@node-projects/web-component-designer 0.1.159 → 0.1.160
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/README.md
CHANGED
|
@@ -56,17 +56,6 @@ Your index.html should be extended as follows:
|
|
|
56
56
|
<link rel="stylesheet" href="/node_modules/mobile-drag-drop/default.css">
|
|
57
57
|
<script src="/node_modules/mobile-drag-drop/index.js"></script>
|
|
58
58
|
|
|
59
|
-
## Similar Frameworks
|
|
60
|
-
|
|
61
|
-
| Name | Licence | Edit Source (split View) | Zooming | Transformations |
|
|
62
|
-
|-------------------------|----------|--------------------------|---------|---|
|
|
63
|
-
| web-component-designer | MIT | yes |
|
|
64
|
-
| GrapeJS | BSD-3 | yes |
|
|
65
|
-
| CraftJS | MIT | no |
|
|
66
|
-
|
|
67
|
-
TODO:
|
|
68
|
-
force css states via explicit class (or attr??)
|
|
69
|
-
|
|
70
59
|
## Copyright notice
|
|
71
60
|
|
|
72
61
|
The Library uses Images from the Chrome Dev Tools, see
|
|
@@ -1055,12 +1055,12 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
|
1055
1055
|
return currentElement;
|
|
1056
1056
|
}
|
|
1057
1057
|
_patchStylesheetForDesigner(text) {
|
|
1058
|
-
return text.
|
|
1059
|
-
.
|
|
1060
|
-
.
|
|
1061
|
-
.
|
|
1062
|
-
.
|
|
1063
|
-
.
|
|
1058
|
+
return text.replaceAll(':hover', '[' + forceHoverAttributeName + ']')
|
|
1059
|
+
.replaceAll(':active', '[' + forceActiveAttributeName + ']')
|
|
1060
|
+
.replaceAll(':visited', '[' + forceVisitedAttributeName + ']')
|
|
1061
|
+
.replaceAll(':focus', '[' + forceFocusAttributeName + ']')
|
|
1062
|
+
.replaceAll(':focus-within', '[' + forceFocusWithinAttributeName + ']')
|
|
1063
|
+
.replaceAll(':focus-visible', '[' + forceFocusVisibleAttributeName + ']');
|
|
1064
1064
|
}
|
|
1065
1065
|
_hoverElement;
|
|
1066
1066
|
showHoverExtension(element, event) {
|
|
@@ -24,11 +24,15 @@ export class ElementDragTitleExtension extends AbstractExtension {
|
|
|
24
24
|
this._rect = this._drawRect(transformedCornerPoints[0].x, transformedCornerPoints[0].y, this._width, 15, 'svg-primary-selection-move', this._rect);
|
|
25
25
|
this._clickRect = this._drawRect(transformedCornerPoints[0].x, transformedCornerPoints[0].y, this._width, 18, 'svg-invisible', this._clickRect);
|
|
26
26
|
this._clickRect.style.background = 'transparent';
|
|
27
|
-
this._text = this._drawHTML('<div style="position:relative"><span style="width: 100%; position: absolute; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transform-origin: 0 0; padding-left: 2px;">' + text + '</span></div>', (boundRect.x - this.designerCanvas.containerBoundingRect.x) / this.designerCanvas.scaleFactor, transformedCornerPoints[0].y - 16, this._width, 15, 'svg-text-primary', this._text);
|
|
27
|
+
this._text = this._drawHTML('<div style="position:relative; pointer-events: none;"><span style="width: 100%; position: absolute; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transform-origin: 0 0; padding-left: 2px;">' + text + '</span></div>', (boundRect.x - this.designerCanvas.containerBoundingRect.x) / this.designerCanvas.scaleFactor, transformedCornerPoints[0].y - 16, this._width, 15, 'svg-text-primary', this._text);
|
|
28
28
|
this._text.style.overflow = 'visible';
|
|
29
29
|
this._clickRect.addEventListener('pointerdown', (e) => this._pointerEvent(e));
|
|
30
30
|
this._clickRect.addEventListener('pointermove', (e) => this._pointerEvent(e));
|
|
31
31
|
this._clickRect.addEventListener('pointerup', (e) => this._pointerEvent(e));
|
|
32
|
+
this._clickRect.addEventListener('contextmenu', (e) => {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
this.designerCanvas.showDesignItemContextMenu(this.extendedItem, e);
|
|
35
|
+
});
|
|
32
36
|
this.refresh(cache, event);
|
|
33
37
|
}
|
|
34
38
|
}
|
|
@@ -67,7 +71,8 @@ export class ElementDragTitleExtension extends AbstractExtension {
|
|
|
67
71
|
_pointerEvent(event) {
|
|
68
72
|
event.preventDefault();
|
|
69
73
|
event.stopPropagation();
|
|
70
|
-
|
|
74
|
+
if (event.button != 2)
|
|
75
|
+
this.designerCanvas.serviceContainer.designerTools.get(NamedTools.Pointer).pointerEventHandler(this.designerCanvas, event, this.extendedItem.element);
|
|
71
76
|
}
|
|
72
77
|
dispose() {
|
|
73
78
|
this._removeAllOverlays();
|
package/package.json
CHANGED