@node-projects/web-component-designer 0.0.99 → 0.0.100

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.
@@ -10,7 +10,7 @@ export class DocumentContainer extends BaseCustomWebComponentLazyAppend {
10
10
  _additionalStyle;
11
11
  set additionalStyleString(style) {
12
12
  this._additionalStyle = style;
13
- this.designerView.additionalStyle = cssFromString(style);
13
+ this.designerView.additionalStyles = [cssFromString(style)];
14
14
  }
15
15
  ;
16
16
  get additionalStyleString() {
@@ -64,7 +64,7 @@ export declare class DesignerCanvas extends BaseCustomWebComponentLazyAppend imp
64
64
  getDesignSurfaceDimensions(): ISize;
65
65
  get designerOffsetWidth(): number;
66
66
  get designerOffsetHeight(): number;
67
- set additionalStyle(value: CSSStyleSheet);
67
+ set additionalStyles(value: CSSStyleSheet[]);
68
68
  executeCommand(command: IUiCommand): Promise<void>;
69
69
  canExecuteCommand(command: IUiCommand): boolean;
70
70
  handleSelectAll(): void;
@@ -3,7 +3,7 @@ import { InstanceServiceContainer } from '../../services/InstanceServiceContaine
3
3
  import { UndoService } from '../../services/undoService/UndoService';
4
4
  import { SelectionService } from '../../services/selectionService/SelectionService';
5
5
  import { DesignItem } from '../../item/DesignItem';
6
- import { BaseCustomWebComponentLazyAppend, css, html, TypedEvent } from '@node-projects/base-custom-webcomponent';
6
+ import { BaseCustomWebComponentLazyAppend, css, html, TypedEvent, cssFromString } from '@node-projects/base-custom-webcomponent';
7
7
  import { dragDropFormatNameElementDefinition, dragDropFormatNameBindingObject } from '../../../Constants';
8
8
  import { ContentService } from '../../services/contentService/ContentService';
9
9
  import { InsertAction } from '../../services/undoService/transactionItems/InsertAction';
@@ -199,21 +199,24 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
199
199
  get designerOffsetHeight() {
200
200
  return this._canvasContainer.offsetHeight;
201
201
  }
202
- set additionalStyle(value) {
202
+ set additionalStyles(value) {
203
203
  if (value) {
204
- for (let r of value.rules) {
205
- if (r instanceof CSSStyleRule) {
206
- let parts = r.selectorText.split(',');
207
- let t = '';
208
- for (let p of parts) {
209
- if (r.selectorText)
210
- t += ',';
211
- t += '#canvas ' + p;
204
+ let style = '';
205
+ for (let s of value) {
206
+ for (let r of s.cssRules) {
207
+ if (r instanceof CSSStyleRule) {
208
+ let parts = r.selectorText.split(',');
209
+ let t = '';
210
+ for (let p of parts) {
211
+ if (t)
212
+ t += ',';
213
+ t += '#node-projects-designer-canvas-canvas ' + p;
214
+ }
215
+ style += t + '{' + r.style.cssText + '}';
212
216
  }
213
- r.selectorText = t;
214
217
  }
215
218
  }
216
- this.shadowRoot.adoptedStyleSheets = [this.constructor.style, value];
219
+ this.shadowRoot.adoptedStyleSheets = [this.constructor.style, cssFromString(style)];
217
220
  }
218
221
  else
219
222
  this.shadowRoot.adoptedStyleSheets = [this.constructor.style];
@@ -29,7 +29,7 @@ export declare class DesignerView extends BaseCustomWebComponentConstructorAppen
29
29
  set designerWidth(value: string);
30
30
  get designerHeight(): string;
31
31
  set designerHeight(value: string);
32
- set additionalStyle(value: CSSStyleSheet);
32
+ set additionalStyles(value: CSSStyleSheet[]);
33
33
  setDesignItems(designItems: IDesignItem[]): void;
34
34
  executeCommand(command: IUiCommand): Promise<void>;
35
35
  canExecuteCommand(command: IUiCommand): boolean;
@@ -297,8 +297,8 @@ export class DesignerView extends BaseCustomWebComponentConstructorAppend {
297
297
  set designerHeight(value) {
298
298
  this._designerCanvas.designerHeight = value;
299
299
  }
300
- set additionalStyle(value) {
301
- this._designerCanvas.additionalStyle = value;
300
+ set additionalStyles(value) {
301
+ this._designerCanvas.additionalStyles = value;
302
302
  }
303
303
  setDesignItems(designItems) {
304
304
  this._designerCanvas.setDesignItems(designItems);
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
- {
2
- "description": "A UI designer for Polymer apps",
3
- "name": "@node-projects/web-component-designer",
4
- "version": "0.0.99",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "author": "",
8
- "license": "MIT",
9
- "scripts": {
10
- "tsc": "tsc",
11
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
12
- "build": "tsc",
13
- "prepublishOnly": "npm run build"
14
- },
15
- "dependencies": {
16
- "@node-projects/base-custom-webcomponent": "^0.9.1",
17
- "construct-style-sheets-polyfill": "^3.1.0"
18
- },
19
- "devDependencies": {
20
- "@node-projects/lean-he-esm": "^3.3.0",
21
- "@node-projects/node-html-parser-esm": "^2.4.1",
22
- "@papyrs/stylo": "^0.0.15",
23
- "@types/codemirror": "^5.60.5",
24
- "@types/jquery": "^3.5.14",
25
- "@types/jquery.fancytree": "0.0.7",
26
- "ace-builds": "^1.4.14",
27
- "codemirror": "^5.65.3",
28
- "esprima-next": "^5.8.1",
29
- "html2canvas": "*",
30
- "jest": "^27.5.1",
31
- "jquery": "^3.6.0",
32
- "jquery.fancytree": "^2.38.1",
33
- "monaco-editor": "^0.33.0",
34
- "ts-jest": "^27.1.4",
35
- "typescript": "^4.6.3",
36
- "typescript-lit-html-plugin": "^0.9.0"
37
- },
38
- "repository": {
39
- "type": "git",
40
- "url": "git+https://github.com/node-projects/web-component-designer.git"
41
- }
42
- }
1
+ {
2
+ "description": "A UI designer for Polymer apps",
3
+ "name": "@node-projects/web-component-designer",
4
+ "version": "0.0.100",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "author": "",
8
+ "license": "MIT",
9
+ "scripts": {
10
+ "tsc": "tsc",
11
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
12
+ "build": "tsc",
13
+ "prepublishOnly": "npm run build"
14
+ },
15
+ "dependencies": {
16
+ "@node-projects/base-custom-webcomponent": "^0.9.1",
17
+ "construct-style-sheets-polyfill": "^3.1.0"
18
+ },
19
+ "devDependencies": {
20
+ "@node-projects/lean-he-esm": "^3.3.0",
21
+ "@node-projects/node-html-parser-esm": "^2.4.1",
22
+ "@papyrs/stylo": "^0.0.26",
23
+ "@types/codemirror": "^5.60.5",
24
+ "@types/jquery": "^3.5.14",
25
+ "@types/jquery.fancytree": "0.0.7",
26
+ "ace-builds": "^1.5.1",
27
+ "codemirror": "^5.65.4",
28
+ "esprima-next": "^5.8.2",
29
+ "html2canvas": "*",
30
+ "jest": "^28.1.0",
31
+ "jquery": "^3.6.0",
32
+ "jquery.fancytree": "^2.38.1",
33
+ "monaco-editor": "^0.33.0",
34
+ "ts-jest": "^28.0.3",
35
+ "typescript": "^4.7.2",
36
+ "typescript-lit-html-plugin": "^0.9.0"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/node-projects/web-component-designer.git"
41
+ }
42
+ }