@node-projects/web-component-designer 0.0.135 → 0.0.137

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 (43) hide show
  1. package/config/elements-native.json +2 -0
  2. package/dist/elements/controls/MetricsEditor.d.ts +14 -0
  3. package/dist/elements/controls/MetricsEditor.js +120 -0
  4. package/dist/elements/controls/ThicknessEditor copy.d.ts +33 -0
  5. package/dist/elements/controls/ThicknessEditor copy.js +145 -0
  6. package/dist/elements/helper/Screenshot.js +2 -1
  7. package/dist/elements/services/DefaultServiceBootstrap.js +4 -0
  8. package/dist/elements/services/ServiceContainer.d.ts +3 -0
  9. package/dist/elements/services/ServiceContainer.js +3 -0
  10. package/dist/elements/services/htmlWriterService/HtmlWriterService.js +1 -1
  11. package/dist/elements/services/propertiesService/DefaultEditorTypesService.js +5 -0
  12. package/dist/elements/services/propertiesService/IPropertiesService.d.ts +1 -0
  13. package/dist/elements/services/propertiesService/IProperty.d.ts +1 -1
  14. package/dist/elements/services/propertiesService/IPropertyGroupsService.d.ts +8 -0
  15. package/dist/elements/services/propertiesService/IPropertyGroupsService.js +1 -0
  16. package/dist/elements/services/propertiesService/PropertyGroupsService.d.ts +11 -0
  17. package/dist/elements/services/propertiesService/PropertyGroupsService.js +28 -0
  18. package/dist/elements/services/propertiesService/PropertyType.d.ts +3 -1
  19. package/dist/elements/services/propertiesService/PropertyType.js +2 -0
  20. package/dist/elements/services/propertiesService/propertyEditors/MetricsEditor.d.ts +0 -0
  21. package/dist/elements/services/propertiesService/propertyEditors/MetricsEditor.js +1 -0
  22. package/dist/elements/services/propertiesService/propertyEditors/MetricsPropertyEditor.d.ts +8 -0
  23. package/dist/elements/services/propertiesService/propertyEditors/MetricsPropertyEditor.js +14 -0
  24. package/dist/elements/services/propertiesService/services/AttributesPropertiesService.d.ts +1 -0
  25. package/dist/elements/services/propertiesService/services/AttributesPropertiesService.js +4 -0
  26. package/dist/elements/services/propertiesService/services/CommonPropertiesService.d.ts +1 -0
  27. package/dist/elements/services/propertiesService/services/CommonPropertiesService.js +3 -0
  28. package/dist/elements/services/propertiesService/services/CssPropertiesService.d.ts +6 -6
  29. package/dist/elements/services/propertiesService/services/CssPropertiesService.js +16 -75
  30. package/dist/elements/services/propertiesService/services/NativeElementsPropertiesService.d.ts +3 -0
  31. package/dist/elements/services/propertiesService/services/NativeElementsPropertiesService.js +79 -8
  32. package/dist/elements/services/propertiesService/services/SVGElementsPropertiesService.d.ts +15 -0
  33. package/dist/elements/services/propertiesService/services/SVGElementsPropertiesService.js +259 -0
  34. package/dist/elements/services/propertiesService/services/UnkownElementPropertiesService.d.ts +1 -0
  35. package/dist/elements/services/propertiesService/services/UnkownElementPropertiesService.js +6 -1
  36. package/dist/elements/widgets/designerView/designerCanvas.js +16 -4
  37. package/dist/elements/widgets/designerView/tools/TextTool.js +3 -1
  38. package/dist/elements/widgets/propertyGrid/PropertyGrid.d.ts +1 -0
  39. package/dist/elements/widgets/propertyGrid/PropertyGrid.js +24 -58
  40. package/dist/elements/widgets/propertyGrid/PropertyGridPropertyList.js +61 -41
  41. package/dist/index.d.ts +15 -0
  42. package/dist/index.js +14 -0
  43. package/package.json +1 -1
