@knime/scripting-editor 0.0.7 → 0.0.9
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/knime-scripting-editor.js +10824 -4248
- package/dist/lib/main.d.ts +2 -1
- package/dist/src/components/OutputConsole.vue.d.ts +10 -0
- package/dist/src/components/ScriptingEditor.vue.d.ts +4 -2
- package/dist/src/editor-service.d.ts +18 -0
- package/dist/src/scripting-service.d.ts +7 -4
- package/package.json +4 -2
package/dist/lib/main.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ScriptingEditor from "../src/components/ScriptingEditor.vue";
|
|
2
2
|
import CodeEditor from "../src/components/CodeEditor.vue";
|
|
3
|
+
import OutputConsole from "../src/components/OutputConsole.vue";
|
|
3
4
|
import { getScriptingService } from "../src/scripting-service";
|
|
4
5
|
import type { NodeSettings, ScriptingServiceType } from "../src/scripting-service";
|
|
5
|
-
export { ScriptingEditor, CodeEditor, getScriptingService };
|
|
6
|
+
export { ScriptingEditor, CodeEditor, OutputConsole, getScriptingService };
|
|
6
7
|
export type { NodeSettings, ScriptingServiceType };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ConsoleText {
|
|
2
|
+
text: string;
|
|
3
|
+
}
|
|
4
|
+
export type ConsoleHandler = (text: ConsoleText) => void;
|
|
5
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"console-created": (handler: ConsoleHandler) => void;
|
|
7
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
8
|
+
"onConsole-created"?: ((handler: ConsoleHandler) => any) | undefined;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type PropType } from "vue";
|
|
2
|
-
import { editor } from './monaco-editor';
|
|
3
2
|
import type { MenuItem } from "webapps-common/ui/components/MenuItems.vue";
|
|
3
|
+
import type { editor } from './monaco-editor';
|
|
4
|
+
import type { ConsoleHandler } from "./OutputConsole.vue";
|
|
4
5
|
type PaneSizes = {
|
|
5
6
|
[key in "left" | "right" | "bottom"]: number;
|
|
6
7
|
};
|
|
@@ -69,6 +70,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
69
70
|
event: Event;
|
|
70
71
|
item: any;
|
|
71
72
|
}): void;
|
|
73
|
+
onConsoleCreated(handler: ConsoleHandler): void;
|
|
72
74
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("monaco-created" | "menu-item-clicked")[], "monaco-created" | "menu-item-clicked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
73
75
|
title: {
|
|
74
76
|
type: StringConstructor;
|
|
@@ -111,9 +113,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
111
113
|
"onMonaco-created"?: ((...args: any[]) => any) | undefined;
|
|
112
114
|
"onMenu-item-clicked"?: ((...args: any[]) => any) | undefined;
|
|
113
115
|
}, {
|
|
116
|
+
title: string;
|
|
114
117
|
language: string;
|
|
115
118
|
fileName: string;
|
|
116
|
-
title: string;
|
|
117
119
|
menuItems: MenuItem[];
|
|
118
120
|
rightPaneLayout: "fixed" | "relative";
|
|
119
121
|
showControlBar: boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { editor as monaco } from './monaco-editor';
|
|
2
|
+
export declare class EditorService {
|
|
3
|
+
editor?: monaco.IStandaloneCodeEditor;
|
|
4
|
+
editorModel?: monaco.ITextModel;
|
|
5
|
+
initEditorService({ editor, editorModel, }: {
|
|
6
|
+
editor: monaco.IStandaloneCodeEditor;
|
|
7
|
+
editorModel: monaco.ITextModel;
|
|
8
|
+
}): void;
|
|
9
|
+
/**
|
|
10
|
+
* @returns the entire editor content or null if monaco has not yet been initialized
|
|
11
|
+
*/
|
|
12
|
+
getScript(): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* @returns all currently selected lines in the editor from first to last column. Also returns partly selected lines.
|
|
15
|
+
* Returns null if monaco has not yet been initialized.
|
|
16
|
+
*/
|
|
17
|
+
getSelectedLines(): string | null;
|
|
18
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
text: string;
|
|
3
|
-
stderr: boolean;
|
|
4
|
-
};
|
|
1
|
+
import type { ConsoleText } from "./components/OutputConsole.vue";
|
|
5
2
|
export type NodeSettings = {
|
|
6
3
|
script: string;
|
|
7
4
|
};
|
|
5
|
+
import { editor as monaco } from './monaco-editor';
|
|
8
6
|
declare class ScriptingService {
|
|
9
7
|
private _knimeService;
|
|
10
8
|
private _jsonDataService;
|
|
@@ -12,6 +10,7 @@ declare class ScriptingService {
|
|
|
12
10
|
private _settings;
|
|
13
11
|
private _eventHandlers;
|
|
14
12
|
private _runEventPoller;
|
|
13
|
+
private _editorService;
|
|
15
14
|
constructor();
|
|
16
15
|
private eventPoller;
|
|
17
16
|
stopEventPoller(): void;
|
|
@@ -22,6 +21,10 @@ declare class ScriptingService {
|
|
|
22
21
|
registerEventHandler(type: string, handler: (args: any) => void): void;
|
|
23
22
|
registerLanguageServerEventHandler(handler: (message: string) => void): void;
|
|
24
23
|
registerConsoleEventHandler(handler: (text: ConsoleText) => void): void;
|
|
24
|
+
sendToConsole(text: ConsoleText): void;
|
|
25
|
+
initEditorService(editor: monaco.IStandaloneCodeEditor, editorModel: monaco.ITextModel): void;
|
|
26
|
+
getScript(): string | null;
|
|
27
|
+
getSelectedLines(): string | null;
|
|
25
28
|
}
|
|
26
29
|
export type ScriptingServiceType = Pick<ScriptingService, keyof ScriptingService>;
|
|
27
30
|
declare const getScriptingService: (mock?: ScriptingServiceType) => ScriptingServiceType;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knime/scripting-editor",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"description": "Shared Scripting Editor components for KNIME",
|
|
6
6
|
"author": "KNIME AG, Zurich, Switzerland",
|
|
7
7
|
"license": "See the file license.txt",
|
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
"pinia": "2.1.4",
|
|
32
32
|
"splitpanes": "3.1.5",
|
|
33
33
|
"vue": "3.x",
|
|
34
|
-
"webapps-common": "file:webapps-common"
|
|
34
|
+
"webapps-common": "file:webapps-common",
|
|
35
|
+
"xterm": "5.2.1",
|
|
36
|
+
"xterm-addon-fit": "0.7.0"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"@knime/eslint-config": "8.0.7",
|