@node-projects/web-component-designer 0.0.58 → 0.0.59

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.
@@ -1,6 +1,6 @@
1
1
  export class CssCombiner {
2
2
  static _helperElement = document.createElement('div');
3
- //todo: inset,
3
+ //todo: inset, flex flow, place content...
4
4
  static combine(styles, globalStyles) {
5
5
  let e = CssCombiner._helperElement;
6
6
  e.setAttribute('style', '');
@@ -1,5 +1,6 @@
1
1
  import { CalculateGridInformation } from '../../helper/GridHelper.js';
2
2
  import { pointInRect } from '../../helper/Helper.js';
3
+ import { DefaultPlacementService } from './DefaultPlacementService';
3
4
  export class GridPlacementService {
4
5
  enterContainer(container, items) {
5
6
  for (let i of items) {
@@ -35,7 +36,8 @@ export class GridPlacementService {
35
36
  return container.element.getBoundingClientRect();
36
37
  }
37
38
  placePoint(event, placementView, container, startPoint, offsetInControl, newPoint, items) {
38
- return null;
39
+ const defaultPlacementService = container.serviceContainer.getLastServiceWhere('containerService', x => x instanceof DefaultPlacementService);
40
+ return defaultPlacementService.placePoint(event, placementView, container, startPoint, offsetInControl, newPoint, items);
39
41
  }
40
42
  place(event, placementView, container, startPoint, offsetInControl, newPoint, items) {
41
43
  const gridInformation = CalculateGridInformation(container);
@@ -49,14 +51,23 @@ export class GridPlacementService {
49
51
  column = 0;
50
52
  for (let cell of cellRow) {
51
53
  if (pointInRect(pos, cell)) {
52
- items[0].element.style.gridColumn = column + 1;
53
- items[0].element.style.gridRow = row + 1;
54
+ if (cell.name) {
55
+ items[0].element.style.gridColumn = '';
56
+ items[0].element.style.gridRow = '';
57
+ items[0].element.style.gridArea = cell.name;
58
+ }
59
+ else {
60
+ items[0].element.style.gridArea = '';
61
+ items[0].element.style.gridColumn = column + 1;
62
+ items[0].element.style.gridRow = row + 1;
63
+ }
54
64
  }
55
65
  column++;
56
66
  }
57
67
  row++;
58
68
  }
59
69
  }
70
+ placementView.extensionManager.refreshAllExtensions([container]);
60
71
  }
61
72
  finishPlace(event, placementView, container, startPoint, offsetInControl, newPoint, items) {
62
73
  const gridInformation = CalculateGridInformation(container);
@@ -68,12 +79,21 @@ export class GridPlacementService {
68
79
  column = 0;
69
80
  for (let cell of cellRow) {
70
81
  if (pointInRect(pos, cell)) {
71
- items[0].setStyle('grid-column', column + 1);
72
- items[0].setStyle('grid-row', row + 1);
82
+ if (cell.name) {
83
+ items[0].removeStyle('grid-column');
84
+ items[0].removeStyle('grid-row');
85
+ items[0].setStyle('grid-area', cell.name);
86
+ }
87
+ else {
88
+ items[0].removeStyle('grid-area');
89
+ items[0].setStyle('grid-column', column + 1);
90
+ items[0].setStyle('grid-row', row + 1);
91
+ }
73
92
  }
74
93
  column++;
75
94
  }
76
95
  row++;
77
96
  }
97
+ placementView.extensionManager.refreshAllExtensions([container]);
78
98
  }
79
99
  }
@@ -115,7 +115,10 @@ export class ResizeExtension extends AbstractExtension {
115
115
  break;
116
116
  //for other resize modes we need a replacement
117
117
  }
118
- this.extensionManager.refreshExtensions(this.designerCanvas.instanceServiceContainer.selectionService.selectedElements);
118
+ const resizedElements = [this.extendedItem, this.extendedItem.parent];
119
+ if (this.resizeAllSelected)
120
+ resizedElements.push(...this.designerCanvas.instanceServiceContainer.selectionService.selectedElements);
121
+ this.extensionManager.refreshExtensions(resizedElements);
119
122
  }
120
123
  break;
121
124
  case EventNames.PointerUp:
@@ -34,6 +34,9 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
34
34
  font-size: 12px;
35
35
  height: 20px;
36
36
  }
37
+ #pg {
38
+ height: calc(100% - 45px);
39
+ }
37
40
  `;
38
41
  static template = html `
39
42
  <div>
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.58",
4
+ "version": "0.0.59",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "",