@dodona/papyros 3.0.2 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -72
- package/dist/Components.d.ts +4 -0
- package/dist/Components.js +5 -0
- package/dist/Components.js.map +1 -0
- package/dist/Papyros.d.ts +18 -127
- package/dist/Papyros.js +39 -211
- package/dist/Papyros.js.map +1 -1
- package/dist/{Backend.d.ts → backend/Backend.d.ts} +3 -12
- package/dist/{Backend.js → backend/Backend.js} +4 -17
- package/dist/backend/Backend.js.map +1 -0
- package/dist/{workers → backend/workers}/javascript/JavaScriptWorker.js +1 -1
- package/dist/backend/workers/javascript/JavaScriptWorker.js.map +1 -0
- package/dist/backend/workers/javascript/worker.js.map +1 -0
- package/dist/{workers → backend/workers}/python/PythonWorker.d.ts +2 -2
- package/dist/{workers → backend/workers}/python/PythonWorker.js +2 -2
- package/dist/backend/workers/python/PythonWorker.js.map +1 -0
- package/dist/backend/workers/python/python_package.tar.gz.load_by_url +0 -0
- package/dist/backend/workers/python/worker.js.map +1 -0
- package/dist/communication/BackendEvent.js.map +1 -0
- package/dist/{BackendEventQueue.d.ts → communication/BackendEventQueue.d.ts} +1 -36
- package/dist/{BackendEventQueue.js → communication/BackendEventQueue.js} +2 -45
- package/dist/communication/BackendEventQueue.js.map +1 -0
- package/dist/{BackendManager.d.ts → communication/BackendManager.d.ts} +2 -2
- package/dist/{BackendManager.js → communication/BackendManager.js} +4 -4
- package/dist/communication/BackendManager.js.map +1 -0
- package/dist/communication/InputServiceWorker.js +37 -0
- package/dist/communication/InputServiceWorker.js.map +1 -0
- package/dist/communication/InputWorker.js.map +1 -0
- package/dist/frontend/components/CodeRunner.d.ts +9 -0
- package/dist/frontend/components/CodeRunner.js +60 -0
- package/dist/frontend/components/CodeRunner.js.map +1 -0
- package/dist/frontend/components/Debugger.d.ts +7 -0
- package/dist/frontend/components/Debugger.js +62 -0
- package/dist/frontend/components/Debugger.js.map +1 -0
- package/dist/frontend/components/Input.d.ts +17 -0
- package/dist/frontend/components/Input.js +73 -0
- package/dist/frontend/components/Input.js.map +1 -0
- package/dist/frontend/components/Output.d.ts +14 -0
- package/dist/frontend/components/Output.js +154 -0
- package/dist/frontend/components/Output.js.map +1 -0
- package/dist/frontend/components/PapyrosElement.d.ts +8 -0
- package/dist/frontend/components/PapyrosElement.js +24 -0
- package/dist/frontend/components/PapyrosElement.js.map +1 -0
- package/dist/frontend/components/app/App.d.ts +24 -0
- package/dist/frontend/components/app/App.js +204 -0
- package/dist/frontend/components/app/App.js.map +1 -0
- package/dist/frontend/components/app/ExamplePicker.d.ts +7 -0
- package/dist/frontend/components/app/ExamplePicker.js +35 -0
- package/dist/frontend/components/app/ExamplePicker.js.map +1 -0
- package/dist/frontend/components/app/LanguagePicker.d.ts +7 -0
- package/dist/frontend/components/app/LanguagePicker.js +35 -0
- package/dist/frontend/components/app/LanguagePicker.js.map +1 -0
- package/dist/frontend/components/app/ProgrammingLanguagePicker.d.ts +7 -0
- package/dist/frontend/components/app/ProgrammingLanguagePicker.js +39 -0
- package/dist/frontend/components/app/ProgrammingLanguagePicker.js.map +1 -0
- package/dist/frontend/components/app/examples/JavaScriptExamples.js.map +1 -0
- package/dist/frontend/components/app/examples/PythonExamples.js.map +1 -0
- package/dist/frontend/components/app/themes/ThemePicker.d.ts +11 -0
- package/dist/frontend/components/app/themes/ThemePicker.js +47 -0
- package/dist/frontend/components/app/themes/ThemePicker.js.map +1 -0
- package/dist/frontend/components/app/themes/ThemedButton.d.ts +9 -0
- package/dist/frontend/components/app/themes/ThemedButton.js +43 -0
- package/dist/frontend/components/app/themes/ThemedButton.js.map +1 -0
- package/dist/frontend/components/code_mirror/BatchInputEditor.d.ts +8 -0
- package/dist/frontend/components/code_mirror/BatchInputEditor.js +54 -0
- package/dist/frontend/components/code_mirror/BatchInputEditor.js.map +1 -0
- package/dist/frontend/components/code_mirror/CodeEditor.d.ts +24 -0
- package/dist/frontend/components/code_mirror/CodeEditor.js +206 -0
- package/dist/frontend/components/code_mirror/CodeEditor.js.map +1 -0
- package/dist/frontend/components/code_mirror/CodeMirrorEditor.d.ts +20 -0
- package/dist/frontend/components/code_mirror/CodeMirrorEditor.js +99 -0
- package/dist/frontend/components/code_mirror/CodeMirrorEditor.js.map +1 -0
- package/dist/frontend/components/code_mirror/Extensions.d.ts +15 -0
- package/dist/frontend/components/code_mirror/Extensions.js +169 -0
- package/dist/frontend/components/code_mirror/Extensions.js.map +1 -0
- package/dist/frontend/components/code_mirror/MaterialTheme.d.ts +5 -0
- package/dist/frontend/components/code_mirror/MaterialTheme.js +114 -0
- package/dist/frontend/components/code_mirror/MaterialTheme.js.map +1 -0
- package/dist/frontend/components/code_runner/ButtonLint.d.ts +9 -0
- package/dist/frontend/components/code_runner/ButtonLint.js +76 -0
- package/dist/frontend/components/code_runner/ButtonLint.js.map +1 -0
- package/dist/frontend/components/code_runner/Code.d.ts +7 -0
- package/dist/frontend/components/code_runner/Code.js +46 -0
- package/dist/frontend/components/code_runner/Code.js.map +1 -0
- package/dist/frontend/components/code_runner/RunState.d.ts +7 -0
- package/dist/frontend/components/code_runner/RunState.js +41 -0
- package/dist/frontend/components/code_runner/RunState.js.map +1 -0
- package/dist/frontend/components/input/BatchInput.d.ts +19 -0
- package/dist/frontend/components/input/BatchInput.js +92 -0
- package/dist/frontend/components/input/BatchInput.js.map +1 -0
- package/dist/frontend/components/input/InteractiveInput.d.ts +13 -0
- package/dist/frontend/components/input/InteractiveInput.js +73 -0
- package/dist/frontend/components/input/InteractiveInput.js.map +1 -0
- package/dist/frontend/state/Constants.d.ts +38 -0
- package/dist/frontend/state/Constants.js +108 -0
- package/dist/frontend/state/Constants.js.map +1 -0
- package/dist/frontend/state/Debugger.d.ts +23 -0
- package/dist/frontend/state/Debugger.js +80 -0
- package/dist/frontend/state/Debugger.js.map +1 -0
- package/dist/frontend/state/Examples.d.ts +11 -0
- package/dist/frontend/state/Examples.js +36 -0
- package/dist/frontend/state/Examples.js.map +1 -0
- package/dist/frontend/state/I18n.d.ts +16 -0
- package/dist/frontend/state/I18n.js +75 -0
- package/dist/frontend/state/I18n.js.map +1 -0
- package/dist/frontend/state/InputOutput.d.ts +55 -0
- package/dist/frontend/state/InputOutput.js +93 -0
- package/dist/frontend/state/InputOutput.js.map +1 -0
- package/dist/frontend/state/Runner.d.ts +118 -0
- package/dist/frontend/state/Runner.js +330 -0
- package/dist/frontend/state/Runner.js.map +1 -0
- package/dist/frontend/state/Test.d.ts +11 -0
- package/dist/frontend/state/Test.js +59 -0
- package/dist/frontend/state/Test.js.map +1 -0
- package/dist/frontend/state/Translations.d.ts +178 -0
- package/dist/frontend/state/Translations.js +188 -0
- package/dist/frontend/state/Translations.js.map +1 -0
- package/dist/frontend/state/themes/blue-dark.d.ts +2 -0
- package/dist/frontend/state/themes/blue-dark.js +55 -0
- package/dist/frontend/state/themes/blue-dark.js.map +1 -0
- package/dist/frontend/state/themes/blue-light.d.ts +2 -0
- package/dist/frontend/state/themes/blue-light.js +55 -0
- package/dist/frontend/state/themes/blue-light.js.map +1 -0
- package/dist/frontend/state/themes/green-dark.d.ts +2 -0
- package/dist/frontend/state/themes/green-dark.js +55 -0
- package/dist/frontend/state/themes/green-dark.js.map +1 -0
- package/dist/frontend/state/themes/green-light.d.ts +2 -0
- package/dist/frontend/state/themes/green-light.js +55 -0
- package/dist/frontend/state/themes/green-light.js.map +1 -0
- package/dist/frontend/state/themes/red-dark.d.ts +2 -0
- package/dist/frontend/state/themes/red-dark.js +55 -0
- package/dist/frontend/state/themes/red-dark.js.map +1 -0
- package/dist/frontend/state/themes/red-light.d.ts +2 -0
- package/dist/frontend/state/themes/red-light.js +55 -0
- package/dist/frontend/state/themes/red-light.js.map +1 -0
- package/dist/util/Util.d.ts +1 -4
- package/dist/util/Util.js +7 -8
- package/dist/util/Util.js.map +1 -1
- package/package.json +13 -21
- package/dist/App.d.ts +0 -1
- package/dist/App.js +0 -76
- package/dist/App.js.map +0 -1
- package/dist/Backend.js.map +0 -1
- package/dist/BackendEvent.js.map +0 -1
- package/dist/BackendEventQueue.js.map +0 -1
- package/dist/BackendManager.js.map +0 -1
- package/dist/CodeRunner.d.ts +0 -188
- package/dist/CodeRunner.js +0 -548
- package/dist/CodeRunner.js.map +0 -1
- package/dist/Constants.d.ts +0 -31
- package/dist/Constants.js +0 -36
- package/dist/Constants.js.map +0 -1
- package/dist/Debugger.d.ts +0 -18
- package/dist/Debugger.js +0 -86
- package/dist/Debugger.js.map +0 -1
- package/dist/InputManager.d.ts +0 -38
- package/dist/InputManager.js +0 -101
- package/dist/InputManager.js.map +0 -1
- package/dist/InputServiceWorker.js.map +0 -1
- package/dist/Library.d.ts +0 -12
- package/dist/Library.js +0 -9
- package/dist/Library.js.map +0 -1
- package/dist/OutputManager.d.ts +0 -90
- package/dist/OutputManager.js +0 -172
- package/dist/OutputManager.js.map +0 -1
- package/dist/Papyros.css +0 -657
- package/dist/Translations.d.ts +0 -180
- package/dist/Translations.js +0 -191
- package/dist/Translations.js.map +0 -1
- package/dist/editor/BatchInputEditor.d.ts +0 -41
- package/dist/editor/BatchInputEditor.js +0 -80
- package/dist/editor/BatchInputEditor.js.map +0 -1
- package/dist/editor/CodeEditor.d.ts +0 -81
- package/dist/editor/CodeEditor.js +0 -213
- package/dist/editor/CodeEditor.js.map +0 -1
- package/dist/editor/CodeMirrorEditor.d.ts +0 -133
- package/dist/editor/CodeMirrorEditor.js +0 -169
- package/dist/editor/CodeMirrorEditor.js.map +0 -1
- package/dist/editor/DarkTheme.d.ts +0 -1
- package/dist/editor/DarkTheme.js +0 -72
- package/dist/editor/DarkTheme.js.map +0 -1
- package/dist/editor/DebugExtension.d.ts +0 -11
- package/dist/editor/DebugExtension.js +0 -70
- package/dist/editor/DebugExtension.js.map +0 -1
- package/dist/editor/Gutters.d.ts +0 -109
- package/dist/editor/Gutters.js +0 -201
- package/dist/editor/Gutters.js.map +0 -1
- package/dist/editor/LineEffectExtension.d.ts +0 -13
- package/dist/editor/LineEffectExtension.js +0 -48
- package/dist/editor/LineEffectExtension.js.map +0 -1
- package/dist/editor/TestCodeExtension.d.ts +0 -21
- package/dist/editor/TestCodeExtension.js +0 -134
- package/dist/editor/TestCodeExtension.js.map +0 -1
- package/dist/examples/Examples.d.ts +0 -6
- package/dist/examples/Examples.js +0 -23
- package/dist/examples/Examples.js.map +0 -1
- package/dist/examples/JavaScriptExamples.js.map +0 -1
- package/dist/examples/PythonExamples.js.map +0 -1
- package/dist/input/BatchInputHandler.d.ts +0 -55
- package/dist/input/BatchInputHandler.js +0 -131
- package/dist/input/BatchInputHandler.js.map +0 -1
- package/dist/input/InteractiveInputHandler.d.ts +0 -27
- package/dist/input/InteractiveInputHandler.js +0 -89
- package/dist/input/InteractiveInputHandler.js.map +0 -1
- package/dist/input/UserInputHandler.d.ts +0 -68
- package/dist/input/UserInputHandler.js +0 -39
- package/dist/input/UserInputHandler.js.map +0 -1
- package/dist/util/HTMLShapes.d.ts +0 -15
- package/dist/util/HTMLShapes.js +0 -25
- package/dist/util/HTMLShapes.js.map +0 -1
- package/dist/util/Rendering.d.ts +0 -120
- package/dist/util/Rendering.js +0 -142
- package/dist/util/Rendering.js.map +0 -1
- package/dist/workers/input/InputWorker.js.map +0 -1
- package/dist/workers/javascript/JavaScriptWorker.js.map +0 -1
- package/dist/workers/javascript/worker.js.map +0 -1
- package/dist/workers/python/PythonWorker.js.map +0 -1
- package/dist/workers/python/python_package.tar.gz.load_by_url +0 -0
- package/dist/workers/python/worker.js.map +0 -1
- /package/dist/{workers → backend/workers}/javascript/JavaScriptWorker.d.ts +0 -0
- /package/dist/{workers → backend/workers}/javascript/worker.d.ts +0 -0
- /package/dist/{workers → backend/workers}/javascript/worker.js +0 -0
- /package/dist/{workers → backend/workers}/python/worker.d.ts +0 -0
- /package/dist/{workers → backend/workers}/python/worker.js +0 -0
- /package/dist/{BackendEvent.d.ts → communication/BackendEvent.d.ts} +0 -0
- /package/dist/{BackendEvent.js → communication/BackendEvent.js} +0 -0
- /package/dist/{InputServiceWorker.d.ts → communication/InputServiceWorker.d.ts} +0 -0
- /package/dist/{workers/input → communication}/InputWorker.d.ts +0 -0
- /package/dist/{workers/input → communication}/InputWorker.js +0 -0
- /package/dist/{examples → frontend/components/app/examples}/JavaScriptExamples.d.ts +0 -0
- /package/dist/{examples → frontend/components/app/examples}/JavaScriptExamples.js +0 -0
- /package/dist/{examples → frontend/components/app/examples}/PythonExamples.d.ts +0 -0
- /package/dist/{examples → frontend/components/app/examples}/PythonExamples.js +0 -0
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { ProgrammingLanguage } from "../ProgrammingLanguage";
|
|
2
|
-
import { t } from "../util/Util";
|
|
3
|
-
import { acceptCompletion, autocompletion, closeBrackets, closeBracketsKeymap, completionKeymap } from "@codemirror/autocomplete";
|
|
4
|
-
import { defaultKeymap, history, historyKeymap, indentWithTab, insertBlankLine } from "@codemirror/commands";
|
|
5
|
-
import { javascript } from "@codemirror/lang-javascript";
|
|
6
|
-
import { python } from "@codemirror/lang-python";
|
|
7
|
-
import { bracketMatching, defaultHighlightStyle, foldGutter, indentOnInput, indentUnit, syntaxHighlighting } from "@codemirror/language";
|
|
8
|
-
import { highlightSelectionMatches, searchKeymap } from "@codemirror/search";
|
|
9
|
-
import { EditorState } from "@codemirror/state";
|
|
10
|
-
import { oneDarkHighlightStyle } from "@codemirror/theme-one-dark";
|
|
11
|
-
import { drawSelection, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, keymap, lineNumbers, rectangularSelection, showPanel } from "@codemirror/view";
|
|
12
|
-
import { linter, lintGutter, lintKeymap } from "@codemirror/lint";
|
|
13
|
-
import { CodeMirrorEditor } from "./CodeMirrorEditor";
|
|
14
|
-
import { darkTheme } from "./DarkTheme";
|
|
15
|
-
import { TestCodeExtension } from "./TestCodeExtension";
|
|
16
|
-
import { DebugExtension } from "./DebugExtension";
|
|
17
|
-
const tabCompletionKeyMap = [{ key: "Tab", run: acceptCompletion }];
|
|
18
|
-
/**
|
|
19
|
-
* Component that provides useful features to users writing code
|
|
20
|
-
*/
|
|
21
|
-
export class CodeEditor extends CodeMirrorEditor {
|
|
22
|
-
/**
|
|
23
|
-
* Construct a new CodeEditor
|
|
24
|
-
* @param {Function} onRunRequest Callback for when the user wants to run the code
|
|
25
|
-
* @param {string} initialCode The initial code to display
|
|
26
|
-
* @param {number} indentLength The length in spaces for the indent unit
|
|
27
|
-
*/
|
|
28
|
-
constructor(onRunRequest, initialCode = "", indentLength = 4) {
|
|
29
|
-
super(new Set([
|
|
30
|
-
CodeEditor.PROGRAMMING_LANGUAGE, CodeEditor.INDENTATION, CodeEditor.DEBUGGING,
|
|
31
|
-
CodeEditor.PANEL, CodeEditor.AUTOCOMPLETION, CodeEditor.LINTING
|
|
32
|
-
]), {
|
|
33
|
-
classes: ["papyros-code-editor", "_tw-overflow-auto",
|
|
34
|
-
"_tw-border-solid", "_tw-border-gray-200", "_tw-border-2",
|
|
35
|
-
"_tw-rounded-lg", "dark:_tw-border-dark-mode-content"],
|
|
36
|
-
minHeight: "20vh",
|
|
37
|
-
maxHeight: "72vh",
|
|
38
|
-
theme: {}
|
|
39
|
-
});
|
|
40
|
-
this.debugExtension = new DebugExtension(this.editorView);
|
|
41
|
-
this.addExtension([
|
|
42
|
-
keymap.of([
|
|
43
|
-
{
|
|
44
|
-
key: "Mod-Enter", run: () => {
|
|
45
|
-
onRunRequest();
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
// The original Ctrl-Enter keybind gets assigned to Shift-Enter
|
|
50
|
-
{
|
|
51
|
-
key: "Shift-Enter", run: insertBlankLine
|
|
52
|
-
}
|
|
53
|
-
]),
|
|
54
|
-
...CodeEditor.getExtensions()
|
|
55
|
-
]);
|
|
56
|
-
this.setText(initialCode);
|
|
57
|
-
this.setIndentLength(indentLength);
|
|
58
|
-
this.testCodeExtension = new TestCodeExtension(this.editorView);
|
|
59
|
-
this.addExtension(this.testCodeExtension.toExtension());
|
|
60
|
-
this.debugMode = false;
|
|
61
|
-
}
|
|
62
|
-
set debugMode(value) {
|
|
63
|
-
if (value) {
|
|
64
|
-
this.reconfigure([CodeEditor.DEBUGGING, [
|
|
65
|
-
this.debugExtension.toExtension(),
|
|
66
|
-
]]);
|
|
67
|
-
this.debugExtension.reset();
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
this.reconfigure([CodeEditor.DEBUGGING, [
|
|
71
|
-
highlightActiveLineGutter(),
|
|
72
|
-
lintGutter(),
|
|
73
|
-
highlightActiveLine()
|
|
74
|
-
]]);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
set testCode(code) {
|
|
78
|
-
this.testCodeExtension.testCode = code;
|
|
79
|
-
}
|
|
80
|
-
getText() {
|
|
81
|
-
if (this.testCodeExtension) {
|
|
82
|
-
return this.testCodeExtension.getNonTestCode();
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
return super.getText();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
getCode() {
|
|
89
|
-
return super.getText();
|
|
90
|
-
}
|
|
91
|
-
setDarkMode(darkMode) {
|
|
92
|
-
let styleExtensions = [];
|
|
93
|
-
if (darkMode) {
|
|
94
|
-
styleExtensions = [darkTheme, syntaxHighlighting(oneDarkHighlightStyle)];
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
styleExtensions = syntaxHighlighting(defaultHighlightStyle);
|
|
98
|
-
}
|
|
99
|
-
this.reconfigure([CodeMirrorEditor.STYLE, styleExtensions]);
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* @param {ProgrammingLanguage} language The language to use
|
|
103
|
-
*/
|
|
104
|
-
setProgrammingLanguage(language) {
|
|
105
|
-
this.reconfigure([CodeEditor.PROGRAMMING_LANGUAGE, CodeEditor.getLanguageSupport(language)]);
|
|
106
|
-
this.setPlaceholder(t("Papyros.code_placeholder", { programmingLanguage: language }));
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* @param {LintSource} lintSource Function to obtain linting results
|
|
110
|
-
*/
|
|
111
|
-
setLintingSource(lintSource) {
|
|
112
|
-
this.reconfigure([
|
|
113
|
-
CodeEditor.LINTING,
|
|
114
|
-
linter(lintSource)
|
|
115
|
-
]);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* @param {number} indentLength The number of spaces to use for indentation
|
|
119
|
-
*/
|
|
120
|
-
setIndentLength(indentLength) {
|
|
121
|
-
this.reconfigure([CodeEditor.INDENTATION, indentUnit.of(CodeEditor.getIndentUnit(indentLength))]);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* @param {HTMLElement} panel The panel to display at the bottom of the editor
|
|
125
|
-
*/
|
|
126
|
-
setPanel(panel) {
|
|
127
|
-
this.reconfigure([CodeEditor.PANEL, showPanel.of(() => {
|
|
128
|
-
return { dom: panel };
|
|
129
|
-
})]);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* @param {number} indentLength The amount of spaces to use
|
|
133
|
-
* @return {string} The indentation unit to be used by CodeMirror
|
|
134
|
-
*/
|
|
135
|
-
static getIndentUnit(indentLength) {
|
|
136
|
-
return new Array(indentLength).fill(" ").join("");
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* @param {ProgrammingLanguage} language The language to support
|
|
140
|
-
* @return {LanguageSupport} CodeMirror LanguageSupport for the language
|
|
141
|
-
*/
|
|
142
|
-
static getLanguageSupport(language) {
|
|
143
|
-
switch (language) {
|
|
144
|
-
case ProgrammingLanguage.Python: {
|
|
145
|
-
return python();
|
|
146
|
-
}
|
|
147
|
-
case ProgrammingLanguage.JavaScript: {
|
|
148
|
-
return javascript();
|
|
149
|
-
}
|
|
150
|
-
default: {
|
|
151
|
-
throw new Error(`${language} is not yet supported.`);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* - line numbers
|
|
157
|
-
* - special character highlighting
|
|
158
|
-
* - the undo history
|
|
159
|
-
* - a fold gutter
|
|
160
|
-
* - custom selection drawing
|
|
161
|
-
* - multiple selections
|
|
162
|
-
* - reindentation on input
|
|
163
|
-
* - bracket matching
|
|
164
|
-
* - bracket closing
|
|
165
|
-
* - autocompletion
|
|
166
|
-
* - rectangular selection
|
|
167
|
-
* - active line highlighting
|
|
168
|
-
* - active line gutter highlighting
|
|
169
|
-
* - selection match highlighting
|
|
170
|
-
* - gutter for linting
|
|
171
|
-
* Keymaps:
|
|
172
|
-
* - the default command bindings
|
|
173
|
-
* - bracket closing
|
|
174
|
-
* - searching
|
|
175
|
-
* - linting
|
|
176
|
-
* - completion
|
|
177
|
-
* - indenting with tab
|
|
178
|
-
* @return {Array<Extension} Default extensions to use
|
|
179
|
-
*/
|
|
180
|
-
static getExtensions() {
|
|
181
|
-
return [
|
|
182
|
-
lineNumbers(),
|
|
183
|
-
highlightSpecialChars(),
|
|
184
|
-
history(),
|
|
185
|
-
foldGutter(),
|
|
186
|
-
drawSelection(),
|
|
187
|
-
EditorState.allowMultipleSelections.of(true),
|
|
188
|
-
indentOnInput(),
|
|
189
|
-
bracketMatching(),
|
|
190
|
-
closeBrackets(),
|
|
191
|
-
autocompletion(),
|
|
192
|
-
rectangularSelection(),
|
|
193
|
-
highlightSelectionMatches(),
|
|
194
|
-
keymap.of([
|
|
195
|
-
...closeBracketsKeymap,
|
|
196
|
-
...defaultKeymap,
|
|
197
|
-
...searchKeymap,
|
|
198
|
-
...historyKeymap,
|
|
199
|
-
...completionKeymap,
|
|
200
|
-
...tabCompletionKeyMap,
|
|
201
|
-
...lintKeymap,
|
|
202
|
-
indentWithTab
|
|
203
|
-
]),
|
|
204
|
-
];
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
CodeEditor.PROGRAMMING_LANGUAGE = "programming_language";
|
|
208
|
-
CodeEditor.INDENTATION = "indentation";
|
|
209
|
-
CodeEditor.PANEL = "panel";
|
|
210
|
-
CodeEditor.AUTOCOMPLETION = "autocompletion";
|
|
211
|
-
CodeEditor.LINTING = "linting";
|
|
212
|
-
CodeEditor.DEBUGGING = "debugging";
|
|
213
|
-
//# sourceMappingURL=CodeEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../src/editor/CodeEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,UAAU,EAEV,kBAAkB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAa,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACH,aAAa,EAEb,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,SAAS,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAc,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,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kBAAkB,CAAC,QAA6B;QAC3D,QAAQ,QAAQ,EAAE,CAAC;YACf,KAAK,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC9B,OAAO,MAAM,EAAE,CAAC;YACpB,CAAC;YACD,KAAK,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC;gBAClC,OAAO,UAAU,EAAE,CAAC;YACxB,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,wBAAwB,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;MAwBE;IACM,MAAM,CAAC,aAAa;QACxB,OAAO;YACH,WAAW,EAAE;YACb,qBAAqB,EAAE;YACvB,OAAO,EAAE;YACT,UAAU,EAAE;YACZ,aAAa,EAAE;YACf,WAAW,CAAC,uBAAuB,CAAC,EAAE,CAAC,IAAI,CAAC;YAC5C,aAAa,EAAE;YACf,eAAe,EAAE;YACjB,aAAa,EAAE;YACf,cAAc,EAAE;YAChB,oBAAoB,EAAE;YACtB,yBAAyB,EAAE;YAC3B,MAAM,CAAC,EAAE,CAAC;gBACN,GAAG,mBAAmB;gBACtB,GAAG,aAAa;gBAChB,GAAG,YAAY;gBACf,GAAG,aAAa;gBAChB,GAAG,gBAAgB;gBACnB,GAAG,mBAAmB;gBACtB,GAAG,UAAU;gBACb,aAAa;aAChB,CAAC;SACL,CAAC;IACN,CAAC;;AAxNa,+BAAoB,GAAG,sBAAsB,CAAC;AAC9C,sBAAW,GAAG,aAAa,CAAC;AAC5B,gBAAK,GAAG,OAAO,CAAC;AAChB,yBAAc,GAAG,gBAAgB,CAAC;AAClC,kBAAO,GAAG,SAAS,CAAC;AACpB,oBAAS,GAAG,WAAW,CAAC"}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { Compartment, Extension } from "@codemirror/state";
|
|
2
|
-
import { EditorView, ViewUpdate } from "@codemirror/view";
|
|
3
|
-
import { Renderable, RenderOptions } from "../util/Rendering";
|
|
4
|
-
import { StyleSpec } from "style-mod";
|
|
5
|
-
/**
|
|
6
|
-
* Data structure containing common elements for styling
|
|
7
|
-
*/
|
|
8
|
-
export interface EditorStyling {
|
|
9
|
-
/**
|
|
10
|
-
* Array of HTML classes to apply to this editor
|
|
11
|
-
*/
|
|
12
|
-
classes: Array<string>;
|
|
13
|
-
/**
|
|
14
|
-
* The maximum height of the editor
|
|
15
|
-
*/
|
|
16
|
-
maxHeight: string;
|
|
17
|
-
/**
|
|
18
|
-
* The minimum height of the editor
|
|
19
|
-
*/
|
|
20
|
-
minHeight: string;
|
|
21
|
-
/**
|
|
22
|
-
* Extra theme options to be passed to EditorView.theme
|
|
23
|
-
*/
|
|
24
|
-
theme?: {
|
|
25
|
-
[selectorSpec: string]: StyleSpec;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Interface for listeners to textual changes in the editor
|
|
30
|
-
*/
|
|
31
|
-
export interface DocChangeListener {
|
|
32
|
-
/**
|
|
33
|
-
* Method to call with the new document value
|
|
34
|
-
*/
|
|
35
|
-
onChange: (code: string) => void;
|
|
36
|
-
/**
|
|
37
|
-
* How many milliseconds should pass since the last change
|
|
38
|
-
* before notifying (in case computations are expensive)
|
|
39
|
-
*/
|
|
40
|
-
delay?: number;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Interface for storing data related to delayed function calls
|
|
44
|
-
*/
|
|
45
|
-
interface TimeoutData {
|
|
46
|
-
/**
|
|
47
|
-
* The time in ms at which the last call occurred
|
|
48
|
-
*/
|
|
49
|
-
lastCalled: number;
|
|
50
|
-
/**
|
|
51
|
-
* The timeout identifier associated with the delayed call
|
|
52
|
-
* null if not currently scheduled
|
|
53
|
-
*/
|
|
54
|
-
timeout: NodeJS.Timeout | null;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Base class for Editors implemented using CodeMirror 6
|
|
58
|
-
* https://codemirror.net/6/
|
|
59
|
-
*/
|
|
60
|
-
export declare abstract class CodeMirrorEditor extends Renderable {
|
|
61
|
-
static STYLE: string;
|
|
62
|
-
static PLACEHOLDER: string;
|
|
63
|
-
static THEME: string;
|
|
64
|
-
static LANGUAGE: string;
|
|
65
|
-
/**
|
|
66
|
-
* CodeMirror EditorView representing the internal editor
|
|
67
|
-
*/
|
|
68
|
-
readonly editorView: EditorView;
|
|
69
|
-
/**
|
|
70
|
-
* Mapping of strings to Compartments associated with that property
|
|
71
|
-
*/
|
|
72
|
-
protected compartments: Map<string, Compartment>;
|
|
73
|
-
/**
|
|
74
|
-
* Data to style this Editor
|
|
75
|
-
*/
|
|
76
|
-
protected styling: EditorStyling;
|
|
77
|
-
/**
|
|
78
|
-
* Mapping for each change listener to its timeout identifier and last call time
|
|
79
|
-
*/
|
|
80
|
-
protected listenerTimeouts: Map<DocChangeListener, TimeoutData>;
|
|
81
|
-
/**
|
|
82
|
-
* @param {Set<string>} compartments Identifiers for configurable extensions
|
|
83
|
-
* @param {EditorStyling} styling Data to style this editor
|
|
84
|
-
*/
|
|
85
|
-
constructor(compartments: Set<string>, styling: EditorStyling);
|
|
86
|
-
protected onViewUpdate(v: ViewUpdate): void;
|
|
87
|
-
/**
|
|
88
|
-
* @param {Extension} extension The extension to add to the Editor
|
|
89
|
-
*/
|
|
90
|
-
protected addExtension(extension: Extension): void;
|
|
91
|
-
/**
|
|
92
|
-
* @return {string} The text within the editor
|
|
93
|
-
*/
|
|
94
|
-
getText(): string;
|
|
95
|
-
/**
|
|
96
|
-
* @param {string} text The new value to be shown in the editor
|
|
97
|
-
*/
|
|
98
|
-
setText(text: string): void;
|
|
99
|
-
/**
|
|
100
|
-
* Helper method to dispatch configuration changes at runtime
|
|
101
|
-
* @param {Array<[Option, Extension]>} items Array of items to reconfigure
|
|
102
|
-
* The option indicates the relevant compartment
|
|
103
|
-
* The extension indicates the new configuration
|
|
104
|
-
*/
|
|
105
|
-
reconfigure(...items: Array<[string, Extension]>): void;
|
|
106
|
-
/**
|
|
107
|
-
* Apply focus to the Editor
|
|
108
|
-
*/
|
|
109
|
-
focus(): void;
|
|
110
|
-
/**
|
|
111
|
-
* @param {string} placeholderValue The contents of the placeholder
|
|
112
|
-
*/
|
|
113
|
-
setPlaceholder(placeholderValue: string): void;
|
|
114
|
-
/**
|
|
115
|
-
* @param {boolean} darkMode Whether to use dark mode
|
|
116
|
-
*/
|
|
117
|
-
setDarkMode(darkMode: boolean): void;
|
|
118
|
-
/**
|
|
119
|
-
* Override the style used by this Editor
|
|
120
|
-
* @param {Partial<EditorStyling>} styling Object with keys of EditorStyling to override styles
|
|
121
|
-
*/
|
|
122
|
-
setStyling(styling: Partial<EditorStyling>): void;
|
|
123
|
-
protected _render(options: RenderOptions): void;
|
|
124
|
-
/**
|
|
125
|
-
* Process the changes by informing the listeners of the new contents
|
|
126
|
-
*/
|
|
127
|
-
private handleChange;
|
|
128
|
-
/**
|
|
129
|
-
* @param {DocChangeListener} changeListener Listener that performs actions on the new contents
|
|
130
|
-
*/
|
|
131
|
-
onChange(changeListener: DocChangeListener): void;
|
|
132
|
-
}
|
|
133
|
-
export {};
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { Compartment, EditorState, StateEffect } from "@codemirror/state";
|
|
2
|
-
import { EditorView, placeholder } from "@codemirror/view";
|
|
3
|
-
import { Renderable, renderWithOptions } from "../util/Rendering";
|
|
4
|
-
import { darkTheme } from "./DarkTheme";
|
|
5
|
-
import { CODE_MIRROR_TRANSLATIONS } from "../Translations";
|
|
6
|
-
import { cursorDocEnd } from "@codemirror/commands";
|
|
7
|
-
import { i18n } from "../util/Util";
|
|
8
|
-
/**
|
|
9
|
-
* Base class for Editors implemented using CodeMirror 6
|
|
10
|
-
* https://codemirror.net/6/
|
|
11
|
-
*/
|
|
12
|
-
export class CodeMirrorEditor extends Renderable {
|
|
13
|
-
/**
|
|
14
|
-
* @param {Set<string>} compartments Identifiers for configurable extensions
|
|
15
|
-
* @param {EditorStyling} styling Data to style this editor
|
|
16
|
-
*/
|
|
17
|
-
constructor(compartments, styling) {
|
|
18
|
-
super();
|
|
19
|
-
this.styling = styling;
|
|
20
|
-
this.listenerTimeouts = new Map();
|
|
21
|
-
// Ensure default compartments are present
|
|
22
|
-
compartments.add(CodeMirrorEditor.STYLE);
|
|
23
|
-
compartments.add(CodeMirrorEditor.PLACEHOLDER);
|
|
24
|
-
compartments.add(CodeMirrorEditor.THEME);
|
|
25
|
-
compartments.add(CodeMirrorEditor.LANGUAGE);
|
|
26
|
-
this.compartments = new Map();
|
|
27
|
-
const configurableExtensions = [];
|
|
28
|
-
compartments.forEach(opt => {
|
|
29
|
-
const compartment = new Compartment();
|
|
30
|
-
this.compartments.set(opt, compartment);
|
|
31
|
-
configurableExtensions.push(compartment.of([]));
|
|
32
|
-
});
|
|
33
|
-
this.editorView = new EditorView({
|
|
34
|
-
state: EditorState.create({
|
|
35
|
-
extensions: [
|
|
36
|
-
configurableExtensions,
|
|
37
|
-
EditorView.updateListener.of(this.onViewUpdate.bind(this))
|
|
38
|
-
]
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
onViewUpdate(v) {
|
|
43
|
-
if (v.docChanged) {
|
|
44
|
-
this.handleChange();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* @param {Extension} extension The extension to add to the Editor
|
|
49
|
-
*/
|
|
50
|
-
addExtension(extension) {
|
|
51
|
-
this.editorView.dispatch({
|
|
52
|
-
effects: StateEffect.appendConfig.of(extension)
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* @return {string} The text within the editor
|
|
57
|
-
*/
|
|
58
|
-
getText() {
|
|
59
|
-
return this.editorView.state.doc.toString();
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @param {string} text The new value to be shown in the editor
|
|
63
|
-
*/
|
|
64
|
-
setText(text) {
|
|
65
|
-
this.editorView.dispatch({ changes: { from: 0, to: this.getText().length, insert: text } });
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Helper method to dispatch configuration changes at runtime
|
|
69
|
-
* @param {Array<[Option, Extension]>} items Array of items to reconfigure
|
|
70
|
-
* The option indicates the relevant compartment
|
|
71
|
-
* The extension indicates the new configuration
|
|
72
|
-
*/
|
|
73
|
-
reconfigure(...items) {
|
|
74
|
-
this.editorView.dispatch({
|
|
75
|
-
effects: items.map(([opt, ext]) => this.compartments.get(opt).reconfigure(ext))
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Apply focus to the Editor
|
|
80
|
-
*/
|
|
81
|
-
focus() {
|
|
82
|
-
this.editorView.focus();
|
|
83
|
-
cursorDocEnd(this.editorView);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* @param {string} placeholderValue The contents of the placeholder
|
|
87
|
-
*/
|
|
88
|
-
setPlaceholder(placeholderValue) {
|
|
89
|
-
this.reconfigure([
|
|
90
|
-
CodeMirrorEditor.PLACEHOLDER,
|
|
91
|
-
placeholder(placeholderValue)
|
|
92
|
-
]);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* @param {boolean} darkMode Whether to use dark mode
|
|
96
|
-
*/
|
|
97
|
-
setDarkMode(darkMode) {
|
|
98
|
-
let styleExtensions = [];
|
|
99
|
-
if (darkMode) {
|
|
100
|
-
styleExtensions = [darkTheme];
|
|
101
|
-
}
|
|
102
|
-
this.reconfigure([CodeMirrorEditor.STYLE, styleExtensions]);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Override the style used by this Editor
|
|
106
|
-
* @param {Partial<EditorStyling>} styling Object with keys of EditorStyling to override styles
|
|
107
|
-
*/
|
|
108
|
-
setStyling(styling) {
|
|
109
|
-
Object.assign(this.styling, styling);
|
|
110
|
-
this.reconfigure([
|
|
111
|
-
CodeMirrorEditor.THEME,
|
|
112
|
-
EditorView.theme(Object.assign({ ".cm-scroller": { overflow: "auto" }, "&": {
|
|
113
|
-
"maxHeight": this.styling.maxHeight, "height": "100%",
|
|
114
|
-
"font-size": "14px" // use proper size to align gutters with editor
|
|
115
|
-
}, ".cm-gutter,.cm-content": { minHeight: this.styling.minHeight }, ".cm-button": {
|
|
116
|
-
"background-color": "#455A64",
|
|
117
|
-
"color": "white", "background-image": "none"
|
|
118
|
-
} }, (this.styling.theme || {})))
|
|
119
|
-
]);
|
|
120
|
-
}
|
|
121
|
-
_render(options) {
|
|
122
|
-
this.setStyling(this.styling);
|
|
123
|
-
this.setDarkMode(options.darkMode || false);
|
|
124
|
-
const language = i18n.locale;
|
|
125
|
-
this.reconfigure([
|
|
126
|
-
CodeMirrorEditor.LANGUAGE,
|
|
127
|
-
EditorState.phrases.of(CODE_MIRROR_TRANSLATIONS[language])
|
|
128
|
-
]);
|
|
129
|
-
const wrappingDiv = document.createElement("div");
|
|
130
|
-
wrappingDiv.classList.add(...this.styling.classes);
|
|
131
|
-
wrappingDiv.replaceChildren(this.editorView.dom);
|
|
132
|
-
renderWithOptions(options, wrappingDiv);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Process the changes by informing the listeners of the new contents
|
|
136
|
-
*/
|
|
137
|
-
handleChange() {
|
|
138
|
-
const currentDoc = this.getText();
|
|
139
|
-
const now = Date.now();
|
|
140
|
-
this.listenerTimeouts.forEach((timeoutData, listener) => {
|
|
141
|
-
// Clear existing scheduled calls
|
|
142
|
-
if (timeoutData.timeout !== null) {
|
|
143
|
-
clearTimeout(timeoutData.timeout);
|
|
144
|
-
}
|
|
145
|
-
timeoutData.lastCalled = now;
|
|
146
|
-
if (listener.delay && listener.delay > 0) {
|
|
147
|
-
timeoutData.timeout = setTimeout(() => {
|
|
148
|
-
timeoutData.timeout = null;
|
|
149
|
-
listener.onChange(currentDoc);
|
|
150
|
-
}, listener.delay);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
listener.onChange(currentDoc);
|
|
154
|
-
}
|
|
155
|
-
timeoutData.lastCalled = now;
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* @param {DocChangeListener} changeListener Listener that performs actions on the new contents
|
|
160
|
-
*/
|
|
161
|
-
onChange(changeListener) {
|
|
162
|
-
this.listenerTimeouts.set(changeListener, { timeout: null, lastCalled: 0 });
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
CodeMirrorEditor.STYLE = "style";
|
|
166
|
-
CodeMirrorEditor.PLACEHOLDER = "placeholder";
|
|
167
|
-
CodeMirrorEditor.THEME = "theme";
|
|
168
|
-
CodeMirrorEditor.LANGUAGE = "language";
|
|
169
|
-
//# sourceMappingURL=CodeMirrorEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CodeMirrorEditor.js","sourceRoot":"","sources":["../../src/editor/CodeMirrorEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAa,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAiB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAyDpC;;;GAGG;AACH,MAAM,OAAgB,gBAAiB,SAAQ,UAAU;IAsBrD;;;OAGG;IACH,YAAY,YAAyB,EAAE,OAAsB;QACzD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,0CAA0C;QAC1C,YAAY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@@
|
|
|
1
|
-
// Based on https://github.com/codemirror/theme-one-dark/blob/main/src/one-dark.ts with slight edits
|
|
2
|
-
import { EditorView } from "@codemirror/view";
|
|
3
|
-
// Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors
|
|
4
|
-
const ivory = "#abb2bf";
|
|
5
|
-
const stone = "#7d8799"; // Brightened compared to original to increase contrast
|
|
6
|
-
const darkBackground = "#21252b";
|
|
7
|
-
const highlightBackground = "#2c313a";
|
|
8
|
-
const background = "#282c34";
|
|
9
|
-
const tooltipBackground = "#353a42";
|
|
10
|
-
const selection = "#3E4451";
|
|
11
|
-
const cursor = "#528bff";
|
|
12
|
-
// / The editor theme styles
|
|
13
|
-
export const darkTheme = EditorView.theme({
|
|
14
|
-
"&": {
|
|
15
|
-
color: ivory,
|
|
16
|
-
backgroundColor: background
|
|
17
|
-
},
|
|
18
|
-
".cm-content": {
|
|
19
|
-
caretColor: cursor
|
|
20
|
-
},
|
|
21
|
-
".cm-cursor, .cm-dropCursor": { borderLeftColor: cursor },
|
|
22
|
-
"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: selection },
|
|
23
|
-
".cm-panels": { backgroundColor: darkBackground, color: ivory },
|
|
24
|
-
".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
|
|
25
|
-
".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
|
|
26
|
-
".cm-searchMatch": {
|
|
27
|
-
backgroundColor: "#72a1ff59",
|
|
28
|
-
outline: "1px solid #457dff"
|
|
29
|
-
},
|
|
30
|
-
".cm-searchMatch.cm-searchMatch-selected": {
|
|
31
|
-
backgroundColor: "#6199ff2f"
|
|
32
|
-
},
|
|
33
|
-
".cm-activeLine": { backgroundColor: highlightBackground },
|
|
34
|
-
".cm-selectionMatch": { backgroundColor: "#aafe661a" },
|
|
35
|
-
"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket": {
|
|
36
|
-
backgroundColor: "#bad0f847",
|
|
37
|
-
outline: "1px solid #515a6b"
|
|
38
|
-
},
|
|
39
|
-
".cm-gutters": {
|
|
40
|
-
// make gutters darker
|
|
41
|
-
backgroundColor: darkBackground,
|
|
42
|
-
color: stone,
|
|
43
|
-
border: "none"
|
|
44
|
-
},
|
|
45
|
-
".cm-activeLineGutter": {
|
|
46
|
-
backgroundColor: highlightBackground
|
|
47
|
-
},
|
|
48
|
-
".cm-foldPlaceholder": {
|
|
49
|
-
backgroundColor: "transparent",
|
|
50
|
-
border: "none",
|
|
51
|
-
color: "#ddd"
|
|
52
|
-
},
|
|
53
|
-
".cm-tooltip": {
|
|
54
|
-
border: "none",
|
|
55
|
-
backgroundColor: tooltipBackground
|
|
56
|
-
},
|
|
57
|
-
".cm-tooltip .cm-tooltip-arrow:before": {
|
|
58
|
-
borderTopColor: "transparent",
|
|
59
|
-
borderBottomColor: "transparent"
|
|
60
|
-
},
|
|
61
|
-
".cm-tooltip .cm-tooltip-arrow:after": {
|
|
62
|
-
borderTopColor: tooltipBackground,
|
|
63
|
-
borderBottomColor: tooltipBackground
|
|
64
|
-
},
|
|
65
|
-
".cm-tooltip-autocomplete": {
|
|
66
|
-
"& > ul > li[aria-selected]": {
|
|
67
|
-
backgroundColor: highlightBackground,
|
|
68
|
-
color: ivory
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}, { dark: true });
|
|
72
|
-
//# sourceMappingURL=DarkTheme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DarkTheme.js","sourceRoot":"","sources":["../../src/editor/DarkTheme.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,uFAAuF;AAEvF,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,uDAAuD;AAChF,MAAM,cAAc,GAAG,SAAS,CAAC;AACjC,MAAM,mBAAmB,GAAG,SAA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M,EAAE,MAAM;QACd,eAAe,EAAE,iBAAiB;KACrC;IACD,sCAAsC,EAAE;QACpC,cAAc,EAAE,aAAa;QAC7B,iBAAiB,EAAE,aAAa;KACnC;IACD,qCAAqC,EAAE;QACnC,cAAc,EAAE,iBAAiB;QACjC,iBAAiB,EAAE,iBAAiB;KACvC;IACD,0BAA0B,EAAE;QACxB,4BAA4B,EAAE;YAC1B,eAAe,EAAE,mBAAmB;YACpC,KAAK,EAAE,KAAK;SACf;KACJ;CACJ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EditorView } from "@codemirror/view";
|
|
2
|
-
import { Extension } from "@codemirror/state";
|
|
3
|
-
export declare class DebugExtension {
|
|
4
|
-
private readonly view;
|
|
5
|
-
private gutter;
|
|
6
|
-
private lineEffect;
|
|
7
|
-
constructor(view: EditorView);
|
|
8
|
-
reset(): void;
|
|
9
|
-
markLine(lineNr: number | undefined): void;
|
|
10
|
-
toExtension(): Extension;
|
|
11
|
-
}
|