@tldraw/editor 3.16.0-next.f9f54ec051f3 → 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 (221) hide show
  1. package/dist-cjs/index.d.ts +197 -114
  2. package/dist-cjs/index.js +5 -5
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/TldrawEditor.js +9 -9
  5. package/dist-cjs/lib/TldrawEditor.js.map +2 -2
  6. package/dist-cjs/lib/components/MenuClickCapture.js +0 -5
  7. package/dist-cjs/lib/components/MenuClickCapture.js.map +2 -2
  8. package/dist-cjs/lib/components/Shape.js +7 -10
  9. package/dist-cjs/lib/components/Shape.js.map +2 -2
  10. package/dist-cjs/lib/components/default-components/DefaultCanvas.js +14 -23
  11. package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
  12. package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js +1 -1
  13. package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js.map +1 -1
  14. package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js +1 -1
  15. package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js.map +2 -2
  16. package/dist-cjs/lib/components/default-components/DefaultScribble.js +1 -1
  17. package/dist-cjs/lib/components/default-components/DefaultScribble.js.map +2 -2
  18. package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js +9 -1
  19. package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js.map +2 -2
  20. package/dist-cjs/lib/config/TLUserPreferences.js +21 -4
  21. package/dist-cjs/lib/config/TLUserPreferences.js.map +2 -2
  22. package/dist-cjs/lib/editor/Editor.js +121 -138
  23. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  24. package/dist-cjs/lib/editor/derivations/notVisibleShapes.js +4 -0
  25. package/dist-cjs/lib/editor/derivations/notVisibleShapes.js.map +2 -2
  26. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js +4 -2
  27. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +2 -2
  28. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +14 -4
  29. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
  30. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +23 -0
  31. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  32. package/dist-cjs/lib/editor/types/misc-types.js.map +1 -1
  33. package/dist-cjs/lib/exports/getSvgJsx.js +35 -16
  34. package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
  35. package/dist-cjs/lib/hooks/useCanvasEvents.js +47 -38
  36. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  37. package/dist-cjs/lib/hooks/useDocumentEvents.js +5 -5
  38. package/dist-cjs/lib/hooks/useDocumentEvents.js.map +2 -2
  39. package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js +1 -2
  40. package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js.map +2 -2
  41. package/dist-cjs/lib/hooks/useGestureEvents.js +1 -1
  42. package/dist-cjs/lib/hooks/useGestureEvents.js.map +2 -2
  43. package/dist-cjs/lib/hooks/useHandleEvents.js +6 -6
  44. package/dist-cjs/lib/hooks/useHandleEvents.js.map +2 -2
  45. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js +4 -1
  46. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +2 -2
  47. package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js +4 -1
  48. package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js.map +2 -2
  49. package/dist-cjs/lib/hooks/useSelectionEvents.js +8 -8
  50. package/dist-cjs/lib/hooks/useSelectionEvents.js.map +2 -2
  51. package/dist-cjs/lib/{utils/nearestMultiple.js → hooks/useStateAttribute.js} +15 -14
  52. package/dist-cjs/lib/hooks/useStateAttribute.js.map +7 -0
  53. package/dist-cjs/lib/license/LicenseManager.js +143 -53
  54. package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
  55. package/dist-cjs/lib/license/LicenseProvider.js +39 -1
  56. package/dist-cjs/lib/license/LicenseProvider.js.map +2 -2
  57. package/dist-cjs/lib/license/Watermark.js +144 -75
  58. package/dist-cjs/lib/license/Watermark.js.map +3 -3
  59. package/dist-cjs/lib/license/useLicenseManagerState.js.map +2 -2
  60. package/dist-cjs/lib/options.js +7 -0
  61. package/dist-cjs/lib/options.js.map +2 -2
  62. package/dist-cjs/lib/primitives/Box.js +3 -0
  63. package/dist-cjs/lib/primitives/Box.js.map +2 -2
  64. package/dist-cjs/lib/primitives/Vec.js +0 -4
  65. package/dist-cjs/lib/primitives/Vec.js.map +2 -2
  66. package/dist-cjs/lib/primitives/geometry/Geometry2d.js +50 -20
  67. package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
  68. package/dist-cjs/lib/primitives/geometry/Group2d.js +8 -1
  69. package/dist-cjs/lib/primitives/geometry/Group2d.js.map +2 -2
  70. package/dist-cjs/lib/utils/EditorAtom.js +45 -0
  71. package/dist-cjs/lib/utils/EditorAtom.js.map +7 -0
  72. package/dist-cjs/lib/utils/dom.js.map +2 -2
  73. package/dist-cjs/lib/utils/getPointerInfo.js +2 -3
  74. package/dist-cjs/lib/utils/getPointerInfo.js.map +2 -2
  75. package/dist-cjs/lib/utils/reparenting.js +7 -36
  76. package/dist-cjs/lib/utils/reparenting.js.map +3 -3
  77. package/dist-cjs/version.js +4 -4
  78. package/dist-cjs/version.js.map +1 -1
  79. package/dist-esm/index.d.mts +197 -114
  80. package/dist-esm/index.mjs +5 -5
  81. package/dist-esm/index.mjs.map +2 -2
  82. package/dist-esm/lib/TldrawEditor.mjs +9 -9
  83. package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
  84. package/dist-esm/lib/components/MenuClickCapture.mjs +0 -5
  85. package/dist-esm/lib/components/MenuClickCapture.mjs.map +2 -2
  86. package/dist-esm/lib/components/Shape.mjs +7 -10
  87. package/dist-esm/lib/components/Shape.mjs.map +2 -2
  88. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +14 -23
  89. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
  90. package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs +1 -1
  91. package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs.map +1 -1
  92. package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs +1 -1
  93. package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs.map +2 -2
  94. package/dist-esm/lib/components/default-components/DefaultScribble.mjs +1 -1
  95. package/dist-esm/lib/components/default-components/DefaultScribble.mjs.map +2 -2
  96. package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs +9 -1
  97. package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs.map +2 -2
  98. package/dist-esm/lib/config/TLUserPreferences.mjs +21 -4
  99. package/dist-esm/lib/config/TLUserPreferences.mjs.map +2 -2
  100. package/dist-esm/lib/editor/Editor.mjs +121 -138
  101. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  102. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs +4 -0
  103. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs.map +2 -2
  104. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs +4 -2
  105. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +2 -2
  106. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +14 -4
  107. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
  108. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +23 -0
  109. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  110. package/dist-esm/lib/exports/getSvgJsx.mjs +36 -16
  111. package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
  112. package/dist-esm/lib/hooks/useCanvasEvents.mjs +49 -45
  113. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  114. package/dist-esm/lib/hooks/useDocumentEvents.mjs +6 -6
  115. package/dist-esm/lib/hooks/useDocumentEvents.mjs.map +2 -2
  116. package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs +1 -2
  117. package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs.map +2 -2
  118. package/dist-esm/lib/hooks/useGestureEvents.mjs +2 -2
  119. package/dist-esm/lib/hooks/useGestureEvents.mjs.map +2 -2
  120. package/dist-esm/lib/hooks/useHandleEvents.mjs +6 -6
  121. package/dist-esm/lib/hooks/useHandleEvents.mjs.map +2 -2
  122. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs +4 -1
  123. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +2 -2
  124. package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs +4 -1
  125. package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs.map +2 -2
  126. package/dist-esm/lib/hooks/useSelectionEvents.mjs +9 -14
  127. package/dist-esm/lib/hooks/useSelectionEvents.mjs.map +2 -2
  128. package/dist-esm/lib/hooks/useStateAttribute.mjs +15 -0
  129. package/dist-esm/lib/hooks/useStateAttribute.mjs.map +7 -0
  130. package/dist-esm/lib/license/LicenseManager.mjs +144 -54
  131. package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
  132. package/dist-esm/lib/license/LicenseProvider.mjs +39 -2
  133. package/dist-esm/lib/license/LicenseProvider.mjs.map +2 -2
  134. package/dist-esm/lib/license/Watermark.mjs +145 -76
  135. package/dist-esm/lib/license/Watermark.mjs.map +3 -3
  136. package/dist-esm/lib/license/useLicenseManagerState.mjs.map +2 -2
  137. package/dist-esm/lib/options.mjs +7 -0
  138. package/dist-esm/lib/options.mjs.map +2 -2
  139. package/dist-esm/lib/primitives/Box.mjs +4 -1
  140. package/dist-esm/lib/primitives/Box.mjs.map +2 -2
  141. package/dist-esm/lib/primitives/Vec.mjs +0 -4
  142. package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
  143. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +53 -21
  144. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  145. package/dist-esm/lib/primitives/geometry/Group2d.mjs +8 -1
  146. package/dist-esm/lib/primitives/geometry/Group2d.mjs.map +2 -2
  147. package/dist-esm/lib/utils/EditorAtom.mjs +25 -0
  148. package/dist-esm/lib/utils/EditorAtom.mjs.map +7 -0
  149. package/dist-esm/lib/utils/dom.mjs.map +2 -2
  150. package/dist-esm/lib/utils/getPointerInfo.mjs +2 -3
  151. package/dist-esm/lib/utils/getPointerInfo.mjs.map +2 -2
  152. package/dist-esm/lib/utils/reparenting.mjs +8 -41
  153. package/dist-esm/lib/utils/reparenting.mjs.map +2 -2
  154. package/dist-esm/version.mjs +4 -4
  155. package/dist-esm/version.mjs.map +1 -1
  156. package/editor.css +308 -290
  157. package/package.json +14 -37
  158. package/src/index.ts +4 -9
  159. package/src/lib/TldrawEditor.tsx +14 -21
  160. package/src/lib/components/MenuClickCapture.tsx +0 -8
  161. package/src/lib/components/Shape.tsx +6 -12
  162. package/src/lib/components/default-components/DefaultCanvas.tsx +11 -22
  163. package/src/lib/components/default-components/DefaultCollaboratorHint.tsx +1 -1
  164. package/src/lib/components/default-components/DefaultErrorFallback.tsx +1 -1
  165. package/src/lib/components/default-components/DefaultScribble.tsx +1 -1
  166. package/src/lib/components/default-components/DefaultShapeIndicator.tsx +5 -1
  167. package/src/lib/config/TLUserPreferences.ts +21 -1
  168. package/src/lib/editor/Editor.test.ts +102 -11
  169. package/src/lib/editor/Editor.ts +165 -198
  170. package/src/lib/editor/derivations/notVisibleShapes.ts +6 -0
  171. package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +15 -14
  172. package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +16 -15
  173. package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +49 -48
  174. package/src/lib/editor/managers/FocusManager/FocusManager.ts +6 -2
  175. package/src/lib/editor/managers/FontManager/FontManager.test.ts +24 -23
  176. package/src/lib/editor/managers/HistoryManager/HistoryManager.test.ts +7 -6
  177. package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +12 -11
  178. package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +57 -50
  179. package/src/lib/editor/managers/TextManager/TextManager.test.ts +51 -26
  180. package/src/lib/editor/managers/TickManager/TickManager.test.ts +14 -13
  181. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +56 -26
  182. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +13 -1
  183. package/src/lib/editor/shapes/ShapeUtil.ts +46 -0
  184. package/src/lib/editor/types/misc-types.ts +54 -7
  185. package/src/lib/exports/getSvgJsx.test.ts +868 -0
  186. package/src/lib/exports/getSvgJsx.tsx +78 -21
  187. package/src/lib/hooks/useCanvasEvents.ts +62 -55
  188. package/src/lib/hooks/useDocumentEvents.ts +6 -6
  189. package/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +1 -1
  190. package/src/lib/hooks/useGestureEvents.ts +2 -2
  191. package/src/lib/hooks/useHandleEvents.ts +6 -6
  192. package/src/lib/hooks/usePassThroughMouseOverEvents.ts +4 -1
  193. package/src/lib/hooks/usePassThroughWheelEvents.ts +6 -1
  194. package/src/lib/hooks/useSelectionEvents.ts +9 -14
  195. package/src/lib/hooks/useStateAttribute.ts +15 -0
  196. package/src/lib/license/LicenseManager.test.ts +724 -383
  197. package/src/lib/license/LicenseManager.ts +204 -58
  198. package/src/lib/license/LicenseProvider.tsx +74 -2
  199. package/src/lib/license/Watermark.test.tsx +2 -1
  200. package/src/lib/license/Watermark.tsx +152 -77
  201. package/src/lib/license/useLicenseManagerState.ts +2 -2
  202. package/src/lib/options.ts +8 -0
  203. package/src/lib/primitives/Box.test.ts +126 -0
  204. package/src/lib/primitives/Box.ts +10 -1
  205. package/src/lib/primitives/Vec.ts +0 -5
  206. package/src/lib/primitives/geometry/Geometry2d.test.ts +420 -0
  207. package/src/lib/primitives/geometry/Geometry2d.ts +78 -21
  208. package/src/lib/primitives/geometry/Group2d.ts +10 -1
  209. package/src/lib/test/InFrontOfTheCanvas.test.tsx +187 -0
  210. package/src/lib/utils/EditorAtom.ts +37 -0
  211. package/src/lib/utils/dom.test.ts +103 -0
  212. package/src/lib/utils/dom.ts +8 -1
  213. package/src/lib/utils/getPointerInfo.ts +3 -2
  214. package/src/lib/utils/reparenting.ts +10 -70
  215. package/src/lib/utils/sync/LocalIndexedDb.test.ts +2 -1
  216. package/src/lib/utils/sync/TLLocalSyncClient.test.ts +15 -15
  217. package/src/version.ts +4 -4
  218. package/dist-cjs/lib/utils/nearestMultiple.js.map +0 -7
  219. package/dist-esm/lib/utils/nearestMultiple.mjs +0 -14
  220. package/dist-esm/lib/utils/nearestMultiple.mjs.map +0 -7
  221. 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 */
@@ -889,6 +885,9 @@ export declare const defaultTldrawOptions: {
889
885
  readonly nonce: undefined;
890
886
  readonly temporaryAssetPreviewLifetimeMs: 180000;
891
887
  readonly textShadowLod: 0.35;
888
+ readonly tooltipDelayMs: 700;
889
+ readonly uiCoarseDragDistanceSquared: 625;
890
+ readonly uiDragDistanceSquared: 16;
892
891
  };
893
892
 
894
893
  /** @public */
@@ -898,6 +897,8 @@ export declare const defaultUserPreferences: Readonly<{
898
897
  color: "#02B1CC" | "#11B3A3" | "#39B178" | "#55B467" | "#7B66DC" | "#9D5BD2" | "#BD54C6" | "#E34BA9" | "#EC5E41" | "#F04F88" | "#F2555A" | "#FF802B";
899
898
  colorScheme: "light";
900
899
  edgeScrollSpeed: 1;
900
+ enhancedA11yMode: false;
901
+ inputMode: null;
901
902
  isDynamicSizeMode: false;
902
903
  isPasteAtCursorMode: false;
903
904
  isSnapMode: false;
@@ -979,7 +980,7 @@ export declare class EdgeScrollManager {
979
980
  /** @public */
980
981
  export declare class Editor extends EventEmitter<TLEventMap> {
981
982
  readonly id: string;
982
- 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);
983
984
  private readonly _getShapeVisibility?;
984
985
  private getIsShapeHiddenCache;
985
986
  isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
@@ -1046,22 +1047,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1046
1047
  * @public
1047
1048
  */
1048
1049
  readonly fonts: FontManager;
1049
- /**
1050
- * A manager for the editor's environment.
1051
- *
1052
- * @deprecated This is deprecated and will be removed in a future version. Use the `tlenv` global export instead.
1053
- * @public
1054
- */
1055
- readonly environment: {
1056
- hasCanvasSupport: boolean;
1057
- isAndroid: boolean;
1058
- isChromeForIos: boolean;
1059
- isDarwin: boolean;
1060
- isFirefox: boolean;
1061
- isIos: boolean;
1062
- isSafari: boolean;
1063
- isWebview: boolean;
1064
- };
1065
1050
  /**
1066
1051
  * A manager for the editor's scribbles.
1067
1052
  *
@@ -1204,22 +1189,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1204
1189
  * @public
1205
1190
  */
1206
1191
  getCanRedo(): boolean;
1207
- /**
1208
- * Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
1209
- * any redos.
1210
- *
1211
- * @example
1212
- * ```ts
1213
- * editor.mark()
1214
- * editor.mark('flip shapes')
1215
- * ```
1216
- *
1217
- * @param markId - The mark's id, usually the reason for adding the mark.
1218
- *
1219
- * @public
1220
- * @deprecated use {@link Editor.markHistoryStoppingPoint} instead
1221
- */
1222
- mark(markId?: string): this;
1223
1192
  /**
1224
1193
  * Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
1225
1194
  * any redos. You typically want to do this just before a user interaction begins or is handled.
@@ -1309,10 +1278,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1309
1278
  * @public
1310
1279
  */
1311
1280
  run(fn: () => void, opts?: TLEditorRunOptions): this;
1312
- /**
1313
- * @deprecated Use `Editor.run` instead.
1314
- */
1315
- batch(fn: () => void, opts?: TLEditorRunOptions): this;
1316
1281
  /* Excluded from this release type: annotateError */
1317
1282
  /* Excluded from this release type: createErrorAnnotations */
1318
1283
  /* Excluded from this release type: _crashingError */
@@ -1434,36 +1399,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1434
1399
  hasOpenMenus: () => boolean;
1435
1400
  isMenuOpen: (id: string) => boolean;
1436
1401
  };
1437
- /**
1438
- * @deprecated Use `editor.menus.getOpenMenus` instead.
1439
- *
1440
- * @public
1441
- */
1442
- getOpenMenus(): string[];
1443
- /**
1444
- * @deprecated Use `editor.menus.addOpenMenu` instead.
1445
- *
1446
- * @public
1447
- */
1448
- addOpenMenu(id: string): this;
1449
- /**
1450
- * @deprecated Use `editor.menus.deleteOpenMenu` instead.
1451
- *
1452
- * @public
1453
- */
1454
- deleteOpenMenu(id: string): this;
1455
- /**
1456
- * @deprecated Use `editor.menus.clearOpenMenus` instead.
1457
- *
1458
- * @public
1459
- */
1460
- clearOpenMenus(): this;
1461
- /**
1462
- * @deprecated Use `editor.menus.hasAnyOpenMenus` instead.
1463
- *
1464
- * @public
1465
- */
1466
- getIsMenuOpen(): boolean;
1467
1402
  /**
1468
1403
  * Set the cursor.
1469
1404
  *
@@ -2690,15 +2625,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2690
2625
  *
2691
2626
  * @returns The shape at the given point, or undefined if there is no shape at the point.
2692
2627
  */
2693
- getShapeAtPoint(point: VecLike, opts?: {
2694
- filter?(shape: TLShape): boolean;
2695
- hitFrameInside?: boolean;
2696
- hitInside?: boolean;
2697
- hitLabels?: boolean;
2698
- hitLocked?: boolean;
2699
- margin?: number;
2700
- renderingOnly?: boolean;
2701
- }): TLShape | undefined;
2628
+ getShapeAtPoint(point: VecLike, opts?: TLGetShapeAtPointOptions): TLShape | undefined;
2702
2629
  /**
2703
2630
  * Get the shapes, if any, at a given page point.
2704
2631
  *
@@ -2920,8 +2847,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2920
2847
  * @public
2921
2848
  */
2922
2849
  getShapeAndDescendantIds(ids: TLShapeId[]): Set<TLShapeId>;
2923
- /** @deprecated Use {@link Editor.getDraggingOverShape} instead */
2924
- getDroppingOverShape(point: Vec, droppingShapes: TLShape[]): TLShape | undefined;
2925
2850
  /**
2926
2851
  * Get the shape that some shapes should be dropped on at a given point.
2927
2852
  *
@@ -3633,14 +3558,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3633
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.
3634
3559
  *
3635
3560
  * @param info - Info about the external content.
3561
+ * @param opts - Options for handling external content, including force flag to bypass readonly checks.
3636
3562
  */
3637
- putExternalContent<E>(info: TLExternalContent<E>): Promise<void>;
3563
+ putExternalContent<E>(info: TLExternalContent<E>, opts?: {
3564
+ force?: boolean;
3565
+ }): Promise<void>;
3638
3566
  /**
3639
3567
  * Handle replacing external content.
3640
3568
  *
3641
3569
  * @param info - Info about the external content.
3570
+ * @param opts - Options for handling external content, including force flag to bypass readonly checks.
3642
3571
  */
3643
- replaceExternalContent<E>(info: TLExternalContent<E>): Promise<void>;
3572
+ replaceExternalContent<E>(info: TLExternalContent<E>, opts?: {
3573
+ force?: boolean;
3574
+ }): Promise<void>;
3644
3575
  /**
3645
3576
  * Get content that can be exported for the given shape ids.
3646
3577
  *
@@ -3696,8 +3627,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3696
3627
  svg: string;
3697
3628
  width: number;
3698
3629
  } | undefined>;
3699
- /** @deprecated Use {@link Editor.getSvgString} or {@link Editor.getSvgElement} instead. */
3700
- getSvg(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<SVGSVGElement | undefined>;
3701
3630
  /**
3702
3631
  * Get an exported image of the given shapes.
3703
3632
  *
@@ -3712,6 +3641,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3712
3641
  height: number;
3713
3642
  width: number;
3714
3643
  }>;
3644
+ /**
3645
+ * Get an exported image of the given shapes as a data URL.
3646
+ *
3647
+ * @param shapes - The shapes (or shape ids) to export.
3648
+ * @param opts - Options for the export.
3649
+ *
3650
+ * @returns A data URL of the image.
3651
+ * @public
3652
+ */
3653
+ toImageDataUrl(shapes: TLShape[] | TLShapeId[], opts?: TLImageExportOptions): Promise<{
3654
+ height: number;
3655
+ url: string;
3656
+ width: number;
3657
+ }>;
3715
3658
  /**
3716
3659
  * The app's current input state.
3717
3660
  *
@@ -4017,6 +3960,31 @@ export declare class Editor extends EventEmitter<TLEventMap> {
4017
3960
  /* Excluded from this release type: capturedPointerId */
4018
3961
  /* Excluded from this release type: performanceTracker */
4019
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;
4020
3988
  /**
4021
3989
  * Dispatch an event to the editor.
4022
3990
  *
@@ -4036,6 +4004,26 @@ export declare class Editor extends EventEmitter<TLEventMap> {
4036
4004
  /* Excluded from this release type: maybeTrackPerformance */
4037
4005
  }
4038
4006
 
4007
+ /**
4008
+ * An Atom that is scoped to the lifetime of an Editor.
4009
+ *
4010
+ * This is useful for storing UI state for tldraw applications. Keeping state scoped to an editor
4011
+ * instead of stored in a global atom can prevent issues with state being shared between editors
4012
+ * when navigating between pages, or when multiple editor instances are used on the same page.
4013
+ *
4014
+ * @public
4015
+ */
4016
+ export declare class EditorAtom<T> {
4017
+ private name;
4018
+ private getInitialState;
4019
+ private states;
4020
+ constructor(name: string, getInitialState: (editor: Editor) => T);
4021
+ getAtom(editor: Editor): Atom<T>;
4022
+ get(editor: Editor): T;
4023
+ update(editor: Editor, update: (state: T) => T): T;
4024
+ set(editor: Editor, state: T): T;
4025
+ }
4026
+
4039
4027
  /** @public */
4040
4028
  export declare const EditorContext: React_3.Context<Editor | null>;
4041
4029
 
@@ -4133,6 +4121,7 @@ export declare abstract class Geometry2d {
4133
4121
  isLabel: boolean;
4134
4122
  isEmptyLabel: boolean;
4135
4123
  isInternal: boolean;
4124
+ excludeFromShapeBounds: boolean;
4136
4125
  debugColor?: string;
4137
4126
  ignore?: boolean;
4138
4127
  constructor(opts: Geometry2dOptions);
@@ -4156,12 +4145,14 @@ export declare abstract class Geometry2d {
4156
4145
  * along the edge it is as a fraction of the total length.
4157
4146
  */
4158
4147
  uninterpolateAlongEdge(point: VecLike, _filters?: Geometry2dFilters): number;
4159
- /** @deprecated Iterate the vertices instead. */
4160
- nearestPointOnLineSegment(A: VecLike, B: VecLike): Vec;
4161
4148
  isPointInBounds(point: VecLike, margin?: number): boolean;
4149
+ overlapsPolygon(_polygon: VecLike[]): boolean;
4162
4150
  transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
4163
4151
  private _vertices;
4164
4152
  get vertices(): Vec[];
4153
+ getBoundsVertices(): Vec[];
4154
+ private _boundsVertices;
4155
+ get boundsVertices(): Vec[];
4165
4156
  getBounds(): Box;
4166
4157
  private _bounds;
4167
4158
  get bounds(): Box;
@@ -4269,7 +4260,7 @@ export declare function getPerfectDashProps(totalLength: number, strokeWidth: nu
4269
4260
  };
4270
4261
 
4271
4262
  /** @public */
4272
- export declare function getPointerInfo(e: PointerEvent | React.PointerEvent): {
4263
+ export declare function getPointerInfo(editor: Editor, e: PointerEvent | React.PointerEvent): {
4273
4264
  accelKey: boolean;
4274
4265
  altKey: boolean;
4275
4266
  button: number;
@@ -4358,6 +4349,7 @@ export declare class Group2d extends Geometry2d {
4358
4349
  hitTestLineSegment(A: VecLike, B: VecLike, zoom: number, filters?: Geometry2dFilters): boolean;
4359
4350
  intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
4360
4351
  intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
4352
+ getBoundsVertices(): Vec[];
4361
4353
  intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
4362
4354
  intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
4363
4355
  interpolateAlongEdge(t: number, filters?: Geometry2dFilters): Vec;
@@ -4367,6 +4359,7 @@ export declare class Group2d extends Geometry2d {
4367
4359
  toSimpleSvgPath(): string;
4368
4360
  getLength(filters?: Geometry2dFilters): number;
4369
4361
  getSvgPathData(): string;
4362
+ overlapsPolygon(polygon: VecLike[]): boolean;
4370
4363
  }
4371
4364
 
4372
4365
  /** @public */
@@ -4607,12 +4600,16 @@ export declare function kickoutOccludedShapes(editor: Editor, shapeIds: TLShapeI
4607
4600
  filter?(parent: TLShape): boolean;
4608
4601
  }): void;
4609
4602
 
4603
+ /* Excluded from this release type: LICENSE_TIMEOUT */
4604
+
4610
4605
  /* Excluded from this release type: LicenseFromKeyResult */
4611
4606
 
4612
4607
  /* Excluded from this release type: LicenseInfo */
4613
4608
 
4614
4609
  /* Excluded from this release type: LicenseManager */
4615
4610
 
4611
+ /* Excluded from this release type: LicenseState */
4612
+
4616
4613
  /** @public */
4617
4614
  export declare function linesIntersect(A: VecLike, B: VecLike, C: VecLike, D: VecLike): boolean;
4618
4615
 
@@ -5218,7 +5215,34 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5218
5215
  * @public
5219
5216
  */
5220
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;
5221
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;
5222
5246
  /**
5223
5247
  * Whether the shape should hide its resize handles when selected.
5224
5248
  *
@@ -5249,6 +5273,17 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5249
5273
  * @public
5250
5274
  */
5251
5275
  isAspectRatioLocked(_shape: Shape): boolean;
5276
+ /**
5277
+ * By default, the bounds of an image export are the bounds of all the shapes it contains, plus
5278
+ * some padding. If an export includes a shape where `isExportBoundsContainer` is true, then the
5279
+ * padding is skipped _if the bounds of that shape contains all the other shapes_. This is
5280
+ * useful in cases like annotating on top of an image, where you usually want to avoid extra
5281
+ * padding around the image if you don't need it.
5282
+ *
5283
+ * @param _shape - The shape to check
5284
+ * @returns True if this shape should be treated as an export bounds container
5285
+ */
5286
+ isExportBoundsContainer(_shape: Shape): boolean;
5252
5287
  /* Excluded from this release type: backgroundComponent */
5253
5288
  /**
5254
5289
  * Get the interpolated props for an animating shape. This is an optional method.
@@ -5804,7 +5839,14 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
5804
5839
  onExit?(info: any, to: string): void;
5805
5840
  }
5806
5841
 
5807
- /** @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
+ */
5808
5850
  export declare const stopEventPropagation: (e: any) => any;
5809
5851
 
5810
5852
  /* Excluded from this release type: StoreName */
@@ -6295,12 +6337,6 @@ export declare interface TldrawEditorBaseProps {
6295
6337
  * Options for syncing the editor's camera state with the URL.
6296
6338
  */
6297
6339
  deepLinks?: TLDeepLinkOptions | true;
6298
- /**
6299
- * Predicate for whether or not a shape should be hidden.
6300
- *
6301
- * @deprecated Use {@link TldrawEditorBaseProps#getShapeVisibility} instead.
6302
- */
6303
- isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6304
6340
  /**
6305
6341
  * Provides a way to hide shapes.
6306
6342
  *
@@ -6408,6 +6444,8 @@ export declare interface TldrawOptions {
6408
6444
  readonly multiClickDurationMs: number;
6409
6445
  readonly coarseDragDistanceSquared: number;
6410
6446
  readonly dragDistanceSquared: number;
6447
+ readonly uiDragDistanceSquared: number;
6448
+ readonly uiCoarseDragDistanceSquared: number;
6411
6449
  readonly defaultSvgPadding: number;
6412
6450
  readonly cameraSlideFriction: number;
6413
6451
  readonly gridSteps: readonly {
@@ -6434,6 +6472,7 @@ export declare interface TldrawOptions {
6434
6472
  readonly flattenImageBoundsPadding: number;
6435
6473
  readonly laserDelayMs: number;
6436
6474
  readonly maxExportDelayMs: number;
6475
+ readonly tooltipDelayMs: number;
6437
6476
  /**
6438
6477
  * How long should previews created by {@link Editor.createTemporaryAssetPreview} last before
6439
6478
  * they expire? Defaults to 3 minutes.
@@ -6559,15 +6598,6 @@ export declare interface TLEditorOptions {
6559
6598
  fontAssetUrls?: {
6560
6599
  [key: string]: string | undefined;
6561
6600
  };
6562
- /**
6563
- * A predicate that should return true if the given shape should be hidden.
6564
- *
6565
- * @deprecated Use {@link Editor#getShapeVisibility} instead.
6566
- *
6567
- * @param shape - The shape to check.
6568
- * @param editor - The editor instance.
6569
- */
6570
- isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6571
6601
  /**
6572
6602
  * Provides a way to hide shapes.
6573
6603
  *
@@ -6835,6 +6865,59 @@ export declare interface TLGeometryOpts {
6835
6865
  context?: string;
6836
6866
  }
6837
6867
 
6868
+ /**
6869
+ * Options to {@link Editor.getShapeAtPoint}.
6870
+ *
6871
+ * @public
6872
+ */
6873
+ export declare interface TLGetShapeAtPointOptions {
6874
+ /**
6875
+ * The margin to apply to the shape.
6876
+ * If a number, it will be applied to both the inside and outside of the shape.
6877
+ * If an array, the first element will be applied to the inside of the shape, and the second element will be applied to the outside.
6878
+ *
6879
+ * @example
6880
+ * ```ts
6881
+ * // Get the shape at the center of the screen
6882
+ * const shape = editor.getShapeAtProps({
6883
+ * margin: 10,
6884
+ * })
6885
+ *
6886
+ * // Get the shape at the center of the screen with a 10px inner margin and a 5px outer margin
6887
+ * const shape = editor.getShapeAtProps({
6888
+ * margin: [10, 5],
6889
+ * })
6890
+ * ```
6891
+ */
6892
+ margin?: [number, number] | number;
6893
+ /**
6894
+ * Whether to register hits inside of shapes (beyond the margin), such as the inside of a solid shape.
6895
+ */
6896
+ hitInside?: boolean;
6897
+ /**
6898
+ * Whether to register hits on locked shapes.
6899
+ */
6900
+ hitLocked?: boolean;
6901
+ /**
6902
+ * Whether to register hits on labels.
6903
+ */
6904
+ hitLabels?: boolean;
6905
+ /**
6906
+ * Whether to only return hits on shapes that are currently being rendered.
6907
+ * todo: rename this to hitCulled or hitNotRendering
6908
+ */
6909
+ renderingOnly?: boolean;
6910
+ /**
6911
+ * Whether to register hits on the inside of frame shapes.
6912
+ * todo: rename this to hitInsideFrames
6913
+ */
6914
+ hitFrameInside?: boolean;
6915
+ /**
6916
+ * A filter function to apply to the shapes.
6917
+ */
6918
+ filter?(shape: TLShape): boolean;
6919
+ }
6920
+
6838
6921
  /** @public */
6839
6922
  export declare interface TLGridProps {
6840
6923
  x: number;
@@ -7505,12 +7588,6 @@ export declare interface TLSvgExportOptions {
7505
7588
  preserveAspectRatio?: React.SVGAttributes<SVGSVGElement>['preserveAspectRatio'];
7506
7589
  }
7507
7590
 
7508
- /**
7509
- * @public
7510
- * @deprecated use {@link TLImageExportOptions} instead
7511
- */
7512
- export declare type TLSvgOptions = TLImageExportOptions;
7513
-
7514
7591
  /** @public */
7515
7592
  export declare interface TLSvgTextExternalContent extends TLBaseExternalContent {
7516
7593
  type: 'svg-text';
@@ -7621,6 +7698,8 @@ export declare interface TLUserPreferences {
7621
7698
  isWrapMode?: boolean | null;
7622
7699
  isDynamicSizeMode?: boolean | null;
7623
7700
  isPasteAtCursorMode?: boolean | null;
7701
+ enhancedA11yMode?: boolean | null;
7702
+ inputMode?: 'mouse' | 'trackpad' | null;
7624
7703
  }
7625
7704
 
7626
7705
  /** @public */
@@ -7663,6 +7742,7 @@ export declare class TransformedGeometry2d extends Geometry2d {
7663
7742
  private readonly decomposed;
7664
7743
  constructor(geometry: Geometry2d, matrix: MatModel, opts?: TransformedGeometry2dOptions);
7665
7744
  getVertices(filters: Geometry2dFilters): Vec[];
7745
+ getBoundsVertices(): Vec[];
7666
7746
  nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;
7667
7747
  hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean;
7668
7748
  distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
@@ -7683,6 +7763,7 @@ export declare interface TransformedGeometry2dOptions {
7683
7763
  isInternal?: boolean;
7684
7764
  debugColor?: string;
7685
7765
  ignore?: boolean;
7766
+ excludeFromShapeBounds?: boolean;
7686
7767
  }
7687
7768
 
7688
7769
  /** @public */
@@ -7786,7 +7867,9 @@ export declare class UserPreferencesManager {
7786
7867
  areKeyboardShortcutsEnabled: boolean;
7787
7868
  color: string;
7788
7869
  colorScheme: "dark" | "light" | "system" | undefined;
7870
+ enhancedA11yMode: boolean;
7789
7871
  id: string;
7872
+ inputMode: "mouse" | "trackpad" | null;
7790
7873
  isDarkMode: boolean;
7791
7874
  isDynamicResizeMode: boolean;
7792
7875
  isSnapMode: boolean;
@@ -7809,6 +7892,8 @@ export declare class UserPreferencesManager {
7809
7892
  getIsWrapMode(): boolean;
7810
7893
  getIsDynamicResizeMode(): boolean;
7811
7894
  getIsPasteAtCursorMode(): boolean;
7895
+ getEnhancedA11yMode(): boolean;
7896
+ getInputMode(): "mouse" | "trackpad" | null;
7812
7897
  }
7813
7898
 
7814
7899
  /** @public */
@@ -7915,8 +8000,6 @@ export declare class Vec {
7915
8000
  lrp(B: VecLike, t: number): Vec;
7916
8001
  equals(B: VecLike): boolean;
7917
8002
  equalsXY(x: number, y: number): boolean;
7918
- /** @deprecated use `uni` instead */
7919
- norm(): this;
7920
8003
  toFixed(): this;
7921
8004
  toString(): string;
7922
8005
  toJson(): VecModel;
package/dist-cjs/index.js CHANGED
@@ -55,6 +55,7 @@ __export(index_exports, {
55
55
  Edge2d: () => import_Edge2d.Edge2d,
56
56
  EdgeScrollManager: () => import_EdgeScrollManager.EdgeScrollManager,
57
57
  Editor: () => import_Editor.Editor,
58
+ EditorAtom: () => import_EditorAtom.EditorAtom,
58
59
  EditorContext: () => import_useEditor.EditorContext,
59
60
  EditorProvider: () => import_useEditor.EditorProvider,
60
61
  Ellipse2d: () => import_Ellipse2d.Ellipse2d,
@@ -69,6 +70,7 @@ __export(index_exports, {
69
70
  HTMLContainer: () => import_HTMLContainer.HTMLContainer,
70
71
  HandleSnaps: () => import_HandleSnaps.HandleSnaps,
71
72
  HistoryManager: () => import_HistoryManager.HistoryManager,
73
+ LICENSE_TIMEOUT: () => import_LicenseProvider.LICENSE_TIMEOUT,
72
74
  LicenseManager: () => import_LicenseManager.LicenseManager,
73
75
  LoadingScreen: () => import_TldrawEditor.LoadingScreen,
74
76
  LocalIndexedDb: () => import_LocalIndexedDb.LocalIndexedDb,
@@ -120,7 +122,6 @@ __export(index_exports, {
120
122
  createTLStore: () => import_createTLStore.createTLStore,
121
123
  createTLUser: () => import_createTLUser.createTLUser,
122
124
  dataUrlToFile: () => import_assets.dataUrlToFile,
123
- debugEnableLicensing: () => debugEnableLicensing,
124
125
  debugFlags: () => import_debug_flags.debugFlags,
125
126
  defaultTldrawOptions: () => import_options.defaultTldrawOptions,
126
127
  defaultUserPreferences: () => import_TLUserPreferences.defaultUserPreferences,
@@ -321,6 +322,7 @@ var import_useTLStore = require("./lib/hooks/useTLStore");
321
322
  var import_useTransform = require("./lib/hooks/useTransform");
322
323
  var import_useViewportHeight = require("./lib/hooks/useViewportHeight");
323
324
  var import_LicenseManager = require("./lib/license/LicenseManager");
325
+ var import_LicenseProvider = require("./lib/license/LicenseProvider");
324
326
  var import_options = require("./lib/options");
325
327
  var import_Box = require("./lib/primitives/Box");
326
328
  var import_easings = require("./lib/primitives/easings");
@@ -348,6 +350,7 @@ var import_browserCanvasMaxSize = require("./lib/utils/browserCanvasMaxSize");
348
350
  var import_debug_flags = require("./lib/utils/debug-flags");
349
351
  var import_deepLinks = require("./lib/utils/deepLinks");
350
352
  var import_dom = require("./lib/utils/dom");
353
+ var import_EditorAtom = require("./lib/utils/EditorAtom");
351
354
  var import_getIncrementedName = require("./lib/utils/getIncrementedName");
352
355
  var import_getPointerInfo = require("./lib/utils/getPointerInfo");
353
356
  var import_getSvgPathFromPoints = require("./lib/utils/getSvgPathFromPoints");
@@ -364,12 +367,9 @@ var import_hardReset = require("./lib/utils/sync/hardReset");
364
367
  var import_LocalIndexedDb = require("./lib/utils/sync/LocalIndexedDb");
365
368
  var import_uniq = require("./lib/utils/uniq");
366
369
  var import_window_open = require("./lib/utils/window-open");
367
- function debugEnableLicensing() {
368
- return;
369
- }
370
370
  (0, import_utils.registerTldrawLibraryVersion)(
371
371
  "@tldraw/editor",
372
- "3.16.0-next.f9f54ec051f3",
372
+ "4.0.0",
373
373
  "cjs"
374
374
  );
375
375
  //# sourceMappingURL=index.js.map