@tldraw/editor 3.14.0-canary.95353287a2be → 3.14.0-canary.9635d3157d9b

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 (221) hide show
  1. package/dist-cjs/index.d.ts +103 -104
  2. package/dist-cjs/index.js +8 -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 +52 -77
  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/notVisibleShapes.js +16 -20
  12. package/dist-cjs/lib/editor/derivations/notVisibleShapes.js.map +3 -3
  13. package/dist-cjs/lib/editor/derivations/parentsToChildren.js +16 -16
  14. package/dist-cjs/lib/editor/derivations/parentsToChildren.js.map +2 -2
  15. package/dist-cjs/lib/editor/managers/{ClickManager.js → ClickManager/ClickManager.js} +1 -1
  16. package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +7 -0
  17. package/dist-cjs/lib/editor/managers/{EdgeScrollManager.js → EdgeScrollManager/EdgeScrollManager.js} +2 -2
  18. package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js.map +7 -0
  19. package/dist-cjs/lib/editor/managers/{FocusManager.js → FocusManager/FocusManager.js} +2 -0
  20. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +7 -0
  21. package/dist-cjs/lib/editor/managers/{FontManager.js → FontManager/FontManager.js} +4 -1
  22. package/dist-cjs/lib/editor/managers/FontManager/FontManager.js.map +7 -0
  23. package/dist-cjs/lib/editor/managers/{HistoryManager.js → HistoryManager/HistoryManager.js} +64 -6
  24. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +7 -0
  25. package/dist-cjs/lib/editor/managers/{ScribbleManager.js → ScribbleManager/ScribbleManager.js} +1 -1
  26. package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js.map +7 -0
  27. package/dist-cjs/lib/editor/managers/{TextManager.js → TextManager/TextManager.js} +72 -42
  28. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +7 -0
  29. package/dist-cjs/lib/editor/managers/{TickManager.js → TickManager/TickManager.js} +1 -1
  30. package/dist-cjs/lib/editor/managers/TickManager/TickManager.js.map +7 -0
  31. package/dist-cjs/lib/editor/managers/{UserPreferencesManager.js → UserPreferencesManager/UserPreferencesManager.js} +1 -1
  32. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +7 -0
  33. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +8 -0
  34. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  35. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js +6 -0
  36. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +2 -2
  37. package/dist-cjs/lib/editor/shapes/shared/getPerfectDashProps.js.map +2 -2
  38. package/dist-cjs/lib/exports/getSvgJsx.js.map +1 -1
  39. package/dist-cjs/lib/primitives/Box.js +33 -33
  40. package/dist-cjs/lib/primitives/Box.js.map +2 -2
  41. package/dist-cjs/lib/primitives/Vec.js +18 -13
  42. package/dist-cjs/lib/primitives/Vec.js.map +3 -3
  43. package/dist-cjs/lib/primitives/geometry/Arc2d.js +41 -21
  44. package/dist-cjs/lib/primitives/geometry/Arc2d.js.map +2 -2
  45. package/dist-cjs/lib/primitives/geometry/Circle2d.js +11 -11
  46. package/dist-cjs/lib/primitives/geometry/Circle2d.js.map +2 -2
  47. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js +13 -16
  48. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js.map +2 -2
  49. package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js +4 -4
  50. package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js.map +2 -2
  51. package/dist-cjs/lib/primitives/geometry/Edge2d.js +14 -21
  52. package/dist-cjs/lib/primitives/geometry/Edge2d.js.map +2 -2
  53. package/dist-cjs/lib/primitives/geometry/Ellipse2d.js +10 -10
  54. package/dist-cjs/lib/primitives/geometry/Ellipse2d.js.map +2 -2
  55. package/dist-cjs/lib/primitives/geometry/Geometry2d.js +5 -0
  56. package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
  57. package/dist-cjs/lib/primitives/geometry/Point2d.js +6 -6
  58. package/dist-cjs/lib/primitives/geometry/Point2d.js.map +2 -2
  59. package/dist-cjs/lib/primitives/geometry/Polygon2d.js +3 -0
  60. package/dist-cjs/lib/primitives/geometry/Polygon2d.js.map +2 -2
  61. package/dist-cjs/lib/primitives/geometry/Polyline2d.js +8 -5
  62. package/dist-cjs/lib/primitives/geometry/Polyline2d.js.map +2 -2
  63. package/dist-cjs/lib/primitives/geometry/Rectangle2d.js +22 -11
  64. package/dist-cjs/lib/primitives/geometry/Rectangle2d.js.map +2 -2
  65. package/dist-cjs/lib/primitives/geometry/Stadium2d.js +22 -22
  66. package/dist-cjs/lib/primitives/geometry/Stadium2d.js.map +2 -2
  67. package/dist-cjs/lib/utils/reorderShapes.js +11 -10
  68. package/dist-cjs/lib/utils/reorderShapes.js.map +2 -2
  69. package/dist-cjs/lib/utils/richText.js +7 -2
  70. package/dist-cjs/lib/utils/richText.js.map +2 -2
  71. package/dist-cjs/version.js +3 -3
  72. package/dist-cjs/version.js.map +1 -1
  73. package/dist-esm/index.d.mts +103 -104
  74. package/dist-esm/index.mjs +15 -9
  75. package/dist-esm/index.mjs.map +2 -2
  76. package/dist-esm/lib/config/TLSessionStateSnapshot.mjs +1 -1
  77. package/dist-esm/lib/config/TLSessionStateSnapshot.mjs.map +2 -2
  78. package/dist-esm/lib/editor/Editor.mjs +52 -77
  79. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  80. package/dist-esm/lib/editor/bindings/BindingUtil.mjs.map +2 -2
  81. package/dist-esm/lib/editor/derivations/bindingsIndex.mjs +22 -22
  82. package/dist-esm/lib/editor/derivations/bindingsIndex.mjs.map +2 -2
  83. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs +16 -20
  84. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs.map +3 -3
  85. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs +16 -16
  86. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs.map +2 -2
  87. package/dist-esm/lib/editor/managers/{ClickManager.mjs → ClickManager/ClickManager.mjs} +1 -1
  88. package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +7 -0
  89. package/dist-esm/lib/editor/managers/{EdgeScrollManager.mjs → EdgeScrollManager/EdgeScrollManager.mjs} +2 -2
  90. package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs.map +7 -0
  91. package/dist-esm/lib/editor/managers/{FocusManager.mjs → FocusManager/FocusManager.mjs} +2 -0
  92. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +7 -0
  93. package/dist-esm/lib/editor/managers/{FontManager.mjs → FontManager/FontManager.mjs} +4 -1
  94. package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs.map +7 -0
  95. package/dist-esm/lib/editor/managers/{HistoryManager.mjs → HistoryManager/HistoryManager.mjs} +60 -2
  96. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +7 -0
  97. package/dist-esm/lib/editor/managers/{ScribbleManager.mjs → ScribbleManager/ScribbleManager.mjs} +1 -1
  98. package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs.map +7 -0
  99. package/dist-esm/lib/editor/managers/{TextManager.mjs → TextManager/TextManager.mjs} +72 -42
  100. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +7 -0
  101. package/dist-esm/lib/editor/managers/{TickManager.mjs → TickManager/TickManager.mjs} +1 -1
  102. package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs.map +7 -0
  103. package/dist-esm/lib/editor/managers/{UserPreferencesManager.mjs → UserPreferencesManager/UserPreferencesManager.mjs} +1 -1
  104. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +7 -0
  105. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +8 -0
  106. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  107. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs +6 -0
  108. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +2 -2
  109. package/dist-esm/lib/editor/shapes/shared/getPerfectDashProps.mjs.map +2 -2
  110. package/dist-esm/lib/exports/getSvgJsx.mjs.map +1 -1
  111. package/dist-esm/lib/primitives/Box.mjs +33 -33
  112. package/dist-esm/lib/primitives/Box.mjs.map +2 -2
  113. package/dist-esm/lib/primitives/Vec.mjs +19 -14
  114. package/dist-esm/lib/primitives/Vec.mjs.map +3 -3
  115. package/dist-esm/lib/primitives/geometry/Arc2d.mjs +41 -21
  116. package/dist-esm/lib/primitives/geometry/Arc2d.mjs.map +2 -2
  117. package/dist-esm/lib/primitives/geometry/Circle2d.mjs +11 -11
  118. package/dist-esm/lib/primitives/geometry/Circle2d.mjs.map +2 -2
  119. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs +13 -16
  120. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs.map +2 -2
  121. package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs +4 -4
  122. package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs.map +2 -2
  123. package/dist-esm/lib/primitives/geometry/Edge2d.mjs +14 -21
  124. package/dist-esm/lib/primitives/geometry/Edge2d.mjs.map +2 -2
  125. package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs +11 -11
  126. package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs.map +2 -2
  127. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +7 -1
  128. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  129. package/dist-esm/lib/primitives/geometry/Point2d.mjs +6 -6
  130. package/dist-esm/lib/primitives/geometry/Point2d.mjs.map +2 -2
  131. package/dist-esm/lib/primitives/geometry/Polygon2d.mjs +3 -0
  132. package/dist-esm/lib/primitives/geometry/Polygon2d.mjs.map +2 -2
  133. package/dist-esm/lib/primitives/geometry/Polyline2d.mjs +8 -5
  134. package/dist-esm/lib/primitives/geometry/Polyline2d.mjs.map +2 -2
  135. package/dist-esm/lib/primitives/geometry/Rectangle2d.mjs +22 -11
  136. package/dist-esm/lib/primitives/geometry/Rectangle2d.mjs.map +2 -2
  137. package/dist-esm/lib/primitives/geometry/Stadium2d.mjs +22 -22
  138. package/dist-esm/lib/primitives/geometry/Stadium2d.mjs.map +2 -2
  139. package/dist-esm/lib/utils/reorderShapes.mjs +11 -10
  140. package/dist-esm/lib/utils/reorderShapes.mjs.map +2 -2
  141. package/dist-esm/lib/utils/richText.mjs +8 -3
  142. package/dist-esm/lib/utils/richText.mjs.map +2 -2
  143. package/dist-esm/version.mjs +3 -3
  144. package/dist-esm/version.mjs.map +1 -1
  145. package/editor.css +458 -523
  146. package/package.json +8 -9
  147. package/src/index.ts +18 -8
  148. package/src/lib/config/TLSessionStateSnapshot.ts +1 -1
  149. package/src/lib/editor/Editor.test.ts +252 -3
  150. package/src/lib/editor/Editor.ts +51 -75
  151. package/src/lib/editor/bindings/BindingUtil.ts +6 -0
  152. package/src/lib/editor/derivations/bindingsIndex.ts +27 -26
  153. package/src/lib/editor/derivations/notVisibleShapes.ts +24 -25
  154. package/src/lib/editor/derivations/parentsToChildren.ts +28 -25
  155. package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +442 -0
  156. package/src/lib/editor/managers/{ClickManager.ts → ClickManager/ClickManager.ts} +3 -3
  157. package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +374 -0
  158. package/src/lib/editor/managers/{EdgeScrollManager.ts → EdgeScrollManager/EdgeScrollManager.ts} +3 -3
  159. package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +455 -0
  160. package/src/lib/editor/managers/{FocusManager.ts → FocusManager/FocusManager.ts} +3 -1
  161. package/src/lib/editor/managers/FontManager/FontManager.test.ts +263 -0
  162. package/src/lib/editor/managers/{FontManager.ts → FontManager/FontManager.ts} +5 -2
  163. package/src/lib/editor/managers/{HistoryManager.test.ts → HistoryManager/HistoryManager.test.ts} +388 -1
  164. package/src/lib/editor/managers/{HistoryManager.ts → HistoryManager/HistoryManager.ts} +73 -2
  165. package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +624 -0
  166. package/src/lib/editor/managers/{ScribbleManager.ts → ScribbleManager/ScribbleManager.ts} +2 -2
  167. package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +485 -0
  168. package/src/lib/editor/managers/TextManager/TextManager.test.ts +407 -0
  169. package/src/lib/editor/managers/{TextManager.ts → TextManager/TextManager.ts} +117 -87
  170. package/src/lib/editor/managers/TickManager/TickManager.test.ts +314 -0
  171. package/src/lib/editor/managers/{TickManager.ts → TickManager/TickManager.ts} +2 -2
  172. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +591 -0
  173. package/src/lib/editor/managers/{UserPreferencesManager.ts → UserPreferencesManager/UserPreferencesManager.ts} +2 -2
  174. package/src/lib/editor/shapes/ShapeUtil.ts +10 -1
  175. package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +8 -0
  176. package/src/lib/editor/shapes/shared/getPerfectDashProps.ts +5 -2
  177. package/src/lib/exports/getSvgJsx.tsx +1 -1
  178. package/src/lib/primitives/Box.test.ts +588 -7
  179. package/src/lib/primitives/Box.ts +33 -33
  180. package/src/lib/primitives/Vec.test.ts +2 -2
  181. package/src/lib/primitives/Vec.ts +15 -10
  182. package/src/lib/primitives/geometry/Arc2d.ts +42 -23
  183. package/src/lib/primitives/geometry/Circle2d.ts +12 -12
  184. package/src/lib/primitives/geometry/CubicBezier2d.test.ts +5 -0
  185. package/src/lib/primitives/geometry/CubicBezier2d.ts +13 -17
  186. package/src/lib/primitives/geometry/CubicSpline2d.ts +5 -5
  187. package/src/lib/primitives/geometry/Edge2d.ts +14 -25
  188. package/src/lib/primitives/geometry/Ellipse2d.ts +12 -13
  189. package/src/lib/primitives/geometry/Geometry2d.ts +6 -0
  190. package/src/lib/primitives/geometry/Point2d.ts +6 -6
  191. package/src/lib/primitives/geometry/Polygon2d.ts +4 -0
  192. package/src/lib/primitives/geometry/Polyline2d.ts +10 -7
  193. package/src/lib/primitives/geometry/Rectangle2d.ts +24 -11
  194. package/src/lib/primitives/geometry/Stadium2d.ts +22 -23
  195. package/src/lib/utils/reorderShapes.ts +10 -13
  196. package/src/lib/utils/richText.ts +10 -4
  197. package/src/version.ts +3 -3
  198. package/dist-cjs/lib/editor/managers/ClickManager.js.map +0 -7
  199. package/dist-cjs/lib/editor/managers/EdgeScrollManager.js.map +0 -7
  200. package/dist-cjs/lib/editor/managers/FocusManager.js.map +0 -7
  201. package/dist-cjs/lib/editor/managers/FontManager.js.map +0 -7
  202. package/dist-cjs/lib/editor/managers/HistoryManager.js.map +0 -7
  203. package/dist-cjs/lib/editor/managers/ScribbleManager.js.map +0 -7
  204. package/dist-cjs/lib/editor/managers/Stack.js +0 -82
  205. package/dist-cjs/lib/editor/managers/Stack.js.map +0 -7
  206. package/dist-cjs/lib/editor/managers/TextManager.js.map +0 -7
  207. package/dist-cjs/lib/editor/managers/TickManager.js.map +0 -7
  208. package/dist-cjs/lib/editor/managers/UserPreferencesManager.js.map +0 -7
  209. package/dist-esm/lib/editor/managers/ClickManager.mjs.map +0 -7
  210. package/dist-esm/lib/editor/managers/EdgeScrollManager.mjs.map +0 -7
  211. package/dist-esm/lib/editor/managers/FocusManager.mjs.map +0 -7
  212. package/dist-esm/lib/editor/managers/FontManager.mjs.map +0 -7
  213. package/dist-esm/lib/editor/managers/HistoryManager.mjs.map +0 -7
  214. package/dist-esm/lib/editor/managers/ScribbleManager.mjs.map +0 -7
  215. package/dist-esm/lib/editor/managers/Stack.mjs +0 -62
  216. package/dist-esm/lib/editor/managers/Stack.mjs.map +0 -7
  217. package/dist-esm/lib/editor/managers/TextManager.mjs.map +0 -7
  218. package/dist-esm/lib/editor/managers/TickManager.mjs.map +0 -7
  219. package/dist-esm/lib/editor/managers/UserPreferencesManager.mjs.map +0 -7
  220. package/src/lib/editor/managers/ScribbleManager.test.ts +0 -32
  221. package/src/lib/editor/managers/Stack.ts +0 -71
@@ -105,15 +105,15 @@ export declare function approximately(a: number, b: number, precision?: number):
105
105
 
106
106
  /** @public */
107
107
  export declare class Arc2d extends Geometry2d {
108
- _center: Vec;
109
- radius: number;
110
- start: Vec;
111
- end: Vec;
112
- largeArcFlag: number;
113
- sweepFlag: number;
114
- measure: number;
115
- angleStart: number;
116
- angleEnd: number;
108
+ private _center;
109
+ private _radius;
110
+ private _start;
111
+ private _end;
112
+ private _largeArcFlag;
113
+ private _sweepFlag;
114
+ private _measure;
115
+ private _angleStart;
116
+ private _angleEnd;
117
117
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
118
118
  center: Vec;
119
119
  end: Vec;
@@ -206,6 +206,12 @@ export declare interface BindingOnShapeChangeOptions<Binding extends TLUnknownBi
206
206
  shapeBefore: TLShape;
207
207
  /** The shape record after the change is made. */
208
208
  shapeAfter: TLShape;
209
+ /**
210
+ * Why did this shape change?
211
+ * - 'self': the shape itself changed
212
+ * - 'ancestry': the ancestry of the shape changed, but the shape itself may not have done
213
+ */
214
+ reason: 'ancestry' | 'self';
209
215
  }
210
216
 
211
217
  /**
@@ -551,10 +557,10 @@ export declare class Circle2d extends Geometry2d {
551
557
  x?: number;
552
558
  y?: number;
553
559
  };
554
- _center: Vec;
555
- radius: number;
556
- x: number;
557
- y: number;
560
+ private _center;
561
+ private _radius;
562
+ private _x;
563
+ private _y;
558
564
  constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
559
565
  isFilled: boolean;
560
566
  radius: number;
@@ -716,10 +722,10 @@ export declare function createTLUser(opts?: {
716
722
 
717
723
  /** @public */
718
724
  export declare class CubicBezier2d extends Polyline2d {
719
- a: Vec;
720
- b: Vec;
721
- c: Vec;
722
- d: Vec;
725
+ private _a;
726
+ private _b;
727
+ private _c;
728
+ private _d;
723
729
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
724
730
  cp1: Vec;
725
731
  cp2: Vec;
@@ -727,20 +733,19 @@ export declare class CubicBezier2d extends Polyline2d {
727
733
  start: Vec;
728
734
  });
729
735
  getVertices(): Vec[];
730
- midPoint(): Vec;
731
736
  nearestPoint(A: VecLike): Vec;
732
737
  getSvgPathData(first?: boolean): string;
733
738
  static GetAtT(segment: CubicBezier2d, t: number): Vec;
734
- getLength(filters?: Geometry2dFilters, precision?: number): number;
739
+ getLength(_filters?: Geometry2dFilters, precision?: number): number;
735
740
  }
736
741
 
737
742
  /** @public */
738
743
  export declare class CubicSpline2d extends Geometry2d {
739
- points: Vec[];
744
+ private _points;
740
745
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
741
746
  points: Vec[];
742
747
  });
743
- _segments?: CubicBezier2d[];
748
+ private _segments?;
744
749
  get segments(): CubicBezier2d[];
745
750
  getLength(): number;
746
751
  getVertices(): Vec[];
@@ -927,20 +932,18 @@ export declare const EASINGS: {
927
932
 
928
933
  /** @public */
929
934
  export declare class Edge2d extends Geometry2d {
930
- start: Vec;
931
- end: Vec;
932
- d: Vec;
933
- u: Vec;
934
- ul: number;
935
+ private _start;
936
+ private _end;
937
+ private _d;
938
+ private _u;
939
+ private _ul;
935
940
  constructor(config: {
936
941
  end: Vec;
937
942
  start: Vec;
938
943
  });
939
944
  getLength(): number;
940
- midPoint(): Vec;
941
945
  getVertices(): Vec[];
942
946
  nearestPoint(point: VecLike): Vec;
943
- hitTestLineSegment(A: VecLike, B: VecLike, distance?: number): boolean;
944
947
  getSvgPathData(first?: boolean): string;
945
948
  }
946
949
 
@@ -2458,23 +2461,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2458
2461
  * @public
2459
2462
  */
2460
2463
  getShapeGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
2461
- private _shapePageGeometryCaches;
2462
- /**
2463
- * Get the geometry of a shape in page-space.
2464
- *
2465
- * @example
2466
- * ```ts
2467
- * editor.getShapePageGeometry(myShape)
2468
- * editor.getShapePageGeometry(myShapeId)
2469
- * editor.getShapePageGeometry(myShapeId, { context: "arrow" })
2470
- * ```
2471
- *
2472
- * @param shape - The shape (or shape id) to get the geometry for.
2473
- * @param opts - Additional options about the request for geometry. Passed to {@link ShapeUtil.getGeometry}.
2474
- *
2475
- * @public
2476
- */
2477
- getShapePageGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
2478
2464
  /* Excluded from this release type: _getShapeHandlesCache */
2479
2465
  /**
2480
2466
  * Get the handles (if any) for a shape.
@@ -2652,11 +2638,16 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2652
2638
  *
2653
2639
  * @public
2654
2640
  */
2655
- isShapeOrAncestorLocked(shape?: TLShape): boolean;
2656
- isShapeOrAncestorLocked(id?: TLShapeId): boolean;
2641
+ isShapeOrAncestorLocked(shape?: TLShape | TLShapeId): boolean;
2642
+ /**
2643
+ * Get shapes that are outside of the viewport.
2644
+ *
2645
+ * @public
2646
+ */
2647
+ getNotVisibleShapes(): Set<TLShapeId>;
2657
2648
  private _notVisibleShapes;
2658
2649
  /**
2659
- * Get culled shapes.
2650
+ * Get culled shapes (those that should not render), taking into account which shapes are selected or editing.
2660
2651
  *
2661
2652
  * @public
2662
2653
  */
@@ -2698,12 +2689,14 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2698
2689
  * @example
2699
2690
  * ```ts
2700
2691
  * editor.getShapesAtPoint({ x: 100, y: 100 })
2701
- * editor.getShapesAtPoint({ x: 100, y: 100 }, { hitInside: true, exact: true })
2692
+ * editor.getShapesAtPoint({ x: 100, y: 100 }, { hitInside: true, margin: 8 })
2702
2693
  * ```
2703
2694
  *
2704
2695
  * @param point - The page point to test.
2705
2696
  * @param opts - The options for the hit point testing.
2706
2697
  *
2698
+ * @returns An array of shapes at the given point, sorted in reverse order of their absolute z-index (top-most shape first).
2699
+ *
2707
2700
  * @public
2708
2701
  */
2709
2702
  getShapesAtPoint(point: VecLike, opts?: {
@@ -3997,13 +3990,13 @@ export declare class Ellipse2d extends Geometry2d {
3997
3990
  height: number;
3998
3991
  width: number;
3999
3992
  };
4000
- w: number;
4001
- h: number;
3993
+ private _w;
3994
+ private _h;
3995
+ private _edges?;
4002
3996
  constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
4003
3997
  height: number;
4004
3998
  width: number;
4005
3999
  });
4006
- _edges?: Edge2d[];
4007
4000
  get edges(): Edge2d[];
4008
4001
  getVertices(): any[];
4009
4002
  nearestPoint(A: VecLike): Vec;
@@ -4184,11 +4177,11 @@ export declare function getIncrementedName(name: string, others: string[]): stri
4184
4177
  /** @public */
4185
4178
  export declare function getPerfectDashProps(totalLength: number, strokeWidth: number, opts?: {
4186
4179
  closed?: boolean;
4187
- end?: 'none' | 'outset' | 'skip';
4180
+ end?: PerfectDashTerminal;
4188
4181
  forceSolid?: boolean;
4189
4182
  lengthRatio?: number;
4190
4183
  snap?: number;
4191
- start?: 'none' | 'outset' | 'skip';
4184
+ start?: PerfectDashTerminal;
4192
4185
  style?: TLDefaultDashStyle;
4193
4186
  }): {
4194
4187
  strokeDasharray: string;
@@ -4301,6 +4294,8 @@ export declare class GroupShapeUtil extends ShapeUtil<TLGroupShape> {
4301
4294
  static migrations: TLPropsMigrations;
4302
4295
  hideSelectionBoundsFg(): boolean;
4303
4296
  canBind(): boolean;
4297
+ canResize(): boolean;
4298
+ canResizeChildren(): boolean;
4304
4299
  getDefaultProps(): TLGroupShape['props'];
4305
4300
  getGeometry(shape: TLGroupShape): Geometry2d;
4306
4301
  component(shape: TLGroupShape): JSX_2.Element | null;
@@ -4666,6 +4661,9 @@ export declare type OptionalKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pi
4666
4661
  */
4667
4662
  export declare function parseDeepLinkString(deepLinkString: string): TLDeepLink;
4668
4663
 
4664
+ /** @public */
4665
+ export declare type PerfectDashTerminal = 'none' | 'outset' | 'skip';
4666
+
4669
4667
  /**
4670
4668
  * Find the approximate perimeter of an ellipse.
4671
4669
  *
@@ -4683,7 +4681,7 @@ export declare const PI2: number;
4683
4681
 
4684
4682
  /** @public */
4685
4683
  export declare class Point2d extends Geometry2d {
4686
- point: Vec;
4684
+ private _point;
4687
4685
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
4688
4686
  margin: number;
4689
4687
  point: Vec;
@@ -4727,12 +4725,12 @@ export declare function polygonsIntersect(a: VecLike[], b: VecLike[]): boolean;
4727
4725
 
4728
4726
  /** @public */
4729
4727
  export declare class Polyline2d extends Geometry2d {
4730
- points: Vec[];
4728
+ private _points;
4729
+ private _segments?;
4731
4730
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
4732
4731
  points: Vec[];
4733
4732
  });
4734
- _segments?: Edge2d[];
4735
- get segments(): Edge2d[];
4733
+ protected get segments(): Edge2d[];
4736
4734
  getLength(): number;
4737
4735
  getVertices(): Vec[];
4738
4736
  nearestPoint(A: VecLike): Vec;
@@ -4798,10 +4796,10 @@ export declare class ReadonlySharedStyleMap {
4798
4796
 
4799
4797
  /** @public */
4800
4798
  export declare class Rectangle2d extends Polygon2d {
4801
- x: number;
4802
- y: number;
4803
- w: number;
4804
- h: number;
4799
+ private _x;
4800
+ private _y;
4801
+ private _w;
4802
+ private _h;
4805
4803
  constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
4806
4804
  height: number;
4807
4805
  width: number;
@@ -4810,6 +4808,7 @@ export declare class Rectangle2d extends Polygon2d {
4810
4808
  });
4811
4809
  getBounds(): Box;
4812
4810
  getSvgPathData(): string;
4811
+ private negativeZeroFix;
4813
4812
  }
4814
4813
 
4815
4814
  /** @public */
@@ -5095,6 +5094,12 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5095
5094
  * @public
5096
5095
  */
5097
5096
  canResize(_shape: Shape): boolean;
5097
+ /**
5098
+ * When the shape is resized, whether the shape's children should also be resized.
5099
+ *
5100
+ * @public
5101
+ */
5102
+ canResizeChildren(_shape: Shape): boolean;
5098
5103
  /**
5099
5104
  * Whether the shape can be edited in read-only mode.
5100
5105
  *
@@ -5538,12 +5543,12 @@ export declare class Stadium2d extends Geometry2d {
5538
5543
  height: number;
5539
5544
  width: number;
5540
5545
  };
5541
- w: number;
5542
- h: number;
5543
- a: Arc2d;
5544
- b: Edge2d;
5545
- c: Arc2d;
5546
- d: Edge2d;
5546
+ private _w;
5547
+ private _h;
5548
+ private _a;
5549
+ private _b;
5550
+ private _c;
5551
+ private _d;
5547
5552
  constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
5548
5553
  height: number;
5549
5554
  width: number;
@@ -5719,43 +5724,15 @@ export declare const TAB_ID: string;
5719
5724
  /** @public */
5720
5725
  export declare class TextManager {
5721
5726
  editor: Editor;
5722
- private baseElem;
5727
+ private elm;
5728
+ private defaultStyles;
5723
5729
  constructor(editor: Editor);
5724
- measureText(textToMeasure: string, opts: {
5725
- /**
5726
- * When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
5727
- * is null, the text will be measured without wrapping, but explicit line breaks and
5728
- * space are preserved.
5729
- */
5730
- maxWidth: null | number;
5731
- disableOverflowWrapBreaking?: boolean;
5732
- fontFamily: string;
5733
- fontSize: number;
5734
- fontStyle: string;
5735
- fontWeight: string;
5736
- lineHeight: number;
5737
- minWidth?: null | number;
5738
- padding: string;
5739
- }): BoxModel & {
5730
+ dispose(): void;
5731
+ private resetElmStyles;
5732
+ measureText(textToMeasure: string, opts: TLMeasureTextOpts): BoxModel & {
5740
5733
  scrollWidth: number;
5741
5734
  };
5742
- measureHtml(html: string, opts: {
5743
- /**
5744
- * When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
5745
- * is null, the text will be measured without wrapping, but explicit line breaks and
5746
- * space are preserved.
5747
- */
5748
- maxWidth: null | number;
5749
- disableOverflowWrapBreaking?: boolean;
5750
- fontFamily: string;
5751
- fontSize: number;
5752
- fontStyle: string;
5753
- fontWeight: string;
5754
- lineHeight: number;
5755
- minWidth?: null | number;
5756
- otherStyles?: Record<string, string>;
5757
- padding: string;
5758
- }): BoxModel & {
5735
+ measureHtml(html: string, opts: TLMeasureTextOpts): BoxModel & {
5759
5736
  scrollWidth: number;
5760
5737
  };
5761
5738
  /**
@@ -6780,6 +6757,26 @@ export declare interface TLLoadSnapshotOptions {
6780
6757
  forceOverwriteSessionState?: boolean;
6781
6758
  }
6782
6759
 
6760
+ /** @public */
6761
+ export declare interface TLMeasureTextOpts {
6762
+ fontStyle: string;
6763
+ fontWeight: string;
6764
+ fontFamily: string;
6765
+ fontSize: number;
6766
+ lineHeight: number;
6767
+ /**
6768
+ * When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
6769
+ * is null, the text will be measured without wrapping, but explicit line breaks and
6770
+ * space are preserved.
6771
+ */
6772
+ maxWidth: null | number;
6773
+ minWidth?: null | number;
6774
+ padding: string;
6775
+ otherStyles?: Record<string, string>;
6776
+ disableOverflowWrapBreaking?: boolean;
6777
+ measureScrollWidth?: boolean;
6778
+ }
6779
+
6783
6780
  /** @public */
6784
6781
  export declare interface TLMeasureTextSpanOpts {
6785
6782
  overflow: 'truncate-clip' | 'truncate-ellipsis' | 'wrap';
@@ -6793,6 +6790,7 @@ export declare interface TLMeasureTextSpanOpts {
6793
6790
  lineHeight: number;
6794
6791
  textAlign: TLDefaultHorizontalAlignStyle;
6795
6792
  otherStyles?: Record<string, string>;
6793
+ measureScrollWidth?: boolean;
6796
6794
  }
6797
6795
 
6798
6796
  /** @public */
@@ -7676,7 +7674,7 @@ export declare class Vec {
7676
7674
  len(): number;
7677
7675
  pry(V: VecLike): number;
7678
7676
  per(): this;
7679
- uni(): Vec;
7677
+ uni(): this;
7680
7678
  tan(V: VecLike): Vec;
7681
7679
  dist(V: VecLike): number;
7682
7680
  distanceToLineSegment(A: VecLike, B: VecLike): number;
@@ -7687,8 +7685,9 @@ export declare class Vec {
7687
7685
  lrp(B: VecLike, t: number): Vec;
7688
7686
  equals(B: VecLike): boolean;
7689
7687
  equalsXY(x: number, y: number): boolean;
7688
+ /** @deprecated use `uni` instead */
7690
7689
  norm(): this;
7691
- toFixed(): Vec;
7690
+ toFixed(): this;
7692
7691
  toString(): string;
7693
7692
  toJson(): VecModel;
7694
7693
  toArray(): number[];
package/dist-cjs/index.js CHANGED
@@ -269,16 +269,16 @@ var import_defaultShapes = require("./lib/config/defaultShapes");
269
269
  var import_constants = require("./lib/constants");
270
270
  var import_Editor = require("./lib/editor/Editor");
271
271
  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");
272
+ var import_ClickManager = require("./lib/editor/managers/ClickManager/ClickManager");
273
+ var import_EdgeScrollManager = require("./lib/editor/managers/EdgeScrollManager/EdgeScrollManager");
274
+ var import_FontManager = require("./lib/editor/managers/FontManager/FontManager");
275
+ var import_HistoryManager = require("./lib/editor/managers/HistoryManager/HistoryManager");
276
+ var import_ScribbleManager = require("./lib/editor/managers/ScribbleManager/ScribbleManager");
277
277
  var import_BoundsSnaps = require("./lib/editor/managers/SnapManager/BoundsSnaps");
278
278
  var import_HandleSnaps = require("./lib/editor/managers/SnapManager/HandleSnaps");
279
279
  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");
280
+ var import_TextManager = require("./lib/editor/managers/TextManager/TextManager");
281
+ var import_UserPreferencesManager = require("./lib/editor/managers/UserPreferencesManager/UserPreferencesManager");
282
282
  var import_BaseBoxShapeUtil = require("./lib/editor/shapes/BaseBoxShapeUtil");
283
283
  var import_ShapeUtil = require("./lib/editor/shapes/ShapeUtil");
284
284
  var import_GroupShapeUtil = require("./lib/editor/shapes/group/GroupShapeUtil");
@@ -361,7 +361,7 @@ function debugEnableLicensing() {
361
361
  }
362
362
  (0, import_utils.registerTldrawLibraryVersion)(
363
363
  "@tldraw/editor",
364
- "3.14.0-canary.95353287a2be",
364
+ "3.14.0-canary.9635d3157d9b",
365
365
  "cjs"
366
366
  );
367
367
  //# 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 { getPerfectDashProps } 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": "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",
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 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": "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",
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) {