@dodona/papyros 4.1.1 → 4.1.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/dist/Library.d.ts +11 -0
- package/dist/Library.js +11 -0
- package/dist/Library.js.map +1 -0
- package/dist/ProgrammingLanguage.d.ts +7 -0
- package/dist/ProgrammingLanguage.js +9 -0
- package/dist/ProgrammingLanguage.js.map +1 -0
- package/dist/backend/Backend.d.ts +92 -0
- package/dist/backend/Backend.js +79 -0
- package/dist/backend/Backend.js.map +1 -0
- package/dist/backend/workers/javascript/JavaScriptWorker.d.ts +39 -0
- package/dist/backend/workers/javascript/JavaScriptWorker.js +158 -0
- package/dist/backend/workers/javascript/JavaScriptWorker.js.map +1 -0
- package/dist/backend/workers/javascript/worker.d.ts +1 -0
- package/dist/backend/workers/javascript/worker.js +5 -0
- package/dist/backend/workers/javascript/worker.js.map +1 -0
- package/dist/backend/workers/python/PythonWorker.d.ts +32 -0
- package/dist/backend/workers/python/PythonWorker.js +117 -0
- 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.d.ts +1 -0
- package/dist/backend/workers/python/worker.js +5 -0
- package/dist/backend/workers/python/worker.js.map +1 -0
- package/dist/communication/BackendEvent.d.ts +33 -0
- package/dist/communication/BackendEvent.js +18 -0
- package/dist/communication/BackendEvent.js.map +1 -0
- package/dist/communication/BackendEventQueue.d.ts +59 -0
- package/dist/communication/BackendEventQueue.js +96 -0
- package/dist/communication/BackendEventQueue.js.map +1 -0
- package/dist/communication/BackendManager.d.ts +68 -0
- package/dist/communication/BackendManager.js +99 -0
- package/dist/communication/BackendManager.js.map +1 -0
- package/dist/communication/InputServiceWorker.d.ts +1 -0
- package/dist/communication/InputServiceWorker.js +37 -0
- package/dist/communication/InputServiceWorker.js.map +1 -0
- package/dist/communication/InputWorker.d.ts +22 -0
- package/dist/communication/InputWorker.js +63 -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 +75 -0
- package/dist/frontend/components/Debugger.js.map +1 -0
- package/dist/frontend/components/Input.d.ts +13 -0
- package/dist/frontend/components/Input.js +60 -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 +157 -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 +207 -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 +36 -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 +33 -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 +38 -0
- package/dist/frontend/components/app/ProgrammingLanguagePicker.js.map +1 -0
- package/dist/frontend/components/app/examples/JavaScriptExamples.d.ts +5 -0
- package/dist/frontend/components/app/examples/JavaScriptExamples.js +16 -0
- package/dist/frontend/components/app/examples/JavaScriptExamples.js.map +1 -0
- package/dist/frontend/components/app/examples/PythonExamples.d.ts +14 -0
- package/dist/frontend/components/app/examples/PythonExamples.js +163 -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 +48 -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 +53 -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 +51 -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 +204 -0
- package/dist/frontend/components/code_mirror/CodeEditor.js.map +1 -0
- package/dist/frontend/components/code_mirror/CodeMirrorEditor.d.ts +22 -0
- package/dist/frontend/components/code_mirror/CodeMirrorEditor.js +111 -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 +164 -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 +115 -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 +72 -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 +48 -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 +9 -0
- package/dist/frontend/components/input/BatchInput.js +53 -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 +71 -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 +111 -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 +86 -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 +64 -0
- package/dist/frontend/state/InputOutput.js +146 -0
- package/dist/frontend/state/InputOutput.js.map +1 -0
- package/dist/frontend/state/Papyros.d.ts +40 -0
- package/dist/frontend/state/Papyros.js +115 -0
- package/dist/frontend/state/Papyros.js.map +1 -0
- package/dist/frontend/state/Runner.d.ts +123 -0
- package/dist/frontend/state/Runner.js +372 -0
- package/dist/frontend/state/Runner.js.map +1 -0
- package/dist/frontend/state/Test.d.ts +10 -0
- package/dist/frontend/state/Test.js +43 -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 +187 -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 +56 -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 +56 -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 +56 -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 +56 -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 +56 -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 +56 -0
- package/dist/frontend/state/themes/red-light.js.map +1 -0
- package/dist/util/Logging.d.ts +15 -0
- package/dist/util/Logging.js +30 -0
- package/dist/util/Logging.js.map +1 -0
- package/dist/util/Util.d.ts +8 -0
- package/dist/util/Util.js +48 -0
- package/dist/util/Util.js.map +1 -0
- package/package.json +1 -1
- package/dist/assets/__vite-browser-external-9wXp6ZBx.js +0 -1
- package/dist/assets/__vite-browser-external-BIHI7g3E.js +0 -1
- package/dist/assets/index-C1AWjGcU.js +0 -2202
- package/dist/assets/manifest-BaVmi6rC.json +0 -15
- package/dist/assets/python_package.tar.gz-B8aMWvGt.load_by_url +0 -0
- package/dist/assets/worker-BhABRh01.js +0 -5
- package/dist/assets/worker-C2Ju1j5g.js +0 -110
- package/dist/index.html +0 -26
- package/dist/manifest.json +0 -15
- package/dist/robots.txt +0 -3
|
@@ -0,0 +1,38 @@
|
|
|
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 { html } from "lit";
|
|
10
|
+
import { ProgrammingLanguage } from "../../../ProgrammingLanguage";
|
|
11
|
+
import "@material/web/select/outlined-select";
|
|
12
|
+
import "@material/web/select/select-option";
|
|
13
|
+
import { RunState } from "../../state/Runner";
|
|
14
|
+
let ProgrammingLanguagePicker = class ProgrammingLanguagePicker extends PapyrosElement {
|
|
15
|
+
render() {
|
|
16
|
+
return html `
|
|
17
|
+
<md-outlined-select
|
|
18
|
+
?disabled=${this.papyros.runner.state !== RunState.Ready || this.papyros.debugger.active}
|
|
19
|
+
label=${this.t("Papyros.programming_language")}
|
|
20
|
+
@input=${(e) => {
|
|
21
|
+
this.papyros.runner.programmingLanguage = e.target
|
|
22
|
+
.value;
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
${Object.values(ProgrammingLanguage).map((lang) => html `
|
|
26
|
+
<md-select-option value=${lang} ?selected=${this.papyros.runner.programmingLanguage === lang}>
|
|
27
|
+
<div slot="headline">${lang}</div>
|
|
28
|
+
</md-select-option>
|
|
29
|
+
`)}
|
|
30
|
+
</md-outlined-select>
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
ProgrammingLanguagePicker = __decorate([
|
|
35
|
+
customElement("p-programming-language-picker")
|
|
36
|
+
], ProgrammingLanguagePicker);
|
|
37
|
+
export { ProgrammingLanguagePicker };
|
|
38
|
+
//# sourceMappingURL=ProgrammingLanguagePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgrammingLanguagePicker.js","sourceRoot":"","sources":["../../../../src/frontend/components/app/ProgrammingLanguagePicker.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGvC,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,cAAc;IACtC,MAAM;QACrB,OAAO,IAAI,CAAA;;4BAES,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM;wBAChF,IAAI,CAAC,CAAC,CAAC,8BAA8B,CAAC;yBACrC,CAAC,CAAa,EAAE,EAAE;YACvB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,GAAI,CAAC,CAAC,MAA2B;iBACnE,KAA4B,CAAC;QACtC,CAAC;;kBAEC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,GAAG,CACpC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;kDACgB,IAAI,cAAc,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,KAAK,IAAI;mDACjE,IAAI;;qBAElC,CACJ;;SAER,CAAC;IACN,CAAC;CACJ,CAAA;AArBY,yBAAyB;IADrC,aAAa,CAAC,+BAA+B,CAAC;GAClC,yBAAyB,CAqBrC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const JAVASCRIPT_EXAMPLES = {
|
|
2
|
+
"Hello world!": 'console.log("Hello, World!");',
|
|
3
|
+
Input: `const name = prompt('What is your name?')
|
|
4
|
+
console.log(\`Hello, \${name}!\`)`,
|
|
5
|
+
Fibonacci: `function fibonacci(n){
|
|
6
|
+
if (n <= 1) {
|
|
7
|
+
return n;
|
|
8
|
+
}
|
|
9
|
+
return fibonacci(n - 2) + fibonacci(n - 1);
|
|
10
|
+
}
|
|
11
|
+
for(let i = 0; i < 10; i += 1){
|
|
12
|
+
console.log(fibonacci(i));
|
|
13
|
+
}
|
|
14
|
+
`,
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=JavaScriptExamples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JavaScriptExamples.js","sourceRoot":"","sources":["../../../../../src/frontend/components/app/examples/JavaScriptExamples.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,cAAc,EAAE,+BAA+B;IAC/C,KAAK,EAAE;kCACuB;IAC9B,SAAS,EAAE;;;;;;;;;CASd;CACA,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const PYTHON_EXAMPLES: {
|
|
2
|
+
"Hello, World!": string;
|
|
3
|
+
Input: string;
|
|
4
|
+
Fibonacci: string;
|
|
5
|
+
Doctests: string;
|
|
6
|
+
Async: string;
|
|
7
|
+
Erroneous: string;
|
|
8
|
+
Unicode: string;
|
|
9
|
+
Files: string;
|
|
10
|
+
Matplotlib: string;
|
|
11
|
+
Sleep: string;
|
|
12
|
+
Overflow: string;
|
|
13
|
+
Interrupt: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
export const PYTHON_EXAMPLES = {
|
|
2
|
+
"Hello, World!": "print('Hello, World!')",
|
|
3
|
+
Input: `name = input('What is your name?')
|
|
4
|
+
print(f'Hello, {name}!')`,
|
|
5
|
+
Fibonacci: `def fibonacci(n):
|
|
6
|
+
return n if n <= 1 else fibonacci(n- 2) + fibonacci(n - 1)
|
|
7
|
+
|
|
8
|
+
print([fibonacci(n) for n in range(10)])`,
|
|
9
|
+
Doctests: `def factorial(n):
|
|
10
|
+
"""Return the factorial of n, an exact integer >= 0.
|
|
11
|
+
|
|
12
|
+
>>> [factorial(n) for n in range(6)]
|
|
13
|
+
[1, 1, 2, 6, 24, 120]
|
|
14
|
+
>>> factorial(30)
|
|
15
|
+
265252859812191058636308480000000
|
|
16
|
+
>>> factorial(-1)
|
|
17
|
+
Traceback (most recent call last):
|
|
18
|
+
...
|
|
19
|
+
ValueError: n must be >= 0
|
|
20
|
+
|
|
21
|
+
Factorials of floats are OK, but the float must be an exact integer:
|
|
22
|
+
>>> factorial(30.1)
|
|
23
|
+
Traceback (most recent call last):
|
|
24
|
+
...
|
|
25
|
+
ValueError: n must be exact integer
|
|
26
|
+
>>> factorial(30.0)
|
|
27
|
+
265252859812191058636308480000000
|
|
28
|
+
|
|
29
|
+
It must also not be ridiculously large:
|
|
30
|
+
>>> factorial(1e100)
|
|
31
|
+
Traceback (most recent call last):
|
|
32
|
+
...
|
|
33
|
+
OverflowError: n too large
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
import math
|
|
37
|
+
if not n >= 0:
|
|
38
|
+
raise ValueError("n must be >= 0")
|
|
39
|
+
if math.floor(n) != n:
|
|
40
|
+
raise ValueError("n must be exact integer")
|
|
41
|
+
if n+1 == n: # catch a value like 1e300
|
|
42
|
+
raise OverflowError("n too large")
|
|
43
|
+
result = 1
|
|
44
|
+
factor = 2
|
|
45
|
+
while factor <= n:
|
|
46
|
+
result *= factor
|
|
47
|
+
factor += 1
|
|
48
|
+
return result
|
|
49
|
+
|
|
50
|
+
def wrong_factorial(n):
|
|
51
|
+
"""
|
|
52
|
+
>>> [wrong_factorial(n) for n in range(6)]
|
|
53
|
+
[1, 1, 2, 6, 24, 120]
|
|
54
|
+
>>> wrong_factorial(30)
|
|
55
|
+
265252859812191058636308480000000
|
|
56
|
+
"""
|
|
57
|
+
return 0
|
|
58
|
+
`,
|
|
59
|
+
Async: `import asyncio
|
|
60
|
+
|
|
61
|
+
async def nested():
|
|
62
|
+
print(42)
|
|
63
|
+
|
|
64
|
+
async def main():
|
|
65
|
+
# Schedule nested() to run soon concurrently
|
|
66
|
+
# with "main()".
|
|
67
|
+
task = asyncio.create_task(nested())
|
|
68
|
+
|
|
69
|
+
# "task" can now be used to cancel "nested()", or
|
|
70
|
+
# can simply be awaited to wait until it is complete:
|
|
71
|
+
await task
|
|
72
|
+
|
|
73
|
+
await main()
|
|
74
|
+
`,
|
|
75
|
+
Erroneous: `def bitonic_search(numbers, query):
|
|
76
|
+
if not numbers:
|
|
77
|
+
return -1
|
|
78
|
+
if len(numbers) == 1:
|
|
79
|
+
return 0 if numbers[0] == query else -1
|
|
80
|
+
int top_index = find_max_index(numbers, 0, len(numbers))
|
|
81
|
+
possible_position = find_bitonic_query(numbers,query,0,top_index+1, lambda a, b: a - b)
|
|
82
|
+
if possible_position != -1:
|
|
83
|
+
return possible_position
|
|
84
|
+
else:
|
|
85
|
+
return find_bitonic_query(numbers,query,top_index, len(numbers), lambda a, b: b - a)
|
|
86
|
+
|
|
87
|
+
def find_max_index(numbers, start, stop):
|
|
88
|
+
while start <= stop:
|
|
89
|
+
if stop - start <= 1:
|
|
90
|
+
return start
|
|
91
|
+
middle = (start + stop) / 2;
|
|
92
|
+
if numbers[middle] < numbers[middle+1]:
|
|
93
|
+
start = midden + 1
|
|
94
|
+
else:
|
|
95
|
+
stop = midden
|
|
96
|
+
|
|
97
|
+
def find_bitonic_query(numbers, query, start, stop, comp):
|
|
98
|
+
while start <= stop:
|
|
99
|
+
if stop - start <= 1:
|
|
100
|
+
return start if numbers[start] == query else -1
|
|
101
|
+
middle = (start + stop) / 2;
|
|
102
|
+
if comp(numbers[midden], query) <= 0:
|
|
103
|
+
start = midden
|
|
104
|
+
else:
|
|
105
|
+
stop = midden
|
|
106
|
+
`,
|
|
107
|
+
Unicode: `import random
|
|
108
|
+
emoji = '🎅🤶👪🦌🌟❄️☃️🔥🎄🎁🧦🔔🎶🕯️🦆'
|
|
109
|
+
for _ in range(10):
|
|
110
|
+
print(''.join(random.choice(emoji) for _ in range(30)))
|
|
111
|
+
`,
|
|
112
|
+
Files: `with open("names.txt", "w") as out_file:
|
|
113
|
+
for name in ["Alice", "Bob", "Claire"]:
|
|
114
|
+
print(name, file=out_file)
|
|
115
|
+
|
|
116
|
+
with open("names.txt", "r") as in_file:
|
|
117
|
+
for line in in_file:
|
|
118
|
+
print(line.rstrip())
|
|
119
|
+
`,
|
|
120
|
+
Matplotlib: `import matplotlib.pyplot as plt
|
|
121
|
+
import networkx as nx
|
|
122
|
+
|
|
123
|
+
plt.rcParams["font.size"] = 10
|
|
124
|
+
plt.figure()
|
|
125
|
+
plt.title('Random graph')
|
|
126
|
+
|
|
127
|
+
plt.tick_params(
|
|
128
|
+
axis='both', left='off', top='off', right='off',
|
|
129
|
+
bottom='off', labelleft='off', labeltop='off',
|
|
130
|
+
labelright='off', labelbottom='off'
|
|
131
|
+
)
|
|
132
|
+
G = nx.random_geometric_graph(512, 0.125)
|
|
133
|
+
pos=nx.spring_layout(G)
|
|
134
|
+
nx.draw_networkx_edges(G, pos, alpha=0.2)
|
|
135
|
+
nx.draw_networkx_nodes(G, pos, node_color='r', node_size=12)
|
|
136
|
+
|
|
137
|
+
plt.show()
|
|
138
|
+
`,
|
|
139
|
+
Sleep: `import time
|
|
140
|
+
text = """What is the air-speed velocity of an unladen swallow?
|
|
141
|
+
What do you mean? An African or European swallow?
|
|
142
|
+
What? I, I don't know that.
|
|
143
|
+
"""
|
|
144
|
+
for character in text:
|
|
145
|
+
print(character, end="")
|
|
146
|
+
time.sleep(0.1)
|
|
147
|
+
`,
|
|
148
|
+
Overflow: `from functools import lru_cache
|
|
149
|
+
|
|
150
|
+
@lru_cache
|
|
151
|
+
def fibonacci(n):
|
|
152
|
+
return n if n <= 1 else fibonacci(n- 2) + fibonacci(n - 1)
|
|
153
|
+
|
|
154
|
+
for index in range(5000):
|
|
155
|
+
print(f'{index}: {fibonacci(index)}')
|
|
156
|
+
`,
|
|
157
|
+
Interrupt: `i = 0
|
|
158
|
+
while i >= 0:
|
|
159
|
+
print(i)
|
|
160
|
+
i += 1
|
|
161
|
+
`,
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=PythonExamples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PythonExamples.js","sourceRoot":"","sources":["../../../../../src/frontend/components/app/examples/PythonExamples.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,eAAe,EAAE,wBAAwB;IACzC,KAAK,EAAE;yBACc;IACrB,SAAS,EAAE;;;yCAG0B;IACrC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDb;IACG,KAAK,EAAE;;;;;;;;;;;;;;;CAeV;IACG,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bd;IACG,OAAO,EAAE;;;;CAIZ;IACG,KAAK,EAAE;;;;;;;CAOV;IACG,UAAU,EAAE;;;;;;;;;;;;;;;;;;CAkBf;IACG,KAAK,EAAE;;;;;;;;CAQV;IACG,QAAQ,EAAE;;;;;;;;CAQb;IACG,SAAS,EAAE;;;;CAId;CACA,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TemplateResult } from "lit";
|
|
2
|
+
import "./ThemedButton";
|
|
3
|
+
import "@material/web/icon/icon";
|
|
4
|
+
import "@material/web/iconbutton/icon-button";
|
|
5
|
+
import { PapyrosElement } from "../../PapyrosElement";
|
|
6
|
+
import { ThemeOption } from "../../../state/Constants";
|
|
7
|
+
export declare class ThemePicker extends PapyrosElement {
|
|
8
|
+
picking: boolean;
|
|
9
|
+
setTheme(theme: ThemeOption): void;
|
|
10
|
+
protected render(): TemplateResult[] | TemplateResult;
|
|
11
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { html } from "lit";
|
|
9
|
+
import "./ThemedButton";
|
|
10
|
+
import "@material/web/icon/icon";
|
|
11
|
+
import "@material/web/iconbutton/icon-button";
|
|
12
|
+
import { PapyrosElement } from "../../PapyrosElement";
|
|
13
|
+
let ThemePicker = class ThemePicker extends PapyrosElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.picking = false;
|
|
17
|
+
}
|
|
18
|
+
setTheme(theme) {
|
|
19
|
+
this.picking = false;
|
|
20
|
+
this.papyros.constants.activeTheme = theme;
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
if (!this.picking) {
|
|
24
|
+
return html `
|
|
25
|
+
<md-icon-button @click=${() => (this.picking = true)}>
|
|
26
|
+
<md-icon>
|
|
27
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#currentCollor">
|
|
28
|
+
<path
|
|
29
|
+
d="M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 32.5-156t88-127Q256-817 330-848.5T488-880q80 0 151 27.5t124.5 76q53.5 48.5 85 115T880-518q0 115-70 176.5T640-280h-74q-9 0-12.5 5t-3.5 11q0 12 15 34.5t15 51.5q0 50-27.5 74T480-80Zm0-400Zm-220 40q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm120-160q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm200 0q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm120 160q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17ZM480-160q9 0 14.5-5t5.5-13q0-14-15-33t-15-57q0-42 29-67t71-25h70q66 0 113-38.5T800-518q0-121-92.5-201.5T488-800q-136 0-232 93t-96 227q0 133 93.5 226.5T480-160Z"
|
|
30
|
+
/>
|
|
31
|
+
</svg>
|
|
32
|
+
</md-icon>
|
|
33
|
+
</md-icon-button>
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
return Object.values(this.papyros.constants.themes).map((t) => html `
|
|
37
|
+
<p-themed-button .theme=${t.theme} .dark=${t.dark} @click=${() => this.setTheme(t)}></p-themed-button>
|
|
38
|
+
`);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
__decorate([
|
|
42
|
+
property({ state: true })
|
|
43
|
+
], ThemePicker.prototype, "picking", void 0);
|
|
44
|
+
ThemePicker = __decorate([
|
|
45
|
+
customElement("p-theme-picker")
|
|
46
|
+
], ThemePicker);
|
|
47
|
+
export { ThemePicker };
|
|
48
|
+
//# sourceMappingURL=ThemePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemePicker.js","sourceRoot":"","sources":["../../../../../src/frontend/components/app/themes/ThemePicker.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3C,OAAO,gBAAgB,CAAC;AACxB,OAAO,yBAAyB,CAAC;AACjC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI/C,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,cAAc;IAAxC;;QAEH,YAAO,GAAG,KAAK,CAAC;IA4BpB,CAAC;IA1BG,QAAQ,CAAC,KAAkB;QACvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,GAAG,KAAK,CAAC;IAC/C,CAAC;IAEkB,MAAM;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAChB,OAAO,IAAI,CAAA;yCACkB,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;;;;;;;;;aASvD,CAAC;QACN,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CACnD,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAA;0CACmB,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,IAAI,WAAW,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;aACrF,CACJ,CAAC;IACN,CAAC;CACJ,CAAA;AA5BG;IADC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;4CACV;AAFP,WAAW;IADvB,aAAa,CAAC,gBAAgB,CAAC;GACnB,WAAW,CA8BvB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSResult, LitElement, TemplateResult } from "lit";
|
|
2
|
+
import "@material/web/icon/icon";
|
|
3
|
+
import "@material/web/iconbutton/filled-icon-button";
|
|
4
|
+
export declare class ThemedButton extends LitElement {
|
|
5
|
+
theme: CSSResult | undefined;
|
|
6
|
+
dark: boolean;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
protected render(): TemplateResult;
|
|
9
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { adoptStyles, html, LitElement } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import "@material/web/icon/icon";
|
|
10
|
+
import "@material/web/iconbutton/filled-icon-button";
|
|
11
|
+
let ThemedButton = class ThemedButton extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.dark = false;
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback();
|
|
18
|
+
if (this.theme) {
|
|
19
|
+
adoptStyles(this.renderRoot, [this.theme]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return html `
|
|
24
|
+
<md-filled-icon-button>
|
|
25
|
+
<md-icon>
|
|
26
|
+
${this.dark
|
|
27
|
+
? html `
|
|
28
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor">
|
|
29
|
+
<path
|
|
30
|
+
d="M480-120q-150 0-255-105T120-480q0-150 105-255t255-105q14 0 27.5 1t26.5 3q-41 29-65.5 75.5T444-660q0 90 63 153t153 63q55 0 101-24.5t75-65.5q2 13 3 26.5t1 27.5q0 150-105 255T480-120Zm0-80q88 0 158-48.5T740-375q-20 5-40 8t-40 3q-123 0-209.5-86.5T364-660q0-20 3-40t8-40q-78 32-126.5 102T200-480q0 116 82 198t198 82Zm-10-270Z"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
33
|
+
`
|
|
34
|
+
: html `
|
|
35
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor">
|
|
36
|
+
<path
|
|
37
|
+
d="M480-360q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35Zm0 80q-83 0-141.5-58.5T280-480q0-83 58.5-141.5T480-680q83 0 141.5 58.5T680-480q0 83-58.5 141.5T480-280ZM200-440H40v-80h160v80Zm720 0H760v-80h160v80ZM440-760v-160h80v160h-80Zm0 720v-160h80v160h-80ZM256-650l-101-97 57-59 96 100-52 56Zm492 496-97-101 53-55 101 97-57 59Zm-98-550 97-101 59 57-100 96-56-52ZM154-212l101-97 55 53-97 101-59-57Zm326-268Z"
|
|
38
|
+
/>
|
|
39
|
+
</svg>
|
|
40
|
+
`}
|
|
41
|
+
</md-icon>
|
|
42
|
+
</md-filled-icon-button>
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
__decorate([
|
|
47
|
+
property({ type: Boolean })
|
|
48
|
+
], ThemedButton.prototype, "dark", void 0);
|
|
49
|
+
ThemedButton = __decorate([
|
|
50
|
+
customElement("p-themed-button")
|
|
51
|
+
], ThemedButton);
|
|
52
|
+
export { ThemedButton };
|
|
53
|
+
//# sourceMappingURL=ThemedButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemedButton.js","sourceRoot":"","sources":["../../../../../src/frontend/components/app/themes/ThemedButton.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAa,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,yBAAyB,CAAC;AACjC,OAAO,6CAA6C,CAAC;AAG9C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAArC;;QAGH,SAAI,GAAY,KAAK,CAAC;IAgC1B,CAAC;IA9BmB,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,WAAW,CAAC,IAAI,CAAC,UAAwB,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7D,CAAC;IACL,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;;;sBAGG,IAAI,CAAC,IAAI;YACP,CAAC,CAAC,IAAI,CAAA;;;;;;2BAMH;YACH,CAAC,CAAC,IAAI,CAAA;;;;;;2BAMH;;;SAGlB,CAAC;IACN,CAAC;CACJ,CAAA;AAhCG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACN;AAHb,YAAY;IADxB,aAAa,CAAC,iBAAiB,CAAC;GACpB,YAAY,CAmCxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CodeMirrorEditor } from "./CodeMirrorEditor";
|
|
2
|
+
import { CSSResult } from "lit";
|
|
3
|
+
export declare class BatchInputEditor extends CodeMirrorEditor {
|
|
4
|
+
static get styles(): CSSResult;
|
|
5
|
+
set usedLines(value: number);
|
|
6
|
+
set readOnly(value: boolean);
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { CodeMirrorEditor } from "./CodeMirrorEditor";
|
|
9
|
+
import { EditorView, keymap } from "@codemirror/view";
|
|
10
|
+
import { css } from "lit";
|
|
11
|
+
import { defaultKeymap } from "@codemirror/commands";
|
|
12
|
+
import { setUsedLines, usedLineExtension } from "./Extensions";
|
|
13
|
+
let BatchInputEditor = class BatchInputEditor extends CodeMirrorEditor {
|
|
14
|
+
static get styles() {
|
|
15
|
+
return css `
|
|
16
|
+
:host {
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
}
|
|
22
|
+
set usedLines(value) {
|
|
23
|
+
var _a;
|
|
24
|
+
const lines = Array.from({ length: value }, (a, i) => i + 1);
|
|
25
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.dispatch({
|
|
26
|
+
effects: setUsedLines.of(lines),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
set readOnly(value) {
|
|
30
|
+
this.configure({
|
|
31
|
+
debugging: value ? EditorView.editable.of(false) : [],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
this.configure({
|
|
37
|
+
default: [usedLineExtension, keymap.of(defaultKeymap)],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
__decorate([
|
|
42
|
+
property({ type: Number })
|
|
43
|
+
], BatchInputEditor.prototype, "usedLines", null);
|
|
44
|
+
__decorate([
|
|
45
|
+
property({ type: Boolean })
|
|
46
|
+
], BatchInputEditor.prototype, "readOnly", null);
|
|
47
|
+
BatchInputEditor = __decorate([
|
|
48
|
+
customElement("p-batch-input-editor")
|
|
49
|
+
], BatchInputEditor);
|
|
50
|
+
export { BatchInputEditor };
|
|
51
|
+
//# sourceMappingURL=BatchInputEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BatchInputEditor.js","sourceRoot":"","sources":["../../../../src/frontend/components/code_mirror/BatchInputEditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAa,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGxD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,gBAAgB;IAClD,MAAM,KAAK,MAAM;QACb,OAAO,GAAG,CAAA;;;;;SAKT,CAAC;IACN,CAAC;IAGD,IAAI,SAAS,CAAC,KAAa;;QACvB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7D,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,CAAC;YAChB,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC;SAClC,CAAC,CAAC;IACP,CAAC;IAGD,IAAI,QAAQ,CAAC,KAAc;QACvB,IAAI,CAAC,SAAS,CAAC;YACX,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;SACxD,CAAC,CAAC;IACP,CAAC;IAED;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC;YACX,OAAO,EAAE,CAAC,iBAAiB,EAAE,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC;SACzD,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AApBG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAM1B;AAGD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDAK3B;AAvBQ,gBAAgB;IAD5B,aAAa,CAAC,sBAAsB,CAAC;GACzB,gBAAgB,CA+B5B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CodeMirrorEditor } from "./CodeMirrorEditor";
|
|
2
|
+
import { CSSResult } from "lit";
|
|
3
|
+
import { WorkerDiagnostic } from "../../../backend/Backend";
|
|
4
|
+
import { ProgrammingLanguage } from "../../../ProgrammingLanguage";
|
|
5
|
+
export declare class CodeEditor extends CodeMirrorEditor {
|
|
6
|
+
static get styles(): CSSResult;
|
|
7
|
+
set debug(value: boolean);
|
|
8
|
+
set debugLine(value: number | undefined);
|
|
9
|
+
set testLines(value: number[] | undefined);
|
|
10
|
+
/**
|
|
11
|
+
* Override the value setter to temporarily disable read-only ranges
|
|
12
|
+
*/
|
|
13
|
+
dispatchChange(): void;
|
|
14
|
+
set testLineCount(value: number | undefined);
|
|
15
|
+
set testTranslations(value: {
|
|
16
|
+
description: string;
|
|
17
|
+
edit: string;
|
|
18
|
+
remove: string;
|
|
19
|
+
});
|
|
20
|
+
set programmingLanguage(value: ProgrammingLanguage);
|
|
21
|
+
set lintingSource(lintSource: () => Promise<readonly WorkerDiagnostic[]>);
|
|
22
|
+
set indentLength(length: number);
|
|
23
|
+
constructor();
|
|
24
|
+
}
|