@@ -3,6 +3,8 @@
3
3
  [
4
4
  "div",
5
5
  "input",
6
+ "textarea",
7
+ "select",
6
8
  {"tag" : "button", "defaultWidth": "80px", "defaultHeight": "30px", "defaultContent": "Button" },
7
9
  "img",
8
10
  "iframe",
@@ -0,0 +1,14 @@
1
+ import { BaseCustomWebComponentConstructorAppend } from '@node-projects/base-custom-webcomponent';
2
+ export declare type ThicknessEditorValueChangedEventArgs = {
3
+ newValue?: string;
4
+ oldValue?: string;
5
+ };
6
+ export declare class MetricsEditor extends BaseCustomWebComponentConstructorAppend {
7
+ static readonly style: CSSStyleSheet;
8
+ static readonly template: HTMLTemplateElement;
9
+ property: string;
10
+ unsetValue: string;
11
+ _updateValue(): void;
12
+ ready(): void;
13
+ onDoubleClick(event: PointerEvent): void;
14
+ }
@@ -0,0 +1,120 @@
1
+ import { BaseCustomWebComponentConstructorAppend, css, html } from '@node-projects/base-custom-webcomponent';
2
+ export class MetricsEditor extends BaseCustomWebComponentConstructorAppend {
3
+ static style = css `
4
+ :host {
5
+ justify-content: center;
6
+ display: flex;
7
+ margin: 10px;
8
+ line-height: 12px;
9
+ }
10
+
11
+ * {
12
+ font-size: 12px;
13
+ font-family: monospace;
14
+ color: black;
15
+ }
16
+
17
+ .top {
18
+ display: inline-block;
19
+ }
20
+ .left {
21
+ display: inline-block;
22
+ vertical-align: middle;
23
+ }
24
+ .right {
25
+ display: inline-block;
26
+ vertical-align: middle;
27
+ }
28
+ .bottom {
29
+ display: inline-block;
30
+ }
31
+
32
+ div.ct {
33
+ width:280px;height:180px;
34
+ }
35
+
36
+ div span {
37
+ font-size: 10px;
38
+ position: absolute;
39
+ top: 0;
40
+ left: 0;
41
+ }
42
+
43
+ div.ct {
44
+ position: relative;
45
+ background: white;
46
+ display: inline-block;
47
+ border: dotted 1px gray;
48
+ text-align: center;
49
+ vertical-align: middle;
50
+ }
51
+
52
+ div.ct > div.ct {
53
+ left: 0;
54
+ top: 0;
55
+ background: #F9CC9F;
56
+ width: calc(100% - 20px);
57
+ height: calc(100% - 26px);
58
+ border-style: dashed;
59
+ }
60
+
61
+ div.ct > div.ct > div.ct {
62
+ background: #FEDC9B;
63
+ border-style: solid;
64
+ }
65
+
66
+ div.ct > div.ct > div.ct > div.ct {
67
+ background: #C4Cf8C;
68
+ border-style: dashed;
69
+ }
70
+
71
+ div.ct > div.ct > div.ct > div.ct > div.ct {
72
+ background: #8Cb6C2;
73
+ border-style: solid;
74
+ display: inline-flex;
75
+ justify-content: center;
76
+ align-items: center;
77
+ }`;
78
+ static template = html `
79
+ <div class="ct"><span>position</span>
80
+ <div class="top">-</div><br><div class="left">-</div><div class="ct"><span>margin</span>
81
+ <div id="testdiv" [contentEditable]="contentEditable" @dblclick="onDoubleClick" class="top">-</div><br><div class="left">-</div><div class="ct"><span>border</span>
82
+ <div class="top">-</div><br><div class="left">-</div><div class="ct"><span>padding</span>
83
+ <div class="top">-</div><br><div class="left">-</div><div class="ct" style="font-size:6px"><div class="left">-</div>
84
+ x
85
+ <div class="right">-</div>
86
+ </div><div class="right">-</div><br><div class="bottom">-</div></div><div class="right">-</div><br><div class="bottom">-</div></div><div class="right">-</div><br><div class="bottom">-</div></div><div class="right">-</div><br><div class="bottom">-</div></div>
87
+ `;
88
+ property;
89
+ unsetValue;
90
+ //private _root: HTMLDivElement;
91
+ //private _contentEditable: HTMLDivElement;
92
+ _updateValue() {
93
+ }
94
+ ready() {
95
+ //this._root = this._getDomElement<HTMLDivElement>("testdiv");
96
+ this._parseAttributesToProperties();
97
+ this._updateValue();
98
+ this._assignEvents();
99
+ }
100
+ onDoubleClick(event) {
101
+ let element = this._getDomElement("testdiv");
102
+ // contentEditable setzten
103
+ element.setAttribute("contentEditable", "");
104
+ // - rausnehmen
105
+ element.innerHTML = "-";
106
+ // Input auswerten
107
+ //Input in div schreiben
108
+ // contentEditable false setzen mit EnterTaste
109
+ element.onkeydown = (e) => {
110
+ if (e.key == "Enter") {
111
+ let _input = element.innerHTML;
112
+ //let value = document.createElement("input");
113
+ element.style.marginTop = _input;
114
+ element.removeAttribute("contentEditable");
115
+ element.innerHTML = "-";
116
+ }
117
+ };
118
+ }
119
+ }
120
+ customElements.define('node-projects-metrics-editor', MetricsEditor);
@@ -0,0 +1,33 @@
1
+ import { BaseCustomWebComponentConstructorAppend, TypedEvent } from '@node-projects/base-custom-webcomponent';
2
+ export declare type ThicknessEditorValueChangedEventArgs = {
3
+ newValue?: string;
4
+ oldValue?: string;
5
+ };
6
+ export declare class ThicknessEditor extends BaseCustomWebComponentConstructorAppend {
7
+ static readonly style: CSSStyleSheet;
8
+ static readonly template: HTMLTemplateElement;
9
+ private _leftInput;
10
+ private _topInput;
11
+ private _rightInput;
12
+ private _bottomInput;
13
+ private _valueLeft;
14
+ get valueLeft(): string;
15
+ set valueLeft(value: string);
16
+ valueLeftChanged: TypedEvent<ThicknessEditorValueChangedEventArgs>;
17
+ private _valueTop;
18
+ get valueTop(): string;
19
+ set valueTop(value: string);
20
+ valueTopChanged: TypedEvent<ThicknessEditorValueChangedEventArgs>;
21
+ private _valueRight;
22
+ get valueRight(): string;
23
+ set valueRight(value: string);
24
+ valueRightChanged: TypedEvent<ThicknessEditorValueChangedEventArgs>;
25
+ private _valueBottom;
26
+ get valueBottom(): string;
27
+ set valueBottom(value: string);
28
+ valueBottomChanged: TypedEvent<ThicknessEditorValueChangedEventArgs>;
29
+ property: string;
30
+ unsetValue: string;
31
+ _updateValue(): void;
32
+ ready(): void;
33
+ }
@@ -0,0 +1,145 @@
1
+ import { BaseCustomWebComponentConstructorAppend, css, html, TypedEvent } from '@node-projects/base-custom-webcomponent';
2
+ export class ThicknessEditor extends BaseCustomWebComponentConstructorAppend {
3
+ static style = css `
4
+ :host {
5
+ margin: 4px;
6
+ margin-left: auto;
7
+ margin-right: auto;
8
+ }
9
+ #container {
10
+ display: grid;
11
+ grid-template-columns: minmax(30px, 40px) minmax(30px, 60px) minmax(30px, 40px);
12
+ grid-template-rows: auto;
13
+ grid-template-areas:
14
+ " . top ."
15
+ "left middle right"
16
+ " . bottom .";
17
+ column-gap: 2px;
18
+ row-gap: 2px;
19
+ }
20
+ input {
21
+ width: 20px;
22
+ text-align: center;
23
+ font-size: 10px;
24
+ height: 20px;
25
+ padding: 0;
26
+ }
27
+ #left {
28
+ grid-area: left;
29
+ justify-self: end;
30
+ }
31
+ #top {
32
+ grid-area: top;
33
+ align-self: end;
34
+ justify-self: center;
35
+ }
36
+ #right {
37
+ grid-area: right;
38
+ justify-self: start;
39
+ }
40
+ #bottom {
41
+ grid-area: bottom;
42
+ align-self: start;
43
+ justify-self: center;
44
+ }
45
+ #rect {
46
+ grid-area: middle;
47
+ border: 1px solid black;
48
+ background: lightgray;
49
+ }
50
+ `;
51
+ static template = html `
52
+ <div id="container">
53
+ <input id="left">
54
+ <input id="top">
55
+ <input id="right">
56
+ <input id="bottom">
57
+ <div id="rect"></div>
58
+ </div>
59
+ `;
60
+ _leftInput;
61
+ _topInput;
62
+ _rightInput;
63
+ _bottomInput;
64
+ _valueLeft;
65
+ get valueLeft() {
66
+ return this._valueLeft;
67
+ }
68
+ set valueLeft(value) {
69
+ const oldValue = this._valueLeft;
70
+ this._valueLeft = value;
71
+ if (oldValue !== value) {
72
+ this._updateValue();
73
+ this.valueLeftChanged.emit({ newValue: value, oldValue: oldValue });
74
+ }
75
+ }
76
+ valueLeftChanged = new TypedEvent();
77
+ _valueTop;
78
+ get valueTop() {
79
+ return this._valueTop;
80
+ }
81
+ set valueTop(value) {
82
+ const oldValue = this._valueTop;
83
+ this._valueTop = value;
84
+ if (oldValue !== value) {
85
+ this._updateValue();
86
+ this.valueTopChanged.emit({ newValue: value, oldValue: oldValue });
87
+ }
88
+ }
89
+ valueTopChanged = new TypedEvent();
90
+ _valueRight;
91
+ get valueRight() {
92
+ return this._valueRight;
93
+ }
94
+ set valueRight(value) {
95
+ const oldValue = this._valueRight;
96
+ this._valueRight = value;
97
+ if (oldValue !== value) {
98
+ this._updateValue();
99
+ this.valueRightChanged.emit({ newValue: value, oldValue: oldValue });
100
+ }
101
+ }
102
+ valueRightChanged = new TypedEvent();
103
+ _valueBottom;
104
+ get valueBottom() {
105
+ return this._valueBottom;
106
+ }
107
+ set valueBottom(value) {
108
+ const oldValue = this._valueBottom;
109
+ this._valueBottom = value;
110
+ if (oldValue !== value) {
111
+ this._updateValue();
112
+ this.valueBottomChanged.emit({ newValue: value, oldValue: oldValue });
113
+ }
114
+ }
115
+ valueBottomChanged = new TypedEvent();
116
+ property;
117
+ unsetValue;
118
+ _updateValue() {
119
+ this._leftInput.value = this.valueLeft;
120
+ this._topInput.value = this.valueTop;
121
+ this._rightInput.value = this.valueRight;
122
+ this._bottomInput.value = this._valueBottom;
123
+ }
124
+ ready() {
125
+ this._parseAttributesToProperties();
126
+ this._leftInput = this._getDomElement('left');
127
+ this._topInput = this._getDomElement('top');
128
+ this._rightInput = this._getDomElement('right');
129
+ this._bottomInput = this._getDomElement('bottom');
130
+ this._leftInput.onkeyup = (e) => { if (e.key === 'Enter')
131
+ this._valueLeft = this._leftInput.value; };
132
+ this._topInput.onkeyup = (e) => { if (e.key === 'Enter')
133
+ this._valueTop = this._topInput.value; };
134
+ this._rightInput.onkeyup = (e) => { if (e.key === 'Enter')
135
+ this._valueRight = this._rightInput.value; };
136
+ this._bottomInput.onkeyup = (e) => { if (e.key === 'Enter')
137
+ this._valueBottom = this._bottomInput.value; };
138
+ this._leftInput.onblur = (e) => this._valueLeft = this._leftInput.value;
139
+ this._topInput.onblur = (e) => this._valueTop = this._topInput.value;
140
+ this._rightInput.onblur = (e) => this._valueRight = this._rightInput.value;
141
+ this._bottomInput.onblur = (e) => this._valueBottom = this._bottomInput.value;
142
+ this._updateValue();
143
+ }
144
+ }
145
+ customElements.define('node-projects-thickness-editor', ThicknessEditor);
@@ -21,7 +21,8 @@ export class Screenshot {
21
21
  Screenshot._video = document.createElement("video");
22
22
  const gdmOptions = {
23
23
  video: {
24
- cursor: "never"
24
+ cursor: "never",
25
+ displaySurface: 'browser'
25
26
  },
26
27
  audio: false
27
28
  };
@@ -2,6 +2,7 @@ import { ServiceContainer } from './ServiceContainer.js';
2
2
  import { PolymerPropertiesService } from './propertiesService/services/PolymerPropertiesService.js';
3
3
  import { LitElementPropertiesService } from './propertiesService/services/LitElementPropertiesService.js';
4
4
  import { NativeElementsPropertiesService } from './propertiesService/services/NativeElementsPropertiesService.js';
5
+ import { SVGElementsPropertiesService } from './propertiesService/services/SVGElementsPropertiesService.js';
5
6
  import { DefaultInstanceService } from './instanceService/DefaultInstanceService.js';
6
7
  import { DefaultEditorTypesService } from './propertiesService/DefaultEditorTypesService.js';
7
8
  import { BaseCustomWebComponentPropertiesService } from './propertiesService/services/BaseCustomWebComponentPropertiesService.js';
@@ -67,13 +68,16 @@ import { GrayOutDragOverContainerExtensionProvider } from '../widgets/designerVi
67
68
  import { LineExtensionProvider } from '../widgets/designerView/extensions/svg/LineExtensionProvider.js';
68
69
  import { RectExtentionProvider } from '../widgets/designerView/extensions/svg/RectExtensionProvider.js';
69
70
  import { EllipsisExtensionProvider } from '../widgets/designerView/extensions/svg/EllipsisExtensionProvider.js';
71
+ import { PropertyGroupsService } from './propertiesService/PropertyGroupsService.js';
70
72
  export function createDefaultServiceContainer() {
71
73
  let serviceContainer = new ServiceContainer();
72
74
  serviceContainer.register("propertyService", new PolymerPropertiesService());
73
75
  serviceContainer.register("propertyService", new LitElementPropertiesService());
74
76
  serviceContainer.register("propertyService", new NativeElementsPropertiesService());
77
+ serviceContainer.register("propertyService", new SVGElementsPropertiesService());
75
78
  serviceContainer.register("propertyService", new Lit2PropertiesService());
76
79
  serviceContainer.register("propertyService", new BaseCustomWebComponentPropertiesService());
80
+ serviceContainer.register("propertyGroupsService", new PropertyGroupsService());
77
81
  serviceContainer.register("instanceService", new DefaultInstanceService());
78
82
  serviceContainer.register("editorTypesService", new DefaultEditorTypesService());
79
83
  serviceContainer.register("htmlWriterService", new HtmlWriterService());
@@ -32,6 +32,7 @@ import { IProperty } from "./propertiesService/IProperty.js";
32
32
  import { IDesignItem } from "../item/IDesignItem.js";
33
33
  import { IBinding } from "../item/IBinding";
34
34
  import { BindingTarget } from "../item/BindingTarget";
35
+ import { IPropertyGroupsService } from "./propertiesService/IPropertyGroupsService";
35
36
  interface ServiceNameMap {
36
37
  "propertyService": IPropertiesService;
37
38
  "containerService": IPlacementService;
@@ -51,6 +52,7 @@ interface ServiceNameMap {
51
52
  "modelCommandService": IModelCommandService;
52
53
  "demoProviderService": IDemoProviderService;
53
54
  "elementInteractionService": IElementInteractionService;
55
+ "propertyGroupsService": IPropertyGroupsService;
54
56
  }
55
57
  export declare class ServiceContainer extends BaseServiceContainer<ServiceNameMap> {
56
58
  readonly config: {
@@ -71,6 +73,7 @@ export declare class ServiceContainer extends BaseServiceContainer<ServiceNameMa
71
73
  get bindableObjectDragDropService(): IBindableObjectDragDropService;
72
74
  get elementInteractionServices(): IElementInteractionService[];
73
75
  get propertiesServices(): IPropertiesService[];
76
+ get propertyGroupService(): IPropertyGroupsService;
74
77
  get containerServices(): IPlacementService[];
75
78
  get snaplinesProviderService(): ISnaplinesProviderService;
76
79
  get elementsServices(): IElementsService[];
@@ -37,6 +37,9 @@ export class ServiceContainer extends BaseServiceContainer {
37
37
  get propertiesServices() {
38
38
  return this.getServices('propertyService');
39
39
  }
40
+ get propertyGroupService() {
41
+ return this.getLastService('propertyGroupsService');
42
+ }
40
43
  get containerServices() {
41
44
  return this.getServices('containerService');
42
45
  }
@@ -59,7 +59,7 @@ export class HtmlWriterService extends AbstractHtmlWriterService {
59
59
  let childSingleTextNode = c.childCount === 1 && c.firstChild.nodeType === NodeType.TextNode;
60
60
  if (childSingleTextNode)
61
61
  if (!indentedTextWriter.isLastCharNewline())
62
- indentedTextWriter.writeNewline();
62
+ this._conditionalyWriteNewline(indentedTextWriter, c);
63
63
  }
64
64
  if (designItem.element instanceof HTMLElement && !isInline(designItem.element) || (designItem.element instanceof SVGElement)) {
65
65
  indentedTextWriter.levelShrink();
@@ -7,6 +7,7 @@ import { TextPropertyEditor } from './propertyEditors/TextPropertyEditor';
7
7
  import { BooleanPropertyEditor } from './propertyEditors/BooleanPropertyEditor';
8
8
  import { ImageButtonListPropertyEditor } from './propertyEditors/ImageButtonListPropertyEditor';
9
9
  import { ThicknessPropertyEditor } from "./propertyEditors/ThicknessPropertyEditor.js";
10
+ import { MetricsPropertyEditor } from "./propertyEditors/MetricsPropertyEditor";
10
11
  export class DefaultEditorTypesService {
11
12
  getEditorForProperty(property) {
12
13
  if (property.createEditor)
@@ -48,6 +49,10 @@ export class DefaultEditorTypesService {
48
49
  {
49
50
  return new ThicknessPropertyEditor(property);
50
51
  }
52
+ case "metrics":
53
+ {
54
+ return new MetricsPropertyEditor(property);
55
+ }
51
56
  case "css-length":
52
57
  case "string":
53
58
  default:
@@ -5,6 +5,7 @@ import { ValueType } from './ValueType';
5
5
  import { BindingTarget } from '../../item/BindingTarget';
6
6
  import { IBinding } from '../../item/IBinding';
7
7
  export interface IPropertiesService extends IService {
8
+ listNeedsRefresh(designItem: IDesignItem): boolean;
8
9
  isHandledElement(designItem: IDesignItem): boolean;
9
10
  getProperties(designItem: IDesignItem): IProperty[];
10
11
  getProperty(designItem: IDesignItem, name: string): IProperty;
@@ -6,7 +6,7 @@ export interface IProperty {
6
6
  propertyName?: string;
7
7
  attributeName?: string;
8
8
  description?: string;
9
- type?: 'json' | 'color' | 'date' | 'number' | 'list' | 'enum' | 'boolean' | 'img-lis' | 'thickness' | 'css-length' | 'string' | string;
9
+ type?: 'addNew' | 'json' | 'color' | 'date' | 'number' | 'list' | 'enum' | 'boolean' | 'img-lis' | 'thickness' | 'css-length' | 'string' | string;
10
10
  default?: any;
11
11
  min?: number;
12
12
  max?: number;
@@ -0,0 +1,8 @@
1
+ import { IDesignItem } from "../../item/IDesignItem";
2
+ import { IPropertiesService } from "./IPropertiesService";
3
+ export interface IPropertyGroupsService {
4
+ getPropertygroups(designItems: IDesignItem[]): {
5
+ name: string;
6
+ propertiesService: IPropertiesService;
7
+ }[];
8
+ }
@@ -0,0 +1,11 @@
1
+ import { IDesignItem } from "../../item/IDesignItem";
2
+ import { IPropertiesService } from "./IPropertiesService";
3
+ import { IPropertyGroupsService } from "./IPropertyGroupsService";
4
+ export declare class PropertyGroupsService implements IPropertyGroupsService {
5
+ private _pgList;
6
+ private _svgPgList;
7
+ getPropertygroups(designItems: IDesignItem[]): {
8
+ name: string;
9
+ propertiesService: IPropertiesService;
10
+ }[];
11
+ }
@@ -0,0 +1,28 @@
1
+ import { AttributesPropertiesService } from "./services/AttributesPropertiesService";
2
+ import { CommonPropertiesService } from "./services/CommonPropertiesService";
3
+ import { CssPropertiesService } from "./services/CssPropertiesService";
4
+ export class PropertyGroupsService {
5
+ _pgList = [
6
+ { name: 'properties', propertiesService: null },
7
+ { name: 'attributes', propertiesService: new AttributesPropertiesService() },
8
+ { name: 'common', propertiesService: new CommonPropertiesService() },
9
+ { name: 'styles', propertiesService: new CssPropertiesService("styles") },
10
+ { name: 'layout', propertiesService: new CssPropertiesService("layout") },
11
+ { name: 'flex', propertiesService: new CssPropertiesService("flex") },
12
+ { name: 'grid', propertiesService: new CssPropertiesService("grid") },
13
+ ];
14
+ _svgPgList = [
15
+ { name: 'properties', propertiesService: null },
16
+ { name: 'attributes', propertiesService: new AttributesPropertiesService() },
17
+ { name: 'styles', propertiesService: new CssPropertiesService("styles") },
18
+ { name: 'layout', propertiesService: new CssPropertiesService("layout") },
19
+ ];
20
+ getPropertygroups(designItems) {
21
+ if (designItems == null || designItems.length == 0)
22
+ return [];
23
+ this._pgList[0].propertiesService = designItems[0].serviceContainer.getLastServiceWhere('propertyService', x => x.isHandledElement(designItems[0]));
24
+ if (designItems[0] instanceof SVGElement)
25
+ return this._svgPgList;
26
+ return this._pgList;
27
+ }
28
+ }
@@ -2,5 +2,7 @@ export declare enum PropertyType {
2
2
  property = "property",
3
3
  attribute = "attribute",
4
4
  propertyAndAttribute = "propertyAndAttribute",
5
- cssValue = "cssvalue"
5
+ cssValue = "cssvalue",
6
+ complex = "complex",
7
+ add = "add"
6
8
  }
@@ -4,4 +4,6 @@ export var PropertyType;
4
4
  PropertyType["attribute"] = "attribute";
5
5
  PropertyType["propertyAndAttribute"] = "propertyAndAttribute";
6
6
  PropertyType["cssValue"] = "cssvalue";
7
+ PropertyType["complex"] = "complex";
8
+ PropertyType["add"] = "add"; // editor allows to add a new one
7
9
  })(PropertyType || (PropertyType = {}));
@@ -0,0 +1,8 @@
1
+ import { IProperty } from "../IProperty";
2
+ import { BasePropertyEditor } from './BasePropertyEditor';
3
+ import { ValueType } from "../ValueType";
4
+ import { MetricsEditor } from "../../../controls/MetricsEditor";
5
+ export declare class MetricsPropertyEditor extends BasePropertyEditor<MetricsEditor> {
6
+ constructor(property: IProperty);
7
+ refreshValue(valueType: ValueType, value: any): void;
8
+ }
@@ -0,0 +1,14 @@
1
+ import { BasePropertyEditor } from './BasePropertyEditor';
2
+ import { MetricsEditor } from "../../../controls/MetricsEditor";
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
+ }
@@ -6,6 +6,7 @@ import { IBinding } from "../../../item/IBinding.js";
6
6
  import { BindingTarget } from "../../../item/BindingTarget";
7
7
  export declare class AttributesPropertiesService implements IPropertiesService {
8
8
  name: string;
9
+ listNeedsRefresh(designItem: IDesignItem): boolean;
9
10
  isHandledElement(designItem: IDesignItem): boolean;
10
11
  getProperty(designItem: IDesignItem, name: string): IProperty;
11
12
  getProperties(designItem: IDesignItem): IProperty[];
@@ -3,6 +3,9 @@ import { BindingTarget } from "../../../item/BindingTarget";
3
3
  import { PropertyType } from "../PropertyType";
4
4
  export class AttributesPropertiesService {
5
5
  name = "attributes";
6
+ listNeedsRefresh(designItem) {
7
+ return true;
8
+ }
6
9
  isHandledElement(designItem) {
7
10
  return true;
8
11
  }
@@ -15,6 +18,7 @@ export class AttributesPropertiesService {
15
18
  for (let a of designItem.attributes.keys()) {
16
19
  p.push({ name: a, type: 'string', service: this, propertyType: PropertyType.propertyAndAttribute });
17
20
  }
21
+ p.push({ name: '', type: 'addNew', service: this, propertyType: PropertyType.complex });
18
22
  return p;
19
23
  }
20
24
  return null;
@@ -5,6 +5,7 @@ import { ValueType } from "../ValueType";
5
5
  import { BindingTarget } from "../../../item/BindingTarget";
6
6
  import { IBinding } from "../../../item/IBinding";
7
7
  export declare class CommonPropertiesService implements IPropertiesService {
8
+ listNeedsRefresh(designItem: IDesignItem): boolean;
8
9
  private commonProperties;
9
10
  name: string;
10
11
  isHandledElement(designItem: IDesignItem): boolean;
@@ -2,6 +2,9 @@ import { ValueType } from "../ValueType";
2
2
  import { BindingTarget } from "../../../item/BindingTarget";
3
3
  import { PropertyType } from "../PropertyType";
4
4
  export class CommonPropertiesService {
5
+ listNeedsRefresh(designItem) {
6
+ return false;
7
+ }
5
8
  //@ts-ignore
6
9
  commonProperties = [
7
10
  {
@@ -5,12 +5,12 @@ import { ValueType } from '../ValueType';
5
5
  import { BindingTarget } from '../../../item/BindingTarget.js';
6
6
  import { IBinding } from '../../../item/IBinding';
7
7
  export declare class CssPropertiesService implements IPropertiesService {
8
- private styles;
9
- private alignment;
10
- private grid;
11
- private flex;
12
- name: 'set-styles' | 'alignment' | 'styles' | 'grid' | 'flex';
13
- constructor(name: 'set-styles' | 'alignment' | 'styles' | 'grid' | 'flex');
8
+ listNeedsRefresh(designItem: IDesignItem): boolean;
9
+ layout: IProperty[];
10
+ grid: IProperty[];
11
+ flex: IProperty[];
12
+ name: 'styles' | 'layout' | 'grid' | 'flex';
13
+ constructor(name: 'styles' | 'layout' | 'grid' | 'flex');
14
14
  isHandledElement(designItem: IDesignItem): boolean;
15
15
  getProperty(designItem: IDesignItem, name: string): IProperty;
16
16
  getProperties(designItem: IDesignItem): IProperty[];