@tldraw/editor 3.9.0-canary.ffd990988638 → 3.9.0-internal.7f0e15f4f7d9
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.
- package/dist-cjs/index.d.ts +228 -3
- package/dist-cjs/index.js +9 -1
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/TldrawEditor.js +33 -6
- package/dist-cjs/lib/TldrawEditor.js.map +2 -2
- package/dist-cjs/lib/components/Shape.js +7 -0
- package/dist-cjs/lib/components/Shape.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +63 -8
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/FontManager.js +167 -0
- package/dist-cjs/lib/editor/managers/FontManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/TextManager.js +23 -17
- package/dist-cjs/lib/editor/managers/TextManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js +11 -0
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
- package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
- package/dist-cjs/lib/exports/FontEmbedder.js +7 -2
- package/dist-cjs/lib/exports/FontEmbedder.js.map +2 -2
- package/dist-cjs/lib/exports/StyleEmbedder.js +1 -1
- package/dist-cjs/lib/exports/StyleEmbedder.js.map +2 -2
- package/dist-cjs/lib/exports/exportToSvg.js +3 -2
- package/dist-cjs/lib/exports/exportToSvg.js.map +2 -2
- package/dist-cjs/lib/exports/getSvgAsImage.js +1 -1
- package/dist-cjs/lib/exports/getSvgAsImage.js.map +2 -2
- package/dist-cjs/lib/exports/getSvgJsx.js +18 -1
- package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
- package/dist-cjs/lib/exports/parseCss.js +1 -0
- package/dist-cjs/lib/exports/parseCss.js.map +2 -2
- package/dist-cjs/lib/globals/environment.js +3 -1
- package/dist-cjs/lib/globals/environment.js.map +2 -2
- package/dist-cjs/lib/hooks/useCanvasEvents.js +2 -2
- package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js +1 -1
- package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js +48 -0
- package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +7 -0
- package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useViewportHeight.js +56 -0
- package/dist-cjs/lib/hooks/useViewportHeight.js.map +7 -0
- package/dist-cjs/lib/license/LicenseManager.js +1 -1
- package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
- package/dist-cjs/lib/options.js +2 -1
- package/dist-cjs/lib/options.js.map +2 -2
- package/dist-cjs/lib/utils/browserCanvasMaxSize.js +104 -28
- package/dist-cjs/lib/utils/browserCanvasMaxSize.js.map +3 -3
- package/dist-cjs/lib/utils/dom.js +1 -1
- package/dist-cjs/lib/utils/dom.js.map +2 -2
- package/dist-cjs/lib/utils/richText.js +46 -0
- package/dist-cjs/lib/utils/richText.js.map +7 -0
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +228 -3
- package/dist-esm/index.mjs +13 -1
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/TldrawEditor.mjs +34 -7
- package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
- package/dist-esm/lib/components/Shape.mjs +8 -1
- package/dist-esm/lib/components/Shape.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +71 -9
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/FontManager.mjs +153 -0
- package/dist-esm/lib/editor/managers/FontManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/TextManager.mjs +23 -17
- package/dist-esm/lib/editor/managers/TextManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +11 -0
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/exports/FontEmbedder.mjs +7 -2
- package/dist-esm/lib/exports/FontEmbedder.mjs.map +2 -2
- package/dist-esm/lib/exports/StyleEmbedder.mjs +1 -1
- package/dist-esm/lib/exports/StyleEmbedder.mjs.map +2 -2
- package/dist-esm/lib/exports/exportToSvg.mjs +3 -2
- package/dist-esm/lib/exports/exportToSvg.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgAsImage.mjs +1 -1
- package/dist-esm/lib/exports/getSvgAsImage.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs +19 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
- package/dist-esm/lib/exports/parseCss.mjs +1 -0
- package/dist-esm/lib/exports/parseCss.mjs.map +2 -2
- package/dist-esm/lib/globals/environment.mjs +3 -1
- package/dist-esm/lib/globals/environment.mjs.map +2 -2
- package/dist-esm/lib/hooks/useCanvasEvents.mjs +2 -2
- package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs +1 -1
- package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs +28 -0
- package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +7 -0
- package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useViewportHeight.mjs +36 -0
- package/dist-esm/lib/hooks/useViewportHeight.mjs.map +7 -0
- package/dist-esm/lib/license/LicenseManager.mjs +1 -1
- package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
- package/dist-esm/lib/options.mjs +2 -1
- package/dist-esm/lib/options.mjs.map +2 -2
- package/dist-esm/lib/utils/browserCanvasMaxSize.mjs +104 -18
- package/dist-esm/lib/utils/browserCanvasMaxSize.mjs.map +2 -2
- package/dist-esm/lib/utils/dom.mjs +1 -1
- package/dist-esm/lib/utils/dom.mjs.map +2 -2
- package/dist-esm/lib/utils/richText.mjs +26 -0
- package/dist-esm/lib/utils/richText.mjs.map +7 -0
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +127 -13
- package/package.json +10 -9
- package/src/index.ts +15 -0
- package/src/lib/TldrawEditor.tsx +52 -4
- package/src/lib/components/Shape.tsx +9 -1
- package/src/lib/editor/Editor.ts +91 -7
- package/src/lib/editor/managers/FontManager.ts +252 -0
- package/src/lib/editor/managers/TextManager.ts +42 -17
- package/src/lib/editor/shapes/ShapeUtil.ts +13 -0
- package/src/lib/editor/types/emit-types.ts +1 -0
- package/src/lib/editor/types/external-content.ts +1 -0
- package/src/lib/exports/FontEmbedder.ts +13 -1
- package/src/lib/exports/StyleEmbedder.ts +1 -1
- package/src/lib/exports/exportToSvg.tsx +4 -3
- package/src/lib/exports/getSvgAsImage.ts +1 -1
- package/src/lib/exports/getSvgJsx.tsx +22 -2
- package/src/lib/exports/parseCss.ts +1 -0
- package/src/lib/globals/environment.ts +3 -0
- package/src/lib/hooks/useCanvasEvents.ts +2 -1
- package/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +1 -0
- package/src/lib/hooks/usePassThroughMouseOverEvents.ts +29 -0
- package/src/lib/hooks/usePassThroughWheelEvents.ts +0 -1
- package/src/lib/hooks/useViewportHeight.ts +37 -0
- package/src/lib/license/LicenseManager.test.ts +16 -13
- package/src/lib/license/LicenseManager.ts +2 -2
- package/src/lib/options.ts +7 -0
- package/src/lib/utils/browserCanvasMaxSize.ts +121 -21
- package/src/lib/utils/dom.ts +1 -1
- package/src/lib/utils/richText.ts +72 -0
- package/src/version.ts +3 -3
package/dist-esm/index.d.mts
CHANGED
|
@@ -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,7 @@ 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
|
+
constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options, isShapeHidden, fontAssetUrls, }: TLEditorOptions);
|
|
983
988
|
private readonly _isShapeHiddenPredicate?;
|
|
984
989
|
private getIsShapeHiddenCache;
|
|
985
990
|
isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
|
|
@@ -1040,6 +1045,12 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1040
1045
|
* @public
|
|
1041
1046
|
*/
|
|
1042
1047
|
readonly textMeasure: TextManager;
|
|
1048
|
+
/**
|
|
1049
|
+
* A utility for managing the set of fonts that should be rendered in the document.
|
|
1050
|
+
*
|
|
1051
|
+
* @public
|
|
1052
|
+
*/
|
|
1053
|
+
readonly fonts: FontManager;
|
|
1043
1054
|
/**
|
|
1044
1055
|
* A manager for the editor's environment.
|
|
1045
1056
|
*
|
|
@@ -1047,6 +1058,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1047
1058
|
* @public
|
|
1048
1059
|
*/
|
|
1049
1060
|
readonly environment: {
|
|
1061
|
+
hasCanvasSupport: boolean;
|
|
1050
1062
|
isAndroid: boolean;
|
|
1051
1063
|
isChromeForIos: boolean;
|
|
1052
1064
|
isDarwin: boolean;
|
|
@@ -1678,6 +1690,26 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1678
1690
|
* @public
|
|
1679
1691
|
*/
|
|
1680
1692
|
setEditingShape(shape: null | TLShape | TLShapeId): this;
|
|
1693
|
+
private _currentRichTextEditor;
|
|
1694
|
+
/**
|
|
1695
|
+
* The current editing shape's text editor.
|
|
1696
|
+
*
|
|
1697
|
+
* @public
|
|
1698
|
+
*/
|
|
1699
|
+
getRichTextEditor(): null | TiptapEditor;
|
|
1700
|
+
/**
|
|
1701
|
+
* Set the current editing shape's rich text editor.
|
|
1702
|
+
*
|
|
1703
|
+
* @example
|
|
1704
|
+
* ```ts
|
|
1705
|
+
* editor.setRichTextEditor(richTextEditorView)
|
|
1706
|
+
* ```
|
|
1707
|
+
*
|
|
1708
|
+
* @param textEditor - The text editor to set as the current editing shape's text editor.
|
|
1709
|
+
*
|
|
1710
|
+
* @public
|
|
1711
|
+
*/
|
|
1712
|
+
setRichTextEditor(textEditor: null | TiptapEditor): this;
|
|
1681
1713
|
/**
|
|
1682
1714
|
* The current hovered shape id.
|
|
1683
1715
|
*
|
|
@@ -1778,6 +1810,17 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1778
1810
|
* @public
|
|
1779
1811
|
*/
|
|
1780
1812
|
setCroppingShape(shape: null | TLShape | TLShapeId): this;
|
|
1813
|
+
private _textOptions;
|
|
1814
|
+
/**
|
|
1815
|
+
* Get the current text options.
|
|
1816
|
+
*
|
|
1817
|
+
* @example
|
|
1818
|
+
* ```ts
|
|
1819
|
+
* editor.getTextOptions()
|
|
1820
|
+
* ```
|
|
1821
|
+
*
|
|
1822
|
+
* @public */
|
|
1823
|
+
getTextOptions(): TLTextOptions;
|
|
1781
1824
|
/* Excluded from this release type: _unsafe_getCameraId */
|
|
1782
1825
|
/**
|
|
1783
1826
|
* The current camera.
|
|
@@ -3182,7 +3225,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3182
3225
|
* @example
|
|
3183
3226
|
* ```ts
|
|
3184
3227
|
* editor.createShape(myShape)
|
|
3185
|
-
* editor.createShape({ id: 'box1', type: 'text', props: {
|
|
3228
|
+
* editor.createShape({ id: 'box1', type: 'text', props: { richText: toRichText("ok") } })
|
|
3186
3229
|
* ```
|
|
3187
3230
|
*
|
|
3188
3231
|
* @param shape - The shape (or shape partial) to create.
|
|
@@ -3196,7 +3239,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3196
3239
|
* @example
|
|
3197
3240
|
* ```ts
|
|
3198
3241
|
* editor.createShapes([myShape])
|
|
3199
|
-
* editor.createShapes([{ id: 'box1', type: 'text', props: {
|
|
3242
|
+
* editor.createShapes([{ id: 'box1', type: 'text', props: { richText: toRichText("ok") } }])
|
|
3200
3243
|
* ```
|
|
3201
3244
|
*
|
|
3202
3245
|
* @param shapes - The shapes (or shape partials) to create.
|
|
@@ -3955,6 +3998,27 @@ export declare const EVENT_NAME_MAP: Record<Exclude<TLEventName, TLPinchEventNam
|
|
|
3955
3998
|
|
|
3956
3999
|
/* Excluded from this release type: featureFlags */
|
|
3957
4000
|
|
|
4001
|
+
/** @public */
|
|
4002
|
+
export declare class FontManager {
|
|
4003
|
+
private readonly editor;
|
|
4004
|
+
private readonly assetUrls?;
|
|
4005
|
+
constructor(editor: Editor, assetUrls?: {
|
|
4006
|
+
[key: string]: string | undefined;
|
|
4007
|
+
} | undefined);
|
|
4008
|
+
private readonly shapeFontFacesCache;
|
|
4009
|
+
private readonly shapeFontLoadStateCache;
|
|
4010
|
+
getShapeFontFaces(shape: TLShape | TLShapeId): TLFontFace[];
|
|
4011
|
+
trackFontsForShape(shape: TLShape | TLShapeId): void;
|
|
4012
|
+
loadRequiredFontsForCurrentPage(limit?: number): Promise<void>;
|
|
4013
|
+
private readonly fontStates;
|
|
4014
|
+
private getFontState;
|
|
4015
|
+
ensureFontIsLoaded(font: TLFontFace): Promise<void>;
|
|
4016
|
+
private fontsToLoad;
|
|
4017
|
+
requestFonts(fonts: TLFontFace[]): void;
|
|
4018
|
+
private findOrCreateFontFace;
|
|
4019
|
+
toEmbeddedCssDeclaration(font: TLFontFace): Promise<string>;
|
|
4020
|
+
}
|
|
4021
|
+
|
|
3958
4022
|
/** @public */
|
|
3959
4023
|
export declare interface GapsSnapIndicator {
|
|
3960
4024
|
id: string;
|
|
@@ -4027,6 +4091,9 @@ export declare function getCursor(cursor: TLCursorType, rotation?: number, color
|
|
|
4027
4091
|
/** @public */
|
|
4028
4092
|
export declare function getDefaultCdnBaseUrl(): string;
|
|
4029
4093
|
|
|
4094
|
+
/** @public */
|
|
4095
|
+
export declare function getFontsFromRichText(editor: Editor, richText: TLRichText, initialState: RichTextFontVisitorState): TLFontFace[];
|
|
4096
|
+
|
|
4030
4097
|
/** @public */
|
|
4031
4098
|
export declare function getFreshUserPreferences(): TLUserPreferences;
|
|
4032
4099
|
|
|
@@ -4711,6 +4778,16 @@ export declare function resizeScaled(shape: TLBaseShape<any, {
|
|
|
4711
4778
|
y: number;
|
|
4712
4779
|
};
|
|
4713
4780
|
|
|
4781
|
+
/** @public */
|
|
4782
|
+
export declare type RichTextFontVisitor = (node: TiptapNode, state: RichTextFontVisitorState, addFont: (font: TLFontFace) => void) => RichTextFontVisitorState;
|
|
4783
|
+
|
|
4784
|
+
/** @public */
|
|
4785
|
+
export declare interface RichTextFontVisitorState {
|
|
4786
|
+
readonly family: string;
|
|
4787
|
+
readonly weight: string;
|
|
4788
|
+
readonly style: string;
|
|
4789
|
+
}
|
|
4790
|
+
|
|
4714
4791
|
/** @public */
|
|
4715
4792
|
export declare const ROTATE_CORNER_TO_SELECTION_CORNER: {
|
|
4716
4793
|
readonly bottom_left_rotate: "bottom_left";
|
|
@@ -4892,6 +4969,14 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
4892
4969
|
* @public
|
|
4893
4970
|
*/
|
|
4894
4971
|
abstract indicator(shape: Shape): any;
|
|
4972
|
+
/**
|
|
4973
|
+
* Get the font faces that should be rendered in the document in order for this shape to render
|
|
4974
|
+
* correctly.
|
|
4975
|
+
*
|
|
4976
|
+
* @param shape - The shape.
|
|
4977
|
+
* @public
|
|
4978
|
+
*/
|
|
4979
|
+
getFontFaces(shape: Shape): TLFontFace[];
|
|
4895
4980
|
/**
|
|
4896
4981
|
* Whether the shape can be snapped to by another shape.
|
|
4897
4982
|
*
|
|
@@ -5544,6 +5629,24 @@ export declare class TextManager {
|
|
|
5544
5629
|
}): BoxModel & {
|
|
5545
5630
|
scrollWidth: number;
|
|
5546
5631
|
};
|
|
5632
|
+
measureHtml(html: string, opts: {
|
|
5633
|
+
/**
|
|
5634
|
+
* When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
|
|
5635
|
+
* is null, the text will be measured without wrapping, but explicit line breaks and
|
|
5636
|
+
* space are preserved.
|
|
5637
|
+
*/
|
|
5638
|
+
maxWidth: null | number;
|
|
5639
|
+
disableOverflowWrapBreaking?: boolean;
|
|
5640
|
+
fontFamily: string;
|
|
5641
|
+
fontSize: number;
|
|
5642
|
+
fontStyle: string;
|
|
5643
|
+
fontWeight: string;
|
|
5644
|
+
lineHeight: number;
|
|
5645
|
+
minWidth?: null | number;
|
|
5646
|
+
padding: string;
|
|
5647
|
+
}): BoxModel & {
|
|
5648
|
+
scrollWidth: number;
|
|
5649
|
+
};
|
|
5547
5650
|
/**
|
|
5548
5651
|
* Given an html element, measure the position of each span of unbroken
|
|
5549
5652
|
* word/white-space characters within any text nodes it contains.
|
|
@@ -5571,6 +5674,19 @@ export declare class TextManager {
|
|
|
5571
5674
|
}[];
|
|
5572
5675
|
}
|
|
5573
5676
|
|
|
5677
|
+
/**
|
|
5678
|
+
* This is the TipTap editor! Docs are {@link https://tiptap.dev/docs}.
|
|
5679
|
+
*
|
|
5680
|
+
* @public
|
|
5681
|
+
*/
|
|
5682
|
+
export declare type TiptapEditor = Editor_2;
|
|
5683
|
+
|
|
5684
|
+
/**
|
|
5685
|
+
* A TipTap node. See {@link https://tiptap.dev/docs}.
|
|
5686
|
+
* @public
|
|
5687
|
+
*/
|
|
5688
|
+
export declare type TiptapNode = Node_2;
|
|
5689
|
+
|
|
5574
5690
|
/** @public */
|
|
5575
5691
|
export declare type TLAnyBindingUtilConstructor = TLBindingUtilConstructor<any>;
|
|
5576
5692
|
|
|
@@ -5894,6 +6010,10 @@ export declare interface TldrawEditorBaseProps {
|
|
|
5894
6010
|
* Camera options for the editor.
|
|
5895
6011
|
*/
|
|
5896
6012
|
cameraOptions?: Partial<TLCameraOptions>;
|
|
6013
|
+
/**
|
|
6014
|
+
* Text options for the editor.
|
|
6015
|
+
*/
|
|
6016
|
+
textOptions?: TLTextOptions;
|
|
5897
6017
|
/**
|
|
5898
6018
|
* Options for the editor.
|
|
5899
6019
|
*/
|
|
@@ -5914,6 +6034,14 @@ export declare interface TldrawEditorBaseProps {
|
|
|
5914
6034
|
* remain in the store and participate in all other operations.
|
|
5915
6035
|
*/
|
|
5916
6036
|
isShapeHidden?(shape: TLShape, editor: Editor): boolean;
|
|
6037
|
+
/**
|
|
6038
|
+
* The URLs for the fonts to use in the editor.
|
|
6039
|
+
*/
|
|
6040
|
+
assetUrls?: {
|
|
6041
|
+
fonts?: {
|
|
6042
|
+
[key: string]: string | undefined;
|
|
6043
|
+
};
|
|
6044
|
+
};
|
|
5917
6045
|
}
|
|
5918
6046
|
|
|
5919
6047
|
/**
|
|
@@ -6037,6 +6165,12 @@ export declare interface TldrawOptions {
|
|
|
6037
6165
|
* By default, the toolbar items are accessible via number shortcuts according to their order. To disable this, set this option to false.
|
|
6038
6166
|
*/
|
|
6039
6167
|
readonly enableToolbarKeyboardShortcuts: boolean;
|
|
6168
|
+
/**
|
|
6169
|
+
* The maximum number of fonts that will be loaded while blocking the main rendering of the
|
|
6170
|
+
* canvas. If there are more than this number of fonts needed, we'll just show the canvas right
|
|
6171
|
+
* away and let the fonts load in in the background.
|
|
6172
|
+
*/
|
|
6173
|
+
readonly maxFontsToLoadBeforeRender: number;
|
|
6040
6174
|
}
|
|
6041
6175
|
|
|
6042
6176
|
/** @public */
|
|
@@ -6114,8 +6248,12 @@ export declare interface TLEditorOptions {
|
|
|
6114
6248
|
* Options for the editor's camera.
|
|
6115
6249
|
*/
|
|
6116
6250
|
cameraOptions?: Partial<TLCameraOptions>;
|
|
6251
|
+
textOptions?: TLTextOptions;
|
|
6117
6252
|
options?: Partial<TldrawOptions>;
|
|
6118
6253
|
licenseKey?: string;
|
|
6254
|
+
fontAssetUrls?: {
|
|
6255
|
+
[key: string]: string | undefined;
|
|
6256
|
+
};
|
|
6119
6257
|
/**
|
|
6120
6258
|
* A predicate that should return true if the given shape should be hidden.
|
|
6121
6259
|
* @param shape - The shape to check.
|
|
@@ -6154,6 +6292,7 @@ export declare type TLEnterEventHandler = (info: any, from: string) => void;
|
|
|
6154
6292
|
* @public
|
|
6155
6293
|
*/
|
|
6156
6294
|
export declare const tlenv: {
|
|
6295
|
+
hasCanvasSupport: boolean;
|
|
6157
6296
|
isAndroid: boolean;
|
|
6158
6297
|
isChromeForIos: boolean;
|
|
6159
6298
|
isDarwin: boolean;
|
|
@@ -6229,6 +6368,13 @@ export declare interface TLEventMap {
|
|
|
6229
6368
|
'select-all-text': [{
|
|
6230
6369
|
shapeId: TLShapeId;
|
|
6231
6370
|
}];
|
|
6371
|
+
'place-caret': [{
|
|
6372
|
+
point: {
|
|
6373
|
+
x: number;
|
|
6374
|
+
y: number;
|
|
6375
|
+
};
|
|
6376
|
+
shapeId: TLShapeId;
|
|
6377
|
+
}];
|
|
6232
6378
|
}
|
|
6233
6379
|
|
|
6234
6380
|
/** @public */
|
|
@@ -6278,6 +6424,72 @@ export declare interface TLFilesExternalContent extends TLBaseExternalContent {
|
|
|
6278
6424
|
ignoreParent: boolean;
|
|
6279
6425
|
}
|
|
6280
6426
|
|
|
6427
|
+
/**
|
|
6428
|
+
* A font face that can be used in the editor. The properties of this are largely the same as the
|
|
6429
|
+
* ones in the
|
|
6430
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face | css `@font-face` rule}.
|
|
6431
|
+
* @public
|
|
6432
|
+
*/
|
|
6433
|
+
export declare interface TLFontFace {
|
|
6434
|
+
/**
|
|
6435
|
+
* How this font can be referred to in CSS.
|
|
6436
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-family | `font-family`}.
|
|
6437
|
+
*/
|
|
6438
|
+
readonly family: string;
|
|
6439
|
+
/**
|
|
6440
|
+
* The source of the font. This
|
|
6441
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src | `src`}.
|
|
6442
|
+
*/
|
|
6443
|
+
readonly src: TLFontFaceSource;
|
|
6444
|
+
/**
|
|
6445
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/ascent-override | `ascent-override`}.
|
|
6446
|
+
*/
|
|
6447
|
+
readonly ascentOverride?: string;
|
|
6448
|
+
/**
|
|
6449
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/descent-override | `descent-override`}.
|
|
6450
|
+
*/
|
|
6451
|
+
readonly descentOverride?: string;
|
|
6452
|
+
/**
|
|
6453
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-stretch | `font-stretch`}.
|
|
6454
|
+
*/
|
|
6455
|
+
readonly stretch?: string;
|
|
6456
|
+
/**
|
|
6457
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-style | `font-style`}.
|
|
6458
|
+
*/
|
|
6459
|
+
readonly style?: string;
|
|
6460
|
+
/**
|
|
6461
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-weight | `font-weight`}.
|
|
6462
|
+
*/
|
|
6463
|
+
readonly weight?: string;
|
|
6464
|
+
/**
|
|
6465
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-feature-settings | `font-feature-settings`}.
|
|
6466
|
+
*/
|
|
6467
|
+
readonly featureSettings?: string;
|
|
6468
|
+
/**
|
|
6469
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/line-gap-override | `line-gap-override`}.
|
|
6470
|
+
*/
|
|
6471
|
+
readonly lineGapOverride?: string;
|
|
6472
|
+
/**
|
|
6473
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range | `unicode-range`}.
|
|
6474
|
+
*/
|
|
6475
|
+
readonly unicodeRange?: string;
|
|
6476
|
+
}
|
|
6477
|
+
|
|
6478
|
+
/**
|
|
6479
|
+
* Represents the `src` property of a {@link TLFontFace}.
|
|
6480
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src | `src`} for details of the properties here.
|
|
6481
|
+
* @public
|
|
6482
|
+
*/
|
|
6483
|
+
export declare interface TLFontFaceSource {
|
|
6484
|
+
/**
|
|
6485
|
+
* A URL from which to load the font. If the value here is a key in
|
|
6486
|
+
* {@link tldraw#TLEditorAssetUrls.fonts}, the value from there will be used instead.
|
|
6487
|
+
*/
|
|
6488
|
+
url: string;
|
|
6489
|
+
format?: string;
|
|
6490
|
+
tech?: string;
|
|
6491
|
+
}
|
|
6492
|
+
|
|
6281
6493
|
/** @public */
|
|
6282
6494
|
export declare interface TLGridProps {
|
|
6283
6495
|
x: number;
|
|
@@ -6907,6 +7119,7 @@ export declare interface TLSvgTextExternalContent extends TLBaseExternalContent
|
|
|
6907
7119
|
export declare interface TLTextExternalContent extends TLBaseExternalContent {
|
|
6908
7120
|
type: 'text';
|
|
6909
7121
|
text: string;
|
|
7122
|
+
html?: string;
|
|
6910
7123
|
}
|
|
6911
7124
|
|
|
6912
7125
|
/** @public */
|
|
@@ -6916,6 +7129,12 @@ export declare interface TLTextExternalContentSource {
|
|
|
6916
7129
|
subtype: 'html' | 'json' | 'text' | 'url';
|
|
6917
7130
|
}
|
|
6918
7131
|
|
|
7132
|
+
/** @public */
|
|
7133
|
+
export declare interface TLTextOptions {
|
|
7134
|
+
tipTapConfig?: EditorProviderProps;
|
|
7135
|
+
addFontsFromNode?: RichTextFontVisitor;
|
|
7136
|
+
}
|
|
7137
|
+
|
|
6919
7138
|
/** @public */
|
|
6920
7139
|
export declare type TLTickEvent = (info: TLTickEventInfo) => void;
|
|
6921
7140
|
|
|
@@ -7087,6 +7306,9 @@ export declare function useMaybeEditor(): Editor | null;
|
|
|
7087
7306
|
|
|
7088
7307
|
/* Excluded from this release type: useOnMount */
|
|
7089
7308
|
|
|
7309
|
+
/** @public */
|
|
7310
|
+
export declare function usePassThroughMouseOverEvents(ref: RefObject<HTMLElement>): void;
|
|
7311
|
+
|
|
7090
7312
|
/** @public */
|
|
7091
7313
|
export declare function usePassThroughWheelEvents(ref: RefObject<HTMLElement>): void;
|
|
7092
7314
|
|
|
@@ -7198,6 +7420,9 @@ export declare function useUniqueSafeId(suffix?: string): SafeId;
|
|
|
7198
7420
|
|
|
7199
7421
|
export { useValue }
|
|
7200
7422
|
|
|
7423
|
+
/** @public */
|
|
7424
|
+
export declare function useViewportHeight(): number;
|
|
7425
|
+
|
|
7201
7426
|
/* Excluded from this release type: ValidLicenseKeyResult */
|
|
7202
7427
|
|
|
7203
7428
|
/** @public */
|
package/dist-esm/index.mjs
CHANGED
|
@@ -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.9.0-
|
|
300
|
+
"3.9.0-internal.7f0e15f4f7d9",
|
|
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
|
};
|
package/dist-esm/index.mjs.map
CHANGED
|
@@ -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 TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\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;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,SAAS,gBAAgB,aAA6B;AA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EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,eAAe,4BAA4B;AACpD,SAAS,mCAAuD;AAChE;AAAA,EACC;AAAA,EACA;AAAA,OAIM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,SAAS,2BAA2B;AAE7C,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAKpB,SAAS,uBAAuB;AAEtC;AACD;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
|
|
4
|
+
"sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\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 TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\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,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP,SAAS,mBAAqC;AAC9C;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AA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