@tldraw/editor 3.10.0-canary.d4dfa96478a4 → 3.10.0-canary.df3cd57be513

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 (122) hide show
  1. package/dist-cjs/index.d.ts +238 -5
  2. package/dist-cjs/index.js +9 -1
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/TldrawEditor.js +32 -6
  5. package/dist-cjs/lib/TldrawEditor.js.map +2 -2
  6. package/dist-cjs/lib/components/Shape.js +7 -0
  7. package/dist-cjs/lib/components/Shape.js.map +2 -2
  8. package/dist-cjs/lib/editor/Editor.js +69 -14
  9. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  10. package/dist-cjs/lib/editor/managers/FontManager.js +166 -0
  11. package/dist-cjs/lib/editor/managers/FontManager.js.map +7 -0
  12. package/dist-cjs/lib/editor/managers/TextManager.js +23 -17
  13. package/dist-cjs/lib/editor/managers/TextManager.js.map +2 -2
  14. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +11 -0
  15. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  16. package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
  17. package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
  18. package/dist-cjs/lib/exports/FontEmbedder.js +7 -2
  19. package/dist-cjs/lib/exports/FontEmbedder.js.map +2 -2
  20. package/dist-cjs/lib/exports/StyleEmbedder.js +1 -1
  21. package/dist-cjs/lib/exports/StyleEmbedder.js.map +2 -2
  22. package/dist-cjs/lib/exports/exportToSvg.js +3 -2
  23. package/dist-cjs/lib/exports/exportToSvg.js.map +2 -2
  24. package/dist-cjs/lib/exports/getSvgJsx.js +18 -1
  25. package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
  26. package/dist-cjs/lib/exports/parseCss.js +1 -0
  27. package/dist-cjs/lib/exports/parseCss.js.map +2 -2
  28. package/dist-cjs/lib/hooks/useCanvasEvents.js +2 -2
  29. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  30. package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js +1 -1
  31. package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js.map +2 -2
  32. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js +48 -0
  33. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +7 -0
  34. package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js.map +2 -2
  35. package/dist-cjs/lib/hooks/usePeerIds.js.map +1 -1
  36. package/dist-cjs/lib/hooks/usePresence.js.map +1 -1
  37. package/dist-cjs/lib/hooks/useViewportHeight.js +56 -0
  38. package/dist-cjs/lib/hooks/useViewportHeight.js.map +7 -0
  39. package/dist-cjs/lib/options.js +2 -1
  40. package/dist-cjs/lib/options.js.map +2 -2
  41. package/dist-cjs/lib/utils/browserCanvasMaxSize.js +5 -0
  42. package/dist-cjs/lib/utils/browserCanvasMaxSize.js.map +2 -2
  43. package/dist-cjs/lib/utils/dom.js +1 -1
  44. package/dist-cjs/lib/utils/dom.js.map +2 -2
  45. package/dist-cjs/lib/utils/richText.js +46 -0
  46. package/dist-cjs/lib/utils/richText.js.map +7 -0
  47. package/dist-cjs/version.js +3 -3
  48. package/dist-cjs/version.js.map +1 -1
  49. package/dist-esm/index.d.mts +238 -5
  50. package/dist-esm/index.mjs +13 -1
  51. package/dist-esm/index.mjs.map +2 -2
  52. package/dist-esm/lib/TldrawEditor.mjs +33 -7
  53. package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
  54. package/dist-esm/lib/components/Shape.mjs +8 -1
  55. package/dist-esm/lib/components/Shape.mjs.map +2 -2
  56. package/dist-esm/lib/editor/Editor.mjs +72 -10
  57. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  58. package/dist-esm/lib/editor/managers/FontManager.mjs +152 -0
  59. package/dist-esm/lib/editor/managers/FontManager.mjs.map +7 -0
  60. package/dist-esm/lib/editor/managers/TextManager.mjs +23 -17
  61. package/dist-esm/lib/editor/managers/TextManager.mjs.map +2 -2
  62. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +11 -0
  63. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  64. package/dist-esm/lib/exports/FontEmbedder.mjs +7 -2
  65. package/dist-esm/lib/exports/FontEmbedder.mjs.map +2 -2
  66. package/dist-esm/lib/exports/StyleEmbedder.mjs +1 -1
  67. package/dist-esm/lib/exports/StyleEmbedder.mjs.map +2 -2
  68. package/dist-esm/lib/exports/exportToSvg.mjs +3 -2
  69. package/dist-esm/lib/exports/exportToSvg.mjs.map +2 -2
  70. package/dist-esm/lib/exports/getSvgJsx.mjs +19 -2
  71. package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
  72. package/dist-esm/lib/exports/parseCss.mjs +1 -0
  73. package/dist-esm/lib/exports/parseCss.mjs.map +2 -2
  74. package/dist-esm/lib/hooks/useCanvasEvents.mjs +2 -2
  75. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  76. package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs +1 -1
  77. package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs.map +2 -2
  78. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs +28 -0
  79. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +7 -0
  80. package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs.map +2 -2
  81. package/dist-esm/lib/hooks/usePeerIds.mjs.map +1 -1
  82. package/dist-esm/lib/hooks/usePresence.mjs.map +1 -1
  83. package/dist-esm/lib/hooks/useViewportHeight.mjs +36 -0
  84. package/dist-esm/lib/hooks/useViewportHeight.mjs.map +7 -0
  85. package/dist-esm/lib/options.mjs +2 -1
  86. package/dist-esm/lib/options.mjs.map +2 -2
  87. package/dist-esm/lib/utils/browserCanvasMaxSize.mjs +5 -0
  88. package/dist-esm/lib/utils/browserCanvasMaxSize.mjs.map +2 -2
  89. package/dist-esm/lib/utils/dom.mjs +1 -1
  90. package/dist-esm/lib/utils/dom.mjs.map +2 -2
  91. package/dist-esm/lib/utils/richText.mjs +26 -0
  92. package/dist-esm/lib/utils/richText.mjs.map +7 -0
  93. package/dist-esm/version.mjs +3 -3
  94. package/dist-esm/version.mjs.map +1 -1
  95. package/editor.css +131 -13
  96. package/package.json +10 -7
  97. package/src/index.ts +15 -0
  98. package/src/lib/TldrawEditor.tsx +52 -4
  99. package/src/lib/components/Shape.tsx +9 -1
  100. package/src/lib/editor/Editor.ts +92 -8
  101. package/src/lib/editor/managers/FontManager.ts +251 -0
  102. package/src/lib/editor/managers/TextManager.ts +42 -17
  103. package/src/lib/editor/shapes/ShapeUtil.ts +13 -0
  104. package/src/lib/editor/types/emit-types.ts +1 -0
  105. package/src/lib/editor/types/external-content.ts +1 -0
  106. package/src/lib/exports/FontEmbedder.ts +13 -1
  107. package/src/lib/exports/StyleEmbedder.ts +1 -1
  108. package/src/lib/exports/exportToSvg.tsx +4 -3
  109. package/src/lib/exports/getSvgJsx.tsx +22 -2
  110. package/src/lib/exports/parseCss.ts +1 -0
  111. package/src/lib/hooks/useCanvasEvents.ts +2 -1
  112. package/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +1 -0
  113. package/src/lib/hooks/usePassThroughMouseOverEvents.ts +29 -0
  114. package/src/lib/hooks/usePassThroughWheelEvents.ts +0 -1
  115. package/src/lib/hooks/usePeerIds.ts +1 -1
  116. package/src/lib/hooks/usePresence.ts +2 -2
  117. package/src/lib/hooks/useViewportHeight.ts +37 -0
  118. package/src/lib/options.ts +7 -0
  119. package/src/lib/utils/browserCanvasMaxSize.ts +5 -3
  120. package/src/lib/utils/dom.ts +1 -1
  121. package/src/lib/utils/richText.ts +72 -0
  122. package/src/version.ts +3 -3
@@ -7,6 +7,8 @@ import { ComponentType } from 'react';
7
7
  import { Computed } from '@tldraw/state';
8
8
  import { computed } from '@tldraw/state';
9
9
  import { Dispatch } from 'react';
10
+ import { Editor as Editor_2 } from '@tiptap/core';
11
+ import { EditorProviderProps } from '@tiptap/react';
10
12
  import { EffectScheduler } from '@tldraw/state';
11
13
  import { EMPTY_ARRAY } from '@tldraw/state';
12
14
  import EventEmitter from 'eventemitter3';
@@ -18,6 +20,7 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
18
20
  import { LegacyMigrations } from '@tldraw/store';
19
21
  import { MigrationSequence } from '@tldraw/store';
20
22
  import { NamedExoticComponent } from 'react';
23
+ import { Node as Node_2 } from '@tiptap/pm/model';
21
24
  import { PerformanceTracker } from '@tldraw/utils';
22
25
  import { PointerEventHandler } from 'react';
23
26
  import { react } from '@tldraw/state';
@@ -66,6 +69,7 @@ import { TLPageId } from '@tldraw/tlschema';
66
69
  import { TLParentId } from '@tldraw/tlschema';
67
70
  import { TLPropsMigrations } from '@tldraw/tlschema';
68
71
  import { TLRecord } from '@tldraw/tlschema';
72
+ import { TLRichText } from '@tldraw/tlschema';
69
73
  import { TLScribble } from '@tldraw/tlschema';
70
74
  import { TLShape } from '@tldraw/tlschema';
71
75
  import { TLShapeCrop } from '@tldraw/tlschema';
@@ -884,6 +888,7 @@ export declare const defaultTldrawOptions: {
884
888
  readonly longPressDurationMs: 500;
885
889
  readonly maxExportDelayMs: 5000;
886
890
  readonly maxFilesAtOnce: 100;
891
+ readonly maxFontsToLoadBeforeRender: number;
887
892
  readonly maxPages: 40;
888
893
  readonly maxShapesPerPage: 4000;
889
894
  readonly multiClickDurationMs: 200;
@@ -979,7 +984,8 @@ export declare class EdgeScrollManager {
979
984
 
980
985
  /** @public */
981
986
  export declare class Editor extends EventEmitter<TLEventMap> {
982
- constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, initialState, autoFocus, inferDarkMode, options, isShapeHidden, }: TLEditorOptions);
987
+ readonly id: string;
988
+ constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options, isShapeHidden, fontAssetUrls, }: TLEditorOptions);
983
989
  private readonly _isShapeHiddenPredicate?;
984
990
  private getIsShapeHiddenCache;
985
991
  isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
@@ -1040,6 +1046,12 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1040
1046
  * @public
1041
1047
  */
1042
1048
  readonly textMeasure: TextManager;
1049
+ /**
1050
+ * A utility for managing the set of fonts that should be rendered in the document.
1051
+ *
1052
+ * @public
1053
+ */
1054
+ readonly fonts: FontManager;
1043
1055
  /**
1044
1056
  * A manager for the editor's environment.
1045
1057
  *
@@ -1679,6 +1691,26 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1679
1691
  * @public
1680
1692
  */
1681
1693
  setEditingShape(shape: null | TLShape | TLShapeId): this;
1694
+ private _currentRichTextEditor;
1695
+ /**
1696
+ * The current editing shape's text editor.
1697
+ *
1698
+ * @public
1699
+ */
1700
+ getRichTextEditor(): null | TiptapEditor;
1701
+ /**
1702
+ * Set the current editing shape's rich text editor.
1703
+ *
1704
+ * @example
1705
+ * ```ts
1706
+ * editor.setRichTextEditor(richTextEditorView)
1707
+ * ```
1708
+ *
1709
+ * @param textEditor - The text editor to set as the current editing shape's text editor.
1710
+ *
1711
+ * @public
1712
+ */
1713
+ setRichTextEditor(textEditor: null | TiptapEditor): this;
1682
1714
  /**
1683
1715
  * The current hovered shape id.
1684
1716
  *
@@ -1779,6 +1811,17 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1779
1811
  * @public
1780
1812
  */
1781
1813
  setCroppingShape(shape: null | TLShape | TLShapeId): this;
1814
+ private _textOptions;
1815
+ /**
1816
+ * Get the current text options.
1817
+ *
1818
+ * @example
1819
+ * ```ts
1820
+ * editor.getTextOptions()
1821
+ * ```
1822
+ *
1823
+ * @public */
1824
+ getTextOptions(): TLTextOptions;
1782
1825
  /* Excluded from this release type: _unsafe_getCameraId */
1783
1826
  /**
1784
1827
  * The current camera.
@@ -3186,7 +3229,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3186
3229
  * @example
3187
3230
  * ```ts
3188
3231
  * editor.createShape(myShape)
3189
- * editor.createShape({ id: 'box1', type: 'text', props: { text: "ok" } })
3232
+ * editor.createShape({ id: 'box1', type: 'text', props: { richText: toRichText("ok") } })
3190
3233
  * ```
3191
3234
  *
3192
3235
  * @param shape - The shape (or shape partial) to create.
@@ -3200,7 +3243,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3200
3243
  * @example
3201
3244
  * ```ts
3202
3245
  * editor.createShapes([myShape])
3203
- * editor.createShapes([{ id: 'box1', type: 'text', props: { text: "ok" } }])
3246
+ * editor.createShapes([{ id: 'box1', type: 'text', props: { richText: toRichText("ok") } }])
3204
3247
  * ```
3205
3248
  *
3206
3249
  * @param shapes - The shapes (or shape partials) to create.
@@ -3959,6 +4002,27 @@ export declare const EVENT_NAME_MAP: Record<Exclude<TLEventName, TLPinchEventNam
3959
4002
 
3960
4003
  /* Excluded from this release type: featureFlags */
3961
4004
 
4005
+ /** @public */
4006
+ export declare class FontManager {
4007
+ private readonly editor;
4008
+ private readonly assetUrls?;
4009
+ constructor(editor: Editor, assetUrls?: {
4010
+ [key: string]: string | undefined;
4011
+ } | undefined);
4012
+ private readonly shapeFontFacesCache;
4013
+ private readonly shapeFontLoadStateCache;
4014
+ getShapeFontFaces(shape: TLShape | TLShapeId): TLFontFace[];
4015
+ trackFontsForShape(shape: TLShape | TLShapeId): void;
4016
+ loadRequiredFontsForCurrentPage(limit?: number): Promise<void>;
4017
+ private readonly fontStates;
4018
+ private getFontState;
4019
+ ensureFontIsLoaded(font: TLFontFace): Promise<void>;
4020
+ private fontsToLoad;
4021
+ requestFonts(fonts: TLFontFace[]): void;
4022
+ private findOrCreateFontFace;
4023
+ toEmbeddedCssDeclaration(font: TLFontFace): Promise<string>;
4024
+ }
4025
+
3962
4026
  /** @public */
3963
4027
  export declare interface GapsSnapIndicator {
3964
4028
  id: string;
@@ -4031,6 +4095,9 @@ export declare function getCursor(cursor: TLCursorType, rotation?: number, color
4031
4095
  /** @public */
4032
4096
  export declare function getDefaultCdnBaseUrl(): string;
4033
4097
 
4098
+ /** @public */
4099
+ export declare function getFontsFromRichText(editor: Editor, richText: TLRichText, initialState: RichTextFontVisitorState): TLFontFace[];
4100
+
4034
4101
  /** @public */
4035
4102
  export declare function getFreshUserPreferences(): TLUserPreferences;
4036
4103
 
@@ -4715,6 +4782,16 @@ export declare function resizeScaled(shape: TLBaseShape<any, {
4715
4782
  y: number;
4716
4783
  };
4717
4784
 
4785
+ /** @public */
4786
+ export declare type RichTextFontVisitor = (node: TiptapNode, state: RichTextFontVisitorState, addFont: (font: TLFontFace) => void) => RichTextFontVisitorState;
4787
+
4788
+ /** @public */
4789
+ export declare interface RichTextFontVisitorState {
4790
+ readonly family: string;
4791
+ readonly weight: string;
4792
+ readonly style: string;
4793
+ }
4794
+
4718
4795
  /** @public */
4719
4796
  export declare const ROTATE_CORNER_TO_SELECTION_CORNER: {
4720
4797
  readonly bottom_left_rotate: "bottom_left";
@@ -4897,6 +4974,14 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
4897
4974
  * @public
4898
4975
  */
4899
4976
  abstract indicator(shape: Shape): any;
4977
+ /**
4978
+ * Get the font faces that should be rendered in the document in order for this shape to render
4979
+ * correctly.
4980
+ *
4981
+ * @param shape - The shape.
4982
+ * @public
4983
+ */
4984
+ getFontFaces(shape: Shape): TLFontFace[];
4900
4985
  /**
4901
4986
  * Whether the shape can be snapped to by another shape.
4902
4987
  *
@@ -5554,6 +5639,24 @@ export declare class TextManager {
5554
5639
  }): BoxModel & {
5555
5640
  scrollWidth: number;
5556
5641
  };
5642
+ measureHtml(html: string, opts: {
5643
+ /**
5644
+ * When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
5645
+ * is null, the text will be measured without wrapping, but explicit line breaks and
5646
+ * space are preserved.
5647
+ */
5648
+ maxWidth: null | number;
5649
+ disableOverflowWrapBreaking?: boolean;
5650
+ fontFamily: string;
5651
+ fontSize: number;
5652
+ fontStyle: string;
5653
+ fontWeight: string;
5654
+ lineHeight: number;
5655
+ minWidth?: null | number;
5656
+ padding: string;
5657
+ }): BoxModel & {
5658
+ scrollWidth: number;
5659
+ };
5557
5660
  /**
5558
5661
  * Given an html element, measure the position of each span of unbroken
5559
5662
  * word/white-space characters within any text nodes it contains.
@@ -5581,6 +5684,19 @@ export declare class TextManager {
5581
5684
  }[];
5582
5685
  }
5583
5686
 
5687
+ /**
5688
+ * This is the TipTap editor! Docs are {@link https://tiptap.dev/docs}.
5689
+ *
5690
+ * @public
5691
+ */
5692
+ export declare type TiptapEditor = Editor_2;
5693
+
5694
+ /**
5695
+ * A TipTap node. See {@link https://tiptap.dev/docs}.
5696
+ * @public
5697
+ */
5698
+ export declare type TiptapNode = Node_2;
5699
+
5584
5700
  /** @public */
5585
5701
  export declare type TLAnyBindingUtilConstructor = TLBindingUtilConstructor<any>;
5586
5702
 
@@ -5907,6 +6023,10 @@ export declare interface TldrawEditorBaseProps {
5907
6023
  * Camera options for the editor.
5908
6024
  */
5909
6025
  cameraOptions?: Partial<TLCameraOptions>;
6026
+ /**
6027
+ * Text options for the editor.
6028
+ */
6029
+ textOptions?: TLTextOptions;
5910
6030
  /**
5911
6031
  * Options for the editor.
5912
6032
  */
@@ -5927,6 +6047,14 @@ export declare interface TldrawEditorBaseProps {
5927
6047
  * remain in the store and participate in all other operations.
5928
6048
  */
5929
6049
  isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6050
+ /**
6051
+ * The URLs for the fonts to use in the editor.
6052
+ */
6053
+ assetUrls?: {
6054
+ fonts?: {
6055
+ [key: string]: string | undefined;
6056
+ };
6057
+ };
5930
6058
  }
5931
6059
 
5932
6060
  /**
@@ -6050,6 +6178,12 @@ export declare interface TldrawOptions {
6050
6178
  * By default, the toolbar items are accessible via number shortcuts according to their order. To disable this, set this option to false.
6051
6179
  */
6052
6180
  readonly enableToolbarKeyboardShortcuts: boolean;
6181
+ /**
6182
+ * The maximum number of fonts that will be loaded while blocking the main rendering of the
6183
+ * canvas. If there are more than this number of fonts needed, we'll just show the canvas right
6184
+ * away and let the fonts load in in the background.
6185
+ */
6186
+ readonly maxFontsToLoadBeforeRender: number;
6053
6187
  }
6054
6188
 
6055
6189
  /** @public */
@@ -6127,8 +6261,12 @@ export declare interface TLEditorOptions {
6127
6261
  * Options for the editor's camera.
6128
6262
  */
6129
6263
  cameraOptions?: Partial<TLCameraOptions>;
6264
+ textOptions?: TLTextOptions;
6130
6265
  options?: Partial<TldrawOptions>;
6131
6266
  licenseKey?: string;
6267
+ fontAssetUrls?: {
6268
+ [key: string]: string | undefined;
6269
+ };
6132
6270
  /**
6133
6271
  * A predicate that should return true if the given shape should be hidden.
6134
6272
  * @param shape - The shape to check.
@@ -6243,6 +6381,13 @@ export declare interface TLEventMap {
6243
6381
  'select-all-text': [{
6244
6382
  shapeId: TLShapeId;
6245
6383
  }];
6384
+ 'place-caret': [{
6385
+ point: {
6386
+ x: number;
6387
+ y: number;
6388
+ };
6389
+ shapeId: TLShapeId;
6390
+ }];
6246
6391
  }
6247
6392
 
6248
6393
  /** @public */
@@ -6292,6 +6437,72 @@ export declare interface TLFilesExternalContent extends TLBaseExternalContent {
6292
6437
  ignoreParent: boolean;
6293
6438
  }
6294
6439
 
6440
+ /**
6441
+ * A font face that can be used in the editor. The properties of this are largely the same as the
6442
+ * ones in the
6443
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face | css `@font-face` rule}.
6444
+ * @public
6445
+ */
6446
+ export declare interface TLFontFace {
6447
+ /**
6448
+ * How this font can be referred to in CSS.
6449
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-family | `font-family`}.
6450
+ */
6451
+ readonly family: string;
6452
+ /**
6453
+ * The source of the font. This
6454
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src | `src`}.
6455
+ */
6456
+ readonly src: TLFontFaceSource;
6457
+ /**
6458
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/ascent-override | `ascent-override`}.
6459
+ */
6460
+ readonly ascentOverride?: string;
6461
+ /**
6462
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/descent-override | `descent-override`}.
6463
+ */
6464
+ readonly descentOverride?: string;
6465
+ /**
6466
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-stretch | `font-stretch`}.
6467
+ */
6468
+ readonly stretch?: string;
6469
+ /**
6470
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-style | `font-style`}.
6471
+ */
6472
+ readonly style?: string;
6473
+ /**
6474
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-weight | `font-weight`}.
6475
+ */
6476
+ readonly weight?: string;
6477
+ /**
6478
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-feature-settings | `font-feature-settings`}.
6479
+ */
6480
+ readonly featureSettings?: string;
6481
+ /**
6482
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/line-gap-override | `line-gap-override`}.
6483
+ */
6484
+ readonly lineGapOverride?: string;
6485
+ /**
6486
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range | `unicode-range`}.
6487
+ */
6488
+ readonly unicodeRange?: string;
6489
+ }
6490
+
6491
+ /**
6492
+ * Represents the `src` property of a {@link TLFontFace}.
6493
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src | `src`} for details of the properties here.
6494
+ * @public
6495
+ */
6496
+ export declare interface TLFontFaceSource {
6497
+ /**
6498
+ * A URL from which to load the font. If the value here is a key in
6499
+ * {@link tldraw#TLEditorAssetUrls.fonts}, the value from there will be used instead.
6500
+ */
6501
+ url: string;
6502
+ format?: string;
6503
+ tech?: string;
6504
+ }
6505
+
6295
6506
  /** Additional options for the {@link ShapeUtil.getGeometry} method.
6296
6507
  *
6297
6508
  * @public
@@ -6944,6 +7155,7 @@ export declare interface TLSvgTextExternalContent extends TLBaseExternalContent
6944
7155
  export declare interface TLTextExternalContent extends TLBaseExternalContent {
6945
7156
  type: 'text';
6946
7157
  text: string;
7158
+ html?: string;
6947
7159
  }
6948
7160
 
6949
7161
  /** @public */
@@ -6953,6 +7165,12 @@ export declare interface TLTextExternalContentSource {
6953
7165
  subtype: 'html' | 'json' | 'text' | 'url';
6954
7166
  }
6955
7167
 
7168
+ /** @public */
7169
+ export declare interface TLTextOptions {
7170
+ tipTapConfig?: EditorProviderProps;
7171
+ addFontsFromNode?: RichTextFontVisitor;
7172
+ }
7173
+
6956
7174
  /** @public */
6957
7175
  export declare type TLTickEvent = (info: TLTickEventInfo) => void;
6958
7176
 
@@ -7124,12 +7342,24 @@ export declare function useMaybeEditor(): Editor | null;
7124
7342
 
7125
7343
  /* Excluded from this release type: useOnMount */
7126
7344
 
7345
+ /** @public */
7346
+ export declare function usePassThroughMouseOverEvents(ref: RefObject<HTMLElement>): void;
7347
+
7127
7348
  /** @public */
7128
7349
  export declare function usePassThroughWheelEvents(ref: RefObject<HTMLElement>): void;
7129
7350
 
7130
- /* Excluded from this release type: usePeerIds */
7351
+ /**
7352
+ * @returns The list of peer UserIDs
7353
+ * @public
7354
+ */
7355
+ export declare function usePeerIds(): string[];
7356
+
7357
+ /**
7358
+ * @returns The latest presence of the user matching userId
7359
+ * @public
7360
+ */
7361
+ export declare function usePresence(userId: string): null | TLInstancePresence;
7131
7362
 
7132
- /* Excluded from this release type: usePresence */
7133
7363
  export { useQuickReactor }
7134
7364
 
7135
7365
  /* Excluded from this release type: USER_COLORS */
@@ -7235,6 +7465,9 @@ export declare function useUniqueSafeId(suffix?: string): SafeId;
7235
7465
 
7236
7466
  export { useValue }
7237
7467
 
7468
+ /** @public */
7469
+ export declare function useViewportHeight(): number;
7470
+
7238
7471
  /* Excluded from this release type: ValidLicenseKeyResult */
7239
7472
 
7240
7473
  /** @public */
@@ -24,6 +24,9 @@ import {
24
24
  useValue
25
25
  } from "@tldraw/state-react";
26
26
  import { resizeScaled } from "./lib/editor/shapes/shared/resizeScaled.mjs";
27
+ import {
28
+ getFontsFromRichText
29
+ } from "./lib/utils/richText.mjs";
27
30
  import { LocalIndexedDb, Table } from "./lib/utils/sync/LocalIndexedDb.mjs";
28
31
  export * from "@tldraw/store";
29
32
  export * from "@tldraw/tlschema";
@@ -115,6 +118,9 @@ import {
115
118
  } from "./lib/editor/bindings/BindingUtil.mjs";
116
119
  import { ClickManager } from "./lib/editor/managers/ClickManager.mjs";
117
120
  import { EdgeScrollManager } from "./lib/editor/managers/EdgeScrollManager.mjs";
121
+ import {
122
+ FontManager
123
+ } from "./lib/editor/managers/FontManager.mjs";
118
124
  import { HistoryManager } from "./lib/editor/managers/HistoryManager.mjs";
119
125
  import { ScribbleManager } from "./lib/editor/managers/ScribbleManager.mjs";
120
126
  import {
@@ -162,6 +168,7 @@ import { useIsCropping } from "./lib/hooks/useIsCropping.mjs";
162
168
  import { useIsDarkMode } from "./lib/hooks/useIsDarkMode.mjs";
163
169
  import { useIsEditing } from "./lib/hooks/useIsEditing.mjs";
164
170
  import { useLocalStore } from "./lib/hooks/useLocalStore.mjs";
171
+ import { usePassThroughMouseOverEvents } from "./lib/hooks/usePassThroughMouseOverEvents.mjs";
165
172
  import { usePassThroughWheelEvents } from "./lib/hooks/usePassThroughWheelEvents.mjs";
166
173
  import { usePeerIds } from "./lib/hooks/usePeerIds.mjs";
167
174
  import { usePresence } from "./lib/hooks/usePresence.mjs";
@@ -175,6 +182,7 @@ import {
175
182
  import { useSelectionEvents } from "./lib/hooks/useSelectionEvents.mjs";
176
183
  import { useTLSchemaFromUtils, useTLStore } from "./lib/hooks/useTLStore.mjs";
177
184
  import { useTransform } from "./lib/hooks/useTransform.mjs";
185
+ import { useViewportHeight } from "./lib/hooks/useViewportHeight.mjs";
178
186
  import {
179
187
  LicenseManager
180
188
  } from "./lib/license/LicenseManager.mjs";
@@ -289,7 +297,7 @@ function debugEnableLicensing() {
289
297
  }
290
298
  registerTldrawLibraryVersion(
291
299
  "@tldraw/editor",
292
- "3.10.0-canary.d4dfa96478a4",
300
+ "3.10.0-canary.df3cd57be513",
293
301
  "esm"
294
302
  );
295
303
  export {
@@ -334,6 +342,7 @@ export {
334
342
  Ellipse2d,
335
343
  ErrorBoundary,
336
344
  ErrorScreen,
345
+ FontManager,
337
346
  Geometry2d,
338
347
  Group2d,
339
348
  GroupShapeUtil,
@@ -403,6 +412,7 @@ export {
403
412
  getArcMeasure,
404
413
  getCursor,
405
414
  getDefaultCdnBaseUrl,
415
+ getFontsFromRichText,
406
416
  getFreshUserPreferences,
407
417
  getIncrementedName,
408
418
  getPerfectDashProps,
@@ -486,6 +496,7 @@ export {
486
496
  useLocalStore,
487
497
  useMaybeEditor,
488
498
  useOnMount,
499
+ usePassThroughMouseOverEvents,
489
500
  usePassThroughWheelEvents,
490
501
  usePeerIds,
491
502
  usePresence,
@@ -505,6 +516,7 @@ export {
505
516
  useTransform,
506
517
  useUniqueSafeId,
507
518
  useValue,
519
+ useViewportHeight,
508
520
  userTypeValidator,
509
521
  whyAmIRunning
510
522
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\nexport {\n\tEMPTY_ARRAY,\n\tEffectScheduler,\n\tatom,\n\tcomputed,\n\treact,\n\ttransact,\n\ttransaction,\n\twhyAmIRunning,\n\ttype Atom,\n\ttype Signal,\n} from '@tldraw/state'\nexport {\n\ttrack,\n\tuseAtom,\n\tuseComputed,\n\tuseQuickReactor,\n\tuseReactor,\n\tuseStateTracking,\n\tuseValue,\n} from '@tldraw/state-react'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\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 { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport { DefaultShapeIndicators } from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tTAB_ID,\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tUSER_COLORS,\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\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 { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager'\nexport { ScribbleManager, type ScribbleItem } from './lib/editor/managers/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 { TextManager, type TLMeasureTextSpanOpts } from './lib/editor/managers/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport { getPerfectDashProps } from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\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 {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\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 TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\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 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 TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLSvgOptions,\n} from './lib/editor/types/misc-types'\nexport { type TLResizeHandle, type TLSelectionHandle } from './lib/editor/types/selection-types'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport { EditorContext, useEditor, useMaybeEditor } from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\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 { Geometry2d, type Geometry2dOptions } 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 {\n\tHALF_PI,\n\tPI,\n\tPI2,\n\tSIN,\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\tisSafeFloat,\n\tperimeterOfEllipse,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
- "mappings": "AAAA,SAAS,oCAAoC;AAC7C,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\nexport {\n\tEMPTY_ARRAY,\n\tEffectScheduler,\n\tatom,\n\tcomputed,\n\treact,\n\ttransact,\n\ttransaction,\n\twhyAmIRunning,\n\ttype Atom,\n\ttype Signal,\n} from '@tldraw/state'\nexport {\n\ttrack,\n\tuseAtom,\n\tuseComputed,\n\tuseQuickReactor,\n\tuseReactor,\n\tuseStateTracking,\n\tuseValue,\n} from '@tldraw/state-react'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TLTextOptions,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n} from './lib/utils/richText'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\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 { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport { DefaultShapeIndicators } from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tTAB_ID,\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tUSER_COLORS,\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\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 { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager'\nexport { ScribbleManager, type ScribbleItem } from './lib/editor/managers/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 { TextManager, type TLMeasureTextSpanOpts } from './lib/editor/managers/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport { getPerfectDashProps } from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\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 {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\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 TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\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 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 TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLSvgOptions,\n} from './lib/editor/types/misc-types'\nexport { type TLResizeHandle, type TLSelectionHandle } from './lib/editor/types/selection-types'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport { EditorContext, useEditor, useMaybeEditor } from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\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 { Geometry2d, type Geometry2dOptions } 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 {\n\tHALF_PI,\n\tPI,\n\tPI2,\n\tSIN,\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\tisSafeFloat,\n\tperimeterOfEllipse,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
+ "mappings": "AAAA,SAAS,oCAAoC;AAC7C,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,OAMM;AACP,SAAS,gBAAgB,aAA6B;AAEtD,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,qBAA8C;AACvD,SAAS,wBAAwB;AACjC,SAAS,oBAA4C;AACrD,SAAS,yBAAyB;AAClC,SAAS,oBAAuC;AAChD;AAAA,EACC;AAAA,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