@node-projects/web-component-designer 0.0.117 → 0.0.118
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/widgets/designerView/extensions/AltToEnterContainerExtension.js +3 -0
- package/dist/elements/widgets/designerView/extensions/AltToEnterContainerExtensionProvider.js +1 -1
- package/dist/elements/widgets/designerView/extensions/ElementDragTitleExtension.js +9 -2
- package/dist/elements/widgets/designerView/extensions/ElementDragTitleExtensionProvider.js +1 -1
- package/dist/elements/widgets/designerView/extensions/PathExtension.js +4 -0
- package/package.json +7 -7
|
@@ -11,6 +11,9 @@ export class AltToEnterContainerExtension extends AbstractExtension {
|
|
|
11
11
|
refresh() {
|
|
12
12
|
let itemRect = this.designerCanvas.getNormalizedElementCoordinates(this.extendedItem.element);
|
|
13
13
|
this._text = this._drawText("Press ALT to enter container", itemRect.x + 5, itemRect.y + 12, 'svg-text-enter-container', this._text, OverlayLayer.Foregorund);
|
|
14
|
+
this._text.style.fontSize = (14 / this.designerCanvas.scaleFactor) + 'px';
|
|
15
|
+
this._text.setAttribute('x', '' + (itemRect.x + 5 / this.designerCanvas.scaleFactor));
|
|
16
|
+
this._text.setAttribute('y', '' + (itemRect.y + 12 / this.designerCanvas.scaleFactor));
|
|
14
17
|
}
|
|
15
18
|
dispose() {
|
|
16
19
|
this._removeAllOverlays();
|
package/dist/elements/widgets/designerView/extensions/AltToEnterContainerExtensionProvider.js
CHANGED
|
@@ -8,6 +8,6 @@ export class AltToEnterContainerExtensionProvider {
|
|
|
8
8
|
return new AltToEnterContainerExtension(extensionManager, designerView, designItem);
|
|
9
9
|
}
|
|
10
10
|
style = css `
|
|
11
|
-
.svg-text-enter-container { stroke: none; fill: black; stroke-width: 1; font-
|
|
11
|
+
.svg-text-enter-container { stroke: none; fill: black; stroke-width: 1; font-weight:800; font-family: monospace; }
|
|
12
12
|
`;
|
|
13
13
|
}
|
|
@@ -16,19 +16,26 @@ export class ElementDragTitleExtension extends AbstractExtension {
|
|
|
16
16
|
this._rect.addEventListener('pointerdown', (e) => this._pointerEvent(e));
|
|
17
17
|
this._rect.addEventListener('pointermove', (e) => this._pointerEvent(e));
|
|
18
18
|
this._rect.addEventListener('pointerup', (e) => this._pointerEvent(e));
|
|
19
|
+
this.refresh();
|
|
19
20
|
}
|
|
20
21
|
_drawMoveOverlay(itemRect) {
|
|
21
22
|
}
|
|
22
23
|
refresh() {
|
|
23
24
|
const boundRect = this.extendedItem.element.getBoundingClientRect();
|
|
24
25
|
const xr = (boundRect.x - this.designerCanvas.containerBoundingRect.x) / this.designerCanvas.scaleFactor;
|
|
25
|
-
const
|
|
26
|
+
const h = (15 / this.designerCanvas.scaleFactor);
|
|
27
|
+
const w = (60 / this.designerCanvas.scaleFactor);
|
|
28
|
+
const yr = (boundRect.y - this.designerCanvas.containerBoundingRect.y) / this.designerCanvas.scaleFactor - h;
|
|
26
29
|
this._rect.setAttribute('x', xr);
|
|
27
30
|
this._rect.setAttribute('y', yr);
|
|
31
|
+
this._rect.setAttribute('height', '' + h);
|
|
32
|
+
this._rect.setAttribute('width', '' + w);
|
|
33
|
+
this._rect.style.strokeWidth = (1 / this.designerCanvas.scaleFactor).toString();
|
|
28
34
|
const x = (boundRect.x - this.designerCanvas.containerBoundingRect.x) / this.designerCanvas.scaleFactor;
|
|
29
|
-
const y = (boundRect.y - this.designerCanvas.containerBoundingRect.y) / this.designerCanvas.scaleFactor - 5;
|
|
35
|
+
const y = (boundRect.y - this.designerCanvas.containerBoundingRect.y) / this.designerCanvas.scaleFactor - 5 / this.designerCanvas.scaleFactor;
|
|
30
36
|
this._text.setAttribute('x', x);
|
|
31
37
|
this._text.setAttribute('y', y);
|
|
38
|
+
this._text.style.fontSize = (10 / this.designerCanvas.scaleFactor) + 'px';
|
|
32
39
|
}
|
|
33
40
|
_pointerEvent(event) {
|
|
34
41
|
event.preventDefault();
|
|
@@ -8,6 +8,6 @@ export class ElementDragTitleExtensionProvider {
|
|
|
8
8
|
return new ElementDragTitleExtension(extensionManager, designerView, designItem);
|
|
9
9
|
}
|
|
10
10
|
style = css `
|
|
11
|
-
.svg-text-primary { stroke: none; fill: white;
|
|
11
|
+
.svg-text-primary { stroke: none; fill: white; font-family: monospace; }
|
|
12
12
|
`;
|
|
13
13
|
}
|
|
@@ -26,6 +26,10 @@ export class PathExtension extends AbstractExtension {
|
|
|
26
26
|
this._drawPathCircle(p.values[0], p.values[1], p, 0);
|
|
27
27
|
this._lastPos = { x: p.values[0], y: p.values[1] };
|
|
28
28
|
break;
|
|
29
|
+
case 'l':
|
|
30
|
+
this._drawPathCircle(p.values[0] + this._lastPos.x, p.values[1] + this._lastPos.y, p, 0);
|
|
31
|
+
this._lastPos = { x: p.values[0] + this._lastPos.x, y: p.values[1] + this._lastPos.y };
|
|
32
|
+
break;
|
|
29
33
|
case 'H':
|
|
30
34
|
break;
|
|
31
35
|
case 'V':
|
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.118",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"author": "",
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@node-projects/lean-he-esm": "^3.3.0",
|
|
21
21
|
"@node-projects/node-html-parser-esm": "^2.4.1",
|
|
22
|
-
"@papyrs/stylo": "^0.0.
|
|
22
|
+
"@papyrs/stylo": "^0.0.39",
|
|
23
23
|
"@types/codemirror": "^5.60.5",
|
|
24
24
|
"@types/jquery": "^3.5.14",
|
|
25
25
|
"@types/jquery.fancytree": "0.0.7",
|
|
26
|
-
"ace-builds": "^1.
|
|
26
|
+
"ace-builds": "^1.11.2",
|
|
27
27
|
"codemirror": "^6.0.1",
|
|
28
|
-
"esprima-next": "^5.8.
|
|
28
|
+
"esprima-next": "^5.8.4",
|
|
29
29
|
"html2canvas": "*",
|
|
30
|
-
"jest": "^
|
|
30
|
+
"jest": "^29.1.1",
|
|
31
31
|
"jquery": "^3.6.1",
|
|
32
32
|
"jquery.fancytree": "^2.38.2",
|
|
33
33
|
"monaco-editor": "^0.34.0",
|
|
34
|
-
"ts-jest": "^
|
|
35
|
-
"typescript": "^4.8.
|
|
34
|
+
"ts-jest": "^29.0.2",
|
|
35
|
+
"typescript": "^4.8.4",
|
|
36
36
|
"typescript-lit-html-plugin": "^0.9.0"
|
|
37
37
|
},
|
|
38
38
|
"repository": {
|