kritzel-stencil 0.0.105 → 0.0.106

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 (157) hide show
  1. package/dist/cjs/kritzel-brush-style_18.cjs.entry.js +265 -123
  2. package/dist/cjs/kritzel-brush-style_18.cjs.entry.js.map +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/stencil.cjs.js +1 -1
  5. package/dist/collection/classes/handlers/context-menu.handler.js +1 -1
  6. package/dist/collection/classes/handlers/context-menu.handler.js.map +1 -1
  7. package/dist/collection/classes/handlers/selection.handler.js +4 -4
  8. package/dist/collection/classes/handlers/selection.handler.js.map +1 -1
  9. package/dist/collection/classes/objects/base-object.class.js +7 -2
  10. package/dist/collection/classes/objects/base-object.class.js.map +1 -1
  11. package/dist/collection/classes/objects/image.class.js +14 -7
  12. package/dist/collection/classes/objects/image.class.js.map +1 -1
  13. package/dist/collection/classes/objects/path.class.js +22 -16
  14. package/dist/collection/classes/objects/path.class.js.map +1 -1
  15. package/dist/collection/classes/objects/selection-box.class.js +15 -9
  16. package/dist/collection/classes/objects/selection-box.class.js.map +1 -1
  17. package/dist/collection/classes/objects/selection-group.class.js +11 -5
  18. package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
  19. package/dist/collection/classes/objects/text.class.js +29 -12
  20. package/dist/collection/classes/objects/text.class.js.map +1 -1
  21. package/dist/collection/classes/reviver.class.js +4 -4
  22. package/dist/collection/classes/reviver.class.js.map +1 -1
  23. package/dist/collection/classes/store.class.js +30 -14
  24. package/dist/collection/classes/store.class.js.map +1 -1
  25. package/dist/collection/classes/tools/brush-tool.class.js +4 -4
  26. package/dist/collection/classes/tools/brush-tool.class.js.map +1 -1
  27. package/dist/collection/classes/tools/image-tool.class.js +2 -2
  28. package/dist/collection/classes/tools/image-tool.class.js.map +1 -1
  29. package/dist/collection/classes/tools/selection-tool.class.js +1 -1
  30. package/dist/collection/classes/tools/selection-tool.class.js.map +1 -1
  31. package/dist/collection/classes/tools/text-tool.class.js +2 -2
  32. package/dist/collection/classes/tools/text-tool.class.js.map +1 -1
  33. package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.css +10 -10
  34. package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js +1 -1
  35. package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js.map +1 -1
  36. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +42 -1
  37. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js.map +1 -1
  38. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +235 -22
  39. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
  40. package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.css +43 -43
  41. package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +2 -2
  42. package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js.map +1 -1
  43. package/dist/collection/components/shared/kritzel-color/kritzel-color.css +20 -20
  44. package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
  45. package/dist/collection/components/shared/kritzel-color/kritzel-color.js.map +1 -1
  46. package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
  47. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.css +53 -53
  48. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +1 -1
  49. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js.map +1 -1
  50. package/dist/collection/components/shared/kritzel-font/kritzel-font.css +10 -10
  51. package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
  52. package/dist/collection/components/shared/kritzel-font/kritzel-font.js.map +1 -1
  53. package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.css +48 -48
  54. package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +2 -2
  55. package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js.map +1 -1
  56. package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.css +30 -30
  57. package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
  58. package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js.map +1 -1
  59. package/dist/collection/components/shared/kritzel-icon/kritzel-icon.css +17 -17
  60. package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
  61. package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.css +17 -17
  62. package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +4 -4
  63. package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js.map +1 -1
  64. package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.js +1 -1
  65. package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.js.map +1 -1
  66. package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.css +18 -18
  67. package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.js +2 -2
  68. package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.js.map +1 -1
  69. package/dist/collection/components/ui/kritzel-control-text-config/kritzel-control-text-config.js +2 -2
  70. package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +2 -2
  71. package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
  72. package/dist/collection/interfaces/object.interface.js.map +1 -1
  73. package/dist/components/kritzel-brush-style.js +1 -1
  74. package/dist/components/kritzel-color-palette.js +1 -1
  75. package/dist/components/kritzel-color.js +1 -1
  76. package/dist/components/kritzel-context-menu.js +1 -1
  77. package/dist/components/kritzel-control-brush-config.js +1 -1
  78. package/dist/components/kritzel-control-text-config.js +1 -1
  79. package/dist/components/kritzel-controls.js +1 -1
  80. package/dist/components/kritzel-cursor-trail.js +1 -1
  81. package/dist/components/kritzel-dropdown.js +1 -1
  82. package/dist/components/kritzel-editor.js +58 -18
  83. package/dist/components/kritzel-editor.js.map +1 -1
  84. package/dist/components/kritzel-engine.js +1 -1
  85. package/dist/components/kritzel-font-family.js +1 -1
  86. package/dist/components/kritzel-font-size.js +1 -1
  87. package/dist/components/kritzel-font.js +1 -1
  88. package/dist/components/kritzel-stroke-size.js +1 -1
  89. package/dist/components/kritzel-tooltip.js +1 -1
  90. package/dist/components/kritzel-utility-panel.js +1 -1
  91. package/dist/components/{p-X3xYsp4r.js → p-9IX8ss5J.js} +6 -6
  92. package/dist/components/p-9IX8ss5J.js.map +1 -0
  93. package/dist/components/{p-Ddfewfv9.js → p-B1tJ3Woq.js} +3 -3
  94. package/dist/components/{p-Ddfewfv9.js.map → p-B1tJ3Woq.js.map} +1 -1
  95. package/dist/components/{p-D06w3u84.js → p-B7P9QBiE.js} +4 -4
  96. package/dist/components/p-B7P9QBiE.js.map +1 -0
  97. package/dist/components/{p-BjqfG-5H.js → p-BFlJumTk.js} +10 -10
  98. package/dist/components/{p-BjqfG-5H.js.map → p-BFlJumTk.js.map} +1 -1
  99. package/dist/components/{p-DT8_Rz-o.js → p-BcQCX1Z6.js} +67 -39
  100. package/dist/components/p-BcQCX1Z6.js.map +1 -0
  101. package/dist/components/{p-_wFpvzNp.js → p-Bhfk_puI.js} +4 -4
  102. package/dist/components/p-Bhfk_puI.js.map +1 -0
  103. package/dist/components/{p-BYH2jNAX.js → p-CF5pcRGS.js} +4 -4
  104. package/dist/components/{p-BYH2jNAX.js.map → p-CF5pcRGS.js.map} +1 -1
  105. package/dist/components/p-CZkSABuJ.js.map +1 -1
  106. package/dist/components/{p-BYt7-mGK.js → p-Cbu5RSmC.js} +3 -3
  107. package/dist/components/{p-BYt7-mGK.js.map → p-Cbu5RSmC.js.map} +1 -1
  108. package/dist/components/{p-DaeIjoQm.js → p-Ck2d5Wd1.js} +4 -4
  109. package/dist/components/p-Ck2d5Wd1.js.map +1 -0
  110. package/dist/components/{p-C3vo4rx8.js → p-CkPd1oL1.js} +151 -71
  111. package/dist/components/p-CkPd1oL1.js.map +1 -0
  112. package/dist/components/{p-C8KDwUb7.js → p-D9nf_Yw4.js} +3 -3
  113. package/dist/components/p-D9nf_Yw4.js.map +1 -0
  114. package/dist/components/{p-D31-QJwi.js → p-DIxwvThL.js} +17 -17
  115. package/dist/components/{p-D31-QJwi.js.map → p-DIxwvThL.js.map} +1 -1
  116. package/dist/components/{p-CDhTT8u8.js → p-Ds3FhuuO.js} +3 -3
  117. package/dist/components/p-Ds3FhuuO.js.map +1 -0
  118. package/dist/components/{p-BgUIonZF.js → p-I1jXruHK.js} +4 -4
  119. package/dist/components/p-I1jXruHK.js.map +1 -0
  120. package/dist/components/{p-BqUM5gV3.js → p-JvUh5Cky.js} +9 -9
  121. package/dist/components/p-JvUh5Cky.js.map +1 -0
  122. package/dist/components/{p-DQHNxDS7.js → p-c6tIpE_t.js} +3 -3
  123. package/dist/components/p-c6tIpE_t.js.map +1 -0
  124. package/dist/components/{p-BJ5xxphF.js → p-wUZba7Vi.js} +4 -4
  125. package/dist/components/{p-BJ5xxphF.js.map → p-wUZba7Vi.js.map} +1 -1
  126. package/dist/esm/kritzel-brush-style_18.entry.js +265 -123
  127. package/dist/esm/kritzel-brush-style_18.entry.js.map +1 -1
  128. package/dist/esm/loader.js +1 -1
  129. package/dist/esm/stencil.js +1 -1
  130. package/dist/stencil/p-7aaf3e49.entry.js +2 -0
  131. package/dist/stencil/p-7aaf3e49.entry.js.map +1 -0
  132. package/dist/stencil/stencil.esm.js +1 -1
  133. package/dist/types/classes/objects/base-object.class.d.ts +4 -3
  134. package/dist/types/classes/objects/image.class.d.ts +1 -1
  135. package/dist/types/classes/objects/path.class.d.ts +1 -1
  136. package/dist/types/classes/objects/selection-box.class.d.ts +1 -1
  137. package/dist/types/classes/objects/selection-group.class.d.ts +1 -1
  138. package/dist/types/classes/objects/text.class.d.ts +12 -1
  139. package/dist/types/classes/store.class.d.ts +3 -3
  140. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +7 -0
  141. package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +8 -1
  142. package/dist/types/components.d.ts +11 -3
  143. package/dist/types/interfaces/object.interface.d.ts +1 -1
  144. package/package.json +1 -1
  145. package/dist/components/p-BgUIonZF.js.map +0 -1
  146. package/dist/components/p-BqUM5gV3.js.map +0 -1
  147. package/dist/components/p-C3vo4rx8.js.map +0 -1
  148. package/dist/components/p-C8KDwUb7.js.map +0 -1
  149. package/dist/components/p-CDhTT8u8.js.map +0 -1
  150. package/dist/components/p-D06w3u84.js.map +0 -1
  151. package/dist/components/p-DQHNxDS7.js.map +0 -1
  152. package/dist/components/p-DT8_Rz-o.js.map +0 -1
  153. package/dist/components/p-DaeIjoQm.js.map +0 -1
  154. package/dist/components/p-X3xYsp4r.js.map +0 -1
  155. package/dist/components/p-_wFpvzNp.js.map +0 -1
  156. package/dist/stencil/p-d0394bb5.entry.js +0 -2
  157. package/dist/stencil/p-d0394bb5.entry.js.map +0 -1
@@ -22,7 +22,7 @@ const KritzelBrushStyle = class {
22
22
  value: option.value,
23
23
  label: option.label,
24
24
  }));
25
- return (index.h(index.Host, { key: 'cb9a9485596d25280c6d96e30296ed8c6b3de0e1' }, index.h("kritzel-dropdown", { key: 'b2f22f627e91228ca42bcd2898b468fcb994d5f8', options: dropdownOptions, value: this.type, onValueChanged: event => this.handleDropdownValueChange(event) }, index.h("button", { key: '1a8ab8cc0917bcdcbbbd485354853b80dd2f9a7f', class: "brush-style-button", slot: "prefix" }, index.h("kritzel-icon", { key: '62238f43f6a88a0a01d47e56d48179834edc4fc1', name: this.type, size: 16 })))));
25
+ return (index.h(index.Host, { key: 'd7af382fe6f613aa16a5146785990ad2faa17f60' }, index.h("kritzel-dropdown", { key: '6d6d330d415c210058834b2968774b3db2ab7fc4', options: dropdownOptions, value: this.type, onValueChanged: event => this.handleDropdownValueChange(event) }, index.h("button", { key: 'c9fb33795b8e25f68c1d2ae248dc82a6de29e199', class: "brush-style-button", slot: "prefix" }, index.h("kritzel-icon", { key: '975c95b545a1c27ae2984405ac298592eec9743d', name: this.type, size: 16 })))));
26
26
  }
27
27
  };
28
28
  KritzelBrushStyle.style = kritzelBrushStyleCss;
@@ -60,13 +60,13 @@ const KritzelColor = class {
60
60
  }
