mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-05-07 16:38:38 +00:00
move darkvision to library, and sort themes
This commit is contained in:
@@ -188,13 +188,13 @@ const newPage = (view)=>{
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const generalKeymap = keymap.of([
|
export const generalKeymap = Prec.high(keymap.of([
|
||||||
{ key: 'Tab', run: indentMore },
|
{ key: 'Tab', run: indentMore },
|
||||||
{ key: 'Mod-z', run: undo }, //i think it may be unnecessary
|
{ key: 'Mod-z', run: undo }, //i think it may be unnecessary
|
||||||
{ key: 'Mod-Shift-z', run: redo },
|
{ key: 'Mod-Shift-z', run: redo },
|
||||||
{ key: 'Mod-y', run: redo },
|
{ key: 'Mod-y', run: redo },
|
||||||
{ key: 'Mod-d', run: deleteLine},
|
{ key: 'Mod-d', run: deleteLine},
|
||||||
]);
|
]));
|
||||||
|
|
||||||
export const markdownKeymap = Prec.highest(keymap.of([
|
export const markdownKeymap = Prec.highest(keymap.of([
|
||||||
//{ key: 'Shift-Tab', run: indentMore },
|
//{ key: 'Shift-Tab', run: indentMore },
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import cm5Themes from 'codemirror-5-themes';
|
|||||||
|
|
||||||
const themes = { default: defaultCM5Theme, ...cm5Themes, darkbrewery };
|
const themes = { default: defaultCM5Theme, ...cm5Themes, darkbrewery };
|
||||||
|
|
||||||
const EditorThemes = Object.entries(themes)
|
const themeNames = Object.entries(themes)
|
||||||
.filter(([name, value]) =>
|
.filter(([name, value]) =>
|
||||||
Array.isArray(value) &&
|
Array.isArray(value) &&
|
||||||
!name.endsWith('Init') &&
|
!name.endsWith('Init') &&
|
||||||
@@ -37,6 +37,13 @@ const EditorThemes = Object.entries(themes)
|
|||||||
)
|
)
|
||||||
.map(([name]) => name);
|
.map(([name]) => name);
|
||||||
|
|
||||||
|
const EditorThemes = [
|
||||||
|
'default',
|
||||||
|
...themeNames
|
||||||
|
.filter(name => name !== 'default')
|
||||||
|
.sort((a, b) => a.localeCompare(b))
|
||||||
|
];
|
||||||
|
|
||||||
const execute = function(val, props){
|
const execute = function(val, props){
|
||||||
if(_.isFunction(val)) return val(props);
|
if(_.isFunction(val)) return val(props);
|
||||||
return val;
|
return val;
|
||||||
|
|||||||
Generated
+4
-4
@@ -33,7 +33,7 @@
|
|||||||
"@vitejs/plugin-react": "^5.1.2",
|
"@vitejs/plugin-react": "^5.1.2",
|
||||||
"body-parser": "^2.2.0",
|
"body-parser": "^2.2.0",
|
||||||
"classnames": "^2.5.1",
|
"classnames": "^2.5.1",
|
||||||
"codemirror-5-themes": "^1.3.0",
|
"codemirror-5-themes": "^1.4.0",
|
||||||
"cookie-parser": "^1.4.7",
|
"cookie-parser": "^1.4.7",
|
||||||
"core-js": "^3.49.0",
|
"core-js": "^3.49.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
@@ -6094,9 +6094,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/codemirror-5-themes": {
|
"node_modules/codemirror-5-themes": {
|
||||||
"version": "1.3.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/codemirror-5-themes/-/codemirror-5-themes-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/codemirror-5-themes/-/codemirror-5-themes-1.4.0.tgz",
|
||||||
"integrity": "sha512-FO8HG4m4GdcphVtJFcj8wcx9nhktb4UMnSu8ia5yCNd3G89pBGqrIxw2UAEluJP4D2gLZWQOwdPaU8Ik3Bqt2w==",
|
"integrity": "sha512-3WKAmpTLqcE1MXFLHdNtwQYaxlWZXS69MY79UiNsFpW9KedMkf/vBYBjUAmacDXPKAJjdPSNMGmCPIZi21yoXA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/view": "^6.41.1"
|
"@codemirror/view": "^6.41.1"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -109,7 +109,7 @@
|
|||||||
"@vitejs/plugin-react": "^5.1.2",
|
"@vitejs/plugin-react": "^5.1.2",
|
||||||
"body-parser": "^2.2.0",
|
"body-parser": "^2.2.0",
|
||||||
"classnames": "^2.5.1",
|
"classnames": "^2.5.1",
|
||||||
"codemirror-5-themes": "^1.3.0",
|
"codemirror-5-themes": "^1.4.0",
|
||||||
"cookie-parser": "^1.4.7",
|
"cookie-parser": "^1.4.7",
|
||||||
"core-js": "^3.49.0",
|
"core-js": "^3.49.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
|||||||
@@ -1,126 +0,0 @@
|
|||||||
/*This document is old, from back when Codemirror was version 5,
|
|
||||||
if someone wants to update it, feel free, it needs to be like default.js or darkbrewery.js
|
|
||||||
Then imported in snippetbar.jsx and codeEditor.jsx.
|
|
||||||
*/
|
|
||||||
|
|
||||||
.CodeMirror {
|
|
||||||
background: #0C0C0C;
|
|
||||||
color: #B9BDB6;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Brew BG */
|
|
||||||
.brewRenderer {
|
|
||||||
background-color: #0C0C0C;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cm-s-darkvision {
|
|
||||||
/* Blinking cursor and selection */
|
|
||||||
.CodeMirror-cursor {
|
|
||||||
border-left: 1px solid #B9BDB6;
|
|
||||||
}
|
|
||||||
.CodeMirror-selected {
|
|
||||||
background: #E0E8FF40;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Line number stuff */
|
|
||||||
.cm-gutter-elt {
|
|
||||||
color: #81969A;
|
|
||||||
}
|
|
||||||
.CodeMirror-linenumber {
|
|
||||||
background-color: #0C0C0C;
|
|
||||||
}
|
|
||||||
.cm-gutter {
|
|
||||||
background-color: #0C0C0C;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* column splits */
|
|
||||||
.editor .codeEditor .columnSplit {
|
|
||||||
font-style: italic;
|
|
||||||
color: inherit;
|
|
||||||
background-color:#1F5763;
|
|
||||||
border-bottom: #299 solid 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* # headings */
|
|
||||||
.cm-header {
|
|
||||||
color: #C51B1B;
|
|
||||||
-webkit-text-stroke-width: 0.1px;
|
|
||||||
}
|
|
||||||
/* bold points */
|
|
||||||
.cm-strong {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #309DD2;
|
|
||||||
}
|
|
||||||
/* Link headings */
|
|
||||||
.cm-link {
|
|
||||||
color: #DD6300;
|
|
||||||
}
|
|
||||||
/* links */
|
|
||||||
.cm-string {
|
|
||||||
color: #5CE638;
|
|
||||||
}
|
|
||||||
/*@import*/
|
|
||||||
.cm-def {
|
|
||||||
color: #2986CC;
|
|
||||||
}
|
|
||||||
/* Bullets and such */
|
|
||||||
.cm-variable-2 {
|
|
||||||
color: #3CBF30;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Tags (divs) */
|
|
||||||
.cm-tag {
|
|
||||||
color: #E3FF00;
|
|
||||||
}
|
|
||||||
.cm-attribute {
|
|
||||||
color: #E3FF00;
|
|
||||||
}
|
|
||||||
.cm-atom {
|
|
||||||
color: #CF7EA9;
|
|
||||||
}
|
|
||||||
.cm-qualifier {
|
|
||||||
color: #EE1919;
|
|
||||||
}
|
|
||||||
.cm-comment {
|
|
||||||
color: #BBC700;
|
|
||||||
}
|
|
||||||
.cm-keyword {
|
|
||||||
color: #CC66FF;
|
|
||||||
}
|
|
||||||
.cm-property {
|
|
||||||
color: aqua;
|
|
||||||
}
|
|
||||||
.cm-error {
|
|
||||||
color: #C50202;
|
|
||||||
}
|
|
||||||
.CodeMirror-foldmarker {
|
|
||||||
color: #F0FF00;
|
|
||||||
}
|
|
||||||
/* New page */
|
|
||||||
.cm-builtin {
|
|
||||||
color: #FFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor .codeEditor {
|
|
||||||
/* blocks */
|
|
||||||
.block:not(.cm-comment) {
|
|
||||||
color: magenta;
|
|
||||||
}
|
|
||||||
/* definition lists */
|
|
||||||
.define.definition {
|
|
||||||
color: #FFAA3E;
|
|
||||||
}
|
|
||||||
.define.term {
|
|
||||||
color: #7290d9;
|
|
||||||
}
|
|
||||||
.define:not(.term):not(.definition) {
|
|
||||||
background: #333;
|
|
||||||
}
|
|
||||||
/* New page */
|
|
||||||
.pageLine {
|
|
||||||
background: #000;
|
|
||||||
color: #000;
|
|
||||||
border-bottom: 1px solid #FFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user