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
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-UcX3pzju.js');
3
+ var index = require('./index-CgSgPOBv.js');
4
4
 
5
5
 
6
6
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-C05uAr89.js');
4
- var index$1 = require('./index-UcX3pzju.js');
4
+ var index$1 = require('./index-CgSgPOBv.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
 
@@ -1932,7 +1932,6 @@ const KritzelEngine = class {
1932
1932
  this.store.setState('activeTool', index$1.KritzelToolRegistry.getTool('selection'));
1933
1933
  this.store.deselectAllObjects();
1934
1934
  this.store.selectObjects(objects);
1935
- console.log('Selected objects:', objects);
1936
1935
  }
1937
1936
  async selectAllObjectsInViewport() {
1938
1937
  var _a;
@@ -1977,15 +1976,15 @@ const KritzelEngine = class {
1977
1976
  const baseHandleSizePx = computedStyle.getPropertyValue('--kritzel-selection-handle-size').trim() || '6px';
1978
1977
  const baseHandleSize = parseFloat(baseHandleSizePx);
1979
1978
  const baseHandleTouchSize = baseHandleSize * 2 < 14 ? 14 : baseHandleSize;
1980
- return (index.h(index.Host, { key: 'a8e6c284c98509ddd158686887d656d3907d40a2' }, index.h("div", { key: '3935b658e8859f746a5faef0bb91a527b68fcd3e', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, index.h("div", { key: '12c190c7ea99ac69310b27e719e7df8392b2b46e' }, "TranslateX: ", (_a = this.store.state) === null || _a === void 0 ? void 0 :
1981
- _a.translateX), index.h("div", { key: '4c98deccc2a029dab06ed76e5af426f4a05c7b66' }, "TranslateY: ", (_b = this.store.state) === null || _b === void 0 ? void 0 :
1982
- _b.translateY), index.h("div", { key: '1330191a39c7795f17a6adcc4fbd05e2d6a24d43' }, "ViewportWidth: ", (_c = this.store.state) === null || _c === void 0 ? void 0 :
1983
- _c.viewportWidth), index.h("div", { key: '1ee59427037357ee6bf746a094285426eb0e6a58' }, "ViewportHeight: ", (_d = this.store.state) === null || _d === void 0 ? void 0 :
1984
- _d.viewportHeight), index.h("div", { key: '1e68312e8516f25dcff34e9f9f70b90f426b8711' }, "ObjectsInViewport. ", this.store.objects.length), index.h("div", { key: '1d7cea9e21d9b744d8eaac29286528829143b4fa' }, "Scale: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
1985
- _e.scale), index.h("div", { key: '0b60168fbd55aefa3714067bace80f167b8bcac0' }, "ActiveTool: ", (_g = (_f = this.store.state) === null || _f === void 0 ? void 0 : _f.activeTool) === null || _g === void 0 ? void 0 :
1986
- _g.name), index.h("div", { key: '109752df6a77633d89929f325d296f96d27d7aa9' }, "HasViewportChanged: ", ((_h = this.store.state) === null || _h === void 0 ? void 0 : _h.hasViewportChanged) ? 'true' : 'false'), index.h("div", { key: 'b35466caf465b490c5d448d694353186ff902f09' }, "IsEnabled: ", ((_j = this.store.state) === null || _j === void 0 ? void 0 : _j.isEnabled) ? 'true' : 'false'), index.h("div", { key: '5df20e47f3bf234f04eea001b0a0abaf57946498' }, "IsScaling: ", ((_k = this.store.state) === null || _k === void 0 ? void 0 : _k.isScaling) ? 'true' : 'false'), index.h("div", { key: '9d1ec8b8268488821a968e109fa279393977fdf8' }, "IsPanning: ", ((_l = this.store.state) === null || _l === void 0 ? void 0 : _l.isPanning) ? 'true' : 'false'), index.h("div", { key: '92fa98b7fa3bf877c4fffaca70683d2d908f5177' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), index.h("div", { key: '708d02459c1e3907dd88a2f2fd8916c1ee684cf1' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), index.h("div", { key: '27f45c1b6ee0b6bd0b3301a9c09b9198de722ac4' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), index.h("div", { key: '50d4476aecfc00d12bae7d8a3880ccb8de82fe68' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), index.h("div", { key: '0c582e97ee1535b4a14b75b7ef15373c43f21c4b' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), index.h("div", { key: '7a8378ac991d17d0eaaba5fbd519875197903a39' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), index.h("div", { key: '00b56f11ffd16f7b9049d2857f5f7effceba1294' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), index.h("div", { key: '3b7773194bd6bc8b8b2d024afc768f4e9fbb54c6' }, "PointerX: ", (_m = this.store.state) === null || _m === void 0 ? void 0 :
1987
- _m.pointerX), index.h("div", { key: 'a2b2c96f6180591082a5aee20cc3e82236dac520' }, "PointerY: ", (_o = this.store.state) === null || _o === void 0 ? void 0 :
1988
- _o.pointerY)), index.h("div", { key: '309eb61fff5182b5076cb3886bbd79006efc30b1', id: "origin", class: "origin", style: {
1979
+ return (index.h(index.Host, { key: '61bfbd2fbd2a0fa54671b55372c0c78479bcbd42' }, index.h("div", { key: '51741a7ffe2143fd78ef0d47961c98007c9cb996', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, index.h("div", { key: 'aa580caa079e7ccb619369136a05860d21e7cc53' }, "TranslateX: ", (_a = this.store.state) === null || _a === void 0 ? void 0 :
1980
+ _a.translateX), index.h("div", { key: '0a3ff31676954408050097cc1bbb34e71c10e157' }, "TranslateY: ", (_b = this.store.state) === null || _b === void 0 ? void 0 :
1981
+ _b.translateY), index.h("div", { key: '86a4db3532f05ea238b4fa8f84e0cf1d1cfce05e' }, "ViewportWidth: ", (_c = this.store.state) === null || _c === void 0 ? void 0 :
1982
+ _c.viewportWidth), index.h("div", { key: '775ef8217d65947e86e19b4b0d3f14b6ca0c0cc4' }, "ViewportHeight: ", (_d = this.store.state) === null || _d === void 0 ? void 0 :
1983
+ _d.viewportHeight), index.h("div", { key: '47bb465ff9bf4179dd0d0d3973af534663f72a79' }, "ObjectsInViewport. ", this.store.objects.length), index.h("div", { key: '4bc3129aa10b9d63ff5ff2eebafb5b98bc4349a5' }, "Scale: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
1984
+ _e.scale), index.h("div", { key: '2bda37d1f92525c73230cc5247b4ce8d4918b341' }, "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: 'b94f3078b060223150dd26b2194ab0debd2b531b' }, "HasViewportChanged: ", ((_h = this.store.state) === null || _h === void 0 ? void 0 : _h.hasViewportChanged) ? 'true' : 'false'), index.h("div", { key: '2d17379ea2ab8c8494d5c51b51a5f1a5f253e5c3' }, "IsEnabled: ", ((_j = this.store.state) === null || _j === void 0 ? void 0 : _j.isEnabled) ? 'true' : 'false'), index.h("div", { key: '2dc852b4a8935da997c0ff46d34bebf0bddc33d8' }, "IsScaling: ", ((_k = this.store.state) === null || _k === void 0 ? void 0 : _k.isScaling) ? 'true' : 'false'), index.h("div", { key: '2af7e9330c379c9a9d962d91b07749e2442df0cf' }, "IsPanning: ", ((_l = this.store.state) === null || _l === void 0 ? void 0 : _l.isPanning) ? 'true' : 'false'), index.h("div", { key: '99466f5d289fdc00b9c0b8c21f0a74a491495c96' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), index.h("div", { key: '98d95674cdc72f5b375b50d4ee8ac458d4af052d' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), index.h("div", { key: '9aa3cea7f3abd42fb627191678f733f7ae3be52d' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), index.h("div", { key: 'ce0f5842e763e68cb9a7912622dedef14c403867' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), index.h("div", { key: '459ec8743e55a68dd933d1e005c742fb108b6c94' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), index.h("div", { key: 'd12267e3924fbd066fa3ea851c3a88317bd5e78e' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), index.h("div", { key: '9f6a79f1c5feb36fe636ea5db8f76405efcff620' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), index.h("div", { key: '95a2c0ca71db420aedc87914dd1407a7d51e4ad9' }, "PointerX: ", (_m = this.store.state) === null || _m === void 0 ? void 0 :
1986
+ _m.pointerX), index.h("div", { key: '97eeaaa4152979c94086ccb4819622f08c126ba3' }, "PointerY: ", (_o = this.store.state) === null || _o === void 0 ? void 0 :
1987
+ _o.pointerY)), index.h("div", { key: '9c5ac0629d021a44a66fc6d42dec39ea0b8814a8', id: "origin", class: "origin", style: {
1989
1988
  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})`,
1990
1989
  } }, (_t = this.store.objects) === null || _t === void 0 ? void 0 :
1991
1990
  _t.map(object => {
@@ -2088,7 +2087,7 @@ const KritzelEngine = class {
2088
2087
  fill: 'transparent',
2089
2088
  cursor: 'grab',
2090
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)))))));
2091
- }), index.h("svg", { key: 'c40c470ce1a341a6d238ea6c313bd3a78465dbd9', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
2090
+ }), index.h("svg", { key: '95ad9e12faccc0fbb3af7871b2a4acb383ff8d1c', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
2092
2091
  height: (_u = this.store.state.currentPath) === null || _u === void 0 ? void 0 : _u.height.toString(),
2093
2092
  width: (_v = this.store.state.currentPath) === null || _v === void 0 ? void 0 : _v.width.toString(),
2094
2093
  left: '0',
@@ -2098,7 +2097,7 @@ const KritzelEngine = class {
2098
2097
  transform: (_x = this.store.state.currentPath) === null || _x === void 0 ? void 0 : _x.transformationMatrix,
2099
2098
  transformOrigin: 'top left',
2100
2099
  overflow: 'visible',
2101
- }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.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 && (index.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: {
2100
+ }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.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 && (index.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: {
2102
2101
  position: 'fixed',
2103
2102
  left: `${this.store.state.contextMenuX}px`,
2104
2103
  top: `${this.store.state.contextMenuY}px`,
@@ -2110,7 +2109,7 @@ const KritzelEngine = class {
2110
2109
  y: (-this.store.state.translateY + this.store.state.contextMenuY) / this.store.state.scale,
2111
2110
  }, (_a = this.store.state.selectionGroup) === null || _a === void 0 ? void 0 : _a.objects);
2112
2111
  this.hideContextMenu();
2113
- } })), ((_3 = this.store.state) === null || _3 === void 0 ? void 0 : _3.activeTool) instanceof index$1.KritzelEraserTool && !this.store.state.isScaling && index.h("kritzel-cursor-trail", { key: '6917e2621b4de0b0985e58a6043898d79e367ccc', store: this.store })));
2112
+ } })), ((_3 = this.store.state) === null || _3 === void 0 ? void 0 : _3.activeTool) instanceof index$1.KritzelEraserTool && !this.store.state.isScaling && index.h("kritzel-cursor-trail", { key: 'c999cf8982b522f0a00b853141171c6726666390', store: this.store })));
2114
2113
  }
2115
2114
  get host() { return index.getElement(this); }
2116
2115
  static get watchers() { return {