@tldraw/editor 3.16.0-canary.ca347c5375a5 → 3.16.0-canary.cb18f446a36f
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 +193 -114
- package/dist-cjs/index.js +5 -5
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/TldrawEditor.js +9 -9
- package/dist-cjs/lib/TldrawEditor.js.map +2 -2
- package/dist-cjs/lib/components/MenuClickCapture.js +0 -5
- package/dist-cjs/lib/components/MenuClickCapture.js.map +2 -2
- package/dist-cjs/lib/components/Shape.js +7 -10
- package/dist-cjs/lib/components/Shape.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +14 -23
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js.map +1 -1
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultScribble.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultScribble.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js +9 -1
- package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js.map +2 -2
- package/dist-cjs/lib/config/TLUserPreferences.js +9 -3
- package/dist-cjs/lib/config/TLUserPreferences.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +115 -137
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/derivations/notVisibleShapes.js +4 -0
- package/dist-cjs/lib/editor/derivations/notVisibleShapes.js.map +2 -2
- package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js +4 -2
- package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +9 -4
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js +23 -0
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/types/misc-types.js.map +1 -1
- package/dist-cjs/lib/exports/getSvgJsx.js +35 -16
- package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
- package/dist-cjs/lib/hooks/useCanvasEvents.js +47 -38
- package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useDocumentEvents.js +5 -5
- package/dist-cjs/lib/hooks/useDocumentEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js +1 -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/useHandleEvents.js +6 -6
- package/dist-cjs/lib/hooks/useHandleEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js +4 -1
- package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js +4 -1
- package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useSelectionEvents.js +8 -8
- package/dist-cjs/lib/hooks/useSelectionEvents.js.map +2 -2
- package/dist-cjs/lib/{utils/nearestMultiple.js → hooks/useStateAttribute.js} +15 -14
- package/dist-cjs/lib/hooks/useStateAttribute.js.map +7 -0
- package/dist-cjs/lib/license/LicenseManager.js +143 -53
- package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
- package/dist-cjs/lib/license/LicenseProvider.js +39 -1
- package/dist-cjs/lib/license/LicenseProvider.js.map +2 -2
- package/dist-cjs/lib/license/Watermark.js +144 -75
- package/dist-cjs/lib/license/Watermark.js.map +3 -3
- package/dist-cjs/lib/license/useLicenseManagerState.js.map +2 -2
- package/dist-cjs/lib/options.js +7 -0
- 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/Vec.js +0 -4
- package/dist-cjs/lib/primitives/Vec.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js +50 -20
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Group2d.js +8 -1
- package/dist-cjs/lib/primitives/geometry/Group2d.js.map +2 -2
- package/dist-cjs/lib/utils/EditorAtom.js +45 -0
- package/dist-cjs/lib/utils/EditorAtom.js.map +7 -0
- package/dist-cjs/lib/utils/dom.js.map +2 -2
- package/dist-cjs/lib/utils/getPointerInfo.js +2 -3
- package/dist-cjs/lib/utils/getPointerInfo.js.map +2 -2
- package/dist-cjs/lib/utils/reparenting.js +2 -35
- package/dist-cjs/lib/utils/reparenting.js.map +3 -3
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +193 -114
- package/dist-esm/index.mjs +5 -5
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/TldrawEditor.mjs +9 -9
- package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
- package/dist-esm/lib/components/MenuClickCapture.mjs +0 -5
- package/dist-esm/lib/components/MenuClickCapture.mjs.map +2 -2
- package/dist-esm/lib/components/Shape.mjs +7 -10
- package/dist-esm/lib/components/Shape.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +14 -23
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs.map +1 -1
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultScribble.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultScribble.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs +9 -1
- package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs.map +2 -2
- package/dist-esm/lib/config/TLUserPreferences.mjs +9 -3
- package/dist-esm/lib/config/TLUserPreferences.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +115 -137
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs +4 -0
- package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs +4 -2
- package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +9 -4
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +23 -0
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs +36 -16
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
- package/dist-esm/lib/hooks/useCanvasEvents.mjs +49 -45
- package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useDocumentEvents.mjs +6 -6
- package/dist-esm/lib/hooks/useDocumentEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs +1 -2
- package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useGestureEvents.mjs +2 -2
- package/dist-esm/lib/hooks/useGestureEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useHandleEvents.mjs +6 -6
- package/dist-esm/lib/hooks/useHandleEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs +4 -1
- package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs +4 -1
- package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useSelectionEvents.mjs +9 -14
- package/dist-esm/lib/hooks/useSelectionEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useStateAttribute.mjs +15 -0
- package/dist-esm/lib/hooks/useStateAttribute.mjs.map +7 -0
- package/dist-esm/lib/license/LicenseManager.mjs +144 -54
- package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
- package/dist-esm/lib/license/LicenseProvider.mjs +39 -2
- package/dist-esm/lib/license/LicenseProvider.mjs.map +2 -2
- package/dist-esm/lib/license/Watermark.mjs +145 -76
- package/dist-esm/lib/license/Watermark.mjs.map +3 -3
- package/dist-esm/lib/license/useLicenseManagerState.mjs.map +2 -2
- package/dist-esm/lib/options.mjs +7 -0
- package/dist-esm/lib/options.mjs.map +2 -2
- package/dist-esm/lib/primitives/Box.mjs +4 -1
- package/dist-esm/lib/primitives/Box.mjs.map +2 -2
- package/dist-esm/lib/primitives/Vec.mjs +0 -4
- package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +53 -21
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Group2d.mjs +8 -1
- package/dist-esm/lib/primitives/geometry/Group2d.mjs.map +2 -2
- package/dist-esm/lib/utils/EditorAtom.mjs +25 -0
- package/dist-esm/lib/utils/EditorAtom.mjs.map +7 -0
- package/dist-esm/lib/utils/dom.mjs.map +2 -2
- package/dist-esm/lib/utils/getPointerInfo.mjs +2 -3
- package/dist-esm/lib/utils/getPointerInfo.mjs.map +2 -2
- package/dist-esm/lib/utils/reparenting.mjs +3 -40
- package/dist-esm/lib/utils/reparenting.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +308 -290
- package/package.json +14 -37
- package/src/index.ts +4 -9
- package/src/lib/TldrawEditor.tsx +14 -21
- package/src/lib/components/MenuClickCapture.tsx +0 -8
- package/src/lib/components/Shape.tsx +6 -12
- package/src/lib/components/default-components/DefaultCanvas.tsx +11 -22
- package/src/lib/components/default-components/DefaultCollaboratorHint.tsx +1 -1
- package/src/lib/components/default-components/DefaultErrorFallback.tsx +1 -1
- package/src/lib/components/default-components/DefaultScribble.tsx +1 -1
- package/src/lib/components/default-components/DefaultShapeIndicator.tsx +5 -1
- package/src/lib/config/TLUserPreferences.ts +8 -1
- package/src/lib/editor/Editor.test.ts +102 -11
- package/src/lib/editor/Editor.ts +157 -197
- package/src/lib/editor/derivations/notVisibleShapes.ts +6 -0
- package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +15 -14
- package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +16 -15
- package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +49 -48
- package/src/lib/editor/managers/FocusManager/FocusManager.ts +6 -2
- package/src/lib/editor/managers/FontManager/FontManager.test.ts +24 -23
- package/src/lib/editor/managers/HistoryManager/HistoryManager.test.ts +7 -6
- package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +12 -11
- package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +57 -50
- package/src/lib/editor/managers/TextManager/TextManager.test.ts +51 -26
- package/src/lib/editor/managers/TickManager/TickManager.test.ts +14 -13
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +34 -26
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +6 -1
- package/src/lib/editor/shapes/ShapeUtil.ts +46 -0
- package/src/lib/editor/types/misc-types.ts +54 -7
- package/src/lib/exports/getSvgJsx.test.ts +868 -0
- package/src/lib/exports/getSvgJsx.tsx +78 -21
- package/src/lib/hooks/useCanvasEvents.ts +62 -55
- package/src/lib/hooks/useDocumentEvents.ts +6 -6
- package/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +1 -1
- package/src/lib/hooks/useGestureEvents.ts +2 -2
- package/src/lib/hooks/useHandleEvents.ts +6 -6
- package/src/lib/hooks/usePassThroughMouseOverEvents.ts +4 -1
- package/src/lib/hooks/usePassThroughWheelEvents.ts +6 -1
- package/src/lib/hooks/useSelectionEvents.ts +9 -14
- package/src/lib/hooks/useStateAttribute.ts +15 -0
- package/src/lib/license/LicenseManager.test.ts +724 -383
- package/src/lib/license/LicenseManager.ts +204 -58
- package/src/lib/license/LicenseProvider.tsx +74 -2
- package/src/lib/license/Watermark.test.tsx +2 -1
- package/src/lib/license/Watermark.tsx +152 -77
- package/src/lib/license/useLicenseManagerState.ts +2 -2
- package/src/lib/options.ts +8 -0
- package/src/lib/primitives/Box.test.ts +126 -0
- package/src/lib/primitives/Box.ts +10 -1
- package/src/lib/primitives/Vec.ts +0 -5
- package/src/lib/primitives/geometry/Geometry2d.test.ts +420 -0
- package/src/lib/primitives/geometry/Geometry2d.ts +78 -21
- package/src/lib/primitives/geometry/Group2d.ts +10 -1
- package/src/lib/test/InFrontOfTheCanvas.test.tsx +187 -0
- package/src/lib/utils/EditorAtom.ts +37 -0
- package/src/lib/utils/dom.test.ts +103 -0
- package/src/lib/utils/dom.ts +8 -1
- package/src/lib/utils/getPointerInfo.ts +3 -2
- package/src/lib/utils/reparenting.ts +3 -69
- package/src/lib/utils/sync/LocalIndexedDb.test.ts +2 -1
- package/src/lib/utils/sync/TLLocalSyncClient.test.ts +15 -15
- package/src/version.ts +3 -3
- package/dist-cjs/lib/utils/nearestMultiple.js.map +0 -7
- package/dist-esm/lib/utils/nearestMultiple.mjs +0 -14
- package/dist-esm/lib/utils/nearestMultiple.mjs.map +0 -7
- package/src/lib/utils/nearestMultiple.ts +0 -13
package/dist-esm/index.d.mts
CHANGED
|
@@ -510,6 +510,7 @@ export declare class Box {
|
|
|
510
510
|
static ExpandBy(A: Box, n: number): Box;
|
|
511
511
|
static Collides(A: Box, B: Box): boolean;
|
|
512
512
|
static Contains(A: Box, B: Box): boolean;
|
|
513
|
+
static ContainsApproximately(A: Box, B: Box, precision?: number): boolean;
|
|
513
514
|
static Includes(A: Box, B: Box): boolean;
|
|
514
515
|
static ContainsPoint(A: Box, B: VecLike, margin?: number): boolean;
|
|
515
516
|
static Common(boxes: Box[]): Box;
|
|
@@ -760,11 +761,6 @@ export declare class CubicSpline2d extends Geometry2d {
|
|
|
760
761
|
/** @public */
|
|
761
762
|
export declare function dataUrlToFile(url: string, filename: string, mimeType: string): Promise<File>;
|
|
762
763
|
|
|
763
|
-
/**
|
|
764
|
-
* @deprecated Licensing is now enabled in the tldraw SDK.
|
|
765
|
-
* @public */
|
|
766
|
-
export declare function debugEnableLicensing(): void;
|
|
767
|
-
|
|
768
764
|
/* Excluded from this release type: DebugFlag */
|
|
769
765
|
|
|
770
766
|
/* Excluded from this release type: DebugFlagDef */
|
|
@@ -889,6 +885,9 @@ export declare const defaultTldrawOptions: {
|
|
|
889
885
|
readonly nonce: undefined;
|
|
890
886
|
readonly temporaryAssetPreviewLifetimeMs: 180000;
|
|
891
887
|
readonly textShadowLod: 0.35;
|
|
888
|
+
readonly tooltipDelayMs: 700;
|
|
889
|
+
readonly uiCoarseDragDistanceSquared: 625;
|
|
890
|
+
readonly uiDragDistanceSquared: 16;
|
|
892
891
|
};
|
|
893
892
|
|
|
894
893
|
/** @public */
|
|
@@ -904,6 +903,7 @@ export declare const defaultUserPreferences: Readonly<{
|
|
|
904
903
|
isWrapMode: false;
|
|
905
904
|
locale: "ar" | "bn" | "ca" | "cs" | "da" | "de" | "el" | "en" | "es" | "fa" | "fi" | "fr" | "gl" | "gu-in" | "he" | "hi-in" | "hr" | "hu" | "id" | "it" | "ja" | "km-kh" | "kn" | "ko-kr" | "ml" | "mr" | "ms" | "ne" | "nl" | "no" | "pa" | "pl" | "pt-br" | "pt-pt" | "ro" | "ru" | "sl" | "so" | "sv" | "ta" | "te" | "th" | "tl" | "tr" | "uk" | "ur" | "vi" | "zh-cn" | "zh-tw";
|
|
906
905
|
name: "";
|
|
906
|
+
showUiLabels: false;
|
|
907
907
|
}>;
|
|
908
908
|
|
|
909
909
|
/**
|
|
@@ -979,7 +979,7 @@ export declare class EdgeScrollManager {
|
|
|
979
979
|
/** @public */
|
|
980
980
|
export declare class Editor extends EventEmitter<TLEventMap> {
|
|
981
981
|
readonly id: string;
|
|
982
|
-
constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options,
|
|
982
|
+
constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options, getShapeVisibility, fontAssetUrls, }: TLEditorOptions);
|
|
983
983
|
private readonly _getShapeVisibility?;
|
|
984
984
|
private getIsShapeHiddenCache;
|
|
985
985
|
isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
|
|
@@ -1046,22 +1046,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1046
1046
|
* @public
|
|
1047
1047
|
*/
|
|
1048
1048
|
readonly fonts: FontManager;
|
|
1049
|
-
/**
|
|
1050
|
-
* A manager for the editor's environment.
|
|
1051
|
-
*
|
|
1052
|
-
* @deprecated This is deprecated and will be removed in a future version. Use the `tlenv` global export instead.
|
|
1053
|
-
* @public
|
|
1054
|
-
*/
|
|
1055
|
-
readonly environment: {
|
|
1056
|
-
hasCanvasSupport: boolean;
|
|
1057
|
-
isAndroid: boolean;
|
|
1058
|
-
isChromeForIos: boolean;
|
|
1059
|
-
isDarwin: boolean;
|
|
1060
|
-
isFirefox: boolean;
|
|
1061
|
-
isIos: boolean;
|
|
1062
|
-
isSafari: boolean;
|
|
1063
|
-
isWebview: boolean;
|
|
1064
|
-
};
|
|
1065
1049
|
/**
|
|
1066
1050
|
* A manager for the editor's scribbles.
|
|
1067
1051
|
*
|
|
@@ -1204,22 +1188,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1204
1188
|
* @public
|
|
1205
1189
|
*/
|
|
1206
1190
|
getCanRedo(): boolean;
|
|
1207
|
-
/**
|
|
1208
|
-
* Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
|
|
1209
|
-
* any redos.
|
|
1210
|
-
*
|
|
1211
|
-
* @example
|
|
1212
|
-
* ```ts
|
|
1213
|
-
* editor.mark()
|
|
1214
|
-
* editor.mark('flip shapes')
|
|
1215
|
-
* ```
|
|
1216
|
-
*
|
|
1217
|
-
* @param markId - The mark's id, usually the reason for adding the mark.
|
|
1218
|
-
*
|
|
1219
|
-
* @public
|
|
1220
|
-
* @deprecated use {@link Editor.markHistoryStoppingPoint} instead
|
|
1221
|
-
*/
|
|
1222
|
-
mark(markId?: string): this;
|
|
1223
1191
|
/**
|
|
1224
1192
|
* Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
|
|
1225
1193
|
* any redos. You typically want to do this just before a user interaction begins or is handled.
|
|
@@ -1309,10 +1277,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1309
1277
|
* @public
|
|
1310
1278
|
*/
|
|
1311
1279
|
run(fn: () => void, opts?: TLEditorRunOptions): this;
|
|
1312
|
-
/**
|
|
1313
|
-
* @deprecated Use `Editor.run` instead.
|
|
1314
|
-
*/
|
|
1315
|
-
batch(fn: () => void, opts?: TLEditorRunOptions): this;
|
|
1316
1280
|
/* Excluded from this release type: annotateError */
|
|
1317
1281
|
/* Excluded from this release type: createErrorAnnotations */
|
|
1318
1282
|
/* Excluded from this release type: _crashingError */
|
|
@@ -1434,36 +1398,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1434
1398
|
hasOpenMenus: () => boolean;
|
|
1435
1399
|
isMenuOpen: (id: string) => boolean;
|
|
1436
1400
|
};
|
|
1437
|
-
/**
|
|
1438
|
-
* @deprecated Use `editor.menus.getOpenMenus` instead.
|
|
1439
|
-
*
|
|
1440
|
-
* @public
|
|
1441
|
-
*/
|
|
1442
|
-
getOpenMenus(): string[];
|
|
1443
|
-
/**
|
|
1444
|
-
* @deprecated Use `editor.menus.addOpenMenu` instead.
|
|
1445
|
-
*
|
|
1446
|
-
* @public
|
|
1447
|
-
*/
|
|
1448
|
-
addOpenMenu(id: string): this;
|
|
1449
|
-
/**
|
|
1450
|
-
* @deprecated Use `editor.menus.deleteOpenMenu` instead.
|
|
1451
|
-
*
|
|
1452
|
-
* @public
|
|
1453
|
-
*/
|
|
1454
|
-
deleteOpenMenu(id: string): this;
|
|
1455
|
-
/**
|
|
1456
|
-
* @deprecated Use `editor.menus.clearOpenMenus` instead.
|
|
1457
|
-
*
|
|
1458
|
-
* @public
|
|
1459
|
-
*/
|
|
1460
|
-
clearOpenMenus(): this;
|
|
1461
|
-
/**
|
|
1462
|
-
* @deprecated Use `editor.menus.hasAnyOpenMenus` instead.
|
|
1463
|
-
*
|
|
1464
|
-
* @public
|
|
1465
|
-
*/
|
|
1466
|
-
getIsMenuOpen(): boolean;
|
|
1467
1401
|
/**
|
|
1468
1402
|
* Set the cursor.
|
|
1469
1403
|
*
|
|
@@ -2690,15 +2624,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2690
2624
|
*
|
|
2691
2625
|
* @returns The shape at the given point, or undefined if there is no shape at the point.
|
|
2692
2626
|
*/
|
|
2693
|
-
getShapeAtPoint(point: VecLike, opts?:
|
|
2694
|
-
filter?(shape: TLShape): boolean;
|
|
2695
|
-
hitFrameInside?: boolean;
|
|
2696
|
-
hitInside?: boolean;
|
|
2697
|
-
hitLabels?: boolean;
|
|
2698
|
-
hitLocked?: boolean;
|
|
2699
|
-
margin?: number;
|
|
2700
|
-
renderingOnly?: boolean;
|
|
2701
|
-
}): TLShape | undefined;
|
|
2627
|
+
getShapeAtPoint(point: VecLike, opts?: TLGetShapeAtPointOptions): TLShape | undefined;
|
|
2702
2628
|
/**
|
|
2703
2629
|
* Get the shapes, if any, at a given page point.
|
|
2704
2630
|
*
|
|
@@ -2920,8 +2846,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2920
2846
|
* @public
|
|
2921
2847
|
*/
|
|
2922
2848
|
getShapeAndDescendantIds(ids: TLShapeId[]): Set<TLShapeId>;
|
|
2923
|
-
/** @deprecated Use {@link Editor.getDraggingOverShape} instead */
|
|
2924
|
-
getDroppingOverShape(point: Vec, droppingShapes: TLShape[]): TLShape | undefined;
|
|
2925
2849
|
/**
|
|
2926
2850
|
* Get the shape that some shapes should be dropped on at a given point.
|
|
2927
2851
|
*
|
|
@@ -3633,14 +3557,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3633
3557
|
* Handle external content, such as files, urls, embeds, or plain text which has been put into the app, for example by pasting external text or dropping external images onto canvas.
|
|
3634
3558
|
*
|
|
3635
3559
|
* @param info - Info about the external content.
|
|
3560
|
+
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3636
3561
|
*/
|
|
3637
|
-
putExternalContent<E>(info: TLExternalContent<E
|
|
3562
|
+
putExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3563
|
+
force?: boolean;
|
|
3564
|
+
}): Promise<void>;
|
|
3638
3565
|
/**
|
|
3639
3566
|
* Handle replacing external content.
|
|
3640
3567
|
*
|
|
3641
3568
|
* @param info - Info about the external content.
|
|
3569
|
+
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3642
3570
|
*/
|
|
3643
|
-
replaceExternalContent<E>(info: TLExternalContent<E
|
|
3571
|
+
replaceExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3572
|
+
force?: boolean;
|
|
3573
|
+
}): Promise<void>;
|
|
3644
3574
|
/**
|
|
3645
3575
|
* Get content that can be exported for the given shape ids.
|
|
3646
3576
|
*
|
|
@@ -3696,8 +3626,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3696
3626
|
svg: string;
|
|
3697
3627
|
width: number;
|
|
3698
3628
|
} | undefined>;
|
|
3699
|
-
/** @deprecated Use {@link Editor.getSvgString} or {@link Editor.getSvgElement} instead. */
|
|
3700
|
-
getSvg(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<SVGSVGElement | undefined>;
|
|
3701
3629
|
/**
|
|
3702
3630
|
* Get an exported image of the given shapes.
|
|
3703
3631
|
*
|
|
@@ -3712,6 +3640,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3712
3640
|
height: number;
|
|
3713
3641
|
width: number;
|
|
3714
3642
|
}>;
|
|
3643
|
+
/**
|
|
3644
|
+
* Get an exported image of the given shapes as a data URL.
|
|
3645
|
+
*
|
|
3646
|
+
* @param shapes - The shapes (or shape ids) to export.
|
|
3647
|
+
* @param opts - Options for the export.
|
|
3648
|
+
*
|
|
3649
|
+
* @returns A data URL of the image.
|
|
3650
|
+
* @public
|
|
3651
|
+
*/
|
|
3652
|
+
toImageDataUrl(shapes: TLShape[] | TLShapeId[], opts?: TLImageExportOptions): Promise<{
|
|
3653
|
+
height: number;
|
|
3654
|
+
url: string;
|
|
3655
|
+
width: number;
|
|
3656
|
+
}>;
|
|
3715
3657
|
/**
|
|
3716
3658
|
* The app's current input state.
|
|
3717
3659
|
*
|
|
@@ -4017,6 +3959,31 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
4017
3959
|
/* Excluded from this release type: capturedPointerId */
|
|
4018
3960
|
/* Excluded from this release type: performanceTracker */
|
|
4019
3961
|
/* Excluded from this release type: performanceTrackerTimeout */
|
|
3962
|
+
/* Excluded from this release type: handledEvents */
|
|
3963
|
+
/**
|
|
3964
|
+
* In tldraw, events are sometimes handled by multiple components. For example, the shapes might
|
|
3965
|
+
* have events, but the canvas handles events too. The way that the canvas handles events can
|
|
3966
|
+
* interfere with the with the shapes event handlers - for example, it calls `.preventDefault()`
|
|
3967
|
+
* on `pointerDown`, which also prevents `click` events from firing on the shapes.
|
|
3968
|
+
*
|
|
3969
|
+
* You can use `.stopPropagation()` to prevent the event from propagating to the rest of the
|
|
3970
|
+
* DOM, but that can impact non-tldraw event handlers set up elsewhere. By using
|
|
3971
|
+
* `markEventAsHandled`, you'll stop other parts of tldraw from handling the event without
|
|
3972
|
+
* impacting other, non-tldraw event handlers. See also {@link Editor.wasEventAlreadyHandled}.
|
|
3973
|
+
*
|
|
3974
|
+
* @public
|
|
3975
|
+
*/
|
|
3976
|
+
markEventAsHandled(e: {
|
|
3977
|
+
nativeEvent: Event;
|
|
3978
|
+
} | Event): void;
|
|
3979
|
+
/**
|
|
3980
|
+
* Checks if an event has already been handled. See {@link Editor.markEventAsHandled}.
|
|
3981
|
+
*
|
|
3982
|
+
* @public
|
|
3983
|
+
*/
|
|
3984
|
+
wasEventAlreadyHandled(e: {
|
|
3985
|
+
nativeEvent: Event;
|
|
3986
|
+
} | Event): boolean;
|
|
4020
3987
|
/**
|
|
4021
3988
|
* Dispatch an event to the editor.
|
|
4022
3989
|
*
|
|
@@ -4036,6 +4003,26 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
4036
4003
|
/* Excluded from this release type: maybeTrackPerformance */
|
|
4037
4004
|
}
|
|
4038
4005
|
|
|
4006
|
+
/**
|
|
4007
|
+
* An Atom that is scoped to the lifetime of an Editor.
|
|
4008
|
+
*
|
|
4009
|
+
* This is useful for storing UI state for tldraw applications. Keeping state scoped to an editor
|
|
4010
|
+
* instead of stored in a global atom can prevent issues with state being shared between editors
|
|
4011
|
+
* when navigating between pages, or when multiple editor instances are used on the same page.
|
|
4012
|
+
*
|
|
4013
|
+
* @public
|
|
4014
|
+
*/
|
|
4015
|
+
export declare class EditorAtom<T> {
|
|
4016
|
+
private name;
|
|
4017
|
+
private getInitialState;
|
|
4018
|
+
private states;
|
|
4019
|
+
constructor(name: string, getInitialState: (editor: Editor) => T);
|
|
4020
|
+
getAtom(editor: Editor): Atom<T>;
|
|
4021
|
+
get(editor: Editor): T;
|
|
4022
|
+
update(editor: Editor, update: (state: T) => T): T;
|
|
4023
|
+
set(editor: Editor, state: T): T;
|
|
4024
|
+
}
|
|
4025
|
+
|
|
4039
4026
|
/** @public */
|
|
4040
4027
|
export declare const EditorContext: React_3.Context<Editor | null>;
|
|
4041
4028
|
|
|
@@ -4133,6 +4120,7 @@ export declare abstract class Geometry2d {
|
|
|
4133
4120
|
isLabel: boolean;
|
|
4134
4121
|
isEmptyLabel: boolean;
|
|
4135
4122
|
isInternal: boolean;
|
|
4123
|
+
excludeFromShapeBounds: boolean;
|
|
4136
4124
|
debugColor?: string;
|
|
4137
4125
|
ignore?: boolean;
|
|
4138
4126
|
constructor(opts: Geometry2dOptions);
|
|
@@ -4156,12 +4144,14 @@ export declare abstract class Geometry2d {
|
|
|
4156
4144
|
* along the edge it is as a fraction of the total length.
|
|
4157
4145
|
*/
|
|
4158
4146
|
uninterpolateAlongEdge(point: VecLike, _filters?: Geometry2dFilters): number;
|
|
4159
|
-
/** @deprecated Iterate the vertices instead. */
|
|
4160
|
-
nearestPointOnLineSegment(A: VecLike, B: VecLike): Vec;
|
|
4161
4147
|
isPointInBounds(point: VecLike, margin?: number): boolean;
|
|
4148
|
+
overlapsPolygon(_polygon: VecLike[]): boolean;
|
|
4162
4149
|
transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
|
|
4163
4150
|
private _vertices;
|
|
4164
4151
|
get vertices(): Vec[];
|
|
4152
|
+
getBoundsVertices(): Vec[];
|
|
4153
|
+
private _boundsVertices;
|
|
4154
|
+
get boundsVertices(): Vec[];
|
|
4165
4155
|
getBounds(): Box;
|
|
4166
4156
|
private _bounds;
|
|
4167
4157
|
get bounds(): Box;
|
|
@@ -4269,7 +4259,7 @@ export declare function getPerfectDashProps(totalLength: number, strokeWidth: nu
|
|
|
4269
4259
|
};
|
|
4270
4260
|
|
|
4271
4261
|
/** @public */
|
|
4272
|
-
export declare function getPointerInfo(e: PointerEvent | React.PointerEvent): {
|
|
4262
|
+
export declare function getPointerInfo(editor: Editor, e: PointerEvent | React.PointerEvent): {
|
|
4273
4263
|
accelKey: boolean;
|
|
4274
4264
|
altKey: boolean;
|
|
4275
4265
|
button: number;
|
|
@@ -4358,6 +4348,7 @@ export declare class Group2d extends Geometry2d {
|
|
|
4358
4348
|
hitTestLineSegment(A: VecLike, B: VecLike, zoom: number, filters?: Geometry2dFilters): boolean;
|
|
4359
4349
|
intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
|
|
4360
4350
|
intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
|
|
4351
|
+
getBoundsVertices(): Vec[];
|
|
4361
4352
|
intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
|
|
4362
4353
|
intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
|
|
4363
4354
|
interpolateAlongEdge(t: number, filters?: Geometry2dFilters): Vec;
|
|
@@ -4367,6 +4358,7 @@ export declare class Group2d extends Geometry2d {
|
|
|
4367
4358
|
toSimpleSvgPath(): string;
|
|
4368
4359
|
getLength(filters?: Geometry2dFilters): number;
|
|
4369
4360
|
getSvgPathData(): string;
|
|
4361
|
+
overlapsPolygon(polygon: VecLike[]): boolean;
|
|
4370
4362
|
}
|
|
4371
4363
|
|
|
4372
4364
|
/** @public */
|
|
@@ -4607,12 +4599,16 @@ export declare function kickoutOccludedShapes(editor: Editor, shapeIds: TLShapeI
|
|
|
4607
4599
|
filter?(parent: TLShape): boolean;
|
|
4608
4600
|
}): void;
|
|
4609
4601
|
|
|
4602
|
+
/* Excluded from this release type: LICENSE_TIMEOUT */
|
|
4603
|
+
|
|
4610
4604
|
/* Excluded from this release type: LicenseFromKeyResult */
|
|
4611
4605
|
|
|
4612
4606
|
/* Excluded from this release type: LicenseInfo */
|
|
4613
4607
|
|
|
4614
4608
|
/* Excluded from this release type: LicenseManager */
|
|
4615
4609
|
|
|
4610
|
+
/* Excluded from this release type: LicenseState */
|
|
4611
|
+
|
|
4616
4612
|
/** @public */
|
|
4617
4613
|
export declare function linesIntersect(A: VecLike, B: VecLike, C: VecLike, D: VecLike): boolean;
|
|
4618
4614
|
|
|
@@ -5218,7 +5214,34 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5218
5214
|
* @public
|
|
5219
5215
|
*/
|
|
5220
5216
|
canBeLaidOut(_shape: Shape, _info: TLShapeUtilCanBeLaidOutOpts): boolean;
|
|
5217
|
+
/**
|
|
5218
|
+
* Whether this shape can be culled. By default, shapes are culled for
|
|
5219
|
+
* performance reasons when they are outside of the viewport. Culled shapes are still rendered
|
|
5220
|
+
* to the DOM, but have their `display` property set to `none`.
|
|
5221
|
+
*
|
|
5222
|
+
* @param shape - The shape.
|
|
5223
|
+
*/
|
|
5224
|
+
canCull(_shape: Shape): boolean;
|
|
5221
5225
|
/* Excluded from this release type: providesBackgroundForChildren */
|
|
5226
|
+
/**
|
|
5227
|
+
* Get the clip path to apply to this shape's children.
|
|
5228
|
+
*
|
|
5229
|
+
* @param shape - The shape to get the clip path for
|
|
5230
|
+
* @returns Array of points defining the clipping polygon in local coordinates, or undefined if no clipping
|
|
5231
|
+
* @public
|
|
5232
|
+
*/
|
|
5233
|
+
getClipPath?(shape: Shape): undefined | Vec[];
|
|
5234
|
+
/**
|
|
5235
|
+
* Whether a specific child shape should be clipped by this shape.
|
|
5236
|
+
* Only called if getClipPath returns a valid polygon.
|
|
5237
|
+
*
|
|
5238
|
+
* If not defined, the default behavior is to clip all children.
|
|
5239
|
+
*
|
|
5240
|
+
* @param child - The child shape to check
|
|
5241
|
+
* @returns boolean indicating if this child should be clipped
|
|
5242
|
+
* @public
|
|
5243
|
+
*/
|
|
5244
|
+
shouldClipChild?(child: TLShape): boolean;
|
|
5222
5245
|
/**
|
|
5223
5246
|
* Whether the shape should hide its resize handles when selected.
|
|
5224
5247
|
*
|
|
@@ -5249,6 +5272,17 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5249
5272
|
* @public
|
|
5250
5273
|
*/
|
|
5251
5274
|
isAspectRatioLocked(_shape: Shape): boolean;
|
|
5275
|
+
/**
|
|
5276
|
+
* By default, the bounds of an image export are the bounds of all the shapes it contains, plus
|
|
5277
|
+
* some padding. If an export includes a shape where `isExportBoundsContainer` is true, then the
|
|
5278
|
+
* padding is skipped _if the bounds of that shape contains all the other shapes_. This is
|
|
5279
|
+
* useful in cases like annotating on top of an image, where you usually want to avoid extra
|
|
5280
|
+
* padding around the image if you don't need it.
|
|
5281
|
+
*
|
|
5282
|
+
* @param _shape - The shape to check
|
|
5283
|
+
* @returns True if this shape should be treated as an export bounds container
|
|
5284
|
+
*/
|
|
5285
|
+
isExportBoundsContainer(_shape: Shape): boolean;
|
|
5252
5286
|
/* Excluded from this release type: backgroundComponent */
|
|
5253
5287
|
/**
|
|
5254
5288
|
* Get the interpolated props for an animating shape. This is an optional method.
|
|
@@ -5804,7 +5838,14 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
|
|
|
5804
5838
|
onExit?(info: any, to: string): void;
|
|
5805
5839
|
}
|
|
5806
5840
|
|
|
5807
|
-
/**
|
|
5841
|
+
/**
|
|
5842
|
+
* Calls `event.stopPropagation()`.
|
|
5843
|
+
*
|
|
5844
|
+
* @deprecated Use {@link Editor.markEventAsHandled} instead, or manually call `event.stopPropagation()` if
|
|
5845
|
+
* that's what you really want.
|
|
5846
|
+
*
|
|
5847
|
+
* @public
|
|
5848
|
+
*/
|
|
5808
5849
|
export declare const stopEventPropagation: (e: any) => any;
|
|
5809
5850
|
|
|
5810
5851
|
/* Excluded from this release type: StoreName */
|
|
@@ -6295,12 +6336,6 @@ export declare interface TldrawEditorBaseProps {
|
|
|
6295
6336
|
* Options for syncing the editor's camera state with the URL.
|
|
6296
6337
|
*/
|
|
6297
6338
|
deepLinks?: TLDeepLinkOptions | true;
|
|
6298
|
-
/**
|
|
6299
|
-
* Predicate for whether or not a shape should be hidden.
|
|
6300
|
-
*
|
|
6301
|
-
* @deprecated Use {@link TldrawEditorBaseProps#getShapeVisibility} instead.
|
|
6302
|
-
*/
|
|
6303
|
-
isShapeHidden?(shape: TLShape, editor: Editor): boolean;
|
|
6304
6339
|
/**
|
|
6305
6340
|
* Provides a way to hide shapes.
|
|
6306
6341
|
*
|
|
@@ -6408,6 +6443,8 @@ export declare interface TldrawOptions {
|
|
|
6408
6443
|
readonly multiClickDurationMs: number;
|
|
6409
6444
|
readonly coarseDragDistanceSquared: number;
|
|
6410
6445
|
readonly dragDistanceSquared: number;
|
|
6446
|
+
readonly uiDragDistanceSquared: number;
|
|
6447
|
+
readonly uiCoarseDragDistanceSquared: number;
|
|
6411
6448
|
readonly defaultSvgPadding: number;
|
|
6412
6449
|
readonly cameraSlideFriction: number;
|
|
6413
6450
|
readonly gridSteps: readonly {
|
|
@@ -6434,6 +6471,7 @@ export declare interface TldrawOptions {
|
|
|
6434
6471
|
readonly flattenImageBoundsPadding: number;
|
|
6435
6472
|
readonly laserDelayMs: number;
|
|
6436
6473
|
readonly maxExportDelayMs: number;
|
|
6474
|
+
readonly tooltipDelayMs: number;
|
|
6437
6475
|
/**
|
|
6438
6476
|
* How long should previews created by {@link Editor.createTemporaryAssetPreview} last before
|
|
6439
6477
|
* they expire? Defaults to 3 minutes.
|
|
@@ -6559,15 +6597,6 @@ export declare interface TLEditorOptions {
|
|
|
6559
6597
|
fontAssetUrls?: {
|
|
6560
6598
|
[key: string]: string | undefined;
|
|
6561
6599
|
};
|
|
6562
|
-
/**
|
|
6563
|
-
* A predicate that should return true if the given shape should be hidden.
|
|
6564
|
-
*
|
|
6565
|
-
* @deprecated Use {@link Editor#getShapeVisibility} instead.
|
|
6566
|
-
*
|
|
6567
|
-
* @param shape - The shape to check.
|
|
6568
|
-
* @param editor - The editor instance.
|
|
6569
|
-
*/
|
|
6570
|
-
isShapeHidden?(shape: TLShape, editor: Editor): boolean;
|
|
6571
6600
|
/**
|
|
6572
6601
|
* Provides a way to hide shapes.
|
|
6573
6602
|
*
|
|
@@ -6835,6 +6864,59 @@ export declare interface TLGeometryOpts {
|
|
|
6835
6864
|
context?: string;
|
|
6836
6865
|
}
|
|
6837
6866
|
|
|
6867
|
+
/**
|
|
6868
|
+
* Options to {@link Editor.getShapeAtPoint}.
|
|
6869
|
+
*
|
|
6870
|
+
* @public
|
|
6871
|
+
*/
|
|
6872
|
+
export declare interface TLGetShapeAtPointOptions {
|
|
6873
|
+
/**
|
|
6874
|
+
* The margin to apply to the shape.
|
|
6875
|
+
* If a number, it will be applied to both the inside and outside of the shape.
|
|
6876
|
+
* If an array, the first element will be applied to the inside of the shape, and the second element will be applied to the outside.
|
|
6877
|
+
*
|
|
6878
|
+
* @example
|
|
6879
|
+
* ```ts
|
|
6880
|
+
* // Get the shape at the center of the screen
|
|
6881
|
+
* const shape = editor.getShapeAtProps({
|
|
6882
|
+
* margin: 10,
|
|
6883
|
+
* })
|
|
6884
|
+
*
|
|
6885
|
+
* // Get the shape at the center of the screen with a 10px inner margin and a 5px outer margin
|
|
6886
|
+
* const shape = editor.getShapeAtProps({
|
|
6887
|
+
* margin: [10, 5],
|
|
6888
|
+
* })
|
|
6889
|
+
* ```
|
|
6890
|
+
*/
|
|
6891
|
+
margin?: [number, number] | number;
|
|
6892
|
+
/**
|
|
6893
|
+
* Whether to register hits inside of shapes (beyond the margin), such as the inside of a solid shape.
|
|
6894
|
+
*/
|
|
6895
|
+
hitInside?: boolean;
|
|
6896
|
+
/**
|
|
6897
|
+
* Whether to register hits on locked shapes.
|
|
6898
|
+
*/
|
|
6899
|
+
hitLocked?: boolean;
|
|
6900
|
+
/**
|
|
6901
|
+
* Whether to register hits on labels.
|
|
6902
|
+
*/
|
|
6903
|
+
hitLabels?: boolean;
|
|
6904
|
+
/**
|
|
6905
|
+
* Whether to only return hits on shapes that are currently being rendered.
|
|
6906
|
+
* todo: rename this to hitCulled or hitNotRendering
|
|
6907
|
+
*/
|
|
6908
|
+
renderingOnly?: boolean;
|
|
6909
|
+
/**
|
|
6910
|
+
* Whether to register hits on the inside of frame shapes.
|
|
6911
|
+
* todo: rename this to hitInsideFrames
|
|
6912
|
+
*/
|
|
6913
|
+
hitFrameInside?: boolean;
|
|
6914
|
+
/**
|
|
6915
|
+
* A filter function to apply to the shapes.
|
|
6916
|
+
*/
|
|
6917
|
+
filter?(shape: TLShape): boolean;
|
|
6918
|
+
}
|
|
6919
|
+
|
|
6838
6920
|
/** @public */
|
|
6839
6921
|
export declare interface TLGridProps {
|
|
6840
6922
|
x: number;
|
|
@@ -7505,12 +7587,6 @@ export declare interface TLSvgExportOptions {
|
|
|
7505
7587
|
preserveAspectRatio?: React.SVGAttributes<SVGSVGElement>['preserveAspectRatio'];
|
|
7506
7588
|
}
|
|
7507
7589
|
|
|
7508
|
-
/**
|
|
7509
|
-
* @public
|
|
7510
|
-
* @deprecated use {@link TLImageExportOptions} instead
|
|
7511
|
-
*/
|
|
7512
|
-
export declare type TLSvgOptions = TLImageExportOptions;
|
|
7513
|
-
|
|
7514
7590
|
/** @public */
|
|
7515
7591
|
export declare interface TLSvgTextExternalContent extends TLBaseExternalContent {
|
|
7516
7592
|
type: 'svg-text';
|
|
@@ -7621,6 +7697,7 @@ export declare interface TLUserPreferences {
|
|
|
7621
7697
|
isWrapMode?: boolean | null;
|
|
7622
7698
|
isDynamicSizeMode?: boolean | null;
|
|
7623
7699
|
isPasteAtCursorMode?: boolean | null;
|
|
7700
|
+
showUiLabels?: boolean | null;
|
|
7624
7701
|
}
|
|
7625
7702
|
|
|
7626
7703
|
/** @public */
|
|
@@ -7663,6 +7740,7 @@ export declare class TransformedGeometry2d extends Geometry2d {
|
|
|
7663
7740
|
private readonly decomposed;
|
|
7664
7741
|
constructor(geometry: Geometry2d, matrix: MatModel, opts?: TransformedGeometry2dOptions);
|
|
7665
7742
|
getVertices(filters: Geometry2dFilters): Vec[];
|
|
7743
|
+
getBoundsVertices(): Vec[];
|
|
7666
7744
|
nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;
|
|
7667
7745
|
hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean;
|
|
7668
7746
|
distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
|
|
@@ -7683,6 +7761,7 @@ export declare interface TransformedGeometry2dOptions {
|
|
|
7683
7761
|
isInternal?: boolean;
|
|
7684
7762
|
debugColor?: string;
|
|
7685
7763
|
ignore?: boolean;
|
|
7764
|
+
excludeFromShapeBounds?: boolean;
|
|
7686
7765
|
}
|
|
7687
7766
|
|
|
7688
7767
|
/** @public */
|
|
@@ -7793,6 +7872,7 @@ export declare class UserPreferencesManager {
|
|
|
7793
7872
|
isWrapMode: boolean;
|
|
7794
7873
|
locale: string;
|
|
7795
7874
|
name: string;
|
|
7875
|
+
showUiLabels: boolean;
|
|
7796
7876
|
};
|
|
7797
7877
|
getIsDarkMode(): boolean;
|
|
7798
7878
|
/**
|
|
@@ -7809,6 +7889,7 @@ export declare class UserPreferencesManager {
|
|
|
7809
7889
|
getIsWrapMode(): boolean;
|
|
7810
7890
|
getIsDynamicResizeMode(): boolean;
|
|
7811
7891
|
getIsPasteAtCursorMode(): boolean;
|
|
7892
|
+
getShowUiLabels(): boolean;
|
|
7812
7893
|
}
|
|
7813
7894
|
|
|
7814
7895
|
/** @public */
|
|
@@ -7915,8 +7996,6 @@ export declare class Vec {
|
|
|
7915
7996
|
lrp(B: VecLike, t: number): Vec;
|
|
7916
7997
|
equals(B: VecLike): boolean;
|
|
7917
7998
|
equalsXY(x: number, y: number): boolean;
|
|
7918
|
-
/** @deprecated use `uni` instead */
|
|
7919
|
-
norm(): this;
|
|
7920
7999
|
toFixed(): this;
|
|
7921
8000
|
toString(): string;
|
|
7922
8001
|
toJson(): VecModel;
|
package/dist-esm/index.mjs
CHANGED
|
@@ -175,6 +175,7 @@ import { useViewportHeight } from "./lib/hooks/useViewportHeight.mjs";
|
|
|
175
175
|
import {
|
|
176
176
|
LicenseManager
|
|
177
177
|
} from "./lib/license/LicenseManager.mjs";
|
|
178
|
+
import { LICENSE_TIMEOUT } from "./lib/license/LicenseProvider.mjs";
|
|
178
179
|
import { defaultTldrawOptions } from "./lib/options.mjs";
|
|
179
180
|
import {
|
|
180
181
|
Box,
|
|
@@ -273,6 +274,7 @@ import {
|
|
|
273
274
|
setPointerCapture,
|
|
274
275
|
stopEventPropagation
|
|
275
276
|
} from "./lib/utils/dom.mjs";
|
|
277
|
+
import { EditorAtom } from "./lib/utils/EditorAtom.mjs";
|
|
276
278
|
import { getIncrementedName } from "./lib/utils/getIncrementedName.mjs";
|
|
277
279
|
import { getPointerInfo } from "./lib/utils/getPointerInfo.mjs";
|
|
278
280
|
import { getSvgPathFromPoints } from "./lib/utils/getSvgPathFromPoints.mjs";
|
|
@@ -297,12 +299,9 @@ import { hardReset } from "./lib/utils/sync/hardReset.mjs";
|
|
|
297
299
|
import { LocalIndexedDb, Table } from "./lib/utils/sync/LocalIndexedDb.mjs";
|
|
298
300
|
import { uniq } from "./lib/utils/uniq.mjs";
|
|
299
301
|
import { openWindow } from "./lib/utils/window-open.mjs";
|
|
300
|
-
function debugEnableLicensing() {
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
302
|
registerTldrawLibraryVersion(
|
|
304
303
|
"@tldraw/editor",
|
|
305
|
-
"3.16.0-canary.
|
|
304
|
+
"3.16.0-canary.cb18f446a36f",
|
|
306
305
|
"esm"
|
|
307
306
|
);
|
|
308
307
|
export {
|
|
@@ -342,6 +341,7 @@ export {
|
|
|
342
341
|
Edge2d,
|
|
343
342
|
EdgeScrollManager,
|
|
344
343
|
Editor,
|
|
344
|
+
EditorAtom,
|
|
345
345
|
EditorContext,
|
|
346
346
|
EditorProvider,
|
|
347
347
|
Ellipse2d,
|
|
@@ -356,6 +356,7 @@ export {
|
|
|
356
356
|
HTMLContainer,
|
|
357
357
|
HandleSnaps,
|
|
358
358
|
HistoryManager,
|
|
359
|
+
LICENSE_TIMEOUT,
|
|
359
360
|
LicenseManager,
|
|
360
361
|
LoadingScreen,
|
|
361
362
|
LocalIndexedDb,
|
|
@@ -407,7 +408,6 @@ export {
|
|
|
407
408
|
createTLStore,
|
|
408
409
|
createTLUser,
|
|
409
410
|
dataUrlToFile,
|
|
410
|
-
debugEnableLicensing,
|
|
411
411
|
debugFlags,
|
|
412
412
|
defaultTldrawOptions,
|
|
413
413
|
defaultUserPreferences,
|