@node-projects/web-component-designer 0.1.21 → 0.1.22

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.
@@ -81,7 +81,7 @@ export declare class DesignItem implements IDesignItem {
81
81
  static GetDesignItem(node: Node): IDesignItem;
82
82
  setStyle(name: string, value?: string | null, important?: boolean): void;
83
83
  removeStyle(name: string): void;
84
- updateStyleInSheetOrLocal(name: string, value?: string | null, important?: boolean): void;
84
+ updateStyleInSheetOrLocal(name: string, value?: string | null, important?: boolean, forceSet?: boolean): void;
85
85
  getStyleFromSheetOrLocal(name: string, fallback?: string): string;
86
86
  getStyleFromSheetOrLocalOrComputed(name: string, fallback?: string): string;
87
87
  getComputedStyle(name: string, fallback?: string): string;
@@ -372,13 +372,13 @@ export class DesignItem {
372
372
  const action = new CssStyleChangeAction(this, nm, '', this._styles.get(nm));
373
373
  this.instanceServiceContainer.undoService.execute(action);
374
374
  }
375
- updateStyleInSheetOrLocal(name, value, important) {
375
+ updateStyleInSheetOrLocal(name, value, important, forceSet) {
376
376
  let nm = PropertiesHelper.camelToDashCase(name);
377
377
  // Pre-sorted by specificity
378
378
  let declarations = this.instanceServiceContainer.stylesheetService?.getDeclarations(this, nm);
379
379
  if (this.hasStyle(name) || this.instanceServiceContainer.designContext.extensionOptions[enableStylesheetService] === false || !declarations?.length) {
380
380
  // Set style locally
381
- if (this.getStyle(nm) != value) {
381
+ if (this.getStyle(nm) != value || forceSet) {
382
382
  this.setStyle(nm, value);
383
383
  }
384
384
  else if (value == null) {
@@ -59,7 +59,7 @@ export interface IDesignItem {
59
59
  hasStyle(name: string): boolean;
60
60
  setStyle(name: string, value?: string | null, important?: boolean): any;
61
61
  removeStyle(name: string): any;
62
- updateStyleInSheetOrLocal(name: string, value?: string | null, important?: boolean): any;
62
+ updateStyleInSheetOrLocal(name: string, value?: string | null, important?: boolean, forceSet?: boolean): any;
63
63
  getStyleFromSheetOrLocal(name: string, fallback?: string): any;
64
64
  getStyleFromSheetOrLocalOrComputed(name: string, fallback?: string): any;
65
65
  getAllStyles(): IStyleRule[];
@@ -23,8 +23,50 @@
23
23
  "unsafe"
24
24
  ]
25
25
  },
26
- "alignItems": {},
27
- "alignSelf": {},
26
+ "alignItems": {
27
+ "type": "list",
28
+ "values": [
29
+ "start",
30
+ "end",
31
+ "flex-start",
32
+ "flex-end",
33
+ "self-start",
34
+ "self-end",
35
+ "center",
36
+ "normal",
37
+ "baseline",
38
+ "first baseline",
39
+ "last baseline",
40
+ "space-between",
41
+ "space-around",
42
+ "space-evenly",
43
+ "stretch",
44
+ "safe",
45
+ "unsafe"
46
+ ]
47
+ },
48
+ "alignSelf": {
49
+ "type": "list",
50
+ "values": [
51
+ "start",
52
+ "end",
53
+ "flex-start",
54
+ "flex-end",
55
+ "self-start",
56
+ "self-end",
57
+ "center",
58
+ "normal",
59
+ "baseline",
60
+ "first baseline",
61
+ "last baseline",
62
+ "space-between",
63
+ "space-around",
64
+ "space-evenly",
65
+ "stretch",
66
+ "safe",
67
+ "unsafe"
68
+ ]
69
+ },
28
70
  "alignmentBaseline": {},
29
71
  "all": {},
30
72
  "animation": {},
@@ -338,9 +380,70 @@
338
380
  "insetInlineEnd": {},
339
381
  "insetInlineStart": {},
340
382
  "isolation": {},
341
- "justifyContent": {},
342
- "justifyItems": {},
343
- "justifySelf": {},
383
+ "justifyContent": {
384
+ "type": "list",
385
+ "values": [
386
+ "start",
387
+ "end",
388
+ "flex-start",
389
+ "flex-end",
390
+ "self-start",
391
+ "self-end",
392
+ "center",
393
+ "normal",
394
+ "baseline",
395
+ "first baseline",
396
+ "last baseline",
397
+ "space-between",
398
+ "space-around",
399
+ "space-evenly",
400
+ "stretch",
401
+ "safe",
402
+ "unsafe"
403
+ ]
404
+ },
405
+ "justifyItems": {
406
+ "type": "list",
407
+ "values": [
408
+ "start",
409
+ "end",
410
+ "flex-start",
411
+ "flex-end",
412
+ "center",
413
+ "normal",
414
+ "baseline",
415
+ "first baseline",
416
+ "last baseline",
417
+ "space-between",
418
+ "space-around",
419
+ "space-evenly",
420
+ "stretch",
421
+ "safe",
422
+ "unsafe"
423
+ ]
424
+ },
425
+ "justifySelf": {
426
+ "type": "list",
427
+ "values": [
428
+ "start",
429
+ "end",
430
+ "flex-start",
431
+ "flex-end",
432
+ "self-start",
433
+ "self-end",
434
+ "center",
435
+ "normal",
436
+ "baseline",
437
+ "first baseline",
438
+ "last baseline",
439
+ "space-between",
440
+ "space-around",
441
+ "space-evenly",
442
+ "stretch",
443
+ "safe",
444
+ "unsafe"
445
+ ]
446
+ },
344
447
  "left": {},
345
448
  "letterSpacing": {},
346
449
  "lightingColor": {
@@ -17,7 +17,8 @@ export class AttributeChangeAction {
17
17
  this.designItem.element.removeAttribute(this.name);
18
18
  }
19
19
  catch (e) {
20
- console.warn(e);
20
+ if (e?.code !== 5)
21
+ console.warn(e);
21
22
  }
22
23
  }
23
24
  else {
@@ -28,7 +29,8 @@ export class AttributeChangeAction {
28
29
  this.designItem.element.setAttribute(this.name, this.oldValue);
29
30
  }
30
31
  catch (e) {
31
- console.warn(e);
32
+ if (e?.code !== 5)
33
+ console.warn(e);
32
34
  }
33
35
  }
34
36
  }
@@ -40,7 +42,8 @@ export class AttributeChangeAction {
40
42
  this.designItem.element.removeAttribute(this.name);
41
43
  }
42
44
  catch (e) {
43
- console.warn(e);
45
+ if (e?.code !== 5)
46
+ console.warn(e);
44
47
  }
45
48
  }
46
49
  else {
@@ -51,7 +54,8 @@ export class AttributeChangeAction {
51
54
  this.designItem.element.setAttribute(this.name, this.newValue);
52
55
  }
53
56
  catch (e) {
54
- console.warn(e);
57
+ if (e?.code !== 5)
58
+ console.warn(e);
55
59
  }
56
60
  }
57
61
  }
@@ -79,7 +79,7 @@ export class EditGridColumnRowSizesExtension extends AbstractExtension {
79
79
  targetPixelSizes[index] -= diff;
80
80
  targetPixelSizes[index + 1] += diff;
81
81
  const newSizes = this._convertCssUnits(targetPixelSizes, units, this.extendedItem.element, sizeType);
82
- this.extendedItem.updateStyleInSheetOrLocal(templatePropertyName, newSizes.join(' '));
82
+ this.extendedItem.updateStyleInSheetOrLocal(templatePropertyName, newSizes.join(' '), null, true);
83
83
  this._initalPos = null;
84
84
  this._initialSizes = null;
85
85
  this.extensionManager.refreshExtensions([this.extendedItem]);
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.21",
4
+ "version": "0.1.22",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "jochen.kuehner@gmx.de",