@tldraw/editor 3.15.0-canary.d3401abd19b9 → 3.15.0-canary.db14db4f5395
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 +41 -49
- package/dist-cjs/index.js +16 -18
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/config/TLUserPreferences.js +1 -7
- package/dist-cjs/lib/config/TLUserPreferences.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +2 -20
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +101 -96
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +2 -7
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Arc2d.js +1 -1
- package/dist-cjs/lib/primitives/geometry/Arc2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Circle2d.js +1 -1
- package/dist-cjs/lib/primitives/geometry/Circle2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js +1 -3
- package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Ellipse2d.js +1 -1
- package/dist-cjs/lib/primitives/geometry/Ellipse2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/geometry-constants.js +2 -2
- package/dist-cjs/lib/primitives/geometry/geometry-constants.js.map +2 -2
- package/dist-cjs/lib/primitives/intersect.js +4 -4
- package/dist-cjs/lib/primitives/intersect.js.map +2 -2
- package/dist-cjs/lib/primitives/utils.js +0 -4
- package/dist-cjs/lib/primitives/utils.js.map +2 -2
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js +1 -0
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +41 -49
- package/dist-esm/index.mjs +41 -43
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/config/TLUserPreferences.mjs +1 -7
- package/dist-esm/lib/config/TLUserPreferences.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +2 -20
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +101 -96
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +2 -7
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Arc2d.mjs +2 -2
- package/dist-esm/lib/primitives/geometry/Arc2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Circle2d.mjs +2 -2
- package/dist-esm/lib/primitives/geometry/Circle2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs +1 -3
- package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs +2 -2
- package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/geometry-constants.mjs +2 -2
- package/dist-esm/lib/primitives/geometry/geometry-constants.mjs.map +2 -2
- package/dist-esm/lib/primitives/intersect.mjs +5 -5
- package/dist-esm/lib/primitives/intersect.mjs.map +2 -2
- package/dist-esm/lib/primitives/utils.mjs +0 -4
- package/dist-esm/lib/primitives/utils.mjs.map +2 -2
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs +1 -0
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +62 -63
- package/src/lib/config/TLUserPreferences.ts +0 -7
- package/src/lib/editor/Editor.test.ts +0 -407
- package/src/lib/editor/Editor.ts +4 -29
- package/src/lib/editor/managers/TextManager/TextManager.ts +128 -108
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +0 -21
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +0 -8
- package/src/lib/license/LicenseManager.test.ts +1 -1
- package/src/lib/primitives/geometry/Arc2d.ts +2 -2
- package/src/lib/primitives/geometry/Circle2d.ts +2 -2
- package/src/lib/primitives/geometry/CubicBezier2d.ts +1 -4
- package/src/lib/primitives/geometry/Ellipse2d.ts +2 -2
- package/src/lib/primitives/geometry/geometry-constants.ts +1 -2
- package/src/lib/primitives/intersect.ts +5 -12
- package/src/lib/primitives/utils.ts +0 -11
- package/src/lib/utils/sync/TLLocalSyncClient.ts +1 -0
- package/src/version.ts +3 -3
- package/src/lib/primitives/intersect.test.ts +0 -946
package/dist-esm/index.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
1
3
|
import { Atom } from '@tldraw/state';
|
|
2
4
|
import { BoxModel } from '@tldraw/tlschema';
|
|
3
5
|
import { ComponentType } from 'react';
|
|
@@ -17,8 +19,8 @@ import { NamedExoticComponent } from 'react';
|
|
|
17
19
|
import { Node as Node_2 } from '@tiptap/pm/model';
|
|
18
20
|
import { PerformanceTracker } from '@tldraw/utils';
|
|
19
21
|
import { PointerEventHandler } from 'react';
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
+
import { default as React_2 } from 'react';
|
|
23
|
+
import * as React_3 from 'react';
|
|
22
24
|
import { ReactElement } from 'react';
|
|
23
25
|
import { ReactNode } from 'react';
|
|
24
26
|
import { RecordProps } from '@tldraw/tlschema';
|
|
@@ -57,7 +59,6 @@ import { TLImageAsset } from '@tldraw/tlschema';
|
|
|
57
59
|
import { TLInstance } from '@tldraw/tlschema';
|
|
58
60
|
import { TLInstancePageState } from '@tldraw/tlschema';
|
|
59
61
|
import { TLInstancePresence } from '@tldraw/tlschema';
|
|
60
|
-
import { TLOpacityType } from '@tldraw/tlschema';
|
|
61
62
|
import { TLPage } from '@tldraw/tlschema';
|
|
62
63
|
import { TLPageId } from '@tldraw/tlschema';
|
|
63
64
|
import { TLParentId } from '@tldraw/tlschema';
|
|
@@ -715,8 +716,8 @@ export declare function createTLStore({ initialData, defaultName, id, assets, on
|
|
|
715
716
|
|
|
716
717
|
/** @public */
|
|
717
718
|
export declare function createTLUser(opts?: {
|
|
718
|
-
setUserPreferences?: (userPreferences: TLUserPreferences) => void;
|
|
719
|
-
userPreferences?: Signal<TLUserPreferences
|
|
719
|
+
setUserPreferences?: ((userPreferences: TLUserPreferences) => void) | undefined;
|
|
720
|
+
userPreferences?: Signal<TLUserPreferences, unknown> | undefined;
|
|
720
721
|
}): TLUser;
|
|
721
722
|
|
|
722
723
|
/** @public */
|
|
@@ -725,12 +726,10 @@ export declare class CubicBezier2d extends Polyline2d {
|
|
|
725
726
|
private _b;
|
|
726
727
|
private _c;
|
|
727
728
|
private _d;
|
|
728
|
-
private _resolution;
|
|
729
729
|
constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
|
|
730
730
|
cp1: Vec;
|
|
731
731
|
cp2: Vec;
|
|
732
732
|
end: Vec;
|
|
733
|
-
resolution?: number;
|
|
734
733
|
start: Vec;
|
|
735
734
|
});
|
|
736
735
|
getVertices(): Vec[];
|
|
@@ -849,7 +848,7 @@ export declare const defaultTldrawOptions: {
|
|
|
849
848
|
readonly edgeScrollSpeed: 25;
|
|
850
849
|
readonly enableToolbarKeyboardShortcuts: true;
|
|
851
850
|
readonly exportProvider: ExoticComponent< {
|
|
852
|
-
children?: ReactNode
|
|
851
|
+
children?: ReactNode;
|
|
853
852
|
}>;
|
|
854
853
|
readonly flattenImageBoundsExpand: 64;
|
|
855
854
|
readonly flattenImageBoundsPadding: 16;
|
|
@@ -889,7 +888,6 @@ export declare const defaultTldrawOptions: {
|
|
|
889
888
|
/** @public */
|
|
890
889
|
export declare const defaultUserPreferences: Readonly<{
|
|
891
890
|
animationSpeed: 0 | 1;
|
|
892
|
-
areKeyboardShortcutsEnabled: true;
|
|
893
891
|
color: "#02B1CC" | "#11B3A3" | "#39B178" | "#55B467" | "#7B66DC" | "#9D5BD2" | "#BD54C6" | "#E34BA9" | "#EC5E41" | "#F04F88" | "#F2555A" | "#FF802B";
|
|
894
892
|
colorScheme: "light";
|
|
895
893
|
edgeScrollSpeed: 1;
|
|
@@ -1020,8 +1018,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1020
1018
|
readonly timers: {
|
|
1021
1019
|
dispose: () => void;
|
|
1022
1020
|
requestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
1023
|
-
setInterval: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
|
|
1024
|
-
setTimeout: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
|
|
1021
|
+
setInterval: (handler: TimerHandler, timeout?: number | undefined, ...args: any[]) => number;
|
|
1022
|
+
setTimeout: (handler: TimerHandler, timeout?: number | undefined, ...args: any[]) => number;
|
|
1025
1023
|
};
|
|
1026
1024
|
/**
|
|
1027
1025
|
* A manager for the user and their preferences.
|
|
@@ -1555,9 +1553,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1555
1553
|
*/
|
|
1556
1554
|
deselect(...shapes: TLShape[] | TLShapeId[]): this;
|
|
1557
1555
|
/**
|
|
1558
|
-
* Select all
|
|
1559
|
-
* select all shapes within that parent. If the user has not selected any shapes,
|
|
1560
|
-
* or if the shapes shapes are only on select all shapes on the current page.
|
|
1556
|
+
* Select all direct children of the current page.
|
|
1561
1557
|
*
|
|
1562
1558
|
* @example
|
|
1563
1559
|
* ```ts
|
|
@@ -2072,10 +2068,10 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2072
2068
|
*/
|
|
2073
2069
|
slideCamera(opts?: {
|
|
2074
2070
|
direction: VecLike;
|
|
2075
|
-
force?: boolean;
|
|
2076
|
-
friction?: number;
|
|
2071
|
+
force?: boolean | undefined;
|
|
2072
|
+
friction?: number | undefined;
|
|
2077
2073
|
speed: number;
|
|
2078
|
-
speedThreshold?: number;
|
|
2074
|
+
speedThreshold?: number | undefined;
|
|
2079
2075
|
}): this;
|
|
2080
2076
|
/**
|
|
2081
2077
|
* Animate the camera to a user's cursor position. This also briefly show the user's cursor if it's not currently visible.
|
|
@@ -2687,12 +2683,12 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2687
2683
|
*/
|
|
2688
2684
|
getShapeAtPoint(point: VecLike, opts?: {
|
|
2689
2685
|
filter?(shape: TLShape): boolean;
|
|
2690
|
-
hitFrameInside?: boolean;
|
|
2691
|
-
hitInside?: boolean;
|
|
2692
|
-
hitLabels?: boolean;
|
|
2693
|
-
hitLocked?: boolean;
|
|
2694
|
-
margin?: number;
|
|
2695
|
-
renderingOnly?: boolean;
|
|
2686
|
+
hitFrameInside?: boolean | undefined;
|
|
2687
|
+
hitInside?: boolean | undefined;
|
|
2688
|
+
hitLabels?: boolean | undefined;
|
|
2689
|
+
hitLocked?: boolean | undefined;
|
|
2690
|
+
margin?: number | undefined;
|
|
2691
|
+
renderingOnly?: boolean | undefined;
|
|
2696
2692
|
}): TLShape | undefined;
|
|
2697
2693
|
/**
|
|
2698
2694
|
* Get the shapes, if any, at a given page point.
|
|
@@ -2711,8 +2707,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2711
2707
|
* @public
|
|
2712
2708
|
*/
|
|
2713
2709
|
getShapesAtPoint(point: VecLike, opts?: {
|
|
2714
|
-
hitInside?: boolean;
|
|
2715
|
-
margin?: number;
|
|
2710
|
+
hitInside?: boolean | undefined;
|
|
2711
|
+
margin?: number | undefined;
|
|
2716
2712
|
}): TLShape[];
|
|
2717
2713
|
/**
|
|
2718
2714
|
* Test whether a point (in the current page space) will will a shape. This method takes into account masks,
|
|
@@ -2730,8 +2726,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2730
2726
|
* @public
|
|
2731
2727
|
*/
|
|
2732
2728
|
isPointInShape(shape: TLShape | TLShapeId, point: VecLike, opts?: {
|
|
2733
|
-
hitInside?: boolean;
|
|
2734
|
-
margin?: number;
|
|
2729
|
+
hitInside?: boolean | undefined;
|
|
2730
|
+
margin?: number | undefined;
|
|
2735
2731
|
}): boolean;
|
|
2736
2732
|
/**
|
|
2737
2733
|
* Convert a point in the current page space to a point in the local space of a shape. For example, if a
|
|
@@ -4017,7 +4013,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
4017
4013
|
}
|
|
4018
4014
|
|
|
4019
4015
|
/** @public */
|
|
4020
|
-
export declare const EditorContext:
|
|
4016
|
+
export declare const EditorContext: React_2.Context<Editor | null>;
|
|
4021
4017
|
|
|
4022
4018
|
/** @public @react */
|
|
4023
4019
|
export declare function EditorProvider({ editor, children }: EditorProviderProps): JSX_2.Element;
|
|
@@ -4025,7 +4021,7 @@ export declare function EditorProvider({ editor, children }: EditorProviderProps
|
|
|
4025
4021
|
/** @public */
|
|
4026
4022
|
export declare interface EditorProviderProps {
|
|
4027
4023
|
editor: Editor;
|
|
4028
|
-
children:
|
|
4024
|
+
children: React_2.ReactNode;
|
|
4029
4025
|
}
|
|
4030
4026
|
|
|
4031
4027
|
/** @public */
|
|
@@ -4051,7 +4047,7 @@ export declare class Ellipse2d extends Geometry2d {
|
|
|
4051
4047
|
}
|
|
4052
4048
|
|
|
4053
4049
|
/** @public */
|
|
4054
|
-
export declare class ErrorBoundary extends
|
|
4050
|
+
export declare class ErrorBoundary extends React_3.Component<React_3.PropsWithRef<React_3.PropsWithChildren<TLErrorBoundaryProps>>, {
|
|
4055
4051
|
error: Error | null;
|
|
4056
4052
|
}> {
|
|
4057
4053
|
static getDerivedStateFromError(error: Error): {
|
|
@@ -4061,7 +4057,7 @@ export declare class ErrorBoundary extends React_2.Component<React_2.PropsWithRe
|
|
|
4061
4057
|
error: null;
|
|
4062
4058
|
};
|
|
4063
4059
|
componentDidCatch(error: unknown): void;
|
|
4064
|
-
render(): boolean | JSX_2.Element | Iterable<
|
|
4060
|
+
render(): boolean | JSX_2.Element | Iterable<React_3.ReactNode> | null | number | string | undefined;
|
|
4065
4061
|
}
|
|
4066
4062
|
|
|
4067
4063
|
/** @public @react */
|
|
@@ -4322,8 +4318,6 @@ export declare function getSvgPathFromPoints(points: VecLike[], closed?: boolean
|
|
|
4322
4318
|
/** @public */
|
|
4323
4319
|
export declare function getUserPreferences(): TLUserPreferences;
|
|
4324
4320
|
|
|
4325
|
-
/* Excluded from this release type: getVerticesCountForArcLength */
|
|
4326
|
-
|
|
4327
4321
|
/** @public */
|
|
4328
4322
|
export declare class Group2d extends Geometry2d {
|
|
4329
4323
|
children: Geometry2d[];
|
|
@@ -4467,7 +4461,7 @@ export declare class HistoryManager<R extends UnknownRecord> {
|
|
|
4467
4461
|
export declare function HTMLContainer({ children, className, ...rest }: HTMLContainerProps): JSX_2.Element;
|
|
4468
4462
|
|
|
4469
4463
|
/** @public */
|
|
4470
|
-
export declare type HTMLContainerProps =
|
|
4464
|
+
export declare type HTMLContainerProps = React_3.HTMLAttributes<HTMLDivElement>;
|
|
4471
4465
|
|
|
4472
4466
|
/** @public */
|
|
4473
4467
|
export declare const inlineBase64AssetStore: TLAssetStore;
|
|
@@ -4523,7 +4517,7 @@ export declare function intersectLineSegmentCircle(a1: VecLike, a2: VecLike, c:
|
|
|
4523
4517
|
* @param b2 - The second segment's second point.
|
|
4524
4518
|
* @public
|
|
4525
4519
|
*/
|
|
4526
|
-
export declare function intersectLineSegmentLineSegment(a1: VecLike, a2: VecLike, b1: VecLike, b2: VecLike
|
|
4520
|
+
export declare function intersectLineSegmentLineSegment(a1: VecLike, a2: VecLike, b1: VecLike, b2: VecLike): null | Vec;
|
|
4527
4521
|
|
|
4528
4522
|
/**
|
|
4529
4523
|
* Find the intersections between a line segment and a closed polygon.
|
|
@@ -4829,7 +4823,7 @@ export declare function precise(A: VecLike): string;
|
|
|
4829
4823
|
* @param event - To prevent default on
|
|
4830
4824
|
* @public
|
|
4831
4825
|
*/
|
|
4832
|
-
export declare function preventDefault(event: Event |
|
|
4826
|
+
export declare function preventDefault(event: Event | React_2.BaseSyntheticEvent): void;
|
|
4833
4827
|
|
|
4834
4828
|
/**
|
|
4835
4829
|
* Convert radians to degrees.
|
|
@@ -4864,10 +4858,10 @@ export declare class ReadonlySharedStyleMap {
|
|
|
4864
4858
|
getAsKnownValue<T>(prop: StyleProp<T>): T | undefined;
|
|
4865
4859
|
get size(): number;
|
|
4866
4860
|
equals(other: ReadonlySharedStyleMap): boolean;
|
|
4867
|
-
keys():
|
|
4868
|
-
values():
|
|
4869
|
-
entries():
|
|
4870
|
-
[Symbol.iterator]():
|
|
4861
|
+
keys(): IterableIterator<StyleProp<any>>;
|
|
4862
|
+
values(): IterableIterator<SharedStyle<unknown>>;
|
|
4863
|
+
entries(): IterableIterator<[StyleProp<any>, SharedStyle<unknown>]>;
|
|
4864
|
+
[Symbol.iterator](): IterableIterator<[StyleProp<any>, SharedStyle<unknown>]>;
|
|
4871
4865
|
}
|
|
4872
4866
|
|
|
4873
4867
|
/** @public */
|
|
@@ -4891,7 +4885,7 @@ export declare class Rectangle2d extends Polygon2d {
|
|
|
4891
4885
|
export declare function refreshPage(): void;
|
|
4892
4886
|
|
|
4893
4887
|
/** @public */
|
|
4894
|
-
export declare function releasePointerCapture(element: Element, event: PointerEvent |
|
|
4888
|
+
export declare function releasePointerCapture(element: Element, event: PointerEvent | React_2.PointerEvent<Element>): void;
|
|
4895
4889
|
|
|
4896
4890
|
/** @public */
|
|
4897
4891
|
export declare type RequiredKeys<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
|
|
@@ -5034,7 +5028,7 @@ export declare type SelectionEdge = 'bottom' | 'left' | 'right' | 'top';
|
|
|
5034
5028
|
export declare type SelectionHandle = SelectionCorner | SelectionEdge;
|
|
5035
5029
|
|
|
5036
5030
|
/** @public */
|
|
5037
|
-
export declare function setPointerCapture(element: Element, event: PointerEvent |
|
|
5031
|
+
export declare function setPointerCapture(element: Element, event: PointerEvent | React_2.PointerEvent<Element>): void;
|
|
5038
5032
|
|
|
5039
5033
|
/** @public */
|
|
5040
5034
|
export declare function setRuntimeOverrides(input: Partial<typeof runtime>): void;
|
|
@@ -5740,7 +5734,7 @@ export declare function suffixSafeId(id: SafeId, suffix: string): SafeId;
|
|
|
5740
5734
|
export declare function SVGContainer({ children, className, ...rest }: SVGContainerProps): JSX_2.Element;
|
|
5741
5735
|
|
|
5742
5736
|
/** @public */
|
|
5743
|
-
export declare type SVGContainerProps =
|
|
5737
|
+
export declare type SVGContainerProps = React_3.ComponentProps<'svg'>;
|
|
5744
5738
|
|
|
5745
5739
|
/** @public */
|
|
5746
5740
|
export declare interface SvgExportContext {
|
|
@@ -5801,9 +5795,10 @@ export declare const TAB_ID: string;
|
|
|
5801
5795
|
export declare class TextManager {
|
|
5802
5796
|
editor: Editor;
|
|
5803
5797
|
private elm;
|
|
5798
|
+
private defaultStyles;
|
|
5804
5799
|
constructor(editor: Editor);
|
|
5805
|
-
private setElementStyles;
|
|
5806
5800
|
dispose(): void;
|
|
5801
|
+
private resetElmStyles;
|
|
5807
5802
|
measureText(textToMeasure: string, opts: TLMeasureTextOpts): BoxModel & {
|
|
5808
5803
|
scrollWidth: number;
|
|
5809
5804
|
};
|
|
@@ -6147,7 +6142,7 @@ export declare interface TLDragShapesOverInfo {
|
|
|
6147
6142
|
}
|
|
6148
6143
|
|
|
6149
6144
|
/** @public @react */
|
|
6150
|
-
export declare const TldrawEditor:
|
|
6145
|
+
export declare const TldrawEditor: React_2.NamedExoticComponent<TldrawEditorProps>;
|
|
6151
6146
|
|
|
6152
6147
|
/**
|
|
6153
6148
|
* Base props for the {@link tldraw#Tldraw} and {@link TldrawEditor} components.
|
|
@@ -6551,7 +6546,7 @@ export declare const tlenv: {
|
|
|
6551
6546
|
|
|
6552
6547
|
/** @public */
|
|
6553
6548
|
export declare interface TLErrorBoundaryProps {
|
|
6554
|
-
children:
|
|
6549
|
+
children: React_3.ReactNode;
|
|
6555
6550
|
onError?: ((error: unknown) => void) | null;
|
|
6556
6551
|
fallback: TLErrorFallbackComponent;
|
|
6557
6552
|
}
|
|
@@ -7507,7 +7502,6 @@ export declare interface TLUserPreferences {
|
|
|
7507
7502
|
color?: null | string;
|
|
7508
7503
|
locale?: null | string;
|
|
7509
7504
|
animationSpeed?: null | number;
|
|
7510
|
-
areKeyboardShortcutsEnabled?: boolean | null;
|
|
7511
7505
|
edgeScrollSpeed?: null | number;
|
|
7512
7506
|
colorScheme?: 'dark' | 'light' | 'system';
|
|
7513
7507
|
isSnapMode?: boolean | null;
|
|
@@ -7676,7 +7670,6 @@ export declare class UserPreferencesManager {
|
|
|
7676
7670
|
updateUserPreferences(userPreferences: Partial<TLUserPreferences>): void;
|
|
7677
7671
|
getUserPreferences(): {
|
|
7678
7672
|
animationSpeed: number;
|
|
7679
|
-
areKeyboardShortcutsEnabled: boolean;
|
|
7680
7673
|
color: string;
|
|
7681
7674
|
colorScheme: "dark" | "light" | "system" | undefined;
|
|
7682
7675
|
id: string;
|
|
@@ -7693,7 +7686,6 @@ export declare class UserPreferencesManager {
|
|
|
7693
7686
|
*/
|
|
7694
7687
|
getEdgeScrollSpeed(): number;
|
|
7695
7688
|
getAnimationSpeed(): number;
|
|
7696
|
-
getAreKeyboardShortcutsEnabled(): boolean;
|
|
7697
7689
|
getId(): string;
|
|
7698
7690
|
getName(): string;
|
|
7699
7691
|
getLocale(): string;
|
package/dist-esm/index.mjs
CHANGED
|
@@ -10,6 +10,19 @@ export * from "@tldraw/store";
|
|
|
10
10
|
export * from "@tldraw/tlschema";
|
|
11
11
|
export * from "@tldraw/utils";
|
|
12
12
|
export * from "@tldraw/validate";
|
|
13
|
+
import {
|
|
14
|
+
ErrorScreen,
|
|
15
|
+
LoadingScreen,
|
|
16
|
+
TldrawEditor,
|
|
17
|
+
useOnMount
|
|
18
|
+
} from "./lib/TldrawEditor.mjs";
|
|
19
|
+
import {
|
|
20
|
+
ErrorBoundary,
|
|
21
|
+
OptionalErrorBoundary
|
|
22
|
+
} from "./lib/components/ErrorBoundary.mjs";
|
|
23
|
+
import { HTMLContainer } from "./lib/components/HTMLContainer.mjs";
|
|
24
|
+
import { MenuClickCapture } from "./lib/components/MenuClickCapture.mjs";
|
|
25
|
+
import { SVGContainer } from "./lib/components/SVGContainer.mjs";
|
|
13
26
|
import { DefaultBackground } from "./lib/components/default-components/DefaultBackground.mjs";
|
|
14
27
|
import { DefaultBrush } from "./lib/components/default-components/DefaultBrush.mjs";
|
|
15
28
|
import {
|
|
@@ -51,45 +64,38 @@ import {
|
|
|
51
64
|
} from "./lib/components/default-components/DefaultSnapIndictor.mjs";
|
|
52
65
|
import { DefaultSpinner } from "./lib/components/default-components/DefaultSpinner.mjs";
|
|
53
66
|
import { DefaultSvgDefs } from "./lib/components/default-components/DefaultSvgDefs.mjs";
|
|
54
|
-
import {
|
|
55
|
-
ErrorBoundary,
|
|
56
|
-
OptionalErrorBoundary
|
|
57
|
-
} from "./lib/components/ErrorBoundary.mjs";
|
|
58
|
-
import { HTMLContainer } from "./lib/components/HTMLContainer.mjs";
|
|
59
|
-
import { MenuClickCapture } from "./lib/components/MenuClickCapture.mjs";
|
|
60
|
-
import { SVGContainer } from "./lib/components/SVGContainer.mjs";
|
|
61
|
-
import {
|
|
62
|
-
createTLSchemaFromUtils,
|
|
63
|
-
createTLStore,
|
|
64
|
-
inlineBase64AssetStore
|
|
65
|
-
} from "./lib/config/createTLStore.mjs";
|
|
66
|
-
import { createTLUser, useTldrawUser } from "./lib/config/createTLUser.mjs";
|
|
67
|
-
import { coreShapes } from "./lib/config/defaultShapes.mjs";
|
|
68
67
|
import {
|
|
69
68
|
getSnapshot,
|
|
70
69
|
loadSnapshot
|
|
71
70
|
} from "./lib/config/TLEditorSnapshot.mjs";
|
|
72
71
|
import {
|
|
72
|
+
TAB_ID,
|
|
73
73
|
createSessionStateSnapshotSignal,
|
|
74
74
|
extractSessionStateFromLegacySnapshot,
|
|
75
|
-
loadSessionStateSnapshotIntoStore
|
|
76
|
-
TAB_ID
|
|
75
|
+
loadSessionStateSnapshotIntoStore
|
|
77
76
|
} from "./lib/config/TLSessionStateSnapshot.mjs";
|
|
78
77
|
import {
|
|
78
|
+
USER_COLORS,
|
|
79
79
|
defaultUserPreferences,
|
|
80
80
|
getFreshUserPreferences,
|
|
81
81
|
getUserPreferences,
|
|
82
82
|
setUserPreferences,
|
|
83
|
-
USER_COLORS,
|
|
84
83
|
userTypeValidator
|
|
85
84
|
} from "./lib/config/TLUserPreferences.mjs";
|
|
86
|
-
import { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from "./lib/constants.mjs";
|
|
87
85
|
import {
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
createTLSchemaFromUtils,
|
|
87
|
+
createTLStore,
|
|
88
|
+
inlineBase64AssetStore
|
|
89
|
+
} from "./lib/config/createTLStore.mjs";
|
|
90
|
+
import { createTLUser, useTldrawUser } from "./lib/config/createTLUser.mjs";
|
|
91
|
+
import { coreShapes } from "./lib/config/defaultShapes.mjs";
|
|
92
|
+
import { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from "./lib/constants.mjs";
|
|
90
93
|
import {
|
|
91
94
|
Editor
|
|
92
95
|
} from "./lib/editor/Editor.mjs";
|
|
96
|
+
import {
|
|
97
|
+
BindingUtil
|
|
98
|
+
} from "./lib/editor/bindings/BindingUtil.mjs";
|
|
93
99
|
import { ClickManager } from "./lib/editor/managers/ClickManager/ClickManager.mjs";
|
|
94
100
|
import { EdgeScrollManager } from "./lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs";
|
|
95
101
|
import {
|
|
@@ -111,10 +117,10 @@ import {
|
|
|
111
117
|
} from "./lib/editor/managers/TextManager/TextManager.mjs";
|
|
112
118
|
import { UserPreferencesManager } from "./lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs";
|
|
113
119
|
import { BaseBoxShapeUtil } from "./lib/editor/shapes/BaseBoxShapeUtil.mjs";
|
|
114
|
-
import { GroupShapeUtil } from "./lib/editor/shapes/group/GroupShapeUtil.mjs";
|
|
115
120
|
import {
|
|
116
121
|
ShapeUtil
|
|
117
122
|
} from "./lib/editor/shapes/ShapeUtil.mjs";
|
|
123
|
+
import { GroupShapeUtil } from "./lib/editor/shapes/group/GroupShapeUtil.mjs";
|
|
118
124
|
import {
|
|
119
125
|
getPerfectDashProps
|
|
120
126
|
} from "./lib/editor/shapes/shared/getPerfectDashProps.mjs";
|
|
@@ -123,13 +129,13 @@ import { resizeScaled } from "./lib/editor/shapes/shared/resizeScaled.mjs";
|
|
|
123
129
|
import { BaseBoxShapeTool } from "./lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.mjs";
|
|
124
130
|
import { maybeSnapToGrid } from "./lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs";
|
|
125
131
|
import { StateNode } from "./lib/editor/tools/StateNode.mjs";
|
|
126
|
-
import {
|
|
127
|
-
EVENT_NAME_MAP
|
|
128
|
-
} from "./lib/editor/types/event-types.mjs";
|
|
129
132
|
import {
|
|
130
133
|
useDelaySvgExport,
|
|
131
134
|
useSvgExportContext
|
|
132
135
|
} from "./lib/editor/types/SvgExportContext.mjs";
|
|
136
|
+
import {
|
|
137
|
+
EVENT_NAME_MAP
|
|
138
|
+
} from "./lib/editor/types/event-types.mjs";
|
|
133
139
|
import { getSvgAsImage } from "./lib/exports/getSvgAsImage.mjs";
|
|
134
140
|
import { tlenv } from "./lib/globals/environment.mjs";
|
|
135
141
|
import { tlmenus } from "./lib/globals/menus.mjs";
|
|
@@ -178,6 +184,8 @@ import {
|
|
|
178
184
|
ROTATE_CORNER_TO_SELECTION_CORNER,
|
|
179
185
|
rotateSelectionHandle
|
|
180
186
|
} from "./lib/primitives/Box.mjs";
|
|
187
|
+
import { Mat } from "./lib/primitives/Mat.mjs";
|
|
188
|
+
import { Vec } from "./lib/primitives/Vec.mjs";
|
|
181
189
|
import { EASINGS } from "./lib/primitives/easings.mjs";
|
|
182
190
|
import { Arc2d } from "./lib/primitives/geometry/Arc2d.mjs";
|
|
183
191
|
import { Circle2d } from "./lib/primitives/geometry/Circle2d.mjs";
|
|
@@ -185,7 +193,6 @@ import { CubicBezier2d } from "./lib/primitives/geometry/CubicBezier2d.mjs";
|
|
|
185
193
|
import { CubicSpline2d } from "./lib/primitives/geometry/CubicSpline2d.mjs";
|
|
186
194
|
import { Edge2d } from "./lib/primitives/geometry/Edge2d.mjs";
|
|
187
195
|
import { Ellipse2d } from "./lib/primitives/geometry/Ellipse2d.mjs";
|
|
188
|
-
import { getVerticesCountForArcLength } from "./lib/primitives/geometry/geometry-constants.mjs";
|
|
189
196
|
import {
|
|
190
197
|
Geometry2d,
|
|
191
198
|
Geometry2dFilters,
|
|
@@ -211,8 +218,11 @@ import {
|
|
|
211
218
|
polygonIntersectsPolyline,
|
|
212
219
|
polygonsIntersect
|
|
213
220
|
} from "./lib/primitives/intersect.mjs";
|
|
214
|
-
import { Mat } from "./lib/primitives/Mat.mjs";
|
|
215
221
|
import {
|
|
222
|
+
HALF_PI,
|
|
223
|
+
PI,
|
|
224
|
+
PI2,
|
|
225
|
+
SIN,
|
|
216
226
|
angleDistance,
|
|
217
227
|
approximately,
|
|
218
228
|
areAnglesCompatible,
|
|
@@ -229,29 +239,22 @@ import {
|
|
|
229
239
|
getPointOnCircle,
|
|
230
240
|
getPointsOnArc,
|
|
231
241
|
getPolygonVertices,
|
|
232
|
-
HALF_PI,
|
|
233
242
|
isSafeFloat,
|
|
234
243
|
perimeterOfEllipse,
|
|
235
|
-
PI,
|
|
236
|
-
PI2,
|
|
237
244
|
pointInPolygon,
|
|
238
245
|
precise,
|
|
239
246
|
radiansToDegrees,
|
|
240
247
|
rangeIntersection,
|
|
241
248
|
shortAngleDist,
|
|
242
|
-
SIN,
|
|
243
249
|
snapAngle,
|
|
244
250
|
toDomPrecision,
|
|
245
251
|
toFixed,
|
|
246
252
|
toPrecision
|
|
247
253
|
} from "./lib/primitives/utils.mjs";
|
|
248
|
-
import { Vec } from "./lib/primitives/Vec.mjs";
|
|
249
254
|
import {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
useOnMount
|
|
254
|
-
} from "./lib/TldrawEditor.mjs";
|
|
255
|
+
ReadonlySharedStyleMap,
|
|
256
|
+
SharedStyleMap
|
|
257
|
+
} from "./lib/utils/SharedStylesMap.mjs";
|
|
255
258
|
import { dataUrlToFile, getDefaultCdnBaseUrl } from "./lib/utils/assets.mjs";
|
|
256
259
|
import { clampToBrowserMaxCanvasSize } from "./lib/utils/browserCanvasMaxSize.mjs";
|
|
257
260
|
import {
|
|
@@ -286,12 +289,8 @@ import {
|
|
|
286
289
|
getRotationSnapshot
|
|
287
290
|
} from "./lib/utils/rotation.mjs";
|
|
288
291
|
import { runtime, setRuntimeOverrides } from "./lib/utils/runtime.mjs";
|
|
289
|
-
import {
|
|
290
|
-
ReadonlySharedStyleMap,
|
|
291
|
-
SharedStyleMap
|
|
292
|
-
} from "./lib/utils/SharedStylesMap.mjs";
|
|
293
|
-
import { hardReset } from "./lib/utils/sync/hardReset.mjs";
|
|
294
292
|
import { LocalIndexedDb, Table } from "./lib/utils/sync/LocalIndexedDb.mjs";
|
|
293
|
+
import { hardReset } from "./lib/utils/sync/hardReset.mjs";
|
|
295
294
|
import { uniq } from "./lib/utils/uniq.mjs";
|
|
296
295
|
import { openWindow } from "./lib/utils/window-open.mjs";
|
|
297
296
|
function debugEnableLicensing() {
|
|
@@ -299,7 +298,7 @@ function debugEnableLicensing() {
|
|
|
299
298
|
}
|
|
300
299
|
registerTldrawLibraryVersion(
|
|
301
300
|
"@tldraw/editor",
|
|
302
|
-
"3.15.0-canary.
|
|
301
|
+
"3.15.0-canary.db14db4f5395",
|
|
303
302
|
"esm"
|
|
304
303
|
);
|
|
305
304
|
export {
|
|
@@ -428,7 +427,6 @@ export {
|
|
|
428
427
|
getSvgAsImage,
|
|
429
428
|
getSvgPathFromPoints,
|
|
430
429
|
getUserPreferences,
|
|
431
|
-
getVerticesCountForArcLength,
|
|
432
430
|
hardReset,
|
|
433
431
|
hardResetEditor,
|
|
434
432
|
inlineBase64AssetStore,
|
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'\n\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport {\n\tTextManager,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLSvgOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,oCAAoC;AAC7C,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAGP,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,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;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AAEP;AAAA,EACC;AAAA,OAEM;AAEP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B;AAAA,EACC;AAAA,EACA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\n\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\n\nexport {\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 {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} 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/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport {\n\tTextManager,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport {\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 TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLSvgOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { 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 {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport {\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 { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TLTextOptions,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\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": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,7 +10,6 @@ const userTypeValidator = T.object({
|
|
|
10
10
|
// N.B. These are duplicated in TLdrawAppUser.
|
|
11
11
|
locale: T.string.nullable().optional(),
|
|
12
12
|
animationSpeed: T.number.nullable().optional(),
|
|
13
|
-
areKeyboardShortcutsEnabled: T.boolean.nullable().optional(),
|
|
14
13
|
edgeScrollSpeed: T.number.nullable().optional(),
|
|
15
14
|
colorScheme: T.literalEnum("light", "dark", "system").optional(),
|
|
16
15
|
isSnapMode: T.boolean.nullable().optional(),
|
|
@@ -26,8 +25,7 @@ const Versions = {
|
|
|
26
25
|
AddExcalidrawSelectMode: 5,
|
|
27
26
|
AddDynamicSizeMode: 6,
|
|
28
27
|
AllowSystemColorScheme: 7,
|
|
29
|
-
AddPasteAtCursor: 8
|
|
30
|
-
AddKeyboardShortcuts: 9
|
|
28
|
+
AddPasteAtCursor: 8
|
|
31
29
|
};
|
|
32
30
|
const CURRENT_VERSION = Math.max(...Object.values(Versions));
|
|
33
31
|
function migrateSnapshot(data) {
|
|
@@ -59,9 +57,6 @@ function migrateSnapshot(data) {
|
|
|
59
57
|
if (data.version < Versions.AddPasteAtCursor) {
|
|
60
58
|
data.user.isPasteAtCursorMode = false;
|
|
61
59
|
}
|
|
62
|
-
if (data.version < Versions.AddKeyboardShortcuts) {
|
|
63
|
-
data.user.areKeyboardShortcutsEnabled = true;
|
|
64
|
-
}
|
|
65
60
|
data.version = CURRENT_VERSION;
|
|
66
61
|
}
|
|
67
62
|
const USER_COLORS = [
|
|
@@ -94,7 +89,6 @@ const defaultUserPreferences = Object.freeze({
|
|
|
94
89
|
// N.B. These are duplicated in TLdrawAppUser.
|
|
95
90
|
edgeScrollSpeed: 1,
|
|
96
91
|
animationSpeed: userPrefersReducedMotion() ? 0 : 1,
|
|
97
|
-
areKeyboardShortcutsEnabled: true,
|
|
98
92
|
isSnapMode: false,
|
|
99
93
|
isWrapMode: false,
|
|
100
94
|
isDynamicSizeMode: false,
|