@node-projects/web-component-designer 0.1.43 → 0.1.44

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.
@@ -6,8 +6,9 @@ import { CommonPropertiesService } from './CommonPropertiesService.js';
6
6
  import { ValueType } from '../ValueType.js';
7
7
  import { BindingTarget } from '../../../item/BindingTarget.js';
8
8
  export declare class CssCustomPropertiesService extends CommonPropertiesService {
9
+ removeInheritedCustomProperties: boolean;
10
+ constructor(removeInheritedCustomProperties?: boolean);
9
11
  getRefreshMode(designItem: IDesignItem): RefreshMode;
10
- constructor();
11
12
  isHandledElement(designItem: IDesignItem): boolean;
12
13
  getProperty(designItem: IDesignItem, name: string): IProperty;
13
14
  getProperties(designItem: IDesignItem): IProperty[] | IPropertyGroup[];
@@ -4,12 +4,14 @@ import { CommonPropertiesService } from './CommonPropertiesService.js';
4
4
  import { ValueType } from '../ValueType.js';
5
5
  import { BindingTarget } from '../../../item/BindingTarget.js';
6
6
  export class CssCustomPropertiesService extends CommonPropertiesService {
7
- getRefreshMode(designItem) {
8
- return RefreshMode.fullOnValueChange;
9
- }
10
- constructor() {
7
+ removeInheritedCustomProperties;
8
+ constructor(removeInheritedCustomProperties = true) {
11
9
  super();
12
10
  this.name = 'customProperties';
11
+ this.removeInheritedCustomProperties = removeInheritedCustomProperties;
12
+ }
13
+ getRefreshMode(designItem) {
14
+ return RefreshMode.fullOnValueChange;
13
15
  }
14
16
  isHandledElement(designItem) {
15
17
  return true;
@@ -22,7 +24,9 @@ export class CssCustomPropertiesService extends CommonPropertiesService {
22
24
  return null;
23
25
  let rootMap = Array.from(designItem.instanceServiceContainer.designerCanvas.computedStyleMap()).map(x => x[0]).filter(key => key.startsWith("--"));
24
26
  let props = Array.from(designItem.element.computedStyleMap()).map(x => x[0]).filter(key => key.startsWith("--"));
25
- let arr = props.filter(x => !rootMap.includes(x)).map(x => ({
27
+ if (this.removeInheritedCustomProperties)
28
+ props = props.filter(x => !rootMap.includes(x));
29
+ let arr = props.map(x => ({
26
30
  name: x,
27
31
  service: this,
28
32
  propertyType: PropertyType.cssValue
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.1.43",
4
+ "version": "0.1.44",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "jochen.kuehner@gmx.de",