@tldraw/editor 5.3.0-internal.fba91ed55f6c → 5.3.0-next.030bf6014f04

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 (101) hide show
  1. package/dist-cjs/index.d.ts +132 -3
  2. package/dist-cjs/index.js +10 -3
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/TldrawEditor.js +24 -19
  5. package/dist-cjs/lib/TldrawEditor.js.map +2 -2
  6. package/dist-cjs/lib/components/EditorPortal.js +44 -0
  7. package/dist-cjs/lib/components/EditorPortal.js.map +7 -0
  8. package/dist-cjs/lib/components/LiveCollaborators.js +102 -0
  9. package/dist-cjs/lib/components/LiveCollaborators.js.map +7 -0
  10. package/dist-cjs/lib/components/default-components/DefaultCanvas.js +4 -10
  11. package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +3 -3
  12. package/dist-cjs/lib/components/default-components/DefaultCursor.js +59 -0
  13. package/dist-cjs/lib/components/default-components/DefaultCursor.js.map +7 -0
  14. package/dist-cjs/lib/editor/Editor.js +7 -2
  15. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  16. package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js +4 -4
  17. package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js.map +2 -2
  18. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  19. package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
  20. package/dist-cjs/lib/hooks/EditorComponentsContext.js.map +2 -2
  21. package/dist-cjs/lib/hooks/useCursor.js +1 -0
  22. package/dist-cjs/lib/hooks/useCursor.js.map +2 -2
  23. package/dist-cjs/lib/hooks/useEditorComponents.js +2 -0
  24. package/dist-cjs/lib/hooks/useEditorComponents.js.map +2 -2
  25. package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js +25 -1
  26. package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js.map +2 -2
  27. package/dist-cjs/lib/hooks/useTransform.js +45 -0
  28. package/dist-cjs/lib/hooks/useTransform.js.map +7 -0
  29. package/dist-cjs/lib/license/LicenseManager.js +3 -0
  30. package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
  31. package/dist-cjs/lib/utils/collaborators.js +27 -0
  32. package/dist-cjs/lib/utils/collaborators.js.map +7 -0
  33. package/dist-cjs/lib/utils/getHtmlLayerTransform.js +33 -0
  34. package/dist-cjs/lib/utils/getHtmlLayerTransform.js.map +7 -0
  35. package/dist-cjs/version.js +3 -3
  36. package/dist-cjs/version.js.map +1 -1
  37. package/dist-esm/index.d.mts +132 -3
  38. package/dist-esm/index.mjs +15 -3
  39. package/dist-esm/index.mjs.map +2 -2
  40. package/dist-esm/lib/TldrawEditor.mjs +23 -18
  41. package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
  42. package/dist-esm/lib/components/EditorPortal.mjs +24 -0
  43. package/dist-esm/lib/components/EditorPortal.mjs.map +7 -0
  44. package/dist-esm/lib/components/LiveCollaborators.mjs +82 -0
  45. package/dist-esm/lib/components/LiveCollaborators.mjs.map +7 -0
  46. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +5 -11
  47. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
  48. package/dist-esm/lib/components/default-components/DefaultCursor.mjs +29 -0
  49. package/dist-esm/lib/components/default-components/DefaultCursor.mjs.map +7 -0
  50. package/dist-esm/lib/editor/Editor.mjs +7 -2
  51. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  52. package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs +5 -5
  53. package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs.map +2 -2
  54. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  55. package/dist-esm/lib/hooks/EditorComponentsContext.mjs.map +2 -2
  56. package/dist-esm/lib/hooks/useCursor.mjs +1 -0
  57. package/dist-esm/lib/hooks/useCursor.mjs.map +2 -2
  58. package/dist-esm/lib/hooks/useEditorComponents.mjs +2 -0
  59. package/dist-esm/lib/hooks/useEditorComponents.mjs.map +2 -2
  60. package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs +25 -1
  61. package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs.map +2 -2
  62. package/dist-esm/lib/hooks/useTransform.mjs +25 -0
  63. package/dist-esm/lib/hooks/useTransform.mjs.map +7 -0
  64. package/dist-esm/lib/license/LicenseManager.mjs +3 -0
  65. package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
  66. package/dist-esm/lib/utils/collaborators.mjs +7 -0
  67. package/dist-esm/lib/utils/collaborators.mjs.map +7 -0
  68. package/dist-esm/lib/utils/getHtmlLayerTransform.mjs +13 -0
  69. package/dist-esm/lib/utils/getHtmlLayerTransform.mjs.map +7 -0
  70. package/dist-esm/version.mjs +3 -3
  71. package/dist-esm/version.mjs.map +1 -1
  72. package/editor.css +43 -4
  73. package/package.json +7 -7
  74. package/src/index.ts +11 -1
  75. package/src/lib/TldrawEditor.tsx +21 -13
  76. package/src/lib/components/EditorPortal.tsx +77 -0
  77. package/src/lib/components/LiveCollaborators.tsx +133 -0
  78. package/src/lib/components/default-components/DefaultCanvas.tsx +5 -17
  79. package/src/lib/components/default-components/DefaultCursor.tsx +65 -0
  80. package/src/lib/editor/Editor.ts +14 -2
  81. package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.test.ts +46 -1
  82. package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.ts +10 -5
  83. package/src/lib/editor/shapes/ShapeUtil.ts +24 -0
  84. package/src/lib/editor/types/external-content.ts +5 -0
  85. package/src/lib/hooks/EditorComponentsContext.tsx +2 -0
  86. package/src/lib/hooks/useCursor.ts +1 -0
  87. package/src/lib/hooks/useEditorComponents.tsx +2 -0
  88. package/src/lib/hooks/usePassThroughWheelEvents.ts +44 -2
  89. package/src/lib/hooks/useTransform.ts +38 -0
  90. package/src/lib/license/LicenseManager.test.ts +25 -0
  91. package/src/lib/license/LicenseManager.ts +7 -0
  92. package/src/lib/test/EditorPortal.test.tsx +48 -0
  93. package/src/lib/utils/collaborators.test.ts +34 -0
  94. package/src/lib/utils/collaborators.ts +25 -0
  95. package/src/lib/utils/getHtmlLayerTransform.ts +22 -0
  96. package/src/version.ts +3 -3
  97. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js +0 -51
  98. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +0 -7
  99. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs +0 -31
  100. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +0 -7
  101. package/src/lib/hooks/usePassThroughMouseOverEvents.ts +0 -32
