@dodona/papyros 0.1.23-rc → 0.1.32-action
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/{lib/index.d.ts → dist/App.d.ts} +0 -0
- package/{lib → dist}/Backend.d.ts +0 -0
- package/{lib → dist}/BackendManager.d.ts +0 -0
- package/{lib → dist}/CodeEditor.d.ts +4 -2
- package/{lib → dist}/Constants.d.ts +4 -1
- package/dist/InputManager.d.ts +31 -0
- package/{lib → dist}/Papyros.d.ts +12 -20
- package/{lib → dist}/PapyrosEvent.d.ts +0 -0
- package/{lib → dist}/ProgrammingLanguage.d.ts +0 -0
- package/dist/StatusPanel.d.ts +10 -0
- package/dist/index.js +1 -0
- package/{lib → dist}/library.d.ts +2 -0
- package/{lib → dist}/util/Logging.d.ts +0 -0
- package/dist/util/Util.d.ts +6 -0
- package/{lib → dist}/workers/javascript/JavaScriptWorker.worker.d.ts +0 -0
- package/{lib → dist}/workers/python/PythonWorker.worker.d.ts +0 -0
- package/{lib → dist}/workers/python/init.py.d.ts +1 -1
- package/package.json +9 -9
- package/lib/index.js +0 -1
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,8 +5,10 @@ export declare class CodeEditor {
|
|
|
5
5
|
editorView: EditorView;
|
|
6
6
|
languageCompartment: Compartment;
|
|
7
7
|
indentCompartment: Compartment;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
placeholderCompartment: Compartment;
|
|
9
|
+
constructor(element: HTMLElement, language: ProgrammingLanguage, panel: HTMLElement, editorPlaceHolder: string, initialCode?: string, indentLength?: number);
|
|
10
|
+
setLanguage(language: ProgrammingLanguage, editorPlaceHolder: string): void;
|
|
10
11
|
setIndentLength(indentLength: number): void;
|
|
11
12
|
getCode(): string;
|
|
13
|
+
focus(): void;
|
|
12
14
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ProgrammingLanguage } from "./ProgrammingLanguage";
|
|
2
2
|
export declare const MAIN_APP_ID = "papyros";
|
|
3
3
|
export declare const OUTPUT_TA_ID = "code-output-area";
|
|
4
|
+
export declare const INPUT_AREA_WRAPPER_ID = "code-input-area-wrapper";
|
|
4
5
|
export declare const INPUT_TA_ID = "code-input-area";
|
|
5
6
|
export declare const EDITOR_WRAPPER_ID = "code-area";
|
|
6
7
|
export declare const STATE_SPINNER_ID = "state-spinner";
|
|
7
8
|
export declare const APPLICATION_STATE_TEXT_ID = "application-state-text";
|
|
8
9
|
export declare const RUN_BTN_ID = "run-code-btn";
|
|
9
|
-
export declare const
|
|
10
|
+
export declare const STOP_BTN_ID = "stop-btn";
|
|
11
|
+
export declare const SEND_INPUT_BTN_ID = "send-input-btn";
|
|
12
|
+
export declare const SWITCH_INPUT_MODE_A_ID = "switch-input-mode";
|
|
10
13
|
export declare const PROGRAMMING_LANGUAGE_SELECT_ID = "programming-language-select";
|
|
11
14
|
export declare const DEFAULT_PROGRAMMING_LANGUAGE = ProgrammingLanguage.Python;
|
|
12
15
|
export declare const LOCALE_SELECT_ID = "locale-select";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PapyrosEvent } from "./PapyrosEvent";
|
|
2
|
+
export declare enum InputMode {
|
|
3
|
+
Interactive = "interactive",
|
|
4
|
+
Batch = "batch"
|
|
5
|
+
}
|
|
6
|
+
export declare const INPUT_MODES: InputMode[];
|
|
7
|
+
interface InputSession {
|
|
8
|
+
lineNr: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class InputManager {
|
|
11
|
+
inputWrapper: HTMLElement;
|
|
12
|
+
inputMode: InputMode;
|
|
13
|
+
waiting: boolean;
|
|
14
|
+
batchInput: string;
|
|
15
|
+
onSend: () => void;
|
|
16
|
+
session: InputSession;
|
|
17
|
+
inputTextArray?: Uint8Array;
|
|
18
|
+
inputMetaData?: Int32Array;
|
|
19
|
+
textEncoder: TextEncoder;
|
|
20
|
+
constructor(onSend: () => void, inputMode: InputMode);
|
|
21
|
+
get enterButton(): HTMLButtonElement;
|
|
22
|
+
get inputArea(): HTMLInputElement;
|
|
23
|
+
buildInputArea(): void;
|
|
24
|
+
setInputMode(inputMode: InputMode): void;
|
|
25
|
+
setWaiting(waiting: boolean, prompt?: string): void;
|
|
26
|
+
sendLine(): Promise<boolean>;
|
|
27
|
+
onInput(e?: PapyrosEvent): Promise<void>;
|
|
28
|
+
onRunStart(): void;
|
|
29
|
+
onRunEnd(): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -2,22 +2,23 @@ import "./Papyros.css";
|
|
|
2
2
|
import { Remote } from "comlink";
|
|
3
3
|
import { Backend } from "./Backend";
|
|
4
4
|
import { CodeEditor } from "./CodeEditor";
|
|
5
|
+
import { InputManager, InputMode } from "./InputManager";
|
|
5
6
|
import { PapyrosEvent } from "./PapyrosEvent";
|
|
6
7
|
import { ProgrammingLanguage } from "./ProgrammingLanguage";
|
|
8
|
+
import { StatusPanel } from "./StatusPanel";
|
|
7
9
|
declare enum PapyrosState {
|
|
8
10
|
Loading = "loading",
|
|
9
11
|
Running = "running",
|
|
10
12
|
AwaitingInput = "awaiting_input",
|
|
11
|
-
|
|
13
|
+
Stopping = "stopping",
|
|
12
14
|
Ready = "ready"
|
|
13
15
|
}
|
|
14
16
|
declare class PapyrosStateManager {
|
|
15
17
|
state: PapyrosState;
|
|
16
|
-
|
|
17
|
-
stateText: HTMLElement;
|
|
18
|
+
statusPanel: StatusPanel;
|
|
18
19
|
runButton: HTMLButtonElement;
|
|
19
|
-
|
|
20
|
-
constructor();
|
|
20
|
+
stopButton: HTMLButtonElement;
|
|
21
|
+
constructor(statusPanel: StatusPanel);
|
|
21
22
|
setState(state: PapyrosState, message?: string): void;
|
|
22
23
|
}
|
|
23
24
|
interface PapyrosCodeState {
|
|
@@ -27,35 +28,26 @@ interface PapyrosCodeState {
|
|
|
27
28
|
runId: number;
|
|
28
29
|
outputArea: HTMLInputElement;
|
|
29
30
|
}
|
|
30
|
-
interface PapyrosInputState {
|
|
31
|
-
lineNr: number;
|
|
32
|
-
textEncoder: TextEncoder;
|
|
33
|
-
inputArea: HTMLInputElement;
|
|
34
|
-
inputTextArray?: Uint8Array;
|
|
35
|
-
inputMetaData?: Int32Array;
|
|
36
|
-
}
|
|
37
31
|
interface PapyrosConfig {
|
|
38
32
|
standAlone: boolean;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
inputMetaData?: Int32Array;
|
|
33
|
+
programmingLanguage: ProgrammingLanguage;
|
|
34
|
+
locale: string;
|
|
35
|
+
inputMode: InputMode;
|
|
43
36
|
}
|
|
44
37
|
export declare class Papyros {
|
|
45
38
|
stateManager: PapyrosStateManager;
|
|
46
39
|
codeState: PapyrosCodeState;
|
|
47
|
-
|
|
48
|
-
constructor(programmingLanguage: ProgrammingLanguage,
|
|
40
|
+
inputManager: InputManager;
|
|
41
|
+
constructor(programmingLanguage: ProgrammingLanguage, inputMode: InputMode);
|
|
49
42
|
get state(): PapyrosState;
|
|
50
43
|
launch(): Promise<Papyros>;
|
|
51
44
|
setProgrammingLanguage(programmingLanguage: ProgrammingLanguage): Promise<void>;
|
|
52
45
|
startBackend(): Promise<void>;
|
|
53
46
|
static fromElement(parent: HTMLElement, config: PapyrosConfig): Promise<Papyros>;
|
|
54
47
|
onError(e: PapyrosEvent): void;
|
|
55
|
-
sendInput(): Promise<boolean>;
|
|
56
48
|
onInput(e: PapyrosEvent): Promise<void>;
|
|
57
49
|
onMessage(e: PapyrosEvent): void;
|
|
58
50
|
runCode(): Promise<void>;
|
|
59
|
-
|
|
51
|
+
stop(): Promise<void>;
|
|
60
52
|
}
|
|
61
53
|
export {};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class StatusPanel {
|
|
2
|
+
onRun: () => void;
|
|
3
|
+
constructor(onRun: () => void);
|
|
4
|
+
initialize(): void;
|
|
5
|
+
get statusSpinner(): HTMLElement;
|
|
6
|
+
get statusText(): HTMLElement;
|
|
7
|
+
showSpinner(show: boolean): void;
|
|
8
|
+
setStatus(status: string): void;
|
|
9
|
+
render(parent: HTMLElement): HTMLElement;
|
|
10
|
+
}
|