kritzel-stencil 0.0.123 → 0.0.125

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.
Files changed (44) hide show
  1. package/dist/cjs/{index-UcX3pzju.js → index-CgSgPOBv.js} +8 -11
  2. package/dist/cjs/index-CgSgPOBv.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/kritzel-brush-style_18.cjs.entry.js +13 -14
  5. package/dist/cjs/kritzel-brush-style_18.cjs.entry.js.map +1 -1
  6. package/dist/collection/classes/handlers/hover.handler.js +0 -3
  7. package/dist/collection/classes/handlers/hover.handler.js.map +1 -1
  8. package/dist/collection/classes/objects/base-object.class.js.map +1 -1
  9. package/dist/collection/classes/objects/path.class.js +6 -4
  10. package/dist/collection/classes/objects/path.class.js.map +1 -1
  11. package/dist/collection/classes/objects/selection-group.class.js +0 -2
  12. package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
  13. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +12 -13
  14. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
  15. package/dist/components/index.js +2 -2
  16. package/dist/components/kritzel-controls.js +1 -1
  17. package/dist/components/kritzel-editor.js +3 -3
  18. package/dist/components/kritzel-engine.js +1 -1
  19. package/dist/components/{p-Cnc43o9b.js → p-BJOf0PsO.js} +8 -6
  20. package/dist/components/p-BJOf0PsO.js.map +1 -0
  21. package/dist/components/{p-DJaVT2yR.js → p-BjG1zRRI.js} +15 -21
  22. package/dist/components/p-BjG1zRRI.js.map +1 -0
  23. package/dist/components/{p-CneTqrgt.js → p-CBCFr_x3.js} +3 -3
  24. package/dist/components/{p-CneTqrgt.js.map → p-CBCFr_x3.js.map} +1 -1
  25. package/dist/esm/{index-DO2IiM_o.js → index-B_0CRlFw.js} +8 -11
  26. package/dist/esm/index-B_0CRlFw.js.map +1 -0
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/kritzel-brush-style_18.entry.js +13 -14
  29. package/dist/esm/kritzel-brush-style_18.entry.js.map +1 -1
  30. package/dist/stencil/index.esm.js +1 -1
  31. package/dist/stencil/{p-c64f6589.entry.js → p-3a2f1d19.entry.js} +2 -2
  32. package/dist/stencil/p-3a2f1d19.entry.js.map +1 -0
  33. package/dist/stencil/p-B_0CRlFw.js +2 -0
  34. package/dist/stencil/p-B_0CRlFw.js.map +1 -0
  35. package/dist/stencil/stencil.esm.js +1 -1
  36. package/dist/types/classes/objects/path.class.d.ts +1 -1
  37. package/package.json +62 -57
  38. package/dist/cjs/index-UcX3pzju.js.map +0 -1
  39. package/dist/components/p-Cnc43o9b.js.map +0 -1
  40. package/dist/components/p-DJaVT2yR.js.map +0 -1
  41. package/dist/esm/index-DO2IiM_o.js.map +0 -1
  42. package/dist/stencil/p-DO2IiM_o.js +0 -2
  43. package/dist/stencil/p-DO2IiM_o.js.map +0 -1
  44. package/dist/stencil/p-c64f6589.entry.js.map +0 -1
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { D as DEFAULT_BRUSH_CONFIG, e as DEFAULT_TEXT_CONFIG, K as KritzelBrushTool, d as KritzelEraserTool, s as KritzelImage, f as KritzelImageTool, r as KritzelPath, c as KritzelSelectionTool, q as KritzelText, a as KritzelTextTool } from './index-DO2IiM_o.js';
1
+ export { D as DEFAULT_BRUSH_CONFIG, e as DEFAULT_TEXT_CONFIG, K as KritzelBrushTool, d as KritzelEraserTool, s as KritzelImage, f as KritzelImageTool, r as KritzelPath, c as KritzelSelectionTool, q as KritzelText, a as KritzelTextTool } from './index-B_0CRlFw.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
 
