kritzel-stencil 0.0.128 → 0.0.130

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 (154) hide show
  1. package/dist/cjs/index-CUSIflVf.js +2 -2
  2. package/dist/cjs/{index-C7Read21.js → index-CfXjPLHb.js} +46 -28
  3. package/dist/cjs/index-CfXjPLHb.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +1 -1
  5. package/dist/cjs/{kritzel-brush-style_22.cjs.entry.js → kritzel-brush-style_23.cjs.entry.js} +502 -438
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/stencil.cjs.js +1 -1
  8. package/dist/collection/classes/commands/add-object.command.js +2 -2
  9. package/dist/collection/classes/commands/add-object.command.js.map +1 -1
  10. package/dist/collection/classes/commands/add-selection-group.command.js +3 -3
  11. package/dist/collection/classes/commands/add-selection-group.command.js.map +1 -1
  12. package/dist/collection/classes/commands/remove-object.command.js +4 -4
  13. package/dist/collection/classes/commands/remove-object.command.js.map +1 -1
  14. package/dist/collection/classes/commands/remove-selection-group.command.js +2 -2
  15. package/dist/collection/classes/commands/remove-selection-group.command.js.map +1 -1
  16. package/dist/collection/classes/commands/rotate-selection-group.command.js +2 -2
  17. package/dist/collection/classes/commands/rotate-selection-group.command.js.map +1 -1
  18. package/dist/collection/classes/handlers/selection.handler.js +5 -5
  19. package/dist/collection/classes/handlers/selection.handler.js.map +1 -1
  20. package/dist/collection/classes/objects/base-object.class.js +1 -1
  21. package/dist/collection/classes/objects/base-object.class.js.map +1 -1
  22. package/dist/collection/classes/objects/path.class.js +1 -1
  23. package/dist/collection/classes/objects/path.class.js.map +1 -1
  24. package/dist/collection/classes/objects/selection-group.class.js +6 -6
  25. package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
  26. package/dist/collection/classes/store.class.js +9 -22
  27. package/dist/collection/classes/store.class.js.map +1 -1
  28. package/dist/collection/classes/structures/object-map.structure.js +42 -0
  29. package/dist/collection/classes/structures/object-map.structure.js.map +1 -0
  30. package/dist/collection/collection-manifest.json +1 -0
  31. package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +7 -0
  32. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +12 -2
  33. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js.map +1 -1
  34. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +17 -17
  35. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
  36. package/dist/collection/components/shared/kritzel-menu/kritzel-menu.css +15 -155
  37. package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +167 -177
  38. package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js.map +1 -1
  39. package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.css +129 -0
  40. package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +261 -0
  41. package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js.map +1 -0
  42. package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +160 -43
  43. package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js.map +1 -1
  44. package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.css +83 -74
  45. package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +142 -118
  46. package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js.map +1 -1
  47. package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
  48. package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +4 -4
  49. package/dist/collection/components/ui/kritzel-control-brush-config/kritzel-control-brush-config.js +2 -2
  50. package/dist/collection/components/ui/kritzel-control-text-config/kritzel-control-text-config.js +2 -2
  51. package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +5 -8
  52. package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +3 -3
  53. package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
  54. package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.js +110 -88
  55. package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.js.map +1 -1
  56. package/dist/collection/configs/default-engine-state.js +1 -1
  57. package/dist/collection/configs/default-engine-state.js.map +1 -1
  58. package/dist/collection/helpers/keyboard.helper.js +18 -0
  59. package/dist/collection/helpers/keyboard.helper.js.map +1 -1
  60. package/dist/collection/index.js +1 -0
  61. package/dist/collection/index.js.map +1 -1
  62. package/dist/collection/interfaces/engine-state.interface.js.map +1 -1
  63. package/dist/collection/interfaces/menu-item.interface.js.map +1 -1
  64. package/dist/components/index.d.ts +2 -0
  65. package/dist/components/index.js +3 -2
  66. package/dist/components/index.js.map +1 -1
  67. package/dist/components/kritzel-control-brush-config.js +1 -1
  68. package/dist/components/kritzel-control-text-config.js +1 -1
  69. package/dist/components/kritzel-controls.js +1 -1
  70. package/dist/components/kritzel-editor.js +53 -39
  71. package/dist/components/kritzel-editor.js.map +1 -1
  72. package/dist/components/kritzel-engine.js +1 -1
  73. package/dist/components/kritzel-menu-item.d.ts +11 -0
  74. package/dist/components/kritzel-menu-item.js +9 -0
  75. package/dist/components/kritzel-menu-item.js.map +1 -0
  76. package/dist/components/kritzel-menu.js +1 -1
  77. package/dist/components/kritzel-portal.js +1 -1
  78. package/dist/components/kritzel-split-button.js +1 -1
  79. package/dist/components/kritzel-stroke-size.js +1 -1
  80. package/dist/components/kritzel-tooltip.js +1 -1
  81. package/dist/components/kritzel-utility-panel.js +1 -1
  82. package/dist/components/kritzel-workspace-manager.js +1 -1
  83. package/dist/components/{p-jG1e48OE.js → p-26poIWa_.js} +6 -6
  84. package/dist/components/{p-jG1e48OE.js.map → p-26poIWa_.js.map} +1 -1
  85. package/dist/components/{p-rQeWFfPG.js → p-BGccckxP.js} +3 -3
  86. package/dist/components/{p-rQeWFfPG.js.map → p-BGccckxP.js.map} +1 -1
  87. package/dist/components/p-BcQWRzsB.js +183 -0
  88. package/dist/components/p-BcQWRzsB.js.map +1 -0
  89. package/dist/components/p-C-DqsDXz.js +238 -0
  90. package/dist/components/p-C-DqsDXz.js.map +1 -0
  91. package/dist/components/{p-B7VrEdgP.js → p-C9-70hiF.js} +25 -7
  92. package/dist/components/p-C9-70hiF.js.map +1 -0
  93. package/dist/components/p-CJKA5zIE.js +10 -0
  94. package/dist/components/p-CJKA5zIE.js.map +1 -0
  95. package/dist/components/p-CaPdvVd4.js +127 -0
  96. package/dist/components/p-CaPdvVd4.js.map +1 -0
  97. package/dist/components/{p-a7KmQzo4.js → p-Cb1IUD_g.js} +5 -5
  98. package/dist/components/{p-a7KmQzo4.js.map → p-Cb1IUD_g.js.map} +1 -1
  99. package/dist/components/{p-BaKb8ZLg.js → p-Crni2OI4.js} +4 -4
  100. package/dist/components/{p-BaKb8ZLg.js.map → p-Crni2OI4.js.map} +1 -1
  101. package/dist/components/{p-BB22cVkU.js → p-D_Uh-xv_.js} +13 -18
  102. package/dist/components/p-D_Uh-xv_.js.map +1 -0
  103. package/dist/components/{p-BzSz74Ci.js → p-fyfT6A5K.js} +3 -3
  104. package/dist/components/{p-BzSz74Ci.js.map → p-fyfT6A5K.js.map} +1 -1
  105. package/dist/components/{p-D-zg05gA.js → p-jGaWxggY.js} +93 -179
  106. package/dist/components/p-jGaWxggY.js.map +1 -0
  107. package/dist/components/p-jpGLgpoq.js +237 -0
  108. package/dist/components/p-jpGLgpoq.js.map +1 -0
  109. package/dist/esm/{index-J4NpPimy.js → index-DqqxAoZI.js} +47 -29
  110. package/dist/esm/index-DqqxAoZI.js.map +1 -0
  111. package/dist/esm/index-NiIEUDzj.js +2 -2
  112. package/dist/esm/index.js +1 -1
  113. package/dist/esm/{kritzel-brush-style_22.entry.js → kritzel-brush-style_23.entry.js} +502 -439
  114. package/dist/esm/loader.js +1 -1
  115. package/dist/esm/stencil.js +1 -1
  116. package/dist/stencil/index.esm.js +1 -1
  117. package/dist/stencil/p-DqqxAoZI.js +2 -0
  118. package/dist/stencil/p-DqqxAoZI.js.map +1 -0
  119. package/dist/stencil/p-eebdbf65.entry.js +2 -0
  120. package/dist/stencil/p-eebdbf65.entry.js.map +1 -0
  121. package/dist/stencil/stencil.esm.js +1 -1
  122. package/dist/types/classes/structures/object-map.structure.d.ts +11 -0
  123. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +3 -0
  124. package/dist/types/components/shared/kritzel-menu/kritzel-menu.d.ts +18 -18
  125. package/dist/types/components/shared/kritzel-menu-item/kritzel-menu-item.d.ts +26 -0
  126. package/dist/types/components/shared/kritzel-portal/kritzel-portal.d.ts +15 -10
  127. package/dist/types/components/shared/kritzel-split-button/kritzel-split-button.d.ts +25 -16
  128. package/dist/types/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.d.ts +18 -14
  129. package/dist/types/components.d.ts +90 -61
  130. package/dist/types/helpers/keyboard.helper.d.ts +1 -0
  131. package/dist/types/index.d.ts +1 -0
  132. package/dist/types/interfaces/engine-state.interface.d.ts +2 -2
  133. package/dist/types/interfaces/menu-item.interface.d.ts +21 -7
  134. package/package.json +1 -1
  135. package/dist/cjs/index-C7Read21.js.map +0 -1
  136. package/dist/collection/classes/structures/octree.structure.js +0 -115
  137. package/dist/collection/classes/structures/octree.structure.js.map +0 -1
  138. package/dist/components/p-B7VrEdgP.js.map +0 -1
  139. package/dist/components/p-BB22cVkU.js.map +0 -1
  140. package/dist/components/p-BmJbJwkH.js +0 -167
  141. package/dist/components/p-BmJbJwkH.js.map +0 -1
  142. package/dist/components/p-D-zg05gA.js.map +0 -1
  143. package/dist/components/p-DV4ERZv5.js +0 -112
  144. package/dist/components/p-DV4ERZv5.js.map +0 -1
  145. package/dist/components/p-hSuNJiIq.js +0 -152
  146. package/dist/components/p-hSuNJiIq.js.map +0 -1
  147. package/dist/components/p-sQmW5NRu.js +0 -156
  148. package/dist/components/p-sQmW5NRu.js.map +0 -1
  149. package/dist/esm/index-J4NpPimy.js.map +0 -1
  150. package/dist/stencil/p-4a0009e7.entry.js +0 -2
  151. package/dist/stencil/p-4a0009e7.entry.js.map +0 -1
  152. package/dist/stencil/p-J4NpPimy.js +0 -2
  153. package/dist/stencil/p-J4NpPimy.js.map +0 -1
  154. package/dist/types/classes/structures/octree.structure.d.ts +0 -18
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-BqrTPNyu.js';
2
2
  import { K as KritzelMouseButton } from './p-D8W6LE-c.js';
3
- import { d as KritzelBaseObject, e as KritzelBaseCommand, f as KritzelBaseTool, g as KritzelEventHelper, U as UpdateObjectCommand, c as KritzelTextTool, b as KritzelBrushTool, K as KritzelText, a as KritzelPath, A as AddObjectCommand, h as KritzelToolRegistry, i as KritzelKeyboardHelper } from './p-B7VrEdgP.js';
3
+ import { e as KritzelBaseObject, f as KritzelBaseCommand, g as KritzelBaseTool, h as KritzelEventHelper, U as UpdateObjectCommand, c as KritzelTextTool, b as KritzelBrushTool, K as KritzelText, a as KritzelPath, A as AddObjectCommand, i as KritzelToolRegistry, d as KritzelKeyboardHelper } from './p-C9-70hiF.js';
4
4
  import { O as ObjectHelper } from './p-Bb6od8He.js';
5
5
  import { K as KritzelContextMenu, d as defineCustomElement$3 } from './p-BU2q3PRS.js';
6
6
  import { K as KritzelWorkspace } from './p-BeVv4o5c.js';
@@ -131,13 +131,13 @@ class RemoveObjectCommand extends KritzelBaseCommand {
131
131
  this.object = object;
132
132
  }
133
133
  execute() {
134
- this._store.state.objectsOctree.remove(object => object.id === this.object.id);
135
- this._store.state.objectsOctree.filter(object => object instanceof KritzelCustomElement).forEach(object => object.remount());
134
+ this._store.state.objectsMap.remove(object => object.id === this.object.id);
135
+ this._store.state.objectsMap.filter(object => object instanceof KritzelCustomElement).forEach(object => object.remount());
136
136
  this._store.deleteObjectFromDatabase(this.object.id);
137
137
  }
