@tldraw/editor 3.14.0-canary.48967da8ee66 → 3.14.0-canary.4c533b76dc35

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 (195) hide show
  1. package/dist-cjs/index.d.ts +51 -63
  2. package/dist-cjs/index.js +10 -8
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/editor/Editor.js +21 -57
  5. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  6. package/dist-cjs/lib/editor/derivations/bindingsIndex.js +22 -22
  7. package/dist-cjs/lib/editor/derivations/bindingsIndex.js.map +2 -2
  8. package/dist-cjs/lib/editor/derivations/parentsToChildren.js +16 -16
  9. package/dist-cjs/lib/editor/derivations/parentsToChildren.js.map +2 -2
  10. package/dist-cjs/lib/editor/managers/{ClickManager.js → ClickManager/ClickManager.js} +1 -1
  11. package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +7 -0
  12. package/dist-cjs/lib/editor/managers/{EdgeScrollManager.js → EdgeScrollManager/EdgeScrollManager.js} +2 -2
  13. package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js.map +7 -0
  14. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +7 -0
  15. package/dist-cjs/lib/editor/managers/{FontManager.js → FontManager/FontManager.js} +5 -1
  16. package/dist-cjs/lib/editor/managers/FontManager/FontManager.js.map +7 -0
  17. package/dist-cjs/lib/editor/managers/{HistoryManager.js → HistoryManager/HistoryManager.js} +64 -6
  18. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +7 -0
  19. package/dist-cjs/lib/editor/managers/{ScribbleManager.js → ScribbleManager/ScribbleManager.js} +1 -1
  20. package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js.map +7 -0
  21. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +7 -0
  22. package/dist-cjs/lib/editor/managers/{TickManager.js → TickManager/TickManager.js} +1 -1
  23. package/dist-cjs/lib/editor/managers/TickManager/TickManager.js.map +7 -0
  24. package/dist-cjs/lib/editor/managers/{UserPreferencesManager.js → UserPreferencesManager/UserPreferencesManager.js} +1 -1
  25. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +7 -0
  26. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +1 -1
  27. package/dist-cjs/lib/exports/getSvgJsx.js.map +1 -1
  28. package/dist-cjs/lib/primitives/Box.js +39 -33
  29. package/dist-cjs/lib/primitives/Box.js.map +2 -2
  30. package/dist-cjs/lib/primitives/Vec.js +13 -8
  31. package/dist-cjs/lib/primitives/Vec.js.map +2 -2
  32. package/dist-cjs/lib/primitives/geometry/Arc2d.js +41 -21
  33. package/dist-cjs/lib/primitives/geometry/Arc2d.js.map +2 -2
  34. package/dist-cjs/lib/primitives/geometry/Circle2d.js +11 -11
  35. package/dist-cjs/lib/primitives/geometry/Circle2d.js.map +2 -2
  36. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js +13 -16
  37. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js.map +2 -2
  38. package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js +4 -4
  39. package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js.map +2 -2
  40. package/dist-cjs/lib/primitives/geometry/Edge2d.js +14 -17
  41. package/dist-cjs/lib/primitives/geometry/Edge2d.js.map +2 -2
  42. package/dist-cjs/lib/primitives/geometry/Ellipse2d.js +10 -10
  43. package/dist-cjs/lib/primitives/geometry/Ellipse2d.js.map +2 -2
  44. package/dist-cjs/lib/primitives/geometry/Point2d.js +6 -6
  45. package/dist-cjs/lib/primitives/geometry/Point2d.js.map +2 -2
  46. package/dist-cjs/lib/primitives/geometry/Polygon2d.js +3 -0
  47. package/dist-cjs/lib/primitives/geometry/Polygon2d.js.map +2 -2
  48. package/dist-cjs/lib/primitives/geometry/Polyline2d.js +8 -5
  49. package/dist-cjs/lib/primitives/geometry/Polyline2d.js.map +2 -2
  50. package/dist-cjs/lib/primitives/geometry/Rectangle2d.js +22 -11
  51. package/dist-cjs/lib/primitives/geometry/Rectangle2d.js.map +2 -2
  52. package/dist-cjs/lib/primitives/geometry/Stadium2d.js +22 -22
  53. package/dist-cjs/lib/primitives/geometry/Stadium2d.js.map +2 -2
  54. package/dist-cjs/lib/utils/areShapesContentEqual.js +1 -1
  55. package/dist-cjs/lib/utils/areShapesContentEqual.js.map +2 -2
  56. package/dist-cjs/lib/utils/reorderShapes.js +11 -10
  57. package/dist-cjs/lib/utils/reorderShapes.js.map +2 -2
  58. package/dist-cjs/lib/utils/richText.js.map +1 -1
  59. package/dist-cjs/version.js +3 -3
  60. package/dist-cjs/version.js.map +1 -1
  61. package/dist-esm/index.d.mts +51 -63
  62. package/dist-esm/index.mjs +14 -8
  63. package/dist-esm/index.mjs.map +2 -2
  64. package/dist-esm/lib/editor/Editor.mjs +21 -57
  65. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  66. package/dist-esm/lib/editor/derivations/bindingsIndex.mjs +22 -22
  67. package/dist-esm/lib/editor/derivations/bindingsIndex.mjs.map +2 -2
  68. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs +16 -16
  69. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs.map +2 -2
  70. package/dist-esm/lib/editor/managers/{ClickManager.mjs → ClickManager/ClickManager.mjs} +1 -1
  71. package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +7 -0
  72. package/dist-esm/lib/editor/managers/{EdgeScrollManager.mjs → EdgeScrollManager/EdgeScrollManager.mjs} +2 -2
  73. package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs.map +7 -0
  74. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +7 -0
  75. package/dist-esm/lib/editor/managers/{FontManager.mjs → FontManager/FontManager.mjs} +5 -1
  76. package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs.map +7 -0
  77. package/dist-esm/lib/editor/managers/{HistoryManager.mjs → HistoryManager/HistoryManager.mjs} +60 -2
  78. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +7 -0
  79. package/dist-esm/lib/editor/managers/{ScribbleManager.mjs → ScribbleManager/ScribbleManager.mjs} +1 -1
  80. package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs.map +7 -0
  81. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +7 -0
  82. package/dist-esm/lib/editor/managers/{TickManager.mjs → TickManager/TickManager.mjs} +1 -1
  83. package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs.map +7 -0
  84. package/dist-esm/lib/editor/managers/{UserPreferencesManager.mjs → UserPreferencesManager/UserPreferencesManager.mjs} +1 -1
  85. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +7 -0
  86. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +1 -1
  87. package/dist-esm/lib/exports/getSvgJsx.mjs.map +1 -1
  88. package/dist-esm/lib/primitives/Box.mjs +39 -33
  89. package/dist-esm/lib/primitives/Box.mjs.map +2 -2
  90. package/dist-esm/lib/primitives/Vec.mjs +13 -8
  91. package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
  92. package/dist-esm/lib/primitives/geometry/Arc2d.mjs +41 -21
  93. package/dist-esm/lib/primitives/geometry/Arc2d.mjs.map +2 -2
  94. package/dist-esm/lib/primitives/geometry/Circle2d.mjs +11 -11
  95. package/dist-esm/lib/primitives/geometry/Circle2d.mjs.map +2 -2
  96. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs +13 -16
  97. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs.map +2 -2
  98. package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs +4 -4
  99. package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs.map +2 -2
  100. package/dist-esm/lib/primitives/geometry/Edge2d.mjs +14 -17
  101. package/dist-esm/lib/primitives/geometry/Edge2d.mjs.map +2 -2
  102. package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs +11 -11
  103. package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs.map +2 -2
  104. package/dist-esm/lib/primitives/geometry/Point2d.mjs +6 -6
  105. package/dist-esm/lib/primitives/geometry/Point2d.mjs.map +2 -2
  106. package/dist-esm/lib/primitives/geometry/Polygon2d.mjs +3 -0
  107. package/dist-esm/lib/primitives/geometry/Polygon2d.mjs.map +2 -2
  108. package/dist-esm/lib/primitives/geometry/Polyline2d.mjs +8 -5
  109. package/dist-esm/lib/primitives/geometry/Polyline2d.mjs.map +2 -2
  110. package/dist-esm/lib/primitives/geometry/Rectangle2d.mjs +22 -11
  111. package/dist-esm/lib/primitives/geometry/Rectangle2d.mjs.map +2 -2
  112. package/dist-esm/lib/primitives/geometry/Stadium2d.mjs +22 -22
  113. package/dist-esm/lib/primitives/geometry/Stadium2d.mjs.map +2 -2
  114. package/dist-esm/lib/utils/areShapesContentEqual.mjs +1 -1
  115. package/dist-esm/lib/utils/areShapesContentEqual.mjs.map +2 -2
  116. package/dist-esm/lib/utils/reorderShapes.mjs +11 -10
  117. package/dist-esm/lib/utils/reorderShapes.mjs.map +2 -2
  118. package/dist-esm/lib/utils/richText.mjs.map +1 -1
  119. package/dist-esm/version.mjs +3 -3
  120. package/dist-esm/version.mjs.map +1 -1
  121. package/package.json +7 -7
  122. package/src/index.ts +14 -7
  123. package/src/lib/editor/Editor.test.ts +252 -3
  124. package/src/lib/editor/Editor.ts +25 -59
  125. package/src/lib/editor/derivations/bindingsIndex.ts +27 -26
  126. package/src/lib/editor/derivations/parentsToChildren.ts +28 -25
  127. package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +442 -0
  128. package/src/lib/editor/managers/{ClickManager.ts → ClickManager/ClickManager.ts} +3 -3
  129. package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +374 -0
  130. package/src/lib/editor/managers/{EdgeScrollManager.ts → EdgeScrollManager/EdgeScrollManager.ts} +3 -3
  131. package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +455 -0
  132. package/src/lib/editor/managers/{FocusManager.ts → FocusManager/FocusManager.ts} +1 -1
  133. package/src/lib/editor/managers/FontManager/FontManager.test.ts +263 -0
  134. package/src/lib/editor/managers/{FontManager.ts → FontManager/FontManager.ts} +6 -2
  135. package/src/lib/editor/managers/{HistoryManager.test.ts → HistoryManager/HistoryManager.test.ts} +388 -1
  136. package/src/lib/editor/managers/{HistoryManager.ts → HistoryManager/HistoryManager.ts} +73 -2
  137. package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +624 -0
  138. package/src/lib/editor/managers/{ScribbleManager.ts → ScribbleManager/ScribbleManager.ts} +2 -2
  139. package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +485 -0
  140. package/src/lib/editor/managers/TextManager/TextManager.test.ts +411 -0
  141. package/src/lib/editor/managers/{TextManager.ts → TextManager/TextManager.ts} +1 -1
  142. package/src/lib/editor/managers/TickManager/TickManager.test.ts +314 -0
  143. package/src/lib/editor/managers/{TickManager.ts → TickManager/TickManager.ts} +2 -2
  144. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +591 -0
  145. package/src/lib/editor/managers/{UserPreferencesManager.ts → UserPreferencesManager/UserPreferencesManager.ts} +2 -2
  146. package/src/lib/editor/shapes/ShapeUtil.ts +1 -1
  147. package/src/lib/exports/getSvgJsx.tsx +1 -1
  148. package/src/lib/primitives/Box.test.ts +588 -7
  149. package/src/lib/primitives/Box.ts +41 -33
  150. package/src/lib/primitives/Vec.test.ts +2 -2
  151. package/src/lib/primitives/Vec.ts +13 -8
  152. package/src/lib/primitives/geometry/Arc2d.ts +42 -23
  153. package/src/lib/primitives/geometry/Circle2d.ts +12 -12
  154. package/src/lib/primitives/geometry/CubicBezier2d.test.ts +5 -0
  155. package/src/lib/primitives/geometry/CubicBezier2d.ts +13 -17
  156. package/src/lib/primitives/geometry/CubicSpline2d.ts +5 -5
  157. package/src/lib/primitives/geometry/Edge2d.ts +14 -18
  158. package/src/lib/primitives/geometry/Ellipse2d.ts +12 -13
  159. package/src/lib/primitives/geometry/Point2d.ts +6 -6
  160. package/src/lib/primitives/geometry/Polygon2d.ts +4 -0
  161. package/src/lib/primitives/geometry/Polyline2d.ts +10 -7
  162. package/src/lib/primitives/geometry/Rectangle2d.ts +24 -11
  163. package/src/lib/primitives/geometry/Stadium2d.ts +22 -23
  164. package/src/lib/utils/areShapesContentEqual.ts +2 -1
  165. package/src/lib/utils/reorderShapes.ts +10 -13
  166. package/src/lib/utils/richText.ts +1 -1
  167. package/src/version.ts +3 -3
  168. package/dist-cjs/lib/editor/managers/ClickManager.js.map +0 -7
  169. package/dist-cjs/lib/editor/managers/EdgeScrollManager.js.map +0 -7
  170. package/dist-cjs/lib/editor/managers/FocusManager.js.map +0 -7
  171. package/dist-cjs/lib/editor/managers/FontManager.js.map +0 -7
  172. package/dist-cjs/lib/editor/managers/HistoryManager.js.map +0 -7
  173. package/dist-cjs/lib/editor/managers/ScribbleManager.js.map +0 -7
  174. package/dist-cjs/lib/editor/managers/Stack.js +0 -82
  175. package/dist-cjs/lib/editor/managers/Stack.js.map +0 -7
  176. package/dist-cjs/lib/editor/managers/TextManager.js.map +0 -7
  177. package/dist-cjs/lib/editor/managers/TickManager.js.map +0 -7
  178. package/dist-cjs/lib/editor/managers/UserPreferencesManager.js.map +0 -7
  179. package/dist-esm/lib/editor/managers/ClickManager.mjs.map +0 -7
  180. package/dist-esm/lib/editor/managers/EdgeScrollManager.mjs.map +0 -7
  181. package/dist-esm/lib/editor/managers/FocusManager.mjs.map +0 -7
  182. package/dist-esm/lib/editor/managers/FontManager.mjs.map +0 -7
  183. package/dist-esm/lib/editor/managers/HistoryManager.mjs.map +0 -7
  184. package/dist-esm/lib/editor/managers/ScribbleManager.mjs.map +0 -7
  185. package/dist-esm/lib/editor/managers/Stack.mjs +0 -62
  186. package/dist-esm/lib/editor/managers/Stack.mjs.map +0 -7
  187. package/dist-esm/lib/editor/managers/TextManager.mjs.map +0 -7
  188. package/dist-esm/lib/editor/managers/TickManager.mjs.map +0 -7
  189. package/dist-esm/lib/editor/managers/UserPreferencesManager.mjs.map +0 -7
  190. package/src/lib/editor/managers/ScribbleManager.test.ts +0 -32
  191. package/src/lib/editor/managers/Stack.ts +0 -71
  192. /package/dist-cjs/lib/editor/managers/{FocusManager.js → FocusManager/FocusManager.js} +0 -0
  193. /package/dist-cjs/lib/editor/managers/{TextManager.js → TextManager/TextManager.js} +0 -0
  194. /package/dist-esm/lib/editor/managers/{FocusManager.mjs → FocusManager/FocusManager.mjs} +0 -0
  195. /package/dist-esm/lib/editor/managers/{TextManager.mjs → TextManager/TextManager.mjs} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/version.ts"],
4
- "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.14.0-canary.48967da8ee66'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-05-29T21:43:31.679Z',\n\tpatch: '2025-05-29T21:43:31.679Z',\n}\n"],
4
+ "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.14.0-canary.4c533b76dc35'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-06-08T15:48:10.989Z',\n\tpatch: '2025-06-08T15:48:10.989Z',\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -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;
@@ -138,6 +138,9 @@ export declare class Arc2d extends Geometry2d {
138
138
  */
139
139
  export declare function areAnglesCompatible(a: number, b: number): boolean;
140
140
 
141
+ /** @public */
142
+ export declare const areShapesContentEqual: (a: TLShape, b: TLShape) => boolean;
143
+
141
144
  /** @public */
142
145
  export declare function average(A: VecLike, B: VecLike): string;
143
146
 
@@ -514,6 +517,8 @@ export declare class Box {
514
517
  };
515
518
  equals(other: Box | BoxModel): boolean;
516
519
  static Equals(a: Box | BoxModel, b: Box | BoxModel): boolean;
520
+ prettyMuchEquals(other: Box | BoxModel): boolean;
521
+ static PrettyMuchEquals(a: Box | BoxModel, b: Box | BoxModel): boolean;
517
522
  zeroFix(): this;
518
523
  static ZeroFix(other: Box | BoxModel): Box;
519
524
  }
@@ -551,10 +556,10 @@ export declare class Circle2d extends Geometry2d {
551
556
  x?: number;
552
557
  y?: number;
553
558
  };
554
- _center: Vec;
555
- radius: number;
556
- x: number;
557
- y: number;
559
+ private _center;
560
+ private _radius;
561
+ private _x;
562
+ private _y;
558
563
  constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
559
564
  isFilled: boolean;
560
565
  radius: number;
@@ -716,10 +721,10 @@ export declare function createTLUser(opts?: {
716
721
 
717
722
  /** @public */
718
723
  export declare class CubicBezier2d extends Polyline2d {
719
- a: Vec;
720
- b: Vec;
721
- c: Vec;
722
- d: Vec;
724
+ private _a;
725
+ private _b;
726
+ private _c;
727
+ private _d;
723
728
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
724
729
  cp1: Vec;
725
730
  cp2: Vec;
@@ -727,20 +732,19 @@ export declare class CubicBezier2d extends Polyline2d {
727
732
  start: Vec;
728
733
  });
729
734
  getVertices(): Vec[];
730
- midPoint(): Vec;
731
735
  nearestPoint(A: VecLike): Vec;
732
736
  getSvgPathData(first?: boolean): string;
733
737
  static GetAtT(segment: CubicBezier2d, t: number): Vec;
734
- getLength(filters?: Geometry2dFilters, precision?: number): number;
738
+ getLength(_filters?: Geometry2dFilters, precision?: number): number;
735
739
  }
736
740
 
737
741
  /** @public */
738
742
  export declare class CubicSpline2d extends Geometry2d {
739
- points: Vec[];
743
+ private _points;
740
744
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
741
745
  points: Vec[];
742
746
  });
743
- _segments?: CubicBezier2d[];
747
+ private _segments?;
744
748
  get segments(): CubicBezier2d[];
745
749
  getLength(): number;
746
750
  getVertices(): Vec[];
@@ -927,17 +931,16 @@ export declare const EASINGS: {
927
931
 
928
932
  /** @public */
929
933
  export declare class Edge2d extends Geometry2d {
930
- start: Vec;
931
- end: Vec;
932
- d: Vec;
933
- u: Vec;
934
- ul: number;
934
+ private _start;
935
+ private _end;
936
+ private _d;
937
+ private _u;
938
+ private _ul;
935
939
  constructor(config: {
936
940
  end: Vec;
937
941
  start: Vec;
938
942
  });
939
943
  getLength(): number;
940
- midPoint(): Vec;
941
944
  getVertices(): Vec[];
942
945
  nearestPoint(point: VecLike): Vec;
943
946
  getSvgPathData(first?: boolean): string;
@@ -2457,23 +2460,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2457
2460
  * @public
2458
2461
  */
2459
2462
  getShapeGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
2460
- private _shapePageGeometryCaches;
2461
- /**
2462
- * Get the geometry of a shape in page-space.
2463
- *
2464
- * @example
2465
- * ```ts
2466
- * editor.getShapePageGeometry(myShape)
2467
- * editor.getShapePageGeometry(myShapeId)
2468
- * editor.getShapePageGeometry(myShapeId, { context: "arrow" })
2469
- * ```
2470
- *
2471
- * @param shape - The shape (or shape id) to get the geometry for.
2472
- * @param opts - Additional options about the request for geometry. Passed to {@link ShapeUtil.getGeometry}.
2473
- *
2474
- * @public
2475
- */
2476
- getShapePageGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
2477
2463
  /* Excluded from this release type: _getShapeHandlesCache */
2478
2464
  /**
2479
2465
  * Get the handles (if any) for a shape.
@@ -3996,13 +3982,13 @@ export declare class Ellipse2d extends Geometry2d {
3996
3982
  height: number;
3997
3983
  width: number;
3998
3984
  };
3999
- w: number;
4000
- h: number;
3985
+ private _w;
3986
+ private _h;
3987
+ private _edges?;
4001
3988
  constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
4002
3989
  height: number;
4003
3990
  width: number;
4004
3991
  });
4005
- _edges?: Edge2d[];
4006
3992
  get edges(): Edge2d[];
4007
3993
  getVertices(): any[];
4008
3994
  nearestPoint(A: VecLike): Vec;
@@ -4687,7 +4673,7 @@ export declare const PI2: number;
4687
4673
 
4688
4674
  /** @public */
4689
4675
  export declare class Point2d extends Geometry2d {
4690
- point: Vec;
4676
+ private _point;
4691
4677
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
4692
4678
  margin: number;
4693
4679
  point: Vec;
@@ -4731,12 +4717,12 @@ export declare function polygonsIntersect(a: VecLike[], b: VecLike[]): boolean;
4731
4717
 
4732
4718
  /** @public */
4733
4719
  export declare class Polyline2d extends Geometry2d {
4734
- points: Vec[];
4720
+ private _points;
4721
+ private _segments?;
4735
4722
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
4736
4723
  points: Vec[];
4737
4724
  });
4738
- _segments?: Edge2d[];
4739
- get segments(): Edge2d[];
4725
+ protected get segments(): Edge2d[];
4740
4726
  getLength(): number;
4741
4727
  getVertices(): Vec[];
4742
4728
  nearestPoint(A: VecLike): Vec;
@@ -4802,10 +4788,10 @@ export declare class ReadonlySharedStyleMap {
4802
4788
 
4803
4789
  /** @public */
4804
4790
  export declare class Rectangle2d extends Polygon2d {
4805
- x: number;
4806
- y: number;
4807
- w: number;
4808
- h: number;
4791
+ private _x;
4792
+ private _y;
4793
+ private _w;
4794
+ private _h;
4809
4795
  constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
4810
4796
  height: number;
4811
4797
  width: number;
@@ -4814,6 +4800,7 @@ export declare class Rectangle2d extends Polygon2d {
4814
4800
  });
4815
4801
  getBounds(): Box;
4816
4802
  getSvgPathData(): string;
4803
+ private negativeZeroFix;
4817
4804
  }
4818
4805
 
4819
4806
  /** @public */
@@ -5548,12 +5535,12 @@ export declare class Stadium2d extends Geometry2d {
5548
5535
  height: number;
5549
5536
  width: number;
5550
5537
  };
5551
- w: number;
5552
- h: number;
5553
- a: Arc2d;
5554
- b: Edge2d;
5555
- c: Arc2d;
5556
- d: Edge2d;
5538
+ private _w;
5539
+ private _h;
5540
+ private _a;
5541
+ private _b;
5542
+ private _c;
5543
+ private _d;
5557
5544
  constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
5558
5545
  height: number;
5559
5546
  width: number;
@@ -7686,7 +7673,7 @@ export declare class Vec {
7686
7673
  len(): number;
7687
7674
  pry(V: VecLike): number;
7688
7675
  per(): this;
7689
- uni(): Vec;
7676
+ uni(): this;
7690
7677
  tan(V: VecLike): Vec;
7691
7678
  dist(V: VecLike): number;
7692
7679
  distanceToLineSegment(A: VecLike, B: VecLike): number;
@@ -7697,8 +7684,9 @@ export declare class Vec {
7697
7684
  lrp(B: VecLike, t: number): Vec;
7698
7685
  equals(B: VecLike): boolean;
7699
7686
  equalsXY(x: number, y: number): boolean;
7687
+ /** @deprecated use `uni` instead */
7700
7688
  norm(): this;
7701
- toFixed(): Vec;
7689
+ toFixed(): this;
7702
7690
  toString(): string;
7703
7691
  toJson(): VecModel;
7704
7692
  toArray(): number[];
@@ -4,6 +4,7 @@ import "core-js/stable/array/flat-map.js";
4
4
  import "core-js/stable/array/flat.js";
5
5
  import "core-js/stable/string/at.js";
6
6
  import "core-js/stable/string/replace-all.js";
7
+ import { areShapesContentEqual } from "./lib/utils/areShapesContentEqual.mjs";
7
8
  export * from "@tldraw/state";
8
9
  export * from "@tldraw/state-react";
9
10
  export * from "@tldraw/store";
@@ -96,13 +97,15 @@ import {
96
97
  import {
97
98
  BindingUtil
98
99
  } from "./lib/editor/bindings/BindingUtil.mjs";
99
- import { ClickManager } from "./lib/editor/managers/ClickManager.mjs";
100
- import { EdgeScrollManager } from "./lib/editor/managers/EdgeScrollManager.mjs";
100
+ import { ClickManager } from "./lib/editor/managers/ClickManager/ClickManager.mjs";
101
+ import { EdgeScrollManager } from "./lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs";
101
102
  import {
102
103
  FontManager
103
- } from "./lib/editor/managers/FontManager.mjs";
104
- import { HistoryManager } from "./lib/editor/managers/HistoryManager.mjs";
105
- import { ScribbleManager } from "./lib/editor/managers/ScribbleManager.mjs";
104
+ } from "./lib/editor/managers/FontManager/FontManager.mjs";
105
+ import { HistoryManager } from "./lib/editor/managers/HistoryManager/HistoryManager.mjs";
106
+ import {
107
+ ScribbleManager
108
+ } from "./lib/editor/managers/ScribbleManager/ScribbleManager.mjs";
106
109
  import {
107
110
  BoundsSnaps
108
111
  } from "./lib/editor/managers/SnapManager/BoundsSnaps.mjs";
@@ -110,8 +113,10 @@ import { HandleSnaps } from "./lib/editor/managers/SnapManager/HandleSnaps.mjs";
110
113
  import {
111
114
  SnapManager
112
115
  } from "./lib/editor/managers/SnapManager/SnapManager.mjs";
113
- import { TextManager } from "./lib/editor/managers/TextManager.mjs";
114
- import { UserPreferencesManager } from "./lib/editor/managers/UserPreferencesManager.mjs";
116
+ import {
117
+ TextManager
118
+ } from "./lib/editor/managers/TextManager/TextManager.mjs";
119
+ import { UserPreferencesManager } from "./lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs";
115
120
  import { BaseBoxShapeUtil } from "./lib/editor/shapes/BaseBoxShapeUtil.mjs";
116
121
  import {
117
122
  ShapeUtil
@@ -288,7 +293,7 @@ function debugEnableLicensing() {
288
293
  }
289
294
  registerTldrawLibraryVersion(
290
295
  "@tldraw/editor",
291
- "3.14.0-canary.48967da8ee66",
296
+ "3.14.0-canary.4c533b76dc35",
292
297
  "esm"
293
298
  );
294
299
  export {
@@ -376,6 +381,7 @@ export {
376
381
  applyRotationToSnapshotShapes,
377
382
  approximately,
378
383
  areAnglesCompatible,
384
+ areShapesContentEqual,
379
385
  average,
380
386
  canonicalizeRotation,
381
387
  centerOfCircleFromThreePoints,
@@ -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,SAAS,oCAAoC;AAC7C,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAGP,cAAc;AAEd,cAAc;AAEd,cAAc;A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;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'\nexport { areShapesContentEqual } from './lib/utils/areShapesContentEqual'\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 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": "AAAA,SAAS,oCAAoC;AAC7C,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,6BAA6B;AAGtC,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,qBAA8C;AACvD,SAAS,wBAAwB;AACjC,SAAS,oBAA4C;AACrD,SAAS,yBAAyB;AAClC,SAAS,oBAAuC;AAChD;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAA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ACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,eAAe,4BAA4B;AACpD,SAAS,mCAAuD;AAChE;AAAA,EACC;AAAA,EACA;AAAA,OAIM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B;AAAA,EACC;AAAA,OAMM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,SAAS,2BAA2B;AAC7C,SAAS,gBAAgB,aAA6B;AAEtD,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAKpB,SAAS,uBAAuB;AAEtC;AACD;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": []
7
7
  }
@@ -147,16 +147,16 @@ import { bindingsIndex } from "./derivations/bindingsIndex.mjs";
147
147
  import { notVisibleShapes } from "./derivations/notVisibleShapes.mjs";
148
148
  import { parentsToChildren } from "./derivations/parentsToChildren.mjs";
149
149
  import { deriveShapeIdsInCurrentPage } from "./derivations/shapeIdsInCurrentPage.mjs";
150
- import { ClickManager } from "./managers/ClickManager.mjs";
151
- import { EdgeScrollManager } from "./managers/EdgeScrollManager.mjs";
152
- import { FocusManager } from "./managers/FocusManager.mjs";
153
- import { FontManager } from "./managers/FontManager.mjs";
154
- import { HistoryManager } from "./managers/HistoryManager.mjs";
155
- import { ScribbleManager } from "./managers/ScribbleManager.mjs";
150
+ import { ClickManager } from "./managers/ClickManager/ClickManager.mjs";
151
+ import { EdgeScrollManager } from "./managers/EdgeScrollManager/EdgeScrollManager.mjs";
152
+ import { FocusManager } from "./managers/FocusManager/FocusManager.mjs";
153
+ import { FontManager } from "./managers/FontManager/FontManager.mjs";
154
+ import { HistoryManager } from "./managers/HistoryManager/HistoryManager.mjs";
155
+ import { ScribbleManager } from "./managers/ScribbleManager/ScribbleManager.mjs";
156
156
  import { SnapManager } from "./managers/SnapManager/SnapManager.mjs";
157
- import { TextManager } from "./managers/TextManager.mjs";
158
- import { TickManager } from "./managers/TickManager.mjs";
159
- import { UserPreferencesManager } from "./managers/UserPreferencesManager.mjs";
157
+ import { TextManager } from "./managers/TextManager/TextManager.mjs";
158
+ import { TickManager } from "./managers/TickManager/TickManager.mjs";
159
+ import { UserPreferencesManager } from "./managers/UserPreferencesManager/UserPreferencesManager.mjs";
160
160
  import { RootState } from "./tools/RootState.mjs";
161
161
  class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed], _getCanUndo_dec = [computed], _getCanRedo_dec = [computed], _getPath_dec = [computed], _getCurrentTool_dec = [computed], _getCurrentToolId_dec = [computed], _getDocumentSettings_dec = [computed], _getInstanceState_dec = [computed], _getOpenMenus_dec = [computed], _getIsMenuOpen_dec = [computed], _getPageStates_dec = [computed], __getPageStatesQuery_dec = [computed], _getCurrentPageState_dec = [computed], __getCurrentPageStateId_dec = [computed], _getSelectedShapeIds_dec = [computed], _getSelectedShapes_dec = [computed], _getCurrentPageShapesInReadingOrder_dec = [computed], _getOnlySelectedShapeId_dec = [computed], _getOnlySelectedShape_dec = [computed], _getSelectionPageBounds_dec = [computed], _getSelectionRotation_dec = [computed], _getSelectionRotatedPageBounds_dec = [computed], _getSelectionRotatedScreenBounds_dec = [computed], _getFocusedGroupId_dec = [computed], _getFocusedGroup_dec = [computed], _getEditingShapeId_dec = [computed], _getEditingShape_dec = [computed], _getRichTextEditor_dec = [computed], _getHoveredShapeId_dec = [computed], _getHoveredShape_dec = [computed], _getHintingShapeIds_dec = [computed], _getHintingShape_dec = [computed], _getErasingShapeIds_dec = [computed], _getErasingShapes_dec = [computed], __unsafe_getCameraId_dec = [computed], _getCamera_dec = [computed], _getViewportPageBoundsForFollowing_dec = [computed], _getCameraForFollowing_dec = [computed], _getZoomLevel_dec = [computed], _getViewportScreenBounds_dec = [computed], _getViewportScreenCenter_dec = [computed], _getViewportPageBounds_dec = [computed], __getCollaboratorsQuery_dec = [computed], _getCollaborators_dec = [computed], _getCollaboratorsOnCurrentPage_dec = [computed], _getRenderingShapes_dec = [computed], __getAllPagesQuery_dec = [computed], _getPages_dec = [computed], _getCurrentPageId_dec = [computed], _getCurrentPageShapeIdsSorted_dec = [computed], __getAllAssetsQuery_dec = [computed], __getShapeHandlesCache_dec = [computed], __getShapePageTransformCache_dec = [computed], __getShapePageBoundsCache_dec = [computed], __getShapeClipPathCache_dec = [computed], __getShapeMaskCache_dec = [computed], __getShapeMaskedPageBoundsCache_dec = [computed], __notVisibleShapes_dec = [computed], _getCulledShapes_dec = [computed], _getCurrentPageBounds_dec = [computed], _getCurrentPageShapes_dec = [computed], _getCurrentPageShapesSorted_dec = [computed], _getCurrentPageRenderingShapesSorted_dec = [computed], __getBindingsIndexCache_dec = [computed], __getSelectionSharedStyles_dec = [computed], _getSharedStyles_dec = [computed({ isEqual: (a, b) => a.equals(b) })], _getSharedOpacity_dec = [computed], _getIsFocused_dec = [computed], _getIsReadonly_dec = [computed], __setShiftKeyTimeout_dec = [bind], __setAltKeyTimeout_dec = [bind], __setCtrlKeyTimeout_dec = [bind], __setMetaKeyTimeout_dec = [bind], _a) {
162
162
  constructor({
@@ -336,7 +336,6 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
336
336
  __publicField(this, "_currentPageShapeIds");
337
337
  /* --------------------- Shapes --------------------- */
338
338
  __publicField(this, "_shapeGeometryCaches", {});
339
- __publicField(this, "_shapePageGeometryCaches", {});
340
339
  // Parents and children
341
340
  /**
342
341
  * A cache of parents to children.
@@ -593,6 +592,7 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
593
592
  shape: {
594
593
  afterChange: (shapeBefore, shapeAfter) => {
595
594
  for (const binding of this.getBindingsInvolvingShape(shapeAfter)) {
595
+ if (areShapesContentEqual(shapeBefore, shapeAfter)) continue;
596
596
  invalidBindingTypes.add(binding.type);
597
597
  if (binding.fromId === shapeAfter.id) {
598
598
  this.getBindingUtil(binding).onAfterChangeFromShape?.({
@@ -2853,10 +2853,7 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
2853
2853
  }
2854
2854
  getViewportScreenCenter() {
2855
2855
  const viewportScreenBounds = this.getViewportScreenBounds();
2856
- return new Vec(
2857
- viewportScreenBounds.midX - viewportScreenBounds.minX,
2858
- viewportScreenBounds.midY - viewportScreenBounds.minY
2859
- );
2856
+ return new Vec(viewportScreenBounds.w / 2, viewportScreenBounds.h / 2);
2860
2857
  }
2861
2858
  getViewportPageBounds() {
2862
2859
  const { w, h } = this.getViewportScreenBounds();
@@ -3531,41 +3528,6 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
3531
3528
  typeof shape === "string" ? shape : shape.id
3532
3529
  );
3533
3530
  }
3534
- /**
3535
- * Get the geometry of a shape in page-space.
3536
- *
3537
- * @example
3538
- * ```ts
3539
- * editor.getShapePageGeometry(myShape)
3540
- * editor.getShapePageGeometry(myShapeId)
3541
- * editor.getShapePageGeometry(myShapeId, { context: "arrow" })
3542
- * ```
3543
- *
3544
- * @param shape - The shape (or shape id) to get the geometry for.
3545
- * @param opts - Additional options about the request for geometry. Passed to {@link ShapeUtil.getGeometry}.
3546
- *
3547
- * @public
3548
- */
3549
- getShapePageGeometry(shape, opts) {
3550
- const context = opts?.context ?? "none";
3551
- if (!this._shapePageGeometryCaches[context]) {
3552
- this._shapePageGeometryCaches[context] = this.store.createComputedCache(
3553
- "bounds",
3554
- (shape2) => {
3555
- const geometry = this.getShapeGeometry(shape2.id, opts);
3556
- const pageTransform = this.getShapePageTransform(shape2.id);
3557
- return geometry.transform(pageTransform);
3558
- },
3559
- {
3560
- // we only depend directly on the shape id, and changing geometry/transform will update us anyway
3561
- areRecordsEqual: () => true
3562
- }
3563
- );
3564
- }
3565
- return this._shapePageGeometryCaches[context].get(
3566
- typeof shape === "string" ? shape : shape.id
3567
- );
3568
- }
3569
3531
  _getShapeHandlesCache() {
3570
3532
  return this.store.createComputedCache(
3571
3533
  "handles",
@@ -3659,7 +3621,10 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
3659
3621
  }
3660
3622
  _getShapePageBoundsCache() {
3661
3623
  return this.store.createComputedCache("pageBoundsCache", (shape) => {
3662
- return this.getShapePageGeometry(shape).bounds;
3624
+ const pageTransform = this.getShapePageTransform(shape);
3625
+ if (!pageTransform) return void 0;
3626
+ const geometry = this.getShapeGeometry(shape);
3627
+ return Box.FromPoints(pageTransform.applyToPoints(geometry.vertices));
3663
3628
  });
3664
3629
  }
3665
3630
  /**
@@ -3716,12 +3681,11 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
3716
3681
  (shape2) => this.isShapeOfType(shape2, "frame")
3717
3682
  );
3718
3683
  if (frameAncestors.length === 0) return void 0;
3719
- const pageMask = frameAncestors.map(
3720
- (s) => (
3721
- // Apply the frame transform to the frame outline to get the frame outline in the current page space
3722
- (this.getShapePageGeometry(s.id).vertices)
3723
- )
3724
- ).reduce((acc, b) => {
3684
+ const pageMask = frameAncestors.map((s) => {
3685
+ const geometry = this.getShapeGeometry(s.id);
3686
+ const pageTransform = this.getShapePageTransform(s.id);
3687
+ return pageTransform.applyToPoints(geometry.vertices);
3688
+ }).reduce((acc, b) => {
3725
3689
  if (!(b && acc)) return void 0;
3726
3690
  const intersection = intersectPolygonPolygon(acc, b);
3727
3691
  if (intersection) {
@@ -4049,7 +4013,7 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
4049
4013
  * @public
4050
4014
  */
4051
4015
  getShapesAtPoint(point, opts = {}) {
4052
- return this.getCurrentPageShapes().filter(
4016
+ return this.getCurrentPageShapesSorted().filter(
4053
4017
  (shape) => !this.isShapeHidden(shape) && this.isPointInShape(shape, point, opts)
4054
4018
  );
4055
4019
  }