diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index ed8cb87d5..d6502e985 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -10,6 +10,8 @@ const CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx'); const SnippetBar = require('./snippetbar/snippetbar.jsx'); const MetadataEditor = require('./metadataEditor/metadataEditor.jsx'); +const EDITOR_THEME_KEY = 'HOMEBREWERY-EDITOR-THEME'; + const SNIPPETBAR_HEIGHT = 25; const DEFAULT_STYLE_TEXT = dedent` /*=======--- Example CSS styling ---=======*/ @@ -34,12 +36,14 @@ const Editor = createClass({ onMetaChange : ()=>{}, reportError : ()=>{}, - renderer : 'legacy' + editorTheme : 'default', + renderer : 'legacy' }; }, getInitialState : function() { return { - view : 'text' //'text', 'style', 'meta' + editorTheme : this.props.editorTheme, + view : 'text' //'text', 'style', 'meta' }; }, @@ -51,6 +55,13 @@ const Editor = createClass({ this.updateEditorSize(); this.highlightCustomMarkdown(); window.addEventListener('resize', this.updateEditorSize); + + const editorTheme = window.localStorage.getItem(EDITOR_THEME_KEY); + if(editorTheme) { + this.setState({ + editorTheme : editorTheme + }); + } }, componentWillUnmount : function() { @@ -255,6 +266,13 @@ const Editor = createClass({ this.refs.codeEditor?.updateSize(); }, + updateEditorTheme : function(newTheme){ + window.localStorage.setItem(EDITOR_THEME_KEY, newTheme); + this.setState({ + editorTheme : newTheme + }); + }, + //Called by CodeEditor after document switch, so Snippetbar can refresh UndoHistory rerenderParent : function (){ this.forceUpdate(); @@ -269,6 +287,7 @@ const Editor = createClass({ view={this.state.view} value={this.props.brew.text} onChange={this.props.onTextChange} + editorTheme={this.state.editorTheme} rerenderParent={this.rerenderParent} /> ; } @@ -281,6 +300,7 @@ const Editor = createClass({ value={this.props.brew.style ?? DEFAULT_STYLE_TEXT} onChange={this.props.onStyleChange} enableFolding={false} + editorTheme={this.state.editorTheme} rerenderParent={this.rerenderParent} /> ; } @@ -324,6 +344,8 @@ const Editor = createClass({ undo={this.undo} redo={this.redo} historySize={this.historySize()} + currentEditorTheme={this.state.editorTheme} + updateEditorTheme={this.updateEditorTheme} cursorPos={this.refs.codeEditor?.getCursorPosition() || {}} /> {this.renderEditor()} diff --git a/client/homebrew/editor/editor.less b/client/homebrew/editor/editor.less index 86e523a13..db88b5b0f 100644 --- a/client/homebrew/editor/editor.less +++ b/client/homebrew/editor/editor.less @@ -1,4 +1,4 @@ - +@import 'themes/codeMirror/customEditorStyles.less'; .editor{ position : relative; width : 100%; diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index fee1a5780..246d534a9 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -1,3 +1,4 @@ +/*eslint max-lines: ["warn", {"max": 250, "skipBlankLines": true, "skipComments": true}]*/ require('./snippetbar.less'); const React = require('react'); const createClass = require('create-react-class'); @@ -15,6 +16,8 @@ ThemeSnippets['V3_5eDMG'] = require('themes/V3/5eDMG/snippets.js'); ThemeSnippets['V3_Journal'] = require('themes/V3/Journal/snippets.js'); ThemeSnippets['V3_Blank'] = require('themes/V3/Blank/snippets.js'); +const EditorThemes = require('build/homebrew/codeMirror/editorThemes.json'); + const execute = function(val, props){ if(_.isFunction(val)) return val(props); return val; @@ -24,24 +27,26 @@ const Snippetbar = createClass({ displayName : 'SnippetBar', getDefaultProps : function() { return { - brew : {}, - view : 'text', - onViewChange : ()=>{}, - onInject : ()=>{}, - onToggle : ()=>{}, - showEditButtons : true, - renderer : 'legacy', - undo : ()=>{}, - redo : ()=>{}, - historySize : ()=>{}, - cursorPos : {} + brew : {}, + view : 'text', + onViewChange : ()=>{}, + onInject : ()=>{}, + onToggle : ()=>{}, + showEditButtons : true, + renderer : 'legacy', + undo : ()=>{}, + redo : ()=>{}, + historySize : ()=>{}, + updateEditorTheme : ()=>{}, + cursorPos : {} }; }, getInitialState : function() { return { - renderer : this.props.renderer, - snippets : [] + renderer : this.props.renderer, + themeSelector : false, + snippets : [] }; }, @@ -95,6 +100,31 @@ const Snippetbar = createClass({ this.props.onInject(injectedText); }, + toggleThemeSelector : function(){ + this.setState({ + themeSelector : !this.state.themeSelector + }); + }, + + changeTheme : function(e){ + if(e.target.value == this.props.currentEditorTheme) return; + this.props.updateEditorTheme(e.target.value); + + this.setState({ + showThemeSelector : false, + }); + }, + + renderThemeSelector : function(){ + return
+ +
; + }, + renderSnippetGroups : function(){ const snippets = this.state.snippets.filter((snippetGroup)=>snippetGroup.view === this.props.view); @@ -124,6 +154,12 @@ const Snippetbar = createClass({
+
+ +
+ {this.state.themeSelector && this.renderThemeSelector()} +
this.props.onViewChange('text')}> @@ -196,5 +232,4 @@ const SnippetGroup = createClass({
; }, - }); diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index cb24da105..ed2dcebce 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -46,6 +46,15 @@ color : black; } } + &.editorTheme{ + .tooltipLeft('Editor Themes'); + font-size : 0.75em; + color : black; + &.active{ + color : white; + background-color: black; + } + } &.divider { background: linear-gradient(#000, #000) no-repeat center/1px 100%; width: 5px; @@ -54,6 +63,15 @@ } } } + .themeSelector{ + position: absolute; + left: -65px; + top: 30px; + z-index: 999; + width: 170px; + background-color: black; + border-radius: 5px; + } } .snippetBarButton{ height : @menuHeight; diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 86570ec46..2696d4e7a 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -89,7 +89,7 @@ const ListPage = createClass({ sortBrewOrder : function(brew){ if(!brew.title){brew.title = 'No Title';} const mapping = { - 'alpha' : _.deburr(brew.title.toLowerCase()), + 'alpha' : _.deburr(brew.title.trim().toLowerCase()), 'created' : moment(brew.createdAt).format(), 'updated' : moment(brew.updatedAt).format(), 'views' : brew.views, diff --git a/package-lock.json b/package-lock.json index 44ff4eecc..4a7cd44b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "mongoose": "^7.5.0", "nanoid": "3.3.4", "nconf": "^0.12.0", - "npm": "^9.8.1", + "npm": "^10.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-frame-component": "^4.1.3", @@ -10796,9 +10796,9 @@ } }, "node_modules/npm": { - "version": "9.8.1", - "resolved": "https://registry.npmjs.org/npm/-/npm-9.8.1.tgz", - "integrity": "sha512-AfDvThQzsIXhYgk9zhbk5R+lh811lKkLAeQMMhSypf1BM7zUafeIIBzMzespeuVEJ0+LvY36oRQYf7IKLzU3rw==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.0.0.tgz", + "integrity": "sha512-15O/VIG6/zuZ8ui2YxHhcJcomoTKNqC8bC6hKlmazJooDbdWCoC5iZsNp9Jm8xqwVab60hiAkhDyAqh8W8yq/g==", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -10808,6 +10808,7 @@ "@npmcli/package-json", "@npmcli/promise-spawn", "@npmcli/run-script", + "@sigstore/tuf", "abbrev", "archy", "cacache", @@ -10858,7 +10859,6 @@ "qrcode-terminal", "read", "semver", - "sigstore", "ssri", "supports-color", "tar", @@ -10871,72 +10871,72 @@ ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^6.3.0", - "@npmcli/config": "^6.2.1", + "@npmcli/arborist": "^7.0.0", + "@npmcli/config": "^7.1.0", "@npmcli/fs": "^3.1.0", "@npmcli/map-workspaces": "^3.0.4", - "@npmcli/package-json": "^4.0.1", - "@npmcli/promise-spawn": "^6.0.2", - "@npmcli/run-script": "^6.0.2", + "@npmcli/package-json": "^5.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "@npmcli/run-script": "^7.0.1", + "@sigstore/tuf": "^2.1.0", "abbrev": "^2.0.0", "archy": "~1.0.0", - "cacache": "^17.1.3", + "cacache": "^18.0.0", "chalk": "^5.3.0", "ci-info": "^3.8.0", "cli-columns": "^4.0.0", "cli-table3": "^0.6.3", "columnify": "^1.6.0", "fastest-levenshtein": "^1.0.16", - "fs-minipass": "^3.0.2", - "glob": "^10.2.7", + "fs-minipass": "^3.0.3", + "glob": "^10.3.3", "graceful-fs": "^4.2.11", - "hosted-git-info": "^6.1.1", + "hosted-git-info": "^7.0.0", "ini": "^4.1.1", - "init-package-json": "^5.0.0", + "init-package-json": "^6.0.0", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^3.0.0", - "libnpmaccess": "^7.0.2", - "libnpmdiff": "^5.0.19", - "libnpmexec": "^6.0.3", - "libnpmfund": "^4.0.19", - "libnpmhook": "^9.0.3", - "libnpmorg": "^5.0.4", - "libnpmpack": "^5.0.19", - "libnpmpublish": "^7.5.0", - "libnpmsearch": "^6.0.2", - "libnpmteam": "^5.0.3", - "libnpmversion": "^4.0.2", - "make-fetch-happen": "^11.1.1", + "libnpmaccess": "^8.0.0", + "libnpmdiff": "^6.0.0", + "libnpmexec": "^7.0.0", + "libnpmfund": "^4.1.0", + "libnpmhook": "^10.0.0", + "libnpmorg": "^6.0.0", + "libnpmpack": "^6.0.0", + "libnpmpublish": "^9.0.0", + "libnpmsearch": "^7.0.0", + "libnpmteam": "^6.0.0", + "libnpmversion": "^5.0.0", + "make-fetch-happen": "^13.0.0", "minimatch": "^9.0.3", - "minipass": "^5.0.0", + "minipass": "^7.0.3", "minipass-pipeline": "^1.2.4", "ms": "^2.1.2", "node-gyp": "^9.4.0", "nopt": "^7.2.0", "npm-audit-report": "^5.0.0", - "npm-install-checks": "^6.1.1", - "npm-package-arg": "^10.1.0", - "npm-pick-manifest": "^8.0.1", - "npm-profile": "^7.0.1", - "npm-registry-fetch": "^14.0.5", + "npm-install-checks": "^6.2.0", + "npm-package-arg": "^11.0.0", + "npm-pick-manifest": "^9.0.0", + "npm-profile": "^9.0.0", + "npm-registry-fetch": "^16.0.0", "npm-user-validate": "^2.0.0", "npmlog": "^7.0.1", "p-map": "^4.0.0", - "pacote": "^15.2.0", + "pacote": "^17.0.4", "parse-conflict-json": "^3.0.1", "proc-log": "^3.0.0", "qrcode-terminal": "^0.12.0", "read": "^2.1.0", "semver": "^7.5.4", - "sigstore": "^1.7.0", - "ssri": "^10.0.4", + "ssri": "^10.0.5", "supports-color": "^9.4.0", "tar": "^6.1.15", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^3.0.0", "validate-npm-package-name": "^5.0.0", - "which": "^3.0.1", + "which": "^4.0.0", "write-file-atomic": "^5.0.1" }, "bin": { @@ -10944,7 +10944,7 @@ "npx": "bin/npx-cli.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm-run-path": { @@ -11035,8 +11035,70 @@ "inBundle": true, "license": "ISC" }, + "node_modules/npm/node_modules/@npmcli/agent": { + "version": "2.1.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/agent/node_modules/agent-base": { + "version": "7.1.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/npm/node_modules/@npmcli/agent/node_modules/http-proxy-agent": { + "version": "7.0.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/npm/node_modules/@npmcli/agent/node_modules/https-proxy-agent": { + "version": "7.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/npm/node_modules/@npmcli/agent/node_modules/socks-proxy-agent": { + "version": "8.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.1", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/npm/node_modules/@npmcli/arborist": { - "version": "6.3.0", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { @@ -11044,33 +11106,33 @@ "@npmcli/fs": "^3.1.0", "@npmcli/installed-package-contents": "^2.0.2", "@npmcli/map-workspaces": "^3.0.2", - "@npmcli/metavuln-calculator": "^5.0.0", + "@npmcli/metavuln-calculator": "^7.0.0", "@npmcli/name-from-folder": "^2.0.0", "@npmcli/node-gyp": "^3.0.0", - "@npmcli/package-json": "^4.0.0", + "@npmcli/package-json": "^5.0.0", "@npmcli/query": "^3.0.0", - "@npmcli/run-script": "^6.0.0", + "@npmcli/run-script": "^7.0.1", "bin-links": "^4.0.1", - "cacache": "^17.0.4", + "cacache": "^18.0.0", "common-ancestor-path": "^1.0.1", - "hosted-git-info": "^6.1.1", + "hosted-git-info": "^7.0.0", "json-parse-even-better-errors": "^3.0.0", "json-stringify-nice": "^1.1.4", "minimatch": "^9.0.0", "nopt": "^7.0.0", - "npm-install-checks": "^6.0.0", - "npm-package-arg": "^10.1.0", - "npm-pick-manifest": "^8.0.1", - "npm-registry-fetch": "^14.0.3", + "npm-install-checks": "^6.2.0", + "npm-package-arg": "^11.0.0", + "npm-pick-manifest": "^9.0.0", + "npm-registry-fetch": "^16.0.0", "npmlog": "^7.0.1", - "pacote": "^15.0.8", + "pacote": "^17.0.4", "parse-conflict-json": "^3.0.0", "proc-log": "^3.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^1.0.2", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", - "ssri": "^10.0.1", + "ssri": "^10.0.5", "treeverse": "^3.0.0", "walk-up-path": "^3.0.1" }, @@ -11078,11 +11140,11 @@ "arborist": "bin/index.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/config": { - "version": "6.2.1", + "version": "7.1.0", "inBundle": true, "license": "ISC", "dependencies": { @@ -11122,21 +11184,21 @@ } }, "node_modules/npm/node_modules/@npmcli/git": { - "version": "4.1.0", + "version": "5.0.3", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/promise-spawn": "^6.0.0", - "lru-cache": "^7.4.4", - "npm-pick-manifest": "^8.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^9.0.0", "proc-log": "^3.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", - "which": "^3.0.0" + "which": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { @@ -11169,17 +11231,17 @@ } }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { - "version": "5.0.1", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "cacache": "^17.0.0", + "cacache": "^18.0.0", "json-parse-even-better-errors": "^3.0.0", - "pacote": "^15.0.0", + "pacote": "^17.0.0", "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { @@ -11199,31 +11261,31 @@ } }, "node_modules/npm/node_modules/@npmcli/package-json": { - "version": "4.0.1", + "version": "5.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/git": "^4.1.0", + "@npmcli/git": "^5.0.0", "glob": "^10.2.2", - "hosted-git-info": "^6.1.1", + "hosted-git-info": "^7.0.0", "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", + "normalize-package-data": "^6.0.0", "proc-log": "^3.0.0", "semver": "^7.5.3" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { - "version": "6.0.2", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "which": "^3.0.0" + "which": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/query": { @@ -11238,18 +11300,18 @@ } }, "node_modules/npm/node_modules/@npmcli/run-script": { - "version": "6.0.2", + "version": "7.0.1", "inBundle": true, "license": "ISC", "dependencies": { "@npmcli/node-gyp": "^3.0.0", - "@npmcli/promise-spawn": "^6.0.0", + "@npmcli/promise-spawn": "^7.0.0", "node-gyp": "^9.0.0", "read-package-json-fast": "^3.0.0", - "which": "^3.0.0" + "which": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@pkgjs/parseargs": { @@ -11261,24 +11323,48 @@ "node": ">=14" } }, + "node_modules/npm/node_modules/@sigstore/bundle": { + "version": "2.1.0", + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.2.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { - "version": "0.1.0", + "version": "0.2.1", "inBundle": true, "license": "Apache-2.0", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@sigstore/tuf": { - "version": "1.0.2", + "node_modules/npm/node_modules/@sigstore/sign": { + "version": "2.1.0", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/protobuf-specs": "^0.1.0", - "tuf-js": "^1.1.7" + "@sigstore/bundle": "^2.1.0", + "@sigstore/protobuf-specs": "^0.2.1", + "make-fetch-happen": "^13.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/tuf": { + "version": "2.1.0", + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.2.1", + "tuf-js": "^2.1.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@tootallnate/once": { @@ -11290,23 +11376,23 @@ } }, "node_modules/npm/node_modules/@tufjs/canonical-json": { - "version": "1.0.0", + "version": "2.0.0", "inBundle": true, "license": "MIT", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@tufjs/models": { - "version": "1.0.4", + "version": "2.0.0", "inBundle": true, "license": "MIT", "dependencies": { - "@tufjs/canonical-json": "1.0.0", - "minimatch": "^9.0.0" + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^9.0.3" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/abbrev": { @@ -11340,12 +11426,10 @@ } }, "node_modules/npm/node_modules/agentkeepalive": { - "version": "4.3.0", + "version": "4.5.0", "inBundle": true, "license": "MIT", "dependencies": { - "debug": "^4.1.0", - "depd": "^2.0.0", "humanize-ms": "^1.2.1" }, "engines": { @@ -11494,15 +11578,15 @@ } }, "node_modules/npm/node_modules/cacache": { - "version": "17.1.3", + "version": "18.0.0", "inBundle": true, "license": "ISC", "dependencies": { "@npmcli/fs": "^3.1.0", "fs-minipass": "^3.0.0", "glob": "^10.2.2", - "lru-cache": "^7.7.1", - "minipass": "^5.0.0", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", @@ -11512,7 +11596,7 @@ "unique-filename": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/chalk": { @@ -11735,14 +11819,6 @@ "inBundle": true, "license": "MIT" }, - "node_modules/npm/node_modules/depd": { - "version": "2.0.0", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/npm/node_modules/diff": { "version": "5.1.0", "inBundle": true, @@ -11828,11 +11904,11 @@ } }, "node_modules/npm/node_modules/fs-minipass": { - "version": "3.0.2", + "version": "3.0.3", "inBundle": true, "license": "ISC", "dependencies": { - "minipass": "^5.0.0" + "minipass": "^7.0.3" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -11867,15 +11943,15 @@ } }, "node_modules/npm/node_modules/glob": { - "version": "10.2.7", + "version": "10.3.3", "inBundle": true, "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.0.3", "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2", - "path-scurry": "^1.7.0" + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" }, "bin": { "glob": "dist/cjs/src/bin.js" @@ -11909,14 +11985,14 @@ "license": "ISC" }, "node_modules/npm/node_modules/hosted-git-info": { - "version": "6.1.1", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "lru-cache": "^7.5.1" + "lru-cache": "^10.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/http-cache-semantics": { @@ -12038,20 +12114,20 @@ } }, "node_modules/npm/node_modules/init-package-json": { - "version": "5.0.0", + "version": "6.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-package-arg": "^10.0.0", + "npm-package-arg": "^11.0.0", "promzard": "^1.0.0", "read": "^2.0.0", - "read-package-json": "^6.0.0", + "read-package-json": "^7.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/ip": { @@ -12159,47 +12235,47 @@ "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { - "version": "7.0.2", + "version": "8.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-package-arg": "^10.1.0", - "npm-registry-fetch": "^14.0.3" + "npm-package-arg": "^11.0.0", + "npm-registry-fetch": "^16.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmdiff": { - "version": "5.0.19", + "version": "6.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.3.0", + "@npmcli/arborist": "^7.0.0", "@npmcli/disparity-colors": "^3.0.0", "@npmcli/installed-package-contents": "^2.0.2", "binary-extensions": "^2.2.0", "diff": "^5.1.0", "minimatch": "^9.0.0", - "npm-package-arg": "^10.1.0", - "pacote": "^15.0.8", + "npm-package-arg": "^11.0.0", + "pacote": "^17.0.4", "tar": "^6.1.13" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmexec": { - "version": "6.0.3", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.3.0", - "@npmcli/run-script": "^6.0.0", + "@npmcli/arborist": "^7.0.0", + "@npmcli/run-script": "^7.0.1", "ci-info": "^3.7.1", - "npm-package-arg": "^10.1.0", + "npm-package-arg": "^11.0.0", "npmlog": "^7.0.1", - "pacote": "^15.0.8", + "pacote": "^17.0.4", "proc-log": "^3.0.0", "read": "^2.0.0", "read-package-json-fast": "^3.0.2", @@ -12207,145 +12283,141 @@ "walk-up-path": "^3.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmfund": { - "version": "4.0.19", + "version": "4.1.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.3.0" + "@npmcli/arborist": "^7.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmhook": { - "version": "9.0.3", + "version": "10.0.0", "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^16.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmorg": { - "version": "5.0.4", + "version": "6.0.0", "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^16.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmpack": { - "version": "5.0.19", + "version": "6.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.3.0", - "@npmcli/run-script": "^6.0.0", - "npm-package-arg": "^10.1.0", - "pacote": "^15.0.8" + "@npmcli/arborist": "^7.0.0", + "@npmcli/run-script": "^7.0.1", + "npm-package-arg": "^11.0.0", + "pacote": "^17.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmpublish": { - "version": "7.5.0", + "version": "9.0.0", "inBundle": true, "license": "ISC", "dependencies": { "ci-info": "^3.6.1", - "normalize-package-data": "^5.0.0", - "npm-package-arg": "^10.1.0", - "npm-registry-fetch": "^14.0.3", + "normalize-package-data": "^6.0.0", + "npm-package-arg": "^11.0.0", + "npm-registry-fetch": "^16.0.0", "proc-log": "^3.0.0", "semver": "^7.3.7", - "sigstore": "^1.4.0", - "ssri": "^10.0.1" + "sigstore": "^2.1.0", + "ssri": "^10.0.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmsearch": { - "version": "6.0.2", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^16.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmteam": { - "version": "5.0.3", + "version": "6.0.0", "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^16.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmversion": { - "version": "4.0.2", + "version": "5.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/git": "^4.0.1", - "@npmcli/run-script": "^6.0.0", + "@npmcli/git": "^5.0.3", + "@npmcli/run-script": "^7.0.1", "json-parse-even-better-errors": "^3.0.0", "proc-log": "^3.0.0", "semver": "^7.3.7" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/lru-cache": { - "version": "7.18.3", + "version": "10.0.1", "inBundle": true, "license": "ISC", "engines": { - "node": ">=12" + "node": "14 || >=16.14" } }, "node_modules/npm/node_modules/make-fetch-happen": { - "version": "11.1.1", + "version": "13.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "agentkeepalive": "^4.2.1", - "cacache": "^17.0.0", + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", "http-cache-semantics": "^4.1.1", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", - "lru-cache": "^7.7.1", - "minipass": "^5.0.0", + "minipass": "^7.0.2", "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", "promise-retry": "^2.0.1", - "socks-proxy-agent": "^7.0.0", "ssri": "^10.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/minimatch": { @@ -12363,11 +12435,11 @@ } }, "node_modules/npm/node_modules/minipass": { - "version": "5.0.0", + "version": "7.0.3", "inBundle": true, "license": "ISC", "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" } }, "node_modules/npm/node_modules/minipass-collect": { @@ -12393,11 +12465,11 @@ } }, "node_modules/npm/node_modules/minipass-fetch": { - "version": "3.0.3", + "version": "3.0.4", "inBundle": true, "license": "MIT", "dependencies": { - "minipass": "^5.0.0", + "minipass": "^7.0.3", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, @@ -12599,6 +12671,79 @@ "concat-map": "0.0.1" } }, + "node_modules/npm/node_modules/node-gyp/node_modules/cacache": { + "version": "17.1.4", + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^7.7.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/brace-expansion": { + "version": "2.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/glob": { + "version": "10.3.3", + "inBundle": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/minimatch": { + "version": "9.0.3", + "inBundle": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/minipass": { + "version": "7.0.3", + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/npm/node_modules/node-gyp/node_modules/gauge": { "version": "4.0.4", "inBundle": true, @@ -12636,6 +12781,39 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/npm/node_modules/node-gyp/node_modules/lru-cache": { + "version": "7.18.3", + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/npm/node_modules/node-gyp/node_modules/make-fetch-happen": { + "version": "11.1.1", + "inBundle": true, + "license": "ISC", + "dependencies": { + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^5.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/npm/node_modules/node-gyp/node_modules/minimatch": { "version": "3.1.2", "inBundle": true, @@ -12647,6 +12825,14 @@ "node": "*" } }, + "node_modules/npm/node_modules/node-gyp/node_modules/minipass": { + "version": "5.0.0", + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, "node_modules/npm/node_modules/node-gyp/node_modules/nopt": { "version": "6.0.0", "inBundle": true, @@ -12722,17 +12908,17 @@ } }, "node_modules/npm/node_modules/normalize-package-data": { - "version": "5.0.0", + "version": "6.0.0", "inBundle": true, "license": "BSD-2-Clause", "dependencies": { - "hosted-git-info": "^6.0.0", + "hosted-git-info": "^7.0.0", "is-core-module": "^2.8.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-audit-report": { @@ -12755,7 +12941,7 @@ } }, "node_modules/npm/node_modules/npm-install-checks": { - "version": "6.1.1", + "version": "6.2.0", "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -12774,21 +12960,21 @@ } }, "node_modules/npm/node_modules/npm-package-arg": { - "version": "10.1.0", + "version": "11.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "hosted-git-info": "^6.0.0", + "hosted-git-info": "^7.0.0", "proc-log": "^3.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-packlist": { - "version": "7.0.4", + "version": "8.0.0", "inBundle": true, "license": "ISC", "dependencies": { @@ -12799,46 +12985,46 @@ } }, "node_modules/npm/node_modules/npm-pick-manifest": { - "version": "8.0.1", + "version": "9.0.0", "inBundle": true, "license": "ISC", "dependencies": { "npm-install-checks": "^6.0.0", "npm-normalize-package-bin": "^3.0.0", - "npm-package-arg": "^10.0.0", + "npm-package-arg": "^11.0.0", "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-profile": { - "version": "7.0.1", + "version": "9.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-registry-fetch": "^14.0.0", + "npm-registry-fetch": "^16.0.0", "proc-log": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-registry-fetch": { - "version": "14.0.5", + "version": "16.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "make-fetch-happen": "^11.0.0", - "minipass": "^5.0.0", + "make-fetch-happen": "^13.0.0", + "minipass": "^7.0.2", "minipass-fetch": "^3.0.0", "minipass-json-stream": "^1.0.1", "minizlib": "^2.1.2", - "npm-package-arg": "^10.0.0", + "npm-package-arg": "^11.0.0", "proc-log": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-user-validate": { @@ -12886,26 +13072,26 @@ } }, "node_modules/npm/node_modules/pacote": { - "version": "15.2.0", + "version": "17.0.4", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/git": "^4.0.0", + "@npmcli/git": "^5.0.0", "@npmcli/installed-package-contents": "^2.0.1", - "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/run-script": "^6.0.0", - "cacache": "^17.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "@npmcli/run-script": "^7.0.0", + "cacache": "^18.0.0", "fs-minipass": "^3.0.0", - "minipass": "^5.0.0", - "npm-package-arg": "^10.0.0", - "npm-packlist": "^7.0.0", - "npm-pick-manifest": "^8.0.0", - "npm-registry-fetch": "^14.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^11.0.0", + "npm-packlist": "^8.0.0", + "npm-pick-manifest": "^9.0.0", + "npm-registry-fetch": "^16.0.0", "proc-log": "^3.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^6.0.0", + "read-package-json": "^7.0.0", "read-package-json-fast": "^3.0.0", - "sigstore": "^1.3.0", + "sigstore": "^2.0.0", "ssri": "^10.0.0", "tar": "^6.1.11" }, @@ -12913,7 +13099,7 @@ "pacote": "lib/bin.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/parse-conflict-json": { @@ -12946,12 +13132,12 @@ } }, "node_modules/npm/node_modules/path-scurry": { - "version": "1.9.2", + "version": "1.10.1", "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^9.1.1", - "minipass": "^5.0.0 || ^6.0.2" + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -12960,14 +13146,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/npm/node_modules/path-scurry/node_modules/lru-cache": { - "version": "9.1.1", - "inBundle": true, - "license": "ISC", - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/npm/node_modules/postcss-selector-parser": { "version": "6.0.13", "inBundle": true, @@ -13067,17 +13245,17 @@ } }, "node_modules/npm/node_modules/read-package-json": { - "version": "6.0.4", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { "glob": "^10.2.2", "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", + "normalize-package-data": "^6.0.0", "npm-normalize-package-bin": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/read-package-json-fast": { @@ -13253,19 +13431,17 @@ } }, "node_modules/npm/node_modules/sigstore": { - "version": "1.7.0", + "version": "2.1.0", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/protobuf-specs": "^0.1.0", - "@sigstore/tuf": "^1.0.1", - "make-fetch-happen": "^11.0.1" - }, - "bin": { - "sigstore": "bin/sigstore.js" + "@sigstore/bundle": "^2.1.0", + "@sigstore/protobuf-specs": "^0.2.1", + "@sigstore/sign": "^2.1.0", + "@sigstore/tuf": "^2.1.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/smart-buffer": { @@ -13332,11 +13508,11 @@ "license": "CC0-1.0" }, "node_modules/npm/node_modules/ssri": { - "version": "10.0.4", + "version": "10.0.5", "inBundle": true, "license": "ISC", "dependencies": { - "minipass": "^5.0.0" + "minipass": "^7.0.3" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -13449,6 +13625,14 @@ "node": ">=8" } }, + "node_modules/npm/node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", "inBundle": true, @@ -13468,16 +13652,16 @@ } }, "node_modules/npm/node_modules/tuf-js": { - "version": "1.1.7", + "version": "2.1.0", "inBundle": true, "license": "MIT", "dependencies": { - "@tufjs/models": "1.0.4", + "@tufjs/models": "2.0.0", "debug": "^4.3.4", - "make-fetch-happen": "^11.1.1" + "make-fetch-happen": "^13.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/unique-filename": { @@ -13541,17 +13725,25 @@ } }, "node_modules/npm/node_modules/which": { - "version": "3.0.1", + "version": "4.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/which/node_modules/isexe": { + "version": "3.1.1", + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=16" } }, "node_modules/npm/node_modules/wide-align": { diff --git a/package.json b/package.json index 5f1d07d9f..39ba72e77 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "mongoose": "^7.5.0", "nanoid": "3.3.4", "nconf": "^0.12.0", - "npm": "^9.8.1", + "npm": "^10.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-frame-component": "^4.1.3", diff --git a/scripts/buildHomebrew.js b/scripts/buildHomebrew.js index 3bf0065d0..e78759168 100644 --- a/scripts/buildHomebrew.js +++ b/scripts/buildHomebrew.js @@ -99,6 +99,24 @@ fs.emptyDirSync('./build'); await fs.copy('./themes/assets', './build/assets'); await fs.copy('./client/icons', './build/icons'); + //v==---------------------------MOVE CM EDITOR THEMES -----------------------------==v// + + editorThemeFiles = fs.readdirSync('./node_modules/codemirror/theme'); + + const editorThemeFile = './themes/codeMirror/editorThemes.json'; + if(fs.existsSync(editorThemeFile)) fs.rmSync(editorThemeFile); + const stream = fs.createWriteStream(editorThemeFile, { flags: 'a' }); + stream.write('[\n"default"'); + + for (themeFile of editorThemeFiles) { + stream.write(`,\n"${themeFile.slice(0, -4)}"`); + } + stream.write('\n]\n'); + stream.end(); + + await fs.copy('./node_modules/codemirror/theme', './build/homebrew/cm-themes'); + await fs.copy('./themes/codeMirror', './build/homebrew/codeMirror'); + //v==----------------------------- BUNDLE PACKAGES --------------------------------==v// const bundles = await pack('./client/homebrew/homebrew.jsx', { diff --git a/server/app.js b/server/app.js index 520dd154e..f10b6ff5e 100644 --- a/server/app.js +++ b/server/app.js @@ -268,6 +268,9 @@ app.get('/user/:username', async (req, res, next)=>{ } req.brews = _.map(brews, (brew)=>{ + // Clean up brew data + brew.title = brew.title?.trim(); + brew.description = brew.description?.trim(); return sanitizeBrew(brew, ownAccount ? 'edit' : 'share'); }); diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 52f5cf88f..b394b2ee7 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -153,6 +153,9 @@ const api = { brew.text = api.mergeBrewText(brew); _.defaults(brew, DEFAULT_BREW); + + brew.title = brew.title.trim(); + brew.description = brew.description.trim(); }, newGoogleBrew : async (account, brew, res)=>{ const oAuth2Client = GoogleActions.authCheck(account, res); @@ -217,6 +220,8 @@ const api = { const { saveToGoogle, removeFromGoogle } = req.query; let afterSave = async ()=>true; + brew.title = brew.title.trim(); + brew.description = brew.description.trim() || ''; brew.text = api.mergeBrewText(brew); if(brew.googleId && removeFromGoogle) { diff --git a/shared/naturalcrit/codeEditor/codeEditor.jsx b/shared/naturalcrit/codeEditor/codeEditor.jsx index 2b5685e49..e0a2220b4 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.jsx +++ b/shared/naturalcrit/codeEditor/codeEditor.jsx @@ -49,7 +49,8 @@ const CodeEditor = createClass({ value : '', wrap : true, onChange : ()=>{}, - enableFolding : true + enableFolding : true, + editorTheme : 'default' }; }, @@ -91,6 +92,10 @@ const CodeEditor = createClass({ } else { this.codeMirror.setOption('foldOptions', false); } + + if(prevProps.editorTheme !== this.props.editorTheme){ + this.codeMirror.setOption('theme', this.props.editorTheme); + } }, buildEditor : function() { @@ -159,6 +164,7 @@ const CodeEditor = createClass({ autoCloseTags : true, styleActiveLine : true, showTrailingSpace : false, + theme : this.props.editorTheme // specialChars : / /, // specialCharPlaceholder : function(char) { // const el = document.createElement('span'); @@ -406,7 +412,10 @@ const CodeEditor = createClass({ //----------------------// render : function(){ - return
; + return <> + +
+ ; } }); diff --git a/themes/codeMirror/customEditorStyles.less b/themes/codeMirror/customEditorStyles.less new file mode 100644 index 000000000..3318e1305 --- /dev/null +++ b/themes/codeMirror/customEditorStyles.less @@ -0,0 +1,88 @@ +.editor .codeEditor .CodeMirror { + // Themes with dark backgrounds + &.cm-s-3024-night, + &.cm-s-abbott, + &.cm-s-abcdef, + &.cm-s-ambiance, + &.cm-s-ayu-dark, + &.cm-s-ayu-mirage, + &.cm-s-base16-dark, + &.cm-s-bespin, + &.cm-s-blackboard, + &.cm-s-cobalt, + &.cm-s-colorforth, + &.cm-s-darcula, + &.cm-s-dracula, + &.cm-s-duotone-dark, + &.cm-s-erlang-dark, + &.cm-s-gruvbox-dark, + &.cm-s-hopscotch, + &.cm-s-icecoder, + &.cm-s-isotope, + &.cm-s-lesser-dark, + &.cm-s-liquibyte, + &.cm-s-lucario, + &.cm-s-material, + &.cm-s-material-darker, + &.cm-s-material-ocean, + &.cm-s-material-palenight, + &.cm-s-mbo, + &.cm-s-midnight, + &.cm-s-monokai, + &.cm-s-moxer, + &.cm-s-night, + &.cm-s-nord, + &.cm-s-oceanic-next, + &.cm-s-panda-syntax, + &.cm-s-paraiso-dark, + &.cm-s-pastel-on-dark, + &.cm-s-railscasts, + &.cm-s-rubyblue, + &.cm-s-seti, + &.cm-s-shadowfox, + &.cm-s-the-matrix, + &.cm-s-tomorrow-night-bright, + &.cm-s-tomorrow-night-eighties, + &.cm-s-twilight, + &.cm-s-vibrant-ink, + &.cm-s-xq-dark, + &.cm-s-yonce, + &.cm-s-zenburn + { + .CodeMirror-code { + .block:not(.cm-comment) { + color: magenta; + } + .columnSplit { + color: black; + background-color: rgba(35,153,153,0.5); + } + .pageLine { + background-color: rgba(255,255,255,0.75); + & ~ pre.CodeMirror-line { + color: black; + } + } + } + } + // Themes with light backgrounds + &.cm-s-default, + &.cm-s-3024-day, + &.cm-s-ambiance-mobile, + &.cm-s-base16-light, + &.cm-s-duotone-light, + &.cm-s-eclipse, + &.cm-s-elegant, + &.cm-s-juejin, + &.cm-s-neat, + &.cm-s-neo, + &.cm-s-paraiso-lightm + &.cm-s-solarized, + &.cm-s-ssms, + &.cm-s-ttcn, + &.cm-s-xq-light, + &.cm-s-yeti { + // Future styling for themes with light backgrounds + --dummyVar: 'currently unused'; + } +} \ No newline at end of file diff --git a/themes/codeMirror/editorThemes.json b/themes/codeMirror/editorThemes.json new file mode 100644 index 000000000..a4dd74470 --- /dev/null +++ b/themes/codeMirror/editorThemes.json @@ -0,0 +1,68 @@ +[ +"default", +"3024-day", +"3024-night", +"abbott", +"abcdef", +"ambiance-mobile", +"ambiance", +"ayu-dark", +"ayu-mirage", +"base16-dark", +"base16-light", +"bespin", +"blackboard", +"cobalt", +"colorforth", +"darcula", +"dracula", +"duotone-dark", +"duotone-light", +"eclipse", +"elegant", +"erlang-dark", +"gruvbox-dark", +"hopscotch", +"icecoder", +"idea", +"isotope", +"juejin", +"lesser-dark", +"liquibyte", +"lucario", +"material-darker", +"material-ocean", +"material-palenight", +"material", +"mbo", +"mdn-like", +"midnight", +"monokai", +"moxer", +"neat", +"neo", +"night", +"nord", +"oceanic-next", +"panda-syntax", +"paraiso-dark", +"paraiso-light", +"pastel-on-dark", +"railscasts", +"rubyblue", +"seti", +"shadowfox", +"solarized", +"ssms", +"the-matrix", +"tomorrow-night-bright", +"tomorrow-night-eighties", +"ttcn", +"twilight", +"vibrant-ink", +"xq-dark", +"xq-light", +"yeti", +"yonce", +"zenburn" +]