61
61
  render() {
62
62
  const isColorVeryLight = this.isLightColor(this.value);
63
- return (index.h(index.Host, { key: 'e913815994a30d97f92781e742c4a13de19e59fe' }, index.h("div", { key: 'e0cc40b10dcb298f5b86be7d4283d6bffbd08c2c', class: "checkerboard-bg", style: {
63
+ return (index.h(index.Host, { key: '606cfb813de66c495b2a2ff1e54aac4a5f761ab8' }, index.h("div", { key: '066d364e6e025b245c896603f68a15962684f78b', class: "checkerboard-bg", style: {
64
64
  width: `${this.size}px`,
65
65
  height: `${this.size}px`,
66
66
  borderRadius: '50%',
67
67
  display: 'inline-block',
68
68
  position: 'relative',
69
- } }, index.h("div", { key: '5e0a092a6d3463d852a1760d125fba04494e0d90', class: {
69
+ } }, index.h("div", { key: '500d1a781d0b7a1777a7a43f89be8c6217726584', class: {
70
70
  'color-circle': true,
71
71
  'white': isColorVeryLight,
72
72
  }, style: {
@@ -108,7 +108,7 @@ const KritzelColorPalette = class {
108
108
  render() {
109
109
  const displayedColors = this.isExpanded ? this.colors : this.colors.slice(0, 6);
110
110
  const expandedHeight = this.isExpanded ? this.calculateHeight() : '32px';
111
- return (index.h(index.Host, { key: '0f0d176e1c8b199a973dbdb23b84e4a8d4d57f59' }, index.h("div", { key: '1d4707cdb30752d21a5058dbbef5fb32934bd3bd', class: {
111
+ return (index.h(index.Host, { key: '9590fbda0cb20e767880c49323350b12c7d287e4' }, index.h("div", { key: '9fd8699050018a90919c0045630b766183abb42e', class: {
112
112
  'color-grid': true,
113
113
  'expanded': this.isExpanded,
114
114
  }, style: {
@@ -136,7 +136,7 @@ const KritzelContextMenu = class {
136
136
  }
137
137
  }
138
138
  render() {
139
- return (index.h(index.Host, { key: 'dfbafed8ab0ab62e8124763431e00283ddfc9aaa' }, index.h("div", { key: 'd0d7cf6241d24bd85ca2f4d2aa3e23aeb4283d82', class: "menu-container" }, this.items.map(item => (index.h("button", { key: `${item.label}-${this.items.indexOf(item)}`, class: { 'menu-item': true, 'disabled': typeof item.disabled === 'function' ? item.disabled() : item.disabled }, onClick: () => this.handleItemClick(item), onTouchStart: () => this.handleItemClick(item), disabled: typeof item.disabled === 'function' ? item.disabled() : item.disabled }, item.icon && index.h("kritzel-icon", { name: item.icon, size: 16 }), index.h("span", { class: "label" }, item.label)))))));
139
+ return (index.h(index.Host, { key: 'db318a0936f89f202ef5101447b723c0ba7aa139' }, index.h("div", { key: '53da01021464f605e08c5f910997bb8f21d481a1', class: "menu-container" }, this.items.map(item => (index.h("button", { key: `${item.label}-${this.items.indexOf(item)}`, class: { 'menu-item': true, 'disabled': typeof item.disabled === 'function' ? item.disabled() : item.disabled }, onClick: () => this.handleItemClick(item), onTouchStart: () => this.handleItemClick(item), disabled: typeof item.disabled === 'function' ? item.disabled() : item.disabled }, item.icon && index.h("kritzel-icon", { name: item.icon, size: 16 }), index.h("span", { class: "label" }, item.label)))))));
140
140
  }
141
141
  get hostElement() { return index.getElement(this); }
142
142
  };
@@ -175,14 +175,14 @@ const KritzelControlBrushConfig = class {
175
175
  this.toolChange.emit(this.tool);
176
176
  }
177
177
  render() {
178
- return (index.h(index.Host, { key: '1658cc6062f9a62c11a7011e36bd5f892653f691' }, index.h("div", { key: 'bfafd20ebc6f7541e6a0952b555e3aefd0524086', style: {
178
+ return (index.h(index.Host, { key: '29f0492264283879fd86195fc0db8e5a8f352a0f' }, index.h("div", { key: 'c5bde66ab565eb717bf302f3f97d08ed0b261289', style: {
179
179
  display: 'flex',
180
180
  flexDirection: 'row',
181
181
  alignItems: 'center',
182
182
  justifyContent: 'flex-start',
183
183
  width: '100%',
184
184
  gap: '8px',
185
- } }, index.h("kritzel-brush-style", { key: '6530b0fbee10db66f6dfd0e482e2a95279f303eb', type: this.tool.type, onTypeChange: event => this.handleTypeChange(event) }), index.h("button", { key: 'f16a4c5aefb298228d29576d6bf8a0632301169d', 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: '138726189ee12b0d15dedfdbd07019701712ea3b', name: this.isExpanded ? 'chevron-up' : 'chevron-down' }))), index.h("kritzel-color-palette", { key: 'ca15a07a28ad955d49289299265e1b62da508cfd', colors: this.palette, selectedColor: this.tool.color, isExpanded: this.isExpanded, isOpaque: true, onColorChange: color => this.handleColorChange(color) }), index.h("kritzel-stroke-size", { key: '1017df7a36bad69af055fe08e685a1be3ff48b4b', selectedSize: this.tool.size, onSizeChange: event => this.handleSizeChange(event) })));
185
+ } }, index.h("kritzel-brush-style", { key: 'e78ec70c5d0eb24933543e12389f1a3db4c3b8f2', type: this.tool.type, onTypeChange: event => this.handleTypeChange(event) }), index.h("button", { key: '9fbde247a8ed3cf43ef0bd0b269f8562dfac56a0', 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: '3cf37dd520fabd632cfd7d764254467d563670e1', name: this.isExpanded ? 'chevron-up' : 'chevron-down' }))), index.h("kritzel-color-palette", { key: 'daa59edce48e683a52a39ae4062fe811908dc685', colors: this.palette, selectedColor: this.tool.color, isExpanded: this.isExpanded, isOpaque: true, onColorChange: color => this.handleColorChange(color) }), index.h("kritzel-stroke-size", { key: 'b71bfb1176c35c24c15827ebc89dcac56bb42f0e', selectedSize: this.tool.size, onSizeChange: event => this.handleSizeChange(event) })));
186
186
  }
187
187
  static get watchers() { return {
188
188
  "tool": ["handleToolChange"]
@@ -214,14 +214,14 @@ const KritzelControlTextConfig = class {
214
214
  this.toolChange.emit(this.tool);
215
215
  }
216
216
  render() {
217
- return (index.h(index.Host, { key: '27d47c47987fb7644313a4face4a7023dfbe454d' }, index.h("div", { key: '835b8072267da18b39a5c02a6c989e1f7b81e9a5', style: {
217
+ return (index.h(index.Host, { key: '4a530500af6a26013d286f995987c8321c3565ec' }, index.h("div", { key: '98499852c8c2b95e2485058c8d0d114dfc4c133d', style: {
218
218
  display: 'flex',
219
219
  flexDirection: 'row',
220
220
  alignItems: 'center',
221
221
  justifyContent: 'flex-start',
222
222
  width: '100%',
223
223
  gap: '8px',
224
- } }, index.h("kritzel-font-family", { key: 'b7a0bde2e9cf53c9ae7c3a32b424825ca9f757c4', selectedFontFamily: this.tool.fontFamily, onFontFamilyChange: event => this.handleFamilyChange(event) }), index.h("button", { key: '41aba583656195c4825a15ddc12c5e1efed0d8d2', class: "expand-toggle", onClick: () => this.handleToggleExpand(), title: this.isExpanded ? 'Collapse' : 'Expand' }, index.h("kritzel-icon", { key: '5ff979420066703b5d5e886d12f89687392006e3', name: this.isExpanded ? 'chevron-up' : 'chevron-down' }))), index.h("kritzel-color-palette", { key: '30fbcc05f80b15fba7f1f5ac6413732d0149ee9b', colors: this.tool.palette, selectedColor: this.tool.fontColor, isExpanded: this.isExpanded, onColorChange: event => this.handleColorChange(event) }), index.h("kritzel-font-size", { key: '2a0d3c4578316b37bc1a25b6e065ecf565eca2b3', selectedSize: this.tool.fontSize, fontFamily: this.tool.fontFamily, onSizeChange: event => this.handleSizeChange(event) })));
224
+ } }, index.h("kritzel-font-family", { key: '21a06dd2a43b47219bf9fd983cbd75af75a7489d', selectedFontFamily: this.tool.fontFamily, onFontFamilyChange: event => this.handleFamilyChange(event) }), index.h("button", { key: 'dfef40e171b4c2c5c771a017448ae2c22597834b', class: "expand-toggle", onClick: () => this.handleToggleExpand(), title: this.isExpanded ? 'Collapse' : 'Expand' }, index.h("kritzel-icon", { key: 'ce3f80a32af959676b3dd16faedf195e9686fff3', name: this.isExpanded ? 'chevron-up' : 'chevron-down' }))), index.h("kritzel-color-palette", { key: '61dd15d6577784511b7abce9fe9e0c38c10a99fa', colors: this.tool.palette, selectedColor: this.tool.fontColor, isExpanded: this.isExpanded, onColorChange: event => this.handleColorChange(event) }), index.h("kritzel-font-size", { key: '162b9e3b4c342b4c224ec20bba61adbe168a638f', selectedSize: this.tool.fontSize, fontFamily: this.tool.fontFamily, onSizeChange: event => this.handleSizeChange(event) })));
225
225
  }
226
226
  };
227
227
  KritzelControlTextConfig.style = kritzelControlTextConfigCss;
@@ -454,7 +454,7 @@ class KritzelBaseObject {
454
454
  get centerY() {
455
455
  return this.translateY + this.totalHeight / 2;
456
456
  }
457
- constructor(store) {
457
+ constructor() {
458
458
  this.__class__ = 'KritzelBaseObject';
459
459
  this.visible = true;
460
460
  this.borderWidth = 0;
@@ -467,9 +467,14 @@ class KritzelBaseObject {
467
467
  this.isMounted = false;
468
468
  this.zIndex = 0;
469
469
  this.debugInfoVisible = false;
470
- this._store = store;
471
470
  this.id = this.generateId();
472
471
  }
472
+ static create(store) {
473
+ const object = new KritzelBaseObject();
474
+ object._store = store;
475
+ object.zIndex = store.currentZIndex;
476
+ return object;
477
+ }
473
478
  mount(element) {
474
479
  if (this.isMounted) {
475
480
  return;
@@ -528,12 +533,8 @@ class KritzelBaseObject {
528
533
  }
529
534
 
530
535
  class KritzelPath extends KritzelBaseObject {
531
- get viewBox() {
532
- return `${this.x} ${this.y} ${this.width} ${this.height}`;
533
- }
534
- constructor(store, options) {
535
- var _a, _b, _c, _d, _e, _f;
536
- super(store);
536
+ constructor() {
537
+ super(...arguments);
537
538
  this.__class__ = 'KritzelPath';
538
539
  this.stroke = 'none';
539
540
  this.lineSlack = 0.5;
@@ -544,16 +545,26 @@ class KritzelPath extends KritzelBaseObject {
544
545
  this.scale = 1;
545
546
  this.visible = true;
546
547
  this.debugInfoVisible = true;
547
- this.options = options;
548
- this.points = (_a = options === null || options === void 0 ? void 0 : options.points) !== null && _a !== void 0 ? _a : [];
549
- this.translateX = (_b = options === null || options === void 0 ? void 0 : options.translateX) !== null && _b !== void 0 ? _b : 0;
550
- this.translateY = (_c = options === null || options === void 0 ? void 0 : options.translateY) !== null && _c !== void 0 ? _c : 0;
551
- this.scale = (_d = options === null || options === void 0 ? void 0 : options.scale) !== null && _d !== void 0 ? _d : 1;
552
- this.strokeWidth = (_e = options === null || options === void 0 ? void 0 : options.strokeWidth) !== null && _e !== void 0 ? _e : 8;
553
- this.fill = (_f = options === null || options === void 0 ? void 0 : options.fill) !== null && _f !== void 0 ? _f : '#000000';
554
- this.zIndex = 9999;
555
- this.d = this.generateSvgPath();
556
- this.updateDimensions();
548
+ }
549
+ get viewBox() {
550
+ return `${this.x} ${this.y} ${this.width} ${this.height}`;
551
+ }
552
+ static create(store, options) {
553
+ var _a, _b, _c, _d, _e, _f;
554
+ const object = new KritzelPath();
555
+ object._store = store;
556
+ object.id = object.generateId();
557
+ object.options = options;
558
+ object.points = (_a = options === null || options === void 0 ? void 0 : options.points) !== null && _a !== void 0 ? _a : [];
559
+ object.translateX = (_b = options === null || options === void 0 ? void 0 : options.translateX) !== null && _b !== void 0 ? _b : 0;
560
+ object.translateY = (_c = options === null || options === void 0 ? void 0 : options.translateY) !== null && _c !== void 0 ? _c : 0;
561
+ object.scale = (_d = options === null || options === void 0 ? void 0 : options.scale) !== null && _d !== void 0 ? _d : 1;
562
+ object.strokeWidth = (_e = options === null || options === void 0 ? void 0 : options.strokeWidth) !== null && _e !== void 0 ? _e : 8;
563
+ object.fill = (_f = options === null || options === void 0 ? void 0 : options.fill) !== null && _f !== void 0 ? _f : '#000000';
564
+ object.zIndex = store.currentZIndex;
565
+ object.d = object.generateSvgPath();
566
+ object.updateDimensions();
567
+ return object;
557
568
  }
558
569
  resize(x, y, width, height) {
559
570
  if (width <= 1 || height <= 1) {
@@ -700,7 +711,7 @@ class KritzelBrushTool extends KritzelBaseTool {
700
711
  this._store.state.isDrawing = true;
701
712
  const x = event.clientX - this._store.offsetX;
702
713
  const y = event.clientY - this._store.offsetY;
703
- this._store.state.currentPath = new KritzelPath(this._store, {
714
+ this._store.state.currentPath = KritzelPath.create(this._store, {
704
715
  points: [[x, y]],
705
716
  translateX: -this._store.state.translateX,
706
717
  translateY: -this._store.state.translateY,
@@ -714,7 +725,7 @@ class KritzelBrushTool extends KritzelBaseTool {
714
725
  if (this._store.state.isDrawing) {
715
726
  const x = event.clientX - this._store.offsetX;
716
727
  const y = event.clientY - this._store.offsetY;
717
- this._store.state.currentPath = new KritzelPath(this._store, {
728
+ this._store.state.currentPath = KritzelPath.create(this._store, {
718
729
  points: [...this._store.state.currentPath.points, [x, y]],
719
730
  translateX: -this._store.state.translateX,
720
731
  translateY: -this._store.state.translateY,
@@ -740,7 +751,7 @@ class KritzelBrushTool extends KritzelBaseTool {
740
751
  const x = Math.round(event.touches[0].clientX - this._store.offsetX);
741
752
  const y = Math.round(event.touches[0].clientY - this._store.offsetY);
742
753
  this._store.state.isDrawing = true;
743
- this._store.state.currentPath = new KritzelPath(this._store, {
754
+ this._store.state.currentPath = KritzelPath.create(this._store, {
744
755
  points: [[x, y]],
745
756
  translateX: -this._store.state.translateX,
746
757
  translateY: -this._store.state.translateY,
@@ -755,7 +766,7 @@ class KritzelBrushTool extends KritzelBaseTool {
755
766
  if (this._store.state.touchCount === 1) {
756
767
  const x = Math.round(event.touches[0].clientX - this._store.offsetX);
757
768
  const y = Math.round(event.touches[0].clientY - this._store.offsetY);
758
- this._store.state.currentPath = new KritzelPath(this._store, {
769
+ this._store.state.currentPath = KritzelPath.create(this._store, {
759
770
  points: [...this._store.state.currentPath.points, [x, y]],
760
771
  translateX: -this._store.state.translateX,
761
772
  translateY: -this._store.state.translateY,
@@ -783,8 +794,8 @@ class KritzelText extends KritzelBaseObject {
783
794
  get isReadonly() {
784
795
  return !(this._store.state.activeTool instanceof KritzelTextTool);
785
796
  }
786
- constructor(store, fontSize, fontFamily) {
787
- super(store);
797
+ constructor(config) {
798
+ super();
788
799
  this.__class__ = 'KritzelText';
789
800
  this.value = '';
790
801
  this.fontFamily = 'Arial';
@@ -794,16 +805,33 @@ class KritzelText extends KritzelBaseObject {
794
805
  this.isNew = true;
795
806
  this.debugInfoVisible = true;
796
807
  this.rows = 1;
797
- this.fontSize = fontSize;
798
- this.fontFamily = fontFamily;
799
- this.translateX = 0;
800
- this.translateY = 0;
801
- this.width = this.initialWidth / (this._store.state.scale < 0 ? this._store.state.scale : 1);
802
- this.height = (this.fontSize * 1.2) / (this._store.state.scale < 0 ? this._store.state.scale : 1);
803
- this.padding = 5;
804
- this.backgroundColor = 'transparent';
805
- this.scale = this._store.state.scale;
806
- this.value = ' ';
808
+ if (config) {
809
+ this.value = config.value || ' ';
810
+ this.translateX = config.translateX || 0;
811
+ this.translateY = config.translateY || 0;
812
+ this.fontSize = config.fontSize || 8;
813
+ this.fontFamily = config.fontFamily || 'Arial';
814
+ this.fontColor = config.fontColor || '#000000';
815
+ this.height = config.height || (this.fontSize * 1.2);
816
+ this.width = config.width || 0;
817
+ this.scale = config.scale || 1;
818
+ }
819
+ }
820
+ static create(store, fontSize, fontFamily) {
821
+ const object = new KritzelText();
822
+ object._store = store;
823
+ object.fontSize = fontSize;
824
+ object.fontFamily = fontFamily;
825
+ object.translateX = 0;
826
+ object.translateY = 0;
827
+ object.width = object.initialWidth / (object._store.state.scale < 0 ? object._store.state.scale : 1);
828
+ object.height = (object.fontSize * 1.2) / (object._store.state.scale < 0 ? object._store.state.scale : 1);
829
+ object.padding = 5;
830
+ object.backgroundColor = 'transparent';
831
+ object.scale = object._store.state.scale;
832
+ object.value = ' ';
833
+ object.zIndex = store.currentZIndex;
834
+ return object;
807
835
  }
808
836
  mount(element) {
809
837
  if ((this.isMounted && this.elementRef === element) || this.isInViewport() === false) {
@@ -955,7 +983,7 @@ class KritzelTextTool extends KritzelBaseTool {
955
983
  }
956
984
  const clientX = event.clientX - this._store.offsetX;
957
985
  const clientY = event.clientY - this._store.offsetY;
958
- const text = new KritzelText(this._store, this.fontSize, this.fontFamily);
986
+ const text = KritzelText.create(this._store, this.fontSize, this.fontFamily);
959
987
  text.fontColor = this.fontColor;
960
988
  text.translateX = (clientX - this._store.state.translateX) / this._store.state.scale;
961
989
  text.translateY = (clientY - this._store.state.translateY) / this._store.state.scale;
@@ -992,7 +1020,7 @@ class KritzelTextTool extends KritzelBaseTool {
992
1020
  }
993
1021
  const clientX = Math.round(event.touches[0].clientX - this._store.offsetX);
994
1022
  const clientY = Math.round(event.touches[0].clientY - this._store.offsetY);
995
- const text = new KritzelText(this._store, this.fontSize, this.fontFamily);
1023
+ const text = KritzelText.create(this._store, this.fontSize, this.fontFamily);
996
1024
  text.fontColor = this.fontColor;
997
1025
  text.translateX = (clientX - this._store.state.translateX) / this._store.state.scale;
998
1026
  text.translateY = (clientY - this._store.state.translateY) / this._store.state.scale;
@@ -1097,11 +1125,11 @@ const KritzelControls = class {
1097
1125
  render() {
1098
1126
  var _a, _b;
1099
1127
  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;
1100
- return (index.h(index.Host, { key: '2b13783ef0f1638ad76bfcef22c17c3eeb849d67' }, index.h("kritzel-utility-panel", { key: '1babeb88133cebc9057c85723b812b99152316c6', style: {
1128
+ return (index.h(index.Host, { key: 'ed654553a1d3f5d2b5e85e3b3bce4a5705cc51e3' }, index.h("kritzel-utility-panel", { key: '9db82dacbe7360acba1b58b15536c7fed0c1f0dd', style: {
1101
1129
  position: 'absolute',
1102
1130
  bottom: '56px',
1103
1131
  left: '12px',
1104
- }, 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 => {
1132
+ }, 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: '193a4efd69c51425dc0c8b142c8fba7c6f133077', class: "kritzel-controls" }, this.controls.map(control => {
1105
1133
  var _a, _b, _c, _d, _e, _f, _g, _h;
1106
1134
  if (control.type === 'tool') {
1107
1135
  return (index.h("button", { class: {
@@ -1204,7 +1232,7 @@ const KritzelCursorTrail = class {
1204
1232
  }
1205
1233
  }
1206
1234
  render() {
1207
- return (index.h(index.Host, { key: '604f5c39a01f3aea870861de0a93cd162302d7b2' }, this.cursorTrailPoints.length > 1 && (index.h("svg", { key: '6f69f0b5a871010581b73bff51b2ef7341389f5a', class: "cursor-trail-svg", xmlns: "http://www.w3.org/2000/svg", style: {
1235
+ return (index.h(index.Host, { key: 'c0a9b9ebe1634ba020024efed6446791d6a65a2f' }, this.cursorTrailPoints.length > 1 && (index.h("svg", { key: '50c73784eaffe743823bc6a75524fa4dc98566a8', class: "cursor-trail-svg", xmlns: "http://www.w3.org/2000/svg", style: {
1208
1236
  position: 'absolute',
1209
1237
  left: '0',
1210
1238
  top: '0',
@@ -1308,7 +1336,7 @@ const KritzelDropdown = class {
1308
1336
  'has-suffix-border': this.hasSuffixContent,
1309
1337
  'has-prefix-border': this.hasPrefixContent,
1310
1338
  };
1311
- return (index.h(index.Host, { key: '1e4df5425e205d3709d93d71f2e7a47844a5b0f2' }, index.h("div", { key: '6e0d6fa7b35d1d9d61cf2174828d0d0f0d242683', class: "dropdown-wrapper" }, index.h("slot", { key: '07565dc0982498a9b026bc36f285eb728b5c771b', name: "prefix", ref: el => this.prefixSlotElement = el, onSlotchange: this.evaluatePrefixContent }), index.h("select", { key: 'ba618a1166681f36aae554242192e375286ba7e8', class: selectClasses, style: Object.assign(Object.assign({}, this.selectStyles), { width: this.width }), onInput: this.handleSelectChange }, this.options.map(option => (index.h("option", { value: option.value, style: option.style, selected: option.value === this.internalValue }, option.label)))), index.h("slot", { key: '2731003fa214cb3aa968b48db36ab1816d563425', name: "suffix", ref: el => this.suffixSlotElement = el, onSlotchange: this.evaluateSuffixContent }))));
1339
+ return (index.h(index.Host, { key: '32c5f5a4f807c1e316c91b795c005b8d30ce6189' }, index.h("div", { key: 'b1cbeff18e688da4a2f7472be290b9527a619f07', class: "dropdown-wrapper" }, index.h("slot", { key: 'b3bbb7e21c6f5620cab41aa4b1c7206b6c75fd86', name: "prefix", ref: el => this.prefixSlotElement = el, onSlotchange: this.evaluatePrefixContent }), index.h("select", { key: '8b2dcdc125bee59cf29fce7c980b755e78d5816e', class: selectClasses, style: Object.assign(Object.assign({}, this.selectStyles), { width: this.width }), onInput: this.handleSelectChange }, this.options.map(option => (index.h("option", { value: option.value, style: option.style, selected: option.value === this.internalValue }, option.label)))), index.h("slot", { key: '8d83f0dea41ac959bf2392948efef33bb70d0154', name: "suffix", ref: el => this.suffixSlotElement = el, onSlotchange: this.evaluateSuffixContent }))));
1312
1340
  }
1313
1341
  static get watchers() { return {
1314
1342
  "value": ["externalValueChanged"],
@@ -1461,16 +1489,23 @@ class KritzelEraserTool extends KritzelBaseTool {
1461
1489
  }
1462
1490
 
1463
1491
  class KritzelImage extends KritzelBaseObject {
1464
- constructor(store) {
1465
- super(store);
1492
+ constructor() {
1493
+ super(...arguments);
1466
1494
  this.__class__ = 'KritzelImage';
1467
1495
  this.src = '';
1468
1496
  this.debugInfoVisible = true;
1469
- this.x = 0;
1470
- this.y = 0;
1471
- this.translateX = 0;
1472
- this.translateY = 0;
1473
- this.scale = this._store.state.scale;
1497
+ }
1498
+ static create(store) {
1499
+ const object = new KritzelImage();
1500
+ object._store = store;
1501
+ object.id = object.generateId();
1502
+ object.x = 0;
1503
+ object.y = 0;
1504
+ object.translateX = 0;
1505
+ object.translateY = 0;
1506
+ object.scale = object._store.state.scale;
1507
+ object.zIndex = store.currentZIndex;
1508
+ return object;
1474
1509
  }
1475
1510
  resize(x, y, width, height) {
1476
1511
  if (width <= 1 || height <= 1) {
@@ -1935,17 +1970,23 @@ class KritzelGeometryHelper {
1935
1970
  }
1936
1971
 
1937
1972
  class KrtizelSelectionBox extends KritzelBaseObject {
1938
- constructor(store) {
1939
- super(store);
1973
+ constructor() {
1974
+ super(...arguments);
1940
1975
  this.__class__ = 'KrtizelSelectionBox';
1941
1976
  this.objects = [];
1942
- this.backgroundColor = 'var(--kritzel-selection-box-background-color, rgba(14, 17, 17, 0.2))';
1943
- this.borderColor = 'var(--kritzel-selection-box-border-color, rgba(14, 17, 17, 0.5))';
1944
- this.borderWidth = 2;
1945
- this.scale = this._store.state.scale;
1946
- this.height = 0;
1947
- this.width = 0;
1948
- this.zIndex = 9999;
1977
+ }
1978
+ static create(store) {
1979
+ const object = new KrtizelSelectionBox();
1980
+ object._store = store;
1981
+ object.id = object.generateId();
1982
+ object.scale = store.state.scale;
1983
+ object.zIndex = 99999;
1984
+ object.backgroundColor = 'var(--kritzel-selection-box-background-color, rgba(14, 17, 17, 0.2))';
1985
+ object.borderColor = 'var(--kritzel-selection-box-border-color, rgba(14, 17, 17, 0.5))';
1986
+ object.borderWidth = 2;
1987
+ object.height = 0;
1988
+ object.width = 0;
1989
+ return object;
1949
1990
  }
1950
1991
  }
1951
1992
 
@@ -2047,7 +2088,7 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
2047
2088
  let clientX, clientY;
2048
2089
  clientX = event.clientX - this._store.offsetX;
2049
2090
  clientY = event.clientY - this._store.offsetY;
2050
- const selectionBox = new KrtizelSelectionBox(this._store);
2091
+ const selectionBox = KrtizelSelectionBox.create(this._store);
2051
2092
  this.startX = (clientX - this._store.state.translateX) / this._store.state.scale;
2052
2093
  this.startY = (clientY - this._store.state.translateY) / this._store.state.scale;
2053
2094
  selectionBox.translateX = this.startX;
@@ -2068,7 +2109,7 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
2068
2109
  clientY = Math.round(firstTouch.clientY - this._store.offsetY);
2069
2110
  this.touchStartX = clientX;
2070
2111
  this.touchStartY = clientY;
2071
- const selectionBox = new KrtizelSelectionBox(this._store);
2112
+ const selectionBox = KrtizelSelectionBox.create(this._store);
2072
2113
  this.startX = (clientX - this._store.state.translateX) / this._store.state.scale;
2073
2114
  this.startY = (clientY - this._store.state.translateY) / this._store.state.scale;
2074
2115
  selectionBox.translateX = this.startX;
@@ -2130,7 +2171,7 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
2130
2171
  return;
2131
2172
  }
2132
2173
  selectedObjects.forEach(o => (o.selected = false));
2133
- this._store.state.selectionGroup = new KritzelSelectionGroup(this._store);
2174
+ this._store.state.selectionGroup = KritzelSelectionGroup.create(this._store);
2134
2175
  this._store.state.selectionGroup.addOrRemove(selectedObject);
2135
2176
  this._store.state.selectionGroup.selected = true;
2136
2177
  this._store.state.selectionGroup.rotation = this._store.state.selectionGroup.objects[0].rotation;
@@ -2141,7 +2182,7 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
2141
2182
  if (selectedObjects.length === 0) {
2142
2183
  return;
2143
2184
  }
2144
- this._store.state.selectionGroup = new KritzelSelectionGroup(this._store);
2185
+ this._store.state.selectionGroup = KritzelSelectionGroup.create(this._store);
2145
2186
  selectedObjects.forEach(o => {
2146
2187
  o.selected = false;
2147
2188
  this._store.state.selectionGroup.addOrRemove(o);
@@ -2281,7 +2322,7 @@ class KritzelSelectionTool extends KritzelBaseTool {
2281
2322
  return object;
2282
2323
  }
2283
2324
  else {
2284
- const group = new KritzelSelectionGroup(this._store);
2325
+ const group = KritzelSelectionGroup.create(this._store);
2285
2326
  group.translateX = 0;
2286
2327
  group.translateY = 0;
2287
2328
  group.addOrRemove(object);
@@ -2323,16 +2364,16 @@ class KritzelReviver {
2323
2364
  let revivedObj;
2324
2365
  switch (obj.__class__) {
2325
2366
  case 'KritzelPath':
2326
- revivedObj = new KritzelPath(this._store).revive(obj);
2367
+ revivedObj = KritzelPath.create(this._store).revive(obj);
2327
2368
  break;
2328
2369
  case 'KritzelText':
2329
- revivedObj = new KritzelText(this._store, obj.fontSize, obj.fontFamily).revive(obj);
2370
+ revivedObj = KritzelText.create(this._store, obj.fontSize, obj.fontFamily).revive(obj);
2330
2371
  break;
2331
2372
  case 'KritzelImage':
2332
- revivedObj = new KritzelImage(this._store).revive(obj);
2373
+ revivedObj = KritzelImage.create(this._store).revive(obj);
2333
2374
  break;
2334
2375
  case 'KritzelSelectionGroup':
2335
- revivedObj = new KritzelSelectionGroup(this._store).revive(obj);
2376
+ revivedObj = KritzelSelectionGroup.create(this._store).revive(obj);
2336
2377
  break;
2337
2378
  case 'KritzelBrushTool':
2338
2379
  revivedObj = new KritzelBrushTool(this._store);
@@ -2367,17 +2408,23 @@ class KritzelReviver {
2367
2408
  }
2368
2409
 
2369
2410
  class KritzelSelectionGroup extends KritzelBaseObject {
2370
- constructor(store) {
2371
- super(store);
2411
+ constructor() {
2412
+ super(...arguments);
2372
2413
  this.__class__ = 'KritzelSelectionGroup';
2373
2414
  this.objects = [];
2374
2415
  this.unchangedObjects = [];
2375
- this.scale = this._store.state.scale;
2376
- this.zIndex = 99999;
2377
2416
  }
2378
2417
  get length() {
2379
2418
  return this.objects.length;
2380
2419
  }
2420
+ static create(store) {
2421
+ const object = new KritzelSelectionGroup();
2422
+ object._store = store;
2423
+ object.id = object.generateId();
2424
+ object.scale = store.state.scale;
2425
+ object.zIndex = 99999;
2426
+ return object;
2427
+ }
2381
2428
  addOrRemove(object) {
2382
2429
  const index = this.objects.findIndex(obj => obj.id === object.id);
2383
2430
  if (index === -1) {
@@ -2462,7 +2509,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
2462
2509
  });
2463
2510
  }
2464
2511
  copy() {
2465
- const selectionGroup = new KritzelSelectionGroup(this._store);
2512
+ const selectionGroup = KritzelSelectionGroup.create(this._store);
2466
2513
  let currentZIndex = this._store.currentZIndex;
2467
2514
  this.objects.forEach(obj => {
2468
2515
  const copiedObject = obj.copy();
@@ -2601,7 +2648,7 @@ class KritzelImageTool extends KritzelBaseTool {
2601
2648
  return { scaledWidth, scaledHeight };
2602
2649
  }
2603
2650
  createKritzelImage(img, width, height) {
2604
- const image = new KritzelImage(this._store);
2651
+ const image = KritzelImage.create(this._store);
2605
2652
  image.src = img.src;
2606
2653
  image.width = width;
2607
2654
  image.height = height;
@@ -2610,7 +2657,7 @@ class KritzelImageTool extends KritzelBaseTool {
2610
2657
  return image;
2611
2658
  }
2612
2659
  addImageToStore(image) {
2613
- const selectionGroup = new KritzelSelectionGroup(this._store);
2660
+ const selectionGroup = KritzelSelectionGroup.create(this._store);
2614
2661
  selectionGroup.addOrRemove(image);
2615
2662
  selectionGroup.selected = true;
2616
2663
  const addImageCommand = new AddObjectCommand(this._store, this, image);
@@ -2765,6 +2812,7 @@ const KritzelEditor = class {
2765
2812
  this.controls = DEFAULT_KRITZEL_CONTROLS;
2766
2813
  this.customSvgIcons = {};
2767
2814
  this.hideControls = false;
2815
+ this.text = null;
2768
2816
  }
2769
2817
  handleTouchStart(event) {
2770
2818
  if (event.cancelable) {
@@ -2774,13 +2822,52 @@ const KritzelEditor = class {
2774
2822
  componentWillLoad() {
2775
2823
  this.registerCustomSvgIcons();
2776
2824
  }
2825
+ addTextObject() {
2826
+ const obj = new KritzelText({
2827
+ translateX: 100,
2828
+ translateY: 100,
2829
+ width: 200,
2830
+ height: 50,
2831
+ value: 'New Text',
2832
+ fontSize: 16,
2833
+ fontFamily: 'Arial',
2834
+ fontColor: '#000000',
2835
+ scale: 1,
2836
+ });
2837
+ this.engineRef.addObject(obj).then((text) => this.text = text);
2838
+ }
2839
+ getTextObject() {
2840
+ var _a;
2841
+ this.engineRef.getObjectById(((_a = this.text) === null || _a === void 0 ? void 0 : _a.id) || '').then((object) => {
2842
+ console.log('Retrieved Text Object:', object);
2843
+ });
2844
+ }
2845
+ updateTextObject() {
2846
+ const updatedText = {
2847
+ value: 'Updated Text',
2848
+ translateX: 150,
2849
+ translateY: 150,
2850
+ rotation: Math.PI / 2
2851
+ };
2852
+ this.engineRef.updateObject(this.text, updatedText)
2853
+ .then((text) => {
2854
+ this.text = text;
2855
+ console.log('Updated Text Object:', text);
2856
+ });
2857
+ }
2858
+ removeTextObject() {
2859
+ this.engineRef.removeObject(this.text).then((text) => {
2860
+ console.log('Text Object removed', text);
2861
+ this.text = null;
2862
+ });
2863
+ }
2777
2864
  registerCustomSvgIcons() {
2778
2865
  for (const [name, svg] of Object.entries(this.customSvgIcons)) {
2779
2866
  KritzelIconRegistry.register(name, svg);
2780
2867
  }
2781
2868
  }
2782
2869
  render() {
2783
- return (index.h(index.Host, { key: '3a2846ec3573702162d669a130420f5b0dca97bd' }, index.h("kritzel-engine", { key: '853d5558e2886c62a3a07109be23145978a0a88f' }), index.h("kritzel-controls", { key: 'eb4d48e6768b4808d3efc43ceb104de72475a4f2', controls: this.controls, style: this.hideControls ? { display: 'none' } : { display: 'flex' } })));
2870
+ return (index.h(index.Host, { key: '3e54e232dd459dcebf3322dcba5ac2f1936ef23a' }, index.h("div", { key: '5c7f90645dfe6010187a709a657b5366d0e6d402', class: "button-panel", style: { position: 'absolute', top: '0', left: '0', zIndex: '10', display: 'flex', flexDirection: 'row' } }, index.h("button", { key: 'b8c22edc7b752f176c8bee4af186692100d09e1c', onClick: () => this.addTextObject() }, "Add Text"), index.h("button", { key: 'd38091f4142392ab4d1ed3e4b26c9e4a38ded104', onClick: () => this.getTextObject() }, "Get Text"), index.h("button", { key: '2f2bacf47603b5fb50a782bf24a8e6b3954d77e2', onClick: () => this.updateTextObject() }, "Update Text"), index.h("button", { key: '5ce49401b19a3730b30a24aaee6474f8ff8ed94f', onClick: () => this.removeTextObject() }, "Remove Text"), index.h("button", { key: '38870ef7c6776a37c742722fc96c37055c9e2ae3', onClick: () => this.engineRef.selectObjects([this.text]) }, "Select Text"), index.h("button", { key: '9a95113343e746cac85a0643a7633bf1030987b5', onClick: () => this.engineRef.selectAllObjectsInViewport() }, "Select All"), index.h("button", { key: 'c2caf8b0f02ad07d9b7f2166ed04e17daff10786', onClick: () => this.engineRef.clearSelection() }, "Clear Selection")), index.h("kritzel-engine", { key: 'c3174bc087b7875744f222d9fd03c68f06ce2522', ref: el => (this.engineRef = el) }), index.h("kritzel-controls", { key: 'b22337b1d0cb2f703f69c197a3c2b50a21a7a9b1', controls: this.controls, style: this.hideControls ? { display: 'none' } : { display: 'flex' } })));
2784
2871
  }
2785
2872
  get host() { return index.getElement(this); }
2786
2873
  };
@@ -3322,9 +3409,6 @@ class KritzelStore {
3322
3409
  }
3323
3410
  }
3324
3411
  }
3325
- clearSelection() {
3326
- this.history.executeCommand(new RemoveSelectionGroupCommand(this, this.state.selectionGroup));
3327
- }
3328
3412
  delete() {
3329
3413
  if (!this.state.selectionGroup) {
3330
3414
  return;
@@ -3401,7 +3485,23 @@ class KritzelStore {
3401
3485
  });
3402
3486
  this.history.executeCommand(new BatchCommand(this, this, decreaseZIndexCommands));
3403
3487
  }
3404
- selectAllInViewport() {
3488
+ selectObjects(objects) {
3489
+ if (objects.length === 0) {
3490
+ return;
3491
+ }
3492
+ const selectionGroup = KritzelSelectionGroup.create(this);
3493
+ objects.forEach(obj => {
3494
+ obj.selected = false;
3495
+ selectionGroup.addOrRemove(obj);
3496
+ });
3497
+ selectionGroup.selected = true;
3498
+ this.state.selectionGroup = selectionGroup;
3499
+ if (objects.length === 1) {
3500
+ selectionGroup.rotation = selectionGroup.objects[0].rotation;
3501
+ }
3502
+ this.history.executeCommand(new AddSelectionGroupCommand(this, this, selectionGroup));
3503
+ }
3504
+ selectAllObjectsInViewport() {
3405
3505
  const objectsInViewport = this._state.objectsOctree
3406
3506
  .query({
3407
3507
  x: -this._state.translateX / this._state.scale,
@@ -3413,17 +3513,29 @@ class KritzelStore {
3413
3513
  })
3414
3514
  .filter(o => !(o instanceof KritzelSelectionGroup) && !(o instanceof KrtizelSelectionBox) && !(o instanceof KritzelContextMenu));
3415
3515
  if (objectsInViewport.length > 0) {
3416
- const selectionGroup = new KritzelSelectionGroup(this);
3516
+ const selectionGroup = KritzelSelectionGroup.create(this);
3417
3517
  objectsInViewport.forEach(obj => {
3418
3518
  obj.selected = false;
3419
3519
  selectionGroup.addOrRemove(obj);
3420
3520
  });
3421
3521
  selectionGroup.selected = true;
3422
3522
  this.state.isSelecting = false;
3523
+ if (objectsInViewport.length === 1) {
3524
+ selectionGroup.rotation = selectionGroup.objects[0].rotation;
3525
+ }
3423
3526
  this.history.executeCommand(new AddSelectionGroupCommand(this, this, selectionGroup));
3424
3527
  this.setState('activeTool', KritzelToolRegistry.getTool('selection'));
3425
3528
  }
3426
3529
  }
3530
+ clearSelection() {
3531
+ const command = new RemoveSelectionGroupCommand(this, this.state.selectionGroup);
3532
+ this.history.executeCommand(command);
3533
+ this.state.selectionGroup = null;
3534
+ this.state.selectionBox = null;
3535
+ this.state.isSelecting = false;
3536
+ this.state.isResizeHandleSelected = false;
3537
+ this.state.isRotationHandleSelected = false;
3538
+ }
3427
3539
  resetActiveText() {
3428
3540
  if (this.state.activeText && this.state.activeText.value === ' ') {
3429
3541
  this.deleteObject(this.state.activeText.id, false);
@@ -3458,15 +3570,6 @@ class KritzelStore {
3458
3570
  }
3459
3571
  return null;
3460
3572
  }
3461
- resetSelection() {
3462
- this.state.selectionGroup = null;
3463
- this.state.selectionBox = null;
3464
- this.state.isSelecting = false;
3465
- this.state.isResizeHandleSelected = false;
3466
- this.state.isRotationHandleSelected = false;
3467
- this._state.objectsOctree.remove(obj => obj instanceof KritzelSelectionGroup);
3468
- this.rerender();
3469
- }
3470
3573
  }
3471
3574
 
3472
3575
  class KritzelKeyHandler extends KritzelBaseHandler {
@@ -3606,7 +3709,7 @@ class KritzelContextMenuHandler extends KritzelBaseHandler {
3606
3709
  }
3607
3710
  const selectedObject = this._store.getObjectFromPointerEvent(event, '.object');
3608
3711
  if (selectedObject && !(selectedObject instanceof KritzelSelectionGroup)) {
3609
- this._store.state.selectionGroup = new KritzelSelectionGroup(this._store);
3712
+ this._store.state.selectionGroup = KritzelSelectionGroup.create(this._store);
3610
3713
  this._store.state.selectionGroup.addOrRemove(selectedObject);
3611
3714
  this._store.state.selectionGroup.selected = true;
3612
3715
  this._store.state.selectionGroup.rotation = selectedObject.rotation;
@@ -3663,7 +3766,7 @@ const KritzelEngine = class {
3663
3766
  this.paste(x, y);
3664
3767
  },
3665
3768
  },
3666
- { label: 'Select All', icon: 'select-all', action: () => this.selectAllInViewport() },
3769
+ { label: 'Select All', icon: 'select-all', action: () => this.selectAllObjectsInViewport() },
3667
3770
  ];
3668
3771
  this.objectContextMenuItems = [
3669
3772
  { label: 'Copy', icon: 'copy', action: () => this.copy() },
@@ -3688,7 +3791,7 @@ const KritzelEngine = class {
3688
3791
  this.keyHandler = new KritzelKeyHandler(this.store);
3689
3792
  this.store.onStateChange('activeTool', (activeTool) => {
3690
3793
  if (!(activeTool instanceof KritzelSelectionTool)) {
3691
- this.store.resetSelection();
3794
+ this.store.clearSelection();
3692
3795
  }
3693
3796
  this.store.state.skipContextMenu = false;
3694
3797
  this.activeToolChange.emit(activeTool);
@@ -3874,9 +3977,6 @@ const KritzelEngine = class {
3874
3977
  async moveToBottom() {
3875
3978
  this.store.moveToBottom();
3876
3979
  }
3877
- async selectAllInViewport() {
3878
- this.store.selectAllInViewport();
3879
- }
3880
3980
  async undo() {
3881
3981
  this.store.history.undo();
3882
3982
  }
@@ -3888,21 +3988,63 @@ const KritzelEngine = class {
3888
3988
  this.store.state.selectionBox = null;
3889
3989
  this.store.state.isSelecting = false;
3890
3990
  }
3991
+ async getObjectById(id) {
3992
+ const object = this.store.objects.find(obj => obj.id === id);
3993
+ return object || null;
3994
+ }
3995
+ async addObject(object) {
3996
+ this.store.deselectAllObjects();
3997
+ object.id = object.generateId();
3998
+ object._store = this.store;
3999
+ object.zIndex = this.store.currentZIndex;
4000
+ const command = new AddObjectCommand(this.store, this, object);
4001
+ this.store.history.executeCommand(command);
4002
+ return object;
4003
+ }
4004
+ async updateObject(object, updatedProperties) {
4005
+ this.store.deselectAllObjects();
4006
+ const command = new UpdateObjectCommand(this.store, this, object, updatedProperties);
4007
+ this.store.history.executeCommand(command);
4008
+ return object;
4009
+ }
4010
+ async removeObject(object) {
4011
+ this.store.deselectAllObjects();
4012
+ const command = new RemoveObjectCommand(this.store, this, object);
4013
+ this.store.history.executeCommand(command);
4014
+ return object;
4015
+ }
4016
+ async selectObjects(objects) {
4017
+ var _a;
4018
+ (_a = this.store.state.activeTool) === null || _a === void 0 ? void 0 : _a.onDeactivate();
4019
+ this.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
4020
+ this.store.deselectAllObjects();
4021
+ this.store.selectObjects(objects);
4022
+ }
4023
+ async selectAllObjectsInViewport() {
4024
+ var _a;
4025
+ (_a = this.store.state.activeTool) === null || _a === void 0 ? void 0 : _a.onDeactivate();
4026
+ this.store.setState('activeTool', KritzelToolRegistry.getTool('selection'));
4027
+ this.store.deselectAllObjects();
4028
+ this.store.selectAllObjectsInViewport();
4029
+ }
4030
+ async clearSelection() {
4031
+ this.store.clearSelection();
4032
+ }
3891
4033
  render() {
3892
4034
  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;
3893
4035
  const computedStyle = window.getComputedStyle(this.host);
3894
4036
  const baseHandleSizePx = computedStyle.getPropertyValue('--kritzel-selection-handle-size').trim() || '6px';
3895
4037
  const baseHandleSize = parseFloat(baseHandleSizePx);
3896
4038
  const baseHandleTouchSize = baseHandleSize * 2 < 14 ? 14 : baseHandleSize;
3897
- 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 :
3898
- _a.translateX), index.h("div", { key: '6c979eb953d01507fd29013d9186618f8f14588b' }, "TranslateY: ", (_b = this.store.state) === null || _b === void 0 ? void 0 :
3899
- _b.translateY), index.h("div", { key: '3be6ea4a5b5eef5d07ddc48aa8ac2e57edbe0887' }, "ViewportWidth: ", (_c = this.store.state) === null || _c === void 0 ? void 0 :
3900
- _c.viewportWidth), index.h("div", { key: '70aed9d3ee1227ba2a4f54a95eda27cb748f4b9f' }, "ViewportHeight: ", (_d = this.store.state) === null || _d === void 0 ? void 0 :
3901
- _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 :
3902
- _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 :
3903
- _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 :
3904
- _m.cursorX), index.h("div", { key: 'b3bdd26eb7d5ac0fdfda0f13b7d4cde9f3712954' }, "CursorY: ", (_o = this.store.state) === null || _o === void 0 ? void 0 :
3905
- _o.cursorY)), index.h("div", { key: '186591f736514dcdb96f22d5ab3d14347a4c51ae', class: "origin", style: {
4039
+ return (index.h(index.Host, { key: '0c20c50e3ad8ac088902881c35c406ad2f0787d5' }, index.h("div", { key: 'a89d76b5f6a10cbc54c40d034a08b3ceb99be063', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, index.h("div", { key: '94345439d02de7d005bb92abb377b7ebeb91fcdb' }, "TranslateX: ", (_a = this.store.state) === null || _a === void 0 ? void 0 :
4040
+ _a.translateX), index.h("div", { key: '1e2e3ffc6ad760f089f4d02d94dfeb09bb5725cb' }, "TranslateY: ", (_b = this.store.state) === null || _b === void 0 ? void 0 :
4041
+ _b.translateY), index.h("div", { key: '36d6170934959e19b95326d84b32c9abe2385edc' }, "ViewportWidth: ", (_c = this.store.state) === null || _c === void 0 ? void 0 :
4042
+ _c.viewportWidth), index.h("div", { key: '57e5d37af3fd1f6ad24ea89ca525a6f0bc8e014b' }, "ViewportHeight: ", (_d = this.store.state) === null || _d === void 0 ? void 0 :
4043
+ _d.viewportHeight), index.h("div", { key: '8281e788e350db75bbf1fe12dd8c17b91b429135' }, "ObjectsInViewport. ", this.store.objects.length), index.h("div", { key: '9f42aad27d0a266cbc720d1e13292bea5be84770' }, "Scale: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
4044
+ _e.scale), index.h("div", { key: '76848c1a0eb2379ee0d0314523a540dbeb3d0697' }, "ActiveTool: ", (_g = (_f = this.store.state) === null || _f === void 0 ? void 0 : _f.activeTool) === null || _g === void 0 ? void 0 :
4045
+ _g.name), index.h("div", { key: '77f8ff0b660227f7b25c12b74d70946bc1f66e78' }, "HasViewportChanged: ", ((_h = this.store.state) === null || _h === void 0 ? void 0 : _h.hasViewportChanged) ? 'true' : 'false'), index.h("div", { key: '229e94fee90a847a853419ae61bc131221313fc6' }, "IsEnabled: ", ((_j = this.store.state) === null || _j === void 0 ? void 0 : _j.isEnabled) ? 'true' : 'false'), index.h("div", { key: 'f31784916ab54f9a5eda02cffebe55a1f9aaa51f' }, "IsScaling: ", ((_k = this.store.state) === null || _k === void 0 ? void 0 : _k.isScaling) ? 'true' : 'false'), index.h("div", { key: '4611a6dd48f1033d42fc3b7813634cbc16bf9b3b' }, "IsPanning: ", ((_l = this.store.state) === null || _l === void 0 ? void 0 : _l.isPanning) ? 'true' : 'false'), index.h("div", { key: '14388f4b5cca60d8a2d8d474f941b53a78ad327d' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), index.h("div", { key: '2f3dcd488855413e392f56718af640e369d99fae' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), index.h("div", { key: '2cd0e44a1d13eaf5d3a942f75a727a074bf37622' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), index.h("div", { key: '99d51cf25e02c9d06865bf1f847c704ad8a32110' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), index.h("div", { key: '87ab9908a318b238ad1fb00e91dba9c485038443' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), index.h("div", { key: '20f291bf45ba06b4107002e288b93f8f61ef9520' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), index.h("div", { key: '52244f4f0d368e7bc183eed4c65abe536d134f44' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), index.h("div", { key: '641edd47e7bccc7514ed6aeac3ecbead95568dde' }, "CursorX: ", (_m = this.store.state) === null || _m === void 0 ? void 0 :
4046
+ _m.cursorX), index.h("div", { key: 'bf0826a9cbc800ca0f13d4de4da7dbb21241498f' }, "CursorY: ", (_o = this.store.state) === null || _o === void 0 ? void 0 :
4047
+ _o.cursorY)), index.h("div", { key: '5659cb254f57b79ca8e33ab11a8087d5ca5088dc', class: "origin", style: {
3906
4048
  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})`,
3907
4049
  } }, (_t = this.store.objects) === null || _t === void 0 ? void 0 :
3908
4050
  _t.map(object => {
@@ -3999,7 +4141,7 @@ const KritzelEngine = class {
3999
4141
  fill: 'transparent',
4000
4142
  cursor: 'grab',
4001
4143
  }, visibility: object.selected && !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.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)))))));
4002
- }), index.h("svg", { key: '9f862215ce2de4cc0745942bc946897f5f5e24b7', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
4144
+ }), index.h("svg", { key: '05a35ebb17312d00a4065dc6dc76f3a93a72eff4', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
4003
4145
  height: (_u = this.store.state.currentPath) === null || _u === void 0 ? void 0 : _u.height.toString(),
4004
4146
  width: (_v = this.store.state.currentPath) === null || _v === void 0 ? void 0 : _v.width.toString(),
4005
4147
  left: '0',
@@ -4009,12 +4151,12 @@ const KritzelEngine = class {
4009
4151
  transform: (_x = this.store.state.currentPath) === null || _x === void 0 ? void 0 : _x.transformationMatrix,
4010
4152
  transformOrigin: 'top left',
4011
4153
  overflow: 'visible',
4012
- }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.h("path", { key: 'e1f0ea5ee56c8fb753438c978750151c688e9330', 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: '89184b62326fcfde61ee4922ec5d640b16a191a7', ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, style: {
4154
+ }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.h("path", { key: 'cb232e2697ce6ede2e4d9ed2e1b433ccde3961b5', 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: 'e41b88a78bbd25f692fbdba88fda80993055a078', ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, style: {
4013
4155
  position: 'fixed',
4014
4156
  left: `${this.store.state.contextMenuX}px`,
4015
4157
  top: `${this.store.state.contextMenuY}px`,
4016
4158
  zIndex: '10000',
4017
- }, 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: '8797da3afce7d97e0f94ec9f90522b9ad35bb71b' })));
4159
+ }, 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: '1d96c0d7fa94ddcf5820fd76fbaf69c54b1face2' })));
4018
4160
  }
4019
4161
  get host() { return index.getElement(this); }
4020
4162
  };
@@ -4030,7 +4172,7 @@ const KritzelFont = class {
4030
4172
  this.color = '#000000';
4031
4173
  }
4032
4174
  render() {
4033
- return (index.h(index.Host, { key: '6f25832892d8042464751360cc9e2307193f5407' }, index.h("div", { key: '3d2ec48a6a3b3e347c8cc1ab6f129bfacd984776', class: "font-preview", style: {
4175
+ return (index.h(index.Host, { key: 'b4ebef665dacaca67e0a7574a15eae851e40ba3d' }, index.h("div", { key: '3af8906e1092fe333daf52da9e0da7a764fc47e3', class: "font-preview", style: {
4034
4176
  fontFamily: this.fontFamily,
4035
4177
  fontSize: `${this.size}px`,
4036
4178
  color: this.color
@@ -4075,7 +4217,7 @@ const KritzelFontFamily = class {
4075
4217
  label: option.label,
4076
4218
  style: { fontFamily: option.value },
4077
4219
  }));
4078
- return (index.h(index.Host, { key: '7ab677468a605e6b23466b73c1c93e258cf85c1a' }, index.h("kritzel-dropdown", { key: '5c2528687d1e5068d958b9f663cb0ceb46a2794e', options: dropdownOptions, value: this.selectedFontFamily, onValueChanged: this.handleDropdownValueChange, selectStyles: { fontFamily: this.selectedFontFamily } }, index.h("button", { key: 'ab422c954569515f636031ddaaea2ec5f13a7bdc', class: "font-style-button", slot: "suffix" }, "B"), index.h("button", { key: '884116c86f3d710df58f82c10294f66aae95829e', class: "font-style-button italic-text", slot: "suffix" }, "I"))));
4220
+ return (index.h(index.Host, { key: 'f420ff18156d54bfc475148a7d9aae0f1441408c' }, index.h("kritzel-dropdown", { key: '6b54fb8265a0eb59a6a681c6a2b7a95fb222671c', options: dropdownOptions, value: this.selectedFontFamily, onValueChanged: this.handleDropdownValueChange, selectStyles: { fontFamily: this.selectedFontFamily } }, index.h("button", { key: 'b853c75a425c7baafa7a8e749c90c0b08884375c', class: "font-style-button", slot: "suffix" }, "B"), index.h("button", { key: '68dea850dd1d1f38db727d8be0eec3481890c571', class: "font-style-button italic-text", slot: "suffix" }, "I"))));
4079
4221
  }
4080
4222
  };
4081
4223
  KritzelFontFamily.style = kritzelFontFamilyCss;
@@ -4095,7 +4237,7 @@ const KritzelFontSize = class {
4095
4237
  this.sizeChange.emit(size);
4096
4238
  }
4097
4239
  render() {
4098
- return (index.h(index.Host, { key: '20ad8f22858732c62838693c7b135dc92dbc5910' }, this.sizes.map(size => (index.h("div", { class: {
4240
+ return (index.h(index.Host, { key: 'daf7a1f16f96dfcbaaaa2ba43b77c99565c9893d' }, this.sizes.map(size => (index.h("div", { class: {
4099
4241
  'size-container': true,
4100
4242
  'selected': this.selectedSize === size,
4101
4243
  }, onClick: () => this.handleSizeClick(size) }, index.h("kritzel-font", { fontFamily: this.fontFamily, size: size }))))));
@@ -4139,7 +4281,7 @@ const KritzelStrokeSize = class {
4139
4281
  this.sizeChange.emit(size);
4140
4282
  }
4141
4283
  render() {
4142
- return (index.h(index.Host, { key: '2e2a4d38920e25e1e60788deabe4912b510d0b10' }, this.sizes.map(size => (index.h("div", { class: {
4284
+ return (index.h(index.Host, { key: 'ee73f8679fa8e1f99bc01f31fb5cd8935fa597a8' }, this.sizes.map(size => (index.h("div", { class: {
4143
4285
  'size-container': true,
4144
4286
  'selected': this.selectedSize === size,
4145
4287
  }, onClick: () => this.handleSizeClick(size) }, index.h("kritzel-color", { value: '#000000', size: size }))))));
@@ -4188,23 +4330,23 @@ const KritzelTooltip = class {
4188
4330
  }
4189
4331
  }
4190
4332
  render() {
4191
- return (index.h(index.Host, { key: '30db4852719464fcb9c6964c34992e87a364caa3', style: {
4333
+ return (index.h(index.Host, { key: 'd0ec1b12583a5e69a022ed4538060a0fe609b4fc', style: {
4192
4334
  position: 'fixed',
4193
4335
  zIndex: '9999',
4194
4336
  transition: 'opacity 0.3s ease-in-out, transform 0.3s ease-in-out',
4195
4337
  visibility: this.isVisible ? 'visible' : 'hidden',
4196
4338
  left: !this.isMobileView ? `${this.positionX}px` : '50%',
4197
4339
  marginBottom: `${this.offsetY + this.arrowSize}px`,
4198
- } }, index.h("div", { key: '3f270c9bdb1a5282f67034618123a5d61f9f8b40', class: "tooltip-content", onClick: event => event.stopPropagation() }, index.h("slot", { key: 'bd4a11782eb2e263f21a8ab57ad64eb4fd4fe7ec' }), index.h("div", { key: '4ede173979b8e0335fb3a012b662a694dc09ea28', class: "tooltip-arrow-wrapper", style: {
4340
+ } }, index.h("div", { key: 'f4edf3ee17d5074aff60808dada77ddb601ea33d', class: "tooltip-content", onClick: event => event.stopPropagation() }, index.h("slot", { key: '947ea9110ccb0ed4a02684d7a51b04da8df6c909' }), index.h("div", { key: 'bffda8ba16f67e54cb581f96f355b5ddefca5792', class: "tooltip-arrow-wrapper", style: {
4199
4341
  position: 'fixed',
4200
4342
  left: this.arrowOffset,
4201
4343
  bottom: `-${this.arrowSize * 2}px`,
4202
- } }, index.h("div", { key: 'c96993f91dde76cc5feb0c42dd4e599837121bf7', class: "tooltip-arrow", style: {
4344
+ } }, index.h("div", { key: '76d33735507f0164dc68173f02c3ca2d45070744', class: "tooltip-arrow", style: {
4203
4345
  borderLeft: `${this.arrowSize}px solid transparent`,
4204
4346
  borderRight: `${this.arrowSize}px solid transparent`,
4205
4347
  borderTop: `${this.arrowSize}px solid var(--kritzel-controls-tooltip-background-color, #ffffff)`,
4206
4348
  filter: 'drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2))',
4207
- } }), index.h("div", { key: '888f9d44f58969b3f50db04f1cd3d49008872b55', class: "tooltip-arrow-rect", style: {
4349
+ } }), index.h("div", { key: '8f1913c9ed12f8a3171963cfb0360241fab21302', class: "tooltip-arrow-rect", style: {
4208
4350
  position: 'relative',
4209
4351
  width: `${this.arrowSize * 2}px`,
4210
4352
  height: `${this.arrowSize}px`,
@@ -4238,7 +4380,7 @@ const KritzelUtilityPanel = class {
4238
4380
  this.redo.emit();
4239
4381
  }
4240
4382
  render() {
4241
- return (index.h(index.Host, { key: '496ed78323c9899ad363e7f7732a1464d99e1b3b' }, index.h("button", { key: '7b6b9cd238a8d254f032d5752f184d567e9a3096', class: "utility-button", onClick: event => this.handleUndo(event) }, index.h("kritzel-icon", { key: '8ac19f36c6b82f7cc4a0249e60cf429f75c09218', name: "undo" })), index.h("button", { key: '1164727510a968356042507c1e302b85a135baf8', class: "utility-button", onClick: event => this.handleRedo(event) }, index.h("kritzel-icon", { key: '1c6cc414d5841a06853f99316eee7a0a609d5c92', name: "redo" })), index.h("div", { key: 'e6f3342569b1c6b5a6b267cc215bc8e5d259e302', class: "utility-separator" }), index.h("button", { key: '0aa486a543df924c224f3637857cdcdb06f995ea', class: "utility-button" }, index.h("kritzel-icon", { key: '9ee324e03f5df5297916549743539f7f19950768', name: "delete", onClick: () => this.delete.emit() }))));
4383
+ return (index.h(index.Host, { key: 'c295ba2931094213a276ca2ccf002fea4a17a9a5' }, index.h("button", { key: 'ad636f88a4fb8540e0a5607b505fa157257a0cd4', class: "utility-button", onClick: event => this.handleUndo(event) }, index.h("kritzel-icon", { key: '9a6ebf66cafddeb5fd191ffe374831ad583598ae', name: "undo" })), index.h("button", { key: '334cb5c195b6da4992f08964f31f412172f3904d', class: "utility-button", onClick: event => this.handleRedo(event) }, index.h("kritzel-icon", { key: '5f3528d7cfdee42ed8203c8cb09f54550ab57810', name: "redo" })), index.h("div", { key: 'f859dcfd8a576323a2d52fc1bf3787b8ac589532', class: "utility-separator" }), index.h("button", { key: '30e28fc71e12caca42effe63fc033f84b9b07d02', class: "utility-button" }, index.h("kritzel-icon", { key: 'f448f23126e2d29a1be44d88e39c7dd6d5927ca2', name: "delete", onClick: () => this.delete.emit() }))));
4242
4384
  }
4243
4385
  };
4244
4386
  KritzelUtilityPanel.style = kritzelUtilityPanelCss;