@node-projects/web-component-designer 0.0.86 → 0.0.89

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.
Files changed (55) hide show
  1. package/dist/elements/controls/PlainScrollbar.js +122 -116
  2. package/dist/elements/controls/SimpleSplitView.js +1 -1
  3. package/dist/elements/documentContainer.js +2 -0
  4. package/dist/elements/helper/ElementHelper.d.ts +1 -0
  5. package/dist/elements/helper/ElementHelper.js +10 -0
  6. package/dist/elements/item/DesignItem.d.ts +2 -0
  7. package/dist/elements/item/DesignItem.js +7 -0
  8. package/dist/elements/item/IDesignItem.d.ts +1 -0
  9. package/dist/elements/services/DefaultServiceBootstrap.js +0 -4
  10. package/dist/elements/services/ServiceContainer.d.ts +1 -3
  11. package/dist/elements/services/ServiceContainer.js +8 -3
  12. package/dist/elements/services/htmlParserService/NodeHtmlParserService.js +8 -0
  13. package/dist/elements/services/initializationService/DefaultIntializationService.js +12 -12
  14. package/dist/elements/services/instanceService/PrepareElementsForDesignerService.js +23 -23
  15. package/dist/elements/services/undoService/UndoService.js +3 -2
  16. package/dist/elements/services/undoService/transactionItems/InsertAction.js +0 -3
  17. package/dist/elements/widgets/designerView/IDesignerCanvas.d.ts +8 -0
  18. package/dist/elements/widgets/designerView/designerCanvas.d.ts +13 -1
  19. package/dist/elements/widgets/designerView/designerCanvas.js +129 -39
  20. package/dist/elements/widgets/designerView/designerCanvas.ts.BASE.d.ts +92 -0
  21. package/dist/elements/widgets/designerView/designerCanvas.ts.BASE.js +734 -0
  22. package/dist/elements/widgets/designerView/designerCanvas.ts.LOCAL.d.ts +95 -0
  23. package/dist/elements/widgets/designerView/designerCanvas.ts.LOCAL.js +768 -0
  24. package/dist/elements/widgets/designerView/designerCanvas.ts.REMOTE.d.ts +94 -0
  25. package/dist/elements/widgets/designerView/designerCanvas.ts.REMOTE.js +745 -0
  26. package/dist/elements/widgets/designerView/designerView.js +19 -15
  27. package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtension copy.d.ts +17 -0
  28. package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtension copy.js +80 -0
  29. package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtension.js +4 -2
  30. package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtensionProvider copy.d.ts +9 -0
  31. package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtensionProvider copy.js +11 -0
  32. package/dist/elements/widgets/designerView/extensions/EditText/EditTextWithStyloExtension.d.ts +20 -0
  33. package/dist/elements/widgets/designerView/extensions/EditText/EditTextWithStyloExtension.js +83 -0
  34. package/dist/elements/widgets/designerView/extensions/EditText/EditTextWithStyloExtensionProvider.d.ts +10 -0
  35. package/dist/elements/widgets/designerView/extensions/EditText/EditTextWithStyloExtensionProvider.js +15 -0
  36. package/dist/elements/widgets/designerView/extensions/ElementDragTitleExtension.js +2 -2
  37. package/dist/elements/widgets/designerView/extensions/PathExtension.js +2 -5
  38. package/dist/elements/widgets/designerView/extensions/ResizeExtension.js +2 -1
  39. package/dist/elements/widgets/designerView/extensions/TransformOriginExtension.js +1 -0
  40. package/dist/elements/widgets/designerView/tools/DrawEllipsisTool.js +1 -0
  41. package/dist/elements/widgets/designerView/tools/DrawLineTool.js +1 -0
  42. package/dist/elements/widgets/designerView/tools/DrawPathTool.js +1 -0
  43. package/dist/elements/widgets/designerView/tools/DrawRectTool.js +1 -0
  44. package/dist/elements/widgets/designerView/tools/MagicWandSelectorTool.js +10 -9
  45. package/dist/elements/widgets/designerView/tools/PanTool.js +1 -0
  46. package/dist/elements/widgets/designerView/tools/PointerTool.js +4 -2
  47. package/dist/elements/widgets/designerView/tools/RectangleSelectorTool.js +10 -9
  48. package/dist/elements/widgets/designerView/tools/ZoomTool.d.ts +8 -1
  49. package/dist/elements/widgets/designerView/tools/ZoomTool.js +69 -0
  50. package/dist/elements/widgets/paletteView/paletteTreeView.js +5 -0
  51. package/dist/elements/widgets/treeView/treeView.js +1 -0
  52. package/dist/elements/widgets/treeView/treeViewExtended.js +21 -20
  53. package/dist/index.d.ts +4 -4
  54. package/dist/index.js +4 -3
  55. package/package.json +5 -4
