@node-projects/web-component-designer 0.1.78 → 0.1.79
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.
|
@@ -4,6 +4,9 @@ export class CanvasExtension extends AbstractExtension {
|
|
|
4
4
|
super(extensionManager, designerView, extendedItem);
|
|
5
5
|
}
|
|
6
6
|
extend() {
|
|
7
|
+
this.refresh();
|
|
8
|
+
}
|
|
9
|
+
refresh() {
|
|
7
10
|
const itemRect = this.designerCanvas.getNormalizedElementCoordinates(this.extendedItem.element);
|
|
8
11
|
const computedStyle = getComputedStyle(this.extendedItem.element);
|
|
9
12
|
if (computedStyle.margin !== '0px') {
|
|
@@ -11,16 +14,15 @@ export class CanvasExtension extends AbstractExtension {
|
|
|
11
14
|
const top = Number.parseFloat(computedStyle.marginTop.replace('px', ''));
|
|
12
15
|
const right = Number.parseFloat(computedStyle.marginRight.replace('px', ''));
|
|
13
16
|
const bottom = Number.parseFloat(computedStyle.marginBottom.replace('px', ''));
|
|
14
|
-
this.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
if (this._valuesHaveChanges(left, top, right, bottom, itemRect.x, itemRect.y, itemRect.width, itemRect.height)) {
|
|
18
|
+
this._removeAllOverlays();
|
|
19
|
+
this._drawRect(itemRect.x - left, itemRect.y - top, left + itemRect.width + right, top, 'svg-margin');
|
|
20
|
+
this._drawRect(itemRect.x - left, itemRect.y, left, itemRect.height, 'svg-margin');
|
|
21
|
+
this._drawRect(itemRect.x + itemRect.width, itemRect.y, right, itemRect.height, 'svg-margin');
|
|
22
|
+
this._drawRect(itemRect.x - left, itemRect.y + itemRect.height, left + itemRect.width + right, bottom, 'svg-margin');
|
|
23
|
+
}
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
|
-
refresh() {
|
|
21
|
-
this._removeAllOverlays();
|
|
22
|
-
this.extend();
|
|
23
|
-
}
|
|
24
26
|
dispose() {
|
|
25
27
|
this._removeAllOverlays();
|
|
26
28
|
}
|
|
@@ -313,8 +313,14 @@ export class PointerTool {
|
|
|
313
313
|
if (containerService) {
|
|
314
314
|
if (!this._changeGroup)
|
|
315
315
|
this._changeGroup = designerCanvas.rootDesignItem.openGroup("Move Elements");
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
try {
|
|
317
|
+
containerService.finishPlace(event, designerCanvas, this._actionStartedDesignItem.parent, this._initialPoint, this._initialOffset, cp, designerCanvas.instanceServiceContainer.selectionService.selectedElements);
|
|
318
|
+
this._changeGroup.commit();
|
|
319
|
+
}
|
|
320
|
+
catch (err) {
|
|
321
|
+
console.error(err);
|
|
322
|
+
this._changeGroup.abort();
|
|
323
|
+
}
|
|
318
324
|
this._changeGroup = null;
|
|
319
325
|
let elements = designerCanvas.elementsFromPoint(event.x, event.y);
|
|
320
326
|
for (const item of this._actionStartedDesignItems) {
|
|
@@ -323,6 +329,11 @@ export class PointerTool {
|
|
|
323
329
|
designerCanvas.extensionManager.removeExtension(item, ExtensionType.Placement);
|
|
324
330
|
}
|
|
325
331
|
}
|
|
332
|
+
else {
|
|
333
|
+
if (this._changeGroup)
|
|
334
|
+
this._changeGroup.abort();
|
|
335
|
+
this._changeGroup = null;
|
|
336
|
+
}
|
|
326
337
|
designerCanvas.extensionManager.removeExtension(this._dragExtensionItem, ExtensionType.ContainerDrag);
|
|
327
338
|
this._dragExtensionItem = null;
|
|
328
339
|
designerCanvas.extensionManager.removeExtension(this._dragOverExtensionItem, ExtensionType.ContainerDragOverAndCanBeEntered);
|