@node-projects/web-component-designer 0.0.72 → 0.0.73
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.
- package/dist/elements/item/DesignItem.d.ts +5 -1
- package/dist/elements/item/DesignItem.js +56 -29
- package/dist/elements/item/IDesignItem.d.ts +4 -0
- package/dist/elements/services/htmlParserService/NodeHtmlParserService.js +1 -1
- package/dist/elements/services/modelCommandService/DefaultModelCommandService.js +12 -8
- package/dist/elements/services/undoService/transactionItems/DeleteAction.d.ts +1 -3
- package/dist/elements/services/undoService/transactionItems/DeleteAction.js +2 -5
- package/dist/elements/services/undoService/transactionItems/InsertAction.js +1 -1
- package/dist/elements/services/undoService/transactionItems/InsertChildAction.d.ts +16 -0
- package/dist/elements/services/undoService/transactionItems/InsertChildAction.js +31 -0
- package/dist/elements/services/undoService/transactionItems/MoveElementInDomAction copy.d.ts +16 -0
- package/dist/elements/services/undoService/transactionItems/MoveElementInDomAction copy.js +32 -0
- package/dist/elements/widgets/codeView/code-view-monaco.js +3 -3
- package/dist/elements/widgets/designerView/designerCanvas.js +2 -2
- package/dist/elements/widgets/designerView/tools/PointerTool.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -24,12 +24,14 @@ export declare class DesignItem implements IDesignItem {
|
|
|
24
24
|
get id(): string;
|
|
25
25
|
set id(value: string);
|
|
26
26
|
get isRootItem(): boolean;
|
|
27
|
-
|
|
27
|
+
_childArray: IDesignItem[];
|
|
28
28
|
get hasChildren(): boolean;
|
|
29
29
|
children(): IterableIterator<IDesignItem>;
|
|
30
30
|
get childCount(): number;
|
|
31
31
|
get firstChild(): IDesignItem;
|
|
32
32
|
get parent(): IDesignItem;
|
|
33
|
+
indexOf(designItem: IDesignItem): number;
|
|
34
|
+
insertAdjacentElement(designItem: IDesignItem, where: InsertPosition): void;
|
|
33
35
|
insertChild(designItem: IDesignItem, index?: number): void;
|
|
34
36
|
removeChild(designItem: IDesignItem): void;
|
|
35
37
|
remove(): void;
|
|
@@ -57,4 +59,6 @@ export declare class DesignItem implements IDesignItem {
|
|
|
57
59
|
removeStyle(name: string): void;
|
|
58
60
|
setAttribute(name: string, value?: string | null): void;
|
|
59
61
|
removeAttribute(name: string): void;
|
|
62
|
+
_insertChildInternal(designItem: IDesignItem, index?: number): void;
|
|
63
|
+
_removeChildInternal(designItem: IDesignItem): void;
|
|
60
64
|
}
|
|
@@ -2,9 +2,10 @@ import { CssStyleChangeAction } from '../services/undoService/transactionItems/C
|
|
|
2
2
|
import { NodeType } from './NodeType';
|
|
3
3
|
import { AttributeChangeAction } from '../services/undoService/transactionItems/AttributeChangeAction';
|
|
4
4
|
import { ExtensionType } from '../widgets/designerView/extensions/ExtensionType';
|
|
5
|
-
import { DomHelper } from '@node-projects/base-custom-webcomponent/dist/DomHelper';
|
|
6
5
|
import { CssAttributeParser } from '../helper/CssAttributeParser.js';
|
|
7
6
|
import { PropertiesHelper } from '../services/propertiesService/services/PropertiesHelper.js';
|
|
7
|
+
import { InsertChildAction } from '../services/undoService/transactionItems/InsertChildAction';
|
|
8
|
+
import { DeleteAction } from '../..';
|
|
8
9
|
const hideAtDesignTimeAttributeName = 'node-projects-hide-at-design-time';
|
|
9
10
|
const hideAtRunTimeAttributeName = 'node-projects-hide-at-run-time';
|
|
10
11
|
const lockAtDesignTimeAttributeName = 'node-projects-lock-at-design-time';
|
|
@@ -69,44 +70,41 @@ export class DesignItem {
|
|
|
69
70
|
get parent() {
|
|
70
71
|
return this.getOrCreateDesignItem(this.element.parentNode);
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
|
|
73
|
+
indexOf(designItem) {
|
|
74
|
+
return this._childArray.indexOf(designItem);
|
|
75
|
+
}
|
|
76
|
+
insertAdjacentElement(designItem, where) {
|
|
77
|
+
if (where == 'afterbegin') {
|
|
78
|
+
this._insertChildInternal(designItem, 0);
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this._childArray.push(designItem);
|
|
82
|
-
this.element.appendChild(designItem.node);
|
|
80
|
+
else if (where == 'beforeend') {
|
|
81
|
+
this._insertChildInternal(designItem);
|
|
83
82
|
}
|
|
84
|
-
else {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
else if (where == 'beforebegin') {
|
|
84
|
+
this.parent._insertChildInternal(designItem, this.parent.indexOf(this));
|
|
85
|
+
}
|
|
86
|
+
else if (where == 'afterend') {
|
|
87
|
+
this.parent._insertChildInternal(designItem, this.parent.indexOf(this) + 1);
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
}
|
|
90
|
+
insertChild(designItem, index) {
|
|
91
|
+
const action = new InsertChildAction(designItem, this, index);
|
|
92
|
+
this.instanceServiceContainer.undoService.execute(action);
|
|
91
93
|
}
|
|
92
94
|
removeChild(designItem) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
designItem.instanceServiceContainer.designerCanvas.extensionManager.removeExtension(designItem.parent, ExtensionType.PrimarySelectionContainer);
|
|
96
|
-
const index = this._childArray.indexOf(designItem);
|
|
97
|
-
if (index > -1) {
|
|
98
|
-
this._childArray.splice(index, 1);
|
|
99
|
-
designItem.element.remove();
|
|
100
|
-
}
|
|
95
|
+
const action = new DeleteAction([designItem]);
|
|
96
|
+
this.instanceServiceContainer.undoService.execute(action);
|
|
101
97
|
}
|
|
102
98
|
remove() {
|
|
103
|
-
this.parent.
|
|
99
|
+
this.parent._removeChildInternal(this);
|
|
104
100
|
}
|
|
105
101
|
clearChildren() {
|
|
106
|
-
this._childArray
|
|
107
|
-
|
|
102
|
+
for (let i = this._childArray.length - 1; i >= 0; i--) {
|
|
103
|
+
let di = this._childArray[i];
|
|
104
|
+
di.remove();
|
|
105
|
+
}
|
|
108
106
|
}
|
|
109
|
-
//abstract text content to own property. so only
|
|
107
|
+
//abstract text content to own property. so only change via designer api will use it.
|
|
110
108
|
get hasContent() {
|
|
111
109
|
return this.nodeType == NodeType.TextNode || (this._childArray.length === 0 && this.content !== null);
|
|
112
110
|
}
|
|
@@ -259,4 +257,33 @@ export class DesignItem {
|
|
|
259
257
|
const action = new AttributeChangeAction(this, name, null, this.attributes.get(name));
|
|
260
258
|
this.instanceServiceContainer.undoService.execute(action);
|
|
261
259
|
}
|
|
260
|
+
// Internal implementations wich don't use undo/redo
|
|
261
|
+
_insertChildInternal(designItem, index) {
|
|
262
|
+
if (designItem.parent && this.instanceServiceContainer.selectionService.primarySelection == designItem)
|
|
263
|
+
designItem.instanceServiceContainer.designerCanvas.extensionManager.removeExtension(designItem.parent, ExtensionType.PrimarySelectionContainer);
|
|
264
|
+
if (designItem.parent) {
|
|
265
|
+
designItem.parent._removeChildInternal(designItem);
|
|
266
|
+
}
|
|
267
|
+
if (index == null || this._childArray.length == 0 || index >= this._childArray.length) {
|
|
268
|
+
this._childArray.push(designItem);
|
|
269
|
+
this.element.appendChild(designItem.node);
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
let el = this._childArray[index];
|
|
273
|
+
this.node.insertBefore(designItem.node, el.element);
|
|
274
|
+
this._childArray.splice(index, 0, designItem);
|
|
275
|
+
}
|
|
276
|
+
if (this.instanceServiceContainer.selectionService.primarySelection == designItem)
|
|
277
|
+
designItem.instanceServiceContainer.designerCanvas.extensionManager.applyExtension(designItem.parent, ExtensionType.PrimarySelectionContainer);
|
|
278
|
+
}
|
|
279
|
+
_removeChildInternal(designItem) {
|
|
280
|
+
if (designItem.parent && this.instanceServiceContainer.selectionService.primarySelection == designItem)
|
|
281
|
+
designItem.instanceServiceContainer.designerCanvas.extensionManager.removeExtension(designItem.parent, ExtensionType.PrimarySelectionContainer);
|
|
282
|
+
designItem.instanceServiceContainer.designerCanvas.extensionManager.removeExtensions([designItem]);
|
|
283
|
+
const index = this._childArray.indexOf(designItem);
|
|
284
|
+
if (index > -1) {
|
|
285
|
+
this._childArray.splice(index, 1);
|
|
286
|
+
designItem.element.remove();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
262
289
|
}
|
|
@@ -21,6 +21,10 @@ export interface IDesignItem {
|
|
|
21
21
|
readonly childCount: number;
|
|
22
22
|
readonly firstChild: IDesignItem;
|
|
23
23
|
readonly parent: IDesignItem;
|
|
24
|
+
_insertChildInternal(designItem: IDesignItem, index?: number): any;
|
|
25
|
+
_removeChildInternal(designItem: IDesignItem): any;
|
|
26
|
+
indexOf(designItem: IDesignItem): number;
|
|
27
|
+
insertAdjacentElement(designItem: IDesignItem, where: InsertPosition): any;
|
|
24
28
|
insertChild(designItem: IDesignItem, index?: number): any;
|
|
25
29
|
removeChild(designItem: IDesignItem): any;
|
|
26
30
|
remove(): any;
|
|
@@ -70,7 +70,7 @@ export class NodeHtmlParserService {
|
|
|
70
70
|
element.draggable = false; //even if it should be true, for better designer exp.
|
|
71
71
|
for (let c of item.childNodes) {
|
|
72
72
|
let di = this._createDesignItemsRecursive(c, serviceContainer, instanceServiceContainer, element instanceof SVGElement ? 'http://www.w3.org/2000/svg' : null);
|
|
73
|
-
designItem.
|
|
73
|
+
designItem._insertChildInternal(di);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
else if (item.nodeType == 3) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { CommandType } from "../../../commandHandling/CommandType.js";
|
|
2
|
-
import { DesignItem } from "../../item/DesignItem.js";
|
|
3
|
-
import { MoveElementInDomAction } from "../undoService/transactionItems/MoveElementInDomAction.js";
|
|
4
2
|
export class DefaultModelCommandService {
|
|
5
3
|
canExecuteCommand(designerCanvas, command) {
|
|
6
4
|
if (command.type == CommandType.moveBackward ||
|
|
@@ -21,14 +19,20 @@ export class DefaultModelCommandService {
|
|
|
21
19
|
}
|
|
22
20
|
async executeCommand(designerCanvas, command) {
|
|
23
21
|
let sel = designerCanvas.instanceServiceContainer.selectionService.primarySelection;
|
|
24
|
-
if (command.type == CommandType.moveBackward)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (command.type == CommandType.moveBackward) {
|
|
23
|
+
let idx = sel.parent.indexOf(sel) - 1;
|
|
24
|
+
if (idx >= 0)
|
|
25
|
+
sel.parent.insertChild(sel, idx);
|
|
26
|
+
}
|
|
27
|
+
else if (command.type == CommandType.moveForward) {
|
|
28
|
+
let idx = sel.parent.indexOf(sel) + 1;
|
|
29
|
+
if (idx < sel.parent.childCount)
|
|
30
|
+
sel.parent.insertChild(sel, idx);
|
|
31
|
+
}
|
|
28
32
|
else if (command.type == CommandType.moveToBack)
|
|
29
|
-
|
|
33
|
+
sel.parent.insertChild(sel, 0);
|
|
30
34
|
else if (command.type == CommandType.moveToFront)
|
|
31
|
-
|
|
35
|
+
sel.parent.insertChild(sel);
|
|
32
36
|
else if (command.type == CommandType.arrangeLeft) {
|
|
33
37
|
const grp = designerCanvas.instanceServiceContainer.selectionService.primarySelection.openGroup('arrangeLeft');
|
|
34
38
|
const left = designerCanvas.instanceServiceContainer.selectionService.primarySelection.styles.get('left');
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { ITransactionItem } from '../ITransactionItem';
|
|
2
2
|
import { IDesignItem } from '../../../item/IDesignItem';
|
|
3
|
-
import { IExtensionManager } from '../../../widgets/designerView/extensions/IExtensionManger';
|
|
4
3
|
export declare class DeleteAction implements ITransactionItem {
|
|
5
|
-
constructor(deletedItems: IDesignItem[]
|
|
4
|
+
constructor(deletedItems: IDesignItem[]);
|
|
6
5
|
title?: string;
|
|
7
6
|
get affectedItems(): IDesignItem[];
|
|
8
7
|
undo(): void;
|
|
9
8
|
do(): void;
|
|
10
9
|
deletedItems: IDesignItem[];
|
|
11
|
-
extensionManager: IExtensionManager;
|
|
12
10
|
private _parentItems;
|
|
13
11
|
private _parentIndexes;
|
|
14
12
|
mergeWith(other: ITransactionItem): boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { DomHelper } from '@node-projects/base-custom-webcomponent/dist/DomHelper';
|
|
2
2
|
export class DeleteAction {
|
|
3
|
-
constructor(deletedItems
|
|
3
|
+
constructor(deletedItems) {
|
|
4
4
|
this.title = "Delete Items";
|
|
5
5
|
this.deletedItems = deletedItems;
|
|
6
|
-
this.extensionManager = extensionManager;
|
|
7
6
|
}
|
|
8
7
|
title;
|
|
9
8
|
get affectedItems() {
|
|
@@ -11,7 +10,7 @@ export class DeleteAction {
|
|
|
11
10
|
}
|
|
12
11
|
undo() {
|
|
13
12
|
for (let n = 0; n < this.deletedItems.length; n++) {
|
|
14
|
-
this._parentItems[n].
|
|
13
|
+
this._parentItems[n]._insertChildInternal(this.deletedItems[n], this._parentIndexes[n]);
|
|
15
14
|
}
|
|
16
15
|
this.affectedItems[0].instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'added', designItems: this.deletedItems });
|
|
17
16
|
}
|
|
@@ -25,11 +24,9 @@ export class DeleteAction {
|
|
|
25
24
|
for (let n = 0; n < this.deletedItems.length; n++) {
|
|
26
25
|
this.deletedItems[n].remove();
|
|
27
26
|
}
|
|
28
|
-
this.extensionManager.removeExtensions(this.deletedItems);
|
|
29
27
|
this.affectedItems[0].instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'removed', designItems: this.deletedItems });
|
|
30
28
|
}
|
|
31
29
|
deletedItems;
|
|
32
|
-
extensionManager;
|
|
33
30
|
_parentItems;
|
|
34
31
|
_parentIndexes;
|
|
35
32
|
mergeWith(other) {
|
|
@@ -14,7 +14,7 @@ export class InsertAction {
|
|
|
14
14
|
this.affectedItems[0].instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'removed', designItems: [this.newItem] });
|
|
15
15
|
}
|
|
16
16
|
do() {
|
|
17
|
-
this.designItem.
|
|
17
|
+
this.designItem._insertChildInternal(this.newItem, this.index);
|
|
18
18
|
const prepService = this.designItem.serviceContainer.prepareElementsForDesignerService;
|
|
19
19
|
if (prepService)
|
|
20
20
|
requestAnimationFrame(() => prepService.prepareElementsForDesigner(this.newItem));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ITransactionItem } from '../ITransactionItem';
|
|
2
|
+
import { IDesignItem } from '../../../item/IDesignItem';
|
|
3
|
+
export declare class InsertChildAction implements ITransactionItem {
|
|
4
|
+
constructor(designItem: IDesignItem, newParent: IDesignItem, newIndex: number);
|
|
5
|
+
title?: string;
|
|
6
|
+
get affectedItems(): IDesignItem[];
|
|
7
|
+
undo(): void;
|
|
8
|
+
do(): void;
|
|
9
|
+
designItem: IDesignItem;
|
|
10
|
+
newParent: IDesignItem;
|
|
11
|
+
newIndex: number;
|
|
12
|
+
oldParent: IDesignItem;
|
|
13
|
+
oldIndex: number;
|
|
14
|
+
newItem: IDesignItem;
|
|
15
|
+
mergeWith(other: ITransactionItem): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class InsertChildAction {
|
|
2
|
+
constructor(designItem, newParent, newIndex) {
|
|
3
|
+
this.title = "Move Item";
|
|
4
|
+
this.designItem = designItem;
|
|
5
|
+
this.newParent = newParent;
|
|
6
|
+
this.newIndex = newIndex;
|
|
7
|
+
}
|
|
8
|
+
title;
|
|
9
|
+
get affectedItems() {
|
|
10
|
+
return [this.designItem, this.newParent, this.oldParent];
|
|
11
|
+
}
|
|
12
|
+
undo() {
|
|
13
|
+
this.oldParent._insertChildInternal(this.designItem, this.newIndex);
|
|
14
|
+
this.affectedItems[0].instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'moved', designItems: [this.designItem] });
|
|
15
|
+
}
|
|
16
|
+
do() {
|
|
17
|
+
this.oldParent = this.designItem.parent;
|
|
18
|
+
this.oldIndex = this.designItem.parent.indexOf(this.designItem);
|
|
19
|
+
this.newParent._insertChildInternal(this.designItem, this.newIndex);
|
|
20
|
+
this.affectedItems[0].instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'moved', designItems: [this.designItem] });
|
|
21
|
+
}
|
|
22
|
+
designItem;
|
|
23
|
+
newParent;
|
|
24
|
+
newIndex;
|
|
25
|
+
oldParent;
|
|
26
|
+
oldIndex;
|
|
27
|
+
newItem;
|
|
28
|
+
mergeWith(other) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ITransactionItem } from '../ITransactionItem';
|
|
2
|
+
import { IDesignItem } from '../../../item/IDesignItem';
|
|
3
|
+
export declare class MoveElementInDomAction implements ITransactionItem {
|
|
4
|
+
constructor(designItem: IDesignItem, newTarget: IDesignItem, newPosition: InsertPosition, oldTarget: IDesignItem, oldPosition: InsertPosition);
|
|
5
|
+
title?: string;
|
|
6
|
+
get affectedItems(): IDesignItem[];
|
|
7
|
+
undo(): void;
|
|
8
|
+
do(): void;
|
|
9
|
+
designItem: IDesignItem;
|
|
10
|
+
newTarget: IDesignItem;
|
|
11
|
+
newPosition: InsertPosition;
|
|
12
|
+
oldTarget: IDesignItem;
|
|
13
|
+
oldPosition: InsertPosition;
|
|
14
|
+
newItem: IDesignItem;
|
|
15
|
+
mergeWith(other: ITransactionItem): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class MoveElementInDomAction {
|
|
2
|
+
constructor(designItem, newTarget, newPosition, oldTarget, oldPosition) {
|
|
3
|
+
this.title = "Move Item";
|
|
4
|
+
this.designItem = designItem;
|
|
5
|
+
this.newTarget = newTarget;
|
|
6
|
+
this.newPosition = newPosition;
|
|
7
|
+
this.oldTarget = oldTarget;
|
|
8
|
+
this.oldPosition = oldPosition;
|
|
9
|
+
}
|
|
10
|
+
title;
|
|
11
|
+
get affectedItems() {
|
|
12
|
+
return [this.designItem, this.newTarget, this.oldTarget];
|
|
13
|
+
}
|
|
14
|
+
undo() {
|
|
15
|
+
this.oldTarget.element.insertAdjacentElement(this.oldPosition, this.designItem.element);
|
|
16
|
+
this.affectedItems[0].instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'moved', designItems: [this.designItem] });
|
|
17
|
+
}
|
|
18
|
+
do() {
|
|
19
|
+
//this.newTarget.insertChild(this.designItem, )
|
|
20
|
+
this.newTarget.element.insertAdjacentElement(this.newPosition, this.designItem.element);
|
|
21
|
+
this.affectedItems[0].instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'moved', designItems: [this.designItem] });
|
|
22
|
+
}
|
|
23
|
+
designItem;
|
|
24
|
+
newTarget;
|
|
25
|
+
newPosition;
|
|
26
|
+
oldTarget;
|
|
27
|
+
oldPosition;
|
|
28
|
+
newItem;
|
|
29
|
+
mergeWith(other) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -19,7 +19,7 @@ export class CodeViewMonaco extends BaseCustomWebComponentLazyAppend {
|
|
|
19
19
|
`;
|
|
20
20
|
static template = html `
|
|
21
21
|
<style>@import "./node_modules/monaco-editor/min/vs/editor/editor.main.css";</style>
|
|
22
|
-
<div id="container" style="width: 100%; height: 100%;"></div>
|
|
22
|
+
<div id="container" style="width: 100%; height: 100%; position: absolute;"></div>
|
|
23
23
|
`;
|
|
24
24
|
executeCommand(command) {
|
|
25
25
|
switch (command.type) {
|
|
@@ -65,9 +65,9 @@ export class CodeViewMonaco extends BaseCustomWebComponentLazyAppend {
|
|
|
65
65
|
value: this.code,
|
|
66
66
|
language: 'html',
|
|
67
67
|
minimap: {
|
|
68
|
-
//@ts-ignore
|
|
69
68
|
size: 'fill'
|
|
70
|
-
}
|
|
69
|
+
},
|
|
70
|
+
fixedOverflowWidgets: true
|
|
71
71
|
});
|
|
72
72
|
this._monacoEditor.layout();
|
|
73
73
|
let changeContentListener = this._monacoEditor.getModel().onDidChangeContent(e => {
|
|
@@ -290,7 +290,7 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
|
290
290
|
}
|
|
291
291
|
handleDeleteCommand() {
|
|
292
292
|
let items = this.instanceServiceContainer.selectionService.selectedElements;
|
|
293
|
-
this.instanceServiceContainer.undoService.execute(new DeleteAction(items
|
|
293
|
+
this.instanceServiceContainer.undoService.execute(new DeleteAction(items));
|
|
294
294
|
this.instanceServiceContainer.selectionService.setSelectedElements(null);
|
|
295
295
|
}
|
|
296
296
|
initialize(serviceContainer) {
|
|
@@ -362,7 +362,7 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
|
362
362
|
addDesignItems(designItems) {
|
|
363
363
|
if (designItems) {
|
|
364
364
|
for (let di of designItems) {
|
|
365
|
-
this.rootDesignItem.
|
|
365
|
+
this.rootDesignItem._insertChildInternal(di);
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
const intializationService = this.serviceContainer.intializationService;
|
|
@@ -281,7 +281,7 @@ export class PointerTool {
|
|
|
281
281
|
const newOffset = newContainerService.getElementOffset(newContainerElementDesignItem, this._actionStartedDesignItem);
|
|
282
282
|
this._moveItemsOffset = { x: newOffset.x - oldOffset.x + this._moveItemsOffset.x, y: newOffset.y - oldOffset.y + this._moveItemsOffset.y };
|
|
283
283
|
currentContainerService.leaveContainer(this._actionStartedDesignItem.parent, [this._actionStartedDesignItem]);
|
|
284
|
-
newContainerElementDesignItem.
|
|
284
|
+
newContainerElementDesignItem._insertChildInternal(this._actionStartedDesignItem);
|
|
285
285
|
const cp = { x: currentPoint.x - this._moveItemsOffset.x, y: currentPoint.y - this._moveItemsOffset.y };
|
|
286
286
|
newContainerService.enterContainer(newContainerElementDesignItem, [this._actionStartedDesignItem]);
|
|
287
287
|
newContainerService.place(event, designerCanvas, this._actionStartedDesignItem.parent, this._initialPoint, this._initialOffset, cp, designerCanvas.instanceServiceContainer.selectionService.selectedElements);
|
package/dist/index.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ export * from "./elements/services/undoService/transactionItems/AttributeChangeA
|
|
|
80
80
|
export * from "./elements/services/undoService/transactionItems/CssStyleChangeAction.js";
|
|
81
81
|
export * from "./elements/services/undoService/transactionItems/DeleteAction.js";
|
|
82
82
|
export * from "./elements/services/undoService/transactionItems/InsertAction.js";
|
|
83
|
-
export * from "./elements/services/undoService/transactionItems/
|
|
83
|
+
export * from "./elements/services/undoService/transactionItems/InsertChildAction.js";
|
|
84
84
|
export * from "./elements/services/undoService/transactionItems/PropertyChangeAction.js";
|
|
85
85
|
export * from "./elements/services/BaseServiceContainer.js";
|
|
86
86
|
export * from "./elements/services/InstanceServiceContainer.js";
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ export * from "./elements/services/undoService/transactionItems/AttributeChangeA
|
|
|
49
49
|
export * from "./elements/services/undoService/transactionItems/CssStyleChangeAction.js";
|
|
50
50
|
export * from "./elements/services/undoService/transactionItems/DeleteAction.js";
|
|
51
51
|
export * from "./elements/services/undoService/transactionItems/InsertAction.js";
|
|
52
|
-
export * from "./elements/services/undoService/transactionItems/
|
|
52
|
+
export * from "./elements/services/undoService/transactionItems/InsertChildAction.js";
|
|
53
53
|
export * from "./elements/services/undoService/transactionItems/PropertyChangeAction.js";
|
|
54
54
|
export * from "./elements/services/BaseServiceContainer.js";
|
|
55
55
|
export * from "./elements/services/InstanceServiceContainer.js";
|