4
4
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-BGl8znzE.js';
2
- import { K as KritzelBrushTool, a as KritzelTextTool, b as KritzelMouseButton, c as KritzelSelectionTool, D as DEFAULT_BRUSH_CONFIG, d as KritzelEraserTool, e as DEFAULT_TEXT_CONFIG, f as KritzelImageTool, g as KritzelEventHelper, h as KritzelBaseCommand, i as KritzelSelectionGroup, j as KrtizelSelectionBox, R as RemoveSelectionGroupCommand, k as RemoveObjectCommand, B as BatchCommand, A as AddObjectCommand, l as AddSelectionGroupCommand, m as KritzelToolRegistry, n as KritzelBaseHandler, o as KritzelBaseTool, p as KritzelKeyboardHelper } from './index-DO2IiM_o.js';
2
+ import { K as KritzelBrushTool, a as KritzelTextTool, b as KritzelMouseButton, c as KritzelSelectionTool, D as DEFAULT_BRUSH_CONFIG, d as KritzelEraserTool, e as DEFAULT_TEXT_CONFIG, f as KritzelImageTool, g as KritzelEventHelper, h as KritzelBaseCommand, i as KritzelSelectionGroup, j as KrtizelSelectionBox, R as RemoveSelectionGroupCommand, k as RemoveObjectCommand, B as BatchCommand, A as AddObjectCommand, l as AddSelectionGroupCommand, m as KritzelToolRegistry, n as KritzelBaseHandler, o as KritzelBaseTool, p as KritzelKeyboardHelper } from './index-B_0CRlFw.js';
3
3
 
4
4
  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)}";
5
5
 
@@ -1930,7 +1930,6 @@ const KritzelEngine = class {
1930
1930
  this.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
1931
1931
  this.store.deselectAllObjects();
1932
1932
  this.store.selectObjects(objects);
1933
- console.log('Selected objects:', objects);
1934
1933
  }
1935
1934
  async selectAllObjectsInViewport() {
1936
1935
  var _a;
@@ -1975,15 +1974,15 @@ const KritzelEngine = class {
1975
1974
  const baseHandleSizePx = computedStyle.getPropertyValue('--kritzel-selection-handle-size').trim() || '6px';
1976
1975
  const baseHandleSize = parseFloat(baseHandleSizePx);
1977
1976
  const baseHandleTouchSize = baseHandleSize * 2 < 14 ? 14 : baseHandleSize;
1978
- return (h(Host, { key: 'a8e6c284c98509ddd158686887d656d3907d40a2' }, h("div", { key: '3935b658e8859f746a5faef0bb91a527b68fcd3e', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, h("div", { key: '12c190c7ea99ac69310b27e719e7df8392b2b46e' }, "TranslateX: ", (_a = this.store.state) === null || _a === void 0 ? void 0 :
1979
- _a.translateX), h("div", { key: '4c98deccc2a029dab06ed76e5af426f4a05c7b66' }, "TranslateY: ", (_b = this.store.state) === null || _b === void 0 ? void 0 :
1980
- _b.translateY), h("div", { key: '1330191a39c7795f17a6adcc4fbd05e2d6a24d43' }, "ViewportWidth: ", (_c = this.store.state) === null || _c === void 0 ? void 0 :
1981
- _c.viewportWidth), h("div", { key: '1ee59427037357ee6bf746a094285426eb0e6a58' }, "ViewportHeight: ", (_d = this.store.state) === null || _d === void 0 ? void 0 :
1982
- _d.viewportHeight), h("div", { key: '1e68312e8516f25dcff34e9f9f70b90f426b8711' }, "ObjectsInViewport. ", this.store.objects.length), h("div", { key: '1d7cea9e21d9b744d8eaac29286528829143b4fa' }, "Scale: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
1983
- _e.scale), h("div", { key: '0b60168fbd55aefa3714067bace80f167b8bcac0' }, "ActiveTool: ", (_g = (_f = this.store.state) === null || _f === void 0 ? void 0 : _f.activeTool) === null || _g === void 0 ? void 0 :
1984
- _g.name), h("div", { key: '109752df6a77633d89929f325d296f96d27d7aa9' }, "HasViewportChanged: ", ((_h = this.store.state) === null || _h === void 0 ? void 0 : _h.hasViewportChanged) ? 'true' : 'false'), h("div", { key: 'b35466caf465b490c5d448d694353186ff902f09' }, "IsEnabled: ", ((_j = this.store.state) === null || _j === void 0 ? void 0 : _j.isEnabled) ? 'true' : 'false'), h("div", { key: '5df20e47f3bf234f04eea001b0a0abaf57946498' }, "IsScaling: ", ((_k = this.store.state) === null || _k === void 0 ? void 0 : _k.isScaling) ? 'true' : 'false'), h("div", { key: '9d1ec8b8268488821a968e109fa279393977fdf8' }, "IsPanning: ", ((_l = this.store.state) === null || _l === void 0 ? void 0 : _l.isPanning) ? 'true' : 'false'), h("div", { key: '92fa98b7fa3bf877c4fffaca70683d2d908f5177' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), h("div", { key: '708d02459c1e3907dd88a2f2fd8916c1ee684cf1' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), h("div", { key: '27f45c1b6ee0b6bd0b3301a9c09b9198de722ac4' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), h("div", { key: '50d4476aecfc00d12bae7d8a3880ccb8de82fe68' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), h("div", { key: '0c582e97ee1535b4a14b75b7ef15373c43f21c4b' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), h("div", { key: '7a8378ac991d17d0eaaba5fbd519875197903a39' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), h("div", { key: '00b56f11ffd16f7b9049d2857f5f7effceba1294' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), h("div", { key: '3b7773194bd6bc8b8b2d024afc768f4e9fbb54c6' }, "PointerX: ", (_m = this.store.state) === null || _m === void 0 ? void 0 :
1985
- _m.pointerX), h("div", { key: 'a2b2c96f6180591082a5aee20cc3e82236dac520' }, "PointerY: ", (_o = this.store.state) === null || _o === void 0 ? void 0 :
1986
- _o.pointerY)), h("div", { key: '309eb61fff5182b5076cb3886bbd79006efc30b1', id: "origin", class: "origin", style: {
1977
+ return (h(Host, { key: '61bfbd2fbd2a0fa54671b55372c0c78479bcbd42' }, h("div", { key: '51741a7ffe2143fd78ef0d47961c98007c9cb996', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, h("div", { key: 'aa580caa079e7ccb619369136a05860d21e7cc53' }, "TranslateX: ", (_a = this.store.state) === null || _a === void 0 ? void 0 :
1978
+ _a.translateX), h("div", { key: '0a3ff31676954408050097cc1bbb34e71c10e157' }, "TranslateY: ", (_b = this.store.state) === null || _b === void 0 ? void 0 :
1979
+ _b.translateY), h("div", { key: '86a4db3532f05ea238b4fa8f84e0cf1d1cfce05e' }, "ViewportWidth: ", (_c = this.store.state) === null || _c === void 0 ? void 0 :
1980
+ _c.viewportWidth), h("div", { key: '775ef8217d65947e86e19b4b0d3f14b6ca0c0cc4' }, "ViewportHeight: ", (_d = this.store.state) === null || _d === void 0 ? void 0 :
1981
+ _d.viewportHeight), h("div", { key: '47bb465ff9bf4179dd0d0d3973af534663f72a79' }, "ObjectsInViewport. ", this.store.objects.length), h("div", { key: '4bc3129aa10b9d63ff5ff2eebafb5b98bc4349a5' }, "Scale: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
1982
+ _e.scale), h("div", { key: '2bda37d1f92525c73230cc5247b4ce8d4918b341' }, "ActiveTool: ", (_g = (_f = this.store.state) === null || _f === void 0 ? void 0 : _f.activeTool) === null || _g === void 0 ? void 0 :
1983
+ _g.name), h("div", { key: 'b94f3078b060223150dd26b2194ab0debd2b531b' }, "HasViewportChanged: ", ((_h = this.store.state) === null || _h === void 0 ? void 0 : _h.hasViewportChanged) ? 'true' : 'false'), h("div", { key: '2d17379ea2ab8c8494d5c51b51a5f1a5f253e5c3' }, "IsEnabled: ", ((_j = this.store.state) === null || _j === void 0 ? void 0 : _j.isEnabled) ? 'true' : 'false'), h("div", { key: '2dc852b4a8935da997c0ff46d34bebf0bddc33d8' }, "IsScaling: ", ((_k = this.store.state) === null || _k === void 0 ? void 0 : _k.isScaling) ? 'true' : 'false'), h("div", { key: '2af7e9330c379c9a9d962d91b07749e2442df0cf' }, "IsPanning: ", ((_l = this.store.state) === null || _l === void 0 ? void 0 : _l.isPanning) ? 'true' : 'false'), h("div", { key: '99466f5d289fdc00b9c0b8c21f0a74a491495c96' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), h("div", { key: '98d95674cdc72f5b375b50d4ee8ac458d4af052d' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), h("div", { key: '9aa3cea7f3abd42fb627191678f733f7ae3be52d' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), h("div", { key: 'ce0f5842e763e68cb9a7912622dedef14c403867' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), h("div", { key: '459ec8743e55a68dd933d1e005c742fb108b6c94' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), h("div", { key: 'd12267e3924fbd066fa3ea851c3a88317bd5e78e' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), h("div", { key: '9f6a79f1c5feb36fe636ea5db8f76405efcff620' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), h("div", { key: '95a2c0ca71db420aedc87914dd1407a7d51e4ad9' }, "PointerX: ", (_m = this.store.state) === null || _m === void 0 ? void 0 :
1984
+ _m.pointerX), h("div", { key: '97eeaaa4152979c94086ccb4819622f08c126ba3' }, "PointerY: ", (_o = this.store.state) === null || _o === void 0 ? void 0 :
1985
+ _o.pointerY)), h("div", { key: '9c5ac0629d021a44a66fc6d42dec39ea0b8814a8', id: "origin", class: "origin", style: {
1987
1986
  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})`,
1988
1987
  } }, (_t = this.store.objects) === null || _t === void 0 ? void 0 :
1989
1988
  _t.map(object => {
@@ -2086,7 +2085,7 @@ const KritzelEngine = class {
2086
2085
  fill: 'transparent',
2087
2086
  cursor: 'grab',
2088
2087
  }, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("g", { style: { display: this.store.state.debugInfo.showObjectInfo ? 'block' : 'none', pointerEvents: 'none' } }, h("foreignObject", { x: object.totalWidth.toString(), y: "0", width: "400px", height: "160px", style: { minHeight: '0', minWidth: '0', display: object.isDebugInfoVisible ? 'block' : 'none' } }, h("div", { style: { width: '100%', height: '100%' } }, h("div", { style: { whiteSpace: 'nowrap' } }, "zIndex: ", object.zIndex), h("div", { style: { whiteSpace: 'nowrap' } }, "translateX: ", object.translateX), h("div", { style: { whiteSpace: 'nowrap' } }, "translateY: ", object.translateY), h("div", { style: { whiteSpace: 'nowrap' } }, "width: ", object.width), h("div", { style: { whiteSpace: 'nowrap' } }, "height: ", object.height), h("div", { style: { whiteSpace: 'nowrap' } }, "scale: ", object.scale), h("div", { style: { whiteSpace: 'nowrap' } }, "rotation: ", object.rotation), h("div", { style: { whiteSpace: 'nowrap' } }, "x: ", object.x), h("div", { style: { whiteSpace: 'nowrap' } }, "y: ", object.y)))))));
2089
- }), h("svg", { key: 'c40c470ce1a341a6d238ea6c313bd3a78465dbd9', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
2088
+ }), h("svg", { key: '95ad9e12faccc0fbb3af7871b2a4acb383ff8d1c', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
2090
2089
  height: (_u = this.store.state.currentPath) === null || _u === void 0 ? void 0 : _u.height.toString(),
2091
2090
  width: (_v = this.store.state.currentPath) === null || _v === void 0 ? void 0 : _v.width.toString(),
2092
2091
  left: '0',
@@ -2096,7 +2095,7 @@ const KritzelEngine = class {
2096
2095
  transform: (_x = this.store.state.currentPath) === null || _x === void 0 ? void 0 : _x.transformationMatrix,
2097
2096
  transformOrigin: 'top left',
2098
2097
  overflow: 'visible',
2099
- }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, h("path", { key: 'f2d62173bc61abf639e356520419b50c0493f34b', 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 && (h("kritzel-context-menu", { key: 'ad36d2e5eb72e2cbca73c48ef8a4db6d3b6f7a64', class: "context-menu", ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, objects: ((_2 = this.store.state.selectionGroup) === null || _2 === void 0 ? void 0 : _2.objects) || [], style: {
2098
+ }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, h("path", { key: '94a8e02708fdb85a298d96dbce880dcd2f933c0c', 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 && (h("kritzel-context-menu", { key: '127e0f7b1d69243cdb5f41473755e16e3d93a2f3', class: "context-menu", ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, objects: ((_2 = this.store.state.selectionGroup) === null || _2 === void 0 ? void 0 : _2.objects) || [], style: {
2100
2099
  position: 'fixed',
2101
2100
  left: `${this.store.state.contextMenuX}px`,
2102
2101
  top: `${this.store.state.contextMenuY}px`,
@@ -2108,7 +2107,7 @@ const KritzelEngine = class {
2108
2107
  y: (-this.store.state.translateY + this.store.state.contextMenuY) / this.store.state.scale,
2109
2108
  }, (_a = this.store.state.selectionGroup) === null || _a === void 0 ? void 0 : _a.objects);
2110
2109
  this.hideContextMenu();
2111
- } })), ((_3 = this.store.state) === null || _3 === void 0 ? void 0 : _3.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && h("kritzel-cursor-trail", { key: '6917e2621b4de0b0985e58a6043898d79e367ccc', store: this.store })));
2110
+ } })), ((_3 = this.store.state) === null || _3 === void 0 ? void 0 : _3.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && h("kritzel-cursor-trail", { key: 'c999cf8982b522f0a00b853141171c6726666390', store: this.store })));
2112
2111
  }
2113
2112
  get host() { return getElement(this); }
2114
2113
  static get watchers() { return {