@tldraw/editor 3.16.0-next.fe14f1b4181f → 4.0.0

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 (143) hide show
  1. package/dist-cjs/index.d.ts +91 -109
  2. package/dist-cjs/index.js +3 -5
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/TldrawEditor.js +1 -7
  5. package/dist-cjs/lib/TldrawEditor.js.map +2 -2
  6. package/dist-cjs/lib/components/default-components/DefaultCanvas.js +11 -1
  7. package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
  8. package/dist-cjs/lib/config/TLUserPreferences.js +15 -4
  9. package/dist-cjs/lib/config/TLUserPreferences.js.map +2 -2
  10. package/dist-cjs/lib/editor/Editor.js +58 -114
  11. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  12. package/dist-cjs/lib/editor/derivations/notVisibleShapes.js +4 -0
  13. package/dist-cjs/lib/editor/derivations/notVisibleShapes.js.map +2 -2
  14. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js +4 -2
  15. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +2 -2
  16. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +11 -6
  17. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
  18. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +10 -0
  19. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  20. package/dist-cjs/lib/editor/types/misc-types.js.map +1 -1
  21. package/dist-cjs/lib/hooks/useCanvasEvents.js +19 -16
  22. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  23. package/dist-cjs/lib/hooks/useDocumentEvents.js +5 -5
  24. package/dist-cjs/lib/hooks/useDocumentEvents.js.map +2 -2
  25. package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js +1 -2
  26. package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js.map +2 -2
  27. package/dist-cjs/lib/hooks/useGestureEvents.js +1 -1
  28. package/dist-cjs/lib/hooks/useGestureEvents.js.map +2 -2
  29. package/dist-cjs/lib/hooks/useHandleEvents.js +6 -6
  30. package/dist-cjs/lib/hooks/useHandleEvents.js.map +2 -2
  31. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js +4 -1
  32. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +2 -2
  33. package/dist-cjs/lib/hooks/useSelectionEvents.js +8 -8
  34. package/dist-cjs/lib/hooks/useSelectionEvents.js.map +2 -2
  35. package/dist-cjs/lib/license/LicenseManager.js +143 -53
  36. package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
  37. package/dist-cjs/lib/license/LicenseProvider.js +39 -1
  38. package/dist-cjs/lib/license/LicenseProvider.js.map +2 -2
  39. package/dist-cjs/lib/license/Watermark.js +144 -75
  40. package/dist-cjs/lib/license/Watermark.js.map +3 -3
  41. package/dist-cjs/lib/license/useLicenseManagerState.js.map +2 -2
  42. package/dist-cjs/lib/primitives/Vec.js +0 -4
  43. package/dist-cjs/lib/primitives/Vec.js.map +2 -2
  44. package/dist-cjs/lib/primitives/geometry/Geometry2d.js +50 -20
  45. package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
  46. package/dist-cjs/lib/primitives/geometry/Group2d.js +8 -1
  47. package/dist-cjs/lib/primitives/geometry/Group2d.js.map +2 -2
  48. package/dist-cjs/lib/utils/dom.js.map +2 -2
  49. package/dist-cjs/lib/utils/getPointerInfo.js +2 -3
  50. package/dist-cjs/lib/utils/getPointerInfo.js.map +2 -2
  51. package/dist-cjs/lib/utils/reparenting.js +7 -36
  52. package/dist-cjs/lib/utils/reparenting.js.map +3 -3
  53. package/dist-cjs/version.js +4 -4
  54. package/dist-cjs/version.js.map +1 -1
  55. package/dist-esm/index.d.mts +91 -109
  56. package/dist-esm/index.mjs +3 -5
  57. package/dist-esm/index.mjs.map +2 -2
  58. package/dist-esm/lib/TldrawEditor.mjs +1 -7
  59. package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
  60. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +11 -1
  61. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
  62. package/dist-esm/lib/config/TLUserPreferences.mjs +15 -4
  63. package/dist-esm/lib/config/TLUserPreferences.mjs.map +2 -2
  64. package/dist-esm/lib/editor/Editor.mjs +58 -114
  65. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  66. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs +4 -0
  67. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs.map +2 -2
  68. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs +4 -2
  69. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +2 -2
  70. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +11 -6
  71. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
  72. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +10 -0
  73. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  74. package/dist-esm/lib/hooks/useCanvasEvents.mjs +20 -22
  75. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  76. package/dist-esm/lib/hooks/useDocumentEvents.mjs +6 -6
  77. package/dist-esm/lib/hooks/useDocumentEvents.mjs.map +2 -2
  78. package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs +1 -2
  79. package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs.map +2 -2
  80. package/dist-esm/lib/hooks/useGestureEvents.mjs +2 -2
  81. package/dist-esm/lib/hooks/useGestureEvents.mjs.map +2 -2
  82. package/dist-esm/lib/hooks/useHandleEvents.mjs +6 -6
  83. package/dist-esm/lib/hooks/useHandleEvents.mjs.map +2 -2
  84. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs +4 -1
  85. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +2 -2
  86. package/dist-esm/lib/hooks/useSelectionEvents.mjs +9 -14
  87. package/dist-esm/lib/hooks/useSelectionEvents.mjs.map +2 -2
  88. package/dist-esm/lib/license/LicenseManager.mjs +144 -54
  89. package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
  90. package/dist-esm/lib/license/LicenseProvider.mjs +39 -2
  91. package/dist-esm/lib/license/LicenseProvider.mjs.map +2 -2
  92. package/dist-esm/lib/license/Watermark.mjs +145 -76
  93. package/dist-esm/lib/license/Watermark.mjs.map +3 -3
  94. package/dist-esm/lib/license/useLicenseManagerState.mjs.map +2 -2
  95. package/dist-esm/lib/primitives/Vec.mjs +0 -4
  96. package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
  97. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +53 -21
  98. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  99. package/dist-esm/lib/primitives/geometry/Group2d.mjs +8 -1
  100. package/dist-esm/lib/primitives/geometry/Group2d.mjs.map +2 -2
  101. package/dist-esm/lib/utils/dom.mjs.map +2 -2
  102. package/dist-esm/lib/utils/getPointerInfo.mjs +2 -3
  103. package/dist-esm/lib/utils/getPointerInfo.mjs.map +2 -2
  104. package/dist-esm/lib/utils/reparenting.mjs +8 -41
  105. package/dist-esm/lib/utils/reparenting.mjs.map +2 -2
  106. package/dist-esm/version.mjs +4 -4
  107. package/dist-esm/version.mjs.map +1 -1
  108. package/editor.css +8 -3
  109. package/package.json +7 -7
  110. package/src/index.ts +2 -9
  111. package/src/lib/TldrawEditor.tsx +1 -15
  112. package/src/lib/components/default-components/DefaultCanvas.tsx +7 -1
  113. package/src/lib/config/TLUserPreferences.ts +16 -3
  114. package/src/lib/editor/Editor.test.ts +90 -0
  115. package/src/lib/editor/Editor.ts +77 -151
  116. package/src/lib/editor/derivations/notVisibleShapes.ts +6 -0
  117. package/src/lib/editor/managers/FocusManager/FocusManager.ts +6 -2
  118. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +30 -8
  119. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +10 -3
  120. package/src/lib/editor/shapes/ShapeUtil.ts +32 -0
  121. package/src/lib/editor/types/misc-types.ts +0 -6
  122. package/src/lib/hooks/useCanvasEvents.ts +20 -20
  123. package/src/lib/hooks/useDocumentEvents.ts +6 -6
  124. package/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +1 -1
  125. package/src/lib/hooks/useGestureEvents.ts +2 -2
  126. package/src/lib/hooks/useHandleEvents.ts +6 -6
  127. package/src/lib/hooks/usePassThroughMouseOverEvents.ts +4 -1
  128. package/src/lib/hooks/useSelectionEvents.ts +9 -14
  129. package/src/lib/license/LicenseManager.test.ts +721 -382
  130. package/src/lib/license/LicenseManager.ts +204 -58
  131. package/src/lib/license/LicenseProvider.tsx +74 -2
  132. package/src/lib/license/Watermark.tsx +152 -77
  133. package/src/lib/license/useLicenseManagerState.ts +2 -2
  134. package/src/lib/primitives/Vec.ts +0 -5
  135. package/src/lib/primitives/geometry/Geometry2d.test.ts +420 -0
  136. package/src/lib/primitives/geometry/Geometry2d.ts +78 -21
  137. package/src/lib/primitives/geometry/Group2d.ts +10 -1
  138. package/src/lib/test/InFrontOfTheCanvas.test.tsx +187 -0
  139. package/src/lib/utils/dom.test.ts +103 -0
  140. package/src/lib/utils/dom.ts +8 -1
  141. package/src/lib/utils/getPointerInfo.ts +3 -2
  142. package/src/lib/utils/reparenting.ts +10 -70
  143. package/src/version.ts +4 -4
@@ -761,11 +761,6 @@ export declare class CubicSpline2d extends Geometry2d {
761
761
  /** @public */
762
762
  export declare function dataUrlToFile(url: string, filename: string, mimeType: string): Promise<File>;
763
763
 
764
- /**
765
- * @deprecated Licensing is now enabled in the tldraw SDK.
766
- * @public */
767
- export declare function debugEnableLicensing(): void;
768
-
769
764
  /* Excluded from this release type: DebugFlag */
770
765
 
771
766
  /* Excluded from this release type: DebugFlagDef */
@@ -902,13 +897,14 @@ export declare const defaultUserPreferences: Readonly<{
902
897
  color: "#02B1CC" | "#11B3A3" | "#39B178" | "#55B467" | "#7B66DC" | "#9D5BD2" | "#BD54C6" | "#E34BA9" | "#EC5E41" | "#F04F88" | "#F2555A" | "#FF802B";
903
898
  colorScheme: "light";
904
899
  edgeScrollSpeed: 1;
900
+ enhancedA11yMode: false;
901
+ inputMode: null;
905
902
  isDynamicSizeMode: false;
906
903
  isPasteAtCursorMode: false;
907
904
  isSnapMode: false;
908
905
  isWrapMode: false;
909
906
  locale: "ar" | "bn" | "ca" | "cs" | "da" | "de" | "el" | "en" | "es" | "fa" | "fi" | "fr" | "gl" | "gu-in" | "he" | "hi-in" | "hr" | "hu" | "id" | "it" | "ja" | "km-kh" | "kn" | "ko-kr" | "ml" | "mr" | "ms" | "ne" | "nl" | "no" | "pa" | "pl" | "pt-br" | "pt-pt" | "ro" | "ru" | "sl" | "so" | "sv" | "ta" | "te" | "th" | "tl" | "tr" | "uk" | "ur" | "vi" | "zh-cn" | "zh-tw";
910
907
  name: "";
911
- showUiLabels: false;
912
908
  }>;
913
909
 
914
910
  /**
@@ -984,7 +980,7 @@ export declare class EdgeScrollManager {
984
980
  /** @public */
985
981
  export declare class Editor extends EventEmitter<TLEventMap> {
986
982
  readonly id: string;
987
- constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options, isShapeHidden, getShapeVisibility, fontAssetUrls, }: TLEditorOptions);
983
+ constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options, getShapeVisibility, fontAssetUrls, }: TLEditorOptions);
988
984
  private readonly _getShapeVisibility?;
989
985
  private getIsShapeHiddenCache;
990
986
  isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
@@ -1051,22 +1047,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1051
1047
  * @public
1052
1048
  */
1053
1049
  readonly fonts: FontManager;
1054
- /**
1055
- * A manager for the editor's environment.
1056
- *
1057
- * @deprecated This is deprecated and will be removed in a future version. Use the `tlenv` global export instead.
1058
- * @public
1059
- */
1060
- readonly environment: {
1061
- hasCanvasSupport: boolean;
1062
- isAndroid: boolean;
1063
- isChromeForIos: boolean;
1064
- isDarwin: boolean;
1065
- isFirefox: boolean;
1066
- isIos: boolean;
1067
- isSafari: boolean;
1068
- isWebview: boolean;
1069
- };
1070
1050
  /**
1071
1051
  * A manager for the editor's scribbles.
1072
1052
  *
@@ -1209,22 +1189,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1209
1189
  * @public
1210
1190
  */
1211
1191
  getCanRedo(): boolean;
1212
- /**
1213
- * Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
1214
- * any redos.
1215
- *
1216
- * @example
1217
- * ```ts
1218
- * editor.mark()
1219
- * editor.mark('flip shapes')
1220
- * ```
1221
- *
1222
- * @param markId - The mark's id, usually the reason for adding the mark.
1223
- *
1224
- * @public
1225
- * @deprecated use {@link Editor.markHistoryStoppingPoint} instead
1226
- */
1227
- mark(markId?: string): this;
1228
1192
  /**
1229
1193
  * Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
1230
1194
  * any redos. You typically want to do this just before a user interaction begins or is handled.
@@ -1314,10 +1278,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1314
1278
  * @public
1315
1279
  */
1316
1280
  run(fn: () => void, opts?: TLEditorRunOptions): this;
1317
- /**
1318
- * @deprecated Use `Editor.run` instead.
1319
- */
1320
- batch(fn: () => void, opts?: TLEditorRunOptions): this;
1321
1281
  /* Excluded from this release type: annotateError */
1322
1282
  /* Excluded from this release type: createErrorAnnotations */
1323
1283
  /* Excluded from this release type: _crashingError */
@@ -1439,36 +1399,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1439
1399
  hasOpenMenus: () => boolean;
1440
1400
  isMenuOpen: (id: string) => boolean;
1441
1401
  };
1442
- /**
1443
- * @deprecated Use `editor.menus.getOpenMenus` instead.
1444
- *
1445
- * @public
1446
- */
1447
- getOpenMenus(): string[];
1448
- /**
1449
- * @deprecated Use `editor.menus.addOpenMenu` instead.
1450
- *
1451
- * @public
1452
- */
1453
- addOpenMenu(id: string): this;
1454
- /**
1455
- * @deprecated Use `editor.menus.deleteOpenMenu` instead.
1456
- *
1457
- * @public
1458
- */
1459
- deleteOpenMenu(id: string): this;
1460
- /**
1461
- * @deprecated Use `editor.menus.clearOpenMenus` instead.
1462
- *
1463
- * @public
1464
- */
1465
- clearOpenMenus(): this;
1466
- /**
1467
- * @deprecated Use `editor.menus.hasAnyOpenMenus` instead.
1468
- *
1469
- * @public
1470
- */
1471
- getIsMenuOpen(): boolean;
1472
1402
  /**
1473
1403
  * Set the cursor.
1474
1404
  *
@@ -2917,8 +2847,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2917
2847
  * @public
2918
2848
  */
2919
2849
  getShapeAndDescendantIds(ids: TLShapeId[]): Set<TLShapeId>;
2920
- /** @deprecated Use {@link Editor.getDraggingOverShape} instead */
2921
- getDroppingOverShape(point: Vec, droppingShapes: TLShape[]): TLShape | undefined;
2922
2850
  /**
2923
2851
  * Get the shape that some shapes should be dropped on at a given point.
2924
2852
  *
@@ -3630,14 +3558,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3630
3558
  * Handle external content, such as files, urls, embeds, or plain text which has been put into the app, for example by pasting external text or dropping external images onto canvas.
3631
3559
  *
3632
3560
  * @param info - Info about the external content.
3561
+ * @param opts - Options for handling external content, including force flag to bypass readonly checks.
3633
3562
  */
3634
- putExternalContent<E>(info: TLExternalContent<E>): Promise<void>;
3563
+ putExternalContent<E>(info: TLExternalContent<E>, opts?: {
3564
+ force?: boolean;
3565
+ }): Promise<void>;
3635
3566
  /**
3636
3567
  * Handle replacing external content.
3637
3568
  *
3638
3569
  * @param info - Info about the external content.
3570
+ * @param opts - Options for handling external content, including force flag to bypass readonly checks.
3639
3571
  */
3640
- replaceExternalContent<E>(info: TLExternalContent<E>): Promise<void>;
3572
+ replaceExternalContent<E>(info: TLExternalContent<E>, opts?: {
3573
+ force?: boolean;
3574
+ }): Promise<void>;
3641
3575
  /**
3642
3576
  * Get content that can be exported for the given shape ids.
3643
3577
  *
@@ -3693,8 +3627,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3693
3627
  svg: string;
3694
3628
  width: number;
3695
3629
  } | undefined>;
3696
- /** @deprecated Use {@link Editor.getSvgString} or {@link Editor.getSvgElement} instead. */
3697
- getSvg(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<SVGSVGElement | undefined>;
3698
3630
  /**
3699
3631
  * Get an exported image of the given shapes.
3700
3632
  *
@@ -4028,6 +3960,31 @@ export declare class Editor extends EventEmitter<TLEventMap> {
4028
3960
  /* Excluded from this release type: capturedPointerId */
4029
3961
  /* Excluded from this release type: performanceTracker */
4030
3962
  /* Excluded from this release type: performanceTrackerTimeout */
3963
+ /* Excluded from this release type: handledEvents */
3964
+ /**
3965
+ * In tldraw, events are sometimes handled by multiple components. For example, the shapes might
3966
+ * have events, but the canvas handles events too. The way that the canvas handles events can
3967
+ * interfere with the with the shapes event handlers - for example, it calls `.preventDefault()`
3968
+ * on `pointerDown`, which also prevents `click` events from firing on the shapes.
3969
+ *
3970
+ * You can use `.stopPropagation()` to prevent the event from propagating to the rest of the
3971
+ * DOM, but that can impact non-tldraw event handlers set up elsewhere. By using
3972
+ * `markEventAsHandled`, you'll stop other parts of tldraw from handling the event without
3973
+ * impacting other, non-tldraw event handlers. See also {@link Editor.wasEventAlreadyHandled}.
3974
+ *
3975
+ * @public
3976
+ */
3977
+ markEventAsHandled(e: {
3978
+ nativeEvent: Event;
3979
+ } | Event): void;
3980
+ /**
3981
+ * Checks if an event has already been handled. See {@link Editor.markEventAsHandled}.
3982
+ *
3983
+ * @public
3984
+ */
3985
+ wasEventAlreadyHandled(e: {
3986
+ nativeEvent: Event;
3987
+ } | Event): boolean;
4031
3988
  /**
4032
3989
  * Dispatch an event to the editor.
4033
3990
  *
@@ -4164,6 +4121,7 @@ export declare abstract class Geometry2d {
4164
4121
  isLabel: boolean;
4165
4122
  isEmptyLabel: boolean;
4166
4123
  isInternal: boolean;
4124
+ excludeFromShapeBounds: boolean;
4167
4125
  debugColor?: string;
4168
4126
  ignore?: boolean;
4169
4127
  constructor(opts: Geometry2dOptions);
@@ -4187,12 +4145,14 @@ export declare abstract class Geometry2d {
4187
4145
  * along the edge it is as a fraction of the total length.
4188
4146
  */
4189
4147
  uninterpolateAlongEdge(point: VecLike, _filters?: Geometry2dFilters): number;
4190
- /** @deprecated Iterate the vertices instead. */
4191
- nearestPointOnLineSegment(A: VecLike, B: VecLike): Vec;
4192
4148
  isPointInBounds(point: VecLike, margin?: number): boolean;
4149
+ overlapsPolygon(_polygon: VecLike[]): boolean;
4193
4150
  transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
4194
4151
  private _vertices;
4195
4152
  get vertices(): Vec[];
4153
+ getBoundsVertices(): Vec[];
4154
+ private _boundsVertices;
4155
+ get boundsVertices(): Vec[];
4196
4156
  getBounds(): Box;
4197
4157
  private _bounds;
4198
4158
  get bounds(): Box;
@@ -4300,7 +4260,7 @@ export declare function getPerfectDashProps(totalLength: number, strokeWidth: nu
4300
4260
  };
4301
4261
 
4302
4262
  /** @public */
4303
- export declare function getPointerInfo(e: PointerEvent | React.PointerEvent): {
4263
+ export declare function getPointerInfo(editor: Editor, e: PointerEvent | React.PointerEvent): {
4304
4264
  accelKey: boolean;
4305
4265
  altKey: boolean;
4306
4266
  button: number;
@@ -4389,6 +4349,7 @@ export declare class Group2d extends Geometry2d {
4389
4349
  hitTestLineSegment(A: VecLike, B: VecLike, zoom: number, filters?: Geometry2dFilters): boolean;
4390
4350
  intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
4391
4351
  intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
4352
+ getBoundsVertices(): Vec[];
4392
4353
  intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
4393
4354
  intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
4394
4355
  interpolateAlongEdge(t: number, filters?: Geometry2dFilters): Vec;
@@ -4398,6 +4359,7 @@ export declare class Group2d extends Geometry2d {
4398
4359
  toSimpleSvgPath(): string;
4399
4360
  getLength(filters?: Geometry2dFilters): number;
4400
4361
  getSvgPathData(): string;
4362
+ overlapsPolygon(polygon: VecLike[]): boolean;
4401
4363
  }
4402
4364
 
4403
4365
  /** @public */
@@ -4638,12 +4600,16 @@ export declare function kickoutOccludedShapes(editor: Editor, shapeIds: TLShapeI
4638
4600
  filter?(parent: TLShape): boolean;
4639
4601
  }): void;
4640
4602
 
4603
+ /* Excluded from this release type: LICENSE_TIMEOUT */
4604
+
4641
4605
  /* Excluded from this release type: LicenseFromKeyResult */
4642
4606
 
4643
4607
  /* Excluded from this release type: LicenseInfo */
4644
4608
 
4645
4609
  /* Excluded from this release type: LicenseManager */
4646
4610
 
4611
+ /* Excluded from this release type: LicenseState */
4612
+
4647
4613
  /** @public */
4648
4614
  export declare function linesIntersect(A: VecLike, B: VecLike, C: VecLike, D: VecLike): boolean;
4649
4615
 
@@ -5249,7 +5215,34 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5249
5215
  * @public
5250
5216
  */
5251
5217
  canBeLaidOut(_shape: Shape, _info: TLShapeUtilCanBeLaidOutOpts): boolean;
5218
+ /**
5219
+ * Whether this shape can be culled. By default, shapes are culled for
5220
+ * performance reasons when they are outside of the viewport. Culled shapes are still rendered
5221
+ * to the DOM, but have their `display` property set to `none`.
5222
+ *
5223
+ * @param shape - The shape.
5224
+ */
5225
+ canCull(_shape: Shape): boolean;
5252
5226
  /* Excluded from this release type: providesBackgroundForChildren */
5227
+ /**
5228
+ * Get the clip path to apply to this shape's children.
5229
+ *
5230
+ * @param shape - The shape to get the clip path for
5231
+ * @returns Array of points defining the clipping polygon in local coordinates, or undefined if no clipping
5232
+ * @public
5233
+ */
5234
+ getClipPath?(shape: Shape): undefined | Vec[];
5235
+ /**
5236
+ * Whether a specific child shape should be clipped by this shape.
5237
+ * Only called if getClipPath returns a valid polygon.
5238
+ *
5239
+ * If not defined, the default behavior is to clip all children.
5240
+ *
5241
+ * @param child - The child shape to check
5242
+ * @returns boolean indicating if this child should be clipped
5243
+ * @public
5244
+ */
5245
+ shouldClipChild?(child: TLShape): boolean;
5253
5246
  /**
5254
5247
  * Whether the shape should hide its resize handles when selected.
5255
5248
  *
@@ -5846,7 +5839,14 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
5846
5839
  onExit?(info: any, to: string): void;
5847
5840
  }
5848
5841
 
5849
- /** @public */
5842
+ /**
5843
+ * Calls `event.stopPropagation()`.
5844
+ *
5845
+ * @deprecated Use {@link Editor.markEventAsHandled} instead, or manually call `event.stopPropagation()` if
5846
+ * that's what you really want.
5847
+ *
5848
+ * @public
5849
+ */
5850
5850
  export declare const stopEventPropagation: (e: any) => any;
5851
5851
 
5852
5852
  /* Excluded from this release type: StoreName */
@@ -6337,12 +6337,6 @@ export declare interface TldrawEditorBaseProps {
6337
6337
  * Options for syncing the editor's camera state with the URL.
6338
6338
  */
6339
6339
  deepLinks?: TLDeepLinkOptions | true;
6340
- /**
6341
- * Predicate for whether or not a shape should be hidden.
6342
- *
6343
- * @deprecated Use {@link TldrawEditorBaseProps#getShapeVisibility} instead.
6344
- */
6345
- isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6346
6340
  /**
6347
6341
  * Provides a way to hide shapes.
6348
6342
  *
@@ -6604,15 +6598,6 @@ export declare interface TLEditorOptions {
6604
6598
  fontAssetUrls?: {
6605
6599
  [key: string]: string | undefined;
6606
6600
  };
6607
- /**
6608
- * A predicate that should return true if the given shape should be hidden.
6609
- *
6610
- * @deprecated Use {@link Editor#getShapeVisibility} instead.
6611
- *
6612
- * @param shape - The shape to check.
6613
- * @param editor - The editor instance.
6614
- */
6615
- isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6616
6601
  /**
6617
6602
  * Provides a way to hide shapes.
6618
6603
  *
@@ -7603,12 +7588,6 @@ export declare interface TLSvgExportOptions {
7603
7588
  preserveAspectRatio?: React.SVGAttributes<SVGSVGElement>['preserveAspectRatio'];
7604
7589
  }
7605
7590
 
7606
- /**
7607
- * @public
7608
- * @deprecated use {@link TLImageExportOptions} instead
7609
- */
7610
- export declare type TLSvgOptions = TLImageExportOptions;
7611
-
7612
7591
  /** @public */
7613
7592
  export declare interface TLSvgTextExternalContent extends TLBaseExternalContent {
7614
7593
  type: 'svg-text';
@@ -7719,7 +7698,8 @@ export declare interface TLUserPreferences {
7719
7698
  isWrapMode?: boolean | null;
7720
7699
  isDynamicSizeMode?: boolean | null;
7721
7700
  isPasteAtCursorMode?: boolean | null;
7722
- showUiLabels?: boolean | null;
7701
+ enhancedA11yMode?: boolean | null;
7702
+ inputMode?: 'mouse' | 'trackpad' | null;
7723
7703
  }
7724
7704
 
7725
7705
  /** @public */
@@ -7762,6 +7742,7 @@ export declare class TransformedGeometry2d extends Geometry2d {
7762
7742
  private readonly decomposed;
7763
7743
  constructor(geometry: Geometry2d, matrix: MatModel, opts?: TransformedGeometry2dOptions);
7764
7744
  getVertices(filters: Geometry2dFilters): Vec[];
7745
+ getBoundsVertices(): Vec[];
7765
7746
  nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;
7766
7747
  hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean;
7767
7748
  distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
@@ -7782,6 +7763,7 @@ export declare interface TransformedGeometry2dOptions {
7782
7763
  isInternal?: boolean;
7783
7764
  debugColor?: string;
7784
7765
  ignore?: boolean;
7766
+ excludeFromShapeBounds?: boolean;
7785
7767
  }
7786
7768
 
7787
7769
  /** @public */
@@ -7885,14 +7867,15 @@ export declare class UserPreferencesManager {
7885
7867
  areKeyboardShortcutsEnabled: boolean;
7886
7868
  color: string;
7887
7869
  colorScheme: "dark" | "light" | "system" | undefined;
7870
+ enhancedA11yMode: boolean;
7888
7871
  id: string;
7872
+ inputMode: "mouse" | "trackpad" | null;
7889
7873
  isDarkMode: boolean;
7890
7874
  isDynamicResizeMode: boolean;
7891
7875
  isSnapMode: boolean;
7892
7876
  isWrapMode: boolean;
7893
7877
  locale: string;
7894
7878
  name: string;
7895
- showUiLabels: boolean;
7896
7879
  };
7897
7880
  getIsDarkMode(): boolean;
7898
7881
  /**
@@ -7909,7 +7892,8 @@ export declare class UserPreferencesManager {
7909
7892
  getIsWrapMode(): boolean;
7910
7893
  getIsDynamicResizeMode(): boolean;
7911
7894
  getIsPasteAtCursorMode(): boolean;
7912
- getShowUiLabels(): boolean;
7895
+ getEnhancedA11yMode(): boolean;
7896
+ getInputMode(): "mouse" | "trackpad" | null;
7913
7897
  }
7914
7898
 
7915
7899
  /** @public */
@@ -8016,8 +8000,6 @@ export declare class Vec {
8016
8000
  lrp(B: VecLike, t: number): Vec;
8017
8001
  equals(B: VecLike): boolean;
8018
8002
  equalsXY(x: number, y: number): boolean;
8019
- /** @deprecated use `uni` instead */
8020
- norm(): this;
8021
8003
  toFixed(): this;
8022
8004
  toString(): string;
8023
8005
  toJson(): VecModel;
package/dist-cjs/index.js CHANGED
@@ -70,6 +70,7 @@ __export(index_exports, {
70
70
  HTMLContainer: () => import_HTMLContainer.HTMLContainer,
71
71
  HandleSnaps: () => import_HandleSnaps.HandleSnaps,
72
72
  HistoryManager: () => import_HistoryManager.HistoryManager,
73
+ LICENSE_TIMEOUT: () => import_LicenseProvider.LICENSE_TIMEOUT,
73
74
  LicenseManager: () => import_LicenseManager.LicenseManager,
74
75
  LoadingScreen: () => import_TldrawEditor.LoadingScreen,
75
76
  LocalIndexedDb: () => import_LocalIndexedDb.LocalIndexedDb,
@@ -121,7 +122,6 @@ __export(index_exports, {
121
122
  createTLStore: () => import_createTLStore.createTLStore,
122
123
  createTLUser: () => import_createTLUser.createTLUser,
123
124
  dataUrlToFile: () => import_assets.dataUrlToFile,
124
- debugEnableLicensing: () => debugEnableLicensing,
125
125
  debugFlags: () => import_debug_flags.debugFlags,
126
126
  defaultTldrawOptions: () => import_options.defaultTldrawOptions,
127
127
  defaultUserPreferences: () => import_TLUserPreferences.defaultUserPreferences,
@@ -322,6 +322,7 @@ var import_useTLStore = require("./lib/hooks/useTLStore");
322
322
  var import_useTransform = require("./lib/hooks/useTransform");
323
323
  var import_useViewportHeight = require("./lib/hooks/useViewportHeight");
324
324
  var import_LicenseManager = require("./lib/license/LicenseManager");
325
+ var import_LicenseProvider = require("./lib/license/LicenseProvider");
325
326
  var import_options = require("./lib/options");
326
327
  var import_Box = require("./lib/primitives/Box");
327
328
  var import_easings = require("./lib/primitives/easings");
@@ -366,12 +367,9 @@ var import_hardReset = require("./lib/utils/sync/hardReset");
366
367
  var import_LocalIndexedDb = require("./lib/utils/sync/LocalIndexedDb");
367
368
  var import_uniq = require("./lib/utils/uniq");
368
369
  var import_window_open = require("./lib/utils/window-open");
369
- function debugEnableLicensing() {
370
- return;
371
- }
372
370
  (0, import_utils.registerTldrawLibraryVersion)(
373
371
  "@tldraw/editor",
374
- "3.16.0-next.fe14f1b4181f",
372
+ "4.0.0",
375
373
  "cjs"
376
374
  );
377
375
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\n\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\n\nexport { 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 {\n\tScribbleManager,\n\ttype ScribbleItem,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport {\n\tTextManager,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { 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 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 {\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 TLSvgOptions,\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 } 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 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 { 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\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 { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype 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 { runtime, setRuntimeOverrides } 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'\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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B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,uBAA0B;AAC1B,uBAaO;AACP,iBAAiD;AACjD,IAAAC,gBAgCO;AACP,iBAAkC;AAClC,0BAYO;AACP,oBAAoD;AACpD,kCAAgE;AAChE,yBAMO;AACP,uBAKO;AACP,iBAOO;AACP,wBAA2B;AAC3B,gCAAmC;AACnC,4BAA+B;AAC/B,kCAAqC;AACrC,6BAAgC;AAChC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAA4B;AAC5B,yBAAoE;AACpE,sBAOO;AACP,sBAIO;AACP,qBAA6C;AAC7C,6BAIO;AACP,uBAA0B;AAC1B,4BAAsD;AAEtD,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 { 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 {\n\tScribbleManager,\n\ttype ScribbleItem,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport {\n\tTextManager,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { 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 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 {\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 } 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 TestEnvironment,\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\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 { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype 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 { runtime, setRuntimeOverrides } 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'\nexport { openWindow } from './lib/utils/window-open'\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;AAA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_at", "import_utils"]
7
7
  }
@@ -41,8 +41,8 @@ var import_jsx_runtime = (
41
41
  );
42
42
  var import_store = require("@tldraw/store");
43
43
  var import_utils = require("@tldraw/utils");
44
- var import_react = __toESM(require("react"));
45
44
  var import_classnames = __toESM(require("classnames"));
45
+ var import_react = __toESM(require("react"));
46
46
  var import_version = require("../version");
47
47
  var import_DefaultErrorFallback = require("./components/default-components/DefaultErrorFallback");
48
48
  var import_ErrorBoundary = require("./components/ErrorBoundary");
@@ -62,7 +62,6 @@ var import_useStateAttribute = require("./hooks/useStateAttribute");
62
62
  var import_useZoomCss = require("./hooks/useZoomCss");
63
63
  var import_LicenseProvider = require("./license/LicenseProvider");
64
64
  var import_Watermark = require("./license/Watermark");
65
- var import_dom = require("./utils/dom");
66
65
  const EMPTY_SHAPE_UTILS_ARRAY = [];
67
66
  const EMPTY_BINDING_UTILS_ARRAY = [];
68
67
  const EMPTY_TOOLS_ARRAY = [];
@@ -93,7 +92,6 @@ const TldrawEditor = (0, import_react.memo)(function TldrawEditor2({
93
92
  "data-tldraw": import_version.version,
94
93
  draggable: false,
95
94
  className: (0, import_classnames.default)(`${TL_CONTAINER_CLASS} tl-theme__light`, className),
96
- onPointerDown: import_dom.stopEventPropagation,
97
95
  tabIndex: -1,
98
96
  role: "application",
99
97
  "aria-label": _options?.branding ?? "tldraw",
@@ -189,8 +187,6 @@ function TldrawEditorWithReadyStore({
189
187
  options,
190
188
  licenseKey,
191
189
  deepLinks: _deepLinks,
192
- // eslint-disable-next-line @typescript-eslint/no-deprecated
193
- isShapeHidden,
194
190
  getShapeVisibility,
195
191
  assetUrls
196
192
  }) {
@@ -235,7 +231,6 @@ function TldrawEditorWithReadyStore({
235
231
  textOptions,
236
232
  options,
237
233
  licenseKey,
238
- isShapeHidden,
239
234
  getShapeVisibility,
240
235
  fontAssetUrls: assetUrls?.fonts
241
236
  });
@@ -263,7 +258,6 @@ function TldrawEditorWithReadyStore({
263
258
  user,
264
259
  setEditor,
265
260
  licenseKey,
266
- isShapeHidden,
267
261
  getShapeVisibility,
268
262
  textOptions,
269
263
  assetUrls