@tldraw/editor 3.13.0-canary.3ac739625a6f → 3.13.0-canary.409fd05a1a56
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 +129 -113
- package/dist-cjs/index.js +7 -22
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/TldrawEditor.js +2 -1
- package/dist-cjs/lib/TldrawEditor.js.map +2 -2
- package/dist-cjs/lib/components/Shape.js +12 -8
- package/dist-cjs/lib/components/Shape.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +37 -8
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js +14 -12
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js +17 -11
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultSpinner.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultSpinner.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +110 -44
- package/dist-cjs/lib/editor/Editor.js.map +3 -3
- package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TextManager.js +10 -0
- package/dist-cjs/lib/editor/managers/TextManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js +1 -1
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js +0 -3
- package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/shared/getPerfectDashProps.js.map +2 -2
- package/dist-cjs/lib/exports/getSvgJsx.js +12 -3
- package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
- package/dist-cjs/lib/hooks/useDocumentEvents.js +3 -2
- package/dist-cjs/lib/hooks/useDocumentEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useEditorComponents.js +16 -16
- package/dist-cjs/lib/hooks/useEditorComponents.js.map +2 -2
- package/dist-cjs/lib/license/LicenseManager.js +8 -1
- package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
- package/dist-cjs/lib/options.js.map +2 -2
- package/dist-cjs/lib/primitives/Box.js +16 -0
- package/dist-cjs/lib/primitives/Box.js.map +2 -2
- package/dist-cjs/lib/primitives/Mat.js +1 -1
- package/dist-cjs/lib/primitives/Mat.js.map +2 -2
- package/dist-cjs/lib/primitives/Vec.js +20 -0
- package/dist-cjs/lib/primitives/Vec.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Arc2d.js +2 -2
- 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 -1
- package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Edge2d.js +1 -1
- package/dist-cjs/lib/primitives/geometry/Edge2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Ellipse2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js +91 -20
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Group2d.js +55 -2
- package/dist-cjs/lib/primitives/geometry/Group2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Point2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Polyline2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Stadium2d.js.map +2 -2
- package/dist-cjs/lib/utils/areShapesContentEqual.js +25 -0
- package/dist-cjs/lib/utils/areShapesContentEqual.js.map +7 -0
- package/dist-cjs/lib/utils/debug-flags.js +5 -2
- package/dist-cjs/lib/utils/debug-flags.js.map +2 -2
- package/dist-cjs/lib/utils/dom.js +3 -3
- package/dist-cjs/lib/utils/dom.js.map +2 -2
- package/dist-cjs/lib/utils/nearestMultiple.js +34 -0
- package/dist-cjs/lib/utils/nearestMultiple.js.map +7 -0
- package/dist-cjs/lib/utils/rotation.js +5 -5
- package/dist-cjs/lib/utils/rotation.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 +129 -113
- package/dist-esm/index.mjs +9 -41
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/TldrawEditor.mjs +2 -1
- package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
- package/dist-esm/lib/components/Shape.mjs +12 -8
- package/dist-esm/lib/components/Shape.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +37 -8
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs +14 -12
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs +17 -11
- package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultSpinner.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultSpinner.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +110 -44
- package/dist-esm/lib/editor/Editor.mjs.map +3 -3
- package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TextManager.mjs +10 -0
- package/dist-esm/lib/editor/managers/TextManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +1 -1
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs +0 -3
- package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/shared/getPerfectDashProps.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs +12 -3
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
- package/dist-esm/lib/hooks/useDocumentEvents.mjs +3 -2
- package/dist-esm/lib/hooks/useDocumentEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useEditorComponents.mjs +16 -18
- package/dist-esm/lib/hooks/useEditorComponents.mjs.map +2 -2
- package/dist-esm/lib/license/LicenseManager.mjs +8 -1
- package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
- package/dist-esm/lib/options.mjs.map +2 -2
- package/dist-esm/lib/primitives/Box.mjs +16 -0
- package/dist-esm/lib/primitives/Box.mjs.map +2 -2
- package/dist-esm/lib/primitives/Mat.mjs +1 -1
- package/dist-esm/lib/primitives/Mat.mjs.map +2 -2
- package/dist-esm/lib/primitives/Vec.mjs +20 -0
- package/dist-esm/lib/primitives/Vec.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 +1 -1
- package/dist-esm/lib/primitives/geometry/Circle2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs +1 -1
- package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Edge2d.mjs +1 -1
- package/dist-esm/lib/primitives/geometry/Edge2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +92 -21
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Group2d.mjs +55 -2
- package/dist-esm/lib/primitives/geometry/Group2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Point2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Polyline2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Stadium2d.mjs.map +2 -2
- package/dist-esm/lib/utils/areShapesContentEqual.mjs +5 -0
- package/dist-esm/lib/utils/areShapesContentEqual.mjs.map +7 -0
- package/dist-esm/lib/utils/debug-flags.mjs +5 -2
- package/dist-esm/lib/utils/debug-flags.mjs.map +2 -2
- package/dist-esm/lib/utils/dom.mjs +3 -3
- package/dist-esm/lib/utils/dom.mjs.map +2 -2
- package/dist-esm/lib/utils/nearestMultiple.mjs +14 -0
- package/dist-esm/lib/utils/nearestMultiple.mjs.map +7 -0
- package/dist-esm/lib/utils/rotation.mjs +5 -5
- package/dist-esm/lib/utils/rotation.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +47 -4
- package/package.json +7 -7
- package/src/index.ts +16 -31
- package/src/lib/TldrawEditor.tsx +6 -1
- package/src/lib/components/Shape.tsx +14 -10
- package/src/lib/components/default-components/DefaultCanvas.tsx +43 -8
- package/src/lib/components/default-components/DefaultErrorFallback.tsx +25 -14
- package/src/lib/components/default-components/DefaultShapeIndicator.tsx +17 -8
- package/src/lib/components/default-components/DefaultSpinner.tsx +1 -1
- package/src/lib/editor/Editor.test.ts +1 -1
- package/src/lib/editor/Editor.ts +118 -43
- package/src/lib/editor/managers/SnapManager/HandleSnaps.ts +0 -1
- package/src/lib/editor/managers/TextManager.ts +12 -0
- package/src/lib/editor/shapes/ShapeUtil.ts +23 -3
- package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +0 -4
- package/src/lib/editor/shapes/shared/getPerfectDashProps.ts +9 -9
- package/src/lib/exports/getSvgJsx.tsx +16 -7
- package/src/lib/hooks/useDocumentEvents.ts +7 -2
- package/src/lib/hooks/useEditorComponents.tsx +33 -32
- package/src/lib/license/LicenseManager.test.ts +40 -0
- package/src/lib/license/LicenseManager.ts +13 -1
- package/src/lib/options.ts +4 -0
- package/src/lib/primitives/Box.ts +20 -0
- package/src/lib/primitives/Mat.ts +5 -4
- package/src/lib/primitives/Vec.ts +23 -0
- package/src/lib/primitives/geometry/Arc2d.ts +5 -5
- package/src/lib/primitives/geometry/Circle2d.ts +4 -4
- package/src/lib/primitives/geometry/CubicBezier2d.ts +4 -4
- package/src/lib/primitives/geometry/CubicSpline2d.ts +3 -3
- package/src/lib/primitives/geometry/Edge2d.ts +3 -3
- package/src/lib/primitives/geometry/Ellipse2d.ts +3 -3
- package/src/lib/primitives/geometry/Geometry2d.test.ts +42 -0
- package/src/lib/primitives/geometry/Geometry2d.ts +123 -35
- package/src/lib/primitives/geometry/Group2d.ts +70 -7
- package/src/lib/primitives/geometry/Point2d.ts +2 -2
- package/src/lib/primitives/geometry/Polyline2d.ts +3 -3
- package/src/lib/primitives/geometry/Stadium2d.ts +3 -3
- package/src/lib/test/currentToolIdMask.test.ts +1 -1
- package/src/lib/test/user.test.ts +1 -1
- package/src/lib/utils/areShapesContentEqual.ts +4 -0
- package/src/lib/utils/debug-flags.ts +7 -2
- package/src/lib/utils/dom.ts +4 -4
- package/src/lib/utils/nearestMultiple.ts +13 -0
- package/src/lib/utils/rotation.ts +8 -6
- package/src/lib/utils/sync/LocalIndexedDb.test.ts +1 -1
- package/src/lib/utils/sync/TLLocalSyncClient.test.ts +1 -1
- package/src/version.ts +3 -3
package/dist-esm/index.d.mts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
|
|
3
3
|
import { Atom } from '@tldraw/state';
|
|
4
|
-
import { atom } from '@tldraw/state';
|
|
5
4
|
import { BoxModel } from '@tldraw/tlschema';
|
|
6
5
|
import { ComponentType } from 'react';
|
|
7
6
|
import { Computed } from '@tldraw/state';
|
|
8
|
-
import { computed } from '@tldraw/state';
|
|
9
7
|
import { Dispatch } from 'react';
|
|
10
8
|
import { Editor as Editor_2 } from '@tiptap/core';
|
|
11
9
|
import { EditorProviderProps } from '@tiptap/react';
|
|
12
|
-
import { EffectScheduler } from '@tldraw/state';
|
|
13
|
-
import { EMPTY_ARRAY } from '@tldraw/state';
|
|
14
10
|
import EventEmitter from 'eventemitter3';
|
|
15
11
|
import { ExoticComponent } from 'react';
|
|
16
12
|
import { HistoryEntry } from '@tldraw/store';
|
|
@@ -23,7 +19,6 @@ import { NamedExoticComponent } from 'react';
|
|
|
23
19
|
import { Node as Node_2 } from '@tiptap/pm/model';
|
|
24
20
|
import { PerformanceTracker } from '@tldraw/utils';
|
|
25
21
|
import { PointerEventHandler } from 'react';
|
|
26
|
-
import { react } from '@tldraw/state';
|
|
27
22
|
import { default as React_2 } from 'react';
|
|
28
23
|
import * as React_3 from 'react';
|
|
29
24
|
import { ReactElement } from 'react';
|
|
@@ -82,18 +77,8 @@ import { TLStoreSnapshot } from '@tldraw/tlschema';
|
|
|
82
77
|
import { TLUnknownBinding } from '@tldraw/tlschema';
|
|
83
78
|
import { TLUnknownShape } from '@tldraw/tlschema';
|
|
84
79
|
import { TLVideoAsset } from '@tldraw/tlschema';
|
|
85
|
-
import { track } from '@tldraw/state-react';
|
|
86
|
-
import { transact } from '@tldraw/state';
|
|
87
|
-
import { transaction } from '@tldraw/state';
|
|
88
80
|
import { UnknownRecord } from '@tldraw/store';
|
|
89
|
-
import { useAtom } from '@tldraw/state-react';
|
|
90
|
-
import { useComputed } from '@tldraw/state-react';
|
|
91
|
-
import { useQuickReactor } from '@tldraw/state-react';
|
|
92
|
-
import { useReactor } from '@tldraw/state-react';
|
|
93
|
-
import { useStateTracking } from '@tldraw/state-react';
|
|
94
|
-
import { useValue } from '@tldraw/state-react';
|
|
95
81
|
import { VecModel } from '@tldraw/tlschema';
|
|
96
|
-
import { whyAmIRunning } from '@tldraw/state';
|
|
97
82
|
|
|
98
83
|
/* Excluded from this release type: activeElementShouldCaptureKeys */
|
|
99
84
|
|
|
@@ -136,8 +121,8 @@ export declare class Arc2d extends Geometry2d {
|
|
|
136
121
|
start: Vec;
|
|
137
122
|
sweepFlag: number;
|
|
138
123
|
});
|
|
139
|
-
nearestPoint(point:
|
|
140
|
-
hitTestLineSegment(A:
|
|
124
|
+
nearestPoint(point: VecLike): Vec;
|
|
125
|
+
hitTestLineSegment(A: VecLike, B: VecLike): boolean;
|
|
141
126
|
getVertices(): Vec[];
|
|
142
127
|
getSvgPathData(first?: boolean): string;
|
|
143
128
|
getLength(): number;
|
|
@@ -153,10 +138,6 @@ export declare class Arc2d extends Geometry2d {
|
|
|
153
138
|
*/
|
|
154
139
|
export declare function areAnglesCompatible(a: number, b: number): boolean;
|
|
155
140
|
|
|
156
|
-
export { Atom }
|
|
157
|
-
|
|
158
|
-
export { atom }
|
|
159
|
-
|
|
160
141
|
/** @public */
|
|
161
142
|
export declare function average(A: VecLike, B: VecLike): string;
|
|
162
143
|
|
|
@@ -477,12 +458,16 @@ export declare class Box {
|
|
|
477
458
|
set point(val: Vec);
|
|
478
459
|
get minX(): number;
|
|
479
460
|
set minX(n: number);
|
|
461
|
+
get left(): number;
|
|
480
462
|
get midX(): number;
|
|
481
463
|
get maxX(): number;
|
|
464
|
+
get right(): number;
|
|
482
465
|
get minY(): number;
|
|
483
466
|
set minY(n: number);
|
|
467
|
+
get top(): number;
|
|
484
468
|
get midY(): number;
|
|
485
469
|
get maxY(): number;
|
|
470
|
+
get bottom(): number;
|
|
486
471
|
get width(): number;
|
|
487
472
|
set width(n: number);
|
|
488
473
|
get height(): number;
|
|
@@ -578,8 +563,8 @@ export declare class Circle2d extends Geometry2d {
|
|
|
578
563
|
});
|
|
579
564
|
getBounds(): Box;
|
|
580
565
|
getVertices(): Vec[];
|
|
581
|
-
nearestPoint(point:
|
|
582
|
-
hitTestLineSegment(A:
|
|
566
|
+
nearestPoint(point: VecLike): Vec;
|
|
567
|
+
hitTestLineSegment(A: VecLike, B: VecLike, distance?: number): boolean;
|
|
583
568
|
getSvgPathData(): string;
|
|
584
569
|
}
|
|
585
570
|
|
|
@@ -656,8 +641,6 @@ export declare class ClickManager {
|
|
|
656
641
|
*/
|
|
657
642
|
export declare function clockwiseAngleDist(a0: number, a1: number): number;
|
|
658
643
|
|
|
659
|
-
export { computed }
|
|
660
|
-
|
|
661
644
|
/**
|
|
662
645
|
* @public
|
|
663
646
|
* @react
|
|
@@ -745,10 +728,10 @@ export declare class CubicBezier2d extends Polyline2d {
|
|
|
745
728
|
});
|
|
746
729
|
getVertices(): Vec[];
|
|
747
730
|
midPoint(): Vec;
|
|
748
|
-
nearestPoint(A:
|
|
731
|
+
nearestPoint(A: VecLike): Vec;
|
|
749
732
|
getSvgPathData(first?: boolean): string;
|
|
750
733
|
static GetAtT(segment: CubicBezier2d, t: number): Vec;
|
|
751
|
-
getLength(precision?: number): number;
|
|
734
|
+
getLength(filters?: Geometry2dFilters, precision?: number): number;
|
|
752
735
|
}
|
|
753
736
|
|
|
754
737
|
/** @public */
|
|
@@ -761,8 +744,8 @@ export declare class CubicSpline2d extends Geometry2d {
|
|
|
761
744
|
get segments(): CubicBezier2d[];
|
|
762
745
|
getLength(): number;
|
|
763
746
|
getVertices(): Vec[];
|
|
764
|
-
nearestPoint(A:
|
|
765
|
-
hitTestLineSegment(A:
|
|
747
|
+
nearestPoint(A: VecLike): Vec;
|
|
748
|
+
hitTestLineSegment(A: VecLike, B: VecLike): boolean;
|
|
766
749
|
getSvgPathData(): string;
|
|
767
750
|
}
|
|
768
751
|
|
|
@@ -956,8 +939,8 @@ export declare class Edge2d extends Geometry2d {
|
|
|
956
939
|
getLength(): number;
|
|
957
940
|
midPoint(): Vec;
|
|
958
941
|
getVertices(): Vec[];
|
|
959
|
-
nearestPoint(point:
|
|
960
|
-
hitTestLineSegment(A:
|
|
942
|
+
nearestPoint(point: VecLike): Vec;
|
|
943
|
+
hitTestLineSegment(A: VecLike, B: VecLike, distance?: number): boolean;
|
|
961
944
|
getSvgPathData(first?: boolean): string;
|
|
962
945
|
}
|
|
963
946
|
|
|
@@ -1577,6 +1560,16 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1577
1560
|
* @public
|
|
1578
1561
|
*/
|
|
1579
1562
|
selectAll(): this;
|
|
1563
|
+
/**
|
|
1564
|
+
* Select the next shape in the reading order or in cardinal order.
|
|
1565
|
+
*
|
|
1566
|
+
* @example
|
|
1567
|
+
* ```ts
|
|
1568
|
+
* editor.selectAdjacentShape('next')
|
|
1569
|
+
* ```
|
|
1570
|
+
*
|
|
1571
|
+
* @public
|
|
1572
|
+
*/
|
|
1580
1573
|
selectAdjacentShape(direction: TLAdjacentDirection): void;
|
|
1581
1574
|
/**
|
|
1582
1575
|
* Generates a reading order for shapes based on rows grouping.
|
|
@@ -1585,12 +1578,16 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1585
1578
|
* @public
|
|
1586
1579
|
*/
|
|
1587
1580
|
getCurrentPageShapesInReadingOrder(): TLShape[];
|
|
1581
|
+
private _getShapesInReadingOrder;
|
|
1588
1582
|
/**
|
|
1589
1583
|
* Find the nearest adjacent shape in a specific direction.
|
|
1590
1584
|
*
|
|
1591
1585
|
* @public
|
|
1592
1586
|
*/
|
|
1593
1587
|
getNearestAdjacentShape(currentShapeId: TLShapeId, direction: 'down' | 'left' | 'right' | 'up'): TLShapeId;
|
|
1588
|
+
selectParentShape(): void;
|
|
1589
|
+
selectFirstChildShape(): void;
|
|
1590
|
+
private _selectShapesAndZoom;
|
|
1594
1591
|
/**
|
|
1595
1592
|
* Clear the selection.
|
|
1596
1593
|
*
|
|
@@ -1844,6 +1841,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1844
1841
|
* @public
|
|
1845
1842
|
*/
|
|
1846
1843
|
getCamera(): TLCamera;
|
|
1844
|
+
private _getFollowingPresence;
|
|
1847
1845
|
private getViewportPageBoundsForFollowing;
|
|
1848
1846
|
private getCameraForFollowing;
|
|
1849
1847
|
/**
|
|
@@ -3993,8 +3991,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3993
3991
|
/** @public */
|
|
3994
3992
|
export declare const EditorContext: React_2.Context<Editor | null>;
|
|
3995
3993
|
|
|
3996
|
-
export { EffectScheduler }
|
|
3997
|
-
|
|
3998
3994
|
/** @public */
|
|
3999
3995
|
export declare class Ellipse2d extends Geometry2d {
|
|
4000
3996
|
config: Omit<Geometry2dOptions, 'isClosed'> & {
|
|
@@ -4010,15 +4006,13 @@ export declare class Ellipse2d extends Geometry2d {
|
|
|
4010
4006
|
_edges?: Edge2d[];
|
|
4011
4007
|
get edges(): Edge2d[];
|
|
4012
4008
|
getVertices(): any[];
|
|
4013
|
-
nearestPoint(A:
|
|
4014
|
-
hitTestLineSegment(A:
|
|
4009
|
+
nearestPoint(A: VecLike): Vec;
|
|
4010
|
+
hitTestLineSegment(A: VecLike, B: VecLike): boolean;
|
|
4015
4011
|
getBounds(): Box;
|
|
4016
4012
|
getLength(): number;
|
|
4017
4013
|
getSvgPathData(first?: boolean): string;
|
|
4018
4014
|
}
|
|
4019
4015
|
|
|
4020
|
-
export { EMPTY_ARRAY }
|
|
4021
|
-
|
|
4022
4016
|
/** @public */
|
|
4023
4017
|
export declare class ErrorBoundary extends React_3.Component<React_3.PropsWithRef<React_3.PropsWithChildren<TLErrorBoundaryProps>>, {
|
|
4024
4018
|
error: Error | null;
|
|
@@ -4086,18 +4080,27 @@ export declare abstract class Geometry2d {
|
|
|
4086
4080
|
constructor(opts: Geometry2dOptions);
|
|
4087
4081
|
isExcludedByFilter(filters?: Geometry2dFilters): boolean;
|
|
4088
4082
|
abstract getVertices(filters: Geometry2dFilters): Vec[];
|
|
4089
|
-
abstract nearestPoint(point:
|
|
4090
|
-
hitTestPoint(point:
|
|
4091
|
-
distanceToPoint(point:
|
|
4092
|
-
distanceToLineSegment(A:
|
|
4093
|
-
hitTestLineSegment(A:
|
|
4083
|
+
abstract nearestPoint(point: VecLike, _filters?: Geometry2dFilters): Vec;
|
|
4084
|
+
hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, _filters?: Geometry2dFilters): boolean;
|
|
4085
|
+
distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
|
|
4086
|
+
distanceToLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): number;
|
|
4087
|
+
hitTestLineSegment(A: VecLike, B: VecLike, distance?: number, filters?: Geometry2dFilters): boolean;
|
|
4094
4088
|
intersectLineSegment(A: VecLike, B: VecLike, _filters?: Geometry2dFilters): VecLike[];
|
|
4095
4089
|
intersectCircle(center: VecLike, radius: number, _filters?: Geometry2dFilters): VecLike[];
|
|
4096
4090
|
intersectPolygon(polygon: VecLike[], _filters?: Geometry2dFilters): VecLike[];
|
|
4097
4091
|
intersectPolyline(polyline: VecLike[], _filters?: Geometry2dFilters): VecLike[];
|
|
4092
|
+
/**
|
|
4093
|
+
* Find a point along the edge of the geometry that is a fraction `t` along the entire way round.
|
|
4094
|
+
*/
|
|
4095
|
+
interpolateAlongEdge(t: number, _filters?: Geometry2dFilters): Vec;
|
|
4096
|
+
/**
|
|
4097
|
+
* Take `point`, find the closest point to it on the edge of the geometry, and return how far
|
|
4098
|
+
* along the edge it is as a fraction of the total length.
|
|
4099
|
+
*/
|
|
4100
|
+
uninterpolateAlongEdge(point: VecLike, _filters?: Geometry2dFilters): number;
|
|
4098
4101
|
/** @deprecated Iterate the vertices instead. */
|
|
4099
|
-
nearestPointOnLineSegment(A:
|
|
4100
|
-
isPointInBounds(point:
|
|
4102
|
+
nearestPointOnLineSegment(A: VecLike, B: VecLike): Vec;
|
|
4103
|
+
isPointInBounds(point: VecLike, margin?: number): boolean;
|
|
4101
4104
|
transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
|
|
4102
4105
|
private _vertices;
|
|
4103
4106
|
get vertices(): Vec[];
|
|
@@ -4111,7 +4114,7 @@ export declare abstract class Geometry2d {
|
|
|
4111
4114
|
toSimpleSvgPath(): string;
|
|
4112
4115
|
private _length?;
|
|
4113
4116
|
get length(): number;
|
|
4114
|
-
getLength(): number;
|
|
4117
|
+
getLength(_filters?: Geometry2dFilters): number;
|
|
4115
4118
|
abstract getSvgPathData(first: boolean): string;
|
|
4116
4119
|
}
|
|
4117
4120
|
|
|
@@ -4179,15 +4182,15 @@ export declare function getFreshUserPreferences(): TLUserPreferences;
|
|
|
4179
4182
|
export declare function getIncrementedName(name: string, others: string[]): string;
|
|
4180
4183
|
|
|
4181
4184
|
/** @public */
|
|
4182
|
-
export declare function getPerfectDashProps(totalLength: number, strokeWidth: number, opts?:
|
|
4183
|
-
closed
|
|
4184
|
-
end
|
|
4185
|
-
forceSolid
|
|
4186
|
-
lengthRatio
|
|
4187
|
-
snap
|
|
4188
|
-
start
|
|
4189
|
-
style
|
|
4190
|
-
}
|
|
4185
|
+
export declare function getPerfectDashProps(totalLength: number, strokeWidth: number, opts?: {
|
|
4186
|
+
closed?: boolean;
|
|
4187
|
+
end?: 'none' | 'outset' | 'skip';
|
|
4188
|
+
forceSolid?: boolean;
|
|
4189
|
+
lengthRatio?: number;
|
|
4190
|
+
snap?: number;
|
|
4191
|
+
start?: 'none' | 'outset' | 'skip';
|
|
4192
|
+
style?: TLDefaultDashStyle;
|
|
4193
|
+
}): {
|
|
4191
4194
|
strokeDasharray: string;
|
|
4192
4195
|
strokeDashoffset: string;
|
|
4193
4196
|
};
|
|
@@ -4274,18 +4277,20 @@ export declare class Group2d extends Geometry2d {
|
|
|
4274
4277
|
children: Geometry2d[];
|
|
4275
4278
|
});
|
|
4276
4279
|
getVertices(filters: Geometry2dFilters): Vec[];
|
|
4277
|
-
nearestPoint(point:
|
|
4278
|
-
distanceToPoint(point:
|
|
4279
|
-
hitTestPoint(point:
|
|
4280
|
-
hitTestLineSegment(A:
|
|
4280
|
+
nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;
|
|
4281
|
+
distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
|
|
4282
|
+
hitTestPoint(point: VecLike, margin: number, hitInside: boolean, filters?: Geometry2dFilters): boolean;
|
|
4283
|
+
hitTestLineSegment(A: VecLike, B: VecLike, zoom: number, filters?: Geometry2dFilters): boolean;
|
|
4281
4284
|
intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
|
|
4282
4285
|
intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
|
|
4283
4286
|
intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
|
|
4284
4287
|
intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
|
|
4288
|
+
interpolateAlongEdge(t: number, filters?: Geometry2dFilters): Vec;
|
|
4289
|
+
uninterpolateAlongEdge(point: VecLike, filters?: Geometry2dFilters): number;
|
|
4285
4290
|
transform(transform: Mat): Geometry2d;
|
|
4286
4291
|
getArea(): number;
|
|
4287
4292
|
toSimpleSvgPath(): string;
|
|
4288
|
-
getLength(): number;
|
|
4293
|
+
getLength(filters?: Geometry2dFilters): number;
|
|
4289
4294
|
getSvgPathData(): string;
|
|
4290
4295
|
}
|
|
4291
4296
|
|
|
@@ -4294,7 +4299,6 @@ export declare class GroupShapeUtil extends ShapeUtil<TLGroupShape> {
|
|
|
4294
4299
|
static type: "group";
|
|
4295
4300
|
static props: RecordProps<TLGroupShape>;
|
|
4296
4301
|
static migrations: TLPropsMigrations;
|
|
4297
|
-
canTabTo(): boolean;
|
|
4298
4302
|
hideSelectionBoundsFg(): boolean;
|
|
4299
4303
|
canBind(): boolean;
|
|
4300
4304
|
getDefaultProps(): TLGroupShape['props'];
|
|
@@ -4590,8 +4594,8 @@ export declare class Mat {
|
|
|
4590
4594
|
static Identity(): Mat;
|
|
4591
4595
|
static Translate(x: number, y: number): Mat;
|
|
4592
4596
|
static Rotate(r: number, cx?: number, cy?: number): Mat;
|
|
4593
|
-
static Scale(x: number, y: number):
|
|
4594
|
-
static Scale(x: number, y: number, cx: number, cy: number):
|
|
4597
|
+
static Scale(x: number, y: number): Mat;
|
|
4598
|
+
static Scale(x: number, y: number, cx: number, cy: number): Mat;
|
|
4595
4599
|
static Multiply(m1: MatModel, m2: MatModel): MatModel;
|
|
4596
4600
|
static Inverse(m: MatModel): MatModel;
|
|
4597
4601
|
static Absolute(m: MatLike): MatModel;
|
|
@@ -4686,7 +4690,7 @@ export declare class Point2d extends Geometry2d {
|
|
|
4686
4690
|
});
|
|
4687
4691
|
getVertices(): Vec[];
|
|
4688
4692
|
nearestPoint(): Vec;
|
|
4689
|
-
hitTestLineSegment(A:
|
|
4693
|
+
hitTestLineSegment(A: VecLike, B: VecLike, margin: number): boolean;
|
|
4690
4694
|
getSvgPathData(): string;
|
|
4691
4695
|
}
|
|
4692
4696
|
|
|
@@ -4731,8 +4735,8 @@ export declare class Polyline2d extends Geometry2d {
|
|
|
4731
4735
|
get segments(): Edge2d[];
|
|
4732
4736
|
getLength(): number;
|
|
4733
4737
|
getVertices(): Vec[];
|
|
4734
|
-
nearestPoint(A:
|
|
4735
|
-
hitTestLineSegment(A:
|
|
4738
|
+
nearestPoint(A: VecLike): Vec;
|
|
4739
|
+
hitTestLineSegment(A: VecLike, B: VecLike, distance?: number): boolean;
|
|
4736
4740
|
getSvgPathData(): string;
|
|
4737
4741
|
}
|
|
4738
4742
|
|
|
@@ -4773,8 +4777,6 @@ export declare function radiansToDegrees(r: number): number;
|
|
|
4773
4777
|
*/
|
|
4774
4778
|
export declare function rangeIntersection(a0: number, a1: number, b0: number, b1: number): [number, number] | null;
|
|
4775
4779
|
|
|
4776
|
-
export { react }
|
|
4777
|
-
|
|
4778
4780
|
/**
|
|
4779
4781
|
* A map of {@link @tldraw/tlschema#StyleProp | StyleProps} to their {@link SharedStyle} values. See
|
|
4780
4782
|
* {@link Editor.getSharedStyles}.
|
|
@@ -5098,7 +5100,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5098
5100
|
*
|
|
5099
5101
|
* @public
|
|
5100
5102
|
*/
|
|
5101
|
-
|
|
5103
|
+
canEditInReadonly(_shape: Shape): boolean;
|
|
5102
5104
|
/**
|
|
5103
5105
|
* Whether the shape can be cropped.
|
|
5104
5106
|
*
|
|
@@ -5418,10 +5420,20 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5418
5420
|
* A callback called when a shape's edge is double clicked.
|
|
5419
5421
|
*
|
|
5420
5422
|
* @param shape - The shape.
|
|
5423
|
+
* @param info - Info about the edge.
|
|
5424
|
+
* @returns A change to apply to the shape, or void.
|
|
5425
|
+
* @public
|
|
5426
|
+
*/
|
|
5427
|
+
onDoubleClickEdge?(shape: Shape, info: TLClickEventInfo): TLShapePartial<Shape> | void;
|
|
5428
|
+
/**
|
|
5429
|
+
* A callback called when a shape's corner is double clicked.
|
|
5430
|
+
*
|
|
5431
|
+
* @param shape - The shape.
|
|
5432
|
+
* @param info - Info about the corner.
|
|
5421
5433
|
* @returns A change to apply to the shape, or void.
|
|
5422
5434
|
* @public
|
|
5423
5435
|
*/
|
|
5424
|
-
|
|
5436
|
+
onDoubleClickCorner?(shape: Shape, info: TLClickEventInfo): TLShapePartial<Shape> | void;
|
|
5425
5437
|
/**
|
|
5426
5438
|
* A callback called when a shape is double clicked.
|
|
5427
5439
|
*
|
|
@@ -5439,7 +5451,14 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5439
5451
|
*/
|
|
5440
5452
|
onClick?(shape: Shape): TLShapePartial<Shape> | void;
|
|
5441
5453
|
/**
|
|
5442
|
-
* A callback called when a shape
|
|
5454
|
+
* A callback called when a shape starts being edited.
|
|
5455
|
+
*
|
|
5456
|
+
* @param shape - The shape.
|
|
5457
|
+
* @public
|
|
5458
|
+
*/
|
|
5459
|
+
onEditStart?(shape: Shape): void;
|
|
5460
|
+
/**
|
|
5461
|
+
* A callback called when a shape finishes being edited.
|
|
5443
5462
|
*
|
|
5444
5463
|
* @param shape - The shape.
|
|
5445
5464
|
* @public
|
|
@@ -5478,8 +5497,6 @@ export declare function shortAngleDist(a0: number, a1: number): number;
|
|
|
5478
5497
|
/** @public */
|
|
5479
5498
|
export declare const SIDES: readonly ["top", "right", "bottom", "left"];
|
|
5480
5499
|
|
|
5481
|
-
export { Signal }
|
|
5482
|
-
|
|
5483
5500
|
/** @public */
|
|
5484
5501
|
export declare const SIN: (x: number) => number;
|
|
5485
5502
|
|
|
@@ -5531,8 +5548,8 @@ export declare class Stadium2d extends Geometry2d {
|
|
|
5531
5548
|
height: number;
|
|
5532
5549
|
width: number;
|
|
5533
5550
|
});
|
|
5534
|
-
nearestPoint(A:
|
|
5535
|
-
hitTestLineSegment(A:
|
|
5551
|
+
nearestPoint(A: VecLike): Vec;
|
|
5552
|
+
hitTestLineSegment(A: VecLike, B: VecLike): boolean;
|
|
5536
5553
|
getVertices(): Vec[];
|
|
5537
5554
|
getBounds(): Box;
|
|
5538
5555
|
getLength(): number;
|
|
@@ -5736,6 +5753,7 @@ export declare class TextManager {
|
|
|
5736
5753
|
fontWeight: string;
|
|
5737
5754
|
lineHeight: number;
|
|
5738
5755
|
minWidth?: null | number;
|
|
5756
|
+
otherStyles?: Record<string, string>;
|
|
5739
5757
|
padding: string;
|
|
5740
5758
|
}): BoxModel & {
|
|
5741
5759
|
scrollWidth: number;
|
|
@@ -6293,34 +6311,39 @@ export declare interface TldrawOptions {
|
|
|
6293
6311
|
* nonce to use in the editor's styles.
|
|
6294
6312
|
*/
|
|
6295
6313
|
readonly nonce: string | undefined;
|
|
6314
|
+
/**
|
|
6315
|
+
* Branding name of the app, currently only used for adding aria-label for the application.
|
|
6316
|
+
*/
|
|
6317
|
+
readonly branding?: string;
|
|
6296
6318
|
}
|
|
6297
6319
|
|
|
6298
6320
|
/** @public */
|
|
6299
6321
|
export declare interface TLEditorComponents {
|
|
6300
6322
|
Background?: ComponentType | null;
|
|
6301
|
-
SvgDefs?: ComponentType | null;
|
|
6302
6323
|
Brush?: ComponentType<TLBrushProps> | null;
|
|
6303
|
-
ZoomBrush?: ComponentType<TLBrushProps> | null;
|
|
6304
|
-
ShapeIndicators?: ComponentType | null;
|
|
6305
|
-
ShapeIndicator?: ComponentType<TLShapeIndicatorProps> | null;
|
|
6306
|
-
Cursor?: ComponentType<TLCursorProps> | null;
|
|
6307
6324
|
Canvas?: ComponentType<TLCanvasComponentProps> | null;
|
|
6308
6325
|
CollaboratorBrush?: ComponentType<TLBrushProps> | null;
|
|
6309
6326
|
CollaboratorCursor?: ComponentType<TLCursorProps> | null;
|
|
6310
6327
|
CollaboratorHint?: ComponentType<TLCollaboratorHintProps> | null;
|
|
6328
|
+
CollaboratorScribble?: ComponentType<TLScribbleProps> | null;
|
|
6311
6329
|
CollaboratorShapeIndicator?: ComponentType<TLShapeIndicatorProps> | null;
|
|
6330
|
+
Cursor?: ComponentType<TLCursorProps> | null;
|
|
6312
6331
|
Grid?: ComponentType<TLGridProps> | null;
|
|
6313
|
-
Scribble?: ComponentType<TLScribbleProps> | null;
|
|
6314
|
-
CollaboratorScribble?: ComponentType<TLScribbleProps> | null;
|
|
6315
|
-
SnapIndicator?: ComponentType<TLSnapIndicatorProps> | null;
|
|
6316
|
-
Handles?: ComponentType<TLHandlesProps> | null;
|
|
6317
6332
|
Handle?: ComponentType<TLHandleProps> | null;
|
|
6318
|
-
|
|
6319
|
-
SelectionForeground?: ComponentType<TLSelectionForegroundProps> | null;
|
|
6320
|
-
SelectionBackground?: ComponentType<TLSelectionBackgroundProps> | null;
|
|
6321
|
-
OnTheCanvas?: ComponentType | null;
|
|
6333
|
+
Handles?: ComponentType<TLHandlesProps> | null;
|
|
6322
6334
|
InFrontOfTheCanvas?: ComponentType | null;
|
|
6323
6335
|
LoadingScreen?: ComponentType | null;
|
|
6336
|
+
OnTheCanvas?: ComponentType | null;
|
|
6337
|
+
Overlays?: ComponentType | null;
|
|
6338
|
+
Scribble?: ComponentType<TLScribbleProps> | null;
|
|
6339
|
+
SelectionBackground?: ComponentType<TLSelectionBackgroundProps> | null;
|
|
6340
|
+
SelectionForeground?: ComponentType<TLSelectionForegroundProps> | null;
|
|
6341
|
+
ShapeIndicator?: ComponentType<TLShapeIndicatorProps> | null;
|
|
6342
|
+
ShapeIndicators?: ComponentType | null;
|
|
6343
|
+
SnapIndicator?: ComponentType<TLSnapIndicatorProps> | null;
|
|
6344
|
+
Spinner?: ComponentType | null;
|
|
6345
|
+
SvgDefs?: ComponentType | null;
|
|
6346
|
+
ZoomBrush?: ComponentType<TLBrushProps> | null;
|
|
6324
6347
|
ErrorFallback?: TLErrorFallbackComponent;
|
|
6325
6348
|
ShapeErrorFallback?: TLShapeErrorFallbackComponent;
|
|
6326
6349
|
ShapeIndicatorErrorFallback?: TLShapeIndicatorErrorFallbackComponent;
|
|
@@ -6769,6 +6792,7 @@ export declare interface TLMeasureTextSpanOpts {
|
|
|
6769
6792
|
fontStyle: string;
|
|
6770
6793
|
lineHeight: number;
|
|
6771
6794
|
textAlign: TLDefaultHorizontalAlignStyle;
|
|
6795
|
+
otherStyles?: Record<string, string>;
|
|
6772
6796
|
}
|
|
6773
6797
|
|
|
6774
6798
|
/** @public */
|
|
@@ -7406,12 +7430,6 @@ export declare function toFixed(v: number): number;
|
|
|
7406
7430
|
*/
|
|
7407
7431
|
export declare function toPrecision(n: number, precision?: number): number;
|
|
7408
7432
|
|
|
7409
|
-
export { track }
|
|
7410
|
-
|
|
7411
|
-
export { transact }
|
|
7412
|
-
|
|
7413
|
-
export { transaction }
|
|
7414
|
-
|
|
7415
7433
|
/** @public */
|
|
7416
7434
|
export declare class TransformedGeometry2d extends Geometry2d {
|
|
7417
7435
|
private readonly geometry;
|
|
@@ -7420,13 +7438,13 @@ export declare class TransformedGeometry2d extends Geometry2d {
|
|
|
7420
7438
|
private readonly decomposed;
|
|
7421
7439
|
constructor(geometry: Geometry2d, matrix: MatModel, opts?: TransformedGeometry2dOptions);
|
|
7422
7440
|
getVertices(filters: Geometry2dFilters): Vec[];
|
|
7423
|
-
nearestPoint(point:
|
|
7424
|
-
hitTestPoint(point:
|
|
7425
|
-
distanceToPoint(point:
|
|
7426
|
-
distanceToLineSegment(A:
|
|
7427
|
-
hitTestLineSegment(A:
|
|
7428
|
-
intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters):
|
|
7429
|
-
intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters):
|
|
7441
|
+
nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;
|
|
7442
|
+
hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean;
|
|
7443
|
+
distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
|
|
7444
|
+
distanceToLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): number;
|
|
7445
|
+
hitTestLineSegment(A: VecLike, B: VecLike, distance?: number, filters?: Geometry2dFilters): boolean;
|
|
7446
|
+
intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): Vec[];
|
|
7447
|
+
intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): Vec[];
|
|
7430
7448
|
intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
|
|
7431
7449
|
intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
|
|
7432
7450
|
transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
|
|
@@ -7453,10 +7471,6 @@ export declare function uniq<T>(array: {
|
|
|
7453
7471
|
readonly length: number;
|
|
7454
7472
|
} | null | undefined): T[];
|
|
7455
7473
|
|
|
7456
|
-
export { useAtom }
|
|
7457
|
-
|
|
7458
|
-
export { useComputed }
|
|
7459
|
-
|
|
7460
7474
|
/** @public */
|
|
7461
7475
|
export declare function useContainer(): HTMLElement;
|
|
7462
7476
|
|
|
@@ -7526,12 +7540,9 @@ export declare function usePeerIds(): string[];
|
|
|
7526
7540
|
*/
|
|
7527
7541
|
export declare function usePresence(userId: string): null | TLInstancePresence;
|
|
7528
7542
|
|
|
7529
|
-
export { useQuickReactor }
|
|
7530
|
-
|
|
7531
7543
|
/* Excluded from this release type: USER_COLORS */
|
|
7532
7544
|
|
|
7533
7545
|
/* Excluded from this release type: useReactiveEvent */
|
|
7534
|
-
export { useReactor }
|
|
7535
7546
|
|
|
7536
7547
|
/* Excluded from this release type: useRefState */
|
|
7537
7548
|
|
|
@@ -7594,8 +7605,6 @@ export declare function useSelectionEvents(handle: TLSelectionHandle): {
|
|
|
7594
7605
|
*/
|
|
7595
7606
|
export declare function useSharedSafeId(id: string): SafeId;
|
|
7596
7607
|
|
|
7597
|
-
export { useStateTracking }
|
|
7598
|
-
|
|
7599
7608
|
/**
|
|
7600
7609
|
* Returns the current SVG export context. Returns null if the component isn't being rendered for an
|
|
7601
7610
|
* SVG export.
|
|
@@ -7629,8 +7638,6 @@ export declare function useTransform(ref: React.RefObject<HTMLElement | SVGEleme
|
|
|
7629
7638
|
*/
|
|
7630
7639
|
export declare function useUniqueSafeId(suffix?: string): SafeId;
|
|
7631
7640
|
|
|
7632
|
-
export { useValue }
|
|
7633
|
-
|
|
7634
7641
|
/** @public */
|
|
7635
7642
|
export declare function useViewportHeight(): number;
|
|
7636
7643
|
|
|
@@ -7702,6 +7709,7 @@ export declare class Vec {
|
|
|
7702
7709
|
static Per(A: VecLike): Vec;
|
|
7703
7710
|
static Abs(A: VecLike): Vec;
|
|
7704
7711
|
static Dist(A: VecLike, B: VecLike): number;
|
|
7712
|
+
static ManhattanDist(A: VecLike, B: VecLike): number;
|
|
7705
7713
|
static DistMin(A: VecLike, B: VecLike, n: number): boolean;
|
|
7706
7714
|
static Dist2(A: VecLike, B: VecLike): number;
|
|
7707
7715
|
/**
|
|
@@ -7749,7 +7757,15 @@ export declare class Vec {
|
|
|
7749
7757
|
static Cast(A: VecLike): Vec;
|
|
7750
7758
|
static Slope(A: VecLike, B: VecLike): number;
|
|
7751
7759
|
static IsNaN(A: VecLike): boolean;
|
|
7760
|
+
/**
|
|
7761
|
+
* Get the angle from position A to position B.
|
|
7762
|
+
*/
|
|
7752
7763
|
static Angle(A: VecLike, B: VecLike): number;
|
|
7764
|
+
/**
|
|
7765
|
+
* Get the angle between vector A and vector B. This will return the smallest angle between the
|
|
7766
|
+
* two vectors, between -π and π. The sign indicates direction of angle.
|
|
7767
|
+
*/
|
|
7768
|
+
static AngleBetween(A: VecLike, B: VecLike): number;
|
|
7753
7769
|
/**
|
|
7754
7770
|
* Linearly interpolate between two points.
|
|
7755
7771
|
* @param A - The first point.
|
|
@@ -7793,9 +7809,9 @@ export declare class Vec {
|
|
|
7793
7809
|
/** @public */
|
|
7794
7810
|
export declare type VecLike = Vec | VecModel;
|
|
7795
7811
|
|
|
7796
|
-
export { whyAmIRunning }
|
|
7797
|
-
|
|
7798
7812
|
|
|
7813
|
+
export * from "@tldraw/state";
|
|
7814
|
+
export * from "@tldraw/state-react";
|
|
7799
7815
|
export * from "@tldraw/store";
|
|
7800
7816
|
export * from "@tldraw/tlschema";
|
|
7801
7817
|
export * from "@tldraw/utils";
|