@node-projects/web-component-designer 0.0.283 → 0.0.285
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/helper/NpmPackageLoader.js +4 -1
- package/dist/elements/item/DesignItem.d.ts +2 -0
- package/dist/elements/item/DesignItem.js +2 -1
- package/dist/elements/item/IDesignItem.d.ts +2 -0
- package/dist/elements/services/propertiesService/services/AbstractPolymerLikePropertiesService.d.ts +2 -1
- package/dist/elements/services/propertiesService/services/AttributesPropertiesService.d.ts +2 -1
- package/dist/elements/services/propertiesService/services/ListPropertiesService.d.ts +2 -1
- package/dist/elements/services/propertiesService/services/Lit2PropertiesService.d.ts +2 -1
- package/dist/elements/services/propertiesService/services/NativeElementsPropertiesService.d.ts +2 -1
- package/dist/elements/services/propertiesService/services/SVGElementsPropertiesService.d.ts +2 -1
- package/dist/elements/services/propertiesService/services/WebcomponentManifestPropertiesService.d.ts +2 -1
- package/dist/elements/widgets/propertyGrid/PropertyGrid.d.ts +2 -1
- package/dist/elements/widgets/propertyGrid/PropertyGrid.js +7 -2
- package/package.json +1 -1
|
@@ -307,7 +307,10 @@ export class NpmPackageLoader {
|
|
|
307
307
|
if (packageJsonObj.unpkg && !mainImport)
|
|
308
308
|
mainImport = packageJsonObj.unpkg;
|
|
309
309
|
if (!importMap.imports[packageJsonObj.name]) {
|
|
310
|
-
|
|
310
|
+
if (mainImport)
|
|
311
|
+
importMap.imports[packageJsonObj.name] = baseUrl + removeTrailing(mainImport, '/');
|
|
312
|
+
else
|
|
313
|
+
console.warn('package: ' + baseUrl + 'no main import found');
|
|
311
314
|
}
|
|
312
315
|
importMap.imports[packageJsonObj.name + '/'] = baseUrl;
|
|
313
316
|
//@ts-ignore
|
|
@@ -9,6 +9,7 @@ import { IDesignerExtension } from '../widgets/designerView/extensions/IDesigner
|
|
|
9
9
|
import { ISize } from '../../interfaces/ISize.js';
|
|
10
10
|
import { IDesignerExtensionProvider } from '../widgets/designerView/extensions/IDesignerExtensionProvider.js';
|
|
11
11
|
import { IStyleRule } from '../services/stylesheetService/IStylesheetService.js';
|
|
12
|
+
import { TypedEvent } from '@node-projects/base-custom-webcomponent';
|
|
12
13
|
import { IPlacementService } from '../services/placementService/IPlacementService.js';
|
|
13
14
|
export declare class DesignItem implements IDesignItem {
|
|
14
15
|
lastContainerSize: ISize;
|
|
@@ -18,6 +19,7 @@ export declare class DesignItem implements IDesignItem {
|
|
|
18
19
|
instanceServiceContainer: InstanceServiceContainer;
|
|
19
20
|
appliedDesignerExtensions: Map<ExtensionType, IDesignerExtension[]>;
|
|
20
21
|
shouldAppliedDesignerExtensions: Map<ExtensionType, IDesignerExtensionProvider[]>;
|
|
22
|
+
nodeReplaced: TypedEvent<void>;
|
|
21
23
|
clone(): Promise<IDesignItem>;
|
|
22
24
|
allMatching(selectors: string): Generator<IDesignItem, void, undefined>;
|
|
23
25
|
replaceNode(newNode: Node): void;
|
|
@@ -9,7 +9,7 @@ import { DomConverter } from '../widgets/designerView/DomConverter.js';
|
|
|
9
9
|
import { DeleteAction } from '../services/undoService/transactionItems/DeleteAction.js';
|
|
10
10
|
import { enableStylesheetService } from '../widgets/designerView/extensions/buttons/StylesheetServiceDesignViewConfigButtons.js';
|
|
11
11
|
import { AbstractStylesheetService } from '../services/stylesheetService/AbstractStylesheetService.js';
|
|
12
|
-
import { cssFromString } from '@node-projects/base-custom-webcomponent';
|
|
12
|
+
import { TypedEvent, cssFromString } from '@node-projects/base-custom-webcomponent';
|
|
13
13
|
const hideAtDesignTimeAttributeName = 'node-projects-hide-at-design-time';
|
|
14
14
|
const hideAtRunTimeAttributeName = 'node-projects-hide-at-run-time';
|
|
15
15
|
const lockAtDesignTimeAttributeName = 'node-projects-lock-at-design-time';
|
|
@@ -21,6 +21,7 @@ export class DesignItem {
|
|
|
21
21
|
instanceServiceContainer;
|
|
22
22
|
appliedDesignerExtensions = new Map();
|
|
23
23
|
shouldAppliedDesignerExtensions = new Map();
|
|
24
|
+
nodeReplaced = new TypedEvent;
|
|
24
25
|
async clone() {
|
|
25
26
|
try {
|
|
26
27
|
const html = DomConverter.ConvertToString([this], false);
|
|
@@ -8,9 +8,11 @@ import { ISize } from "../../interfaces/ISize.js";
|
|
|
8
8
|
import { IDesignerExtensionProvider } from '../widgets/designerView/extensions/IDesignerExtensionProvider.js';
|
|
9
9
|
import { IStyleRule } from '../services/stylesheetService/IStylesheetService.js';
|
|
10
10
|
import { IPlacementService } from '../services/placementService/IPlacementService.js';
|
|
11
|
+
import { TypedEvent } from '@node-projects/base-custom-webcomponent';
|
|
11
12
|
export interface IDesignItem {
|
|
12
13
|
lastContainerSize: ISize;
|
|
13
14
|
replaceNode(newNode: Node): any;
|
|
15
|
+
nodeReplaced: TypedEvent<void>;
|
|
14
16
|
clone(): Promise<IDesignItem>;
|
|
15
17
|
readonly nodeType: NodeType;
|
|
16
18
|
readonly name: string;
|
package/dist/elements/services/propertiesService/services/AbstractPolymerLikePropertiesService.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { IProperty } from '../IProperty.js';
|
|
|
2
2
|
import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
3
3
|
import { AbstractPropertiesService } from './AbstractPropertiesService.js';
|
|
4
4
|
import { RefreshMode } from '../IPropertiesService.js';
|
|
5
|
+
import { IPropertyGroup } from '../IPropertyGroup.js';
|
|
5
6
|
export declare abstract class AbstractPolymerLikePropertiesService extends AbstractPropertiesService {
|
|
6
7
|
getRefreshMode(designItem: IDesignItem): RefreshMode;
|
|
7
|
-
getProperties(designItem: IDesignItem): IProperty[];
|
|
8
|
+
getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
|
|
8
9
|
protected parseProperties(list: any): IProperty[];
|
|
9
10
|
getUnsetValue(designItems: IDesignItem[], property: IProperty): any;
|
|
10
11
|
}
|
|
@@ -4,12 +4,13 @@ import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
|
4
4
|
import { ValueType } from '../ValueType.js';
|
|
5
5
|
import { IBinding } from "../../../item/IBinding.js";
|
|
6
6
|
import { BindingTarget } from '../../../item/BindingTarget.js';
|
|
7
|
+
import { IPropertyGroup } from '../IPropertyGroup.js';
|
|
7
8
|
export declare class AttributesPropertiesService implements IPropertiesService {
|
|
8
9
|
name: string;
|
|
9
10
|
getRefreshMode(designItem: IDesignItem): RefreshMode;
|
|
10
11
|
isHandledElement(designItem: IDesignItem): boolean;
|
|
11
12
|
getProperty(designItem: IDesignItem, name: string): IProperty;
|
|
12
|
-
getProperties(designItem: IDesignItem): IProperty[];
|
|
13
|
+
getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
|
|
13
14
|
setValue(designItems: IDesignItem[], property: IProperty, value: any): void;
|
|
14
15
|
getPropertyTarget(designItem: IDesignItem, property: IProperty): BindingTarget;
|
|
15
16
|
clearValue(designItems: IDesignItem[], property: IProperty): void;
|
|
@@ -3,6 +3,7 @@ import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
|
3
3
|
import { IJsonPropertyDefinitions } from './IJsonPropertyDefinitions.js';
|
|
4
4
|
import { AbstractPropertiesService } from './AbstractPropertiesService.js';
|
|
5
5
|
import { RefreshMode } from '../IPropertiesService.js';
|
|
6
|
+
import { IPropertyGroup } from '../IPropertyGroup.js';
|
|
6
7
|
export declare class ListPropertiesService extends AbstractPropertiesService {
|
|
7
8
|
getRefreshMode(designItem: IDesignItem): RefreshMode;
|
|
8
9
|
name: string;
|
|
@@ -10,5 +11,5 @@ export declare class ListPropertiesService extends AbstractPropertiesService {
|
|
|
10
11
|
constructor(propertyDefinitions: IJsonPropertyDefinitions);
|
|
11
12
|
isHandledElement(designItem: IDesignItem): boolean;
|
|
12
13
|
protected _notifyChangedProperty(designItem: IDesignItem, property: IProperty, value: any): void;
|
|
13
|
-
getProperties(designItem: IDesignItem): IProperty[];
|
|
14
|
+
getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
|
|
14
15
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IProperty } from '../IProperty.js';
|
|
2
2
|
import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
3
3
|
import { AbstractPolymerLikePropertiesService } from './AbstractPolymerLikePropertiesService.js';
|
|
4
|
+
import { IPropertyGroup } from '../IPropertyGroup.js';
|
|
4
5
|
export declare class Lit2PropertiesService extends AbstractPolymerLikePropertiesService {
|
|
5
6
|
name: string;
|
|
6
7
|
isHandledElement(designItem: IDesignItem): boolean;
|
|
7
|
-
getProperties(designItem: IDesignItem): IProperty[];
|
|
8
|
+
getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
|
|
8
9
|
protected _notifyChangedProperty(designItem: IDesignItem, property: IProperty, value: any): void;
|
|
9
10
|
}
|
package/dist/elements/services/propertiesService/services/NativeElementsPropertiesService.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { IProperty } from '../IProperty.js';
|
|
|
2
2
|
import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
3
3
|
import { CommonPropertiesService } from './CommonPropertiesService.js';
|
|
4
4
|
import { RefreshMode } from '../IPropertiesService.js';
|
|
5
|
+
import { IPropertyGroup } from '../IPropertyGroup.js';
|
|
5
6
|
export declare class NativeElementsPropertiesService extends CommonPropertiesService {
|
|
6
7
|
private inputProperties;
|
|
7
8
|
private textareaProperties;
|
|
@@ -16,5 +17,5 @@ export declare class NativeElementsPropertiesService extends CommonPropertiesSer
|
|
|
16
17
|
getRefreshMode(designItem: IDesignItem): RefreshMode;
|
|
17
18
|
isHandledElement(designItem: IDesignItem): boolean;
|
|
18
19
|
getProperty(designItem: IDesignItem, name: string): IProperty;
|
|
19
|
-
getProperties(designItem: IDesignItem): IProperty[];
|
|
20
|
+
getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
|
|
20
21
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IProperty } from '../IProperty.js';
|
|
2
2
|
import { IDesignItem } from '../../../item/IDesignItem.js';
|
|
3
3
|
import { CommonPropertiesService } from './CommonPropertiesService.js';
|
|
4
|
+
import { IPropertyGroup } from '../IPropertyGroup.js';
|
|
4
5
|
export declare class SVGElementsPropertiesService extends CommonPropertiesService {
|
|
5
6
|
private rectProperties;
|
|
6
7
|
private lineProperties;
|
|
@@ -11,5 +12,5 @@ export declare class SVGElementsPropertiesService extends CommonPropertiesServic
|
|
|
11
12
|
name: string;
|
|
12
13
|
isHandledElement(designItem: IDesignItem): boolean;
|
|
13
14
|
getProperty(designItem: IDesignItem, name: string): IProperty;
|
|
14
|
-
getProperties(designItem: IDesignItem): IProperty[];
|
|
15
|
+
getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
|
|
15
16
|
}
|
package/dist/elements/services/propertiesService/services/WebcomponentManifestPropertiesService.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { BindingTarget } from "../../../item/BindingTarget.js";
|
|
|
2
2
|
import { IDesignItem } from "../../../item/IDesignItem.js";
|
|
3
3
|
import { IPropertiesService, RefreshMode } from "../IPropertiesService.js";
|
|
4
4
|
import { IProperty } from "../IProperty.js";
|
|
5
|
+
import { IPropertyGroup } from "../IPropertyGroup.js";
|
|
5
6
|
import { AbstractPropertiesService } from "./AbstractPropertiesService.js";
|
|
6
7
|
export declare class WebcomponentManifestPropertiesService extends AbstractPropertiesService implements IPropertiesService {
|
|
7
8
|
getRefreshMode(designItem: IDesignItem): RefreshMode;
|
|
@@ -12,7 +13,7 @@ export declare class WebcomponentManifestPropertiesService extends AbstractPrope
|
|
|
12
13
|
private _parseManifest;
|
|
13
14
|
private manifestClassPropertyTypeToEditorPropertyType;
|
|
14
15
|
isHandledElement(designItem: IDesignItem): boolean;
|
|
15
|
-
getProperties(designItem: IDesignItem): IProperty[];
|
|
16
|
+
getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
|
|
16
17
|
getProperty(designItem: IDesignItem, name: string): IProperty;
|
|
17
18
|
getPropertyTarget(designItem: IDesignItem, property: IProperty): BindingTarget;
|
|
18
19
|
getUnsetValue(designItems: IDesignItem[], property: IProperty): any;
|
|
@@ -9,6 +9,7 @@ export declare class PropertyGrid extends BaseCustomWebComponentLazyAppend {
|
|
|
9
9
|
private _propertyGridPropertyLists;
|
|
10
10
|
private _propertyGridPropertyListsDict;
|
|
11
11
|
private _itemsObserver;
|
|
12
|
+
private _nodeReplacedCb;
|
|
12
13
|
private _instanceServiceContainer;
|
|
13
14
|
private _selectionChangedHandler;
|
|
14
15
|
static readonly style: CSSStyleSheet;
|
|
@@ -18,5 +19,5 @@ export declare class PropertyGrid extends BaseCustomWebComponentLazyAppend {
|
|
|
18
19
|
set instanceServiceContainer(value: InstanceServiceContainer);
|
|
19
20
|
get selectedItems(): IDesignItem[];
|
|
20
21
|
set selectedItems(items: IDesignItem[]);
|
|
21
|
-
private
|
|
22
|
+
private _observePrimarySelectionForChanges;
|
|
22
23
|
}
|
|
@@ -9,6 +9,7 @@ export class PropertyGrid extends BaseCustomWebComponentLazyAppend {
|
|
|
9
9
|
_propertyGridPropertyLists;
|
|
10
10
|
_propertyGridPropertyListsDict;
|
|
11
11
|
_itemsObserver;
|
|
12
|
+
_nodeReplacedCb;
|
|
12
13
|
_instanceServiceContainer;
|
|
13
14
|
_selectionChangedHandler;
|
|
14
15
|
static style = css `
|
|
@@ -100,17 +101,21 @@ export class PropertyGrid extends BaseCustomWebComponentLazyAppend {
|
|
|
100
101
|
if (visibleDict.has(a.title))
|
|
101
102
|
a.refreshForDesignItems(items);
|
|
102
103
|
}
|
|
103
|
-
this.
|
|
104
|
+
this._observePrimarySelectionForChanges();
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
else {
|
|
107
108
|
this._itemsObserver.disconnect();
|
|
109
|
+
this._nodeReplacedCb?.dispose();
|
|
110
|
+
this._nodeReplacedCb = null;
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
|
-
|
|
114
|
+
_observePrimarySelectionForChanges() {
|
|
115
|
+
this._nodeReplacedCb?.dispose();
|
|
112
116
|
this._itemsObserver.disconnect();
|
|
113
117
|
this._itemsObserver.observe(this._selectedItems[0].element, { attributes: true, childList: false, characterData: false });
|
|
118
|
+
this._nodeReplacedCb = this._selectedItems[0].nodeReplaced.on(() => this._observePrimarySelectionForChanges());
|
|
114
119
|
}
|
|
115
120
|
}
|
|
116
121
|
customElements.define('node-projects-property-grid', PropertyGrid);
|