@tldraw/editor 3.13.0-canary.8e04030e54fe → 3.13.0-canary.8f8ae1660cdb

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 (96) hide show
  1. package/dist-cjs/index.d.ts +74 -96
  2. package/dist-cjs/index.js +7 -22
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/editor/Editor.js +3 -5
  5. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  6. package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js.map +2 -2
  7. package/dist-cjs/lib/editor/shapes/shared/getPerfectDashProps.js.map +2 -2
  8. package/dist-cjs/lib/primitives/Box.js +16 -0
  9. package/dist-cjs/lib/primitives/Box.js.map +2 -2
  10. package/dist-cjs/lib/primitives/Mat.js +1 -1
  11. package/dist-cjs/lib/primitives/Mat.js.map +2 -2
  12. package/dist-cjs/lib/primitives/Vec.js +20 -0
  13. package/dist-cjs/lib/primitives/Vec.js.map +2 -2
  14. package/dist-cjs/lib/primitives/geometry/Arc2d.js +2 -2
  15. package/dist-cjs/lib/primitives/geometry/Arc2d.js.map +2 -2
  16. package/dist-cjs/lib/primitives/geometry/Circle2d.js +1 -1
  17. package/dist-cjs/lib/primitives/geometry/Circle2d.js.map +2 -2
  18. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js +1 -1
  19. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js.map +2 -2
  20. package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js.map +2 -2
  21. package/dist-cjs/lib/primitives/geometry/Edge2d.js +1 -1
  22. package/dist-cjs/lib/primitives/geometry/Edge2d.js.map +2 -2
  23. package/dist-cjs/lib/primitives/geometry/Ellipse2d.js.map +2 -2
  24. package/dist-cjs/lib/primitives/geometry/Geometry2d.js +91 -20
  25. package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
  26. package/dist-cjs/lib/primitives/geometry/Group2d.js +55 -2
  27. package/dist-cjs/lib/primitives/geometry/Group2d.js.map +2 -2
  28. package/dist-cjs/lib/primitives/geometry/Point2d.js.map +2 -2
  29. package/dist-cjs/lib/primitives/geometry/Polyline2d.js.map +2 -2
  30. package/dist-cjs/lib/primitives/geometry/Stadium2d.js.map +2 -2
  31. package/dist-cjs/lib/utils/debug-flags.js +5 -2
  32. package/dist-cjs/lib/utils/debug-flags.js.map +2 -2
  33. package/dist-cjs/version.js +3 -3
  34. package/dist-cjs/version.js.map +1 -1
  35. package/dist-esm/index.d.mts +74 -96
  36. package/dist-esm/index.mjs +9 -41
  37. package/dist-esm/index.mjs.map +2 -2
  38. package/dist-esm/lib/editor/Editor.mjs +3 -5
  39. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  40. package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs.map +2 -2
  41. package/dist-esm/lib/editor/shapes/shared/getPerfectDashProps.mjs.map +2 -2
  42. package/dist-esm/lib/primitives/Box.mjs +16 -0
  43. package/dist-esm/lib/primitives/Box.mjs.map +2 -2
  44. package/dist-esm/lib/primitives/Mat.mjs +1 -1
  45. package/dist-esm/lib/primitives/Mat.mjs.map +2 -2
  46. package/dist-esm/lib/primitives/Vec.mjs +20 -0
  47. package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
  48. package/dist-esm/lib/primitives/geometry/Arc2d.mjs +2 -2
  49. package/dist-esm/lib/primitives/geometry/Arc2d.mjs.map +2 -2
  50. package/dist-esm/lib/primitives/geometry/Circle2d.mjs +1 -1
  51. package/dist-esm/lib/primitives/geometry/Circle2d.mjs.map +2 -2
  52. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs +1 -1
  53. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs.map +2 -2
  54. package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs.map +2 -2
  55. package/dist-esm/lib/primitives/geometry/Edge2d.mjs +1 -1
  56. package/dist-esm/lib/primitives/geometry/Edge2d.mjs.map +2 -2
  57. package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs.map +2 -2
  58. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +92 -21
  59. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  60. package/dist-esm/lib/primitives/geometry/Group2d.mjs +55 -2
  61. package/dist-esm/lib/primitives/geometry/Group2d.mjs.map +2 -2
  62. package/dist-esm/lib/primitives/geometry/Point2d.mjs.map +2 -2
  63. package/dist-esm/lib/primitives/geometry/Polyline2d.mjs.map +2 -2
  64. package/dist-esm/lib/primitives/geometry/Stadium2d.mjs.map +2 -2
  65. package/dist-esm/lib/utils/debug-flags.mjs +5 -2
  66. package/dist-esm/lib/utils/debug-flags.mjs.map +2 -2
  67. package/dist-esm/version.mjs +3 -3
  68. package/dist-esm/version.mjs.map +1 -1
  69. package/editor.css +29 -0
  70. package/package.json +7 -7
  71. package/src/index.ts +16 -31
  72. package/src/lib/editor/Editor.test.ts +1 -1
  73. package/src/lib/editor/Editor.ts +3 -5
  74. package/src/lib/editor/managers/SnapManager/HandleSnaps.ts +0 -1
  75. package/src/lib/editor/shapes/shared/getPerfectDashProps.ts +9 -9
  76. package/src/lib/primitives/Box.ts +20 -0
  77. package/src/lib/primitives/Mat.ts +5 -4
  78. package/src/lib/primitives/Vec.ts +23 -0
  79. package/src/lib/primitives/geometry/Arc2d.ts +5 -5
  80. package/src/lib/primitives/geometry/Circle2d.ts +4 -4
  81. package/src/lib/primitives/geometry/CubicBezier2d.ts +4 -4
  82. package/src/lib/primitives/geometry/CubicSpline2d.ts +3 -3
  83. package/src/lib/primitives/geometry/Edge2d.ts +3 -3
  84. package/src/lib/primitives/geometry/Ellipse2d.ts +3 -3
  85. package/src/lib/primitives/geometry/Geometry2d.test.ts +42 -0
  86. package/src/lib/primitives/geometry/Geometry2d.ts +123 -35
  87. package/src/lib/primitives/geometry/Group2d.ts +70 -7
  88. package/src/lib/primitives/geometry/Point2d.ts +2 -2
  89. package/src/lib/primitives/geometry/Polyline2d.ts +3 -3
  90. package/src/lib/primitives/geometry/Stadium2d.ts +3 -3
  91. package/src/lib/test/currentToolIdMask.test.ts +1 -1
  92. package/src/lib/test/user.test.ts +1 -1
  93. package/src/lib/utils/debug-flags.ts +7 -2
  94. package/src/lib/utils/sync/LocalIndexedDb.test.ts +1 -1
  95. package/src/lib/utils/sync/TLLocalSyncClient.test.ts +1 -1
  96. package/src/version.ts +3 -3