138
138
  undo() {
139
- this._store.state.objectsOctree.insert(this.object);
140
- this._store.state.objectsOctree.filter(object => object instanceof KritzelCustomElement).forEach(object => object.remount());
139
+ this._store.state.objectsMap.insert(this.object);
140
+ this._store.state.objectsMap.filter(object => object instanceof KritzelCustomElement).forEach(object => object.remount());
141
141
  this._store.addObjectToDatabase(ObjectHelper.clone(this.object));
142
142
  }
143
143
  }
@@ -230,12 +230,12 @@ class RemoveSelectionGroupCommand extends KritzelBaseCommand {
230
230
  this.previousSelectionGroup = this._store.state.selectionGroup;
231
231
  }
232
232
  execute() {
233
- this._store.state.objectsOctree.remove(object => { var _a; return object.id === ((_a = this.previousSelectionGroup) === null || _a === void 0 ? void 0 : _a.id); });
233
+ this._store.state.objectsMap.remove(object => { var _a; return object.id === ((_a = this.previousSelectionGroup) === null || _a === void 0 ? void 0 : _a.id); });
234
234
  this._store.state.selectionGroup = null;
235
235
  }
236
236
  undo() {
237
237
  if (this.previousSelectionGroup) {
238
- this._store.state.objectsOctree.insert(this.previousSelectionGroup);
238
+ this._store.state.objectsMap.insert(this.previousSelectionGroup);
239
239
  this._store.state.selectionGroup = this.previousSelectionGroup;
240
240
  }
241
241
  }
@@ -554,14 +554,14 @@ class RotateSelectionGroupCommand extends KritzelBaseCommand {
554
554
  this._store.state.selectionGroup = this.selectionGroup;
555
555
  this._store.state.selectionGroup.rotate(this.rotation);
556
556
  this._store.state.selectionGroup.objects.forEach(object => {
557
- this._store.state.objectsOctree.update(object);
557
+ this._store.state.objectsMap.update(object);
558
558
  });
559
559
  }
560
560
  undo() {
561
561
  this._store.state.selectionGroup = this.selectionGroup;
562
562
  this._store.state.selectionGroup.rotate(this.rotation - this.initialRotation);
563
563
  this._store.state.selectionGroup.objects.forEach(object => {
564
- this._store.state.objectsOctree.update(object);
564
+ this._store.state.objectsMap.update(object);
565
565
  });
566
566
  }
567
567
  }
@@ -707,13 +707,13 @@ class AddSelectionGroupCommand extends KritzelBaseCommand {
707
707
  this.selectionGroup = selectionGroup;
708
708
  }
709
709
  execute() {
710
- this._store.state.objectsOctree.remove(object => object instanceof KrtizelSelectionBox);
711
- this._store.state.objectsOctree.insert(this.selectionGroup);
710
+ this._store.state.objectsMap.remove(object => object instanceof KrtizelSelectionBox);
711
+ this._store.state.objectsMap.insert(this.selectionGroup);
712
712
  this._store.state.selectionGroup = this.selectionGroup;
713
713
  this._store.state.selectionBox = null;
714
714
  }
715
715
  undo() {
716
- this._store.state.objectsOctree.remove(object => object.id === this.selectionGroup.id);
716
+ this._store.state.objectsMap.remove(object => object.id === this.selectionGroup.id);
717
717
  this._store.state.selectionGroup = null;
718
718
  this._store.state.selectionBox = null;
719
719
  }
@@ -805,7 +805,7 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
805
805
  removeSelectionBox() {
806
806
  this._store.state.selectionBox = null;
807
807
  this._store.state.isSelecting = false;
808
- this._store.state.objectsOctree.remove(o => o instanceof KrtizelSelectionBox);
808
+ this._store.state.objectsMap.remove(o => o instanceof KrtizelSelectionBox);
809
809
  this._store.rerender();
810
810
  }
811
811
  startMouseSelection(event) {
@@ -820,8 +820,8 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
820
820
  this._store.state.selectionGroup = null;
821
821
  this._store.state.selectionBox = selectionBox;
822
822
  this._store.state.isSelecting = true;
823
- this._store.state.objectsOctree.remove(o => o instanceof KrtizelSelectionBox || o instanceof KritzelSelectionGroup);
824
- this._store.state.objectsOctree.insert(selectionBox);
823
+ this._store.state.objectsMap.remove(o => o instanceof KrtizelSelectionBox || o instanceof KritzelSelectionGroup);
824
+ this._store.state.objectsMap.insert(selectionBox);
825
825
  }
826
826
  startTouchSelection() {
827
827
  const activePointers = Array.from(this._store.state.pointers.values());
@@ -842,8 +842,8 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
842
842
  this._store.state.selectionGroup = null;
843
843
  this._store.state.selectionBox = selectionBox;
844
844
  this._store.state.isSelecting = true;
845
- this._store.state.objectsOctree.remove(o => o instanceof KrtizelSelectionBox || o instanceof KritzelSelectionGroup);
846
- this._store.state.objectsOctree.insert(selectionBox);
845
+ this._store.state.objectsMap.remove(o => o instanceof KrtizelSelectionBox || o instanceof KritzelSelectionGroup);
846
+ this._store.state.objectsMap.insert(selectionBox);
847
847
  }
848
848
  updateMouseSelection(event) {
849
849
  let clientX, clientY;
@@ -1180,17 +1180,17 @@ class KritzelSelectionGroup extends KritzelBaseObject {
1180
1180
  });
1181
1181
  this.translateX = x;
1182
1182
  this.translateY = y;
1183
- this._store.state.objectsOctree.update(this);
1183
+ this._store.state.objectsMap.update(this);
1184
1184
  }
1185
1185
  move(startX, startY, endX, endY) {
1186
1186
  const deltaX = (startX - endX) / this._store.state.scale;
1187
1187
  const deltaY = (startY - endY) / this._store.state.scale;
1188
1188
  this.translateX += deltaX;
1189
1189
  this.translateY += deltaY;
1190
- this._store.state.objectsOctree.update(this);
1190
+ this._store.state.objectsMap.update(this);
1191
1191
  this.objects.forEach(obj => {
1192
1192
  obj.move(startX, startY, endX, endY);
1193
- this._store.state.objectsOctree.update(obj);
1193
+ this._store.state.objectsMap.update(obj);
1194
1194
  });
1195
1195
  this.unchangedObjects.forEach(obj => {
1196
1196
  obj.translateX += deltaX;
@@ -1208,7 +1208,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
1208
1208
  const updatedX = child.translateX + deltaX + (child.translateX - this.translateX) * (widthScaleFactor - 1);
1209
1209
  const updatedY = child.translateY + deltaY + (child.translateY - this.translateY) * (heightScaleFactor - 1);
1210
1210
  child.resize(updatedX, updatedY, updatedWidth, updatedHeight);
1211
- this._store.state.objectsOctree.update(child);
1211
+ this._store.state.objectsMap.update(child);
1212
1212
  });
1213
1213
  this.refreshObjectDimensions();
1214
1214
  this.unchangedObjects = ObjectHelper.clone(this.objects);
@@ -1229,7 +1229,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
1229
1229
  child.translateX = centerX + rotatedX - child.totalWidth / 2 / child.scale;
1230
1230
  child.translateY = centerY + rotatedY - child.totalHeight / 2 / child.scale;
1231
1231
  child.rotate(this.objects.length === 1 ? value : value + unchangedChild.rotation);
1232
- this._store.state.objectsOctree.update(child);
1232
+ this._store.state.objectsMap.update(child);
1233
1233
  });
1234
1234
  }
1235
1235
  copy() {
@@ -1269,7 +1269,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
1269
1269
  this.width = (this.maxX - this.minX - this.padding) * this.scale;
1270
1270
  this.height = (this.maxY - this.minY - this.padding) * this.scale;
1271
1271
  }
1272
- this._store.state.objectsOctree.update(this);
1272
+ this._store.state.objectsMap.update(this);
1273
1273
  }
1274
1274
  getOffsetXToCenter(obj) {
1275
1275
  const objCenterX = obj.translateX + obj.totalWidth / obj.scale / 2;
@@ -1683,128 +1683,13 @@ class KritzelHistory {
1683
1683
  }
1684
1684
  }
1685
1685
 
1686
- class KritzelOctree {
1687
- constructor(bounds, capacity = 8) {
1688
- this.objects = [];
1689
- this.children = null;
1690
- this.bounds = bounds;
1691
- this.capacity = capacity;
1692
- }
1693
- reset() {
1694
- this.objects = [];
1695
- this.children = null;
1696
- }
1697
- insert(object) {
1698
- if (!this.intersects(object.rotatedBoundingBox, this.bounds)) {
1699
- return false;
1700
- }
1701
- if (this.objects.length < this.capacity && this.children === null) {
1702
- this.objects.push(object);
1703
- return true;
1704
- }
1705
- if (this.children === null) {
1706
- this.subdivide();
1707
- }
1708
- for (const child of this.children) {
1709
- if (child.insert(object)) {
1710
- return true;
1711
- }
1712
- }
1713
- return false;
1714
- }
1715
- update(object) {
1716
- const index = this.objects.findIndex(o => o.id === object.id);
1717
- if (index !== -1) {
1718
- this.objects[index] = object;
1719
- return true;
1720
- }
1721
- if (this.children !== null) {
1722
- for (const child of this.children) {
1723
- if (child.update(object)) {
1724
- return true;
1725
- }
1726
- }
1727
- }
1728
- return false;
1729
- }
1730
- remove(predicate) {
1731
- const index = this.objects.findIndex(o => predicate(o));
1732
- if (index !== -1) {
1733
- this.objects.splice(index, 1);
1734
- }
1735
- if (this.children !== null) {
1736
- for (const child of this.children) {
1737
- child.remove(predicate);
1738
- }
1739
- }
1740
- }
1741
- query(range) {
1742
- const results = [];
1743
- if (!this.intersects(range, this.bounds)) {
1744
- return results;
1745
- }
1746
- for (const object of this.objects) {
1747
- if (this.intersects(object.rotatedBoundingBox, range)) {
1748
- results.push(object);
1749
- }
1750
- }
1751
- if (this.children !== null) {
1752
- for (const child of this.children) {
1753
- results.push(...child.query(range));
1754
- }
1755
- }
1756
- return results;
1757
- }
1758
- filter(predicate) {
1759
- const results = this.objects.filter(o => predicate(o));
1760
- if (this.children !== null) {
1761
- for (const child of this.children) {
1762
- results.push(...child.filter(predicate));
1763
- }
1764
- }
1765
- return results;
1766
- }
1767
- allObjects() {
1768
- const results = [...this.objects];
1769
- if (this.children !== null) {
1770
- for (const child of this.children) {
1771
- results.push(...child.allObjects());
1772
- }
1773
- }
1774
- return results;
1775
- }
1776
- subdivide() {
1777
- const { x, y, z, width, height, depth } = this.bounds;
1778
- const halfWidth = width / 2;
1779
- const halfHeight = height / 2;
1780
- const halfDepth = depth / 2;
1781
- this.children = [
1782
- new KritzelOctree({ x, y, z, width: halfWidth, height: halfHeight, depth: halfDepth }, this.capacity),
1783
- new KritzelOctree({ x: x + halfWidth, y, z, width: halfWidth, height: halfHeight, depth: halfDepth }, this.capacity),
1784
- new KritzelOctree({ x, y: y + halfHeight, z, width: halfWidth, height: halfHeight, depth: halfDepth }, this.capacity),
1785
- new KritzelOctree({ x: x + halfWidth, y: y + halfHeight, z, width: halfWidth, height: halfHeight, depth: halfDepth }, this.capacity),
1786
- new KritzelOctree({ x, y, z: z + halfDepth, width: halfWidth, height: halfHeight, depth: halfDepth }, this.capacity),
1787
- new KritzelOctree({ x: x + halfWidth, y, z: z + halfDepth, width: halfWidth, height: halfHeight, depth: halfDepth }, this.capacity),
1788
- new KritzelOctree({ x, y: y + halfHeight, z: z + halfDepth, width: halfWidth, height: halfHeight, depth: halfDepth }, this.capacity),
1789
- new KritzelOctree({ x: x + halfWidth, y: y + halfHeight, z: z + halfDepth, width: halfWidth, height: halfHeight, depth: halfDepth }, this.capacity),
1790
- ];
1791
- }
1792
- intersects(a, b) {
1793
- return !(a.x >= b.x + b.width || // a is completely to the right of b
1794
- a.x + a.width <= b.x || // a is completely to the left of b
1795
- a.y >= b.y + b.height || // a is completely below b
1796
- a.y + a.height <= b.y // a is completely above b
1797
- );
1798
- }
1799
- }
1800
-
1801
1686
  const DEFAULT_ENGINE_STATE = {
1802
1687
  activeWorkspace: null,
1803
1688
  activeTool: null,
1804
1689
  activeText: null,
1805
1690
  currentPath: null,
1806
1691
  copiedObjects: null,
1807
- objectsOctree: null,
1692
+ objectsMap: null,
1808
1693
  selectionBox: null,
1809
1694
  selectionGroup: null,
1810
1695
  resizeHandleType: null,
@@ -2086,6 +1971,48 @@ class KritzelDatabase {
2086
1971
  }
2087
1972
  }
