@node-projects/web-component-designer 0.0.125 → 0.0.127
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/ACKNOWLEDGMENTS +3 -1
- package/dist/elements/helper/contextMenu/ContextMenu.d.ts +29 -0
- package/dist/elements/helper/contextMenu/ContextMenu.js +304 -0
- package/dist/elements/helper/contextMenu/{IContextmenuItem.d.ts → IContextMenuItem.d.ts} +3 -2
- package/dist/elements/helper/contextMenu/{IContextmenuItem.js → IContextMenuItem.js} +1 -0
- package/dist/elements/widgets/designerView/designerCanvas.d.ts +2 -2
- package/dist/elements/widgets/designerView/designerCanvas.js +4 -3
- package/dist/elements/widgets/designerView/extensions/contextMenu/CopyPasteContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/IContextMenuExtension.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/ItemsBelowContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/ItemsBelowContextMenu.js +1 -2
- package/dist/elements/widgets/designerView/extensions/contextMenu/MultipleItemsSelectedContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/PathContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/RectContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/RotateLeftAndRightContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/SelectAllChildrenContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/SeperatorContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/ZMoveContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/contextMenu/ZoomToElementContextMenu.d.ts +1 -1
- package/dist/elements/widgets/designerView/extensions/svg/PathExtension.js +2 -2
- package/dist/elements/widgets/designerView/tools/PointerTool.js +1 -1
- package/dist/elements/widgets/propertyGrid/PropertyGridPropertyList.js +2 -2
- package/dist/elements/widgets/treeView/treeViewExtended.d.ts +2 -2
- package/dist/elements/widgets/treeView/treeViewExtended.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/elements/helper/KeyNameHelper.d.ts +0 -0
- package/dist/elements/helper/KeyNameHelper.js +0 -1
- package/dist/elements/helper/contextMenu/ContextMenuHelper.d.ts +0 -27
- package/dist/elements/helper/contextMenu/ContextMenuHelper.js +0 -216
- package/dist/elements/services/bindableObjectsService/IDragDropService.d.ts +0 -5
- package/dist/elements/services/bindableObjectsService/IDragDropService.js +0 -1
- package/dist/elements/services/elementsService/WebcomponentManifestParserService.d.ts +0 -25
- package/dist/elements/services/elementsService/WebcomponentManifestParserService.js +0 -94
- package/dist/elements/services/htmlParserService/NodeHtmlParserService copy.d.ts +0 -11
- package/dist/elements/services/htmlParserService/NodeHtmlParserService copy.js +0 -96
- package/dist/elements/services/initializationService/DefaultIntializationService.d.ts +0 -6
- package/dist/elements/services/initializationService/DefaultIntializationService.js +0 -22
- package/dist/elements/services/instanceService/IPrepareElementsForDesignerService.d.ts +0 -4
- package/dist/elements/services/instanceService/IPrepareElementsForDesignerService.js +0 -1
- package/dist/elements/services/instanceService/PrepareElementsForDesignerService.d.ts +0 -6
- package/dist/elements/services/instanceService/PrepareElementsForDesignerService.js +0 -32
- package/dist/elements/services/propertiesService/services/WebcomponentManifestParserService.d.ts +0 -25
- package/dist/elements/services/propertiesService/services/WebcomponentManifestParserService.js +0 -94
- package/dist/elements/services/undoService/transactionItems/MoveElementInDomAction.d.ts +0 -16
- package/dist/elements/services/undoService/transactionItems/MoveElementInDomAction.js +0 -31
- package/dist/elements/widgets/designerView/DesignerViewUseOverlayScollbars.d.ts +0 -7
- package/dist/elements/widgets/designerView/DesignerViewUseOverlayScollbars.js +0 -13
- package/dist/elements/widgets/designerView/designerCanvas.ts.BASE.d.ts +0 -92
- package/dist/elements/widgets/designerView/designerCanvas.ts.BASE.js +0 -734
- package/dist/elements/widgets/designerView/designerCanvas.ts.LOCAL.d.ts +0 -95
- package/dist/elements/widgets/designerView/designerCanvas.ts.LOCAL.js +0 -768
- package/dist/elements/widgets/designerView/designerCanvas.ts.REMOTE.d.ts +0 -94
- package/dist/elements/widgets/designerView/designerCanvas.ts.REMOTE.js +0 -745
- package/dist/elements/widgets/designerView/extensions/AltToEnterContainerExtension copy.d.ts +0 -12
- package/dist/elements/widgets/designerView/extensions/AltToEnterContainerExtension copy.js +0 -20
- package/dist/elements/widgets/designerView/extensions/AltToEnterContainerExtensionProvider copy.d.ts +0 -10
- package/dist/elements/widgets/designerView/extensions/AltToEnterContainerExtensionProvider copy.js +0 -14
- package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtension copy.d.ts +0 -17
- package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtension copy.js +0 -80
- package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtensionProvider copy.d.ts +0 -9
- package/dist/elements/widgets/designerView/extensions/EditText/EditTextExtensionProvider copy.js +0 -11
- package/dist/elements/widgets/designerView/extensions/GrayOutDragOverExtension.d.ts +0 -11
- package/dist/elements/widgets/designerView/extensions/GrayOutDragOverExtension.js +0 -18
- package/dist/elements/widgets/designerView/extensions/IframeExtension.d.ts +0 -11
- package/dist/elements/widgets/designerView/extensions/IframeExtension.js +0 -46
- package/dist/elements/widgets/designerView/extensions/IframeExtensionProvider.d.ts +0 -9
- package/dist/elements/widgets/designerView/extensions/IframeExtensionProvider.js +0 -9
- package/dist/elements/widgets/designerView/extensions/PathExtension.d.ts +0 -23
- package/dist/elements/widgets/designerView/extensions/PathExtension.js +0 -251
- package/dist/elements/widgets/designerView/extensions/PathExtensionProvider.d.ts +0 -9
- package/dist/elements/widgets/designerView/extensions/PathExtensionProvider.js +0 -18
- package/dist/elements/widgets/designerView/extensions/PrimarySelectionDefaultExtension.d.ts +0 -13
- package/dist/elements/widgets/designerView/extensions/PrimarySelectionDefaultExtension.js +0 -21
- package/dist/elements/widgets/designerView/extensions/PrimarySelectionDefaultExtensionProvider.d.ts +0 -10
- package/dist/elements/widgets/designerView/extensions/PrimarySelectionDefaultExtensionProvider.js +0 -13
- package/dist/elements/widgets/designerView/extensions/contextMenu/CopyPasteContextMenu copy.d.ts +0 -8
- package/dist/elements/widgets/designerView/extensions/contextMenu/CopyPasteContextMenu copy.js +0 -15
- package/dist/elements/widgets/designerView/extensions/contextMenu/ZMoveContextMenu copy.d.ts +0 -8
- package/dist/elements/widgets/designerView/extensions/contextMenu/ZMoveContextMenu copy.js +0 -14
- package/dist/elements/widgets/designerView/toolBar/DrawElementTool.d.ts +0 -19
- package/dist/elements/widgets/designerView/toolBar/DrawElementTool.js +0 -79
- package/dist/elements/widgets/designerView/toolBar/DrawEllipsisTool.d.ts +0 -16
- package/dist/elements/widgets/designerView/toolBar/DrawEllipsisTool.js +0 -94
- package/dist/elements/widgets/designerView/toolBar/DrawLineTool.d.ts +0 -14
- package/dist/elements/widgets/designerView/toolBar/DrawLineTool.js +0 -79
- package/dist/elements/widgets/designerView/toolBar/DrawPathTool.d.ts +0 -20
- package/dist/elements/widgets/designerView/toolBar/DrawPathTool.js +0 -128
- package/dist/elements/widgets/designerView/toolBar/DrawRectTool.d.ts +0 -19
- package/dist/elements/widgets/designerView/toolBar/DrawRectTool.js +0 -109
- package/dist/elements/widgets/designerView/toolBar/ITool.d.ts +0 -9
- package/dist/elements/widgets/designerView/toolBar/ITool.js +0 -1
- package/dist/elements/widgets/designerView/toolBar/MagicWandSelectorTool.d.ts +0 -12
- package/dist/elements/widgets/designerView/toolBar/MagicWandSelectorTool.js +0 -64
- package/dist/elements/widgets/designerView/toolBar/NamedTools.d.ts +0 -15
- package/dist/elements/widgets/designerView/toolBar/NamedTools.js +0 -16
- package/dist/elements/widgets/designerView/toolBar/PanTool.d.ts +0 -10
- package/dist/elements/widgets/designerView/toolBar/PanTool.js +0 -26
- package/dist/elements/widgets/designerView/toolBar/PickColorTool.d.ts +0 -10
- package/dist/elements/widgets/designerView/toolBar/PickColorTool.js +0 -20
- package/dist/elements/widgets/designerView/toolBar/PointerTool.d.ts +0 -24
- package/dist/elements/widgets/designerView/toolBar/PointerTool.js +0 -283
- package/dist/elements/widgets/designerView/toolBar/RectangleSelectorTool.d.ts +0 -12
- package/dist/elements/widgets/designerView/toolBar/RectangleSelectorTool.js +0 -84
- package/dist/elements/widgets/designerView/toolBar/TextTool.d.ts +0 -11
- package/dist/elements/widgets/designerView/toolBar/TextTool.js +0 -33
- package/dist/elements/widgets/designerView/toolBar/ZoomTool.d.ts +0 -17
- package/dist/elements/widgets/designerView/toolBar/ZoomTool.js +0 -79
- package/dist/elements/widgets/designerView/toolBar/designerToolbarGenerics/designerToolRenderer.d.ts +0 -5
- package/dist/elements/widgets/designerView/toolBar/designerToolbarGenerics/designerToolRenderer.js +0 -19
- package/dist/elements/widgets/designerView/toolBar/designerToolbarGenerics/designerToolbarPopup.d.ts +0 -8
- package/dist/elements/widgets/designerView/toolBar/designerToolbarGenerics/designerToolbarPopup.js +0 -41
- package/dist/elements/widgets/designerView/toolBar/designerToolbarGenerics/designerToolbarPopupToolSelect.d.ts +0 -9
- package/dist/elements/widgets/designerView/toolBar/designerToolbarGenerics/designerToolbarPopupToolSelect.js +0 -42
- package/dist/elements/widgets/designerView/toolBar/designerToolbarGenerics/designerToolsButtons.d.ts +0 -36
- package/dist/elements/widgets/designerView/toolBar/designerToolbarGenerics/designerToolsButtons.js +0 -96
- package/dist/elements/widgets/designerView/toolBar/designerToolbarPopups/DrawToolPopup.d.ts +0 -5
- package/dist/elements/widgets/designerView/toolBar/designerToolbarPopups/DrawToolPopup.js +0 -21
- package/dist/elements/widgets/designerView/toolBar/designerToolbarPopups/SelectorToolsPopup.d.ts +0 -8
- package/dist/elements/widgets/designerView/toolBar/designerToolbarPopups/SelectorToolsPopup.js +0 -23
- package/dist/elements/widgets/designerView/toolBar/designerToolsDock.d.ts +0 -24
- package/dist/elements/widgets/designerView/toolBar/designerToolsDock.js +0 -115
- package/dist/elements/widgets/designerView/tools/designerToolbarGenerics/designerToolRenderer.d.ts +0 -5
- package/dist/elements/widgets/designerView/tools/designerToolbarGenerics/designerToolRenderer.js +0 -19
- package/dist/elements/widgets/designerView/tools/designerToolbarGenerics/designerToolbarPopup.d.ts +0 -8
- package/dist/elements/widgets/designerView/tools/designerToolbarGenerics/designerToolbarPopup.js +0 -41
- package/dist/elements/widgets/designerView/tools/designerToolbarGenerics/designerToolbarPopupToolSelect.d.ts +0 -9
- package/dist/elements/widgets/designerView/tools/designerToolbarGenerics/designerToolbarPopupToolSelect.js +0 -42
- package/dist/elements/widgets/designerView/tools/designerToolbarGenerics/designerToolsButtons.d.ts +0 -36
- package/dist/elements/widgets/designerView/tools/designerToolbarGenerics/designerToolsButtons.js +0 -87
- package/dist/elements/widgets/designerView/tools/designerToolbarPopups/DrawToolPopup copy.d.ts +0 -8
- package/dist/elements/widgets/designerView/tools/designerToolbarPopups/DrawToolPopup copy.js +0 -25
- package/dist/elements/widgets/designerView/tools/designerToolbarPopups/DrawToolPopup.d.ts +0 -5
- package/dist/elements/widgets/designerView/tools/designerToolbarPopups/DrawToolPopup.js +0 -21
- package/dist/elements/widgets/designerView/tools/designerToolbarPopups/SelectorToolsPopup.d.ts +0 -8
- package/dist/elements/widgets/designerView/tools/designerToolbarPopups/SelectorToolsPopup.js +0 -23
- package/dist/elements/widgets/designerView/tools/designerToolsDock.d.ts +0 -24
- package/dist/elements/widgets/designerView/tools/designerToolsDock.js +0 -115
- package/dist/elements/widgets/designerView/tools/toolBar/AbstractDesignerToolbarButton.d.ts +0 -5
- package/dist/elements/widgets/designerView/tools/toolBar/AbstractDesignerToolbarButton.js +0 -5
- package/dist/elements/widgets/designerView/tools/toolBar/IDesignViewConfigButtonsProvider.d.ts +0 -5
- package/dist/elements/widgets/designerView/tools/toolBar/IDesignViewConfigButtonsProvider.js +0 -1
- package/dist/elements/widgets/designerView/tools/toolBar/buttons/PointerToolButtonProvider copy.d.ts +0 -5
- package/dist/elements/widgets/designerView/tools/toolBar/buttons/PointerToolButtonProvider copy.js +0 -7
- package/dist/elements/widgets/designerView/tools/toolBar/buttons/SelectorToolButtonProvider copy.d.ts +0 -5
- package/dist/elements/widgets/designerView/tools/toolBar/buttons/SelectorToolButtonProvider copy.js +0 -10
- package/dist/elements/widgets/designerView/tools/toolBar/designerToolsDock.d.ts +0 -24
- package/dist/elements/widgets/designerView/tools/toolBar/designerToolsDock.js +0 -115
- package/dist/elements/widgets/designerView/tools/toolBar/popups/SelectorToolsPopup.d.ts +0 -7
- package/dist/elements/widgets/designerView/tools/toolBar/popups/SelectorToolsPopup.js +0 -23
- package/dist/elements/widgets/designerView/tools/toolBar/popups/designerToolbarPopup.d.ts +0 -8
- package/dist/elements/widgets/designerView/tools/toolBar/popups/designerToolbarPopup.js +0 -41
package/ACKNOWLEDGMENTS
CHANGED
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
https://github.com/PolymerLabs/wizzywid
|
|
5
5
|
This was a start for this whole project (even if mostly nothing of the original code is left)
|
|
6
6
|
- Thanks to @chdh for plain-scrollbar component
|
|
7
|
-
https://github.com/chdh/plain-scrollbar
|
|
7
|
+
https://github.com/chdh/plain-scrollbar
|
|
8
|
+
- Thanks to @m-thalmann for contextmenujs
|
|
9
|
+
https://github.com/m-thalmann/contextmenujs (also we have heavily modified it)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IContextMenuItem } from "./IContextMenuItem";
|
|
2
|
+
export interface IContextMenuOptions {
|
|
3
|
+
defaultIcon?: string;
|
|
4
|
+
subIcon?: string;
|
|
5
|
+
mouseOffset?: number;
|
|
6
|
+
shadowRoot?: ShadowRoot | Document;
|
|
7
|
+
}
|
|
8
|
+
export declare class ContextMenu {
|
|
9
|
+
private static _contextMenuCss;
|
|
10
|
+
static count: number;
|
|
11
|
+
menu: IContextMenuItem[];
|
|
12
|
+
options: IContextMenuOptions;
|
|
13
|
+
private num;
|
|
14
|
+
private _windowDownBound;
|
|
15
|
+
private _windowUpBound;
|
|
16
|
+
private _windowKeyUpBound;
|
|
17
|
+
private _windowResizeBound;
|
|
18
|
+
private _menuElement;
|
|
19
|
+
constructor(menu: IContextMenuItem[], options?: IContextMenuOptions);
|
|
20
|
+
reload(): void;
|
|
21
|
+
renderLevel(level: IContextMenuItem[]): HTMLUListElement;
|
|
22
|
+
display(event: MouseEvent): void;
|
|
23
|
+
_windowResize(): void;
|
|
24
|
+
_windowDown(e: MouseEvent): void;
|
|
25
|
+
_windowUp(e: MouseEvent): void;
|
|
26
|
+
_windowKeyUp(e: KeyboardEvent): void;
|
|
27
|
+
static show(menu: IContextMenuItem[], event: MouseEvent, options?: IContextMenuOptions): ContextMenu;
|
|
28
|
+
close(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { css } from "@node-projects/base-custom-webcomponent";
|
|
2
|
+
export class ContextMenu {
|
|
3
|
+
static _contextMenuCss = css `
|
|
4
|
+
.context_menu {
|
|
5
|
+
position: fixed;
|
|
6
|
+
opacity: 0;
|
|
7
|
+
transform: scale(0);
|
|
8
|
+
transition: transform 0.1s;
|
|
9
|
+
transform-origin: top left;
|
|
10
|
+
padding: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.context_menu.display {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
transform: scale(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.context_menu,
|
|
19
|
+
.context_menu * {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.context_menu * {
|
|
24
|
+
position: relative;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.context_menu ul {
|
|
28
|
+
list-style-type: none;
|
|
29
|
+
padding: 0;
|
|
30
|
+
margin: 0;
|
|
31
|
+
background-color: #ccc;
|
|
32
|
+
box-shadow: 0 0 5px #333;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.context_menu li {
|
|
36
|
+
padding: 0;
|
|
37
|
+
padding-right: 1.7em;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.context_menu li:hover {
|
|
43
|
+
background-color: #bbb;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.context_menu li .cm_icon_span {
|
|
47
|
+
width: 1.5em;
|
|
48
|
+
height: 1.2em;
|
|
49
|
+
vertical-align: bottom;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
border-right: 1px solid #aaa;
|
|
52
|
+
margin-right: 5px;
|
|
53
|
+
padding-right: 5px;
|
|
54
|
+
text-align: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.context_menu li .cm_sub_span {
|
|
58
|
+
width: 1em;
|
|
59
|
+
display: inline-block;
|
|
60
|
+
text-align: center;
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 50%;
|
|
63
|
+
right: 0.5em;
|
|
64
|
+
transform: translateY(-50%);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.context_menu li>ul {
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: 0;
|
|
70
|
+
left: 100%;
|
|
71
|
+
opacity: 0;
|
|
72
|
+
transition: opacity 0.2s;
|
|
73
|
+
visibility: hidden;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.context_menu li:hover>ul {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
visibility: visible;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.context_menu li.cm_divider {
|
|
82
|
+
border-bottom: 1px solid #aaa;
|
|
83
|
+
margin: 5px;
|
|
84
|
+
padding: 0;
|
|
85
|
+
cursor: default;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.context_menu li.cm_divider:hover {
|
|
89
|
+
background-color: inherit;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.context_menu.cm_border_right>ul ul {
|
|
93
|
+
left: unset;
|
|
94
|
+
right: 100%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.context_menu.cm_border_bottom>ul ul {
|
|
98
|
+
top: unset;
|
|
99
|
+
bottom: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.context_menu li[disabled=""] {
|
|
103
|
+
color: #777;
|
|
104
|
+
cursor: default;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.context_menu li[disabled=""]:hover {
|
|
108
|
+
background-color: inherit;
|
|
109
|
+
}`;
|
|
110
|
+
static count = 0;
|
|
111
|
+
menu;
|
|
112
|
+
options;
|
|
113
|
+
num;
|
|
114
|
+
_windowDownBound;
|
|
115
|
+
_windowUpBound;
|
|
116
|
+
_windowKeyUpBound;
|
|
117
|
+
_windowResizeBound;
|
|
118
|
+
_menuElement;
|
|
119
|
+
constructor(menu, options) {
|
|
120
|
+
this.num = ContextMenu.count++;
|
|
121
|
+
this.menu = menu;
|
|
122
|
+
this.options = options;
|
|
123
|
+
this.reload();
|
|
124
|
+
this._windowDownBound = this._windowDown.bind(this);
|
|
125
|
+
this._windowUpBound = this._windowUp.bind(this);
|
|
126
|
+
this._windowKeyUpBound = this._windowKeyUp.bind(this);
|
|
127
|
+
this._windowResizeBound = this._windowResize.bind(this);
|
|
128
|
+
}
|
|
129
|
+
reload() {
|
|
130
|
+
let shadowRoot = this.options?.shadowRoot ?? document;
|
|
131
|
+
if (this._menuElement == null) {
|
|
132
|
+
this._menuElement = document.createElement("div");
|
|
133
|
+
this._menuElement.className = "context_menu";
|
|
134
|
+
this._menuElement.id = "cm_" + this.num;
|
|
135
|
+
if (shadowRoot === document)
|
|
136
|
+
document.body.appendChild(this._menuElement);
|
|
137
|
+
else
|
|
138
|
+
shadowRoot.appendChild(this._menuElement);
|
|
139
|
+
}
|
|
140
|
+
this._menuElement.innerHTML = "";
|
|
141
|
+
if (shadowRoot.adoptedStyleSheets.indexOf(ContextMenu._contextMenuCss) < 0) {
|
|
142
|
+
shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, ContextMenu._contextMenuCss];
|
|
143
|
+
}
|
|
144
|
+
this._menuElement.appendChild(this.renderLevel(this.menu));
|
|
145
|
+
}
|
|
146
|
+
renderLevel(level) {
|
|
147
|
+
let ul_outer = document.createElement("ul");
|
|
148
|
+
let lastWasDivider = false;
|
|
149
|
+
level.forEach((item) => {
|
|
150
|
+
let li = document.createElement("li");
|
|
151
|
+
if (item.title !== '-') {
|
|
152
|
+
let icon_span = document.createElement("span");
|
|
153
|
+
icon_span.className = 'cm_icon_span';
|
|
154
|
+
if ((item.icon ?? '') != '') {
|
|
155
|
+
icon_span.innerHTML = item.icon;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
icon_span.innerHTML = this.options?.defaultIcon ?? '';
|
|
159
|
+
}
|
|
160
|
+
let text_span = document.createElement("span");
|
|
161
|
+
text_span.className = 'cm_text';
|
|
162
|
+
text_span.innerHTML = item.title;
|
|
163
|
+
let sub_span = document.createElement("span");
|
|
164
|
+
sub_span.className = 'cm_sub_span';
|
|
165
|
+
if (item.children != null) {
|
|
166
|
+
sub_span.innerHTML = this.options?.subIcon ?? '›';
|
|
167
|
+
}
|
|
168
|
+
li.appendChild(icon_span);
|
|
169
|
+
li.appendChild(text_span);
|
|
170
|
+
li.appendChild(sub_span);
|
|
171
|
+
if (item.disabled) {
|
|
172
|
+
li.setAttribute("disabled", "");
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
if (item.action)
|
|
176
|
+
li.addEventListener('click', (e) => {
|
|
177
|
+
item.action(e, item);
|
|
178
|
+
this.close();
|
|
179
|
+
});
|
|
180
|
+
if (item.children != null) {
|
|
181
|
+
li.appendChild(this.renderLevel(item.children));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
lastWasDivider = false;
|
|
185
|
+
ul_outer.appendChild(li);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
if (!lastWasDivider) {
|
|
189
|
+
li.className = "cm_divider";
|
|
190
|
+
lastWasDivider = true;
|
|
191
|
+
ul_outer.appendChild(li);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
return ul_outer;
|
|
196
|
+
}
|
|
197
|
+
display(event) {
|
|
198
|
+
let menu = this._menuElement;
|
|
199
|
+
let clickCoords = { x: event.clientX, y: event.clientY };
|
|
200
|
+
let clickCoordsX = clickCoords.x;
|
|
201
|
+
let clickCoordsY = clickCoords.y;
|
|
202
|
+
let menuWidth = menu.offsetWidth + 4;
|
|
203
|
+
let menuHeight = menu.offsetHeight + 4;
|
|
204
|
+
let windowWidth = window.innerWidth;
|
|
205
|
+
let windowHeight = window.innerHeight;
|
|
206
|
+
let mouseOffset = this.options?.mouseOffset != null ? this.options.mouseOffset : 2;
|
|
207
|
+
if ((windowWidth - clickCoordsX) < menuWidth) {
|
|
208
|
+
menu.style.left = windowWidth - menuWidth + "px";
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
menu.style.left = (clickCoordsX + mouseOffset) + "px";
|
|
212
|
+
}
|
|
213
|
+
if ((windowHeight - clickCoordsY) < menuHeight) {
|
|
214
|
+
menu.style.top = windowHeight - menuHeight + "px";
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
menu.style.top = (clickCoordsY + mouseOffset) + "px";
|
|
218
|
+
}
|
|
219
|
+
let sizes = ContextUtil.getSizes(menu);
|
|
220
|
+
if ((windowWidth - clickCoordsX) < sizes.width) {
|
|
221
|
+
menu.classList.add("cm_border_right");
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
menu.classList.remove("cm_border_right");
|
|
225
|
+
}
|
|
226
|
+
if ((windowHeight - clickCoordsY) < sizes.height) {
|
|
227
|
+
menu.classList.add("cm_border_bottom");
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
menu.classList.remove("cm_border_bottom");
|
|
231
|
+
}
|
|
232
|
+
menu.classList.add("display");
|
|
233
|
+
window.addEventListener("keyup", this._windowKeyUpBound);
|
|
234
|
+
window.addEventListener("mousedown", this._windowDownBound);
|
|
235
|
+
window.addEventListener("mouseup", this._windowUpBound);
|
|
236
|
+
window.addEventListener("resize", this._windowResizeBound);
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
}
|
|
239
|
+
_windowResize() {
|
|
240
|
+
this.close();
|
|
241
|
+
}
|
|
242
|
+
_windowDown(e) {
|
|
243
|
+
const p = e.composedPath();
|
|
244
|
+
if (p.indexOf(this._menuElement) < 0)
|
|
245
|
+
this.close();
|
|
246
|
+
}
|
|
247
|
+
_windowUp(e) {
|
|
248
|
+
const p = e.composedPath();
|
|
249
|
+
if (p.indexOf(this._menuElement) < 0)
|
|
250
|
+
this.close();
|
|
251
|
+
}
|
|
252
|
+
_windowKeyUp(e) {
|
|
253
|
+
if (e.key === 'Escape') {
|
|
254
|
+
this.close();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
static show(menu, event, options) {
|
|
258
|
+
let ctxMenu = new ContextMenu(menu, options);
|
|
259
|
+
ctxMenu.display(event);
|
|
260
|
+
return ctxMenu;
|
|
261
|
+
}
|
|
262
|
+
close() {
|
|
263
|
+
this._menuElement.remove();
|
|
264
|
+
window.removeEventListener("keyup", this._windowKeyUpBound);
|
|
265
|
+
window.removeEventListener("mousedown", this._windowDownBound);
|
|
266
|
+
window.removeEventListener("mouseup", this._windowUpBound);
|
|
267
|
+
window.removeEventListener("resize", this._windowResizeBound);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
class ContextUtil {
|
|
271
|
+
static getSizes(obj) {
|
|
272
|
+
let lis = obj.getElementsByTagName('li');
|
|
273
|
+
let width_def = 0;
|
|
274
|
+
let height_def = 0;
|
|
275
|
+
for (let i = 0; i < lis.length; i++) {
|
|
276
|
+
let li = lis[i];
|
|
277
|
+
if (li.offsetWidth > width_def) {
|
|
278
|
+
width_def = li.offsetWidth;
|
|
279
|
+
}
|
|
280
|
+
if (li.offsetHeight > height_def) {
|
|
281
|
+
height_def = li.offsetHeight;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
let width = width_def;
|
|
285
|
+
let height = height_def;
|
|
286
|
+
for (let i = 0; i < lis.length; i++) {
|
|
287
|
+
let li = lis[i];
|
|
288
|
+
let ul = li.getElementsByTagName('ul');
|
|
289
|
+
if (typeof ul[0] !== "undefined") {
|
|
290
|
+
let ul_size = ContextUtil.getSizes(ul[0]);
|
|
291
|
+
if (width_def + ul_size.width > width) {
|
|
292
|
+
width = width_def + ul_size.width;
|
|
293
|
+
}
|
|
294
|
+
if (height_def + ul_size.height > height) {
|
|
295
|
+
height = height_def + ul_size.height;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
"width": width,
|
|
301
|
+
"height": height
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export interface IContextMenuItem {
|
|
2
|
-
readonly title
|
|
2
|
+
readonly title?: string;
|
|
3
3
|
readonly icon?: string;
|
|
4
|
-
readonly action?: (e: HTMLElement, args?: Event) => void;
|
|
5
4
|
readonly children?: IContextMenuItem[];
|
|
5
|
+
readonly disabled?: boolean;
|
|
6
6
|
readonly shortCut?: string;
|
|
7
|
+
action?: (event: MouseEvent, item: IContextMenuItem) => void;
|
|
7
8
|
}
|
|
@@ -4,7 +4,6 @@ import { IDesignItem } from '../../item/IDesignItem';
|
|
|
4
4
|
import { BaseCustomWebComponentLazyAppend, TypedEvent } from '@node-projects/base-custom-webcomponent';
|
|
5
5
|
import { IDesignerCanvas } from './IDesignerCanvas';
|
|
6
6
|
import { Snaplines } from './Snaplines';
|
|
7
|
-
import { ContextMenuHelper } from '../../helper/contextMenu/ContextMenuHelper';
|
|
8
7
|
import { IPlacementView } from './IPlacementView';
|
|
9
8
|
import { IUiCommandHandler } from '../../../commandHandling/IUiCommandHandler';
|
|
10
9
|
import { IUiCommand } from '../../../commandHandling/IUiCommand';
|
|
@@ -15,6 +14,7 @@ import { OverlayLayerView } from './overlayLayerView';
|
|
|
15
14
|
import { IRect } from "../../../interfaces/IRect.js";
|
|
16
15
|
import { ISize } from "../../../interfaces/ISize.js";
|
|
17
16
|
import { ITool } from "./tools/ITool.js";
|
|
17
|
+
import { ContextMenu } from "../../helper/contextMenu/ContextMenu";
|
|
18
18
|
export declare class DesignerCanvas extends BaseCustomWebComponentLazyAppend implements IDesignerCanvas, IPlacementView, IUiCommandHandler {
|
|
19
19
|
serviceContainer: ServiceContainer;
|
|
20
20
|
instanceServiceContainer: InstanceServiceContainer;
|
|
@@ -87,7 +87,7 @@ export declare class DesignerCanvas extends BaseCustomWebComponentLazyAppend imp
|
|
|
87
87
|
private _onDragOver;
|
|
88
88
|
private _getPossibleContainerForDrop;
|
|
89
89
|
private _onDrop;
|
|
90
|
-
showDesignItemContextMenu(designItem: IDesignItem, event: MouseEvent):
|
|
90
|
+
showDesignItemContextMenu(designItem: IDesignItem, event: MouseEvent): ContextMenu;
|
|
91
91
|
private _onDblClick;
|
|
92
92
|
private onKeyUp;
|
|
93
93
|
private onKeyDown;
|
|
@@ -8,7 +8,6 @@ import { dragDropFormatNameElementDefinition, dragDropFormatNameBindingObject }
|
|
|
8
8
|
import { ContentService } from '../../services/contentService/ContentService';
|
|
9
9
|
import { InsertAction } from '../../services/undoService/transactionItems/InsertAction';
|
|
10
10
|
import { Snaplines } from './Snaplines';
|
|
11
|
-
import { ContextMenuHelper } from '../../helper/contextMenu/ContextMenuHelper';
|
|
12
11
|
import { DeleteAction } from '../../services/undoService/transactionItems/DeleteAction';
|
|
13
12
|
import { CommandType } from '../../../commandHandling/CommandType';
|
|
14
13
|
import { DefaultHtmlParserService } from "../../services/htmlParserService/DefaultHtmlParserService";
|
|
@@ -20,6 +19,7 @@ import { dataURItoBlob, exportData, sleep } from "../../helper/Helper";
|
|
|
20
19
|
import { DomHelper } from '@node-projects/base-custom-webcomponent/dist/DomHelper';
|
|
21
20
|
import { OverlayLayer } from "./extensions/OverlayLayer";
|
|
22
21
|
import { OverlayLayerView } from './overlayLayerView';
|
|
22
|
+
import { ContextMenu } from "../../helper/contextMenu/ContextMenu";
|
|
23
23
|
export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
24
24
|
// Public Properties
|
|
25
25
|
serviceContainer;
|
|
@@ -639,8 +639,9 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
|
639
639
|
mnuItems.push(...cme.provideContextMenuItems(event, this, designItem));
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
|
|
643
|
-
|
|
642
|
+
let ctxMenu = new ContextMenu(mnuItems, null);
|
|
643
|
+
ctxMenu.display(event);
|
|
644
|
+
return ctxMenu;
|
|
644
645
|
}
|
|
645
646
|
_onDblClick(event) {
|
|
646
647
|
event.preventDefault();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
package/dist/elements/widgets/designerView/extensions/contextMenu/IContextMenuExtension.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
export declare type ContextmenuInitiator = 'designer' | 'treeView' | 'other';
|
package/dist/elements/widgets/designerView/extensions/contextMenu/ItemsBelowContextMenu.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
|
@@ -6,8 +6,7 @@ export class ItemsBelowContextMenu {
|
|
|
6
6
|
provideContextMenuItems(event, designerCanvas, designItem) {
|
|
7
7
|
const lstItems = designerCanvas.elementsFromPoint(event.x, event.y);
|
|
8
8
|
if (lstItems.length > 0) {
|
|
9
|
-
|
|
10
|
-
return [...lstItems.map(x => ({ title: 'select: ' + x.localName + (x.id ? ' (' + x.id + ')' : ''), action: () => this._select(designerCanvas, x) }))];
|
|
9
|
+
return [{ title: 'items below', children: [...lstItems.map(x => ({ title: 'select: ' + x.localName + (x.id ? ' (' + x.id + ')' : ''), action: () => this._select(designerCanvas, x) }))] }];
|
|
11
10
|
}
|
|
12
11
|
return [];
|
|
13
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
package/dist/elements/widgets/designerView/extensions/contextMenu/RotateLeftAndRightContextMenu.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
package/dist/elements/widgets/designerView/extensions/contextMenu/SelectAllChildrenContextMenu.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
package/dist/elements/widgets/designerView/extensions/contextMenu/ZoomToElementContextMenu.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContextMenuItem } from "../../../../helper/contextMenu/
|
|
1
|
+
import { IContextMenuItem } from "../../../../helper/contextMenu/IContextMenuItem";
|
|
2
2
|
import { IDesignItem } from "../../../../item/IDesignItem";
|
|
3
3
|
import { IDesignerCanvas } from "../../IDesignerCanvas";
|
|
4
4
|
import { ContextmenuInitiator, IContextMenuExtension } from "./IContextMenuExtension";
|
|
@@ -2,7 +2,7 @@ import { AbstractExtension } from "../AbstractExtension";
|
|
|
2
2
|
import "../../../../helper/PathDataPolyfill";
|
|
3
3
|
import { EventNames } from "../../../../../enums/EventNames";
|
|
4
4
|
import { createPathD } from "../../../../helper/PathDataPolyfill";
|
|
5
|
-
import {
|
|
5
|
+
import { ContextMenu } from "../../../../helper/contextMenu/ContextMenu";
|
|
6
6
|
export class PathExtension extends AbstractExtension {
|
|
7
7
|
_lastPos;
|
|
8
8
|
_parentRect;
|
|
@@ -253,7 +253,7 @@ export class PathExtension extends AbstractExtension {
|
|
|
253
253
|
circle.addEventListener(EventNames.PointerUp, event => this.pointerEvent(event, circle, p, index));
|
|
254
254
|
circle.addEventListener(EventNames.ContextMenu, event => {
|
|
255
255
|
event.preventDefault();
|
|
256
|
-
|
|
256
|
+
ContextMenu.show(items, event);
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
_drawPathLine(x1, y1, x2, y2) {
|
|
@@ -46,7 +46,7 @@ export class PointerTool {
|
|
|
46
46
|
if (s.stopEventHandling(designerCanvas, event, currentElement))
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
if (event.button == 2) {
|
|
49
|
+
if (event.button == 2 && event.type == EventNames.PointerDown) {
|
|
50
50
|
this._showContextMenu(event, designerCanvas);
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCustomWebComponentLazyAppend, css, DomHelper } from '@node-projects/base-custom-webcomponent';
|
|
2
|
-
import { ContextMenuHelper } from '../../helper/contextMenu/ContextMenuHelper';
|
|
3
2
|
import { ValueType } from '../../services/propertiesService/ValueType';
|
|
3
|
+
import { ContextMenu } from '../../helper/contextMenu/ContextMenu';
|
|
4
4
|
export class PropertyGridPropertyList extends BaseCustomWebComponentLazyAppend {
|
|
5
5
|
_div;
|
|
6
6
|
_propertyMap = new Map();
|
|
@@ -146,7 +146,7 @@ export class PropertyGridPropertyList extends BaseCustomWebComponentLazyAppend {
|
|
|
146
146
|
]);
|
|
147
147
|
}
|
|
148
148
|
;
|
|
149
|
-
|
|
149
|
+
ContextMenu.show(ctxMenu, event);
|
|
150
150
|
}
|
|
151
151
|
designItemsChanged(designItems) {
|
|
152
152
|
this._designItems = designItems;
|
|
@@ -3,7 +3,7 @@ import { ITreeView } from './ITreeView';
|
|
|
3
3
|
import { IDesignItem } from '../../item/IDesignItem';
|
|
4
4
|
import { ISelectionChangedEvent } from '../../services/selectionService/ISelectionChangedEvent';
|
|
5
5
|
import { InstanceServiceContainer } from '../../services/InstanceServiceContainer.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ContextMenu } from '../../helper/contextMenu/ContextMenu';
|
|
7
7
|
export declare class TreeViewExtended extends BaseCustomWebComponentConstructorAppend implements ITreeView {
|
|
8
8
|
private _treeDiv;
|
|
9
9
|
private _tree;
|
|
@@ -21,7 +21,7 @@ export declare class TreeViewExtended extends BaseCustomWebComponentConstructorA
|
|
|
21
21
|
_switchLockAtDesignTimeState(img: HTMLImageElement, designItem: IDesignItem): void;
|
|
22
22
|
_showHideAtRunTimeState(img: HTMLImageElement, designItem: IDesignItem): void;
|
|
23
23
|
_switchHideAtRunTimeState(img: HTMLImageElement, designItem: IDesignItem): void;
|
|
24
|
-
showDesignItemContextMenu(designItem: IDesignItem, event: MouseEvent):
|
|
24
|
+
showDesignItemContextMenu(designItem: IDesignItem, event: MouseEvent): ContextMenu;
|
|
25
25
|
ready(): Promise<void>;
|
|
26
26
|
createTree(rootItem: IDesignItem): void;
|
|
27
27
|
set instanceServiceContainer(value: InstanceServiceContainer);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css, html, BaseCustomWebComponentConstructorAppend } from '@node-projects/base-custom-webcomponent';
|
|
2
2
|
import { NodeType } from '../../item/NodeType';
|
|
3
3
|
import { assetsPath } from '../../../Constants';
|
|
4
|
-
import {
|
|
4
|
+
import { ContextMenu } from '../../helper/contextMenu/ContextMenu';
|
|
5
5
|
export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
|
|
6
6
|
_treeDiv;
|
|
7
7
|
_tree;
|
|
@@ -157,7 +157,7 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
|
|
|
157
157
|
mnuItems.push(...cme.provideContextMenuItems(event, designItem.instanceServiceContainer.designerCanvas, designItem));
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
let ctxMnu =
|
|
160
|
+
let ctxMnu = ContextMenu.show(mnuItems, event);
|
|
161
161
|
return ctxMnu;
|
|
162
162
|
}
|
|
163
163
|
async ready() {
|
|
@@ -185,8 +185,8 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
|
|
|
185
185
|
let node = data.node;
|
|
186
186
|
if (node.tr.children[0]) {
|
|
187
187
|
let designItem = node.data.ref;
|
|
188
|
+
node.tr.oncontextmenu = (e) => this.showDesignItemContextMenu(designItem, e);
|
|
188
189
|
if (designItem && designItem.nodeType === NodeType.Element && designItem !== designItem.instanceServiceContainer.contentService.rootDesignItem) {
|
|
189
|
-
node.tr.oncontextmenu = (e) => this.showDesignItemContextMenu(designItem, e);
|
|
190
190
|
node.tr.onmouseenter = (e) => designItem.instanceServiceContainer.designerCanvas.showHoverExtension(designItem.element);
|
|
191
191
|
node.tr.onmouseleave = (e) => designItem.instanceServiceContainer.designerCanvas.showHoverExtension(null);
|
|
192
192
|
let d = document.createElement("div");
|
package/dist/index.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ export * from "./elements/helper/PathDataPolyfill.js";
|
|
|
9
9
|
export * from "./elements/helper/Screenshot.js";
|
|
10
10
|
export * from "./elements/loader/OldCustomElementsManifestLoader.js";
|
|
11
11
|
export * from "./elements/helper/w3color.js";
|
|
12
|
-
export * from "./elements/helper/contextMenu/
|
|
12
|
+
export * from "./elements/helper/contextMenu/ContextMenu.js";
|
|
13
13
|
export * from "./elements/helper/Helper.js";
|
|
14
|
-
export type { IContextMenuItem } from "./elements/helper/contextMenu/
|
|
14
|
+
export type { IContextMenuItem } from "./elements/helper/contextMenu/IContextMenuItem.js";
|
|
15
15
|
export * from "./elements/item/DesignItem.js";
|
|
16
16
|
export type { IDesignItem } from "./elements/item/IDesignItem.js";
|
|
17
17
|
export type { IBinding } from "./elements/item/IBinding.js";
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export * from "./elements/helper/PathDataPolyfill.js";
|
|
|
9
9
|
export * from "./elements/helper/Screenshot.js";
|
|
10
10
|
export * from "./elements/loader/OldCustomElementsManifestLoader.js";
|
|
11
11
|
export * from "./elements/helper/w3color.js";
|
|
12
|
-
export * from "./elements/helper/contextMenu/
|
|
12
|
+
export * from "./elements/helper/contextMenu/ContextMenu.js";
|
|
13
13
|
export * from "./elements/helper/Helper.js";
|
|
14
14
|
export * from "./elements/item/DesignItem.js";
|
|
15
15
|
export * from "./elements/item/BindingMode.js";
|
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.
|
|
4
|
+
"version": "0.0.127",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"author": "",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"prepublishOnly": "npm run build"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@node-projects/base-custom-webcomponent": "^0.10.
|
|
16
|
+
"@node-projects/base-custom-webcomponent": "^0.10.3",
|
|
17
17
|
"construct-style-sheets-polyfill": "^3.1.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|