@tldraw/editor 4.5.0-canary.ea6778d1533e → 4.5.0-canary.faef1456e562
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 +38 -38
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +38 -38
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/version.ts +3 -3
package/dist-cjs/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { MigrationSequence } from '@tldraw/store';
|
|
|
20
20
|
import { NamedExoticComponent } from 'react';
|
|
21
21
|
import { Node as Node_2 } from '@tiptap/pm/model';
|
|
22
22
|
import { PerformanceTracker } from '@tldraw/utils';
|
|
23
|
+
import { PointerEvent as PointerEvent_2 } from 'react';
|
|
23
24
|
import { PointerEventHandler } from 'react';
|
|
24
25
|
import * as React_2 from 'react';
|
|
25
26
|
import { default as React_3 } from 'react';
|
|
@@ -63,7 +64,6 @@ import { TLImageAsset } from '@tldraw/tlschema';
|
|
|
63
64
|
import { TLInstance } from '@tldraw/tlschema';
|
|
64
65
|
import { TLInstancePageState } from '@tldraw/tlschema';
|
|
65
66
|
import { TLInstancePresence } from '@tldraw/tlschema';
|
|
66
|
-
import { TLOpacityType } from '@tldraw/tlschema';
|
|
67
67
|
import { TLPage } from '@tldraw/tlschema';
|
|
68
68
|
import { TLPageId } from '@tldraw/tlschema';
|
|
69
69
|
import { TLParentId } from '@tldraw/tlschema';
|
|
@@ -439,13 +439,13 @@ export declare class BoundsSnaps {
|
|
|
439
439
|
private getSnappablePoints;
|
|
440
440
|
private getSnappableGapNodes;
|
|
441
441
|
private getVisibleGaps;
|
|
442
|
-
snapTranslateShapes({ lockedAxis, initialSelectionPageBounds, initialSelectionSnapPoints, dragDelta
|
|
442
|
+
snapTranslateShapes({ lockedAxis, initialSelectionPageBounds, initialSelectionSnapPoints, dragDelta }: {
|
|
443
443
|
dragDelta: Vec;
|
|
444
444
|
initialSelectionPageBounds: Box;
|
|
445
445
|
initialSelectionSnapPoints: BoundsSnapPoint[];
|
|
446
446
|
lockedAxis: 'x' | 'y' | null;
|
|
447
447
|
}): SnapData;
|
|
448
|
-
snapResizeShapes({ initialSelectionPageBounds, dragDelta, handle: originalHandle, isAspectRatioLocked, isResizingFromCenter
|
|
448
|
+
snapResizeShapes({ initialSelectionPageBounds, dragDelta, handle: originalHandle, isAspectRatioLocked, isResizingFromCenter }: {
|
|
449
449
|
dragDelta: Vec;
|
|
450
450
|
handle: SelectionCorner | SelectionEdge;
|
|
451
451
|
initialSelectionPageBounds: Box;
|
|
@@ -679,7 +679,7 @@ export declare const coreShapes: readonly [typeof GroupShapeUtil];
|
|
|
679
679
|
export declare function counterClockwiseAngleDist(a0: number, a1: number): number;
|
|
680
680
|
|
|
681
681
|
/** @public */
|
|
682
|
-
export declare function createDebugValue<T>(name: string, { defaults, shouldStoreForSession
|
|
682
|
+
export declare function createDebugValue<T>(name: string, { defaults, shouldStoreForSession }: {
|
|
683
683
|
defaults: DebugFlagDefaults<T>;
|
|
684
684
|
shouldStoreForSession?: boolean;
|
|
685
685
|
}): DebugFlag<T>;
|
|
@@ -729,8 +729,8 @@ export declare function createTLStore({ initialData, defaultName, id, assets, on
|
|
|
729
729
|
|
|
730
730
|
/** @public */
|
|
731
731
|
export declare function createTLUser(opts?: {
|
|
732
|
-
setUserPreferences?: (userPreferences: TLUserPreferences) => void;
|
|
733
|
-
userPreferences?: Signal<TLUserPreferences
|
|
732
|
+
setUserPreferences?: ((userPreferences: TLUserPreferences) => void) | undefined;
|
|
733
|
+
userPreferences?: Signal<TLUserPreferences, unknown> | undefined;
|
|
734
734
|
}): TLUser;
|
|
735
735
|
|
|
736
736
|
/** @public */
|
|
@@ -814,7 +814,7 @@ export declare const DefaultBrush: ({ brush, color, opacity, className }: TLBrus
|
|
|
814
814
|
export declare function DefaultCanvas({ className }: TLCanvasComponentProps): JSX.Element;
|
|
815
815
|
|
|
816
816
|
/** @public @react */
|
|
817
|
-
export declare function DefaultCollaboratorHint({ className, zoom, point, color, viewport, opacity
|
|
817
|
+
export declare function DefaultCollaboratorHint({ className, zoom, point, color, viewport, opacity }: TLCollaboratorHintProps): JSX.Element;
|
|
818
818
|
|
|
819
819
|
/** @public @react */
|
|
820
820
|
export declare const DefaultCursor: NamedExoticComponent<TLCursorProps>;
|
|
@@ -1022,7 +1022,7 @@ export declare class EdgeScrollManager {
|
|
|
1022
1022
|
/** @public */
|
|
1023
1023
|
export declare class Editor extends EventEmitter<TLEventMap> {
|
|
1024
1024
|
readonly id: string;
|
|
1025
|
-
constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, initialState, autoFocus, inferDarkMode, options: _options, textOptions: _textOptions, getShapeVisibility, fontAssetUrls
|
|
1025
|
+
constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, initialState, autoFocus, inferDarkMode, options: _options, textOptions: _textOptions, getShapeVisibility, fontAssetUrls }: TLEditorOptions);
|
|
1026
1026
|
private readonly _getShapeVisibility?;
|
|
1027
1027
|
private getIsShapeHiddenCache;
|
|
1028
1028
|
isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
|
|
@@ -1095,8 +1095,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1095
1095
|
readonly timers: {
|
|
1096
1096
|
dispose: () => void;
|
|
1097
1097
|
requestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
1098
|
-
setInterval: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
|
|
1099
|
-
setTimeout: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
|
|
1098
|
+
setInterval: (handler: TimerHandler, timeout?: number | undefined, ...args: any[]) => number;
|
|
1099
|
+
setTimeout: (handler: TimerHandler, timeout?: number | undefined, ...args: any[]) => number;
|
|
1100
1100
|
};
|
|
1101
1101
|
/**
|
|
1102
1102
|
* A manager for the user and their preferences.
|
|
@@ -1487,14 +1487,14 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1487
1487
|
* @public
|
|
1488
1488
|
*/
|
|
1489
1489
|
getPageStates(): TLInstancePageState[];
|
|
1490
|
-
|
|
1490
|
+
private _getPageStatesQuery;
|
|
1491
1491
|
/**
|
|
1492
1492
|
* The current page state.
|
|
1493
1493
|
*
|
|
1494
1494
|
* @public
|
|
1495
1495
|
*/
|
|
1496
1496
|
getCurrentPageState(): TLInstancePageState;
|
|
1497
|
-
|
|
1497
|
+
private _getCurrentPageStateId;
|
|
1498
1498
|
/**
|
|
1499
1499
|
* Update this instance's page state.
|
|
1500
1500
|
*
|
|
@@ -1887,7 +1887,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1887
1887
|
*
|
|
1888
1888
|
* @public */
|
|
1889
1889
|
getTextOptions(): TLTextOptions;
|
|
1890
|
-
|
|
1890
|
+
private _unsafe_getCameraId;
|
|
1891
1891
|
/**
|
|
1892
1892
|
* The current camera.
|
|
1893
1893
|
*
|
|
@@ -2137,10 +2137,10 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2137
2137
|
*/
|
|
2138
2138
|
slideCamera(opts?: {
|
|
2139
2139
|
direction: VecLike;
|
|
2140
|
-
force?: boolean;
|
|
2141
|
-
friction?: number;
|
|
2140
|
+
force?: boolean | undefined;
|
|
2141
|
+
friction?: number | undefined;
|
|
2142
2142
|
speed: number;
|
|
2143
|
-
speedThreshold?: number;
|
|
2143
|
+
speedThreshold?: number | undefined;
|
|
2144
2144
|
}): this;
|
|
2145
2145
|
/**
|
|
2146
2146
|
* Animate the camera to a user's cursor position. This also briefly show the user's cursor if it's not currently visible.
|
|
@@ -2448,7 +2448,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2448
2448
|
* @public
|
|
2449
2449
|
*/
|
|
2450
2450
|
renamePage(page: TLPage | TLPageId, name: string): this;
|
|
2451
|
-
|
|
2451
|
+
private _getAllAssetsQuery;
|
|
2452
2452
|
/**
|
|
2453
2453
|
* Get all assets in the editor.
|
|
2454
2454
|
*
|
|
@@ -2537,7 +2537,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2537
2537
|
* @public
|
|
2538
2538
|
*/
|
|
2539
2539
|
getShapeGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
|
|
2540
|
-
|
|
2540
|
+
private _getShapeHandlesCache;
|
|
2541
2541
|
/**
|
|
2542
2542
|
* Get the handles (if any) for a shape.
|
|
2543
2543
|
*
|
|
@@ -2567,7 +2567,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2567
2567
|
* @public
|
|
2568
2568
|
*/
|
|
2569
2569
|
getShapeLocalTransform(shape: TLShape | TLShapeId): Mat;
|
|
2570
|
-
|
|
2570
|
+
private _getShapePageTransformCache;
|
|
2571
2571
|
/**
|
|
2572
2572
|
* Get the local transform of a shape's parent as a matrix model.
|
|
2573
2573
|
*
|
|
@@ -2595,7 +2595,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2595
2595
|
* @public
|
|
2596
2596
|
*/
|
|
2597
2597
|
getShapePageTransform(shape: TLShape | TLShapeId): Mat;
|
|
2598
|
-
|
|
2598
|
+
private _getShapePageBoundsCache;
|
|
2599
2599
|
/**
|
|
2600
2600
|
* Get the bounds of a shape in the current page space.
|
|
2601
2601
|
*
|
|
@@ -2610,7 +2610,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2610
2610
|
* @public
|
|
2611
2611
|
*/
|
|
2612
2612
|
getShapePageBounds(shape: TLShape | TLShapeId): Box | undefined;
|
|
2613
|
-
|
|
2613
|
+
private _getShapeClipPathCache;
|
|
2614
2614
|
/**
|
|
2615
2615
|
* Get the clip path for a shape.
|
|
2616
2616
|
*
|
|
@@ -2627,7 +2627,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2627
2627
|
* @public
|
|
2628
2628
|
*/
|
|
2629
2629
|
getShapeClipPath(shape: TLShape | TLShapeId): string | undefined;
|
|
2630
|
-
|
|
2630
|
+
private _getShapeMaskCache;
|
|
2631
2631
|
/**
|
|
2632
2632
|
* Get the mask (in the current page space) for a shape.
|
|
2633
2633
|
*
|
|
@@ -2659,7 +2659,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2659
2659
|
* @public
|
|
2660
2660
|
*/
|
|
2661
2661
|
getShapeMaskedPageBounds(shape: TLShape | TLShapeId): Box | undefined;
|
|
2662
|
-
|
|
2662
|
+
private _getShapeMaskedPageBoundsCache;
|
|
2663
2663
|
/**
|
|
2664
2664
|
* Get the ancestors of a shape.
|
|
2665
2665
|
*
|
|
@@ -2769,8 +2769,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2769
2769
|
* @public
|
|
2770
2770
|
*/
|
|
2771
2771
|
getShapesAtPoint(point: VecLike, opts?: {
|
|
2772
|
-
hitInside?: boolean;
|
|
2773
|
-
margin?: number;
|
|
2772
|
+
hitInside?: boolean | undefined;
|
|
2773
|
+
margin?: number | undefined;
|
|
2774
2774
|
}): TLShape[];
|
|
2775
2775
|
/**
|
|
2776
2776
|
* Get shape IDs within the given bounds.
|
|
@@ -2806,8 +2806,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2806
2806
|
* @public
|
|
2807
2807
|
*/
|
|
2808
2808
|
isPointInShape(shape: TLShape | TLShapeId, point: VecLike, opts?: {
|
|
2809
|
-
hitInside?: boolean;
|
|
2810
|
-
margin?: number;
|
|
2809
|
+
hitInside?: boolean | undefined;
|
|
2810
|
+
margin?: number | undefined;
|
|
2811
2811
|
}): boolean;
|
|
2812
2812
|
/**
|
|
2813
2813
|
* Convert a point in the current page space to a point in the local space of a shape. For example, if a
|
|
@@ -3081,7 +3081,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3081
3081
|
* Delete a binding by its ID. If the binding doesn't exist, it's ignored.
|
|
3082
3082
|
*/
|
|
3083
3083
|
deleteBinding(binding: TLBinding | TLBindingId, opts?: Parameters<this['deleteBindings']>[1]): this;
|
|
3084
|
-
canBindShapes({ fromShape, toShape, binding
|
|
3084
|
+
canBindShapes({ fromShape, toShape, binding }: {
|
|
3085
3085
|
binding: {
|
|
3086
3086
|
type: TLBinding['type'];
|
|
3087
3087
|
} | TLBinding | TLBinding['type'];
|
|
@@ -3530,7 +3530,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3530
3530
|
deleteShape(id: TLShapeId): this;
|
|
3531
3531
|
deleteShape(shape: TLShape): this;
|
|
3532
3532
|
/* Excluded from this release type: _extractSharedStyles */
|
|
3533
|
-
|
|
3533
|
+
private _getSelectionSharedStyles;
|
|
3534
3534
|
/**
|
|
3535
3535
|
* Get the style for the next shape.
|
|
3536
3536
|
*
|
|
@@ -3719,7 +3719,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3719
3719
|
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3720
3720
|
*/
|
|
3721
3721
|
putExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3722
|
-
force?: boolean;
|
|
3722
|
+
force?: boolean | undefined;
|
|
3723
3723
|
}): Promise<void>;
|
|
3724
3724
|
/**
|
|
3725
3725
|
* Handle replacing external content.
|
|
@@ -3728,7 +3728,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3728
3728
|
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3729
3729
|
*/
|
|
3730
3730
|
replaceExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3731
|
-
force?: boolean;
|
|
3731
|
+
force?: boolean | undefined;
|
|
3732
3732
|
}): Promise<void>;
|
|
3733
3733
|
/**
|
|
3734
3734
|
* Get content that can be exported for the given shape ids.
|
|
@@ -4535,7 +4535,7 @@ export declare class HandleSnaps {
|
|
|
4535
4535
|
private iterateSnapOutlines;
|
|
4536
4536
|
private getHandleSnapPosition;
|
|
4537
4537
|
private getHandleSnapData;
|
|
4538
|
-
snapHandle({ currentShapeId, handle
|
|
4538
|
+
snapHandle({ currentShapeId, handle }: {
|
|
4539
4539
|
currentShapeId: TLShapeId;
|
|
4540
4540
|
handle: TLHandle;
|
|
4541
4541
|
}): null | SnapData;
|
|
@@ -7771,7 +7771,7 @@ export declare const tlmenus: {
|
|
|
7771
7771
|
*
|
|
7772
7772
|
* @public
|
|
7773
7773
|
*/
|
|
7774
|
-
clearOpenMenus(contextId?: string): void;
|
|
7774
|
+
clearOpenMenus(contextId?: string | undefined): void;
|
|
7775
7775
|
/**
|
|
7776
7776
|
* Delete an open menu.
|
|
7777
7777
|
*
|
|
@@ -7794,7 +7794,7 @@ export declare const tlmenus: {
|
|
|
7794
7794
|
*
|
|
7795
7795
|
* @public
|
|
7796
7796
|
*/
|
|
7797
|
-
getOpenMenus(contextId?: string): string[];
|
|
7797
|
+
getOpenMenus(contextId?: string | undefined): string[];
|
|
7798
7798
|
/**
|
|
7799
7799
|
* Get whether a menu is open for a given context.
|
|
7800
7800
|
*
|
|
@@ -7808,7 +7808,7 @@ export declare const tlmenus: {
|
|
|
7808
7808
|
*
|
|
7809
7809
|
* @public
|
|
7810
7810
|
*/
|
|
7811
|
-
isMenuOpen(id: string, contextId?: string): boolean;
|
|
7811
|
+
isMenuOpen(id: string, contextId?: string | undefined): boolean;
|
|
7812
7812
|
/**
|
|
7813
7813
|
* Get whether any menus are open for a given context.
|
|
7814
7814
|
*
|
|
@@ -7846,7 +7846,7 @@ export declare const tlmenus: {
|
|
|
7846
7846
|
*
|
|
7847
7847
|
* @public
|
|
7848
7848
|
*/
|
|
7849
|
-
hideOpenMenus(contextId?: string): void;
|
|
7849
|
+
hideOpenMenus(contextId?: string | undefined): void;
|
|
7850
7850
|
/**
|
|
7851
7851
|
* Show all hidden menus.
|
|
7852
7852
|
*
|
|
@@ -7860,7 +7860,7 @@ export declare const tlmenus: {
|
|
|
7860
7860
|
*
|
|
7861
7861
|
* @public
|
|
7862
7862
|
*/
|
|
7863
|
-
showOpenMenus(contextId?: string): void;
|
|
7863
|
+
showOpenMenus(contextId?: string | undefined): void;
|
|
7864
7864
|
forContext(contextId: string): {
|
|
7865
7865
|
addOpenMenu: (id: string) => void;
|
|
7866
7866
|
clearOpenMenus: () => void;
|
|
@@ -8578,7 +8578,7 @@ export declare const userTypeValidator: T.Validator<TLUserPreferences>;
|
|
|
8578
8578
|
/** @public */
|
|
8579
8579
|
export declare function useSelectionEvents(handle: TLSelectionHandle): {
|
|
8580
8580
|
onPointerDown: PointerEventHandler<Element>;
|
|
8581
|
-
onPointerMove: (e:
|
|
8581
|
+
onPointerMove: (e: PointerEvent_2<Element>) => void;
|
|
8582
8582
|
onPointerUp: PointerEventHandler<Element>;
|
|
8583
8583
|
};
|
|
8584
8584
|
|
package/dist-cjs/index.js
CHANGED
|
@@ -369,7 +369,7 @@ var import_LocalIndexedDb = require("./lib/utils/sync/LocalIndexedDb");
|
|
|
369
369
|
var import_uniq = require("./lib/utils/uniq");
|
|
370
370
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
371
371
|
"@tldraw/editor",
|
|
372
|
-
"4.5.0-canary.
|
|
372
|
+
"4.5.0-canary.faef1456e562",
|
|
373
373
|
"cjs"
|
|
374
374
|
);
|
|
375
375
|
//# sourceMappingURL=index.js.map
|
package/dist-cjs/version.js
CHANGED
|
@@ -22,10 +22,10 @@ __export(version_exports, {
|
|
|
22
22
|
version: () => version
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(version_exports);
|
|
25
|
-
const version = "4.5.0-canary.
|
|
25
|
+
const version = "4.5.0-canary.faef1456e562";
|
|
26
26
|
const publishDates = {
|
|
27
27
|
major: "2025-09-18T14:39:22.803Z",
|
|
28
|
-
minor: "2026-02-
|
|
29
|
-
patch: "2026-02-
|
|
28
|
+
minor: "2026-02-23T11:28:13.987Z",
|
|
29
|
+
patch: "2026-02-23T11:28:13.987Z"
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=version.js.map
|
package/dist-cjs/version.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/version.ts"],
|
|
4
|
-
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '4.5.0-canary.
|
|
4
|
+
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '4.5.0-canary.faef1456e562'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2026-02-23T11:28:13.987Z',\n\tpatch: '2026-02-23T11:28:13.987Z',\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist-esm/index.d.mts
CHANGED
|
@@ -20,6 +20,7 @@ import { MigrationSequence } from '@tldraw/store';
|
|
|
20
20
|
import { NamedExoticComponent } from 'react';
|
|
21
21
|
import { Node as Node_2 } from '@tiptap/pm/model';
|
|
22
22
|
import { PerformanceTracker } from '@tldraw/utils';
|
|
23
|
+
import { PointerEvent as PointerEvent_2 } from 'react';
|
|
23
24
|
import { PointerEventHandler } from 'react';
|
|
24
25
|
import * as React_2 from 'react';
|
|
25
26
|
import { default as React_3 } from 'react';
|
|
@@ -63,7 +64,6 @@ import { TLImageAsset } from '@tldraw/tlschema';
|
|
|
63
64
|
import { TLInstance } from '@tldraw/tlschema';
|
|
64
65
|
import { TLInstancePageState } from '@tldraw/tlschema';
|
|
65
66
|
import { TLInstancePresence } from '@tldraw/tlschema';
|
|
66
|
-
import { TLOpacityType } from '@tldraw/tlschema';
|
|
67
67
|
import { TLPage } from '@tldraw/tlschema';
|
|
68
68
|
import { TLPageId } from '@tldraw/tlschema';
|
|
69
69
|
import { TLParentId } from '@tldraw/tlschema';
|
|
@@ -439,13 +439,13 @@ export declare class BoundsSnaps {
|
|
|
439
439
|
private getSnappablePoints;
|
|
440
440
|
private getSnappableGapNodes;
|
|
441
441
|
private getVisibleGaps;
|
|
442
|
-
snapTranslateShapes({ lockedAxis, initialSelectionPageBounds, initialSelectionSnapPoints, dragDelta
|
|
442
|
+
snapTranslateShapes({ lockedAxis, initialSelectionPageBounds, initialSelectionSnapPoints, dragDelta }: {
|
|
443
443
|
dragDelta: Vec;
|
|
444
444
|
initialSelectionPageBounds: Box;
|
|
445
445
|
initialSelectionSnapPoints: BoundsSnapPoint[];
|
|
446
446
|
lockedAxis: 'x' | 'y' | null;
|
|
447
447
|
}): SnapData;
|
|
448
|
-
snapResizeShapes({ initialSelectionPageBounds, dragDelta, handle: originalHandle, isAspectRatioLocked, isResizingFromCenter
|
|
448
|
+
snapResizeShapes({ initialSelectionPageBounds, dragDelta, handle: originalHandle, isAspectRatioLocked, isResizingFromCenter }: {
|
|
449
449
|
dragDelta: Vec;
|
|
450
450
|
handle: SelectionCorner | SelectionEdge;
|
|
451
451
|
initialSelectionPageBounds: Box;
|
|
@@ -679,7 +679,7 @@ export declare const coreShapes: readonly [typeof GroupShapeUtil];
|
|
|
679
679
|
export declare function counterClockwiseAngleDist(a0: number, a1: number): number;
|
|
680
680
|
|
|
681
681
|
/** @public */
|
|
682
|
-
export declare function createDebugValue<T>(name: string, { defaults, shouldStoreForSession
|
|
682
|
+
export declare function createDebugValue<T>(name: string, { defaults, shouldStoreForSession }: {
|
|
683
683
|
defaults: DebugFlagDefaults<T>;
|
|
684
684
|
shouldStoreForSession?: boolean;
|
|
685
685
|
}): DebugFlag<T>;
|
|
@@ -729,8 +729,8 @@ export declare function createTLStore({ initialData, defaultName, id, assets, on
|
|
|
729
729
|
|
|
730
730
|
/** @public */
|
|
731
731
|
export declare function createTLUser(opts?: {
|
|
732
|
-
setUserPreferences?: (userPreferences: TLUserPreferences) => void;
|
|
733
|
-
userPreferences?: Signal<TLUserPreferences
|
|
732
|
+
setUserPreferences?: ((userPreferences: TLUserPreferences) => void) | undefined;
|
|
733
|
+
userPreferences?: Signal<TLUserPreferences, unknown> | undefined;
|
|
734
734
|
}): TLUser;
|
|
735
735
|
|
|
736
736
|
/** @public */
|
|
@@ -814,7 +814,7 @@ export declare const DefaultBrush: ({ brush, color, opacity, className }: TLBrus
|
|
|
814
814
|
export declare function DefaultCanvas({ className }: TLCanvasComponentProps): JSX.Element;
|
|
815
815
|
|
|
816
816
|
/** @public @react */
|
|
817
|
-
export declare function DefaultCollaboratorHint({ className, zoom, point, color, viewport, opacity
|
|
817
|
+
export declare function DefaultCollaboratorHint({ className, zoom, point, color, viewport, opacity }: TLCollaboratorHintProps): JSX.Element;
|
|
818
818
|
|
|
819
819
|
/** @public @react */
|
|
820
820
|
export declare const DefaultCursor: NamedExoticComponent<TLCursorProps>;
|
|
@@ -1022,7 +1022,7 @@ export declare class EdgeScrollManager {
|
|
|
1022
1022
|
/** @public */
|
|
1023
1023
|
export declare class Editor extends EventEmitter<TLEventMap> {
|
|
1024
1024
|
readonly id: string;
|
|
1025
|
-
constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, initialState, autoFocus, inferDarkMode, options: _options, textOptions: _textOptions, getShapeVisibility, fontAssetUrls
|
|
1025
|
+
constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, initialState, autoFocus, inferDarkMode, options: _options, textOptions: _textOptions, getShapeVisibility, fontAssetUrls }: TLEditorOptions);
|
|
1026
1026
|
private readonly _getShapeVisibility?;
|
|
1027
1027
|
private getIsShapeHiddenCache;
|
|
1028
1028
|
isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
|
|
@@ -1095,8 +1095,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1095
1095
|
readonly timers: {
|
|
1096
1096
|
dispose: () => void;
|
|
1097
1097
|
requestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
1098
|
-
setInterval: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
|
|
1099
|
-
setTimeout: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
|
|
1098
|
+
setInterval: (handler: TimerHandler, timeout?: number | undefined, ...args: any[]) => number;
|
|
1099
|
+
setTimeout: (handler: TimerHandler, timeout?: number | undefined, ...args: any[]) => number;
|
|
1100
1100
|
};
|
|
1101
1101
|
/**
|
|
1102
1102
|
* A manager for the user and their preferences.
|
|
@@ -1487,14 +1487,14 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1487
1487
|
* @public
|
|
1488
1488
|
*/
|
|
1489
1489
|
getPageStates(): TLInstancePageState[];
|
|
1490
|
-
|
|
1490
|
+
private _getPageStatesQuery;
|
|
1491
1491
|
/**
|
|
1492
1492
|
* The current page state.
|
|
1493
1493
|
*
|
|
1494
1494
|
* @public
|
|
1495
1495
|
*/
|
|
1496
1496
|
getCurrentPageState(): TLInstancePageState;
|
|
1497
|
-
|
|
1497
|
+
private _getCurrentPageStateId;
|
|
1498
1498
|
/**
|
|
1499
1499
|
* Update this instance's page state.
|
|
1500
1500
|
*
|
|
@@ -1887,7 +1887,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1887
1887
|
*
|
|
1888
1888
|
* @public */
|
|
1889
1889
|
getTextOptions(): TLTextOptions;
|
|
1890
|
-
|
|
1890
|
+
private _unsafe_getCameraId;
|
|
1891
1891
|
/**
|
|
1892
1892
|
* The current camera.
|
|
1893
1893
|
*
|
|
@@ -2137,10 +2137,10 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2137
2137
|
*/
|
|
2138
2138
|
slideCamera(opts?: {
|
|
2139
2139
|
direction: VecLike;
|
|
2140
|
-
force?: boolean;
|
|
2141
|
-
friction?: number;
|
|
2140
|
+
force?: boolean | undefined;
|
|
2141
|
+
friction?: number | undefined;
|
|
2142
2142
|
speed: number;
|
|
2143
|
-
speedThreshold?: number;
|
|
2143
|
+
speedThreshold?: number | undefined;
|
|
2144
2144
|
}): this;
|
|
2145
2145
|
/**
|
|
2146
2146
|
* Animate the camera to a user's cursor position. This also briefly show the user's cursor if it's not currently visible.
|
|
@@ -2448,7 +2448,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2448
2448
|
* @public
|
|
2449
2449
|
*/
|
|
2450
2450
|
renamePage(page: TLPage | TLPageId, name: string): this;
|
|
2451
|
-
|
|
2451
|
+
private _getAllAssetsQuery;
|
|
2452
2452
|
/**
|
|
2453
2453
|
* Get all assets in the editor.
|
|
2454
2454
|
*
|
|
@@ -2537,7 +2537,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2537
2537
|
* @public
|
|
2538
2538
|
*/
|
|
2539
2539
|
getShapeGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
|
|
2540
|
-
|
|
2540
|
+
private _getShapeHandlesCache;
|
|
2541
2541
|
/**
|
|
2542
2542
|
* Get the handles (if any) for a shape.
|
|
2543
2543
|
*
|
|
@@ -2567,7 +2567,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2567
2567
|
* @public
|
|
2568
2568
|
*/
|
|
2569
2569
|
getShapeLocalTransform(shape: TLShape | TLShapeId): Mat;
|
|
2570
|
-
|
|
2570
|
+
private _getShapePageTransformCache;
|
|
2571
2571
|
/**
|
|
2572
2572
|
* Get the local transform of a shape's parent as a matrix model.
|
|
2573
2573
|
*
|
|
@@ -2595,7 +2595,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2595
2595
|
* @public
|
|
2596
2596
|
*/
|
|
2597
2597
|
getShapePageTransform(shape: TLShape | TLShapeId): Mat;
|
|
2598
|
-
|
|
2598
|
+
private _getShapePageBoundsCache;
|
|
2599
2599
|
/**
|
|
2600
2600
|
* Get the bounds of a shape in the current page space.
|
|
2601
2601
|
*
|
|
@@ -2610,7 +2610,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2610
2610
|
* @public
|
|
2611
2611
|
*/
|
|
2612
2612
|
getShapePageBounds(shape: TLShape | TLShapeId): Box | undefined;
|
|
2613
|
-
|
|
2613
|
+
private _getShapeClipPathCache;
|
|
2614
2614
|
/**
|
|
2615
2615
|
* Get the clip path for a shape.
|
|
2616
2616
|
*
|
|
@@ -2627,7 +2627,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2627
2627
|
* @public
|
|
2628
2628
|
*/
|
|
2629
2629
|
getShapeClipPath(shape: TLShape | TLShapeId): string | undefined;
|
|
2630
|
-
|
|
2630
|
+
private _getShapeMaskCache;
|
|
2631
2631
|
/**
|
|
2632
2632
|
* Get the mask (in the current page space) for a shape.
|
|
2633
2633
|
*
|
|
@@ -2659,7 +2659,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2659
2659
|
* @public
|
|
2660
2660
|
*/
|
|
2661
2661
|
getShapeMaskedPageBounds(shape: TLShape | TLShapeId): Box | undefined;
|
|
2662
|
-
|
|
2662
|
+
private _getShapeMaskedPageBoundsCache;
|
|
2663
2663
|
/**
|
|
2664
2664
|
* Get the ancestors of a shape.
|
|
2665
2665
|
*
|
|
@@ -2769,8 +2769,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2769
2769
|
* @public
|
|
2770
2770
|
*/
|
|
2771
2771
|
getShapesAtPoint(point: VecLike, opts?: {
|
|
2772
|
-
hitInside?: boolean;
|
|
2773
|
-
margin?: number;
|
|
2772
|
+
hitInside?: boolean | undefined;
|
|
2773
|
+
margin?: number | undefined;
|
|
2774
2774
|
}): TLShape[];
|
|
2775
2775
|
/**
|
|
2776
2776
|
* Get shape IDs within the given bounds.
|
|
@@ -2806,8 +2806,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2806
2806
|
* @public
|
|
2807
2807
|
*/
|
|
2808
2808
|
isPointInShape(shape: TLShape | TLShapeId, point: VecLike, opts?: {
|
|
2809
|
-
hitInside?: boolean;
|
|
2810
|
-
margin?: number;
|
|
2809
|
+
hitInside?: boolean | undefined;
|
|
2810
|
+
margin?: number | undefined;
|
|
2811
2811
|
}): boolean;
|
|
2812
2812
|
/**
|
|
2813
2813
|
* Convert a point in the current page space to a point in the local space of a shape. For example, if a
|
|
@@ -3081,7 +3081,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3081
3081
|
* Delete a binding by its ID. If the binding doesn't exist, it's ignored.
|
|
3082
3082
|
*/
|
|
3083
3083
|
deleteBinding(binding: TLBinding | TLBindingId, opts?: Parameters<this['deleteBindings']>[1]): this;
|
|
3084
|
-
canBindShapes({ fromShape, toShape, binding
|
|
3084
|
+
canBindShapes({ fromShape, toShape, binding }: {
|
|
3085
3085
|
binding: {
|
|
3086
3086
|
type: TLBinding['type'];
|
|
3087
3087
|
} | TLBinding | TLBinding['type'];
|
|
@@ -3530,7 +3530,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3530
3530
|
deleteShape(id: TLShapeId): this;
|
|
3531
3531
|
deleteShape(shape: TLShape): this;
|
|
3532
3532
|
/* Excluded from this release type: _extractSharedStyles */
|
|
3533
|
-
|
|
3533
|
+
private _getSelectionSharedStyles;
|
|
3534
3534
|
/**
|
|
3535
3535
|
* Get the style for the next shape.
|
|
3536
3536
|
*
|
|
@@ -3719,7 +3719,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3719
3719
|
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3720
3720
|
*/
|
|
3721
3721
|
putExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3722
|
-
force?: boolean;
|
|
3722
|
+
force?: boolean | undefined;
|
|
3723
3723
|
}): Promise<void>;
|
|
3724
3724
|
/**
|
|
3725
3725
|
* Handle replacing external content.
|
|
@@ -3728,7 +3728,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3728
3728
|
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3729
3729
|
*/
|
|
3730
3730
|
replaceExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3731
|
-
force?: boolean;
|
|
3731
|
+
force?: boolean | undefined;
|
|
3732
3732
|
}): Promise<void>;
|
|
3733
3733
|
/**
|
|
3734
3734
|
* Get content that can be exported for the given shape ids.
|
|
@@ -4535,7 +4535,7 @@ export declare class HandleSnaps {
|
|
|
4535
4535
|
private iterateSnapOutlines;
|
|
4536
4536
|
private getHandleSnapPosition;
|
|
4537
4537
|
private getHandleSnapData;
|
|
4538
|
-
snapHandle({ currentShapeId, handle
|
|
4538
|
+
snapHandle({ currentShapeId, handle }: {
|
|
4539
4539
|
currentShapeId: TLShapeId;
|
|
4540
4540
|
handle: TLHandle;
|
|
4541
4541
|
}): null | SnapData;
|
|
@@ -7771,7 +7771,7 @@ export declare const tlmenus: {
|
|
|
7771
7771
|
*
|
|
7772
7772
|
* @public
|
|
7773
7773
|
*/
|
|
7774
|
-
clearOpenMenus(contextId?: string): void;
|
|
7774
|
+
clearOpenMenus(contextId?: string | undefined): void;
|
|
7775
7775
|
/**
|
|
7776
7776
|
* Delete an open menu.
|
|
7777
7777
|
*
|
|
@@ -7794,7 +7794,7 @@ export declare const tlmenus: {
|
|
|
7794
7794
|
*
|
|
7795
7795
|
* @public
|
|
7796
7796
|
*/
|
|
7797
|
-
getOpenMenus(contextId?: string): string[];
|
|
7797
|
+
getOpenMenus(contextId?: string | undefined): string[];
|
|
7798
7798
|
/**
|
|
7799
7799
|
* Get whether a menu is open for a given context.
|
|
7800
7800
|
*
|
|
@@ -7808,7 +7808,7 @@ export declare const tlmenus: {
|
|
|
7808
7808
|
*
|
|
7809
7809
|
* @public
|
|
7810
7810
|
*/
|
|
7811
|
-
isMenuOpen(id: string, contextId?: string): boolean;
|
|
7811
|
+
isMenuOpen(id: string, contextId?: string | undefined): boolean;
|
|
7812
7812
|
/**
|
|
7813
7813
|
* Get whether any menus are open for a given context.
|
|
7814
7814
|
*
|
|
@@ -7846,7 +7846,7 @@ export declare const tlmenus: {
|
|
|
7846
7846
|
*
|
|
7847
7847
|
* @public
|
|
7848
7848
|
*/
|
|
7849
|
-
hideOpenMenus(contextId?: string): void;
|
|
7849
|
+
hideOpenMenus(contextId?: string | undefined): void;
|
|
7850
7850
|
/**
|
|
7851
7851
|
* Show all hidden menus.
|
|
7852
7852
|
*
|
|
@@ -7860,7 +7860,7 @@ export declare const tlmenus: {
|
|
|
7860
7860
|
*
|
|
7861
7861
|
* @public
|
|
7862
7862
|
*/
|
|
7863
|
-
showOpenMenus(contextId?: string): void;
|
|
7863
|
+
showOpenMenus(contextId?: string | undefined): void;
|
|
7864
7864
|
forContext(contextId: string): {
|
|
7865
7865
|
addOpenMenu: (id: string) => void;
|
|
7866
7866
|
clearOpenMenus: () => void;
|
|
@@ -8578,7 +8578,7 @@ export declare const userTypeValidator: T.Validator<TLUserPreferences>;
|
|
|
8578
8578
|
/** @public */
|
|
8579
8579
|
export declare function useSelectionEvents(handle: TLSelectionHandle): {
|
|
8580
8580
|
onPointerDown: PointerEventHandler<Element>;
|
|
8581
|
-
onPointerMove: (e:
|
|
8581
|
+
onPointerMove: (e: PointerEvent_2<Element>) => void;
|
|
8582
8582
|
onPointerUp: PointerEventHandler<Element>;
|
|
8583
8583
|
};
|
|
8584
8584
|
|
package/dist-esm/index.mjs
CHANGED
|
@@ -303,7 +303,7 @@ import { LocalIndexedDb, Table } from "./lib/utils/sync/LocalIndexedDb.mjs";
|
|
|
303
303
|
import { uniq } from "./lib/utils/uniq.mjs";
|
|
304
304
|
registerTldrawLibraryVersion(
|
|
305
305
|
"@tldraw/editor",
|
|
306
|
-
"4.5.0-canary.
|
|
306
|
+
"4.5.0-canary.faef1456e562",
|
|
307
307
|
"esm"
|
|
308
308
|
);
|
|
309
309
|
export {
|
package/dist-esm/version.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const version = "4.5.0-canary.
|
|
1
|
+
const version = "4.5.0-canary.faef1456e562";
|
|
2
2
|
const publishDates = {
|
|
3
3
|
major: "2025-09-18T14:39:22.803Z",
|
|
4
|
-
minor: "2026-02-
|
|
5
|
-
patch: "2026-02-
|
|
4
|
+
minor: "2026-02-23T11:28:13.987Z",
|
|
5
|
+
patch: "2026-02-23T11:28:13.987Z"
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
publishDates,
|
package/dist-esm/version.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/version.ts"],
|
|
4
|
-
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '4.5.0-canary.
|
|
4
|
+
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '4.5.0-canary.faef1456e562'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2026-02-23T11:28:13.987Z',\n\tpatch: '2026-02-23T11:28:13.987Z',\n}\n"],
|
|
5
5
|
"mappings": "AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tldraw/editor",
|
|
3
3
|
"description": "tldraw infinite canvas SDK (editor).",
|
|
4
|
-
"version": "4.5.0-canary.
|
|
4
|
+
"version": "4.5.0-canary.faef1456e562",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "tldraw Inc.",
|
|
7
7
|
"email": "hello@tldraw.com"
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"@tiptap/core": "^3.12.1",
|
|
50
50
|
"@tiptap/pm": "^3.12.1",
|
|
51
51
|
"@tiptap/react": "^3.12.1",
|
|
52
|
-
"@tldraw/state": "4.5.0-canary.
|
|
53
|
-
"@tldraw/state-react": "4.5.0-canary.
|
|
54
|
-
"@tldraw/store": "4.5.0-canary.
|
|
55
|
-
"@tldraw/tlschema": "4.5.0-canary.
|
|
56
|
-
"@tldraw/utils": "4.5.0-canary.
|
|
57
|
-
"@tldraw/validate": "4.5.0-canary.
|
|
52
|
+
"@tldraw/state": "4.5.0-canary.faef1456e562",
|
|
53
|
+
"@tldraw/state-react": "4.5.0-canary.faef1456e562",
|
|
54
|
+
"@tldraw/store": "4.5.0-canary.faef1456e562",
|
|
55
|
+
"@tldraw/tlschema": "4.5.0-canary.faef1456e562",
|
|
56
|
+
"@tldraw/utils": "4.5.0-canary.faef1456e562",
|
|
57
|
+
"@tldraw/validate": "4.5.0-canary.faef1456e562",
|
|
58
58
|
"@use-gesture/react": "^10.3.1",
|
|
59
59
|
"classnames": "^2.5.1",
|
|
60
60
|
"eventemitter3": "^4.0.7",
|
package/src/version.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is automatically generated by internal/scripts/refresh-assets.ts.
|
|
2
2
|
// Do not edit manually. Or do, I'm a comment, not a cop.
|
|
3
3
|
|
|
4
|
-
export const version = '4.5.0-canary.
|
|
4
|
+
export const version = '4.5.0-canary.faef1456e562'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2025-09-18T14:39:22.803Z',
|
|
7
|
-
minor: '2026-02-
|
|
8
|
-
patch: '2026-02-
|
|
7
|
+
minor: '2026-02-23T11:28:13.987Z',
|
|
8
|
+
patch: '2026-02-23T11:28:13.987Z',
|
|
9
9
|
}
|