kritzel-stencil 0.0.125 → 0.0.127
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/{index-CgSgPOBv.js → index-BacMQbNR.js} +15 -6
- package/dist/cjs/index-BacMQbNR.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kritzel-brush-style_18.cjs.entry.js +49 -49
- 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/objects/base-object.class.js +5 -0
- package/dist/collection/classes/objects/base-object.class.js.map +1 -1
- package/dist/collection/classes/objects/path.class.js +6 -0
- package/dist/collection/classes/objects/path.class.js.map +1 -1
- package/dist/collection/classes/objects/selection-group.class.js +2 -4
- package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
- package/dist/collection/classes/store.class.js +2 -2
- package/dist/collection/classes/store.class.js.map +1 -1
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +4 -4
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js.map +1 -1
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +24 -24
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +1 -1
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +4 -4
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.js +1 -1
- package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.js +2 -2
- package/dist/collection/components/ui/kritzel-control-text-config/kritzel-control-text-config.js +2 -2
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +3 -3
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/interfaces/object.interface.js.map +1 -1
- package/dist/components/index.js +2 -2
- 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-editor.js +18 -18
- 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-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-BY8BWGge.js → p-2gNwfcSP.js} +3 -3
- package/dist/components/{p-BY8BWGge.js.map → p-2gNwfcSP.js.map} +1 -1
- package/dist/components/{p-BOj_wqdw.js → p-BOUCnklW.js} +3 -3
- package/dist/components/{p-BOj_wqdw.js.map → p-BOUCnklW.js.map} +1 -1
- package/dist/components/{p-DMAzUKo6.js → p-BhC-Et5I.js} +9 -9
- package/dist/components/{p-DMAzUKo6.js.map → p-BhC-Et5I.js.map} +1 -1
- package/dist/components/{p-ubNAWsY_.js → p-BkFzf8vg.js} +7 -7
- package/dist/components/{p-ubNAWsY_.js.map → p-BkFzf8vg.js.map} +1 -1
- package/dist/components/{p-CF8ziFc4.js → p-BubFkS0u.js} +3 -3
- package/dist/components/{p-CF8ziFc4.js.map → p-BubFkS0u.js.map} +1 -1
- package/dist/components/{p-DpiklJU9.js → p-CmlcJ8Kw.js} +6 -6
- package/dist/components/{p-DpiklJU9.js.map → p-CmlcJ8Kw.js.map} +1 -1
- package/dist/components/{p-BjG1zRRI.js → p-CudOuOAW.js} +33 -35
- package/dist/components/p-CudOuOAW.js.map +1 -0
- package/dist/components/{p-DSLY0tr5.js → p-D5a8vnRF.js} +4 -4
- package/dist/components/{p-DSLY0tr5.js.map → p-D5a8vnRF.js.map} +1 -1
- package/dist/components/{p-Bn5P7YQn.js → p-DJc6_PyL.js} +4 -4
- package/dist/components/{p-Bn5P7YQn.js.map → p-DJc6_PyL.js.map} +1 -1
- package/dist/components/{p-CBCFr_x3.js → p-DSWoCkxm.js} +16 -16
- package/dist/components/{p-CBCFr_x3.js.map → p-DSWoCkxm.js.map} +1 -1
- package/dist/components/{p-Cn_kantt.js → p-DcvujuV_.js} +4 -4
- package/dist/components/{p-Cn_kantt.js.map → p-DcvujuV_.js.map} +1 -1
- package/dist/components/{p-D0sLslUq.js → p-DfJEh7HZ.js} +4 -4
- package/dist/components/{p-D0sLslUq.js.map → p-DfJEh7HZ.js.map} +1 -1
- package/dist/components/{p-CiT5gBDh.js → p-Dp8hrISj.js} +3 -3
- package/dist/components/{p-CiT5gBDh.js.map → p-Dp8hrISj.js.map} +1 -1
- package/dist/components/{p-Cw2ATHMj.js → p-EQo4-DJT.js} +3 -3
- package/dist/components/{p-Cw2ATHMj.js.map → p-EQo4-DJT.js.map} +1 -1
- package/dist/components/{p-BJOf0PsO.js → p-ljdIU3DL.js} +13 -2
- package/dist/components/p-ljdIU3DL.js.map +1 -0
- package/dist/esm/{index-B_0CRlFw.js → index-D37FADaF.js} +15 -6
- package/dist/esm/index-D37FADaF.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/kritzel-brush-style_18.entry.js +49 -49
- 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/index.esm.js +1 -1
- package/dist/stencil/p-D37FADaF.js +2 -0
- package/dist/stencil/p-D37FADaF.js.map +1 -0
- package/dist/stencil/p-e6ac7fc6.entry.js +2 -0
- package/dist/stencil/p-e6ac7fc6.entry.js.map +1 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/objects/base-object.class.d.ts +1 -0
- package/dist/types/classes/objects/path.class.d.ts +1 -0
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +2 -2
- package/dist/types/components.d.ts +4 -4
- package/dist/types/interfaces/object.interface.d.ts +1 -0
- package/package.json +62 -62
- package/dist/cjs/index-CgSgPOBv.js.map +0 -1
- package/dist/components/p-BJOf0PsO.js.map +0 -1
- package/dist/components/p-BjG1zRRI.js.map +0 -1
- package/dist/esm/index-B_0CRlFw.js.map +0 -1
- package/dist/stencil/p-3a2f1d19.entry.js +0 -2
- package/dist/stencil/p-3a2f1d19.entry.js.map +0 -1
- package/dist/stencil/p-B_0CRlFw.js +0 -2
- package/dist/stencil/p-B_0CRlFw.js.map +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-C05uAr89.js');
|
|
4
|
-
var index$1 = require('./index-
|
|
4
|
+
var index$1 = require('./index-BacMQbNR.js');
|
|
5
5
|
|
|
6
6
|
const kritzelBrushStyleCss = ":host{display:flex;align-items:flex-start;gap:8px;padding:8px;box-sizing:border-box;width:100%}.brush-style-button{display:flex;justify-content:center;align-items:center;width:42px;height:32px;padding:0;border:none;outline:none;background:none;cursor:default;border-radius:0;color:var(--control-text-color);font-weight:bold;-webkit-tap-highlight-color:transparent}.font-style-button:not(:last-child){border-right:1px solid #333333}.font-style-button:hover{background-color:var(--control-hover-bg)}.font-style-button:active{background-color:var(--control-active-bg)}.font-style-button.selected,.font-style-button.selected:hover,.font-style-button.selected:active{background-color:var(--control-selected-bg);color:var(--control-selected-color)}";
|
|
7
7
|
|
|
@@ -61,13 +61,13 @@ const KritzelColor = class {
|
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
63
|
const isColorVeryLight = this.isLightColor(this.value);
|
|
64
|
-
return (index.h(index.Host, { key: '
|
|
64
|
+
return (index.h(index.Host, { key: '8f8bb6c8c710bf6f3731b2be82c0857dd13913f1' }, index.h("div", { key: 'd28526ebcb418130ae8f608ea51c6c8dccffb906', class: "checkerboard-bg", style: {
|
|
65
65
|
width: `${this.size}px`,
|
|
66
66
|
height: `${this.size}px`,
|
|
67
67
|
borderRadius: '50%',
|
|
68
68
|
display: 'inline-block',
|
|
69
69
|
position: 'relative',
|
|
70
|
-
} }, index.h("div", { key: '
|
|
70
|
+
} }, index.h("div", { key: 'ec6a886f152dd4db4d4a3f86991f3b065ece1b45', class: {
|
|
71
71
|
'color-circle': true,
|
|
72
72
|
'white': isColorVeryLight,
|
|
73
73
|
}, style: {
|
|
@@ -109,7 +109,7 @@ const KritzelColorPalette = class {
|
|
|
109
109
|
render() {
|
|
110
110
|
const displayedColors = this.isExpanded ? this.colors : this.colors.slice(0, 6);
|
|
111
111
|
const expandedHeight = this.isExpanded ? this.calculateHeight() : '32px';
|
|
112
|
-
return (index.h(index.Host, { key: '
|
|
112
|
+
return (index.h(index.Host, { key: 'bae0e5b2c6444f4a447dbcb13bfd427b4f25ddb6' }, index.h("div", { key: '3020fe3b1eef1cafb8e1720716219464d11c0594', class: {
|
|
113
113
|
'color-grid': true,
|
|
114
114
|
'expanded': this.isExpanded,
|
|
115
115
|
}, style: {
|
|
@@ -194,7 +194,7 @@ const KritzelContextMenu = class {
|
|
|
194
194
|
this.disabledStates = new Map(newStates);
|
|
195
195
|
}
|
|
196
196
|
render() {
|
|
197
|
-
return (index.h(index.Host, { key: '
|
|
197
|
+
return (index.h(index.Host, { key: 'cc1a338a7bf0d32764c2737f4f32774ccb22370a' }, index.h("div", { key: '4a83b9366332e42b506c3c876c00d77498a2b8b5', class: "menu-container" }, this.visibleItems.map((item, index$1) => {
|
|
198
198
|
var _a;
|
|
199
199
|
const isDisabled = (_a = this.disabledStates.get(index$1)) !== null && _a !== void 0 ? _a : false;
|
|
200
200
|
return (index.h("button", { key: `${item.label}-${index$1}`, class: { 'menu-item': true, 'disabled': isDisabled }, onClick: () => this.handleItemClick(item, index$1), onTouchStart: () => this.handleItemClick(item, index$1), disabled: isDisabled }, item.icon && index.h("kritzel-icon", { name: item.icon, size: 16 }), index.h("span", { class: "label" }, item.label)));
|
|
@@ -240,14 +240,14 @@ const KritzelControlBrushConfig = class {
|
|
|
240
240
|
this.toolChange.emit(this.tool);
|
|
241
241
|
}
|
|
242
242
|
render() {
|
|
243
|
-
return (index.h(index.Host, { key: '
|
|
243
|
+
return (index.h(index.Host, { key: 'c200146a90a3dd72241e098eff555312fd3125a9' }, index.h("div", { key: '886492ec4c5e15954166c4a7569ba832d0e6eff8', style: {
|
|
244
244
|
display: 'flex',
|
|
245
245
|
flexDirection: 'row',
|
|
246
246
|
alignItems: 'center',
|
|
247
247
|
justifyContent: 'flex-start',
|
|
248
248
|
width: '100%',
|
|
249
249
|
gap: '8px',
|
|
250
|
-
} }, index.h("kritzel-brush-style", { key: '
|
|
250
|
+
} }, index.h("kritzel-brush-style", { key: '64e205189fbd740c01d4fd94c5098edae574d69b', type: this.tool.type, onTypeChange: event => this.handleTypeChange(event) }), index.h("button", { key: '4b2d0fbf4d485350223dbc27601e78ab37be8df5', class: "expand-toggle", onClick: () => this.handleToggleExpand(), title: this.isExpanded ? 'Collapse' : 'Expand', style: this.palette.length > 6 ? { visibillity: 'visible' } : { visibility: 'hidden' } }, index.h("kritzel-icon", { key: '35262e8456901d10c84437e578317287282cf690', name: this.isExpanded ? 'chevron-up' : 'chevron-down' }))), index.h("kritzel-color-palette", { key: '4f519179f419a3e3567d2db39d0d8f9f30d5a6a1', colors: this.palette, selectedColor: this.tool.color, isExpanded: this.isExpanded, isOpaque: true, onColorChange: color => this.handleColorChange(color) }), index.h("kritzel-stroke-size", { key: '05f05946c3ebd2707f1c41c236a2efca47cedbec', selectedSize: this.tool.size, onSizeChange: event => this.handleSizeChange(event) })));
|
|
251
251
|
}
|
|
252
252
|
static get watchers() { return {
|
|
253
253
|
"tool": ["handleToolChange"]
|
|
@@ -279,14 +279,14 @@ const KritzelControlTextConfig = class {
|
|
|
279
279
|
this.toolChange.emit(this.tool);
|
|
280
280
|
}
|
|
281
281
|
render() {
|
|
282
|
-
return (index.h(index.Host, { key: '
|
|
282
|
+
return (index.h(index.Host, { key: '1c8463a1f6b7bcf81f3b58fc0064330c50d6ada9' }, index.h("div", { key: '69825e6c9be473dda3597c86d51dffff9a6418fd', style: {
|
|
283
283
|
display: 'flex',
|
|
284
284
|
flexDirection: 'row',
|
|
285
285
|
alignItems: 'center',
|
|
286
286
|
justifyContent: 'flex-start',
|
|
287
287
|
width: '100%',
|
|
288
288
|
gap: '8px',
|
|
289
|
-
} }, index.h("kritzel-font-family", { key: '
|
|
289
|
+
} }, index.h("kritzel-font-family", { key: '56c947950e32989782512a2b00e3be0aaa12d77b', selectedFontFamily: this.tool.fontFamily, onFontFamilyChange: event => this.handleFamilyChange(event) }), index.h("button", { key: '83fdb5908340adc032a7abae9b4b678697e0cff8', class: "expand-toggle", onClick: () => this.handleToggleExpand(), title: this.isExpanded ? 'Collapse' : 'Expand' }, index.h("kritzel-icon", { key: '739c175fbc3c0c5c342f2983d0e47323bc5b56f4', name: this.isExpanded ? 'chevron-up' : 'chevron-down' }))), index.h("kritzel-color-palette", { key: '98251da71574b3487bf6ee46f7e4e95d133e1eea', colors: this.tool.palette, selectedColor: this.tool.fontColor, isExpanded: this.isExpanded, onColorChange: event => this.handleColorChange(event) }), index.h("kritzel-font-size", { key: '95c88611a6631a4db5d200aac57e7eeef2c195b8', selectedSize: this.tool.fontSize, fontFamily: this.tool.fontFamily, onSizeChange: event => this.handleSizeChange(event) })));
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
292
|
KritzelControlTextConfig.style = kritzelControlTextConfigCss;
|
|
@@ -386,13 +386,13 @@ const KritzelControls = class {
|
|
|
386
386
|
render() {
|
|
387
387
|
var _a, _b;
|
|
388
388
|
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;
|
|
389
|
-
return (index.h(index.Host, { key: '
|
|
389
|
+
return (index.h(index.Host, { key: 'dfb17219cf1d27d86148bc918b8303d74244700c', class: {
|
|
390
390
|
mobile: this.isTouchDevice,
|
|
391
|
-
} }, this.isUtilityPanelVisible && (index.h("kritzel-utility-panel", { key: '
|
|
391
|
+
} }, this.isUtilityPanelVisible && (index.h("kritzel-utility-panel", { key: 'a5eb7c6b59a193ba0bdde53812882c355a7658d4', style: {
|
|
392
392
|
position: 'absolute',
|
|
393
393
|
bottom: '56px',
|
|
394
394
|
left: '12px',
|
|
395
|
-
}, 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: '
|
|
395
|
+
}, 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: 'b51e49664bf6330f22fb07ef64116459ec3832b3', class: "kritzel-controls" }, this.controls.map(control => {
|
|
396
396
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
397
397
|
if (control.type === 'tool') {
|
|
398
398
|
return (index.h("button", { class: {
|
|
@@ -485,7 +485,7 @@ const KritzelCursorTrail = class {
|
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
render() {
|
|
488
|
-
return (index.h(index.Host, { key: '
|
|
488
|
+
return (index.h(index.Host, { key: '2bd830d9a7f97a9a7e96a5b6a40535fdaefb904d' }, this.cursorTrailPoints.length > 1 && (index.h("svg", { key: '3da6a2e65030721cbdb04fba78d15776cb8f281c', class: "cursor-trail-svg", xmlns: "http://www.w3.org/2000/svg", style: {
|
|
489
489
|
position: 'absolute',
|
|
490
490
|
left: '0',
|
|
491
491
|
top: '0',
|
|
@@ -726,8 +726,8 @@ const KritzelEditor = class {
|
|
|
726
726
|
action: (menu, _) => this.engineRef.paste(menu.x, menu.y),
|
|
727
727
|
},
|
|
728
728
|
{ label: 'Delete', icon: 'delete', action: () => this.engineRef.delete() },
|
|
729
|
-
{ label: 'Bring to Front', icon: 'bring-to-front', action: () => this.engineRef.
|
|
730
|
-
{ label: 'Send to Back', icon: 'send-to-back', action: () => this.engineRef.
|
|
729
|
+
{ label: 'Bring to Front', icon: 'bring-to-front', action: () => this.engineRef.bringToFront() },
|
|
730
|
+
{ label: 'Send to Back', icon: 'send-to-back', action: () => this.engineRef.sendToBack() },
|
|
731
731
|
];
|
|
732
732
|
this.customSvgIcons = {};
|
|
733
733
|
this.isControlsVisible = true;
|
|
@@ -802,7 +802,7 @@ const KritzelEditor = class {
|
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
804
|
render() {
|
|
805
|
-
return (index.h(index.Host, { key: '
|
|
805
|
+
return (index.h(index.Host, { key: 'ddfb1861cc7fe2acda822b9389c3a049fe626deb' }, index.h("kritzel-engine", { key: 'ccbf2c636bdf63630ac06e1e8d3239c79bb7e774', ref: el => (this.engineRef = el), onIsEngineReady: () => (this.isEngineReady = true), scaleMax: this.scaleMax, scaleMin: this.scaleMin, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems }), index.h("kritzel-controls", { key: 'a0111b00ecbcb18c615c7f12f005f0edfe363af8', ref: el => (this.controlsRef = el), controls: this.controls, isUtilityPanelVisible: this.isUtilityPanelVisible, style: this.isControlsVisible ? { display: 'flex' } : { display: 'none' }, onIsControlsReady: () => (this.isControlsReady = true) })));
|
|
806
806
|
}
|
|
807
807
|
get host() { return index.getElement(this); }
|
|
808
808
|
static get watchers() { return {
|
|
@@ -1436,7 +1436,7 @@ class KritzelStore {
|
|
|
1436
1436
|
this.history.executeCommand(new index$1.BatchCommand(this, this, decreaseZIndexCommands));
|
|
1437
1437
|
}
|
|
1438
1438
|
bringToFront(object) {
|
|
1439
|
-
const max = this.allObjects.
|
|
1439
|
+
const max = Math.max(...this.allObjects.map(obj => obj.zIndex)) + 1;
|
|
1440
1440
|
const objects = object ? [object] : this.state.selectionGroup.objects;
|
|
1441
1441
|
const increaseZIndexCommands = objects.map(obj => {
|
|
1442
1442
|
return new UpdateObjectCommand(this, this, obj, { zIndex: max });
|
|
@@ -1444,7 +1444,7 @@ class KritzelStore {
|
|
|
1444
1444
|
this.history.executeCommand(new index$1.BatchCommand(this, this, increaseZIndexCommands));
|
|
1445
1445
|
}
|
|
1446
1446
|
sendToBack(object) {
|
|
1447
|
-
const min = -1;
|
|
1447
|
+
const min = Math.min(...this.allObjects.map(obj => obj.zIndex)) - 1;
|
|
1448
1448
|
const objects = object ? [object] : this.state.selectionGroup.objects;
|
|
1449
1449
|
const decreaseZIndexCommands = objects.map(obj => {
|
|
1450
1450
|
return new UpdateObjectCommand(this, this, obj, { zIndex: min });
|
|
@@ -1879,10 +1879,10 @@ const KritzelEngine = class {
|
|
|
1879
1879
|
async sendBackward(object) {
|
|
1880
1880
|
this.store.sendBackward(object);
|
|
1881
1881
|
}
|
|
1882
|
-
async
|
|
1882
|
+
async bringToFront(object) {
|
|
1883
1883
|
this.store.bringToFront(object);
|
|
1884
1884
|
}
|
|
1885
|
-
async
|
|
1885
|
+
async sendToBack(object) {
|
|
1886
1886
|
this.store.sendToBack(object);
|
|
1887
1887
|
}
|
|
1888
1888
|
async undo() {
|
|
@@ -1971,23 +1971,23 @@ const KritzelEngine = class {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
1973
|
render() {
|
|
1974
|
-
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, _3;
|
|
1974
|
+
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, _3, _4;
|
|
1975
1975
|
const computedStyle = window.getComputedStyle(this.host);
|
|
1976
1976
|
const baseHandleSizePx = computedStyle.getPropertyValue('--kritzel-selection-handle-size').trim() || '6px';
|
|
1977
1977
|
const baseHandleSize = parseFloat(baseHandleSizePx);
|
|
1978
1978
|
const baseHandleTouchSize = baseHandleSize * 2 < 14 ? 14 : baseHandleSize;
|
|
1979
|
-
return (index.h(index.Host, { key: '
|
|
1980
|
-
_a.translateX), index.h("div", { key: '
|
|
1981
|
-
_b.translateY), index.h("div", { key: '
|
|
1982
|
-
_c.viewportWidth), index.h("div", { key: '
|
|
1983
|
-
_d.viewportHeight), index.h("div", { key: '
|
|
1984
|
-
_e.scale), index.h("div", { key: '
|
|
1985
|
-
_g.name), index.h("div", { key: '
|
|
1986
|
-
_m.pointerX), index.h("div", { key: '
|
|
1987
|
-
_o.pointerY)), index.h("div", { key: '
|
|
1988
|
-
transform: `matrix(${(
|
|
1989
|
-
} }, (
|
|
1990
|
-
|
|
1979
|
+
return (index.h(index.Host, { key: '9662d9be6c5537340fe8416a5f74f3dec995fc91' }, index.h("div", { key: '4f42e6cf0ee0b77c672e7485a53ffed7a75961fa', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, index.h("div", { key: '75bb2ea8e945c4d65d86a90f4f6da95ccd4425d1' }, "TranslateX: ", (_a = this.store.state) === null || _a === void 0 ? void 0 :
|
|
1980
|
+
_a.translateX), index.h("div", { key: '69558794d6b88fece7c8af2be3cf5930174b8fd6' }, "TranslateY: ", (_b = this.store.state) === null || _b === void 0 ? void 0 :
|
|
1981
|
+
_b.translateY), index.h("div", { key: 'd2e933f23eef9ee56137906f56c5cbadbaadaf23' }, "ViewportWidth: ", (_c = this.store.state) === null || _c === void 0 ? void 0 :
|
|
1982
|
+
_c.viewportWidth), index.h("div", { key: 'c085fee84706c0be930d1e659dedb8a2728130dd' }, "ViewportHeight: ", (_d = this.store.state) === null || _d === void 0 ? void 0 :
|
|
1983
|
+
_d.viewportHeight), index.h("div", { key: 'eeef8323ae0bc5047f038f4794aee4ed718d1183' }, "ObjectsInViewport. ", this.store.objects.length), index.h("div", { key: '20172772854ab20ee9dd9b4bf9b969627c649e61' }, "Scale: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
|
|
1984
|
+
_e.scale), index.h("div", { key: '256646b05f63bc6949578acb1739f57a581c86e4' }, "ActiveTool: ", (_g = (_f = this.store.state) === null || _f === void 0 ? void 0 : _f.activeTool) === null || _g === void 0 ? void 0 :
|
|
1985
|
+
_g.name), index.h("div", { key: 'd9e17c3c89a135fcbaf1cdfaa8f8123186c74626' }, "HasViewportChanged: ", ((_h = this.store.state) === null || _h === void 0 ? void 0 : _h.hasViewportChanged) ? 'true' : 'false'), index.h("div", { key: '7750bc5b2763e6351eb37f51b54bca965f7e0823' }, "IsEnabled: ", ((_j = this.store.state) === null || _j === void 0 ? void 0 : _j.isEnabled) ? 'true' : 'false'), index.h("div", { key: '59ca295c0ab33fe6d82ccd1072fe64672c9f21b7' }, "IsScaling: ", ((_k = this.store.state) === null || _k === void 0 ? void 0 : _k.isScaling) ? 'true' : 'false'), index.h("div", { key: 'b413ddf6bbc8e7e758abd811f3e66a71a4961a04' }, "IsPanning: ", ((_l = this.store.state) === null || _l === void 0 ? void 0 : _l.isPanning) ? 'true' : 'false'), index.h("div", { key: 'c941fe71c6d3a124bcb02ff6d1efa33d943646aa' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), index.h("div", { key: 'f060e324991d0885770cfbedf8332047a3ede890' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), index.h("div", { key: 'ec3f85f2cc61bb55210cfa952ce8b1af66c4caf4' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), index.h("div", { key: '0376abe30d6456038a98383a82eff2ec955fd69a' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), index.h("div", { key: '546d868377d654400e9013f8df54389e08a2c02d' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), index.h("div", { key: 'b233911cad585a5318dd0a83258d477dd3e286f7' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), index.h("div", { key: '4fd9f89a72c49bb681695030245d4622ffe281b5' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), index.h("div", { key: 'e7c3b3485b945fff20dd0c6601727b52478a283b' }, "PointerX: ", (_m = this.store.state) === null || _m === void 0 ? void 0 :
|
|
1986
|
+
_m.pointerX), index.h("div", { key: '0e940ac9609f23f1e4855206dda52c52eec14fe5' }, "PointerY: ", (_o = this.store.state) === null || _o === void 0 ? void 0 :
|
|
1987
|
+
_o.pointerY), index.h("div", { key: '60475be8341d3a8e28416d91a38d188bce30d15b' }, "SelectedObjects: ", ((_p = this.store.state.selectionGroup) === null || _p === void 0 ? void 0 : _p.objects.length) || 0)), index.h("div", { key: '16608718942fd141d17a5d398045e178fa37eacf', id: "origin", class: "origin", style: {
|
|
1988
|
+
transform: `matrix(${(_q = this.store.state) === null || _q === void 0 ? void 0 : _q.scale}, 0, 0, ${(_r = this.store.state) === null || _r === void 0 ? void 0 : _r.scale}, ${(_s = this.store.state) === null || _s === void 0 ? void 0 : _s.translateX}, ${(_t = this.store.state) === null || _t === void 0 ? void 0 : _t.translateY})`,
|
|
1989
|
+
} }, (_u = this.store.objects) === null || _u === void 0 ? void 0 :
|
|
1990
|
+
_u.map(object => {
|
|
1991
1991
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1992
1992
|
return (index.h("div", { style: { transform: object === null || object === void 0 ? void 0 : object.transformationMatrix, transformOrigin: 'top left', zIndex: object.zIndex.toString(), position: 'absolute' } }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", key: object.id, id: object.id, class: "object", style: {
|
|
1993
1993
|
height: object === null || object === void 0 ? void 0 : object.totalHeight.toString(),
|
|
@@ -2087,17 +2087,17 @@ const KritzelEngine = class {
|
|
|
2087
2087
|
fill: 'transparent',
|
|
2088
2088
|
cursor: 'grab',
|
|
2089
2089
|
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), index.h("g", { style: { display: this.store.state.debugInfo.showObjectInfo ? 'block' : 'none', pointerEvents: 'none' } }, index.h("foreignObject", { x: object.totalWidth.toString(), y: "0", width: "400px", height: "160px", style: { minHeight: '0', minWidth: '0', display: object.isDebugInfoVisible ? '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), index.h("div", { style: { whiteSpace: 'nowrap' } }, "x: ", object.x), index.h("div", { style: { whiteSpace: 'nowrap' } }, "y: ", object.y)))))));
|
|
2090
|
-
}), index.h("svg", { key: '
|
|
2091
|
-
height: (
|
|
2092
|
-
width: (
|
|
2090
|
+
}), index.h("svg", { key: 'd945e3fae758a66d8d17875203561602446acf9a', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
|
|
2091
|
+
height: (_v = this.store.state.currentPath) === null || _v === void 0 ? void 0 : _v.height.toString(),
|
|
2092
|
+
width: (_w = this.store.state.currentPath) === null || _w === void 0 ? void 0 : _w.width.toString(),
|
|
2093
2093
|
left: '0',
|
|
2094
2094
|
top: '0',
|
|
2095
|
-
zIndex: (
|
|
2095
|
+
zIndex: (_x = this.store.state.currentPath) === null || _x === void 0 ? void 0 : _x.zIndex.toString(),
|
|
2096
2096
|
position: 'absolute',
|
|
2097
|
-
transform: (
|
|
2097
|
+
transform: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.transformationMatrix,
|
|
2098
2098
|
transformOrigin: 'top left',
|
|
2099
2099
|
overflow: 'visible',
|
|
2100
|
-
}, viewBox: (
|
|
2100
|
+
}, viewBox: (_z = this.store.state.currentPath) === null || _z === void 0 ? void 0 : _z.viewBox }, index.h("path", { key: '111070848aa210dabf4150a9e69326c7a32a2bb7', d: (_0 = this.store.state.currentPath) === null || _0 === void 0 ? void 0 : _0.d, fill: (_1 = this.store.state.currentPath) === null || _1 === void 0 ? void 0 : _1.fill, stroke: (_2 = this.store.state.currentPath) === null || _2 === void 0 ? void 0 : _2.stroke }))), this.store.state.isContextMenuVisible && (index.h("kritzel-context-menu", { key: '13f61253ab96655d6816bfba60b7c1c8e0697533', class: "context-menu", ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, objects: ((_3 = this.store.state.selectionGroup) === null || _3 === void 0 ? void 0 : _3.objects) || [], style: {
|
|
2101
2101
|
position: 'fixed',
|
|
2102
2102
|
left: `${this.store.state.contextMenuX}px`,
|
|
2103
2103
|
top: `${this.store.state.contextMenuY}px`,
|
|
@@ -2109,7 +2109,7 @@ const KritzelEngine = class {
|
|
|
2109
2109
|
y: (-this.store.state.translateY + this.store.state.contextMenuY) / this.store.state.scale,
|
|
2110
2110
|
}, (_a = this.store.state.selectionGroup) === null || _a === void 0 ? void 0 : _a.objects);
|
|
2111
2111
|
this.hideContextMenu();
|
|
2112
|
-
} })), ((
|
|
2112
|
+
} })), ((_4 = this.store.state) === null || _4 === void 0 ? void 0 : _4.activeTool) instanceof index$1.KritzelEraserTool && !this.store.state.isScaling && index.h("kritzel-cursor-trail", { key: 'bcbedb0fd45a7b87e82e78326bfdc0d1a872c1aa', store: this.store })));
|
|
2113
2113
|
}
|
|
2114
2114
|
get host() { return index.getElement(this); }
|
|
2115
2115
|
static get watchers() { return {
|
|
@@ -2129,7 +2129,7 @@ const KritzelFont = class {
|
|
|
2129
2129
|
this.color = '#000000';
|
|
2130
2130
|
}
|
|
2131
2131
|
render() {
|
|
2132
|
-
return (index.h(index.Host, { key: '
|
|
2132
|
+
return (index.h(index.Host, { key: 'e4123d3701933d5de1d5c063f69f6823db849baf' }, index.h("div", { key: '81dde2ff263a8bf110b9c0f0be4a5adc5852fa2f', class: "font-preview", style: {
|
|
2133
2133
|
fontFamily: this.fontFamily,
|
|
2134
2134
|
fontSize: `${this.size}px`,
|
|
2135
2135
|
color: this.color
|
|
@@ -2174,7 +2174,7 @@ const KritzelFontFamily = class {
|
|
|
2174
2174
|
label: option.label,
|
|
2175
2175
|
style: { fontFamily: option.value },
|
|
2176
2176
|
}));
|
|
2177
|
-
return (index.h(index.Host, { key: '
|
|
2177
|
+
return (index.h(index.Host, { key: 'b56a2dcc19e11c8cf84449d94f43fd93a882ac4e' }, index.h("kritzel-dropdown", { key: '999c75650ce8d83c5b52eda5c96ce0b040e67475', options: dropdownOptions, value: this.selectedFontFamily, onValueChanged: this.handleDropdownValueChange, selectStyles: { fontFamily: this.selectedFontFamily } }, index.h("button", { key: 'defbe8238c3037a5128f59f33a51f6ec9fd08dc3', class: "font-style-button", slot: "suffix" }, "B"), index.h("button", { key: '7dd5a7256dde1d38b495f67bdec2d605fde0a1ec', class: "font-style-button italic-text", slot: "suffix" }, "I"))));
|
|
2178
2178
|
}
|
|
2179
2179
|
};
|
|
2180
2180
|
KritzelFontFamily.style = kritzelFontFamilyCss;
|
|
@@ -2194,7 +2194,7 @@ const KritzelFontSize = class {
|
|
|
2194
2194
|
this.sizeChange.emit(size);
|
|
2195
2195
|
}
|
|
2196
2196
|
render() {
|
|
2197
|
-
return (index.h(index.Host, { key: '
|
|
2197
|
+
return (index.h(index.Host, { key: 'b741185f77e6e6f9fa7a5023d90936d1ebb48d30' }, this.sizes.map(size => (index.h("div", { class: {
|
|
2198
2198
|
'size-container': true,
|
|
2199
2199
|
'selected': this.selectedSize === size,
|
|
2200
2200
|
}, onClick: () => this.handleSizeClick(size) }, index.h("kritzel-font", { fontFamily: this.fontFamily, size: size }))))));
|
|
@@ -2238,7 +2238,7 @@ const KritzelStrokeSize = class {
|
|
|
2238
2238
|
this.sizeChange.emit(size);
|
|
2239
2239
|
}
|
|
2240
2240
|
render() {
|
|
2241
|
-
return (index.h(index.Host, { key: '
|
|
2241
|
+
return (index.h(index.Host, { key: 'b481b62184551bc776042f58d2f27beba837f61d' }, this.sizes.map(size => (index.h("div", { class: {
|
|
2242
2242
|
'size-container': true,
|
|
2243
2243
|
'selected': this.selectedSize === size,
|
|
2244
2244
|
}, onClick: () => this.handleSizeClick(size) }, index.h("kritzel-color", { value: '#000000', size: size }))))));
|
|
@@ -2287,23 +2287,23 @@ const KritzelTooltip = class {
|
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
2289
|
render() {
|
|
2290
|
-
return (index.h(index.Host, { key: '
|
|
2290
|
+
return (index.h(index.Host, { key: 'aed123eda0750df66229f0dd40eeafea39360901', style: {
|
|
2291
2291
|
position: 'fixed',
|
|
2292
2292
|
zIndex: '9999',
|
|
2293
2293
|
transition: 'opacity 0.3s ease-in-out, transform 0.3s ease-in-out',
|
|
2294
2294
|
visibility: this.isVisible ? 'visible' : 'hidden',
|
|
2295
2295
|
left: !this.isMobileView ? `${this.positionX}px` : '50%',
|
|
2296
2296
|
marginBottom: `${this.offsetY + this.arrowSize}px`,
|
|
2297
|
-
} }, index.h("div", { key: '
|
|
2297
|
+
} }, index.h("div", { key: 'ebd77cc44aea3a3ff193717f2dae7eedb55023fd', class: "tooltip-content", onClick: event => event.stopPropagation() }, index.h("slot", { key: '70966228bbe59b894eb472704f08b340c32bbad9' }), index.h("div", { key: '0d82c0f5b1531b39e48b9e80045771e3dda53964', class: "tooltip-arrow-wrapper", style: {
|
|
2298
2298
|
position: 'fixed',
|
|
2299
2299
|
left: this.arrowOffset,
|
|
2300
2300
|
bottom: `-${this.arrowSize * 2}px`,
|
|
2301
|
-
} }, index.h("div", { key: '
|
|
2301
|
+
} }, index.h("div", { key: '24b911e6fe5b5b9a1009d28c797c4c3d00f6f7c7', class: "tooltip-arrow", style: {
|
|
2302
2302
|
borderLeft: `${this.arrowSize}px solid transparent`,
|
|
2303
2303
|
borderRight: `${this.arrowSize}px solid transparent`,
|
|
2304
2304
|
borderTop: `${this.arrowSize}px solid var(--kritzel-controls-tooltip-background-color, #ffffff)`,
|
|
2305
2305
|
filter: 'drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2))',
|
|
2306
|
-
} }), index.h("div", { key: '
|
|
2306
|
+
} }), index.h("div", { key: '2a15c5e8614e57a763aa3d8d4f8d4138146ac0a7', class: "tooltip-arrow-rect", style: {
|
|
2307
2307
|
position: 'relative',
|
|
2308
2308
|
width: `${this.arrowSize * 2}px`,
|
|
2309
2309
|
height: `${this.arrowSize}px`,
|
|
@@ -2337,7 +2337,7 @@ const KritzelUtilityPanel = class {
|
|
|
2337
2337
|
this.redo.emit();
|
|
2338
2338
|
}
|
|
2339
2339
|
render() {
|
|
2340
|
-
return (index.h(index.Host, { key: '
|
|
2340
|
+
return (index.h(index.Host, { key: 'f381fac2cb032ca19c6945ef4f39673ea0bd0cc5' }, index.h("button", { key: '1f7200672970baf1d0cfcaa116fa3f8f9a39832a', class: "utility-button", onClick: event => this.handleUndo(event) }, index.h("kritzel-icon", { key: '755d9201d80d8db086f07b38e90a01a06e980b50', name: "undo" })), index.h("button", { key: '06e4d5c2956f23245c3d48f21c15d54e8bef8119', class: "utility-button", onClick: event => this.handleRedo(event) }, index.h("kritzel-icon", { key: '13eb6b31c45b67ac399fc7c84b941ddce04c5c86', name: "redo" })), index.h("div", { key: '7f03a576a37649db679b93604c2654d29cc81da4', class: "utility-separator" }), index.h("button", { key: '0c40613e9f6a049cec872d71e9f948d685ec1dbe', class: "utility-button" }, index.h("kritzel-icon", { key: '8cba73bcb02ef8b7c182ba2fd16d98d6855f1c1b', name: "delete", onClick: () => this.delete.emit() }))));
|
|
2341
2341
|
}
|
|
2342
2342
|
};
|
|
2343
2343
|
KritzelUtilityPanel.style = kritzelUtilityPanelCss;
|