@@ -19,12 +19,14 @@ import { JsonObject } from '@tldraw/utils';
19
19
  import { JSX } from 'react/jsx-runtime';
20
20
  import { LegacyMigrations } from '@tldraw/store';
21
21
  import { MigrationSequence } from '@tldraw/store';
22
+ import { NamedExoticComponent } from 'react';
22
23
  import { Node as Node_2 } from '@tiptap/pm/model';
23
24
  import { PerformanceTracker } from '@tldraw/utils';
24
25
  import * as React_2 from 'react';
25
26
  import { default as React_3 } from 'react';
26
27
  import { ReactElement } from 'react';
27
28
  import { ReactNode } from 'react';
29
+ import { ReactPortal } from 'react';
28
30
  import { RecordProps } from '@tldraw/tlschema';
29
31
  import { RecordsDiff } from '@tldraw/store';
30
32
  import { RefAttributes } from 'react';
@@ -982,6 +984,15 @@ export declare function DefaultBackground(): JSX.Element;
982
984
  /** @public @react */
983
985
  export declare function DefaultCanvas({ className }: TLCanvasComponentProps): JSX.Element;
984
986
 
987
+ /**
988
+ * The default collaborator cursor: the arrow glyph plus a name tag or chat bubble. The arrow is a
989
+ * `<use>` of a shared `<defs>` symbol that `LiveCollaborators` renders, so a `DefaultCursor`
990
+ * used outside that layer draws no arrow.
991
+ *
992
+ * @public @react
993
+ */
994
+ export declare const DefaultCursor: NamedExoticComponent<TLCursorProps>;
995
+
985
996
  /** @public @react */
986
997
  export declare const DefaultErrorFallback: TLErrorFallbackComponent;
987
998
 
@@ -4586,6 +4597,52 @@ export declare abstract class EditorManager {
4586
4597
  /* Excluded from this release type: dispose */
4587
4598
  }
4588
4599
 
4600
+ /**
4601
+ * Renders its children into the end of the editor's container, escaping the canvas layer.
4602
+ *
4603
+ * Use this for anything anchored to canvas coordinates that also has to draw over the UI — a
4604
+ * popover on a shape, a comment thread, an annotation panel. The `OnTheCanvas` and
4605
+ * `InFrontOfTheCanvas` slots are fixed layers, each its own stacking context, so content mounted
4606
+ * there can't paint above whatever outranks its layer whatever z-index it asks for. Mount in
4607
+ * whichever slot suits your data flow, wrap the part that needs its own layer in this, and give
4608
+ * that part a z-index.
4609
+ *
4610
+ * This package's own layers stop at 250 (`--tl-layer-canvas-in-front`); above that belongs to
4611
+ * whatever renders the UI. In `tldraw` that's `--tl-layer-panels` (300) and `--tl-layer-menus`
4612
+ * (400), defined by `tldraw`'s stylesheet rather than this one.
4613
+ *
4614
+ * Positioning still resolves against the editor's container, so a `position: absolute` child uses
4615
+ * ordinary container coordinates.
4616
+ *
4617
+ * Prefer this over `createPortal(children, useContainer())`, which picks its DOM position from the
4618
+ * commit that mounts it — landing the node ahead of the UI and of the "skip to main content" link
4619
+ * that only works while nothing precedes it. This host is a real element placed last, so ordering
4620
+ * is fixed rather than dependent on mount timing.
4621
+ *
4622
+ * @example
4623
+ * ```tsx
4624
+ * // 400 clears tldraw's menus layer; the bare editor's own layers stop at 250.
4625
+ * function ShapeAnnotation({ point }: { point: VecLike }) {
4626
+ * return (
4627
+ * <EditorPortal>
4628
+ * <div style={{ position: 'absolute', left: point.x, top: point.y, zIndex: 400 }}>
4629
+ * Above the UI
4630
+ * </div>
4631
+ * </EditorPortal>
4632
+ * )
4633
+ * }
4634
+ * ```
4635
+ *
4636
+ * @public
4637
+ * @react
4638
+ */
4639
+ export declare function EditorPortal({ children }: EditorPortalProps): ReactPortal | null;
4640
+
4641
+ /** @public */
4642
+ export declare interface EditorPortalProps {
4643
+ children: ReactNode;
4644
+ }
4645
+
4589
4646
  /** @public @react */
4590
4647
  export declare function EditorProvider({ editor, children }: EditorProviderProps): JSX.Element;
4591
4648
 
@@ -5449,6 +5506,24 @@ export declare function intersectPolygonPolygon(polygonA: VecLike[], polygonB: V
5449
5506
 
5450
5507
  /* Excluded from this release type: isAccelKey */
5451
5508
 
5509
+ /**
5510
+ * Whether a collaborator's cursor (page coords) is inside the viewport, with a small margin for the
5511
+ * cursor glyph so it isn't culled the instant its hotspot crosses the edge.
5512
+ *
5513
+ * Single source of truth for the cursor/hint split: the DOM cursor layer renders a collaborator
5514
+ * when this is true, and `CollaboratorHintOverlayUtil` draws the viewport-edge hint when it's
5515
+ * false. Sharing the predicate keeps those two exhaustive and mutually exclusive — a margin change
5516
+ * can't open a dead zone (neither renders) or a double-render (both).
5517
+ *
5518
+ * @public
5519
+ */
5520
+ export declare function isCursorInViewport(cursor: VecLike, viewport: {
5521
+ maxX: number;
5522
+ maxY: number;
5523
+ minX: number;
5524
+ minY: number;
5525
+ }, zoom: number): boolean;
5526
+
5452
5527
  /**
5453
5528
  * Check if a float is safe to use. ie: Not too big or small.
5454
5529
  * @public
@@ -6795,6 +6870,29 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
6795
6870
  * @public
6796
6871
  */
6797
6872
  onBeforeCreate?(next: Shape): Shape | void;
6873
+ /**
6874
+ * A callback called when a shape is reproduced from an existing shape, either by duplicating
6875
+ * ({@link Editor.duplicateShapes}) or by pasting/putting content onto the page
6876
+ * ({@link Editor.putContentOntoCurrentPage}). This provides a last chance to modify the copy
6877
+ * before it's created — for example, to re-stamp attribution so the copy is credited to the
6878
+ * current user rather than the original author. It is not called when content is put with
6879
+ * `preserveIds` (e.g. {@link Editor.moveShapesToPage}), since the shape keeps its identity
6880
+ * and no copy is made.
6881
+ *
6882
+ * @example
6883
+ *
6884
+ * ```ts
6885
+ * onBeforeDuplicate = (source, duplicate) => {
6886
+ * return { ...duplicate, props: { ...duplicate.props, editedBy: this.editor.getAttributionUserId() } }
6887
+ * }
6888
+ * ```
6889
+ *
6890
+ * @param source - The shape being copied from.
6891
+ * @param duplicate - The new copy (with its own id), before it's created.
6892
+ * @returns The next shape or void.
6893
+ * @public
6894
+ */
6895
+ onBeforeDuplicate?(source: Shape, duplicate: Shape): Shape | void;
6798
6896
  /**
6799
6897
  * A callback called just before a shape is updated. This method provides a last chance to modify
6800
6898
  * the updated shape.
@@ -7527,6 +7625,11 @@ export declare interface TLBaseEventInfo {
7527
7625
 
7528
7626
  /** @public */
7529
7627
  export declare interface TLBaseExternalContent {
7628
+ /**
7629
+ * The other content sources found on the clipboard alongside this content. For example, when
7630
+ * pasting an image copied together with HTML and plain text, the `files` content will have
7631
+ * text sources for the HTML and plain text parts.
7632
+ */
7530
7633
  sources?: TLExternalContentSource[];
7531
7634
  point?: VecLike;
7532
7635
  }
@@ -7773,6 +7876,17 @@ export declare interface TLCurrentUser {
7773
7876
  readonly setUserPreferences: (userPreferences: TLUserPreferences) => void;
7774
7877
  }
7775
7878
 
7879
+ /** @public */
7880
+ export declare interface TLCursorProps {
7881
+ userId: string;
7882
+ className?: string;
7883
+ point: null | VecModel;
7884
+ zoom: number;
7885
+ color?: string;
7886
+ name: null | string;
7887
+ chatMessage: string;
7888
+ }
7889
+
7776
7890
  /** @public */
7777
7891
  export declare type TLDeepLink = {
7778
7892
  bounds: BoxModel;
@@ -8275,6 +8389,7 @@ export declare interface TLDropShapesOverInfo {
8275
8389
  export declare interface TLEditorComponents {
8276
8390
  Background?: ComponentType | null;
8277
8391
  Canvas?: ComponentType<TLCanvasComponentProps> | null;
8392
+ CollaboratorCursor?: ComponentType<TLCursorProps> | null;
8278
8393
  Grid?: ComponentType<TLGridProps> | null;
8279
8394
  InFrontOfTheCanvas?: ComponentType | null;
8280
8395
  LoadingScreen?: ComponentType | null;
@@ -9730,6 +9845,16 @@ export declare function useEditor(): Editor;
9730
9845
  /** @public */
9731
9846
  export declare function useEditorComponents(): Required<TLEditorComponents>;
9732
9847
 
9848
+ /**
9849
+ * The DOM node that {@link EditorPortal} renders into: an empty `display: contents` element the
9850
+ * editor renders last among its container's children, after the canvas and after the UI.
9851
+ *
9852
+ * Null until the container has mounted, so prefer {@link EditorPortal}, which handles that for you.
9853
+ *
9854
+ * @public
9855
+ */
9856
+ export declare function useEditorPortalHost(): HTMLElement | null;
9857
+
9733
9858
  /* Excluded from this release type: useEvent */
9734
9859
 
9735
9860
  /** @public */
@@ -9752,9 +9877,6 @@ export declare function useMaybeEditor(): Editor | null;
9752
9877
 
9753
9878
  /* Excluded from this release type: useOnMount */
9754
9879
 
9755
- /** @public */
9756
- export declare function usePassThroughMouseOverEvents(ref: RefObject<HTMLElement | null>): void;
9757
-
9758
9880
  /** @public */
9759
9881
  export declare function usePassThroughWheelEvents(ref: RefObject<HTMLElement | null>): void;
9760
9882
 
@@ -9881,6 +10003,13 @@ export declare function useTLSchemaFromUtils(opts: TLStoreSchemaOptions): StoreS
9881
10003
  /** @public */
9882
10004
  export declare function useTLStore(opts: TLStoreOptions): TLStore;
9883
10005
 
10006
+ /**
10007
+ * Position an element by writing its `transform` directly, outside React's render output — the
10008
+ * cheap path for elements that move at pointer/presence frequency.
10009
+ * @public
10010
+ */
10011
+ export declare function useTransform(ref: React.RefObject<HTMLElement | null | SVGElement>, x?: number, y?: number, scale?: number, rotate?: number, additionalOffset?: VecLike): void;
10012
+
9884
10013
  /**
9885
10014
  * React's useId hook returns a unique id for the component. However, it uses a colon in the id,
9886
10015
  * which is not valid for CSS selectors. This hook replaces the colon with an underscore.
package/dist-cjs/index.js CHANGED
@@ -38,6 +38,7 @@ __export(index_exports, {
38
38
  DEFAULT_THEME: () => import_defaultThemes.DEFAULT_THEME,
39
39
  DefaultBackground: () => import_DefaultBackground.DefaultBackground,
40
40
  DefaultCanvas: () => import_DefaultCanvas.DefaultCanvas,
41
+ DefaultCursor: () => import_DefaultCursor.DefaultCursor,
41
42
  DefaultErrorFallback: () => import_DefaultErrorFallback.DefaultErrorFallback,
42
43
  DefaultGrid: () => import_DefaultGrid.DefaultGrid,
43
44
  DefaultShapeWrapper: () => import_DefaultShapeWrapper.DefaultShapeWrapper,
@@ -51,6 +52,7 @@ __export(index_exports, {
51
52
  EditorAtom: () => import_EditorAtom.EditorAtom,
52
53
  EditorContext: () => import_useEditor.EditorContext,
53
54
  EditorManager: () => import_EditorManager.EditorManager,
55
+ EditorPortal: () => import_EditorPortal.EditorPortal,
54
56
  EditorProvider: () => import_useEditor.EditorProvider,
55
57
  Ellipse2d: () => import_Ellipse2d.Ellipse2d,
56
58
  ErrorBoundary: () => import_ErrorBoundary.ErrorBoundary,
@@ -171,6 +173,7 @@ __export(index_exports, {
171
173
  intersectPolygonBounds: () => import_intersect.intersectPolygonBounds,
172
174
  intersectPolygonPolygon: () => import_intersect.intersectPolygonPolygon,
173
175
  isAccelKey: () => import_keyboard.isAccelKey,
176
+ isCursorInViewport: () => import_collaborators.isCursorInViewport,
174
177
  isSafeFloat: () => import_utils2.isSafeFloat,
175
178
  kickoutOccludedShapes: () => import_reparenting.kickoutOccludedShapes,
176
179
  linesIntersect: () => import_intersect.linesIntersect,
@@ -221,6 +224,7 @@ __export(index_exports, {
221
224
  useDelaySvgExport: () => import_SvgExportContext.useDelaySvgExport,
222
225
  useEditor: () => import_useEditor.useEditor,
223
226
  useEditorComponents: () => import_useEditorComponents.useEditorComponents,
227
+ useEditorPortalHost: () => import_EditorPortal.useEditorPortalHost,
224
228
  useEvent: () => import_useEvent.useEvent,
225
229
  useGlobalMenuIsOpen: () => import_useGlobalMenuIsOpen.useGlobalMenuIsOpen,
226
230
  useIsCropping: () => import_useIsCropping.useIsCropping,
@@ -230,7 +234,6 @@ __export(index_exports, {
230
234
  useLocalStore: () => import_useLocalStore.useLocalStore,
231
235
  useMaybeEditor: () => import_useEditor.useMaybeEditor,
232
236
  useOnMount: () => import_TldrawEditor.useOnMount,
233
- usePassThroughMouseOverEvents: () => import_usePassThroughMouseOverEvents.usePassThroughMouseOverEvents,
234
237
  usePassThroughWheelEvents: () => import_usePassThroughWheelEvents.usePassThroughWheelEvents,
235
238
  usePeerIds: () => import_usePeerIds.usePeerIds,
236
239
  usePresence: () => import_usePresence.usePresence,
@@ -243,6 +246,7 @@ __export(index_exports, {
243
246
  useTLSchemaFromUtils: () => import_useTLStore.useTLSchemaFromUtils,
244
247
  useTLStore: () => import_useTLStore.useTLStore,
245
248
  useTldrawCurrentUser: () => import_createTLCurrentUser.useTldrawCurrentUser,
249
+ useTransform: () => import_useTransform.useTransform,
246
250
  useUniqueSafeId: () => import_useSafeId.useUniqueSafeId,
247
251
  useViewportHeight: () => import_useViewportHeight.useViewportHeight,
248
252
  userTypeValidator: () => import_TLUserPreferences.userTypeValidator
@@ -257,11 +261,13 @@ __reExport(index_exports, require("@tldraw/utils"), module.exports);
257
261
  __reExport(index_exports, require("@tldraw/validate"), module.exports);
258
262
  var import_DefaultBackground = require("./lib/components/default-components/DefaultBackground");
259
263
  var import_DefaultCanvas = require("./lib/components/default-components/DefaultCanvas");
264
+ var import_DefaultCursor = require("./lib/components/default-components/DefaultCursor");
260
265
  var import_DefaultErrorFallback = require("./lib/components/default-components/DefaultErrorFallback");
261
266
  var import_DefaultGrid = require("./lib/components/default-components/DefaultGrid");
262
267
  var import_DefaultShapeWrapper = require("./lib/components/default-components/DefaultShapeWrapper");
263
268
  var import_DefaultSpinner = require("./lib/components/default-components/DefaultSpinner");
264
269
  var import_DefaultSvgDefs = require("./lib/components/default-components/DefaultSvgDefs");
270
+ var import_EditorPortal = require("./lib/components/EditorPortal");
265
271
  var import_ErrorBoundary = require("./lib/components/ErrorBoundary");
266
272
  var import_HTMLContainer = require("./lib/components/HTMLContainer");
267
273
  var import_MenuClickCapture = require("./lib/components/MenuClickCapture");
@@ -327,12 +333,13 @@ var import_useIdentity = require("./lib/hooks/useIdentity");
327
333
  var import_useIsCropping = require("./lib/hooks/useIsCropping");
328
334
  var import_useIsEditing = require("./lib/hooks/useIsEditing");
329
335
  var import_useLocalStore = require("./lib/hooks/useLocalStore");
330
- var import_usePassThroughMouseOverEvents = require("./lib/hooks/usePassThroughMouseOverEvents");
331
336
  var import_usePassThroughWheelEvents = require("./lib/hooks/usePassThroughWheelEvents");
332
337
  var import_usePeerIds = require("./lib/hooks/usePeerIds");
333
338
  var import_usePresence = require("./lib/hooks/usePresence");
334
339
  var import_useRefState = require("./lib/hooks/useRefState");
335
340
  var import_useSafeId = require("./lib/hooks/useSafeId");
341
+ var import_useTransform = require("./lib/hooks/useTransform");
342
+ var import_collaborators = require("./lib/utils/collaborators");
336
343
  var import_useTLStore = require("./lib/hooks/useTLStore");
337
344
  var import_useViewportHeight = require("./lib/hooks/useViewportHeight");
338
345
  var import_LicenseManager = require("./lib/license/LicenseManager");
@@ -382,7 +389,7 @@ var import_uniq = require("./lib/utils/uniq");
382
389
  var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
383
390
  (0, import_utils.registerTldrawLibraryVersion)(
384
391
  "@tldraw/editor",
385
- "5.3.0-internal.fba91ed55f6c",
392
+ "5.3.0-next.030bf6014f04",
386
393
  "cjs"
387
394
  );
388
395
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\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\tcreateTLCurrentUser,\n\tuseTldrawCurrentUser,\n\ttype TLCurrentUser,\n} from './lib/config/createTLCurrentUser'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tdefaultUserStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { type TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\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 { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\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 { FontManager } from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { EditorManager } from './lib/editor/managers/EditorManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\tresolveLineHeightPx,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { CollaboratorsManager } from './lib/editor/managers/CollaboratorsManager/CollaboratorsManager'\nexport { PerformanceApiAdapter } from './lib/editor/managers/PerformanceManager/PerformanceApiAdapter'\nexport { PerformanceManager } from './lib/editor/managers/PerformanceManager/PerformanceManager'\nexport {\n\ttype TLCameraEndPerfEvent,\n\ttype TLCameraStartPerfEvent,\n\ttype TLFramePerfEvent,\n\ttype TLInteractionEndPerfEvent,\n\ttype TLInteractionStartPerfEvent,\n\ttype TLPerfEventMap,\n\ttype TLPerfFrameTimeStats,\n\ttype TLPerfLongAnimationFrame,\n\ttype TLPerfLongAnimationFrameScript,\n\ttype TLShapeOperationPerfEvent,\n\ttype TLUndoRedoPerfEvent,\n} from './lib/editor/managers/PerformanceManager/perf-types'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { BaseFrameLikeShapeUtil } from './lib/editor/shapes/BaseFrameLikeShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetOverlayDisplayValues,\n\ttype OverlayOptionsWithDisplayValues,\n} from './lib/editor/overlays/getOverlayDisplayValues'\nexport { OverlayManager, type TLOverlayEntry } from './lib/editor/overlays/OverlayManager'\nexport {\n\tOverlayUtil,\n\ttype TLAnyOverlayUtilConstructor,\n\ttype TLOverlay,\n\ttype TLOverlayUtilConstructor,\n} from './lib/editor/overlays/OverlayUtil'\nexport { strokeShapeIndicators } from './lib/editor/overlays/strokeShapeIndicators'\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 { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { useColorMode } from './lib/hooks/useColorMode'\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 { 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 { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFeatureName,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT, useLicenseContext } from './lib/license/LicenseProvider'\nexport { useLicenseFeatureFlag } from './lib/license/useLicenseManagerState'\nexport {\n\tdefaultTldrawOptions,\n\ttype TLClipboardPasteRawInfo,\n\ttype TLClipboardWriteInfo,\n\ttype TldrawOptions,\n} from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\telementShouldCaptureKeys,\n\tgetGlobalDocument,\n\tgetGlobalWindow,\n\tloopToHtmlElement,\n\tmoveElementInto,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n\nexport { getColorValue } from './lib/editor/managers/ThemeManager/defa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;AAC1B,uBAMO;AACP,iCAAoC;AAEpC,sBAA2C;AAC3C,iCAAoC;AACpC,yBAAkE;AAClE,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2CAA8C;AAC9C,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,wBAAiD;AACjD,+BAAkC;AAClC,4BASO;AACP,6BAAmD;AACnD,oCAAsC;AACtC,qBAKO;AACP,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,IAAAA,gBAgCO;AACP,iBAAkC;AAClC,0BAYO;AACP,oBAAoD;AACpD,kCAAgE;AAChE,yBAOO;AACP,uBAKO;AACP,iBAYO;AACP,wBAA2B;AAC3B,gCAAmC;AACnC,4BAA+B;AAC/B,kCAAqC;AACrC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAAoE;AACpE,sBAOO;AACP,sBAIO;AACP,qBAMO;AACP,6BAIO;AACP,uBAA0B;AAC1B,4BAAsD;AAEtD,kBAAqB;AAQrB,IAAAC,wBAA8B;AAAA,IAN9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\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 { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tEditorPortal,\n\tuseEditorPortalHost,\n\ttype EditorPortalProps,\n} from './lib/components/EditorPortal'\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\tcreateTLCurrentUser,\n\tuseTldrawCurrentUser,\n\ttype TLCurrentUser,\n} from './lib/config/createTLCurrentUser'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tdefaultUserStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { type TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\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 { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\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 { FontManager } from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { EditorManager } from './lib/editor/managers/EditorManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\tresolveLineHeightPx,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { CollaboratorsManager } from './lib/editor/managers/CollaboratorsManager/CollaboratorsManager'\nexport { PerformanceApiAdapter } from './lib/editor/managers/PerformanceManager/PerformanceApiAdapter'\nexport { PerformanceManager } from './lib/editor/managers/PerformanceManager/PerformanceManager'\nexport {\n\ttype TLCameraEndPerfEvent,\n\ttype TLCameraStartPerfEvent,\n\ttype TLFramePerfEvent,\n\ttype TLInteractionEndPerfEvent,\n\ttype TLInteractionStartPerfEvent,\n\ttype TLPerfEventMap,\n\ttype TLPerfFrameTimeStats,\n\ttype TLPerfLongAnimationFrame,\n\ttype TLPerfLongAnimationFrameScript,\n\ttype TLShapeOperationPerfEvent,\n\ttype TLUndoRedoPerfEvent,\n} from './lib/editor/managers/PerformanceManager/perf-types'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { BaseFrameLikeShapeUtil } from './lib/editor/shapes/BaseFrameLikeShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetOverlayDisplayValues,\n\ttype OverlayOptionsWithDisplayValues,\n} from './lib/editor/overlays/getOverlayDisplayValues'\nexport { OverlayManager, type TLOverlayEntry } from './lib/editor/overlays/OverlayManager'\nexport {\n\tOverlayUtil,\n\ttype TLAnyOverlayUtilConstructor,\n\ttype TLOverlay,\n\ttype TLOverlayUtilConstructor,\n} from './lib/editor/overlays/OverlayUtil'\nexport { strokeShapeIndicators } from './lib/editor/overlays/strokeShapeIndicators'\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 { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { useColorMode } from './lib/hooks/useColorMode'\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 { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\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 { useTransform } from './lib/hooks/useTransform'\nexport { isCursorInViewport } from './lib/utils/collaborators'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFeatureName,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT, useLicenseContext } from './lib/license/LicenseProvider'\nexport { useLicenseFeatureFlag } from './lib/license/useLicenseManagerState'\nexport {\n\tdefaultTldrawOptions,\n\ttype TLClipboardPasteRawInfo,\n\ttype TLClipboardWriteInfo,\n\ttype TldrawOptions,\n} from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\telementShouldCaptureKeys,\n\tgetGlobalDocument,\n\tgetGlobalWindow,\n\tloopToHtmlElement,\n\tmoveElementInto,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n\nexport { getColorValue } from './lib/editor/managers/ThemeManager/defaultThemes'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AN9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": ["import_utils", "import_defaultThemes"]
7
7
  }
@@ -35,10 +35,7 @@ __export(TldrawEditor_exports, {
35
35
  useOnMount: () => useOnMount
36
36
  });
37
37
  module.exports = __toCommonJS(TldrawEditor_exports);
38
- var import_jsx_runtime = (
39
- // Store is ready to go, whether externally synced or not
40
- require("react/jsx-runtime")
41
- );
38
+ var import_jsx_runtime = require("react/jsx-runtime");
42
39
  var import_store = require("@tldraw/store");
43
40
  var import_tlschema = require("@tldraw/tlschema");
44
41
  var import_utils = require("@tldraw/utils");
@@ -46,6 +43,7 @@ var import_classnames = __toESM(require("classnames"), 1);
46
43
  var import_react = __toESM(require("react"), 1);
47
44
  var import_version = require("../version");
48
45
  var import_DefaultErrorFallback = require("./components/default-components/DefaultErrorFallback");
46
+ var import_EditorPortal = require("./components/EditorPortal");
49
47
  var import_ErrorBoundary = require("./components/ErrorBoundary");
50
48
  var import_createTLCurrentUser = require("./config/createTLCurrentUser");
51
49
  var import_Editor = require("./editor/Editor");
@@ -87,6 +85,7 @@ const TldrawEditor = (0, import_react.memo)(function TldrawEditor2({
87
85
  (0, import_tlschema.registerColorsFromThemes)(resolvedThemes);
88
86
  (0, import_tlschema.registerFontsFromThemes)(resolvedThemes);
89
87
  const [container, setContainer] = (0, import_react.useState)(null);
88
+ const [portalHost, setPortalHost] = (0, import_react.useState)(null);
90
89
  const user = (0, import_react.useMemo)(() => _user ?? (0, import_createTLCurrentUser.createTLCurrentUser)(), [_user]);
91
90
  const ErrorFallback = components?.ErrorFallback === void 0 ? import_DefaultErrorFallback.DefaultErrorFallback : components?.ErrorFallback;
92
91
  const mergedOptions = (0, import_react.useMemo)(() => {
@@ -108,7 +107,7 @@ const TldrawEditor = (0, import_react.memo)(function TldrawEditor2({
108
107
  components,
109
108
  options: (0, import_useIdentity.useShallowObjectIdentity)(mergedOptions)
110
109
  };
111
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
110
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
112
111
  "div",
113
112
  {
114
113
  ref: setContainer,
@@ -118,20 +117,26 @@ const TldrawEditor = (0, import_react.memo)(function TldrawEditor2({
118
117
  tabIndex: -1,
119
118
  role: "application",
120
119
  "aria-label": _options?.branding ?? "tldraw",
121
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
122
- import_ErrorBoundary.OptionalErrorBoundary,
123
- {
124
- fallback: ErrorFallback,
125
- onError: (error) => (0, import_utils.annotateError)(error, { tags: { origin: "react.tldraw-before-app" } }),
126
- children: container && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LicenseProvider.LicenseProvider, { licenseKey: rest.licenseKey, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useContainer.ContainerProvider, { container, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useEditorComponents.EditorComponentsProvider, { overrides: components, children: store ? store instanceof import_store.Store ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithReadyStore, { ...withDefaults, store, user }) : (
127
- // Store is a synced store, so handle syncing stages internally
128
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithLoadingStore, { ...withDefaults, store, user })
129
- ) : (
130
- // We have no store (it's undefined) so create one and possibly sync it
131
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithOwnStore, { ...withDefaults, store, user })
132
- ) }) }) })
133
- }
134
- )
120
+ children: [
121
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
122
+ import_ErrorBoundary.OptionalErrorBoundary,
123
+ {
124
+ fallback: ErrorFallback,
125
+ onError: (error) => (0, import_utils.annotateError)(error, { tags: { origin: "react.tldraw-before-app" } }),
126
+ children: container && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LicenseProvider.LicenseProvider, { licenseKey: rest.licenseKey, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useContainer.ContainerProvider, { container, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EditorPortal.EditorPortalProvider, { host: portalHost, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useEditorComponents.EditorComponentsProvider, { overrides: components, children: store ? store instanceof import_store.Store ? (
127
+ // Store is ready to go, whether externally synced or not
128
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithReadyStore, { ...withDefaults, store, user })
129
+ ) : (
130
+ // Store is a synced store, so handle syncing stages internally
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithLoadingStore, { ...withDefaults, store, user })
132
+ ) : (
133
+ // We have no store (it's undefined) so create one and possibly sync it
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithOwnStore, { ...withDefaults, store, user })
135
+ ) }) }) }) })
136
+ }
137
+ ),
138
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "tl-portal-host", ref: setPortalHost })
139
+ ]
135
140
  }
136
141
  );
137
142
  });