@node-projects/web-component-designer-visualization-addons 0.1.63 → 0.1.65
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/blockly/components/fields/FieldObjectId.d.ts +1 -0
- package/dist/blockly/components/fields/FieldObjectId.js +6 -0
- package/dist/scripting/ScriptCommands.d.ts +58 -1
- package/dist/scripting/ScriptSystem.d.ts +1 -2
- package/dist/scripting/ScriptSystem.js +1 -1
- package/dist/services/ScriptRefactorService.js +4 -4
- package/package.json +31 -31
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare type ScriptCommands = Comment | OpenScreen | OpenUrl | OpenDialog | CloseDialog | ToggleSignalValue | SetSignalValue | IncrementSignalValue | DecrementSignalValue | SetBitInSignal | ClearBitInSignal | ToggleBitInSignal | Console | CalculateSignalValue | Javascript | SetElementProperty | Delay | SwitchLanguage | Login | Logout | SubscribeSignal | UnsubscribeSignal | WriteSignalsInGroup | ClearSiganlsInGroup | Condition | Exit | Label | RunScript | Goto;
|
|
1
|
+
export declare type ScriptCommands = Comment | OpenScreen | OpenUrl | OpenDialog | CloseDialog | ToggleSignalValue | SetSignalValue | IncrementSignalValue | DecrementSignalValue | SetBitInSignal | ClearBitInSignal | ToggleBitInSignal | Console | CalculateSignalValue | Javascript | SetElementProperty | Delay | SwitchLanguage | Login | Logout | SubscribeSignal | UnsubscribeSignal | WriteSignalsInGroup | ClearSiganlsInGroup | Condition | Exit | Label | RunScript | Goto | CopySignalValuesFromFolder | ShowMessageBox | ExportSignalValuesAsJson | ImportSignalValuesFromJson;
|
|
2
2
|
export interface Comment {
|
|
3
3
|
type: 'Comment';
|
|
4
4
|
comment: string;
|
|
@@ -35,6 +35,30 @@ export interface OpenDialog {
|
|
|
35
35
|
left?: string;
|
|
36
36
|
top?: string;
|
|
37
37
|
}
|
|
38
|
+
export interface ShowMessageBox {
|
|
39
|
+
type: 'ShowMessageBox';
|
|
40
|
+
/**
|
|
41
|
+
* title text
|
|
42
|
+
*/
|
|
43
|
+
title: string;
|
|
44
|
+
/**
|
|
45
|
+
* message text
|
|
46
|
+
*/
|
|
47
|
+
message: string;
|
|
48
|
+
/**
|
|
49
|
+
* message type
|
|
50
|
+
*/
|
|
51
|
+
messageType?: 'info' | 'warning' | 'error';
|
|
52
|
+
/**
|
|
53
|
+
* message text
|
|
54
|
+
*/
|
|
55
|
+
buttons: 'ok' | 'okCancel' | 'yesNo' | 'retryCancel' | 'yesNoCancel' | 'abortRetryIgnore' | 'cancelTryContinue';
|
|
56
|
+
/**
|
|
57
|
+
* number of the clicked button
|
|
58
|
+
* @TJS-format signal
|
|
59
|
+
*/
|
|
60
|
+
resultSignal: string;
|
|
61
|
+
}
|
|
38
62
|
export interface CloseDialog {
|
|
39
63
|
type: 'CloseDialog';
|
|
40
64
|
}
|
|
@@ -225,6 +249,39 @@ export interface ClearSiganlsInGroup {
|
|
|
225
249
|
*/
|
|
226
250
|
group: string;
|
|
227
251
|
}
|
|
252
|
+
export interface CopySignalValuesFromFolder {
|
|
253
|
+
type: 'CopySignalValuesFromFolder';
|
|
254
|
+
/**
|
|
255
|
+
* name of the source folder
|
|
256
|
+
*/
|
|
257
|
+
sourceFolder: string;
|
|
258
|
+
/**
|
|
259
|
+
* name of destination folder
|
|
260
|
+
*/
|
|
261
|
+
destinationFolder?: number;
|
|
262
|
+
}
|
|
263
|
+
export interface ExportSignalValuesAsJson {
|
|
264
|
+
type: 'ExportSignalValuesAsJson';
|
|
265
|
+
/**
|
|
266
|
+
* regex to select the signals (every matching one)
|
|
267
|
+
*/
|
|
268
|
+
regex: string;
|
|
269
|
+
/**
|
|
270
|
+
* wait for updated values from the connection
|
|
271
|
+
*/
|
|
272
|
+
waitForUpdatedValues?: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* download filename
|
|
275
|
+
*/
|
|
276
|
+
fileName?: string;
|
|
277
|
+
}
|
|
278
|
+
export interface ImportSignalValuesFromJson {
|
|
279
|
+
type: 'ImportSignalValuesFromJson';
|
|
280
|
+
/**
|
|
281
|
+
* json data with the values
|
|
282
|
+
*/
|
|
283
|
+
data: string;
|
|
284
|
+
}
|
|
228
285
|
export interface Condition {
|
|
229
286
|
type: 'Condition';
|
|
230
287
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IScriptMultiplexValue } from "../interfaces/IScriptMultiplexValue.js";
|
|
2
1
|
import { VisualisationElementScript } from "../interfaces/VisualisationElementScript.js";
|
|
3
2
|
import { VisualizationHandler } from "../interfaces/VisualizationHandler.js";
|
|
4
3
|
import { ScriptCommands } from "./ScriptCommands.js";
|
|
@@ -17,7 +16,7 @@ export declare class ScriptSystem {
|
|
|
17
16
|
runExternalScript(name: string, type: string): Promise<void>;
|
|
18
17
|
runScriptCommand<T extends ScriptCommands>(command: T, context: contextType): Promise<void>;
|
|
19
18
|
getTargetFromTargetSelector(context: contextType, targetSelectorTarget: 'currentScreen' | 'parentScreen' | 'currentElement' | 'parentElement', targetSelector: string): Iterable<Element>;
|
|
20
|
-
getValue<T>(value:
|
|
19
|
+
getValue<T>(value: T, outerContext: contextType): Promise<T>;
|
|
21
20
|
getStateOrFieldOrParameter(name: string, context: contextType): Promise<any>;
|
|
22
21
|
parseStringWithValues(text: string, context: contextType): Promise<string>;
|
|
23
22
|
getSignaName(name: string, outerContext: contextType): string;
|
|
@@ -123,7 +123,7 @@ export class ScriptSystem {
|
|
|
123
123
|
case 'IncrementSignalValue': {
|
|
124
124
|
const signal = await this.getValue(command.signal, context);
|
|
125
125
|
let state = await this._visualizationHandler.getState(this.getSignaName(signal, context));
|
|
126
|
-
await this._visualizationHandler.setState(this.getSignaName(signal, context), state.val + await this.getValue(command.value, context));
|
|
126
|
+
await this._visualizationHandler.setState(this.getSignaName(signal, context), (state.val + await this.getValue(command.value, context)));
|
|
127
127
|
break;
|
|
128
128
|
}
|
|
129
129
|
case 'DecrementSignalValue': {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { BindingTarget } from "@node-projects/web-component-designer";
|
|
2
2
|
export class ScriptRefactorService {
|
|
3
3
|
getRefactorings(designItems) {
|
|
4
|
-
|
|
4
|
+
const refactorings = [];
|
|
5
5
|
for (let d of designItems) {
|
|
6
6
|
for (let a of d.attributes()) {
|
|
7
7
|
if (a[0][0] == '@') {
|
|
8
|
-
|
|
8
|
+
const sc = a[1];
|
|
9
9
|
if (sc[0] == '{') {
|
|
10
|
-
|
|
10
|
+
const script = JSON.parse(sc);
|
|
11
11
|
if ('commands' in script) {
|
|
12
12
|
for (let c of script.commands) {
|
|
13
13
|
for (let p in c) {
|
|
14
|
-
|
|
14
|
+
const cp = c[p];
|
|
15
15
|
if (cp != null && typeof cp === 'object') {
|
|
16
16
|
let mp = cp;
|
|
17
17
|
if (mp.source == 'signal') {
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "web-component-designer addon for visualizations",
|
|
3
|
-
"name": "@node-projects/web-component-designer-visualization-addons",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"author": "jochen.kuehner@gmx.de",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"tsc": "tsc",
|
|
11
|
-
"build": "tsc",
|
|
12
|
-
"link": "npm link",
|
|
13
|
-
"prepublishOnly": "npm run build"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@adobe/css-tools": "^4.4.0",
|
|
17
|
-
"@blockly/zoom-to-fit": "^6.0.7",
|
|
18
|
-
"@node-projects/base-custom-webcomponent": ">=0.19.0",
|
|
19
|
-
"@node-projects/propertygrid.webcomponent": ">=1.1.1",
|
|
20
|
-
"@node-projects/splitview.webcomponent": ">=1.0.1",
|
|
21
|
-
"@node-projects/web-component-designer": ">=0.1.215",
|
|
22
|
-
"@node-projects/web-component-designer-codeview-monaco": ">=0.1.27",
|
|
23
|
-
"@node-projects/web-component-designer-widgets-wunderbaum": ">=0.1.27",
|
|
24
|
-
"blockly": "^11.1.1",
|
|
25
|
-
"long": "^5.2.3"
|
|
26
|
-
},
|
|
27
|
-
"repository": {
|
|
28
|
-
"type": "git",
|
|
29
|
-
"url": "git+https://github.com/node-projects/web-component-designer.git"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"description": "web-component-designer addon for visualizations",
|
|
3
|
+
"name": "@node-projects/web-component-designer-visualization-addons",
|
|
4
|
+
"version": "0.1.65",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"author": "jochen.kuehner@gmx.de",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"tsc": "tsc",
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"link": "npm link",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@adobe/css-tools": "^4.4.0",
|
|
17
|
+
"@blockly/zoom-to-fit": "^6.0.7",
|
|
18
|
+
"@node-projects/base-custom-webcomponent": ">=0.19.0",
|
|
19
|
+
"@node-projects/propertygrid.webcomponent": ">=1.1.1",
|
|
20
|
+
"@node-projects/splitview.webcomponent": ">=1.0.1",
|
|
21
|
+
"@node-projects/web-component-designer": ">=0.1.215",
|
|
22
|
+
"@node-projects/web-component-designer-codeview-monaco": ">=0.1.27",
|
|
23
|
+
"@node-projects/web-component-designer-widgets-wunderbaum": ">=0.1.27",
|
|
24
|
+
"blockly": "^11.1.1",
|
|
25
|
+
"long": "^5.2.3"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/node-projects/web-component-designer.git"
|
|
30
|
+
}
|
|
31
|
+
}
|