@node-projects/web-component-designer-widgets-wunderbaum 0.1.14 → 0.1.16

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.
@@ -3,7 +3,7 @@ import { dragDropFormatNameBindingObject } from '@node-projects/web-component-de
3
3
  import { Wunderbaum } from 'wunderbaum';
4
4
  import { defaultOptions, defaultStyle } from '../WunderbaumOptions.js';
5
5
  //@ts-ignore
6
- import wunderbaumStyle from 'wunderbaum/dist/wunderbaum.css' assert { type: 'css' };
6
+ import wunderbaumStyle from 'wunderbaum/dist/wunderbaum.css' with { type: 'css' };
7
7
  export class BindableObjectsBrowser extends BaseCustomWebComponentConstructorAppend {
8
8
  _treeDiv;
9
9
  _tree;
@@ -3,7 +3,7 @@ import { NamedTools, dragDropFormatNameElementDefinition } from '@node-projects/
3
3
  import { Wunderbaum } from 'wunderbaum';
4
4
  import { defaultOptions, defaultStyle } from '../WunderbaumOptions.js';
5
5
  //@ts-ignore
6
- import wunderbaumStyle from 'wunderbaum/dist/wunderbaum.css' assert { type: 'css' };
6
+ import wunderbaumStyle from 'wunderbaum/dist/wunderbaum.css' with { type: 'css' };
7
7
  export class PaletteTreeView extends BaseCustomWebComponentConstructorAppend {
8
8
  _treeDiv;
9
9
  _tree;
@@ -19,7 +19,9 @@ export declare class TreeViewExtended extends BaseCustomWebComponentConstructorA
19
19
  _switchHideAtRunTimeState(img: HTMLImageElement, designItem: IDesignItem): void;
20
20
  showDesignItemContextMenu(designItem: IDesignItem, event: MouseEvent): ContextMenu;
21
21
  ready(): Promise<void>;
22
- createTree(rootItem: IDesignItem): void;
22
+ _recomputeRunning: any;
23
+ _recomputeRequestedAgain: any;
24
+ createTree(rootItem: IDesignItem): Promise<void>;
23
25
  set instanceServiceContainer(value: InstanceServiceContainer);
24
26
  selectionChanged(event: ISelectionChangedEvent): void;
25
27
  private _recomputeTree;
@@ -3,7 +3,7 @@ import { NodeType, assetsPath, ContextMenu, switchContainer, DomConverter } from
3
3
  import { Wunderbaum } from 'wunderbaum';
4
4
  import { defaultOptions, defaultStyle } from '../WunderbaumOptions.js';
5
5
  //@ts-ignore
6
- import wunderbaumStyle from 'wunderbaum/dist/wunderbaum.css' assert { type: 'css' };
6
+ import wunderbaumStyle from 'wunderbaum/dist/wunderbaum.css' with { type: 'css' };
7
7
  export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
8
8
  _treeDiv;
9
9
  _tree;
@@ -244,9 +244,25 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
244
244
  },
245
245
  });
246
246
  }
247
- createTree(rootItem) {
247
+ _recomputeRunning;
248
+ _recomputeRequestedAgain;
249
+ async createTree(rootItem) {
248
250
  if (this._tree) {
249
- this._recomputeTree(rootItem);
251
+ if (!this._recomputeRunning) {
252
+ this._recomputeRunning = true;
253
+ setTimeout(async () => {
254
+ this._recomputeRequestedAgain = false;
255
+ await this._recomputeTree(rootItem);
256
+ this._recomputeRunning = false;
257
+ if (this._recomputeRequestedAgain) {
258
+ this._recomputeRequestedAgain = false;
259
+ this.createTree(rootItem);
260
+ }
261
+ }, 20);
262
+ }
263
+ else {
264
+ this._recomputeRequestedAgain = true;
265
+ }
250
266
  }
251
267
  }
252
268
  set instanceServiceContainer(value) {
@@ -264,11 +280,11 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
264
280
  selectionChanged(event) {
265
281
  this._highlight(event.selectedElements);
266
282
  }
267
- _recomputeTree(rootItem) {
283
+ async _recomputeTree(rootItem) {
268
284
  try {
269
285
  this._tree.root.removeChildren();
270
286
  this._getChildren(rootItem, null);
271
- this._tree.expandAll();
287
+ await this._tree.expandAll();
272
288
  this._filterNodes();
273
289
  }
274
290
  catch (err) {
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
- {
2
- "description": "web-component-designer addon: Widgets using wunderbaum",
3
- "name": "@node-projects/web-component-designer-widgets-wunderbaum",
4
- "version": "0.1.14",
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
- "prepublishOnly": "npm run build"
13
- },
14
- "dependencies": {
15
- "@node-projects/base-custom-webcomponent": ">=0.19.0",
16
- "@node-projects/web-component-designer": ">=0.1.1",
17
- "wunderbaum": ">=0.6.0"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/node-projects/web-component-designer.git"
22
- }
23
- }
1
+ {
2
+ "description": "web-component-designer addon: Widgets using wunderbaum",
3
+ "name": "@node-projects/web-component-designer-widgets-wunderbaum",
4
+ "version": "0.1.16",
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
+ "prepublishOnly": "npm run build"
13
+ },
14
+ "dependencies": {
15
+ "@node-projects/base-custom-webcomponent": ">=0.19.0",
16
+ "@node-projects/web-component-designer": ">=0.1.1",
17
+ "wunderbaum": ">=0.6.0"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/node-projects/web-component-designer.git"
22
+ }
23
+ }