@tldraw/editor 3.15.0-canary.51c2773438c3 → 3.15.0-canary.53600affdb31
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 +109 -44
- package/dist-cjs/index.js +18 -16
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/components/SVGContainer.js +1 -1
- package/dist-cjs/lib/components/SVGContainer.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultBrush.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultBrush.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCursor.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultCursor.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultGrid.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultGrid.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultHandles.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultHandles.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultSnapIndictor.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultSnapIndictor.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultSpinner.js +27 -15
- package/dist-cjs/lib/components/default-components/DefaultSpinner.js.map +3 -3
- package/dist-cjs/lib/config/TLUserPreferences.js +7 -1
- package/dist-cjs/lib/config/TLUserPreferences.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +24 -8
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +96 -101
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +7 -2
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/tools/StateNode.js +20 -1
- package/dist-cjs/lib/editor/tools/StateNode.js.map +2 -2
- package/dist-cjs/lib/hooks/useEditorComponents.js.map +1 -1
- package/dist-cjs/lib/license/Watermark.js +2 -2
- package/dist-cjs/lib/license/Watermark.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 +3 -1
- 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 +4 -0
- package/dist-cjs/lib/primitives/utils.js.map +2 -2
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js +0 -1
- 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 +109 -44
- package/dist-esm/index.mjs +43 -41
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/components/SVGContainer.mjs +1 -1
- package/dist-esm/lib/components/SVGContainer.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultBrush.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultBrush.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCursor.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultCursor.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultGrid.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultGrid.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultHandles.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultHandles.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultSnapIndictor.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultSnapIndictor.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultSpinner.mjs +17 -15
- package/dist-esm/lib/components/default-components/DefaultSpinner.mjs.map +2 -2
- package/dist-esm/lib/config/TLUserPreferences.mjs +7 -1
- package/dist-esm/lib/config/TLUserPreferences.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +24 -8
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +96 -101
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +7 -2
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/tools/StateNode.mjs +20 -1
- package/dist-esm/lib/editor/tools/StateNode.mjs.map +2 -2
- package/dist-esm/lib/hooks/useEditorComponents.mjs.map +1 -1
- package/dist-esm/lib/license/Watermark.mjs +2 -2
- package/dist-esm/lib/license/Watermark.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 +3 -1
- 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 +4 -0
- package/dist-esm/lib/primitives/utils.mjs.map +2 -2
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs +0 -1
- 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/editor.css +17 -4
- package/package.json +9 -8
- package/src/index.ts +63 -62
- package/src/lib/components/SVGContainer.tsx +1 -1
- package/src/lib/components/default-components/DefaultBrush.tsx +1 -1
- package/src/lib/components/default-components/DefaultCanvas.tsx +1 -1
- package/src/lib/components/default-components/DefaultCollaboratorHint.tsx +1 -1
- package/src/lib/components/default-components/DefaultCursor.tsx +1 -1
- package/src/lib/components/default-components/DefaultGrid.tsx +1 -1
- package/src/lib/components/default-components/DefaultHandles.tsx +5 -1
- package/src/lib/components/default-components/DefaultShapeIndicator.tsx +1 -1
- package/src/lib/components/default-components/DefaultSnapIndictor.tsx +1 -1
- package/src/lib/components/default-components/DefaultSpinner.tsx +12 -12
- package/src/lib/config/TLUserPreferences.ts +7 -0
- package/src/lib/editor/Editor.test.ts +407 -0
- package/src/lib/editor/Editor.ts +35 -9
- package/src/lib/editor/managers/TextManager/TextManager.ts +108 -128
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +21 -0
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +8 -0
- package/src/lib/editor/shapes/ShapeUtil.ts +57 -0
- package/src/lib/editor/tools/StateNode.test.ts +285 -0
- package/src/lib/editor/tools/StateNode.ts +27 -1
- package/src/lib/hooks/useEditorComponents.tsx +1 -1
- package/src/lib/license/LicenseManager.test.ts +1 -1
- package/src/lib/license/Watermark.tsx +2 -2
- 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 +4 -1
- package/src/lib/primitives/geometry/Ellipse2d.ts +2 -2
- package/src/lib/primitives/geometry/geometry-constants.ts +2 -1
- package/src/lib/primitives/intersect.test.ts +946 -0
- package/src/lib/primitives/intersect.ts +12 -5
- package/src/lib/primitives/utils.ts +11 -0
- package/src/lib/utils/sync/TLLocalSyncClient.ts +0 -1
- package/src/version.ts +3 -3
- package/src/lib/test/currentToolIdMask.test.ts +0 -49
package/dist-esm/index.d.mts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
|
|
3
1
|
import { Atom } from '@tldraw/state';
|
|
4
2
|
import { BoxModel } from '@tldraw/tlschema';
|
|
5
3
|
import { ComponentType } from 'react';
|
|
@@ -19,8 +17,8 @@ import { NamedExoticComponent } from 'react';
|
|
|
19
17
|
import { Node as Node_2 } from '@tiptap/pm/model';
|
|
20
18
|
import { PerformanceTracker } from '@tldraw/utils';
|
|
21
19
|
import { PointerEventHandler } from 'react';
|
|
22
|
-
import
|
|
23
|
-
import
|
|
20
|
+
import * as React_2 from 'react';
|
|
21
|
+
import { default as React_3 } from 'react';
|
|
24
22
|
import { ReactElement } from 'react';
|
|
25
23
|
import { ReactNode } from 'react';
|
|
26
24
|
import { RecordProps } from '@tldraw/tlschema';
|
|
@@ -59,6 +57,7 @@ import { TLImageAsset } from '@tldraw/tlschema';
|
|
|
59
57
|
import { TLInstance } from '@tldraw/tlschema';
|
|
60
58
|
import { TLInstancePageState } from '@tldraw/tlschema';
|
|
61
59
|
import { TLInstancePresence } from '@tldraw/tlschema';
|
|
60
|
+
import { TLOpacityType } from '@tldraw/tlschema';
|
|
62
61
|
import { TLPage } from '@tldraw/tlschema';
|
|
63
62
|
import { TLPageId } from '@tldraw/tlschema';
|
|
64
63
|
import { TLParentId } from '@tldraw/tlschema';
|
|
@@ -716,8 +715,8 @@ export declare function createTLStore({ initialData, defaultName, id, assets, on
|
|
|
716
715
|
|
|
717
716
|
/** @public */
|
|
718
717
|
export declare function createTLUser(opts?: {
|
|
719
|
-
setUserPreferences?: (
|
|
720
|
-
userPreferences?: Signal<TLUserPreferences
|
|
718
|
+
setUserPreferences?: (userPreferences: TLUserPreferences) => void;
|
|
719
|
+
userPreferences?: Signal<TLUserPreferences>;
|
|
721
720
|
}): TLUser;
|
|
722
721
|
|
|
723
722
|
/** @public */
|
|
@@ -726,10 +725,12 @@ export declare class CubicBezier2d extends Polyline2d {
|
|
|
726
725
|
private _b;
|
|
727
726
|
private _c;
|
|
728
727
|
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;
|
|
733
734
|
start: Vec;
|
|
734
735
|
});
|
|
735
736
|
getVertices(): Vec[];
|
|
@@ -820,7 +821,7 @@ export declare const DefaultShapeIndicators: NamedExoticComponent<TLShapeIndicat
|
|
|
820
821
|
export declare function DefaultSnapIndicator({ className, line, zoom }: TLSnapIndicatorProps): JSX_2.Element;
|
|
821
822
|
|
|
822
823
|
/** @public @react */
|
|
823
|
-
export declare function DefaultSpinner(): JSX_2.Element;
|
|
824
|
+
export declare function DefaultSpinner(props: React.SVGProps<SVGSVGElement>): JSX_2.Element;
|
|
824
825
|
|
|
825
826
|
/** @public @react */
|
|
826
827
|
export declare const DefaultSvgDefs: () => null;
|
|
@@ -848,7 +849,7 @@ export declare const defaultTldrawOptions: {
|
|
|
848
849
|
readonly edgeScrollSpeed: 25;
|
|
849
850
|
readonly enableToolbarKeyboardShortcuts: true;
|
|
850
851
|
readonly exportProvider: ExoticComponent< {
|
|
851
|
-
children?: ReactNode;
|
|
852
|
+
children?: ReactNode | undefined;
|
|
852
853
|
}>;
|
|
853
854
|
readonly flattenImageBoundsExpand: 64;
|
|
854
855
|
readonly flattenImageBoundsPadding: 16;
|
|
@@ -888,6 +889,7 @@ export declare const defaultTldrawOptions: {
|
|
|
888
889
|
/** @public */
|
|
889
890
|
export declare const defaultUserPreferences: Readonly<{
|
|
890
891
|
animationSpeed: 0 | 1;
|
|
892
|
+
areKeyboardShortcutsEnabled: true;
|
|
891
893
|
color: "#02B1CC" | "#11B3A3" | "#39B178" | "#55B467" | "#7B66DC" | "#9D5BD2" | "#BD54C6" | "#E34BA9" | "#EC5E41" | "#F04F88" | "#F2555A" | "#FF802B";
|
|
892
894
|
colorScheme: "light";
|
|
893
895
|
edgeScrollSpeed: 1;
|
|
@@ -1018,8 +1020,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1018
1020
|
readonly timers: {
|
|
1019
1021
|
dispose: () => void;
|
|
1020
1022
|
requestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
1021
|
-
setInterval: (handler: TimerHandler, timeout?: number
|
|
1022
|
-
setTimeout: (handler: TimerHandler, timeout?: number
|
|
1023
|
+
setInterval: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
|
|
1024
|
+
setTimeout: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
|
|
1023
1025
|
};
|
|
1024
1026
|
/**
|
|
1025
1027
|
* A manager for the user and their preferences.
|
|
@@ -1553,7 +1555,9 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1553
1555
|
*/
|
|
1554
1556
|
deselect(...shapes: TLShape[] | TLShapeId[]): this;
|
|
1555
1557
|
/**
|
|
1556
|
-
* Select all
|
|
1558
|
+
* Select all shapes. If the user has selected shapes that share a parent,
|
|
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.
|
|
1557
1561
|
*
|
|
1558
1562
|
* @example
|
|
1559
1563
|
* ```ts
|
|
@@ -1587,7 +1591,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1587
1591
|
*
|
|
1588
1592
|
* @public
|
|
1589
1593
|
*/
|
|
1590
|
-
getNearestAdjacentShape(currentShapeId: TLShapeId, direction: 'down' | 'left' | 'right' | 'up'): TLShapeId;
|
|
1594
|
+
getNearestAdjacentShape(shapes: TLShape[], currentShapeId: TLShapeId, direction: 'down' | 'left' | 'right' | 'up'): TLShapeId;
|
|
1591
1595
|
selectParentShape(): void;
|
|
1592
1596
|
selectFirstChildShape(): void;
|
|
1593
1597
|
private _selectShapesAndZoom;
|
|
@@ -2068,10 +2072,10 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2068
2072
|
*/
|
|
2069
2073
|
slideCamera(opts?: {
|
|
2070
2074
|
direction: VecLike;
|
|
2071
|
-
force?: boolean
|
|
2072
|
-
friction?: number
|
|
2075
|
+
force?: boolean;
|
|
2076
|
+
friction?: number;
|
|
2073
2077
|
speed: number;
|
|
2074
|
-
speedThreshold?: number
|
|
2078
|
+
speedThreshold?: number;
|
|
2075
2079
|
}): this;
|
|
2076
2080
|
/**
|
|
2077
2081
|
* Animate the camera to a user's cursor position. This also briefly show the user's cursor if it's not currently visible.
|
|
@@ -2683,12 +2687,12 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2683
2687
|
*/
|
|
2684
2688
|
getShapeAtPoint(point: VecLike, opts?: {
|
|
2685
2689
|
filter?(shape: TLShape): boolean;
|
|
2686
|
-
hitFrameInside?: boolean
|
|
2687
|
-
hitInside?: boolean
|
|
2688
|
-
hitLabels?: boolean
|
|
2689
|
-
hitLocked?: boolean
|
|
2690
|
-
margin?: number
|
|
2691
|
-
renderingOnly?: boolean
|
|
2690
|
+
hitFrameInside?: boolean;
|
|
2691
|
+
hitInside?: boolean;
|
|
2692
|
+
hitLabels?: boolean;
|
|
2693
|
+
hitLocked?: boolean;
|
|
2694
|
+
margin?: number;
|
|
2695
|
+
renderingOnly?: boolean;
|
|
2692
2696
|
}): TLShape | undefined;
|
|
2693
2697
|
/**
|
|
2694
2698
|
* Get the shapes, if any, at a given page point.
|
|
@@ -2707,8 +2711,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2707
2711
|
* @public
|
|
2708
2712
|
*/
|
|
2709
2713
|
getShapesAtPoint(point: VecLike, opts?: {
|
|
2710
|
-
hitInside?: boolean
|
|
2711
|
-
margin?: number
|
|
2714
|
+
hitInside?: boolean;
|
|
2715
|
+
margin?: number;
|
|
2712
2716
|
}): TLShape[];
|
|
2713
2717
|
/**
|
|
2714
2718
|
* Test whether a point (in the current page space) will will a shape. This method takes into account masks,
|
|
@@ -2726,8 +2730,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2726
2730
|
* @public
|
|
2727
2731
|
*/
|
|
2728
2732
|
isPointInShape(shape: TLShape | TLShapeId, point: VecLike, opts?: {
|
|
2729
|
-
hitInside?: boolean
|
|
2730
|
-
margin?: number
|
|
2733
|
+
hitInside?: boolean;
|
|
2734
|
+
margin?: number;
|
|
2731
2735
|
}): boolean;
|
|
2732
2736
|
/**
|
|
2733
2737
|
* Convert a point in the current page space to a point in the local space of a shape. For example, if a
|
|
@@ -4013,7 +4017,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
4013
4017
|
}
|
|
4014
4018
|
|
|
4015
4019
|
/** @public */
|
|
4016
|
-
export declare const EditorContext:
|
|
4020
|
+
export declare const EditorContext: React_3.Context<Editor | null>;
|
|
4017
4021
|
|
|
4018
4022
|
/** @public @react */
|
|
4019
4023
|
export declare function EditorProvider({ editor, children }: EditorProviderProps): JSX_2.Element;
|
|
@@ -4021,7 +4025,7 @@ export declare function EditorProvider({ editor, children }: EditorProviderProps
|
|
|
4021
4025
|
/** @public */
|
|
4022
4026
|
export declare interface EditorProviderProps {
|
|
4023
4027
|
editor: Editor;
|
|
4024
|
-
children:
|
|
4028
|
+
children: React_3.ReactNode;
|
|
4025
4029
|
}
|
|
4026
4030
|
|
|
4027
4031
|
/** @public */
|
|
@@ -4047,7 +4051,7 @@ export declare class Ellipse2d extends Geometry2d {
|
|
|
4047
4051
|
}
|
|
4048
4052
|
|
|
4049
4053
|
/** @public */
|
|
4050
|
-
export declare class ErrorBoundary extends
|
|
4054
|
+
export declare class ErrorBoundary extends React_2.Component<React_2.PropsWithRef<React_2.PropsWithChildren<TLErrorBoundaryProps>>, {
|
|
4051
4055
|
error: Error | null;
|
|
4052
4056
|
}> {
|
|
4053
4057
|
static getDerivedStateFromError(error: Error): {
|
|
@@ -4057,7 +4061,7 @@ export declare class ErrorBoundary extends React_3.Component<React_3.PropsWithRe
|
|
|
4057
4061
|
error: null;
|
|
4058
4062
|
};
|
|
4059
4063
|
componentDidCatch(error: unknown): void;
|
|
4060
|
-
render(): boolean | JSX_2.Element | Iterable<
|
|
4064
|
+
render(): boolean | JSX_2.Element | Iterable<React_2.ReactNode> | null | number | string | undefined;
|
|
4061
4065
|
}
|
|
4062
4066
|
|
|
4063
4067
|
/** @public @react */
|
|
@@ -4318,6 +4322,8 @@ export declare function getSvgPathFromPoints(points: VecLike[], closed?: boolean
|
|
|
4318
4322
|
/** @public */
|
|
4319
4323
|
export declare function getUserPreferences(): TLUserPreferences;
|
|
4320
4324
|
|
|
4325
|
+
/* Excluded from this release type: getVerticesCountForArcLength */
|
|
4326
|
+
|
|
4321
4327
|
/** @public */
|
|
4322
4328
|
export declare class Group2d extends Geometry2d {
|
|
4323
4329
|
children: Geometry2d[];
|
|
@@ -4461,7 +4467,7 @@ export declare class HistoryManager<R extends UnknownRecord> {
|
|
|
4461
4467
|
export declare function HTMLContainer({ children, className, ...rest }: HTMLContainerProps): JSX_2.Element;
|
|
4462
4468
|
|
|
4463
4469
|
/** @public */
|
|
4464
|
-
export declare type HTMLContainerProps =
|
|
4470
|
+
export declare type HTMLContainerProps = React_2.HTMLAttributes<HTMLDivElement>;
|
|
4465
4471
|
|
|
4466
4472
|
/** @public */
|
|
4467
4473
|
export declare const inlineBase64AssetStore: TLAssetStore;
|
|
@@ -4517,7 +4523,7 @@ export declare function intersectLineSegmentCircle(a1: VecLike, a2: VecLike, c:
|
|
|
4517
4523
|
* @param b2 - The second segment's second point.
|
|
4518
4524
|
* @public
|
|
4519
4525
|
*/
|
|
4520
|
-
export declare function intersectLineSegmentLineSegment(a1: VecLike, a2: VecLike, b1: VecLike, b2: VecLike): null | Vec;
|
|
4526
|
+
export declare function intersectLineSegmentLineSegment(a1: VecLike, a2: VecLike, b1: VecLike, b2: VecLike, precision?: number): null | Vec;
|
|
4521
4527
|
|
|
4522
4528
|
/**
|
|
4523
4529
|
* Find the intersections between a line segment and a closed polygon.
|
|
@@ -4823,7 +4829,7 @@ export declare function precise(A: VecLike): string;
|
|
|
4823
4829
|
* @param event - To prevent default on
|
|
4824
4830
|
* @public
|
|
4825
4831
|
*/
|
|
4826
|
-
export declare function preventDefault(event: Event |
|
|
4832
|
+
export declare function preventDefault(event: Event | React_3.BaseSyntheticEvent): void;
|
|
4827
4833
|
|
|
4828
4834
|
/**
|
|
4829
4835
|
* Convert radians to degrees.
|
|
@@ -4858,10 +4864,10 @@ export declare class ReadonlySharedStyleMap {
|
|
|
4858
4864
|
getAsKnownValue<T>(prop: StyleProp<T>): T | undefined;
|
|
4859
4865
|
get size(): number;
|
|
4860
4866
|
equals(other: ReadonlySharedStyleMap): boolean;
|
|
4861
|
-
keys():
|
|
4862
|
-
values():
|
|
4863
|
-
entries():
|
|
4864
|
-
[Symbol.iterator]():
|
|
4867
|
+
keys(): MapIterator<StyleProp<any>>;
|
|
4868
|
+
values(): MapIterator<SharedStyle<unknown>>;
|
|
4869
|
+
entries(): MapIterator<[StyleProp<any>, SharedStyle<unknown>]>;
|
|
4870
|
+
[Symbol.iterator](): MapIterator<[StyleProp<any>, SharedStyle<unknown>]>;
|
|
4865
4871
|
}
|
|
4866
4872
|
|
|
4867
4873
|
/** @public */
|
|
@@ -4885,7 +4891,7 @@ export declare class Rectangle2d extends Polygon2d {
|
|
|
4885
4891
|
export declare function refreshPage(): void;
|
|
4886
4892
|
|
|
4887
4893
|
/** @public */
|
|
4888
|
-
export declare function releasePointerCapture(element: Element, event: PointerEvent |
|
|
4894
|
+
export declare function releasePointerCapture(element: Element, event: PointerEvent | React_3.PointerEvent<Element>): void;
|
|
4889
4895
|
|
|
4890
4896
|
/** @public */
|
|
4891
4897
|
export declare type RequiredKeys<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
|
|
@@ -5028,7 +5034,7 @@ export declare type SelectionEdge = 'bottom' | 'left' | 'right' | 'top';
|
|
|
5028
5034
|
export declare type SelectionHandle = SelectionCorner | SelectionEdge;
|
|
5029
5035
|
|
|
5030
5036
|
/** @public */
|
|
5031
|
-
export declare function setPointerCapture(element: Element, event: PointerEvent |
|
|
5037
|
+
export declare function setPointerCapture(element: Element, event: PointerEvent | React_3.PointerEvent<Element>): void;
|
|
5032
5038
|
|
|
5033
5039
|
/** @public */
|
|
5034
5040
|
export declare function setRuntimeOverrides(input: Partial<typeof runtime>): void;
|
|
@@ -5412,6 +5418,14 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5412
5418
|
* @public
|
|
5413
5419
|
*/
|
|
5414
5420
|
onResizeEnd?(initial: Shape, current: Shape): TLShapePartial<Shape> | void;
|
|
5421
|
+
/**
|
|
5422
|
+
* A callback called when a shape resize is cancelled.
|
|
5423
|
+
*
|
|
5424
|
+
* @param initial - The shape at the start of the resize.
|
|
5425
|
+
* @param current - The current shape.
|
|
5426
|
+
* @public
|
|
5427
|
+
*/
|
|
5428
|
+
onResizeCancel?(initial: Shape, current: Shape): void;
|
|
5415
5429
|
/**
|
|
5416
5430
|
* A callback called when a shape starts being translated.
|
|
5417
5431
|
*
|
|
@@ -5438,6 +5452,23 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5438
5452
|
* @public
|
|
5439
5453
|
*/
|
|
5440
5454
|
onTranslateEnd?(initial: Shape, current: Shape): TLShapePartial<Shape> | void;
|
|
5455
|
+
/**
|
|
5456
|
+
* A callback called when a shape translation is cancelled.
|
|
5457
|
+
*
|
|
5458
|
+
* @param initial - The shape at the start of the translation.
|
|
5459
|
+
* @param current - The current shape.
|
|
5460
|
+
* @public
|
|
5461
|
+
*/
|
|
5462
|
+
onTranslateCancel?(initial: Shape, current: Shape): void;
|
|
5463
|
+
/**
|
|
5464
|
+
* A callback called when a shape's handle starts being dragged.
|
|
5465
|
+
*
|
|
5466
|
+
* @param shape - The shape.
|
|
5467
|
+
* @param info - An object containing the handle and whether the handle is 'precise' or not.
|
|
5468
|
+
* @returns A change to apply to the shape, or void.
|
|
5469
|
+
* @public
|
|
5470
|
+
*/
|
|
5471
|
+
onHandleDragStart?(shape: Shape, info: TLHandleDragInfo<Shape>): TLShapePartial<Shape> | void;
|
|
5441
5472
|
/**
|
|
5442
5473
|
* A callback called when a shape's handle changes.
|
|
5443
5474
|
*
|
|
@@ -5447,6 +5478,23 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5447
5478
|
* @public
|
|
5448
5479
|
*/
|
|
5449
5480
|
onHandleDrag?(shape: Shape, info: TLHandleDragInfo<Shape>): TLShapePartial<Shape> | void;
|
|
5481
|
+
/**
|
|
5482
|
+
* A callback called when a shape's handle finishes being dragged.
|
|
5483
|
+
*
|
|
5484
|
+
* @param current - The current shape.
|
|
5485
|
+
* @param info - An object containing the handle and whether the handle is 'precise' or not.
|
|
5486
|
+
* @returns A change to apply to the shape, or void.
|
|
5487
|
+
* @public
|
|
5488
|
+
*/
|
|
5489
|
+
onHandleDragEnd?(current: Shape, info: TLHandleDragInfo<Shape>): TLShapePartial<Shape> | void;
|
|
5490
|
+
/**
|
|
5491
|
+
* A callback called when a shape's handle drag is cancelled.
|
|
5492
|
+
*
|
|
5493
|
+
* @param current - The current shape.
|
|
5494
|
+
* @param info - An object containing the handle and whether the handle is 'precise' or not.
|
|
5495
|
+
* @public
|
|
5496
|
+
*/
|
|
5497
|
+
onHandleDragCancel?(current: Shape, info: TLHandleDragInfo<Shape>): void;
|
|
5450
5498
|
/**
|
|
5451
5499
|
* A callback called when a shape starts being rotated.
|
|
5452
5500
|
*
|
|
@@ -5473,6 +5521,14 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5473
5521
|
* @public
|
|
5474
5522
|
*/
|
|
5475
5523
|
onRotateEnd?(initial: Shape, current: Shape): TLShapePartial<Shape> | void;
|
|
5524
|
+
/**
|
|
5525
|
+
* A callback called when a shape rotation is cancelled.
|
|
5526
|
+
*
|
|
5527
|
+
* @param initial - The shape at the start of the rotation.
|
|
5528
|
+
* @param current - The current shape.
|
|
5529
|
+
* @public
|
|
5530
|
+
*/
|
|
5531
|
+
onRotateCancel?(initial: Shape, current: Shape): void;
|
|
5476
5532
|
/* Excluded from this release type: onBindingChange */
|
|
5477
5533
|
/**
|
|
5478
5534
|
* A callback called when a shape's children change.
|
|
@@ -5701,6 +5757,12 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
|
|
|
5701
5757
|
_currentToolIdMask: Atom<string | undefined, unknown>;
|
|
5702
5758
|
getCurrentToolIdMask(): string | undefined;
|
|
5703
5759
|
setCurrentToolIdMask(id: string | undefined): void;
|
|
5760
|
+
/**
|
|
5761
|
+
* Add a child node to this state node.
|
|
5762
|
+
*
|
|
5763
|
+
* @public
|
|
5764
|
+
*/
|
|
5765
|
+
addChild(childConstructor: TLStateNodeConstructor): this;
|
|
5704
5766
|
onWheel?(info: TLWheelEventInfo): void;
|
|
5705
5767
|
onPointerDown?(info: TLPointerEventInfo): void;
|
|
5706
5768
|
onPointerMove?(info: TLPointerEventInfo): void;
|
|
@@ -5734,7 +5796,7 @@ export declare function suffixSafeId(id: SafeId, suffix: string): SafeId;
|
|
|
5734
5796
|
export declare function SVGContainer({ children, className, ...rest }: SVGContainerProps): JSX_2.Element;
|
|
5735
5797
|
|
|
5736
5798
|
/** @public */
|
|
5737
|
-
export declare type SVGContainerProps =
|
|
5799
|
+
export declare type SVGContainerProps = React_2.ComponentProps<'svg'>;
|
|
5738
5800
|
|
|
5739
5801
|
/** @public */
|
|
5740
5802
|
export declare interface SvgExportContext {
|
|
@@ -5795,10 +5857,9 @@ export declare const TAB_ID: string;
|
|
|
5795
5857
|
export declare class TextManager {
|
|
5796
5858
|
editor: Editor;
|
|
5797
5859
|
private elm;
|
|
5798
|
-
private defaultStyles;
|
|
5799
5860
|
constructor(editor: Editor);
|
|
5861
|
+
private setElementStyles;
|
|
5800
5862
|
dispose(): void;
|
|
5801
|
-
private resetElmStyles;
|
|
5802
5863
|
measureText(textToMeasure: string, opts: TLMeasureTextOpts): BoxModel & {
|
|
5803
5864
|
scrollWidth: number;
|
|
5804
5865
|
};
|
|
@@ -6142,7 +6203,7 @@ export declare interface TLDragShapesOverInfo {
|
|
|
6142
6203
|
}
|
|
6143
6204
|
|
|
6144
6205
|
/** @public @react */
|
|
6145
|
-
export declare const TldrawEditor:
|
|
6206
|
+
export declare const TldrawEditor: React_3.NamedExoticComponent<TldrawEditorProps>;
|
|
6146
6207
|
|
|
6147
6208
|
/**
|
|
6148
6209
|
* Base props for the {@link tldraw#Tldraw} and {@link TldrawEditor} components.
|
|
@@ -6419,7 +6480,7 @@ export declare interface TLEditorComponents {
|
|
|
6419
6480
|
ShapeIndicator?: ComponentType<TLShapeIndicatorProps> | null;
|
|
6420
6481
|
ShapeIndicators?: ComponentType | null;
|
|
6421
6482
|
SnapIndicator?: ComponentType<TLSnapIndicatorProps> | null;
|
|
6422
|
-
Spinner?: ComponentType | null;
|
|
6483
|
+
Spinner?: ComponentType<React.SVGProps<SVGSVGElement>> | null;
|
|
6423
6484
|
SvgDefs?: ComponentType | null;
|
|
6424
6485
|
ZoomBrush?: ComponentType<TLBrushProps> | null;
|
|
6425
6486
|
ErrorFallback?: TLErrorFallbackComponent;
|
|
@@ -6546,7 +6607,7 @@ export declare const tlenv: {
|
|
|
6546
6607
|
|
|
6547
6608
|
/** @public */
|
|
6548
6609
|
export declare interface TLErrorBoundaryProps {
|
|
6549
|
-
children:
|
|
6610
|
+
children: React_2.ReactNode;
|
|
6550
6611
|
onError?: ((error: unknown) => void) | null;
|
|
6551
6612
|
fallback: TLErrorFallbackComponent;
|
|
6552
6613
|
}
|
|
@@ -6765,6 +6826,7 @@ export declare interface TLGridProps {
|
|
|
6765
6826
|
export declare interface TLHandleDragInfo<T extends TLShape> {
|
|
6766
6827
|
handle: TLHandle;
|
|
6767
6828
|
isPrecise: boolean;
|
|
6829
|
+
isCreatingShape: boolean;
|
|
6768
6830
|
initial?: T | undefined;
|
|
6769
6831
|
}
|
|
6770
6832
|
|
|
@@ -7502,6 +7564,7 @@ export declare interface TLUserPreferences {
|
|
|
7502
7564
|
color?: null | string;
|
|
7503
7565
|
locale?: null | string;
|
|
7504
7566
|
animationSpeed?: null | number;
|
|
7567
|
+
areKeyboardShortcutsEnabled?: boolean | null;
|
|
7505
7568
|
edgeScrollSpeed?: null | number;
|
|
7506
7569
|
colorScheme?: 'dark' | 'light' | 'system';
|
|
7507
7570
|
isSnapMode?: boolean | null;
|
|
@@ -7670,6 +7733,7 @@ export declare class UserPreferencesManager {
|
|
|
7670
7733
|
updateUserPreferences(userPreferences: Partial<TLUserPreferences>): void;
|
|
7671
7734
|
getUserPreferences(): {
|
|
7672
7735
|
animationSpeed: number;
|
|
7736
|
+
areKeyboardShortcutsEnabled: boolean;
|
|
7673
7737
|
color: string;
|
|
7674
7738
|
colorScheme: "dark" | "light" | "system" | undefined;
|
|
7675
7739
|
id: string;
|
|
@@ -7686,6 +7750,7 @@ export declare class UserPreferencesManager {
|
|
|
7686
7750
|
*/
|
|
7687
7751
|
getEdgeScrollSpeed(): number;
|
|
7688
7752
|
getAnimationSpeed(): number;
|
|
7753
|
+
getAreKeyboardShortcutsEnabled(): boolean;
|
|
7689
7754
|
getId(): string;
|
|
7690
7755
|
getName(): string;
|
|
7691
7756
|
getLocale(): string;
|
package/dist-esm/index.mjs
CHANGED
|
@@ -10,19 +10,6 @@ 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";
|
|
26
13
|
import { DefaultBackground } from "./lib/components/default-components/DefaultBackground.mjs";
|
|
27
14
|
import { DefaultBrush } from "./lib/components/default-components/DefaultBrush.mjs";
|
|
28
15
|
import {
|
|
@@ -64,38 +51,45 @@ import {
|
|
|
64
51
|
} from "./lib/components/default-components/DefaultSnapIndictor.mjs";
|
|
65
52
|
import { DefaultSpinner } from "./lib/components/default-components/DefaultSpinner.mjs";
|
|
66
53
|
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";
|
|
67
68
|
import {
|
|
68
69
|
getSnapshot,
|
|
69
70
|
loadSnapshot
|
|
70
71
|
} from "./lib/config/TLEditorSnapshot.mjs";
|
|
71
72
|
import {
|
|
72
|
-
TAB_ID,
|
|
73
73
|
createSessionStateSnapshotSignal,
|
|
74
74
|
extractSessionStateFromLegacySnapshot,
|
|
75
|
-
loadSessionStateSnapshotIntoStore
|
|
75
|
+
loadSessionStateSnapshotIntoStore,
|
|
76
|
+
TAB_ID
|
|
76
77
|
} from "./lib/config/TLSessionStateSnapshot.mjs";
|
|
77
78
|
import {
|
|
78
|
-
USER_COLORS,
|
|
79
79
|
defaultUserPreferences,
|
|
80
80
|
getFreshUserPreferences,
|
|
81
81
|
getUserPreferences,
|
|
82
82
|
setUserPreferences,
|
|
83
|
+
USER_COLORS,
|
|
83
84
|
userTypeValidator
|
|
84
85
|
} from "./lib/config/TLUserPreferences.mjs";
|
|
85
|
-
import {
|
|
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
86
|
import { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from "./lib/constants.mjs";
|
|
93
|
-
import {
|
|
94
|
-
Editor
|
|
95
|
-
} from "./lib/editor/Editor.mjs";
|
|
96
87
|
import {
|
|
97
88
|
BindingUtil
|
|
98
89
|
} from "./lib/editor/bindings/BindingUtil.mjs";
|
|
90
|
+
import {
|
|
91
|
+
Editor
|
|
92
|
+
} from "./lib/editor/Editor.mjs";
|
|
99
93
|
import { ClickManager } from "./lib/editor/managers/ClickManager/ClickManager.mjs";
|
|
100
94
|
import { EdgeScrollManager } from "./lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs";
|
|
101
95
|
import {
|
|
@@ -117,10 +111,10 @@ import {
|
|
|
117
111
|
} from "./lib/editor/managers/TextManager/TextManager.mjs";
|
|
118
112
|
import { UserPreferencesManager } from "./lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs";
|
|
119
113
|
import { BaseBoxShapeUtil } from "./lib/editor/shapes/BaseBoxShapeUtil.mjs";
|
|
114
|
+
import { GroupShapeUtil } from "./lib/editor/shapes/group/GroupShapeUtil.mjs";
|
|
120
115
|
import {
|
|
121
116
|
ShapeUtil
|
|
122
117
|
} from "./lib/editor/shapes/ShapeUtil.mjs";
|
|
123
|
-
import { GroupShapeUtil } from "./lib/editor/shapes/group/GroupShapeUtil.mjs";
|
|
124
118
|
import {
|
|
125
119
|
getPerfectDashProps
|
|
126
120
|
} from "./lib/editor/shapes/shared/getPerfectDashProps.mjs";
|
|
@@ -129,13 +123,13 @@ import { resizeScaled } from "./lib/editor/shapes/shared/resizeScaled.mjs";
|
|
|
129
123
|
import { BaseBoxShapeTool } from "./lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.mjs";
|
|
130
124
|
import { maybeSnapToGrid } from "./lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs";
|
|
131
125
|
import { StateNode } from "./lib/editor/tools/StateNode.mjs";
|
|
126
|
+
import {
|
|
127
|
+
EVENT_NAME_MAP
|
|
128
|
+
} from "./lib/editor/types/event-types.mjs";
|
|
132
129
|
import {
|
|
133
130
|
useDelaySvgExport,
|
|
134
131
|
useSvgExportContext
|
|
135
132
|
} from "./lib/editor/types/SvgExportContext.mjs";
|
|
136
|
-
import {
|
|
137
|
-
EVENT_NAME_MAP
|
|
138
|
-
} from "./lib/editor/types/event-types.mjs";
|
|
139
133
|
import { getSvgAsImage } from "./lib/exports/getSvgAsImage.mjs";
|
|
140
134
|
import { tlenv } from "./lib/globals/environment.mjs";
|
|
141
135
|
import { tlmenus } from "./lib/globals/menus.mjs";
|
|
@@ -184,8 +178,6 @@ import {
|
|
|
184
178
|
ROTATE_CORNER_TO_SELECTION_CORNER,
|
|
185
179
|
rotateSelectionHandle
|
|
186
180
|
} from "./lib/primitives/Box.mjs";
|
|
187
|
-
import { Mat } from "./lib/primitives/Mat.mjs";
|
|
188
|
-
import { Vec } from "./lib/primitives/Vec.mjs";
|
|
189
181
|
import { EASINGS } from "./lib/primitives/easings.mjs";
|
|
190
182
|
import { Arc2d } from "./lib/primitives/geometry/Arc2d.mjs";
|
|
191
183
|
import { Circle2d } from "./lib/primitives/geometry/Circle2d.mjs";
|
|
@@ -193,6 +185,7 @@ import { CubicBezier2d } from "./lib/primitives/geometry/CubicBezier2d.mjs";
|
|
|
193
185
|
import { CubicSpline2d } from "./lib/primitives/geometry/CubicSpline2d.mjs";
|
|
194
186
|
import { Edge2d } from "./lib/primitives/geometry/Edge2d.mjs";
|
|
195
187
|
import { Ellipse2d } from "./lib/primitives/geometry/Ellipse2d.mjs";
|
|
188
|
+
import { getVerticesCountForArcLength } from "./lib/primitives/geometry/geometry-constants.mjs";
|
|
196
189
|
import {
|
|
197
190
|
Geometry2d,
|
|
198
191
|
Geometry2dFilters,
|
|
@@ -218,11 +211,8 @@ import {
|
|
|
218
211
|
polygonIntersectsPolyline,
|
|
219
212
|
polygonsIntersect
|
|
220
213
|
} from "./lib/primitives/intersect.mjs";
|
|
214
|
+
import { Mat } from "./lib/primitives/Mat.mjs";
|
|
221
215
|
import {
|
|
222
|
-
HALF_PI,
|
|
223
|
-
PI,
|
|
224
|
-
PI2,
|
|
225
|
-
SIN,
|
|
226
216
|
angleDistance,
|
|
227
217
|
approximately,
|
|
228
218
|
areAnglesCompatible,
|
|
@@ -239,22 +229,29 @@ import {
|
|
|
239
229
|
getPointOnCircle,
|
|
240
230
|
getPointsOnArc,
|
|
241
231
|
getPolygonVertices,
|
|
232
|
+
HALF_PI,
|
|
242
233
|
isSafeFloat,
|
|
243
234
|
perimeterOfEllipse,
|
|
235
|
+
PI,
|
|
236
|
+
PI2,
|
|
244
237
|
pointInPolygon,
|
|
245
238
|
precise,
|
|
246
239
|
radiansToDegrees,
|
|
247
240
|
rangeIntersection,
|
|
248
241
|
shortAngleDist,
|
|
242
|
+
SIN,
|
|
249
243
|
snapAngle,
|
|
250
244
|
toDomPrecision,
|
|
251
245
|
toFixed,
|
|
252
246
|
toPrecision
|
|
253
247
|
} from "./lib/primitives/utils.mjs";
|
|
248
|
+
import { Vec } from "./lib/primitives/Vec.mjs";
|
|
254
249
|
import {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
250
|
+
ErrorScreen,
|
|
251
|
+
LoadingScreen,
|
|
252
|
+
TldrawEditor,
|
|
253
|
+
useOnMount
|
|
254
|
+
} from "./lib/TldrawEditor.mjs";
|
|
258
255
|
import { dataUrlToFile, getDefaultCdnBaseUrl } from "./lib/utils/assets.mjs";
|
|
259
256
|
import { clampToBrowserMaxCanvasSize } from "./lib/utils/browserCanvasMaxSize.mjs";
|
|
260
257
|
import {
|
|
@@ -289,8 +286,12 @@ import {
|
|
|
289
286
|
getRotationSnapshot
|
|
290
287
|
} from "./lib/utils/rotation.mjs";
|
|
291
288
|
import { runtime, setRuntimeOverrides } from "./lib/utils/runtime.mjs";
|
|
292
|
-
import {
|
|
289
|
+
import {
|
|
290
|
+
ReadonlySharedStyleMap,
|
|
291
|
+
SharedStyleMap
|
|
292
|
+
} from "./lib/utils/SharedStylesMap.mjs";
|
|
293
293
|
import { hardReset } from "./lib/utils/sync/hardReset.mjs";
|
|
294
|
+
import { LocalIndexedDb, Table } from "./lib/utils/sync/LocalIndexedDb.mjs";
|
|
294
295
|
import { uniq } from "./lib/utils/uniq.mjs";
|
|
295
296
|
import { openWindow } from "./lib/utils/window-open.mjs";
|
|
296
297
|
function debugEnableLicensing() {
|
|
@@ -298,7 +299,7 @@ function debugEnableLicensing() {
|
|
|
298
299
|
}
|
|
299
300
|
registerTldrawLibraryVersion(
|
|
300
301
|
"@tldraw/editor",
|
|
301
|
-
"3.15.0-canary.
|
|
302
|
+
"3.15.0-canary.53600affdb31",
|
|
302
303
|
"esm"
|
|
303
304
|
);
|
|
304
305
|
export {
|
|
@@ -427,6 +428,7 @@ export {
|
|
|
427
428
|
getSvgAsImage,
|
|
428
429
|
getSvgPathFromPoints,
|
|
429
430
|
getUserPreferences,
|
|
431
|
+
getVerticesCountForArcLength,
|
|
430
432
|
hardReset,
|
|
431
433
|
hardResetEditor,
|
|
432
434
|
inlineBase64AssetStore,
|