@@ -0,0 +1,745 @@
1
+ import { EventNames } from "../../../enums/EventNames";
2
+ import { InstanceServiceContainer } from '../../services/InstanceServiceContainer';
3
+ import { UndoService } from '../../services/undoService/UndoService';
4
+ import { SelectionService } from '../../services/selectionService/SelectionService';
5
+ import { DesignItem } from '../../item/DesignItem';
6
+ import { BaseCustomWebComponentLazyAppend, css, html, TypedEvent } from '@node-projects/base-custom-webcomponent';
7
+ import { dragDropFormatNameElementDefinition, dragDropFormatNameBindingObject } from '../../../Constants';
8
+ import { ContentService } from '../../services/contentService/ContentService';
9
+ import { InsertAction } from '../../services/undoService/transactionItems/InsertAction';
10
+ import { Snaplines } from './Snaplines';
11
+ import { ContextMenuHelper } from '../../helper/contextMenu/ContextMenuHelper';
12
+ import { DeleteAction } from '../../services/undoService/transactionItems/DeleteAction';
13
+ import { CommandType } from '../../../commandHandling/CommandType';
14
+ import { DefaultHtmlParserService } from "../../services/htmlParserService/DefaultHtmlParserService";
15
+ import { ExtensionType } from "./extensions/ExtensionType";
16
+ import { ExtensionManager } from "./extensions/ExtensionManager";
17
+ import { NamedTools } from "./tools/NamedTools";
18
+ import { Screenshot } from '../../helper/Screenshot';
19
+ import { dataURItoBlob, exportData } from "../../helper/Helper";
20
+ import { DomHelper } from '@node-projects/base-custom-webcomponent/dist/DomHelper';
21
+ import { OverlayLayer } from "./extensions/OverlayLayer";
22
+ import { OverlayLayerView } from './overlayLayerView';
23
+ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
24
+ // Public Properties
25
+ serviceContainer;
26
+ instanceServiceContainer;
27
+ containerBoundingRect;
28
+ outerRect;
29
+ // IPlacementView
30
+ gridSize = 10;
31
+ alignOnGrid = false;
32
+ alignOnSnap = true;
33
+ snapLines;
34
+ overlayLayer;
35
+ rootDesignItem;
36
+ eatEvents;
37
+ transformHelperElement;
38
+ _zoomFactor = 1; //if scale or zoom css property is used this needs to be the value
39
+ _scaleFactor = 1; //if scale css property is used this need to be the scale value
40
+ _canvasOffset = { x: 0, y: 0 };
41
+ get zoomFactor() {
42
+ return this._zoomFactor;
43
+ }
44
+ set zoomFactor(value) {
45
+ this._zoomFactor = value;
46
+ this.zoomFactorChanged();
47
+ }
48
+ get scaleFactor() {
49
+ return this._scaleFactor;
50
+ }
51
+ get canvasOffset() {
52
+ return this._canvasOffset;
53
+ }
54
+ set canvasOffset(value) {
55
+ this._canvasOffset = value;
56
+ this.zoomFactorChanged();
57
+ }
58
+ onContentChanged = new TypedEvent();
59
+ // Private Variables
60
+ _canvas;
61
+ _canvasContainer;
62
+ _outercanvas2;
63
+ _lastHoverDesignItem;
64
+ _onContextMenuBound;
65
+ _pointerEventHandlerBound;
66
+ _firstConnect;
67
+ _onKeyDownBound;
68
+ _onKeyUpBound;
69
+ static style = css `
70
+ :host {
71
+ display: block;
72
+ box-sizing: border-box;
73
+ width: 100%;
74
+ position: relative;
75
+ transform: translateZ(0);
76
+ overflow: hidden;
77
+
78
+ font-family: initial;
79
+ font-size: initial;
80
+ font-weight: initial;
81
+ font-style: initial;
82
+ line-height: initial;
83
+ }
84
+ * {
85
+ touch-action: none;
86
+ }
87
+ #node-projects-designer-canvas-canvas {
88
+ background-color: var(--canvas-background, white);
89
+ /* 10px grid, using http://www.patternify.com/ */
90
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/q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+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFFJREFUeNpicChb7DAQmMGhbLHD////GQjh8nW3qapu1OJRi0ctHiYWl6+7TRAnLbxCVXWjcTxq8ajFoxaPllyjcTxq8ajFI8hiAAAAAP//AwCQfdyctxBQfwAAAABJRU5ErkJggg==);
91
+ background-position: 0px 0px;
92
+ box-sizing: border-box;
93
+ width: 100%;
94
+ height: 100%;
95
+ transform-origin: 0 0;
96
+ }
97
+
98
+ #node-projects-designer-canvas-canvas.dragFileActive {
99
+ outline: blue 4px solid;
100
+ outline-offset: -4px;
101
+ }
102
+
103
+ node-projects-overlay-layer-view {
104
+ box-sizing: border-box;
105
+ width: 100%;
106
+ height: 100%;
107
+ position: absolute;
108
+ top: 0;
109
+ left: 0;
110
+ pointer-events: none;
111
+ overflow: visible;
112
+ user-select: none;
113
+ -webkit-user-select: none;
114
+ z-index: 999999999999;
115
+ }
116
+
117
+ #node-projects-designer-canvas-canvas * {
118
+ cursor: pointer;
119
+ user-select: none;
120
+ -webkit-user-select: none;
121
+ }
122
+
123
+ #transformHelper {
124
+ height: 0;
125
+ width: 0;
126
+ }`;
127
+ static template = html `
128
+ <div style="display: flex;flex-direction: column;width: 100%;height: 100%;">
129
+ <div style="width: 100%;height: 100%;">
130
+ <div id="node-projects-designer-canvas-outercanvas2" style="width:100%;height:100%;position:relative;">
131
+ <div id="node-projects-designer-canvas-canvasContainer"
132
+ style="width: 100%;height: 100%;margin: auto;position: absolute;top: 0;/* bottom: 0; does not work with fixed sized when size is bigger then view */left: 0;user-select: none;">
133
+ <div id="node-projects-designer-canvas-canvas" part="canvas" tabindex="0"></div>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ <div id="transformHelper"></div>
138
+ </div>`;
139
+ extensionManager;
140
+ _pointerextensions;
141
+ _onDblClickBound;
142
+ constructor() {
143
+ super();
144
+ this._canvas = this._getDomElement('node-projects-designer-canvas-canvas');
145
+ this._canvasContainer = this._getDomElement('node-projects-designer-canvas-canvasContainer');
146
+ this._outercanvas2 = this._getDomElement('node-projects-designer-canvas-outercanvas2');
147
+ this.transformHelperElement = this._getDomElement('transformHelper');
148
+ this._onKeyDownBound = this.onKeyDown.bind(this);
149
+ this._onKeyUpBound = this.onKeyUp.bind(this);
150
+ this._onDblClickBound = this._onDblClick.bind(this);
151
+ this._onContextMenuBound = this._onContextMenu.bind(this);
152
+ this._pointerEventHandlerBound = this._pointerEventHandler.bind(this);
153
+ this._canvas.oncontextmenu = this._onContextMenuBound;
154
+ }
155
+ get designerWidth() {
156
+ return this._canvasContainer.style.width;
157
+ }
158
+ set designerWidth(value) {
159
+ this._canvasContainer.style.width = value;
160
+ this.zoomFactorChanged();
161
+ }
162
+ get designerHeight() {
163
+ return this._canvasContainer.style.height;
164
+ }
165
+ set designerHeight(value) {
166
+ this._canvasContainer.style.height = value;
167
+ this.zoomFactorChanged();
168
+ }
169
+ get designerOffsetWidth() {
170
+ return this._canvasContainer.offsetWidth;
171
+ }
172
+ get designerOffsetHeight() {
173
+ return this._canvasContainer.offsetHeight;
174
+ }
175
+ set additionalStyle(value) {
176
+ if (value) {
177
+ for (let r of value.rules) {
178
+ if (r instanceof CSSStyleRule) {
179
+ let parts = r.selectorText.split(',');
180
+ let t = '';
181
+ for (let p of parts) {
182
+ if (r.selectorText)
183
+ t += ',';
184
+ t += '#canvas ' + p;
185
+ }
186
+ r.selectorText = t;
187
+ }
188
+ }
189
+ this.shadowRoot.adoptedStyleSheets = [this.constructor.style, value];
190
+ }
191
+ else
192
+ this.shadowRoot.adoptedStyleSheets = [this.constructor.style];
193
+ }
194
+ /* --- start IUiCommandHandler --- */
195
+ async executeCommand(command) {
196
+ const modelCommandService = this.serviceContainer.modelCommandService;
197
+ if (modelCommandService) {
198
+ let handeled = await modelCommandService.executeCommand(this, command);
199
+ if (handeled != null)
200
+ return;
201
+ }
202
+ switch (command.type) {
203
+ case CommandType.screenshot:
204
+ {
205
+ if (!this.instanceServiceContainer.selectionService.primarySelection)
206
+ alert("you need to select an element!");
207
+ else {
208
+ if (!Screenshot.screenshotsEnabled) {
209
+ alert("you need to select current tab in next browser dialog, or screenshots will not work correctly");
210
+ }
211
+ const el = this.instanceServiceContainer.selectionService.primarySelection.element;
212
+ const sel = this.instanceServiceContainer.selectionService.selectedElements;
213
+ this.instanceServiceContainer.selectionService.setSelectedElements(null);
214
+ const screenshot = await Screenshot.takeScreenshot(el, el.clientWidth, el.clientHeight);
215
+ await exportData(dataURItoBlob(screenshot), "screenshot.png");
216
+ this.instanceServiceContainer.selectionService.setSelectedElements(sel);
217
+ }
218
+ }
219
+ break;
220
+ case CommandType.setTool:
221
+ {
222
+ this.serviceContainer.globalContext.tool = this.serviceContainer.designerTools.get(command.parameter);
223
+ }
224
+ break;
225
+ case CommandType.setStrokeColor:
226
+ {
227
+ this.serviceContainer.globalContext.strokeColor = command.parameter;
228
+ }
229
+ break;
230
+ case CommandType.setFillBrush:
231
+ {
232
+ this.serviceContainer.globalContext.fillBrush = command.parameter;
233
+ }
234
+ break;
235
+ case CommandType.setStrokeThickness:
236
+ {
237
+ this.serviceContainer.globalContext.strokeThickness = command.parameter;
238
+ }
239
+ break;
240
+ case CommandType.delete:
241
+ this.handleDeleteCommand();
242
+ break;
243
+ case CommandType.undo:
244
+ this.instanceServiceContainer.undoService.undo();
245
+ break;
246
+ case CommandType.redo:
247
+ this.instanceServiceContainer.undoService.redo();
248
+ break;
249
+ case CommandType.copy:
250
+ this.handleCopyCommand();
251
+ break;
252
+ case CommandType.cut:
253
+ this.handleCopyCommand();
254
+ this.handleDeleteCommand();
255
+ break;
256
+ case CommandType.paste:
257
+ this.handlePasteCommand();
258
+ break;
259
+ case CommandType.selectAll:
260
+ this.handleSelectAll();
261
+ break;
262
+ }
263
+ }
264
+ canExecuteCommand(command) {
265
+ const modelCommandService = this.serviceContainer.modelCommandService;
266
+ if (modelCommandService) {
267
+ let handeled = modelCommandService.canExecuteCommand(this, command);
268
+ if (handeled !== null)
269
+ return handeled;
270
+ }
271
+ if (command.type === CommandType.undo) {
272
+ return this.instanceServiceContainer.undoService.canUndo();
273
+ }
274
+ if (command.type === CommandType.redo) {
275
+ return this.instanceServiceContainer.undoService.canRedo();
276
+ }
277
+ if (command.type === CommandType.setTool) {
278
+ return this.serviceContainer.designerTools.has(command.parameter);
279
+ }
280
+ return true;
281
+ }
282
+ /* --- end IUiCommandHandler --- */
283
+ handleSelectAll() {
284
+ this.instanceServiceContainer.selectionService.setSelectedElements(Array.from(this.rootDesignItem.children()));
285
+ }
286
+ async handleCopyCommand() {
287
+ await this.serviceContainer.copyPasteService.copyItems(this.instanceServiceContainer.selectionService.selectedElements);
288
+ }
289
+ async handlePasteCommand() {
290
+ const designItems = await this.serviceContainer.copyPasteService.getPasteItems(this.serviceContainer, this.instanceServiceContainer);
291
+ let grp = this.rootDesignItem.openGroup("Insert");
292
+ if (designItems) {
293
+ for (let di of designItems) {
294
+ this.instanceServiceContainer.undoService.execute(new InsertAction(this.rootDesignItem, this.rootDesignItem.childCount, di));
295
+ }
296
+ const intializationService = this.serviceContainer.intializationService;
297
+ if (intializationService) {
298
+ for (let di of designItems)
299
+ intializationService.init(di);
300
+ }
301
+ this.instanceServiceContainer.selectionService.setSelectedElements(designItems);
302
+ }
303
+ grp.commit();
304
+ this.snapLines.clearSnaplines();
305
+ }
306
+ handleDeleteCommand() {
307
+ let items = this.instanceServiceContainer.selectionService.selectedElements;
308
+ this.instanceServiceContainer.undoService.execute(new DeleteAction(items));
309
+ this.instanceServiceContainer.selectionService.setSelectedElements(null);
310
+ }
311
+ initialize(serviceContainer) {
312
+ this.serviceContainer = serviceContainer;
313
+ this.instanceServiceContainer = new InstanceServiceContainer(this);
314
+ this.instanceServiceContainer.register("undoService", new UndoService(this));
315
+ this.instanceServiceContainer.register("selectionService", new SelectionService);
316
+ this.rootDesignItem = DesignItem.GetOrCreateDesignItem(this._canvas, this.serviceContainer, this.instanceServiceContainer);
317
+ this.instanceServiceContainer.register("contentService", new ContentService(this.rootDesignItem));
318
+ this.extensionManager = new ExtensionManager(this);
319
+ this.overlayLayer = new OverlayLayerView(serviceContainer);
320
+ this.overlayLayer.style.pointerEvents = 'none';
321
+ this._canvasContainer.appendChild(this.overlayLayer);
322
+ this.snapLines = new Snaplines(this.overlayLayer);
323
+ this.snapLines.initialize(this.rootDesignItem);
324
+ if (this.serviceContainer.designerPointerExtensions)
325
+ for (let pe of this.serviceContainer.designerPointerExtensions) {
326
+ if (!this._pointerextensions)
327
+ this._pointerextensions = [];
328
+ this._pointerextensions.push(pe.getExtension(this));
329
+ }
330
+ if (this.children) {
331
+ let children = this.children;
332
+ if (this.children.length == 1 && this.children[0] instanceof HTMLSlotElement) {
333
+ children = this.children[0].assignedElements();
334
+ }
335
+ const parser = this.serviceContainer.getLastServiceWhere('htmlParserService', x => x.constructor == DefaultHtmlParserService);
336
+ this.addDesignItems(parser.createDesignItems(children, this.serviceContainer, this.instanceServiceContainer));
337
+ }
338
+ }
339
+ elementFromPoint(x, y) {
340
+ //@ts-ignore
341
+ return this.shadowRoot.elementFromPoint(x, y);
342
+ }
343
+ connectedCallback() {
344
+ if (!this._firstConnect) {
345
+ this._firstConnect = true;
346
+ this._outercanvas2.addEventListener(EventNames.PointerDown, this._pointerEventHandlerBound);
347
+ this._outercanvas2.addEventListener(EventNames.PointerMove, this._pointerEventHandlerBound);
348
+ this._outercanvas2.addEventListener(EventNames.PointerUp, this._pointerEventHandlerBound);
349
+ this._outercanvas2.addEventListener(EventNames.DragEnter, event => this._onDragEnter(event));
350
+ this._outercanvas2.addEventListener(EventNames.DragLeave, event => this._onDragLeave(event));
351
+ this._outercanvas2.addEventListener(EventNames.DragOver, event => this._onDragOver(event));
352
+ this._outercanvas2.addEventListener(EventNames.Drop, event => this._onDrop(event));
353
+ this._canvas.addEventListener(EventNames.KeyDown, this._onKeyDownBound, true);
354
+ this._canvas.addEventListener(EventNames.KeyUp, this._onKeyUpBound, true);
355
+ this._canvas.addEventListener(EventNames.DblClick, this._onDblClickBound, true);
356
+ }
357
+ }
358
+ zoomFactorChanged() {
359
+ //a@ts-ignore
360
+ //this._canvasContainer.style.zoom = <any>this._zoomFactor;
361
+ //this._canvasContainer.style.transform = 'scale(' + this._zoomFactor+') translate(' + this._translate.x + ', '+this._translate.y+')';
362
+ //this._canvasContainer.style.transformOrigin = '0 0';
363
+ this._canvasContainer.style.bottom = this._outercanvas2.offsetHeight >= this._canvasContainer.offsetHeight ? '0' : '';
364
+ this._canvasContainer.style.right = this._outercanvas2.offsetWidth >= this._canvasContainer.offsetWidth ? '0' : '';
365
+ this._updateTransform();
366
+ }
367
+ _updateTransform() {
368
+ this._scaleFactor = this._zoomFactor;
369
+ this._canvasContainer.style.transform = 'scale(' + this._zoomFactor + ') translate(' + this._canvasOffset.x + 'px, ' + this._canvasOffset.y + 'px)';
370
+ this._canvasContainer.style.transformOrigin = '0 0';
371
+ this.snapLines.clearSnaplines();
372
+ }
373
+ setDesignItems(designItems) {
374
+ this._fillCalculationrects();
375
+ this.instanceServiceContainer.undoService.clear();
376
+ this.overlayLayer.removeAllOverlays();
377
+ DomHelper.removeAllChildnodes(this.overlayLayer);
378
+ this.rootDesignItem.clearChildren();
379
+ this.addDesignItems(designItems);
380
+ this.instanceServiceContainer.contentService.onContentChanged.emit({ changeType: 'parsed' });
381
+ }
382
+ addDesignItems(designItems) {
383
+ if (designItems) {
384
+ for (let di of designItems) {
385
+ this.rootDesignItem._insertChildInternal(di);
386
+ }
387
+ }
388
+ const intializationService = this.serviceContainer.intializationService;
389
+ if (intializationService) {
390
+ for (let di of designItems)
391
+ intializationService.init(di);
392
+ }
393
+ this.snapLines.clearSnaplines();
394
+ const prepService = this.serviceContainer.prepareElementsForDesignerService;
395
+ if (prepService)
396
+ requestAnimationFrame(() => prepService.prepareElementsForDesigner(this.rootDesignItem));
397
+ }
398
+ _onDragEnter(event) {
399
+ this._fillCalculationrects();
400
+ event.preventDefault();
401
+ const hasTransferDataBindingObject = event.dataTransfer.types.indexOf(dragDropFormatNameBindingObject) >= 0;
402
+ if (hasTransferDataBindingObject) {
403
+ const ddService = this.serviceContainer.bindableObjectDragDropService;
404
+ if (ddService) {
405
+ const effect = ddService.dragEnter(this, event);
406
+ event.dataTransfer.dropEffect = effect;
407
+ }
408
+ }
409
+ }
410
+ _onDragLeave(event) {
411
+ this._fillCalculationrects();
412
+ event.preventDefault();
413
+ this._canvas.classList.remove('dragFileActive');
414
+ const hasTransferDataBindingObject = event.dataTransfer.types.indexOf(dragDropFormatNameBindingObject) >= 0;
415
+ if (hasTransferDataBindingObject) {
416
+ const ddService = this.serviceContainer.bindableObjectDragDropService;
417
+ if (ddService) {
418
+ const effect = ddService.dragLeave(this, event);
419
+ event.dataTransfer.dropEffect = effect;
420
+ }
421
+ }
422
+ }
423
+ _onDragOver(event) {
424
+ event.preventDefault();
425
+ /*if (this.alignOnSnap) {
426
+ this.snapLines.calculateSnaplines(this.instanceServiceContainer.selectionService.selectedElements);
427
+ //TODO: fix this following code...
428
+ const currentPoint = this.getDesignerMousepoint(event);
429
+ let containerService = this.serviceContainer.getLastServiceWhere('containerService', x => x.serviceForContainer(this.rootDesignItem))
430
+ containerService.finishPlace(this, this.rootDesignItem, this._initialPoint, currentPoint, this.instanceServiceContainer.selectionService.selectedElements);
431
+ }*/
432
+ this._fillCalculationrects();
433
+ if (event.dataTransfer.types.length > 0 && event.dataTransfer.types[0] == 'Files') {
434
+ const ddService = this.serviceContainer.dragDropService;
435
+ if (ddService) {
436
+ const effect = ddService.dragOver(event);
437
+ event.dataTransfer.dropEffect = effect;
438
+ if (effect !== 'none')
439
+ this._canvas.classList.add('dragFileActive');
440
+ }
441
+ }
442
+ const hasTransferDataBindingObject = event.dataTransfer.types.indexOf(dragDropFormatNameBindingObject) >= 0;
443
+ if (hasTransferDataBindingObject) {
444
+ const ddService = this.serviceContainer.bindableObjectDragDropService;
445
+ if (ddService) {
446
+ const effect = ddService.dragOver(this, event);
447
+ event.dataTransfer.dropEffect = effect;
448
+ }
449
+ }
450
+ }
451
+ async _onDrop(event) {
452
+ event.preventDefault();
453
+ this._canvas.classList.remove('dragFileActive');
454
+ this._fillCalculationrects();
455
+ if (event.dataTransfer.files?.length > 0) {
456
+ const ddService = this.serviceContainer.dragDropService;
457
+ if (ddService) {
458
+ ddService.drop(this, event);
459
+ }
460
+ }
461
+ else {
462
+ const transferDataBindingObject = event.dataTransfer.getData(dragDropFormatNameBindingObject);
463
+ if (transferDataBindingObject) {
464
+ const bo = JSON.parse(transferDataBindingObject);
465
+ const ddService = this.serviceContainer.bindableObjectDragDropService;
466
+ if (ddService) {
467
+ const effect = ddService.drop(this, event, bo);
468
+ event.dataTransfer.dropEffect = effect;
469
+ }
470
+ }
471
+ else {
472
+ this._fillCalculationrects();
473
+ const position = this.getNormalizedEventCoordinates(event);
474
+ const transferData = event.dataTransfer.getData(dragDropFormatNameElementDefinition);
475
+ const elementDefinition = JSON.parse(transferData);
476
+ const di = await this.serviceContainer.forSomeServicesTillResult("instanceService", (service) => service.getElement(elementDefinition, this.serviceContainer, this.instanceServiceContainer));
477
+ const grp = di.openGroup("Insert");
478
+ di.setStyle('position', 'absolute');
479
+ di.setStyle('left', position.x + 'px');
480
+ di.setStyle('top', position.y + 'px');
481
+ this.instanceServiceContainer.undoService.execute(new InsertAction(this.rootDesignItem, this.rootDesignItem.childCount, di));
482
+ grp.commit();
483
+ requestAnimationFrame(() => this.instanceServiceContainer.selectionService.setSelectedElements([di]));
484
+ }
485
+ }
486
+ }
487
+ _onContextMenu(event) {
488
+ event.preventDefault();
489
+ if (!event.shiftKey) {
490
+ let items = this.getItemsBelowMouse(event);
491
+ if (items.indexOf(this.instanceServiceContainer.selectionService.primarySelection.element) >= 0)
492
+ this.showDesignItemContextMenu(this.instanceServiceContainer.selectionService.primarySelection, event);
493
+ else {
494
+ const designItem = DesignItem.GetOrCreateDesignItem(event.target, this.serviceContainer, this.instanceServiceContainer);
495
+ if (!this.instanceServiceContainer.selectionService.isSelected(designItem)) {
496
+ this.instanceServiceContainer.selectionService.setSelectedElements([designItem]);
497
+ }
498
+ this.showDesignItemContextMenu(designItem, event);
499
+ }
500
+ }
501
+ }
502
+ showDesignItemContextMenu(designItem, event) {
503
+ const mnuItems = [];
504
+ for (let cme of this.serviceContainer.designerContextMenuExtensions) {
505
+ if (cme.shouldProvideContextmenu(event, this, designItem, 'designer')) {
506
+ mnuItems.push(...cme.provideContextMenuItems(event, this, designItem));
507
+ }
508
+ }
509
+ let ctxMnu = ContextMenuHelper.showContextMenu(null, event, null, mnuItems);
510
+ return ctxMnu;
511
+ }
512
+ _onDblClick(event) {
513
+ event.preventDefault();
514
+ this.extensionManager.applyExtension(this.instanceServiceContainer.selectionService.primarySelection, ExtensionType.Doubleclick);
515
+ }
516
+ onKeyUp(event) {
517
+ if (event.composedPath().indexOf(this.eatEvents) >= 0)
518
+ return;
519
+ switch (event.key) {
520
+ case 'ArrowUp':
521
+ //this._resetPointerEventsForClickThrough();
522
+ break;
523
+ }
524
+ event.preventDefault();
525
+ }
526
+ onKeyDown(event) {
527
+ if (event.composedPath().indexOf(this.eatEvents) >= 0)
528
+ return;
529
+ //TODO: keyboard events maybe should also be handeled by tools
530
+ if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey)
531
+ this.executeCommand({ type: CommandType.undo });
532
+ else if ((event.ctrlKey || event.metaKey) && event.key === 'z' && event.shiftKey)
533
+ this.executeCommand({ type: CommandType.redo });
534
+ else if ((event.ctrlKey || event.metaKey) && event.key === 'y')
535
+ this.executeCommand({ type: CommandType.redo });
536
+ else if ((event.ctrlKey || event.metaKey) && event.key === 'a')
537
+ this.executeCommand({ type: CommandType.selectAll });
538
+ else if ((event.ctrlKey || event.metaKey) && event.key === 'c')
539
+ this.executeCommand({ type: CommandType.copy });
540
+ else if ((event.ctrlKey || event.metaKey) && event.key === 'v')
541
+ this.executeCommand({ type: CommandType.paste });
542
+ else if ((event.ctrlKey || event.metaKey) && event.key === 'x')
543
+ this.executeCommand({ type: CommandType.cut });
544
+ else {
545
+ let primarySelection = this.instanceServiceContainer.selectionService.primarySelection;
546
+ if (!primarySelection) {
547
+ return;
548
+ }
549
+ let moveOffset = 1;
550
+ if (event.shiftKey)
551
+ moveOffset = 10;
552
+ switch (event.key) {
553
+ case 'Delete':
554
+ case 'Backspace':
555
+ this.executeCommand({ type: CommandType.delete });
556
+ break;
557
+ case 'ArrowUp':
558
+ {
559
+ this.instanceServiceContainer.selectionService.selectedElements.forEach(x => x.setStyle('top', parseInt(x.element.style.top) - moveOffset + 'px'));
560
+ this.extensionManager.refreshExtensions(this.instanceServiceContainer.selectionService.selectedElements);
561
+ }
562
+ break;
563
+ case 'ArrowDown':
564
+ {
565
+ this.instanceServiceContainer.selectionService.selectedElements.forEach(x => x.setStyle('top', parseInt(x.element.style.top) + moveOffset + 'px'));
566
+ this.extensionManager.refreshExtensions(this.instanceServiceContainer.selectionService.selectedElements);
567
+ }
568
+ break;
569
+ case 'ArrowLeft':
570
+ {
571
+ this.instanceServiceContainer.selectionService.selectedElements.forEach(x => x.setStyle('left', parseInt(x.element.style.left) - moveOffset + 'px'));
572
+ this.extensionManager.refreshExtensions(this.instanceServiceContainer.selectionService.selectedElements);
573
+ }
574
+ break;
575
+ case 'ArrowRight':
576
+ {
577
+ this.instanceServiceContainer.selectionService.selectedElements.forEach(x => x.setStyle('left', parseInt(x.element.style.left) + moveOffset + 'px'));
578
+ this.extensionManager.refreshExtensions(this.instanceServiceContainer.selectionService.selectedElements);
579
+ }
580
+ break;
581
+ }
582
+ }
583
+ event.preventDefault();
584
+ }
585
+ getNormalizedEventCoordinates(event) {
586
+ const offsetOfOuterX = (event.clientX - this.outerRect.x) / this.zoomFactor;
587
+ const offsetOfCanvasX = this.containerBoundingRect.x - this.outerRect.x;
588
+ const offsetOfOuterY = (event.clientY - this.outerRect.y) / this.zoomFactor;
589
+ const offsetOfCanvasY = this.containerBoundingRect.y - this.outerRect.y;
590
+ return {
591
+ x: offsetOfOuterX - offsetOfCanvasX / this.zoomFactor,
592
+ y: offsetOfOuterY - offsetOfCanvasY / this.zoomFactor
593
+ };
594
+ }
595
+ getNormalizedElementCoordinates(element) {
596
+ const targetRect = element.getBoundingClientRect();
597
+ return { x: (targetRect.x - this.containerBoundingRect.x) / this.scaleFactor, y: (targetRect.y - this.containerBoundingRect.y) / this.scaleFactor, width: targetRect.width / this.scaleFactor, height: targetRect.height / this.scaleFactor };
598
+ }
599
+ getNormalizedOffsetInElement(event, element) {
600
+ const normEvt = this.getNormalizedEventCoordinates(event);
601
+ const normEl = this.getNormalizedElementCoordinates(element);
602
+ return { x: normEvt.x - normEl.x, y: normEvt.y - normEl.y };
603
+ }
604
+ getElementAtPoint(point, ignoreElementCallback) {
605
+ let backupPEventsMap = new Map();
606
+ let currentElement = this.elementFromPoint(point.x, point.y);
607
+ let lastElement = null;
608
+ try {
609
+ while (currentElement != null) {
610
+ if (currentElement == lastElement) {
611
+ currentElement = null;
612
+ break;
613
+ }
614
+ lastElement = currentElement;
615
+ if (currentElement == this._canvas) {
616
+ break;
617
+ }
618
+ if (currentElement === this.overlayLayer) {
619
+ currentElement = this.overlayLayer.elementFromPoint(point.x, point.y);
620
+ break;
621
+ }
622
+ if (!ignoreElementCallback || !ignoreElementCallback(currentElement)) {
623
+ break;
624
+ }
625
+ backupPEventsMap.set(currentElement, currentElement.style.pointerEvents);
626
+ currentElement.style.pointerEvents = 'none';
627
+ if (currentElement.shadowRoot) {
628
+ for (let e of currentElement.shadowRoot.querySelectorAll('*')) {
629
+ if (!backupPEventsMap.has(e)) {
630
+ if (e.style)
631
+ backupPEventsMap.set(e, e.style.pointerEvents);
632
+ e.style.pointerEvents = 'none';
633
+ }
634
+ }
635
+ }
636
+ currentElement = this.elementFromPoint(point.x, point.y);
637
+ }
638
+ }
639
+ finally {
640
+ for (let e of backupPEventsMap.entries()) {
641
+ e[0].style.pointerEvents = e[1];
642
+ }
643
+ }
644
+ return currentElement;
645
+ }
646
+ _rect;
647
+ _pointerEventHandler(event, forceElement = null) {
648
+ this._fillCalculationrects();
649
+ if (this._pointerextensions) {
650
+ for (let pe of this._pointerextensions)
651
+ pe.refresh(event);
652
+ }
653
+ if (event.composedPath().indexOf(this.eatEvents) >= 0)
654
+ return;
655
+ if (event.buttons == 2)
656
+ return;
657
+ let currentElement;
658
+ if (forceElement)
659
+ currentElement = forceElement;
660
+ else {
661
+ currentElement = this.serviceContainer.elementAtPointService.getElementAtPoint(this, { x: event.x, y: event.y });
662
+ if (currentElement === this._outercanvas2 || currentElement === this.overlayLayer || !currentElement) {
663
+ currentElement = this._canvas;
664
+ }
665
+ } /* else {
666
+ if (!DesignerCanvas.hasOrIsParent(currentElement, this._canvas))
667
+ return;
668
+ }*/
669
+ //TODO: remove duplication when tool refactoring starts
670
+ //this._fillCalculationrects();
671
+ const currentDesignItem = DesignItem.GetOrCreateDesignItem(currentElement, this.serviceContainer, this.instanceServiceContainer);
672
+ if (this._lastHoverDesignItem != currentDesignItem) {
673
+ if (this._lastHoverDesignItem)
674
+ this.extensionManager.removeExtension(this._lastHoverDesignItem, ExtensionType.MouseOver);
675
+ if (currentDesignItem && currentDesignItem != this.rootDesignItem && DomHelper.getHost(currentElement.parentNode) !== this.overlayLayer)
676
+ this.extensionManager.applyExtension(currentDesignItem, ExtensionType.MouseOver);
677
+ this._lastHoverDesignItem = currentDesignItem;
678
+ }
679
+ if (currentElement && DomHelper.getHost(currentElement.parentNode) === this.overlayLayer) {
680
+ if (this.eatEvents)
681
+ return;
682
+ currentElement = this.instanceServiceContainer.selectionService.primarySelection?.element ?? this._canvas;
683
+ }
684
+ this._fillCalculationrects();
685
+ let tool = this.serviceContainer.globalContext.tool ?? this.serviceContainer.designerTools.get(NamedTools.Pointer);
686
+ this._canvas.style.cursor = tool.cursor;
687
+ tool.pointerEventHandler(this, event, currentElement);
688
+ }
689
+ _fillCalculationrects() {
690
+ this.containerBoundingRect = this._canvasContainer.getBoundingClientRect();
691
+ this.outerRect = this._outercanvas2.getBoundingClientRect();
692
+ }
693
+ addOverlay(element, overlayLayer = OverlayLayer.Normal) {
694
+ this.overlayLayer.addOverlay(element, overlayLayer);
695
+ }
696
+ removeOverlay(element) {
697
+ this.overlayLayer.removeOverlay(element);
698
+ }
699
+ getItemsBelowMouse(event) {
700
+ const lstEl = [];
701
+ //search for containers below mouse cursor.
702
+ //to do this, we need to disable pointer events for each in a loop and search wich element is there
703
+ let backupPEventsMap = new Map();
704
+ try {
705
+ let el = this.elementFromPoint(event.x, event.y);
706
+ backupPEventsMap.set(el, el.style.pointerEvents);
707
+ el.style.pointerEvents = 'none';
708
+ if (el !== this.rootDesignItem.element) {
709
+ el = this.elementFromPoint(event.x, event.y);
710
+ while (el != null) {
711
+ if (el === this.rootDesignItem.element)
712
+ break;
713
+ if (el !== this.overlayLayer && el.parentElement !== this.overlayLayer && el.getRootNode() === this.shadowRoot)
714
+ lstEl.push(el);
715
+ if (!backupPEventsMap.has(el))
716
+ backupPEventsMap.set(el, el.style.pointerEvents);
717
+ el.style.pointerEvents = 'none';
718
+ const oldEl = el;
719
+ el = this.elementFromPoint(event.x, event.y);
720
+ if (oldEl === el)
721
+ break;
722
+ }
723
+ }
724
+ }
725
+ finally {
726
+ for (let e of backupPEventsMap.entries()) {
727
+ e[0].style.pointerEvents = e[1];
728
+ }
729
+ }
730
+ return lstEl;
731
+ }
732
+ zoomOntoRectangle(startpoint, endPoint, scalechange) {
733
+ }
734
+ zoomTowardsPointer(point, scalechange) {
735
+ // offsetOuter = (point.x + (this.containerBoundingRect.x - this.outerRect.x) / this.zoomFactor),
736
+ // deltaOffset = point.x / this.zoomFactor - offsetOuter
737
+ let canvasOffset = {
738
+ x: -(point.x / scalechange) - ((point.x / this.zoomFactor - (point.x + (this.containerBoundingRect.x - this.outerRect.x) / this.zoomFactor)) / scalechange),
739
+ y: -(point.y / scalechange) - ((point.y / this.zoomFactor - (point.y + (this.containerBoundingRect.y - this.outerRect.y) / this.zoomFactor)) / scalechange),
740
+ };
741
+ this.zoomFactor = scalechange * this.zoomFactor;
742
+ this.canvasOffset = canvasOffset;
743
+ }
744
+ }
745
+ customElements.define('node-projects-designer-canvas', DesignerCanvas);