iobroker.mywebui 1.42.41 → 1.42.42

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/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "mywebui",
4
- "version": "1.42.41",
4
+ "version": "1.42.42",
5
5
  "titleLang": {
6
6
  "en": "mywebui",
7
7
  "de": "mywebui",
@@ -29,6 +29,13 @@
29
29
  "zh-cn": "使用万维网传送器的高锰用户接口"
30
30
  },
31
31
  "news": {
32
+ "1.42.42": {
33
+ "en": "feature: 'dynamic' tab in property grid for every element (works also with npm manifest widgets) - per-instance dynamic properties with two-way binding; fix: solution explorer drag crash on nodes without data",
34
+ "az": "yenilik: property grid-də hər element üçün 'dynamic' tabı (npm manifest widget-ləri ilə də işləyir) - instance-əsaslı dinamik property-lər iki-tərəfli binding ilə; düzəliş: solution explorer-də data-sız node-ları drag edəndə çökmə",
35
+ "tr": "yenilik: property grid'de her element için 'dynamic' sekmesi (npm manifest widget'larıyla da çalışır) - instance bazlı dinamik property'ler çift yönlü binding ile; düzeltme: solution explorer'da data'sız node sürüklemede çökme",
36
+ "ru": "новое: вкладка 'dynamic' в property grid для каждого элемента (работает и с npm manifest виджетами) - динамические свойства экземпляра с двусторонней привязкой; исправление: падение drag в solution explorer на узлах без data",
37
+ "de": "Neu: 'dynamic'-Tab im Property-Grid für jedes Element (funktioniert auch mit npm-Manifest-Widgets) - instanzbasierte dynamische Properties mit Zwei-Wege-Binding; Fix: Drag-Absturz im Solution Explorer bei Knoten ohne Daten"
38
+ },
32
39
  "1.42.41": {
33
40
  "en": "improvement: dynamic properties now work on Lit/package widgets at runtime too (accessors + -changed events applied by ScreenViewer); events tab lists -changed events of dynamic properties; added webui-demo-widget sample package",
34
41
  "az": "təkmilləşdirmə: dinamik property-lər artıq runtime-da Lit/package widget-lərdə də işləyir (accessor-lar + -changed event-ləri ScreenViewer tərəfindən tətbiq olunur); events tabı dinamik property-lərin -changed event-lərini göstərir; webui-demo-widget nümunə paketi əlavə olundu",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.mywebui",
3
- "version": "1.42.41",
3
+ "version": "1.42.42",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413 with 3D Editor",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -15,6 +15,7 @@ import { IobrokerWebuiCustomElementContextMenu } from "../services/IobrokerWebui
15
15
  import { IobrokerWebuiRefactorService } from "../services/IobrokerWebuiRefactorService.js";
16
16
  import { IobrokerWebuiSpecialPropertiesService } from "../services/IobrokerWebuiSpecialPropertiesService.js";
17
17
  import { IobrokerWebuiLitPropertiesService } from "../services/IobrokerWebuiLitPropertiesService.js";
18
+ import { IobrokerWebuiPropertyGroupsService } from "../services/IobrokerWebuiPropertyGroupsService.js";
18
19
  // import { IobrokerWebuiVisibilityPropertiesService } from "../services/IobrokerWebuiVisibilityPropertiesService.js";
19
20
  import { iobrokerHandler } from "../common/IobrokerHandler.js";
20
21
  import { ExpandCollapseContextMenu } from "@gokturk413/web-component-designer-widgets-wunderbaum";
@@ -51,6 +52,7 @@ export function configureDesigner(bindingsHelper) {
51
52
  serviceContainer.register('propertyService', new IobrokerWebuiPropertiesService());
52
53
  serviceContainer.register('propertyService', new IobrokerWebuiSpecialPropertiesService());
53
54
  serviceContainer.register('propertyService', new IobrokerWebuiLitPropertiesService());
55
+ serviceContainer.register('propertyGroupsService', new IobrokerWebuiPropertyGroupsService());
54
56
  // Visibility is now handled directly in PropertyGrid
55
57
  // serviceContainer.register('propertyService', new IobrokerWebuiVisibilityPropertiesService());
56
58
  serviceContainer.designViewConfigButtons.push(new IobrokerWebuiConfigButtonProvider());
@@ -1086,6 +1086,9 @@ export class IobrokerWebuiSolutionExplorer extends BaseCustomWebComponentConstru
1086
1086
  dndSourceNode = e.node;
1087
1087
  //@ts-ignore
1088
1088
  e.event.target.style.opacity = '0.4';
1089
+ if (!e.node.data?.data) {
1090
+ return false;
1091
+ }
1089
1092
  if (e.node.data.data.type == 'screen') {
1090
1093
  const screen = e.node.data.data.name;
1091
1094
  const elementDef = { tag: "iobroker-webui-screen-viewer", defaultAttributes: { 'screen-name': screen }, defaultWidth: '300px', defaultHeight: '200px' };
@@ -0,0 +1,36 @@
1
+ import { AbstractPropertiesService, PropertyType, RefreshMode } from "@gokturk413/web-component-designer";
2
+ import { readDynamicDefs, createWebuiTypedProperty, dynamicDefsAttributeName } from "./DynamicPropertiesHelper.js";
3
+ import { IobrokerWebuiDynamicPropsEditor } from "../config/IobrokerWebuiDynamicPropsEditor.js";
4
+
5
+ // serves the 'dynamic' tab of the property grid for EVERY element
6
+ // (independent of which properties service handles the 'properties' tab,
7
+ // e.g. WebcomponentManifestPropertiesService for installed npm widgets)
8
+ export class IobrokerWebuiDynamicPropertiesService extends AbstractPropertiesService {
9
+ name = "webuiDynamic";
10
+
11
+ getRefreshMode(designItem) {
12
+ return RefreshMode.fullOnValueChange;
13
+ }
14
+
15
+ isHandledElement(designItem) {
16
+ return true;
17
+ }
18
+
19
+ async getProperties(designItem) {
20
+ if (!designItem?.element?.getAttribute)
21
+ return null;
22
+ const defs = readDynamicDefs(designItem.element);
23
+ const properties = [];
24
+ for (const d of defs)
25
+ properties.push(await createWebuiTypedProperty(d.name, d, this));
26
+ properties.push({
27
+ name: 'dynamicPropertyDefs',
28
+ type: 'string',
29
+ attributeName: dynamicDefsAttributeName,
30
+ service: this,
31
+ propertyType: PropertyType.attribute,
32
+ createEditor: p => new IobrokerWebuiDynamicPropsEditor(p)
33
+ });
34
+ return properties;
35
+ }
36
+ }
@@ -1,5 +1,5 @@
1
1
  import { Lit2PropertiesService, PropertiesHelper, PropertyType, RefreshMode } from "@gokturk413/web-component-designer";
2
- import { buildDynamicPropertiesGroup, createWebuiTypedProperty } from "./DynamicPropertiesHelper.js";
2
+ import { createWebuiTypedProperty } from "./DynamicPropertiesHelper.js";
3
3
 
4
4
  // extended properties service for Lit (2/3) widgets:
5
5
  // - supports Array & custom converter properties (edited as string/JSON) which Lit2PropertiesService skips
@@ -47,7 +47,6 @@ export class IobrokerWebuiLitPropertiesService extends Lit2PropertiesService {
47
47
  if (!handled.has(name))
48
48
  properties.push(await createWebuiTypedProperty(name, meta[name], this));
49
49
  }
50
- properties.push(await buildDynamicPropertiesGroup(designItem, this));
51
50
  return properties;
52
51
  }
53
52
  }
@@ -3,7 +3,6 @@ import { BaseCustomControl, webuiCustomControlSymbol } from "../runtime/CustomCo
3
3
  import { iobrokerHandler } from "../common/IobrokerHandler.js";
4
4
  import { ScreenViewer } from "../runtime/ScreenViewer.js";
5
5
  import { IobrokerWebuiSignalPropertyEditor } from "../config/IobrokerWebuiSignalPropertyEditor.js";
6
- import { buildDynamicPropertiesGroup } from "./DynamicPropertiesHelper.js";
7
6
  export class IobrokerWebuiPropertiesService extends BaseCustomWebComponentPropertiesService {
8
7
  isHandledElement(designItem) {
9
8
  return designItem.element instanceof BaseCustomControl || designItem.element instanceof ScreenViewer;
@@ -72,7 +71,6 @@ export class IobrokerWebuiPropertiesService extends BaseCustomWebComponentProper
72
71
  for (const [groupName, groupProps] of groupMap) {
73
72
  result.push({ name: groupName, description: '', properties: groupProps });
74
73
  }
75
- result.push(await buildDynamicPropertiesGroup(designItem, this));
76
74
  return result;
77
75
  }
78
76
  else {
@@ -0,0 +1,13 @@
1
+ import { PropertyGroupsService } from "@gokturk413/web-component-designer";
2
+ import { IobrokerWebuiDynamicPropertiesService } from "./IobrokerWebuiDynamicPropertiesService.js";
3
+
4
+ // adds a 'dynamic' tab (per-instance dynamic properties) to the property grid for all elements
5
+ export class IobrokerWebuiPropertyGroupsService extends PropertyGroupsService {
6
+ constructor() {
7
+ super();
8
+ const dynamicEntry = { name: 'dynamic', propertiesService: new IobrokerWebuiDynamicPropertiesService() };
9
+ this._pgList.splice(1, 0, dynamicEntry);
10
+ this._svgPgList.splice(1, 0, dynamicEntry);
11
+ this._svgChildPgList.splice(1, 0, dynamicEntry);
12
+ }
13
+ }