iobroker.webui 1.31.6 → 1.32.0

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.
Files changed (16) hide show
  1. package/README.md +3 -0
  2. package/io-package.json +14 -14
  3. package/package.json +3 -3
  4. package/www/dist/frontend/generated/Properties.json +2 -1
  5. package/www/index.html +1 -1
  6. package/www/node_modules/@node-projects/web-component-designer/dist/elements/helper/CssUnitConverter.js +1 -1
  7. package/www/node_modules/@node-projects/web-component-designer/dist/elements/helper/Helper.js +4 -4
  8. package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/propertiesService/services/CssCurrentPropertiesService.js +6 -3
  9. package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/propertiesService/services/CssProperties.json +61 -15
  10. package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/propertiesService/services/CssPropertiesService.js +6 -2
  11. package/www/node_modules/@node-projects/web-component-designer/dist/elements/widgets/designerView/extensions/PositionExtension.js +1 -0
  12. package/www/node_modules/@node-projects/web-component-designer/dist/elements/widgets/designerView/extensions/ResizeExtension.js +3 -4
  13. package/www/node_modules/@node-projects/web-component-designer/dist/elements/widgets/propertyGrid/PropertyGridPropertyList.js +19 -1
  14. package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/components/SimpleScriptEditor.js +1 -1
  15. package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/interfaces/IScriptMultiplexValue.js +1 -0
  16. package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/scripting/ScriptSystem.js +11 -16
package/README.md CHANGED
@@ -133,6 +133,9 @@ runtime.html?screenName=screen2
133
133
  Placeholder for next versions:
134
134
  ### __WORK IN PROGRESS__
135
135
  -->
136
+ ### 1.32.0 (2025-08-20)
137
+ - Support css prop suggestions
138
+
136
139
  ### 1.31.6 (2025-08-19)
137
140
  - Test one more release
138
141
 
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "webui",
4
- "version": "1.31.6",
4
+ "version": "1.32.0",
5
5
  "titleLang": {
6
6
  "en": "webui",
7
7
  "de": "webui",
@@ -29,6 +29,19 @@
29
29
  "zh-cn": "使用万维网传送器的高锰用户接口"
30
30
  },
31
31
  "news": {
32
+ "1.32.0": {
33
+ "en": "Support css prop suggestions",
34
+ "de": "Support css prop Vorschläge",
35
+ "ru": "Поддержка предложений css",
36
+ "pt": "Suportar sugestões de suporte para css",
37
+ "nl": "Ondersteuning css prop suggesties",
38
+ "fr": "Soutien css prop suggestions",
39
+ "it": "Support css prop suggerimenti",
40
+ "es": "Sugerencias de apoyo css",
41
+ "pl": "Support sugestie css prop",
42
+ "uk": "Підтримка пропозицій css",
43
+ "zh-cn": "支持 css 道具建议"
44
+ },
32
45
  "1.31.6": {
33
46
  "en": "Test one more release",
34
47
  "de": "Testen Sie eine weitere Freigabe",
@@ -106,19 +119,6 @@
106
119
  "pl": "usuń nod 18 z działań github",
107
120
  "uk": "remove nod 18 від github дії",
108
121
  "zh-cn": "从 github 动作中删除点头 18"
109
- },
110
- "1.31.0": {
111
- "en": "update packages\nscript support for properties",
112
- "de": "update-pakete\nscript-unterstützung für eigenschaften",
113
- "ru": "обновление пакетов\nподдержка скриптов для свойств",
114
- "pt": "atualizar pacotes\nsuporte de script para propriedades",
115
- "nl": "pakketten bijwerken\nscriptondersteuning voor eigenschappen",
116
- "fr": "mettre à jour les paquets\nsupport de script pour les propriétés",
117
- "it": "pacchetti di aggiornamento\nsupporto script per le proprietà",
118
- "es": "actualizar paquetes\nsoporte de script para propiedades",
119
- "pl": "aktualizacja pakietów\nobsługa skryptów dla właściwości",
120
- "uk": "оновлення пакетів\nпідтримка сценаріїв властивостей",
121
- "zh-cn": "更新软件包\n属性的脚本支持"
122
122
  }
123
123
  },
124
124
  "icon": "logo.png",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.webui",
3
- "version": "1.31.6",
3
+ "version": "1.32.0",
4
4
  "description": "ioBroker webui",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -60,11 +60,11 @@
60
60
  "@node-projects/node-html-parser-esm": "^6.2.0",
61
61
  "@node-projects/propertygrid.webcomponent": "^1.4.1",
62
62
  "@node-projects/splitview.webcomponent": "^1.0.1",
63
- "@node-projects/web-component-designer": "^0.1.260",
63
+ "@node-projects/web-component-designer": "^0.1.261",
64
64
  "@node-projects/web-component-designer-codeview-monaco": "^0.1.33",
65
65
  "@node-projects/web-component-designer-htmlparserservice-nodehtmlparser": "^0.1.11",
66
66
  "@node-projects/web-component-designer-stylesheetservice-css-tools": "^0.1.11",
67
- "@node-projects/web-component-designer-visualization-addons": "^0.1.127",
67
+ "@node-projects/web-component-designer-visualization-addons": "^0.1.128",
68
68
  "@node-projects/web-component-designer-widgets-wunderbaum": "^0.1.33",
69
69
  "@types/json-schema": "^7.0.15",
70
70
  "@web/dev-server": "^0.4.6",
@@ -255,11 +255,12 @@
255
255
  "type": "string"
256
256
  },
