@tldraw/editor 3.16.0-canary.e9c30b532b82 → 3.16.0-canary.ea008b31887f

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 (152) hide show
  1. package/dist-cjs/index.d.ts +71 -101
  2. package/dist-cjs/index.js +3 -5
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/TldrawEditor.js +6 -6
  5. package/dist-cjs/lib/TldrawEditor.js.map +2 -2
  6. package/dist-cjs/lib/components/Shape.js +7 -10
  7. package/dist-cjs/lib/components/Shape.js.map +2 -2
  8. package/dist-cjs/lib/components/default-components/DefaultCanvas.js +4 -23
  9. package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
  10. package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js +1 -1
  11. package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js.map +2 -2
  12. package/dist-cjs/lib/config/TLUserPreferences.js +1 -1
  13. package/dist-cjs/lib/config/TLUserPreferences.js.map +2 -2
  14. package/dist-cjs/lib/editor/Editor.js +44 -112
  15. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  16. package/dist-cjs/lib/editor/derivations/notVisibleShapes.js +4 -0
  17. package/dist-cjs/lib/editor/derivations/notVisibleShapes.js.map +2 -2
  18. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +1 -1
  19. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
  20. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +23 -0
  21. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  22. package/dist-cjs/lib/editor/types/misc-types.js.map +1 -1
  23. package/dist-cjs/lib/exports/getSvgJsx.js +34 -14
  24. package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
  25. package/dist-cjs/lib/hooks/useCanvasEvents.js +7 -5
  26. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  27. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js +4 -1
  28. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +2 -2
  29. package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js +4 -1
  30. package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js.map +2 -2
  31. package/dist-cjs/lib/license/LicenseManager.js +138 -50
  32. package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
  33. package/dist-cjs/lib/license/LicenseProvider.js +39 -1
  34. package/dist-cjs/lib/license/LicenseProvider.js.map +2 -2
  35. package/dist-cjs/lib/license/Watermark.js +68 -6
  36. package/dist-cjs/lib/license/Watermark.js.map +3 -3
  37. package/dist-cjs/lib/license/useLicenseManagerState.js.map +2 -2
  38. package/dist-cjs/lib/options.js +6 -0
  39. package/dist-cjs/lib/options.js.map +2 -2
  40. package/dist-cjs/lib/primitives/Box.js +3 -0
  41. package/dist-cjs/lib/primitives/Box.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/reparenting.js +2 -35
  49. package/dist-cjs/lib/utils/reparenting.js.map +3 -3
  50. package/dist-cjs/version.js +3 -3
  51. package/dist-cjs/version.js.map +1 -1
  52. package/dist-esm/index.d.mts +71 -101
  53. package/dist-esm/index.mjs +3 -5
  54. package/dist-esm/index.mjs.map +2 -2
  55. package/dist-esm/lib/TldrawEditor.mjs +6 -6
  56. package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
  57. package/dist-esm/lib/components/Shape.mjs +7 -10
  58. package/dist-esm/lib/components/Shape.mjs.map +2 -2
  59. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +4 -23
  60. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
  61. package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs +1 -1
  62. package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs.map +2 -2
  63. package/dist-esm/lib/config/TLUserPreferences.mjs +1 -1
  64. package/dist-esm/lib/config/TLUserPreferences.mjs.map +2 -2
  65. package/dist-esm/lib/editor/Editor.mjs +44 -112
  66. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  67. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs +4 -0
  68. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs.map +2 -2
  69. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +1 -1
  70. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
  71. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +23 -0
  72. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  73. package/dist-esm/lib/exports/getSvgJsx.mjs +34 -14
  74. package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
  75. package/dist-esm/lib/hooks/useCanvasEvents.mjs +7 -5
  76. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  77. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs +4 -1
  78. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +2 -2
  79. package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs +4 -1
  80. package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs.map +2 -2
  81. package/dist-esm/lib/license/LicenseManager.mjs +139 -51
  82. package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
  83. package/dist-esm/lib/license/LicenseProvider.mjs +39 -2
  84. package/dist-esm/lib/license/LicenseProvider.mjs.map +2 -2
  85. package/dist-esm/lib/license/Watermark.mjs +68 -6
  86. package/dist-esm/lib/license/Watermark.mjs.map +3 -3
  87. package/dist-esm/lib/license/useLicenseManagerState.mjs.map +2 -2
  88. package/dist-esm/lib/options.mjs +6 -0
  89. package/dist-esm/lib/options.mjs.map +2 -2
  90. package/dist-esm/lib/primitives/Box.mjs +4 -1
  91. package/dist-esm/lib/primitives/Box.mjs.map +2 -2
  92. package/dist-esm/lib/primitives/Vec.mjs +0 -4
  93. package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
  94. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +53 -21
  95. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  96. package/dist-esm/lib/primitives/geometry/Group2d.mjs +8 -1
  97. package/dist-esm/lib/primitives/geometry/Group2d.mjs.map +2 -2
  98. package/dist-esm/lib/utils/reparenting.mjs +3 -40
  99. package/dist-esm/lib/utils/reparenting.mjs.map +2 -2
  100. package/dist-esm/version.mjs +3 -3
  101. package/dist-esm/version.mjs.map +1 -1
  102. package/editor.css +16 -3
  103. package/package.json +14 -37
  104. package/src/index.ts +2 -9
  105. package/src/lib/TldrawEditor.tsx +7 -14
  106. package/src/lib/components/Shape.tsx +6 -12
  107. package/src/lib/components/default-components/DefaultCanvas.tsx +5 -22
  108. package/src/lib/components/default-components/DefaultErrorFallback.tsx +1 -1
  109. package/src/lib/config/TLUserPreferences.ts +1 -1
  110. package/src/lib/editor/Editor.test.ts +12 -11
  111. package/src/lib/editor/Editor.ts +53 -149
  112. package/src/lib/editor/derivations/notVisibleShapes.ts +6 -0
  113. package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +15 -14
  114. package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +16 -15
  115. package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +49 -48
  116. package/src/lib/editor/managers/FontManager/FontManager.test.ts +24 -23
  117. package/src/lib/editor/managers/HistoryManager/HistoryManager.test.ts +7 -6
  118. package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +12 -11
  119. package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +57 -50
  120. package/src/lib/editor/managers/TextManager/TextManager.test.ts +51 -26
  121. package/src/lib/editor/managers/TickManager/TickManager.test.ts +14 -13
  122. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +21 -26
  123. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +1 -1
  124. package/src/lib/editor/shapes/ShapeUtil.ts +46 -0
  125. package/src/lib/editor/types/misc-types.ts +0 -6
  126. package/src/lib/exports/getSvgJsx.test.ts +868 -0
  127. package/src/lib/exports/getSvgJsx.tsx +76 -19
  128. package/src/lib/hooks/useCanvasEvents.ts +6 -6
  129. package/src/lib/hooks/usePassThroughMouseOverEvents.ts +4 -1
  130. package/src/lib/hooks/usePassThroughWheelEvents.ts +6 -1
  131. package/src/lib/license/LicenseManager.test.ts +692 -383
  132. package/src/lib/license/LicenseManager.ts +197 -53
  133. package/src/lib/license/LicenseProvider.tsx +74 -2
  134. package/src/lib/license/Watermark.test.tsx +2 -1
  135. package/src/lib/license/Watermark.tsx +73 -6
  136. package/src/lib/license/useLicenseManagerState.ts +2 -2
  137. package/src/lib/options.ts +6 -0
  138. package/src/lib/primitives/Box.test.ts +126 -0
  139. package/src/lib/primitives/Box.ts +10 -1
  140. package/src/lib/primitives/Vec.ts +0 -5
  141. package/src/lib/primitives/geometry/Geometry2d.test.ts +420 -0
  142. package/src/lib/primitives/geometry/Geometry2d.ts +78 -21
  143. package/src/lib/primitives/geometry/Group2d.ts +10 -1
  144. package/src/lib/utils/reparenting.ts +3 -69
  145. package/src/lib/utils/sync/LocalIndexedDb.test.ts +2 -1
  146. package/src/lib/utils/sync/TLLocalSyncClient.test.ts +15 -15
  147. package/src/version.ts +3 -3
  148. package/dist-cjs/lib/utils/nearestMultiple.js +0 -34
  149. package/dist-cjs/lib/utils/nearestMultiple.js.map +0 -7
  150. package/dist-esm/lib/utils/nearestMultiple.mjs +0 -14
  151. package/dist-esm/lib/utils/nearestMultiple.mjs.map +0 -7
  152. package/src/lib/utils/nearestMultiple.ts +0 -13
@@ -510,6 +510,7 @@ export declare class Box {
510
510
  static ExpandBy(A: Box, n: number): Box;
511
511
  static Collides(A: Box, B: Box): boolean;
512
512
  static Contains(A: Box, B: Box): boolean;
513
+ static ContainsApproximately(A: Box, B: Box, precision?: number): boolean;
513
514
  static Includes(A: Box, B: Box): boolean;
514
515
  static ContainsPoint(A: Box, B: VecLike, margin?: number): boolean;
515
516
  static Common(boxes: Box[]): Box;
@@ -760,11 +761,6 @@ export declare class CubicSpline2d extends Geometry2d {
760
761
  /** @public */
761
762
  export declare function dataUrlToFile(url: string, filename: string, mimeType: string): Promise<File>;
762
763
 
763
- /**
764
- * @deprecated Licensing is now enabled in the tldraw SDK.
765
- * @public */
766
- export declare function debugEnableLicensing(): void;
767
-
768
764
  /* Excluded from this release type: DebugFlag */
769
765
 
770
766
  /* Excluded from this release type: DebugFlagDef */
@@ -890,6 +886,8 @@ export declare const defaultTldrawOptions: {
890
886
  readonly temporaryAssetPreviewLifetimeMs: 180000;
891
887
  readonly textShadowLod: 0.35;
892
888
  readonly tooltipDelayMs: 700;
889
+ readonly uiCoarseDragDistanceSquared: 625;
890
+ readonly uiDragDistanceSquared: 16;
893
891
  };
894
892
 
895
893
  /** @public */
@@ -981,7 +979,7 @@ export declare class EdgeScrollManager {
981
979
  /** @public */
982
980
  export declare class Editor extends EventEmitter<TLEventMap> {
983
981
  readonly id: string;
984
- constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options, isShapeHidden, getShapeVisibility, fontAssetUrls, }: TLEditorOptions);
982
+ constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options, getShapeVisibility, fontAssetUrls, }: TLEditorOptions);
985
983
  private readonly _getShapeVisibility?;
986
984
  private getIsShapeHiddenCache;
987
985
  isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
@@ -1048,22 +1046,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1048
1046
  * @public
1049
1047
  */
1050
1048
  readonly fonts: FontManager;
1051
- /**
1052
- * A manager for the editor's environment.
1053
- *
1054
- * @deprecated This is deprecated and will be removed in a future version. Use the `tlenv` global export instead.
1055
- * @public
1056
- */
1057
- readonly environment: {
1058
- hasCanvasSupport: boolean;
1059
- isAndroid: boolean;
1060
- isChromeForIos: boolean;
1061
- isDarwin: boolean;
1062
- isFirefox: boolean;
1063
- isIos: boolean;
1064
- isSafari: boolean;
1065
- isWebview: boolean;
1066
- };
1067
1049
  /**
1068
1050
  * A manager for the editor's scribbles.
1069
1051
  *
@@ -1206,22 +1188,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1206
1188
  * @public
1207
1189
  */
1208
1190
  getCanRedo(): boolean;
1209
- /**
1210
- * Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
1211
- * any redos.
1212
- *
1213
- * @example
1214
- * ```ts
1215
- * editor.mark()
1216
- * editor.mark('flip shapes')
1217
- * ```
1218
- *
1219
- * @param markId - The mark's id, usually the reason for adding the mark.
1220
- *
1221
- * @public
1222
- * @deprecated use {@link Editor.markHistoryStoppingPoint} instead
1223
- */
1224
- mark(markId?: string): this;
1225
1191
  /**
1226
1192
  * Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
1227
1193
  * any redos. You typically want to do this just before a user interaction begins or is handled.
@@ -1311,10 +1277,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1311
1277
  * @public
1312
1278
  */
1313
1279
  run(fn: () => void, opts?: TLEditorRunOptions): this;
1314
- /**
1315
- * @deprecated Use `Editor.run` instead.
1316
- */
1317
- batch(fn: () => void, opts?: TLEditorRunOptions): this;
1318
1280
  /* Excluded from this release type: annotateError */
1319
1281
  /* Excluded from this release type: createErrorAnnotations */
1320
1282
  /* Excluded from this release type: _crashingError */
@@ -1436,36 +1398,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1436
1398
  hasOpenMenus: () => boolean;
1437
1399
  isMenuOpen: (id: string) => boolean;
1438
1400
  };
1439
- /**
1440
- * @deprecated Use `editor.menus.getOpenMenus` instead.
1441
- *
1442
- * @public
1443
- */
1444
- getOpenMenus(): string[];
1445
- /**
1446
- * @deprecated Use `editor.menus.addOpenMenu` instead.
1447
- *
1448
- * @public
1449
- */
1450
- addOpenMenu(id: string): this;
1451
- /**
1452
- * @deprecated Use `editor.menus.deleteOpenMenu` instead.
1453
- *
1454
- * @public
1455
- */
1456
- deleteOpenMenu(id: string): this;
1457
- /**
1458
- * @deprecated Use `editor.menus.clearOpenMenus` instead.
1459
- *
1460
- * @public
1461
- */
1462
- clearOpenMenus(): this;
1463
- /**
1464
- * @deprecated Use `editor.menus.hasAnyOpenMenus` instead.
1465
- *
1466
- * @public
1467
- */
1468
- getIsMenuOpen(): boolean;
1469
1401
  /**
1470
1402
  * Set the cursor.
1471
1403
  *
@@ -2914,8 +2846,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2914
2846
  * @public
2915
2847
  */
2916
2848
  getShapeAndDescendantIds(ids: TLShapeId[]): Set<TLShapeId>;
2917
- /** @deprecated Use {@link Editor.getDraggingOverShape} instead */
2918
- getDroppingOverShape(point: Vec, droppingShapes: TLShape[]): TLShape | undefined;
2919
2849
  /**
2920
2850
  * Get the shape that some shapes should be dropped on at a given point.
2921
2851
  *
@@ -3690,8 +3620,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3690
3620
  svg: string;
3691
3621
  width: number;
3692
3622
  } | undefined>;
3693
- /** @deprecated Use {@link Editor.getSvgString} or {@link Editor.getSvgElement} instead. */
3694
- getSvg(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<SVGSVGElement | undefined>;
3695
3623
  /**
3696
3624
  * Get an exported image of the given shapes.
3697
3625
  *
@@ -3706,6 +3634,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3706
3634
  height: number;
3707
3635
  width: number;
3708
3636
  }>;
3637
+ /**
3638
+ * Get an exported image of the given shapes as a data URL.
3639
+ *
3640
+ * @param shapes - The shapes (or shape ids) to export.
3641
+ * @param opts - Options for the export.
3642
+ *
3643
+ * @returns A data URL of the image.
3644
+ * @public
3645
+ */
3646
+ toImageDataUrl(shapes: TLShape[] | TLShapeId[], opts?: TLImageExportOptions): Promise<{
3647
+ height: number;
3648
+ url: string;
3649
+ width: number;
3650
+ }>;
3709
3651
  /**
3710
3652
  * The app's current input state.
3711
3653
  *
@@ -4147,6 +4089,7 @@ export declare abstract class Geometry2d {
4147
4089
  isLabel: boolean;
4148
4090
  isEmptyLabel: boolean;
4149
4091
  isInternal: boolean;
4092
+ excludeFromShapeBounds: boolean;
4150
4093
  debugColor?: string;
4151
4094
  ignore?: boolean;
4152
4095
  constructor(opts: Geometry2dOptions);
@@ -4170,12 +4113,14 @@ export declare abstract class Geometry2d {
4170
4113
  * along the edge it is as a fraction of the total length.
4171
4114
  */
4172
4115
  uninterpolateAlongEdge(point: VecLike, _filters?: Geometry2dFilters): number;
4173
- /** @deprecated Iterate the vertices instead. */
4174
- nearestPointOnLineSegment(A: VecLike, B: VecLike): Vec;
4175
4116
  isPointInBounds(point: VecLike, margin?: number): boolean;
4117
+ overlapsPolygon(_polygon: VecLike[]): boolean;
4176
4118
  transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
4177
4119
  private _vertices;
4178
4120
  get vertices(): Vec[];
4121
+ getBoundsVertices(): Vec[];
4122
+ private _boundsVertices;
4123
+ get boundsVertices(): Vec[];
4179
4124
  getBounds(): Box;
4180
4125
  private _bounds;
4181
4126
  get bounds(): Box;
@@ -4372,6 +4317,7 @@ export declare class Group2d extends Geometry2d {
4372
4317
  hitTestLineSegment(A: VecLike, B: VecLike, zoom: number, filters?: Geometry2dFilters): boolean;
4373
4318
  intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
4374
4319
  intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
4320
+ getBoundsVertices(): Vec[];
4375
4321
  intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
4376
4322
  intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
4377
4323
  interpolateAlongEdge(t: number, filters?: Geometry2dFilters): Vec;
@@ -4381,6 +4327,7 @@ export declare class Group2d extends Geometry2d {
4381
4327
  toSimpleSvgPath(): string;
4382
4328
  getLength(filters?: Geometry2dFilters): number;
4383
4329
  getSvgPathData(): string;
4330
+ overlapsPolygon(polygon: VecLike[]): boolean;
4384
4331
  }
4385
4332
 
4386
4333
  /** @public */
@@ -4621,12 +4568,16 @@ export declare function kickoutOccludedShapes(editor: Editor, shapeIds: TLShapeI
4621
4568
  filter?(parent: TLShape): boolean;
4622
4569
  }): void;
4623
4570
 
4571
+ /* Excluded from this release type: LICENSE_TIMEOUT */
4572
+
4624
4573
  /* Excluded from this release type: LicenseFromKeyResult */
4625
4574
 
4626
4575
  /* Excluded from this release type: LicenseInfo */
4627
4576
 
4628
4577
  /* Excluded from this release type: LicenseManager */
4629
4578
 
4579
+ /* Excluded from this release type: LicenseState */
4580
+
4630
4581
  /** @public */
4631
4582
  export declare function linesIntersect(A: VecLike, B: VecLike, C: VecLike, D: VecLike): boolean;
4632
4583
 
@@ -5232,7 +5183,34 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5232
5183
  * @public
5233
5184
  */
5234
5185
  canBeLaidOut(_shape: Shape, _info: TLShapeUtilCanBeLaidOutOpts): boolean;
5186
+ /**
5187
+ * Whether this shape can be culled. By default, shapes are culled for
5188
+ * performance reasons when they are outside of the viewport. Culled shapes are still rendered
5189
+ * to the DOM, but have their `display` property set to `none`.
5190
+ *
5191
+ * @param shape - The shape.
5192
+ */
5193
+ canCull(_shape: Shape): boolean;
5235
5194
  /* Excluded from this release type: providesBackgroundForChildren */
5195
+ /**
5196
+ * Get the clip path to apply to this shape's children.
5197
+ *
5198
+ * @param shape - The shape to get the clip path for
5199
+ * @returns Array of points defining the clipping polygon in local coordinates, or undefined if no clipping
5200
+ * @public
5201
+ */
5202
+ getClipPath?(shape: Shape): undefined | Vec[];
5203
+ /**
5204
+ * Whether a specific child shape should be clipped by this shape.
5205
+ * Only called if getClipPath returns a valid polygon.
5206
+ *
5207
+ * If not defined, the default behavior is to clip all children.
5208
+ *
5209
+ * @param child - The child shape to check
5210
+ * @returns boolean indicating if this child should be clipped
5211
+ * @public
5212
+ */
5213
+ shouldClipChild?(child: TLShape): boolean;
5236
5214
  /**
5237
5215
  * Whether the shape should hide its resize handles when selected.
5238
5216
  *
@@ -5263,6 +5241,17 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5263
5241
  * @public
5264
5242
  */
5265
5243
  isAspectRatioLocked(_shape: Shape): boolean;
5244
+ /**
5245
+ * By default, the bounds of an image export are the bounds of all the shapes it contains, plus
5246
+ * some padding. If an export includes a shape where `isExportBoundsContainer` is true, then the
5247
+ * padding is skipped _if the bounds of that shape contains all the other shapes_. This is
5248
+ * useful in cases like annotating on top of an image, where you usually want to avoid extra
5249
+ * padding around the image if you don't need it.
5250
+ *
5251
+ * @param _shape - The shape to check
5252
+ * @returns True if this shape should be treated as an export bounds container
5253
+ */
5254
+ isExportBoundsContainer(_shape: Shape): boolean;
5266
5255
  /* Excluded from this release type: backgroundComponent */
5267
5256
  /**
5268
5257
  * Get the interpolated props for an animating shape. This is an optional method.
@@ -6309,12 +6298,6 @@ export declare interface TldrawEditorBaseProps {
6309
6298
  * Options for syncing the editor's camera state with the URL.
6310
6299
  */
6311
6300
  deepLinks?: TLDeepLinkOptions | true;
6312
- /**
6313
- * Predicate for whether or not a shape should be hidden.
6314
- *
6315
- * @deprecated Use {@link TldrawEditorBaseProps#getShapeVisibility} instead.
6316
- */
6317
- isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6318
6301
  /**
6319
6302
  * Provides a way to hide shapes.
6320
6303
  *
@@ -6422,6 +6405,8 @@ export declare interface TldrawOptions {
6422
6405
  readonly multiClickDurationMs: number;
6423
6406
  readonly coarseDragDistanceSquared: number;
6424
6407
  readonly dragDistanceSquared: number;
6408
+ readonly uiDragDistanceSquared: number;
6409
+ readonly uiCoarseDragDistanceSquared: number;
6425
6410
  readonly defaultSvgPadding: number;
6426
6411
  readonly cameraSlideFriction: number;
6427
6412
  readonly gridSteps: readonly {
@@ -6574,15 +6559,6 @@ export declare interface TLEditorOptions {
6574
6559
  fontAssetUrls?: {
6575
6560
  [key: string]: string | undefined;
6576
6561
  };
6577
- /**
6578
- * A predicate that should return true if the given shape should be hidden.
6579
- *
6580
- * @deprecated Use {@link Editor#getShapeVisibility} instead.
6581
- *
6582
- * @param shape - The shape to check.
6583
- * @param editor - The editor instance.
6584
- */
6585
- isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6586
6562
  /**
6587
6563
  * Provides a way to hide shapes.
6588
6564
  *
@@ -7573,12 +7549,6 @@ export declare interface TLSvgExportOptions {
7573
7549
  preserveAspectRatio?: React.SVGAttributes<SVGSVGElement>['preserveAspectRatio'];
7574
7550
  }
7575
7551
 
7576
- /**
7577
- * @public
7578
- * @deprecated use {@link TLImageExportOptions} instead
7579
- */
7580
- export declare type TLSvgOptions = TLImageExportOptions;
7581
-
7582
7552
  /** @public */
7583
7553
  export declare interface TLSvgTextExternalContent extends TLBaseExternalContent {
7584
7554
  type: 'svg-text';
@@ -7732,6 +7702,7 @@ export declare class TransformedGeometry2d extends Geometry2d {
7732
7702
  private readonly decomposed;
7733
7703
  constructor(geometry: Geometry2d, matrix: MatModel, opts?: TransformedGeometry2dOptions);
7734
7704
  getVertices(filters: Geometry2dFilters): Vec[];
7705
+ getBoundsVertices(): Vec[];
7735
7706
  nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;
7736
7707
  hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean;
7737
7708
  distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
@@ -7752,6 +7723,7 @@ export declare interface TransformedGeometry2dOptions {
7752
7723
  isInternal?: boolean;
7753
7724
  debugColor?: string;
7754
7725
  ignore?: boolean;
7726
+ excludeFromShapeBounds?: boolean;
7755
7727
  }
7756
7728
 
7757
7729
  /** @public */
@@ -7986,8 +7958,6 @@ export declare class Vec {
7986
7958
  lrp(B: VecLike, t: number): Vec;
7987
7959
  equals(B: VecLike): boolean;
7988
7960
  equalsXY(x: number, y: number): boolean;
7989
- /** @deprecated use `uni` instead */
7990
- norm(): this;
7991
7961
  toFixed(): this;
7992
7962
  toString(): string;
7993
7963
  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-canary.e9c30b532b82",
372
+ "3.16.0-canary.ea008b31887f",
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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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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AAA,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;A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iD;AACjD,0BAA6B;AAC7B,+BAAkC;AAClC,4BASO;AACP,6BAAgC;AAChC,qBAAyD;AACzD,iBASO;AACP,qBAAwB;AACxB,mBAAsB;AACtB,sBAAyB;AACzB,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAAuB;AACvB,uBAA0B;AAC1B,gCAA6C;AAC7C,wBAMO;AACP,qBAAwB;AACxB,qBAAwB;AACxB,uBAA0B;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;AAAA,IAE3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": ["import_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");
@@ -189,8 +189,6 @@ function TldrawEditorWithReadyStore({
189
189
  options,
190
190
  licenseKey,
191
191
  deepLinks: _deepLinks,
192
- // eslint-disable-next-line @typescript-eslint/no-deprecated
193
- isShapeHidden,
194
192
  getShapeVisibility,
195
193
  assetUrls
196
194
  }) {
@@ -235,7 +233,6 @@ function TldrawEditorWithReadyStore({
235
233
  textOptions,
236
234
  options,
237
235
  licenseKey,
238
- isShapeHidden,
239
236
  getShapeVisibility,
240
237
  fontAssetUrls: assetUrls?.fonts
241
238
  });
@@ -263,7 +260,6 @@ function TldrawEditorWithReadyStore({
263
260
  user,
264
261
  setEditor,
265
262
  licenseKey,
266
- isShapeHidden,
267
263
  getShapeVisibility,
268
264
  textOptions,
269
265
  assetUrls
@@ -321,8 +317,12 @@ function TldrawEditorWithReadyStore({
321
317
  if (editor !== fontLoadingState?.editor) {
322
318
  fontLoadingState = null;
323
319
  }
324
- (0, import_react.useEffect)(() => {
320
+ (0, import_react.useLayoutEffect)(() => {
325
321
  if (!editor) return;
322
+ if (editor.options.maxFontsToLoadBeforeRender === 0) {
323
+ setFontLoadingState({ editor, isLoaded: true });
324
+ return;
325
+ }
326
326
  let isCancelled = false;
327
327
  setFontLoadingState({ editor, isLoaded: false });
328
328
  editor.fonts.loadRequiredFontsForCurrentPage(editor.options.maxFontsToLoadBeforeRender).finally(() => {