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/15] 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/15] 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/15] 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/15] "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/15] 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/15] 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 f2f06b23fd3c80ce518393abf5593ffe3acfc0e0 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 17 Oct 2024 16:42:57 -0400 Subject: [PATCH 07/15] Disable Global ToC Snippet --- .../homebrew/editor/snippetbar/snippetbar.jsx | 3 +- .../editor/snippetbar/snippetbar.less | 1 + themes/V3/5ePHB/snippets.js | 39 ++++++++++--------- themes/V3/5ePHB/style.less | 21 +++++----- 4 files changed, 36 insertions(+), 28 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index d457d92f2..3b8520284 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -291,8 +291,9 @@ const SnippetGroup = createClass({ return _.map(snippets, (snippet)=>{ return
this.handleSnippetClick(e, snippet)}> - {snippet.name} + {snippet.name} {snippet.experimental && beta} + {snippet.disabled && disabled} {snippet.subsnippets && <>
diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index c50d9df4c..434ee4beb 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -179,6 +179,7 @@ } } .name { margin-right : auto; } + .disabled { text-decoration: line-through; } .beta { align-self : center; padding : 4px 6px; diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index c3094abc4..543b1cf5c 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -157,24 +157,27 @@ module.exports = [ { name : 'Table of Contents Toggles', icon : 'fas fa-book', - gen : `{{tocGlobalH4}}\n\n`, - 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`, - }, - ] + //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`, + // }, + // ] } ] }, diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 5a2b5cf3f..1216d0370 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -812,17 +812,20 @@ h6, // Brew level default inclusion changes. // These add Headers 'back' to inclusion. -.pages:has(.tocGlobalH4) { - h4 {--TOC: include; } -} -.pages:has(.tocGlobalH5) { - h4, h5 {--TOC: include; } -} +//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(.tocGlobalH6) { - h4, h5, h6 {--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 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 08/15] 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 09/15] 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 10/15] 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 11/15] 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 12/15] 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 13/15] 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 14/15] 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 15/15] 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; } - }