kritzel-stencil 0.0.54 → 0.0.56
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/cjs/kritzel-brush-style_17.cjs.entry.js +21 -17
- package/dist/cjs/kritzel-brush-style_17.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/viewport.class.js +1 -0
- package/dist/collection/classes/viewport.class.js.map +1 -1
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +37 -17
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
- package/dist/components/kritzel-editor.js +1 -1
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/{p-CITJbMNh.js → p-fsRjfJeF.js} +25 -20
- package/dist/components/p-fsRjfJeF.js.map +1 -0
- package/dist/esm/kritzel-brush-style_17.entry.js +21 -17
- package/dist/esm/kritzel-brush-style_17.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/{p-739c0899.entry.js → p-62842814.entry.js} +2 -2
- package/dist/stencil/p-62842814.entry.js.map +1 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +1 -0
- package/dist/types/components.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/p-CITJbMNh.js.map +0 -1
- package/dist/stencil/p-739c0899.entry.js.map +0 -1
|
@@ -4819,6 +4819,7 @@ class KritzelViewport {
|
|
|
4819
4819
|
this._store.state.startY = 0;
|
|
4820
4820
|
this._store.state.translateX = 0;
|
|
4821
4821
|
this._store.state.translateY = 0;
|
|
4822
|
+
this._store.rerender();
|
|
4822
4823
|
}
|
|
4823
4824
|
handleResize() {
|
|
4824
4825
|
this._store.state.viewportWidth = this._store.state.host.clientWidth;
|
|
@@ -5731,8 +5732,7 @@ const KritzelEngine = class {
|
|
|
5731
5732
|
handleMouseDown(ev) {
|
|
5732
5733
|
var _a, _b;
|
|
5733
5734
|
if (this.store.state.isContextMenuVisible) {
|
|
5734
|
-
this.
|
|
5735
|
-
this.store.state.isEnabled = true;
|
|
5735
|
+
this.hideContextMenu();
|
|
5736
5736
|
return;
|
|
5737
5737
|
}
|
|
5738
5738
|
if (this.store.state.isEnabled === false) {
|
|
@@ -5820,8 +5820,7 @@ const KritzelEngine = class {
|
|
|
5820
5820
|
handleWheel(ev) {
|
|
5821
5821
|
var _a, _b;
|
|
5822
5822
|
if (this.store.state.isContextMenuVisible) {
|
|
5823
|
-
this.
|
|
5824
|
-
this.store.state.isEnabled = true;
|
|
5823
|
+
this.hideContextMenu();
|
|
5825
5824
|
}
|
|
5826
5825
|
this.viewport.handleWheel(ev);
|
|
5827
5826
|
(_b = (_a = this.store.state) === null || _a === void 0 ? void 0 : _a.activeTool) === null || _b === void 0 ? void 0 : _b.handleWheel(ev);
|
|
@@ -5845,7 +5844,7 @@ const KritzelEngine = class {
|
|
|
5845
5844
|
}
|
|
5846
5845
|
handleContextMenuAction(event) {
|
|
5847
5846
|
event.detail.action();
|
|
5848
|
-
this.
|
|
5847
|
+
this.hideContextMenu();
|
|
5849
5848
|
}
|
|
5850
5849
|
async registerTool(toolName, toolClass, toolConfig) {
|
|
5851
5850
|
if (typeof toolClass !== 'function' || !(toolClass.prototype instanceof KritzelBaseTool)) {
|
|
@@ -5903,21 +5902,26 @@ const KritzelEngine = class {
|
|
|
5903
5902
|
async redo() {
|
|
5904
5903
|
this.store.history.redo();
|
|
5905
5904
|
}
|
|
5905
|
+
async hideContextMenu() {
|
|
5906
|
+
this.store.state.isContextMenuVisible = false;
|
|
5907
|
+
this.store.state.selectionBox = null;
|
|
5908
|
+
this.store.state.isSelecting = false;
|
|
5909
|
+
}
|
|
5906
5910
|
render() {
|
|
5907
5911
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
5908
5912
|
const computedStyle = window.getComputedStyle(this.host);
|
|
5909
5913
|
const baseHandleSizePx = computedStyle.getPropertyValue('--kritzel-selection-handle-size').trim() || '6px';
|
|
5910
5914
|
const baseHandleSize = parseFloat(baseHandleSizePx);
|
|
5911
5915
|
const baseHandleTouchSize = baseHandleSize * 2 < 14 ? 14 : baseHandleSize;
|
|
5912
|
-
return (index.h(index.Host, { key: '
|
|
5913
|
-
_a.translateX), index.h("div", { key: '
|
|
5914
|
-
_b.translateY), index.h("div", { key: '
|
|
5915
|
-
_c.viewportWidth), index.h("div", { key: '
|
|
5916
|
-
_d.viewportHeight), index.h("div", { key: '
|
|
5917
|
-
_e.scale), index.h("div", { key: '
|
|
5918
|
-
_g.name), index.h("div", { key: '
|
|
5919
|
-
_m.cursorX), index.h("div", { key: '
|
|
5920
|
-
_o.cursorY)), index.h("div", { key: '
|
|
5916
|
+
return (index.h(index.Host, { key: '657e79abc0fcfcea53e5cc2fdbf738e2528484eb' }, index.h("div", { key: '958b641575f67e0d4af485d6e016dad97f0374c5', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, index.h("div", { key: 'cbcceaeb84308afd4585da4156e84e5f388e71a8' }, "TranslateX: ", (_a = this.store.state) === null || _a === void 0 ? void 0 :
|
|
5917
|
+
_a.translateX), index.h("div", { key: '85affd2f0e73c5120184c1dcbd43c1d3f20e62fc' }, "TranslateY: ", (_b = this.store.state) === null || _b === void 0 ? void 0 :
|
|
5918
|
+
_b.translateY), index.h("div", { key: '50c6c1c60637798619264d7fd970560f2516bdfe' }, "ViewportWidth: ", (_c = this.store.state) === null || _c === void 0 ? void 0 :
|
|
5919
|
+
_c.viewportWidth), index.h("div", { key: 'e7b8687608610ea6690e829bb7ab347789874361' }, "ViewportHeight: ", (_d = this.store.state) === null || _d === void 0 ? void 0 :
|
|
5920
|
+
_d.viewportHeight), index.h("div", { key: 'b0fef414048508caba4096d73803d4e6cf2985d5' }, "ObjectsInViewport. ", this.store.objects.length), index.h("div", { key: '9eec781e50f6705320af1720b80a2a3437465f8e' }, "Scale: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
|
|
5921
|
+
_e.scale), index.h("div", { key: 'fdfce990c7d3e873793ba6fe96fa8c9f509cf871' }, "ActiveTool: ", (_g = (_f = this.store.state) === null || _f === void 0 ? void 0 : _f.activeTool) === null || _g === void 0 ? void 0 :
|
|
5922
|
+
_g.name), index.h("div", { key: '4f5291779f38119c0da4dd0c76cee953403a18fb' }, "HasViewportChanged: ", ((_h = this.store.state) === null || _h === void 0 ? void 0 : _h.hasViewportChanged) ? 'true' : 'false'), index.h("div", { key: 'f10780190d41f893f9503e69529e4493d3a2bb53' }, "IsEnabled: ", ((_j = this.store.state) === null || _j === void 0 ? void 0 : _j.isEnabled) ? 'true' : 'false'), index.h("div", { key: 'efdc247fc22755b6c93e29ae3cba8a3f77d9da1b' }, "IsScaling: ", ((_k = this.store.state) === null || _k === void 0 ? void 0 : _k.isScaling) ? 'true' : 'false'), index.h("div", { key: '6220789e4f91b06dc16b5279e9ad7f938be2b57c' }, "IsPanning: ", ((_l = this.store.state) === null || _l === void 0 ? void 0 : _l.isPanning) ? 'true' : 'false'), index.h("div", { key: '5d08a8710904e8429322f0abab9501e230269e22' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), index.h("div", { key: '3bd7ad33f021ab2bc17019c9421fb66e9324e954' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), index.h("div", { key: 'f43b598e9de8cfb46584c805f301d277e8c9756a' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), index.h("div", { key: '5eff9661689fc2a3af5fb1ac535d0a5bac695f7e' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), index.h("div", { key: 'da8b5ee45a3d207e4c77696f938957b30c308a72' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), index.h("div", { key: 'f958d0ef38567af150fe26637663ef85539815fe' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), index.h("div", { key: '8a27c1c3ee36111192b639b2e04dc3295822963b' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), index.h("div", { key: 'a57c3f9874d0755131cba940bbeac4fdd1e4b42d' }, "CursorX: ", (_m = this.store.state) === null || _m === void 0 ? void 0 :
|
|
5923
|
+
_m.cursorX), index.h("div", { key: 'b36d278cdf15c9681d5a13bbe0d38c40fb63572f' }, "CursorY: ", (_o = this.store.state) === null || _o === void 0 ? void 0 :
|
|
5924
|
+
_o.cursorY)), index.h("div", { key: 'c398ac098e0d94ff7f1bd7775b48b67c80462c14', class: "origin", style: {
|
|
5921
5925
|
transform: `matrix(${(_p = this.store.state) === null || _p === void 0 ? void 0 : _p.scale}, 0, 0, ${(_q = this.store.state) === null || _q === void 0 ? void 0 : _q.scale}, ${(_r = this.store.state) === null || _r === void 0 ? void 0 : _r.translateX}, ${(_s = this.store.state) === null || _s === void 0 ? void 0 : _s.translateY})`,
|
|
5922
5926
|
} }, (_t = this.store.objects) === null || _t === void 0 ? void 0 :
|
|
5923
5927
|
_t.map(object => {
|
|
@@ -6015,7 +6019,7 @@ const KritzelEngine = class {
|
|
|
6015
6019
|
fill: 'transparent',
|
|
6016
6020
|
cursor: 'grab',
|
|
6017
6021
|
}, visibility: object.selected && !this.isSelecting ? 'visible' : 'hidden' })), index.h("g", { style: { display: this.store.state.debugInfo.showObjectInfo ? 'block' : 'none' } }, index.h("foreignObject", { x: object.totalWidth.toString(), y: "0", width: "400px", height: "160px", style: { minHeight: '0', minWidth: '0', display: object.debugInfoVisible ? 'block' : 'none' } }, index.h("div", { style: { width: '100%', height: '100%' } }, index.h("div", { style: { whiteSpace: 'nowrap' } }, "zIndex: ", object.zIndex), index.h("div", { style: { whiteSpace: 'nowrap' } }, "translateX: ", object.translateX), index.h("div", { style: { whiteSpace: 'nowrap' } }, "translateY: ", object.translateY), index.h("div", { style: { whiteSpace: 'nowrap' } }, "width: ", object.width), index.h("div", { style: { whiteSpace: 'nowrap' } }, "height: ", object.height), index.h("div", { style: { whiteSpace: 'nowrap' } }, "scale: ", object.scale), index.h("div", { style: { whiteSpace: 'nowrap' } }, "rotation: ", object.rotation))))));
|
|
6018
|
-
}), index.h("svg", { key: '
|
|
6022
|
+
}), index.h("svg", { key: '2e49d78292a0c23413faeaefbdf0a19d0deed738', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
|
|
6019
6023
|
height: (_u = this.store.state.currentPath) === null || _u === void 0 ? void 0 : _u.height.toString(),
|
|
6020
6024
|
width: (_v = this.store.state.currentPath) === null || _v === void 0 ? void 0 : _v.width.toString(),
|
|
6021
6025
|
left: '0',
|
|
@@ -6024,12 +6028,12 @@ const KritzelEngine = class {
|
|
|
6024
6028
|
position: 'absolute',
|
|
6025
6029
|
transform: (_x = this.store.state.currentPath) === null || _x === void 0 ? void 0 : _x.transformationMatrix,
|
|
6026
6030
|
overflow: 'visible',
|
|
6027
|
-
}, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.h("path", { key: '
|
|
6031
|
+
}, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.h("path", { key: 'ae81abc2edbc6b6458c219575b6a30d6dc9202e2', d: (_z = this.store.state.currentPath) === null || _z === void 0 ? void 0 : _z.d, fill: (_0 = this.store.state.currentPath) === null || _0 === void 0 ? void 0 : _0.fill, stroke: (_1 = this.store.state.currentPath) === null || _1 === void 0 ? void 0 : _1.stroke }))), this.store.state.isContextMenuVisible && (index.h("kritzel-context-menu", { key: '8e4cc47400eb7c519e04854b67009dfd147acda6', ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, style: {
|
|
6028
6032
|
position: 'fixed',
|
|
6029
6033
|
left: `${this.store.state.contextMenuX}px`,
|
|
6030
6034
|
top: `${this.store.state.contextMenuY}px`,
|
|
6031
6035
|
zIndex: '10000',
|
|
6032
|
-
}, onActionSelected: event => this.handleContextMenuAction(event) })), ((_2 = this.store.state) === null || _2 === void 0 ? void 0 : _2.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && index.h("kritzel-cursor-trail", { key: '
|
|
6036
|
+
}, onActionSelected: event => this.handleContextMenuAction(event) })), ((_2 = this.store.state) === null || _2 === void 0 ? void 0 : _2.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && index.h("kritzel-cursor-trail", { key: '259516bef2b2281b7427d312d01b8201508bd7e6' })));
|
|
6033
6037
|
}
|
|
6034
6038
|
get host() { return index.getElement(this); }
|
|
6035
6039
|
};
|