kritzel-stencil 0.0.59 → 0.0.62
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_18.cjs.entry.js +38 -16
- package/dist/cjs/kritzel-brush-style_18.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 +0 -1
- package/dist/collection/classes/viewport.class.js.map +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +23 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js.map +1 -1
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +28 -12
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +23 -2
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/kritzel-brush-style.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-context-menu.js +1 -1
- package/dist/components/kritzel-control-brush-config.js +1 -1
- package/dist/components/kritzel-control-text-config.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-cursor-trail.js +1 -1
- package/dist/components/kritzel-dropdown.js +1 -1
- package/dist/components/kritzel-editor.js +38 -20
- package/dist/components/kritzel-editor.js.map +1 -1
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-font-family.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-icon.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/{p-B3294Xmv.js → p-2YFIMMk9.js} +3 -3
- package/dist/components/{p-B3294Xmv.js.map → p-2YFIMMk9.js.map} +1 -1
- package/dist/components/{p-BwUYYflt.js → p-941YMPAE.js} +4 -4
- package/dist/components/{p-BwUYYflt.js.map → p-941YMPAE.js.map} +1 -1
- package/dist/components/{p-sGUp-TMH.js → p-B6SElWXR.js} +20 -19
- package/dist/components/p-B6SElWXR.js.map +1 -0
- package/dist/components/{p-4BZa9y1Z.js → p-BC0MAXEG.js} +10 -10
- package/dist/components/{p-4BZa9y1Z.js.map → p-BC0MAXEG.js.map} +1 -1
- package/dist/components/{p-DeUSAQvd.js → p-BD83xG07.js} +3 -3
- package/dist/components/{p-DeUSAQvd.js.map → p-BD83xG07.js.map} +1 -1
- package/dist/components/{p-Doyhx4lX.js → p-BDnyq2Ml.js} +4 -4
- package/dist/components/{p-Doyhx4lX.js.map → p-BDnyq2Ml.js.map} +1 -1
- package/dist/components/{p-DYMGroc7.js → p-BeYq6zFh.js} +3 -3
- package/dist/components/{p-DYMGroc7.js.map → p-BeYq6zFh.js.map} +1 -1
- package/dist/components/{p-3tB1pqts.js → p-CMV4GbVh.js} +4 -4
- package/dist/components/{p-3tB1pqts.js.map → p-CMV4GbVh.js.map} +1 -1
- package/dist/components/{p-q9lo4l1n.js → p-CO18iRIg.js} +22 -18
- package/dist/components/p-CO18iRIg.js.map +1 -0
- package/dist/components/{p-DVoP86tX.js → p-COUn_3Z8.js} +4 -4
- package/dist/components/{p-DVoP86tX.js.map → p-COUn_3Z8.js.map} +1 -1
- package/dist/components/{p-61LnJU2_.js → p-CgdgJ3ae.js} +5 -5
- package/dist/components/{p-61LnJU2_.js.map → p-CgdgJ3ae.js.map} +1 -1
- package/dist/components/{p-p9rhP6Ef.js → p-D0Ebkp0_.js} +3 -3
- package/dist/components/{p-p9rhP6Ef.js.map → p-D0Ebkp0_.js.map} +1 -1
- package/dist/components/{p-C10CLNda.js → p-Do_nHKmv.js} +3 -3
- package/dist/components/{p-C10CLNda.js.map → p-Do_nHKmv.js.map} +1 -1
- package/dist/components/{p-cxCgU006.js → p-Dt5ac_OI.js} +4 -4
- package/dist/components/{p-cxCgU006.js.map → p-Dt5ac_OI.js.map} +1 -1
- package/dist/components/{p-ZBgUn421.js → p-DydKiGaQ.js} +3 -3
- package/dist/components/{p-ZBgUn421.js.map → p-DydKiGaQ.js.map} +1 -1
- package/dist/components/{p-Dk3WE598.js → p-EsONCtQl.js} +3 -3
- package/dist/components/{p-Dk3WE598.js.map → p-EsONCtQl.js.map} +1 -1
- package/dist/components/{p-DvEDeKLS.js → p-I5eu72SE.js} +4 -4
- package/dist/components/{p-DvEDeKLS.js.map → p-I5eu72SE.js.map} +1 -1
- package/dist/components/{p-CuUSP61L.js → p-V4wapDqR.js} +9 -9
- package/dist/components/{p-CuUSP61L.js.map → p-V4wapDqR.js.map} +1 -1
- package/dist/esm/kritzel-brush-style_18.entry.js +38 -16
- package/dist/esm/kritzel-brush-style_18.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/p-da6b48a0.entry.js +2 -0
- package/dist/stencil/p-da6b48a0.entry.js.map +1 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +6 -0
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +1 -0
- package/dist/types/components/ui/kritzel-controls/kritzel-controls.d.ts +3 -0
- package/dist/types/components.d.ts +18 -0
- package/package.json +1 -1
- package/dist/components/p-q9lo4l1n.js.map +0 -1
- package/dist/components/p-sGUp-TMH.js.map +0 -1
- package/dist/stencil/p-6892d565.entry.js +0 -2
- package/dist/stencil/p-6892d565.entry.js.map +0 -1
|
@@ -3041,6 +3041,7 @@ const kritzelControlsCss = ":host{display:flex;flex-direction:column;user-select
|
|
|
3041
3041
|
const KritzelControls = class {
|
|
3042
3042
|
constructor(hostRef) {
|
|
3043
3043
|
index.registerInstance(this, hostRef);
|
|
3044
|
+
this.controlsReady = index.createEvent(this, "controlsReady");
|
|
3044
3045
|
this.controls = [];
|
|
3045
3046
|
this.activeControl = null;
|
|
3046
3047
|
this.firstConfig = null;
|
|
@@ -3059,6 +3060,9 @@ const KritzelControls = class {
|
|
|
3059
3060
|
await this.initializeEngine();
|
|
3060
3061
|
await this.initializeTools();
|
|
3061
3062
|
}
|
|
3063
|
+
componentDidLoad() {
|
|
3064
|
+
this.controlsReady.emit();
|
|
3065
|
+
}
|
|
3062
3066
|
async initializeEngine() {
|
|
3063
3067
|
await customElements.whenDefined('kritzel-engine');
|
|
3064
3068
|
this.kritzelEngine = this.host.parentElement.querySelector('kritzel-engine');
|
|
@@ -3122,11 +3126,11 @@ const KritzelControls = class {
|
|
|
3122
3126
|
render() {
|
|
3123
3127
|
var _a, _b;
|
|
3124
3128
|
const hasNoConfig = ((_a = this.activeControl) === null || _a === void 0 ? void 0 : _a.config) === undefined || ((_b = this.activeControl) === null || _b === void 0 ? void 0 : _b.config) === null;
|
|
3125
|
-
return (index.h(index.Host, { key: '
|
|
3129
|
+
return (index.h(index.Host, { key: '2b13783ef0f1638ad76bfcef22c17c3eeb849d67' }, index.h("kritzel-utility-panel", { key: '1babeb88133cebc9057c85723b812b99152316c6', style: {
|
|
3126
3130
|
position: 'absolute',
|
|
3127
3131
|
bottom: '56px',
|
|
3128
3132
|
left: '12px',
|
|
3129
|
-
}, onUndo: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.undo(); }, onRedo: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.redo(); }, onDelete: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.delete(); } }), index.h("div", { key: '
|
|
3133
|
+
}, onUndo: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.undo(); }, onRedo: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.redo(); }, onDelete: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.delete(); } }), index.h("div", { key: '8fafebdf6726dd2bffe85cb2b3ada5f4885a2bf8', class: "kritzel-controls" }, this.controls.map(control => {
|
|
3130
3134
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3131
3135
|
if (control.type === 'tool') {
|
|
3132
3136
|
return (index.h("button", { class: {
|
|
@@ -4784,6 +4788,9 @@ const KritzelEditor = class {
|
|
|
4784
4788
|
},
|
|
4785
4789
|
];
|
|
4786
4790
|
this.customSvgIcons = {};
|
|
4791
|
+
this.forceUpdate = 0;
|
|
4792
|
+
this.engineReady = false;
|
|
4793
|
+
this.controlsReady = false;
|
|
4787
4794
|
}
|
|
4788
4795
|
handleTouchStart(event) {
|
|
4789
4796
|
if (event.cancelable) {
|
|
@@ -4795,8 +4802,22 @@ const KritzelEditor = class {
|
|
|
4795
4802
|
KritzelIconRegistry.register(name, svg);
|
|
4796
4803
|
}
|
|
4797
4804
|
}
|
|
4805
|
+
handleEngineReady() {
|
|
4806
|
+
this.engineReady = true;
|
|
4807
|
+
this.checkReadiness();
|
|
4808
|
+
}
|
|
4809
|
+
handleControlsReady() {
|
|
4810
|
+
this.controlsReady = true;
|
|
4811
|
+
this.checkReadiness();
|
|
4812
|
+
}
|
|
4813
|
+
checkReadiness() {
|
|
4814
|
+
if (this.engineReady && this.controlsReady) {
|
|
4815
|
+
console.info('KritzelEditor is ready');
|
|
4816
|
+
this.forceUpdate++;
|
|
4817
|
+
}
|
|
4818
|
+
}
|
|
4798
4819
|
render() {
|
|
4799
|
-
return (index.h(index.Host, { key: '
|
|
4820
|
+
return (index.h(index.Host, { key: 'cb87a19deed859ac8570f8ddaa2d393e1a43fae5' }, index.h("kritzel-engine", { key: '5ff39fddddee4cf02df2b337622ce9e97b3523a7', onEngineReady: () => this.handleEngineReady() }), index.h("kritzel-controls", { key: '97d032c051482b2d1a11ffbf7112edda7d052f51', controls: this.controls, onControlsReady: () => this.handleControlsReady() })));
|
|
4800
4821
|
}
|
|
4801
4822
|
};
|
|
4802
4823
|
KritzelEditor.style = kritzelEditorCss;
|
|
@@ -4814,7 +4835,6 @@ class KritzelViewport {
|
|
|
4814
4835
|
this._store.state.startY = 0;
|
|
4815
4836
|
this._store.state.translateX = 0;
|
|
4816
4837
|
this._store.state.translateY = 0;
|
|
4817
|
-
this._store.rerender();
|
|
4818
4838
|
}
|
|
4819
4839
|
handleResize() {
|
|
4820
4840
|
this._store.state.viewportWidth = this._store.state.host.clientWidth;
|
|
@@ -5666,6 +5686,7 @@ const KritzelEngine = class {
|
|
|
5666
5686
|
}
|
|
5667
5687
|
constructor(hostRef) {
|
|
5668
5688
|
index.registerInstance(this, hostRef);
|
|
5689
|
+
this.engineReady = index.createEvent(this, "engineReady");
|
|
5669
5690
|
this.activeToolChange = index.createEvent(this, "activeToolChange");
|
|
5670
5691
|
this.globalContextMenuItems = [
|
|
5671
5692
|
{
|
|
@@ -5717,6 +5738,7 @@ const KritzelEngine = class {
|
|
|
5717
5738
|
}
|
|
5718
5739
|
componentDidLoad() {
|
|
5719
5740
|
this.viewport = new KritzelViewport(this.store, this.host);
|
|
5741
|
+
this.engineReady.emit();
|
|
5720
5742
|
}
|
|
5721
5743
|
handleContextMenu(ev) {
|
|
5722
5744
|
if (this.store.state.isEnabled === false) {
|
|
@@ -5908,15 +5930,15 @@ const KritzelEngine = class {
|
|
|
5908
5930
|
const baseHandleSizePx = computedStyle.getPropertyValue('--kritzel-selection-handle-size').trim() || '6px';
|
|
5909
5931
|
const baseHandleSize = parseFloat(baseHandleSizePx);
|
|
5910
5932
|
const baseHandleTouchSize = baseHandleSize * 2 < 14 ? 14 : baseHandleSize;
|
|
5911
|
-
return (index.h(index.Host, { key: '
|
|
5912
|
-
_a.translateX), index.h("div", { key: '
|
|
5913
|
-
_b.translateY), index.h("div", { key: '
|
|
5914
|
-
_c.viewportWidth), index.h("div", { key: '
|
|
5915
|
-
_d.viewportHeight), index.h("div", { key: '
|
|
5916
|
-
_e.scale), index.h("div", { key: '
|
|
5917
|
-
_g.name), index.h("div", { key: '
|
|
5918
|
-
_m.cursorX), index.h("div", { key: '
|
|
5919
|
-
_o.cursorY)), index.h("div", { key: '
|
|
5933
|
+
return (index.h(index.Host, { key: '81d2f8efadded214fde44f3dbaea3b678d0b182b' }, index.h("div", { key: '6657555d40bff3b5d44733e286c4076a82ca2e98', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, index.h("div", { key: 'e0cf766f7e8c8e7856a6b55c9c24272fa865c86e' }, "TranslateX: ", (_a = this.store.state) === null || _a === void 0 ? void 0 :
|
|
5934
|
+
_a.translateX), index.h("div", { key: '6c979eb953d01507fd29013d9186618f8f14588b' }, "TranslateY: ", (_b = this.store.state) === null || _b === void 0 ? void 0 :
|
|
5935
|
+
_b.translateY), index.h("div", { key: '3be6ea4a5b5eef5d07ddc48aa8ac2e57edbe0887' }, "ViewportWidth: ", (_c = this.store.state) === null || _c === void 0 ? void 0 :
|
|
5936
|
+
_c.viewportWidth), index.h("div", { key: '70aed9d3ee1227ba2a4f54a95eda27cb748f4b9f' }, "ViewportHeight: ", (_d = this.store.state) === null || _d === void 0 ? void 0 :
|
|
5937
|
+
_d.viewportHeight), index.h("div", { key: 'c2e79c4245e9f107e5512472030684e0ed617d1a' }, "ObjectsInViewport. ", this.store.objects.length), index.h("div", { key: '66f4284c2d4fd5dae03ffa9b641a28b2528ea117' }, "Scale: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
|
|
5938
|
+
_e.scale), index.h("div", { key: 'e4518d18cf923b57dceb38c07f409471bc178e9d' }, "ActiveTool: ", (_g = (_f = this.store.state) === null || _f === void 0 ? void 0 : _f.activeTool) === null || _g === void 0 ? void 0 :
|
|
5939
|
+
_g.name), index.h("div", { key: '47ea576f9c78f3bfb3e03649a88ec0f7b544f2d7' }, "HasViewportChanged: ", ((_h = this.store.state) === null || _h === void 0 ? void 0 : _h.hasViewportChanged) ? 'true' : 'false'), index.h("div", { key: 'fe92910fd861170651688fedbdc2f15829c15a58' }, "IsEnabled: ", ((_j = this.store.state) === null || _j === void 0 ? void 0 : _j.isEnabled) ? 'true' : 'false'), index.h("div", { key: 'cbe7e87d9a3be8acd47dd45f1b69314a8a9c536a' }, "IsScaling: ", ((_k = this.store.state) === null || _k === void 0 ? void 0 : _k.isScaling) ? 'true' : 'false'), index.h("div", { key: '722a58415ae67530dfe611e03a34f30e4c1db64e' }, "IsPanning: ", ((_l = this.store.state) === null || _l === void 0 ? void 0 : _l.isPanning) ? 'true' : 'false'), index.h("div", { key: 'd9686a405ee05480c17358afb865a39bd64a2346' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), index.h("div", { key: '383f8e4a9e98b891507ff95416a20279e4d79431' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), index.h("div", { key: 'fbda2b9f1ba4fe9daefb7f8b36d25d297b47a764' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), index.h("div", { key: 'c1bb88c228cd6bbd2bdb0fe6bb3fd9b47d92bc2e' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), index.h("div", { key: '26c77aadc8cda5f27f746d0c38049d830127c81e' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), index.h("div", { key: '885725248c47714a49769b94ba48a3a0f59a7f97' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), index.h("div", { key: '035d1c72d476ea9f8110145a25084eca59cfbedc' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), index.h("div", { key: 'd6ac0024bec7d64ca327e6a5760e427e88269b8d' }, "CursorX: ", (_m = this.store.state) === null || _m === void 0 ? void 0 :
|
|
5940
|
+
_m.cursorX), index.h("div", { key: 'b3bdd26eb7d5ac0fdfda0f13b7d4cde9f3712954' }, "CursorY: ", (_o = this.store.state) === null || _o === void 0 ? void 0 :
|
|
5941
|
+
_o.cursorY)), index.h("div", { key: '186591f736514dcdb96f22d5ab3d14347a4c51ae', class: "origin", style: {
|
|
5920
5942
|
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})`,
|
|
5921
5943
|
} }, (_t = this.store.objects) === null || _t === void 0 ? void 0 :
|
|
5922
5944
|
_t.map(object => {
|
|
@@ -6014,7 +6036,7 @@ const KritzelEngine = class {
|
|
|
6014
6036
|
fill: 'transparent',
|
|
6015
6037
|
cursor: 'grab',
|
|
6016
6038
|
}, 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))))));
|
|
6017
|
-
}), index.h("svg", { key: '
|
|
6039
|
+
}), index.h("svg", { key: '74658c104e35b85465fdf92396d0c186e281c0d1', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
|
|
6018
6040
|
height: (_u = this.store.state.currentPath) === null || _u === void 0 ? void 0 : _u.height.toString(),
|
|
6019
6041
|
width: (_v = this.store.state.currentPath) === null || _v === void 0 ? void 0 : _v.width.toString(),
|
|
6020
6042
|
left: '0',
|
|
@@ -6023,12 +6045,12 @@ const KritzelEngine = class {
|
|
|
6023
6045
|
position: 'absolute',
|
|
6024
6046
|
transform: (_x = this.store.state.currentPath) === null || _x === void 0 ? void 0 : _x.transformationMatrix,
|
|
6025
6047
|
overflow: 'visible',
|
|
6026
|
-
}, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.h("path", { key: '
|
|
6048
|
+
}, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.h("path", { key: '433d5372a93973ce9cb1c2033d50a14b3d1c2aa8', 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: 'cb8c6876429f82da7feafc500a104a46d5d61a8b', ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, style: {
|
|
6027
6049
|
position: 'fixed',
|
|
6028
6050
|
left: `${this.store.state.contextMenuX}px`,
|
|
6029
6051
|
top: `${this.store.state.contextMenuY}px`,
|
|
6030
6052
|
zIndex: '10000',
|
|
6031
|
-
}, 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: '
|
|
6053
|
+
}, 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: '02c049339dfc34bc6b5a3d31dfa5dc8f20520dcd' })));
|
|
6032
6054
|
}
|
|
6033
6055
|
get host() { return index.getElement(this); }
|
|
6034
6056
|
};
|