@dodona/papyros 4.0.7 → 4.1.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/dist/assets/__vite-browser-external-9wXp6ZBx.js +1 -0
- package/dist/assets/__vite-browser-external-BIHI7g3E.js +1 -0
- package/dist/assets/index-C1AWjGcU.js +2202 -0
- package/dist/assets/manifest-BaVmi6rC.json +15 -0
- package/dist/assets/python_package.tar.gz-B8aMWvGt.load_by_url +0 -0
- package/dist/assets/worker-BhABRh01.js +5 -0
- package/dist/assets/worker-C2Ju1j5g.js +110 -0
- package/dist/index.html +26 -0
- package/dist/manifest.json +15 -0
- package/dist/robots.txt +3 -0
- package/package.json +25 -25
- package/dist/Library.d.ts +0 -11
- package/dist/Library.js +0 -11
- package/dist/Library.js.map +0 -1
- package/dist/ProgrammingLanguage.d.ts +0 -7
- package/dist/ProgrammingLanguage.js +0 -9
- package/dist/ProgrammingLanguage.js.map +0 -1
- package/dist/backend/Backend.d.ts +0 -92
- package/dist/backend/Backend.js +0 -79
- package/dist/backend/Backend.js.map +0 -1
- package/dist/backend/workers/javascript/JavaScriptWorker.d.ts +0 -39
- package/dist/backend/workers/javascript/JavaScriptWorker.js +0 -158
- package/dist/backend/workers/javascript/JavaScriptWorker.js.map +0 -1
- package/dist/backend/workers/javascript/worker.d.ts +0 -1
- package/dist/backend/workers/javascript/worker.js +0 -5
- package/dist/backend/workers/javascript/worker.js.map +0 -1
- package/dist/backend/workers/python/PythonWorker.d.ts +0 -32
- package/dist/backend/workers/python/PythonWorker.js +0 -117
- package/dist/backend/workers/python/PythonWorker.js.map +0 -1
- package/dist/backend/workers/python/python_package.tar.gz.load_by_url +0 -0
- package/dist/backend/workers/python/worker.d.ts +0 -1
- package/dist/backend/workers/python/worker.js +0 -5
- package/dist/backend/workers/python/worker.js.map +0 -1
- package/dist/communication/BackendEvent.d.ts +0 -33
- package/dist/communication/BackendEvent.js +0 -18
- package/dist/communication/BackendEvent.js.map +0 -1
- package/dist/communication/BackendEventQueue.d.ts +0 -59
- package/dist/communication/BackendEventQueue.js +0 -96
- package/dist/communication/BackendEventQueue.js.map +0 -1
- package/dist/communication/BackendManager.d.ts +0 -68
- package/dist/communication/BackendManager.js +0 -99
- package/dist/communication/BackendManager.js.map +0 -1
- package/dist/communication/InputServiceWorker.d.ts +0 -1
- package/dist/communication/InputServiceWorker.js +0 -37
- package/dist/communication/InputServiceWorker.js.map +0 -1
- package/dist/communication/InputWorker.d.ts +0 -22
- package/dist/communication/InputWorker.js +0 -63
- package/dist/communication/InputWorker.js.map +0 -1
- package/dist/frontend/components/CodeRunner.d.ts +0 -9
- package/dist/frontend/components/CodeRunner.js +0 -60
- package/dist/frontend/components/CodeRunner.js.map +0 -1
- package/dist/frontend/components/Debugger.d.ts +0 -7
- package/dist/frontend/components/Debugger.js +0 -75
- package/dist/frontend/components/Debugger.js.map +0 -1
- package/dist/frontend/components/Input.d.ts +0 -13
- package/dist/frontend/components/Input.js +0 -60
- package/dist/frontend/components/Input.js.map +0 -1
- package/dist/frontend/components/Output.d.ts +0 -14
- package/dist/frontend/components/Output.js +0 -157
- package/dist/frontend/components/Output.js.map +0 -1
- package/dist/frontend/components/PapyrosElement.d.ts +0 -8
- package/dist/frontend/components/PapyrosElement.js +0 -24
- package/dist/frontend/components/PapyrosElement.js.map +0 -1
- package/dist/frontend/components/app/App.d.ts +0 -24
- package/dist/frontend/components/app/App.js +0 -207
- package/dist/frontend/components/app/App.js.map +0 -1
- package/dist/frontend/components/app/ExamplePicker.d.ts +0 -7
- package/dist/frontend/components/app/ExamplePicker.js +0 -36
- package/dist/frontend/components/app/ExamplePicker.js.map +0 -1
- package/dist/frontend/components/app/LanguagePicker.d.ts +0 -7
- package/dist/frontend/components/app/LanguagePicker.js +0 -33
- package/dist/frontend/components/app/LanguagePicker.js.map +0 -1
- package/dist/frontend/components/app/ProgrammingLanguagePicker.d.ts +0 -7
- package/dist/frontend/components/app/ProgrammingLanguagePicker.js +0 -38
- package/dist/frontend/components/app/ProgrammingLanguagePicker.js.map +0 -1
- package/dist/frontend/components/app/examples/JavaScriptExamples.d.ts +0 -5
- package/dist/frontend/components/app/examples/JavaScriptExamples.js +0 -16
- package/dist/frontend/components/app/examples/JavaScriptExamples.js.map +0 -1
- package/dist/frontend/components/app/examples/PythonExamples.d.ts +0 -14
- package/dist/frontend/components/app/examples/PythonExamples.js +0 -163
- package/dist/frontend/components/app/examples/PythonExamples.js.map +0 -1
- package/dist/frontend/components/app/themes/ThemePicker.d.ts +0 -11
- package/dist/frontend/components/app/themes/ThemePicker.js +0 -48
- package/dist/frontend/components/app/themes/ThemePicker.js.map +0 -1
- package/dist/frontend/components/app/themes/ThemedButton.d.ts +0 -9
- package/dist/frontend/components/app/themes/ThemedButton.js +0 -53
- package/dist/frontend/components/app/themes/ThemedButton.js.map +0 -1
- package/dist/frontend/components/code_mirror/BatchInputEditor.d.ts +0 -8
- package/dist/frontend/components/code_mirror/BatchInputEditor.js +0 -51
- package/dist/frontend/components/code_mirror/BatchInputEditor.js.map +0 -1
- package/dist/frontend/components/code_mirror/CodeEditor.d.ts +0 -24
- package/dist/frontend/components/code_mirror/CodeEditor.js +0 -200
- package/dist/frontend/components/code_mirror/CodeEditor.js.map +0 -1
- package/dist/frontend/components/code_mirror/CodeMirrorEditor.d.ts +0 -22
- package/dist/frontend/components/code_mirror/CodeMirrorEditor.js +0 -111
- package/dist/frontend/components/code_mirror/CodeMirrorEditor.js.map +0 -1
- package/dist/frontend/components/code_mirror/Extensions.d.ts +0 -15
- package/dist/frontend/components/code_mirror/Extensions.js +0 -164
- package/dist/frontend/components/code_mirror/Extensions.js.map +0 -1
- package/dist/frontend/components/code_mirror/MaterialTheme.d.ts +0 -5
- package/dist/frontend/components/code_mirror/MaterialTheme.js +0 -115
- package/dist/frontend/components/code_mirror/MaterialTheme.js.map +0 -1
- package/dist/frontend/components/code_runner/ButtonLint.d.ts +0 -9
- package/dist/frontend/components/code_runner/ButtonLint.js +0 -72
- package/dist/frontend/components/code_runner/ButtonLint.js.map +0 -1
- package/dist/frontend/components/code_runner/Code.d.ts +0 -7
- package/dist/frontend/components/code_runner/Code.js +0 -48
- package/dist/frontend/components/code_runner/Code.js.map +0 -1
- package/dist/frontend/components/code_runner/RunState.d.ts +0 -7
- package/dist/frontend/components/code_runner/RunState.js +0 -41
- package/dist/frontend/components/code_runner/RunState.js.map +0 -1
- package/dist/frontend/components/input/BatchInput.d.ts +0 -9
- package/dist/frontend/components/input/BatchInput.js +0 -53
- package/dist/frontend/components/input/BatchInput.js.map +0 -1
- package/dist/frontend/components/input/InteractiveInput.d.ts +0 -13
- package/dist/frontend/components/input/InteractiveInput.js +0 -71
- package/dist/frontend/components/input/InteractiveInput.js.map +0 -1
- package/dist/frontend/state/Constants.d.ts +0 -38
- package/dist/frontend/state/Constants.js +0 -111
- package/dist/frontend/state/Constants.js.map +0 -1
- package/dist/frontend/state/Debugger.d.ts +0 -23
- package/dist/frontend/state/Debugger.js +0 -86
- package/dist/frontend/state/Debugger.js.map +0 -1
- package/dist/frontend/state/Examples.d.ts +0 -11
- package/dist/frontend/state/Examples.js +0 -36
- package/dist/frontend/state/Examples.js.map +0 -1
- package/dist/frontend/state/I18n.d.ts +0 -16
- package/dist/frontend/state/I18n.js +0 -75
- package/dist/frontend/state/I18n.js.map +0 -1
- package/dist/frontend/state/InputOutput.d.ts +0 -64
- package/dist/frontend/state/InputOutput.js +0 -146
- package/dist/frontend/state/InputOutput.js.map +0 -1
- package/dist/frontend/state/Papyros.d.ts +0 -40
- package/dist/frontend/state/Papyros.js +0 -115
- package/dist/frontend/state/Papyros.js.map +0 -1
- package/dist/frontend/state/Runner.d.ts +0 -123
- package/dist/frontend/state/Runner.js +0 -372
- package/dist/frontend/state/Runner.js.map +0 -1
- package/dist/frontend/state/Test.d.ts +0 -10
- package/dist/frontend/state/Test.js +0 -43
- package/dist/frontend/state/Test.js.map +0 -1
- package/dist/frontend/state/Translations.d.ts +0 -178
- package/dist/frontend/state/Translations.js +0 -187
- package/dist/frontend/state/Translations.js.map +0 -1
- package/dist/frontend/state/themes/blue-dark.d.ts +0 -2
- package/dist/frontend/state/themes/blue-dark.js +0 -56
- package/dist/frontend/state/themes/blue-dark.js.map +0 -1
- package/dist/frontend/state/themes/blue-light.d.ts +0 -2
- package/dist/frontend/state/themes/blue-light.js +0 -56
- package/dist/frontend/state/themes/blue-light.js.map +0 -1
- package/dist/frontend/state/themes/green-dark.d.ts +0 -2
- package/dist/frontend/state/themes/green-dark.js +0 -56
- package/dist/frontend/state/themes/green-dark.js.map +0 -1
- package/dist/frontend/state/themes/green-light.d.ts +0 -2
- package/dist/frontend/state/themes/green-light.js +0 -56
- package/dist/frontend/state/themes/green-light.js.map +0 -1
- package/dist/frontend/state/themes/red-dark.d.ts +0 -2
- package/dist/frontend/state/themes/red-dark.js +0 -56
- package/dist/frontend/state/themes/red-dark.js.map +0 -1
- package/dist/frontend/state/themes/red-light.d.ts +0 -2
- package/dist/frontend/state/themes/red-light.js +0 -56
- package/dist/frontend/state/themes/red-light.js.map +0 -1
- package/dist/util/Logging.d.ts +0 -15
- package/dist/util/Logging.js +0 -30
- package/dist/util/Logging.js.map +0 -1
- package/dist/util/Util.d.ts +0 -8
- package/dist/util/Util.js +0 -48
- package/dist/util/Util.js.map +0 -1
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Backend } from "../backend/Backend";
|
|
2
|
-
import { ProgrammingLanguage } from "../ProgrammingLanguage";
|
|
3
|
-
import { BackendEvent, BackendEventType } from "./BackendEvent";
|
|
4
|
-
import { Channel } from "sync-message";
|
|
5
|
-
import { SyncClient } from "comsync";
|
|
6
|
-
/**
|
|
7
|
-
* Callback type definition for subscribers
|
|
8
|
-
* @param {BackendEvent} e The published event
|
|
9
|
-
*/
|
|
10
|
-
type BackendEventListener = (e: BackendEvent) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Abstract class to implement the singleton pattern
|
|
13
|
-
* Static methods group functionality
|
|
14
|
-
*/
|
|
15
|
-
export declare abstract class BackendManager {
|
|
16
|
-
/**
|
|
17
|
-
* Map programming languages to Backend constructors
|
|
18
|
-
*/
|
|
19
|
-
private static createBackendMap;
|
|
20
|
-
/**
|
|
21
|
-
* Map to cache Backends per ProgrammingLanguage
|
|
22
|
-
*/
|
|
23
|
-
private static backendMap;
|
|
24
|
-
/**
|
|
25
|
-
* Map an event type to interested subscribers
|
|
26
|
-
* Uses an Array to maintain order of subscription
|
|
27
|
-
*/
|
|
28
|
-
private static subscriberMap;
|
|
29
|
-
/**
|
|
30
|
-
* Whether the BackendManager is publishing events
|
|
31
|
-
*/
|
|
32
|
-
private static halted;
|
|
33
|
-
/**
|
|
34
|
-
* The channel used to communicate with the SyncClients
|
|
35
|
-
*/
|
|
36
|
-
static channel: Channel;
|
|
37
|
-
/**
|
|
38
|
-
* @param {ProgrammingLanguage} language The language to support
|
|
39
|
-
* @param {Function} backendCreator The constructor for a SyncClient
|
|
40
|
-
*/
|
|
41
|
-
static registerBackend(language: ProgrammingLanguage, backendCreator: () => SyncClient<Backend>): void;
|
|
42
|
-
/**
|
|
43
|
-
* Start a backend for the given language and cache for reuse
|
|
44
|
-
* @param {ProgrammingLanguage} language The programming language supported by the backend
|
|
45
|
-
* @return {SyncClient<Backend>} A SyncClient for the Backend
|
|
46
|
-
*/
|
|
47
|
-
static getBackend(language: ProgrammingLanguage): SyncClient<Backend>;
|
|
48
|
-
/**
|
|
49
|
-
* Remove a backend for the given language
|
|
50
|
-
* @param {ProgrammingLanguage} language The programming language supported by the backend
|
|
51
|
-
* @return {boolean} Whether the remove operation had any effect
|
|
52
|
-
*/
|
|
53
|
-
static removeBackend(language: ProgrammingLanguage): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Register a callback for when an event of a certain type is published
|
|
56
|
-
* @param {BackendEventType} type The type of event to subscribe to
|
|
57
|
-
* @param {BackendEventListener} subscriber Callback for when an event
|
|
58
|
-
* of the given type is published
|
|
59
|
-
*/
|
|
60
|
-
static subscribe(type: BackendEventType, subscriber: BackendEventListener): void;
|
|
61
|
-
/**
|
|
62
|
-
* Publish an event, notifying all listeners for its type
|
|
63
|
-
* @param {BackendEventType} e The event to publish
|
|
64
|
-
*/
|
|
65
|
-
static publish(e: BackendEvent): void;
|
|
66
|
-
private static halt;
|
|
67
|
-
}
|
|
68
|
-
export {};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { ProgrammingLanguage } from "../ProgrammingLanguage";
|
|
2
|
-
import { BackendEventType } from "./BackendEvent";
|
|
3
|
-
import { LogType, papyrosLog } from "../util/Logging";
|
|
4
|
-
import { makeChannel } from "sync-message";
|
|
5
|
-
import { SyncClient } from "comsync";
|
|
6
|
-
import { PyodideClient } from "pyodide-worker-runner";
|
|
7
|
-
/**
|
|
8
|
-
* Abstract class to implement the singleton pattern
|
|
9
|
-
* Static methods group functionality
|
|
10
|
-
*/
|
|
11
|
-
export class BackendManager {
|
|
12
|
-
/**
|
|
13
|
-
* @param {ProgrammingLanguage} language The language to support
|
|
14
|
-
* @param {Function} backendCreator The constructor for a SyncClient
|
|
15
|
-
*/
|
|
16
|
-
static registerBackend(language, backendCreator) {
|
|
17
|
-
BackendManager.removeBackend(language);
|
|
18
|
-
BackendManager.createBackendMap.set(language, backendCreator);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Start a backend for the given language and cache for reuse
|
|
22
|
-
* @param {ProgrammingLanguage} language The programming language supported by the backend
|
|
23
|
-
* @return {SyncClient<Backend>} A SyncClient for the Backend
|
|
24
|
-
*/
|
|
25
|
-
static getBackend(language) {
|
|
26
|
-
if (this.backendMap.has(language)) {
|
|
27
|
-
// Cached
|
|
28
|
-
return this.backendMap.get(language);
|
|
29
|
-
}
|
|
30
|
-
else if (this.createBackendMap.has(language)) {
|
|
31
|
-
// Create and then cache
|
|
32
|
-
const syncClient = this.createBackendMap.get(language)();
|
|
33
|
-
this.backendMap.set(language, syncClient);
|
|
34
|
-
return syncClient;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
throw new Error(`${language} is not yet supported.`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Remove a backend for the given language
|
|
42
|
-
* @param {ProgrammingLanguage} language The programming language supported by the backend
|
|
43
|
-
* @return {boolean} Whether the remove operation had any effect
|
|
44
|
-
*/
|
|
45
|
-
static removeBackend(language) {
|
|
46
|
-
this.backendMap.delete(language);
|
|
47
|
-
return this.createBackendMap.delete(language);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Register a callback for when an event of a certain type is published
|
|
51
|
-
* @param {BackendEventType} type The type of event to subscribe to
|
|
52
|
-
* @param {BackendEventListener} subscriber Callback for when an event
|
|
53
|
-
* of the given type is published
|
|
54
|
-
*/
|
|
55
|
-
static subscribe(type, subscriber) {
|
|
56
|
-
if (!this.subscriberMap.has(type)) {
|
|
57
|
-
this.subscriberMap.set(type, []);
|
|
58
|
-
}
|
|
59
|
-
const subscribers = this.subscriberMap.get(type);
|
|
60
|
-
if (!subscribers.includes(subscriber)) {
|
|
61
|
-
subscribers.push(subscriber);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Publish an event, notifying all listeners for its type
|
|
66
|
-
* @param {BackendEventType} e The event to publish
|
|
67
|
-
*/
|
|
68
|
-
static publish(e) {
|
|
69
|
-
papyrosLog(LogType.Debug, "Publishing event: ", e);
|
|
70
|
-
if (e.type === BackendEventType.Start) {
|
|
71
|
-
BackendManager.halted = false;
|
|
72
|
-
}
|
|
73
|
-
if ((!BackendManager.halted || e.type === BackendEventType.FrameChange) && this.subscriberMap.has(e.type)) {
|
|
74
|
-
this.subscriberMap.get(e.type).forEach((cb) => cb(e));
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
static halt() {
|
|
78
|
-
BackendManager.halted = true;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Initialise the fields and setup the maps
|
|
83
|
-
*/
|
|
84
|
-
(() => {
|
|
85
|
-
BackendManager.channel = makeChannel();
|
|
86
|
-
BackendManager.createBackendMap = new Map();
|
|
87
|
-
BackendManager.backendMap = new Map();
|
|
88
|
-
BackendManager.subscriberMap = new Map();
|
|
89
|
-
BackendManager.registerBackend(ProgrammingLanguage.Python, () => new PyodideClient(() => new Worker(new URL("../backend/workers/python/worker", import.meta.url), {
|
|
90
|
-
type: "module",
|
|
91
|
-
}), BackendManager.channel));
|
|
92
|
-
BackendManager.registerBackend(ProgrammingLanguage.JavaScript, () => new SyncClient(() => new Worker(new URL("../backend/workers/javascript/worker", import.meta.url), {
|
|
93
|
-
type: "module",
|
|
94
|
-
}), BackendManager.channel));
|
|
95
|
-
BackendManager.halted = false;
|
|
96
|
-
BackendManager.subscribe(BackendEventType.End, () => BackendManager.halt());
|
|
97
|
-
BackendManager.subscribe(BackendEventType.Interrupt, () => BackendManager.halt());
|
|
98
|
-
})();
|
|
99
|
-
//# sourceMappingURL=BackendManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackendManager.js","sourceRoot":"","sources":["../../src/communication/BackendManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAgB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAW,WAAW,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAOtD;;;GAGG;AACH,MAAM,OAAgB,cAAc;IAuBhC;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,QAA6B,EAAE,cAAyC;QAClG,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACvC,cAAc,CAAC,gBAA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,cAAc,CAAC,OAAO,CACzB,CACR,CAAC;IACF,cAAc,CAAC,eAAe,CAC1B,mBAAmB,CAAC,UAAU,EAC9B,GAAG,EAAE,CACD,IAAI,UAAU,CACV,GAAG,EAAE,CACD,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,sCAAsC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACzE,IAAI,EAAE,QAAQ;KACjB,CAAC,EACN,cAAc,CAAC,OAAO,CACzB,CACR,CAAC;IACF,cAAc,CAAC,MAAM,GAAG,KAAK,CAAC;IAC9B,cAAc,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5E,cAAc,CAAC,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;AACtF,CAAC,GAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Default service worker to process user input using HTTP requests
|
|
12
|
-
*/
|
|
13
|
-
// Import service worker provided by the Papyros-package
|
|
14
|
-
import { InputWorker } from "./InputWorker";
|
|
15
|
-
// Strip away the filename of the script to obtain the scope
|
|
16
|
-
// let domain = location.href;
|
|
17
|
-
// domain = domain.slice(0, domain.lastIndexOf("/") + 1);
|
|
18
|
-
const domain = ""; // Disable SharedArrayBuffers to use same environment as Dodona
|
|
19
|
-
const inputHandler = new InputWorker(domain);
|
|
20
|
-
addEventListener("fetch", function (event) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
if (!(yield inputHandler.handleInputRequest(event))) {
|
|
23
|
-
// Not a Papyros-specific request
|
|
24
|
-
// Fetch as we would handle a normal request
|
|
25
|
-
// Default action is to let browser handle it by not responding here
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
// Prevent needing to reload page to have working input
|
|
31
|
-
addEventListener("install", function (event) {
|
|
32
|
-
event.waitUntil(skipWaiting());
|
|
33
|
-
});
|
|
34
|
-
addEventListener("activate", function (event) {
|
|
35
|
-
event.waitUntil(clients.claim());
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=InputServiceWorker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputServiceWorker.js","sourceRoot":"","sources":["../../src/communication/InputServiceWorker.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;GAEG;AACH,wDAAwD;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,4DAA4D;AAC5D,8BAA8B;AAC9B,yDAAyD;AACzD,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,+DAA+D;AAClF,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;AAE7C,gBAAgB,CAAC,OAAO,EAAE,UAAgB,KAAiB;;QACvD,IAAI,CAAC,CAAC,MAAM,YAAY,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAClD,iCAAiC;YACjC,4CAA4C;YAC5C,oEAAoE;YACpE,OAAO;QACX,CAAC;IACL,CAAC;CAAA,CAAC,CAAC;AACH,uDAAuD;AACvD,gBAAgB,CAAC,SAAS,EAAE,UAAU,KAAsB;IACxD,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC;AACH,gBAAgB,CAAC,UAAU,EAAE,UAAU,KAAsB;IACzD,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;AACrC,CAAC,CAAC,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Class that is used in a service worker to allow synchronous communication
|
|
3
|
-
* between threads. This is achieved in two different ways.
|
|
4
|
-
* Responses can be modified by attaching headers allowing the use of shared memory.
|
|
5
|
-
* Requests to certain endpoints can be used with synchronous requests
|
|
6
|
-
* to achieve the same goal.
|
|
7
|
-
*/
|
|
8
|
-
export declare class InputWorker {
|
|
9
|
-
private hostName;
|
|
10
|
-
private syncMessageListener;
|
|
11
|
-
/**
|
|
12
|
-
* Create a worker for a specific domain
|
|
13
|
-
* @param {string} hostName Optional name of the host domain
|
|
14
|
-
*/
|
|
15
|
-
constructor(hostName?: string);
|
|
16
|
-
/**
|
|
17
|
-
* Process and potentially handle a fetch request from the application
|
|
18
|
-
* @param {FetchEvent} event The event denoting a request to a url
|
|
19
|
-
* @return {boolean} Whether the event was handled
|
|
20
|
-
*/
|
|
21
|
-
handleInputRequest(event: FetchEvent): Promise<boolean>;
|
|
22
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { serviceWorkerFetchListener } from "sync-message";
|
|
11
|
-
/**
|
|
12
|
-
* Class that is used in a service worker to allow synchronous communication
|
|
13
|
-
* between threads. This is achieved in two different ways.
|
|
14
|
-
* Responses can be modified by attaching headers allowing the use of shared memory.
|
|
15
|
-
* Requests to certain endpoints can be used with synchronous requests
|
|
16
|
-
* to achieve the same goal.
|
|
17
|
-
*/
|
|
18
|
-
export class InputWorker {
|
|
19
|
-
/**
|
|
20
|
-
* Create a worker for a specific domain
|
|
21
|
-
* @param {string} hostName Optional name of the host domain
|
|
22
|
-
*/
|
|
23
|
-
constructor(hostName = "") {
|
|
24
|
-
this.hostName = hostName;
|
|
25
|
-
this.syncMessageListener = serviceWorkerFetchListener();
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Process and potentially handle a fetch request from the application
|
|
29
|
-
* @param {FetchEvent} event The event denoting a request to a url
|
|
30
|
-
* @return {boolean} Whether the event was handled
|
|
31
|
-
*/
|
|
32
|
-
handleInputRequest(event) {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
// Special requests targeted at getting input from the user
|
|
35
|
-
if (this.syncMessageListener(event)) {
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
const url = event.request.url;
|
|
39
|
-
if (this.hostName && url.includes(this.hostName)) {
|
|
40
|
-
// requests to our own domain
|
|
41
|
-
event.respondWith(fetch(event.request).then((response) => {
|
|
42
|
-
// Add new headers to be able to use SharedArrayBuffers
|
|
43
|
-
// if the browser supports them
|
|
44
|
-
const newHeaders = new Headers(response.headers);
|
|
45
|
-
newHeaders.set("Cross-Origin-Embedder-Policy", "require-corp");
|
|
46
|
-
newHeaders.set("Cross-Origin-Opener-Policy", "same-origin");
|
|
47
|
-
newHeaders.set("Cross-Origin-Resource-Policy", "cross-origin");
|
|
48
|
-
const moddedResponse = new Response(response.body, {
|
|
49
|
-
status: response.status || 200,
|
|
50
|
-
statusText: response.statusText,
|
|
51
|
-
headers: newHeaders,
|
|
52
|
-
});
|
|
53
|
-
return moddedResponse;
|
|
54
|
-
}));
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=InputWorker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputWorker.js","sourceRoot":"","sources":["../../src/communication/InputWorker.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IAMpB;;;OAGG;IACH,YAAY,QAAQ,GAAG,EAAE;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,mBAAmB,GAAG,0BAA0B,EAAE,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACU,kBAAkB,CAAC,KAAiB;;YAC7C,2DAA2D;YAC3D,IAAI,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;gBAClC,OAAO,IAAI,CAAC;YAChB,CAAC;YACD,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;YAC9B,IAAI,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC/C,6BAA6B;gBAC7B,KAAK,CAAC,WAAW,CACb,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;oBACnC,uDAAuD;oBACvD,+BAA+B;oBAC/B,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;oBACjD,UAAU,CAAC,GAAG,CAAC,8BAA8B,EAAE,cAAc,CAAC,CAAC;oBAC/D,UAAU,CAAC,GAAG,CAAC,4BAA4B,EAAE,aAAa,CAAC,CAAC;oBAC5D,UAAU,CAAC,GAAG,CAAC,8BAA8B,EAAE,cAAc,CAAC,CAAC;oBAE/D,MAAM,cAAc,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE;wBAC/C,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,GAAG;wBAC9B,UAAU,EAAE,QAAQ,CAAC,UAAU;wBAC/B,OAAO,EAAE,UAAU;qBACtB,CAAC,CAAC;oBACH,OAAO,cAAc,CAAC;gBAC1B,CAAC,CAAC,CACL,CAAC;gBACF,OAAO,IAAI,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACJ,OAAO,KAAK,CAAC;YACjB,CAAC;QACL,CAAC;KAAA;CACJ"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PapyrosElement } from "./PapyrosElement";
|
|
2
|
-
import { CSSResult, TemplateResult } from "lit";
|
|
3
|
-
import "./code_runner/Code";
|
|
4
|
-
import "./code_runner/RunState";
|
|
5
|
-
import "./code_runner/ButtonLint";
|
|
6
|
-
export declare class CodeRunner extends PapyrosElement {
|
|
7
|
-
static get styles(): CSSResult;
|
|
8
|
-
protected render(): TemplateResult;
|
|
9
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
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 { css, html } from "lit";
|
|
10
|
-
import "./code_runner/Code";
|
|
11
|
-
import "./code_runner/RunState";
|
|
12
|
-
import "./code_runner/ButtonLint";
|
|
13
|
-
let CodeRunner = class CodeRunner extends PapyrosElement {
|
|
14
|
-
static get styles() {
|
|
15
|
-
return css `
|
|
16
|
-
:host {
|
|
17
|
-
width: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
border-radius: 0.5rem;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
div {
|
|
24
|
-
flex-grow: 1;
|
|
25
|
-
min-height: 0;
|
|
26
|
-
position: relative;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
p-run-state {
|
|
30
|
-
position: absolute;
|
|
31
|
-
bottom: 0;
|
|
32
|
-
right: 6px;
|
|
33
|
-
background-color: var(--md-sys-color-surface-container);
|
|
34
|
-
padding: 0.25rem 1rem;
|
|
35
|
-
border-top-right-radius: 1rem;
|
|
36
|
-
border-top-left-radius: 1rem;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
p-button-lint {
|
|
40
|
-
background-color: var(--md-sys-color-surface-container);
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
}
|
|
44
|
-
render() {
|
|
45
|
-
return html `
|
|
46
|
-
<div>
|
|
47
|
-
<p-code .papyros=${this.papyros}></p-code>
|
|
48
|
-
${this.papyros.runner.stateMessage ? html `<p-run-state .papyros=${this.papyros}></p-run-state>` : ""}
|
|
49
|
-
</div>
|
|
50
|
-
<p-button-lint .papyros=${this.papyros}>
|
|
51
|
-
<slot name="buttons"></slot>
|
|
52
|
-
</p-button-lint>
|
|
53
|
-
`;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
CodeRunner = __decorate([
|
|
57
|
-
customElement("p-code-runner")
|
|
58
|
-
], CodeRunner);
|
|
59
|
-
export { CodeRunner };
|
|
60
|
-
//# sourceMappingURL=CodeRunner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CodeRunner.js","sourceRoot":"","sources":["../../../src/frontend/components/CodeRunner.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAa,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAG3B,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,cAAc;IAC1C,MAAM,KAAK,MAAM;QACb,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2BT,CAAC;IACN,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;;mCAEgB,IAAI,CAAC,OAAO;kBAC7B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAA,yBAAyB,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,EAAE;;sCAE9E,IAAI,CAAC,OAAO;;;SAGzC,CAAC;IACN,CAAC;CACJ,CAAA;AA3CY,UAAU;IADtB,aAAa,CAAC,eAAe,CAAC;GAClB,UAAU,CA2CtB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CSSResult, TemplateResult } from "lit";
|
|
2
|
-
import "@dodona/trace-component";
|
|
3
|
-
import { PapyrosElement } from "./PapyrosElement";
|
|
4
|
-
export declare class Debugger extends PapyrosElement {
|
|
5
|
-
static get styles(): CSSResult;
|
|
6
|
-
protected render(): TemplateResult;
|
|
7
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
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 "@dodona/trace-component";
|
|
9
|
-
import { customElement } from "lit/decorators.js";
|
|
10
|
-
import { PapyrosElement } from "./PapyrosElement";
|
|
11
|
-
let Debugger = class Debugger extends PapyrosElement {
|
|
12
|
-
static get styles() {
|
|
13
|
-
return css `
|
|
14
|
-
:host {
|
|
15
|
-
/* Base / surface */
|
|
16
|
-
--tc-surface-color: var(--md-sys-color-surface-container);
|
|
17
|
-
--tc-on-surface-color: var(--md-sys-color-on-surface);
|
|
18
|
-
--tc-surface-container-color: var(--md-sys-color-surface-container-highest);
|
|
19
|
-
--tc-outline-color: var(--md-sys-color-outline);
|
|
20
|
-
--tc-outline-variant-color: var(--md-sys-color-outline-variant);
|
|
21
|
-
--tc-primary-color: var(--md-sys-color-primary);
|
|
22
|
-
|
|
23
|
-
/* Secondary */
|
|
24
|
-
--tc-secondary-surface-color: var(
|
|
25
|
-
--md-sys-color-secondary-surface,
|
|
26
|
-
var(--md-sys-color-secondary-container)
|
|
27
|
-
);
|
|
28
|
-
--tc-secondary-on-surface-color: var(
|
|
29
|
-
--md-sys-color-on-secondary-surface,
|
|
30
|
-
var(--md-sys-color-on-secondary-container)
|
|
31
|
-
);
|
|
32
|
-
--tc-secondary-surface-container-color: var(--md-sys-color-secondary-container);
|
|
33
|
-
--tc-secondary-outline-color: var(--md-sys-color-secondary-outline, var(--md-sys-color-outline));
|
|
34
|
-
--tc-secondary-color: var(--md-sys-color-secondary);
|
|
35
|
-
|
|
36
|
-
/* Tertiary */
|
|
37
|
-
--tc-tertiary-surface-color: var(
|
|
38
|
-
--md-sys-color-tertiary-surface,
|
|
39
|
-
var(--md-sys-color-tertiary-container)
|
|
40
|
-
);
|
|
41
|
-
--tc-tertiary-on-surface-color: var(
|
|
42
|
-
--md-sys-color-on-tertiary-surface,
|
|
43
|
-
var(--md-sys-color-on-tertiary-container)
|
|
44
|
-
);
|
|
45
|
-
--tc-tertiary-surface-container-color: var(--md-sys-color-tertiary-container);
|
|
46
|
-
--tc-tertiary-outline-color: var(--md-sys-color-tertiary-outline, var(--md-sys-color-outline));
|
|
47
|
-
--tc-tertiary-color: var(--md-sys-color-tertiary);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.place-holder {
|
|
51
|
-
color: var(--md-sys-color-on-surface);
|
|
52
|
-
opacity: 0.5;
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
}
|
|
56
|
-
render() {
|
|
57
|
-
var _a;
|
|
58
|
-
if (!this.papyros.debugger.active || this.papyros.debugger.trace.length === 0) {
|
|
59
|
-
return html `<div class="place-holder">${this.t("Papyros.debug_placeholder")}</div>`;
|
|
60
|
-
}
|
|
61
|
-
return html `<tc-trace
|
|
62
|
-
.trace=${this.papyros.debugger.trace}
|
|
63
|
-
.translations=${this.papyros.i18n.getTranslations("Papyros.debugger")}
|
|
64
|
-
.selectedFrame=${(_a = this.papyros.debugger.activeFrame) !== null && _a !== void 0 ? _a : 0}
|
|
65
|
-
@frame-change=${(e) => {
|
|
66
|
-
this.papyros.debugger.activeFrame = e.detail.frame;
|
|
67
|
-
}}
|
|
68
|
-
></tc-trace>`;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
Debugger = __decorate([
|
|
72
|
-
customElement("p-debugger")
|
|
73
|
-
], Debugger);
|
|
74
|
-
export { Debugger };
|
|
75
|
-
//# sourceMappingURL=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|
-
import { CSSResult, TemplateResult } from "lit";
|
|
2
|
-
import "./input/BatchInput";
|
|
3
|
-
import "./input/InteractiveInput";
|
|
4
|
-
import { PapyrosElement } from "./PapyrosElement";
|
|
5
|
-
import "@material/web/switch/switch";
|
|
6
|
-
import { InputMode } from "../state/InputOutput";
|
|
7
|
-
export declare class Input extends PapyrosElement {
|
|
8
|
-
static get styles(): CSSResult;
|
|
9
|
-
get mode(): InputMode;
|
|
10
|
-
get otherMode(): InputMode;
|
|
11
|
-
toggleMode(): void;
|
|
12
|
-
protected render(): TemplateResult;
|
|
13
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
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 "./input/BatchInput";
|
|
10
|
-
import "./input/InteractiveInput";
|
|
11
|
-
import { PapyrosElement } from "./PapyrosElement";
|
|
12
|
-
import "@material/web/switch/switch";
|
|
13
|
-
import { InputMode } from "../state/InputOutput";
|
|
14
|
-
let Input = class Input extends PapyrosElement {
|
|
15
|
-
static get styles() {
|
|
16
|
-
return css `
|
|
17
|
-
label {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
gap: 0.5rem;
|
|
21
|
-
margin-top: 0.5rem;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:host {
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: fit-content;
|
|
27
|
-
display: block;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
p-batch-input {
|
|
31
|
-
height: 200px;
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
}
|
|
35
|
-
get mode() {
|
|
36
|
-
return this.papyros.io.inputMode;
|
|
37
|
-
}
|
|
38
|
-
get otherMode() {
|
|
39
|
-
return this.mode === InputMode.batch ? InputMode.interactive : InputMode.batch;
|
|
40
|
-
}
|
|
41
|
-
toggleMode() {
|
|
42
|
-
this.papyros.io.inputMode = this.otherMode;
|
|
43
|
-
}
|
|
44
|
-
render() {
|
|
45
|
-
return html `
|
|
46
|
-
${this.mode === InputMode.batch
|
|
47
|
-
? html `<p-batch-input .papyros=${this.papyros}></p-batch-input>`
|
|
48
|
-
: html `<p-interactive-input .papyros=${this.papyros}></p-interactive-input>`}
|
|
49
|
-
<label>
|
|
50
|
-
<md-switch .selected=${this.mode === InputMode.batch} @change=${() => this.toggleMode()}></md-switch>
|
|
51
|
-
${this.t(`Papyros.switch_input_mode_to.${this.otherMode}`)}
|
|
52
|
-
</label>
|
|
53
|
-
`;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
Input = __decorate([
|
|
57
|
-
customElement("p-input")
|
|
58
|
-
], Input);
|
|
59
|
-
export { Input };
|
|
60
|
-
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../src/frontend/components/Input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAa,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG1C,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,cAAc;IACrC,MAAM,KAAK,MAAM;QACb,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;SAiBT,CAAC;IACN,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC;IACrC,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC;IACnF,CAAC;IAED,UAAU;QACN,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;IAC/C,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;cACL,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK;YAC3B,CAAC,CAAC,IAAI,CAAA,2BAA2B,IAAI,CAAC,OAAO,mBAAmB;YAChE,CAAC,CAAC,IAAI,CAAA,iCAAiC,IAAI,CAAC,OAAO,yBAAyB;;uCAErD,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK,YAAY,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE;kBACrF,IAAI,CAAC,CAAC,CAAC,gCAAgC,IAAI,CAAC,SAAS,EAAE,CAAC;;SAEjE,CAAC;IACN,CAAC;CACJ,CAAA;AA7CY,KAAK;IADjB,aAAa,CAAC,SAAS,CAAC;GACZ,KAAK,CA6CjB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CSSResult, TemplateResult } from "lit";
|
|
2
|
-
import { OutputEntry } from "../state/InputOutput";
|
|
3
|
-
import { PapyrosElement } from "./PapyrosElement";
|
|
4
|
-
import "@material/web/icon/icon";
|
|
5
|
-
export declare class Output extends PapyrosElement {
|
|
6
|
-
static get styles(): CSSResult;
|
|
7
|
-
private get maxOutputLength();
|
|
8
|
-
get outputs(): OutputEntry[];
|
|
9
|
-
get overflow(): OutputEntry[];
|
|
10
|
-
get showOverflowWarning(): boolean;
|
|
11
|
-
get downloadOverflowUrl(): string;
|
|
12
|
-
get renderedOutputs(): TemplateResult[];
|
|
13
|
-
protected render(): TemplateResult;
|
|
14
|
-
}
|