From dc3243ae599616613c972d69f68c992918803fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Aug 2023 15:08:49 +0200 Subject: [PATCH 01/49] back cover should not create a page after itself --- themes/V3/5ePHB/snippets/coverpage.gen.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/themes/V3/5ePHB/snippets/coverpage.gen.js b/themes/V3/5ePHB/snippets/coverpage.gen.js index 865269f92..b662aaaa6 100644 --- a/themes/V3/5ePHB/snippets/coverpage.gen.js +++ b/themes/V3/5ePHB/snippets/coverpage.gen.js @@ -149,8 +149,6 @@ module.exports = { ![](/assets/naturalCritLogoWhite.svg) Homebrewery.Naturalcrit.com - }} - - \page`; + }}`; } }; From 4347debf4525c69b65f1480299bc3d9ae8d12086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Aug 2023 15:10:08 +0200 Subject: [PATCH 02/49] unsetting footer should use display property --- themes/V3/5ePHB/style.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index c6e87c40a..f16dc7d18 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -684,7 +684,7 @@ h5 + table{ columns : 1; text-align : center; &:after { - all: unset; + display: none; } h1 { text-shadow: unset; @@ -828,7 +828,7 @@ h5 + table{ columns: 1; padding: 2.25cm 1.3cm 2cm 1.3cm; &:after { - all: unset; + display: none; } .columnWrapper { width: 7.6cm; From a889fa657ec0d0ec99916553d8e4aa102e927860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Aug 2023 15:18:16 +0200 Subject: [PATCH 03/49] display prop again --- themes/V3/5ePHB/style.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index f16dc7d18..1f998b63b 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -780,7 +780,7 @@ h5 + table{ columns : 1; text-align : center; &:after { - all : unset; + display : none; } h1 { font-family : NodestoCapsCondensed; From 3d5f99adaee814e2235bd5bce0237ef88d1111c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Aug 2023 15:30:33 +0200 Subject: [PATCH 04/49] covers em to cm --- themes/V3/5ePHB/style.less | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 1f998b63b..7c2ccb78c 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -598,7 +598,7 @@ body { // *****************************/ .page .spellList{ .useSansSerif(); - column-count : 2; + column-count : 2; ul+h5{ margin-top : 15px; } @@ -699,7 +699,7 @@ h5 + table{ color : white; font-family : NodestoCapsCondensed; font-size : 2.245cm; - line-height : 0.85em; + line-height : 1.9cm; } h2 { filter : drop-shadow(0 0 1px black) drop-shadow(0 0 0 black) @@ -783,13 +783,13 @@ h5 + table{ display : none; } h1 { - font-family : NodestoCapsCondensed; - font-weight : normal; - font-size : 2.1cm; - margin-top : 1.2cm; + font-family : NodestoCapsCondensed; + font-weight : normal; + font-size : 2.1cm; + margin-top : 1.2cm; margin-bottom : 0; text-transform : uppercase; - line-height : 0.85em; + line-height : 1.785cm; } h2 { font-family : NodestoCapsCondensed; @@ -848,7 +848,7 @@ h5 + table{ h1 { margin-bottom: .3cm; font-size: 1.35cm; - line-height: 0.95em; + line-height: 1.28cm; font-family: NodestoCapsCondensed; text-align: center; color: #ED1C24; @@ -876,8 +876,8 @@ h5 + table{ } p { font-family: Overpass; - line-height: 1.5em; font-size: 0.332cm; + line-height: 0.5cm; } hr+p { text-align: center; @@ -901,8 +901,8 @@ h5 + table{ color: #fff; font-family: NodestoCapsWide; font-size: .4cm; - letter-spacing: 0.08em; - line-height: 1em; + letter-spacing: 0.036cm; + line-height: .4cm; text-align: center; text-indent: 0; width: 100%; @@ -942,8 +942,8 @@ h5 + table{ font-family: Overpass; font-size: 0.45cm; position: relative; - margin-top: -0.7em; - line-height: 1.1em; + margin-top: -0.315cm; + line-height: 0.495cm; margin-left : auto; margin-right : auto; } From 70657c16d1a573b07342c2f828539879fb90232f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 19:30:29 +0000 Subject: [PATCH 05/49] Bump classnames from 2.3.2 to 2.5.1 Bumps [classnames](https://github.com/JedWatson/classnames) from 2.3.2 to 2.5.1. - [Changelog](https://github.com/JedWatson/classnames/blob/main/HISTORY.md) - [Commits](https://github.com/JedWatson/classnames/compare/v2.3.2...v2.5.1) --- updated-dependencies: - dependency-name: classnames dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1fdb4a873..02da537ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@babel/preset-react": "^7.23.3", "@googleapis/drive": "^8.6.0", "body-parser": "^1.20.2", - "classnames": "^2.3.2", + "classnames": "^2.5.1", "codemirror": "^5.65.6", "cookie-parser": "^1.4.6", "create-react-class": "^15.7.0", @@ -4530,9 +4530,9 @@ } }, "node_modules/classnames": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", - "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" }, "node_modules/cliui": { "version": "8.0.1", diff --git a/package.json b/package.json index 74666f461..0c28fbe81 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "@babel/preset-react": "^7.23.3", "@googleapis/drive": "^8.6.0", "body-parser": "^1.20.2", - "classnames": "^2.3.2", + "classnames": "^2.5.1", "codemirror": "^5.65.6", "cookie-parser": "^1.4.6", "create-react-class": "^15.7.0", From beaf67c97538020057ed57f6b49eca03f4383faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 6 Mar 2024 19:30:23 +0100 Subject: [PATCH 06/49] initial commit --- client/homebrew/brewRenderer/brewRenderer.less | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/homebrew/brewRenderer/brewRenderer.less b/client/homebrew/brewRenderer/brewRenderer.less index 17aa146fb..d0551747c 100644 --- a/client/homebrew/brewRenderer/brewRenderer.less +++ b/client/homebrew/brewRenderer/brewRenderer.less @@ -14,6 +14,19 @@ box-shadow : 1px 4px 14px #000000; } } + + &::-webkit-scrollbar { + width: 20px; + z-index: 2; + + } + + &::-webkit-scrollbar-thumb { + width:20px; + background-color: #d3c1af; + border-right: 7px solid #2C3E50; + } + } .pane { position : relative; } .pageInfo { From 54d881642d72a4a84c8dabb86aaee842c0b1928f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 8 Mar 2024 10:09:29 +0100 Subject: [PATCH 07/49] listpage, editor --- .../homebrew/brewRenderer/brewRenderer.less | 4 +--- client/homebrew/homebrew.less | 11 +++++++++++ shared/naturalcrit/codeEditor/codeEditor.less | 19 ++++++++++++++++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.less b/client/homebrew/brewRenderer/brewRenderer.less index d0551747c..ee66945f4 100644 --- a/client/homebrew/brewRenderer/brewRenderer.less +++ b/client/homebrew/brewRenderer/brewRenderer.less @@ -17,14 +17,12 @@ &::-webkit-scrollbar { width: 20px; - z-index: 2; } &::-webkit-scrollbar-thumb { width:20px; - background-color: #d3c1af; - border-right: 7px solid #2C3E50; + background: linear-gradient(90deg, #d3c1af 15px, #00000000 15px); } } diff --git a/client/homebrew/homebrew.less b/client/homebrew/homebrew.less index f4834a25c..4e282ecaf 100644 --- a/client/homebrew/homebrew.less +++ b/client/homebrew/homebrew.less @@ -15,6 +15,17 @@ } &.listPage .content { overflow-y : scroll; + + &::-webkit-scrollbar { + width: 20px; + z-index: 2; + + } + + &::-webkit-scrollbar-thumb { + width:20px; + background: linear-gradient(90deg, #d3c1af 15px, #00000000 15px); + } } } } \ No newline at end of file diff --git a/shared/naturalcrit/codeEditor/codeEditor.less b/shared/naturalcrit/codeEditor/codeEditor.less index 80af543d9..2568d0725 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.less +++ b/shared/naturalcrit/codeEditor/codeEditor.less @@ -17,13 +17,30 @@ text-shadow: none; font-weight: 600; color: grey; -} + } .sourceMoveFlash .CodeMirror-line{ animation-name: sourceMoveAnimation; animation-duration: 0.4s; } + .CodeMirror-sizer { + padding-right: 0 !important; + //this setting must be !important, because CodeMirror sets it inline. Achieves overlay scrollbar + } + + .CodeMirror-vscrollbar { + + &::-webkit-scrollbar { + width: 20px; + } + + &::-webkit-scrollbar-thumb { + width: 20px; + background: linear-gradient(90deg, #85858599 15px, #80808000 15px); + } + } + //.cm-tab { // background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAQAAACOs/baAAAARUlEQVR4nGJgIAG8JkXxUAcCtDWemcGR1lY4MvgzCEKY7jSBjgxBDAG09UEQzAe0AMwMHrSOAwEGRtpaMIwAAAAA//8DAG4ID9EKs6YqAAAAAElFTkSuQmCC) no-repeat right; //} From d0000cee115f75ca8fcd9b0f7c6dc926e8b476b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 8 Mar 2024 10:13:04 +0100 Subject: [PATCH 08/49] linting --- client/homebrew/brewRenderer/brewRenderer.less | 2 -- client/homebrew/homebrew.less | 3 --- shared/naturalcrit/codeEditor/codeEditor.less | 2 -- 3 files changed, 7 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.less b/client/homebrew/brewRenderer/brewRenderer.less index ee66945f4..edc8d503b 100644 --- a/client/homebrew/brewRenderer/brewRenderer.less +++ b/client/homebrew/brewRenderer/brewRenderer.less @@ -17,9 +17,7 @@ &::-webkit-scrollbar { width: 20px; - } - &::-webkit-scrollbar-thumb { width:20px; background: linear-gradient(90deg, #d3c1af 15px, #00000000 15px); diff --git a/client/homebrew/homebrew.less b/client/homebrew/homebrew.less index 4e282ecaf..ed86a8c28 100644 --- a/client/homebrew/homebrew.less +++ b/client/homebrew/homebrew.less @@ -18,10 +18,7 @@ &::-webkit-scrollbar { width: 20px; - z-index: 2; - } - &::-webkit-scrollbar-thumb { width:20px; background: linear-gradient(90deg, #d3c1af 15px, #00000000 15px); diff --git a/shared/naturalcrit/codeEditor/codeEditor.less b/shared/naturalcrit/codeEditor/codeEditor.less index 2568d0725..8ffbcad91 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.less +++ b/shared/naturalcrit/codeEditor/codeEditor.less @@ -30,11 +30,9 @@ } .CodeMirror-vscrollbar { - &::-webkit-scrollbar { width: 20px; } - &::-webkit-scrollbar-thumb { width: 20px; background: linear-gradient(90deg, #85858599 15px, #80808000 15px); From 03f868d084c4d66fb4baa862cacc2cd18311d491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 20 Mar 2024 17:58:10 +0100 Subject: [PATCH 09/49] initial commit --- client/homebrew/pages/errorPage/errors/errorIndex.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 7c7a3ae7f..a7e79e82a 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -75,7 +75,7 @@ const errorIndex = (props)=>{ **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} - **Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'} + **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} [Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`, @@ -88,7 +88,7 @@ const errorIndex = (props)=>{ **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} - **Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'}`, + **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'}`, // Brew load error '05' : dedent` From e02d925a499243e83fea721519725b3a6899e6ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 03:02:53 +0000 Subject: [PATCH 10/49] Bump express from 4.18.3 to 4.19.1 Bumps [express](https://github.com/expressjs/express) from 4.18.3 to 4.19.1. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.3...4.19.1) --- updated-dependencies: - dependency-name: express dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index c14adde12..7bcfecb2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "create-react-class": "^15.7.0", "dedent-tabs": "^0.10.3", "expr-eval": "^2.0.2", - "express": "^4.18.3", + "express": "^4.19.1", "express-async-handler": "^1.2.0", "express-static-gzip": "2.1.7", "fs-extra": "11.2.0", @@ -6184,16 +6184,16 @@ "integrity": "sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg==" }, "node_modules/express": { - "version": "4.18.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.3.tgz", - "integrity": "sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.1.tgz", + "integrity": "sha512-K4w1/Bp7y8iSiVObmCrtq8Cs79XjJc/RU2YYkZQ7wpUu5ZyZ7MtPHkqoMz4pf+mgXfNvo2qft8D9OnrH2ABk9w==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -6238,9 +6238,9 @@ } }, "node_modules/express/node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "engines": { "node": ">= 0.6" } diff --git a/package.json b/package.json index 57b6a4a2f..f7f828471 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "create-react-class": "^15.7.0", "dedent-tabs": "^0.10.3", "expr-eval": "^2.0.2", - "express": "^4.18.3", + "express": "^4.19.1", "express-async-handler": "^1.2.0", "express-static-gzip": "2.1.7", "fs-extra": "11.2.0", From b35739c5c163d54cf005117763a33ad94f35b61e Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Wed, 27 Mar 2024 15:48:34 +1300 Subject: [PATCH 11/49] Change Marked extension priority order --- shared/naturalcrit/markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index a99c1e543..8018bf63b 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -617,7 +617,7 @@ function MarkedVariables() { //^=====--------------------< Variable Handling >-------------------=====^// Marked.use(MarkedVariables()); -Marked.use({ extensions: [mustacheSpans, mustacheDivs, mustacheInjectInline, definitionListsMultiline, definitionListsInline, superSubScripts] }); +Marked.use({ extensions: [definitionListsMultiline, definitionListsInline, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] }); Marked.use(mustacheInjectBlock); Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false }); Marked.use(MarkedExtendedTables(), MarkedGFMHeadingId(), MarkedSmartypantsLite()); From 0ad4cb7cfddb1ad83261f33dc3f4df8e9cfdab9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 13:23:35 +0000 Subject: [PATCH 12/49] Bump express from 4.19.1 to 4.19.2 Bumps [express](https://github.com/expressjs/express) from 4.19.1 to 4.19.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.1...4.19.2) --- updated-dependencies: - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8a9e85b67..bc2d20cf0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "create-react-class": "^15.7.0", "dedent-tabs": "^0.10.3", "expr-eval": "^2.0.2", - "express": "^4.19.1", + "express": "^4.19.2", "express-async-handler": "^1.2.0", "express-static-gzip": "2.1.7", "fs-extra": "11.2.0", @@ -6131,9 +6131,9 @@ "integrity": "sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg==" }, "node_modules/express": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.1.tgz", - "integrity": "sha512-K4w1/Bp7y8iSiVObmCrtq8Cs79XjJc/RU2YYkZQ7wpUu5ZyZ7MtPHkqoMz4pf+mgXfNvo2qft8D9OnrH2ABk9w==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", diff --git a/package.json b/package.json index 6e2f28524..f4865892e 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "create-react-class": "^15.7.0", "dedent-tabs": "^0.10.3", "expr-eval": "^2.0.2", - "express": "^4.19.1", + "express": "^4.19.2", "express-async-handler": "^1.2.0", "express-static-gzip": "2.1.7", "fs-extra": "11.2.0", From ffa01c7f1d682b3d57b0c2fa5c4347abce8fdfaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:01:07 +0000 Subject: [PATCH 13/49] Bump @babel/core from 7.24.0 to 7.24.3 Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.24.0 to 7.24.3. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.24.3/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 101 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 52 insertions(+), 51 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc2d20cf0..f586d03ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.24.0", + "@babel/core": "^7.24.3", "@babel/plugin-transform-runtime": "^7.24.3", "@babel/preset-env": "^7.24.3", "@babel/preset-react": "^7.24.1", @@ -87,12 +87,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -107,19 +107,19 @@ } }, "node_modules/@babel/core": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.0.tgz", - "integrity": "sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.3.tgz", + "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", + "@babel/code-frame": "^7.24.2", + "@babel/generator": "^7.24.1", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.24.0", - "@babel/parser": "^7.24.0", + "@babel/helpers": "^7.24.1", + "@babel/parser": "^7.24.1", "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.0", + "@babel/traverse": "^7.24.1", "@babel/types": "^7.24.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", @@ -141,13 +141,13 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/@babel/generator": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", - "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz", + "integrity": "sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==", "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.24.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { @@ -155,13 +155,13 @@ } }, "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -450,12 +450,12 @@ } }, "node_modules/@babel/helpers": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.0.tgz", - "integrity": "sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.1.tgz", + "integrity": "sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==", "dependencies": { "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.0", + "@babel/traverse": "^7.24.1", "@babel/types": "^7.24.0" }, "engines": { @@ -463,22 +463,23 @@ } }, "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", - "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz", + "integrity": "sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==", "bin": { "parser": "bin/babel-parser.js" }, @@ -1758,17 +1759,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz", - "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz", + "integrity": "sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==", "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", + "@babel/code-frame": "^7.24.1", + "@babel/generator": "^7.24.1", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.24.0", + "@babel/parser": "^7.24.1", "@babel/types": "^7.24.0", "debug": "^4.3.1", "globals": "^11.1.0" @@ -2772,9 +2773,9 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "engines": { "node": ">=6.0.0" } @@ -2785,12 +2786,12 @@ "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@mongodb-js/saslprep": { diff --git a/package.json b/package.json index f4865892e..8c4545027 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ ] }, "dependencies": { - "@babel/core": "^7.24.0", + "@babel/core": "^7.24.3", "@babel/plugin-transform-runtime": "^7.24.3", "@babel/preset-env": "^7.24.3", "@babel/preset-react": "^7.24.1", From 31cf8b7d28042c425accaf4fd8172adef0861121 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Thu, 28 Mar 2024 14:58:05 -0500 Subject: [PATCH 14/49] add browser-readable address and some styling to log. --- server.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index cb58f9bd3..0323fb068 100644 --- a/server.js +++ b/server.js @@ -7,6 +7,13 @@ DB.connect(config).then(()=>{ // before launching server const PORT = process.env.PORT || config.get('web_port') || 8000; server.app.listen(PORT, ()=>{ - console.log(`server on port: ${PORT}`); + const reset = '\x1b[0m'; // Reset to default style + const bright = '\x1b[1m'; // Bright (bold) style + const cyan = '\x1b[36m'; // Cyan color + const underline = '\x1b[4m'; // Underlined style + + console.log(`\n\tserver on port: ${PORT}`); + console.log(`\t${underline}${bright}${cyan}Open in browser: http://localhost:${PORT}${reset}`) + }); }); From 59b3038b9b245a8cfd4ed948b2856937d249689b Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Fri, 29 Mar 2024 20:42:07 -0500 Subject: [PATCH 15/49] small style changes to terminal output of server start --- server.js | 5 +++-- server/googleActions.js | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index 0323fb068..39224bb88 100644 --- a/server.js +++ b/server.js @@ -12,8 +12,9 @@ DB.connect(config).then(()=>{ const cyan = '\x1b[36m'; // Cyan color const underline = '\x1b[4m'; // Underlined style - console.log(`\n\tserver on port: ${PORT}`); - console.log(`\t${underline}${bright}${cyan}Open in browser: http://localhost:${PORT}${reset}`) + console.log(`\n\tserver started at: ${new Date().toLocaleString()}`); + console.log(`\tserver on port: ${PORT}`); + console.log(`\t${bright + cyan}Open in browser: ${reset}${underline + bright + cyan}http://localhost:${PORT}${reset}\n\n`) }); }); diff --git a/server/googleActions.js b/server/googleActions.js index a5ff61d62..16537d603 100644 --- a/server/googleActions.js +++ b/server/googleActions.js @@ -7,7 +7,9 @@ const config = require('./config.js'); let serviceAuth; if(!config.get('service_account')){ - console.log('No Google Service Account in config files - Google Drive integration will not be available.'); + const reset = '\x1b[0m'; // Reset to default style + const yellow = '\x1b[33m'; // yellow color + console.warn(`\n${yellow}No Google Service Account in config files - Google Drive integration will not be available.${reset}`); } else { const keys = typeof(config.get('service_account')) == 'string' ? JSON.parse(config.get('service_account')) : @@ -18,7 +20,7 @@ if(!config.get('service_account')){ serviceAuth.scopes = ['https://www.googleapis.com/auth/drive']; } catch (err) { console.warn(err); - console.log('Please make sure the Google Service Account is set up properly in your config files.'); + console.warn('Please make sure the Google Service Account is set up properly in your config files.'); } } From 45106b47d40fee90b09105ff3912c648e25821b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 2 Apr 2024 13:47:16 +0200 Subject: [PATCH 16/49] Custom scrollbar fixes --- .../homebrew/brewRenderer/brewRenderer.less | 21 +++++++++++++++---- client/homebrew/homebrew.less | 17 +++++++++++---- shared/naturalcrit/codeEditor/codeEditor.less | 7 +------ 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.less b/client/homebrew/brewRenderer/brewRenderer.less index edc8d503b..0406cad29 100644 --- a/client/homebrew/brewRenderer/brewRenderer.less +++ b/client/homebrew/brewRenderer/brewRenderer.less @@ -17,11 +17,24 @@ &::-webkit-scrollbar { width: 20px; + &:horizontal{ + height: 20px; + width:auto; + } + &-thumb { + background: linear-gradient(90deg, #d3c1af 15px, #00000000 15px); + &:horizontal{ + background: linear-gradient(0deg, #d3c1af 15px, #00000000 15px); + } + } + &-corner { + visibility: hidden; + } } - &::-webkit-scrollbar-thumb { - width:20px; - background: linear-gradient(90deg, #d3c1af 15px, #00000000 15px); - } + + + + } .pane { position : relative; } diff --git a/client/homebrew/homebrew.less b/client/homebrew/homebrew.less index ed86a8c28..828de796f 100644 --- a/client/homebrew/homebrew.less +++ b/client/homebrew/homebrew.less @@ -18,10 +18,19 @@ &::-webkit-scrollbar { width: 20px; - } - &::-webkit-scrollbar-thumb { - width:20px; - background: linear-gradient(90deg, #d3c1af 15px, #00000000 15px); + &:horizontal{ + height: 20px; + width:auto; + } + &-thumb { + background: linear-gradient(90deg, #d3c1af 15px, #00000000 15px); + &:horizontal{ + background: linear-gradient(0deg, #d3c1af 15px, #00000000 15px); + } + } + &-corner { + visibility: hidden; + } } } } diff --git a/shared/naturalcrit/codeEditor/codeEditor.less b/shared/naturalcrit/codeEditor/codeEditor.less index 8ffbcad91..2ab08a5af 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.less +++ b/shared/naturalcrit/codeEditor/codeEditor.less @@ -24,18 +24,13 @@ animation-duration: 0.4s; } - .CodeMirror-sizer { - padding-right: 0 !important; - //this setting must be !important, because CodeMirror sets it inline. Achieves overlay scrollbar - } - .CodeMirror-vscrollbar { &::-webkit-scrollbar { width: 20px; } &::-webkit-scrollbar-thumb { width: 20px; - background: linear-gradient(90deg, #85858599 15px, #80808000 15px); + background: linear-gradient(90deg, #858585 15px, #808080 15px); } } From 8a15172db19cdb655bae375a16d88a4ba11f4ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 2 Apr 2024 14:09:53 +0200 Subject: [PATCH 17/49] pull from master and suggested fixes --- client/homebrew/brewRenderer/brewRenderer.jsx | 6 +- .../notificationPopup/notificationPopup.jsx | 4 +- .../homebrew/editor/snippetbar/snippetbar.jsx | 4 +- client/homebrew/navbar/error-navitem.jsx | 10 +- client/homebrew/navbar/newbrew.navitem.jsx | 94 +++++++++---------- .../pages/basePages/listPage/listPage.jsx | 4 +- client/homebrew/pages/printPage/printPage.jsx | 10 +- server/admin.api.js | 2 +- shared/helpers.js | 30 +++--- shared/naturalcrit/codeEditor/codeEditor.jsx | 2 +- themes/V3/5ePHB/snippets/quote.gen.js | 68 +++++++------- .../V3/5ePHB/snippets/tableOfContents.gen.js | 2 +- themes/V3/5ePHB/style.less | 2 +- themes/V3/Blank/snippets.js | 70 +++++++------- 14 files changed, 154 insertions(+), 154 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index ed64c363b..89a75ec79 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -211,11 +211,11 @@ const BrewRenderer = (props)=>{ - + {baseThemePath && - + } - + {/* Apply CSS from Style tab and render pages from Markdown tab */} {state.isMounted diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx index 5a870c108..c08cf4f03 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx @@ -26,8 +26,8 @@ const NotificationPopup = createClass({ <>
  • Don't store IMAGES in Google Drive
    - Google Drive is not an image service, and will block images from being used - in brews if they get more views than expected. Google has confirmed they won't fix + Google Drive is not an image service, and will block images from being used + in brews if they get more views than expected. Google has confirmed they won't fix this, so we recommend you look for another image hosting service such as imgur, ImgBB or Google Photos.
  • diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 75fe0d736..80a97f49e 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -161,7 +161,7 @@ const Snippetbar = createClass({ onClick={this.props.unfoldCode} > - + ; } @@ -181,7 +181,7 @@ const Snippetbar = createClass({ {this.state.themeSelector && this.renderThemeSelector()} - +
    this.props.onViewChange('text')}> diff --git a/client/homebrew/navbar/error-navitem.jsx b/client/homebrew/navbar/error-navitem.jsx index 8551408c5..59e05a253 100644 --- a/client/homebrew/navbar/error-navitem.jsx +++ b/client/homebrew/navbar/error-navitem.jsx @@ -42,7 +42,7 @@ const ErrorNavItem = createClass({
    ; } - + if(status === 412) { return Oops! @@ -51,7 +51,7 @@ const ErrorNavItem = createClass({ ; } - + if(HBErrorCode === '04') { return Oops! @@ -76,10 +76,10 @@ const ErrorNavItem = createClass({ if(response.body?.errors?.[0].reason == 'storageQuotaExceeded') { return Oops! -
    +
    Can't save because your Google Drive seems to be full! -
    - ; +
    +
    ; } if(response.req.url.match(/^\/api.*Google.*$/m)){ diff --git a/client/homebrew/navbar/newbrew.navitem.jsx b/client/homebrew/navbar/newbrew.navitem.jsx index 319ef3392..30d53c675 100644 --- a/client/homebrew/navbar/newbrew.navitem.jsx +++ b/client/homebrew/navbar/newbrew.navitem.jsx @@ -7,58 +7,58 @@ const BREWKEY = 'homebrewery-new'; const STYLEKEY = 'homebrewery-new-style'; const METAKEY = 'homebrewery-new-meta'; -const NewBrew = () => { - const handleFileChange = (e) => { - const file = e.target.files[0]; - if (file) { - const reader = new FileReader(); - reader.onload = (e) => { - const fileContent = e.target.result; - const newBrew = { - text: fileContent, - style: '' - }; - if(fileContent.startsWith('```metadata')) { - splitTextStyleAndMetadata(newBrew); // Modify newBrew directly - localStorage.setItem(BREWKEY, newBrew.text); - localStorage.setItem(STYLEKEY, newBrew.style); - localStorage.setItem(METAKEY, JSON.stringify(_.pick(newBrew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang']))); - window.location.href = '/new'; - } else { - alert('This file is invalid, please, enter a valid file'); - } - }; - reader.readAsText(file); - } - }; +const NewBrew = ()=>{ + const handleFileChange = (e)=>{ + const file = e.target.files[0]; + if(file) { + const reader = new FileReader(); + reader.onload = (e)=>{ + const fileContent = e.target.result; + const newBrew = { + text : fileContent, + style : '' + }; + if(fileContent.startsWith('```metadata')) { + splitTextStyleAndMetadata(newBrew); // Modify newBrew directly + localStorage.setItem(BREWKEY, newBrew.text); + localStorage.setItem(STYLEKEY, newBrew.style); + localStorage.setItem(METAKEY, JSON.stringify(_.pick(newBrew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang']))); + window.location.href = '/new'; + } else { + alert('This file is invalid, please, enter a valid file'); + } + }; + reader.readAsText(file); + } + }; - return ( - - + return ( + + new - - + + from blank - + - { document.getElementById('uploadTxt').click(); }}> - + { document.getElementById('uploadTxt').click(); }}> + from file - - - ); +
    + + ); }; module.exports = NewBrew; diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 0b51609b5..ec557ffb1 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -262,8 +262,8 @@ const ListPage = createClass({ render : function(){ return
    {/**/} - - + + {this.props.navItems} {this.renderSortOptions()} {this.renderTagsOptions()} diff --git a/client/homebrew/pages/printPage/printPage.jsx b/client/homebrew/pages/printPage/printPage.jsx index 9a5a80dbf..29ecbab66 100644 --- a/client/homebrew/pages/printPage/printPage.jsx +++ b/client/homebrew/pages/printPage/printPage.jsx @@ -34,7 +34,7 @@ const PrintPage = createClass({ style : this.props.brew.style || undefined, renderer : this.props.brew.renderer || 'legacy', theme : this.props.brew.theme || '5ePHB', - lang : this.props.brew.lang || 'en' + lang : this.props.brew.lang || 'en' } }; }, @@ -52,7 +52,7 @@ const PrintPage = createClass({ style : styleStorage, renderer : metaStorage?.renderer || 'legacy', theme : metaStorage?.theme || '5ePHB', - lang : metaStorage?.lang || 'en' + lang : metaStorage?.lang || 'en' } }; }); @@ -96,11 +96,11 @@ const PrintPage = createClass({ return
    - + {baseThemePath && - + } - + {/* Apply CSS from Style tab */} {this.renderStyle()}
    diff --git a/server/admin.api.js b/server/admin.api.js index 5363ecc08..fe2def3ce 100644 --- a/server/admin.api.js +++ b/server/admin.api.js @@ -30,7 +30,7 @@ const junkBrewPipeline = [ { $match : { updatedAt : { $lt: Moment().subtract(30, 'days').toDate() }, lastViewed : { $lt: Moment().subtract(30, 'days').toDate() } - }}, + } }, { $project: { textBinSize: { $binarySize: '$textBin' } } }, { $match: { textBinSize: { $lt: 140 } } }, { $limit: 100 } diff --git a/shared/helpers.js b/shared/helpers.js index 5abb93fea..42dd09e3f 100644 --- a/shared/helpers.js +++ b/shared/helpers.js @@ -1,22 +1,22 @@ const _ = require('lodash'); const yaml = require('js-yaml'); -const splitTextStyleAndMetadata = (brew) => { - brew.text = brew.text.replaceAll('\r\n', '\n'); - if (brew.text.startsWith('```metadata')) { - const index = brew.text.indexOf('```\n\n'); - const metadataSection = brew.text.slice(12, index - 1); - const metadata = yaml.load(metadataSection); - Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang'])); - brew.text = brew.text.slice(index + 5); - } - if (brew.text.startsWith('```css')) { - const index = brew.text.indexOf('```\n\n'); - brew.style = brew.text.slice(7, index - 1); - brew.text = brew.text.slice(index + 5); - } +const splitTextStyleAndMetadata = (brew)=>{ + brew.text = brew.text.replaceAll('\r\n', '\n'); + if(brew.text.startsWith('```metadata')) { + const index = brew.text.indexOf('```\n\n'); + const metadataSection = brew.text.slice(12, index - 1); + const metadata = yaml.load(metadataSection); + Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang'])); + brew.text = brew.text.slice(index + 5); + } + if(brew.text.startsWith('```css')) { + const index = brew.text.indexOf('```\n\n'); + brew.style = brew.text.slice(7, index - 1); + brew.text = brew.text.slice(index + 5); + } }; module.exports = { - splitTextStyleAndMetadata + splitTextStyleAndMetadata }; diff --git a/shared/naturalcrit/codeEditor/codeEditor.jsx b/shared/naturalcrit/codeEditor/codeEditor.jsx index a5232a42b..486408332 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.jsx +++ b/shared/naturalcrit/codeEditor/codeEditor.jsx @@ -436,7 +436,7 @@ const CodeEditor = createClass({ render : function(){ return <> - +
    ; } diff --git a/themes/V3/5ePHB/snippets/quote.gen.js b/themes/V3/5ePHB/snippets/quote.gen.js index c5e3d6293..c2a233255 100644 --- a/themes/V3/5ePHB/snippets/quote.gen.js +++ b/themes/V3/5ePHB/snippets/quote.gen.js @@ -1,47 +1,47 @@ -const _ = require("lodash"); +const _ = require('lodash'); const quotes = [ - "The sword glinted in the dim light, its edges keen and deadly. As the adventurer reached for it, he couldn't help but feel a surge of excitement mixed with fear. This was no ordinary blade.", - "The dragon's roar shook the ground beneath their feet, and the brave knight stood tall, his sword at the ready. He knew that this would be the battle of his life, but he was determined to emerge victorious.", - "The wizard's laboratory was a sight to behold, filled with bubbling cauldrons, ancient tomes, and strange artifacts from distant lands. As the apprentice gazed around in wonder, she knew that she was about to embark on a journey unlike any other.", - "The tavern was packed with rowdy patrons, their voices raised in song and laughter. The bard took center stage, strumming his lute and launching into a tale of adventure and heroism that had the crowd hanging on his every word.", - "The thief crept through the shadows, his eyes scanning the room for any sign of danger. He knew that one false move could mean the difference between success and failure, and he was determined to come out on top.", - "The elf queen stood atop her castle walls, surveying the kingdom below with a mix of pride and sadness. She knew that the coming war would be brutal, but she was determined to protect her people at all costs.", - "The necromancer's tower loomed in the distance, its dark spires piercing the sky. As the adventurers approached, they could feel the chill of death emanating from within", - "The ranger moved through the forest like a shadow, his senses attuned to every sound and movement around him. He knew that danger lurked behind every tree, but he was ready for whatever came his way.", - "The paladin knelt before the altar, his hands clasped in prayer. He knew that his faith would be tested in the days ahead, but he was ready to face whatever trials lay in store for him.", - "The druid communed with the spirits of nature, his mind merging with the trees, the animals, and the very earth itself. He knew that his power came with a great responsibility, and he was determined to use it for the greater good.", + 'The sword glinted in the dim light, its edges keen and deadly. As the adventurer reached for it, he couldn\'t help but feel a surge of excitement mixed with fear. This was no ordinary blade.', + 'The dragon\'s roar shook the ground beneath their feet, and the brave knight stood tall, his sword at the ready. He knew that this would be the battle of his life, but he was determined to emerge victorious.', + 'The wizard\'s laboratory was a sight to behold, filled with bubbling cauldrons, ancient tomes, and strange artifacts from distant lands. As the apprentice gazed around in wonder, she knew that she was about to embark on a journey unlike any other.', + 'The tavern was packed with rowdy patrons, their voices raised in song and laughter. The bard took center stage, strumming his lute and launching into a tale of adventure and heroism that had the crowd hanging on his every word.', + 'The thief crept through the shadows, his eyes scanning the room for any sign of danger. He knew that one false move could mean the difference between success and failure, and he was determined to come out on top.', + 'The elf queen stood atop her castle walls, surveying the kingdom below with a mix of pride and sadness. She knew that the coming war would be brutal, but she was determined to protect her people at all costs.', + 'The necromancer\'s tower loomed in the distance, its dark spires piercing the sky. As the adventurers approached, they could feel the chill of death emanating from within', + 'The ranger moved through the forest like a shadow, his senses attuned to every sound and movement around him. He knew that danger lurked behind every tree, but he was ready for whatever came his way.', + 'The paladin knelt before the altar, his hands clasped in prayer. He knew that his faith would be tested in the days ahead, but he was ready to face whatever trials lay in store for him.', + 'The druid communed with the spirits of nature, his mind merging with the trees, the animals, and the very earth itself. He knew that his power came with a great responsibility, and he was determined to use it for the greater good.', ]; const authors = [ - "Unknown", - "James Wyatt", - "Eolande Blackwood", - "Ragnar Ironheart", - "Lyra Nightshade", - "Valtorius Darkstar", - "Isadora Fireheart", - "Theron Shadowbane", - "Lirien Starweaver", - "Drogathar Bonecrusher", - "Kaelen Frostblade", + 'Unknown', + 'James Wyatt', + 'Eolande Blackwood', + 'Ragnar Ironheart', + 'Lyra Nightshade', + 'Valtorius Darkstar', + 'Isadora Fireheart', + 'Theron Shadowbane', + 'Lirien Starweaver', + 'Drogathar Bonecrusher', + 'Kaelen Frostblade', ]; const books = [ - "The Blade of Destiny", - "Dragonfire and Steel", - "The Bard's Tale", - "Darkness Rising", - "The Sacred Quest", - "Shadows in the Forest", - "The Starweaver Chronicles", - "Beneath the Bones", - "Moonlit Magic", - "Frost and Fury", + 'The Blade of Destiny', + 'Dragonfire and Steel', + 'The Bard\'s Tale', + 'Darkness Rising', + 'The Sacred Quest', + 'Shadows in the Forest', + 'The Starweaver Chronicles', + 'Beneath the Bones', + 'Moonlit Magic', + 'Frost and Fury', ]; -module.exports = () => { - return ` +module.exports = ()=>{ + return ` {{quote ${_.sample(quotes)} diff --git a/themes/V3/5ePHB/snippets/tableOfContents.gen.js b/themes/V3/5ePHB/snippets/tableOfContents.gen.js index 03f90d5fa..04ff77f3f 100644 --- a/themes/V3/5ePHB/snippets/tableOfContents.gen.js +++ b/themes/V3/5ePHB/snippets/tableOfContents.gen.js @@ -29,7 +29,7 @@ const getTOC = (pages)=>{ const res = []; _.each(pages, (page, pageNum)=>{ - if(!page.includes("{{frontCover}}") && !page.includes("{{insideCover}}") && !page.includes("{{partCover}}") && !page.includes("{{backCover}}")) { + if(!page.includes('{{frontCover}}') && !page.includes('{{insideCover}}') && !page.includes('{{partCover}}') && !page.includes('{{backCover}}')) { const lines = page.split('\n'); _.each(lines, (line)=>{ if(_.startsWith(line, '# ')){ diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index b37516ec0..f01a3c7e3 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -718,7 +718,7 @@ p { font-family: 'Overpass'; font-size: 0.332cm; - line-height: 0.5cm; + line-height: 0.35cm; } hr + p { margin-top : 0.6cm; diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index 122666055..2dcf49b3e 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -307,8 +307,8 @@ module.exports = [ /**************** FONTS *************/ { groupName : 'Fonts', - icon : 'fas fa-keyboard', - view : 'text', + icon : 'fas fa-keyboard', + view : 'text', snippets : [ { name : 'Open Sans', @@ -341,59 +341,59 @@ module.exports = [ gen : dedent`{{font-family:MrEavesRemake Dummy Text}}` }, { - name: 'Solbera Imitation Remake', - icon: 'font SolberaImitationRemake', - gen: dedent`{{font-family:SolberaImitationRemake Dummy Text}}` + name : 'Solbera Imitation Remake', + icon : 'font SolberaImitationRemake', + gen : dedent`{{font-family:SolberaImitationRemake Dummy Text}}` }, { - name: 'Scaly Sans Small Caps Remake', - icon: 'font ScalySansSmallCapsRemake', - gen: dedent`{{font-family:ScalySansSmallCapsRemake Dummy Text}}` + name : 'Scaly Sans Small Caps Remake', + icon : 'font ScalySansSmallCapsRemake', + gen : dedent`{{font-family:ScalySansSmallCapsRemake Dummy Text}}` }, { - name: 'Walter Turncoat', - icon: 'font WalterTurncoat', - gen: dedent`{{font-family:WalterTurncoat Dummy Text}}` + name : 'Walter Turncoat', + icon : 'font WalterTurncoat', + gen : dedent`{{font-family:WalterTurncoat Dummy Text}}` }, { - name: 'Lato', - icon: 'font Lato', - gen: dedent`{{font-family:Lato Dummy Text}}` + name : 'Lato', + icon : 'font Lato', + gen : dedent`{{font-family:Lato Dummy Text}}` }, { - name: 'Courier', - icon: 'font Courier', - gen: dedent`{{font-family:Courier Dummy Text}}` + name : 'Courier', + icon : 'font Courier', + gen : dedent`{{font-family:Courier Dummy Text}}` }, { - name: 'Nodesto Caps Condensed', - icon: 'font NodestoCapsCondensed', - gen: dedent`{{font-family:NodestoCapsCondensed Dummy Text}}` + name : 'Nodesto Caps Condensed', + icon : 'font NodestoCapsCondensed', + gen : dedent`{{font-family:NodestoCapsCondensed Dummy Text}}` }, { - name: 'Overpass', - icon: 'font Overpass', - gen: dedent`{{font-family:Overpass Dummy Text}}` + name : 'Overpass', + icon : 'font Overpass', + gen : dedent`{{font-family:Overpass Dummy Text}}` }, { - name: 'Davek', - icon: 'font Davek', - gen: dedent`{{font-family:Davek Dummy Text}}` + name : 'Davek', + icon : 'font Davek', + gen : dedent`{{font-family:Davek Dummy Text}}` }, { - name: 'Iokharic', - icon: 'font Iokharic', - gen: dedent`{{font-family:Iokharic Dummy Text}}` + name : 'Iokharic', + icon : 'font Iokharic', + gen : dedent`{{font-family:Iokharic Dummy Text}}` }, { - name: 'Rellanic', - icon: 'font Rellanic', - gen: dedent`{{font-family:Rellanic Dummy Text}}` + name : 'Rellanic', + icon : 'font Rellanic', + gen : dedent`{{font-family:Rellanic Dummy Text}}` }, { - name: 'Times New Roman', - icon: 'font TimesNewRoman', - gen: dedent`{{font-family:"Times New Roman" Dummy Text}}` + name : 'Times New Roman', + icon : 'font TimesNewRoman', + gen : dedent`{{font-family:"Times New Roman" Dummy Text}}` } ] }, From 85a00b508b26cb07fc40201167c2ecafaca3179b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 2 Apr 2024 14:47:03 +0200 Subject: [PATCH 18/49] automatic linting --- themes/V3/5ePHB/style.less | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index f01a3c7e3..37327fb19 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -532,16 +532,14 @@ .page:has(.frontCover) { columns : 1; text-align : center; - &:after { - display: none; - } + &::after { display : none; } h1 { margin-top : 1.2cm; margin-bottom : 0; font-family : 'NodestoCapsCondensed'; font-size : 2.245cm; - line-height : 1.9cm; font-weight : normal; + line-height : 1.9cm; color : white; text-shadow : unset; text-transform : uppercase; @@ -628,9 +626,7 @@ .page:has(.insideCover) { columns : 1; text-align : center; - &:after { - display : none; - } + &::after { display : none; } h1 { margin-top : 1.2cm; margin-bottom : 0; @@ -674,9 +670,9 @@ // *****************************/ .page:has(.backCover) { padding : 2.25cm 1.3cm 2cm 1.3cm; - color : #fff; + color : #FFFFFF; columns : 1; - &::after { display: none; } + &::after { display : none; } .columnWrapper { width : 7.6cm; } .backCover { position : absolute; @@ -692,7 +688,7 @@ margin-bottom : 0.3cm; font-family : 'NodestoCapsCondensed'; font-size : 1.35cm; - line-height: 1.28cm; + line-height : 1.28cm; color : #ED1C24; text-align : center; } @@ -716,9 +712,9 @@ border : none; } p { - font-family: 'Overpass'; - font-size: 0.332cm; - line-height: 0.35cm; + font-family : 'Overpass'; + font-size : 0.332cm; + line-height : 0.35cm; } hr + p { margin-top : 0.6cm; @@ -743,10 +739,10 @@ font-family : 'NodestoCapsWide'; font-size : 0.4cm; line-height : 1em; + line-height : 1.28cm; color : #FFFFFF; text-align : center; text-indent : 0; - line-height : 1.28cm; } } } From 7954ae8692107abfe3bb5bd3893287266828612a Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Wed, 3 Apr 2024 12:57:24 -0500 Subject: [PATCH 19/49] set a min-width on icons, reduce font sizes --- client/homebrew/editor/snippetbar/snippetbar.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index be6ebe11a..e0a24fac9 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -130,6 +130,8 @@ height : 1.2em; margin-right : 8px; font-size : 1.2em; + min-width: 25px; + text-align: center; & ~ i { margin-right : 0; margin-left : 5px; @@ -138,7 +140,7 @@ &.font { height : auto; &::before { - font-size : 1.4em; + font-size : 1em; content : 'ABC'; } From e324de8f4f1876c514ff30858b10f611b25ec496 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Wed, 3 Apr 2024 14:09:07 -0500 Subject: [PATCH 20/49] remove 'remake' from font names --- themes/V3/Blank/snippets.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index 122666055..272368665 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -326,27 +326,27 @@ module.exports = [ gen : dedent`{{font-family:CodeLight Dummy Text}}` }, { - name : 'Scaly Sans Remake', + name : 'Scaly Sans', icon : 'font ScalySansRemake', gen : dedent`{{font-family:ScalySansRemake Dummy Text}}` }, { - name : 'Book Insanity Remake', + name : 'Book Insanity', icon : 'font BookInsanityRemake', gen : dedent`{{font-family:BookInsanityRemake Dummy Text}}` }, { - name : 'Mr Eaves Remake', + name : 'Mr Eaves', icon : 'font MrEavesRemake', gen : dedent`{{font-family:MrEavesRemake Dummy Text}}` }, { - name: 'Solbera Imitation Remake', + name: 'Solbera Imitation', icon: 'font SolberaImitationRemake', gen: dedent`{{font-family:SolberaImitationRemake Dummy Text}}` }, { - name: 'Scaly Sans Small Caps Remake', + name: 'Scaly Sans Small Caps', icon: 'font ScalySansSmallCapsRemake', gen: dedent`{{font-family:ScalySansSmallCapsRemake Dummy Text}}` }, From 4bc76a0766fa9b85dca7404b3133e9e749dba07c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 03:12:37 +0000 Subject: [PATCH 21/49] Bump @babel/core from 7.24.3 to 7.24.4 Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.24.3 to 7.24.4. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.24.4/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 32 ++++++++++++++++---------------- package.json | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index e2e0ca109..530b46d4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.24.3", + "@babel/core": "^7.24.4", "@babel/plugin-transform-runtime": "^7.24.3", "@babel/preset-env": "^7.24.3", "@babel/preset-react": "^7.24.1", @@ -107,17 +107,17 @@ } }, "node_modules/@babel/core": { - "version": "7.24.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.3.tgz", - "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.4.tgz", + "integrity": "sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg==", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.2", - "@babel/generator": "^7.24.1", + "@babel/generator": "^7.24.4", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.24.1", - "@babel/parser": "^7.24.1", + "@babel/helpers": "^7.24.4", + "@babel/parser": "^7.24.4", "@babel/template": "^7.24.0", "@babel/traverse": "^7.24.1", "@babel/types": "^7.24.0", @@ -141,9 +141,9 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/@babel/generator": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz", - "integrity": "sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.4.tgz", + "integrity": "sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==", "dependencies": { "@babel/types": "^7.24.0", "@jridgewell/gen-mapping": "^0.3.5", @@ -450,9 +450,9 @@ } }, "node_modules/@babel/helpers": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.1.tgz", - "integrity": "sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.4.tgz", + "integrity": "sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==", "dependencies": { "@babel/template": "^7.24.0", "@babel/traverse": "^7.24.1", @@ -477,9 +477,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz", - "integrity": "sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.4.tgz", + "integrity": "sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==", "bin": { "parser": "bin/babel-parser.js" }, diff --git a/package.json b/package.json index 2bdaaabf3..f3b01f3f9 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ ] }, "dependencies": { - "@babel/core": "^7.24.3", + "@babel/core": "^7.24.4", "@babel/plugin-transform-runtime": "^7.24.3", "@babel/preset-env": "^7.24.3", "@babel/preset-react": "^7.24.1", From 3b2a48eabf5613bf3d80502b3941748a4b296605 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Wed, 3 Apr 2024 22:52:16 -0500 Subject: [PATCH 22/49] remove `+ 1` from editor height --- client/homebrew/editor/editor.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index a9efdb245..7cc800b78 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -81,7 +81,7 @@ const Editor = createClass({ updateEditorSize : function() { if(this.refs.codeEditor) { let paneHeight = this.refs.main.parentNode.clientHeight; - paneHeight -= SNIPPETBAR_HEIGHT + 1; + paneHeight -= SNIPPETBAR_HEIGHT; this.refs.codeEditor.codeMirror.setSize(null, paneHeight); } }, From beb86c1820f7ee8bb6bfde6997319de5f6cf1d63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 17:42:44 +0000 Subject: [PATCH 23/49] Bump @babel/preset-env from 7.24.3 to 7.24.4 Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.24.3 to 7.24.4. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.24.4/packages/babel-preset-env) --- updated-dependencies: - dependency-name: "@babel/preset-env" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 56 ++++++++++++++++++++++++++++++----------------- package.json | 2 +- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 530b46d4c..b506327c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "dependencies": { "@babel/core": "^7.24.4", "@babel/plugin-transform-runtime": "^7.24.3", - "@babel/preset-env": "^7.24.3", + "@babel/preset-env": "^7.24.4", "@babel/preset-react": "^7.24.1", "@googleapis/drive": "^8.7.0", "body-parser": "^1.20.2", @@ -99,9 +99,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.1.tgz", - "integrity": "sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.4.tgz", + "integrity": "sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ==", "engines": { "node": ">=6.9.0" } @@ -205,9 +205,9 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.1.tgz", - "integrity": "sha512-1yJa9dX9g//V6fDebXoEfEsxkZHk3Hcbm+zLhyu6qVgYFLvmTALTeV+jNU9e5RnYtioBrGEOdoI2joMSNQ/+aA==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.4.tgz", + "integrity": "sha512-lG75yeuUSVu0pIcbhiYMXBXANHrpUPaOfu7ryAzskCgKUHuAxRQI5ssrtmF0X9UXldPlvT0XM/A4F44OXRt6iQ==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-environment-visitor": "^7.22.20", @@ -487,6 +487,21 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.4.tgz", + "integrity": "sha512-qpl6vOOEEzTLLcsuqYYo8yDtrTocmu2xkGvgNebvPjT9DTtfFYGmgDqY+rBYXNlqL4s9qLDn6xkrJv4RxAPiTA==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-plugin-utils": "^7.24.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { "version": "7.24.1", "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.1.tgz", @@ -863,9 +878,9 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.1.tgz", - "integrity": "sha512-h71T2QQvDgM2SmT29UYU6ozjMlAt7s7CSs5Hvy8f8cf/GM/Z4a2zMfN+fjVGaieeCrXR3EdQl6C4gQG+OgmbKw==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.4.tgz", + "integrity": "sha512-nIFUZIpGKDf9O9ttyRXpHFpKC+X3Y5mtshZONuEUYBomAKoM4y029Jr+uB1bHGPhNmK8YXHevDtKDOLmtRrp6g==", "dependencies": { "@babel/helper-plugin-utils": "^7.24.0" }, @@ -892,11 +907,11 @@ } }, "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.1.tgz", - "integrity": "sha512-FUHlKCn6J3ERiu8Dv+4eoz7w8+kFLSyeVG4vDAikwADGjUCoHw/JHokyGtr8OR4UjpwPVivyF+h8Q5iv/JmrtA==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.4.tgz", + "integrity": "sha512-B8q7Pz870Hz/q9UgP8InNpY01CSLDSCyqX7zcRuv3FcPl87A2G17lASroHWaCtbdIcbYzOZ7kWmXFKbijMSmFg==", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.1", + "@babel/helper-create-class-features-plugin": "^7.24.4", "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-class-static-block": "^7.14.5" }, @@ -1605,14 +1620,15 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.24.3", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.3.tgz", - "integrity": "sha512-fSk430k5c2ff8536JcPvPWK4tZDwehWLGlBp0wrsBUjZVdeQV6lePbwKWZaZfK2vnh/1kQX1PzAJWsnBmVgGJA==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.4.tgz", + "integrity": "sha512-7Kl6cSmYkak0FK/FXjSEnLJ1N9T/WA2RkMhu17gZ/dsxKJUuTYNIylahPTzqpLyJN4WhDif8X0XK1R8Wsguo/A==", "dependencies": { - "@babel/compat-data": "^7.24.1", + "@babel/compat-data": "^7.24.4", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-validator-option": "^7.23.5", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.24.4", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.24.1", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.1", "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.24.1", @@ -1639,9 +1655,9 @@ "@babel/plugin-transform-async-generator-functions": "^7.24.3", "@babel/plugin-transform-async-to-generator": "^7.24.1", "@babel/plugin-transform-block-scoped-functions": "^7.24.1", - "@babel/plugin-transform-block-scoping": "^7.24.1", + "@babel/plugin-transform-block-scoping": "^7.24.4", "@babel/plugin-transform-class-properties": "^7.24.1", - "@babel/plugin-transform-class-static-block": "^7.24.1", + "@babel/plugin-transform-class-static-block": "^7.24.4", "@babel/plugin-transform-classes": "^7.24.1", "@babel/plugin-transform-computed-properties": "^7.24.1", "@babel/plugin-transform-destructuring": "^7.24.1", diff --git a/package.json b/package.json index f3b01f3f9..14fcc341a 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "dependencies": { "@babel/core": "^7.24.4", "@babel/plugin-transform-runtime": "^7.24.3", - "@babel/preset-env": "^7.24.3", + "@babel/preset-env": "^7.24.4", "@babel/preset-react": "^7.24.1", "@googleapis/drive": "^8.7.0", "body-parser": "^1.20.2", From d51d7efdcf1a3181a96755f8f503a9c5a50380f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 17:47:06 +0000 Subject: [PATCH 24/49] Bump mongoose from 8.2.3 to 8.3.0 Bumps [mongoose](https://github.com/Automattic/mongoose) from 8.2.3 to 8.3.0. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md) - [Commits](https://github.com/Automattic/mongoose/compare/8.2.3...8.3.0) --- updated-dependencies: - dependency-name: mongoose dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 42 +++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index b506327c8..8cb32640d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.2.3", + "mongoose": "^8.3.0", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.2.0", @@ -2811,9 +2811,9 @@ } }, "node_modules/@mongodb-js/saslprep": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.4.tgz", - "integrity": "sha512-8zJ8N1x51xo9hwPh6AWnKdLGEC5N3lDa6kms1YHmFBoRhTpJR6HG8wWk0td1MVCu9cD4YBrvjZEtd5Obw0Fbnw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.5.tgz", + "integrity": "sha512-XLNOMH66KhJzUJNwT/qlMnS4WsNDWD5ASdyaSH3EtK+F4r/CFGa3jT4GNi4mfOitGvWXtdLgQJkQjxSVrio+jA==", "dependencies": { "sparse-bitfield": "^3.0.3" } @@ -4323,9 +4323,9 @@ } }, "node_modules/bson": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz", - "integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.6.0.tgz", + "integrity": "sha512-BVINv2SgcMjL4oYbBuCQTpE3/VKOSxrOA8Cj/wQP7izSzlBGVomdm+TcUd0Pzy0ytLSSDweCKQ6X3f5veM5LQA==", "engines": { "node": ">=16.20.1" } @@ -9836,9 +9836,9 @@ } }, "node_modules/kareem": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", - "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.0.tgz", + "integrity": "sha512-B9wwgyKKKZkxYZXQzefvb/Ykh9eHixxR+ttTP2c/Pq8NvHi1iYIAImf3nj/DXkPcnenjGEffhPWXnCFRIbNAhw==", "engines": { "node": ">=12.0.0" } @@ -10545,13 +10545,13 @@ } }, "node_modules/mongoose": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.2.3.tgz", - "integrity": "sha512-ZB8K8AgbVgLCcqjtmZMxaQBEztwEEZCtAIPMx2Q56Uo4WWKmwf5Nu/EEIFo8d/17P946X0z6xzxwIqCxUMKxrA==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.3.0.tgz", + "integrity": "sha512-Y5QNnuA38CEin8hnA+q//nUVztIi4Xklu9xlmbkd1KdWHnIlemSwf5IL/evcI+e2zplL4g5Y6PMkO+nPSAnIdA==", "dependencies": { - "bson": "^6.2.0", - "kareem": "2.5.1", - "mongodb": "6.3.0", + "bson": "^6.5.0", + "kareem": "2.6.0", + "mongodb": "6.5.0", "mpath": "0.9.0", "mquery": "5.0.0", "ms": "2.1.3", @@ -10623,12 +10623,12 @@ } }, "node_modules/mongoose/node_modules/mongodb": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.3.0.tgz", - "integrity": "sha512-tt0KuGjGtLUhLoU263+xvQmPHEGTw5LbcNC73EoFRYgSHwZt5tsoJC110hDyO1kjQzpgNrpdcSza9PknWN4LrA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.5.0.tgz", + "integrity": "sha512-Fozq68InT+JKABGLqctgtb8P56pRrJFkbhW0ux+x1mdHeyinor8oNzJqwLjV/t5X5nJGfTlluxfyMnOXNggIUA==", "dependencies": { - "@mongodb-js/saslprep": "^1.1.0", - "bson": "^6.2.0", + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.4.0", "mongodb-connection-string-url": "^3.0.0" }, "engines": { diff --git a/package.json b/package.json index 14fcc341a..57569791a 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.2.3", + "mongoose": "^8.3.0", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.2.0", From d0fbca7af50d14cd5ada194f4251295f2bdc7728 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 4 Apr 2024 17:36:06 -0400 Subject: [PATCH 25/49] Undo linting on unrelated files. --- client/homebrew/brewRenderer/brewRenderer.jsx | 6 +- .../notificationPopup/notificationPopup.jsx | 4 +- .../homebrew/editor/snippetbar/snippetbar.jsx | 4 +- client/homebrew/navbar/error-navitem.jsx | 10 +- client/homebrew/navbar/newbrew.navitem.jsx | 94 +++++++++---------- .../pages/basePages/listPage/listPage.jsx | 4 +- client/homebrew/pages/printPage/printPage.jsx | 10 +- server/admin.api.js | 2 +- shared/helpers.js | 30 +++--- shared/naturalcrit/codeEditor/codeEditor.jsx | 2 +- themes/V3/5ePHB/snippets/quote.gen.js | 68 +++++++------- themes/V3/Blank/snippets.js | 76 +++++++-------- 12 files changed, 155 insertions(+), 155 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 89a75ec79..ed64c363b 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -211,11 +211,11 @@ const BrewRenderer = (props)=>{
    - + {baseThemePath && - + } - + {/* Apply CSS from Style tab and render pages from Markdown tab */} {state.isMounted diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx index c08cf4f03..5a870c108 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx @@ -26,8 +26,8 @@ const NotificationPopup = createClass({ <>
  • Don't store IMAGES in Google Drive
    - Google Drive is not an image service, and will block images from being used - in brews if they get more views than expected. Google has confirmed they won't fix + Google Drive is not an image service, and will block images from being used + in brews if they get more views than expected. Google has confirmed they won't fix this, so we recommend you look for another image hosting service such as imgur, ImgBB or Google Photos.
  • diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 80a97f49e..75fe0d736 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -161,7 +161,7 @@ const Snippetbar = createClass({ onClick={this.props.unfoldCode} >
    - ; + } @@ -181,7 +181,7 @@ const Snippetbar = createClass({ {this.state.themeSelector && this.renderThemeSelector()}
    - +
    this.props.onViewChange('text')}> diff --git a/client/homebrew/navbar/error-navitem.jsx b/client/homebrew/navbar/error-navitem.jsx index 59e05a253..8551408c5 100644 --- a/client/homebrew/navbar/error-navitem.jsx +++ b/client/homebrew/navbar/error-navitem.jsx @@ -42,7 +42,7 @@ const ErrorNavItem = createClass({
    ; } - + if(status === 412) { return Oops! @@ -51,7 +51,7 @@ const ErrorNavItem = createClass({
    ; } - + if(HBErrorCode === '04') { return Oops! @@ -76,10 +76,10 @@ const ErrorNavItem = createClass({ if(response.body?.errors?.[0].reason == 'storageQuotaExceeded') { return Oops! -
    +
    Can't save because your Google Drive seems to be full! -
    - ; +
    +
    ; } if(response.req.url.match(/^\/api.*Google.*$/m)){ diff --git a/client/homebrew/navbar/newbrew.navitem.jsx b/client/homebrew/navbar/newbrew.navitem.jsx index 30d53c675..319ef3392 100644 --- a/client/homebrew/navbar/newbrew.navitem.jsx +++ b/client/homebrew/navbar/newbrew.navitem.jsx @@ -7,58 +7,58 @@ const BREWKEY = 'homebrewery-new'; const STYLEKEY = 'homebrewery-new-style'; const METAKEY = 'homebrewery-new-meta'; -const NewBrew = ()=>{ - const handleFileChange = (e)=>{ - const file = e.target.files[0]; - if(file) { - const reader = new FileReader(); - reader.onload = (e)=>{ - const fileContent = e.target.result; - const newBrew = { - text : fileContent, - style : '' - }; - if(fileContent.startsWith('```metadata')) { - splitTextStyleAndMetadata(newBrew); // Modify newBrew directly - localStorage.setItem(BREWKEY, newBrew.text); - localStorage.setItem(STYLEKEY, newBrew.style); - localStorage.setItem(METAKEY, JSON.stringify(_.pick(newBrew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang']))); - window.location.href = '/new'; - } else { - alert('This file is invalid, please, enter a valid file'); - } - }; - reader.readAsText(file); - } - }; +const NewBrew = () => { + const handleFileChange = (e) => { + const file = e.target.files[0]; + if (file) { + const reader = new FileReader(); + reader.onload = (e) => { + const fileContent = e.target.result; + const newBrew = { + text: fileContent, + style: '' + }; + if(fileContent.startsWith('```metadata')) { + splitTextStyleAndMetadata(newBrew); // Modify newBrew directly + localStorage.setItem(BREWKEY, newBrew.text); + localStorage.setItem(STYLEKEY, newBrew.style); + localStorage.setItem(METAKEY, JSON.stringify(_.pick(newBrew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang']))); + window.location.href = '/new'; + } else { + alert('This file is invalid, please, enter a valid file'); + } + }; + reader.readAsText(file); + } + }; - return ( - - + return ( + + new - - + + from blank - + - { document.getElementById('uploadTxt').click(); }}> - + { document.getElementById('uploadTxt').click(); }}> + from file - - - ); +
    + + ); }; module.exports = NewBrew; diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index ec557ffb1..0b51609b5 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -262,8 +262,8 @@ const ListPage = createClass({ render : function(){ return
    {/**/} - - + + {this.props.navItems} {this.renderSortOptions()} {this.renderTagsOptions()} diff --git a/client/homebrew/pages/printPage/printPage.jsx b/client/homebrew/pages/printPage/printPage.jsx index 29ecbab66..9a5a80dbf 100644 --- a/client/homebrew/pages/printPage/printPage.jsx +++ b/client/homebrew/pages/printPage/printPage.jsx @@ -34,7 +34,7 @@ const PrintPage = createClass({ style : this.props.brew.style || undefined, renderer : this.props.brew.renderer || 'legacy', theme : this.props.brew.theme || '5ePHB', - lang : this.props.brew.lang || 'en' + lang : this.props.brew.lang || 'en' } }; }, @@ -52,7 +52,7 @@ const PrintPage = createClass({ style : styleStorage, renderer : metaStorage?.renderer || 'legacy', theme : metaStorage?.theme || '5ePHB', - lang : metaStorage?.lang || 'en' + lang : metaStorage?.lang || 'en' } }; }); @@ -96,11 +96,11 @@ const PrintPage = createClass({ return
    - + {baseThemePath && - + } - + {/* Apply CSS from Style tab */} {this.renderStyle()}
    diff --git a/server/admin.api.js b/server/admin.api.js index fe2def3ce..5363ecc08 100644 --- a/server/admin.api.js +++ b/server/admin.api.js @@ -30,7 +30,7 @@ const junkBrewPipeline = [ { $match : { updatedAt : { $lt: Moment().subtract(30, 'days').toDate() }, lastViewed : { $lt: Moment().subtract(30, 'days').toDate() } - } }, + }}, { $project: { textBinSize: { $binarySize: '$textBin' } } }, { $match: { textBinSize: { $lt: 140 } } }, { $limit: 100 } diff --git a/shared/helpers.js b/shared/helpers.js index 42dd09e3f..5abb93fea 100644 --- a/shared/helpers.js +++ b/shared/helpers.js @@ -1,22 +1,22 @@ const _ = require('lodash'); const yaml = require('js-yaml'); -const splitTextStyleAndMetadata = (brew)=>{ - brew.text = brew.text.replaceAll('\r\n', '\n'); - if(brew.text.startsWith('```metadata')) { - const index = brew.text.indexOf('```\n\n'); - const metadataSection = brew.text.slice(12, index - 1); - const metadata = yaml.load(metadataSection); - Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang'])); - brew.text = brew.text.slice(index + 5); - } - if(brew.text.startsWith('```css')) { - const index = brew.text.indexOf('```\n\n'); - brew.style = brew.text.slice(7, index - 1); - brew.text = brew.text.slice(index + 5); - } +const splitTextStyleAndMetadata = (brew) => { + brew.text = brew.text.replaceAll('\r\n', '\n'); + if (brew.text.startsWith('```metadata')) { + const index = brew.text.indexOf('```\n\n'); + const metadataSection = brew.text.slice(12, index - 1); + const metadata = yaml.load(metadataSection); + Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang'])); + brew.text = brew.text.slice(index + 5); + } + if (brew.text.startsWith('```css')) { + const index = brew.text.indexOf('```\n\n'); + brew.style = brew.text.slice(7, index - 1); + brew.text = brew.text.slice(index + 5); + } }; module.exports = { - splitTextStyleAndMetadata + splitTextStyleAndMetadata }; diff --git a/shared/naturalcrit/codeEditor/codeEditor.jsx b/shared/naturalcrit/codeEditor/codeEditor.jsx index 486408332..a5232a42b 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.jsx +++ b/shared/naturalcrit/codeEditor/codeEditor.jsx @@ -436,7 +436,7 @@ const CodeEditor = createClass({ render : function(){ return <> - +
    ; } diff --git a/themes/V3/5ePHB/snippets/quote.gen.js b/themes/V3/5ePHB/snippets/quote.gen.js index c2a233255..c5e3d6293 100644 --- a/themes/V3/5ePHB/snippets/quote.gen.js +++ b/themes/V3/5ePHB/snippets/quote.gen.js @@ -1,47 +1,47 @@ -const _ = require('lodash'); +const _ = require("lodash"); const quotes = [ - 'The sword glinted in the dim light, its edges keen and deadly. As the adventurer reached for it, he couldn\'t help but feel a surge of excitement mixed with fear. This was no ordinary blade.', - 'The dragon\'s roar shook the ground beneath their feet, and the brave knight stood tall, his sword at the ready. He knew that this would be the battle of his life, but he was determined to emerge victorious.', - 'The wizard\'s laboratory was a sight to behold, filled with bubbling cauldrons, ancient tomes, and strange artifacts from distant lands. As the apprentice gazed around in wonder, she knew that she was about to embark on a journey unlike any other.', - 'The tavern was packed with rowdy patrons, their voices raised in song and laughter. The bard took center stage, strumming his lute and launching into a tale of adventure and heroism that had the crowd hanging on his every word.', - 'The thief crept through the shadows, his eyes scanning the room for any sign of danger. He knew that one false move could mean the difference between success and failure, and he was determined to come out on top.', - 'The elf queen stood atop her castle walls, surveying the kingdom below with a mix of pride and sadness. She knew that the coming war would be brutal, but she was determined to protect her people at all costs.', - 'The necromancer\'s tower loomed in the distance, its dark spires piercing the sky. As the adventurers approached, they could feel the chill of death emanating from within', - 'The ranger moved through the forest like a shadow, his senses attuned to every sound and movement around him. He knew that danger lurked behind every tree, but he was ready for whatever came his way.', - 'The paladin knelt before the altar, his hands clasped in prayer. He knew that his faith would be tested in the days ahead, but he was ready to face whatever trials lay in store for him.', - 'The druid communed with the spirits of nature, his mind merging with the trees, the animals, and the very earth itself. He knew that his power came with a great responsibility, and he was determined to use it for the greater good.', + "The sword glinted in the dim light, its edges keen and deadly. As the adventurer reached for it, he couldn't help but feel a surge of excitement mixed with fear. This was no ordinary blade.", + "The dragon's roar shook the ground beneath their feet, and the brave knight stood tall, his sword at the ready. He knew that this would be the battle of his life, but he was determined to emerge victorious.", + "The wizard's laboratory was a sight to behold, filled with bubbling cauldrons, ancient tomes, and strange artifacts from distant lands. As the apprentice gazed around in wonder, she knew that she was about to embark on a journey unlike any other.", + "The tavern was packed with rowdy patrons, their voices raised in song and laughter. The bard took center stage, strumming his lute and launching into a tale of adventure and heroism that had the crowd hanging on his every word.", + "The thief crept through the shadows, his eyes scanning the room for any sign of danger. He knew that one false move could mean the difference between success and failure, and he was determined to come out on top.", + "The elf queen stood atop her castle walls, surveying the kingdom below with a mix of pride and sadness. She knew that the coming war would be brutal, but she was determined to protect her people at all costs.", + "The necromancer's tower loomed in the distance, its dark spires piercing the sky. As the adventurers approached, they could feel the chill of death emanating from within", + "The ranger moved through the forest like a shadow, his senses attuned to every sound and movement around him. He knew that danger lurked behind every tree, but he was ready for whatever came his way.", + "The paladin knelt before the altar, his hands clasped in prayer. He knew that his faith would be tested in the days ahead, but he was ready to face whatever trials lay in store for him.", + "The druid communed with the spirits of nature, his mind merging with the trees, the animals, and the very earth itself. He knew that his power came with a great responsibility, and he was determined to use it for the greater good.", ]; const authors = [ - 'Unknown', - 'James Wyatt', - 'Eolande Blackwood', - 'Ragnar Ironheart', - 'Lyra Nightshade', - 'Valtorius Darkstar', - 'Isadora Fireheart', - 'Theron Shadowbane', - 'Lirien Starweaver', - 'Drogathar Bonecrusher', - 'Kaelen Frostblade', + "Unknown", + "James Wyatt", + "Eolande Blackwood", + "Ragnar Ironheart", + "Lyra Nightshade", + "Valtorius Darkstar", + "Isadora Fireheart", + "Theron Shadowbane", + "Lirien Starweaver", + "Drogathar Bonecrusher", + "Kaelen Frostblade", ]; const books = [ - 'The Blade of Destiny', - 'Dragonfire and Steel', - 'The Bard\'s Tale', - 'Darkness Rising', - 'The Sacred Quest', - 'Shadows in the Forest', - 'The Starweaver Chronicles', - 'Beneath the Bones', - 'Moonlit Magic', - 'Frost and Fury', + "The Blade of Destiny", + "Dragonfire and Steel", + "The Bard's Tale", + "Darkness Rising", + "The Sacred Quest", + "Shadows in the Forest", + "The Starweaver Chronicles", + "Beneath the Bones", + "Moonlit Magic", + "Frost and Fury", ]; -module.exports = ()=>{ - return ` +module.exports = () => { + return ` {{quote ${_.sample(quotes)} diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index 2dcf49b3e..272368665 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -307,8 +307,8 @@ module.exports = [ /**************** FONTS *************/ { groupName : 'Fonts', - icon : 'fas fa-keyboard', - view : 'text', + icon : 'fas fa-keyboard', + view : 'text', snippets : [ { name : 'Open Sans', @@ -326,74 +326,74 @@ module.exports = [ gen : dedent`{{font-family:CodeLight Dummy Text}}` }, { - name : 'Scaly Sans Remake', + name : 'Scaly Sans', icon : 'font ScalySansRemake', gen : dedent`{{font-family:ScalySansRemake Dummy Text}}` }, { - name : 'Book Insanity Remake', + name : 'Book Insanity', icon : 'font BookInsanityRemake', gen : dedent`{{font-family:BookInsanityRemake Dummy Text}}` }, { - name : 'Mr Eaves Remake', + name : 'Mr Eaves', icon : 'font MrEavesRemake', gen : dedent`{{font-family:MrEavesRemake Dummy Text}}` }, { - name : 'Solbera Imitation Remake', - icon : 'font SolberaImitationRemake', - gen : dedent`{{font-family:SolberaImitationRemake Dummy Text}}` + name: 'Solbera Imitation', + icon: 'font SolberaImitationRemake', + gen: dedent`{{font-family:SolberaImitationRemake Dummy Text}}` }, { - name : 'Scaly Sans Small Caps Remake', - icon : 'font ScalySansSmallCapsRemake', - gen : dedent`{{font-family:ScalySansSmallCapsRemake Dummy Text}}` + name: 'Scaly Sans Small Caps', + icon: 'font ScalySansSmallCapsRemake', + gen: dedent`{{font-family:ScalySansSmallCapsRemake Dummy Text}}` }, { - name : 'Walter Turncoat', - icon : 'font WalterTurncoat', - gen : dedent`{{font-family:WalterTurncoat Dummy Text}}` + name: 'Walter Turncoat', + icon: 'font WalterTurncoat', + gen: dedent`{{font-family:WalterTurncoat Dummy Text}}` }, { - name : 'Lato', - icon : 'font Lato', - gen : dedent`{{font-family:Lato Dummy Text}}` + name: 'Lato', + icon: 'font Lato', + gen: dedent`{{font-family:Lato Dummy Text}}` }, { - name : 'Courier', - icon : 'font Courier', - gen : dedent`{{font-family:Courier Dummy Text}}` + name: 'Courier', + icon: 'font Courier', + gen: dedent`{{font-family:Courier Dummy Text}}` }, { - name : 'Nodesto Caps Condensed', - icon : 'font NodestoCapsCondensed', - gen : dedent`{{font-family:NodestoCapsCondensed Dummy Text}}` + name: 'Nodesto Caps Condensed', + icon: 'font NodestoCapsCondensed', + gen: dedent`{{font-family:NodestoCapsCondensed Dummy Text}}` }, { - name : 'Overpass', - icon : 'font Overpass', - gen : dedent`{{font-family:Overpass Dummy Text}}` + name: 'Overpass', + icon: 'font Overpass', + gen: dedent`{{font-family:Overpass Dummy Text}}` }, { - name : 'Davek', - icon : 'font Davek', - gen : dedent`{{font-family:Davek Dummy Text}}` + name: 'Davek', + icon: 'font Davek', + gen: dedent`{{font-family:Davek Dummy Text}}` }, { - name : 'Iokharic', - icon : 'font Iokharic', - gen : dedent`{{font-family:Iokharic Dummy Text}}` + name: 'Iokharic', + icon: 'font Iokharic', + gen: dedent`{{font-family:Iokharic Dummy Text}}` }, { - name : 'Rellanic', - icon : 'font Rellanic', - gen : dedent`{{font-family:Rellanic Dummy Text}}` + name: 'Rellanic', + icon: 'font Rellanic', + gen: dedent`{{font-family:Rellanic Dummy Text}}` }, { - name : 'Times New Roman', - icon : 'font TimesNewRoman', - gen : dedent`{{font-family:"Times New Roman" Dummy Text}}` + name: 'Times New Roman', + icon: 'font TimesNewRoman', + gen: dedent`{{font-family:"Times New Roman" Dummy Text}}` } ] }, From 97fba241a1d7f7a39a1632dbf029e64521156ccc Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 4 Apr 2024 17:37:52 -0400 Subject: [PATCH 26/49] Undo linting on unrelated pages --- themes/V3/5ePHB/snippets/tableOfContents.gen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/V3/5ePHB/snippets/tableOfContents.gen.js b/themes/V3/5ePHB/snippets/tableOfContents.gen.js index 04ff77f3f..03f90d5fa 100644 --- a/themes/V3/5ePHB/snippets/tableOfContents.gen.js +++ b/themes/V3/5ePHB/snippets/tableOfContents.gen.js @@ -29,7 +29,7 @@ const getTOC = (pages)=>{ const res = []; _.each(pages, (page, pageNum)=>{ - if(!page.includes('{{frontCover}}') && !page.includes('{{insideCover}}') && !page.includes('{{partCover}}') && !page.includes('{{backCover}}')) { + if(!page.includes("{{frontCover}}") && !page.includes("{{insideCover}}") && !page.includes("{{partCover}}") && !page.includes("{{backCover}}")) { const lines = page.split('\n'); _.each(lines, (line)=>{ if(_.startsWith(line, '# ')){ From 9f2aaf01c77d6d113fa61517131a03c22aa904fe Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Sat, 6 Apr 2024 14:50:20 -0500 Subject: [PATCH 27/49] Remove unnecessary Nav components and methods. --- .../pages/accountPage/accountPage.jsx | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index d08832427..c796b9d22 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -1,19 +1,9 @@ const React = require('react'); const createClass = require('create-react-class'); -const _ = require('lodash'); -const cx = require('classnames'); const moment = require('moment'); const UIPage = require('../basePages/uiPage/uiPage.jsx'); -const Nav = require('naturalcrit/nav/nav.jsx'); -const Navbar = require('../../navbar/navbar.jsx'); - -const RecentNavItem = require('../../navbar/recent.navitem.jsx').both; -const Account = require('../../navbar/account.navitem.jsx'); -const NewBrew = require('../../navbar/newbrew.navitem.jsx'); -const HelpNavItem = require('../../navbar/help.navitem.jsx'); - const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx'); let SAVEKEY = ''; @@ -53,17 +43,6 @@ const AccountPage = createClass({ return ; }, - renderNavItems : function() { - return - - - - - - - ; - }, - renderUiItems : function() { return <>
    From e7eda1f5ec789ce729ca27cbf639d19152fbe4f3 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Sat, 6 Apr 2024 15:26:40 -0500 Subject: [PATCH 28/49] Convert class component to functional component Used OpenAI ChatGPT to do the bulk of this, and then fixed some formatting and looked for obvious mistakes. --- .../pages/accountPage/accountPage.jsx | 129 +++++++++--------- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index c796b9d22..88a347121 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -1,5 +1,4 @@ const React = require('react'); -const createClass = require('create-react-class'); const moment = require('moment'); const UIPage = require('../basePages/uiPage/uiPage.jsx'); @@ -8,74 +7,76 @@ const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx'); let SAVEKEY = ''; -const AccountPage = createClass({ - displayName : 'AccountPage', - getDefaultProps : function() { - return { - brew : {}, - uiItems : {} - }; - }, - getInitialState : function() { - return { - uiItems : this.props.uiItems - }; - }, - componentDidMount : function(){ - if(!this.state.saveLocation && this.props.uiItems.username) { - SAVEKEY = `HOMEBREWERY-DEFAULT-SAVE-LOCATION-${this.props.uiItems.username}`; - let saveLocation = window.localStorage.getItem(SAVEKEY); - saveLocation = saveLocation ?? (this.state.uiItems.googleId ? 'GOOGLE-DRIVE' : 'HOMEBREWERY'); - this.makeActive(saveLocation); +const AccountPage = (props)=>{ + const [saveLocation, setSaveLocation] = React.useState(''); + + React.useEffect(()=>{ + if(!saveLocation && props.uiItems.username) { + SAVEKEY = `HOMEBREWERY-DEFAULT-SAVE-LOCATION-${props.uiItems.username}`; + let saveLocation = window.localStorage.getItem(SAVEKEY); + saveLocation = saveLocation ?? (props.uiItems.googleId ? 'GOOGLE-DRIVE' : 'HOMEBREWERY'); + makeActive(saveLocation); } - }, + }, []); - makeActive : function(newSelection){ - if(this.state.saveLocation == newSelection) return; + const makeActive = (newSelection)=>{ + if(saveLocation === newSelection) return; window.localStorage.setItem(SAVEKEY, newSelection); - this.setState({ - saveLocation : newSelection - }); - }, + setSaveLocation(newSelection); + }; - renderButton : function(name, key, shouldRender=true){ - if(!shouldRender) return; - return ; - }, + const renderButton = (name, key, shouldRender = true)=>{ + if(!shouldRender) return null; + return ( + + ); + }; - renderUiItems : function() { - return <> -
    -

    Account Information

    -

    Username: {this.props.uiItems.username || 'No user currently logged in'}

    -

    Last Login: {moment(this.props.uiItems.issued).format('dddd, MMMM Do YYYY, h:mm:ss a ZZ') || '-'}

    -
    -
    -

    Homebrewery Information

    -

    Brews on Homebrewery: {this.props.uiItems.mongoCount}

    -
    -
    -

    Google Information

    -

    Linked to Google: {this.props.uiItems.googleId ? 'YES' : 'NO'}

    - {this.props.uiItems.googleId && -

    - Brews on Google Drive: {this.props.uiItems.googleCount ?? <>Unable to retrieve files - follow these steps to renew your Google credentials.} -

    - } -
    -
    -

    Default Save Location

    - {this.renderButton('Homebrewery', 'HOMEBREWERY')} - {this.renderButton('Google Drive', 'GOOGLE-DRIVE', this.state.uiItems.googleId)} -
    - ; - }, + const renderUiItems = ()=>{ + return ( + <> +
    +

    Account Information

    +

    Username: {props.uiItems.username || 'No user currently logged in'}

    +

    Last Login: {moment(props.uiItems.issued).format('dddd, MMMM Do YYYY, h:mm:ss a ZZ') || '-'}

    +
    +
    +

    Homebrewery Information

    +

    Brews on Homebrewery: {props.uiItems.mongoCount}

    +
    +
    +

    Google Information

    +

    Linked to Google: {props.uiItems.googleId ? 'YES' : 'NO'}

    + {props.uiItems.googleId && ( +

    + Brews on Google Drive: {props.uiItems.googleCount ?? ( + <> + Unable to retrieve files - follow these steps to renew your Google credentials. + + )} +

    + )} +
    +
    +

    Default Save Location

    + {renderButton('Homebrewery', 'HOMEBREWERY')} + {renderButton('Google Drive', 'GOOGLE-DRIVE', props.uiItems.googleId)} +
    + + ); + }; - render : function(){ - return - {this.renderUiItems()} - ; - } -}); + return ( + + {renderUiItems()} + ); +}; module.exports = AccountPage; From e1599909bcf6448ab359acbd7f81fa89497671a6 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Sat, 6 Apr 2024 15:30:18 -0500 Subject: [PATCH 29/49] change name of render method to be more discriptive "UiItems" is not descriptive enough for a render method because most anything that is rendered is part of the UI. This could be left as just `render()`, but `renderAccountPage()` provides best context of what is happening. --- client/homebrew/pages/accountPage/accountPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index 88a347121..591845cbb 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -39,7 +39,7 @@ const AccountPage = (props)=>{ ); }; - const renderUiItems = ()=>{ + const renderAccountPage = ()=>{ return ( <>
    @@ -75,7 +75,7 @@ const AccountPage = (props)=>{ return ( - {renderUiItems()} + {renderAccountPage()} ); }; From 08406de5cc094efd592f172400a4ca9b4eff502f Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Sat, 6 Apr 2024 15:44:19 -0500 Subject: [PATCH 30/49] add code comments for each step. --- client/homebrew/pages/accountPage/accountPage.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index 591845cbb..72d60a741 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -8,23 +8,29 @@ const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx'); let SAVEKEY = ''; const AccountPage = (props)=>{ + // State for the save location const [saveLocation, setSaveLocation] = React.useState(''); + // initialize save location from local storage based on user id React.useEffect(()=>{ if(!saveLocation && props.uiItems.username) { SAVEKEY = `HOMEBREWERY-DEFAULT-SAVE-LOCATION-${props.uiItems.username}`; + // if no SAVEKEY in local storage, default save location to Google Drive. let saveLocation = window.localStorage.getItem(SAVEKEY); saveLocation = saveLocation ?? (props.uiItems.googleId ? 'GOOGLE-DRIVE' : 'HOMEBREWERY'); makeActive(saveLocation); } }, []); + // function to set the active save location const makeActive = (newSelection)=>{ if(saveLocation === newSelection) return; window.localStorage.setItem(SAVEKEY, newSelection); setSaveLocation(newSelection); }; + // render a button for setting save locations. + // todo: should this be a set of radio buttons (well styled) since it's either/or choice? const renderButton = (name, key, shouldRender = true)=>{ if(!shouldRender) return null; return ( @@ -39,6 +45,7 @@ const AccountPage = (props)=>{ ); }; + // render the entirety of the account page content const renderAccountPage = ()=>{ return ( <> @@ -73,6 +80,7 @@ const AccountPage = (props)=>{ ); }; + // return the account page inside the base layout wrapper (with navbar etc). return ( {renderAccountPage()} From 777438fd940e74fe87f20887fddabd8d41e3f98a Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Sat, 6 Apr 2024 21:23:26 -0500 Subject: [PATCH 31/49] rename props.brew.uiItems to ...accountDetails and destructure props at start of account page component. `accountDetails` is more descriptive of what set of info is being passed through props to the account page, info which is only *then* displayed as UI items. --- client/homebrew/homebrew.jsx | 2 +- .../pages/accountPage/accountPage.jsx | 26 +++++++++++-------- server/app.js | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index a08a39ea0..8c82f33e7 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -76,7 +76,7 @@ const Homebrew = createClass({ } /> } /> } /> - } /> + } /> } /> } /> } /> diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index 72d60a741..e65736a24 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -8,16 +8,20 @@ const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx'); let SAVEKEY = ''; const AccountPage = (props)=>{ + // destructure props + const { accountDetails, brew } = props; + + // State for the save location const [saveLocation, setSaveLocation] = React.useState(''); // initialize save location from local storage based on user id React.useEffect(()=>{ - if(!saveLocation && props.uiItems.username) { - SAVEKEY = `HOMEBREWERY-DEFAULT-SAVE-LOCATION-${props.uiItems.username}`; + if(!saveLocation && accountDetails.username) { + SAVEKEY = `HOMEBREWERY-DEFAULT-SAVE-LOCATION-${accountDetails.username}`; // if no SAVEKEY in local storage, default save location to Google Drive. let saveLocation = window.localStorage.getItem(SAVEKEY); - saveLocation = saveLocation ?? (props.uiItems.googleId ? 'GOOGLE-DRIVE' : 'HOMEBREWERY'); + saveLocation = saveLocation ?? (accountDetails.googleId ? 'GOOGLE-DRIVE' : 'HOMEBREWERY'); makeActive(saveLocation); } }, []); @@ -51,19 +55,19 @@ const AccountPage = (props)=>{ <>

    Account Information

    -

    Username: {props.uiItems.username || 'No user currently logged in'}

    -

    Last Login: {moment(props.uiItems.issued).format('dddd, MMMM Do YYYY, h:mm:ss a ZZ') || '-'}

    +

    Username: {accountDetails.username || 'No user currently logged in'}

    +

    Last Login: {moment(accountDetails.issued).format('dddd, MMMM Do YYYY, h:mm:ss a ZZ') || '-'}

    Homebrewery Information

    -

    Brews on Homebrewery: {props.uiItems.mongoCount}

    +

    Brews on Homebrewery: {accountDetails.mongoCount}

    Google Information

    -

    Linked to Google: {props.uiItems.googleId ? 'YES' : 'NO'}

    - {props.uiItems.googleId && ( +

    Linked to Google: {accountDetails.googleId ? 'YES' : 'NO'}

    + {accountDetails.googleId && (

    - Brews on Google Drive: {props.uiItems.googleCount ?? ( + Brews on Google Drive: {accountDetails.googleCount ?? ( <> Unable to retrieve files - follow these steps to renew your Google credentials. @@ -74,7 +78,7 @@ const AccountPage = (props)=>{

    Default Save Location

    {renderButton('Homebrewery', 'HOMEBREWERY')} - {renderButton('Google Drive', 'GOOGLE-DRIVE', props.uiItems.googleId)} + {renderButton('Google Drive', 'GOOGLE-DRIVE', accountDetails.googleId)}
    ); @@ -82,7 +86,7 @@ const AccountPage = (props)=>{ // return the account page inside the base layout wrapper (with navbar etc). return ( - + {renderAccountPage()} ); }; diff --git a/server/app.js b/server/app.js index 4c72b4924..c8fec4bc4 100644 --- a/server/app.js +++ b/server/app.js @@ -372,7 +372,7 @@ app.get('/account', asyncHandler(async (req, res, next)=>{ console.log(err); }); - data.uiItems = { + data.accountDetails = { username : req.account.username, issued : req.account.issued, googleId : Boolean(req.account.googleId), From ed85f77c48fe1ad4dea889bbfa4fc15593369ccf Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Sat, 6 Apr 2024 21:34:04 -0500 Subject: [PATCH 32/49] ESLint linting (one small whitespace change). --- client/homebrew/pages/accountPage/accountPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index e65736a24..47264dca1 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -33,7 +33,7 @@ const AccountPage = (props)=>{ setSaveLocation(newSelection); }; - // render a button for setting save locations. + // render a button for setting save locations. // todo: should this be a set of radio buttons (well styled) since it's either/or choice? const renderButton = (name, key, shouldRender = true)=>{ if(!shouldRender) return null; From 99f9b1034852f18060151c1581351a595837a4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sun, 7 Apr 2024 16:16:21 +0200 Subject: [PATCH 33/49] initial commit --- .../pages/errorPage/errors/errorIndex.js | 20 +++++++++++++++++-- server/homebrew.api.js | 4 ++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 7c7a3ae7f..bec3fdfe7 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -73,11 +73,14 @@ const errorIndex = (props)=>{ **Properties** tab, and adding your username to the "invited authors" list. You can then try to access this document again. + : + **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} **Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'} - [Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`, + ${props.brew.published ? `[Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`: + 'This brew is unpublished, therefore we cannot grant you its share page URL.'}`, // User is not signed in; must be a user on the Authors List '04' : dedent` @@ -86,9 +89,14 @@ const errorIndex = (props)=>{ You must be logged in to one of the accounts listed as an author of this brew. User is not logged in. Please log in [here](${loginUrl}). + : + **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} - **Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'}`, + **Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'} + + ${props.brew.published ? `[Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`: + 'This brew is unpublished, therefore we cannot grant you its share page URL.'}`, // Brew load error '05' : dedent` @@ -97,6 +105,8 @@ const errorIndex = (props)=>{ The server could not locate the Homebrewery document. It was likely deleted by its owner. + : + **Requested access:** ${props.brew.accessType} **Brew ID:** ${props.brew.brewId}`, @@ -113,6 +123,8 @@ const errorIndex = (props)=>{ An error occurred while attempting to remove the Homebrewery document. + : + **Brew ID:** ${props.brew.brewId}`, // Author delete error @@ -121,6 +133,8 @@ const errorIndex = (props)=>{ An error occurred while attempting to remove the user from the Homebrewery document author list! + : + **Brew ID:** ${props.brew.brewId}`, // Brew locked by Administrators error @@ -129,6 +143,8 @@ const errorIndex = (props)=>{ Please contact the Administrators to unlock this document. + : + **Brew ID:** ${props.brew.brewId} **Brew Title:** ${props.brew.brewTitle}`, diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 567dc9cf7..f9a2c6156 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -83,9 +83,9 @@ const api = { if(accessType === 'edit' && (authorsExist && !(isAuthor || isInvited))) { const accessError = { name: 'Access Error', status: 401 }; if(req.account){ - throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId }; + throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId, published: stub.published }; } - throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title }; + throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId , published: stub.published}; } // If after all of that we still don't have a brew, throw an exception From 2045bf8060cefe0b95180aadd2b9e9e1b0cff76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:17:10 +0200 Subject: [PATCH 34/49] renaming snippetBar --- client/homebrew/editor/editor.jsx | 2 +- client/homebrew/editor/snippetbar/snippetbar.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 7cc800b78..53f9b825f 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -7,7 +7,7 @@ const cx = require('classnames'); const dedent = require('dedent-tabs').default; const CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx'); -const SnippetBar = require('./snippetbar/snippetbar.jsx'); +const snippetBar = require('./snippetBar/snippetBar.jsx'); const MetadataEditor = require('./metadataEditor/metadataEditor.jsx'); const EDITOR_THEME_KEY = 'HOMEBREWERY-EDITOR-THEME'; diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 75fe0d736..1341405e5 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -1,5 +1,5 @@ /*eslint max-lines: ["warn", {"max": 250, "skipBlankLines": true, "skipComments": true}]*/ -require('./snippetbar.less'); +require('./snippetBar.less'); const React = require('react'); const createClass = require('create-react-class'); const _ = require('lodash'); From 22b01b131fc47ea8af9721060e90bd67b44679c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:19:32 +0200 Subject: [PATCH 35/49] rename icons --- client/icons/{book-back-cover.svg => bookBackCover.svg} | 0 client/icons/{book-front-cover.svg => bookFrontCover.svg} | 0 client/icons/{book-inside-cover.svg => bookInsideCover.svg} | 0 client/icons/{book-part-cover.svg => bookPartCover.svg} | 0 client/icons/{mask-center.svg => maskCenter.svg} | 0 client/icons/{mask-corner.svg => maskCorner.svg} | 0 client/icons/{mask-edge.svg => maskEdge.svg} | 0 client/icons/{position-bottom.svg => positionBottom.svg} | 0 client/icons/{position-bottom-left.svg => positionBottomLeft.svg} | 0 .../icons/{position-bottom-right.svg => positionBottomRight.svg} | 0 client/icons/{position-left.svg => positionLeft.svg} | 0 client/icons/{position-right.svg => positionRight.svg} | 0 client/icons/{position-top.svg => positionTop.svg} | 0 client/icons/{position-top-left.svg => positionTopLeft.svg} | 0 client/icons/{position-top-right.svg => positionTopRight.svg} | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename client/icons/{book-back-cover.svg => bookBackCover.svg} (100%) rename client/icons/{book-front-cover.svg => bookFrontCover.svg} (100%) rename client/icons/{book-inside-cover.svg => bookInsideCover.svg} (100%) rename client/icons/{book-part-cover.svg => bookPartCover.svg} (100%) rename client/icons/{mask-center.svg => maskCenter.svg} (100%) rename client/icons/{mask-corner.svg => maskCorner.svg} (100%) rename client/icons/{mask-edge.svg => maskEdge.svg} (100%) rename client/icons/{position-bottom.svg => positionBottom.svg} (100%) rename client/icons/{position-bottom-left.svg => positionBottomLeft.svg} (100%) rename client/icons/{position-bottom-right.svg => positionBottomRight.svg} (100%) rename client/icons/{position-left.svg => positionLeft.svg} (100%) rename client/icons/{position-right.svg => positionRight.svg} (100%) rename client/icons/{position-top.svg => positionTop.svg} (100%) rename client/icons/{position-top-left.svg => positionTopLeft.svg} (100%) rename client/icons/{position-top-right.svg => positionTopRight.svg} (100%) diff --git a/client/icons/book-back-cover.svg b/client/icons/bookBackCover.svg similarity index 100% rename from client/icons/book-back-cover.svg rename to client/icons/bookBackCover.svg diff --git a/client/icons/book-front-cover.svg b/client/icons/bookFrontCover.svg similarity index 100% rename from client/icons/book-front-cover.svg rename to client/icons/bookFrontCover.svg diff --git a/client/icons/book-inside-cover.svg b/client/icons/bookInsideCover.svg similarity index 100% rename from client/icons/book-inside-cover.svg rename to client/icons/bookInsideCover.svg diff --git a/client/icons/book-part-cover.svg b/client/icons/bookPartCover.svg similarity index 100% rename from client/icons/book-part-cover.svg rename to client/icons/bookPartCover.svg diff --git a/client/icons/mask-center.svg b/client/icons/maskCenter.svg similarity index 100% rename from client/icons/mask-center.svg rename to client/icons/maskCenter.svg diff --git a/client/icons/mask-corner.svg b/client/icons/maskCorner.svg similarity index 100% rename from client/icons/mask-corner.svg rename to client/icons/maskCorner.svg diff --git a/client/icons/mask-edge.svg b/client/icons/maskEdge.svg similarity index 100% rename from client/icons/mask-edge.svg rename to client/icons/maskEdge.svg diff --git a/client/icons/position-bottom.svg b/client/icons/positionBottom.svg similarity index 100% rename from client/icons/position-bottom.svg rename to client/icons/positionBottom.svg diff --git a/client/icons/position-bottom-left.svg b/client/icons/positionBottomLeft.svg similarity index 100% rename from client/icons/position-bottom-left.svg rename to client/icons/positionBottomLeft.svg diff --git a/client/icons/position-bottom-right.svg b/client/icons/positionBottomRight.svg similarity index 100% rename from client/icons/position-bottom-right.svg rename to client/icons/positionBottomRight.svg diff --git a/client/icons/position-left.svg b/client/icons/positionLeft.svg similarity index 100% rename from client/icons/position-left.svg rename to client/icons/positionLeft.svg diff --git a/client/icons/position-right.svg b/client/icons/positionRight.svg similarity index 100% rename from client/icons/position-right.svg rename to client/icons/positionRight.svg diff --git a/client/icons/position-top.svg b/client/icons/positionTop.svg similarity index 100% rename from client/icons/position-top.svg rename to client/icons/positionTop.svg diff --git a/client/icons/position-top-left.svg b/client/icons/positionTopLeft.svg similarity index 100% rename from client/icons/position-top-left.svg rename to client/icons/positionTopLeft.svg diff --git a/client/icons/position-top-right.svg b/client/icons/positionTopRight.svg similarity index 100% rename from client/icons/position-top-right.svg rename to client/icons/positionTopRight.svg From 7cc83eaf95d141063004d62acd38e9ffba2a23be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:19:43 +0200 Subject: [PATCH 36/49] rename icons less --- client/icons/customIcons.less | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/client/icons/customIcons.less b/client/icons/customIcons.less index dd6605326..10ba66574 100644 --- a/client/icons/customIcons.less +++ b/client/icons/customIcons.less @@ -1,50 +1,50 @@ .fac { - display : inline-block; + display: inline-block; } .position-top-left { - content: url('../icons/position-top-left.svg'); + content: url('../icons/positionTopLeft.svg'); } .position-top-right { - content: url('../icons/position-top-right.svg'); + content: url('../icons/positionTopRight.svg'); } .position-bottom-left { - content: url('../icons/position-bottom-left.svg'); + content: url('../icons/positionBottomLeft.svg'); } .position-bottom-right { - content: url('../icons/position-bottom-right.svg'); + content: url('../icons/positionBottomRight.svg'); } .position-top { - content: url('../icons/position-top.svg'); + content: url('../icons/positionTop.svg'); } .position-right { - content: url('../icons/position-right.svg'); + content: url('../icons/positionRight.svg'); } .position-bottom { - content: url('../icons/position-bottom.svg'); + content: url('../icons/positionBottom.svg'); } .position-left { - content: url('../icons/position-left.svg'); + content: url('../icons/positionLeft.svg'); } .mask-edge { - content: url('../icons/mask-edge.svg'); + content: url('../icons/maskEdge.svg'); } .mask-corner { - content: url('../icons/mask-corner.svg'); + content: url('../icons/maskCorner.svg'); } .mask-center { - content: url('../icons/mask-center.svg'); + content: url('../icons/maskCenter.svg'); } .book-front-cover { - content: url('../icons/book-front-cover.svg'); + content: url('../icons/bookFrontCover.svg'); } .book-back-cover { - content: url('../icons/book-back-cover.svg'); + content: url('../icons/bookBackCover.svg'); } .book-inside-cover { - content: url('../icons/book-inside-cover.svg'); + content: url('../icons/bookInsideCover.svg'); } .book-part-cover { - content: url('../icons/book-part-cover.svg'); + content: url('../icons/bookPartCover.svg'); } .davek { content: url('../icons/Davek.svg'); From 4f9e93fac744de52b1f8d368024f6e97076e6875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:29:38 +0200 Subject: [PATCH 37/49] Revert "renaming snippetBar" This reverts commit 2045bf8060cefe0b95180aadd2b9e9e1b0cff76d. --- client/homebrew/editor/editor.jsx | 2 +- client/homebrew/editor/snippetbar/snippetbar.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 53f9b825f..7cc800b78 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -7,7 +7,7 @@ const cx = require('classnames'); const dedent = require('dedent-tabs').default; const CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx'); -const snippetBar = require('./snippetBar/snippetBar.jsx'); +const SnippetBar = require('./snippetbar/snippetbar.jsx'); const MetadataEditor = require('./metadataEditor/metadataEditor.jsx'); const EDITOR_THEME_KEY = 'HOMEBREWERY-EDITOR-THEME'; diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 1341405e5..75fe0d736 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -1,5 +1,5 @@ /*eslint max-lines: ["warn", {"max": 250, "skipBlankLines": true, "skipComments": true}]*/ -require('./snippetBar.less'); +require('./snippetbar.less'); const React = require('react'); const createClass = require('create-react-class'); const _ = require('lodash'); From f5c729c32856445290b669481b54bb9167de242b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:29:40 +0200 Subject: [PATCH 38/49] Revert "rename icons" This reverts commit 22b01b131fc47ea8af9721060e90bd67b44679c5. --- client/icons/{bookBackCover.svg => book-back-cover.svg} | 0 client/icons/{bookFrontCover.svg => book-front-cover.svg} | 0 client/icons/{bookInsideCover.svg => book-inside-cover.svg} | 0 client/icons/{bookPartCover.svg => book-part-cover.svg} | 0 client/icons/{maskCenter.svg => mask-center.svg} | 0 client/icons/{maskCorner.svg => mask-corner.svg} | 0 client/icons/{maskEdge.svg => mask-edge.svg} | 0 client/icons/{positionBottomLeft.svg => position-bottom-left.svg} | 0 .../icons/{positionBottomRight.svg => position-bottom-right.svg} | 0 client/icons/{positionBottom.svg => position-bottom.svg} | 0 client/icons/{positionLeft.svg => position-left.svg} | 0 client/icons/{positionRight.svg => position-right.svg} | 0 client/icons/{positionTopLeft.svg => position-top-left.svg} | 0 client/icons/{positionTopRight.svg => position-top-right.svg} | 0 client/icons/{positionTop.svg => position-top.svg} | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename client/icons/{bookBackCover.svg => book-back-cover.svg} (100%) rename client/icons/{bookFrontCover.svg => book-front-cover.svg} (100%) rename client/icons/{bookInsideCover.svg => book-inside-cover.svg} (100%) rename client/icons/{bookPartCover.svg => book-part-cover.svg} (100%) rename client/icons/{maskCenter.svg => mask-center.svg} (100%) rename client/icons/{maskCorner.svg => mask-corner.svg} (100%) rename client/icons/{maskEdge.svg => mask-edge.svg} (100%) rename client/icons/{positionBottomLeft.svg => position-bottom-left.svg} (100%) rename client/icons/{positionBottomRight.svg => position-bottom-right.svg} (100%) rename client/icons/{positionBottom.svg => position-bottom.svg} (100%) rename client/icons/{positionLeft.svg => position-left.svg} (100%) rename client/icons/{positionRight.svg => position-right.svg} (100%) rename client/icons/{positionTopLeft.svg => position-top-left.svg} (100%) rename client/icons/{positionTopRight.svg => position-top-right.svg} (100%) rename client/icons/{positionTop.svg => position-top.svg} (100%) diff --git a/client/icons/bookBackCover.svg b/client/icons/book-back-cover.svg similarity index 100% rename from client/icons/bookBackCover.svg rename to client/icons/book-back-cover.svg diff --git a/client/icons/bookFrontCover.svg b/client/icons/book-front-cover.svg similarity index 100% rename from client/icons/bookFrontCover.svg rename to client/icons/book-front-cover.svg diff --git a/client/icons/bookInsideCover.svg b/client/icons/book-inside-cover.svg similarity index 100% rename from client/icons/bookInsideCover.svg rename to client/icons/book-inside-cover.svg diff --git a/client/icons/bookPartCover.svg b/client/icons/book-part-cover.svg similarity index 100% rename from client/icons/bookPartCover.svg rename to client/icons/book-part-cover.svg diff --git a/client/icons/maskCenter.svg b/client/icons/mask-center.svg similarity index 100% rename from client/icons/maskCenter.svg rename to client/icons/mask-center.svg diff --git a/client/icons/maskCorner.svg b/client/icons/mask-corner.svg similarity index 100% rename from client/icons/maskCorner.svg rename to client/icons/mask-corner.svg diff --git a/client/icons/maskEdge.svg b/client/icons/mask-edge.svg similarity index 100% rename from client/icons/maskEdge.svg rename to client/icons/mask-edge.svg diff --git a/client/icons/positionBottomLeft.svg b/client/icons/position-bottom-left.svg similarity index 100% rename from client/icons/positionBottomLeft.svg rename to client/icons/position-bottom-left.svg diff --git a/client/icons/positionBottomRight.svg b/client/icons/position-bottom-right.svg similarity index 100% rename from client/icons/positionBottomRight.svg rename to client/icons/position-bottom-right.svg diff --git a/client/icons/positionBottom.svg b/client/icons/position-bottom.svg similarity index 100% rename from client/icons/positionBottom.svg rename to client/icons/position-bottom.svg diff --git a/client/icons/positionLeft.svg b/client/icons/position-left.svg similarity index 100% rename from client/icons/positionLeft.svg rename to client/icons/position-left.svg diff --git a/client/icons/positionRight.svg b/client/icons/position-right.svg similarity index 100% rename from client/icons/positionRight.svg rename to client/icons/position-right.svg diff --git a/client/icons/positionTopLeft.svg b/client/icons/position-top-left.svg similarity index 100% rename from client/icons/positionTopLeft.svg rename to client/icons/position-top-left.svg diff --git a/client/icons/positionTopRight.svg b/client/icons/position-top-right.svg similarity index 100% rename from client/icons/positionTopRight.svg rename to client/icons/position-top-right.svg diff --git a/client/icons/positionTop.svg b/client/icons/position-top.svg similarity index 100% rename from client/icons/positionTop.svg rename to client/icons/position-top.svg From 0e5c91733dffce39523a1388f0114cad69bb8a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 8 Apr 2024 02:29:43 +0200 Subject: [PATCH 39/49] Revert "rename icons less" This reverts commit 7cc83eaf95d141063004d62acd38e9ffba2a23be. --- client/icons/customIcons.less | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/client/icons/customIcons.less b/client/icons/customIcons.less index 10ba66574..dd6605326 100644 --- a/client/icons/customIcons.less +++ b/client/icons/customIcons.less @@ -1,50 +1,50 @@ .fac { - display: inline-block; + display : inline-block; } .position-top-left { - content: url('../icons/positionTopLeft.svg'); + content: url('../icons/position-top-left.svg'); } .position-top-right { - content: url('../icons/positionTopRight.svg'); + content: url('../icons/position-top-right.svg'); } .position-bottom-left { - content: url('../icons/positionBottomLeft.svg'); + content: url('../icons/position-bottom-left.svg'); } .position-bottom-right { - content: url('../icons/positionBottomRight.svg'); + content: url('../icons/position-bottom-right.svg'); } .position-top { - content: url('../icons/positionTop.svg'); + content: url('../icons/position-top.svg'); } .position-right { - content: url('../icons/positionRight.svg'); + content: url('../icons/position-right.svg'); } .position-bottom { - content: url('../icons/positionBottom.svg'); + content: url('../icons/position-bottom.svg'); } .position-left { - content: url('../icons/positionLeft.svg'); + content: url('../icons/position-left.svg'); } .mask-edge { - content: url('../icons/maskEdge.svg'); + content: url('../icons/mask-edge.svg'); } .mask-corner { - content: url('../icons/maskCorner.svg'); + content: url('../icons/mask-corner.svg'); } .mask-center { - content: url('../icons/maskCenter.svg'); + content: url('../icons/mask-center.svg'); } .book-front-cover { - content: url('../icons/bookFrontCover.svg'); + content: url('../icons/book-front-cover.svg'); } .book-back-cover { - content: url('../icons/bookBackCover.svg'); + content: url('../icons/book-back-cover.svg'); } .book-inside-cover { - content: url('../icons/bookInsideCover.svg'); + content: url('../icons/book-inside-cover.svg'); } .book-part-cover { - content: url('../icons/bookPartCover.svg'); + content: url('../icons/book-part-cover.svg'); } .davek { content: url('../icons/Davek.svg'); From 53e437c6bc0500bfcb9863dee339921bfeba7bc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 03:02:17 +0000 Subject: [PATCH 40/49] Bump mongoose from 8.3.0 to 8.3.1 Bumps [mongoose](https://github.com/Automattic/mongoose) from 8.3.0 to 8.3.1. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md) - [Commits](https://github.com/Automattic/mongoose/compare/8.3.0...8.3.1) --- updated-dependencies: - dependency-name: mongoose dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8cb32640d..0e69c6d7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.3.0", + "mongoose": "^8.3.1", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.2.0", @@ -9836,9 +9836,9 @@ } }, "node_modules/kareem": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.0.tgz", - "integrity": "sha512-B9wwgyKKKZkxYZXQzefvb/Ykh9eHixxR+ttTP2c/Pq8NvHi1iYIAImf3nj/DXkPcnenjGEffhPWXnCFRIbNAhw==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", + "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", "engines": { "node": ">=12.0.0" } @@ -10545,12 +10545,12 @@ } }, "node_modules/mongoose": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.3.0.tgz", - "integrity": "sha512-Y5QNnuA38CEin8hnA+q//nUVztIi4Xklu9xlmbkd1KdWHnIlemSwf5IL/evcI+e2zplL4g5Y6PMkO+nPSAnIdA==", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.3.1.tgz", + "integrity": "sha512-D78C+s7QI4+pJQhs3XbOxzrHFEti4x+BDhaH94QrdV1/cmMA7fHc50LgLSXjzA/5q89TBK8DAXyf3VwDZbQJlA==", "dependencies": { "bson": "^6.5.0", - "kareem": "2.6.0", + "kareem": "2.6.3", "mongodb": "6.5.0", "mpath": "0.9.0", "mquery": "5.0.0", diff --git a/package.json b/package.json index 57569791a..8dcb7356a 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.3.0", + "mongoose": "^8.3.1", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.2.0", From 4f0cbd82d40890b0ed7258a33b5e934d8ce9fbf3 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 9 Apr 2024 11:35:30 -0400 Subject: [PATCH 41/49] Linting, small cleanup, and renaming some functions Renamed "makeActive" and "renderButton" to make more clear without needing comments. --- .../pages/accountPage/accountPage.jsx | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index 47264dca1..3f1295fdb 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -1,8 +1,6 @@ -const React = require('react'); +const React = require('react'); const moment = require('moment'); - const UIPage = require('../basePages/uiPage/uiPage.jsx'); - const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx'); let SAVEKEY = ''; @@ -11,7 +9,6 @@ const AccountPage = (props)=>{ // destructure props const { accountDetails, brew } = props; - // State for the save location const [saveLocation, setSaveLocation] = React.useState(''); @@ -19,15 +16,15 @@ const AccountPage = (props)=>{ React.useEffect(()=>{ if(!saveLocation && accountDetails.username) { SAVEKEY = `HOMEBREWERY-DEFAULT-SAVE-LOCATION-${accountDetails.username}`; - // if no SAVEKEY in local storage, default save location to Google Drive. + // if no SAVEKEY in local storage, default save location to Google Drive if user has Google account. let saveLocation = window.localStorage.getItem(SAVEKEY); saveLocation = saveLocation ?? (accountDetails.googleId ? 'GOOGLE-DRIVE' : 'HOMEBREWERY'); - makeActive(saveLocation); + setActiveSaveLocation(saveLocation); } }, []); // function to set the active save location - const makeActive = (newSelection)=>{ + const setActiveSaveLocation = (newSelection)=>{ if(saveLocation === newSelection) return; window.localStorage.setItem(SAVEKEY, newSelection); setSaveLocation(newSelection); @@ -35,15 +32,10 @@ const AccountPage = (props)=>{ // render a button for setting save locations. // todo: should this be a set of radio buttons (well styled) since it's either/or choice? - const renderButton = (name, key, shouldRender = true)=>{ + const renderSaveLocationButton = (name, key, shouldRender = true)=>{ if(!shouldRender) return null; return ( - ); @@ -77,8 +69,8 @@ const AccountPage = (props)=>{

    Default Save Location

    - {renderButton('Homebrewery', 'HOMEBREWERY')} - {renderButton('Google Drive', 'GOOGLE-DRIVE', accountDetails.googleId)} + {renderSaveLocationButton('Homebrewery', 'HOMEBREWERY')} + {renderSaveLocationButton('Google Drive', 'GOOGLE-DRIVE', accountDetails.googleId)}
    ); From 431dfd77802fd7ed562e2b15fd1dad68ce594a13 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 9 Apr 2024 11:36:13 -0400 Subject: [PATCH 42/49] tweak comments --- client/homebrew/pages/accountPage/accountPage.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index 3f1295fdb..598683504 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -6,10 +6,8 @@ const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx'); let SAVEKEY = ''; const AccountPage = (props)=>{ - // destructure props + // destructure props and set state for save location const { accountDetails, brew } = props; - - // State for the save location const [saveLocation, setSaveLocation] = React.useState(''); // initialize save location from local storage based on user id @@ -23,14 +21,12 @@ const AccountPage = (props)=>{ } }, []); - // function to set the active save location const setActiveSaveLocation = (newSelection)=>{ if(saveLocation === newSelection) return; window.localStorage.setItem(SAVEKEY, newSelection); setSaveLocation(newSelection); }; - // render a button for setting save locations. // todo: should this be a set of radio buttons (well styled) since it's either/or choice? const renderSaveLocationButton = (name, key, shouldRender = true)=>{ if(!shouldRender) return null; From 810934f2c1237134255c08faf11cfed590e8661f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 15:42:16 +0000 Subject: [PATCH 43/49] Bump eslint-plugin-jest from 27.9.0 to 28.2.0 Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.9.0 to 28.2.0. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v27.9.0...v28.2.0) --- updated-dependencies: - dependency-name: eslint-plugin-jest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 201 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 101 insertions(+), 102 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0e69c6d7c..5750674c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ }, "devDependencies": { "eslint": "^8.57.0", - "eslint-plugin-jest": "^27.9.0", + "eslint-plugin-jest": "^28.2.0", "eslint-plugin-react": "^7.34.1", "jest": "^29.7.0", "jest-expect-message": "^1.1.3", @@ -1900,9 +1900,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.3.0.tgz", - "integrity": "sha512-v3oplH6FYCULtFuCeqyuTd9D2WKO937Dxdq+GmHOLL72TTRriLxz2VLlNfkZRsvj6PKnOPAtuT6dwrs/pA5DvA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" @@ -2960,9 +2960,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/minimist": { @@ -2984,9 +2984,9 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "node_modules/@types/stack-utils": { @@ -3024,16 +3024,16 @@ "dev": true }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.58.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.58.0.tgz", - "integrity": "sha512-b+w8ypN5CFvrXWQb9Ow9T4/6LC2MikNf1viLkYTiTbkQl46CnR69w7lajz1icW0TBsYmlpg+mRzFJ4LEJ8X9NA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.58.0", - "@typescript-eslint/visitor-keys": "5.58.0" + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -3041,12 +3041,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.58.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.58.0.tgz", - "integrity": "sha512-JYV4eITHPzVQMnHZcYJXl2ZloC7thuUHrcUmxtzvItyKPvQ50kb9QXBkgNAt90OYMqwaodQh2kHutWZl1fc+1g==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -3054,21 +3054,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.58.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.58.0.tgz", - "integrity": "sha512-cRACvGTodA+UxnYM2uwA2KCwRL7VAzo45syNysqlMyNyjw0Z35Icc9ihPJZjIYuA5bXJYiJ2YGUB59BqlOZT1Q==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.58.0", - "@typescript-eslint/visitor-keys": "5.58.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -3080,6 +3081,15 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -3092,10 +3102,25 @@ "node": ">=10" } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3114,51 +3139,28 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "5.58.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.58.0.tgz", - "integrity": "sha512-gAmLOTFXMXOC+zP1fsqm3VceKSBQJNzV385Ok3+yzlavNHZoedajjS4UyS21gabJYcobuigQPs/z71A9MdJFqQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.58.0", - "@typescript-eslint/types": "5.58.0", - "@typescript-eslint/typescript-estree": "5.58.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" + "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/utils/node_modules/lru-cache": { @@ -3174,9 +3176,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3195,16 +3197,16 @@ "dev": true }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.58.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.58.0.tgz", - "integrity": "sha512-/fBraTlPj0jwdyTwLyrRTxv/3lnU2H96pNTVM6z3esTWLtA5MZ9ghSMJ7Rb+TtUAdtEw9EyJzJ0EydIMKxQ9gA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.58.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -5746,19 +5748,19 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "27.9.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.9.0.tgz", - "integrity": "sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==", + "version": "28.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.2.0.tgz", + "integrity": "sha512-yRDti/a+f+SMSmNTiT9/M/MzXGkitl8CfzUxnpoQcTyfq8gUrXMriVcWU36W1X6BZSUoyUCJrDAWWUA2N4hE5g==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "^5.10.0" + "@typescript-eslint/utils": "^6.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^16.10.0 || ^18.12.0 || >=20.0.0" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0 || ^7.0.0", - "eslint": "^7.0.0 || ^8.0.0", + "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0", + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", "jest": "*" }, "peerDependenciesMeta": { @@ -14011,26 +14013,23 @@ "utf8-byte-length": "^1.0.1" } }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, "node_modules/tty-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", @@ -14160,9 +14159,9 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz", + "integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==", "dev": true, "peer": true, "bin": { @@ -14170,7 +14169,7 @@ "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" } }, "node_modules/umd": { diff --git a/package.json b/package.json index 8dcb7356a..490e32601 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ }, "devDependencies": { "eslint": "^8.57.0", - "eslint-plugin-jest": "^27.9.0", + "eslint-plugin-jest": "^28.2.0", "eslint-plugin-react": "^7.34.1", "jest": "^29.7.0", "jest-expect-message": "^1.1.3", From 9247967f93a10e3a163d925024b544bd86b97344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 9 Apr 2024 20:12:40 +0200 Subject: [PATCH 44/49] fixed published request --- client/homebrew/pages/errorPage/errors/errorIndex.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 5d242648c..f9d52c109 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -79,8 +79,7 @@ const errorIndex = (props)=>{ **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} - ${props.brew.published ? `[Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`: - 'This brew is unpublished, therefore we cannot grant you its share page URL.'}`, + [Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`, // User is not signed in; must be a user on the Authors List '04' : dedent` @@ -95,8 +94,7 @@ const errorIndex = (props)=>{ **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} - ${props.brew.published ? `[Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`: - 'This brew is unpublished, therefore we cannot grant you its share page URL.'}`, + [Click here to be redirected to the brew's share page.](/share/${props.brew.shareId})`, // Brew load error From 7097897df8cc1131863c62a47feefd5f74416519 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 9 Apr 2024 15:24:04 -0400 Subject: [PATCH 45/49] Remove "stub.published" from thrown error, since no longer used --- server/homebrew.api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index f9a2c6156..e73a704a8 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -83,9 +83,9 @@ const api = { if(accessType === 'edit' && (authorsExist && !(isAuthor || isInvited))) { const accessError = { name: 'Access Error', status: 401 }; if(req.account){ - throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId, published: stub.published }; + throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId}; } - throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId , published: stub.published}; + throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId}; } // If after all of that we still don't have a brew, throw an exception From e1186b4a1ed5f8bc2f3bb199b9a83e4567f82737 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 17 Apr 2024 01:01:58 -0400 Subject: [PATCH 46/49] Rename Inline to SingleLine --- shared/naturalcrit/markdown.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 8018bf63b..c2c0710dd 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -294,8 +294,8 @@ const superSubScripts = { } }; -const definitionListsInline = { - name : 'definitionListsInline', +const definitionListsSingleLine = { + name : 'definitionListsSingleLine', level : 'block', start(src) { return src.match(/^[^\n]*?::[^\n]*/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { @@ -312,7 +312,7 @@ const definitionListsInline = { } if(definitions.length) { return { - type : 'definitionListsInline', + type : 'definitionListsSingleLine', raw : src.slice(0, endIndex), definitions }; @@ -326,8 +326,8 @@ const definitionListsInline = { } }; -const definitionListsMultiline = { - name : 'definitionListsMultiline', +const definitionListsMultiLine = { + name : 'definitionListsMultiLine', level : 'block', start(src) { return src.match(/^[^\n]*\n::/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { @@ -353,7 +353,7 @@ const definitionListsMultiline = { } if(definitions.length) { return { - type : 'definitionListsMultiline', + type : 'definitionListsMultiLine', raw : src.slice(0, endIndex), definitions }; @@ -617,7 +617,7 @@ function MarkedVariables() { //^=====--------------------< Variable Handling >-------------------=====^// Marked.use(MarkedVariables()); -Marked.use({ extensions: [definitionListsMultiline, definitionListsInline, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] }); +Marked.use({ extensions: [definitionListsMultiLine, definitionListsSingleLine, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] }); Marked.use(mustacheInjectBlock); Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false }); Marked.use(MarkedExtendedTables(), MarkedGFMHeadingId(), MarkedSmartypantsLite()); From 68a68bde829f33039c298cc63329d66db0899ece Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 17 Apr 2024 01:03:25 -0400 Subject: [PATCH 47/49] Only check for DLs at start of line Previous "start" regex used `^` instead of `\n`, which meant if the first character in a line failed to start a match, it would check for the start of a DL in *every* character in the line, which slows things down a lot. --- shared/naturalcrit/markdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index c2c0710dd..f72955bf3 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -297,7 +297,7 @@ const superSubScripts = { const definitionListsSingleLine = { name : 'definitionListsSingleLine', level : 'block', - start(src) { return src.match(/^[^\n]*?::[^\n]*/m)?.index; }, // Hint to Marked.js to stop and check for a match + start(src) { return src.match(/\n[^\n]*?::[^\n]*/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const regex = /^([^\n]*?)::([^\n]*)(?:\n|$)/ym; let match; @@ -329,7 +329,7 @@ const definitionListsSingleLine = { const definitionListsMultiLine = { name : 'definitionListsMultiLine', level : 'block', - start(src) { return src.match(/^[^\n]*\n::/m)?.index; }, // Hint to Marked.js to stop and check for a match + start(src) { return src.match(/\n[^\n]*\n::/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const regex = /(\n?\n?(?!::)[^\n]+?(?=\n::))|\n::(.(?:.|\n)*?(?=(?:\n::)|(?:\n\n)|$))/y; let match; From 709c9ece7459860a221d1d5b5922686c7ee12f32 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 18 Apr 2024 16:20:09 -0400 Subject: [PATCH 48/49] Change to camelCase --- themes/V3/5ePHB/style.less | 2 +- themes/V3/Blank/style.less | 2 +- themes/fonts/icon fonts/dicefont.less | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 37327fb19..25b784cfc 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -1,6 +1,6 @@ @import (less) './themes/assets/assets.less'; @import (less) './themes/fonts/icon fonts/font-icons.less'; -@import (less) './themes/fonts/icon fonts/dicefont.less'; +@import (less) './themes/fonts/icon fonts/diceFont.less'; :root { //Colors diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 1d8ca6ee4..ec8905630 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -1,6 +1,6 @@ @import (less) './themes/fonts/5e/fonts.less'; @import (less) './themes/assets/assets.less'; -@import (less) './themes/fonts/icon fonts/dicefont.less'; +@import (less) './themes/fonts/icon fonts/diceFont.less'; :root { //Colors diff --git a/themes/fonts/icon fonts/dicefont.less b/themes/fonts/icon fonts/dicefont.less index 78a88f03a..069f6f769 100644 --- a/themes/fonts/icon fonts/dicefont.less +++ b/themes/fonts/icon fonts/dicefont.less @@ -1,9 +1,9 @@ -/* Icon Font: dicefont */ +/* Icon Font: diceFont */ @font-face { font-family : 'DiceFont'; font-style : normal; font-weight : normal; - src : url('../../../fonts/icon fonts/dicefont.woff2'); + src : url('../../../fonts/icon fonts/diceFont.woff2'); } .df { From 1018ba554f20a872a97e4fdb9699e2bec6bd71b3 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 18 Apr 2024 16:42:06 -0400 Subject: [PATCH 49/49] rename files to camelCase --- .../icon fonts/{dicefont.less => diceFont.less} | 0 .../icon fonts/{dicefont.woff2 => diceFont.woff2} | Bin .../{dicefont_license.md => diceFont_license.md} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename themes/fonts/icon fonts/{dicefont.less => diceFont.less} (100%) rename themes/fonts/icon fonts/{dicefont.woff2 => diceFont.woff2} (100%) rename themes/fonts/icon fonts/{dicefont_license.md => diceFont_license.md} (100%) diff --git a/themes/fonts/icon fonts/dicefont.less b/themes/fonts/icon fonts/diceFont.less similarity index 100% rename from themes/fonts/icon fonts/dicefont.less rename to themes/fonts/icon fonts/diceFont.less diff --git a/themes/fonts/icon fonts/dicefont.woff2 b/themes/fonts/icon fonts/diceFont.woff2 similarity index 100% rename from themes/fonts/icon fonts/dicefont.woff2 rename to themes/fonts/icon fonts/diceFont.woff2 diff --git a/themes/fonts/icon fonts/dicefont_license.md b/themes/fonts/icon fonts/diceFont_license.md similarity index 100% rename from themes/fonts/icon fonts/dicefont_license.md rename to themes/fonts/icon fonts/diceFont_license.md