@tldraw/editor 3.14.0-canary.d926f92ca8d6 → 3.14.0-canary.db789786fb06
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 +212 -117
- package/dist-cjs/index.js +11 -8
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/config/TLSessionStateSnapshot.js +1 -12
- package/dist-cjs/lib/config/TLSessionStateSnapshot.js.map +3 -3
- package/dist-cjs/lib/editor/Editor.js +131 -99
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/bindings/BindingUtil.js.map +2 -2
- package/dist-cjs/lib/editor/derivations/bindingsIndex.js +22 -22
- package/dist-cjs/lib/editor/derivations/bindingsIndex.js.map +2 -2
- package/dist-cjs/lib/editor/derivations/parentsToChildren.js +16 -16
- package/dist-cjs/lib/editor/derivations/parentsToChildren.js.map +2 -2
- package/dist-cjs/lib/editor/managers/{ClickManager.js → ClickManager/ClickManager.js} +1 -1
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/{EdgeScrollManager.js → EdgeScrollManager/EdgeScrollManager.js} +2 -2
- package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/{FontManager.js → FontManager/FontManager.js} +4 -1
- package/dist-cjs/lib/editor/managers/FontManager/FontManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/{HistoryManager.js → HistoryManager/HistoryManager.js} +67 -7
- package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/{ScribbleManager.js → ScribbleManager/ScribbleManager.js} +1 -1
- package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/{TextManager.js → TextManager/TextManager.js} +73 -42
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/{TickManager.js → TickManager/TickManager.js} +1 -1
- package/dist-cjs/lib/editor/managers/TickManager/TickManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/{UserPreferencesManager.js → UserPreferencesManager/UserPreferencesManager.js} +1 -1
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +7 -0
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js +0 -10
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js +1 -1
- package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +1 -1
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +10 -6
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +3 -3
- package/dist-cjs/lib/editor/tools/StateNode.js +3 -3
- package/dist-cjs/lib/editor/tools/StateNode.js.map +2 -2
- package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
- package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
- package/dist-cjs/lib/exports/getSvgJsx.js.map +1 -1
- package/dist-cjs/lib/hooks/useCanvasEvents.js +1 -2
- package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
- package/dist-cjs/lib/primitives/Box.js +33 -33
- package/dist-cjs/lib/primitives/Box.js.map +2 -2
- package/dist-cjs/lib/primitives/Vec.js +13 -8
- package/dist-cjs/lib/primitives/Vec.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Arc2d.js +41 -21
- package/dist-cjs/lib/primitives/geometry/Arc2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Circle2d.js +11 -11
- package/dist-cjs/lib/primitives/geometry/Circle2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js +13 -16
- package/dist-cjs/lib/primitives/geometry/CubicBezier2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js +4 -4
- package/dist-cjs/lib/primitives/geometry/CubicSpline2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Edge2d.js +14 -17
- package/dist-cjs/lib/primitives/geometry/Edge2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Ellipse2d.js +10 -10
- package/dist-cjs/lib/primitives/geometry/Ellipse2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js +6 -2
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Point2d.js +6 -6
- package/dist-cjs/lib/primitives/geometry/Point2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Polygon2d.js +3 -0
- package/dist-cjs/lib/primitives/geometry/Polygon2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Polyline2d.js +8 -5
- package/dist-cjs/lib/primitives/geometry/Polyline2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Rectangle2d.js +22 -11
- package/dist-cjs/lib/primitives/geometry/Rectangle2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Stadium2d.js +22 -22
- package/dist-cjs/lib/primitives/geometry/Stadium2d.js.map +2 -2
- package/dist-cjs/lib/utils/reorderShapes.js +11 -10
- package/dist-cjs/lib/utils/reorderShapes.js.map +2 -2
- package/dist-cjs/lib/utils/reparenting.js +232 -0
- package/dist-cjs/lib/utils/reparenting.js.map +7 -0
- package/dist-cjs/lib/utils/richText.js +7 -2
- package/dist-cjs/lib/utils/richText.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 +212 -117
- package/dist-esm/index.mjs +15 -8
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/config/TLSessionStateSnapshot.mjs +1 -1
- package/dist-esm/lib/config/TLSessionStateSnapshot.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +131 -99
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/bindings/BindingUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/derivations/bindingsIndex.mjs +22 -22
- package/dist-esm/lib/editor/derivations/bindingsIndex.mjs.map +2 -2
- package/dist-esm/lib/editor/derivations/parentsToChildren.mjs +16 -16
- package/dist-esm/lib/editor/derivations/parentsToChildren.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/{ClickManager.mjs → ClickManager/ClickManager.mjs} +1 -1
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/{EdgeScrollManager.mjs → EdgeScrollManager/EdgeScrollManager.mjs} +2 -2
- package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/{FontManager.mjs → FontManager/FontManager.mjs} +4 -1
- package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/{HistoryManager.mjs → HistoryManager/HistoryManager.mjs} +63 -3
- package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/{ScribbleManager.mjs → ScribbleManager/ScribbleManager.mjs} +1 -1
- package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/{TextManager.mjs → TextManager/TextManager.mjs} +73 -42
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/{TickManager.mjs → TickManager/TickManager.mjs} +1 -1
- package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/{UserPreferencesManager.mjs → UserPreferencesManager/UserPreferencesManager.mjs} +1 -1
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +7 -0
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +0 -10
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs +1 -1
- package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +1 -1
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +10 -6
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +3 -3
- package/dist-esm/lib/editor/tools/StateNode.mjs +3 -3
- package/dist-esm/lib/editor/tools/StateNode.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +1 -1
- package/dist-esm/lib/hooks/useCanvasEvents.mjs +1 -2
- package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
- package/dist-esm/lib/primitives/Box.mjs +33 -33
- package/dist-esm/lib/primitives/Box.mjs.map +2 -2
- package/dist-esm/lib/primitives/Vec.mjs +13 -8
- package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Arc2d.mjs +41 -21
- package/dist-esm/lib/primitives/geometry/Arc2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Circle2d.mjs +11 -11
- package/dist-esm/lib/primitives/geometry/Circle2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs +13 -16
- package/dist-esm/lib/primitives/geometry/CubicBezier2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs +4 -4
- package/dist-esm/lib/primitives/geometry/CubicSpline2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Edge2d.mjs +14 -17
- package/dist-esm/lib/primitives/geometry/Edge2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs +11 -11
- package/dist-esm/lib/primitives/geometry/Ellipse2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +6 -2
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Point2d.mjs +6 -6
- package/dist-esm/lib/primitives/geometry/Point2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Polygon2d.mjs +3 -0
- package/dist-esm/lib/primitives/geometry/Polygon2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Polyline2d.mjs +8 -5
- package/dist-esm/lib/primitives/geometry/Polyline2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Rectangle2d.mjs +22 -11
- package/dist-esm/lib/primitives/geometry/Rectangle2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Stadium2d.mjs +22 -22
- package/dist-esm/lib/primitives/geometry/Stadium2d.mjs.map +2 -2
- package/dist-esm/lib/utils/reorderShapes.mjs +11 -10
- package/dist-esm/lib/utils/reorderShapes.mjs.map +2 -2
- package/dist-esm/lib/utils/reparenting.mjs +216 -0
- package/dist-esm/lib/utils/reparenting.mjs.map +7 -0
- package/dist-esm/lib/utils/richText.mjs +8 -3
- package/dist-esm/lib/utils/richText.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +442 -492
- package/package.json +8 -9
- package/src/index.ts +20 -7
- package/src/lib/config/TLSessionStateSnapshot.ts +1 -1
- package/src/lib/editor/Editor.test.ts +252 -3
- package/src/lib/editor/Editor.ts +149 -107
- package/src/lib/editor/bindings/BindingUtil.ts +6 -0
- package/src/lib/editor/derivations/bindingsIndex.ts +27 -26
- package/src/lib/editor/derivations/parentsToChildren.ts +28 -25
- package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +442 -0
- package/src/lib/editor/managers/{ClickManager.ts → ClickManager/ClickManager.ts} +3 -3
- package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +374 -0
- package/src/lib/editor/managers/{EdgeScrollManager.ts → EdgeScrollManager/EdgeScrollManager.ts} +3 -3
- package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +455 -0
- package/src/lib/editor/managers/{FocusManager.ts → FocusManager/FocusManager.ts} +1 -1
- package/src/lib/editor/managers/FontManager/FontManager.test.ts +263 -0
- package/src/lib/editor/managers/{FontManager.ts → FontManager/FontManager.ts} +5 -2
- package/src/lib/editor/managers/{HistoryManager.test.ts → HistoryManager/HistoryManager.test.ts} +388 -1
- package/src/lib/editor/managers/{HistoryManager.ts → HistoryManager/HistoryManager.ts} +76 -3
- package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +624 -0
- package/src/lib/editor/managers/{ScribbleManager.ts → ScribbleManager/ScribbleManager.ts} +2 -2
- package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +485 -0
- package/src/lib/editor/managers/TextManager/TextManager.test.ts +407 -0
- package/src/lib/editor/managers/{TextManager.ts → TextManager/TextManager.ts} +119 -87
- package/src/lib/editor/managers/TickManager/TickManager.test.ts +314 -0
- package/src/lib/editor/managers/{TickManager.ts → TickManager/TickManager.ts} +2 -2
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +591 -0
- package/src/lib/editor/managers/{UserPreferencesManager.ts → UserPreferencesManager/UserPreferencesManager.ts} +2 -2
- package/src/lib/editor/shapes/ShapeUtil.ts +48 -16
- package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +1 -1
- package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +22 -17
- package/src/lib/editor/tools/StateNode.ts +3 -3
- package/src/lib/editor/types/emit-types.ts +4 -0
- package/src/lib/editor/types/external-content.ts +11 -2
- package/src/lib/exports/getSvgJsx.tsx +1 -1
- package/src/lib/hooks/useCanvasEvents.ts +0 -1
- package/src/lib/primitives/Box.test.ts +588 -7
- package/src/lib/primitives/Box.ts +33 -33
- package/src/lib/primitives/Vec.test.ts +2 -2
- package/src/lib/primitives/Vec.ts +13 -8
- package/src/lib/primitives/geometry/Arc2d.ts +42 -23
- package/src/lib/primitives/geometry/Circle2d.ts +12 -12
- package/src/lib/primitives/geometry/CubicBezier2d.test.ts +5 -0
- package/src/lib/primitives/geometry/CubicBezier2d.ts +13 -17
- package/src/lib/primitives/geometry/CubicSpline2d.ts +5 -5
- package/src/lib/primitives/geometry/Edge2d.ts +14 -18
- package/src/lib/primitives/geometry/Ellipse2d.ts +12 -13
- package/src/lib/primitives/geometry/Geometry2d.ts +7 -2
- package/src/lib/primitives/geometry/Point2d.ts +6 -6
- package/src/lib/primitives/geometry/Polygon2d.ts +4 -0
- package/src/lib/primitives/geometry/Polyline2d.ts +10 -7
- package/src/lib/primitives/geometry/Rectangle2d.ts +24 -11
- package/src/lib/primitives/geometry/Stadium2d.ts +22 -23
- package/src/lib/utils/reorderShapes.ts +10 -13
- package/src/lib/utils/reparenting.ts +383 -0
- package/src/lib/utils/richText.ts +10 -4
- package/src/version.ts +3 -3
- package/dist-cjs/lib/editor/managers/ClickManager.js.map +0 -7
- package/dist-cjs/lib/editor/managers/EdgeScrollManager.js.map +0 -7
- package/dist-cjs/lib/editor/managers/FocusManager.js.map +0 -7
- package/dist-cjs/lib/editor/managers/FontManager.js.map +0 -7
- package/dist-cjs/lib/editor/managers/HistoryManager.js.map +0 -7
- package/dist-cjs/lib/editor/managers/ScribbleManager.js.map +0 -7
- package/dist-cjs/lib/editor/managers/Stack.js +0 -82
- package/dist-cjs/lib/editor/managers/Stack.js.map +0 -7
- package/dist-cjs/lib/editor/managers/TextManager.js.map +0 -7
- package/dist-cjs/lib/editor/managers/TickManager.js.map +0 -7
- package/dist-cjs/lib/editor/managers/UserPreferencesManager.js.map +0 -7
- package/dist-esm/lib/editor/managers/ClickManager.mjs.map +0 -7
- package/dist-esm/lib/editor/managers/EdgeScrollManager.mjs.map +0 -7
- package/dist-esm/lib/editor/managers/FocusManager.mjs.map +0 -7
- package/dist-esm/lib/editor/managers/FontManager.mjs.map +0 -7
- package/dist-esm/lib/editor/managers/HistoryManager.mjs.map +0 -7
- package/dist-esm/lib/editor/managers/ScribbleManager.mjs.map +0 -7
- package/dist-esm/lib/editor/managers/Stack.mjs +0 -62
- package/dist-esm/lib/editor/managers/Stack.mjs.map +0 -7
- package/dist-esm/lib/editor/managers/TextManager.mjs.map +0 -7
- package/dist-esm/lib/editor/managers/TickManager.mjs.map +0 -7
- package/dist-esm/lib/editor/managers/UserPreferencesManager.mjs.map +0 -7
- package/src/lib/editor/managers/ScribbleManager.test.ts +0 -32
- package/src/lib/editor/managers/Stack.ts +0 -71
- /package/dist-cjs/lib/editor/managers/{FocusManager.js → FocusManager/FocusManager.js} +0 -0
- /package/dist-esm/lib/editor/managers/{FocusManager.mjs → FocusManager/FocusManager.mjs} +0 -0
package/dist-esm/index.d.mts
CHANGED
|
@@ -105,15 +105,15 @@ export declare function approximately(a: number, b: number, precision?: number):
|
|
|
105
105
|
|
|
106
106
|
/** @public */
|
|
107
107
|
export declare class Arc2d extends Geometry2d {
|
|
108
|
-
_center
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
private _center;
|
|
109
|
+
private _radius;
|
|
110
|
+
private _start;
|
|
111
|
+
private _end;
|
|
112
|
+
private _largeArcFlag;
|
|
113
|
+
private _sweepFlag;
|
|
114
|
+
private _measure;
|
|
115
|
+
private _angleStart;
|
|
116
|
+
private _angleEnd;
|
|
117
117
|
constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
|
|
118
118
|
center: Vec;
|
|
119
119
|
end: Vec;
|
|
@@ -206,6 +206,12 @@ export declare interface BindingOnShapeChangeOptions<Binding extends TLUnknownBi
|
|
|
206
206
|
shapeBefore: TLShape;
|
|
207
207
|
/** The shape record after the change is made. */
|
|
208
208
|
shapeAfter: TLShape;
|
|
209
|
+
/**
|
|
210
|
+
* Why did this shape change?
|
|
211
|
+
* - 'self': the shape itself changed
|
|
212
|
+
* - 'ancestry': the ancestry of the shape changed, but the shape itself may not have done
|
|
213
|
+
*/
|
|
214
|
+
reason: 'ancestry' | 'self';
|
|
209
215
|
}
|
|
210
216
|
|
|
211
217
|
/**
|
|
@@ -551,10 +557,10 @@ export declare class Circle2d extends Geometry2d {
|
|
|
551
557
|
x?: number;
|
|
552
558
|
y?: number;
|
|
553
559
|
};
|
|
554
|
-
_center
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
560
|
+
private _center;
|
|
561
|
+
private _radius;
|
|
562
|
+
private _x;
|
|
563
|
+
private _y;
|
|
558
564
|
constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
|
|
559
565
|
isFilled: boolean;
|
|
560
566
|
radius: number;
|
|
@@ -716,10 +722,10 @@ export declare function createTLUser(opts?: {
|
|
|
716
722
|
|
|
717
723
|
/** @public */
|
|
718
724
|
export declare class CubicBezier2d extends Polyline2d {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
725
|
+
private _a;
|
|
726
|
+
private _b;
|
|
727
|
+
private _c;
|
|
728
|
+
private _d;
|
|
723
729
|
constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
|
|
724
730
|
cp1: Vec;
|
|
725
731
|
cp2: Vec;
|
|
@@ -727,20 +733,19 @@ export declare class CubicBezier2d extends Polyline2d {
|
|
|
727
733
|
start: Vec;
|
|
728
734
|
});
|
|
729
735
|
getVertices(): Vec[];
|
|
730
|
-
midPoint(): Vec;
|
|
731
736
|
nearestPoint(A: VecLike): Vec;
|
|
732
737
|
getSvgPathData(first?: boolean): string;
|
|
733
738
|
static GetAtT(segment: CubicBezier2d, t: number): Vec;
|
|
734
|
-
getLength(
|
|
739
|
+
getLength(_filters?: Geometry2dFilters, precision?: number): number;
|
|
735
740
|
}
|
|
736
741
|
|
|
737
742
|
/** @public */
|
|
738
743
|
export declare class CubicSpline2d extends Geometry2d {
|
|
739
|
-
|
|
744
|
+
private _points;
|
|
740
745
|
constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
|
|
741
746
|
points: Vec[];
|
|
742
747
|
});
|
|
743
|
-
_segments
|
|
748
|
+
private _segments?;
|
|
744
749
|
get segments(): CubicBezier2d[];
|
|
745
750
|
getLength(): number;
|
|
746
751
|
getVertices(): Vec[];
|
|
@@ -927,17 +932,16 @@ export declare const EASINGS: {
|
|
|
927
932
|
|
|
928
933
|
/** @public */
|
|
929
934
|
export declare class Edge2d extends Geometry2d {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
+
private _start;
|
|
936
|
+
private _end;
|
|
937
|
+
private _d;
|
|
938
|
+
private _u;
|
|
939
|
+
private _ul;
|
|
935
940
|
constructor(config: {
|
|
936
941
|
end: Vec;
|
|
937
942
|
start: Vec;
|
|
938
943
|
});
|
|
939
944
|
getLength(): number;
|
|
940
|
-
midPoint(): Vec;
|
|
941
945
|
getVertices(): Vec[];
|
|
942
946
|
nearestPoint(point: VecLike): Vec;
|
|
943
947
|
getSvgPathData(first?: boolean): string;
|
|
@@ -1627,6 +1631,13 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1627
1631
|
* @public
|
|
1628
1632
|
*/
|
|
1629
1633
|
getSelectionPageBounds(): Box | null;
|
|
1634
|
+
/**
|
|
1635
|
+
* The bounds of the selection bounding box in the current page space.
|
|
1636
|
+
*
|
|
1637
|
+
* @readonly
|
|
1638
|
+
* @public
|
|
1639
|
+
*/
|
|
1640
|
+
getSelectionScreenBounds(): Box | undefined;
|
|
1630
1641
|
/* Excluded from this release type: getShapesSharedRotation */
|
|
1631
1642
|
/**
|
|
1632
1643
|
* The rotation of the selection bounding box in the current page space.
|
|
@@ -2457,23 +2468,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2457
2468
|
* @public
|
|
2458
2469
|
*/
|
|
2459
2470
|
getShapeGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
|
|
2460
|
-
private _shapePageGeometryCaches;
|
|
2461
|
-
/**
|
|
2462
|
-
* Get the geometry of a shape in page-space.
|
|
2463
|
-
*
|
|
2464
|
-
* @example
|
|
2465
|
-
* ```ts
|
|
2466
|
-
* editor.getShapePageGeometry(myShape)
|
|
2467
|
-
* editor.getShapePageGeometry(myShapeId)
|
|
2468
|
-
* editor.getShapePageGeometry(myShapeId, { context: "arrow" })
|
|
2469
|
-
* ```
|
|
2470
|
-
*
|
|
2471
|
-
* @param shape - The shape (or shape id) to get the geometry for.
|
|
2472
|
-
* @param opts - Additional options about the request for geometry. Passed to {@link ShapeUtil.getGeometry}.
|
|
2473
|
-
*
|
|
2474
|
-
* @public
|
|
2475
|
-
*/
|
|
2476
|
-
getShapePageGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
|
|
2477
2471
|
/* Excluded from this release type: _getShapeHandlesCache */
|
|
2478
2472
|
/**
|
|
2479
2473
|
* Get the handles (if any) for a shape.
|
|
@@ -2651,11 +2645,16 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2651
2645
|
*
|
|
2652
2646
|
* @public
|
|
2653
2647
|
*/
|
|
2654
|
-
isShapeOrAncestorLocked(shape?: TLShape): boolean;
|
|
2655
|
-
|
|
2648
|
+
isShapeOrAncestorLocked(shape?: TLShape | TLShapeId): boolean;
|
|
2649
|
+
/**
|
|
2650
|
+
* Get shapes that are outside of the viewport.
|
|
2651
|
+
*
|
|
2652
|
+
* @public
|
|
2653
|
+
*/
|
|
2654
|
+
getNotVisibleShapes(): Set<TLShapeId>;
|
|
2656
2655
|
private _notVisibleShapes;
|
|
2657
2656
|
/**
|
|
2658
|
-
* Get culled shapes.
|
|
2657
|
+
* Get culled shapes (those that should not render), taking into account which shapes are selected or editing.
|
|
2659
2658
|
*
|
|
2660
2659
|
* @public
|
|
2661
2660
|
*/
|
|
@@ -2697,12 +2696,14 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2697
2696
|
* @example
|
|
2698
2697
|
* ```ts
|
|
2699
2698
|
* editor.getShapesAtPoint({ x: 100, y: 100 })
|
|
2700
|
-
* editor.getShapesAtPoint({ x: 100, y: 100 }, { hitInside: true,
|
|
2699
|
+
* editor.getShapesAtPoint({ x: 100, y: 100 }, { hitInside: true, margin: 8 })
|
|
2701
2700
|
* ```
|
|
2702
2701
|
*
|
|
2703
2702
|
* @param point - The page point to test.
|
|
2704
2703
|
* @param opts - The options for the hit point testing.
|
|
2705
2704
|
*
|
|
2705
|
+
* @returns An array of shapes at the given point, sorted in reverse order of their absolute z-index (top-most shape first).
|
|
2706
|
+
*
|
|
2706
2707
|
* @public
|
|
2707
2708
|
*/
|
|
2708
2709
|
getShapesAtPoint(point: VecLike, opts?: {
|
|
@@ -2910,6 +2911,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2910
2911
|
* @public
|
|
2911
2912
|
*/
|
|
2912
2913
|
getShapeAndDescendantIds(ids: TLShapeId[]): Set<TLShapeId>;
|
|
2914
|
+
/** @deprecated Use {@link Editor.getDraggingOverShape} instead */
|
|
2915
|
+
getDroppingOverShape(point: Vec, droppingShapes: TLShape[]): TLShape | undefined;
|
|
2913
2916
|
/**
|
|
2914
2917
|
* Get the shape that some shapes should be dropped on at a given point.
|
|
2915
2918
|
*
|
|
@@ -2920,7 +2923,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2920
2923
|
*
|
|
2921
2924
|
* @public
|
|
2922
2925
|
*/
|
|
2923
|
-
|
|
2926
|
+
getDraggingOverShape(point: Vec, droppingShapes: TLShape[]): TLShape | undefined;
|
|
2924
2927
|
/**
|
|
2925
2928
|
* Get the shape that should be selected when you click on a given shape, assuming there is
|
|
2926
2929
|
* nothing already selected. It will not return anything higher than or including the current
|
|
@@ -3261,6 +3264,22 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3261
3264
|
* @public
|
|
3262
3265
|
*/
|
|
3263
3266
|
getInitialMetaForShape(_shape: TLShape): JsonObject;
|
|
3267
|
+
/**
|
|
3268
|
+
* Get whether the provided shape can be created.
|
|
3269
|
+
*
|
|
3270
|
+
* @param shape - The shape or shape IDs to check.
|
|
3271
|
+
*
|
|
3272
|
+
* @public
|
|
3273
|
+
*/
|
|
3274
|
+
canCreateShape<T extends TLUnknownShape>(shape: OptionalKeys<TLShapePartial<T>, 'id'> | T['id']): boolean;
|
|
3275
|
+
/**
|
|
3276
|
+
* Get whether the provided shapes can be created.
|
|
3277
|
+
*
|
|
3278
|
+
* @param shapes - The shapes or shape IDs to create.
|
|
3279
|
+
*
|
|
3280
|
+
* @public
|
|
3281
|
+
*/
|
|
3282
|
+
canCreateShapes<T extends TLUnknownShape>(shapes: (OptionalKeys<TLShapePartial<T>, 'id'> | T['id'])[]): boolean;
|
|
3264
3283
|
/**
|
|
3265
3284
|
* Create a single shape.
|
|
3266
3285
|
*
|
|
@@ -3607,6 +3626,12 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3607
3626
|
* @param info - Info about the external content.
|
|
3608
3627
|
*/
|
|
3609
3628
|
putExternalContent<E>(info: TLExternalContent<E>): Promise<void>;
|
|
3629
|
+
/**
|
|
3630
|
+
* Handle replacing external content.
|
|
3631
|
+
*
|
|
3632
|
+
* @param info - Info about the external content.
|
|
3633
|
+
*/
|
|
3634
|
+
replaceExternalContent<E>(info: TLExternalContent<E>): Promise<void>;
|
|
3610
3635
|
/**
|
|
3611
3636
|
* Get content that can be exported for the given shape ids.
|
|
3612
3637
|
*
|
|
@@ -3996,13 +4021,13 @@ export declare class Ellipse2d extends Geometry2d {
|
|
|
3996
4021
|
height: number;
|
|
3997
4022
|
width: number;
|
|
3998
4023
|
};
|
|
3999
|
-
|
|
4000
|
-
|
|
4024
|
+
private _w;
|
|
4025
|
+
private _h;
|
|
4026
|
+
private _edges?;
|
|
4001
4027
|
constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
|
|
4002
4028
|
height: number;
|
|
4003
4029
|
width: number;
|
|
4004
4030
|
});
|
|
4005
|
-
_edges?: Edge2d[];
|
|
4006
4031
|
get edges(): Edge2d[];
|
|
4007
4032
|
getVertices(): any[];
|
|
4008
4033
|
nearestPoint(A: VecLike): Vec;
|
|
@@ -4073,6 +4098,7 @@ export declare abstract class Geometry2d {
|
|
|
4073
4098
|
isFilled: boolean;
|
|
4074
4099
|
isClosed: boolean;
|
|
4075
4100
|
isLabel: boolean;
|
|
4101
|
+
isEmptyLabel: boolean;
|
|
4076
4102
|
isInternal: boolean;
|
|
4077
4103
|
debugColor?: string;
|
|
4078
4104
|
ignore?: boolean;
|
|
@@ -4164,6 +4190,21 @@ export declare function getCursor(cursor: TLCursorType, rotation?: number, color
|
|
|
4164
4190
|
/** @public */
|
|
4165
4191
|
export declare function getDefaultCdnBaseUrl(): string;
|
|
4166
4192
|
|
|
4193
|
+
/**
|
|
4194
|
+
* Get the shapes that will be reparented to new parents when the shapes are dropped.
|
|
4195
|
+
*
|
|
4196
|
+
* @param editor - The editor instance.
|
|
4197
|
+
* @param shapes - The shapes to check.
|
|
4198
|
+
* @param cb - A callback to filter out certain shapes.
|
|
4199
|
+
* @returns An object with the shapes that will be reparented to new parents and the shapes that will be reparented to the page or their ancestral group.
|
|
4200
|
+
*
|
|
4201
|
+
* @public
|
|
4202
|
+
*/
|
|
4203
|
+
export declare function getDroppedShapesToNewParents(editor: Editor, shapes: Set<TLShape> | TLShape[], cb?: (shape: TLShape, parent: TLShape) => boolean): {
|
|
4204
|
+
remainingShapesToReparent: Set<TLShape>;
|
|
4205
|
+
reparenting: Map<TLShapeId, TLShape[]>;
|
|
4206
|
+
};
|
|
4207
|
+
|
|
4167
4208
|
/** @public */
|
|
4168
4209
|
export declare function getFontsFromRichText(editor: Editor, richText: TLRichText, initialState: RichTextFontVisitorState): TLFontFace[];
|
|
4169
4210
|
|
|
@@ -4517,6 +4558,20 @@ export declare function intersectPolygonPolygon(polygonA: VecLike[], polygonB: V
|
|
|
4517
4558
|
*/
|
|
4518
4559
|
export declare const isSafeFloat: (n: number) => boolean;
|
|
4519
4560
|
|
|
4561
|
+
/**
|
|
4562
|
+
* Reparents shapes that are no longer contained within their parent shapes.
|
|
4563
|
+
* todo: rename me to something more descriptive, like `reparentOccludedShapes` or `reparentAutoDroppedShapes`
|
|
4564
|
+
*
|
|
4565
|
+
* @param editor - The editor instance.
|
|
4566
|
+
* @param shapeIds - The IDs of the shapes to reparent.
|
|
4567
|
+
* @param opts - Optional options, including a callback to filter out certain parents, such as when removing a frame.
|
|
4568
|
+
*
|
|
4569
|
+
* @public
|
|
4570
|
+
*/
|
|
4571
|
+
export declare function kickoutOccludedShapes(editor: Editor, shapeIds: TLShapeId[], opts?: {
|
|
4572
|
+
filter?(parent: TLShape): boolean;
|
|
4573
|
+
}): void;
|
|
4574
|
+
|
|
4520
4575
|
/* Excluded from this release type: LicenseFromKeyResult */
|
|
4521
4576
|
|
|
4522
4577
|
/* Excluded from this release type: LicenseInfo */
|
|
@@ -4687,7 +4742,7 @@ export declare const PI2: number;
|
|
|
4687
4742
|
|
|
4688
4743
|
/** @public */
|
|
4689
4744
|
export declare class Point2d extends Geometry2d {
|
|
4690
|
-
|
|
4745
|
+
private _point;
|
|
4691
4746
|
constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
|
|
4692
4747
|
margin: number;
|
|
4693
4748
|
point: Vec;
|
|
@@ -4731,12 +4786,12 @@ export declare function polygonsIntersect(a: VecLike[], b: VecLike[]): boolean;
|
|
|
4731
4786
|
|
|
4732
4787
|
/** @public */
|
|
4733
4788
|
export declare class Polyline2d extends Geometry2d {
|
|
4734
|
-
|
|
4789
|
+
private _points;
|
|
4790
|
+
private _segments?;
|
|
4735
4791
|
constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
|
|
4736
4792
|
points: Vec[];
|
|
4737
4793
|
});
|
|
4738
|
-
|
|
4739
|
-
get segments(): Edge2d[];
|
|
4794
|
+
protected get segments(): Edge2d[];
|
|
4740
4795
|
getLength(): number;
|
|
4741
4796
|
getVertices(): Vec[];
|
|
4742
4797
|
nearestPoint(A: VecLike): Vec;
|
|
@@ -4802,10 +4857,10 @@ export declare class ReadonlySharedStyleMap {
|
|
|
4802
4857
|
|
|
4803
4858
|
/** @public */
|
|
4804
4859
|
export declare class Rectangle2d extends Polygon2d {
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4860
|
+
private _x;
|
|
4861
|
+
private _y;
|
|
4862
|
+
private _w;
|
|
4863
|
+
private _h;
|
|
4809
4864
|
constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
|
|
4810
4865
|
height: number;
|
|
4811
4866
|
width: number;
|
|
@@ -4814,6 +4869,7 @@ export declare class Rectangle2d extends Polygon2d {
|
|
|
4814
4869
|
});
|
|
4815
4870
|
getBounds(): Box;
|
|
4816
4871
|
getSvgPathData(): string;
|
|
4872
|
+
private negativeZeroFix;
|
|
4817
4873
|
}
|
|
4818
4874
|
|
|
4819
4875
|
/** @public */
|
|
@@ -5195,14 +5251,6 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5195
5251
|
* @public
|
|
5196
5252
|
*/
|
|
5197
5253
|
canReceiveNewChildrenOfType(_shape: Shape, _type: TLShape['type']): boolean;
|
|
5198
|
-
/**
|
|
5199
|
-
* Get whether the shape can receive children of a given type.
|
|
5200
|
-
*
|
|
5201
|
-
* @param shape - The shape type.
|
|
5202
|
-
* @param shapes - The shapes that are being dropped.
|
|
5203
|
-
* @public
|
|
5204
|
-
*/
|
|
5205
|
-
canDropShapes(_shape: Shape, _shapes: TLShape[]): boolean;
|
|
5206
5254
|
/**
|
|
5207
5255
|
* Get the shape as an SVG object.
|
|
5208
5256
|
*
|
|
@@ -5290,7 +5338,15 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5290
5338
|
*/
|
|
5291
5339
|
onCrop?(shape: Shape, info: TLCropInfo<Shape>): Omit<TLShapePartial<Shape>, 'id' | 'type'> | undefined | void;
|
|
5292
5340
|
/**
|
|
5293
|
-
* A callback called when some other shapes are dragged
|
|
5341
|
+
* A callback called when some other shapes are dragged into this one. This fires when the shapes are dragged over the shape for the first time.
|
|
5342
|
+
*
|
|
5343
|
+
* @param shape - The shape.
|
|
5344
|
+
* @param shapes - The shapes that are being dragged in.
|
|
5345
|
+
* @public
|
|
5346
|
+
*/
|
|
5347
|
+
onDragShapesIn?(shape: Shape, shapes: TLShape[], info: TLDragShapesInInfo): void;
|
|
5348
|
+
/**
|
|
5349
|
+
* A callback called when some other shapes are dragged over this one. This fires when the shapes are dragged over the shape for the first time (after the onDragShapesIn callback), and again on every update while the shapes are being dragged.
|
|
5294
5350
|
*
|
|
5295
5351
|
* @example
|
|
5296
5352
|
*
|
|
@@ -5304,7 +5360,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5304
5360
|
* @param shapes - The shapes that are being dragged over this one.
|
|
5305
5361
|
* @public
|
|
5306
5362
|
*/
|
|
5307
|
-
onDragShapesOver?(shape: Shape, shapes: TLShape[]): void;
|
|
5363
|
+
onDragShapesOver?(shape: Shape, shapes: TLShape[], info: TLDragShapesOverInfo): void;
|
|
5308
5364
|
/**
|
|
5309
5365
|
* A callback called when some other shapes are dragged out of this one.
|
|
5310
5366
|
*
|
|
@@ -5312,7 +5368,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5312
5368
|
* @param shapes - The shapes that are being dragged out.
|
|
5313
5369
|
* @public
|
|
5314
5370
|
*/
|
|
5315
|
-
onDragShapesOut?(shape: Shape, shapes: TLShape[]): void;
|
|
5371
|
+
onDragShapesOut?(shape: Shape, shapes: TLShape[], info: TLDragShapesOutInfo): void;
|
|
5316
5372
|
/**
|
|
5317
5373
|
* A callback called when some other shapes are dropped over this one.
|
|
5318
5374
|
*
|
|
@@ -5320,7 +5376,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5320
5376
|
* @param shapes - The shapes that are being dropped over this one.
|
|
5321
5377
|
* @public
|
|
5322
5378
|
*/
|
|
5323
|
-
onDropShapesOver?(shape: Shape, shapes: TLShape[]): void;
|
|
5379
|
+
onDropShapesOver?(shape: Shape, shapes: TLShape[], info: TLDropShapesOverInfo): void;
|
|
5324
5380
|
/**
|
|
5325
5381
|
* A callback called when a shape starts being resized.
|
|
5326
5382
|
*
|
|
@@ -5548,12 +5604,12 @@ export declare class Stadium2d extends Geometry2d {
|
|
|
5548
5604
|
height: number;
|
|
5549
5605
|
width: number;
|
|
5550
5606
|
};
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5607
|
+
private _w;
|
|
5608
|
+
private _h;
|
|
5609
|
+
private _a;
|
|
5610
|
+
private _b;
|
|
5611
|
+
private _c;
|
|
5612
|
+
private _d;
|
|
5557
5613
|
constructor(config: Omit<Geometry2dOptions, 'isClosed'> & {
|
|
5558
5614
|
height: number;
|
|
5559
5615
|
width: number;
|
|
@@ -5622,7 +5678,7 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
|
|
|
5622
5678
|
transition(id: string, info?: any): this;
|
|
5623
5679
|
handleEvent(info: Exclude<TLEventInfo, TLPinchEventInfo>): void;
|
|
5624
5680
|
enter(info: any, from: string): void;
|
|
5625
|
-
exit(info: any,
|
|
5681
|
+
exit(info: any, to: string): void;
|
|
5626
5682
|
/**
|
|
5627
5683
|
* This is a hack / escape hatch that will tell the editor to
|
|
5628
5684
|
* report a different state as active (in `getCurrentToolId()`) when
|
|
@@ -5729,43 +5785,15 @@ export declare const TAB_ID: string;
|
|
|
5729
5785
|
/** @public */
|
|
5730
5786
|
export declare class TextManager {
|
|
5731
5787
|
editor: Editor;
|
|
5732
|
-
private
|
|
5788
|
+
private elm;
|
|
5789
|
+
private defaultStyles;
|
|
5733
5790
|
constructor(editor: Editor);
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
* is null, the text will be measured without wrapping, but explicit line breaks and
|
|
5738
|
-
* space are preserved.
|
|
5739
|
-
*/
|
|
5740
|
-
maxWidth: null | number;
|
|
5741
|
-
disableOverflowWrapBreaking?: boolean;
|
|
5742
|
-
fontFamily: string;
|
|
5743
|
-
fontSize: number;
|
|
5744
|
-
fontStyle: string;
|
|
5745
|
-
fontWeight: string;
|
|
5746
|
-
lineHeight: number;
|
|
5747
|
-
minWidth?: null | number;
|
|
5748
|
-
padding: string;
|
|
5749
|
-
}): BoxModel & {
|
|
5791
|
+
dispose(): void;
|
|
5792
|
+
private resetElmStyles;
|
|
5793
|
+
measureText(textToMeasure: string, opts: TLMeasureTextOpts): BoxModel & {
|
|
5750
5794
|
scrollWidth: number;
|
|
5751
5795
|
};
|
|
5752
|
-
measureHtml(html: string, opts: {
|
|
5753
|
-
/**
|
|
5754
|
-
* When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
|
|
5755
|
-
* is null, the text will be measured without wrapping, but explicit line breaks and
|
|
5756
|
-
* space are preserved.
|
|
5757
|
-
*/
|
|
5758
|
-
maxWidth: null | number;
|
|
5759
|
-
disableOverflowWrapBreaking?: boolean;
|
|
5760
|
-
fontFamily: string;
|
|
5761
|
-
fontSize: number;
|
|
5762
|
-
fontStyle: string;
|
|
5763
|
-
fontWeight: string;
|
|
5764
|
-
lineHeight: number;
|
|
5765
|
-
minWidth?: null | number;
|
|
5766
|
-
otherStyles?: Record<string, string>;
|
|
5767
|
-
padding: string;
|
|
5768
|
-
}): BoxModel & {
|
|
5796
|
+
measureHtml(html: string, opts: TLMeasureTextOpts): BoxModel & {
|
|
5769
5797
|
scrollWidth: number;
|
|
5770
5798
|
};
|
|
5771
5799
|
/**
|
|
@@ -6022,6 +6050,7 @@ export declare interface TLCropInfo<T extends TLShape> {
|
|
|
6022
6050
|
w: number;
|
|
6023
6051
|
};
|
|
6024
6052
|
initialShape: T;
|
|
6053
|
+
aspectRatioLocked?: boolean;
|
|
6025
6054
|
}
|
|
6026
6055
|
|
|
6027
6056
|
/** @public */
|
|
@@ -6080,6 +6109,29 @@ export declare interface TLDeepLinkOptions {
|
|
|
6080
6109
|
onChange?(url: URL, editor: Editor): void;
|
|
6081
6110
|
}
|
|
6082
6111
|
|
|
6112
|
+
/** @public */
|
|
6113
|
+
export declare interface TLDragShapesInInfo {
|
|
6114
|
+
initialDraggingOverShapeId: null | TLShapeId;
|
|
6115
|
+
prevDraggingOverShapeId: null | TLShapeId;
|
|
6116
|
+
initialParentIds: Map<TLShapeId, TLParentId>;
|
|
6117
|
+
initialIndices: Map<TLShapeId, IndexKey>;
|
|
6118
|
+
}
|
|
6119
|
+
|
|
6120
|
+
/** @public */
|
|
6121
|
+
export declare interface TLDragShapesOutInfo {
|
|
6122
|
+
nextDraggingOverShapeId: null | TLShapeId;
|
|
6123
|
+
initialDraggingOverShapeId: null | TLShapeId;
|
|
6124
|
+
initialParentIds: Map<TLShapeId, TLParentId>;
|
|
6125
|
+
initialIndices: Map<TLShapeId, IndexKey>;
|
|
6126
|
+
}
|
|
6127
|
+
|
|
6128
|
+
/** @public */
|
|
6129
|
+
export declare interface TLDragShapesOverInfo {
|
|
6130
|
+
initialDraggingOverShapeId: null | TLShapeId;
|
|
6131
|
+
initialParentIds: Map<TLShapeId, TLParentId>;
|
|
6132
|
+
initialIndices: Map<TLShapeId, IndexKey>;
|
|
6133
|
+
}
|
|
6134
|
+
|
|
6083
6135
|
/** @public @react */
|
|
6084
6136
|
export declare const TldrawEditor: React_2.NamedExoticComponent<TldrawEditorProps>;
|
|
6085
6137
|
|
|
@@ -6327,6 +6379,13 @@ export declare interface TldrawOptions {
|
|
|
6327
6379
|
readonly branding?: string;
|
|
6328
6380
|
}
|
|
6329
6381
|
|
|
6382
|
+
/** @public */
|
|
6383
|
+
export declare interface TLDropShapesOverInfo {
|
|
6384
|
+
initialDraggingOverShapeId: null | TLShapeId;
|
|
6385
|
+
initialParentIds: Map<TLShapeId, TLParentId>;
|
|
6386
|
+
initialIndices: Map<TLShapeId, IndexKey>;
|
|
6387
|
+
}
|
|
6388
|
+
|
|
6330
6389
|
/** @public */
|
|
6331
6390
|
export declare interface TLEditorComponents {
|
|
6332
6391
|
Background?: ComponentType | null;
|
|
@@ -6549,6 +6608,10 @@ export declare interface TLEventMap {
|
|
|
6549
6608
|
};
|
|
6550
6609
|
shapeId: TLShapeId;
|
|
6551
6610
|
}];
|
|
6611
|
+
'created-shapes': [TLRecord[]];
|
|
6612
|
+
'edited-shapes': [TLRecord[]];
|
|
6613
|
+
'deleted-shapes': [TLShapeId[]];
|
|
6614
|
+
edit: [];
|
|
6552
6615
|
}
|
|
6553
6616
|
|
|
6554
6617
|
/** @public */
|
|
@@ -6579,7 +6642,7 @@ export declare type TLExportType = 'jpeg' | 'png' | 'svg' | 'webp';
|
|
|
6579
6642
|
export declare type TLExternalAsset = TLFileExternalAsset | TLUrlExternalAsset;
|
|
6580
6643
|
|
|
6581
6644
|
/** @public */
|
|
6582
|
-
export declare type TLExternalContent<EmbedDefinition> = TLEmbedExternalContent<EmbedDefinition> | TLExcalidrawExternalContent | TLFilesExternalContent | TLSvgTextExternalContent | TLTextExternalContent | TLTldrawExternalContent | TLUrlExternalContent;
|
|
6645
|
+
export declare type TLExternalContent<EmbedDefinition> = TLEmbedExternalContent<EmbedDefinition> | TLExcalidrawExternalContent | TLFileReplaceExternalContent | TLFilesExternalContent | TLSvgTextExternalContent | TLTextExternalContent | TLTldrawExternalContent | TLUrlExternalContent;
|
|
6583
6646
|
|
|
6584
6647
|
/** @public */
|
|
6585
6648
|
export declare type TLExternalContentSource = TLErrorExternalContentSource | TLExcalidrawExternalContentSource | TLTextExternalContentSource | TLTldrawExternalContentSource;
|
|
@@ -6591,11 +6654,19 @@ export declare interface TLFileExternalAsset {
|
|
|
6591
6654
|
assetId?: TLAssetId;
|
|
6592
6655
|
}
|
|
6593
6656
|
|
|
6657
|
+
/** @public */
|
|
6658
|
+
export declare interface TLFileReplaceExternalContent extends TLBaseExternalContent {
|
|
6659
|
+
type: 'file-replace';
|
|
6660
|
+
file: File;
|
|
6661
|
+
shapeId: TLShapeId;
|
|
6662
|
+
isImage: boolean;
|
|
6663
|
+
}
|
|
6664
|
+
|
|
6594
6665
|
/** @public */
|
|
6595
6666
|
export declare interface TLFilesExternalContent extends TLBaseExternalContent {
|
|
6596
6667
|
type: 'files';
|
|
6597
6668
|
files: File[];
|
|
6598
|
-
ignoreParent
|
|
6669
|
+
ignoreParent?: boolean;
|
|
6599
6670
|
}
|
|
6600
6671
|
|
|
6601
6672
|
/**
|
|
@@ -6790,6 +6861,27 @@ export declare interface TLLoadSnapshotOptions {
|
|
|
6790
6861
|
forceOverwriteSessionState?: boolean;
|
|
6791
6862
|
}
|
|
6792
6863
|
|
|
6864
|
+
/** @public */
|
|
6865
|
+
export declare interface TLMeasureTextOpts {
|
|
6866
|
+
fontStyle: string;
|
|
6867
|
+
fontWeight: string;
|
|
6868
|
+
fontFamily: string;
|
|
6869
|
+
fontSize: number;
|
|
6870
|
+
/** This must be a number, e.g. 1.35, not a pixel value. */
|
|
6871
|
+
lineHeight: number;
|
|
6872
|
+
/**
|
|
6873
|
+
* When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
|
|
6874
|
+
* is null, the text will be measured without wrapping, but explicit line breaks and
|
|
6875
|
+
* space are preserved.
|
|
6876
|
+
*/
|
|
6877
|
+
maxWidth: null | number;
|
|
6878
|
+
minWidth?: null | number;
|
|
6879
|
+
padding: string;
|
|
6880
|
+
otherStyles?: Record<string, string>;
|
|
6881
|
+
disableOverflowWrapBreaking?: boolean;
|
|
6882
|
+
measureScrollWidth?: boolean;
|
|
6883
|
+
}
|
|
6884
|
+
|
|
6793
6885
|
/** @public */
|
|
6794
6886
|
export declare interface TLMeasureTextSpanOpts {
|
|
6795
6887
|
overflow: 'truncate-clip' | 'truncate-ellipsis' | 'wrap';
|
|
@@ -6803,6 +6895,7 @@ export declare interface TLMeasureTextSpanOpts {
|
|
|
6803
6895
|
lineHeight: number;
|
|
6804
6896
|
textAlign: TLDefaultHorizontalAlignStyle;
|
|
6805
6897
|
otherStyles?: Record<string, string>;
|
|
6898
|
+
measureScrollWidth?: boolean;
|
|
6806
6899
|
}
|
|
6807
6900
|
|
|
6808
6901
|
/** @public */
|
|
@@ -7464,6 +7557,7 @@ export declare class TransformedGeometry2d extends Geometry2d {
|
|
|
7464
7557
|
/** @public */
|
|
7465
7558
|
export declare interface TransformedGeometry2dOptions {
|
|
7466
7559
|
isLabel?: boolean;
|
|
7560
|
+
isEmptyLabel?: boolean;
|
|
7467
7561
|
isInternal?: boolean;
|
|
7468
7562
|
debugColor?: string;
|
|
7469
7563
|
ignore?: boolean;
|
|
@@ -7686,7 +7780,7 @@ export declare class Vec {
|
|
|
7686
7780
|
len(): number;
|
|
7687
7781
|
pry(V: VecLike): number;
|
|
7688
7782
|
per(): this;
|
|
7689
|
-
uni():
|
|
7783
|
+
uni(): this;
|
|
7690
7784
|
tan(V: VecLike): Vec;
|
|
7691
7785
|
dist(V: VecLike): number;
|
|
7692
7786
|
distanceToLineSegment(A: VecLike, B: VecLike): number;
|
|
@@ -7697,8 +7791,9 @@ export declare class Vec {
|
|
|
7697
7791
|
lrp(B: VecLike, t: number): Vec;
|
|
7698
7792
|
equals(B: VecLike): boolean;
|
|
7699
7793
|
equalsXY(x: number, y: number): boolean;
|
|
7794
|
+
/** @deprecated use `uni` instead */
|
|
7700
7795
|
norm(): this;
|
|
7701
|
-
toFixed():
|
|
7796
|
+
toFixed(): this;
|
|
7702
7797
|
toString(): string;
|
|
7703
7798
|
toJson(): VecModel;
|
|
7704
7799
|
toArray(): number[];
|