@node-projects/web-component-designer 0.0.75 → 0.0.79

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 (71) hide show
  1. package/README.md +2 -2
  2. package/dist/elements/documentContainer.d.ts +3 -0
  3. package/dist/elements/documentContainer.js +13 -3
  4. package/dist/elements/helper/ElementHelper.d.ts +7 -0
  5. package/dist/elements/helper/ElementHelper.js +13 -0
  6. package/dist/elements/helper/IndentedTextWriter.d.ts +1 -0
  7. package/dist/elements/helper/IndentedTextWriter.js +3 -0
  8. package/dist/elements/services/BaseServiceContainer.d.ts +1 -0
  9. package/dist/elements/services/BaseServiceContainer.js +7 -0
  10. package/dist/elements/services/DefaultServiceBootstrap.js +1 -1
  11. package/dist/elements/services/ServiceContainer.d.ts +1 -1
  12. package/dist/elements/services/ServiceContainer.js +2 -2
  13. package/dist/elements/services/demoProviderService/DemoProviderService.d.ts +1 -1
  14. package/dist/elements/services/demoProviderService/DemoProviderService.js +3 -2
  15. package/dist/elements/services/demoProviderService/IDemoProviderService.d.ts +1 -1
  16. package/dist/elements/services/htmlWriterService/FormatingHtmlWriterService copy.d.ts +22 -0
  17. package/dist/elements/services/htmlWriterService/FormatingHtmlWriterService copy.js +125 -0
  18. package/dist/elements/services/htmlWriterService/FormatingHtmlWriterService.d.ts +22 -0
  19. package/dist/elements/services/htmlWriterService/FormatingHtmlWriterService.js +133 -0
  20. package/dist/elements/services/htmlWriterService/HtmlWriterService copy.d.ts +22 -0
  21. package/dist/elements/services/htmlWriterService/HtmlWriterService copy.js +118 -0
  22. package/dist/elements/services/htmlWriterService/HtmlWriterService.d.ts +2 -2
  23. package/dist/elements/services/htmlWriterService/HtmlWriterService.js +34 -19
  24. package/dist/elements/services/htmlWriterService/IHtmlWriterService.d.ts +5 -6
  25. package/dist/elements/services/htmlWriterService/LitElementWriterService.d.ts +14 -0
  26. package/dist/elements/services/htmlWriterService/LitElementWriterService.js +123 -0
  27. package/dist/elements/services/htmlWriterService/LitTsElementWriterService.d.ts +9 -0
  28. package/dist/elements/services/htmlWriterService/LitTsElementWriterService.js +43 -0
  29. package/dist/elements/services/htmlWriterService/SimpleHtmlWriterService copy.d.ts +22 -0
  30. package/dist/elements/services/htmlWriterService/SimpleHtmlWriterService copy.js +125 -0
  31. package/dist/elements/services/htmlWriterService/SimpleHtmlWriterService.d.ts +27 -0
  32. package/dist/elements/services/htmlWriterService/SimpleHtmlWriterService.js +93 -0
  33. package/dist/elements/services/initializationService/DefaultIntializationService.d.ts +6 -0
  34. package/dist/elements/services/initializationService/DefaultIntializationService.js +22 -0
  35. package/dist/elements/services/initializationService/IIntializationService copy.d.ts +4 -0
  36. package/dist/elements/services/initializationService/IIntializationService copy.js +1 -0
  37. package/dist/elements/services/instanceService/DefaultInstanceService.js +1 -1
  38. package/dist/elements/services/manifestLoaders/WebcomponentManifestParserService.d.ts +26 -0
  39. package/dist/elements/services/manifestLoaders/WebcomponentManifestParserService.js +69 -0
  40. package/dist/elements/services/manifestParsers/WebcomponentManifestParserService.d.ts +25 -0
  41. package/dist/elements/services/manifestParsers/WebcomponentManifestParserService.js +92 -0
  42. package/dist/elements/services/propertiesService/DefaultEditorTypesService.js +0 -1
  43. package/dist/elements/services/propertiesService/IPropertiesService.d.ts +0 -1
  44. package/dist/elements/services/propertiesService/IProperty.d.ts +5 -1
  45. package/dist/elements/services/propertiesService/PropertyType.d.ts +6 -0
  46. package/dist/elements/services/propertiesService/PropertyType.js +7 -0
  47. package/dist/elements/services/propertiesService/services/AbstractBasePropertiesService.js +7 -6
  48. package/dist/elements/services/propertiesService/services/AttributesPropertiesService.js +3 -2
  49. package/dist/elements/services/propertiesService/services/CommonPropertiesService.js +11 -4
  50. package/dist/elements/services/propertiesService/services/CssPropertiesService.js +81 -41
  51. package/dist/elements/services/propertiesService/services/IJsonPropertyDefinition.d.ts +4 -0
  52. package/dist/elements/services/propertiesService/services/ListPropertiesService.js +5 -1
  53. package/dist/elements/services/propertiesService/services/Lit2PropertiesService.js +7 -6
  54. package/dist/elements/services/propertiesService/services/NativeElementsPropertiesService.js +25 -12
  55. package/dist/elements/services/propertiesService/services/UnkownElementPropertiesService.d.ts +1 -2
  56. package/dist/elements/services/propertiesService/services/UnkownElementPropertiesService.js +1 -1
  57. package/dist/elements/services/webcomponentManifestParserService/WebcomponentManifestParserService.1.d.ts +0 -0
  58. package/dist/elements/services/webcomponentManifestParserService/WebcomponentManifestParserService.1.js +1 -0
  59. package/dist/elements/services/webcomponentManifestParserService/webcomponentManifestParserService.d.ts +26 -0
  60. package/dist/elements/services/webcomponentManifestParserService/webcomponentManifestParserService.js +69 -0
  61. package/dist/elements/widgets/demoView/IDemoView.d.ts +1 -1
  62. package/dist/elements/widgets/demoView/demoView.d.ts +1 -1
  63. package/dist/elements/widgets/demoView/demoView.js +2 -2
  64. package/dist/elements/widgets/designerView/DomConverter.js +1 -7
  65. package/dist/elements/widgets/designerView/designerCanvas.js +6 -0
  66. package/dist/elements/widgets/designerView/overlayLayerView.js +1 -2
  67. package/dist/elements/widgets/paletteView/paletteTreeView.js +13 -8
  68. package/dist/elements/widgets/paletteView/paletteView.js +10 -5
  69. package/dist/index.d.ts +4 -0
  70. package/dist/index.js +4 -0
  71. package/package.json +5 -4
