From f449132b4c446e3c1659d26578156e7668ed5752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 14 Aug 2024 20:38:38 +0200 Subject: [PATCH 01/17] wrap correctly --- client/homebrew/editor/editor.less | 1 + client/homebrew/editor/snippetbar/snippetbar.less | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/client/homebrew/editor/editor.less b/client/homebrew/editor/editor.less index f8dc249d6..b2e96683e 100644 --- a/client/homebrew/editor/editor.less +++ b/client/homebrew/editor/editor.less @@ -2,6 +2,7 @@ .editor { position : relative; width : 100%; + container: editor / inline-size; .codeEditor { height : 100%; diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index e0a24fac9..19d4c3d4f 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -2,11 +2,18 @@ @import (less) '././././themes/fonts/5e/fonts.less'; .snippetBar { - @menuHeight : 25px; + @menuHeight : 25px; position : relative; height : @menuHeight; color : black; background-color : #DDDDDD; + min-width : 331px; + + @container editor (width < 538px) { + display : flex; + flex-wrap : wrap; + height : 50px; + } .editors { position : absolute; @@ -15,6 +22,11 @@ display : flex; justify-content : space-between; height : @menuHeight; + + @container editor (width < 538px) { + position : static; + } + & > div { width : @menuHeight; height : @menuHeight; From bbe56bf4435b3f68550e3387b2812a78cb725304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 14 Aug 2024 20:39:15 +0200 Subject: [PATCH 02/17] linting --- client/homebrew/editor/snippetbar/snippetbar.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 19d4c3d4f..86e4c9ffc 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -4,10 +4,10 @@ .snippetBar { @menuHeight : 25px; position : relative; + min-width : 331px; height : @menuHeight; color : black; background-color : #DDDDDD; - min-width : 331px; @container editor (width < 538px) { display : flex; @@ -139,11 +139,11 @@ cursor : pointer; .animate(background-color); i { + min-width : 25px; height : 1.2em; margin-right : 8px; font-size : 1.2em; - min-width: 25px; - text-align: center; + text-align : center; & ~ i { margin-right : 0; margin-left : 5px; From cc76ff147843fccb7f1f9c5c40140bf2b2e04f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 15 Aug 2024 12:07:55 +0200 Subject: [PATCH 03/17] relocated container query --- .../editor/snippetbar/snippetbar.less | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 86e4c9ffc..7180da562 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -9,12 +9,6 @@ color : black; background-color : #DDDDDD; - @container editor (width < 538px) { - display : flex; - flex-wrap : wrap; - height : 50px; - } - .editors { position : absolute; top : 0px; @@ -22,10 +16,6 @@ display : flex; justify-content : space-between; height : @menuHeight; - - @container editor (width < 538px) { - position : static; - } & > div { width : @menuHeight; @@ -201,4 +191,17 @@ } } } +} + +@container editor (width < 538px) { + + .snippetBar { + display : flex; + flex-wrap : wrap; + height : 50px; + + .editors { + position : static; + } + } } \ No newline at end of file From 1f41745d2b47267db25ee5105f220f68e0c41998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 23 Aug 2024 13:37:12 +0200 Subject: [PATCH 04/17] "Refactored Snippetbar component: updated JSX structure, added div wrapper for snippets, changed CSS styles for editors and snippets" --- .../homebrew/editor/snippetbar/snippetbar.jsx | 64 ++++++++++--------- .../editor/snippetbar/snippetbar.less | 10 ++- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index af493c961..dd45f0773 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -125,19 +125,23 @@ const Snippetbar = createClass({ renderSnippetGroups : function(){ const snippets = this.state.snippets.filter((snippetGroup)=>snippetGroup.view === this.props.view); - return _.map(snippets, (snippetGroup)=>{ - return ; - }); + return
+ {_.map(snippets, (snippetGroup)=>{ + return ; + }) + } +
}, + renderEditorButtons : function(){ if(!this.props.showEditButtons) return; @@ -158,23 +162,6 @@ const Snippetbar = createClass({ } return
-
- -
-
- -
-
- {foldButtons} -
- - {this.state.themeSelector && this.renderThemeSelector()} -
- -
this.props.onViewChange('text')}> @@ -186,14 +173,33 @@ const Snippetbar = createClass({
this.props.onViewChange('meta')}> +
+
+ {foldButtons} +
+ + {this.state.themeSelector && this.renderThemeSelector()}
+ +
+
+ +
+
+ +
+
; }, render : function(){ return
- {this.renderSnippetGroups()} {this.renderEditorButtons()} + {this.renderSnippetGroups()} +
; } }); diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 7180da562..7b0754a07 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -8,11 +8,15 @@ height : @menuHeight; color : black; background-color : #DDDDDD; + display: flex; - .editors { + .snippets { position : absolute; top : 0px; right : 0px; + } + + .editors { display : flex; justify-content : space-between; height : @menuHeight; @@ -107,7 +111,7 @@ .tooltipLeft('Edit Brew Properties'); } .snippetGroup { - border-right : 1px solid currentColor; + border-left : 1px solid currentColor; &:hover { & > .dropdown { visibility : visible; } } @@ -200,7 +204,7 @@ flex-wrap : wrap; height : 50px; - .editors { + .snippets { position : static; } } From 1aabb84731e64e8227be66e90ba75ceaf1c3148a Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 10 Oct 2024 17:40:32 -0500 Subject: [PATCH 05/17] Revert --experimental-vm-modules Code works but does not work with jest as expected. --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f8007c608..cd4fda141 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "url": "git://github.com/naturalcrit/homebrewery.git" }, "scripts": { - "dev": "node --experimental-require-module scripts/dev.js", - "quick": "node --experimental-require-module scripts/quick.js", - "build": "node --experimental-require-module scripts/buildHomebrew.js && node --experimental-require-module scripts/buildAdmin.js", - "builddev": "node --experimental-require-module scripts/buildHomebrew.js --dev", + "dev": "node scripts/dev.js", + "quick": "node scripts/quick.js", + "build": "node scripts/buildHomebrew.js && node scripts/buildAdmin.js", + "builddev": "node scripts/buildHomebrew.js --dev", "lint": "eslint --fix", "lint:dry": "eslint", "stylelint": "stylelint --fix **/*.{less}", @@ -38,10 +38,10 @@ "test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace", "test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace", "test:route": "jest tests/routes/static-pages.test.js --verbose", - "phb": "node --experimental-require-module scripts/phb.js", + "phb": "node scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run build", - "start": "node --experimental-require-module server.js" + "start": "node server.js" }, "author": "stolksdorf", "license": "MIT", From 9506be6b65f687e095e95278c3362121b425656c Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 10 Oct 2024 17:41:40 -0500 Subject: [PATCH 06/17] Revert "Revert --experimental-vm-modules" This reverts commit 1aabb84731e64e8227be66e90ba75ceaf1c3148a. --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index cd4fda141..f8007c608 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "url": "git://github.com/naturalcrit/homebrewery.git" }, "scripts": { - "dev": "node scripts/dev.js", - "quick": "node scripts/quick.js", - "build": "node scripts/buildHomebrew.js && node scripts/buildAdmin.js", - "builddev": "node scripts/buildHomebrew.js --dev", + "dev": "node --experimental-require-module scripts/dev.js", + "quick": "node --experimental-require-module scripts/quick.js", + "build": "node --experimental-require-module scripts/buildHomebrew.js && node --experimental-require-module scripts/buildAdmin.js", + "builddev": "node --experimental-require-module scripts/buildHomebrew.js --dev", "lint": "eslint --fix", "lint:dry": "eslint", "stylelint": "stylelint --fix **/*.{less}", @@ -38,10 +38,10 @@ "test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace", "test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace", "test:route": "jest tests/routes/static-pages.test.js --verbose", - "phb": "node scripts/phb.js", + "phb": "node --experimental-require-module scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run build", - "start": "node server.js" + "start": "node --experimental-require-module server.js" }, "author": "stolksdorf", "license": "MIT", From 5a75182affeada869e75a177124a749143231037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 18 Oct 2024 00:52:26 +0200 Subject: [PATCH 07/17] changes as requested, wrapping of editor tools, and linting --- .../homebrew/editor/snippetbar/snippetbar.jsx | 95 ++++----- .../editor/snippetbar/snippetbar.less | 194 ++++++++++-------- 2 files changed, 145 insertions(+), 144 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index fc6bc6db6..8e643a837 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -151,7 +151,7 @@ const Snippetbar = createClass({ renderSnippetGroups : function(){ const snippets = this.state.snippets.filter((snippetGroup)=>snippetGroup.view === this.props.view); - return
+ return
{_.map(snippets, (snippetGroup)=>{ return ; - }) + />; + }) } -
+
; }, replaceContent : function(item){ @@ -223,66 +223,53 @@ const Snippetbar = createClass({ } return
-
- - { this.state.showHistory && this.renderHistoryItems() } +
+
+ + { this.state.showHistory && this.renderHistoryItems() } +
+
+ +
+
+ +
-
- -
-
- -
-
- {foldButtons} -
- - {this.state.themeSelector && this.renderThemeSelector()} +
+ {foldButtons} +
+ + {this.state.themeSelector && this.renderThemeSelector()} +
-
-
this.props.onViewChange('text')}> - -
-
this.props.onViewChange('style')}> - -
-
this.props.onViewChange('meta')}> - -
-
- {foldButtons} -
- - {this.state.themeSelector && this.renderThemeSelector()} + +
+
this.props.onViewChange('text')}> + +
+
this.props.onViewChange('style')}> + +
+
this.props.onViewChange('meta')}> + +
-
-
- -
-
- -
-
; }, render : function(){ return
- {this.renderEditorButtons()} {this.renderSnippetGroups()} - + {this.renderEditorButtons()}
; } }); @@ -315,7 +302,7 @@ const SnippetGroup = createClass({ {snippet.name} {snippet.experimental && beta} - {snippet.disabled && disabled} + {snippet.disabled && disabled} {snippet.subsnippets && <>
diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 852a95c98..780ae7a2c 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -5,102 +5,113 @@ @menuHeight : 25px; position : relative; min-width : 331px; - height : @menuHeight; + height : auto; color : black; background-color : #DDDDDD; display: flex; + justify-content: space-between; + flex-wrap:wrap-reverse; .snippets { - position : absolute; - top : 0px; - right : 0px; + display : flex; + justify-content : space-between; } .editors { display : flex; justify-content : space-between; - height : @menuHeight; - - & > div { - width : @menuHeight; - height : @menuHeight; - line-height : @menuHeight; - text-align : center; - cursor : pointer; - &:hover,&.selected { background-color : #999999; } - &.text { - .tooltipLeft('Brew Editor'); + >div { + display:flex; + justify-content: space-around; + flex:1; + border-left:1px solid; + + &:first-child { + border-left: none; } - &.style { - .tooltipLeft('Style Editor'); - } - &.meta { - .tooltipLeft('Properties'); - } - &.undo { - .tooltipLeft('Undo'); - font-size : 0.75em; - color : grey; - &.active { color : inherit; } - } - &.redo { - .tooltipLeft('Redo'); - font-size : 0.75em; - color : grey; - &.active { color : inherit; } - } - &.foldAll { - .tooltipLeft('Fold All'); - font-size : 0.75em; - color : inherit; - } - &.unfoldAll { - .tooltipLeft('Unfold All'); - font-size : 0.75em; - color : inherit; - } - &.history { - .tooltipLeft('History'); - font-size : 0.75em; - color : grey; - position : relative; - &.active { - color : inherit; + + & > div { + width : @menuHeight; + height : @menuHeight; + line-height : @menuHeight; + text-align : center; + cursor : pointer; + &:hover,&.selected { background-color : #999999; } + &.text { + .tooltipLeft('Brew Editor'); } - &>.dropdown{ - right : -1px; - &>.snippet{ - padding-right : 10px; + &.style { + .tooltipLeft('Style Editor'); + } + &.meta { + .tooltipLeft('Properties'); + } + &.undo { + .tooltipLeft('Undo'); + font-size : 0.75em; + color : grey; + &.active { color : inherit; } + } + &.redo { + .tooltipLeft('Redo'); + font-size : 0.75em; + color : grey; + &.active { color : inherit; } + } + &.foldAll { + .tooltipLeft('Fold All'); + font-size : 0.75em; + color : inherit; + } + &.unfoldAll { + .tooltipLeft('Unfold All'); + font-size : 0.75em; + color : inherit; + } + &.history { + .tooltipLeft('History'); + font-size : 0.75em; + color : grey; + position : relative; + border:none; + &.active { + color : inherit; + } + &>.dropdown{ + right : -1px; + &>.snippet{ + padding-right : 10px; + } } } - } - &.editorTheme { - .tooltipLeft('Editor Themes'); - font-size : 0.75em; - color : black; - &.active { - position : relative; - background-color : #999999; + &.editorTheme { + .tooltipLeft('Editor Themes'); + font-size : 0.75em; + color : black; + &.active { + position : relative; + background-color : #999999; + } + } + &.divider { + width : 5px; + background : linear-gradient(currentColor, currentColor) no-repeat center/1px 100%; + &:hover { background-color : inherit; } } } - &.divider { - width : 5px; - background : linear-gradient(currentColor, currentColor) no-repeat center/1px 100%; - &:hover { background-color : inherit; } + .themeSelector { + position : absolute; + top : 25px; + right : 0; + z-index : 10; + display : flex; + align-items : center; + justify-content : center; + width : 170px; + height : inherit; + background-color : inherit; } - } - .themeSelector { - position : absolute; - top : 25px; - right : 0; - z-index : 10; - display : flex; - align-items : center; - justify-content : center; - width : 170px; - height : inherit; - background-color : inherit; - } + } } .snippetBarButton { display : inline-block; @@ -111,6 +122,7 @@ line-height : @menuHeight; text-transform : uppercase; cursor : pointer; + text-wrap: nowrap; &:hover, &.selected { background-color : #999999; } i { margin-right : 3px; @@ -126,7 +138,8 @@ .tooltipLeft('Edit Brew Properties'); } .snippetGroup { - border-left : 1px solid currentColor; + border-right : 1px solid currentColor; + &:hover { & > .dropdown { visibility : visible; } } @@ -213,15 +226,16 @@ } } -@container editor (width < 538px) { +@container editor (width < 568px) { - .snippetBar { - display : flex; - flex-wrap : wrap; - height : 50px; - - .snippets { - position : static; - } + .editors,.snippets { + width:332.59px; } -} \ No newline at end of file + .editors { + border-right:1px solid; + } + .snippetBar .editors>div.history>.dropdown { + right:unset; + } + +} From 631ef795b75239505a2812ed046f2b108cb8c2eb Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 17 Oct 2024 18:30:31 -0500 Subject: [PATCH 08/17] Fix .tocGlobalH? Based on OH DEAR GOD THE LAG! discoveries related to the global toggles, these are being moved from a markup tag to a styles tab insert. --- themes/V3/5ePHB/snippets.js | 47 +++++++++++++++++-------------------- themes/V3/5ePHB/style.less | 12 ---------- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 543b1cf5c..798a36193 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -154,31 +154,6 @@ module.exports = [ ] }, - { - name : 'Table of Contents Toggles', - icon : 'fas fa-book', - //gen : `{{tocGlobalH4}}\n\n`, - disabled : true - // RELIES ON .PAGES:HAS() WHICH IS VERY SLOW - // WILL BE MOVED TO STYLE TAB SNIPPETS - // subsnippets : [ - // { - // name : 'Enable H1-H4 all pages', - // icon : 'fas fa-dice-four', - // gen : `{{tocGlobalH4}}\n\n`, - // }, - // { - // name : 'Enable H1-H5 all pages', - // icon : 'fas fa-dice-five', - // gen : `{{tocGlobalH5}}\n\n`, - // }, - // { - // name : 'Enable H1-H6 all pages', - // icon : 'fas fa-dice-six', - // gen : `{{tocGlobalH6}}\n\n`, - // }, - // ] - } ] }, { @@ -217,6 +192,28 @@ module.exports = [ line-height: 1em; }\n\n` }, + { + name : 'Table of Contents Toggles', + icon : 'fas fa-book', + disabled : false, + subsnippets : [ + { + name : 'Enable H1-H4 all pages', + icon : 'fas fa-dice-four', + gen : `\n.pages {\n h4 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H5 all pages', + icon : 'fas fa-dice-five', + gen : `\n.pages {\n h4, h5 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H6 all pages', + icon : 'fas fa-dice-six', + gen : `\n.pages {\n h4, h5, h6 {--TOC: include; }\n}\n\n`, + }, + ] + } ] }, diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 1216d0370..ba975e58a 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -814,18 +814,6 @@ h6, // These add Headers 'back' to inclusion. //NOTE: DO NOT USE :HAS WITH .PAGES!!! EXTREMELY SLOW TO RENDER ON LARGE DOCS! -//WILL BE MOVED TO A STYLE TAB SNIPPET INSTEAD -// .pages:has(.tocGlobalH4) { -// h4 {--TOC: include; } -// } - -// .pages:has(.tocGlobalH5) { -// h4, h5 {--TOC: include; } -// } - -// .pages:has(.tocGlobalH6) { -// h4, h5, h6 {--TOC: include; } -// } // Block level inclusion changes // These include either a single (include) or a range (depth) From cd09408aa89d5e2598fecd1da14d24f98e28e8dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 03:37:53 +0000 Subject: [PATCH 09/17] Bump mongoose from 8.7.1 to 8.7.2 Bumps [mongoose](https://github.com/Automattic/mongoose) from 8.7.1 to 8.7.2. - [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.7.1...8.7.2) --- updated-dependencies: - dependency-name: mongoose dependency-type: direct:production update-type: version-update:semver-patch ... 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 e3fb0ad29..76c6e2dd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.7.1", + "mongoose": "^8.7.2", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.3.1", @@ -10661,9 +10661,9 @@ } }, "node_modules/mongoose": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.7.1.tgz", - "integrity": "sha512-RpNMyhyzLVCVbf8xTVbrf/18G3MqQzNw5pJdvOJ60fzbCa3cOZzz9L+8XpqzBXtRlgZGWv0T7MmOtvrT8ocp1Q==", + "version": "8.7.2", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.7.2.tgz", + "integrity": "sha512-Ok4VzMds9p5G3ZSUhmvBm1GdxanbzhS29jpSn02SPj+IXEVFnIdfwAlHHXWkyNscZKlcn8GuMi68FH++jo0flg==", "dependencies": { "bson": "^6.7.0", "kareem": "2.6.3", diff --git a/package.json b/package.json index a4c6ee38a..d25c1b1d1 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.7.1", + "mongoose": "^8.7.2", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.3.1", From ac766f3b37428f9d0029840d00d11807689b61c2 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 18 Oct 2024 10:23:56 -0400 Subject: [PATCH 10/17] Update brewRenderer.jsx --- client/homebrew/brewRenderer/brewRenderer.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index dba99638b..b9b9f5589 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -179,8 +179,8 @@ const BrewRenderer = (props)=>{ styleObject.backgroundImage = `url("data:image/svg+xml;utf8,${global.config.deployment}")`; } - const renderedStyle = useMemo(()=> renderStyle(), [props.style?.length, props.themeBundle]); - renderedPages = useMemo(() => renderPages(), [props.text?.length]); + const renderedStyle = useMemo(()=> renderStyle(), [props.style, props.themeBundle]); + renderedPages = useMemo(() => renderPages(), [props.text]); return ( <> From 9d81f50b609dc551375af031639fe4db386d7da1 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 18 Oct 2024 10:46:59 -0400 Subject: [PATCH 11/17] Remove `disabled = false` Don't need that tag at all when it's false. --- themes/V3/5ePHB/snippets.js | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 798a36193..f06064895 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -195,7 +195,6 @@ module.exports = [ { name : 'Table of Contents Toggles', icon : 'fas fa-book', - disabled : false, subsnippets : [ { name : 'Enable H1-H4 all pages', From d53a271c9ff8be2c736b2bb8720ead0a74747b2b Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 18 Oct 2024 10:53:16 -0400 Subject: [PATCH 12/17] Change to `.page` and tweak spacing/newlines to match other snippets All of our "global" style snippets are just set at `.page`, not `.pages`. This still applies globally but is consistent with our current approach. --- themes/V3/5ePHB/snippets.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index f06064895..dbcdc6f2a 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -199,17 +199,17 @@ module.exports = [ { name : 'Enable H1-H4 all pages', icon : 'fas fa-dice-four', - gen : `\n.pages {\n h4 {--TOC: include; }\n}\n\n`, + gen : `.page {\n\th4 {--TOC: include; }\n}\n\n`, }, { name : 'Enable H1-H5 all pages', icon : 'fas fa-dice-five', - gen : `\n.pages {\n h4, h5 {--TOC: include; }\n}\n\n`, + gen : `.page {\n\th4, h5 {--TOC: include; }\n}\n\n`, }, { name : 'Enable H1-H6 all pages', icon : 'fas fa-dice-six', - gen : `\n.pages {\n h4, h5, h6 {--TOC: include; }\n}\n\n`, + gen : `.page {\n\th4, h5, h6 {--TOC: include; }\n}\n\n`, }, ] } From 1d663ef38d6ec9a2ab6222bd22eea0cb03bcba59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sun, 20 Oct 2024 12:19:38 +0200 Subject: [PATCH 13/17] last iteration --- .../editor/snippetbar/snippetbar.less | 53 +++++++------------ 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 780ae7a2c..b766e7fe1 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -4,33 +4,31 @@ .snippetBar { @menuHeight : 25px; position : relative; + display : flex; + flex-wrap : wrap-reverse; + justify-content : space-between; min-width : 331px; height : auto; color : black; background-color : #DDDDDD; - display: flex; - justify-content: space-between; - flex-wrap:wrap-reverse; .snippets { display : flex; - justify-content : space-between; + justify-content : space-evenly; } .editors { display : flex; justify-content : space-between; >div { - display:flex; - justify-content: space-around; - flex:1; - border-left:1px solid; + display : flex; + flex : 1; + justify-content : space-around; - &:first-child { - border-left: none; - } + &:first-child { border-left : none; } & > div { + position : relative; width : @menuHeight; height : @menuHeight; line-height : @menuHeight; @@ -70,18 +68,14 @@ } &.history { .tooltipLeft('History'); + position : relative; font-size : 0.75em; color : grey; - position : relative; - border:none; - &.active { - color : inherit; - } - &>.dropdown{ + border : none; + &.active { color : inherit; } + & > .dropdown { right : -1px; - &>.snippet{ - padding-right : 10px; - } + & > .snippet { padding-right : 10px; } } } &.editorTheme { @@ -121,8 +115,8 @@ font-weight : 800; line-height : @menuHeight; text-transform : uppercase; + text-wrap : nowrap; cursor : pointer; - text-wrap: nowrap; &:hover, &.selected { background-color : #999999; } i { margin-right : 3px; @@ -138,7 +132,6 @@ .tooltipLeft('Edit Brew Properties'); } .snippetGroup { - border-right : 1px solid currentColor; &:hover { & > .dropdown { visibility : visible; } @@ -198,7 +191,7 @@ } } .name { margin-right : auto; } - .disabled { text-decoration: line-through; } + .disabled { text-decoration : line-through; } .beta { align-self : center; padding : 4px 6px; @@ -226,16 +219,10 @@ } } -@container editor (width < 568px) { +@container editor (width < 553px) { - .editors,.snippets { - width:332.59px; - } - .editors { - border-right:1px solid; - } - .snippetBar .editors>div.history>.dropdown { - right:unset; - } + .editors,.snippets { flex:1; } + .editors { border-bottom:1px solid} + .snippetBar .editors > div.history > .dropdown { right : unset; } } From 0e9021049c9c50c132e88d3d545f6b61bd7fd221 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sun, 20 Oct 2024 13:00:05 -0400 Subject: [PATCH 14/17] lint --- client/homebrew/editor/snippetbar/snippetbar.less | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index b766e7fe1..a4d273bbf 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -2,7 +2,7 @@ @import (less) '././././themes/fonts/5e/fonts.less'; .snippetBar { - @menuHeight : 25px; + @menuHeight : 25px; position : relative; display : flex; flex-wrap : wrap-reverse; @@ -74,7 +74,7 @@ border : none; &.active { color : inherit; } & > .dropdown { - right : -1px; + right : -1px; & > .snippet { padding-right : 10px; } } } @@ -220,9 +220,7 @@ } @container editor (width < 553px) { - - .editors,.snippets { flex:1; } - .editors { border-bottom:1px solid} + .editors,.snippets { flex : 1; } + .editors { border-bottom : 1px solid;} .snippetBar .editors > div.history > .dropdown { right : unset; } - } From 5994e0d0b36bc061ec79fec5638be10ed96ce50b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 03:20:07 +0000 Subject: [PATCH 15/17] Bump eslint from 9.12.0 to 9.13.0 Bumps [eslint](https://github.com/eslint/eslint) from 9.12.0 to 9.13.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v9.12.0...v9.13.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 76c6e2dd0..f53d72195 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,7 @@ }, "devDependencies": { "@stylistic/stylelint-plugin": "^3.1.1", - "eslint": "^9.12.0", + "eslint": "^9.13.0", "eslint-plugin-jest": "^28.8.3", "eslint-plugin-react": "^7.37.1", "globals": "^15.11.0", @@ -1881,9 +1881,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", + "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1927,9 +1927,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", + "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5702,17 +5702,17 @@ } }, "node_modules/eslint": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", + "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", + "@eslint/core": "^0.7.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.12.0", + "@eslint/js": "9.13.0", "@eslint/plugin-kit": "^0.2.0", "@humanfs/node": "^0.16.5", "@humanwhocodes/module-importer": "^1.0.1", diff --git a/package.json b/package.json index d25c1b1d1..b1e391931 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ }, "devDependencies": { "@stylistic/stylelint-plugin": "^3.1.1", - "eslint": "^9.12.0", + "eslint": "^9.13.0", "eslint-plugin-jest": "^28.8.3", "eslint-plugin-react": "^7.37.1", "globals": "^15.11.0", From 41a60e63120b4f1561a50ba58a7b16f9f7732188 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 03:20:23 +0000 Subject: [PATCH 16/17] Bump superagent from 10.1.0 to 10.1.1 Bumps [superagent](https://github.com/ladjs/superagent) from 10.1.0 to 10.1.1. - [Release notes](https://github.com/ladjs/superagent/releases) - [Changelog](https://github.com/ladjs/superagent/blob/master/HISTORY.md) - [Commits](https://github.com/ladjs/superagent/compare/v10.1.0...v10.1.1) --- updated-dependencies: - dependency-name: superagent dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 26 ++++++++++++-------------- package.json | 2 +- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 76c6e2dd0..db7e5e4ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "react-frame-component": "^4.1.3", "react-router-dom": "6.27.0", "sanitize-filename": "1.6.3", - "superagent": "^10.1.0", + "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { @@ -6551,13 +6551,12 @@ } }, "node_modules/formidable": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.1.tgz", - "integrity": "sha512-WJWKelbRHN41m5dumb0/k8TeAx7Id/y3a+Z7QfhxP/htI9Js5zYaEDtG8uMgG0vM0lOlqnmjE99/kfpOYi/0Og==", - "license": "MIT", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.2.tgz", + "integrity": "sha512-Jqc1btCy3QzRbJaICGwKcBfGWuLADRerLzDqi2NwSt/UkXLsHJw2TVResiaoBufHVHy9aSgClOHCeJsSsFLTbg==", "dependencies": { "dezalgo": "^1.0.4", - "hexoid": "^1.0.0", + "hexoid": "^2.0.0", "once": "^1.4.0" }, "funding": { @@ -7190,10 +7189,9 @@ } }, "node_modules/hexoid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", - "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", - "license": "MIT", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-2.0.0.tgz", + "integrity": "sha512-qlspKUK7IlSQv2o+5I7yhUd7TxlOG2Vr5LTa3ve2XSNVKAL/n/u/7KLvKmFNimomDIKvZFXWHv0T12mv7rT8Aw==", "engines": { "node": ">=8" } @@ -13597,16 +13595,16 @@ } }, "node_modules/superagent": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.1.0.tgz", - "integrity": "sha512-JMmik7PbnXGlq7g528Gi6apHbVbTz2vrE3du6fuG4kIPSb2PnLoSOPvfjKn8aQYuJcBWAKW6ZG90qPPsE5jZxQ==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.1.1.tgz", + "integrity": "sha512-9pIwrHrOj3uAnqg9gDlW7EA2xv+N5au/dSM0kM22HTqmUu8jBxNT+8uA7tA3UoCnmiqzpSbu8rasIUZvbyamMQ==", "dependencies": { "component-emitter": "^1.3.0", "cookiejar": "^2.1.4", "debug": "^4.3.4", "fast-safe-stringify": "^2.1.1", "form-data": "^4.0.0", - "formidable": "^3.5.1", + "formidable": "^3.5.2", "methods": "^1.1.2", "mime": "2.6.0", "qs": "^6.11.0" diff --git a/package.json b/package.json index d25c1b1d1..891757a3e 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "react-frame-component": "^4.1.3", "react-router-dom": "6.27.0", "sanitize-filename": "1.6.3", - "superagent": "^10.1.0", + "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { From 0c98f832bbfab863aa4bf6349fefc803d19a96f5 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 21 Oct 2024 16:21:41 +1300 Subject: [PATCH 17/17] Add catch to await calls --- client/homebrew/pages/editPage/editPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index fcc43e81a..7fcee9e0c 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -228,8 +228,8 @@ const EditPage = createClass({ htmlErrors : Markdown.validate(prevState.brew.text) })); - await updateHistory(this.state.brew); - await versionHistoryGarbageCollection(); + await updateHistory(this.state.brew).catch(console.error); + await versionHistoryGarbageCollection().catch(console.error); const transfer = this.state.saveGoogle == _.isNil(this.state.brew.googleId);