@node-projects/web-component-designer 0.1.83 → 0.1.85
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/helper/LayoutHelper.d.ts +3 -0
- package/dist/elements/helper/LayoutHelper.js +3 -0
- package/dist/elements/services/placementService/DefaultPlacementService.js +2 -2
- package/dist/elements/services/placementService/SnaplinesProviderService.js +8 -2
- package/dist/elements/widgets/designerView/designerCanvas.js +4 -9
- package/dist/elements/widgets/designerView/tools/MagicWandSelectorTool.js +15 -3
- package/dist/elements/widgets/designerView/tools/RectangleSelectorTool.js +16 -3
- package/dist/elements/widgets/designerView/tools/toolBar/buttons/SelectorToolButtonProvider.js +4 -1
- package/dist/elements/widgets/designerView/tools/toolBar/popups/DrawToolPopup copy.d.ts +6 -0
- package/dist/elements/widgets/designerView/tools/toolBar/popups/DrawToolPopup copy.js +102 -0
- package/dist/elements/widgets/designerView/tools/toolBar/popups/DrawToolPopup.js +2 -1
- package/dist/elements/widgets/designerView/tools/toolBar/popups/SelectionToolPopup.d.ts +6 -0
- package/dist/elements/widgets/designerView/tools/toolBar/popups/SelectionToolPopup.js +49 -0
- package/dist/elements/widgets/designerView/tools/toolBar/popups/TransformToolPopup.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { IPoint } from "../../interfaces/IPoint.js";
|
|
2
2
|
import { IDesignItem } from "../item/IDesignItem.js";
|
|
3
|
+
/**
|
|
4
|
+
* This function filters a items list, so only the outer elments are used for example in a move
|
|
5
|
+
*/
|
|
3
6
|
export declare function filterChildPlaceItems(items: IDesignItem[]): IDesignItem[];
|
|
4
7
|
export declare function getDesignItemCurrentPos(designItem: IDesignItem, mode: 'position' | 'transform' | 'margin' | 'padding'): IPoint;
|
|
5
8
|
export declare function placeDesignItem(container: IDesignItem, designItem: IDesignItem, offset: IPoint, mode: 'position' | 'transform' | 'margin' | 'padding'): void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
//TODO: this function should return the correct property to change a layout,
|
|
2
2
|
// for example left/right when left or right is used,
|
|
3
3
|
//maybe margin on grid? or transform??
|
|
4
|
+
/**
|
|
5
|
+
* This function filters a items list, so only the outer elments are used for example in a move
|
|
6
|
+
*/
|
|
4
7
|
export function filterChildPlaceItems(items) {
|
|
5
8
|
const filterdPlaceItems = [];
|
|
6
9
|
next: for (let i of items) {
|
|
@@ -97,8 +97,8 @@ export class DefaultPlacementService {
|
|
|
97
97
|
}
|
|
98
98
|
let filteredItems = filterChildPlaceItems(items);
|
|
99
99
|
for (const designItem of filteredItems) {
|
|
100
|
-
const canvas = designItem.element
|
|
101
|
-
let originalElementAndAllAncestorsMultipliedMatrix = getResultingTransformationBetweenElementAndAllAncestors(designItem.element
|
|
100
|
+
const canvas = designItem.instanceServiceContainer.designerCanvas.rootDesignItem.element;
|
|
101
|
+
let originalElementAndAllAncestorsMultipliedMatrix = getResultingTransformationBetweenElementAndAllAncestors(designItem.parent.element, canvas, true);
|
|
102
102
|
let transformMatrixParentTransformsCompensated = null;
|
|
103
103
|
if (originalElementAndAllAncestorsMultipliedMatrix) {
|
|
104
104
|
transformMatrixParentTransformsCompensated = new DOMPoint(track.x, track.y, 0, 0).matrixTransform(originalElementAndAllAncestorsMultipliedMatrix.inverse());
|
|
@@ -12,8 +12,13 @@ export class SnaplinesProviderService {
|
|
|
12
12
|
const positionsMiddleH = [];
|
|
13
13
|
const positionsV = [];
|
|
14
14
|
const positionsMiddleV = [];
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const tw = document.createTreeWalker(containerItem.isRootItem ? containerItem.element.shadowRoot : containerItem.element, NodeFilter.SHOW_ELEMENT);
|
|
16
|
+
let n = tw.nextNode();
|
|
17
|
+
while (n != null) {
|
|
18
|
+
if (ignMap.has(n)) {
|
|
19
|
+
n = tw.nextSibling();
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
17
22
|
const p = n.getBoundingClientRect();
|
|
18
23
|
const pLeft = (p.x - outerRect.x) / canvas.scaleFactor;
|
|
19
24
|
const pMidH = (p.x - outerRect.x + p.width / 2) / canvas.scaleFactor;
|
|
@@ -36,6 +41,7 @@ export class SnaplinesProviderService {
|
|
|
36
41
|
positionsV.push([pBottom, transformedP]);
|
|
37
42
|
if (provideWithDist)
|
|
38
43
|
positionsV.push([pBottom + provideWithDistDist, transformedP]);
|
|
44
|
+
n = tw.nextNode();
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
47
|
positionsH.push([0, { x: 0, y: 0, width: 0, height: 0 }]);
|
|
@@ -19,6 +19,7 @@ import { ContextMenu } from '../../helper/contextMenu/ContextMenu.js';
|
|
|
19
19
|
import { NodeType } from '../../item/NodeType.js';
|
|
20
20
|
import { StylesheetChangedAction } from '../../services/undoService/transactionItems/StylesheetChangedAction.js';
|
|
21
21
|
import { SetDesignItemsAction } from '../../services/undoService/transactionItems/SetDesignItemsAction.js';
|
|
22
|
+
import { filterChildPlaceItems } from '../../helper/LayoutHelper.js';
|
|
22
23
|
export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
23
24
|
// Public Properties
|
|
24
25
|
serviceContainer;
|
|
@@ -749,13 +750,6 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
|
749
750
|
_lastDdElement = null;
|
|
750
751
|
_onDragOver(event) {
|
|
751
752
|
event.preventDefault();
|
|
752
|
-
/*if (this.alignOnSnap) {
|
|
753
|
-
this.snapLines.calculateSnaplines(this.instanceServiceContainer.selectionService.selectedElements);
|
|
754
|
-
//TODO: fix this following code...
|
|
755
|
-
const currentPoint = this.getDesignerMousepoint(event);
|
|
756
|
-
let containerService = this.serviceContainer.getLastServiceWhere('containerService', x => x.serviceForContainer(this.rootDesignItem))
|
|
757
|
-
containerService.finishPlace(this, this.rootDesignItem, this._initialPoint, currentPoint, this.instanceServiceContainer.selectionService.selectedElements);
|
|
758
|
-
}*/
|
|
759
753
|
this.fillCalculationrects();
|
|
760
754
|
if (event.dataTransfer.types.length > 0 && event.dataTransfer.types[0] == 'Files') {
|
|
761
755
|
const ddService = this.serviceContainer.externalDragDropService;
|
|
@@ -918,10 +912,11 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
|
918
912
|
offset.x = -moveOffset;
|
|
919
913
|
if (event.key == 'ArrowLeft')
|
|
920
914
|
offset.x = moveOffset;
|
|
921
|
-
this.instanceServiceContainer.selectionService.selectedElements
|
|
915
|
+
for (let x of filterChildPlaceItems(this.instanceServiceContainer.selectionService.selectedElements)) {
|
|
922
916
|
const containerStyle = getComputedStyle(x.parent.element);
|
|
923
917
|
x.serviceContainer.getLastServiceWhere('containerService', y => y.serviceForContainer(x.parent, containerStyle)).moveElements([x], offset, false);
|
|
924
|
-
}
|
|
918
|
+
}
|
|
919
|
+
;
|
|
925
920
|
}
|
|
926
921
|
break;
|
|
927
922
|
}
|
|
@@ -6,6 +6,12 @@ export class MagicWandSelectorTool {
|
|
|
6
6
|
_pathD;
|
|
7
7
|
_path;
|
|
8
8
|
pointerEventHandler(designerCanvas, event, currentElement) {
|
|
9
|
+
if (event.ctrlKey)
|
|
10
|
+
this.cursor = 'copy';
|
|
11
|
+
else if (event.altKey)
|
|
12
|
+
this.cursor = 'default';
|
|
13
|
+
else
|
|
14
|
+
this.cursor = 'default';
|
|
9
15
|
const currentPoint = designerCanvas.getNormalizedEventCoordinates(event);
|
|
10
16
|
switch (event.type) {
|
|
11
17
|
case EventNames.PointerDown:
|
|
@@ -30,6 +36,8 @@ export class MagicWandSelectorTool {
|
|
|
30
36
|
designerCanvas.releaseActiveTool();
|
|
31
37
|
const elements = designerCanvas.rootDesignItem.querySelectorAll('*');
|
|
32
38
|
const inSelectionElements = [];
|
|
39
|
+
if ((event.ctrlKey || event.altKey) && designerCanvas.instanceServiceContainer.selectionService.selectedElements)
|
|
40
|
+
inSelectionElements.push(...designerCanvas.instanceServiceContainer.selectionService.selectedElements);
|
|
33
41
|
let point = designerCanvas.overlayLayer.createPoint();
|
|
34
42
|
for (let e of elements) {
|
|
35
43
|
let elementRect = designerCanvas.getNormalizedElementCoordinates(e);
|
|
@@ -47,9 +55,13 @@ export class MagicWandSelectorTool {
|
|
|
47
55
|
const p4 = this._path.isPointInFill(point) || this._path.isPointInStroke(point);
|
|
48
56
|
if (p1 && p2 && p3 && p4) {
|
|
49
57
|
const desItem = DesignItem.GetOrCreateDesignItem(e, e, designerCanvas.serviceContainer, designerCanvas.instanceServiceContainer);
|
|
50
|
-
if (
|
|
51
|
-
inSelectionElements.push(
|
|
52
|
-
|
|
58
|
+
if (!inSelectionElements.includes(desItem) && !event.altKey) {
|
|
59
|
+
inSelectionElements.push(desItem);
|
|
60
|
+
}
|
|
61
|
+
else if (event.altKey) {
|
|
62
|
+
const idx = inSelectionElements.indexOf(desItem);
|
|
63
|
+
inSelectionElements.splice(idx, 1);
|
|
64
|
+
}
|
|
53
65
|
}
|
|
54
66
|
}
|
|
55
67
|
designerCanvas.overlayLayer.removeOverlay(this._path);
|
|
@@ -8,6 +8,12 @@ export class RectangleSelectorTool {
|
|
|
8
8
|
activated(serviceContainer) {
|
|
9
9
|
}
|
|
10
10
|
pointerEventHandler(designerCanvas, event, currentElement) {
|
|
11
|
+
if (event.ctrlKey)
|
|
12
|
+
this.cursor = 'copy';
|
|
13
|
+
else if (event.altKey)
|
|
14
|
+
this.cursor = 'default';
|
|
15
|
+
else
|
|
16
|
+
this.cursor = 'default';
|
|
11
17
|
const currentPoint = designerCanvas.getNormalizedEventCoordinates(event);
|
|
12
18
|
switch (event.type) {
|
|
13
19
|
case EventNames.PointerDown:
|
|
@@ -52,6 +58,8 @@ export class RectangleSelectorTool {
|
|
|
52
58
|
designerCanvas.releaseActiveTool();
|
|
53
59
|
const elements = designerCanvas.rootDesignItem.querySelectorAll('*');
|
|
54
60
|
let inSelectionElements = [];
|
|
61
|
+
if ((event.ctrlKey || event.altKey) && designerCanvas.instanceServiceContainer.selectionService.selectedElements)
|
|
62
|
+
inSelectionElements.push(...designerCanvas.instanceServiceContainer.selectionService.selectedElements);
|
|
55
63
|
let point = designerCanvas.overlayLayer.createPoint();
|
|
56
64
|
for (let e of elements) {
|
|
57
65
|
let elementRect = designerCanvas.getNormalizedElementCoordinates(e);
|
|
@@ -69,11 +77,16 @@ export class RectangleSelectorTool {
|
|
|
69
77
|
const p4 = p3 && this._rect.isPointInFill(point);
|
|
70
78
|
if (p4) {
|
|
71
79
|
const desItem = DesignItem.GetOrCreateDesignItem(e, e, designerCanvas.serviceContainer, designerCanvas.instanceServiceContainer);
|
|
72
|
-
if (
|
|
73
|
-
inSelectionElements.push(
|
|
74
|
-
|
|
80
|
+
if (!inSelectionElements.includes(desItem) && !event.altKey) {
|
|
81
|
+
inSelectionElements.push(desItem);
|
|
82
|
+
}
|
|
83
|
+
else if (event.altKey) {
|
|
84
|
+
const idx = inSelectionElements.indexOf(desItem);
|
|
85
|
+
inSelectionElements.splice(idx, 1);
|
|
86
|
+
}
|
|
75
87
|
}
|
|
76
88
|
}
|
|
89
|
+
designerCanvas.instanceServiceContainer.selectionService.setSelectedElements(inSelectionElements);
|
|
77
90
|
designerCanvas.overlayLayer.removeOverlay(this._rect);
|
|
78
91
|
this._rect = null;
|
|
79
92
|
this._initialPoint = null;
|
package/dist/elements/widgets/designerView/tools/toolBar/buttons/SelectorToolButtonProvider.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { DesignerToolbarButton } from '../DesignerToolbarButton.js';
|
|
2
2
|
import { assetsPath } from "../../../../../../Constants.js";
|
|
3
|
+
import { SelectionToolPopup } from "../popups/SelectionToolPopup.js";
|
|
3
4
|
export class SelectorToolButtonProvider {
|
|
4
5
|
provideButton(designerCanvas) {
|
|
5
|
-
|
|
6
|
+
const button = new DesignerToolbarButton(designerCanvas, {
|
|
6
7
|
'RectangleSelector': { icon: assetsPath + 'images/layout/SelectRectTool.svg' },
|
|
7
8
|
'MagicWandSelector': { icon: assetsPath + 'images/layout/MagicWandTool.svg' }
|
|
8
9
|
});
|
|
10
|
+
button.popup = SelectionToolPopup;
|
|
11
|
+
return button;
|
|
9
12
|
}
|
|
10
13
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseCustomWebComponentConstructorAppend } from '@node-projects/base-custom-webcomponent';
|
|
2
|
+
export declare class DrawToolPopup extends BaseCustomWebComponentConstructorAppend {
|
|
3
|
+
static style: CSSStyleSheet;
|
|
4
|
+
static template: HTMLTemplateElement;
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { html, BaseCustomWebComponentConstructorAppend, css } from '@node-projects/base-custom-webcomponent';
|
|
2
|
+
import { assetsPath } from "../../../../../../Constants.js";
|
|
3
|
+
export class DrawToolPopup extends BaseCustomWebComponentConstructorAppend {
|
|
4
|
+
static style = css `
|
|
5
|
+
.container {
|
|
6
|
+
width: 220px;
|
|
7
|
+
min-height: 200px;
|
|
8
|
+
color: white;
|
|
9
|
+
background-color: rgb(64, 64, 64);
|
|
10
|
+
border: 1px solid black;
|
|
11
|
+
}
|
|
12
|
+
header {
|
|
13
|
+
text-align: center;
|
|
14
|
+
}
|
|
15
|
+
.tool {
|
|
16
|
+
height: 32px;
|
|
17
|
+
width: 32px;
|
|
18
|
+
background-color: rgb(255, 255, 255);
|
|
19
|
+
background-size: 65%;
|
|
20
|
+
background-repeat: no-repeat;
|
|
21
|
+
background-position: center center;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
border-bottom: 1px solid black;
|
|
24
|
+
}
|
|
25
|
+
.tools {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
margin-bottom: 5px;
|
|
29
|
+
}
|
|
30
|
+
.inputs{
|
|
31
|
+
float: left;
|
|
32
|
+
margin-top: 5px;
|
|
33
|
+
align-items: center;
|
|
34
|
+
}
|
|
35
|
+
.input {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
margin-top: 5px;
|
|
39
|
+
}
|
|
40
|
+
.text {
|
|
41
|
+
margin-left: 5px;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
}
|
|
44
|
+
.strokecolor{
|
|
45
|
+
float: both;
|
|
46
|
+
}
|
|
47
|
+
.fillbrush{
|
|
48
|
+
float: both;
|
|
49
|
+
}
|
|
50
|
+
.strokethickness{
|
|
51
|
+
float: both;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
`;
|
|
55
|
+
static template = html `
|
|
56
|
+
<div class="container">
|
|
57
|
+
<header><h2 id="title" style="margin: 0;">Draw</h2></header>
|
|
58
|
+
<main id="content-area">
|
|
59
|
+
<div class="tools">
|
|
60
|
+
<div class="tool" data-command="setTool" data-command-parameter="DrawLine" title="Draw Line" style="background-image: url('${assetsPath}images/layout/DrawLineTool.svg');"></div>
|
|
61
|
+
<div class="tool" data-command="setTool" data-command-parameter="DrawPath" title="Pointer Tool" style="background-image: url('${assetsPath}images/layout/DrawPathTool.svg');"></div>
|
|
62
|
+
<div class="tool" data-command="setTool" data-command-parameter="DrawRect" title="Draw Rectangle" style="background-image: url('${assetsPath}images/layout/DrawRectTool.svg');"></div>
|
|
63
|
+
<div class="tool" data-command="setTool" data-command-parameter="DrawEllipsis" title="Draw Ellipsis" style="background-image: url('${assetsPath}images/layout/DrawEllipTool.svg');"></div>
|
|
64
|
+
<div class="tool" data-command="setTool" data-command-parameter="PickColor" title="Pick Color" style="background-image: url('${assetsPath}images/layout/ColorPickerTool.svg');"></div>
|
|
65
|
+
</div>
|
|
66
|
+
<div class="inputs">
|
|
67
|
+
<div class="input">
|
|
68
|
+
<input id="strokecolor" class="strokecolor" type="color" title="stroke color" value="#000000" style="padding: 0; width:31px; height:31px;">
|
|
69
|
+
<text class="text">Stroke Color</text>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="input">
|
|
72
|
+
<input id="fillbrush" class="fillbrush" type="color" title="fill brush" value="#ffffff" style="padding: 0; width:31px; height:31px;">
|
|
73
|
+
<text class="text">Fill Brush</text>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="input">
|
|
76
|
+
<input id="strokethickness" class="strokethickness" type="range" title="stroke thickness" min="1" max="20" value="3" style="padding: 0; width:80px; height:20px; margin-right: 5px;">
|
|
77
|
+
<text class="text">Stroke Thickness</text>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</main>
|
|
81
|
+
</div>`;
|
|
82
|
+
constructor() {
|
|
83
|
+
super();
|
|
84
|
+
for (let e of [...this.shadowRoot.querySelectorAll("div.tool")]) {
|
|
85
|
+
let div = e;
|
|
86
|
+
div.onclick = () => this.getRootNode().host.setTool(div.dataset['commandParameter']);
|
|
87
|
+
}
|
|
88
|
+
if (this.shadowRoot.querySelector("input.strokecolor")) {
|
|
89
|
+
let input = this._getDomElement("strokecolor");
|
|
90
|
+
input.onchange = () => this.getRootNode().host.setStrokeColor(input.value);
|
|
91
|
+
}
|
|
92
|
+
if (this.shadowRoot.querySelector("input.fillbrush")) {
|
|
93
|
+
let input = this._getDomElement("fillbrush");
|
|
94
|
+
input.onchange = () => this.getRootNode().host.setFillBrush(input.value);
|
|
95
|
+
}
|
|
96
|
+
if (this.shadowRoot.querySelector("input.strokethickness")) {
|
|
97
|
+
let input = this._getDomElement("strokethickness");
|
|
98
|
+
input.onchange = () => this.getRootNode().host.setStrokeThickness(input.value);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
customElements.define('node-projects-designer-drawtool-popup', DrawToolPopup);
|
|
@@ -26,6 +26,7 @@ export class DrawToolPopup extends BaseCustomWebComponentConstructorAppend {
|
|
|
26
26
|
display: flex;
|
|
27
27
|
flex-wrap: wrap;
|
|
28
28
|
margin-bottom: 5px;
|
|
29
|
+
gap: 3px;
|
|
29
30
|
}
|
|
30
31
|
.inputs{
|
|
31
32
|
float: left;
|
|
@@ -99,4 +100,4 @@ export class DrawToolPopup extends BaseCustomWebComponentConstructorAppend {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
customElements.define('node-projects-designer-
|
|
103
|
+
customElements.define('node-projects-designer-draw-tool-popup', DrawToolPopup);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseCustomWebComponentConstructorAppend } from '@node-projects/base-custom-webcomponent';
|
|
2
|
+
export declare class SelectionToolPopup extends BaseCustomWebComponentConstructorAppend {
|
|
3
|
+
static style: CSSStyleSheet;
|
|
4
|
+
static template: HTMLTemplateElement;
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { html, BaseCustomWebComponentConstructorAppend, css } from '@node-projects/base-custom-webcomponent';
|
|
2
|
+
import { assetsPath } from "../../../../../../Constants.js";
|
|
3
|
+
export class SelectionToolPopup extends BaseCustomWebComponentConstructorAppend {
|
|
4
|
+
static style = css `
|
|
5
|
+
.container {
|
|
6
|
+
width: 120px;
|
|
7
|
+
min-height: 100px;
|
|
8
|
+
color: white;
|
|
9
|
+
background-color: rgb(64, 64, 64);
|
|
10
|
+
border: 1px solid black;
|
|
11
|
+
}
|
|
12
|
+
header {
|
|
13
|
+
text-align: center;
|
|
14
|
+
}
|
|
15
|
+
.tool {
|
|
16
|
+
height: 32px;
|
|
17
|
+
width: 32px;
|
|
18
|
+
background-color: rgb(255, 255, 255);
|
|
19
|
+
background-size: 65%;
|
|
20
|
+
background-repeat: no-repeat;
|
|
21
|
+
background-position: center center;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
border-bottom: 1px solid black;
|
|
24
|
+
}
|
|
25
|
+
.tools {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
margin-bottom: 5px;
|
|
29
|
+
gap: 3px;
|
|
30
|
+
}`;
|
|
31
|
+
static template = html `
|
|
32
|
+
<div class="container">
|
|
33
|
+
<header><h2 id="title" style="margin: 0;">Selection</h2></header>
|
|
34
|
+
<main id="content-area">
|
|
35
|
+
<div class="tools">
|
|
36
|
+
<div class="tool" data-command="setTool" data-command-parameter="RectangleSelector" title="Rectangle Selector" style="background-image: url('${assetsPath}images/layout/SelectRectTool.svg');"></div>
|
|
37
|
+
<div class="tool" data-command="setTool" data-command-parameter="MagicWandSelector" title="Magic Wand Selector" style="background-image: url('${assetsPath}images/layout/MagicWandTool.svg');"></div>
|
|
38
|
+
</div>
|
|
39
|
+
</main>
|
|
40
|
+
</div>`;
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
for (let e of [...this.shadowRoot.querySelectorAll("div.tool")]) {
|
|
44
|
+
let div = e;
|
|
45
|
+
div.onclick = () => this.getRootNode().host.setTool(div.dataset['commandParameter']);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
customElements.define('node-projects-designer-selection-tool-popup', SelectionToolPopup);
|
|
@@ -333,4 +333,4 @@ export class TransformToolPopup extends BaseCustomWebComponentConstructorAppend
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
customElements.define('node-projects-designer-
|
|
336
|
+
customElements.define('node-projects-designer-transform-tool-popup', TransformToolPopup);
|
package/dist/index.d.ts
CHANGED
|
@@ -80,6 +80,8 @@ export type { IInstanceService } from "./elements/services/instanceService/IInst
|
|
|
80
80
|
export * from "./elements/services/manifestParsers/WebcomponentManifestParserService.js";
|
|
81
81
|
export type { IModelCommandService } from "./elements/services/modelCommandService/IModelCommandService.js";
|
|
82
82
|
export * from "./elements/services/modelCommandService/DefaultModelCommandService.js";
|
|
83
|
+
export type { IMultiplayerService } from "./elements/services/multiplayerService/IMultiplayerService.js";
|
|
84
|
+
export * from "./elements/services/multiplayerService/MultiplayerService.js";
|
|
83
85
|
export * from "./elements/services/propertiesService/DefaultEditorTypesService.js";
|
|
84
86
|
export type { IEditorTypesService } from "./elements/services/propertiesService/IEditorTypesService.js";
|
|
85
87
|
export type { IPropertiesService } from "./elements/services/propertiesService/IPropertiesService.js";
|
|
@@ -164,6 +166,7 @@ export * from "./elements/widgets/designerView/tools/toolBar/buttons/TextToolBut
|
|
|
164
166
|
export * from "./elements/widgets/designerView/tools/toolBar/buttons/ZoomToolButtonProvider.js";
|
|
165
167
|
export * from "./elements/widgets/designerView/tools/toolBar/buttons/TransformToolButtonProvider.js";
|
|
166
168
|
export * from "./elements/widgets/designerView/tools/toolBar/popups/DrawToolPopup.js";
|
|
169
|
+
export * from "./elements/widgets/designerView/tools/toolBar/popups/SelectionToolPopup.js";
|
|
167
170
|
export * from "./elements/widgets/designerView/tools/toolBar/DesignerToolbar.js";
|
|
168
171
|
export * from "./elements/widgets/designerView/tools/toolBar/DesignerToolbarButton.js";
|
|
169
172
|
export type { IDesignViewToolbarButtonProvider } from "./elements/widgets/designerView/tools/toolBar/IDesignViewToolbarButtonProvider.js";
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ export * from "./elements/services/htmlParserService/DefaultHtmlParserService.js
|
|
|
46
46
|
export * from "./elements/services/instanceService/DefaultInstanceService.js";
|
|
47
47
|
export * from "./elements/services/manifestParsers/WebcomponentManifestParserService.js";
|
|
48
48
|
export * from "./elements/services/modelCommandService/DefaultModelCommandService.js";
|
|
49
|
+
export * from "./elements/services/multiplayerService/MultiplayerService.js";
|
|
49
50
|
export * from "./elements/services/propertiesService/DefaultEditorTypesService.js";
|
|
50
51
|
export * from "./elements/services/propertiesService/PropertyGroupsService.js";
|
|
51
52
|
export * from "./elements/services/propertiesService/propertyEditors/BasePropertyEditor.js";
|
|
@@ -112,6 +113,7 @@ export * from "./elements/widgets/designerView/tools/toolBar/buttons/TextToolBut
|
|
|
112
113
|
export * from "./elements/widgets/designerView/tools/toolBar/buttons/ZoomToolButtonProvider.js";
|
|
113
114
|
export * from "./elements/widgets/designerView/tools/toolBar/buttons/TransformToolButtonProvider.js";
|
|
114
115
|
export * from "./elements/widgets/designerView/tools/toolBar/popups/DrawToolPopup.js";
|
|
116
|
+
export * from "./elements/widgets/designerView/tools/toolBar/popups/SelectionToolPopup.js";
|
|
115
117
|
export * from "./elements/widgets/designerView/tools/toolBar/DesignerToolbar.js";
|
|
116
118
|
export * from "./elements/widgets/designerView/tools/toolBar/DesignerToolbarButton.js";
|
|
117
119
|
export * from "./elements/widgets/designerView/tools/toolBar/DesignerToolbar.js";
|