@@ -1,85 +1,103 @@
1
1
  import { ValueType } from '../ValueType';
2
2
  import { NodeType } from '../../../item/NodeType';
3
3
  import { BindingTarget } from '../../../item/BindingTarget.js';
4
+ import { PropertyType } from '../PropertyType';
4
5
  export class CssPropertiesService {
5
6
  //@ts-ignore
6
7
  styles = [
7
8
  {
8
9
  name: "color",
9
10
  type: "color",
10
- service: this
11
+ service: this,
12
+ propertyType: PropertyType.cssValue
11
13
  }, {
12
14
  name: "background-color",
13
15
  type: "color",
14
- service: this
16
+ service: this,
17
+ propertyType: PropertyType.cssValue
15
18
  }, {
16
19
  name: "box-sizing",
17
20
  type: "list",
18
21
  values: ["border-box", "content-box"],
19
- service: this
22
+ service: this,
23
+ propertyType: PropertyType.cssValue
20
24
  }, {
21
25
  name: "border",
22
26
  type: "string",
23
27
  default: "0px none rbg(0,0,0)",
24
- service: this
28
+ service: this,
29
+ propertyType: PropertyType.cssValue
25
30
  }, {
26
31
  name: "box-shadow",
27
32
  type: "string",
28
33
  default: "none",
29
- service: this
34
+ service: this,
35
+ propertyType: PropertyType.cssValue
30
36
  }, {
31
37
  name: "opacity",
32
38
  type: "number",
33
39
  min: 0,
34
40
  max: 1,
35
41
  step: 0.1,
36
- service: this
42
+ service: this,
43
+ propertyType: PropertyType.cssValue
37
44
  }, {
38
45
  name: "padding",
39
46
  type: "thickness",
40
- service: this
47
+ service: this,
48
+ propertyType: PropertyType.cssValue
41
49
  }, {
42
50
  name: "margin",
43
51
  type: "thickness",
44
- service: this
52
+ service: this,
53
+ propertyType: PropertyType.cssValue
45
54
  }, {
46
55
  name: "position",
47
56
  type: "list",
48
57
  values: ["static", "relative", "absolute"],
49
- service: this
58
+ service: this,
59
+ propertyType: PropertyType.cssValue
50
60
  }, {
51
61
  name: "left",
52
62
  type: "css-length",
53
- service: this
63
+ service: this,
64
+ propertyType: PropertyType.cssValue
54
65
  }, {
55
66
  name: "top",
56
67
  type: "css-length",
57
- service: this
68
+ service: this,
69
+ propertyType: PropertyType.cssValue
58
70
  }, {
59
71
  name: "right",
60
72
  type: "css-length",
61
- service: this
73
+ service: this,
74
+ propertyType: PropertyType.cssValue
62
75
  }, {
63
76
  name: "bottom",
64
77
  type: "css-length",
65
- service: this
78
+ service: this,
79
+ propertyType: PropertyType.cssValue
66
80
  }, {
67
81
  name: "width",
68
82
  type: "css-length",
69
- service: this
83
+ service: this,
84
+ propertyType: PropertyType.cssValue
70
85
  }, {
71
86
  name: "height",
72
87
  type: "css-length",
73
- service: this
88
+ service: this,
89
+ propertyType: PropertyType.cssValue
74
90
  }, {
75
91
  name: "font-size",
76
92
  type: "css-length",
77
- service: this
93
+ service: this,
94
+ propertyType: PropertyType.cssValue
78
95
  }, {
79
96
  name: "font-weight",
80
97
  type: "list",
81
98
  values: ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900", "lighter", "bolder"],
82
- service: this
99
+ service: this,
100
+ propertyType: PropertyType.cssValue
83
101
  }
84
102
  ];
85
103
  //@ts-ignore
@@ -88,24 +106,29 @@ export class CssPropertiesService {
88
106
  name: "display",
89
107
  type: "list",
90
108
  values: ["block", "inline-block", "flex", "contents", "grid", "inherit", "initial", "none"],
91
- service: this
109
+ service: this,
110
+ propertyType: PropertyType.cssValue
92
111
  }, {
93
112
  name: "position",
94
113
  type: "list",
95
114
  values: ["static", "relative", "absolute"],
96
- service: this
115
+ service: this,
116
+ propertyType: PropertyType.cssValue
97
117
  }, {
98
118
  name: "inset",
99
119
  type: "thickness",
100
- service: this
120
+ service: this,
121
+ propertyType: PropertyType.cssValue
101
122
  }, {
102
123
  name: "margin",
103
124
  type: "thickness",
104
- service: this
125
+ service: this,
126
+ propertyType: PropertyType.cssValue
105
127
  }, {
106
128
  name: "padding",
107
129
  type: "thickness",
108
- service: this
130
+ service: this,
131
+ propertyType: PropertyType.cssValue
109
132
  }
110
133
  ];
111
134
  //@ts-ignore
@@ -114,48 +137,58 @@ export class CssPropertiesService {
114
137
  name: "display",
115
138
  type: "list",
116
139
  values: ["block", "inline-block", "flex", "contents", "grid", "inherit", "initial", "none"],
117
- service: this
140
+ service: this,
141
+ propertyType: PropertyType.cssValue
118
142
  }, {
119
143
  name: "position",
120
144
  type: "list",
121
145
  values: ["static", "relative", "absolute"],
122
- service: this
146
+ service: this,
147
+ propertyType: PropertyType.cssValue
123
148
  }, {
124
149
  name: "grid-template-columns",
125
150
  type: "string",
126
- service: this
151
+ service: this,
152
+ propertyType: PropertyType.cssValue
127
153
  }, {
128
154
  name: "grid-template-rows",
129
155
  type: "string",
130
- service: this
156
+ service: this,
157
+ propertyType: PropertyType.cssValue
131
158
  }, {
132
159
  name: "column-gap",
133
160
  type: "css-length",
134
- service: this
161
+ service: this,
162
+ propertyType: PropertyType.cssValue
135
163
  }, {
136
164
  name: "row-gap",
137
165
  type: "css-length",
138
- service: this
166
+ service: this,
167
+ propertyType: PropertyType.cssValue
139
168
  }, {
140
169
  name: "align-content",
141
170
  type: "img-list",
142
171
  values: ["center", "space-between", "space-around", "space-evenly", "stretch"],
143
- service: this
172
+ service: this,
173
+ propertyType: PropertyType.cssValue
144
174
  }, {
145
175
  name: "justify-content",
146
176
  type: "img-list",
147
177
  values: ["center", "start", "end", "space-between", "space-around", "space-evenly"],
148
- service: this
178
+ service: this,
179
+ propertyType: PropertyType.cssValue
149
180
  }, {
150
181
  name: "align-items",
151
182
  type: "img-list",
152
183
  values: ["center", "start", "end", "stretch", "baseline"],
153
- service: this
184
+ service: this,
185
+ propertyType: PropertyType.cssValue
154
186
  }, {
155
187
  name: "justify-items",
156
188
  type: "img-list",
157
189
  values: ["center", "start", "end", "stretch"],
158
- service: this
190
+ service: this,
191
+ propertyType: PropertyType.cssValue
159
192
  }
160
193
  ];
161
194
  //@ts-ignore
@@ -164,37 +197,44 @@ export class CssPropertiesService {
164
197
  name: "display",
165
198
  type: "list",
166
199
  values: ["block", "inline-block", "flex", "contents", "grid", "inherit", "initial", "none"],
167
- service: this
200
+ service: this,
201
+ propertyType: PropertyType.cssValue
168
202
  }, {
169
203
  name: "position",
170
204
  type: "list",
171
205
  values: ["static", "relative", "absolute"],
172
- service: this
206
+ service: this,
207
+ propertyType: PropertyType.cssValue
173
208
  }, {
174
209
  name: "flex-direction",
175
210
  type: "img-list",
176
211
  values: ["row", "column"],
177
- service: this
212
+ service: this,
213
+ propertyType: PropertyType.cssValue
178
214
  }, {
179
215
  name: "flex-wrap",
180
216
  type: "img-list",
181
217
  values: ["nowrap", "wrap"],
182
- service: this
218
+ service: this,
219
+ propertyType: PropertyType.cssValue
183
220
  }, {
184
221
  name: "align-content",
185
222
  type: "img-list",
186
223
  values: ["center", "flex-start", "flex-end", "space-between", "space-around", "stretch"],
187
- service: this
224
+ service: this,
225
+ propertyType: PropertyType.cssValue
188
226
  }, {
189
227
  name: "justify-content",
190
228
  type: "img-list",
191
229
  values: ["center", "flex-start", "flex-end", "space-between", "space-around", "space-evenly"],
192
- service: this
230
+ service: this,
231
+ propertyType: PropertyType.cssValue
193
232
  }, {
194
233
  name: "align-items",
195
234
  type: "img-list",
196
235
  values: ["center", "flex-start", "flex-end", "stretch", "baseline"],
197
- service: this
236
+ service: this,
237
+ propertyType: PropertyType.cssValue
198
238
  }
199
239
  ];
200
240
  name;
@@ -206,7 +246,7 @@ export class CssPropertiesService {
206
246
  }
207
247
  getProperty(designItem, name) {
208
248
  if (this.name == 'set-styles') {
209
- return { name: name, type: 'string', service: this };
249
+ return { name: name, type: 'string', service: this, propertyType: PropertyType.cssValue };
210
250
  }
211
251
  return this[this.name][name];
212
252
  }
@@ -214,7 +254,7 @@ export class CssPropertiesService {
214
254
  if (this.name == 'set-styles') {
215
255
  if (!designItem)
216
256
  return [];
217
- return Array.from(designItem.styles.keys(), x => ({ name: x, type: 'string', service: this }));
257
+ return Array.from(designItem.styles.keys(), x => ({ name: x, type: 'string', service: this, propertyType: PropertyType.cssValue }));
218
258
  }
219
259
  return this[this.name];
220
260
  }
@@ -1,5 +1,8 @@
1
+ import { PropertyType } from "../PropertyType";
1
2
  export interface IJsonPropertyDefinition {
2
3
  name: string;
4
+ propertyName?: string;
5
+ attributeName?: string;
3
6
  description?: string;
4
7
  type?: string;
5
8
  default?: any;
@@ -10,4 +13,5 @@ export interface IJsonPropertyDefinition {
10
13
  enumValues?: [name: string, value: string | number][];
11
14
  value?: any;
12
15
  defaultValue?: any;
16
+ propertyType?: PropertyType.cssValue;
13
17
  }
@@ -1,4 +1,5 @@
1
1
  import { UnkownElementPropertiesService } from './UnkownElementPropertiesService';
2
+ import { PropertyType } from '../PropertyType';
2
3
  export class ListPropertiesService extends UnkownElementPropertiesService {
3
4
  name = "list";
4
5
  _propertys = new Map();
@@ -11,6 +12,8 @@ export class ListPropertiesService extends UnkownElementPropertiesService {
11
12
  let pdef = propertyDefinitions[e][p];
12
13
  parr.push({
13
14
  name: pdef.name,
15
+ propertyName: pdef.propertyName,
16
+ attributeName: pdef.attributeName,
14
17
  description: pdef.description,
15
18
  type: pdef.type,
16
19
  default: pdef.default,
@@ -21,7 +24,8 @@ export class ListPropertiesService extends UnkownElementPropertiesService {
21
24
  enumValues: pdef.enumValues,
22
25
  value: pdef.value,
23
26
  defaultValue: pdef.defaultValue,
24
- service: this
27
+ service: this,
28
+ propertyType: pdef.propertyType ?? PropertyType.propertyAndAttribute
25
29
  });
26
30
  }
27
31
  }
@@ -1,5 +1,6 @@
1
1
  import { AbstractBasePropertiesService } from "./AbstractBasePropertiesService";
2
2
  import { PropertiesHelper } from './PropertiesHelper';
3
+ import { PropertyType } from '../PropertyType';
3
4
  export class Lit2PropertiesService extends AbstractBasePropertiesService {
4
5
  name = "lit2";
5
6
  isHandledElement(designItem) {
@@ -19,27 +20,27 @@ export class Lit2PropertiesService extends AbstractBasePropertiesService {
19
20
  if (litProperty.type)
20
21
  type = litProperty.type;
21
22
  if (type === String) {
22
- let property = { name: name, type: "string", service: this };
23
+ let property = { name: name, type: "string", service: this, propertyType: PropertyType.propertyAndAttribute };
23
24
  properties.push(property);
24
25
  }
25
26
  else if (type === Object) {
26
- let property = { name: name, type: "string", service: this };
27
+ let property = { name: name, type: "string", service: this, propertyType: PropertyType.propertyAndAttribute };
27
28
  properties.push(property);
28
29
  }
29
30
  else if (type === Number) {
30
- let property = { name: name, type: "number", service: this };
31
+ let property = { name: name, type: "number", service: this, propertyType: PropertyType.propertyAndAttribute };
31
32
  properties.push(property);
32
33
  }
33
34
  else if (type === Date) {
34
- let property = { name: name, type: "date", service: this };
35
+ let property = { name: name, type: "date", service: this, propertyType: PropertyType.propertyAndAttribute };
35
36
  properties.push(property);
36
37
  }
37
38
  else if (type === Boolean) {
38
- let property = { name: name, type: "boolean", service: this };
39
+ let property = { name: name, type: "boolean", service: this, propertyType: PropertyType.propertyAndAttribute };
39
40
  properties.push(property);
40
41
  }
41
42
  else if (PropertiesHelper.isTypescriptEnum(type)) {
42
- let property = { name: name, type: "enum", enumValues: PropertiesHelper.getTypescriptEnumEntries(type), service: this };
43
+ let property = { name: name, type: "enum", enumValues: PropertiesHelper.getTypescriptEnumEntries(type), service: this, propertyType: PropertyType.propertyAndAttribute };
43
44
  properties.push(property);
44
45
  }
45
46
  }
@@ -1,4 +1,5 @@
1
1
  import { CommonPropertiesService } from "./CommonPropertiesService";
2
+ import { PropertyType } from '../PropertyType';
2
3
  export class NativeElementsPropertiesService extends CommonPropertiesService {
3
4
  //@ts-ignore
4
5
  inputProperties = [
@@ -7,23 +8,28 @@ export class NativeElementsPropertiesService extends CommonPropertiesService {
7
8
  type: "list",
8
9
  values: ["text", "number", "button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "password", "radio", "range", "reset", "search", "submit", "tel", "time", "url", "week"],
9
10
  service: this,
10
- defaultValue: "text"
11
+ defaultValue: "text",
12
+ propertyType: PropertyType.propertyAndAttribute
11
13
  }, {
12
14
  name: "value",
13
15
  type: "string",
14
- service: this
16
+ service: this,
17
+ propertyType: PropertyType.propertyAndAttribute
15
18
  }, {
16
19
  name: "checked",
17
20
  type: "boolean",
18
- service: this
21
+ service: this,
22
+ propertyType: PropertyType.propertyAndAttribute
19
23
  }, {
20
24
  name: "min",
21
25
  type: "number",
22
- service: this
26
+ service: this,
27
+ propertyType: PropertyType.propertyAndAttribute
23
28
  }, {
24
29
  name: "max",
25
30
  type: "number",
26
- service: this
31
+ service: this,
32
+ propertyType: PropertyType.propertyAndAttribute
27
33
  }
28
34
  ];
29
35
  buttonProperties = [
@@ -32,43 +38,50 @@ export class NativeElementsPropertiesService extends CommonPropertiesService {
32
38
  type: "list",
33
39
  values: ["button", "submit", "reset"],
34
40
  service: this,
35
- defaultValue: "button"
41
+ defaultValue: "button",
42
+ propertyType: PropertyType.propertyAndAttribute
36
43
  }, {
37
44
  name: "value",
38
45
  type: "string",
39
- service: this
46
+ service: this,
47
+ propertyType: PropertyType.propertyAndAttribute
40
48
  }, {
41
49
  name: "disabled",
42
50
  type: "boolean",
43
- service: this
51
+ service: this,
52
+ propertyType: PropertyType.propertyAndAttribute
44
53
  }
45
54
  ];
46
55
  anchorProperties = [
47
56
  {
48
57
  name: "href",
49
58
  type: "string",
50
- service: this
59
+ service: this,
60
+ propertyType: PropertyType.propertyAndAttribute
51
61
  }
52
62
  ];
53
63
  divProperties = [
54
64
  {
55
65
  name: "title",
56
66
  type: "string",
57
- service: this
67
+ service: this,
68
+ propertyType: PropertyType.propertyAndAttribute
58
69
  }
59
70
  ];
60
71
  imgProperties = [
61
72
  {
62
73
  name: "src",
63
74
  type: "string",
64
- service: this
75
+ service: this,
76
+ propertyType: PropertyType.propertyAndAttribute
65
77
  }
66
78
  ];
67
79
  iframeProperties = [
68
80
  {
69
81
  name: "src",
70
82
  type: "string",
71
- service: this
83
+ service: this,
84
+ propertyType: PropertyType.propertyAndAttribute
72
85
  }
73
86
  ];
74
87
  name = "native";
@@ -3,8 +3,7 @@ import { IProperty } from '../IProperty';
3
3
  import { IDesignItem } from '../../../item/IDesignItem';
4
4
  import { ValueType } from "../ValueType";
5
5
  import { BindingTarget } from "../../../item/BindingTarget";
6
- export declare class UnkownElementPropertiesService implements IPropertiesService {
7
- readonly name: string;
6
+ export declare abstract class UnkownElementPropertiesService implements IPropertiesService {
8
7
  isHandledElement(designItem: IDesignItem): boolean;
9
8
  protected _notifyChangedProperty(designItem: IDesignItem, property: IProperty, value: any): void;
10
9
  getProperty(designItem: IDesignItem, name: string): IProperty;
@@ -1,8 +1,8 @@
1
1
  import { ValueType } from "../ValueType";
2
2
  import { PropertiesHelper } from './PropertiesHelper';
3
3
  import { BindingTarget } from "../../../item/BindingTarget";
4
+ //@ts-ignore
4
5
  export class UnkownElementPropertiesService {
5
- name = "unkown";
6
6
  isHandledElement(designItem) {
7
7
  return true;
8
8
  }
@@ -0,0 +1,26 @@
1
+ import { IDesignItem } from "../../..";
2
+ import { BindingTarget } from "../../item/BindingTarget";
3
+ import { IElementDefinition } from "../elementsService/IElementDefinition";
4
+ import { IElementsService } from "../elementsService/IElementsService";
5
+ import { IPropertiesService } from "../propertiesService/IPropertiesService";
6
+ import { IProperty } from "../propertiesService/IProperty";
7
+ import { ValueType } from "../propertiesService/ValueType";
8
+ export declare class WebcomponentManifestParserService implements IElementsService, IPropertiesService {
9
+ private _name;
10
+ get name(): string;
11
+ private _packageData;
12
+ private _elementList;
13
+ private _resolveStored;
14
+ private _rejectStored;
15
+ constructor(name: string, file: string);
16
+ getElements(): Promise<IElementDefinition[]>;
17
+ isHandledElement(designItem: IDesignItem): boolean;
18
+ getProperties(designItem: IDesignItem): IProperty[];
19
+ getProperty(designItem: IDesignItem, name: string): IProperty;
20
+ getPropertyTarget(designItem: IDesignItem, property: IProperty): BindingTarget;
21
+ setValue(designItems: IDesignItem[], property: IProperty, value: any): void;
22
+ clearValue(designItems: IDesignItem[], property: IProperty): void;
23
+ isSet(designItems: IDesignItem[], property: IProperty): ValueType;
24
+ getValue(designItems: IDesignItem[], property: IProperty): void;
25
+ getUnsetValue(designItems: IDesignItem[], property: IProperty): void;
26
+ }
@@ -0,0 +1,69 @@
1
+ export class WebcomponentManifestParserService {
2
+ _name;
3
+ get name() { return this._name; }
4
+ _packageData;
5
+ _elementList;
6
+ _resolveStored;
7
+ _rejectStored;
8
+ constructor(name, file) {
9
+ this._name = name;
10
+ import(file, { assert: { type: 'json' } }).then(module => {
11
+ this._packageData = module.default;
12
+ this._elementList = [];
13
+ for (let m of this._packageData.modules) {
14
+ for (let e of m.exports) {
15
+ if (e.kind == 'custom-element-definition') {
16
+ this._elementList.push({ tag: e.name });
17
+ }
18
+ }
19
+ if (this._resolveStored) {
20
+ this._resolveStored.forEach(x => x(this._elementList));
21
+ this._resolveStored = null;
22
+ this._rejectStored = null;
23
+ }
24
+ }
25
+ }).catch(err => {
26
+ if (this._rejectStored) {
27
+ this._rejectStored.forEach(x => x(err));
28
+ this._resolveStored = null;
29
+ this._rejectStored = null;
30
+ }
31
+ });
32
+ }
33
+ async getElements() {
34
+ if (this._packageData)
35
+ return Promise.resolve(this._elementList);
36
+ if (!this._resolveStored) {
37
+ this._resolveStored = [];
38
+ this._rejectStored = [];
39
+ }
40
+ return new Promise((resolve, reject) => { this._resolveStored.push(resolve); this._rejectStored.push(reject); });
41
+ }
42
+ isHandledElement(designItem) {
43
+ throw new Error("Method not implemented.");
44
+ }
45
+ getProperties(designItem) {
46
+ throw new Error("Method not implemented.");
47
+ }
48
+ getProperty(designItem, name) {
49
+ throw new Error("Method not implemented.");
50
+ }
51
+ getPropertyTarget(designItem, property) {
52
+ throw new Error("Method not implemented.");
53
+ }
54
+ setValue(designItems, property, value) {
55
+ throw new Error("Method not implemented.");
56
+ }
57
+ clearValue(designItems, property) {
58
+ throw new Error("Method not implemented.");
59
+ }
60
+ isSet(designItems, property) {
61
+ throw new Error("Method not implemented.");
62
+ }
63
+ getValue(designItems, property) {
64
+ throw new Error("Method not implemented.");
65
+ }
66
+ getUnsetValue(designItems, property) {
67
+ throw new Error("Method not implemented.");
68
+ }
69
+ }
@@ -1,5 +1,5 @@
1
1
  import { InstanceServiceContainer } from '../../services/InstanceServiceContainer';
2
2
  import { ServiceContainer } from '../../services/ServiceContainer';
3
3
  export interface IDemoView {
4
- display(serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, code: string): any;
4
+ display(serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, code: string, style: string): any;
5
5
  }
@@ -7,5 +7,5 @@ export declare class DemoView extends BaseCustomWebComponentLazyAppend implement
7
7
  private _loading;
8
8
  static readonly style: CSSStyleSheet;
9
9
  constructor();
10
- display(serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, code: string): Promise<void>;
10
+ display(serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, code: string, style: string): Promise<void>;
11
11
  }
@@ -29,9 +29,9 @@ export class DemoView extends BaseCustomWebComponentLazyAppend {
29
29
  this._loading.textContent = '🛀 Hold on, loading...';
30
30
  this.shadowRoot.appendChild(this._loading);
31
31
  }
32
- async display(serviceContainer, instanceServiceContainer, code) {
32
+ async display(serviceContainer, instanceServiceContainer, code, style) {
33
33
  this._loading.hidden = false;
34
- await serviceContainer.demoProviderService.provideDemo(this._placeholder, serviceContainer, instanceServiceContainer, code);
34
+ await serviceContainer.demoProviderService.provideDemo(this._placeholder, serviceContainer, instanceServiceContainer, code, style);
35
35
  this._loading.hidden = true;
36
36
  }
37
37
  }
@@ -19,7 +19,6 @@ export class DomConverter {
19
19
  tag === 'col' ||
20
20
  tag === 'embed' ||
21
21
  tag === 'hr' ||
22
- tag === 'iframe' ||
23
22
  tag === 'img' ||
24
23
  tag === 'input' ||
25
24
  tag === 'keygen' ||
@@ -33,12 +32,7 @@ export class DomConverter {
33
32
  static ConvertToString(designItems, designItemsAssignmentList) {
34
33
  let itw = new IndentedTextWriter();
35
34
  let options = { beautifyOutput: true, writeDesignerProperties: true, compressCssToShorthandProperties: true };
36
- for (let d of designItems) {
37
- d.serviceContainer.forSomeServicesTillResult('htmlWriterService', (s) => {
38
- if (s.canWrite(d))
39
- s.write(itw, d, options, designItemsAssignmentList);
40
- });
41
- }
35
+ designItems[0].serviceContainer.htmlWriterService.write(itw, designItems, true, options, designItemsAssignmentList);
42
36
  return itw.getString();
43
37
  }
44
38
  }
@@ -73,6 +73,12 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
73
73
  position: relative;
74
74
  transform: translateZ(0);
75
75
  overflow: hidden;
76
+
77
+ font-family: initial;
78
+ font-size: initial;
79
+ font-weight: initial;
80
+ font-style: initial;
81
+ line-height: initial;
76
82
  }
77
83
  * {
78
84
  touch-action: none;