257
257
  "source": {
258
- "description": "signal - read the value from a Signal\nproperty - read the value from a property of the customControl (not usable in screens)\nevent - read the value of a property of the event object\nparameter - a parameter you hand over\ncontext - a value of the context\ncomplexString - a string with signals (contained in {})\ncomplexSignal - read the value from a signal wich name is build here (it can contain other signals in {})\nexpression - js expression, 'ctx' is context object",
258
+ "description": "signal - read the value from a Signal\nproperty - read the value from a property of the customControl (not usable in screens)\nevent - read the value of a property of the event object\nparameter - a parameter you hand over\ncontext - a value of the context\ncomplexString - a string with signals (contained in {})\ncomplexSignal - read the value from a signal wich name is build here (it can contain other signals in {})\nexpression - js expression, 'ctx' is context object\nelementProperty - a property defined on the element raising the event",
259
259
  "enum": [
260
260
  "complexSignal",
261
261
  "complexString",
262
262
  "context",
263
+ "elementProperty",
263
264
  "event",
264
265
  "expression",
265
266
  "parameter",
package/www/index.html CHANGED
@@ -218,7 +218,7 @@
218
218
  </button>
219
219
  <button data-command="save" title="save" disabled><img src="./node_modules/@node-projects/web-component-designer/assets/icons/save.svg"></button>
220
220
  <div style="margin-left: 30px;">
221
- webui - 1.31.6 - 6bb1b00
221
+ webui - 1.32.0 - 009880e
222
222
  </div>
223
223
  <button style="margin-left: 30px;" data-command="paste" title="paste" disabled><img
224
224
  src="./node_modules/@node-projects/web-component-designer/assets/icons/paste.svg"></button>
@@ -1,4 +1,4 @@
1
- //unsupported: ex, ch, svw, svh, vw, lvh, dvw, dvh
1
+ //unsupported: ex, ch, svw, svh, vw, lvh, dvw, dvh, vi, ic, ric
2
2
  const units = ['px', 'cm', 'mm', 'q', 'in', 'pc', 'pt', 'rem', 'em', 'vw', 'vh', 'vmin', 'vmax', 'lh', 'rlh', '%', 'ms', 's', 'deg', 'rad', 'grad', 'turn', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'fr'];
3
3
  const pattern = new RegExp(`^([\-\+]?(?:\\d+(?:\\.\\d+)?))(${units.join('|')})$`, 'i');
4
4
  export function convertCssUnitToPixel(cssValue, target, percentTarget) {
@@ -54,11 +54,11 @@ export function arraysEqual(a, b) {
54
54
  return true;
55
55
  }
56
56
  let nullObject;
57
- export function deepValue(obj, path, returnNullObject = false) {
57
+ export function deepValue(obj, path, returnNullObject = false, splitter = '.') {
58
58
  if (path === undefined || path === null) {
59
59
  return obj;
60
60
  }
61
- const pathParts = path.split('.');
61
+ const pathParts = path.split(splitter);
62
62
  for (let i = 0; i < pathParts.length; i++) {
63
63
  if (obj != null) {
64
64
  obj = obj[pathParts[i]];
@@ -69,11 +69,11 @@ export function deepValue(obj, path, returnNullObject = false) {
69
69
  }
70
70
  return obj;
71
71
  }
72
- export function setDeepValue(obj, path, value) {
72
+ export function setDeepValue(obj, path, value, splitter = '.') {
73
73
  if (path === undefined || path === null) {
74
74
  return;
75
75
  }
76
- const pathParts = path.split('.');
76
+ const pathParts = path.split(splitter);
77
77
  for (let i = 0; i < pathParts.length - 1; i++) {
78
78
  if (obj != null) {
79
79
  let newObj = obj[pathParts[i]];
@@ -4,16 +4,16 @@ import { ValueType } from '../ValueType.js';
4
4
  import { NodeType } from '../../../item/NodeType.js';
5
5
  import cssProperties from "./CssProperties.json" with { type: 'json' };
6
6
  import { BindingTarget } from '../../../item/BindingTarget.js';
7
- import { AbstractCssPropertiesService } from './AbstractCssPropertiesService.js';
8
7
  import { PropertiesHelper } from './PropertiesHelper.js';
9
8
  import { AbstractPropertiesService } from './AbstractPropertiesService.js';
9
+ import { CssPropertiesService } from './CssPropertiesService.js';
10
10
  const localName = '&lt;local&gt;';
11
- export class CssCurrentPropertiesService extends AbstractCssPropertiesService {
11
+ export class CssCurrentPropertiesService extends CssPropertiesService {
12
12
  getRefreshMode(designItem) {
13
13
  return RefreshMode.fullOnValueChange;
14
14
  }
15
15
  constructor() {
16
- super();
16
+ super(null);
17
17
  this.name = 'styles';
18
18
  }
19
19
  isHandledElement(designItem) {
@@ -22,6 +22,9 @@ export class CssCurrentPropertiesService extends AbstractCssPropertiesService {
22
22
  async getProperty(designItem, name) {
23
23
  return { name: name, type: 'string', service: this, propertyType: PropertyType.cssValue };
24
24
  }
25
+ getPropertyNameSuggestions(designItems) {
26
+ return Object.keys(cssProperties).map(x => PropertiesHelper.camelToDashCase(x));
27
+ }
25
28
  async getProperties(designItem) {
26
29
  if (!designItem || designItem.nodeType != NodeType.Element)
27
30
  return [];
@@ -223,7 +223,9 @@
223
223
  "colorScheme": {},
224
224
  "columnCount": {},
225
225
  "columnFill": {},
226
- "columnGap": {},
226
+ "columnGap": {
227
+ "type": "length"
228
+ },
227
229
  "columnRule": {},
228
230
  "columnRuleColor": {
229
231
  "type": "color"
@@ -316,6 +318,7 @@
316
318
  "wrap-reverse"
317
319
  ]
318
320
  },
321
+ "fieldSizing": {},
319
322
  "float": {
320
323
  "type": "list",
321
324
  "values": [
@@ -340,6 +343,7 @@
340
343
  "fontOpticalSizing": {},
341
344
  "fontPalette": {},
342
345
  "fontSize": {},
346
+ "fontSizeAdjust": {},
343
347
  "fontStretch": {},
344
348
  "fontStyle": {},
345
349
  "fontSynthesis": {},
@@ -354,7 +358,9 @@
354
358
  "fontVariationSettings": {},
355
359
  "fontWeight": {},
356
360
  "forcedColorAdjust": {},
357
- "gap": {},
361
+ "gap": {
362
+ "type": "length"
363
+ },
358
364
  "grid": {},
359
365
  "gridArea": {},
360
366
  "gridAutoColumns": {},
@@ -362,12 +368,18 @@
362
368
  "gridAutoRows": {},
363
369
  "gridColumn": {},
364
370
  "gridColumnEnd": {},
365
- "gridColumnGap": {},
371
+ "gridColumnGap": {
372
+ "type": "length"
373
+ },
366
374
  "gridColumnStart": {},
367
- "gridGap": {},
375
+ "gridGap": {
376
+ "type": "length"
377
+ },
368
378
  "gridRow": {},
369
379
  "gridRowEnd": {},
370
- "gridRowGap": {},
380
+ "gridRowGap": {
381
+ "type": "length"
382
+ },
371
383
  "gridRowStart": {},
372
384
  "gridTemplate": {},
373
385
  "gridTemplateAreas": {},
@@ -598,7 +610,8 @@
598
610
  "static",
599
611
  "relative",
600
612
  "absolute",
601
- "fixed"
613
+ "fixed",
614
+ "anchor"
602
615
  ]
603
616
  },
604
617
  "prefix": {},
@@ -608,11 +621,24 @@
608
621
  "resize": {},
609
622
  "right": {},
610
623
  "rotate": {},
611
- "rowGap": {},
624
+ "rowGap": {
625
+ "type": "length"
626
+ },
627
+ "rubyAlign": {},
612
628
  "rubyPosition": {},
613
629
  "rx": {},
614
630
  "ry": {},
615
631
  "scale": {},
632
+ "scrollbarColor": {},
633
+ "scrollbarGutter": {
634
+ "type": "list",
635
+ "values": [
636
+ "auto",
637
+ "stable",
638
+ "stable both-edges"
639
+ ]
640
+ },
641
+ "scrollbarWidth": {},
616
642
  "scrollBehavior": {},
617
643
  "scrollMargin": {},
618
644
  "scrollMarginBlock": {},
@@ -639,11 +665,18 @@
639
665
  "scrollSnapAlign": {},
640
666
  "scrollSnapStop": {},
641
667
  "scrollSnapType": {},
642
- "scrollbarGutter": {},
643
668
  "shapeImageThreshold": {},
644
669
  "shapeMargin": {},
645
670
  "shapeOutside": {},
646
- "shapeRendering": {},
671
+ "shapeRendering": {
672
+ "type": "list",
673
+ "values": [
674
+ "auto",
675
+ "optimizeSpeed",
676
+ "crispEdges",
677
+ "geometricPrecision"
678
+ ]
679
+ },
647
680
  "size": {},
648
681
  "sizeAdjust": {},
649
682
  "speak": {},
@@ -681,12 +714,7 @@
681
714
  "center",
682
715
  "justify",
683
716
  "justify-all",
684
- "match-parent",
685
- "inherit",
686
- "initial",
687
- "revert",
688
- "revert-layer",
689
- "unset"
717
+ "match-parent"
690
718
  ]
691
719
  },
692
720
  "textAlignLast": {},
@@ -715,6 +743,23 @@
715
743
  "textTransform": {},
716
744
  "textUnderlineOffset": {},
717
745
  "textUnderlinePosition": {},
746
+ "textWrap": {},
747
+ "textWrapMode": {
748
+ "type": "list",
749
+ "values": [
750
+ "wrap",
751
+ "nowrap"
752
+ ]
753
+ },
754
+ "textWrapStyle": {
755
+ "type": "list",
756
+ "values": [
757
+ "auto",
758
+ "balance",
759
+ "pretty",
760
+ "stable"
761
+ ]
762
+ },
718
763
  "top": {},
719
764
  "touchAction": {},
720
765
  "transform": {},
@@ -723,6 +768,7 @@
723
768
  "transformStyle": {},
724
769
  "transition": {},
725
770
  "transitionDelay": {},
771
+ "transitionBehavior": {},
726
772
  "transitionDuration": {},
727
773
  "transitionProperty": {},
728
774
  "transitionTimingFunction": {},
@@ -21,6 +21,7 @@ export class CssPropertiesService extends AbstractCssPropertiesService {
21
21
  "box-shadow",
22
22
  "opacity",
23
23
  "position",
24
+ "align-content",
24
25
  ],
25
26
  "font": [
26
27
  "font-family",
@@ -41,12 +42,13 @@ export class CssPropertiesService extends AbstractCssPropertiesService {
41
42
  "position",
42
43
  "grid-template-columns",
43
44
  "grid-template-rows",
45
+ "gap",
44
46
  "column-gap",
45
47
  "row-gap",
46
48
  "align-content",
47
49
  "justify-content",
48
50
  "align-items",
49
- "justify-items",
51
+ "justify-items"
50
52
  ];
51
53
  gridChild = [
52
54
  "grid-row",
@@ -62,7 +64,8 @@ export class CssPropertiesService extends AbstractCssPropertiesService {
62
64
  "flex-wrap",
63
65
  "align-content",
64
66
  "justify-content",
65
- "align-items"
67
+ "align-items",
68
+ "gap"
66
69
  ];
67
70
  flexChild = [
68
71
  "align-self",
@@ -113,6 +116,7 @@ export class CssPropertiesService extends AbstractCssPropertiesService {
113
116
  default:
114
117
  return {
115
118
  name,
119
+ //attributeName: PropertiesHelper.camelToDashCase(name),
116
120
  type: cssProperties[camelName]?.type ?? 'string',
117
121
  values: cssProperties[camelName]?.values ? [...cssProperties[camelName]?.values, 'initial', 'inherit', 'unset'] : ['initial', 'inherit', 'unset'],
118
122
  service: this,
@@ -14,6 +14,7 @@ export class PositionExtension extends AbstractExtension {
14
14
  }
15
15
  _oldValues = [];
16
16
  refresh() {
17
+ //TODO: show wich position is docked (no dashed line, but full). klick on value disables or enables docking? Disabling enables parent side, enabling both removes width or height.
17
18
  const itemRect = this.designerCanvas.getNormalizedElementCoordinates(this.extendedItem.element);
18
19
  const itemParentRect = this.designerCanvas.getNormalizedElementCoordinates(this.extendedItem.parent.element);
19
20
  if (this._valuesHaveChanges(this.designerCanvas.scaleFactor, itemRect.x, itemRect.y, itemParentRect.x, itemParentRect.y, itemRect.height, itemRect.width, itemParentRect.height, itemParentRect.width)) {
@@ -44,7 +44,6 @@ export class ResizeExtension extends AbstractExtension {
44
44
  this.refresh(cache, event);
45
45
  }
46
46
  refresh(cache, event) {
47
- //#region Resizer circles
48
47
  let transformedCornerPoints = this.extendedItem.element.getBoxQuads({ box: 'border', relativeTo: this.designerCanvas.canvas })[0];
49
48
  if (!transformedCornerPoints)
50
49
  return;
@@ -62,7 +61,6 @@ export class ResizeExtension extends AbstractExtension {
62
61
  this._circle8 = this._drawResizerOverlay((transformedCornerPoints.p2.x + (transformedCornerPoints.p3.x - transformedCornerPoints.p2.x) / 2), (transformedCornerPoints.p2.y + (transformedCornerPoints.p3.y - transformedCornerPoints.p2.y) / 2), 'e-resize', this._circle8);
63
62
  this._circle7 = this._drawResizerOverlay(transformedCornerPoints.p3.x, transformedCornerPoints.p3.y, 'se-resize', this._circle7);
64
63
  }
65
- //#endregion Circles
66
64
  }
67
65
  _drawResizerOverlay(x, y, cursor, oldCircle) {
68
66
  let circle = this._drawCircle(x, y, this.designerCanvas.serviceContainer.options.resizerPixelSize / this.designerCanvas.zoomFactor, 'svg-primary-resizer', oldCircle);
@@ -78,6 +76,9 @@ export class ResizeExtension extends AbstractExtension {
78
76
  _pointerActionTypeResize(circle, event, actionMode) {
79
77
  event.stopPropagation();
80
78
  const currentPoint = this.designerCanvas.getNormalizedEventCoordinates(event);
79
+ //TODO: calculate new position and size in the extension
80
+ //aply the values with the position service
81
+ //don't switch from left positioning to right and so on...
81
82
  switch (event.type) {
82
83
  case EventNames.PointerDown:
83
84
  const cx = parseFloat(circle.getAttribute('cx'));
@@ -89,12 +90,10 @@ export class ResizeExtension extends AbstractExtension {
89
90
  this._actionModeStarted = actionMode;
90
91
  this._initialComputedTransformOrigins = [];
91
92
  this._initialTransformOrigins = [];
92
- //#region Calc elements' dimension
93
93
  const transformBackup = this.extendedItem.element.style.transform;
94
94
  this.extendedItem.element.style.transform = '';
95
95
  let rect = this.extendedItem.element.getBoundingClientRect();
96
96
  this.extendedItem.element.style.transform = transformBackup;
97
- //#endregion Calc element's dimension
98
97
  let contentBoxOffset = { x: 0, y: 0 };
99
98
  if (getComputedStyle(this.extendedItem.element).boxSizing == 'content-box') {
100
99
  contentBoxOffset = getContentBoxContentOffsets(this.extendedItem.element);
@@ -11,6 +11,7 @@ export class PropertyGridPropertyList extends BaseCustomWebComponentLazyAppend {
11
11
  _propertiesService;
12
12
  _designItems;
13
13
  _lastClassType;
14
+ _addCounter = 0;
14
15
  propertyGroupHover;
15
16
  propertyGroupClick;
16
17
  propertyContextMenuProvider;
@@ -213,8 +214,11 @@ export class PropertyGridPropertyList extends BaseCustomWebComponentLazyAppend {
213
214
  if (p.type == 'addNew') {
214
215
  let input = editor.element;
215
216
  input.disabled = true;
217
+ input.id = "addNew_input_" + (++this._addCounter);
216
218
  let label = document.createElement("input");
217
219
  label.value = p.name;
220
+ label.type = "text";
221
+ label.id = "addNew_label_" + this._addCounter;
218
222
  label.onkeyup = e => {
219
223
  if (e.key == 'Enter' && label.value) {
220
224
  p.name = label.value;
@@ -223,6 +227,18 @@ export class PropertyGridPropertyList extends BaseCustomWebComponentLazyAppend {
223
227
  input.focus();
224
228
  }
225
229
  };
230
+ if (p.service.getPropertyNameSuggestions) {
231
+ const sug = p.service.getPropertyNameSuggestions(null); //TODO: design items?
232
+ const dl = document.createElement("datalist");
233
+ dl.id = "addNew_" + this._addCounter + "_datalist";
234
+ for (let s of sug) {
235
+ const op = document.createElement("option");
236
+ op.value = s;
237
+ dl.append(op);
238
+ }
239
+ this._div.appendChild(dl);
240
+ label.setAttribute('list', dl.id);
241
+ }
226
242
  this._div.appendChild(label);
227
243
  }
228
244
  else {
@@ -238,6 +254,7 @@ export class PropertyGridPropertyList extends BaseCustomWebComponentLazyAppend {
238
254
  }
239
255
  else {
240
256
  let label = document.createElement("input");
257
+ label.id = 'label_' + p.name;
241
258
  let input = editor.element;
242
259
  label.value = p.name;
243
260
  label.onkeyup = async (e) => {
@@ -253,7 +270,8 @@ export class PropertyGridPropertyList extends BaseCustomWebComponentLazyAppend {
253
270
  this._div.appendChild(label);
254
271
  }
255
272
  }
256
- editor.element.id = p.name;
273
+ if (p.name)
274
+ editor.element.id = p.name;
257
275
  this._div.appendChild(editor.element);
258
276
  this._propertyMap.set(p, { isSetElement: rect, editor: editor });
259
277
  }
@@ -207,7 +207,7 @@ export class SimpleScriptEditor extends BaseCustomWebComponentConstructorAppend
207
207
  }
208
208
  //Converter from TypscriptJsonSchema to our Property list...
209
209
  async addPossibleCommands() {
210
- let commands = Object.keys(this.scriptCommandsTypeInfo.definitions);
210
+ let commands = Object.keys(this.scriptCommandsTypeInfo.definitions).filter(x => this.scriptCommandsTypeInfo.definitions[x].type == 'object');
211
211
  for (let c of commands) {
212
212
  if (c == 'ScriptCommands')
213
213
  continue;
@@ -8,6 +8,7 @@ export class IScriptMultiplexValue {
8
8
  * complexString - a string with signals (contained in {})
9
9
  * complexSignal - read the value from a signal wich name is build here (it can contain other signals in {})
10
10
  * expression - js expression, 'ctx' is context object
11
+ * elementProperty - a property defined on the element raising the event
11
12
  */
12
13
  source;
13
14
  /**
@@ -1,4 +1,4 @@
1
- import { sleep } from "@node-projects/web-component-designer/dist/elements/helper/Helper.js";
1
+ import { deepValue, setDeepValue, sleep } from "@node-projects/web-component-designer/dist/elements/helper/Helper.js";
2
2
  import { generateEventCodeFromBlockly } from "../blockly/BlocklyJavascriptHelper.js";
3
3
  import { parseBindingString } from "../helpers/BindingsHelper.js";
4
4
  import Long from 'long';
@@ -83,10 +83,10 @@ export class ScriptSystem {
83
83
  }
84
84
  async getValueFromTarget(target, name, context) {
85
85
  if (target === 'property') {
86
- return context.root[name];
86
+ return deepValue(context.root, name);
87
87
  }
88
88
  else if (target === 'elementProperty') {
89
- return context.element[name];
89
+ return deepValue(context.element, name);
90
90
  }
91
91
  else {
92
92
  return (await this._visualizationHandler.getState(this.getSignalName(name, context)))?.val;
@@ -94,10 +94,10 @@ export class ScriptSystem {
94
94
  }
95
95
  async setValueOnTarget(target, name, context, value) {
96
96
  if (target === 'property') {
97
- context.root[name] = value;
97
+ setDeepValue(context.root, name, value);
98
98
  }
99
99
  else if (target === 'elementProperty') {
100
- context.element[name] = value;
100
+ setDeepValue(context.element, name, value);
101
101
  }
102
102
  else {
103
103
  await this._visualizationHandler.setState(this.getSignalName(name, context), value);
@@ -349,7 +349,10 @@ export class ScriptSystem {
349
349
  if (typeof value === 'object') {
350
350
  switch (value.source) {
351
351
  case 'property': {
352
- return outerContext.root[value.name];
352
+ return deepValue(outerContext.root, value.name);
353
+ }
354
+ case 'elementProperty': {
355
+ return deepValue(outerContext.element, value.name);
353
356
  }
354
357
  case 'signal': {
355
358
  let sng = await this._visualizationHandler.getState(this.getSignalName(value.name, outerContext));
@@ -358,15 +361,14 @@ export class ScriptSystem {
358
361
  case 'event': {
359
362
  let obj = outerContext.event;
360
363
  if (value.name)
361
- obj = ScriptSystem.extractPart(obj, value.name);
364
+ obj = deepValue(obj, value.name);
362
365
  return obj;
363
366
  }
364
367
  case 'parameter': {
365
368
  return outerContext.parameters[value.name];
366
369
  }
367
370
  case 'context': {
368
- const obj = ScriptSystem.extractPart(outerContext, value.name);
369
- return obj;
371
+ return deepValue(outerContext, value.name);
370
372
  }
371
373
  case 'complexString': {
372
374
  let text = value.name;
@@ -427,13 +429,6 @@ export class ScriptSystem {
427
429
  return outerContext.relativeSignalsPath + name;
428
430
  return name;
429
431
  }
430
- static extractPart(obj, propertyPath) {
431
- let retVal = obj;
432
- for (let p of propertyPath.split('.')) {
433
- retVal = retVal?.[p];
434
- }
435
- return retVal;
436
- }
437
432
  createScriptContext(root, event, element, parameters, relativeSignalsPath) {
438
433
  return { root, event, element, parameters, relativeSignalsPath };
439
434
  }