@dodona/papyros 0.1.32-action → 0.1.33
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 +4 -11
- package/dist/CodeEditor.d.ts +1 -0
- package/dist/Constants.d.ts +1 -0
- package/dist/OutputManager.d.ts +19 -0
- package/dist/Papyros.d.ts +3 -0
- package/dist/PapyrosEvent.d.ts +1 -0
- package/dist/StatusPanel.d.ts +0 -3
- package/dist/examples/Examples.d.ts +6 -0
- package/dist/examples/JavaScriptExamples.d.ts +5 -0
- package/dist/examples/PythonExamples.d.ts +11 -0
- package/dist/index.js +2 -1
- package/dist/index.js.LICENSE.txt +7 -0
- package/dist/util/HTMLShapes.d.ts +3 -0
- package/dist/util/Util.d.ts +3 -1
- package/package.json +4 -1
- package/dist/workers/python/init.py.d.ts +0 -1
package/dist/util/Util.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ import I18n from "i18n-js";
|
|
|
2
2
|
export declare const t: typeof I18n.t;
|
|
3
3
|
export declare function loadTranslations(): void;
|
|
4
4
|
export declare function getLocales(): Array<string>;
|
|
5
|
-
export declare function getSelectOptions<T>(options: Array<T>,
|
|
5
|
+
export declare function getSelectOptions<T>(options: Array<T>, optionText: (option: T) => string, selected?: T): string;
|
|
6
|
+
export declare function renderSelect<T>(selectId: string, options: Array<T>, optionText: (option: T) => string, selected?: T, labelText?: string): string;
|
|
6
7
|
export declare function addListener<T extends string>(elementId: string, onEvent: (e: T) => void, eventType?: string, attribute?: string): void;
|
|
8
|
+
export declare function removeSelection(selectId: string): void;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dodona/papyros",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"private": false,
|
|
5
5
|
"homepage": ".",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@babel/traverse": "^7.16.3",
|
|
8
|
+
"@types/escape-html": "^1.0.1",
|
|
8
9
|
"@types/i18n-js": "^3.8.2",
|
|
9
10
|
"@typescript-eslint/eslint-plugin": "^4.5.0",
|
|
10
11
|
"@typescript-eslint/parser": "^4.5.0",
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
"postcss": "^8.3.11",
|
|
24
25
|
"postcss-import": "^14.0.2",
|
|
25
26
|
"postcss-loader": "^6.2.0",
|
|
27
|
+
"raw-loader": "^4.0.2",
|
|
26
28
|
"style-loader": "^3.3.1",
|
|
27
29
|
"tailwindcss": "^2.2.19",
|
|
28
30
|
"ts-jest": "^27.0.7",
|
|
@@ -48,6 +50,7 @@
|
|
|
48
50
|
"@codemirror/search": "^0.19.3",
|
|
49
51
|
"@codemirror/state": "^0.19.6",
|
|
50
52
|
"comlink": "^4.3.1",
|
|
53
|
+
"escape-html": "^1.0.3",
|
|
51
54
|
"i18n-js": "^3.8.0"
|
|
52
55
|
},
|
|
53
56
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const INITIALIZATION_CODE = "\nfrom pyodide import to_js\nimport sys\n\ndef __override_builtins(cb):\n __capture_stdout(cb)\n __override_stdin(cb)\n # set name to main instead of builtins\n globals()[\"__name__\"] = \"__main__\"\n\ndef __capture_stdout(cb):\n class _OutputWriter:\n def __init__(self):\n self.encoding = \"utf-8\"\n \n def write(self, s):\n cb(to_js({\"type\": \"output\", \"data\":s}))\n\n def flush(self):\n pass # Given data is always immediately written\n\n sys.stdout = _OutputWriter()\n\n__papyros_input = \"\"\ndef __override_stdin(cb):\n\n def __papyros_input(prompt=\"\"):\n return __papyros_readline(prompt=prompt)[:-1] # Remove newline\n\n def __papyros_readline(n=-1, prompt=\"\"):\n global __papyros_input\n if not __papyros_input:\n __papyros_input = cb(to_js({\"type\": \"input\", \"data\": prompt})) + \"\\n\"\n if n < 0 or n > len(__papyros_input):\n n = len(__papyros_input)\n to_return = __papyros_input[0:n]\n __papyros_input = __papyros_input[n:]\n return to_return\n\n global input\n input = __papyros_input\n sys.stdin.readline = __papyros_readline\n";
|