@tldraw/editor 4.3.0-canary.c5efe11c58e0 → 4.3.0-canary.cb6779b4f066
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/README.md +1 -1
- package/dist-cjs/index.d.ts +448 -120
- package/dist-cjs/index.js +8 -1
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/components/ErrorBoundary.js.map +1 -1
- package/dist-cjs/lib/components/GeometryDebuggingView.js +1 -17
- package/dist-cjs/lib/components/GeometryDebuggingView.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +4 -5
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/constants.js +1 -3
- package/dist-cjs/lib/constants.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +346 -280
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/derivations/notVisibleShapes.js +16 -23
- package/dist-cjs/lib/editor/derivations/notVisibleShapes.js.map +3 -3
- package/dist-cjs/lib/editor/derivations/parentsToChildren.js +12 -3
- package/dist-cjs/lib/editor/derivations/parentsToChildren.js.map +2 -2
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js +1 -1
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js +5 -6
- package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js +591 -0
- package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js +1 -1
- package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/RBushIndex.js +144 -0
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/RBushIndex.js.map +7 -0
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js +181 -0
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/TickManager/TickManager.js +1 -22
- package/dist-cjs/lib/editor/managers/TickManager/TickManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js +31 -23
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/group/DashedOutlineBox.js +1 -1
- package/dist-cjs/lib/editor/shapes/group/DashedOutlineBox.js.map +2 -2
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +3 -3
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +2 -2
- package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
- package/dist-cjs/lib/exports/parseCss.js +1 -1
- package/dist-cjs/lib/exports/parseCss.js.map +2 -2
- package/dist-cjs/lib/globals/environment.js +45 -9
- package/dist-cjs/lib/globals/environment.js.map +2 -2
- package/dist-cjs/lib/hooks/useCoarsePointer.js +14 -29
- package/dist-cjs/lib/hooks/useCoarsePointer.js.map +2 -2
- package/dist-cjs/lib/hooks/useEvent.js +1 -1
- package/dist-cjs/lib/hooks/useEvent.js.map +2 -2
- package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useGestureEvents.js +1 -1
- package/dist-cjs/lib/hooks/useGestureEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useScreenBounds.js.map +2 -2
- package/dist-cjs/lib/hooks/useStateAttribute.js +4 -1
- package/dist-cjs/lib/hooks/useStateAttribute.js.map +2 -2
- package/dist-cjs/lib/hooks/useTransform.js.map +1 -1
- package/dist-cjs/lib/hooks/useZoomCss.js +4 -8
- package/dist-cjs/lib/hooks/useZoomCss.js.map +2 -2
- package/dist-cjs/lib/options.js +6 -1
- package/dist-cjs/lib/options.js.map +2 -2
- package/dist-cjs/lib/primitives/Box.js +3 -0
- package/dist-cjs/lib/primitives/Box.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js +1 -0
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
- package/dist-cjs/lib/utils/rotation.js +1 -1
- 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 +448 -120
- package/dist-esm/index.mjs +9 -2
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/components/ErrorBoundary.mjs.map +1 -1
- package/dist-esm/lib/components/GeometryDebuggingView.mjs +1 -17
- package/dist-esm/lib/components/GeometryDebuggingView.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +4 -5
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/constants.mjs +1 -3
- package/dist-esm/lib/constants.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +347 -283
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs +16 -23
- package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs.map +3 -3
- package/dist-esm/lib/editor/derivations/parentsToChildren.mjs +13 -4
- package/dist-esm/lib/editor/derivations/parentsToChildren.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs +1 -1
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs +5 -6
- package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs +573 -0
- package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs +1 -1
- package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SpatialIndexManager/RBushIndex.mjs +114 -0
- package/dist-esm/lib/editor/managers/SpatialIndexManager/RBushIndex.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs +161 -0
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs +1 -22
- package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +31 -23
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/group/DashedOutlineBox.mjs +1 -1
- package/dist-esm/lib/editor/shapes/group/DashedOutlineBox.mjs.map +2 -2
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +3 -3
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +2 -2
- package/dist-esm/lib/exports/parseCss.mjs +1 -1
- package/dist-esm/lib/exports/parseCss.mjs.map +2 -2
- package/dist-esm/lib/globals/environment.mjs +45 -9
- package/dist-esm/lib/globals/environment.mjs.map +2 -2
- package/dist-esm/lib/hooks/useCoarsePointer.mjs +15 -30
- package/dist-esm/lib/hooks/useCoarsePointer.mjs.map +2 -2
- package/dist-esm/lib/hooks/useEvent.mjs +1 -1
- package/dist-esm/lib/hooks/useEvent.mjs.map +2 -2
- package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useGestureEvents.mjs +1 -1
- package/dist-esm/lib/hooks/useGestureEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useScreenBounds.mjs.map +2 -2
- package/dist-esm/lib/hooks/useStateAttribute.mjs +4 -1
- package/dist-esm/lib/hooks/useStateAttribute.mjs.map +2 -2
- package/dist-esm/lib/hooks/useTransform.mjs.map +1 -1
- package/dist-esm/lib/hooks/useZoomCss.mjs +4 -8
- package/dist-esm/lib/hooks/useZoomCss.mjs.map +2 -2
- package/dist-esm/lib/options.mjs +6 -1
- package/dist-esm/lib/options.mjs.map +2 -2
- package/dist-esm/lib/primitives/Box.mjs +3 -0
- package/dist-esm/lib/primitives/Box.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +1 -0
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
- package/dist-esm/lib/utils/rotation.mjs +1 -1
- 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 +14 -12
- package/package.json +21 -17
- package/src/index.ts +5 -1
- package/src/lib/components/ErrorBoundary.tsx +1 -1
- package/src/lib/components/GeometryDebuggingView.tsx +1 -19
- package/src/lib/components/default-components/DefaultCanvas.tsx +5 -8
- package/src/lib/config/TLUserPreferences.test.ts +40 -0
- package/src/lib/constants.ts +0 -2
- package/src/lib/editor/Editor.test.ts +140 -0
- package/src/lib/editor/Editor.ts +452 -326
- package/src/lib/editor/derivations/notVisibleShapes.ts +21 -33
- package/src/lib/editor/derivations/parentsToChildren.ts +18 -7
- package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +17 -31
- package/src/lib/editor/managers/ClickManager/ClickManager.ts +1 -1
- package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +129 -79
- package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.ts +10 -6
- package/src/lib/editor/managers/InputsManager/InputsManager.ts +566 -0
- package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +0 -4
- package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +12 -0
- package/src/lib/editor/managers/SnapManager/SnapManager.ts +1 -1
- package/src/lib/editor/managers/SpatialIndexManager/RBushIndex.ts +144 -0
- package/src/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.ts +215 -0
- package/src/lib/editor/managers/TickManager/TickManager.test.ts +40 -107
- package/src/lib/editor/managers/TickManager/TickManager.ts +2 -32
- package/src/lib/editor/shapes/ShapeUtil.ts +67 -24
- package/src/lib/editor/shapes/group/DashedOutlineBox.tsx +1 -1
- package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +3 -3
- package/src/lib/editor/types/emit-types.ts +3 -1
- package/src/lib/exports/parseCss.test.ts +1 -0
- package/src/lib/exports/parseCss.ts +1 -1
- package/src/lib/globals/environment.ts +65 -10
- package/src/lib/hooks/useCoarsePointer.ts +16 -59
- package/src/lib/hooks/useEvent.tsx +1 -1
- package/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +1 -1
- package/src/lib/hooks/useGestureEvents.ts +2 -2
- package/src/lib/hooks/usePassThroughMouseOverEvents.ts +1 -1
- package/src/lib/hooks/usePassThroughWheelEvents.ts +1 -1
- package/src/lib/hooks/useScreenBounds.ts +1 -1
- package/src/lib/hooks/useStateAttribute.ts +4 -1
- package/src/lib/hooks/useTransform.ts +1 -1
- package/src/lib/hooks/useZoomCss.ts +3 -8
- package/src/lib/options.ts +32 -0
- package/src/lib/primitives/Box.ts +9 -0
- package/src/lib/primitives/geometry/Geometry2d.ts +1 -0
- package/src/lib/utils/rotation.ts +1 -1
- package/src/version.ts +3 -3
package/dist-cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Atom } from '@tldraw/state';
|
|
2
|
+
import { AtomSet } from '@tldraw/store';
|
|
2
3
|
import { BoxModel } from '@tldraw/tlschema';
|
|
3
4
|
import { ComponentType } from 'react';
|
|
4
5
|
import { Computed } from '@tldraw/state';
|
|
@@ -9,10 +10,11 @@ import EventEmitter from 'eventemitter3';
|
|
|
9
10
|
import { ExoticComponent } from 'react';
|
|
10
11
|
import { ExtractShapeByProps } from '@tldraw/tlschema';
|
|
11
12
|
import { ForwardRefExoticComponent } from 'react';
|
|
13
|
+
import { FragmentProps } from 'react';
|
|
12
14
|
import { HistoryEntry } from '@tldraw/store';
|
|
13
15
|
import { IndexKey } from '@tldraw/utils';
|
|
14
16
|
import { JsonObject } from '@tldraw/utils';
|
|
15
|
-
import { JSX
|
|
17
|
+
import { JSX } from 'react/jsx-runtime';
|
|
16
18
|
import { LegacyMigrations } from '@tldraw/store';
|
|
17
19
|
import { MigrationSequence } from '@tldraw/store';
|
|
18
20
|
import { NamedExoticComponent } from 'react';
|
|
@@ -488,6 +490,7 @@ export declare class Box {
|
|
|
488
490
|
get cornersAndCenter(): Vec[];
|
|
489
491
|
get sides(): Array<[Vec, Vec]>;
|
|
490
492
|
get size(): Vec;
|
|
493
|
+
isValid(): boolean;
|
|
491
494
|
toFixed(): this;
|
|
492
495
|
setTo(B: Box): this;
|
|
493
496
|
set(x?: number, y?: number, w?: number, h?: number): this;
|
|
@@ -655,7 +658,7 @@ export declare function clockwiseAngleDist(a0: number, a1: number): number;
|
|
|
655
658
|
* @public
|
|
656
659
|
* @react
|
|
657
660
|
*/
|
|
658
|
-
export declare function ContainerProvider({ container, children }: ContainerProviderProps):
|
|
661
|
+
export declare function ContainerProvider({ container, children }: ContainerProviderProps): JSX.Element;
|
|
659
662
|
|
|
660
663
|
/** @public */
|
|
661
664
|
export declare interface ContainerProviderProps {
|
|
@@ -796,16 +799,16 @@ export declare interface DebugFlagDefaults<T> {
|
|
|
796
799
|
/* Excluded from this release type: DEFAULT_CAMERA_OPTIONS */
|
|
797
800
|
|
|
798
801
|
/** @public @react */
|
|
799
|
-
export declare function DefaultBackground():
|
|
802
|
+
export declare function DefaultBackground(): JSX.Element;
|
|
800
803
|
|
|
801
804
|
/** @public @react */
|
|
802
|
-
export declare const DefaultBrush: ({ brush, color, opacity, className }: TLBrushProps) =>
|
|
805
|
+
export declare const DefaultBrush: ({ brush, color, opacity, className }: TLBrushProps) => JSX.Element;
|
|
803
806
|
|
|
804
807
|
/** @public @react */
|
|
805
|
-
export declare function DefaultCanvas({ className }: TLCanvasComponentProps):
|
|
808
|
+
export declare function DefaultCanvas({ className }: TLCanvasComponentProps): JSX.Element;
|
|
806
809
|
|
|
807
810
|
/** @public @react */
|
|
808
|
-
export declare function DefaultCollaboratorHint({ className, zoom, point, color, viewport, opacity, }: TLCollaboratorHintProps):
|
|
811
|
+
export declare function DefaultCollaboratorHint({ className, zoom, point, color, viewport, opacity, }: TLCollaboratorHintProps): JSX.Element;
|
|
809
812
|
|
|
810
813
|
/** @public @react */
|
|
811
814
|
export declare const DefaultCursor: NamedExoticComponent<TLCursorProps>;
|
|
@@ -814,22 +817,22 @@ export declare const DefaultCursor: NamedExoticComponent<TLCursorProps>;
|
|
|
814
817
|
export declare const DefaultErrorFallback: TLErrorFallbackComponent;
|
|
815
818
|
|
|
816
819
|
/** @public @react */
|
|
817
|
-
export declare function DefaultGrid({ x, y, z, size }: TLGridProps):
|
|
820
|
+
export declare function DefaultGrid({ x, y, z, size }: TLGridProps): JSX.Element;
|
|
818
821
|
|
|
819
822
|
/** @public @react */
|
|
820
|
-
export declare function DefaultHandle({ handle, isCoarse, className, zoom }: TLHandleProps):
|
|
823
|
+
export declare function DefaultHandle({ handle, isCoarse, className, zoom }: TLHandleProps): JSX.Element;
|
|
821
824
|
|
|
822
825
|
/** @public @react */
|
|
823
|
-
export declare const DefaultHandles: ({ children }: TLHandlesProps) =>
|
|
826
|
+
export declare const DefaultHandles: ({ children }: TLHandlesProps) => JSX.Element;
|
|
824
827
|
|
|
825
828
|
/** @public @react */
|
|
826
|
-
export declare function DefaultScribble({ scribble, zoom, color, opacity, className }: TLScribbleProps):
|
|
829
|
+
export declare function DefaultScribble({ scribble, zoom, color, opacity, className }: TLScribbleProps): JSX.Element | null;
|
|
827
830
|
|
|
828
831
|
/** @public @react */
|
|
829
|
-
export declare function DefaultSelectionBackground({ bounds, rotation }: TLSelectionBackgroundProps):
|
|
832
|
+
export declare function DefaultSelectionBackground({ bounds, rotation }: TLSelectionBackgroundProps): JSX.Element;
|
|
830
833
|
|
|
831
834
|
/** @public @react */
|
|
832
|
-
export declare function DefaultSelectionForeground({ bounds, rotation }: TLSelectionForegroundProps):
|
|
835
|
+
export declare function DefaultSelectionForeground({ bounds, rotation }: TLSelectionForegroundProps): JSX.Element;
|
|
833
836
|
|
|
834
837
|
/** @public @react */
|
|
835
838
|
export declare const DefaultShapeIndicator: NamedExoticComponent<TLShapeIndicatorProps>;
|
|
@@ -841,10 +844,10 @@ export declare const DefaultShapeIndicators: NamedExoticComponent<TLShapeIndicat
|
|
|
841
844
|
export declare const DefaultShapeWrapper: ForwardRefExoticComponent<TLShapeWrapperProps & RefAttributes<HTMLDivElement>>;
|
|
842
845
|
|
|
843
846
|
/** @public @react */
|
|
844
|
-
export declare function DefaultSnapIndicator({ className, line, zoom }: TLSnapIndicatorProps):
|
|
847
|
+
export declare function DefaultSnapIndicator({ className, line, zoom }: TLSnapIndicatorProps): JSX.Element;
|
|
845
848
|
|
|
846
849
|
/** @public @react */
|
|
847
|
-
export declare function DefaultSpinner(props: React.SVGProps<SVGSVGElement>):
|
|
850
|
+
export declare function DefaultSpinner(props: React.SVGProps<SVGSVGElement>): JSX.Element;
|
|
848
851
|
|
|
849
852
|
/** @public @react */
|
|
850
853
|
export declare const DefaultSvgDefs: () => null;
|
|
@@ -863,6 +866,8 @@ export declare const defaultTldrawOptions: {
|
|
|
863
866
|
readonly collaboratorIdleTimeoutMs: 3000;
|
|
864
867
|
readonly collaboratorInactiveTimeoutMs: 60000;
|
|
865
868
|
readonly createTextOnCanvasDoubleClick: true;
|
|
869
|
+
readonly debouncedZoom: true;
|
|
870
|
+
readonly debouncedZoomThreshold: 500;
|
|
866
871
|
readonly defaultSvgPadding: 32;
|
|
867
872
|
readonly doubleClickDurationMs: 450;
|
|
868
873
|
readonly dragDistanceSquared: 16;
|
|
@@ -871,9 +876,7 @@ export declare const defaultTldrawOptions: {
|
|
|
871
876
|
readonly edgeScrollEaseDuration: 200;
|
|
872
877
|
readonly edgeScrollSpeed: 25;
|
|
873
878
|
readonly enableToolbarKeyboardShortcuts: true;
|
|
874
|
-
readonly exportProvider: ExoticComponent<
|
|
875
|
-
children?: ReactNode | undefined;
|
|
876
|
-
}>;
|
|
879
|
+
readonly exportProvider: ExoticComponent<FragmentProps>;
|
|
877
880
|
readonly flattenImageBoundsExpand: 64;
|
|
878
881
|
readonly flattenImageBoundsPadding: 16;
|
|
879
882
|
readonly followChaseViewportSnap: 2;
|
|
@@ -905,11 +908,14 @@ export declare const defaultTldrawOptions: {
|
|
|
905
908
|
readonly maxShapesPerPage: 4000;
|
|
906
909
|
readonly multiClickDurationMs: 200;
|
|
907
910
|
readonly nonce: undefined;
|
|
911
|
+
readonly snapThreshold: 8;
|
|
912
|
+
readonly spacebarPanning: true;
|
|
908
913
|
readonly temporaryAssetPreviewLifetimeMs: 180000;
|
|
909
914
|
readonly textShadowLod: 0.35;
|
|
910
915
|
readonly tooltipDelayMs: 700;
|
|
911
916
|
readonly uiCoarseDragDistanceSquared: 625;
|
|
912
917
|
readonly uiDragDistanceSquared: 16;
|
|
918
|
+
readonly zoomToFitPadding: 128;
|
|
913
919
|
};
|
|
914
920
|
|
|
915
921
|
/** @public */
|
|
@@ -983,6 +989,7 @@ export declare class EdgeScrollManager {
|
|
|
983
989
|
constructor(editor: Editor);
|
|
984
990
|
private _isEdgeScrolling;
|
|
985
991
|
private _edgeScrollDuration;
|
|
992
|
+
getIsEdgeScrolling(): boolean;
|
|
986
993
|
/**
|
|
987
994
|
* Update the camera position when the mouse is close to the edge of the screen.
|
|
988
995
|
* Run this on every tick when in a state where edge scrolling is enabled.
|
|
@@ -1041,7 +1048,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1041
1048
|
*/
|
|
1042
1049
|
removeTool(Tool: TLStateNodeConstructor, parent?: StateNode): void;
|
|
1043
1050
|
/**
|
|
1044
|
-
* A set of functions to call when the
|
|
1051
|
+
* A set of functions to call when the editor is disposed.
|
|
1045
1052
|
*
|
|
1046
1053
|
* @public
|
|
1047
1054
|
*/
|
|
@@ -1054,11 +1061,18 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1054
1061
|
isDisposed: boolean;
|
|
1055
1062
|
/* Excluded from this release type: _tickManager */
|
|
1056
1063
|
/**
|
|
1057
|
-
* A manager for the
|
|
1064
|
+
* A manager for the editor's input state.
|
|
1065
|
+
*
|
|
1066
|
+
* @public
|
|
1067
|
+
*/
|
|
1068
|
+
readonly inputs: InputsManager;
|
|
1069
|
+
/**
|
|
1070
|
+
* A manager for the editor's snapping feature.
|
|
1058
1071
|
*
|
|
1059
1072
|
* @public
|
|
1060
1073
|
*/
|
|
1061
1074
|
readonly snaps: SnapManager;
|
|
1075
|
+
private readonly _spatialIndex;
|
|
1062
1076
|
/**
|
|
1063
1077
|
* A manager for the any asynchronous events and making sure they're
|
|
1064
1078
|
* cleaned up upon disposal.
|
|
@@ -1195,7 +1209,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1195
1209
|
} | S): BindingUtil<S>;
|
|
1196
1210
|
getBindingUtil<T extends BindingUtil>(type: T extends BindingUtil<infer R> ? R['type'] : string): T;
|
|
1197
1211
|
/**
|
|
1198
|
-
* A manager for the
|
|
1212
|
+
* A manager for the editor's history.
|
|
1199
1213
|
*
|
|
1200
1214
|
* @readonly
|
|
1201
1215
|
*/
|
|
@@ -1212,10 +1226,11 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1212
1226
|
*/
|
|
1213
1227
|
undo(): this;
|
|
1214
1228
|
/**
|
|
1215
|
-
* Whether the
|
|
1229
|
+
* Whether the editor can undo.
|
|
1216
1230
|
*
|
|
1217
1231
|
* @public
|
|
1218
1232
|
*/
|
|
1233
|
+
canUndo(): boolean;
|
|
1219
1234
|
getCanUndo(): boolean;
|
|
1220
1235
|
/**
|
|
1221
1236
|
* Redo to the next mark.
|
|
@@ -1228,13 +1243,14 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1228
1243
|
* @public
|
|
1229
1244
|
*/
|
|
1230
1245
|
redo(): this;
|
|
1231
|
-
clearHistory(): this;
|
|
1232
1246
|
/**
|
|
1233
|
-
* Whether the
|
|
1247
|
+
* Whether the editor can redo.
|
|
1234
1248
|
*
|
|
1235
1249
|
* @public
|
|
1236
1250
|
*/
|
|
1251
|
+
canRedo(): boolean;
|
|
1237
1252
|
getCanRedo(): boolean;
|
|
1253
|
+
clearHistory(): this;
|
|
1238
1254
|
/**
|
|
1239
1255
|
* Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
|
|
1240
1256
|
* any redos. You typically want to do this just before a user interaction begins or is handled.
|
|
@@ -1593,7 +1609,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1593
1609
|
*/
|
|
1594
1610
|
selectNone(): this;
|
|
1595
1611
|
/**
|
|
1596
|
-
* The id of the
|
|
1612
|
+
* The id of the editor's only selected shape.
|
|
1597
1613
|
*
|
|
1598
1614
|
* @returns Null if there is no shape or more than one selected shape, otherwise the selected shape's id.
|
|
1599
1615
|
*
|
|
@@ -1602,7 +1618,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1602
1618
|
*/
|
|
1603
1619
|
getOnlySelectedShapeId(): null | TLShapeId;
|
|
1604
1620
|
/**
|
|
1605
|
-
* The
|
|
1621
|
+
* The editor's only selected shape.
|
|
1606
1622
|
*
|
|
1607
1623
|
* @returns Null if there is no shape or more than one selected shape, otherwise the selected shape.
|
|
1608
1624
|
*
|
|
@@ -1694,6 +1710,16 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1694
1710
|
* @public
|
|
1695
1711
|
*/
|
|
1696
1712
|
getEditingShape(): TLShape | undefined;
|
|
1713
|
+
/**
|
|
1714
|
+
* Whether the shape can be edited.
|
|
1715
|
+
*
|
|
1716
|
+
* @param shape - The shape (or shape id) to check if it can be edited.
|
|
1717
|
+
* @param info - The info about the edit start.
|
|
1718
|
+
*
|
|
1719
|
+
* @public
|
|
1720
|
+
* @returns true if the shape can be edited, false otherwise.
|
|
1721
|
+
*/
|
|
1722
|
+
canEditShape<T extends TLShape | TLShapeId>(shape: null | T, info?: TLEditStartInfo): shape is T;
|
|
1697
1723
|
/**
|
|
1698
1724
|
* Set the current editing shape.
|
|
1699
1725
|
*
|
|
@@ -1813,6 +1839,15 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1813
1839
|
* @public
|
|
1814
1840
|
*/
|
|
1815
1841
|
getCroppingShapeId(): null | TLShapeId;
|
|
1842
|
+
/**
|
|
1843
|
+
* Whether the shape can be cropped.
|
|
1844
|
+
*
|
|
1845
|
+
* @param shape - The shape (or shape id) to check if it can be cropped.
|
|
1846
|
+
*
|
|
1847
|
+
* @public
|
|
1848
|
+
* @returns true if the shape can be cropped, false otherwise.
|
|
1849
|
+
*/
|
|
1850
|
+
canCropShape<T extends TLShape | TLShapeId>(shape: null | T): shape is T;
|
|
1816
1851
|
/**
|
|
1817
1852
|
* Set the current cropping shape.
|
|
1818
1853
|
*
|
|
@@ -1855,6 +1890,32 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1855
1890
|
* @public
|
|
1856
1891
|
*/
|
|
1857
1892
|
getZoomLevel(): number;
|
|
1893
|
+
private _debouncedZoomLevel;
|
|
1894
|
+
/**
|
|
1895
|
+
* Get the debounced zoom level. When the camera is moving, this returns the zoom level
|
|
1896
|
+
* from when the camera started moving rather than the current zoom level. This can be
|
|
1897
|
+
* used to avoid expensive re-renders during camera movements.
|
|
1898
|
+
*
|
|
1899
|
+
* This behavior is controlled by the `useDebouncedZoom` option. When `useDebouncedZoom`
|
|
1900
|
+
* is `false`, this method always returns the current zoom level.
|
|
1901
|
+
*
|
|
1902
|
+
* @public
|
|
1903
|
+
*/
|
|
1904
|
+
getDebouncedZoomLevel(): number;
|
|
1905
|
+
private _getAboveDebouncedZoomThreshold;
|
|
1906
|
+
/**
|
|
1907
|
+
* Get the efficient zoom level. This returns the current zoom level if there are less than 300 shapes on the page,
|
|
1908
|
+
* otherwise it returns the debounced zoom level. This can be used to avoid expensive re-renders during camera movements.
|
|
1909
|
+
*
|
|
1910
|
+
* @public
|
|
1911
|
+
* @example
|
|
1912
|
+
* ```ts
|
|
1913
|
+
* editor.getEfficientZoomLevel()
|
|
1914
|
+
* ```
|
|
1915
|
+
*
|
|
1916
|
+
* @public
|
|
1917
|
+
*/
|
|
1918
|
+
getEfficientZoomLevel(): number;
|
|
1858
1919
|
/**
|
|
1859
1920
|
* Get the camera's initial or reset zoom level.
|
|
1860
1921
|
*
|
|
@@ -1969,7 +2030,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1969
2030
|
* ```ts
|
|
1970
2031
|
* editor.zoomIn()
|
|
1971
2032
|
* editor.zoomIn(editor.getViewportScreenCenter(), { animation: { duration: 200 } })
|
|
1972
|
-
* editor.zoomIn(editor.inputs.
|
|
2033
|
+
* editor.zoomIn(editor.inputs.getCurrentScreenPoint(), { animation: { duration: 200 } })
|
|
1973
2034
|
* ```
|
|
1974
2035
|
*
|
|
1975
2036
|
* @param point - The screen point to zoom in on. Defaults to the screen center
|
|
@@ -1985,7 +2046,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1985
2046
|
* ```ts
|
|
1986
2047
|
* editor.zoomOut()
|
|
1987
2048
|
* editor.zoomOut(editor.getViewportScreenCenter(), { animation: { duration: 120 } })
|
|
1988
|
-
* editor.zoomOut(editor.inputs.
|
|
2049
|
+
* editor.zoomOut(editor.inputs.getCurrentScreenPoint(), { animation: { duration: 120 } })
|
|
1989
2050
|
* ```
|
|
1990
2051
|
*
|
|
1991
2052
|
* @param point - The point to zoom out on. Defaults to the viewport screen center.
|
|
@@ -2198,8 +2259,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2198
2259
|
/* Excluded from this release type: getUnorderedRenderingShapes */
|
|
2199
2260
|
private _cameraState;
|
|
2200
2261
|
private _cameraStateTimeoutRemaining;
|
|
2201
|
-
_decayCameraStateTimeout
|
|
2202
|
-
_tickCameraState
|
|
2262
|
+
private _decayCameraStateTimeout;
|
|
2263
|
+
private _tickCameraState;
|
|
2203
2264
|
/**
|
|
2204
2265
|
* Whether the camera is moving or idle.
|
|
2205
2266
|
*
|
|
@@ -2648,6 +2709,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2648
2709
|
*/
|
|
2649
2710
|
getNotVisibleShapes(): Set<TLShapeId>;
|
|
2650
2711
|
private _notVisibleShapes;
|
|
2712
|
+
private _culledShapesCache;
|
|
2651
2713
|
/**
|
|
2652
2714
|
* Get culled shapes (those that should not render), taking into account which shapes are selected or editing.
|
|
2653
2715
|
*
|
|
@@ -2697,6 +2759,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2697
2759
|
hitInside?: boolean;
|
|
2698
2760
|
margin?: number;
|
|
2699
2761
|
}): TLShape[];
|
|
2762
|
+
/* Excluded from this release type: getShapeIdsInsideBounds */
|
|
2700
2763
|
/**
|
|
2701
2764
|
* Test whether a point (in the current page space) will will a shape. This method takes into account masks,
|
|
2702
2765
|
* such as when a shape is the child of a frame and is partially clipped by the frame.
|
|
@@ -3720,59 +3783,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3720
3783
|
url: string;
|
|
3721
3784
|
width: number;
|
|
3722
3785
|
}>;
|
|
3723
|
-
/**
|
|
3724
|
-
* The app's current input state.
|
|
3725
|
-
*
|
|
3726
|
-
* @public
|
|
3727
|
-
*/
|
|
3728
|
-
inputs: {
|
|
3729
|
-
/** A set containing the currently pressed buttons. */
|
|
3730
|
-
buttons: Set<number>;
|
|
3731
|
-
/** A set containing the currently pressed keys. */
|
|
3732
|
-
keys: Set<string>;
|
|
3733
|
-
/** The most recent pointer down's position in screen space. */
|
|
3734
|
-
originScreenPoint: Vec;
|
|
3735
|
-
/** The most recent pointer down's position in the current page space. */
|
|
3736
|
-
originPagePoint: Vec;
|
|
3737
|
-
/** The most recent pointer position in screen space. */
|
|
3738
|
-
currentScreenPoint: Vec;
|
|
3739
|
-
/** The most recent pointer position in the current page space. */
|
|
3740
|
-
currentPagePoint: Vec;
|
|
3741
|
-
/** The previous pointer position in screen space. */
|
|
3742
|
-
previousScreenPoint: Vec;
|
|
3743
|
-
/** The previous pointer position in the current page space. */
|
|
3744
|
-
previousPagePoint: Vec;
|
|
3745
|
-
/** Velocity of mouse pointer, in pixels per millisecond */
|
|
3746
|
-
pointerVelocity: Vec;
|
|
3747
|
-
/** Whether the alt or option key is currently pressed. */
|
|
3748
|
-
altKey: boolean;
|
|
3749
|
-
/** Whether the control or command key is currently pressed. */
|
|
3750
|
-
ctrlKey: boolean;
|
|
3751
|
-
/** Whether the input is from a pe. */
|
|
3752
|
-
isPen: boolean;
|
|
3753
|
-
/** Whether the meta key is currently pressed. */
|
|
3754
|
-
metaKey: boolean;
|
|
3755
|
-
/** Whether the shift key is currently pressed. */
|
|
3756
|
-
shiftKey: boolean;
|
|
3757
|
-
/** Whether the user is dragging. */
|
|
3758
|
-
isDragging: boolean;
|
|
3759
|
-
/** Whether the user is editing. */
|
|
3760
|
-
isEditing: boolean;
|
|
3761
|
-
/** Whether the user is panning. */
|
|
3762
|
-
isPanning: boolean;
|
|
3763
|
-
/** Whether the user is pinching. */
|
|
3764
|
-
isPinching: boolean;
|
|
3765
|
-
/** Whether the user is pointing. */
|
|
3766
|
-
isPointing: boolean;
|
|
3767
|
-
/** Whether the user is spacebar panning. */
|
|
3768
|
-
isSpacebarPanning: boolean;
|
|
3769
|
-
};
|
|
3770
|
-
/**
|
|
3771
|
-
* Update the input points from a pointer, pinch, or wheel event.
|
|
3772
|
-
*
|
|
3773
|
-
* @param info - The event info.
|
|
3774
|
-
*/
|
|
3775
|
-
private _updateInputsFromEvent;
|
|
3776
3786
|
/**
|
|
3777
3787
|
* Dispatch a cancel event.
|
|
3778
3788
|
*
|
|
@@ -4018,7 +4028,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
4018
4028
|
/* Excluded from this release type: _metaKeyTimeout */
|
|
4019
4029
|
/* Excluded from this release type: _setMetaKeyTimeout */
|
|
4020
4030
|
/* Excluded from this release type: _restoreToolId */
|
|
4021
|
-
/* Excluded from this release type: _pinchStart */
|
|
4022
4031
|
/* Excluded from this release type: _didPinch */
|
|
4023
4032
|
/* Excluded from this release type: _selectedShapeIdsAtPointerDown */
|
|
4024
4033
|
/* Excluded from this release type: _longPressTimeout */
|
|
@@ -4093,7 +4102,7 @@ export declare class EditorAtom<T> {
|
|
|
4093
4102
|
export declare const EditorContext: React_3.Context<Editor | null>;
|
|
4094
4103
|
|
|
4095
4104
|
/** @public @react */
|
|
4096
|
-
export declare function EditorProvider({ editor, children }: EditorProviderProps):
|
|
4105
|
+
export declare function EditorProvider({ editor, children }: EditorProviderProps): JSX.Element;
|
|
4097
4106
|
|
|
4098
4107
|
/** @public */
|
|
4099
4108
|
export declare interface EditorProviderProps {
|
|
@@ -4124,7 +4133,7 @@ export declare class Ellipse2d extends Geometry2d {
|
|
|
4124
4133
|
}
|
|
4125
4134
|
|
|
4126
4135
|
/** @public */
|
|
4127
|
-
export declare class ErrorBoundary extends React_2.Component<React_2.
|
|
4136
|
+
export declare class ErrorBoundary extends React_2.Component<React_2.PropsWithChildren<TLErrorBoundaryProps>, {
|
|
4128
4137
|
error: Error | null;
|
|
4129
4138
|
}> {
|
|
4130
4139
|
static getDerivedStateFromError(error: Error): {
|
|
@@ -4134,11 +4143,11 @@ export declare class ErrorBoundary extends React_2.Component<React_2.PropsWithRe
|
|
|
4134
4143
|
error: null;
|
|
4135
4144
|
};
|
|
4136
4145
|
componentDidCatch(error: unknown): void;
|
|
4137
|
-
render(): boolean |
|
|
4146
|
+
render(): bigint | boolean | JSX.Element | Iterable<React_2.ReactNode> | null | number | Promise<bigint | boolean | Iterable<React_2.ReactNode> | null | number | React_2.ReactElement<unknown, React_2.JSXElementConstructor<any> | string> | React_2.ReactPortal | string | undefined> | string | undefined;
|
|
4138
4147
|
}
|
|
4139
4148
|
|
|
4140
4149
|
/** @public @react */
|
|
4141
|
-
export declare function ErrorScreen({ children }: LoadingScreenProps):
|
|
4150
|
+
export declare function ErrorScreen({ children }: LoadingScreenProps): JSX.Element;
|
|
4142
4151
|
|
|
4143
4152
|
/** @public */
|
|
4144
4153
|
export declare const EVENT_NAME_MAP: Record<Exclude<TLEventName, TLPinchEventName>, keyof TLEventHandlers>;
|
|
@@ -4438,8 +4447,8 @@ export declare class GroupShapeUtil extends ShapeUtil<TLGroupShape> {
|
|
|
4438
4447
|
canResizeChildren(): boolean;
|
|
4439
4448
|
getDefaultProps(): TLGroupShape['props'];
|
|
4440
4449
|
getGeometry(shape: TLGroupShape): Geometry2d;
|
|
4441
|
-
component(shape: TLGroupShape):
|
|
4442
|
-
indicator(shape: TLGroupShape):
|
|
4450
|
+
component(shape: TLGroupShape): JSX.Element | null;
|
|
4451
|
+
indicator(shape: TLGroupShape): JSX.Element;
|
|
4443
4452
|
onChildrenChange(group: TLGroupShape): void;
|
|
4444
4453
|
}
|
|
4445
4454
|
|
|
@@ -4543,7 +4552,7 @@ export declare class HistoryManager<R extends UnknownRecord> {
|
|
|
4543
4552
|
}
|
|
4544
4553
|
|
|
4545
4554
|
/** @public @react */
|
|
4546
|
-
export declare function HTMLContainer({ children, className, ...rest }: HTMLContainerProps):
|
|
4555
|
+
export declare function HTMLContainer({ children, className, ...rest }: HTMLContainerProps): JSX.Element;
|
|
4547
4556
|
|
|
4548
4557
|
/** @public */
|
|
4549
4558
|
export declare type HTMLContainerProps = React_2.HTMLAttributes<HTMLDivElement>;
|
|
@@ -4551,6 +4560,248 @@ export declare type HTMLContainerProps = React_2.HTMLAttributes<HTMLDivElement>;
|
|
|
4551
4560
|
/** @public */
|
|
4552
4561
|
export declare const inlineBase64AssetStore: TLAssetStore;
|
|
4553
4562
|
|
|
4563
|
+
/** @public */
|
|
4564
|
+
export declare class InputsManager {
|
|
4565
|
+
private readonly editor;
|
|
4566
|
+
constructor(editor: Editor);
|
|
4567
|
+
private _originPagePoint;
|
|
4568
|
+
/**
|
|
4569
|
+
* The most recent pointer down's position in the current page space.
|
|
4570
|
+
*/
|
|
4571
|
+
getOriginPagePoint(): Vec;
|
|
4572
|
+
/**
|
|
4573
|
+
* @deprecated Use `getOriginPagePoint()` instead.
|
|
4574
|
+
*/
|
|
4575
|
+
get originPagePoint(): Vec;
|
|
4576
|
+
private _originScreenPoint;
|
|
4577
|
+
/**
|
|
4578
|
+
* The most recent pointer down's position in screen space.
|
|
4579
|
+
*/
|
|
4580
|
+
getOriginScreenPoint(): Vec;
|
|
4581
|
+
/**
|
|
4582
|
+
* @deprecated Use `getOriginScreenPoint()` instead.
|
|
4583
|
+
*/
|
|
4584
|
+
get originScreenPoint(): Vec;
|
|
4585
|
+
private _previousPagePoint;
|
|
4586
|
+
/**
|
|
4587
|
+
* The previous pointer position in the current page space.
|
|
4588
|
+
*/
|
|
4589
|
+
getPreviousPagePoint(): Vec;
|
|
4590
|
+
/**
|
|
4591
|
+
* @deprecated Use `getPreviousPagePoint()` instead.
|
|
4592
|
+
*/
|
|
4593
|
+
get previousPagePoint(): Vec;
|
|
4594
|
+
private _previousScreenPoint;
|
|
4595
|
+
/**
|
|
4596
|
+
* The previous pointer position in screen space.
|
|
4597
|
+
*/
|
|
4598
|
+
getPreviousScreenPoint(): Vec;
|
|
4599
|
+
/**
|
|
4600
|
+
* @deprecated Use `getPreviousScreenPoint()` instead.
|
|
4601
|
+
*/
|
|
4602
|
+
get previousScreenPoint(): Vec;
|
|
4603
|
+
private _currentPagePoint;
|
|
4604
|
+
/**
|
|
4605
|
+
* The most recent pointer position in the current page space.
|
|
4606
|
+
*/
|
|
4607
|
+
getCurrentPagePoint(): Vec;
|
|
4608
|
+
/**
|
|
4609
|
+
* @deprecated Use `getCurrentPagePoint()` instead.
|
|
4610
|
+
*/
|
|
4611
|
+
get currentPagePoint(): Vec;
|
|
4612
|
+
private _currentScreenPoint;
|
|
4613
|
+
/**
|
|
4614
|
+
* The most recent pointer position in screen space.
|
|
4615
|
+
*/
|
|
4616
|
+
getCurrentScreenPoint(): Vec;
|
|
4617
|
+
/**
|
|
4618
|
+
* @deprecated Use `getCurrentScreenPoint()` instead.
|
|
4619
|
+
*/
|
|
4620
|
+
get currentScreenPoint(): Vec;
|
|
4621
|
+
private _pointerVelocity;
|
|
4622
|
+
/**
|
|
4623
|
+
* Velocity of mouse pointer, in pixels per millisecond.
|
|
4624
|
+
*/
|
|
4625
|
+
getPointerVelocity(): Vec;
|
|
4626
|
+
/**
|
|
4627
|
+
* @deprecated Use `getPointerVelocity()` instead.
|
|
4628
|
+
*/
|
|
4629
|
+
get pointerVelocity(): Vec;
|
|
4630
|
+
/* Excluded from this release type: setPointerVelocity */
|
|
4631
|
+
/**
|
|
4632
|
+
* A set containing the currently pressed keys.
|
|
4633
|
+
*/
|
|
4634
|
+
readonly keys: AtomSet<string>;
|
|
4635
|
+
/**
|
|
4636
|
+
* A set containing the currently pressed buttons.
|
|
4637
|
+
*/
|
|
4638
|
+
readonly buttons: AtomSet<number>;
|
|
4639
|
+
private _isPen;
|
|
4640
|
+
/**
|
|
4641
|
+
* Whether the input is from a pen.
|
|
4642
|
+
*/
|
|
4643
|
+
getIsPen(): boolean;
|
|
4644
|
+
/**
|
|
4645
|
+
* @deprecated Use `getIsPen()` instead.
|
|
4646
|
+
*/
|
|
4647
|
+
get isPen(): boolean;
|
|
4648
|
+
set isPen(isPen: boolean);
|
|
4649
|
+
/**
|
|
4650
|
+
* @param isPen - Whether the input is from a pen.
|
|
4651
|
+
*/
|
|
4652
|
+
setIsPen(isPen: boolean): void;
|
|
4653
|
+
private _shiftKey;
|
|
4654
|
+
/**
|
|
4655
|
+
* Whether the shift key is currently pressed.
|
|
4656
|
+
*/
|
|
4657
|
+
getShiftKey(): boolean;
|
|
4658
|
+
/**
|
|
4659
|
+
* @deprecated Use `getShiftKey()` instead.
|
|
4660
|
+
*/
|
|
4661
|
+
get shiftKey(): boolean;
|
|
4662
|
+
set shiftKey(shiftKey: boolean);
|
|
4663
|
+
/* Excluded from this release type: setShiftKey */
|
|
4664
|
+
private _metaKey;
|
|
4665
|
+
/**
|
|
4666
|
+
* Whether the meta key is currently pressed.
|
|
4667
|
+
*/
|
|
4668
|
+
getMetaKey(): boolean;
|
|
4669
|
+
/**
|
|
4670
|
+
* @deprecated Use `getMetaKey()` instead.
|
|
4671
|
+
*/
|
|
4672
|
+
get metaKey(): boolean;
|
|
4673
|
+
set metaKey(metaKey: boolean);
|
|
4674
|
+
/* Excluded from this release type: setMetaKey */
|
|
4675
|
+
private _ctrlKey;
|
|
4676
|
+
/**
|
|
4677
|
+
* Whether the ctrl or command key is currently pressed.
|
|
4678
|
+
*/
|
|
4679
|
+
getCtrlKey(): boolean;
|
|
4680
|
+
/**
|
|
4681
|
+
* @deprecated Use `getCtrlKey()` instead.
|
|
4682
|
+
*/
|
|
4683
|
+
get ctrlKey(): boolean;
|
|
4684
|
+
set ctrlKey(ctrlKey: boolean);
|
|
4685
|
+
/* Excluded from this release type: setCtrlKey */
|
|
4686
|
+
private _altKey;
|
|
4687
|
+
/**
|
|
4688
|
+
* Whether the alt or option key is currently pressed.
|
|
4689
|
+
*/
|
|
4690
|
+
getAltKey(): boolean;
|
|
4691
|
+
/**
|
|
4692
|
+
* @deprecated Use `getAltKey()` instead.
|
|
4693
|
+
*/
|
|
4694
|
+
get altKey(): boolean;
|
|
4695
|
+
set altKey(altKey: boolean);
|
|
4696
|
+
/* Excluded from this release type: setAltKey */
|
|
4697
|
+
/**
|
|
4698
|
+
* Is the accelerator key (cmd on mac, ctrl elsewhere) currently pressed.
|
|
4699
|
+
*/
|
|
4700
|
+
getAccelKey(): boolean;
|
|
4701
|
+
/**
|
|
4702
|
+
* @deprecated Use `getAccelKey()` instead.
|
|
4703
|
+
*/
|
|
4704
|
+
get accelKey(): boolean;
|
|
4705
|
+
private _isDragging;
|
|
4706
|
+
/**
|
|
4707
|
+
* Whether the user is dragging.
|
|
4708
|
+
*/
|
|
4709
|
+
getIsDragging(): boolean;
|
|
4710
|
+
/**
|
|
4711
|
+
* Soon to be deprecated, use `getIsDragging()` instead.
|
|
4712
|
+
*/
|
|
4713
|
+
get isDragging(): boolean;
|
|
4714
|
+
set isDragging(isDragging: boolean);
|
|
4715
|
+
/**
|
|
4716
|
+
* @param isDragging - Whether the user is dragging.
|
|
4717
|
+
*/
|
|
4718
|
+
setIsDragging(isDragging: boolean): void;
|
|
4719
|
+
private _isPointing;
|
|
4720
|
+
/**
|
|
4721
|
+
* Whether the user is pointing.
|
|
4722
|
+
*/
|
|
4723
|
+
getIsPointing(): boolean;
|
|
4724
|
+
/**
|
|
4725
|
+
* @deprecated Use `getIsPointing()` instead.
|
|
4726
|
+
*/
|
|
4727
|
+
get isPointing(): boolean;
|
|
4728
|
+
set isPointing(isPointing: boolean);
|
|
4729
|
+
/* Excluded from this release type: setIsPointing */
|
|
4730
|
+
private _isPinching;
|
|
4731
|
+
/**
|
|
4732
|
+
* Whether the user is pinching.
|
|
4733
|
+
*/
|
|
4734
|
+
getIsPinching(): boolean;
|
|
4735
|
+
/**
|
|
4736
|
+
* @deprecated Use `getIsPinching()` instead.
|
|
4737
|
+
*/
|
|
4738
|
+
get isPinching(): boolean;
|
|
4739
|
+
set isPinching(isPinching: boolean);
|
|
4740
|
+
/* Excluded from this release type: setIsPinching */
|
|
4741
|
+
private _isEditing;
|
|
4742
|
+
/**
|
|
4743
|
+
* Whether the user is editing.
|
|
4744
|
+
*/
|
|
4745
|
+
getIsEditing(): boolean;
|
|
4746
|
+
/**
|
|
4747
|
+
* @deprecated Use `getIsEditing()` instead.
|
|
4748
|
+
*/
|
|
4749
|
+
get isEditing(): boolean;
|
|
4750
|
+
set isEditing(isEditing: boolean);
|
|
4751
|
+
/**
|
|
4752
|
+
* @param isEditing - Whether the user is editing.
|
|
4753
|
+
*/
|
|
4754
|
+
setIsEditing(isEditing: boolean): void;
|
|
4755
|
+
private _isPanning;
|
|
4756
|
+
/**
|
|
4757
|
+
* Whether the user is panning.
|
|
4758
|
+
*/
|
|
4759
|
+
getIsPanning(): boolean;
|
|
4760
|
+
/**
|
|
4761
|
+
* @deprecated Use `getIsPanning()` instead.
|
|
4762
|
+
*/
|
|
4763
|
+
get isPanning(): boolean;
|
|
4764
|
+
set isPanning(isPanning: boolean);
|
|
4765
|
+
/* Excluded from this release type: setIsPanning */
|
|
4766
|
+
private _isSpacebarPanning;
|
|
4767
|
+
/**
|
|
4768
|
+
* Whether the user is spacebar panning.
|
|
4769
|
+
*/
|
|
4770
|
+
getIsSpacebarPanning(): boolean;
|
|
4771
|
+
/**
|
|
4772
|
+
* @deprecated Use `getIsSpacebarPanning()` instead.
|
|
4773
|
+
*/
|
|
4774
|
+
get isSpacebarPanning(): boolean;
|
|
4775
|
+
set isSpacebarPanning(isSpacebarPanning: boolean);
|
|
4776
|
+
/* Excluded from this release type: setIsSpacebarPanning */
|
|
4777
|
+
private _getHasCollaborators;
|
|
4778
|
+
/* Excluded from this release type: _velocityPrevPoint */
|
|
4779
|
+
/* Excluded from this release type: updatePointerVelocity */
|
|
4780
|
+
/* Excluded from this release type: updateFromEvent */
|
|
4781
|
+
toJson(): {
|
|
4782
|
+
altKey: boolean;
|
|
4783
|
+
buttons: number[];
|
|
4784
|
+
ctrlKey: boolean;
|
|
4785
|
+
currentPagePoint: VecModel;
|
|
4786
|
+
currentScreenPoint: VecModel;
|
|
4787
|
+
isDragging: boolean;
|
|
4788
|
+
isEditing: boolean;
|
|
4789
|
+
isPanning: boolean;
|
|
4790
|
+
isPen: boolean;
|
|
4791
|
+
isPinching: boolean;
|
|
4792
|
+
isPointing: boolean;
|
|
4793
|
+
isSpacebarPanning: boolean;
|
|
4794
|
+
keys: string[];
|
|
4795
|
+
metaKey: boolean;
|
|
4796
|
+
originPagePoint: VecModel;
|
|
4797
|
+
originScreenPoint: VecModel;
|
|
4798
|
+
pointerVelocity: VecModel;
|
|
4799
|
+
previousPagePoint: VecModel;
|
|
4800
|
+
previousScreenPoint: VecModel;
|
|
4801
|
+
shiftKey: boolean;
|
|
4802
|
+
};
|
|
4803
|
+
}
|
|
4804
|
+
|
|
4554
4805
|
/**
|
|
4555
4806
|
* Find the intersections between a circle and a circle.
|
|
4556
4807
|
*
|
|
@@ -4680,7 +4931,7 @@ export declare function kickoutOccludedShapes(editor: Editor, shapeIds: TLShapeI
|
|
|
4680
4931
|
export declare function linesIntersect(A: VecLike, B: VecLike, C: VecLike, D: VecLike): boolean;
|
|
4681
4932
|
|
|
4682
4933
|
/** @public @react */
|
|
4683
|
-
export declare function LoadingScreen({ children }: LoadingScreenProps):
|
|
4934
|
+
export declare function LoadingScreen({ children }: LoadingScreenProps): JSX.Element;
|
|
4684
4935
|
|
|
4685
4936
|
/** @public */
|
|
4686
4937
|
export declare interface LoadingScreenProps {
|
|
@@ -4798,7 +5049,7 @@ export declare function maybeSnapToGrid(point: Vec, editor: Editor): Vec;
|
|
|
4798
5049
|
*
|
|
4799
5050
|
* @public @react
|
|
4800
5051
|
*/
|
|
4801
|
-
export declare function MenuClickCapture(): false |
|
|
5052
|
+
export declare function MenuClickCapture(): false | JSX.Element;
|
|
4802
5053
|
|
|
4803
5054
|
/* Excluded from this release type: normalizeWheel */
|
|
4804
5055
|
|
|
@@ -5231,20 +5482,20 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
5231
5482
|
* @param shape - The shape.
|
|
5232
5483
|
* @public
|
|
5233
5484
|
*/
|
|
5234
|
-
canSnap(
|
|
5485
|
+
canSnap(shape: Shape): boolean;
|
|
5235
5486
|
/**
|
|
5236
5487
|
* Whether the shape can be tabbed to.
|
|
5237
5488
|
*
|
|
5238
5489
|
* @param shape - The shape.
|
|
5239
5490
|
* @public
|
|
5240
5491
|
*/
|
|
5241
|
-
canTabTo(
|
|
5492
|
+
canTabTo(shape: Shape): boolean;
|
|
5242
5493
|
/**
|
|
5243
5494
|
* Whether the shape can be scrolled while editing.
|
|
5244
5495
|
*
|
|
5245
5496
|
* @public
|
|
5246
5497
|
*/
|
|
5247
|
-
canScroll(
|
|
5498
|
+
canScroll(shape: Shape): boolean;
|
|
5248
5499
|
/**
|
|
5249
5500
|
* Whether the shape can be bound to. See {@link TLShapeUtilCanBindOpts} for details.
|
|
5250
5501
|
*
|
|
@@ -5256,31 +5507,37 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
5256
5507
|
*
|
|
5257
5508
|
* @public
|
|
5258
5509
|
*/
|
|
5259
|
-
canEdit(
|
|
5510
|
+
canEdit(shape: Shape, info: TLEditStartInfo): boolean;
|
|
5260
5511
|
/**
|
|
5261
5512
|
* Whether the shape can be resized.
|
|
5262
5513
|
*
|
|
5263
5514
|
* @public
|
|
5264
5515
|
*/
|
|
5265
|
-
canResize(
|
|
5516
|
+
canResize(shape: Shape): boolean;
|
|
5266
5517
|
/**
|
|
5267
5518
|
* When the shape is resized, whether the shape's children should also be resized.
|
|
5268
5519
|
*
|
|
5269
5520
|
* @public
|
|
5270
5521
|
*/
|
|
5271
|
-
canResizeChildren(
|
|
5522
|
+
canResizeChildren(shape: Shape): boolean;
|
|
5272
5523
|
/**
|
|
5273
5524
|
* Whether the shape can be edited in read-only mode.
|
|
5274
5525
|
*
|
|
5275
5526
|
* @public
|
|
5276
5527
|
*/
|
|
5277
|
-
canEditInReadonly(
|
|
5528
|
+
canEditInReadonly(shape: Shape): boolean;
|
|
5529
|
+
/**
|
|
5530
|
+
* Whether the shape can be edited while locked or while an ancestor is locked.
|
|
5531
|
+
*
|
|
5532
|
+
* @public
|
|
5533
|
+
*/
|
|
5534
|
+
canEditWhileLocked(shape: Shape): boolean;
|
|
5278
5535
|
/**
|
|
5279
5536
|
* Whether the shape can be cropped.
|
|
5280
5537
|
*
|
|
5281
5538
|
* @public
|
|
5282
5539
|
*/
|
|
5283
|
-
canCrop(
|
|
5540
|
+
canCrop(shape: Shape): boolean;
|
|
5284
5541
|
/**
|
|
5285
5542
|
* Whether the shape can participate in layout functions such as alignment or distribution.
|
|
5286
5543
|
*
|
|
@@ -5290,7 +5547,7 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
5290
5547
|
*
|
|
5291
5548
|
* @public
|
|
5292
5549
|
*/
|
|
5293
|
-
canBeLaidOut(
|
|
5550
|
+
canBeLaidOut(shape: Shape, info: TLShapeUtilCanBeLaidOutOpts): boolean;
|
|
5294
5551
|
/**
|
|
5295
5552
|
* Whether this shape can be culled. By default, shapes are culled for
|
|
5296
5553
|
* performance reasons when they are outside of the viewport. Culled shapes are still rendered
|
|
@@ -5298,11 +5555,31 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
5298
5555
|
*
|
|
5299
5556
|
* @param shape - The shape.
|
|
5300
5557
|
*/
|
|
5301
|
-
canCull(
|
|
5558
|
+
canCull(shape: Shape): boolean;
|
|
5302
5559
|
/* Excluded from this release type: providesBackgroundForChildren */
|
|
5303
5560
|
/**
|
|
5304
5561
|
* Get the clip path to apply to this shape's children.
|
|
5305
5562
|
*
|
|
5563
|
+
* The returned points should define the **inner** clip boundary - the area where
|
|
5564
|
+
* children will be visible. If your shape has a stroke, you should inset the clip
|
|
5565
|
+
* path by half the stroke width so children are clipped to the inner edge of the
|
|
5566
|
+
* stroke rather than its center line.
|
|
5567
|
+
*
|
|
5568
|
+
* @example
|
|
5569
|
+
* ```ts
|
|
5570
|
+
* override getClipPath(shape: MyShape): Vec[] | undefined {
|
|
5571
|
+
* const strokeWidth = 2
|
|
5572
|
+
* const inset = strokeWidth / 2
|
|
5573
|
+
* // Return points inset by half the stroke width
|
|
5574
|
+
* return [
|
|
5575
|
+
* new Vec(inset, inset),
|
|
5576
|
+
* new Vec(shape.props.w - inset, inset),
|
|
5577
|
+
* new Vec(shape.props.w - inset, shape.props.h - inset),
|
|
5578
|
+
* new Vec(inset, shape.props.h - inset),
|
|
5579
|
+
* ]
|
|
5580
|
+
* }
|
|
5581
|
+
* ```
|
|
5582
|
+
*
|
|
5306
5583
|
* @param shape - The shape to get the clip path for
|
|
5307
5584
|
* @returns Array of points defining the clipping polygon in local coordinates, or undefined if no clipping
|
|
5308
5585
|
* @public
|
|
@@ -5327,37 +5604,37 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
5327
5604
|
* @returns boolean indicating if this shape should hide in the minimap
|
|
5328
5605
|
* @public
|
|
5329
5606
|
*/
|
|
5330
|
-
hideInMinimap?(
|
|
5607
|
+
hideInMinimap?(shape: Shape): boolean;
|
|
5331
5608
|
/**
|
|
5332
5609
|
* Whether the shape should hide its resize handles when selected.
|
|
5333
5610
|
*
|
|
5334
5611
|
* @public
|
|
5335
5612
|
*/
|
|
5336
|
-
hideResizeHandles(
|
|
5613
|
+
hideResizeHandles(shape: Shape): boolean;
|
|
5337
5614
|
/**
|
|
5338
5615
|
* Whether the shape should hide its rotation handles when selected.
|
|
5339
5616
|
*
|
|
5340
5617
|
* @public
|
|
5341
5618
|
*/
|
|
5342
|
-
hideRotateHandle(
|
|
5619
|
+
hideRotateHandle(shape: Shape): boolean;
|
|
5343
5620
|
/**
|
|
5344
5621
|
* Whether the shape should hide its selection bounds background when selected.
|
|
5345
5622
|
*
|
|
5346
5623
|
* @public
|
|
5347
5624
|
*/
|
|
5348
|
-
hideSelectionBoundsBg(
|
|
5625
|
+
hideSelectionBoundsBg(shape: Shape): boolean;
|
|
5349
5626
|
/**
|
|
5350
5627
|
* Whether the shape should hide its selection bounds foreground when selected.
|
|
5351
5628
|
*
|
|
5352
5629
|
* @public
|
|
5353
5630
|
*/
|
|
5354
|
-
hideSelectionBoundsFg(
|
|
5631
|
+
hideSelectionBoundsFg(shape: Shape): boolean;
|
|
5355
5632
|
/**
|
|
5356
5633
|
* Whether the shape's aspect ratio is locked.
|
|
5357
5634
|
*
|
|
5358
5635
|
* @public
|
|
5359
5636
|
*/
|
|
5360
|
-
isAspectRatioLocked(
|
|
5637
|
+
isAspectRatioLocked(shape: Shape): boolean;
|
|
5361
5638
|
/**
|
|
5362
5639
|
* By default, the bounds of an image export are the bounds of all the shapes it contains, plus
|
|
5363
5640
|
* some padding. If an export includes a shape where `isExportBoundsContainer` is true, then the
|
|
@@ -5365,10 +5642,10 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
5365
5642
|
* useful in cases like annotating on top of an image, where you usually want to avoid extra
|
|
5366
5643
|
* padding around the image if you don't need it.
|
|
5367
5644
|
*
|
|
5368
|
-
* @param
|
|
5645
|
+
* @param shape - The shape to check
|
|
5369
5646
|
* @returns True if this shape should be treated as an export bounds container
|
|
5370
5647
|
*/
|
|
5371
|
-
isExportBoundsContainer(
|
|
5648
|
+
isExportBoundsContainer(shape: Shape): boolean;
|
|
5372
5649
|
/* Excluded from this release type: backgroundComponent */
|
|
5373
5650
|
/**
|
|
5374
5651
|
* Get the interpolated props for an animating shape. This is an optional method.
|
|
@@ -5405,7 +5682,7 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
5405
5682
|
* @param type - The shape type.
|
|
5406
5683
|
* @public
|
|
5407
5684
|
*/
|
|
5408
|
-
canReceiveNewChildrenOfType(
|
|
5685
|
+
canReceiveNewChildrenOfType(shape: Shape, _type: TLShape['type']): boolean;
|
|
5409
5686
|
/**
|
|
5410
5687
|
* Get the shape as an SVG object.
|
|
5411
5688
|
*
|
|
@@ -5438,14 +5715,14 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
5438
5715
|
* Get the geometry to use when snapping to this this shape in translate/resize operations. See
|
|
5439
5716
|
* {@link BoundsSnapGeometry} for details.
|
|
5440
5717
|
*/
|
|
5441
|
-
getBoundsSnapGeometry(
|
|
5718
|
+
getBoundsSnapGeometry(shape: Shape): BoundsSnapGeometry;
|
|
5442
5719
|
/**
|
|
5443
5720
|
* Get the geometry to use when snapping handles to this shape. See {@link HandleSnapGeometry}
|
|
5444
5721
|
* for details.
|
|
5445
5722
|
*/
|
|
5446
|
-
getHandleSnapGeometry(
|
|
5447
|
-
getText(
|
|
5448
|
-
getAriaDescriptor(
|
|
5723
|
+
getHandleSnapGeometry(shape: Shape): HandleSnapGeometry;
|
|
5724
|
+
getText(shape: Shape): string | undefined;
|
|
5725
|
+
getAriaDescriptor(shape: Shape): string | undefined;
|
|
5449
5726
|
/**
|
|
5450
5727
|
* A callback called just before a shape is created. This method provides a last chance to modify
|
|
5451
5728
|
* the created shape.
|
|
@@ -5803,6 +6080,8 @@ export declare class SnapManager {
|
|
|
5803
6080
|
getCurrentCommonAncestor(): TLShapeId | undefined;
|
|
5804
6081
|
}
|
|
5805
6082
|
|
|
6083
|
+
/* Excluded from this release type: SpatialIndexManager */
|
|
6084
|
+
|
|
5806
6085
|
/** @public */
|
|
5807
6086
|
export declare class Stadium2d extends Geometry2d {
|
|
5808
6087
|
config: Omit<Geometry2dOptions, 'isClosed'> & {
|
|
@@ -5940,7 +6219,7 @@ export declare const stopEventPropagation: (e: any) => any;
|
|
|
5940
6219
|
export declare function suffixSafeId(id: SafeId, suffix: string): SafeId;
|
|
5941
6220
|
|
|
5942
6221
|
/** @public @react */
|
|
5943
|
-
export declare function SVGContainer({ children, className, ...rest }: SVGContainerProps):
|
|
6222
|
+
export declare function SVGContainer({ children, className, ...rest }: SVGContainerProps): JSX.Element;
|
|
5944
6223
|
|
|
5945
6224
|
/** @public */
|
|
5946
6225
|
export declare type SVGContainerProps = React_2.ComponentProps<'svg'>;
|
|
@@ -6038,6 +6317,8 @@ export declare class TextManager {
|
|
|
6038
6317
|
}[];
|
|
6039
6318
|
}
|
|
6040
6319
|
|
|
6320
|
+
/* Excluded from this release type: TickManager */
|
|
6321
|
+
|
|
6041
6322
|
/**
|
|
6042
6323
|
* This is the TipTap editor! Docs are {@link https://tiptap.dev/docs}.
|
|
6043
6324
|
*
|
|
@@ -6589,6 +6870,33 @@ export declare interface TldrawOptions {
|
|
|
6589
6870
|
* Branding name of the app, currently only used for adding aria-label for the application.
|
|
6590
6871
|
*/
|
|
6591
6872
|
readonly branding?: string;
|
|
6873
|
+
/**
|
|
6874
|
+
* Whether to use debounced zoom level for certain rendering optimizations. When true,
|
|
6875
|
+
* `editor.getDebouncedZoomLevel()` returns a cached zoom value while the camera is moving,
|
|
6876
|
+
* reducing re-renders. When false, it always returns the current zoom level.
|
|
6877
|
+
*/
|
|
6878
|
+
readonly debouncedZoom: boolean;
|
|
6879
|
+
/**
|
|
6880
|
+
* The number of shapes that must be on the page for the debounced zoom level to be used.
|
|
6881
|
+
* Defaults to 300 shapes.
|
|
6882
|
+
*/
|
|
6883
|
+
readonly debouncedZoomThreshold: number;
|
|
6884
|
+
/**
|
|
6885
|
+
* Whether to allow spacebar panning. When true, the spacebar will pan the camera when held down.
|
|
6886
|
+
* When false, the spacebar will not pan the camera.
|
|
6887
|
+
*/
|
|
6888
|
+
readonly spacebarPanning: boolean;
|
|
6889
|
+
/**
|
|
6890
|
+
* The default padding (in pixels) used when zooming to fit content in the viewport.
|
|
6891
|
+
* This affects methods like `zoomToFit()`, `zoomToSelection()`, and `zoomToBounds()`.
|
|
6892
|
+
* The actual padding used is the minimum of this value and 28% of the viewport width.
|
|
6893
|
+
* Defaults to 128 pixels.
|
|
6894
|
+
*/
|
|
6895
|
+
readonly zoomToFitPadding: number;
|
|
6896
|
+
/**
|
|
6897
|
+
* The distance (in screen pixels) at which shapes snap to guides and other shapes.
|
|
6898
|
+
*/
|
|
6899
|
+
readonly snapThreshold: number;
|
|
6592
6900
|
}
|
|
6593
6901
|
|
|
6594
6902
|
/** @public */
|
|
@@ -6634,7 +6942,7 @@ export declare interface TLEditorComponents {
|
|
|
6634
6942
|
/** @public */
|
|
6635
6943
|
export declare interface TLEditorOptions {
|
|
6636
6944
|
/**
|
|
6637
|
-
* The Store instance to use for keeping the
|
|
6945
|
+
* The Store instance to use for keeping the editor's data. This may be prepopulated, e.g. by loading
|
|
6638
6946
|
* from a server or database.
|
|
6639
6947
|
*/
|
|
6640
6948
|
store: TLStore;
|
|
@@ -6713,6 +7021,11 @@ export declare interface TLEditorSnapshot {
|
|
|
6713
7021
|
session: TLSessionStateSnapshot;
|
|
6714
7022
|
}
|
|
6715
7023
|
|
|
7024
|
+
/** @public */
|
|
7025
|
+
export declare interface TLEditStartInfo {
|
|
7026
|
+
type: 'click-header' | 'click' | 'double-click-corner' | 'double-click-edge' | 'double-click' | 'press_enter' | 'unknown';
|
|
7027
|
+
}
|
|
7028
|
+
|
|
6716
7029
|
/** @public */
|
|
6717
7030
|
export declare interface TLEmbedExternalContent<EmbedDefinition> extends TLBaseExternalContent {
|
|
6718
7031
|
type: 'embed';
|
|
@@ -6725,6 +7038,8 @@ export declare type TLEnterEventHandler = (info: any, from: string) => void;
|
|
|
6725
7038
|
|
|
6726
7039
|
/**
|
|
6727
7040
|
* An object that contains information about the current device and environment.
|
|
7041
|
+
* This object is not reactive and will not update automatically when the environment changes,
|
|
7042
|
+
* so only include values that are fixed, such as the user's browser and operating system.
|
|
6728
7043
|
*
|
|
6729
7044
|
* @public
|
|
6730
7045
|
*/
|
|
@@ -6739,6 +7054,17 @@ export declare const tlenv: {
|
|
|
6739
7054
|
isWebview: boolean;
|
|
6740
7055
|
};
|
|
6741
7056
|
|
|
7057
|
+
/**
|
|
7058
|
+
* An atom that contains information about the current device and environment.
|
|
7059
|
+
* This object is reactive and will update automatically when the environment changes.
|
|
7060
|
+
* Use it for values that may change over time, such as the pointer type.
|
|
7061
|
+
*
|
|
7062
|
+
* @public
|
|
7063
|
+
*/
|
|
7064
|
+
export declare const tlenvReactive: Atom< {
|
|
7065
|
+
isCoarsePointer: boolean;
|
|
7066
|
+
}, unknown>;
|
|
7067
|
+
|
|
6742
7068
|
/** @public */
|
|
6743
7069
|
export declare interface TLErrorBoundaryProps {
|
|
6744
7070
|
children: React_2.ReactNode;
|
|
@@ -6802,6 +7128,7 @@ export declare interface TLEventMap {
|
|
|
6802
7128
|
event: [TLEventInfo];
|
|
6803
7129
|
tick: [number];
|
|
6804
7130
|
frame: [number];
|
|
7131
|
+
resize: [BoxModel];
|
|
6805
7132
|
'select-all-text': [{
|
|
6806
7133
|
shapeId: TLShapeId;
|
|
6807
7134
|
}];
|
|
@@ -6816,6 +7143,7 @@ export declare interface TLEventMap {
|
|
|
6816
7143
|
'edited-shapes': [TLRecord[]];
|
|
6817
7144
|
'deleted-shapes': [TLShapeId[]];
|
|
6818
7145
|
edit: [];
|
|
7146
|
+
dispose: [];
|
|
6819
7147
|
}
|
|
6820
7148
|
|
|
6821
7149
|
/** @public */
|
|
@@ -7913,10 +8241,10 @@ export declare function useMaybeEditor(): Editor | null;
|
|
|
7913
8241
|
/* Excluded from this release type: useOnMount */
|
|
7914
8242
|
|
|
7915
8243
|
/** @public */
|
|
7916
|
-
export declare function usePassThroughMouseOverEvents(ref: RefObject<HTMLElement>): void;
|
|
8244
|
+
export declare function usePassThroughMouseOverEvents(ref: RefObject<HTMLElement | null>): void;
|
|
7917
8245
|
|
|
7918
8246
|
/** @public */
|
|
7919
|
-
export declare function usePassThroughWheelEvents(ref: RefObject<HTMLElement>): void;
|
|
8247
|
+
export declare function usePassThroughWheelEvents(ref: RefObject<HTMLElement | null>): void;
|
|
7920
8248
|
|
|
7921
8249
|
/**
|
|
7922
8250
|
* @returns The list of peer UserIDs
|
|
@@ -8024,7 +8352,7 @@ export declare function useTLSchemaFromUtils(opts: TLStoreSchemaOptions): StoreS
|
|
|
8024
8352
|
export declare function useTLStore(opts: TLStoreOptions): TLStore;
|
|
8025
8353
|
|
|
8026
8354
|
/** @public */
|
|
8027
|
-
export declare function useTransform(ref: React.RefObject<HTMLElement | SVGElement>, x?: number, y?: number, scale?: number, rotate?: number, additionalOffset?: VecLike): void;
|
|
8355
|
+
export declare function useTransform(ref: React.RefObject<HTMLElement | null | SVGElement>, x?: number, y?: number, scale?: number, rotate?: number, additionalOffset?: VecLike): void;
|
|
8028
8356
|
|
|
8029
8357
|
/**
|
|
8030
8358
|
* React's useId hook returns a unique id for the component. However, it uses a colon in the id,
|