@tldraw/editor 3.14.0-canary.b8c5ab05b06a → 3.14.0-canary.ba997e465fde

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 (117) hide show
  1. package/dist-cjs/index.d.ts +11 -4
  2. package/dist-cjs/index.js +8 -8
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/editor/Editor.js +32 -24
  5. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  6. package/dist-cjs/lib/editor/derivations/bindingsIndex.js +22 -22
  7. package/dist-cjs/lib/editor/derivations/bindingsIndex.js.map +2 -2
  8. package/dist-cjs/lib/editor/derivations/parentsToChildren.js +16 -16
  9. package/dist-cjs/lib/editor/derivations/parentsToChildren.js.map +2 -2
  10. package/dist-cjs/lib/editor/managers/{ClickManager.js → ClickManager/ClickManager.js} +1 -1
  11. package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +7 -0
  12. package/dist-cjs/lib/editor/managers/{EdgeScrollManager.js → EdgeScrollManager/EdgeScrollManager.js} +2 -2
  13. package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js.map +7 -0
  14. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +7 -0
  15. package/dist-cjs/lib/editor/managers/FontManager/FontManager.js.map +7 -0
  16. package/dist-cjs/lib/editor/managers/{HistoryManager.js → HistoryManager/HistoryManager.js} +64 -6
  17. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +7 -0
  18. package/dist-cjs/lib/editor/managers/{ScribbleManager.js → ScribbleManager/ScribbleManager.js} +1 -1
  19. package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js.map +7 -0
  20. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +7 -0
  21. package/dist-cjs/lib/editor/managers/{TickManager.js → TickManager/TickManager.js} +1 -1
  22. package/dist-cjs/lib/editor/managers/TickManager/TickManager.js.map +7 -0
  23. package/dist-cjs/lib/editor/managers/{UserPreferencesManager.js → UserPreferencesManager/UserPreferencesManager.js} +1 -1
  24. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +7 -0
  25. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +1 -1
  26. package/dist-cjs/lib/exports/getSvgJsx.js.map +1 -1
  27. package/dist-cjs/lib/utils/richText.js.map +1 -1
  28. package/dist-cjs/version.js +3 -3
  29. package/dist-cjs/version.js.map +1 -1
  30. package/dist-esm/index.d.mts +11 -4
  31. package/dist-esm/index.mjs +12 -8
  32. package/dist-esm/index.mjs.map +2 -2
  33. package/dist-esm/lib/editor/Editor.mjs +32 -24
  34. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  35. package/dist-esm/lib/editor/derivations/bindingsIndex.mjs +22 -22
  36. package/dist-esm/lib/editor/derivations/bindingsIndex.mjs.map +2 -2
  37. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs +16 -16
  38. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs.map +2 -2
  39. package/dist-esm/lib/editor/managers/{ClickManager.mjs → ClickManager/ClickManager.mjs} +1 -1
  40. package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +7 -0
  41. package/dist-esm/lib/editor/managers/{EdgeScrollManager.mjs → EdgeScrollManager/EdgeScrollManager.mjs} +2 -2
  42. package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs.map +7 -0
  43. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +7 -0
  44. package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs.map +7 -0
  45. package/dist-esm/lib/editor/managers/{HistoryManager.mjs → HistoryManager/HistoryManager.mjs} +60 -2
  46. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +7 -0
  47. package/dist-esm/lib/editor/managers/{ScribbleManager.mjs → ScribbleManager/ScribbleManager.mjs} +1 -1
  48. package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs.map +7 -0
  49. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +7 -0
  50. package/dist-esm/lib/editor/managers/{TickManager.mjs → TickManager/TickManager.mjs} +1 -1
  51. package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs.map +7 -0
  52. package/dist-esm/lib/editor/managers/{UserPreferencesManager.mjs → UserPreferencesManager/UserPreferencesManager.mjs} +1 -1
  53. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +7 -0
  54. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +1 -1
  55. package/dist-esm/lib/exports/getSvgJsx.mjs.map +1 -1
  56. package/dist-esm/lib/utils/richText.mjs.map +1 -1
  57. package/dist-esm/version.mjs +3 -3
  58. package/dist-esm/version.mjs.map +1 -1
  59. package/package.json +7 -7
  60. package/src/index.ts +13 -7
  61. package/src/lib/editor/Editor.test.ts +252 -3
  62. package/src/lib/editor/Editor.ts +33 -25
  63. package/src/lib/editor/derivations/bindingsIndex.ts +27 -26
  64. package/src/lib/editor/derivations/parentsToChildren.ts +28 -25
  65. package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +442 -0
  66. package/src/lib/editor/managers/{ClickManager.ts → ClickManager/ClickManager.ts} +3 -3
  67. package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +374 -0
  68. package/src/lib/editor/managers/{EdgeScrollManager.ts → EdgeScrollManager/EdgeScrollManager.ts} +3 -3
  69. package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +455 -0
  70. package/src/lib/editor/managers/{FocusManager.ts → FocusManager/FocusManager.ts} +1 -1
  71. package/src/lib/editor/managers/FontManager/FontManager.test.ts +263 -0
  72. package/src/lib/editor/managers/{FontManager.ts → FontManager/FontManager.ts} +1 -1
  73. package/src/lib/editor/managers/{HistoryManager.test.ts → HistoryManager/HistoryManager.test.ts} +388 -1
  74. package/src/lib/editor/managers/{HistoryManager.ts → HistoryManager/HistoryManager.ts} +73 -2
  75. package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +624 -0
  76. package/src/lib/editor/managers/{ScribbleManager.ts → ScribbleManager/ScribbleManager.ts} +2 -2
  77. package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +485 -0
  78. package/src/lib/editor/managers/TextManager/TextManager.test.ts +411 -0
  79. package/src/lib/editor/managers/{TextManager.ts → TextManager/TextManager.ts} +1 -1
  80. package/src/lib/editor/managers/TickManager/TickManager.test.ts +314 -0
  81. package/src/lib/editor/managers/{TickManager.ts → TickManager/TickManager.ts} +2 -2
  82. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +591 -0
  83. package/src/lib/editor/managers/{UserPreferencesManager.ts → UserPreferencesManager/UserPreferencesManager.ts} +2 -2
  84. package/src/lib/editor/shapes/ShapeUtil.ts +1 -1
  85. package/src/lib/exports/getSvgJsx.tsx +1 -1
  86. package/src/lib/utils/richText.ts +1 -1
  87. package/src/version.ts +3 -3
  88. package/dist-cjs/lib/editor/managers/ClickManager.js.map +0 -7
  89. package/dist-cjs/lib/editor/managers/EdgeScrollManager.js.map +0 -7
  90. package/dist-cjs/lib/editor/managers/FocusManager.js.map +0 -7
  91. package/dist-cjs/lib/editor/managers/FontManager.js.map +0 -7
  92. package/dist-cjs/lib/editor/managers/HistoryManager.js.map +0 -7
  93. package/dist-cjs/lib/editor/managers/ScribbleManager.js.map +0 -7
  94. package/dist-cjs/lib/editor/managers/Stack.js +0 -82
  95. package/dist-cjs/lib/editor/managers/Stack.js.map +0 -7
  96. package/dist-cjs/lib/editor/managers/TextManager.js.map +0 -7
  97. package/dist-cjs/lib/editor/managers/TickManager.js.map +0 -7
  98. package/dist-cjs/lib/editor/managers/UserPreferencesManager.js.map +0 -7
  99. package/dist-esm/lib/editor/managers/ClickManager.mjs.map +0 -7
  100. package/dist-esm/lib/editor/managers/EdgeScrollManager.mjs.map +0 -7
  101. package/dist-esm/lib/editor/managers/FocusManager.mjs.map +0 -7
  102. package/dist-esm/lib/editor/managers/FontManager.mjs.map +0 -7
  103. package/dist-esm/lib/editor/managers/HistoryManager.mjs.map +0 -7
  104. package/dist-esm/lib/editor/managers/ScribbleManager.mjs.map +0 -7
  105. package/dist-esm/lib/editor/managers/Stack.mjs +0 -62
  106. package/dist-esm/lib/editor/managers/Stack.mjs.map +0 -7
  107. package/dist-esm/lib/editor/managers/TextManager.mjs.map +0 -7
  108. package/dist-esm/lib/editor/managers/TickManager.mjs.map +0 -7
  109. package/dist-esm/lib/editor/managers/UserPreferencesManager.mjs.map +0 -7
  110. package/src/lib/editor/managers/ScribbleManager.test.ts +0 -32
  111. package/src/lib/editor/managers/Stack.ts +0 -71
  112. /package/dist-cjs/lib/editor/managers/{FocusManager.js → FocusManager/FocusManager.js} +0 -0
  113. /package/dist-cjs/lib/editor/managers/{FontManager.js → FontManager/FontManager.js} +0 -0
  114. /package/dist-cjs/lib/editor/managers/{TextManager.js → TextManager/TextManager.js} +0 -0
  115. /package/dist-esm/lib/editor/managers/{FocusManager.mjs → FocusManager/FocusManager.mjs} +0 -0
  116. /package/dist-esm/lib/editor/managers/{FontManager.mjs → FontManager/FontManager.mjs} +0 -0
  117. /package/dist-esm/lib/editor/managers/{TextManager.mjs → TextManager/TextManager.mjs} +0 -0
@@ -46,7 +46,7 @@ var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use
46
46
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
47
47
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
48
48
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
49
- var __setMetaKeyTimeout_dec, __setCtrlKeyTimeout_dec, __setAltKeyTimeout_dec, __setShiftKeyTimeout_dec, _getIsReadonly_dec, _getIsFocused_dec, _getSharedOpacity_dec, _getSharedStyles_dec, __getSelectionSharedStyles_dec, __getBindingsIndexCache_dec, _getCurrentPageRenderingShapesSorted_dec, _getCurrentPageShapesSorted_dec, _getCurrentPageShapes_dec, _getCurrentPageBounds_dec, _getCulledShapes_dec, __notVisibleShapes_dec, __getShapeMaskedPageBoundsCache_dec, __getShapeMaskCache_dec, __getShapeClipPathCache_dec, __getShapePageBoundsCache_dec, __getShapePageTransformCache_dec, __getShapeHandlesCache_dec, __getAllAssetsQuery_dec, _getCurrentPageShapeIdsSorted_dec, _getCurrentPageId_dec, _getPages_dec, __getAllPagesQuery_dec, _getRenderingShapes_dec, _getCollaboratorsOnCurrentPage_dec, _getCollaborators_dec, __getCollaboratorsQuery_dec, _getViewportPageBounds_dec, _getViewportScreenCenter_dec, _getViewportScreenBounds_dec, _getZoomLevel_dec, _getCameraForFollowing_dec, _getViewportPageBoundsForFollowing_dec, _getCamera_dec, __unsafe_getCameraId_dec, _getErasingShapes_dec, _getErasingShapeIds_dec, _getHintingShape_dec, _getHintingShapeIds_dec, _getHoveredShape_dec, _getHoveredShapeId_dec, _getRichTextEditor_dec, _getEditingShape_dec, _getEditingShapeId_dec, _getFocusedGroup_dec, _getFocusedGroupId_dec, _getSelectionRotatedScreenBounds_dec, _getSelectionRotatedPageBounds_dec, _getSelectionRotation_dec, _getSelectionPageBounds_dec, _getOnlySelectedShape_dec, _getOnlySelectedShapeId_dec, _getCurrentPageShapesInReadingOrder_dec, _getSelectedShapes_dec, _getSelectedShapeIds_dec, __getCurrentPageStateId_dec, _getCurrentPageState_dec, __getPageStatesQuery_dec, _getPageStates_dec, _getIsMenuOpen_dec, _getOpenMenus_dec, _getInstanceState_dec, _getDocumentSettings_dec, _getCurrentToolId_dec, _getCurrentTool_dec, _getPath_dec, _getCanRedo_dec, _getCanUndo_dec, _getIsShapeHiddenCache_dec, _a, _init;
49
+ var __setMetaKeyTimeout_dec, __setCtrlKeyTimeout_dec, __setAltKeyTimeout_dec, __setShiftKeyTimeout_dec, _getIsReadonly_dec, _getIsFocused_dec, _getSharedOpacity_dec, _getSharedStyles_dec, __getSelectionSharedStyles_dec, __getBindingsIndexCache_dec, _getCurrentPageRenderingShapesSorted_dec, _getCurrentPageShapesSorted_dec, _getCurrentPageShapes_dec, _getCurrentPageBounds_dec, _getCulledShapes_dec, _getNotVisibleShapes_dec, __getShapeMaskedPageBoundsCache_dec, __getShapeMaskCache_dec, __getShapeClipPathCache_dec, __getShapePageBoundsCache_dec, __getShapePageTransformCache_dec, __getShapeHandlesCache_dec, __getAllAssetsQuery_dec, _getCurrentPageShapeIdsSorted_dec, _getCurrentPageId_dec, _getPages_dec, __getAllPagesQuery_dec, _getRenderingShapes_dec, _getCollaboratorsOnCurrentPage_dec, _getCollaborators_dec, __getCollaboratorsQuery_dec, _getViewportPageBounds_dec, _getViewportScreenCenter_dec, _getViewportScreenBounds_dec, _getZoomLevel_dec, _getCameraForFollowing_dec, _getViewportPageBoundsForFollowing_dec, _getCamera_dec, __unsafe_getCameraId_dec, _getErasingShapes_dec, _getErasingShapeIds_dec, _getHintingShape_dec, _getHintingShapeIds_dec, _getHoveredShape_dec, _getHoveredShapeId_dec, _getRichTextEditor_dec, _getEditingShape_dec, _getEditingShapeId_dec, _getFocusedGroup_dec, _getFocusedGroupId_dec, _getSelectionRotatedScreenBounds_dec, _getSelectionRotatedPageBounds_dec, _getSelectionRotation_dec, _getSelectionPageBounds_dec, _getOnlySelectedShape_dec, _getOnlySelectedShapeId_dec, _getCurrentPageShapesInReadingOrder_dec, _getSelectedShapes_dec, _getSelectedShapeIds_dec, __getCurrentPageStateId_dec, _getCurrentPageState_dec, __getPageStatesQuery_dec, _getPageStates_dec, _getIsMenuOpen_dec, _getOpenMenus_dec, _getInstanceState_dec, _getDocumentSettings_dec, _getCurrentToolId_dec, _getCurrentTool_dec, _getPath_dec, _getCanRedo_dec, _getCanUndo_dec, _getIsShapeHiddenCache_dec, _a, _init;
50
50
  import {
51
51
  EMPTY_ARRAY,
52
52
  atom,
@@ -147,18 +147,18 @@ import { bindingsIndex } from "./derivations/bindingsIndex.mjs";
147
147
  import { notVisibleShapes } from "./derivations/notVisibleShapes.mjs";
148
148
  import { parentsToChildren } from "./derivations/parentsToChildren.mjs";
149
149
  import { deriveShapeIdsInCurrentPage } from "./derivations/shapeIdsInCurrentPage.mjs";
150
- import { ClickManager } from "./managers/ClickManager.mjs";
151
- import { EdgeScrollManager } from "./managers/EdgeScrollManager.mjs";
152
- import { FocusManager } from "./managers/FocusManager.mjs";
153
- import { FontManager } from "./managers/FontManager.mjs";
154
- import { HistoryManager } from "./managers/HistoryManager.mjs";
155
- import { ScribbleManager } from "./managers/ScribbleManager.mjs";
150
+ import { ClickManager } from "./managers/ClickManager/ClickManager.mjs";
151
+ import { EdgeScrollManager } from "./managers/EdgeScrollManager/EdgeScrollManager.mjs";
152
+ import { FocusManager } from "./managers/FocusManager/FocusManager.mjs";
153
+ import { FontManager } from "./managers/FontManager/FontManager.mjs";
154
+ import { HistoryManager } from "./managers/HistoryManager/HistoryManager.mjs";
155
+ import { ScribbleManager } from "./managers/ScribbleManager/ScribbleManager.mjs";
156
156
  import { SnapManager } from "./managers/SnapManager/SnapManager.mjs";
157
- import { TextManager } from "./managers/TextManager.mjs";
158
- import { TickManager } from "./managers/TickManager.mjs";
159
- import { UserPreferencesManager } from "./managers/UserPreferencesManager.mjs";
157
+ import { TextManager } from "./managers/TextManager/TextManager.mjs";
158
+ import { TickManager } from "./managers/TickManager/TickManager.mjs";
159
+ import { UserPreferencesManager } from "./managers/UserPreferencesManager/UserPreferencesManager.mjs";
160
160
  import { RootState } from "./tools/RootState.mjs";
161
- class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed], _getCanUndo_dec = [computed], _getCanRedo_dec = [computed], _getPath_dec = [computed], _getCurrentTool_dec = [computed], _getCurrentToolId_dec = [computed], _getDocumentSettings_dec = [computed], _getInstanceState_dec = [computed], _getOpenMenus_dec = [computed], _getIsMenuOpen_dec = [computed], _getPageStates_dec = [computed], __getPageStatesQuery_dec = [computed], _getCurrentPageState_dec = [computed], __getCurrentPageStateId_dec = [computed], _getSelectedShapeIds_dec = [computed], _getSelectedShapes_dec = [computed], _getCurrentPageShapesInReadingOrder_dec = [computed], _getOnlySelectedShapeId_dec = [computed], _getOnlySelectedShape_dec = [computed], _getSelectionPageBounds_dec = [computed], _getSelectionRotation_dec = [computed], _getSelectionRotatedPageBounds_dec = [computed], _getSelectionRotatedScreenBounds_dec = [computed], _getFocusedGroupId_dec = [computed], _getFocusedGroup_dec = [computed], _getEditingShapeId_dec = [computed], _getEditingShape_dec = [computed], _getRichTextEditor_dec = [computed], _getHoveredShapeId_dec = [computed], _getHoveredShape_dec = [computed], _getHintingShapeIds_dec = [computed], _getHintingShape_dec = [computed], _getErasingShapeIds_dec = [computed], _getErasingShapes_dec = [computed], __unsafe_getCameraId_dec = [computed], _getCamera_dec = [computed], _getViewportPageBoundsForFollowing_dec = [computed], _getCameraForFollowing_dec = [computed], _getZoomLevel_dec = [computed], _getViewportScreenBounds_dec = [computed], _getViewportScreenCenter_dec = [computed], _getViewportPageBounds_dec = [computed], __getCollaboratorsQuery_dec = [computed], _getCollaborators_dec = [computed], _getCollaboratorsOnCurrentPage_dec = [computed], _getRenderingShapes_dec = [computed], __getAllPagesQuery_dec = [computed], _getPages_dec = [computed], _getCurrentPageId_dec = [computed], _getCurrentPageShapeIdsSorted_dec = [computed], __getAllAssetsQuery_dec = [computed], __getShapeHandlesCache_dec = [computed], __getShapePageTransformCache_dec = [computed], __getShapePageBoundsCache_dec = [computed], __getShapeClipPathCache_dec = [computed], __getShapeMaskCache_dec = [computed], __getShapeMaskedPageBoundsCache_dec = [computed], __notVisibleShapes_dec = [computed], _getCulledShapes_dec = [computed], _getCurrentPageBounds_dec = [computed], _getCurrentPageShapes_dec = [computed], _getCurrentPageShapesSorted_dec = [computed], _getCurrentPageRenderingShapesSorted_dec = [computed], __getBindingsIndexCache_dec = [computed], __getSelectionSharedStyles_dec = [computed], _getSharedStyles_dec = [computed({ isEqual: (a, b) => a.equals(b) })], _getSharedOpacity_dec = [computed], _getIsFocused_dec = [computed], _getIsReadonly_dec = [computed], __setShiftKeyTimeout_dec = [bind], __setAltKeyTimeout_dec = [bind], __setCtrlKeyTimeout_dec = [bind], __setMetaKeyTimeout_dec = [bind], _a) {
161
+ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed], _getCanUndo_dec = [computed], _getCanRedo_dec = [computed], _getPath_dec = [computed], _getCurrentTool_dec = [computed], _getCurrentToolId_dec = [computed], _getDocumentSettings_dec = [computed], _getInstanceState_dec = [computed], _getOpenMenus_dec = [computed], _getIsMenuOpen_dec = [computed], _getPageStates_dec = [computed], __getPageStatesQuery_dec = [computed], _getCurrentPageState_dec = [computed], __getCurrentPageStateId_dec = [computed], _getSelectedShapeIds_dec = [computed], _getSelectedShapes_dec = [computed], _getCurrentPageShapesInReadingOrder_dec = [computed], _getOnlySelectedShapeId_dec = [computed], _getOnlySelectedShape_dec = [computed], _getSelectionPageBounds_dec = [computed], _getSelectionRotation_dec = [computed], _getSelectionRotatedPageBounds_dec = [computed], _getSelectionRotatedScreenBounds_dec = [computed], _getFocusedGroupId_dec = [computed], _getFocusedGroup_dec = [computed], _getEditingShapeId_dec = [computed], _getEditingShape_dec = [computed], _getRichTextEditor_dec = [computed], _getHoveredShapeId_dec = [computed], _getHoveredShape_dec = [computed], _getHintingShapeIds_dec = [computed], _getHintingShape_dec = [computed], _getErasingShapeIds_dec = [computed], _getErasingShapes_dec = [computed], __unsafe_getCameraId_dec = [computed], _getCamera_dec = [computed], _getViewportPageBoundsForFollowing_dec = [computed], _getCameraForFollowing_dec = [computed], _getZoomLevel_dec = [computed], _getViewportScreenBounds_dec = [computed], _getViewportScreenCenter_dec = [computed], _getViewportPageBounds_dec = [computed], __getCollaboratorsQuery_dec = [computed], _getCollaborators_dec = [computed], _getCollaboratorsOnCurrentPage_dec = [computed], _getRenderingShapes_dec = [computed], __getAllPagesQuery_dec = [computed], _getPages_dec = [computed], _getCurrentPageId_dec = [computed], _getCurrentPageShapeIdsSorted_dec = [computed], __getAllAssetsQuery_dec = [computed], __getShapeHandlesCache_dec = [computed], __getShapePageTransformCache_dec = [computed], __getShapePageBoundsCache_dec = [computed], __getShapeClipPathCache_dec = [computed], __getShapeMaskCache_dec = [computed], __getShapeMaskedPageBoundsCache_dec = [computed], _getNotVisibleShapes_dec = [computed], _getCulledShapes_dec = [computed], _getCurrentPageBounds_dec = [computed], _getCurrentPageShapes_dec = [computed], _getCurrentPageShapesSorted_dec = [computed], _getCurrentPageRenderingShapesSorted_dec = [computed], __getBindingsIndexCache_dec = [computed], __getSelectionSharedStyles_dec = [computed], _getSharedStyles_dec = [computed({ isEqual: (a, b) => a.equals(b) })], _getSharedOpacity_dec = [computed], _getIsFocused_dec = [computed], _getIsReadonly_dec = [computed], __setShiftKeyTimeout_dec = [bind], __setAltKeyTimeout_dec = [bind], __setCtrlKeyTimeout_dec = [bind], __setMetaKeyTimeout_dec = [bind], _a) {
162
162
  constructor({
163
163
  store,
164
164
  user,
@@ -336,6 +336,7 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
336
336
  __publicField(this, "_currentPageShapeIds");
337
337
  /* --------------------- Shapes --------------------- */
338
338
  __publicField(this, "_shapeGeometryCaches", {});
339
+ __publicField(this, "_notVisibleShapes", notVisibleShapes(this));
339
340
  // Parents and children
340
341
  /**
341
342
  * A cache of parents to children.
@@ -3849,17 +3850,24 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
3849
3850
  }
3850
3851
  return void 0;
3851
3852
  }
3852
- isShapeOrAncestorLocked(arg) {
3853
- const shape = typeof arg === "string" ? this.getShape(arg) : arg;
3854
- if (shape === void 0) return false;
3855
- if (shape.isLocked) return true;
3856
- return this.isShapeOrAncestorLocked(this.getShapeParent(shape));
3853
+ /**
3854
+ * Check whether a shape or its parent is locked.
3855
+ *
3856
+ * @param shape - The shape (or shape id) to check.
3857
+ *
3858
+ * @public
3859
+ */
3860
+ isShapeOrAncestorLocked(shape) {
3861
+ const _shape = shape && this.getShape(shape);
3862
+ if (_shape === void 0) return false;
3863
+ if (_shape.isLocked) return true;
3864
+ return this.isShapeOrAncestorLocked(this.getShapeParent(_shape));
3857
3865
  }
3858
- _notVisibleShapes() {
3859
- return notVisibleShapes(this);
3866
+ getNotVisibleShapes() {
3867
+ return this._notVisibleShapes.get();
3860
3868
  }
3861
3869
  getCulledShapes() {
3862
- const notVisibleShapes2 = this._notVisibleShapes().get();
3870
+ const notVisibleShapes2 = this.getNotVisibleShapes();
3863
3871
  const selectedShapeIds = this.getSelectedShapeIds();
3864
3872
  const editingId = this.getEditingShapeId();
3865
3873
  const culledShapes = new Set(notVisibleShapes2);
@@ -4004,18 +4012,18 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
4004
4012
  * @example
4005
4013
  * ```ts
4006
4014
  * editor.getShapesAtPoint({ x: 100, y: 100 })
4007
- * editor.getShapesAtPoint({ x: 100, y: 100 }, { hitInside: true, exact: true })
4015
+ * editor.getShapesAtPoint({ x: 100, y: 100 }, { hitInside: true, margin: 8 })
4008
4016
  * ```
4009
4017
  *
4010
4018
  * @param point - The page point to test.
4011
4019
  * @param opts - The options for the hit point testing.
4012
4020
  *
4021
+ * @returns An array of shapes at the given point, sorted in reverse order of their absolute z-index (top-most shape first).
4022
+ *
4013
4023
  * @public
4014
4024
  */
4015
4025
  getShapesAtPoint(point, opts = {}) {
4016
- return this.getCurrentPageShapes().filter(
4017
- (shape) => !this.isShapeHidden(shape) && this.isPointInShape(shape, point, opts)
4018
- );
4026
+ return this.getCurrentPageShapesSorted().filter((shape) => !this.isShapeHidden(shape) && this.isPointInShape(shape, point, opts)).reverse();
4019
4027
  }
4020
4028
  /**
4021
4029
  * Test whether a point (in the current page space) will will a shape. This method takes into account masks,
@@ -7804,7 +7812,7 @@ __decorateElement(_init, 1, "_getShapePageBoundsCache", __getShapePageBoundsCach
7804
7812
  __decorateElement(_init, 1, "_getShapeClipPathCache", __getShapeClipPathCache_dec, Editor);
7805
7813
  __decorateElement(_init, 1, "_getShapeMaskCache", __getShapeMaskCache_dec, Editor);
7806
7814
  __decorateElement(_init, 1, "_getShapeMaskedPageBoundsCache", __getShapeMaskedPageBoundsCache_dec, Editor);
7807
- __decorateElement(_init, 1, "_notVisibleShapes", __notVisibleShapes_dec, Editor);
7815
+ __decorateElement(_init, 1, "getNotVisibleShapes", _getNotVisibleShapes_dec, Editor);
7808
7816
  __decorateElement(_init, 1, "getCulledShapes", _getCulledShapes_dec, Editor);
7809
7817
  __decorateElement(_init, 1, "getCurrentPageBounds", _getCurrentPageBounds_dec, Editor);
7810
7818
  __decorateElement(_init, 1, "getCurrentPageShapes", _getCurrentPageShapes_dec, Editor);