2088
1973
 
1974
+ class KritzelObjectMap {
1975
+ constructor() {
1976
+ this.map = new Map();
1977
+ }
1978
+ reset() {
1979
+ this.map.clear();
1980
+ }
1981
+ insert(object) {
1982
+ if (!object.id) {
1983
+ return false;
1984
+ }
1985
+ this.map.set(object.id, object);
1986
+ return true;
1987
+ }
1988
+ update(object) {
1989
+ if (!object.id || !this.map.has(object.id)) {
1990
+ return false;
1991
+ }
1992
+ this.map.set(object.id, object);
1993
+ return true;
1994
+ }
1995
+ remove(predicate) {
1996
+ for (const [id, object] of this.map) {
1997
+ if (predicate(object)) {
1998
+ this.map.delete(id);
1999
+ }
2000
+ }
2001
+ }
2002
+ filter(predicate) {
2003
+ const results = [];
2004
+ for (const object of this.map.values()) {
2005
+ if (predicate(object)) {
2006
+ results.push(object);
2007
+ }
2008
+ }
2009
+ return results;
2010
+ }
2011
+ allObjects() {
2012
+ return Array.from(this.map.values());
2013
+ }
2014
+ }
2015
+
2089
2016
  class KritzelStore {
2090
2017
  get history() {
2091
2018
  return this._history;
@@ -2097,10 +2024,10 @@ class KritzelStore {
2097
2024
  return this._state;
2098
2025
  }
2099
2026
  get currentZIndex() {
2100
- return this._state.objectsOctree.filter(o => !(o instanceof KritzelSelectionGroup) && !(o instanceof KrtizelSelectionBox)).length;
2027
+ return this._state.objectsMap.filter(o => !(o instanceof KritzelSelectionGroup) && !(o instanceof KrtizelSelectionBox)).length;
2101
2028
  }
2102
2029
  get allObjects() {
2103
- return this._state.objectsOctree.allObjects();
2030
+ return this._state.objectsMap.allObjects();
2104
2031
  }
2105
2032
  get selectedObjects() {
2106
2033
  return this.allObjects.filter(o => !(o instanceof KritzelSelectionGroup)).filter(o => o.isSelected);
@@ -2121,14 +2048,7 @@ class KritzelStore {
2121
2048
  this._kritzelEngine = kritzelEngine;
2122
2049
  this._history = new KritzelHistory(this);
2123
2050
  this._database = new KritzelDatabase('kritzelDB', 1, this._state.debugInfo.logDatabase);
2124
- this._state.objectsOctree = new KritzelOctree({
2125
- x: -Infinity,
2126
- y: -Infinity,
2127
- z: -Infinity,
2128
- width: Infinity,
2129
- height: Infinity,
2130
- depth: Infinity,
2131
- });
2051
+ this._state.objectsMap = new KritzelObjectMap();
2132
2052
  }
2133
2053
  async initializeDatabase() {
2134
2054
  await this._database.open([
@@ -2160,13 +2080,13 @@ class KritzelStore {
2160
2080
  await this.initializeWorkspaceObjects(this._state.activeWorkspace.id);
2161
2081
  }
2162
2082
  async initializeWorkspaceObjects(workspaceId) {
2163
- this._state.objectsOctree.reset();
2083
+ this._state.objectsMap.reset();
2164
2084
  this._history.reset();
2165
2085
  const objectsFromDb = await this._database.getAllByRange('objects', IDBKeyRange.bound([workspaceId], [workspaceId, '\uffff']));
2166
2086
  const reviver = new KritzelReviver(this);
2167
2087
  objectsFromDb.forEach(element => {
2168
2088
  const revivedObject = reviver.revive(element);
2169
- this._state.objectsOctree.insert(revivedObject);
2089
+ this._state.objectsMap.insert(revivedObject);
2170
2090
  });
2171
2091
  this.rerender();
2172
2092
  }
@@ -2257,6 +2177,7 @@ class KritzelStore {
2257
2177
  const objectRange = IDBKeyRange.bound([workspace.id], [workspace.id, '\uffff']);
2258
2178
  await this._database.deleteByRange('objects', objectRange);
2259
2179
  await this._database.delete('workspaces', workspace.id);
2180
+ this.state.workspaces = this.state.workspaces.filter(ws => ws.id !== workspace.id);
2260
2181
  }
2261
2182
  rerender() {
2262
2183
  if (this._kritzelEngine) {
@@ -2382,15 +2303,8 @@ class KritzelStore {
2382
2303
  this.history.executeCommand(new AddSelectionGroupCommand(this, this, selectionGroup));
2383
2304
  }
2384
2305
  selectAllObjectsInViewport() {
2385
- const objectsInViewport = this._state.objectsOctree
2386
- .query({
2387
- x: -this._state.translateX / this._state.scale,
2388
- y: -this._state.translateY / this._state.scale,
2389
- z: this._state.scale,
2390
- width: this._state.viewportWidth / this._state.scale,
2391
- height: this._state.viewportHeight / this._state.scale,
2392
- depth: 100,
2393
- })
2306
+ const objectsInViewport = this._state.objectsMap
2307
+ .filter(o => o.isInViewport())
2394
2308
  .filter(o => !(o instanceof KritzelSelectionGroup) && !(o instanceof KrtizelSelectionBox) && !(o instanceof KritzelContextMenu));
2395
2309
  if (objectsInViewport.length > 0) {
2396
2310
  const selectionGroup = KritzelSelectionGroup.create(this);
@@ -2897,8 +2811,8 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
2897
2811
  });
2898
2812
  }
2899
2813
  async deleteWorkspace(workspace) {
2900
- return this.store.deleteWorkspace(workspace).then(() => {
2901
- this.workspacesChange.emit(this.store.state.workspaces.filter(ws => ws.id !== workspace.id));
2814
+ return this.store.deleteWorkspace(workspace).then(async () => {
2815
+ this.workspacesChange.emit(this.store.state.workspaces);
2902
2816
  });
2903
2817
  }
2904
2818
  async getWorkspaces() {
@@ -2927,19 +2841,19 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
2927
2841
  const baseHandleSizePx = computedStyle.getPropertyValue('--kritzel-selection-handle-size').trim() || '6px';
2928
2842
  const baseHandleSize = parseFloat(baseHandleSizePx);
2929
2843
  const baseHandleTouchSize = baseHandleSize * 2 < 14 ? 14 : baseHandleSize;
2930
- return (h(Host, { key: 'c7e747aa6106e7904cf9f44db37fa285a6fb4434' }, h("div", { key: 'b75652ab9f9531dce765cbe448ad3131c172d06a', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, h("div", { key: 'fd1355bd640b9296949f6bbcf084589578654db6' }, "ActiveWorkspaceId: ", (_b = (_a = this.store.state) === null || _a === void 0 ? void 0 : _a.activeWorkspace) === null || _b === void 0 ? void 0 :
2931
- _b.id), h("div", { key: '8520e3e774e97ebc42ee86401fbfbafbe41c88e8' }, "ActiveWorkspaceName: ", (_d = (_c = this.store.state) === null || _c === void 0 ? void 0 : _c.activeWorkspace) === null || _d === void 0 ? void 0 :
2932
- _d.name), h("div", { key: 'f247b4d76cd018e787a9b59829deedeb6c5c5272' }, "TranslateX: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
2933
- _e.translateX), h("div", { key: 'e0438479bc9e950ef2cbe88ed0aa0b8ec1888890' }, "TranslateY: ", (_f = this.store.state) === null || _f === void 0 ? void 0 :
2934
- _f.translateY), h("div", { key: '1735fde66588e285039bcc090dee71630608d666' }, "ViewportWidth: ", (_g = this.store.state) === null || _g === void 0 ? void 0 :
2935
- _g.viewportWidth), h("div", { key: '15f8b3305c27a395b8aa6463c5acec42bb3e3ddd' }, "ViewportHeight: ", (_h = this.store.state) === null || _h === void 0 ? void 0 :
2936
- _h.viewportHeight), h("div", { key: 'd2e39bae191c7256967d0140f38e75dccf95f24c' }, "ObjectsInViewport. ", this.store.objects.length), h("div", { key: 'cd3f53ff4a8f119a2ef975133f69fc3798fe0f71' }, "Scale: ", (_j = this.store.state) === null || _j === void 0 ? void 0 :
2937
- _j.scale), h("div", { key: 'b1f8c77589a80fe49d0947602bda46438921f7a8' }, "ActiveTool: ", (_l = (_k = this.store.state) === null || _k === void 0 ? void 0 : _k.activeTool) === null || _l === void 0 ? void 0 :
2938
- _l.name), h("div", { key: '41cd94f58f71cd5c1cffc679ada5fc51f6ceeea7' }, "HasViewportChanged: ", ((_m = this.store.state) === null || _m === void 0 ? void 0 : _m.hasViewportChanged) ? 'true' : 'false'), h("div", { key: 'bf8495bb924673aad3a9ca57ed0bf9ac23874dfb' }, "IsEnabled: ", ((_o = this.store.state) === null || _o === void 0 ? void 0 : _o.isEnabled) ? 'true' : 'false'), h("div", { key: '3823936f5b46b100742f94fac8d7e87ed93ddb58' }, "IsScaling: ", ((_p = this.store.state) === null || _p === void 0 ? void 0 : _p.isScaling) ? 'true' : 'false'), h("div", { key: '62eb836fff78b050cdab8cbef54f88f9d5b644ba' }, "IsPanning: ", ((_q = this.store.state) === null || _q === void 0 ? void 0 : _q.isPanning) ? 'true' : 'false'), h("div", { key: 'dac6b8d18ae8f6317bdd318ad48a9612f9942613' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), h("div", { key: 'af232e2cd738e255029f5611531c246ac63a28ce' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), h("div", { key: '95a44fef4b6befe95bfadfc62957103b48bf76b6' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), h("div", { key: 'e8162d4de449a0d6756c2f540fca28353c193438' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), h("div", { key: '4440d023cd4982c834736e06863698c3baf72353' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), h("div", { key: 'd3e467dd18e53850df4d5bedf2b69f54b1fbe5c6' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), h("div", { key: 'df6e4bca16cbe4346786a544d6f6c53d87bdb699' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), h("div", { key: '532aebf1ff35cc578f12e36cdaf00713ffc76b97' }, "PointerX: ", (_r = this.store.state) === null || _r === void 0 ? void 0 :
2939
- _r.pointerX), h("div", { key: 'f710f8c8d27979da4a40e50452e2cdd63cdefa98' }, "PointerY: ", (_s = this.store.state) === null || _s === void 0 ? void 0 :
2940
- _s.pointerY), h("div", { key: '0175010e1d5a22be81ca0b2d88dd1aff217eacfd' }, "SelectedObjects: ", ((_t = this.store.state.selectionGroup) === null || _t === void 0 ? void 0 : _t.objects.length) || 0)), h("div", { key: 'dc2964c479405ed147bd5f090e24262595a474e2', id: "origin", class: "origin", style: {
2844
+ return (h(Host, { key: 'fd353ff17bcde1a9ab646b6f463d1c6ce00a3dff' }, h("div", { key: '45bc2af8f1a3a2bfa3aa76a478c7bf208027da0c', class: "debug-panel", style: { display: this.store.state.debugInfo.showViewportInfo ? 'block' : 'none' } }, h("div", { key: '50e932febc35c7dbe852ad99d96ca4f0e0b742fc' }, "ActiveWorkspaceId: ", (_b = (_a = this.store.state) === null || _a === void 0 ? void 0 : _a.activeWorkspace) === null || _b === void 0 ? void 0 :
2845
+ _b.id), h("div", { key: 'af94b5061f0803588fece6cccdf540f46f13ca05' }, "ActiveWorkspaceName: ", (_d = (_c = this.store.state) === null || _c === void 0 ? void 0 : _c.activeWorkspace) === null || _d === void 0 ? void 0 :
2846
+ _d.name), h("div", { key: '89c0d21ce94f4eda72153554fadbd6942e785edc' }, "TranslateX: ", (_e = this.store.state) === null || _e === void 0 ? void 0 :
2847
+ _e.translateX), h("div", { key: '340b5165265241972a7a940268c7940063ba8c12' }, "TranslateY: ", (_f = this.store.state) === null || _f === void 0 ? void 0 :
2848
+ _f.translateY), h("div", { key: '428054b3ea4a1c327f03d6b37bfe6331dea6c57b' }, "ViewportWidth: ", (_g = this.store.state) === null || _g === void 0 ? void 0 :
2849
+ _g.viewportWidth), h("div", { key: 'd67420ef633627413066a28b8ef9ac43c520015d' }, "ViewportHeight: ", (_h = this.store.state) === null || _h === void 0 ? void 0 :
2850
+ _h.viewportHeight), h("div", { key: 'dedf9eb89c79fa496f7b6d0df9c646898f66b3d4' }, "ObjectsInViewport. ", this.store.objects.length), h("div", { key: '59bb8416941fd84305f2892f24098f6f4a084401' }, "Scale: ", (_j = this.store.state) === null || _j === void 0 ? void 0 :
2851
+ _j.scale), h("div", { key: '6705a4cec22e4e33f75e296e17bc2952a3d1cba7' }, "ActiveTool: ", (_l = (_k = this.store.state) === null || _k === void 0 ? void 0 : _k.activeTool) === null || _l === void 0 ? void 0 :
2852
+ _l.name), h("div", { key: 'ca22e0a377a11fdca851b38f1bf425648cd3b9dd' }, "HasViewportChanged: ", ((_m = this.store.state) === null || _m === void 0 ? void 0 : _m.hasViewportChanged) ? 'true' : 'false'), h("div", { key: '57508b9ee24a5af631e6bb1eace404c39af14f82' }, "IsEnabled: ", ((_o = this.store.state) === null || _o === void 0 ? void 0 : _o.isEnabled) ? 'true' : 'false'), h("div", { key: 'f6cea367b5007f767afb25a033215abda734de9d' }, "IsScaling: ", ((_p = this.store.state) === null || _p === void 0 ? void 0 : _p.isScaling) ? 'true' : 'false'), h("div", { key: '4386ef749facd2e54da7f58aa2713b87ed76f2df' }, "IsPanning: ", ((_q = this.store.state) === null || _q === void 0 ? void 0 : _q.isPanning) ? 'true' : 'false'), h("div", { key: '1713185b36a50dfe0f9efa0c92394222db80a377' }, "IsFocused: ", this.store.state.isFocused ? 'true' : 'false'), h("div", { key: '5104f428b808e7d843712302ad2e58b619876bee' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), h("div", { key: '2cb3b27a00627188e7082fa94169eb961a1ae6ed' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), h("div", { key: '7407656e61be665f27e706738faa6d318e2c1d04' }, "IsResizeHandleSelected: ", this.store.state.isResizeHandleSelected ? 'true' : 'false'), h("div", { key: '701bf05c25cb3d3728af6602f694e6064627ea59' }, "IsRotationHandleSelected: ", this.store.state.isRotationHandleSelected ? 'true' : 'false'), h("div", { key: '772c345ea9c64ef800fdbb26919f1a54ca889025' }, "IsDrawing: ", this.store.state.isDrawing ? 'true' : 'false'), h("div", { key: 'dc687c8ba24182b8b61979ad334b989d3be72ec6' }, "IsWriting: ", this.store.state.isWriting ? 'true' : 'false'), h("div", { key: '10cbc575a7905396a76eca4e7b56be719755aeb4' }, "PointerX: ", (_r = this.store.state) === null || _r === void 0 ? void 0 :
2853
+ _r.pointerX), h("div", { key: '4f21199328ffadddcc58b7d6b102a89e5079f676' }, "PointerY: ", (_s = this.store.state) === null || _s === void 0 ? void 0 :
2854
+ _s.pointerY), h("div", { key: 'ac705f38cb323b8dc8cbf95f875657c5dec5c9ae' }, "SelectedObjects: ", ((_t = this.store.state.selectionGroup) === null || _t === void 0 ? void 0 : _t.objects.length) || 0)), h("div", { key: '2ca55c53246e64520af6720a3f87d2357295ca7f', id: "origin", class: "origin", style: {
2941
2855
  transform: `matrix(${(_u = this.store.state) === null || _u === void 0 ? void 0 : _u.scale}, 0, 0, ${(_v = this.store.state) === null || _v === void 0 ? void 0 : _v.scale}, ${(_w = this.store.state) === null || _w === void 0 ? void 0 : _w.translateX}, ${(_x = this.store.state) === null || _x === void 0 ? void 0 : _x.translateY})`,
2942
- } }, (_y = this.store.state.objectsOctree.allObjects()) === null || _y === void 0 ? void 0 :
2856
+ } }, (_y = this.store.state.objectsMap.allObjects()) === null || _y === void 0 ? void 0 :
2943
2857
  _y.map(object => {
2944
2858
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2945
2859
  return (h("div", { key: object.id, style: { display: object.isInViewport() ? 'block' : 'none', transform: object === null || object === void 0 ? void 0 : object.transformationMatrix, transformOrigin: 'top left', zIndex: object.zIndex.toString(), position: 'absolute' } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", id: object.id, class: "object", style: {
@@ -3040,7 +2954,7 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
3040
2954
  fill: 'transparent',
3041
2955
  cursor: 'grab',
3042
2956
  }, 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)))))));
3043
- }), h("svg", { key: '86f9a08bea3ac2d261b14b2eec471fafd20ca11f', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
2957
+ }), h("svg", { key: '0098f1b8233d45f49dc8bdcc13c08f20c04b65e1', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
3044
2958
  height: (_z = this.store.state.currentPath) === null || _z === void 0 ? void 0 : _z.height.toString(),
3045
2959
  width: (_0 = this.store.state.currentPath) === null || _0 === void 0 ? void 0 : _0.width.toString(),
3046
2960
  left: '0',
@@ -3050,7 +2964,7 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
3050
2964
  transform: (_2 = this.store.state.currentPath) === null || _2 === void 0 ? void 0 : _2.transformationMatrix,
3051
2965
  transformOrigin: 'top left',
3052
2966
  overflow: 'visible',
3053
- }, viewBox: (_3 = this.store.state.currentPath) === null || _3 === void 0 ? void 0 : _3.viewBox }, h("path", { key: '66ebcf1791c993d62b34a2e4da1d4279428a17dd', d: (_4 = this.store.state.currentPath) === null || _4 === void 0 ? void 0 : _4.d, fill: (_5 = this.store.state.currentPath) === null || _5 === void 0 ? void 0 : _5.fill, stroke: (_6 = this.store.state.currentPath) === null || _6 === void 0 ? void 0 : _6.stroke }))), this.store.state.isContextMenuVisible && (h("kritzel-context-menu", { key: 'af91784e3afc84b71d5186237d287c31d472d80a', class: "context-menu", ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, objects: ((_7 = this.store.state.selectionGroup) === null || _7 === void 0 ? void 0 : _7.objects) || [], style: {
2967
+ }, viewBox: (_3 = this.store.state.currentPath) === null || _3 === void 0 ? void 0 : _3.viewBox }, h("path", { key: '08310713fa8f2f1f695b1b61bb2b6e5a5f77f192', d: (_4 = this.store.state.currentPath) === null || _4 === void 0 ? void 0 : _4.d, fill: (_5 = this.store.state.currentPath) === null || _5 === void 0 ? void 0 : _5.fill, stroke: (_6 = this.store.state.currentPath) === null || _6 === void 0 ? void 0 : _6.stroke }))), this.store.state.isContextMenuVisible && (h("kritzel-context-menu", { key: '2529447e26ba02689303be39cc593dfafc25b96c', class: "context-menu", ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, objects: ((_7 = this.store.state.selectionGroup) === null || _7 === void 0 ? void 0 : _7.objects) || [], style: {
3054
2968
  position: 'fixed',
3055
2969
  left: `${this.store.state.contextMenuX}px`,
3056
2970
  top: `${this.store.state.contextMenuY}px`,
@@ -3062,7 +2976,7 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
3062
2976
  y: (-this.store.state.translateY + this.store.state.contextMenuY) / this.store.state.scale,
3063
2977
  }, (_a = this.store.state.selectionGroup) === null || _a === void 0 ? void 0 : _a.objects);
3064
2978
  this.hideContextMenu();
3065
- } })), ((_8 = this.store.state) === null || _8 === void 0 ? void 0 : _8.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && h("kritzel-cursor-trail", { key: '573a4422b742044df5f240b260bc66e83d004520', store: this.store })));
2979
+ } })), ((_8 = this.store.state) === null || _8 === void 0 ? void 0 : _8.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && h("kritzel-cursor-trail", { key: '7c10277160eb1bc51581e4dfbdd4d0cdf626ed8c', store: this.store })));
3066
2980
  }
3067
2981
  get host() { return this; }
3068
2982
  static get watchers() { return {
@@ -3143,6 +3057,6 @@ function defineCustomElement() {
3143
3057
  }
3144
3058
 
3145
3059
  export { ABSOLUTE_SCALE_MAX as A, KritzelImage as K, KritzelEraserTool as a, KritzelImageTool as b, KritzelSelectionTool as c, KritzelEngine as d, defineCustomElement as e, ABSOLUTE_SCALE_MIN as f };
3146
- //# sourceMappingURL=p-D-zg05gA.js.map
3060
+ //# sourceMappingURL=p-jGaWxggY.js.map
3147
3061
 
3148
- //# sourceMappingURL=p-D-zg05gA.js.map
3062
+ //# sourceMappingURL=p-jGaWxggY.js.map