@node-projects/web-component-designer 0.0.286 → 0.0.287

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.
@@ -19,5 +19,6 @@ export declare class PropertyGrid extends BaseCustomWebComponentLazyAppend {
19
19
  set instanceServiceContainer(value: InstanceServiceContainer);
20
20
  get selectedItems(): IDesignItem[];
21
21
  set selectedItems(items: IDesignItem[]);
22
+ _mutationOccured(): void;
22
23
  private _observePrimarySelectionForChanges;
23
24
  }
@@ -35,15 +35,7 @@ export class PropertyGrid extends BaseCustomWebComponentLazyAppend {
35
35
  if (e.composedPath()[0].localName != 'input')
36
36
  e.preventDefault();
37
37
  });
38
- this._itemsObserver = new MutationObserver((m) => {
39
- for (const a of this._propertyGridPropertyLists) {
40
- if (a.propertiesService?.getRefreshMode(this._selectedItems[0]) == RefreshMode.fullOnValueChange) {
41
- a.createElements(this._selectedItems[0]);
42
- a.designItemsChanged(this._selectedItems);
43
- }
44
- a.refreshForDesignItems(this._selectedItems);
45
- }
46
- });
38
+ this._itemsObserver = new MutationObserver((m) => this._mutationOccured());
47
39
  }
48
40
  set serviceContainer(value) {
49
41
  this._serviceContainer = value;
@@ -111,11 +103,23 @@ export class PropertyGrid extends BaseCustomWebComponentLazyAppend {
111
103
  }
112
104
  }
113
105
  }
106
+ _mutationOccured() {
107
+ for (const a of this._propertyGridPropertyLists) {
108
+ if (a.propertiesService?.getRefreshMode(this._selectedItems[0]) == RefreshMode.fullOnValueChange) {
109
+ a.createElements(this._selectedItems[0]);
110
+ a.designItemsChanged(this._selectedItems);
111
+ }
112
+ a.refreshForDesignItems(this._selectedItems);
113
+ }
114
+ }
114
115
  _observePrimarySelectionForChanges() {
115
116
  this._nodeReplacedCb?.dispose();
116
117
  this._itemsObserver.disconnect();
117
118
  this._itemsObserver.observe(this._selectedItems[0].element, { attributes: true, childList: false, characterData: false });
118
- this._nodeReplacedCb = this._selectedItems[0].nodeReplaced.on(() => this._observePrimarySelectionForChanges());
119
+ this._nodeReplacedCb = this._selectedItems[0].nodeReplaced.on(() => {
120
+ this._observePrimarySelectionForChanges();
121
+ this._mutationOccured();
122
+ });
119
123
  }
120
124
  }
121
125
  customElements.define('node-projects-property-grid', PropertyGrid);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "A UI designer for Polymer apps",
3
3
  "name": "@node-projects/web-component-designer",
4
- "version": "0.0.286",
4
+ "version": "0.0.287",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "",