@tldraw/editor 4.5.0-canary.ea6778d1533e → 4.5.0-canary.efe342c4f38c

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 (134) hide show
  1. package/dist-cjs/index.d.ts +95 -45
  2. package/dist-cjs/index.js +2 -1
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/components/default-components/DefaultCanvas.js +13 -16
  5. package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
  6. package/dist-cjs/lib/editor/Editor.js +241 -269
  7. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  8. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js +15 -16
  9. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +3 -3
  10. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +1 -1
  11. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +2 -3
  12. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +2 -2
  13. package/dist-cjs/lib/editor/types/misc-types.js.map +1 -1
  14. package/dist-cjs/lib/exports/exportToSvg.js +1 -1
  15. package/dist-cjs/lib/exports/exportToSvg.js.map +2 -2
  16. package/dist-cjs/lib/exports/getSvgAsImage.js +180 -29
  17. package/dist-cjs/lib/exports/getSvgAsImage.js.map +3 -3
  18. package/dist-cjs/lib/exports/getSvgJsx.js +18 -7
  19. package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
  20. package/dist-cjs/lib/hooks/useCanvasEvents.js +3 -3
  21. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  22. package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js +1 -2
  23. package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js.map +2 -2
  24. package/dist-cjs/lib/primitives/Vec.js +35 -22
  25. package/dist-cjs/lib/primitives/Vec.js.map +2 -2
  26. package/dist-cjs/lib/primitives/geometry/Arc2d.js +6 -13
  27. package/dist-cjs/lib/primitives/geometry/Arc2d.js.map +2 -2
  28. package/dist-cjs/lib/primitives/geometry/Circle2d.js +31 -2
  29. package/dist-cjs/lib/primitives/geometry/Circle2d.js.map +2 -2
  30. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js +9 -0
  31. package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js.map +2 -2
  32. package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js +9 -0
  33. package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js.map +2 -2
  34. package/dist-cjs/lib/primitives/geometry/Edge2d.js +32 -18
  35. package/dist-cjs/lib/primitives/geometry/Edge2d.js.map +2 -2
  36. package/dist-cjs/lib/primitives/geometry/Ellipse2d.js +12 -0
  37. package/dist-cjs/lib/primitives/geometry/Ellipse2d.js.map +2 -2
  38. package/dist-cjs/lib/primitives/geometry/Geometry2d.js +10 -0
  39. package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
  40. package/dist-cjs/lib/primitives/geometry/Polyline2d.js +51 -12
  41. package/dist-cjs/lib/primitives/geometry/Polyline2d.js.map +2 -2
  42. package/dist-cjs/lib/primitives/geometry/Stadium2d.js +12 -0
  43. package/dist-cjs/lib/primitives/geometry/Stadium2d.js.map +2 -2
  44. package/dist-cjs/lib/primitives/geometry/geometry.bench.js +133 -0
  45. package/dist-cjs/lib/primitives/geometry/geometry.bench.js.map +7 -0
  46. package/dist-cjs/lib/primitives/intersect.js +16 -15
  47. package/dist-cjs/lib/primitives/intersect.js.map +2 -2
  48. package/dist-cjs/lib/primitives/utils.js +0 -1
  49. package/dist-cjs/lib/primitives/utils.js.map +2 -2
  50. package/dist-cjs/lib/utils/dom.js +8 -4
  51. package/dist-cjs/lib/utils/dom.js.map +2 -2
  52. package/dist-cjs/version.js +3 -3
  53. package/dist-cjs/version.js.map +1 -1
  54. package/dist-esm/index.d.mts +95 -45
  55. package/dist-esm/index.mjs +3 -1
  56. package/dist-esm/index.mjs.map +2 -2
  57. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +13 -16
  58. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
  59. package/dist-esm/lib/editor/Editor.mjs +243 -271
  60. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  61. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs +15 -16
  62. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +3 -3
  63. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +1 -1
  64. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +2 -3
  65. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +2 -2
  66. package/dist-esm/lib/exports/exportToSvg.mjs +1 -1
  67. package/dist-esm/lib/exports/exportToSvg.mjs.map +2 -2
  68. package/dist-esm/lib/exports/getSvgAsImage.mjs +180 -29
  69. package/dist-esm/lib/exports/getSvgAsImage.mjs.map +3 -3
  70. package/dist-esm/lib/exports/getSvgJsx.mjs +18 -7
  71. package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
  72. package/dist-esm/lib/hooks/useCanvasEvents.mjs +9 -4
  73. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  74. package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs +2 -3
  75. package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs.map +2 -2
  76. package/dist-esm/lib/primitives/Vec.mjs +35 -22
  77. package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
  78. package/dist-esm/lib/primitives/geometry/Arc2d.mjs +6 -13
  79. package/dist-esm/lib/primitives/geometry/Arc2d.mjs.map +2 -2
  80. package/dist-esm/lib/primitives/geometry/Circle2d.mjs +31 -2
  81. package/dist-esm/lib/primitives/geometry/Circle2d.mjs.map +2 -2
  82. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs +9 -0
  83. package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs.map +2 -2
  84. package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs +9 -0
  85. package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs.map +2 -2
  86. package/dist-esm/lib/primitives/geometry/Edge2d.mjs +32 -18
  87. package/dist-esm/lib/primitives/geometry/Edge2d.mjs.map +2 -2
  88. package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs +13 -1
  89. package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs.map +2 -2
  90. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +10 -0
  91. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  92. package/dist-esm/lib/primitives/geometry/Polyline2d.mjs +51 -12
  93. package/dist-esm/lib/primitives/geometry/Polyline2d.mjs.map +2 -2
  94. package/dist-esm/lib/primitives/geometry/Stadium2d.mjs +13 -1
  95. package/dist-esm/lib/primitives/geometry/Stadium2d.mjs.map +2 -2
  96. package/dist-esm/lib/primitives/geometry/geometry.bench.mjs +132 -0
  97. package/dist-esm/lib/primitives/geometry/geometry.bench.mjs.map +7 -0
  98. package/dist-esm/lib/primitives/intersect.mjs +17 -16
  99. package/dist-esm/lib/primitives/intersect.mjs.map +2 -2
  100. package/dist-esm/lib/primitives/utils.mjs +0 -1
  101. package/dist-esm/lib/primitives/utils.mjs.map +2 -2
  102. package/dist-esm/lib/utils/dom.mjs +8 -4
  103. package/dist-esm/lib/utils/dom.mjs.map +2 -2
  104. package/dist-esm/version.mjs +3 -3
  105. package/dist-esm/version.mjs.map +1 -1
  106. package/package.json +7 -7
  107. package/src/index.ts +1 -0
  108. package/src/lib/components/default-components/DefaultCanvas.tsx +19 -26
  109. package/src/lib/editor/Editor.ts +320 -405
  110. package/src/lib/editor/managers/HistoryManager/HistoryManager.ts +6 -5
  111. package/src/lib/editor/shapes/ShapeUtil.ts +1 -1
  112. package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +3 -3
  113. package/src/lib/editor/types/misc-types.ts +8 -2
  114. package/src/lib/exports/exportToSvg.tsx +1 -1
  115. package/src/lib/exports/getSvgAsImage.ts +290 -31
  116. package/src/lib/exports/getSvgJsx.test.ts +103 -101
  117. package/src/lib/exports/getSvgJsx.tsx +30 -8
  118. package/src/lib/hooks/useCanvasEvents.ts +9 -5
  119. package/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +2 -5
  120. package/src/lib/primitives/Vec.ts +42 -24
  121. package/src/lib/primitives/geometry/Arc2d.ts +7 -15
  122. package/src/lib/primitives/geometry/Circle2d.ts +33 -2
  123. package/src/lib/primitives/geometry/CubicBezier2d.ts +10 -0
  124. package/src/lib/primitives/geometry/CubicSpline2d.ts +10 -0
  125. package/src/lib/primitives/geometry/Edge2d.ts +36 -18
  126. package/src/lib/primitives/geometry/Ellipse2d.ts +14 -1
  127. package/src/lib/primitives/geometry/Geometry2d.ts +12 -0
  128. package/src/lib/primitives/geometry/Polyline2d.ts +57 -12
  129. package/src/lib/primitives/geometry/Stadium2d.ts +14 -1
  130. package/src/lib/primitives/geometry/geometry.bench.ts +179 -0
  131. package/src/lib/primitives/intersect.ts +20 -27
  132. package/src/lib/primitives/utils.ts +0 -3
  133. package/src/lib/utils/dom.ts +16 -8
  134. package/src/version.ts +3 -3
@@ -20,6 +20,7 @@ import { MigrationSequence } from '@tldraw/store';
20
20
  import { NamedExoticComponent } from 'react';
21
21
  import { Node as Node_2 } from '@tiptap/pm/model';
22
22
  import { PerformanceTracker } from '@tldraw/utils';
23
+ import { PointerEvent as PointerEvent_2 } from 'react';
23
24
  import { PointerEventHandler } from 'react';
24
25
  import * as React_2 from 'react';
25
26
  import { default as React_3 } from 'react';
@@ -63,7 +64,6 @@ import { TLImageAsset } from '@tldraw/tlschema';
63
64
  import { TLInstance } from '@tldraw/tlschema';
64
65
  import { TLInstancePageState } from '@tldraw/tlschema';
65
66
  import { TLInstancePresence } from '@tldraw/tlschema';
66
- import { TLOpacityType } from '@tldraw/tlschema';
67
67
  import { TLPage } from '@tldraw/tlschema';
68
68
  import { TLPageId } from '@tldraw/tlschema';
69
69
  import { TLParentId } from '@tldraw/tlschema';
@@ -439,13 +439,13 @@ export declare class BoundsSnaps {
439
439
  private getSnappablePoints;
440
440
  private getSnappableGapNodes;
441
441
  private getVisibleGaps;
442
- snapTranslateShapes({ lockedAxis, initialSelectionPageBounds, initialSelectionSnapPoints, dragDelta, }: {
442
+ snapTranslateShapes({ lockedAxis, initialSelectionPageBounds, initialSelectionSnapPoints, dragDelta }: {
443
443
  dragDelta: Vec;
444
444
  initialSelectionPageBounds: Box;
445
445
  initialSelectionSnapPoints: BoundsSnapPoint[];
446
446
  lockedAxis: 'x' | 'y' | null;
447
447
  }): SnapData;
448
- snapResizeShapes({ initialSelectionPageBounds, dragDelta, handle: originalHandle, isAspectRatioLocked, isResizingFromCenter, }: {
448
+ snapResizeShapes({ initialSelectionPageBounds, dragDelta, handle: originalHandle, isAspectRatioLocked, isResizingFromCenter }: {
449
449
  dragDelta: Vec;
450
450
  handle: SelectionCorner | SelectionEdge;
451
451
  initialSelectionPageBounds: Box;
@@ -577,6 +577,8 @@ export declare class Circle2d extends Geometry2d {
577
577
  getBounds(): Box;
578
578
  getVertices(): Vec[];
579
579
  nearestPoint(point: VecLike): Vec;
580
+ distanceToPoint(point: VecLike, hitInside?: boolean): number;
581
+ hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean): boolean;
580
582
  hitTestLineSegment(A: VecLike, B: VecLike, distance?: number): boolean;
581
583
  getSvgPathData(): string;
582
584
  }
@@ -679,7 +681,7 @@ export declare const coreShapes: readonly [typeof GroupShapeUtil];
679
681
  export declare function counterClockwiseAngleDist(a0: number, a1: number): number;
680
682
 
681
683
  /** @public */
682
- export declare function createDebugValue<T>(name: string, { defaults, shouldStoreForSession, }: {
684
+ export declare function createDebugValue<T>(name: string, { defaults, shouldStoreForSession }: {
683
685
  defaults: DebugFlagDefaults<T>;
684
686
  shouldStoreForSession?: boolean;
685
687
  }): DebugFlag<T>;
@@ -729,8 +731,8 @@ export declare function createTLStore({ initialData, defaultName, id, assets, on
729
731
 
730
732
  /** @public */
731
733
  export declare function createTLUser(opts?: {
732
- setUserPreferences?: (userPreferences: TLUserPreferences) => void;
733
- userPreferences?: Signal<TLUserPreferences>;
734
+ setUserPreferences?: ((userPreferences: TLUserPreferences) => void) | undefined;
735
+ userPreferences?: Signal<TLUserPreferences, unknown> | undefined;
734
736
  }): TLUser;
735
737
 
736
738
  /** @public */
@@ -749,6 +751,7 @@ export declare class CubicBezier2d extends Polyline2d {
749
751
  });
750
752
  getVertices(): Vec[];
751
753
  nearestPoint(A: VecLike): Vec;
754
+ distanceToPoint(point: VecLike, _hitInside?: boolean): number;
752
755
  getSvgPathData(first?: boolean): string;
753
756
  static GetAtT(segment: CubicBezier2d, t: number): Vec;
754
757
  getLength(_filters?: Geometry2dFilters, precision?: number): number;
@@ -765,6 +768,7 @@ export declare class CubicSpline2d extends Geometry2d {
765
768
  getLength(): number;
766
769
  getVertices(): Vec[];
767
770
  nearestPoint(A: VecLike): Vec;
771
+ distanceToPoint(point: VecLike, _hitInside?: boolean): number;
768
772
  hitTestLineSegment(A: VecLike, B: VecLike): boolean;
769
773
  getSvgPathData(): string;
770
774
  }
@@ -814,7 +818,7 @@ export declare const DefaultBrush: ({ brush, color, opacity, className }: TLBrus
814
818
  export declare function DefaultCanvas({ className }: TLCanvasComponentProps): JSX.Element;
815
819
 
816
820
  /** @public @react */
817
- export declare function DefaultCollaboratorHint({ className, zoom, point, color, viewport, opacity, }: TLCollaboratorHintProps): JSX.Element;
821
+ export declare function DefaultCollaboratorHint({ className, zoom, point, color, viewport, opacity }: TLCollaboratorHintProps): JSX.Element;
818
822
 
819
823
  /** @public @react */
820
824
  export declare const DefaultCursor: NamedExoticComponent<TLCursorProps>;
@@ -983,9 +987,9 @@ export declare const EASINGS: {
983
987
  export declare class Edge2d extends Geometry2d {
984
988
  private _start;
985
989
  private _end;
986
- private _d;
987
- private _u;
988
- private _ul;
990
+ private _dx;
991
+ private _dy;
992
+ private _len2;
989
993
  constructor(config: {
990
994
  end: Vec;
991
995
  start: Vec;
@@ -993,6 +997,7 @@ export declare class Edge2d extends Geometry2d {
993
997
  getLength(): number;
994
998
  getVertices(): Vec[];
995
999
  nearestPoint(point: VecLike): Vec;
1000
+ distanceToPoint(point: VecLike, _hitInside?: boolean): number;
996
1001
  getSvgPathData(first?: boolean): string;
997
1002
  }
998
1003
 
@@ -1022,7 +1027,7 @@ export declare class EdgeScrollManager {
1022
1027
  /** @public */
1023
1028
  export declare class Editor extends EventEmitter<TLEventMap> {
1024
1029
  readonly id: string;
1025
- constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, initialState, autoFocus, inferDarkMode, options: _options, textOptions: _textOptions, getShapeVisibility, fontAssetUrls, }: TLEditorOptions);
1030
+ constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, initialState, autoFocus, inferDarkMode, options: _options, textOptions: _textOptions, getShapeVisibility, fontAssetUrls }: TLEditorOptions);
1026
1031
  private readonly _getShapeVisibility?;
1027
1032
  private getIsShapeHiddenCache;
1028
1033
  isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
@@ -1095,8 +1100,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1095
1100
  readonly timers: {
1096
1101
  dispose: () => void;
1097
1102
  requestAnimationFrame: (callback: FrameRequestCallback) => number;
1098
- setInterval: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
1099
- setTimeout: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
1103
+ setInterval: (handler: TimerHandler, timeout?: number | undefined, ...args: any[]) => number;
1104
+ setTimeout: (handler: TimerHandler, timeout?: number | undefined, ...args: any[]) => number;
1100
1105
  };
1101
1106
  /**
1102
1107
  * A manager for the user and their preferences.
@@ -1487,14 +1492,14 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1487
1492
  * @public
1488
1493
  */
1489
1494
  getPageStates(): TLInstancePageState[];
1490
- /* Excluded from this release type: _getPageStatesQuery */
1495
+ private _getPageStatesQuery;
1491
1496
  /**
1492
1497
  * The current page state.
1493
1498
  *
1494
1499
  * @public
1495
1500
  */
1496
1501
  getCurrentPageState(): TLInstancePageState;
1497
- /* Excluded from this release type: _getCurrentPageStateId */
1502
+ private _getCurrentPageStateId;
1498
1503
  /**
1499
1504
  * Update this instance's page state.
1500
1505
  *
@@ -1887,7 +1892,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1887
1892
  *
1888
1893
  * @public */
1889
1894
  getTextOptions(): TLTextOptions;
1890
- /* Excluded from this release type: _unsafe_getCameraId */
1895
+ private _unsafe_getCameraId;
1891
1896
  /**
1892
1897
  * The current camera.
1893
1898
  *
@@ -1903,6 +1908,12 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1903
1908
  * @public
1904
1909
  */
1905
1910
  getZoomLevel(): number;
1911
+ /**
1912
+ * Get the scale factor used when creating or resizing shapes in dynamic size mode.
1913
+ *
1914
+ * @public
1915
+ */
1916
+ getResizeScaleFactor(): number;
1906
1917
  private _debouncedZoomLevel;
1907
1918
  /**
1908
1919
  * Get the debounced zoom level. When the camera is moving, this returns the zoom level
@@ -2137,10 +2148,10 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2137
2148
  */
2138
2149
  slideCamera(opts?: {
2139
2150
  direction: VecLike;
2140
- force?: boolean;
2141
- friction?: number;
2151
+ force?: boolean | undefined;
2152
+ friction?: number | undefined;
2142
2153
  speed: number;
2143
- speedThreshold?: number;
2154
+ speedThreshold?: number | undefined;
2144
2155
  }): this;
2145
2156
  /**
2146
2157
  * Animate the camera to a user's cursor position. This also briefly show the user's cursor if it's not currently visible.
@@ -2448,7 +2459,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2448
2459
  * @public
2449
2460
  */
2450
2461
  renamePage(page: TLPage | TLPageId, name: string): this;
2451
- /* Excluded from this release type: _getAllAssetsQuery */
2462
+ private _getAllAssetsQuery;
2452
2463
  /**
2453
2464
  * Get all assets in the editor.
2454
2465
  *
@@ -2537,7 +2548,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2537
2548
  * @public
2538
2549
  */
2539
2550
  getShapeGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
2540
- /* Excluded from this release type: _getShapeHandlesCache */
2551
+ private _getShapeHandlesCache;
2541
2552
  /**
2542
2553
  * Get the handles (if any) for a shape.
2543
2554
  *
@@ -2567,7 +2578,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2567
2578
  * @public
2568
2579
  */
2569
2580
  getShapeLocalTransform(shape: TLShape | TLShapeId): Mat;
2570
- /* Excluded from this release type: _getShapePageTransformCache */
2581
+ private _getShapePageTransformCache;
2571
2582
  /**
2572
2583
  * Get the local transform of a shape's parent as a matrix model.
2573
2584
  *
@@ -2595,7 +2606,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2595
2606
  * @public
2596
2607
  */
2597
2608
  getShapePageTransform(shape: TLShape | TLShapeId): Mat;
2598
- /* Excluded from this release type: _getShapePageBoundsCache */
2609
+ private _getShapePageBoundsCache;
2599
2610
  /**
2600
2611
  * Get the bounds of a shape in the current page space.
2601
2612
  *
@@ -2610,7 +2621,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2610
2621
  * @public
2611
2622
  */
2612
2623
  getShapePageBounds(shape: TLShape | TLShapeId): Box | undefined;
2613
- /* Excluded from this release type: _getShapeClipPathCache */
2624
+ private _getShapeClipPathCache;
2614
2625
  /**
2615
2626
  * Get the clip path for a shape.
2616
2627
  *
@@ -2627,7 +2638,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2627
2638
  * @public
2628
2639
  */
2629
2640
  getShapeClipPath(shape: TLShape | TLShapeId): string | undefined;
2630
- /* Excluded from this release type: _getShapeMaskCache */
2641
+ private _getShapeMaskCache;
2631
2642
  /**
2632
2643
  * Get the mask (in the current page space) for a shape.
2633
2644
  *
@@ -2659,7 +2670,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2659
2670
  * @public
2660
2671
  */
2661
2672
  getShapeMaskedPageBounds(shape: TLShape | TLShapeId): Box | undefined;
2662
- /* Excluded from this release type: _getShapeMaskedPageBoundsCache */
2673
+ private _getShapeMaskedPageBoundsCache;
2663
2674
  /**
2664
2675
  * Get the ancestors of a shape.
2665
2676
  *
@@ -2769,8 +2780,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2769
2780
  * @public
2770
2781
  */
2771
2782
  getShapesAtPoint(point: VecLike, opts?: {
2772
- hitInside?: boolean;
2773
- margin?: number;
2783
+ hitInside?: boolean | undefined;
2784
+ margin?: number | undefined;
2774
2785
  }): TLShape[];
2775
2786
  /**
2776
2787
  * Get shape IDs within the given bounds.
@@ -2806,8 +2817,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2806
2817
  * @public
2807
2818
  */
2808
2819
  isPointInShape(shape: TLShape | TLShapeId, point: VecLike, opts?: {
2809
- hitInside?: boolean;
2810
- margin?: number;
2820
+ hitInside?: boolean | undefined;
2821
+ margin?: number | undefined;
2811
2822
  }): boolean;
2812
2823
  /**
2813
2824
  * Convert a point in the current page space to a point in the local space of a shape. For example, if a
@@ -3081,7 +3092,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3081
3092
  * Delete a binding by its ID. If the binding doesn't exist, it's ignored.
3082
3093
  */
3083
3094
  deleteBinding(binding: TLBinding | TLBindingId, opts?: Parameters<this['deleteBindings']>[1]): this;
3084
- canBindShapes({ fromShape, toShape, binding, }: {
3095
+ canBindShapes({ fromShape, toShape, binding }: {
3085
3096
  binding: {
3086
3097
  type: TLBinding['type'];
3087
3098
  } | TLBinding | TLBinding['type'];
@@ -3236,6 +3247,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3236
3247
  * @public
3237
3248
  */
3238
3249
  bringToFront(shapes: TLShape[] | TLShapeId[]): this;
3250
+ /* Excluded from this release type: getShapeClusters */
3239
3251
  /* Excluded from this release type: collectShapesViaArrowBindings */
3240
3252
  /**
3241
3253
  * Flip shape positions.
@@ -3327,6 +3339,22 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3327
3339
  * @public
3328
3340
  */
3329
3341
  stretchShapes(shapes: TLShape[] | TLShapeId[], operation: 'horizontal' | 'vertical'): this;
3342
+ /**
3343
+ * Resize and reposition a set of shapes so that their combined page bounds matches the given
3344
+ * target bounds.
3345
+ *
3346
+ * @example
3347
+ * ```ts
3348
+ * editor.resizeToBounds([box1, box2], { x: 0, y: 0, w: 500, h: 500 })
3349
+ * editor.resizeToBounds(editor.getSelectedShapeIds(), new Box(0, 0, 500, 500))
3350
+ * ```
3351
+ *
3352
+ * @param shapes - The shapes (or shape ids) to resize.
3353
+ * @param bounds - The target bounding box.
3354
+ *
3355
+ * @public
3356
+ */
3357
+ resizeToBounds(shapes: TLShape[] | TLShapeId[], bounds: BoxLike): this;
3330
3358
  /**
3331
3359
  * Resize a shape.
3332
3360
  *
@@ -3530,7 +3558,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3530
3558
  deleteShape(id: TLShapeId): this;
3531
3559
  deleteShape(shape: TLShape): this;
3532
3560
  /* Excluded from this release type: _extractSharedStyles */
3533
- /* Excluded from this release type: _getSelectionSharedStyles */
3561
+ private _getSelectionSharedStyles;
3534
3562
  /**
3535
3563
  * Get the style for the next shape.
3536
3564
  *
@@ -3719,7 +3747,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3719
3747
  * @param opts - Options for handling external content, including force flag to bypass readonly checks.
3720
3748
  */
3721
3749
  putExternalContent<E>(info: TLExternalContent<E>, opts?: {
3722
- force?: boolean;
3750
+ force?: boolean | undefined;
3723
3751
  }): Promise<void>;
3724
3752
  /**
3725
3753
  * Handle replacing external content.
@@ -3728,7 +3756,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3728
3756
  * @param opts - Options for handling external content, including force flag to bypass readonly checks.
3729
3757
  */
3730
3758
  replaceExternalContent<E>(info: TLExternalContent<E>, opts?: {
3731
- force?: boolean;
3759
+ force?: boolean | undefined;
3732
3760
  }): Promise<void>;
3733
3761
  /**
3734
3762
  * Get content that can be exported for the given shape ids.
@@ -3768,6 +3796,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3768
3796
  getSvgElement(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<{
3769
3797
  height: number;
3770
3798
  svg: SVGSVGElement;
3799
+ trimPadding: number;
3771
3800
  width: number;
3772
3801
  } | undefined>;
3773
3802
  /**
@@ -3783,6 +3812,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3783
3812
  getSvgString(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<{
3784
3813
  height: number;
3785
3814
  svg: string;
3815
+ trimPadding: number;
3786
3816
  width: number;
3787
3817
  } | undefined>;
3788
3818
  /**
@@ -4140,6 +4170,8 @@ export declare interface EditorProviderProps {
4140
4170
  children: React_3.ReactNode;
4141
4171
  }
4142
4172
 
4173
+ /* Excluded from this release type: elementShouldCaptureKeys */
4174
+
4143
4175
  /** @public */
4144
4176
  export declare class Ellipse2d extends Geometry2d {
4145
4177
  config: Omit<Geometry2dOptions, 'isClosed'> & {
@@ -4156,6 +4188,7 @@ export declare class Ellipse2d extends Geometry2d {
4156
4188
  get edges(): Edge2d[];
4157
4189
  getVertices(): any[];
4158
4190
  nearestPoint(A: VecLike): Vec;
4191
+ distanceToPoint(point: VecLike, hitInside?: boolean): number;
4159
4192
  hitTestLineSegment(A: VecLike, B: VecLike): boolean;
4160
4193
  getBounds(): Box;
4161
4194
  getLength(): number;
@@ -4268,6 +4301,11 @@ export declare abstract class Geometry2d {
4268
4301
  private _length?;
4269
4302
  get length(): number;
4270
4303
  getLength(_filters?: Geometry2dFilters): number;
4304
+ /**
4305
+ * Called after a hit test succeeds. Return `true` to reject the hit and allow
4306
+ * shapes behind this one to be selected instead (e.g. transparent image pixels).
4307
+ */
4308
+ ignoreHit(_point: VecLike): boolean;
4271
4309
  abstract getSvgPathData(first: boolean): string;
4272
4310
  }
4273
4311
 
@@ -4535,7 +4573,7 @@ export declare class HandleSnaps {
4535
4573
  private iterateSnapOutlines;
4536
4574
  private getHandleSnapPosition;
4537
4575
  private getHandleSnapData;
4538
- snapHandle({ currentShapeId, handle, }: {
4576
+ snapHandle({ currentShapeId, handle }: {
4539
4577
  currentShapeId: TLShapeId;
4540
4578
  handle: TLHandle;
4541
4579
  }): null | SnapData;
@@ -5186,6 +5224,8 @@ export declare class Polyline2d extends Geometry2d {
5186
5224
  getLength(): number;
5187
5225
  getVertices(): Vec[];
5188
5226
  nearestPoint(A: VecLike): Vec;
5227
+ hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean): boolean;
5228
+ distanceToPoint(point: VecLike, hitInside?: boolean): number;
5189
5229
  hitTestLineSegment(A: VecLike, B: VecLike, distance?: number): boolean;
5190
5230
  getSvgPathData(): string;
5191
5231
  }
@@ -6273,6 +6313,7 @@ export declare class Stadium2d extends Geometry2d {
6273
6313
  width: number;
6274
6314
  });
6275
6315
  nearestPoint(A: VecLike): Vec;
6316
+ distanceToPoint(point: VecLike, hitInside?: boolean): number;
6276
6317
  hitTestLineSegment(A: VecLike, B: VecLike): boolean;
6277
6318
  getVertices(): Vec[];
6278
6319
  getBounds(): Box;
@@ -7771,7 +7812,7 @@ export declare const tlmenus: {
7771
7812
  *
7772
7813
  * @public
7773
7814
  */
7774
- clearOpenMenus(contextId?: string): void;
7815
+ clearOpenMenus(contextId?: string | undefined): void;
7775
7816
  /**
7776
7817
  * Delete an open menu.
7777
7818
  *
@@ -7794,7 +7835,7 @@ export declare const tlmenus: {
7794
7835
  *
7795
7836
  * @public
7796
7837
  */
7797
- getOpenMenus(contextId?: string): string[];
7838
+ getOpenMenus(contextId?: string | undefined): string[];
7798
7839
  /**
7799
7840
  * Get whether a menu is open for a given context.
7800
7841
  *
@@ -7808,7 +7849,7 @@ export declare const tlmenus: {
7808
7849
  *
7809
7850
  * @public
7810
7851
  */
7811
- isMenuOpen(id: string, contextId?: string): boolean;
7852
+ isMenuOpen(id: string, contextId?: string | undefined): boolean;
7812
7853
  /**
7813
7854
  * Get whether any menus are open for a given context.
7814
7855
  *
@@ -7846,7 +7887,7 @@ export declare const tlmenus: {
7846
7887
  *
7847
7888
  * @public
7848
7889
  */
7849
- hideOpenMenus(contextId?: string): void;
7890
+ hideOpenMenus(contextId?: string | undefined): void;
7850
7891
  /**
7851
7892
  * Show all hidden menus.
7852
7893
  *
@@ -7860,7 +7901,7 @@ export declare const tlmenus: {
7860
7901
  *
7861
7902
  * @public
7862
7903
  */
7863
- showOpenMenus(contextId?: string): void;
7904
+ showOpenMenus(contextId?: string | undefined): void;
7864
7905
  forContext(contextId: string): {
7865
7906
  addOpenMenu: (id: string) => void;
7866
7907
  clearOpenMenus: () => void;
@@ -8078,7 +8119,7 @@ export declare interface TLShapeIndicatorsProps {
8078
8119
  */
8079
8120
  export declare interface TLShapeUtilCanBeLaidOutOpts {
8080
8121
  /** The type of action causing the layout. */
8081
- type?: 'align' | 'distribute' | 'flip' | 'pack' | 'stack' | 'stretch';
8122
+ type?: 'align' | 'distribute' | 'flip' | 'pack' | 'resize_to_bounds' | 'stack' | 'stretch';
8082
8123
  /** The other shapes being laid out */
8083
8124
  shapes?: TLShape[];
8084
8125
  }
@@ -8245,9 +8286,15 @@ export declare interface TLSvgExportOptions {
8245
8286
  */
8246
8287
  background?: boolean;
8247
8288
  /**
8248
- * How much padding to include around the bounds of exports? Defaults to 32px.
8289
+ * How much padding to include around the bounds of exports.
8290
+ *
8291
+ * - `'auto'` (default) — trim to visual content bounds, capturing overflow (like thick
8292
+ * strokes or arrowheads) without extra whitespace.
8293
+ * - `number` (e.g. `32`) — fixed padding in px. No trimming; overflow beyond the padding
8294
+ * region is clipped.
8295
+ * - `0` — no padding, no trimming, overflow is clipped.
8249
8296
  */
8250
- padding?: number;
8297
+ padding?: 'auto' | number;
8251
8298
  /**
8252
8299
  * Should the export be rendered in dark mode (true) or light mode (false)? Defaults to the
8253
8300
  * current instance's dark mode setting.
@@ -8426,6 +8473,7 @@ export declare class TransformedGeometry2d extends Geometry2d {
8426
8473
  intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): Vec[];
8427
8474
  intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
8428
8475
  intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
8476
+ ignoreHit(point: VecLike): boolean;
8429
8477
  transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
8430
8478
  getSvgPathData(): string;
8431
8479
  }
@@ -8578,7 +8626,7 @@ export declare const userTypeValidator: T.Validator<TLUserPreferences>;
8578
8626
  /** @public */
8579
8627
  export declare function useSelectionEvents(handle: TLSelectionHandle): {
8580
8628
  onPointerDown: PointerEventHandler<Element>;
8581
- onPointerMove: (e: React.PointerEvent) => void;
8629
+ onPointerMove: (e: PointerEvent_2<Element>) => void;
8582
8630
  onPointerUp: PointerEventHandler<Element>;
8583
8631
  };
8584
8632
 
@@ -8745,6 +8793,7 @@ export declare class Vec {
8745
8793
  static Cast(A: VecLike): Vec;
8746
8794
  static Slope(A: VecLike, B: VecLike): number;
8747
8795
  static IsNaN(A: VecLike): boolean;
8796
+ static IsFinite(A: VecLike): boolean;
8748
8797
  /**
8749
8798
  * Get the angle from position A to position B.
8750
8799
  */
@@ -8789,8 +8838,9 @@ export declare class Vec {
8789
8838
  * @param A - The first point.
8790
8839
  * @param B - The second point.
8791
8840
  * @param steps - The number of points to return.
8841
+ * @param ease - The easing to use.
8792
8842
  */
8793
- static PointsBetween(A: VecModel, B: VecModel, steps?: number): Vec[];
8843
+ static PointsBetween(A: VecModel, B: VecModel, steps?: number, ease?: (t: number) => number): Vec[];
8794
8844
  static SnapToGrid(A: VecLike, gridSize?: number): Vec;
8795
8845
  }
8796
8846
 
package/dist-cjs/index.js CHANGED
@@ -130,6 +130,7 @@ __export(index_exports, {
130
130
  defaultTldrawOptions: () => import_options.defaultTldrawOptions,
131
131
  defaultUserPreferences: () => import_TLUserPreferences.defaultUserPreferences,
132
132
  degreesToRadians: () => import_utils2.degreesToRadians,
133
+ elementShouldCaptureKeys: () => import_dom.elementShouldCaptureKeys,
133
134
  extractSessionStateFromLegacySnapshot: () => import_TLSessionStateSnapshot.extractSessionStateFromLegacySnapshot,
134
135
  featureFlags: () => import_debug_flags.featureFlags,
135
136
  getArcMeasure: () => import_utils2.getArcMeasure,
@@ -369,7 +370,7 @@ var import_LocalIndexedDb = require("./lib/utils/sync/LocalIndexedDb");
369
370
  var import_uniq = require("./lib/utils/uniq");
370
371
  (0, import_utils.registerTldrawLibraryVersion)(
371
372
  "@tldraw/editor",
372
- "4.5.0-canary.ea6778d1533e",
373
+ "4.5.0-canary.efe342c4f38c",
373
374
  "cjs"
374
375
  );
375
376
  //# 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'\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 { 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\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\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\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 {\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 {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\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 {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\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 { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\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 { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\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 {\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 { 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 TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\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 {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } 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 {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} 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 LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT } from './lib/license/LicenseProvider'\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 { 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 { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\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 { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\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\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\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 { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\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;A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C1B,4BAAsD;AAEtD,kBAAqB;AAAA,IAErB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\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 { 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\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\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\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 {\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 {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\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 {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\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 { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\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 { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\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 {\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 { 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 TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\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 {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } 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 {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} 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 LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT } from './lib/license/LicenseProvider'\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 { 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 { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\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 { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\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\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\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\telementShouldCaptureKeys,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
+ "mappings": ";;;;;;;;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