@node-projects/web-component-designer 0.0.105 → 0.0.108

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.
@@ -4,6 +4,7 @@ export interface IElementDefinition {
4
4
  name?: string;
5
5
  description?: string;
6
6
  import?: string;
7
+ className?: string;
7
8
  type?: string;
8
9
  defaultContent?: any;
9
10
  defaultAttributes?: {
@@ -15,7 +15,8 @@ export class WebcomponentManifestElementsService {
15
15
  for (let m of manifest.modules) {
16
16
  for (let e of m.exports) {
17
17
  if (e.kind == 'custom-element-definition') {
18
- this._elementList.push({ tag: e.name, import: this._importPrefix + '/' + e.declaration.module });
18
+ let elDef = { tag: e.name, import: this._importPrefix + '/' + e.declaration.module, defaultWidth: "200px", defaultHeight: "200px", className: e.declaration.name };
19
+ this._elementList.push(elDef);
19
20
  }
20
21
  }
21
22
  if (this._resolveStored) {
@@ -10,12 +10,18 @@ export class DefaultInstanceService {
10
10
  //@ts-ignore
11
11
  if (importShim) {
12
12
  //@ts-ignore
13
- importShim(importUri).then(() => {
13
+ importShim(importUri).then((x) => {
14
+ let ctor = customElements.get(definition.tag);
15
+ if (!ctor && definition.className && x[definition.className])
16
+ customElements.define(definition.tag, x[definition.className]);
14
17
  //TODO: refresh all extensions
15
18
  });
16
19
  }
17
20
  else {
18
- import(importUri).then(() => {
21
+ import(importUri).then((x) => {
22
+ let ctor = customElements.get(definition.tag);
23
+ if (!ctor && definition.className && x[definition.className])
24
+ customElements.define(definition.tag, x[definition.className]);
19
25
  //TODO: refresh all extensions
20
26
  });
21
27
  }
@@ -12,20 +12,32 @@ export class WebcomponentManifestPropertiesService extends UnkownElementProperti
12
12
  }
13
13
  _parseManifest(manifest) {
14
14
  this._propertiesList = {};
15
+ let declarations = [];
16
+ for (let m of manifest.modules) {
17
+ if (m.declarations)
18
+ declarations.push(...m.declarations);
19
+ }
15
20
  for (let m of manifest.modules) {
16
21
  for (let e of m.exports) {
17
22
  if (e.kind == 'custom-element-definition') {
18
23
  let properties = [];
19
- let declaration = m.declarations.find(x => x.name == e.declaration.name);
20
- for (let d of declaration.members) {
21
- if (d.kind == 'field') {
22
- let pType = PropertyType.property;
23
- if (declaration.attributes)
24
- pType = declaration.attributes.find(x => x.fieldName == d.name) != null ? PropertyType.propertyAndAttribute : PropertyType.property;
25
- properties.push({ name: d.name, service: this, propertyType: pType, type: this.manifestClassPropertyTypeToEditorPropertyType(d.type?.text) });
24
+ let declaration = declarations.find(x => x.name == e.declaration.name);
25
+ if (declaration) {
26
+ if (declaration.members) {
27
+ for (let d of declaration.members) {
28
+ if (d.kind == 'field') {
29
+ let pType = PropertyType.property;
30
+ if (declaration.attributes)
31
+ pType = declaration.attributes.find(x => x.fieldName == d.name) != null ? PropertyType.propertyAndAttribute : PropertyType.property;
32
+ properties.push({ name: d.name, service: this, propertyType: pType, type: this.manifestClassPropertyTypeToEditorPropertyType(d.type?.text) });
33
+ }
34
+ }
35
+ this._propertiesList[e.name] = properties;
26
36
  }
27
37
  }
28
- this._propertiesList[e.name] = properties;
38
+ else {
39
+ console.warn('declaration for ' + e.declaration.name + ' not found', manifest);
40
+ }
29
41
  }
30
42
  }
31
43
  }
@@ -38,6 +38,7 @@ export class BindableObjectsBrowser extends BaseCustomWebComponentLazyAppend {
38
38
  this._treeDiv.setAttribute('id', 'tree');
39
39
  this.shadowRoot.appendChild(this._treeDiv);
40
40
  $(this._treeDiv).fancytree({
41
+ debugLevel: 0,
41
42
  icon: false,
42
43
  extensions: ['dnd5'],
43
44
  quicksearch: true,
@@ -49,7 +49,7 @@ export class PaletteTreeView extends BaseCustomWebComponentConstructorAppend {
49
49
  static template = html `
50
50
  <div style="height: 100%;">
51
51
  <input id="input" style="width: 100%; height:21px;" placeholder="Filter..." autocomplete="off">
52
- <div style="height: calc(100% - 23px); overflow: auto;">
52
+ <div style="height: calc(100% - 26px); overflow: auto;">
53
53
  <div id="treetable" style="min-width: 100%;"></div>
54
54
  </div>
55
55
  </div>`;
@@ -67,6 +67,7 @@ export class PaletteTreeView extends BaseCustomWebComponentConstructorAppend {
67
67
  };
68
68
  this._treeDiv = this._getDomElement('treetable');
69
69
  $(this._treeDiv).fancytree({
70
+ debugLevel: 0,
70
71
  icon: true,
71
72
  extensions: ['childcounter', 'dnd5', 'filter'],
72
73
  quicksearch: true,
@@ -158,6 +158,7 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
158
158
  async ready() {
159
159
  //this._treeDiv.classList.add('fancytree-connectors');
160
160
  $(this._treeDiv).fancytree({
161
+ debugLevel: 0,
161
162
  icon: true,
162
163
  extensions: ['childcounter', 'dnd5', 'multi', 'filter', 'table'],
163
164
  quicksearch: true,
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.105",
4
+ "version": "0.0.108",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "",