@node-projects/web-component-designer 0.0.292 → 0.1.1

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 (87) hide show
  1. package/README.md +1 -30
  2. package/dist/elements/helper/NpmPackageLoader.d.ts +1 -2
  3. package/dist/elements/{loader → services/manifestParsers}/OldCustomElementsManifestLoader.d.ts +1 -1
  4. package/dist/elements/{loader → services/manifestParsers}/OldCustomElementsManifestLoader.js +2 -2
  5. package/dist/index.d.ts +4 -17
  6. package/dist/index.js +2 -16
  7. package/package.json +3 -25
  8. package/.editorconfig +0 -7
  9. package/.github/FUNDING.yml +0 -4
  10. package/.vscode/settings.json +0 -3
  11. package/ACKNOWLEDGMENTS +0 -15
  12. package/LICENSE +0 -21
  13. package/RemoveOldRemoteBranches.bat +0 -7
  14. package/dist/elements/services/demoProviderService/DemoProviderService.d.ts +0 -6
  15. package/dist/elements/services/demoProviderService/DemoProviderService.js +0 -38
  16. package/dist/elements/services/demoProviderService/IframeDemoProviderService copy.d.ts +0 -6
  17. package/dist/elements/services/demoProviderService/IframeDemoProviderService copy.js +0 -38
  18. package/dist/elements/services/designerAddons/IDesignerAddonJson copy.d.ts +0 -3
  19. package/dist/elements/services/designerAddons/IDesignerAddonJson copy.js +0 -1
  20. package/dist/elements/services/designerAddons/IDesignerInfoJson.d.ts +0 -7
  21. package/dist/elements/services/designerAddons/IDesignerInfoJson.js +0 -19
  22. package/dist/elements/services/dragDropService/IExternalDragDropService copy.d.ts +0 -5
  23. package/dist/elements/services/dragDropService/IExternalDragDropService copy.js +0 -1
  24. package/dist/elements/services/eventsService/IEventsService copy.d.ts +0 -2
  25. package/dist/elements/services/eventsService/IEventsService copy.js +0 -1
  26. package/dist/elements/services/htmlParserService/BaseCustomWebcomponentParserService.d.ts +0 -11
  27. package/dist/elements/services/htmlParserService/BaseCustomWebcomponentParserService.js +0 -90
  28. package/dist/elements/services/htmlParserService/LitElementParserService.d.ts +0 -12
  29. package/dist/elements/services/htmlParserService/LitElementParserService.js +0 -91
  30. package/dist/elements/services/htmlParserService/NodeHtmlParserService.d.ts +0 -11
  31. package/dist/elements/services/htmlParserService/NodeHtmlParserService.js +0 -89
  32. package/dist/elements/services/htmlParserService/VueParserService.d.ts +0 -9
  33. package/dist/elements/services/htmlParserService/VueParserService.js +0 -10
  34. package/dist/elements/services/htmlWriterService/HtmlWriterOptions.d.ts +0 -7
  35. package/dist/elements/services/htmlWriterService/HtmlWriterOptions.js +0 -7
  36. package/dist/elements/services/propertiesService/propertyEditors/GridAssignedRowColumnPropertyEditor.d.ts +0 -8
  37. package/dist/elements/services/propertiesService/propertyEditors/GridAssignedRowColumnPropertyEditor.js +0 -45
  38. package/dist/elements/services/propertiesService/propertyEditors/GridRowColumnPropertyEditor.d.ts +0 -10
  39. package/dist/elements/services/propertiesService/propertyEditors/GridRowColumnPropertyEditor.js +0 -25
  40. package/dist/elements/services/propertiesService/propertyEditors/JsonPropertyEditor copy.d.ts +0 -9
  41. package/dist/elements/services/propertiesService/propertyEditors/JsonPropertyEditor copy.js +0 -21
  42. package/dist/elements/services/propertiesService/propertyEditors/MetricsPropertyEditor.d.ts +0 -8
  43. package/dist/elements/services/propertiesService/propertyEditors/MetricsPropertyEditor.js +0 -14
  44. package/dist/elements/services/propertiesService/propertyEditors/SelectPropertyEditor copy.d.ts +0 -7
  45. package/dist/elements/services/propertiesService/propertyEditors/SelectPropertyEditor copy.js +0 -28
  46. package/dist/elements/services/propertiesService/services/CommonPropertiesService copy.d.ts +0 -13
  47. package/dist/elements/services/propertiesService/services/CommonPropertiesService copy.js +0 -44
  48. package/dist/elements/services/propertiesService/services/ContentPropertiesService.d.ts +0 -14
  49. package/dist/elements/services/propertiesService/services/ContentPropertiesService.js +0 -30
  50. package/dist/elements/services/propertiesService/services/CssCurrentPropertiesService copy.d.ts +0 -34
  51. package/dist/elements/services/propertiesService/services/CssCurrentPropertiesService copy.js +0 -105
  52. package/dist/elements/services/propertiesService/services/PolymerPropertiesService copy.d.ts +0 -8
  53. package/dist/elements/services/propertiesService/services/PolymerPropertiesService copy.js +0 -10
  54. package/dist/elements/services/propertiesService/services/UnkownElemntPropertiesService.d.ts +0 -24
  55. package/dist/elements/services/propertiesService/services/UnkownElemntPropertiesService.js +0 -198
  56. package/dist/elements/services/stylesheetService/CssToolsStylesheetService.d.ts +0 -42
  57. package/dist/elements/services/stylesheetService/CssToolsStylesheetService.js +0 -114
  58. package/dist/elements/services/stylesheetService/CssTreeStylesheetService.d.ts +0 -58
  59. package/dist/elements/services/stylesheetService/CssTreeStylesheetService.js +0 -204
  60. package/dist/elements/services/stylesheetService/SpecificityCalculator.d.ts +0 -7
  61. package/dist/elements/services/stylesheetService/SpecificityCalculator.js +0 -178
  62. package/dist/elements/services/undoService/transactionItems/AttributeChangeAction copy.d.ts +0 -15
  63. package/dist/elements/services/undoService/transactionItems/AttributeChangeAction copy.js +0 -70
  64. package/dist/elements/widgets/bindableObjectsBrowser/bindable-objects-browser.d.ts +0 -14
  65. package/dist/elements/widgets/bindableObjectsBrowser/bindable-objects-browser.js +0 -137
  66. package/dist/elements/widgets/codeView/code-view-ace.d.ts +0 -24
  67. package/dist/elements/widgets/codeView/code-view-ace.js +0 -134
  68. package/dist/elements/widgets/codeView/code-view-code-mirror.d.ts +0 -25
  69. package/dist/elements/widgets/codeView/code-view-code-mirror.js +0 -117
  70. package/dist/elements/widgets/codeView/code-view-monaco.d.ts +0 -37
  71. package/dist/elements/widgets/codeView/code-view-monaco.js +0 -197
  72. package/dist/elements/widgets/designerView/extensions/EditText/EditTextWithStyloExtension.d.ts +0 -23
  73. package/dist/elements/widgets/designerView/extensions/EditText/EditTextWithStyloExtension.js +0 -87
  74. package/dist/elements/widgets/designerView/extensions/EditText/EditTextWithStyloExtensionProvider.d.ts +0 -10
  75. package/dist/elements/widgets/designerView/extensions/EditText/EditTextWithStyloExtensionProvider.js +0 -15
  76. package/dist/elements/widgets/miniatureView/html-2-canvas-miniature-view.d.ts +0 -10
  77. package/dist/elements/widgets/miniatureView/html-2-canvas-miniature-view.js +0 -21
  78. package/dist/elements/widgets/paletteView/paletteTreeView.d.ts +0 -12
  79. package/dist/elements/widgets/paletteView/paletteTreeView.js +0 -141
  80. package/dist/elements/widgets/treeView/treeViewExtended.d.ts +0 -32
  81. package/dist/elements/widgets/treeView/treeViewExtended.js +0 -366
  82. package/fixesimport.js +0 -98
  83. package/jest.config.cjs +0 -7
  84. package/polymer.json +0 -42
  85. package/tsconfig.json +0 -75
  86. /package/dist/elements/{loader → services/manifestParsers}/IOldCustomElementsManifest.d.ts +0 -0
  87. /package/dist/elements/{loader → services/manifestParsers}/IOldCustomElementsManifest.js +0 -0
@@ -1,91 +0,0 @@
1
- import { DesignItem } from '../../item/DesignItem.js';
2
- import { CssAttributeParser } from '../../helper/CssAttributeParser.js';
3
- import { newElementFromString } from '../../helper/ElementHelper.js';
4
- // Alternative Parser, cause when you use the Browser, it instanciates the CusomElements, and some Elemnts remove
5
- // attributes from their DOM, so you loose Data
6
- export class LitElementParserService {
7
- _parserUrl;
8
- _esprimaUrl;
9
- constructor(parserUrl = '../../../../../node-html-parser-esm/dist/index.js', esprimaUrl = '../../../../../esprima-next/dist/esm/esprima.js') {
10
- this._parserUrl = parserUrl;
11
- this._esprimaUrl = esprimaUrl;
12
- }
13
- async parse(module, serviceContainer, instanceServiceContainer, parseSnippet) {
14
- let esprima = await import(this._esprimaUrl);
15
- const parsedModule = esprima.parseModule(module);
16
- const classDecl = parsedModule.body.find(x => x.type == esprima.Syntax.ClassDeclaration);
17
- const renderMethod = classDecl.body.body.find(x => x.type == esprima.Syntax.MethodDefinition && x.key.name == 'render');
18
- const renderMethodStatement = renderMethod.value.body.body[0];
19
- const taggedTemplate = renderMethodStatement.argument;
20
- const templateLiteral = taggedTemplate.quasi;
21
- const html = templateLiteral.quasis.map(x => x.value.raw).join();
22
- //@ts-ignore
23
- let parser = await import(this._parserUrl);
24
- const parsed = parser.parse(html, { comment: true });
25
- let designItems = [];
26
- for (let p of parsed.childNodes) {
27
- let di = this._createDesignItemsRecursive(p, serviceContainer, instanceServiceContainer, null);
28
- if (di != null)
29
- designItems.push(di);
30
- else
31
- console.warn("NodeHtmlParserService - could not parse element", p);
32
- }
33
- return designItems;
34
- }
35
- _parseDiv = document.createElement("div");
36
- _createDesignItemsRecursive(item, serviceContainer, instanceServiceContainer, namespace) {
37
- let designItem = null;
38
- if (item.nodeType == 1) {
39
- let element;
40
- let manualCreatedElement = false;
41
- if (!namespace)
42
- element = newElementFromString('<' + item.rawTagName + ' ' + item.rawAttrs + '></' + item.rawTagName + '>'); // some custom elements only parse attributes during constructor call
43
- if (!element) {
44
- if (namespace)
45
- element = document.createElementNS(namespace, item.rawTagName);
46
- else
47
- element = document.createElement(item.rawTagName);
48
- manualCreatedElement = true;
49
- }
50
- designItem = DesignItem.GetOrCreateDesignItem(element, item, serviceContainer, instanceServiceContainer);
51
- let style = '';
52
- let attr = item.attributes;
53
- for (let a in attr) {
54
- if (a !== 'style') {
55
- designItem._withoutUndoSetAttribute(a, attr[a]);
56
- if (manualCreatedElement) {
57
- element.setAttribute(a, attr[a]);
58
- }
59
- }
60
- else {
61
- style = attr[a];
62
- }
63
- }
64
- if ((element instanceof HTMLElement || element instanceof SVGElement) && style) {
65
- let styleParser = new CssAttributeParser();
66
- styleParser.parse(style);
67
- for (let s of styleParser.entries) {
68
- designItem._withoutUndoSetStyle(s.name, s.value);
69
- if (manualCreatedElement) {
70
- element.style[s.name] = s.value;
71
- }
72
- }
73
- }
74
- element.draggable = false; //even if it should be true, for better designer exp.
75
- for (let c of item.childNodes) {
76
- let di = this._createDesignItemsRecursive(c, serviceContainer, instanceServiceContainer, element instanceof SVGElement ? 'http://www.w3.org/2000/svg' : null);
77
- designItem._insertChildInternal(di);
78
- }
79
- }
80
- else if (item.nodeType == 3) {
81
- this._parseDiv.innerHTML = item.rawText;
82
- let element = this._parseDiv.childNodes[0];
83
- designItem = DesignItem.GetOrCreateDesignItem(element, item, serviceContainer, instanceServiceContainer);
84
- }
85
- else if (item.nodeType == 8) {
86
- let element = document.createComment(item.rawText);
87
- designItem = DesignItem.GetOrCreateDesignItem(element, item, serviceContainer, instanceServiceContainer);
88
- }
89
- return designItem;
90
- }
91
- }
@@ -1,11 +0,0 @@
1
- import { InstanceServiceContainer } from '../InstanceServiceContainer.js';
2
- import { ServiceContainer } from '../ServiceContainer.js';
3
- import { IHtmlParserService } from './IHtmlParserService.js';
4
- import { IDesignItem } from '../../item/IDesignItem.js';
5
- export declare class NodeHtmlParserService implements IHtmlParserService {
6
- private _parserUrl;
7
- constructor(parserUrl?: string);
8
- parse(html: string, serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, parseSnippet: boolean): Promise<IDesignItem[]>;
9
- private _parseDiv;
10
- _createDesignItemsRecursive(item: any, serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, namespace: string, snippet: boolean): IDesignItem;
11
- }
@@ -1,89 +0,0 @@
1
- import { DesignItem } from '../../item/DesignItem.js';
2
- import { CssAttributeParser } from '../../helper/CssAttributeParser.js';
3
- import { newElementFromString } from '../../helper/ElementHelper.js';
4
- // Alternative Parser, cause when you use the Browser, it instanciates the CusomElements, and some Elemnts remove
5
- // attributes from their DOM, so you loose Data
6
- export class NodeHtmlParserService {
7
- _parserUrl;
8
- constructor(parserUrl = '../../../../../node-html-parser-esm/dist/index.js') {
9
- this._parserUrl = parserUrl;
10
- }
11
- async parse(html, serviceContainer, instanceServiceContainer, parseSnippet) {
12
- //@ts-ignore
13
- let parser = await import(this._parserUrl);
14
- const parsed = parser.parse(html, { comment: true });
15
- let designItems = [];
16
- for (let p of parsed.childNodes) {
17
- let di = this._createDesignItemsRecursive(p, serviceContainer, instanceServiceContainer, null, parseSnippet);
18
- if (di != null)
19
- designItems.push(di);
20
- else
21
- console.warn("NodeHtmlParserService - could not parse element", p);
22
- }
23
- return designItems;
24
- }
25
- _parseDiv = document.createElement("div");
26
- _createDesignItemsRecursive(item, serviceContainer, instanceServiceContainer, namespace, snippet) {
27
- let designItem = null;
28
- if (item.nodeType == 1) {
29
- let element;
30
- let manualCreatedElement = false;
31
- if (!namespace)
32
- element = newElementFromString('<' + item.rawTagName + ' ' + item.rawAttrs + '></' + item.rawTagName + '>'); // some custom elements only parse attributes during constructor call
33
- if (!element) {
34
- if (namespace)
35
- element = document.createElementNS(namespace, item.rawTagName);
36
- else
37
- element = document.createElement(item.rawTagName);
38
- manualCreatedElement = true;
39
- }
40
- designItem = DesignItem.GetOrCreateDesignItem(element, item, serviceContainer, instanceServiceContainer);
41
- if (!snippet && instanceServiceContainer.designItemDocumentPositionService)
42
- instanceServiceContainer.designItemDocumentPositionService.setPosition(designItem, { start: item.range[0], length: item.range[1] - item.range[0] });
43
- let style = '';
44
- let attr = item.attributes;
45
- for (let a in attr) {
46
- if (a !== 'style') {
47
- designItem._withoutUndoSetAttribute(a, attr[a]);
48
- if (manualCreatedElement) {
49
- element.setAttribute(a, attr[a]);
50
- }
51
- }
52
- else {
53
- style = attr[a];
54
- }
55
- }
56
- if ((element instanceof HTMLElement || element instanceof SVGElement) && style) {
57
- let styleParser = new CssAttributeParser();
58
- styleParser.parse(style);
59
- for (let s of styleParser.entries) {
60
- designItem._withoutUndoSetStyle(s.name, s.value);
61
- if (manualCreatedElement) {
62
- element.style[s.name] = s.value;
63
- }
64
- }
65
- }
66
- if (!designItem.lockAtDesignTime && element.style)
67
- element.style.pointerEvents = 'auto';
68
- element.draggable = false; //even if it should be true, for better designer exp.
69
- for (let c of item.childNodes) {
70
- let di = this._createDesignItemsRecursive(c, serviceContainer, instanceServiceContainer, element instanceof SVGElement ? 'http://www.w3.org/2000/svg' : null, snippet);
71
- designItem._insertChildInternal(di);
72
- }
73
- }
74
- else if (item.nodeType == 3) {
75
- this._parseDiv.innerHTML = item.rawText;
76
- let element = this._parseDiv.childNodes[0];
77
- designItem = DesignItem.GetOrCreateDesignItem(element, item, serviceContainer, instanceServiceContainer);
78
- if (!snippet && instanceServiceContainer.designItemDocumentPositionService)
79
- instanceServiceContainer.designItemDocumentPositionService.setPosition(designItem, { start: item.range[0], length: item.range[1] - item.range[0] });
80
- }
81
- else if (item.nodeType == 8) {
82
- let element = document.createComment(item.rawText);
83
- designItem = DesignItem.GetOrCreateDesignItem(element, item, serviceContainer, instanceServiceContainer);
84
- if (!snippet && instanceServiceContainer.designItemDocumentPositionService)
85
- instanceServiceContainer.designItemDocumentPositionService.setPosition(designItem, { start: item.range[0], length: item.range[1] - item.range[0] });
86
- }
87
- return designItem;
88
- }
89
- }
@@ -1,9 +0,0 @@
1
- import { InstanceServiceContainer } from '../InstanceServiceContainer.js';
2
- import { ServiceContainer } from '../ServiceContainer.js';
3
- import { IHtmlParserService } from './IHtmlParserService.js';
4
- import { IDesignItem } from '../../item/IDesignItem.js';
5
- export declare class VueParserService implements IHtmlParserService {
6
- private htmlParser;
7
- constructor(htmlParser: IHtmlParserService);
8
- parse(code: string, serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, parseSnippet: boolean): Promise<IDesignItem[]>;
9
- }
@@ -1,10 +0,0 @@
1
- export class VueParserService {
2
- htmlParser;
3
- constructor(htmlParser) {
4
- this.htmlParser = htmlParser;
5
- }
6
- async parse(code, serviceContainer, instanceServiceContainer, parseSnippet) {
7
- const parsed = await this.htmlParser.parse(code, serviceContainer, instanceServiceContainer, parseSnippet);
8
- return [parsed.find(x => x.name == 'template')];
9
- }
10
- }
@@ -1,7 +0,0 @@
1
- export declare class HtmlWriterOptions {
2
- beautifyOutput: boolean;
3
- compressCssToShorthandProperties: boolean;
4
- writeDesignerProperties: boolean;
5
- parseJsonInAttributes: boolean;
6
- jsonWriteMode: 'min' | 'beauty';
7
- }
@@ -1,7 +0,0 @@
1
- export class HtmlWriterOptions {
2
- beautifyOutput = true;
3
- compressCssToShorthandProperties = true;
4
- writeDesignerProperties = true;
5
- parseJsonInAttributes = true;
6
- jsonWriteMode = 'min';
7
- }
@@ -1,8 +0,0 @@
1
- import { IProperty } from '../IProperty.js';
2
- import { BasePropertyEditor } from './BasePropertyEditor.js';
3
- import { ValueType } from '../ValueType.js';
4
- export declare class GridAssignedRowColumnPropertyEditor extends BasePropertyEditor<HTMLDivElement> {
5
- _root: HTMLDivElement;
6
- constructor(property: IProperty);
7
- refreshValue(valueType: ValueType, value: any): void;
8
- }
@@ -1,45 +0,0 @@
1
- import { BasePropertyEditor } from './BasePropertyEditor.js';
2
- export class GridAssignedRowColumnPropertyEditor extends BasePropertyEditor {
3
- _root;
4
- constructor(property) {
5
- super(property);
6
- this._root = document.createElement('div');
7
- this._root.style.display = 'grid';
8
- this._root.style.padding = '4px 0px';
9
- this._root.style.boxSizing = 'border-box';
10
- this._root.style.minHeight = '50px';
11
- this.element = this._root;
12
- }
13
- refreshValue(valueType, value) {
14
- this._root.innerHTML = "";
15
- if (this.designItems != null && this.designItems.length) {
16
- let styleContainer = getComputedStyle(this.designItems[0].element.parentElement);
17
- let style = getComputedStyle(this.designItems[0].element);
18
- let cntCol = styleContainer.gridTemplateColumns.split(' ').length;
19
- let cntRow = styleContainer.gridTemplateRows.split(' ').length;
20
- this._root.style.gridTemplateColumns = 'repeat(' + cntCol + ', 1fr)';
21
- this._root.style.gridTemplateRows = 'repeat(' + cntRow + ', 1fr)';
22
- let rowStart = parseInt(style.gridRowStart);
23
- let rowEnd = style.gridRowEnd == 'auto' ? rowStart : parseInt(style.gridRowEnd);
24
- rowEnd = rowEnd <= rowStart ? rowStart + 1 : rowEnd;
25
- let colStart = parseInt(style.gridColumnStart);
26
- let colEnd = style.gridColumnEnd == 'auto' ? colStart : parseInt(style.gridColumnEnd);
27
- colEnd = colEnd <= colStart ? colStart + 1 : colEnd;
28
- for (let p = 1; p <= cntRow; p++) {
29
- for (let n = 1; n <= cntCol; n++) {
30
- const b = document.createElement('button');
31
- b.style.minHeight = '10px';
32
- b.onclick = () => {
33
- let grp = this.designItems[0].openGroup('Change grid row/column');
34
- this.designItems[0].setStyle("grid-row", p + ' / ' + (p + 1));
35
- this.designItems[0].setStyle("grid-column", n + ' / ' + (n + 1));
36
- grp.commit();
37
- };
38
- if (p >= rowStart && p < rowEnd && n >= colStart && n < colEnd)
39
- b.style.backgroundColor = 'coral';
40
- this._root.appendChild(b);
41
- }
42
- }
43
- }
44
- }
45
- }
@@ -1,10 +0,0 @@
1
- import { IProperty } from '../IProperty.js';
2
- import { BasePropertyEditor } from './BasePropertyEditor.js';
3
- import { ValueType } from '../ValueType.js';
4
- import { IDesignItem } from '../../../item/IDesignItem.js';
5
- export declare class GridRowColumnPropertyEditor extends BasePropertyEditor<HTMLDivElement> {
6
- _root: HTMLDivElement;
7
- constructor(property: IProperty);
8
- refreshValue(valueType: ValueType, value: any): void;
9
- designItemsChanged(designItems: IDesignItem[]): void;
10
- }
@@ -1,25 +0,0 @@
1
- import { BasePropertyEditor } from './BasePropertyEditor.js';
2
- export class GridRowColumnPropertyEditor extends BasePropertyEditor {
3
- _root;
4
- constructor(property) {
5
- super(property);
6
- this._root = document.createElement('div');
7
- this.element = this._root;
8
- }
9
- refreshValue(valueType, value) {
10
- }
11
- designItemsChanged(designItems) {
12
- super.designItemsChanged(designItems);
13
- this._root.innerHTML == "";
14
- if (this.designItems != null && this.designItems.length) {
15
- let style = getComputedStyle(this.designItems[0].element);
16
- let cntCol = style.gridTemplateColumns.split(' ').length;
17
- let cntRow = style.gridTemplateRows.split(' ').length;
18
- this._root.style.gridTemplateColumns = 'repeat(' + cntCol + ', 1fr)';
19
- this._root.style.gridTemplateRows = 'repeat(' + cntRow + ', 1fr)';
20
- for (let n = 0; n < cntCol * cntRow; n++) {
21
- this._root.appendChild(document.createElement('button'));
22
- }
23
- }
24
- }
25
- }
@@ -1,9 +0,0 @@
1
- import { IProperty } from '../IProperty.js';
2
- import { BasePropertyEditor } from './BasePropertyEditor.js';
3
- import { ValueType } from '../ValueType.js';
4
- export declare class JsonPropertyEditor extends BasePropertyEditor<HTMLDivElement> {
5
- static template: HTMLTemplateElement;
6
- _input: HTMLInputElement;
7
- constructor(property: IProperty);
8
- refreshValue(valueType: ValueType, value: any): void;
9
- }
@@ -1,21 +0,0 @@
1
- import { BasePropertyEditor } from './BasePropertyEditor.js';
2
- import { html } from '@node-projects/base-custom-webcomponent';
3
- export class JsonPropertyEditor extends BasePropertyEditor {
4
- static template = html `
5
- <div style="display: flex;">
6
- <input id="input" type="text">
7
- <button style="width: 30px;">...</button>
8
- </div>
9
- `;
10
- _input;
11
- constructor(property) {
12
- super(property);
13
- let el = JsonPropertyEditor.template.content.cloneNode(true);
14
- this._input = el.getElementById('input');
15
- this._input.onchange = (e) => this._valueChanged(this._input.value);
16
- this.element = el;
17
- }
18
- refreshValue(valueType, value) {
19
- this._input.value = value;
20
- }
21
- }
@@ -1,8 +0,0 @@
1
- import { IProperty } from '../IProperty.js';
2
- import { BasePropertyEditor } from './BasePropertyEditor.js';
3
- import { ValueType } from '../ValueType.js';
4
- import { MetricsEditor } from '../../../controls/MetricsEditor.js';
5
- export declare class MetricsPropertyEditor extends BasePropertyEditor<MetricsEditor> {
6
- constructor(property: IProperty);
7
- refreshValue(valueType: ValueType, value: any): void;
8
- }
@@ -1,14 +0,0 @@
1
- import { BasePropertyEditor } from './BasePropertyEditor.js';
2
- import { MetricsEditor } from '../../../controls/MetricsEditor.js';
3
- export class MetricsPropertyEditor extends BasePropertyEditor {
4
- constructor(property) {
5
- super(property);
6
- const selector = new MetricsEditor();
7
- selector.property = property.name;
8
- //selector.valueLeftChanged.on((e) => this._valueChanged(e.newValue));
9
- this.element = selector;
10
- }
11
- refreshValue(valueType, value) {
12
- //this.element.valueLeft = value;
13
- }
14
- }
@@ -1,7 +0,0 @@
1
- import { IProperty } from '../IProperty.js';
2
- import { BasePropertyEditor } from './BasePropertyEditor.js';
3
- import { ValueType } from '../ValueType.js';
4
- export declare class SelectPropertyEditor extends BasePropertyEditor<HTMLSelectElement> {
5
- constructor(property: IProperty);
6
- refreshValue(valueType: ValueType, value: any): void;
7
- }
@@ -1,28 +0,0 @@
1
- import { BasePropertyEditor } from './BasePropertyEditor.js';
2
- export class SelectPropertyEditor extends BasePropertyEditor {
3
- constructor(property) {
4
- super(property);
5
- let element = document.createElement("select");
6
- if (property.type == 'enum') {
7
- for (let v of property.enumValues) {
8
- let option = document.createElement("option");
9
- option.value = v[1];
10
- option.text = v[0];
11
- element.appendChild(option);
12
- }
13
- }
14
- else {
15
- for (let v of property.values) {
16
- let option = document.createElement("option");
17
- option.value = v;
18
- option.text = v;
19
- element.appendChild(option);
20
- }
21
- }
22
- element.onchange = (e) => this._valueChanged(element.value);
23
- this.element = element;
24
- }
25
- refreshValue(valueType, value) {
26
- this.element.value = value;
27
- }
28
- }
@@ -1,13 +0,0 @@
1
- import { IProperty } from '../IProperty.js';
2
- import { IDesignItem } from '../../../item/IDesignItem.js';
3
- import { AbstractPropertiesService } from './AbstractPropertiesService.js';
4
- import { RefreshMode } from '../IPropertiesService.js';
5
- import { IPropertyGroup } from '../IPropertyGroup.js';
6
- export declare class CommonPropertiesService extends AbstractPropertiesService {
7
- getRefreshMode(designItem: IDesignItem): RefreshMode;
8
- private commonProperties;
9
- name: string;
10
- isHandledElement(designItem: IDesignItem): boolean;
11
- getProperty(designItem: IDesignItem, name: string): IProperty;
12
- getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
13
- }
@@ -1,44 +0,0 @@
1
- import { PropertyType } from '../PropertyType.js';
2
- import { AbstractPropertiesService } from './AbstractPropertiesService.js';
3
- import { RefreshMode } from '../IPropertiesService.js';
4
- export class CommonPropertiesService extends AbstractPropertiesService {
5
- getRefreshMode(designItem) {
6
- return RefreshMode.none;
7
- }
8
- //@ts-ignore
9
- commonProperties = [
10
- {
11
- name: "id",
12
- type: "string",
13
- service: this,
14
- propertyType: PropertyType.propertyAndAttribute
15
- }, {
16
- name: "class",
17
- type: "string",
18
- service: this,
19
- attributeName: "class",
20
- propertyName: "className",
21
- propertyType: PropertyType.propertyAndAttribute
22
- }, {
23
- name: "title",
24
- type: "string",
25
- service: this,
26
- propertyType: PropertyType.propertyAndAttribute
27
- }, {
28
- name: "tabindex",
29
- type: "number",
30
- service: this,
31
- propertyType: PropertyType.propertyAndAttribute
32
- }
33
- ];
34
- name = "common";
35
- isHandledElement(designItem) {
36
- return true;
37
- }
38
- getProperty(designItem, name) {
39
- return this.commonProperties[name];
40
- }
41
- getProperties(designItem) {
42
- return this.commonProperties;
43
- }
44
- }
@@ -1,14 +0,0 @@
1
- import { IProperty } from '../IProperty.js';
2
- import { IDesignItem } from '../../../item/IDesignItem.js';
3
- import { AbstractPropertiesService } from './AbstractPropertiesService.js';
4
- import { RefreshMode } from '../IPropertiesService.js';
5
- import { IPropertyGroup } from '../IPropertyGroup.js';
6
- export declare class ContentAndIdPropertiesService extends AbstractPropertiesService {
7
- getRefreshMode(designItem: IDesignItem): RefreshMode;
8
- contentProperty: IProperty;
9
- private idProperty;
10
- name: string;
11
- isHandledElement(designItem: IDesignItem): boolean;
12
- getProperty(designItem: IDesignItem, name: string): IProperty;
13
- getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
14
- }
@@ -1,30 +0,0 @@
1
- import { PropertyType } from '../PropertyType.js';
2
- import { AbstractPropertiesService } from './AbstractPropertiesService.js';
3
- import { RefreshMode } from '../IPropertiesService.js';
4
- export class ContentAndIdPropertiesService extends AbstractPropertiesService {
5
- getRefreshMode(designItem) {
6
- return RefreshMode.none;
7
- }
8
- contentProperty = {
9
- name: "content",
10
- type: "string",
11
- service: this,
12
- propertyType: PropertyType.complex
13
- };
14
- idProperty = {
15
- name: "content",
16
- type: "string",
17
- service: this,
18
- propertyType: PropertyType.complex
19
- };
20
- name = "content";
21
- isHandledElement(designItem) {
22
- return true;
23
- }
24
- getProperty(designItem, name) {
25
- return name == 'id' ? this.idProperty : this.contentProperty;
26
- }
27
- getProperties(designItem) {
28
- return [this.idProperty, this.contentProperty];
29
- }
30
- }
@@ -1,34 +0,0 @@
1
- import { IProperty } from '../IProperty.js';
2
- import { IDesignItem } from '../../../item/IDesignItem.js';
3
- import { RefreshMode } from '../IPropertiesService.js';
4
- import { IPropertyGroup } from '../IPropertyGroup.js';
5
- import { IStyleDeclaration, IStyleRule } from '../../stylesheetService/IStylesheetService.js';
6
- import { CommonPropertiesService } from './CommonPropertiesService.js';
7
- import { ValueType } from '../ValueType.js';
8
- export declare class CssCurrentPropertiesService extends CommonPropertiesService {
9
- getRefreshMode(designItem: IDesignItem): RefreshMode;
10
- constructor();
11
- isHandledElement(designItem: IDesignItem): boolean;
12
- getProperty(designItem: IDesignItem, name: string): IProperty;
13
- getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
14
- setValue(designItems: IDesignItem[], property: (IProperty & {
15
- styleRule: IStyleRule;
16
- styleDeclaration: IStyleDeclaration;
17
- }), value: any): void;
18
- clearValue(designItems: IDesignItem[], property: IProperty & {
19
- styleRule: IStyleRule;
20
- styleDeclaration: IStyleDeclaration;
21
- }, clearType: 'all' | 'binding' | 'value'): void;
22
- getValue(designItems: IDesignItem[], property: IProperty & {
23
- styleRule: IStyleRule;
24
- styleDeclaration: IStyleDeclaration;
25
- }): string | boolean;
26
- getUnsetValue(designItems: IDesignItem[], property: IProperty & {
27
- styleRule: IStyleRule;
28
- styleDeclaration: IStyleDeclaration;
29
- }): any;
30
- isSet(designItems: IDesignItem[], property: IProperty & {
31
- styleRule: IStyleRule;
32
- styleDeclaration: IStyleDeclaration;
33
- }): ValueType;
34
- }