@node-projects/web-component-designer 0.0.281 → 0.0.283
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.
- package/dist/elements/services/BaseServiceContainer.d.ts +1 -0
- package/dist/elements/services/BaseServiceContainer.js +13 -0
- package/dist/elements/services/GlobalContext.d.ts +5 -0
- package/dist/elements/services/GlobalContext.js +1 -0
- package/dist/elements/services/ServiceContainer.d.ts +5 -0
- package/dist/elements/services/ServiceContainer.js +6 -0
- package/dist/elements/services/configUiService/IConfigUiService.d.ts +5 -0
- package/dist/elements/services/configUiService/IConfigUiService.js +1 -0
- package/dist/elements/services/propertiesService/PropertyTabsService.d.ts +2 -0
- package/dist/elements/services/propertiesService/PropertyTabsService.js +4 -0
- package/dist/elements/services/propertiesService/services/AttachedPropertiesService.d.ts +11 -0
- package/dist/elements/services/propertiesService/services/AttachedPropertiesService.js +22 -0
- package/dist/elements/services/propertiesService/services/AttributesPropertiesService.js +10 -2
- package/dist/elements/services/propertiesService/services/CssPropertiesService.d.ts +5 -1
- package/dist/elements/services/propertiesService/services/CssPropertiesService.js +37 -21
- package/dist/elements/services/propertiesService/services/PolymerPropertiesService copy.d.ts +8 -0
- package/dist/elements/services/propertiesService/services/PolymerPropertiesService copy.js +10 -0
- package/dist/elements/widgets/paletteView/paletteTreeView.js +5 -1
- package/dist/elements/widgets/propertyGrid/PropertyGrid.js +2 -2
- package/dist/elements/widgets/propertyGrid/PropertyGridPropertyList.d.ts +1 -1
- package/dist/elements/widgets/propertyGrid/PropertyGridPropertyList.js +4 -1
- package/dist/elements/widgets/propertyGrid/PropertyGridWithHeader.d.ts +1 -0
- package/dist/elements/widgets/propertyGrid/PropertyGridWithHeader.js +19 -5
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/package.json +8 -8
- package/debug.log +0 -8
|
@@ -11,4 +11,5 @@ export declare class BaseServiceContainer<NameMap> {
|
|
|
11
11
|
registerMultiple<K extends keyof NameMap>(names: K[], service: NameMap[K]): void;
|
|
12
12
|
forSomeServicesTillResult<K extends keyof NameMap, Y>(service: K, callback: (service: NameMap[K]) => Y): Y;
|
|
13
13
|
getLastServiceWhere<K extends keyof NameMap, Y>(service: K, callback: (service: NameMap[K]) => Y): NameMap[K];
|
|
14
|
+
getLastServiceWhereAsync<K extends keyof NameMap, Y>(service: K, callback: (service: NameMap[K]) => Promise<Y>): Promise<NameMap[K]>;
|
|
14
15
|
}
|
|
@@ -51,4 +51,17 @@ export class BaseServiceContainer {
|
|
|
51
51
|
}
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
+
async getLastServiceWhereAsync(service, callback) {
|
|
55
|
+
let services = this.getServices(service);
|
|
56
|
+
if (services == null) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
for (let index = services.length - 1; index >= 0; index--) {
|
|
60
|
+
const currentService = services[index];
|
|
61
|
+
let result = await callback(currentService);
|
|
62
|
+
if (result)
|
|
63
|
+
return currentService;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
54
67
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PropertyChangedArgs, TypedEvent } from "@node-projects/base-custom-webcomponent";
|
|
2
2
|
import { ITool } from '../widgets/designerView/tools/ITool.js';
|
|
3
3
|
import { ServiceContainer } from './ServiceContainer.js';
|
|
4
|
+
import { IDesignItem } from "../item/IDesignItem.js";
|
|
4
5
|
export declare class GlobalContext {
|
|
5
6
|
private _serviceContainer;
|
|
6
7
|
private _tool;
|
|
@@ -24,4 +25,8 @@ export declare class GlobalContext {
|
|
|
24
25
|
set fillBrush(fillBrush: string);
|
|
25
26
|
get fillBrush(): string;
|
|
26
27
|
readonly onFillBrushChanged: TypedEvent<PropertyChangedArgs<string>>;
|
|
28
|
+
readonly showConfigClicked: TypedEvent<{
|
|
29
|
+
configUi: Element;
|
|
30
|
+
designItem: IDesignItem;
|
|
31
|
+
}>;
|
|
27
32
|
}
|
|
@@ -43,8 +43,10 @@ import { IDragDropService } from './dragDropService/IDragDropService.js';
|
|
|
43
43
|
import { IDesignItemService } from './designItemService/IDesignItemService.js';
|
|
44
44
|
import { IEventsService } from './eventsService/IEventsService.js';
|
|
45
45
|
import { IPropertyGridDragDropService } from './dragDropService/IPropertyGridDragDropService.js';
|
|
46
|
+
import { IConfigUiService } from './configUiService/IConfigUiService.js';
|
|
46
47
|
interface ServiceNameMap {
|
|
47
48
|
"propertyService": IPropertiesService;
|
|
49
|
+
"attachedPropertyService": IPropertiesService;
|
|
48
50
|
"containerService": IPlacementService;
|
|
49
51
|
"snaplinesProviderService": ISnaplinesProviderService;
|
|
50
52
|
"elementsService": IElementsService;
|
|
@@ -67,6 +69,7 @@ interface ServiceNameMap {
|
|
|
67
69
|
"designItemService": IDesignItemService;
|
|
68
70
|
"eventsService": IEventsService;
|
|
69
71
|
"propertyGridDragDropService": IPropertyGridDragDropService;
|
|
72
|
+
"configUiService": IConfigUiService;
|
|
70
73
|
"undoService": (designerCanvas: IDesignerCanvas) => IUndoService;
|
|
71
74
|
"selectionService": (designerCanvas: IDesignerCanvas) => ISelectionService;
|
|
72
75
|
"contentService": (designerCanvas: IDesignerCanvas) => IContentService;
|
|
@@ -97,6 +100,7 @@ export declare class ServiceContainer extends BaseServiceContainer<ServiceNameMa
|
|
|
97
100
|
get dragDropService(): IDragDropService;
|
|
98
101
|
get elementInteractionServices(): IElementInteractionService[];
|
|
99
102
|
get propertiesServices(): IPropertiesService[];
|
|
103
|
+
get attachedPropertyServices(): IPropertiesService[];
|
|
100
104
|
get propertyGroupService(): IPropertyTabsService;
|
|
101
105
|
get containerServices(): IPlacementService[];
|
|
102
106
|
get snaplinesProviderService(): ISnaplinesProviderService;
|
|
@@ -113,5 +117,6 @@ export declare class ServiceContainer extends BaseServiceContainer<ServiceNameMa
|
|
|
113
117
|
get modelCommandService(): IModelCommandService;
|
|
114
118
|
get demoProviderService(): IDemoProviderService;
|
|
115
119
|
get designItemService(): IDesignItemService;
|
|
120
|
+
get configUiServices(): IConfigUiService[];
|
|
116
121
|
}
|
|
117
122
|
export {};
|
|
@@ -46,6 +46,9 @@ export class ServiceContainer extends BaseServiceContainer {
|
|
|
46
46
|
get propertiesServices() {
|
|
47
47
|
return this.getServices('propertyService');
|
|
48
48
|
}
|
|
49
|
+
get attachedPropertyServices() {
|
|
50
|
+
return this.getServices('attachedPropertyService');
|
|
51
|
+
}
|
|
49
52
|
get propertyGroupService() {
|
|
50
53
|
return this.getLastService('propertyGroupsService');
|
|
51
54
|
}
|
|
@@ -94,4 +97,7 @@ export class ServiceContainer extends BaseServiceContainer {
|
|
|
94
97
|
get designItemService() {
|
|
95
98
|
return this.getLastService('designItemService');
|
|
96
99
|
}
|
|
100
|
+
get configUiServices() {
|
|
101
|
+
return this.getServices('configUiService');
|
|
102
|
+
}
|
|
97
103
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IDesignItem } from '../../item/IDesignItem.js';
|
|
2
2
|
import { IPropertiesService } from './IPropertiesService.js';
|
|
3
3
|
import { IPropertyTabsService } from './IPropertyTabsService.js';
|
|
4
|
+
import { AttachedPropertiesService } from './services/AttachedPropertiesService.js';
|
|
4
5
|
export declare class PropertyTabsService implements IPropertyTabsService {
|
|
6
|
+
protected _attachedPropertiesService: AttachedPropertiesService;
|
|
5
7
|
protected _pgList: {
|
|
6
8
|
name: string;
|
|
7
9
|
propertiesService: IPropertiesService;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { AttachedPropertiesService } from './services/AttachedPropertiesService.js';
|
|
1
2
|
import { AttributesPropertiesService } from './services/AttributesPropertiesService.js';
|
|
2
3
|
import { CommonPropertiesService } from './services/CommonPropertiesService.js';
|
|
3
4
|
import { CssCurrentPropertiesService } from './services/CssCurrentPropertiesService.js';
|
|
4
5
|
import { CssPropertiesService } from './services/CssPropertiesService.js';
|
|
5
6
|
export class PropertyTabsService {
|
|
7
|
+
_attachedPropertiesService = new AttachedPropertiesService();
|
|
6
8
|
_pgList = [
|
|
7
9
|
{ name: 'properties', propertiesService: null },
|
|
10
|
+
{ name: 'attached', propertiesService: this._attachedPropertiesService },
|
|
8
11
|
{ name: 'attributes', propertiesService: new AttributesPropertiesService() },
|
|
9
12
|
{ name: 'common', propertiesService: new CommonPropertiesService() },
|
|
10
13
|
{ name: 'styles', propertiesService: new CssCurrentPropertiesService() },
|
|
@@ -14,6 +17,7 @@ export class PropertyTabsService {
|
|
|
14
17
|
];
|
|
15
18
|
_svgPgList = [
|
|
16
19
|
{ name: 'properties', propertiesService: null },
|
|
20
|
+
{ name: 'attached', propertiesService: this._attachedPropertiesService },
|
|
17
21
|
{ name: 'attributes', propertiesService: new AttributesPropertiesService() },
|
|
18
22
|
{ name: 'styles', propertiesService: new CssCurrentPropertiesService() },
|
|
19
23
|
{ name: 'layout', propertiesService: new CssPropertiesService("layout") },
|
|
@@ -0,0 +1,11 @@
|
|
|
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 AttachedPropertiesService extends AbstractPropertiesService {
|
|
7
|
+
name: string;
|
|
8
|
+
getRefreshMode(designItem: IDesignItem): RefreshMode;
|
|
9
|
+
isHandledElement(designItem: IDesignItem): boolean;
|
|
10
|
+
getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AbstractPropertiesService } from './AbstractPropertiesService.js';
|
|
2
|
+
import { RefreshMode } from '../IPropertiesService.js';
|
|
3
|
+
export class AttachedPropertiesService extends AbstractPropertiesService {
|
|
4
|
+
name = "attached";
|
|
5
|
+
getRefreshMode(designItem) {
|
|
6
|
+
return RefreshMode.full;
|
|
7
|
+
}
|
|
8
|
+
isHandledElement(designItem) {
|
|
9
|
+
return designItem.serviceContainer.forSomeServicesTillResult('attachedPropertyService', x => x.isHandledElement(designItem));
|
|
10
|
+
}
|
|
11
|
+
getProperties(designItem) {
|
|
12
|
+
let p = [];
|
|
13
|
+
if (designItem.serviceContainer.attachedPropertyServices) {
|
|
14
|
+
for (let s of designItem.serviceContainer.attachedPropertyServices) {
|
|
15
|
+
if (s.isHandledElement(designItem)) {
|
|
16
|
+
p.push(...s.getProperties(designItem));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return p;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -2,6 +2,7 @@ import { RefreshMode } from '../IPropertiesService.js';
|
|
|
2
2
|
import { ValueType } from '../ValueType.js';
|
|
3
3
|
import { BindingTarget } from '../../../item/BindingTarget.js';
|
|
4
4
|
import { PropertyType } from '../PropertyType.js';
|
|
5
|
+
import { PropertiesHelper } from './PropertiesHelper.js';
|
|
5
6
|
export class AttributesPropertiesService {
|
|
6
7
|
name = "attributes";
|
|
7
8
|
getRefreshMode(designItem) {
|
|
@@ -11,13 +12,13 @@ export class AttributesPropertiesService {
|
|
|
11
12
|
return true;
|
|
12
13
|
}
|
|
13
14
|
getProperty(designItem, name) {
|
|
14
|
-
return { name: name, type: 'string', service: this, propertyType: PropertyType.
|
|
15
|
+
return { name: name, type: 'string', service: this, propertyType: PropertyType.attribute };
|
|
15
16
|
}
|
|
16
17
|
getProperties(designItem) {
|
|
17
18
|
if (designItem) {
|
|
18
19
|
let p = [];
|
|
19
20
|
for (let a of designItem.attributes()) {
|
|
20
|
-
p.push({ name: a[0], renamable: true, type: 'string', service: this, propertyType: PropertyType.
|
|
21
|
+
p.push({ name: a[0], renamable: true, type: 'string', service: this, propertyType: PropertyType.attribute });
|
|
21
22
|
}
|
|
22
23
|
p.push({ name: '', type: 'addNew', service: this, propertyType: PropertyType.complex });
|
|
23
24
|
return p;
|
|
@@ -48,12 +49,19 @@ export class AttributesPropertiesService {
|
|
|
48
49
|
if (designItems != null && designItems.length !== 0) {
|
|
49
50
|
if (designItems.length == 1 && typeof designItems[0].getAttribute(property.name) == 'object')
|
|
50
51
|
return ValueType.bound;
|
|
52
|
+
let propName = PropertiesHelper.dashToCamelCase(property.name);
|
|
51
53
|
let attributeName = property.name;
|
|
52
54
|
designItems.forEach((x) => {
|
|
53
55
|
let has = x.hasAttribute(attributeName);
|
|
54
56
|
all = all && has;
|
|
55
57
|
some = some || has;
|
|
56
58
|
});
|
|
59
|
+
//todo: optimize perf, do not call bindings service for each property.
|
|
60
|
+
const bindings = designItems[0].serviceContainer.forSomeServicesTillResult('bindingService', (s) => {
|
|
61
|
+
return s.getBindings(designItems[0]);
|
|
62
|
+
});
|
|
63
|
+
if (bindings && bindings.find(x => x.target == BindingTarget.attribute && x.targetName == propName))
|
|
64
|
+
return ValueType.bound;
|
|
57
65
|
}
|
|
58
66
|
else
|
|
59
67
|
return ValueType.none;
|
|
@@ -6,7 +6,11 @@ import { RefreshMode } from '../IPropertiesService.js';
|
|
|
6
6
|
import { IPropertyGroup } from '../IPropertyGroup.js';
|
|
7
7
|
export declare class CssPropertiesService extends CommonPropertiesService {
|
|
8
8
|
getRefreshMode(designItem: IDesignItem): RefreshMode;
|
|
9
|
-
layout:
|
|
9
|
+
layout: {
|
|
10
|
+
common: string[];
|
|
11
|
+
font: string[];
|
|
12
|
+
layout: string[];
|
|
13
|
+
};
|
|
10
14
|
grid: string[];
|
|
11
15
|
gridChild: string[];
|
|
12
16
|
flex: string[];
|
|
@@ -23,25 +23,31 @@ export class CssPropertiesService extends CommonPropertiesService {
|
|
|
23
23
|
return RefreshMode.none;
|
|
24
24
|
}
|
|
25
25
|
//metrics
|
|
26
|
-
layout =
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"font
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
layout = {
|
|
27
|
+
"common": [
|
|
28
|
+
"display",
|
|
29
|
+
"color",
|
|
30
|
+
"background-color",
|
|
31
|
+
"box-sizing",
|
|
32
|
+
"border",
|
|
33
|
+
"box-shadow",
|
|
34
|
+
"opacity",
|
|
35
|
+
"position",
|
|
36
|
+
],
|
|
37
|
+
"font": [
|
|
38
|
+
"font-family",
|
|
39
|
+
"font-size",
|
|
40
|
+
"font-weight",
|
|
41
|
+
],
|
|
42
|
+
"layout": [
|
|
43
|
+
"inset",
|
|
44
|
+
"margin",
|
|
45
|
+
"border",
|
|
46
|
+
"padding",
|
|
47
|
+
"overflow",
|
|
48
|
+
"metrics"
|
|
49
|
+
]
|
|
50
|
+
};
|
|
45
51
|
grid = [
|
|
46
52
|
"display",
|
|
47
53
|
"position",
|
|
@@ -95,8 +101,18 @@ export class CssPropertiesService extends CommonPropertiesService {
|
|
|
95
101
|
}
|
|
96
102
|
getProperties(designItem) {
|
|
97
103
|
const propNames = this[this.name];
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
if (Array.isArray(propNames)) {
|
|
105
|
+
const propertiesList = propNames.map(x => this._getPropertyDef(x));
|
|
106
|
+
return propertiesList;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
let grps = [];
|
|
110
|
+
for (let g in propNames) {
|
|
111
|
+
let grp = { name: g, properties: propNames[g].map(x => this._getPropertyDef(x)) };
|
|
112
|
+
grps.push(grp);
|
|
113
|
+
}
|
|
114
|
+
return grps;
|
|
115
|
+
}
|
|
100
116
|
}
|
|
101
117
|
_getPropertyDef(name) {
|
|
102
118
|
const camelName = PropertiesHelper.dashToCamelCase(name);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IProperty } from '../IProperty.js';
|
|
2
|
+
import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
3
|
+
import { AbstractPolymerLikePropertiesService } from './AbstractPolymerLikePropertiesService.js';
|
|
4
|
+
export declare class PolymerPropertiesService extends AbstractPolymerLikePropertiesService {
|
|
5
|
+
name: string;
|
|
6
|
+
isHandledElement(designItem: IDesignItem): boolean;
|
|
7
|
+
protected _notifyChangedProperty(designItem: IDesignItem, property: IProperty, value: any): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractPolymerLikePropertiesService } from './AbstractPolymerLikePropertiesService.js';
|
|
2
|
+
export class PolymerPropertiesService extends AbstractPolymerLikePropertiesService {
|
|
3
|
+
name = "polymer";
|
|
4
|
+
isHandledElement(designItem) {
|
|
5
|
+
return designItem.element.constructor.polymerElementVersion != null;
|
|
6
|
+
}
|
|
7
|
+
_notifyChangedProperty(designItem, property, value) {
|
|
8
|
+
designItem.element.set(property.name, value);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -5,6 +5,10 @@ export class PaletteTreeView extends BaseCustomWebComponentConstructorAppend {
|
|
|
5
5
|
_tree;
|
|
6
6
|
_filter;
|
|
7
7
|
static style = css `
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
* {
|
|
9
13
|
touch-action: none;
|
|
10
14
|
}
|
|
@@ -48,7 +52,7 @@ export class PaletteTreeView extends BaseCustomWebComponentConstructorAppend {
|
|
|
48
52
|
`;
|
|
49
53
|
static template = html `
|
|
50
54
|
<div style="height: 100%;">
|
|
51
|
-
<input id="input" style="width: 100%; height:
|
|
55
|
+
<input id="input" style="width: 100%; height: 25px; box-sizing: border-box;" placeholder="Filter..." autocomplete="off">
|
|
52
56
|
<div style="height: calc(100% - 26px); overflow: auto;">
|
|
53
57
|
<div id="treetable" style="min-width: 100%;"></div>
|
|
54
58
|
</div>
|
|
@@ -78,8 +78,8 @@ export class PropertyGrid extends BaseCustomWebComponentLazyAppend {
|
|
|
78
78
|
this._propertyGridPropertyListsDict[p.name] = lst;
|
|
79
79
|
}
|
|
80
80
|
lst.setPropertiesService(p.propertiesService);
|
|
81
|
-
lst.createElements(items[0])
|
|
82
|
-
|
|
81
|
+
if (lst.createElements(items[0]))
|
|
82
|
+
visibleDict.add(p.name);
|
|
83
83
|
}
|
|
84
84
|
for (let p of this._propertyGridPropertyLists) {
|
|
85
85
|
if (visibleDict.has(p.title))
|
|
@@ -14,7 +14,7 @@ export declare class PropertyGridPropertyList extends BaseCustomWebComponentLazy
|
|
|
14
14
|
static get style(): CSSStyleSheet;
|
|
15
15
|
constructor(serviceContainer: ServiceContainer);
|
|
16
16
|
setPropertiesService(propertiesService: IPropertiesService): void;
|
|
17
|
-
createElements(designItem: IDesignItem):
|
|
17
|
+
createElements(designItem: IDesignItem): boolean;
|
|
18
18
|
private createPropertyGroups;
|
|
19
19
|
private createPropertyEditors;
|
|
20
20
|
private _onDragLeave;
|
|
@@ -126,9 +126,12 @@ export class PropertyGridPropertyList extends BaseCustomWebComponentLazyAppend {
|
|
|
126
126
|
this.createPropertyGroups(properties);
|
|
127
127
|
else
|
|
128
128
|
this.createPropertyEditors(properties);
|
|
129
|
+
return true;
|
|
129
130
|
}
|
|
130
131
|
}
|
|
132
|
+
return false;
|
|
131
133
|
}
|
|
134
|
+
return true;
|
|
132
135
|
}
|
|
133
136
|
createPropertyGroups(groups) {
|
|
134
137
|
for (const g of groups) {
|
|
@@ -137,7 +140,7 @@ export class PropertyGridPropertyList extends BaseCustomWebComponentLazyAppend {
|
|
|
137
140
|
header.className = 'group-header';
|
|
138
141
|
this._div.appendChild(header);
|
|
139
142
|
let desc = document.createElement('span');
|
|
140
|
-
desc.innerHTML = g.description;
|
|
143
|
+
desc.innerHTML = g.description ?? '';
|
|
141
144
|
desc.className = 'group-desc';
|
|
142
145
|
this._div.appendChild(desc);
|
|
143
146
|
this.createPropertyEditors(g.properties);
|
|
@@ -14,6 +14,7 @@ export declare class PropertyGridWithHeader extends BaseCustomWebComponentLazyAp
|
|
|
14
14
|
private _contentRect;
|
|
15
15
|
private _innerRect;
|
|
16
16
|
private _propertiesService;
|
|
17
|
+
private _configButton;
|
|
17
18
|
constructor();
|
|
18
19
|
set serviceContainer(value: ServiceContainer);
|
|
19
20
|
set instanceServiceContainer(value: InstanceServiceContainer);
|
|
@@ -15,7 +15,7 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
|
|
|
15
15
|
}
|
|
16
16
|
div.root {
|
|
17
17
|
display: grid;
|
|
18
|
-
grid-template-columns: 11px 11px auto 1fr;
|
|
18
|
+
grid-template-columns: 11px 11px auto 1fr auto;
|
|
19
19
|
padding: 3px 6px;
|
|
20
20
|
font-family: monospace;
|
|
21
21
|
align-items: center;
|
|
@@ -45,14 +45,14 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
|
|
|
45
45
|
static template = html `
|
|
46
46
|
<div class="root">
|
|
47
47
|
<span style="grid-column: span 3;" class="desc">Type:</span><span id="type"></span>
|
|
48
|
-
<
|
|
48
|
+
<button id="config" style="display: none; grid-column: 5; grid-row: span 3; height: calc(100% - 10px); margin-left: 10px;">config</button>
|
|
49
|
+
<div title="id" id="idRect" style="grid-column: 1; width: 7px; height: 7px; border: 1px solid white;"></div>
|
|
49
50
|
<span style="grid-column: span 2;" class="desc">Id:</span><input type="text" id="id">
|
|
50
|
-
<div title="innerHTML" id="innerRect" style="width: 7px; height: 7px; border: 1px solid white;"></div>
|
|
51
|
+
<div title="innerHTML" id="innerRect" style="grid-column: 1; width: 7px; height: 7px; border: 1px solid white;"></div>
|
|
51
52
|
<div title="textContent" id="contentRect" style="width: 7px; height: 7px; border: 1px solid white;"></div>
|
|
52
53
|
<span class="desc">Content:</span><input type="text" id="content">
|
|
53
54
|
</div>
|
|
54
|
-
<node-projects-property-grid id="pg"></node-projects-property-grid
|
|
55
|
-
`;
|
|
55
|
+
<node-projects-property-grid id="pg"></node-projects-property-grid>`;
|
|
56
56
|
_type;
|
|
57
57
|
_id;
|
|
58
58
|
_content;
|
|
@@ -63,6 +63,7 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
|
|
|
63
63
|
_contentRect;
|
|
64
64
|
_innerRect;
|
|
65
65
|
_propertiesService;
|
|
66
|
+
_configButton;
|
|
66
67
|
constructor() {
|
|
67
68
|
super();
|
|
68
69
|
this._restoreCachedInititalValues();
|
|
@@ -73,6 +74,12 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
|
|
|
73
74
|
this._idRect = this._getDomElement('idRect');
|
|
74
75
|
this._contentRect = this._getDomElement('contentRect');
|
|
75
76
|
this._innerRect = this._getDomElement('innerRect');
|
|
77
|
+
this._configButton = this._getDomElement('config');
|
|
78
|
+
this._configButton.onclick = async () => {
|
|
79
|
+
const srv = await this.serviceContainer?.getLastServiceWhereAsync('configUiService', async (x) => await x.hasConfigUi(this._instanceServiceContainer.selectionService.primarySelection));
|
|
80
|
+
const ui = await srv.getConfigUi(this._instanceServiceContainer.selectionService.primarySelection);
|
|
81
|
+
this.serviceContainer.globalContext.showConfigClicked.emit({ designItem: this._instanceServiceContainer.selectionService.primarySelection, configUi: ui });
|
|
82
|
+
};
|
|
76
83
|
this._propertiesService = new ContentAndIdPropertiesService();
|
|
77
84
|
this._idRect.oncontextmenu = (event) => {
|
|
78
85
|
event.preventDefault();
|
|
@@ -123,6 +130,13 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
|
|
|
123
130
|
this._selectionChangedHandler = this._instanceServiceContainer.selectionService.onSelectionChanged.on(async (e) => {
|
|
124
131
|
this._pg.instanceServiceContainer = value;
|
|
125
132
|
await sleep(20); // delay assignment a little bit, so onblur above could still set the value.
|
|
133
|
+
const srv = await this.serviceContainer?.getLastServiceWhereAsync('configUiService', x => x.hasConfigUi(this._instanceServiceContainer.selectionService.primarySelection));
|
|
134
|
+
if (srv) {
|
|
135
|
+
this._configButton.style.display = 'block';
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this._configButton.style.display = 'none';
|
|
139
|
+
}
|
|
126
140
|
if (this._instanceServiceContainer.selectionService.primarySelection?.nodeType == NodeType.Element)
|
|
127
141
|
this._type.innerText = this._instanceServiceContainer.selectionService.primarySelection?.name ?? '';
|
|
128
142
|
else
|
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export * from "./elements/services/demoProviderService/SimpleDemoProviderService
|
|
|
46
46
|
export type { IDemoProviderService } from "./elements/services/demoProviderService/IDemoProviderService.js";
|
|
47
47
|
export * from "./elements/services/designItemDocumentPositionService/DesignItemDocumentPositionService.js";
|
|
48
48
|
export type { IDesignItemDocumentPositionService } from "./elements/services/designItemDocumentPositionService/IDesignItemDocumentPositionService.js";
|
|
49
|
+
export type { IConfigUiService } from "./elements/services/configUiService/IConfigUiService.js";
|
|
49
50
|
export * from "./elements/services/designItemService/DesignItemService.js";
|
|
50
51
|
export type { IDesignItemService } from "./elements/services/designItemService/IDesignItemService.js";
|
|
51
52
|
export * from "./elements/services/dragDropService/ExternalDragDropService.js";
|
|
@@ -65,6 +66,7 @@ export type { IEventsService } from "./elements/services/eventsService/IEventsSe
|
|
|
65
66
|
export * from "./elements/services/eventsService/EventsService.js";
|
|
66
67
|
export type { IHtmlWriterService } from "./elements/services/htmlWriterService/IHtmlWriterService.js";
|
|
67
68
|
export type { IHtmlWriterOptions } from "./elements/services/htmlWriterService/IHtmlWriterOptions.js";
|
|
69
|
+
export type { IStringPosition } from "./elements/services/htmlWriterService/IStringPosition.js";
|
|
68
70
|
export * from "./elements/services/htmlWriterService/AbstractHtmlWriterService.js";
|
|
69
71
|
export * from "./elements/services/htmlWriterService/FormatingHtmlWriterService.js";
|
|
70
72
|
export * from "./elements/services/htmlWriterService/HtmlWriterService.js";
|
|
@@ -102,6 +104,7 @@ export * from "./elements/services/propertiesService/propertyEditors/ThicknessPr
|
|
|
102
104
|
export * from "./elements/services/propertiesService/propertyEditors/special/MetricsPropertyEditor.js";
|
|
103
105
|
export * from "./elements/services/propertiesService/propertyEditors/special/GridAssignedRowColumnPropertyEditor.js";
|
|
104
106
|
export * from "./elements/services/propertiesService/services/PropertiesHelper.js";
|
|
107
|
+
export * from "./elements/services/propertiesService/services/AttachedPropertiesService.js";
|
|
105
108
|
export * from "./elements/services/propertiesService/services/BaseCustomWebComponentPropertiesService.js";
|
|
106
109
|
export * from "./elements/services/propertiesService/services/CommonPropertiesService.js";
|
|
107
110
|
export * from "./elements/services/propertiesService/services/ContentAndIdPropertiesService.js";
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ export * from "./elements/services/propertiesService/propertyEditors/ThicknessPr
|
|
|
64
64
|
export * from "./elements/services/propertiesService/propertyEditors/special/MetricsPropertyEditor.js";
|
|
65
65
|
export * from "./elements/services/propertiesService/propertyEditors/special/GridAssignedRowColumnPropertyEditor.js";
|
|
66
66
|
export * from "./elements/services/propertiesService/services/PropertiesHelper.js";
|
|
67
|
+
export * from "./elements/services/propertiesService/services/AttachedPropertiesService.js";
|
|
67
68
|
export * from "./elements/services/propertiesService/services/BaseCustomWebComponentPropertiesService.js";
|
|
68
69
|
export * from "./elements/services/propertiesService/services/CommonPropertiesService.js";
|
|
69
70
|
export * from "./elements/services/propertiesService/services/ContentAndIdPropertiesService.js";
|
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.
|
|
4
|
+
"version": "0.0.283",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"author": "",
|
|
@@ -13,27 +13,27 @@
|
|
|
13
13
|
"prepublishOnly": "npm run build"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@node-projects/base-custom-webcomponent": "^0.
|
|
16
|
+
"@node-projects/base-custom-webcomponent": "^0.17.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@adobe/css-tools": "4.3.1",
|
|
20
20
|
"@node-projects/lean-he-esm": "^3.3.0",
|
|
21
21
|
"@node-projects/node-html-parser-esm": "^6.1.5",
|
|
22
22
|
"@papyrs/stylo": "^0.0.45",
|
|
23
|
-
"@types/codemirror": "^5.60.
|
|
24
|
-
"@types/css-tree": "^2.3.
|
|
25
|
-
"@types/jquery": "^3.5.
|
|
23
|
+
"@types/codemirror": "^5.60.10",
|
|
24
|
+
"@types/css-tree": "^2.3.2",
|
|
25
|
+
"@types/jquery": "^3.5.18",
|
|
26
26
|
"@types/jquery.fancytree": "0.0.7",
|
|
27
|
-
"@types/node": "^20.5.
|
|
27
|
+
"@types/node": "^20.5.9",
|
|
28
28
|
"ace-builds": "^1.24.1",
|
|
29
29
|
"codemirror": "^5.0.0",
|
|
30
30
|
"css-tree": "^2.3.1",
|
|
31
31
|
"esprima-next": "^5.8.4",
|
|
32
32
|
"html2canvas": "*",
|
|
33
33
|
"jest": "^29.6.4",
|
|
34
|
-
"jquery": "^3.7.
|
|
34
|
+
"jquery": "^3.7.1",
|
|
35
35
|
"jquery.fancytree": "^2.38.3",
|
|
36
|
-
"mdn-data": "^2.0
|
|
36
|
+
"mdn-data": "^2.1.0",
|
|
37
37
|
"monaco-editor": "^0.41.0",
|
|
38
38
|
"ts-jest": "^29.1.1",
|
|
39
39
|
"typescript": "^5.2.2",
|
package/debug.log
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
[0823/112712.281:ERROR:registration_protocol_win.cc(103)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2)
|
|
2
|
-
[0907/074645.949:ERROR:registration_protocol_win.cc(103)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2)
|
|
3
|
-
[0910/083941.590:ERROR:registration_protocol_win.cc(103)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2)
|
|
4
|
-
[0919/084817.864:ERROR:registration_protocol_win.cc(103)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2)
|
|
5
|
-
[0928/190147.234:ERROR:registration_protocol_win.cc(103)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2)
|
|
6
|
-
[0930/210040.588:ERROR:registration_protocol_win.cc(103)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2)
|
|
7
|
-
[0107/215230.051:ERROR:registration_protocol_win.cc(102)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2)
|
|
8
|
-
[0108/121546.570:ERROR:registration_protocol_win.cc(102)] CreateFile: Das System kann die angegebene Datei nicht finden. (0x2)
|