@dodona/papyros 3.0.2 → 4.0.0-beta.2
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 +109 -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 +334 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialTheme.js","sourceRoot":"","sources":["../../../../src/frontend/components/code_mirror/MaterialTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGxC,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC;IAC1C,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;IACpC,GAAG,EAAE;QACD,MAAM,EAAE,MAAM,EAAE,0BAA0B;QAC1C,KAAK,EAAE,MAAM,EAAE,yBAAyB;QACxC,WAAW,EAAE,MAAM,EAAE,+CAA+C;QACpE,eAAe,EAAE,+CAA+C;QAChE,KAAK,EAAE,mCAAmC;KAC7C;IAED,aAAa,EAAE;QACX,eAAe,EAAE,uCAAuC;QACxD,KAAK,EAAE,wCAAwC;QAC/C,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,MAAM;KACnB;IAED,aAAa,EAAE;QACX,KAAK,EAAE,mCAAmC;KAC7C;IAED,sCAAsC,EAAE;QACpC,eAAe,EAAE,6EAA6E;KACjG;IAED,cAAc,EAAE;QACZ,OAAO,EAAE,MAAM;KAClB;IAED,yBAAyB,EAAE;QACvB,eAAe,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AG,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAE;IAE1D,sBAAsB;IACtB,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE;IACnD,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE;IACxC,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE;IAC3D,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,mCAAmC,EAAE;IAErF,iBAAiB;IACjB,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,2BAA2B,EAAE;IACzD,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,2BAA2B,EAAE;IACzD,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,mCAAmC,EAAE,UAAU,EAAE,MAAM,EAAE;IAEtF,cAAc;IACd,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,mCAAmC,EAAE;CACxG,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAc,CAAC,aAAa,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSResult, TemplateResult } from "lit";
|
|
2
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
3
|
+
import "@material/web/button/filled-button";
|
|
4
|
+
import "@material/web/button/outlined-button";
|
|
5
|
+
export declare class ButtonLint extends PapyrosElement {
|
|
6
|
+
static get styles(): CSSResult;
|
|
7
|
+
get buttons(): TemplateResult | TemplateResult[];
|
|
8
|
+
protected render(): TemplateResult;
|
|
9
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement } from "lit/decorators.js";
|
|
8
|
+
import { css, html } from "lit";
|
|
9
|
+
import { RunState } from "../../state/Runner";
|
|
10
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
11
|
+
import { RunMode } from "../../../backend/Backend";
|
|
12
|
+
import "@material/web/button/filled-button";
|
|
13
|
+
import "@material/web/button/outlined-button";
|
|
14
|
+
let ButtonLint = class ButtonLint extends PapyrosElement {
|
|
15
|
+
static get styles() {
|
|
16
|
+
return css `
|
|
17
|
+
:host {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
height: fit-content;
|
|
21
|
+
padding: 0.5rem;
|
|
22
|
+
gap: 1rem;
|
|
23
|
+
flex-wrap: wrap;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.buttons {
|
|
27
|
+
display: flex;
|
|
28
|
+
gap: 0.5rem;
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
get buttons() {
|
|
34
|
+
if (this.papyros.runner.state === RunState.Ready) {
|
|
35
|
+
if (this.papyros.debugger.active) {
|
|
36
|
+
return html `
|
|
37
|
+
<md-outlined-button @click=${() => this.papyros.debugger.active = false}>
|
|
38
|
+
<span slot="icon">${this.papyros.constants.icons.stopDebug}</span>
|
|
39
|
+
${this.t("Papyros.debug.stop")}
|
|
40
|
+
</md-outlined-button>`;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return [
|
|
44
|
+
html `
|
|
45
|
+
<md-filled-button @click=${() => this.papyros.runner.start(RunMode.Run)}>
|
|
46
|
+
<span slot="icon">${this.papyros.constants.icons[RunMode.Run]}</span>
|
|
47
|
+
${this.t(`Papyros.run_modes.${RunMode.Run}`)}
|
|
48
|
+
</md-filled-button>`,
|
|
49
|
+
...this.papyros.runner.runModes.map(mode => html `
|
|
50
|
+
<md-outlined-button @click=${() => this.papyros.runner.start(mode)}>
|
|
51
|
+
<span slot="icon">${this.papyros.constants.icons[mode]}</span>
|
|
52
|
+
${this.t(`Papyros.run_modes.${mode}`)}
|
|
53
|
+
</md-outlined-button>`)
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return html `
|
|
59
|
+
<md-filled-button @click=${() => this.papyros.runner.stop()}>
|
|
60
|
+
<span slot="icon">${this.papyros.constants.icons.stop}</span>
|
|
61
|
+
${this.t("Papyros.stop")}
|
|
62
|
+
</md-filled-button>`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return html `
|
|
67
|
+
<div class="buttons">${this.buttons}</div>
|
|
68
|
+
<div class="buttons"><slot></slot></div>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
ButtonLint = __decorate([
|
|
73
|
+
customElement("p-button-lint")
|
|
74
|
+
], ButtonLint);
|
|
75
|
+
export { ButtonLint };
|
|
76
|
+
//# sourceMappingURL=ButtonLint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonLint.js","sourceRoot":"","sources":["../../../../src/frontend/components/code_runner/ButtonLint.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,G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,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;gDAC1C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;8BACpD,IAAI,CAAC,CAAC,CAAC,qBAAqB,IAAI,EAAE,CAAC;8CACnB,CAAC;iBAC9B,CAAA;YACL,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,CAAA;2CACoB,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE;wCACnC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI;sBACnD,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC;oCACR,CAAC;QAC7B,CAAC;IACL,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;mCACgB,IAAI,CAAC,OAAO;;SAEtC,CAAC;IACN,CAAC;CACJ,CAAA;AAzDY,UAAU;IADtB,aAAa,CAAC,eAAe,CAAC;GAClB,UAAU,CAyDtB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CSSResult, TemplateResult } from "lit";
|
|
2
|
+
import "../code_mirror/CodeEditor";
|
|
3
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
4
|
+
export declare class Code extends PapyrosElement {
|
|
5
|
+
static get styles(): CSSResult;
|
|
6
|
+
protected render(): TemplateResult;
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, html } from "lit";
|
|
8
|
+
import "../code_mirror/CodeEditor";
|
|
9
|
+
import { customElement } from "lit/decorators.js";
|
|
10
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
11
|
+
let Code = class Code extends PapyrosElement {
|
|
12
|
+
static get styles() {
|
|
13
|
+
return css `
|
|
14
|
+
:host {
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return html `
|
|
22
|
+
<p-code-editor
|
|
23
|
+
.testLineCount=${this.papyros.test.testLineCount}
|
|
24
|
+
.programmingLanguage=${this.papyros.runner.programmingLanguage}
|
|
25
|
+
.debug=${this.papyros.debugger.active}
|
|
26
|
+
.debugLine=${this.papyros.debugger.debugLine}
|
|
27
|
+
.value=${this.papyros.runner.code}
|
|
28
|
+
.lintingSource=${this.papyros.runner.lintSource.bind(this.papyros.runner)}
|
|
29
|
+
.indentLength=${this.papyros.constants.indentationSize}
|
|
30
|
+
.translations=${this.papyros.i18n.getTranslations("CodeMirror")}
|
|
31
|
+
.theme=${this.papyros.constants.CodeMirrorTheme}
|
|
32
|
+
.placeholder=${this.t("Papyros.code_placeholder", { programmingLanguage: this.papyros.runner.programmingLanguage })}
|
|
33
|
+
.testLines=${this.papyros.test.testLines}
|
|
34
|
+
.testTranslations=${this.papyros.i18n.getTranslations("Papyros.editor.test_code")}
|
|
35
|
+
@edit-test-code=${() => this.papyros.test.testLineCount = undefined}
|
|
36
|
+
@remove-test-code=${() => this.papyros.test.testCode = undefined}
|
|
37
|
+
@change=${(e) => this.papyros.runner.code = e.detail}
|
|
38
|
+
></p-code-editor>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
Code = __decorate([
|
|
43
|
+
customElement("p-code")
|
|
44
|
+
], Code);
|
|
45
|
+
export { Code };
|
|
46
|
+
//# sourceMappingURL=Code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.js","sourceRoot":"","sources":["../../../../src/frontend/components/code_runner/Code.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAa,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3D,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG5C,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,cAAc;IACpC,MAAM,KAAK,MAAM;QACb,OAAO,GAAG,CAAA;;;;;SAKT,CAAA;IACL,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;;iCAEc,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa;uCACzB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB;yBACrD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM;6BACxB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS;yBACnC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI;iCAChB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;gCACzD,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe;gCACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC;yBACtD,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe;+BAChC,IAAI,CAAC,CAAC,CAAC,0BAA0B,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;6BACtG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS;oCACpB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,0BAA0B,CAAC;kCAC/D,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,GAAG,SAAS;oCAC/C,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,SAAS;0BACtD,CAAC,CAAc,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,MAAM;;SAExE,CAAA;IACL,CAAC;CACJ,CAAA;AA/BY,IAAI;IADhB,aAAa,CAAC,QAAQ,CAAC;GACX,IAAI,CA+BhB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
2
|
+
import { CSSResult, TemplateResult } from "lit";
|
|
3
|
+
import "@material/web/progress/circular-progress";
|
|
4
|
+
export declare class RunStateEl extends PapyrosElement {
|
|
5
|
+
static get styles(): CSSResult;
|
|
6
|
+
protected render(): TemplateResult;
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement } from "lit/decorators.js";
|
|
8
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
9
|
+
import { RunState } from "../../state/Runner";
|
|
10
|
+
import { css, html } from "lit";
|
|
11
|
+
import "@material/web/progress/circular-progress";
|
|
12
|
+
let RunStateEl = class RunStateEl extends PapyrosElement {
|
|
13
|
+
static get styles() {
|
|
14
|
+
return css `
|
|
15
|
+
:host {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: 0.5rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
md-circular-progress {
|
|
22
|
+
--md-circular-progress-size: 2rem;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
if (!this.papyros.runner.stateMessage)
|
|
28
|
+
return html ``;
|
|
29
|
+
return html `
|
|
30
|
+
${this.papyros.runner.state === RunState.Ready ? "" : html `
|
|
31
|
+
<md-circular-progress indeterminate></md-circular-progress>
|
|
32
|
+
`}
|
|
33
|
+
${this.papyros.runner.stateMessage}
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
RunStateEl = __decorate([
|
|
38
|
+
customElement("p-run-state")
|
|
39
|
+
], RunStateEl);
|
|
40
|
+
export { RunStateEl };
|
|
41
|
+
//# sourceMappingURL=RunState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunState.js","sourceRoot":"","sources":["../../../../src/frontend/components/code_runner/RunState.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAa,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3D,OAAO,0CAA0C,CAAC;AAG3C,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,cAAc;IAC1C,MAAM,KAAK,MAAM;QACb,OAAO,GAAG,CAAA;;;;;;;;;;SAUT,CAAC;IACN,CAAC;IAEkB,MAAM;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY;YAAE,OAAO,IAAI,CAAA,EAAE,CAAC;QAErD,OAAO,IAAI,CAAA;cACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAM,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;;aAE1D;cACC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY;SACrC,CAAA;IACL,CAAC;CACJ,CAAA;AAzBY,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAyBtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CSSResult, TemplateResult } from "lit";
|
|
2
|
+
import "../code_mirror/BatchInputEditor";
|
|
3
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
4
|
+
export declare class BatchInput extends PapyrosElement {
|
|
5
|
+
buffer: string;
|
|
6
|
+
unsubscribe: () => void;
|
|
7
|
+
static get styles(): CSSResult;
|
|
8
|
+
get usedLines(): number | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* All lines except the last one that has not (yet) been terminated by a newline
|
|
11
|
+
*/
|
|
12
|
+
get lines(): string[];
|
|
13
|
+
get nextLine(): string | undefined;
|
|
14
|
+
get placeholder(): string;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
provideInput(): void;
|
|
18
|
+
protected render(): TemplateResult;
|
|
19
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
import { css, html } from "lit";
|
|
9
|
+
import "../code_mirror/BatchInputEditor";
|
|
10
|
+
import { RunState } from "../../state/Runner";
|
|
11
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
12
|
+
let BatchInput = class BatchInput extends PapyrosElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.buffer = "";
|
|
16
|
+
this.unsubscribe = () => { };
|
|
17
|
+
}
|
|
18
|
+
static get styles() {
|
|
19
|
+
return css `
|
|
20
|
+
:host {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
overflow: auto;
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
get usedLines() {
|
|
29
|
+
if (this.papyros.debugger.active && this.papyros.debugger.debugUsedInputs !== undefined) {
|
|
30
|
+
return this.papyros.debugger.debugUsedInputs;
|
|
31
|
+
}
|
|
32
|
+
return this.papyros.io.inputs.length;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* All lines except the last one that has not (yet) been terminated by a newline
|
|
36
|
+
*/
|
|
37
|
+
get lines() {
|
|
38
|
+
return this.buffer.split("\n").slice(0, -1);
|
|
39
|
+
}
|
|
40
|
+
get nextLine() {
|
|
41
|
+
if (this.usedLines !== undefined && this.lines.length > this.usedLines) {
|
|
42
|
+
return this.lines[this.usedLines];
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
get placeholder() {
|
|
47
|
+
if (this.papyros.io.prompt) {
|
|
48
|
+
return this.papyros.io.prompt;
|
|
49
|
+
}
|
|
50
|
+
return this.t("Papyros.input_placeholder.batch");
|
|
51
|
+
}
|
|
52
|
+
connectedCallback() {
|
|
53
|
+
super.connectedCallback();
|
|
54
|
+
this.unsubscribe = this.papyros.io.subscribe(() => this.provideInput(), "awaitingInput");
|
|
55
|
+
}
|
|
56
|
+
disconnectedCallback() {
|
|
57
|
+
super.disconnectedCallback();
|
|
58
|
+
this.unsubscribe();
|
|
59
|
+
}
|
|
60
|
+
provideInput() {
|
|
61
|
+
if (this.papyros.io.awaitingInput && this.nextLine !== undefined) {
|
|
62
|
+
this.papyros.io.provideInput(this.nextLine);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return html `
|
|
67
|
+
<p-batch-input-editor
|
|
68
|
+
.value=${this.buffer}
|
|
69
|
+
.usedLines=${this.usedLines}
|
|
70
|
+
.readOnly=${this.papyros.debugger.active && this.papyros.runner.state === RunState.Ready}
|
|
71
|
+
.placeholder=${this.placeholder}
|
|
72
|
+
.translations=${this.papyros.i18n.getTranslations("CodeMirror")}
|
|
73
|
+
.theme=${this.papyros.constants.CodeMirrorTheme}
|
|
74
|
+
@change=${(e) => {
|
|
75
|
+
this.buffer = e.detail;
|
|
76
|
+
this.provideInput();
|
|
77
|
+
if (!this.papyros.debugger.active && this.papyros.runner.state === RunState.Ready) {
|
|
78
|
+
this.papyros.io.clearInputs();
|
|
79
|
+
}
|
|
80
|
+
}}
|
|
81
|
+
></p-batch-input-editor>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
__decorate([
|
|
86
|
+
property({ state: true })
|
|
87
|
+
], BatchInput.prototype, "buffer", void 0);
|
|
88
|
+
BatchInput = __decorate([
|
|
89
|
+
customElement("p-batch-input")
|
|
90
|
+
], BatchInput);
|
|
91
|
+
export { BatchInput };
|
|
92
|
+
//# sourceMappingURL=BatchInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BatchInput.js","sourceRoot":"","sources":["../../../../src/frontend/components/input/BatchInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE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C,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;gBAC/E,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;YAClC,CAAC;QACL,CAAC;;SAEI,CAAA;IACL,CAAC;CACJ,CAAA;AA7EO;IADH,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;0CACF;AAFf,UAAU;IADtB,aAAa,CAAC,eAAe,CAAC;GAClB,UAAU,CA+EtB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from "lit/directives/ref.js";
|
|
2
|
+
import { CSSResult, PropertyValues, TemplateResult } from "lit";
|
|
3
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
4
|
+
import "@material/web/textfield/outlined-text-field";
|
|
5
|
+
import "@material/web/button/outlined-button";
|
|
6
|
+
export declare class InteractiveInput extends PapyrosElement {
|
|
7
|
+
value: string;
|
|
8
|
+
inputRef: Ref<HTMLInputElement>;
|
|
9
|
+
static get styles(): CSSResult;
|
|
10
|
+
provideInput(): void;
|
|
11
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
12
|
+
protected render(): TemplateResult;
|
|
13
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
9
|
+
import { css, html } from "lit";
|
|
10
|
+
import { PapyrosElement } from "../PapyrosElement";
|
|
11
|
+
import "@material/web/textfield/outlined-text-field";
|
|
12
|
+
import "@material/web/button/outlined-button";
|
|
13
|
+
let InteractiveInput = class InteractiveInput extends PapyrosElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.value = "";
|
|
17
|
+
this.inputRef = createRef();
|
|
18
|
+
}
|
|
19
|
+
static get styles() {
|
|
20
|
+
return css `
|
|
21
|
+
:host {
|
|
22
|
+
width: 100%;
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 0.5rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
md-outlined-text-field {
|
|
28
|
+
flex-grow: 1;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
provideInput() {
|
|
33
|
+
this.papyros.io.provideInput(this.value);
|
|
34
|
+
this.value = "";
|
|
35
|
+
}
|
|
36
|
+
updated(_changedProperties) {
|
|
37
|
+
super.updated(_changedProperties);
|
|
38
|
+
if (this.papyros.io.awaitingInput) {
|
|
39
|
+
this.inputRef.value.focus();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
return html `
|
|
44
|
+
<md-outlined-text-field
|
|
45
|
+
type="text"
|
|
46
|
+
.value=${this.value}
|
|
47
|
+
@input=${(e) => this.value = e.target.value}
|
|
48
|
+
@keydown=${(e) => {
|
|
49
|
+
if (e.key === "Enter") {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
this.provideInput();
|
|
52
|
+
}
|
|
53
|
+
}}
|
|
54
|
+
placeholder=${this.papyros.io.prompt || this.t("Papyros.input_placeholder.interactive")}
|
|
55
|
+
?disabled=${!this.papyros.io.awaitingInput}
|
|
56
|
+
${ref(this.inputRef)}
|
|
57
|
+
></md-outlined-text-field>
|
|
58
|
+
<md-outlined-button
|
|
59
|
+
@click=${() => this.provideInput()}
|
|
60
|
+
?disabled=${!this.papyros.io.awaitingInput}>
|
|
61
|
+
${this.t("Papyros.enter")}
|
|
62
|
+
</md-outlined-button>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
__decorate([
|
|
67
|
+
property({ state: true })
|
|
68
|
+
], InteractiveInput.prototype, "value", void 0);
|
|
69
|
+
InteractiveInput = __decorate([
|
|
70
|
+
customElement("p-interactive-input")
|
|
71
|
+
], InteractiveInput);
|
|
72
|
+
export { InteractiveInput };
|
|
73
|
+
//# sourceMappingURL=InteractiveInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractiveInput.js","sourceRoot":"","sources":["../../../../src/frontend/components/input/InteractiveInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAO,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAa,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,6CAA6C,CAAC;AACrD,OAAO,sCAAsC,CAAC;AAGvC,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,cAAc;IAA7C;;QACwB,UAAK,GAAW,EAAE,CAAC;QAC9C,aAAQ,GAA0B,SAAS,EAAE,CAAC;IAmDlD,CAAC;IAjDG,MAAM,KAAK,MAAM;QACb,OAAO,GAAG,CAAA;;;;;;;;;;SAUT,CAAC;IACN,CAAC;IAED,YAAY;QACR,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IACpB,CAAC;IAEkB,OAAO,CAAC,kBAAkC;QACzD,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAClC,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;YAChC,IAAI,CAAC,QAAQ,CAAC,KAAM,CAAC,KAAK,EAAE,CAAC;QACjC,CAAC;IACL,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;;;4BAGS,IAAI,CAAC,KAAK;4BACV,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK;8BAC7D,CAAC,CAAgB,EAAE,EAAE;YAC3C,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;gBACpB,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,IAAI,CAAC,YAAY,EAAE,CAAC;YACxB,CAAC;QACL,CAAC;iCAC4B,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,uCAAuC,CAAC;+BAC3E,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,aAAa;qBACxC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;;;6BAGV,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;gCACtB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,aAAa;kBAC5C,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC;;SAEhC,CAAC;IACN,CAAC;CACJ,CAAA;AApD8B;IAA1B,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;+CAAoB;AADrC,gBAAgB;IAD5B,aAAa,CAAC,qBAAqB,CAAC;GACxB,gBAAgB,CAqD5B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { State } from "@dodona/lit-state";
|
|
2
|
+
import { CSSResult } from "lit";
|
|
3
|
+
import { Extension } from "@codemirror/state";
|
|
4
|
+
export type ThemeOption = {
|
|
5
|
+
theme: CSSResult;
|
|
6
|
+
dark: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class Constants extends State {
|
|
10
|
+
/**
|
|
11
|
+
* The maximum length of the output (in lines).
|
|
12
|
+
* Default is 1000 lines.
|
|
13
|
+
* If the output exceeds this length, it will be truncated.
|
|
14
|
+
* Overflowing output will be downloadable.
|
|
15
|
+
*/
|
|
16
|
+
maxOutputLength: number;
|
|
17
|
+
/**
|
|
18
|
+
* The maximum number of debug frames
|
|
19
|
+
* Default is 10000 frames.
|
|
20
|
+
* If the number of frames exceeds this limit, execution will be stopped.
|
|
21
|
+
*/
|
|
22
|
+
maxDebugFrames: number;
|
|
23
|
+
icons: {
|
|
24
|
+
debug: import("lit").TemplateResult<1>;
|
|
25
|
+
run: import("lit").TemplateResult<1>;
|
|
26
|
+
doctest: import("lit").TemplateResult<1>;
|
|
27
|
+
stop: import("lit").TemplateResult<1>;
|
|
28
|
+
stopDebug: import("lit").TemplateResult<1>;
|
|
29
|
+
info: import("lit").TemplateResult<1>;
|
|
30
|
+
help: import("lit").TemplateResult<1>;
|
|
31
|
+
};
|
|
32
|
+
indentationSize: number;
|
|
33
|
+
CodeMirrorTheme: Extension;
|
|
34
|
+
themes: Record<string, ThemeOption>;
|
|
35
|
+
private _activeThemeName;
|
|
36
|
+
get activeTheme(): ThemeOption;
|
|
37
|
+
set activeTheme(value: ThemeOption);
|
|
38
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { State, stateProperty } from "@dodona/lit-state";
|
|
8
|
+
import { RunMode } from "../../backend/Backend";
|
|
9
|
+
import { html } from "lit";
|
|
10
|
+
import { material } from "../components/code_mirror/MaterialTheme";
|
|
11
|
+
import blueLight from "./themes/blue-light";
|
|
12
|
+
import blueDark from "./themes/blue-dark";
|
|
13
|
+
import greenLight from "./themes/green-light";
|
|
14
|
+
import greenDark from "./themes/green-dark";
|
|
15
|
+
import redLight from "./themes/red-light";
|
|
16
|
+
import redDark from "./themes/red-dark";
|
|
17
|
+
export class Constants extends State {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
/**
|
|
21
|
+
* The maximum length of the output (in lines).
|
|
22
|
+
* Default is 1000 lines.
|
|
23
|
+
* If the output exceeds this length, it will be truncated.
|
|
24
|
+
* Overflowing output will be downloadable.
|
|
25
|
+
*/
|
|
26
|
+
this.maxOutputLength = 1000;
|
|
27
|
+
/**
|
|
28
|
+
* The maximum number of debug frames
|
|
29
|
+
* Default is 10000 frames.
|
|
30
|
+
* If the number of frames exceeds this limit, execution will be stopped.
|
|
31
|
+
*/
|
|
32
|
+
this.maxDebugFrames = 10000;
|
|
33
|
+
this.icons = {
|
|
34
|
+
[RunMode.Debug]: html `
|
|
35
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
36
|
+
<path d="M19 7H16.19C15.74 6.2 15.12 5.5 14.37 5L16 3.41L14.59 2L12.42 4.17C11.96 4.06 11.5 4 11 4S10.05 4.06 9.59 4.17L7.41 2L6 3.41L7.62 5C6.87 5.5 6.26 6.21 5.81 7H3V9H5.09C5.03 9.33 5 9.66 5 10V11H3V13H5V14C5 14.34 5.03 14.67 5.09 15H3V17H5.81C7.26 19.5 10.28 20.61 13 19.65V19C13 18.43 13.09 17.86 13.25 17.31C12.59 17.76 11.8 18 11 18C8.79 18 7 16.21 7 14V10C7 7.79 8.79 6 11 6S15 7.79 15 10V14C15 14.19 15 14.39 14.95 14.58C15.54 14.04 16.24 13.62 17 13.35V13H19V11H17V10C17 9.66 16.97 9.33 16.91 9H19V7M13 9V11H9V9H13M13 13V15H9V13H13M17 16V22L22 19L17 16Z"/>
|
|
37
|
+
</svg>`,
|
|
38
|
+
[RunMode.Run]: html `
|
|
39
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><
|
|
40
|
+
<path d="M8,5.14V19.14L19,12.14L8,5.14Z"/>
|
|
41
|
+
</svg>`,
|
|
42
|
+
[RunMode.Doctest]: html `
|
|
43
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><
|
|
44
|
+
<path d="M8,5.14V19.14L19,12.14L8,5.14Z"/>
|
|
45
|
+
</svg>`,
|
|
46
|
+
stop: html `
|
|
47
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
48
|
+
<path d="M18,18H6V6H18V18Z"/>
|
|
49
|
+
</svg>`,
|
|
50
|
+
stopDebug: html `
|
|
51
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
52
|
+
<path d="M19 7H16.19C15.74 6.2 15.12 5.5 14.37 5L16 3.41L14.59 2L12.42 4.17C11.96 4.06 11.5 4 11 4S10.05 4.06 9.59 4.17L7.41 2L6 3.41L7.62 5C6.87 5.5 6.26 6.21 5.81 7H3V9H5.09C5.03 9.33 5 9.66 5 10V11H3V13H5V14C5 14.34 5.03 14.67 5.09 15H3V17H5.81C7.26 19.5 10.28 20.61 13 19.65V19C13 18.43 13.09 17.86 13.25 17.31C12.59 17.76 11.8 18 11 18C8.79 18 7 16.21 7 14V10C7 7.79 8.79 6 11 6S15 7.79 15 10V14C15 14.19 15 14.39 14.95 14.58C15.54 14.04 16.24 13.62 17 13.35V13H19V11H17V10C17 9.66 16.97 9.33 16.91 9H19V7M13 9V11H9V9H13M13 13V15H9V13H13M16 16H22V22H16V16Z"/>
|
|
53
|
+
</svg>`,
|
|
54
|
+
info: html `
|
|
55
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor">
|
|
56
|
+
<path d="M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/>
|
|
57
|
+
</svg>
|
|
58
|
+
`,
|
|
59
|
+
help: html `
|
|
60
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor">
|
|
61
|
+
<path d="M478-240q21 0 35.5-14.5T528-290q0-21-14.5-35.5T478-340q-21 0-35.5 14.5T428-290q0 21 14.5 35.5T478-240Zm-36-154h74q0-33 7.5-52t42.5-52q26-26 41-49.5t15-56.5q0-56-41-86t-97-30q-57 0-92.5 30T342-618l66 26q5-18 22.5-39t53.5-21q32 0 48 17.5t16 38.5q0 20-12 37.5T506-526q-44 39-54 59t-10 73Zm38 314q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/>
|
|
62
|
+
</svg>
|
|
63
|
+
`
|
|
64
|
+
};
|
|
65
|
+
this.indentationSize = 4;
|
|
66
|
+
this.CodeMirrorTheme = material;
|
|
67
|
+
this.themes = {
|
|
68
|
+
"Blue Light": { theme: blueLight, dark: false, name: "Blue Light" },
|
|
69
|
+
"Blue Dark": { theme: blueDark, dark: true, name: "Blue Dark" },
|
|
70
|
+
"Green Light": { theme: greenLight, dark: false, name: "Green Light" },
|
|
71
|
+
"Green Dark": { theme: greenDark, dark: true, name: "Green Dark" },
|
|
72
|
+
"Red Light": { theme: redLight, dark: false, name: "Red Light" },
|
|
73
|
+
"Red Dark": { theme: redDark, dark: true, name: "Red Dark" },
|
|
74
|
+
};
|
|
75
|
+
this._activeThemeName = "Blue Light";
|
|
76
|
+
}
|
|
77
|
+
get activeTheme() {
|
|
78
|
+
return this.themes[this._activeThemeName];
|
|
79
|
+
}
|
|
80
|
+
set activeTheme(value) {
|
|
81
|
+
this._activeThemeName = value.name;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
__decorate([
|
|
85
|
+
stateProperty
|
|
86
|
+
], Constants.prototype, "maxOutputLength", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
stateProperty
|
|
89
|
+
], Constants.prototype, "maxDebugFrames", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
stateProperty
|
|
92
|
+
], Constants.prototype, "icons", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
stateProperty
|
|
95
|
+
], Constants.prototype, "indentationSize", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
stateProperty
|
|
98
|
+
], Constants.prototype, "CodeMirrorTheme", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
stateProperty
|
|
101
|
+
], Constants.prototype, "themes", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
stateProperty
|
|
104
|
+
], Constants.prototype, "_activeThemeName", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
stateProperty
|
|
107
|
+
], Constants.prototype, "activeTheme", null);
|
|
108
|
+
//# sourceMappingURL=Constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/frontend/state/Constants.ts"],"names":[],"mappings":";;;;;;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AE,WAAW,EAAE;YAC/D,aAAa,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE;YACtE,YAAY,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE;YAClE,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE;YAChE,UAAU,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE;SAC/D,CAAC;QAGE,qBAAgB,GAAW,YAAY,CAAC;IAUpD,CAAC;IAPG,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,WAAW,CAAC,KAAkB;QAC9B,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC;IACvC,CAAC;CACJ;AAtEO;IADH,aAAa;kDACqB;AAO/B;IADH,aAAa;iDACqB;AAG/B;IADH,aAAa;wCAgCR;AAGF;IADH,aAAa;kDACkB;AAG5B;IADH,aAAa;kDAC4B;AAGtC;IADH,aAAa;yCAQR;AAGE;IADP,aAAa;mDACkC;AAGhD;IADC,aAAa;4CAGb"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Frame } from "@dodona/trace-component/dist/trace_types";
|
|
2
|
+
import { State } from "@dodona/lit-state";
|
|
3
|
+
import { Papyros } from "../../Papyros";
|
|
4
|
+
export type FrameState = {
|
|
5
|
+
line: number;
|
|
6
|
+
outputs: number;
|
|
7
|
+
inputs: number;
|
|
8
|
+
};
|
|
9
|
+
export declare class Debugger extends State {
|
|
10
|
+
private papyros;
|
|
11
|
+
private frameStates;
|
|
12
|
+
activeFrame: number | undefined;
|
|
13
|
+
trace: Frame[];
|
|
14
|
+
private _active;
|
|
15
|
+
set active(active: boolean);
|
|
16
|
+
get active(): boolean;
|
|
17
|
+
constructor(papyros: Papyros);
|
|
18
|
+
reset(): void;
|
|
19
|
+
get activeFrameState(): FrameState | undefined;
|
|
20
|
+
get debugLine(): number | undefined;
|
|
21
|
+
get debugOutputs(): number | undefined;
|
|
22
|
+
get debugUsedInputs(): number | undefined;
|
|
23
|
+
}
|