@@ -1,16 +1,12 @@
1
1
  /// <reference types="react" />
2
2
 
3
3
  import { Atom } from '@tldraw/state';
4
- import { atom } from '@tldraw/state';
5
4
  import { BoxModel } from '@tldraw/tlschema';
6
5
  import { ComponentType } from 'react';
7
6
  import { Computed } from '@tldraw/state';
8
- import { computed } from '@tldraw/state';
9
7
  import { Dispatch } from 'react';
10
8
  import { Editor as Editor_2 } from '@tiptap/core';
11
9
  import { EditorProviderProps } from '@tiptap/react';
12
- import { EffectScheduler } from '@tldraw/state';
13
- import { EMPTY_ARRAY } from '@tldraw/state';
14
10
  import EventEmitter from 'eventemitter3';
15
11
  import { ExoticComponent } from 'react';
16
12
  import { HistoryEntry } from '@tldraw/store';
@@ -23,7 +19,6 @@ import { NamedExoticComponent } from 'react';
23
19
  import { Node as Node_2 } from '@tiptap/pm/model';
24
20
  import { PerformanceTracker } from '@tldraw/utils';
25
21
  import { PointerEventHandler } from 'react';
26
- import { react } from '@tldraw/state';
27
22
  import { default as React_2 } from 'react';
28
23
  import * as React_3 from 'react';
29
24
  import { ReactElement } from 'react';
@@ -82,18 +77,8 @@ import { TLStoreSnapshot } from '@tldraw/tlschema';
82
77
  import { TLUnknownBinding } from '@tldraw/tlschema';
83
78
  import { TLUnknownShape } from '@tldraw/tlschema';
84
79
  import { TLVideoAsset } from '@tldraw/tlschema';
85
- import { track } from '@tldraw/state-react';
86
- import { transact } from '@tldraw/state';
87
- import { transaction } from '@tldraw/state';
88
80
  import { UnknownRecord } from '@tldraw/store';
89
- import { useAtom } from '@tldraw/state-react';
90
- import { useComputed } from '@tldraw/state-react';
91
- import { useQuickReactor } from '@tldraw/state-react';
92
- import { useReactor } from '@tldraw/state-react';
93
- import { useStateTracking } from '@tldraw/state-react';
94
- import { useValue } from '@tldraw/state-react';
95
81
  import { VecModel } from '@tldraw/tlschema';
96
- import { whyAmIRunning } from '@tldraw/state';
97
82
 
98
83
  /* Excluded from this release type: activeElementShouldCaptureKeys */
99
84
 
@@ -136,8 +121,8 @@ export declare class Arc2d extends Geometry2d {
136
121
  start: Vec;
137
122
  sweepFlag: number;
138
123
  });
139
- nearestPoint(point: Vec): Vec;
140
- hitTestLineSegment(A: Vec, B: Vec): boolean;
124
+ nearestPoint(point: VecLike): Vec;
125
+ hitTestLineSegment(A: VecLike, B: VecLike): boolean;
141
126
  getVertices(): Vec[];
142
127
  getSvgPathData(first?: boolean): string;
143
128
  getLength(): number;
@@ -153,10 +138,6 @@ export declare class Arc2d extends Geometry2d {
153
138
  */
154
139
  export declare function areAnglesCompatible(a: number, b: number): boolean;
155
140
 
156
- export { Atom }
157
-
158
- export { atom }
159
-
160
141
  /** @public */
161
142
  export declare function average(A: VecLike, B: VecLike): string;
162
143
 
@@ -477,12 +458,16 @@ export declare class Box {
477
458
  set point(val: Vec);
478
459
  get minX(): number;
479
460
  set minX(n: number);
461
+ get left(): number;
480
462
  get midX(): number;
481
463
  get maxX(): number;
464
+ get right(): number;
482
465
  get minY(): number;
483
466
  set minY(n: number);
467
+ get top(): number;
484
468
  get midY(): number;
485
469
  get maxY(): number;
470
+ get bottom(): number;
486
471
  get width(): number;
487
472
  set width(n: number);
488
473
  get height(): number;
@@ -578,8 +563,8 @@ export declare class Circle2d extends Geometry2d {
578
563
  });
579
564
  getBounds(): Box;
580
565
  getVertices(): Vec[];
581
- nearestPoint(point: Vec): Vec;
582
- hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean;
566
+ nearestPoint(point: VecLike): Vec;
567
+ hitTestLineSegment(A: VecLike, B: VecLike, distance?: number): boolean;
583
568
  getSvgPathData(): string;
584
569
  }
585
570
 
@@ -656,8 +641,6 @@ export declare class ClickManager {
656
641
  */
657
642
  export declare function clockwiseAngleDist(a0: number, a1: number): number;
658
643
 
659
- export { computed }
660
-
661
644
  /**
662
645
  * @public
663
646
  * @react
@@ -745,10 +728,10 @@ export declare class CubicBezier2d extends Polyline2d {
745
728
  });
746
729
  getVertices(): Vec[];
747
730
  midPoint(): Vec;
748
- nearestPoint(A: Vec): Vec;
731
+ nearestPoint(A: VecLike): Vec;
749
732
  getSvgPathData(first?: boolean): string;
750
733
  static GetAtT(segment: CubicBezier2d, t: number): Vec;
751
- getLength(precision?: number): number;
734
+ getLength(filters?: Geometry2dFilters, precision?: number): number;
752
735
  }
753
736
 
754
737
  /** @public */
@@ -761,8 +744,8 @@ export declare class CubicSpline2d extends Geometry2d {
761
744
  get segments(): CubicBezier2d[];
762
745
  getLength(): number;
763
746
  getVertices(): Vec[];
764
- nearestPoint(A: Vec): Vec;
765
- hitTestLineSegment(A: Vec, B: Vec): boolean;
747
+ nearestPoint(A: VecLike): Vec;
748
+ hitTestLineSegment(A: VecLike, B: VecLike): boolean;
766
749
  getSvgPathData(): string;
767
750
  }
768
751
 
@@ -956,8 +939,8 @@ export declare class Edge2d extends Geometry2d {
956
939
  getLength(): number;
957
940
  midPoint(): Vec;
958
941
  getVertices(): Vec[];
959
- nearestPoint(point: Vec): Vec;
960
- hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean;
942
+ nearestPoint(point: VecLike): Vec;
943
+ hitTestLineSegment(A: VecLike, B: VecLike, distance?: number): boolean;
961
944
  getSvgPathData(first?: boolean): string;
962
945
  }
963
946
 
@@ -3994,8 +3977,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3994
3977
  /** @public */
3995
3978
  export declare const EditorContext: React_2.Context<Editor | null>;
3996
3979
 
3997
- export { EffectScheduler }
3998
-
3999
3980
  /** @public */
4000
3981
  export declare class Ellipse2d extends Geometry2d {
4001
3982
  config: Omit<Geometry2dOptions, 'isClosed'> & {
@@ -4011,15 +3992,13 @@ export declare class Ellipse2d extends Geometry2d {
4011
3992
  _edges?: Edge2d[];
4012
3993
  get edges(): Edge2d[];
4013
3994
  getVertices(): any[];
4014
- nearestPoint(A: Vec): Vec;
4015
- hitTestLineSegment(A: Vec, B: Vec): boolean;
3995
+ nearestPoint(A: VecLike): Vec;
3996
+ hitTestLineSegment(A: VecLike, B: VecLike): boolean;
4016
3997
  getBounds(): Box;
4017
3998
  getLength(): number;
4018
3999
  getSvgPathData(first?: boolean): string;
4019
4000
  }
4020
4001
 
4021
- export { EMPTY_ARRAY }
4022
-
4023
4002
  /** @public */
4024
4003
  export declare class ErrorBoundary extends React_3.Component<React_3.PropsWithRef<React_3.PropsWithChildren<TLErrorBoundaryProps>>, {
4025
4004
  error: Error | null;
@@ -4087,18 +4066,27 @@ export declare abstract class Geometry2d {
4087
4066
  constructor(opts: Geometry2dOptions);
4088
4067
  isExcludedByFilter(filters?: Geometry2dFilters): boolean;
4089
4068
  abstract getVertices(filters: Geometry2dFilters): Vec[];
4090
- abstract nearestPoint(point: Vec, _filters?: Geometry2dFilters): Vec;
4091
- hitTestPoint(point: Vec, margin?: number, hitInside?: boolean, _filters?: Geometry2dFilters): boolean;
4092
- distanceToPoint(point: Vec, hitInside?: boolean, filters?: Geometry2dFilters): number;
4093
- distanceToLineSegment(A: Vec, B: Vec, filters?: Geometry2dFilters): number;
4094
- hitTestLineSegment(A: Vec, B: Vec, distance?: number, filters?: Geometry2dFilters): boolean;
4069
+ abstract nearestPoint(point: VecLike, _filters?: Geometry2dFilters): Vec;
4070
+ hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, _filters?: Geometry2dFilters): boolean;
4071
+ distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
4072
+ distanceToLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): number;
4073
+ hitTestLineSegment(A: VecLike, B: VecLike, distance?: number, filters?: Geometry2dFilters): boolean;
4095
4074
  intersectLineSegment(A: VecLike, B: VecLike, _filters?: Geometry2dFilters): VecLike[];
4096
4075
  intersectCircle(center: VecLike, radius: number, _filters?: Geometry2dFilters): VecLike[];
4097
4076
  intersectPolygon(polygon: VecLike[], _filters?: Geometry2dFilters): VecLike[];
4098
4077
  intersectPolyline(polyline: VecLike[], _filters?: Geometry2dFilters): VecLike[];
4078
+ /**
4079
+ * Find a point along the edge of the geometry that is a fraction `t` along the entire way round.
4080
+ */
4081
+ interpolateAlongEdge(t: number, _filters?: Geometry2dFilters): Vec;
4082
+ /**
4083
+ * Take `point`, find the closest point to it on the edge of the geometry, and return how far
4084
+ * along the edge it is as a fraction of the total length.
4085
+ */
4086
+ uninterpolateAlongEdge(point: VecLike, _filters?: Geometry2dFilters): number;
4099
4087
  /** @deprecated Iterate the vertices instead. */
4100
- nearestPointOnLineSegment(A: Vec, B: Vec): Vec;
4101
- isPointInBounds(point: Vec, margin?: number): boolean;
4088
+ nearestPointOnLineSegment(A: VecLike, B: VecLike): Vec;
4089
+ isPointInBounds(point: VecLike, margin?: number): boolean;
4102
4090
  transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
4103
4091
  private _vertices;
4104
4092
  get vertices(): Vec[];
@@ -4112,7 +4100,7 @@ export declare abstract class Geometry2d {
4112
4100
  toSimpleSvgPath(): string;
4113
4101
  private _length?;
4114
4102
  get length(): number;
4115
- getLength(): number;
4103
+ getLength(_filters?: Geometry2dFilters): number;
4116
4104
  abstract getSvgPathData(first: boolean): string;
4117
4105
  }
4118
4106
 
@@ -4180,15 +4168,15 @@ export declare function getFreshUserPreferences(): TLUserPreferences;
4180
4168
  export declare function getIncrementedName(name: string, others: string[]): string;
4181
4169
 
4182
4170
  /** @public */
4183
- export declare function getPerfectDashProps(totalLength: number, strokeWidth: number, opts?: Partial<{
4184
- closed: boolean;
4185
- end: 'none' | 'outset' | 'skip';
4186
- forceSolid: boolean;
4187
- lengthRatio: number;
4188
- snap: number;
4189
- start: 'none' | 'outset' | 'skip';
4190
- style: TLDefaultDashStyle;
4191
- }>): {
4171
+ export declare function getPerfectDashProps(totalLength: number, strokeWidth: number, opts?: {
4172
+ closed?: boolean;
4173
+ end?: 'none' | 'outset' | 'skip';
4174
+ forceSolid?: boolean;
4175
+ lengthRatio?: number;
4176
+ snap?: number;
4177
+ start?: 'none' | 'outset' | 'skip';
4178
+ style?: TLDefaultDashStyle;
4179
+ }): {
4192
4180
  strokeDasharray: string;
4193
4181
  strokeDashoffset: string;
4194
4182
  };
@@ -4275,18 +4263,20 @@ export declare class Group2d extends Geometry2d {
4275
4263
  children: Geometry2d[];
4276
4264
  });
4277
4265
  getVertices(filters: Geometry2dFilters): Vec[];
4278
- nearestPoint(point: Vec, filters?: Geometry2dFilters): Vec;
4279
- distanceToPoint(point: Vec, hitInside?: boolean, filters?: Geometry2dFilters): number;
4280
- hitTestPoint(point: Vec, margin: number, hitInside: boolean, filters?: Geometry2dFilters): boolean;
4281
- hitTestLineSegment(A: Vec, B: Vec, zoom: number, filters?: Geometry2dFilters): boolean;
4266
+ nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;
4267
+ distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
4268
+ hitTestPoint(point: VecLike, margin: number, hitInside: boolean, filters?: Geometry2dFilters): boolean;
4269
+ hitTestLineSegment(A: VecLike, B: VecLike, zoom: number, filters?: Geometry2dFilters): boolean;
4282
4270
  intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
4283
4271
  intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
4284
4272
  intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
4285
4273
  intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
4274
+ interpolateAlongEdge(t: number, filters?: Geometry2dFilters): Vec;
4275
+ uninterpolateAlongEdge(point: VecLike, filters?: Geometry2dFilters): number;
4286
4276
  transform(transform: Mat): Geometry2d;
4287
4277
  getArea(): number;
4288
4278
  toSimpleSvgPath(): string;
4289
- getLength(): number;
4279
+ getLength(filters?: Geometry2dFilters): number;
4290
4280
  getSvgPathData(): string;
4291
4281
  }
4292
4282
 
@@ -4591,8 +4581,8 @@ export declare class Mat {
4591
4581
  static Identity(): Mat;
4592
4582
  static Translate(x: number, y: number): Mat;
4593
4583
  static Rotate(r: number, cx?: number, cy?: number): Mat;
4594
- static Scale(x: number, y: number): MatModel;
4595
- static Scale(x: number, y: number, cx: number, cy: number): MatModel;
4584
+ static Scale(x: number, y: number): Mat;
4585
+ static Scale(x: number, y: number, cx: number, cy: number): Mat;
4596
4586
  static Multiply(m1: MatModel, m2: MatModel): MatModel;
4597
4587
  static Inverse(m: MatModel): MatModel;
4598
4588
  static Absolute(m: MatLike): MatModel;
@@ -4687,7 +4677,7 @@ export declare class Point2d extends Geometry2d {
4687
4677
  });
4688
4678
  getVertices(): Vec[];
4689
4679
  nearestPoint(): Vec;
4690
- hitTestLineSegment(A: Vec, B: Vec, margin: number): boolean;
4680
+ hitTestLineSegment(A: VecLike, B: VecLike, margin: number): boolean;
4691
4681
  getSvgPathData(): string;
4692
4682
  }
4693
4683
 
@@ -4732,8 +4722,8 @@ export declare class Polyline2d extends Geometry2d {
4732
4722
  get segments(): Edge2d[];
4733
4723
  getLength(): number;
4734
4724
  getVertices(): Vec[];
4735
- nearestPoint(A: Vec): Vec;
4736
- hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean;
4725
+ nearestPoint(A: VecLike): Vec;
4726
+ hitTestLineSegment(A: VecLike, B: VecLike, distance?: number): boolean;
4737
4727
  getSvgPathData(): string;
4738
4728
  }
4739
4729
 
@@ -4774,8 +4764,6 @@ export declare function radiansToDegrees(r: number): number;
4774
4764
  */
4775
4765
  export declare function rangeIntersection(a0: number, a1: number, b0: number, b1: number): [number, number] | null;
4776
4766
 
4777
- export { react }
4778
-
4779
4767
  /**
4780
4768
  * A map of {@link @tldraw/tlschema#StyleProp | StyleProps} to their {@link SharedStyle} values. See
4781
4769
  * {@link Editor.getSharedStyles}.
@@ -5489,8 +5477,6 @@ export declare function shortAngleDist(a0: number, a1: number): number;
5489
5477
  /** @public */
5490
5478
  export declare const SIDES: readonly ["top", "right", "bottom", "left"];
5491
5479
 
5492
- export { Signal }
5493
-
5494
5480
  /** @public */
5495
5481
  export declare const SIN: (x: number) => number;
5496
5482
 
@@ -5542,8 +5528,8 @@ export declare class Stadium2d extends Geometry2d {
5542
5528
  height: number;
5543
5529
  width: number;
5544
5530
  });
5545
- nearestPoint(A: Vec): Vec;
5546
- hitTestLineSegment(A: Vec, B: Vec): boolean;
5531
+ nearestPoint(A: VecLike): Vec;
5532
+ hitTestLineSegment(A: VecLike, B: VecLike): boolean;
5547
5533
  getVertices(): Vec[];
5548
5534
  getBounds(): Box;
5549
5535
  getLength(): number;
@@ -7424,12 +7410,6 @@ export declare function toFixed(v: number): number;
7424
7410
  */
7425
7411
  export declare function toPrecision(n: number, precision?: number): number;
7426
7412
 
7427
- export { track }
7428
-
7429
- export { transact }
7430
-
7431
- export { transaction }
7432
-
7433
7413
  /** @public */
7434
7414
  export declare class TransformedGeometry2d extends Geometry2d {
7435
7415
  private readonly geometry;
@@ -7438,13 +7418,13 @@ export declare class TransformedGeometry2d extends Geometry2d {
7438
7418
  private readonly decomposed;
7439
7419
  constructor(geometry: Geometry2d, matrix: MatModel, opts?: TransformedGeometry2dOptions);
7440
7420
  getVertices(filters: Geometry2dFilters): Vec[];
7441
- nearestPoint(point: Vec, filters?: Geometry2dFilters): Vec;
7442
- hitTestPoint(point: Vec, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean;
7443
- distanceToPoint(point: Vec, hitInside?: boolean, filters?: Geometry2dFilters): number;
7444
- distanceToLineSegment(A: Vec, B: Vec, filters?: Geometry2dFilters): number;
7445
- hitTestLineSegment(A: Vec, B: Vec, distance?: number, filters?: Geometry2dFilters): boolean;
7446
- intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
7447
- intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
7421
+ nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;
7422
+ hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean;
7423
+ distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
7424
+ distanceToLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): number;
7425
+ hitTestLineSegment(A: VecLike, B: VecLike, distance?: number, filters?: Geometry2dFilters): boolean;
7426
+ intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): Vec[];
7427
+ intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): Vec[];
7448
7428
  intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
7449
7429
  intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
7450
7430
  transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
@@ -7471,10 +7451,6 @@ export declare function uniq<T>(array: {
7471
7451
  readonly length: number;
7472
7452
  } | null | undefined): T[];
7473
7453
 
7474
- export { useAtom }
7475
-
7476
- export { useComputed }
7477
-
7478
7454
  /** @public */
7479
7455
  export declare function useContainer(): HTMLElement;
7480
7456
 
@@ -7544,12 +7520,9 @@ export declare function usePeerIds(): string[];
7544
7520
  */
7545
7521
  export declare function usePresence(userId: string): null | TLInstancePresence;
7546
7522
 
7547
- export { useQuickReactor }
7548
-
7549
7523
  /* Excluded from this release type: USER_COLORS */
7550
7524
 
7551
7525
  /* Excluded from this release type: useReactiveEvent */
7552
- export { useReactor }
7553
7526
 
7554
7527
  /* Excluded from this release type: useRefState */
7555
7528
 
@@ -7612,8 +7585,6 @@ export declare function useSelectionEvents(handle: TLSelectionHandle): {
7612
7585
  */
7613
7586
  export declare function useSharedSafeId(id: string): SafeId;
7614
7587
 
7615
- export { useStateTracking }
7616
-
7617
7588
  /**
7618
7589
  * Returns the current SVG export context. Returns null if the component isn't being rendered for an
7619
7590
  * SVG export.
@@ -7647,8 +7618,6 @@ export declare function useTransform(ref: React.RefObject<HTMLElement | SVGEleme
7647
7618
  */
7648
7619
  export declare function useUniqueSafeId(suffix?: string): SafeId;
7649
7620
 
7650
- export { useValue }
7651
-
7652
7621
  /** @public */
7653
7622
  export declare function useViewportHeight(): number;
7654
7623
 
@@ -7720,6 +7689,7 @@ export declare class Vec {
7720
7689
  static Per(A: VecLike): Vec;
7721
7690
  static Abs(A: VecLike): Vec;
7722
7691
  static Dist(A: VecLike, B: VecLike): number;
7692
+ static ManhattanDist(A: VecLike, B: VecLike): number;
7723
7693
  static DistMin(A: VecLike, B: VecLike, n: number): boolean;
7724
7694
  static Dist2(A: VecLike, B: VecLike): number;
7725
7695
  /**
@@ -7767,7 +7737,15 @@ export declare class Vec {
7767
7737
  static Cast(A: VecLike): Vec;
7768
7738
  static Slope(A: VecLike, B: VecLike): number;
7769
7739
  static IsNaN(A: VecLike): boolean;
7740
+ /**
7741
+ * Get the angle from position A to position B.
7742
+ */
7770
7743
  static Angle(A: VecLike, B: VecLike): number;
7744
+ /**
7745
+ * Get the angle between vector A and vector B. This will return the smallest angle between the
7746
+ * two vectors, between -π and π. The sign indicates direction of angle.
7747
+ */
7748
+ static AngleBetween(A: VecLike, B: VecLike): number;
7771
7749
  /**
7772
7750
  * Linearly interpolate between two points.
7773
7751
  * @param A - The first point.
@@ -7811,9 +7789,9 @@ export declare class Vec {
7811
7789
  /** @public */
7812
7790
  export declare type VecLike = Vec | VecModel;
7813
7791
 
7814
- export { whyAmIRunning }
7815
-
7816
7792
 
7793
+ export * from "@tldraw/state";
7794
+ export * from "@tldraw/state-react";
7817
7795
  export * from "@tldraw/store";
7818
7796
  export * from "@tldraw/tlschema";
7819
7797
  export * from "@tldraw/utils";
package/dist-cjs/index.js CHANGED
@@ -50,13 +50,11 @@ __export(index_exports, {
50
50
  DefaultSpinner: () => import_DefaultSpinner.DefaultSpinner,
51
51
  DefaultSvgDefs: () => import_DefaultSvgDefs.DefaultSvgDefs,
52
52
  EASINGS: () => import_easings.EASINGS,
53
- EMPTY_ARRAY: () => import_state.EMPTY_ARRAY,
54
53
  EVENT_NAME_MAP: () => import_event_types.EVENT_NAME_MAP,
55
54
  Edge2d: () => import_Edge2d.Edge2d,
56
55
  EdgeScrollManager: () => import_EdgeScrollManager.EdgeScrollManager,
57
56
  Editor: () => import_Editor.Editor,
58
57
  EditorContext: () => import_useEditor.EditorContext,
59
- EffectScheduler: () => import_state.EffectScheduler,
60
58
  Ellipse2d: () => import_Ellipse2d.Ellipse2d,
61
59
  ErrorBoundary: () => import_ErrorBoundary.ErrorBoundary,
62
60
  ErrorScreen: () => import_TldrawEditor.ErrorScreen,
@@ -105,7 +103,6 @@ __export(index_exports, {
105
103
  applyRotationToSnapshotShapes: () => import_rotation.applyRotationToSnapshotShapes,
106
104
  approximately: () => import_utils2.approximately,
107
105
  areAnglesCompatible: () => import_utils2.areAnglesCompatible,
108
- atom: () => import_state.atom,
109
106
  average: () => import_utils2.average,
110
107
  canonicalizeRotation: () => import_utils2.canonicalizeRotation,
111
108
  centerOfCircleFromThreePoints: () => import_utils2.centerOfCircleFromThreePoints,
@@ -113,7 +110,6 @@ __export(index_exports, {
113
110
  clampRadians: () => import_utils2.clampRadians,
114
111
  clampToBrowserMaxCanvasSize: () => import_browserCanvasMaxSize.clampToBrowserMaxCanvasSize,
115
112
  clockwiseAngleDist: () => import_utils2.clockwiseAngleDist,
116
- computed: () => import_state.computed,
117
113
  coreShapes: () => import_defaultShapes.coreShapes,
118
114
  counterClockwiseAngleDist: () => import_utils2.counterClockwiseAngleDist,
119
115
  createDeepLinkString: () => import_deepLinks.createDeepLinkString,
@@ -176,7 +172,6 @@ __export(index_exports, {
176
172
  preventDefault: () => import_dom.preventDefault,
177
173
  radiansToDegrees: () => import_utils2.radiansToDegrees,
178
174
  rangeIntersection: () => import_utils2.rangeIntersection,
179
- react: () => import_state.react,
180
175
  refreshPage: () => import_refreshPage.refreshPage,
181
176
  releasePointerCapture: () => import_dom.releasePointerCapture,
182
177
  resizeBox: () => import_resizeBox.resizeBox,
@@ -197,12 +192,7 @@ __export(index_exports, {
197
192
  toDomPrecision: () => import_utils2.toDomPrecision,
198
193
  toFixed: () => import_utils2.toFixed,
199
194
  toPrecision: () => import_utils2.toPrecision,
200
- track: () => import_state_react.track,
201
- transact: () => import_state.transact,
202
- transaction: () => import_state.transaction,
203
195
  uniq: () => import_uniq.uniq,
204
- useAtom: () => import_state_react.useAtom,
205
- useComputed: () => import_state_react.useComputed,
206
196
  useContainer: () => import_useContainer.useContainer,
207
197
  useContainerIfExists: () => import_useContainer.useContainerIfExists,
208
198
  useDelaySvgExport: () => import_SvgExportContext.useDelaySvgExport,
@@ -220,25 +210,20 @@ __export(index_exports, {
220
210
  usePassThroughWheelEvents: () => import_usePassThroughWheelEvents.usePassThroughWheelEvents,
221
211
  usePeerIds: () => import_usePeerIds.usePeerIds,
222
212
  usePresence: () => import_usePresence.usePresence,
223
- useQuickReactor: () => import_state_react.useQuickReactor,
224
213
  useReactiveEvent: () => import_useEvent.useReactiveEvent,
225
- useReactor: () => import_state_react.useReactor,
226
214
  useRefState: () => import_useRefState.useRefState,
227
215
  useSelectionEvents: () => import_useSelectionEvents.useSelectionEvents,
228
216
  useShallowArrayIdentity: () => import_useIdentity.useShallowArrayIdentity,
229
217
  useShallowObjectIdentity: () => import_useIdentity.useShallowObjectIdentity,
230
218
  useSharedSafeId: () => import_useSafeId.useSharedSafeId,
231
- useStateTracking: () => import_state_react.useStateTracking,
232
219
  useSvgExportContext: () => import_SvgExportContext.useSvgExportContext,
233
220
  useTLSchemaFromUtils: () => import_useTLStore.useTLSchemaFromUtils,
234
221
  useTLStore: () => import_useTLStore.useTLStore,
235
222
  useTldrawUser: () => import_createTLUser.useTldrawUser,
236
223
  useTransform: () => import_useTransform.useTransform,
237
224
  useUniqueSafeId: () => import_useSafeId.useUniqueSafeId,
238
- useValue: () => import_state_react.useValue,
239
225
  useViewportHeight: () => import_useViewportHeight.useViewportHeight,
240
- userTypeValidator: () => import_TLUserPreferences.userTypeValidator,
241
- whyAmIRunning: () => import_state.whyAmIRunning
226
+ userTypeValidator: () => import_TLUserPreferences.userTypeValidator
242
227
  });
243
228
  module.exports = __toCommonJS(index_exports);
244
229
  var import_utils = require("@tldraw/utils");
@@ -247,11 +232,8 @@ var import_flat_map = require("core-js/stable/array/flat-map.js");
247
232
  var import_flat = require("core-js/stable/array/flat.js");
248
233
  var import_at2 = require("core-js/stable/string/at.js");
249
234
  var import_replace_all = require("core-js/stable/string/replace-all.js");
250
- var import_state = require("@tldraw/state");
251
- var import_state_react = require("@tldraw/state-react");
252
- var import_resizeScaled = require("./lib/editor/shapes/shared/resizeScaled");
253
- var import_richText = require("./lib/utils/richText");
254
- var import_LocalIndexedDb = require("./lib/utils/sync/LocalIndexedDb");
235
+ __reExport(index_exports, require("@tldraw/state"), module.exports);
236
+ __reExport(index_exports, require("@tldraw/state-react"), module.exports);
255
237
  __reExport(index_exports, require("@tldraw/store"), module.exports);
256
238
  __reExport(index_exports, require("@tldraw/tlschema"), module.exports);
257
239
  __reExport(index_exports, require("@tldraw/utils"), module.exports);
@@ -302,6 +284,7 @@ var import_ShapeUtil = require("./lib/editor/shapes/ShapeUtil");
302
284
  var import_GroupShapeUtil = require("./lib/editor/shapes/group/GroupShapeUtil");
303
285
  var import_getPerfectDashProps = require("./lib/editor/shapes/shared/getPerfectDashProps");
304
286
  var import_resizeBox = require("./lib/editor/shapes/shared/resizeBox");
287
+ var import_resizeScaled = require("./lib/editor/shapes/shared/resizeScaled");
305
288
  var import_BaseBoxShapeTool = require("./lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool");
306
289
  var import_Pointing = require("./lib/editor/tools/BaseBoxShapeTool/children/Pointing");
307
290
  var import_StateNode = require("./lib/editor/tools/StateNode");
@@ -366,8 +349,10 @@ var import_hardResetEditor = require("./lib/utils/hardResetEditor");
366
349
  var import_keyboard = require("./lib/utils/keyboard");
367
350
  var import_normalizeWheel = require("./lib/utils/normalizeWheel");
368
351
  var import_refreshPage = require("./lib/utils/refreshPage");
352
+ var import_richText = require("./lib/utils/richText");
369
353
  var import_rotation = require("./lib/utils/rotation");
370
354
  var import_runtime = require("./lib/utils/runtime");
355
+ var import_LocalIndexedDb = require("./lib/utils/sync/LocalIndexedDb");
371
356
  var import_hardReset = require("./lib/utils/sync/hardReset");
372
357
  var import_uniq = require("./lib/utils/uniq");
373
358
  var import_window_open = require("./lib/utils/window-open");
@@ -376,7 +361,7 @@ function debugEnableLicensing() {
376
361
  }
377
362
  (0, import_utils.registerTldrawLibraryVersion)(
378
363
  "@tldraw/editor",
379
- "3.13.0-canary.8e04030e54fe",
364
+ "3.13.0-canary.8f8ae1660cdb",
380
365
  "cjs"
381
366
  );
382
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'\nexport {\n\tEMPTY_ARRAY,\n\tEffectScheduler,\n\tatom,\n\tcomputed,\n\treact,\n\ttransact,\n\ttransaction,\n\twhyAmIRunning,\n\ttype Atom,\n\ttype Signal,\n} from '@tldraw/state'\nexport {\n\ttrack,\n\tuseAtom,\n\tuseComputed,\n\tuseQuickReactor,\n\tuseReactor,\n\tuseStateTracking,\n\tuseValue,\n} from '@tldraw/state-react'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TLTextOptions,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n} from './lib/utils/richText'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\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'\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 { 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\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\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_L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B;AACvB,0BAKO;AACP,uBAA0B;AAC1B,uBAAyD;AACzD,iCAAoC;AAEpC,sBAA2C;AAC3C,iCAAoC;AACpC,yBAAkE;AAClE,2BAA8B;AAC9B,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2CAA8C;AAC9C,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,gCAAmC;AACnC,wBAAiD;AACjD,0BAA6B;AAC7B,+BAAkC;AAClC,4BAQO;AACP,qBAAyD;AACzD,iBASO;AACP,iBAAiD;AACjD,iBAAkC;AAClC,qBAAwB;AACxB,mBAAsB;AACtB,sBAAyB;AACzB,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAAuB;AACvB,uBAA0B;AAC1B,wBAMO;AACP,qBAAwB;AACxB,qBAAwB;AACxB,uBAA0B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,uBAA0B;AAC1B,uBAaO;AACP,IAAAC,gBAgCO;AACP,6BAIO;AACP,oBAAoD;AACpD,kCAAgE;AAChE,yBAMO;AACP,uBAKO;AACP,iBAOO;AACP,gCAAmC;AACnC,4BAA+B;AAC/B,kCAAqC;AACrC,6BAAgC;AAChC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAA4B;AAC5B,sBAIO;AACP,qBAA6C;AAE7C,uBAA0B;AAC1B,kBAAqB;AACrB,yBAA2B;AAKpB,SAAS,uBAAuB;AAEtC;AACD;AAAA,IAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\n\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\n\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tTAB_ID,\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tUSER_COLORS,\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager'\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": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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