@tldraw/editor 3.14.0-canary.d926f92ca8d6 → 3.14.0-canary.db789786fb06

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 (237) hide show
  1. package/dist-cjs/index.d.ts +212 -117
  2. package/dist-cjs/index.js +11 -8
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/config/TLSessionStateSnapshot.js +1 -12
  5. package/dist-cjs/lib/config/TLSessionStateSnapshot.js.map +3 -3
  6. package/dist-cjs/lib/editor/Editor.js +131 -99
  7. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  8. package/dist-cjs/lib/editor/bindings/BindingUtil.js.map +2 -2
  9. package/dist-cjs/lib/editor/derivations/bindingsIndex.js +22 -22
  10. package/dist-cjs/lib/editor/derivations/bindingsIndex.js.map +2 -2
  11. package/dist-cjs/lib/editor/derivations/parentsToChildren.js +16 -16
  12. package/dist-cjs/lib/editor/derivations/parentsToChildren.js.map +2 -2
  13. package/dist-cjs/lib/editor/managers/{ClickManager.js → ClickManager/ClickManager.js} +1 -1
  14. package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +7 -0
  15. package/dist-cjs/lib/editor/managers/{EdgeScrollManager.js → EdgeScrollManager/EdgeScrollManager.js} +2 -2
  16. package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js.map +7 -0
  17. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +7 -0
  18. package/dist-cjs/lib/editor/managers/{FontManager.js → FontManager/FontManager.js} +4 -1
  19. package/dist-cjs/lib/editor/managers/FontManager/FontManager.js.map +7 -0
  20. package/dist-cjs/lib/editor/managers/{HistoryManager.js → HistoryManager/HistoryManager.js} +67 -7
  21. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +7 -0
  22. package/dist-cjs/lib/editor/managers/{ScribbleManager.js → ScribbleManager/ScribbleManager.js} +1 -1
  23. package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js.map +7 -0
  24. package/dist-cjs/lib/editor/managers/{TextManager.js → TextManager/TextManager.js} +73 -42
  25. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +7 -0
  26. package/dist-cjs/lib/editor/managers/{TickManager.js → TickManager/TickManager.js} +1 -1
  27. package/dist-cjs/lib/editor/managers/TickManager/TickManager.js.map +7 -0
  28. package/dist-cjs/lib/editor/managers/{UserPreferencesManager.js → UserPreferencesManager/UserPreferencesManager.js} +1 -1
  29. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +7 -0
  30. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +0 -10
  31. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  32. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js +1 -1
  33. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +1 -1
  34. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +10 -6
  35. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +3 -3
  36. package/dist-cjs/lib/editor/tools/StateNode.js +3 -3
  37. package/dist-cjs/lib/editor/tools/StateNode.js.map +2 -2
  38. package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
  39. package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
  40. package/dist-cjs/lib/exports/getSvgJsx.js.map +1 -1
  41. package/dist-cjs/lib/hooks/useCanvasEvents.js +1 -2
  42. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  43. package/dist-cjs/lib/primitives/Box.js +33 -33
  44. package/dist-cjs/lib/primitives/Box.js.map +2 -2
  45. package/dist-cjs/lib/primitives/Vec.js +13 -8
  46. package/dist-cjs/lib/primitives/Vec.js.map +2 -2
  47. package/dist-cjs/lib/primitives/geometry/Arc2d.js +41 -21
  48. package/dist-cjs/lib/primitives/geometry/Arc2d.js.map +2 -2
  49. package/dist-cjs/lib/primitives/geometry/Circle2d.js +11 -11
  50. package/dist-cjs/lib/primitives/geometry/Circle2d.js.map +2 -2
  51. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js +13 -16
  52. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js.map +2 -2
  53. package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js +4 -4
  54. package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js.map +2 -2
  55. package/dist-cjs/lib/primitives/geometry/Edge2d.js +14 -17
  56. package/dist-cjs/lib/primitives/geometry/Edge2d.js.map +2 -2
  57. package/dist-cjs/lib/primitives/geometry/Ellipse2d.js +10 -10
  58. package/dist-cjs/lib/primitives/geometry/Ellipse2d.js.map +2 -2
  59. package/dist-cjs/lib/primitives/geometry/Geometry2d.js +6 -2
  60. package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
  61. package/dist-cjs/lib/primitives/geometry/Point2d.js +6 -6
  62. package/dist-cjs/lib/primitives/geometry/Point2d.js.map +2 -2
  63. package/dist-cjs/lib/primitives/geometry/Polygon2d.js +3 -0
  64. package/dist-cjs/lib/primitives/geometry/Polygon2d.js.map +2 -2
  65. package/dist-cjs/lib/primitives/geometry/Polyline2d.js +8 -5
  66. package/dist-cjs/lib/primitives/geometry/Polyline2d.js.map +2 -2
  67. package/dist-cjs/lib/primitives/geometry/Rectangle2d.js +22 -11
  68. package/dist-cjs/lib/primitives/geometry/Rectangle2d.js.map +2 -2
  69. package/dist-cjs/lib/primitives/geometry/Stadium2d.js +22 -22
  70. package/dist-cjs/lib/primitives/geometry/Stadium2d.js.map +2 -2
  71. package/dist-cjs/lib/utils/reorderShapes.js +11 -10
  72. package/dist-cjs/lib/utils/reorderShapes.js.map +2 -2
  73. package/dist-cjs/lib/utils/reparenting.js +232 -0
  74. package/dist-cjs/lib/utils/reparenting.js.map +7 -0
  75. package/dist-cjs/lib/utils/richText.js +7 -2
  76. package/dist-cjs/lib/utils/richText.js.map +2 -2
  77. package/dist-cjs/version.js +3 -3
  78. package/dist-cjs/version.js.map +1 -1
  79. package/dist-esm/index.d.mts +212 -117
  80. package/dist-esm/index.mjs +15 -8
  81. package/dist-esm/index.mjs.map +2 -2
  82. package/dist-esm/lib/config/TLSessionStateSnapshot.mjs +1 -1
  83. package/dist-esm/lib/config/TLSessionStateSnapshot.mjs.map +2 -2
  84. package/dist-esm/lib/editor/Editor.mjs +131 -99
  85. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  86. package/dist-esm/lib/editor/bindings/BindingUtil.mjs.map +2 -2
  87. package/dist-esm/lib/editor/derivations/bindingsIndex.mjs +22 -22
  88. package/dist-esm/lib/editor/derivations/bindingsIndex.mjs.map +2 -2
  89. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs +16 -16
  90. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs.map +2 -2
  91. package/dist-esm/lib/editor/managers/{ClickManager.mjs → ClickManager/ClickManager.mjs} +1 -1
  92. package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +7 -0
  93. package/dist-esm/lib/editor/managers/{EdgeScrollManager.mjs → EdgeScrollManager/EdgeScrollManager.mjs} +2 -2
  94. package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs.map +7 -0
  95. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +7 -0
  96. package/dist-esm/lib/editor/managers/{FontManager.mjs → FontManager/FontManager.mjs} +4 -1
  97. package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs.map +7 -0
  98. package/dist-esm/lib/editor/managers/{HistoryManager.mjs → HistoryManager/HistoryManager.mjs} +63 -3
  99. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +7 -0
  100. package/dist-esm/lib/editor/managers/{ScribbleManager.mjs → ScribbleManager/ScribbleManager.mjs} +1 -1
  101. package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs.map +7 -0
  102. package/dist-esm/lib/editor/managers/{TextManager.mjs → TextManager/TextManager.mjs} +73 -42
  103. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +7 -0
  104. package/dist-esm/lib/editor/managers/{TickManager.mjs → TickManager/TickManager.mjs} +1 -1
  105. package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs.map +7 -0
  106. package/dist-esm/lib/editor/managers/{UserPreferencesManager.mjs → UserPreferencesManager/UserPreferencesManager.mjs} +1 -1
  107. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +7 -0
  108. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +0 -10
  109. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  110. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs +1 -1
  111. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +1 -1
  112. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +10 -6
  113. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +3 -3
  114. package/dist-esm/lib/editor/tools/StateNode.mjs +3 -3
  115. package/dist-esm/lib/editor/tools/StateNode.mjs.map +2 -2
  116. package/dist-esm/lib/exports/getSvgJsx.mjs.map +1 -1
  117. package/dist-esm/lib/hooks/useCanvasEvents.mjs +1 -2
  118. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  119. package/dist-esm/lib/primitives/Box.mjs +33 -33
  120. package/dist-esm/lib/primitives/Box.mjs.map +2 -2
  121. package/dist-esm/lib/primitives/Vec.mjs +13 -8
  122. package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
  123. package/dist-esm/lib/primitives/geometry/Arc2d.mjs +41 -21
  124. package/dist-esm/lib/primitives/geometry/Arc2d.mjs.map +2 -2
  125. package/dist-esm/lib/primitives/geometry/Circle2d.mjs +11 -11
  126. package/dist-esm/lib/primitives/geometry/Circle2d.mjs.map +2 -2
  127. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs +13 -16
  128. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs.map +2 -2
  129. package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs +4 -4
  130. package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs.map +2 -2
  131. package/dist-esm/lib/primitives/geometry/Edge2d.mjs +14 -17
  132. package/dist-esm/lib/primitives/geometry/Edge2d.mjs.map +2 -2
  133. package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs +11 -11
  134. package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs.map +2 -2
  135. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +6 -2
  136. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  137. package/dist-esm/lib/primitives/geometry/Point2d.mjs +6 -6
  138. package/dist-esm/lib/primitives/geometry/Point2d.mjs.map +2 -2
  139. package/dist-esm/lib/primitives/geometry/Polygon2d.mjs +3 -0
  140. package/dist-esm/lib/primitives/geometry/Polygon2d.mjs.map +2 -2
  141. package/dist-esm/lib/primitives/geometry/Polyline2d.mjs +8 -5
  142. package/dist-esm/lib/primitives/geometry/Polyline2d.mjs.map +2 -2
  143. package/dist-esm/lib/primitives/geometry/Rectangle2d.mjs +22 -11
  144. package/dist-esm/lib/primitives/geometry/Rectangle2d.mjs.map +2 -2
  145. package/dist-esm/lib/primitives/geometry/Stadium2d.mjs +22 -22
  146. package/dist-esm/lib/primitives/geometry/Stadium2d.mjs.map +2 -2
  147. package/dist-esm/lib/utils/reorderShapes.mjs +11 -10
  148. package/dist-esm/lib/utils/reorderShapes.mjs.map +2 -2
  149. package/dist-esm/lib/utils/reparenting.mjs +216 -0
  150. package/dist-esm/lib/utils/reparenting.mjs.map +7 -0
  151. package/dist-esm/lib/utils/richText.mjs +8 -3
  152. package/dist-esm/lib/utils/richText.mjs.map +2 -2
  153. package/dist-esm/version.mjs +3 -3
  154. package/dist-esm/version.mjs.map +1 -1
  155. package/editor.css +442 -492
  156. package/package.json +8 -9
  157. package/src/index.ts +20 -7
  158. package/src/lib/config/TLSessionStateSnapshot.ts +1 -1
  159. package/src/lib/editor/Editor.test.ts +252 -3
  160. package/src/lib/editor/Editor.ts +149 -107
  161. package/src/lib/editor/bindings/BindingUtil.ts +6 -0
  162. package/src/lib/editor/derivations/bindingsIndex.ts +27 -26
  163. package/src/lib/editor/derivations/parentsToChildren.ts +28 -25
  164. package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +442 -0
  165. package/src/lib/editor/managers/{ClickManager.ts → ClickManager/ClickManager.ts} +3 -3
  166. package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +374 -0
  167. package/src/lib/editor/managers/{EdgeScrollManager.ts → EdgeScrollManager/EdgeScrollManager.ts} +3 -3
  168. package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +455 -0
  169. package/src/lib/editor/managers/{FocusManager.ts → FocusManager/FocusManager.ts} +1 -1
  170. package/src/lib/editor/managers/FontManager/FontManager.test.ts +263 -0
  171. package/src/lib/editor/managers/{FontManager.ts → FontManager/FontManager.ts} +5 -2
  172. package/src/lib/editor/managers/{HistoryManager.test.ts → HistoryManager/HistoryManager.test.ts} +388 -1
  173. package/src/lib/editor/managers/{HistoryManager.ts → HistoryManager/HistoryManager.ts} +76 -3
  174. package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +624 -0
  175. package/src/lib/editor/managers/{ScribbleManager.ts → ScribbleManager/ScribbleManager.ts} +2 -2
  176. package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +485 -0
  177. package/src/lib/editor/managers/TextManager/TextManager.test.ts +407 -0
  178. package/src/lib/editor/managers/{TextManager.ts → TextManager/TextManager.ts} +119 -87
  179. package/src/lib/editor/managers/TickManager/TickManager.test.ts +314 -0
  180. package/src/lib/editor/managers/{TickManager.ts → TickManager/TickManager.ts} +2 -2
  181. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +591 -0
  182. package/src/lib/editor/managers/{UserPreferencesManager.ts → UserPreferencesManager/UserPreferencesManager.ts} +2 -2
  183. package/src/lib/editor/shapes/ShapeUtil.ts +48 -16
  184. package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +1 -1
  185. package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +22 -17
  186. package/src/lib/editor/tools/StateNode.ts +3 -3
  187. package/src/lib/editor/types/emit-types.ts +4 -0
  188. package/src/lib/editor/types/external-content.ts +11 -2
  189. package/src/lib/exports/getSvgJsx.tsx +1 -1
  190. package/src/lib/hooks/useCanvasEvents.ts +0 -1
  191. package/src/lib/primitives/Box.test.ts +588 -7
  192. package/src/lib/primitives/Box.ts +33 -33
  193. package/src/lib/primitives/Vec.test.ts +2 -2
  194. package/src/lib/primitives/Vec.ts +13 -8
  195. package/src/lib/primitives/geometry/Arc2d.ts +42 -23
  196. package/src/lib/primitives/geometry/Circle2d.ts +12 -12
  197. package/src/lib/primitives/geometry/CubicBezier2d.test.ts +5 -0
  198. package/src/lib/primitives/geometry/CubicBezier2d.ts +13 -17
  199. package/src/lib/primitives/geometry/CubicSpline2d.ts +5 -5
  200. package/src/lib/primitives/geometry/Edge2d.ts +14 -18
  201. package/src/lib/primitives/geometry/Ellipse2d.ts +12 -13
  202. package/src/lib/primitives/geometry/Geometry2d.ts +7 -2
  203. package/src/lib/primitives/geometry/Point2d.ts +6 -6
  204. package/src/lib/primitives/geometry/Polygon2d.ts +4 -0
  205. package/src/lib/primitives/geometry/Polyline2d.ts +10 -7
  206. package/src/lib/primitives/geometry/Rectangle2d.ts +24 -11
  207. package/src/lib/primitives/geometry/Stadium2d.ts +22 -23
  208. package/src/lib/utils/reorderShapes.ts +10 -13
  209. package/src/lib/utils/reparenting.ts +383 -0
  210. package/src/lib/utils/richText.ts +10 -4
  211. package/src/version.ts +3 -3
  212. package/dist-cjs/lib/editor/managers/ClickManager.js.map +0 -7
  213. package/dist-cjs/lib/editor/managers/EdgeScrollManager.js.map +0 -7
  214. package/dist-cjs/lib/editor/managers/FocusManager.js.map +0 -7
  215. package/dist-cjs/lib/editor/managers/FontManager.js.map +0 -7
  216. package/dist-cjs/lib/editor/managers/HistoryManager.js.map +0 -7
  217. package/dist-cjs/lib/editor/managers/ScribbleManager.js.map +0 -7
  218. package/dist-cjs/lib/editor/managers/Stack.js +0 -82
  219. package/dist-cjs/lib/editor/managers/Stack.js.map +0 -7
  220. package/dist-cjs/lib/editor/managers/TextManager.js.map +0 -7
  221. package/dist-cjs/lib/editor/managers/TickManager.js.map +0 -7
  222. package/dist-cjs/lib/editor/managers/UserPreferencesManager.js.map +0 -7
  223. package/dist-esm/lib/editor/managers/ClickManager.mjs.map +0 -7
  224. package/dist-esm/lib/editor/managers/EdgeScrollManager.mjs.map +0 -7
  225. package/dist-esm/lib/editor/managers/FocusManager.mjs.map +0 -7
  226. package/dist-esm/lib/editor/managers/FontManager.mjs.map +0 -7
  227. package/dist-esm/lib/editor/managers/HistoryManager.mjs.map +0 -7
  228. package/dist-esm/lib/editor/managers/ScribbleManager.mjs.map +0 -7
  229. package/dist-esm/lib/editor/managers/Stack.mjs +0 -62
  230. package/dist-esm/lib/editor/managers/Stack.mjs.map +0 -7
  231. package/dist-esm/lib/editor/managers/TextManager.mjs.map +0 -7
  232. package/dist-esm/lib/editor/managers/TickManager.mjs.map +0 -7
  233. package/dist-esm/lib/editor/managers/UserPreferencesManager.mjs.map +0 -7
  234. package/src/lib/editor/managers/ScribbleManager.test.ts +0 -32
  235. package/src/lib/editor/managers/Stack.ts +0 -71
  236. /package/dist-cjs/lib/editor/managers/{FocusManager.js → FocusManager/FocusManager.js} +0 -0
  237. /package/dist-esm/lib/editor/managers/{FocusManager.mjs → FocusManager/FocusManager.mjs} +0 -0
package/dist-cjs/index.js CHANGED
@@ -128,6 +128,7 @@ __export(index_exports, {
128
128
  getArcMeasure: () => import_utils2.getArcMeasure,
129
129
  getCursor: () => import_useCursor.getCursor,
130
130
  getDefaultCdnBaseUrl: () => import_assets.getDefaultCdnBaseUrl,
131
+ getDroppedShapesToNewParents: () => import_reparenting.getDroppedShapesToNewParents,
131
132
  getFontsFromRichText: () => import_richText.getFontsFromRichText,
132
133
  getFreshUserPreferences: () => import_TLUserPreferences.getFreshUserPreferences,
133
134
  getIncrementedName: () => import_getIncrementedName.getIncrementedName,
@@ -156,6 +157,7 @@ __export(index_exports, {
156
157
  intersectPolygonPolygon: () => import_intersect.intersectPolygonPolygon,
157
158
  isAccelKey: () => import_keyboard.isAccelKey,
158
159
  isSafeFloat: () => import_utils2.isSafeFloat,
160
+ kickoutOccludedShapes: () => import_reparenting.kickoutOccludedShapes,
159
161
  linesIntersect: () => import_intersect.linesIntersect,
160
162
  loadSessionStateSnapshotIntoStore: () => import_TLSessionStateSnapshot.loadSessionStateSnapshotIntoStore,
161
163
  loadSnapshot: () => import_TLEditorSnapshot.loadSnapshot,
@@ -269,16 +271,16 @@ var import_defaultShapes = require("./lib/config/defaultShapes");
269
271
  var import_constants = require("./lib/constants");
270
272
  var import_Editor = require("./lib/editor/Editor");
271
273
  var import_BindingUtil = require("./lib/editor/bindings/BindingUtil");
272
- var import_ClickManager = require("./lib/editor/managers/ClickManager");
273
- var import_EdgeScrollManager = require("./lib/editor/managers/EdgeScrollManager");
274
- var import_FontManager = require("./lib/editor/managers/FontManager");
275
- var import_HistoryManager = require("./lib/editor/managers/HistoryManager");
276
- var import_ScribbleManager = require("./lib/editor/managers/ScribbleManager");
274
+ var import_ClickManager = require("./lib/editor/managers/ClickManager/ClickManager");
275
+ var import_EdgeScrollManager = require("./lib/editor/managers/EdgeScrollManager/EdgeScrollManager");
276
+ var import_FontManager = require("./lib/editor/managers/FontManager/FontManager");
277
+ var import_HistoryManager = require("./lib/editor/managers/HistoryManager/HistoryManager");
278
+ var import_ScribbleManager = require("./lib/editor/managers/ScribbleManager/ScribbleManager");
277
279
  var import_BoundsSnaps = require("./lib/editor/managers/SnapManager/BoundsSnaps");
278
280
  var import_HandleSnaps = require("./lib/editor/managers/SnapManager/HandleSnaps");
279
281
  var import_SnapManager = require("./lib/editor/managers/SnapManager/SnapManager");
280
- var import_TextManager = require("./lib/editor/managers/TextManager");
281
- var import_UserPreferencesManager = require("./lib/editor/managers/UserPreferencesManager");
282
+ var import_TextManager = require("./lib/editor/managers/TextManager/TextManager");
283
+ var import_UserPreferencesManager = require("./lib/editor/managers/UserPreferencesManager/UserPreferencesManager");
282
284
  var import_BaseBoxShapeUtil = require("./lib/editor/shapes/BaseBoxShapeUtil");
283
285
  var import_ShapeUtil = require("./lib/editor/shapes/ShapeUtil");
284
286
  var import_GroupShapeUtil = require("./lib/editor/shapes/group/GroupShapeUtil");
@@ -349,6 +351,7 @@ var import_hardResetEditor = require("./lib/utils/hardResetEditor");
349
351
  var import_keyboard = require("./lib/utils/keyboard");
350
352
  var import_normalizeWheel = require("./lib/utils/normalizeWheel");
351
353
  var import_refreshPage = require("./lib/utils/refreshPage");
354
+ var import_reparenting = require("./lib/utils/reparenting");
352
355
  var import_richText = require("./lib/utils/richText");
353
356
  var import_rotation = require("./lib/utils/rotation");
354
357
  var import_runtime = require("./lib/utils/runtime");
@@ -361,7 +364,7 @@ function debugEnableLicensing() {
361
364
  }
362
365
  (0, import_utils.registerTldrawLibraryVersion)(
363
366
  "@tldraw/editor",
364
- "3.14.0-canary.d926f92ca8d6",
367
+ "3.14.0-canary.db789786fb06",
365
368
  "cjs"
366
369
  );
367
370
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\n\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\n\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tTAB_ID,\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tUSER_COLORS,\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager'\nexport { ScribbleManager, type ScribbleItem } from './lib/editor/managers/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { TextManager, type TLMeasureTextSpanOpts } from './lib/editor/managers/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLSvgOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport { EditorContext, useEditor, useMaybeEditor } from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport {\n\tHALF_PI,\n\tPI,\n\tPI2,\n\tSIN,\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TLTextOptions,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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GP,yBAiCO;AA0CP,2BAA8B;AAC9B,yBAAsB;AACtB,mBAAwB;AACxB,kBAAuB;AACvB,0BAKO;AACP,uBAA0B;AAC1B,uBAAyD;AACzD,iCAAoC;AAEpC,sBAA2C;AAC3C,iCAAoC;AACpC,yBAAkE;AAClE,2BAA8B;AAC9B,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2CAA8C;AAC9C,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,gCAAmC;AACnC,wBAAiD;AACjD,0BAA6B;AAC7B,+BAAkC;AAClC,4BAQO;AACP,qBAAyD;AACzD,iBASO;AACP,iBAAiD;AACjD,iBAAkC;AAClC,qBAAwB;AACxB,mBAAsB;AACtB,sBAAyB;AACzB,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAAuB;AACvB,uBAA0B;AAC1B,wBAMO;AACP,qBAAwB;AACxB,qBAAwB;AACxB,uBAA0B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,uBAA0B;AAC1B,uBAaO;AACP,IAAAC,gBAgCO;AACP,6BAIO;AACP,oBAAoD;AACpD,kCAAgE;AAChE,yBAMO;AACP,uBAKO;AACP,iBAOO;AACP,gCAAmC;AACnC,4BAA+B;AAC/B,kCAAqC;AACrC,6BAAgC;AAChC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAA4B;AAC5B,sBAOO;AACP,sBAIO;AACP,qBAA6C;AAC7C,4BAAsD;AAEtD,uBAA0B;AAC1B,kBAAqB;AACrB,yBAA2B;AAKpB,SAAS,uBAAuB;AAEtC;AACD;AAAA,IAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\n\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\n\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tTAB_ID,\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tUSER_COLORS,\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport {\n\tTextManager,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLSvgOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport { EditorContext, useEditor, useMaybeEditor } from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport {\n\tHALF_PI,\n\tPI,\n\tPI2,\n\tSIN,\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TLTextOptions,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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B,kCAAqC;AACrC,6BAAgC;AAChC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAA4B;AAC5B,yBAAoE;AACpE,sBAOO;AACP,sBAIO;AACP,qBAA6C;AAC7C,4BAAsD;AAEtD,uBAA0B;AAC1B,kBAAqB;AACrB,yBAA2B;AAKpB,SAAS,uBAAuB;AAEtC;AACD;AAAA,IAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": ["import_at", "import_utils"]
7
7
  }
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var TLSessionStateSnapshot_exports = {};
30
20
  __export(TLSessionStateSnapshot_exports, {
@@ -38,7 +28,6 @@ var import_state = require("@tldraw/state");
38
28
  var import_tlschema = require("@tldraw/tlschema");
39
29
  var import_utils = require("@tldraw/utils");
40
30
  var import_validate = require("@tldraw/validate");
41
- var import_lodash = __toESM(require("lodash.isequal"));
42
31
  var import_environment = require("../globals/environment");
43
32
  const tabIdKey = "TLDRAW_TAB_ID_v2";
44
33
  const window = globalThis.window;
@@ -144,7 +133,7 @@ function createSessionStateSnapshotSignal(store) {
144
133
  })
145
134
  };
146
135
  },
147
- { isEqual: import_lodash.default }
136
+ { isEqual: import_utils.isEqual }
148
137
  );
149
138
  }
150
139
  function loadSessionStateSnapshotIntoStore(store, snapshot, opts) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/config/TLSessionStateSnapshot.ts"],
4
- "sourcesContent": ["import { Signal, computed } from '@tldraw/state'\nimport { UnknownRecord } from '@tldraw/store'\nimport {\n\tCameraRecordType,\n\tInstancePageStateRecordType,\n\tTLINSTANCE_ID,\n\tTLPageId,\n\tTLShapeId,\n\tTLStore,\n\tpageIdValidator,\n\tpluckPreservingValues,\n\tshapeIdValidator,\n} from '@tldraw/tlschema'\nimport {\n\tdeleteFromSessionStorage,\n\tgetFromSessionStorage,\n\tsetInSessionStorage,\n\tstructuredClone,\n\tuniqueId,\n} from '@tldraw/utils'\nimport { T } from '@tldraw/validate'\nimport isEqual from 'lodash.isequal'\nimport { tlenv } from '../globals/environment'\n\nconst tabIdKey = 'TLDRAW_TAB_ID_v2' as const\n\nconst window = globalThis.window as\n\t| {\n\t\t\tnavigator: Window['navigator']\n\t\t\taddEventListener: Window['addEventListener']\n\t\t\tTLDRAW_TAB_ID_v2?: string\n\t }\n\t| undefined\n\n// https://stackoverflow.com/a/9039885\nfunction iOS() {\n\tif (!window) return false\n\treturn (\n\t\t['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\t\twindow.navigator.platform\n\t\t) ||\n\t\t// iPad on iOS 13 detection\n\t\t(tlenv.isDarwin && 'ontouchend' in document)\n\t)\n}\n\n/**\n * A string that is unique per browser tab\n * @public\n */\nexport const TAB_ID: string = window\n\t? (window[tabIdKey] ??\n\t\tgetFromSessionStorage(tabIdKey) ??\n\t\t`TLDRAW_INSTANCE_STATE_V1_` + uniqueId())\n\t: '<error>'\nif (window) {\n\twindow[tabIdKey] = TAB_ID\n\tif (iOS()) {\n\t\t// iOS does not trigger beforeunload\n\t\t// so we need to keep the sessionStorage value around\n\t\t// and hope the user doesn't figure out a way to duplicate their tab\n\t\t// in which case they'll have two tabs with the same UI state.\n\t\t// It's not a big deal, but it's not ideal.\n\t\t// And anyway I can't see a way to duplicate a tab in iOS Safari.\n\t\tsetInSessionStorage(tabIdKey, TAB_ID)\n\t} else {\n\t\tdeleteFromSessionStorage(tabIdKey)\n\t}\n}\n\nwindow?.addEventListener('beforeunload', () => {\n\tsetInSessionStorage(tabIdKey, TAB_ID)\n})\n\nconst Versions = {\n\tInitial: 0,\n} as const\n\nconst CURRENT_SESSION_STATE_SNAPSHOT_VERSION = Math.max(...Object.values(Versions))\n\nfunction migrate(snapshot: any) {\n\tif (snapshot.version < Versions.Initial) {\n\t\t// initial version\n\t\t// noop\n\t}\n\t// add further migrations down here. see TLUserPreferences.ts for an example.\n\n\t// finally\n\tsnapshot.version = CURRENT_SESSION_STATE_SNAPSHOT_VERSION\n}\n\n/**\n * The state of the editor instance, not including any document state.\n *\n * @public\n */\nexport interface TLSessionStateSnapshot {\n\tversion: number\n\tcurrentPageId?: TLPageId\n\tisFocusMode?: boolean\n\texportBackground?: boolean\n\tisDebugMode?: boolean\n\tisToolLocked?: boolean\n\tisGridMode?: boolean\n\tpageStates?: Array<{\n\t\tpageId: TLPageId\n\t\tcamera?: { x: number; y: number; z: number }\n\t\tselectedShapeIds?: TLShapeId[]\n\t\tfocusedGroupId?: TLShapeId | null\n\t}>\n}\n\nconst sessionStateSnapshotValidator: T.Validator<TLSessionStateSnapshot> = T.object({\n\tversion: T.number,\n\tcurrentPageId: pageIdValidator.optional(),\n\tisFocusMode: T.boolean.optional(),\n\texportBackground: T.boolean.optional(),\n\tisDebugMode: T.boolean.optional(),\n\tisToolLocked: T.boolean.optional(),\n\tisGridMode: T.boolean.optional(),\n\tpageStates: T.arrayOf(\n\t\tT.object({\n\t\t\tpageId: pageIdValidator,\n\t\t\tcamera: T.object({\n\t\t\t\tx: T.number,\n\t\t\t\ty: T.number,\n\t\t\t\tz: T.number,\n\t\t\t}).optional(),\n\t\t\tselectedShapeIds: T.arrayOf(shapeIdValidator).optional(),\n\t\t\tfocusedGroupId: shapeIdValidator.nullable().optional(),\n\t\t})\n\t).optional(),\n})\n\nfunction migrateAndValidateSessionStateSnapshot(state: unknown): TLSessionStateSnapshot | null {\n\tif (!state || typeof state !== 'object') {\n\t\tconsole.warn('Invalid instance state')\n\t\treturn null\n\t}\n\tif (!('version' in state) || typeof state.version !== 'number') {\n\t\tconsole.warn('No version in instance state')\n\t\treturn null\n\t}\n\tif (state.version !== CURRENT_SESSION_STATE_SNAPSHOT_VERSION) {\n\t\tstate = structuredClone(state)\n\t\tmigrate(state)\n\t}\n\n\ttry {\n\t\treturn sessionStateSnapshotValidator.validate(state)\n\t} catch (e) {\n\t\tconsole.warn(e)\n\t\treturn null\n\t}\n}\n\n/**\n * Creates a signal of the instance state for a given store.\n * @public\n * @param store - The store to create the instance state snapshot signal for\n * @returns\n */\nexport function createSessionStateSnapshotSignal(\n\tstore: TLStore\n): Signal<TLSessionStateSnapshot | null> {\n\tconst $allPageIds = store.query.ids('page')\n\n\treturn computed<TLSessionStateSnapshot | null>(\n\t\t'sessionStateSnapshot',\n\t\t() => {\n\t\t\tconst instanceState = store.get(TLINSTANCE_ID)\n\t\t\tif (!instanceState) return null\n\n\t\t\tconst allPageIds = [...$allPageIds.get()]\n\t\t\treturn {\n\t\t\t\tversion: CURRENT_SESSION_STATE_SNAPSHOT_VERSION,\n\t\t\t\tcurrentPageId: instanceState.currentPageId,\n\t\t\t\texportBackground: instanceState.exportBackground,\n\t\t\t\tisFocusMode: instanceState.isFocusMode,\n\t\t\t\tisDebugMode: instanceState.isDebugMode,\n\t\t\t\tisToolLocked: instanceState.isToolLocked,\n\t\t\t\tisGridMode: instanceState.isGridMode,\n\t\t\t\tpageStates: allPageIds.map((id) => {\n\t\t\t\t\tconst ps = store.get(InstancePageStateRecordType.createId(id))\n\t\t\t\t\tconst camera = store.get(CameraRecordType.createId(id))\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpageId: id,\n\t\t\t\t\t\tcamera: {\n\t\t\t\t\t\t\tx: camera?.x ?? 0,\n\t\t\t\t\t\t\ty: camera?.y ?? 0,\n\t\t\t\t\t\t\tz: camera?.z ?? 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectedShapeIds: ps?.selectedShapeIds ?? [],\n\t\t\t\t\t\tfocusedGroupId: ps?.focusedGroupId ?? null,\n\t\t\t\t\t} satisfies NonNullable<TLSessionStateSnapshot['pageStates']>[0]\n\t\t\t\t}),\n\t\t\t} satisfies TLSessionStateSnapshot\n\t\t},\n\t\t{ isEqual }\n\t)\n}\n\n/**\n * Options for {@link loadSessionStateSnapshotIntoStore}\n * @public\n */\nexport interface TLLoadSessionStateSnapshotOptions {\n\t/**\n\t * By default, some session state flags like `isDebugMode` are not overwritten when loading a snapshot.\n\t * These are usually considered \"sticky\" by users while the document data is not.\n\t * If you want to overwrite these flags, set this to `true`.\n\t */\n\tforceOverwrite?: boolean\n}\n\n/**\n * Loads a snapshot of the editor's instance state into the store of a new editor instance.\n *\n * @public\n * @param store - The store to load the instance state into\n * @param snapshot - The instance state snapshot to load\n * @returns\n */\nexport function loadSessionStateSnapshotIntoStore(\n\tstore: TLStore,\n\tsnapshot: TLSessionStateSnapshot,\n\topts?: TLLoadSessionStateSnapshotOptions\n) {\n\tconst res = migrateAndValidateSessionStateSnapshot(snapshot)\n\tif (!res) return\n\n\tconst preserved = pluckPreservingValues(store.get(TLINSTANCE_ID))\n\tconst primary = opts?.forceOverwrite ? res : preserved\n\tconst secondary = opts?.forceOverwrite ? preserved : res\n\n\tconst instanceState = store.schema.types.instance.create({\n\t\tid: TLINSTANCE_ID,\n\t\t...preserved,\n\t\t// the integrity checker will ensure that the currentPageId is valid\n\t\tcurrentPageId: res.currentPageId,\n\t\tisDebugMode: primary?.isDebugMode ?? secondary?.isDebugMode,\n\t\tisFocusMode: primary?.isFocusMode ?? secondary?.isFocusMode,\n\t\tisToolLocked: primary?.isToolLocked ?? secondary?.isToolLocked,\n\t\tisGridMode: primary?.isGridMode ?? secondary?.isGridMode,\n\t\texportBackground: primary?.exportBackground ?? secondary?.exportBackground,\n\t})\n\n\tstore.atomic(() => {\n\t\tfor (const ps of res.pageStates ?? []) {\n\t\t\tif (!store.has(ps.pageId)) continue\n\t\t\tconst cameraId = CameraRecordType.createId(ps.pageId)\n\t\t\tconst instancePageState = InstancePageStateRecordType.createId(ps.pageId)\n\t\t\tconst previousCamera = store.get(cameraId)\n\t\t\tconst previousInstanceState = store.get(instancePageState)\n\t\t\tstore.put([\n\t\t\t\tCameraRecordType.create({\n\t\t\t\t\tid: cameraId,\n\t\t\t\t\tx: ps.camera?.x ?? previousCamera?.x,\n\t\t\t\t\ty: ps.camera?.y ?? previousCamera?.y,\n\t\t\t\t\tz: ps.camera?.z ?? previousCamera?.z,\n\t\t\t\t}),\n\t\t\t\tInstancePageStateRecordType.create({\n\t\t\t\t\tid: instancePageState,\n\t\t\t\t\tpageId: ps.pageId,\n\t\t\t\t\tselectedShapeIds: ps.selectedShapeIds ?? previousInstanceState?.selectedShapeIds,\n\t\t\t\t\tfocusedGroupId: ps.focusedGroupId ?? previousInstanceState?.focusedGroupId,\n\t\t\t\t}),\n\t\t\t])\n\t\t}\n\n\t\tstore.put([instanceState])\n\t\tstore.ensureStoreIsUsable()\n\t})\n}\n\n/**\n * @internal\n */\nexport function extractSessionStateFromLegacySnapshot(\n\tstore: Record<string, UnknownRecord>\n): TLSessionStateSnapshot | null {\n\tconst instanceRecords = []\n\tfor (const record of Object.values(store)) {\n\t\tif (record.typeName?.match(/^(instance.*|pointer|camera)$/)) {\n\t\t\tinstanceRecords.push(record)\n\t\t}\n\t}\n\n\t// for scratch documents, we need to extract the most recently-used instance and it's associated page states\n\t// but oops we don't have the concept of \"most recently-used\" so we'll just take the first one\n\tconst oldInstance = instanceRecords.filter(\n\t\t(r) => r.typeName === 'instance' && r.id !== TLINSTANCE_ID\n\t)[0] as any\n\tif (!oldInstance) return null\n\n\tconst result: TLSessionStateSnapshot = {\n\t\tversion: CURRENT_SESSION_STATE_SNAPSHOT_VERSION,\n\t\tcurrentPageId: oldInstance.currentPageId,\n\t\texportBackground: !!oldInstance.exportBackground,\n\t\tisFocusMode: !!oldInstance.isFocusMode,\n\t\tisDebugMode: !!oldInstance.isDebugMode,\n\t\tisToolLocked: !!oldInstance.isToolLocked,\n\t\tisGridMode: false,\n\t\tpageStates: instanceRecords\n\t\t\t.filter((r: any) => r.typeName === 'instance_page_state' && r.instanceId === oldInstance.id)\n\t\t\t.map((ps: any) => {\n\t\t\t\tconst camera = (store[ps.cameraId] as any) ?? { x: 0, y: 0, z: 1 }\n\t\t\t\treturn {\n\t\t\t\t\tpageId: ps.pageId,\n\t\t\t\t\tcamera: {\n\t\t\t\t\t\tx: camera.x,\n\t\t\t\t\t\ty: camera.y,\n\t\t\t\t\t\tz: camera.z,\n\t\t\t\t\t},\n\t\t\t\t\tselectedShapeIds: ps.selectedShapeIds,\n\t\t\t\t\tfocusedGroupId: ps.focusedGroupId,\n\t\t\t\t} satisfies NonNullable<TLSessionStateSnapshot['pageStates']>[0]\n\t\t\t}),\n\t}\n\n\ttry {\n\t\tsessionStateSnapshotValidator.validate(result)\n\t\treturn result\n\t} catch {\n\t\treturn null\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AAEjC,sBAUO;AACP,mBAMO;AACP,sBAAkB;AAClB,oBAAoB;AACpB,yBAAsB;AAEtB,MAAM,WAAW;AAEjB,MAAM,SAAS,WAAW;AAS1B,SAAS,MAAM;AACd,MAAI,CAAC,OAAQ,QAAO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A,IACD,CAAC;AAAA,EACH;AAEA,MAAI;AACH,kCAA8B,SAAS,MAAM;AAC7C,WAAO;AAAA,EACR,QAAQ;AACP,WAAO;AAAA,EACR;AACD;",
6
- "names": ["isEqual"]
4
+ "sourcesContent": ["import { Signal, computed } from '@tldraw/state'\nimport { UnknownRecord } from '@tldraw/store'\nimport {\n\tCameraRecordType,\n\tInstancePageStateRecordType,\n\tTLINSTANCE_ID,\n\tTLPageId,\n\tTLShapeId,\n\tTLStore,\n\tpageIdValidator,\n\tpluckPreservingValues,\n\tshapeIdValidator,\n} from '@tldraw/tlschema'\nimport {\n\tdeleteFromSessionStorage,\n\tgetFromSessionStorage,\n\tisEqual,\n\tsetInSessionStorage,\n\tstructuredClone,\n\tuniqueId,\n} from '@tldraw/utils'\nimport { T } from '@tldraw/validate'\nimport { tlenv } from '../globals/environment'\n\nconst tabIdKey = 'TLDRAW_TAB_ID_v2' as const\n\nconst window = globalThis.window as\n\t| {\n\t\t\tnavigator: Window['navigator']\n\t\t\taddEventListener: Window['addEventListener']\n\t\t\tTLDRAW_TAB_ID_v2?: string\n\t }\n\t| undefined\n\n// https://stackoverflow.com/a/9039885\nfunction iOS() {\n\tif (!window) return false\n\treturn (\n\t\t['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\t\twindow.navigator.platform\n\t\t) ||\n\t\t// iPad on iOS 13 detection\n\t\t(tlenv.isDarwin && 'ontouchend' in document)\n\t)\n}\n\n/**\n * A string that is unique per browser tab\n * @public\n */\nexport const TAB_ID: string = window\n\t? (window[tabIdKey] ??\n\t\tgetFromSessionStorage(tabIdKey) ??\n\t\t`TLDRAW_INSTANCE_STATE_V1_` + uniqueId())\n\t: '<error>'\nif (window) {\n\twindow[tabIdKey] = TAB_ID\n\tif (iOS()) {\n\t\t// iOS does not trigger beforeunload\n\t\t// so we need to keep the sessionStorage value around\n\t\t// and hope the user doesn't figure out a way to duplicate their tab\n\t\t// in which case they'll have two tabs with the same UI state.\n\t\t// It's not a big deal, but it's not ideal.\n\t\t// And anyway I can't see a way to duplicate a tab in iOS Safari.\n\t\tsetInSessionStorage(tabIdKey, TAB_ID)\n\t} else {\n\t\tdeleteFromSessionStorage(tabIdKey)\n\t}\n}\n\nwindow?.addEventListener('beforeunload', () => {\n\tsetInSessionStorage(tabIdKey, TAB_ID)\n})\n\nconst Versions = {\n\tInitial: 0,\n} as const\n\nconst CURRENT_SESSION_STATE_SNAPSHOT_VERSION = Math.max(...Object.values(Versions))\n\nfunction migrate(snapshot: any) {\n\tif (snapshot.version < Versions.Initial) {\n\t\t// initial version\n\t\t// noop\n\t}\n\t// add further migrations down here. see TLUserPreferences.ts for an example.\n\n\t// finally\n\tsnapshot.version = CURRENT_SESSION_STATE_SNAPSHOT_VERSION\n}\n\n/**\n * The state of the editor instance, not including any document state.\n *\n * @public\n */\nexport interface TLSessionStateSnapshot {\n\tversion: number\n\tcurrentPageId?: TLPageId\n\tisFocusMode?: boolean\n\texportBackground?: boolean\n\tisDebugMode?: boolean\n\tisToolLocked?: boolean\n\tisGridMode?: boolean\n\tpageStates?: Array<{\n\t\tpageId: TLPageId\n\t\tcamera?: { x: number; y: number; z: number }\n\t\tselectedShapeIds?: TLShapeId[]\n\t\tfocusedGroupId?: TLShapeId | null\n\t}>\n}\n\nconst sessionStateSnapshotValidator: T.Validator<TLSessionStateSnapshot> = T.object({\n\tversion: T.number,\n\tcurrentPageId: pageIdValidator.optional(),\n\tisFocusMode: T.boolean.optional(),\n\texportBackground: T.boolean.optional(),\n\tisDebugMode: T.boolean.optional(),\n\tisToolLocked: T.boolean.optional(),\n\tisGridMode: T.boolean.optional(),\n\tpageStates: T.arrayOf(\n\t\tT.object({\n\t\t\tpageId: pageIdValidator,\n\t\t\tcamera: T.object({\n\t\t\t\tx: T.number,\n\t\t\t\ty: T.number,\n\t\t\t\tz: T.number,\n\t\t\t}).optional(),\n\t\t\tselectedShapeIds: T.arrayOf(shapeIdValidator).optional(),\n\t\t\tfocusedGroupId: shapeIdValidator.nullable().optional(),\n\t\t})\n\t).optional(),\n})\n\nfunction migrateAndValidateSessionStateSnapshot(state: unknown): TLSessionStateSnapshot | null {\n\tif (!state || typeof state !== 'object') {\n\t\tconsole.warn('Invalid instance state')\n\t\treturn null\n\t}\n\tif (!('version' in state) || typeof state.version !== 'number') {\n\t\tconsole.warn('No version in instance state')\n\t\treturn null\n\t}\n\tif (state.version !== CURRENT_SESSION_STATE_SNAPSHOT_VERSION) {\n\t\tstate = structuredClone(state)\n\t\tmigrate(state)\n\t}\n\n\ttry {\n\t\treturn sessionStateSnapshotValidator.validate(state)\n\t} catch (e) {\n\t\tconsole.warn(e)\n\t\treturn null\n\t}\n}\n\n/**\n * Creates a signal of the instance state for a given store.\n * @public\n * @param store - The store to create the instance state snapshot signal for\n * @returns\n */\nexport function createSessionStateSnapshotSignal(\n\tstore: TLStore\n): Signal<TLSessionStateSnapshot | null> {\n\tconst $allPageIds = store.query.ids('page')\n\n\treturn computed<TLSessionStateSnapshot | null>(\n\t\t'sessionStateSnapshot',\n\t\t() => {\n\t\t\tconst instanceState = store.get(TLINSTANCE_ID)\n\t\t\tif (!instanceState) return null\n\n\t\t\tconst allPageIds = [...$allPageIds.get()]\n\t\t\treturn {\n\t\t\t\tversion: CURRENT_SESSION_STATE_SNAPSHOT_VERSION,\n\t\t\t\tcurrentPageId: instanceState.currentPageId,\n\t\t\t\texportBackground: instanceState.exportBackground,\n\t\t\t\tisFocusMode: instanceState.isFocusMode,\n\t\t\t\tisDebugMode: instanceState.isDebugMode,\n\t\t\t\tisToolLocked: instanceState.isToolLocked,\n\t\t\t\tisGridMode: instanceState.isGridMode,\n\t\t\t\tpageStates: allPageIds.map((id) => {\n\t\t\t\t\tconst ps = store.get(InstancePageStateRecordType.createId(id))\n\t\t\t\t\tconst camera = store.get(CameraRecordType.createId(id))\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpageId: id,\n\t\t\t\t\t\tcamera: {\n\t\t\t\t\t\t\tx: camera?.x ?? 0,\n\t\t\t\t\t\t\ty: camera?.y ?? 0,\n\t\t\t\t\t\t\tz: camera?.z ?? 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectedShapeIds: ps?.selectedShapeIds ?? [],\n\t\t\t\t\t\tfocusedGroupId: ps?.focusedGroupId ?? null,\n\t\t\t\t\t} satisfies NonNullable<TLSessionStateSnapshot['pageStates']>[0]\n\t\t\t\t}),\n\t\t\t} satisfies TLSessionStateSnapshot\n\t\t},\n\t\t{ isEqual }\n\t)\n}\n\n/**\n * Options for {@link loadSessionStateSnapshotIntoStore}\n * @public\n */\nexport interface TLLoadSessionStateSnapshotOptions {\n\t/**\n\t * By default, some session state flags like `isDebugMode` are not overwritten when loading a snapshot.\n\t * These are usually considered \"sticky\" by users while the document data is not.\n\t * If you want to overwrite these flags, set this to `true`.\n\t */\n\tforceOverwrite?: boolean\n}\n\n/**\n * Loads a snapshot of the editor's instance state into the store of a new editor instance.\n *\n * @public\n * @param store - The store to load the instance state into\n * @param snapshot - The instance state snapshot to load\n * @returns\n */\nexport function loadSessionStateSnapshotIntoStore(\n\tstore: TLStore,\n\tsnapshot: TLSessionStateSnapshot,\n\topts?: TLLoadSessionStateSnapshotOptions\n) {\n\tconst res = migrateAndValidateSessionStateSnapshot(snapshot)\n\tif (!res) return\n\n\tconst preserved = pluckPreservingValues(store.get(TLINSTANCE_ID))\n\tconst primary = opts?.forceOverwrite ? res : preserved\n\tconst secondary = opts?.forceOverwrite ? preserved : res\n\n\tconst instanceState = store.schema.types.instance.create({\n\t\tid: TLINSTANCE_ID,\n\t\t...preserved,\n\t\t// the integrity checker will ensure that the currentPageId is valid\n\t\tcurrentPageId: res.currentPageId,\n\t\tisDebugMode: primary?.isDebugMode ?? secondary?.isDebugMode,\n\t\tisFocusMode: primary?.isFocusMode ?? secondary?.isFocusMode,\n\t\tisToolLocked: primary?.isToolLocked ?? secondary?.isToolLocked,\n\t\tisGridMode: primary?.isGridMode ?? secondary?.isGridMode,\n\t\texportBackground: primary?.exportBackground ?? secondary?.exportBackground,\n\t})\n\n\tstore.atomic(() => {\n\t\tfor (const ps of res.pageStates ?? []) {\n\t\t\tif (!store.has(ps.pageId)) continue\n\t\t\tconst cameraId = CameraRecordType.createId(ps.pageId)\n\t\t\tconst instancePageState = InstancePageStateRecordType.createId(ps.pageId)\n\t\t\tconst previousCamera = store.get(cameraId)\n\t\t\tconst previousInstanceState = store.get(instancePageState)\n\t\t\tstore.put([\n\t\t\t\tCameraRecordType.create({\n\t\t\t\t\tid: cameraId,\n\t\t\t\t\tx: ps.camera?.x ?? previousCamera?.x,\n\t\t\t\t\ty: ps.camera?.y ?? previousCamera?.y,\n\t\t\t\t\tz: ps.camera?.z ?? previousCamera?.z,\n\t\t\t\t}),\n\t\t\t\tInstancePageStateRecordType.create({\n\t\t\t\t\tid: instancePageState,\n\t\t\t\t\tpageId: ps.pageId,\n\t\t\t\t\tselectedShapeIds: ps.selectedShapeIds ?? previousInstanceState?.selectedShapeIds,\n\t\t\t\t\tfocusedGroupId: ps.focusedGroupId ?? previousInstanceState?.focusedGroupId,\n\t\t\t\t}),\n\t\t\t])\n\t\t}\n\n\t\tstore.put([instanceState])\n\t\tstore.ensureStoreIsUsable()\n\t})\n}\n\n/**\n * @internal\n */\nexport function extractSessionStateFromLegacySnapshot(\n\tstore: Record<string, UnknownRecord>\n): TLSessionStateSnapshot | null {\n\tconst instanceRecords = []\n\tfor (const record of Object.values(store)) {\n\t\tif (record.typeName?.match(/^(instance.*|pointer|camera)$/)) {\n\t\t\tinstanceRecords.push(record)\n\t\t}\n\t}\n\n\t// for scratch documents, we need to extract the most recently-used instance and it's associated page states\n\t// but oops we don't have the concept of \"most recently-used\" so we'll just take the first one\n\tconst oldInstance = instanceRecords.filter(\n\t\t(r) => r.typeName === 'instance' && r.id !== TLINSTANCE_ID\n\t)[0] as any\n\tif (!oldInstance) return null\n\n\tconst result: TLSessionStateSnapshot = {\n\t\tversion: CURRENT_SESSION_STATE_SNAPSHOT_VERSION,\n\t\tcurrentPageId: oldInstance.currentPageId,\n\t\texportBackground: !!oldInstance.exportBackground,\n\t\tisFocusMode: !!oldInstance.isFocusMode,\n\t\tisDebugMode: !!oldInstance.isDebugMode,\n\t\tisToolLocked: !!oldInstance.isToolLocked,\n\t\tisGridMode: false,\n\t\tpageStates: instanceRecords\n\t\t\t.filter((r: any) => r.typeName === 'instance_page_state' && r.instanceId === oldInstance.id)\n\t\t\t.map((ps: any) => {\n\t\t\t\tconst camera = (store[ps.cameraId] as any) ?? { x: 0, y: 0, z: 1 }\n\t\t\t\treturn {\n\t\t\t\t\tpageId: ps.pageId,\n\t\t\t\t\tcamera: {\n\t\t\t\t\t\tx: camera.x,\n\t\t\t\t\t\ty: camera.y,\n\t\t\t\t\t\tz: camera.z,\n\t\t\t\t\t},\n\t\t\t\t\tselectedShapeIds: ps.selectedShapeIds,\n\t\t\t\t\tfocusedGroupId: ps.focusedGroupId,\n\t\t\t\t} satisfies NonNullable<TLSessionStateSnapshot['pageStates']>[0]\n\t\t\t}),\n\t}\n\n\ttry {\n\t\tsessionStateSnapshotValidator.validate(result)\n\t\treturn result\n\t} catch {\n\t\treturn null\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AAEjC,sBAUO;AACP,mBAOO;AACP,sBAAkB;AAClB,yBAAsB;AAEtB,MAAM,WAAW;AAEjB,MAAM,SAAS,WAAW;AAS1B,SAAS,MAAM;AACd,MAAI,CAAC,OAAQ,QAAO;AACpB,SACC,CAAC,kBAAkB,oBAAoB,kBAAkB,QAAQ,UAAU,MAAM,EAAE;AAAA;AAAA,IAElF,OAAO,UAAU;AAAA,EAClB;AAAA,EAEC,yBAAM,YAAY,gBAAgB;AAErC;AAMO,MAAM,SAAiB,SAC1B,OAAO,QAAQ,SACjB,oCAA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