@node-projects/web-component-designer 0.0.206 → 0.0.207

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.
@@ -54,7 +54,11 @@ export class CssCurrentPropertiesService extends CommonPropertiesService {
54
54
  setValue(designItems, property, value) {
55
55
  // No selector means local style, styleDeclaration is null means new property
56
56
  if (property.styleRule?.selector !== null && property.styleDeclaration) {
57
- const action = new StylesheetStyleChangeAction(designItems[0].instanceServiceContainer.stylesheetService, property.styleDeclaration, value, property.styleDeclaration.value);
57
+ // styleDeclaration stored Propertygrid is not refreshed after entering a new value, so we need to reload
58
+ // TODO: we do not respect if a same style is found in a media query or another @rule, maybe we need a refresh in the stylesheet parser
59
+ const decls = designItems[0].instanceServiceContainer.stylesheetService?.getDeclarations(designItems[0], property.styleDeclaration.name);
60
+ const currentDecl = decls.find(x => x.parent.selector == property.styleDeclaration.parent.selector && x.parent.stylesheetName == property.styleDeclaration.parent.stylesheetName);
61
+ const action = new StylesheetStyleChangeAction(designItems[0].instanceServiceContainer.stylesheetService, property.styleDeclaration, value, currentDecl.value);
58
62
  designItems[0].instanceServiceContainer.undoService.execute(action);
59
63
  this._notifyChangedProperty(designItems[0], property, value);
60
64
  return;
@@ -80,10 +80,11 @@ export class EditGridColumnRowSizesExtension extends AbstractExtension {
80
80
  }
81
81
  }
82
82
  _convertCssUnits(pixelSizes, targetUnits, target, percentTarget) {
83
+ let cp = getComputedStyle(target);
83
84
  let bounding = target.getBoundingClientRect();
84
85
  let containerSize = bounding[percentTarget];
85
86
  let amountGaps = percentTarget == "height" ? this.gridInformation.cells.length - 1 : this.gridInformation.cells[0].length - 1;
86
- let gapSize = convertCssUnitToPixel(percentTarget == "width" ? target.style.columnGap : target.style.rowGap, target, percentTarget) ?? 0;
87
+ let gapSize = convertCssUnitToPixel(percentTarget == "width" ? cp.columnGap : cp.rowGap, target, percentTarget) ?? 0;
87
88
  let containerSizeWithoutGaps = containerSize - gapSize * amountGaps;
88
89
  let sizeForFrs = containerSizeWithoutGaps;
89
90
  for (let i = 0; i < pixelSizes.length; i++) {
@@ -96,7 +97,7 @@ export class EditGridColumnRowSizesExtension extends AbstractExtension {
96
97
  result.push(convertCssUnit(pixelSizes[i], target, percentTarget, targetUnits[i]));
97
98
  }
98
99
  else {
99
- result.push((pixelSizes[i] / sizeForFrs).toFixed(2) + 'fr');
100
+ result.push(((pixelSizes[i] / sizeForFrs) * 10).toFixed(2) + 'fr');
100
101
  }
101
102
  }
102
103
  return result;
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.206",
4
+ "version": "0.0.207",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "",