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 ( <> 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.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index d457d92f2..8e643a837 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -151,17 +151,20 @@ 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 ; + }) + } +
; }, replaceContent : function(item){ @@ -220,40 +223,46 @@ 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')}> - + +
+
this.props.onViewChange('text')}> + +
+
this.props.onViewChange('style')}> + +
+
this.props.onViewChange('meta')}> + +
+
; }, @@ -291,8 +300,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..a4d273bbf 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -4,97 +4,108 @@ .snippetBar { @menuHeight : 25px; position : relative; - height : @menuHeight; + display : flex; + flex-wrap : wrap-reverse; + justify-content : space-between; + min-width : 331px; + height : auto; color : black; background-color : #DDDDDD; + .snippets { + display : flex; + justify-content : space-evenly; + } + .editors { - position : absolute; - top : 0px; - right : 0px; 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'); - } - &.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 { + display : flex; + flex : 1; + justify-content : space-around; + + &:first-child { border-left : none; } + + & > div { + position : relative; + 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'); + position : relative; + font-size : 0.75em; + color : grey; + 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; @@ -104,6 +115,7 @@ font-weight : 800; line-height : @menuHeight; text-transform : uppercase; + text-wrap : nowrap; cursor : pointer; &:hover, &.selected { background-color : #999999; } i { @@ -120,7 +132,7 @@ .tooltipLeft('Edit Brew Properties'); } .snippetGroup { - border-right : 1px solid currentColor; + &:hover { & > .dropdown { visibility : visible; } } @@ -142,11 +154,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; @@ -179,6 +191,7 @@ } } .name { margin-right : auto; } + .disabled { text-decoration : line-through; } .beta { align-self : center; padding : 4px 6px; @@ -204,4 +217,10 @@ } } } -} \ No newline at end of file +} + +@container editor (width < 553px) { + .editors,.snippets { flex : 1; } + .editors { border-bottom : 1px solid;} + .snippetBar .editors > div.history > .dropdown { right : unset; } +} 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", diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index c3094abc4..dbcdc6f2a 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -154,28 +154,6 @@ 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`, - }, - ] - } ] }, { @@ -214,6 +192,27 @@ module.exports = [ line-height: 1em; }\n\n` }, + { + name : 'Table of Contents Toggles', + icon : 'fas fa-book', + subsnippets : [ + { + name : 'Enable H1-H4 all pages', + icon : 'fas fa-dice-four', + gen : `.page {\n\th4 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H5 all pages', + icon : 'fas fa-dice-five', + gen : `.page {\n\th4, h5 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H6 all pages', + icon : 'fas fa-dice-six', + gen : `.page {\n\th4, h5, h6 {--TOC: include; }\n}\n\n`, + }, + ] + } ] }, diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 5a2b5cf3f..ba975e58a 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -812,17 +812,8 @@ 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; } -} - -.pages:has(.tocGlobalH6) { - h4, h5, h6 {--TOC: include; } -} +//NOTE: DO NOT USE :HAS WITH .PAGES!!! EXTREMELY SLOW TO RENDER ON LARGE DOCS! // Block level inclusion changes // These include either a single (include) or a range (depth)