@tldraw/editor 3.16.0-internal.51e99e128bd4 → 3.16.0-internal.71f83a8a571b
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 +133 -126
- package/dist-cjs/index.js +6 -6
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/TldrawEditor.js +7 -7
- package/dist-cjs/lib/TldrawEditor.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/editor/Editor.js +40 -113
- 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/derivations/parentsToChildren.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/BaseBoxShapeUtil.js.map +1 -1
- 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/tools/BaseBoxShapeTool/BaseBoxShapeTool.js.map +2 -2
- package/dist-cjs/lib/editor/types/misc-types.js.map +1 -1
- package/dist-cjs/lib/exports/getSvgJsx.js +34 -14
- package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
- package/dist-cjs/lib/hooks/useCanvasEvents.js +22 -17
- 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 +3 -3
- 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 +4 -4
- package/dist-cjs/lib/hooks/useSelectionEvents.js.map +2 -2
- package/dist-cjs/lib/license/LicenseManager.js +140 -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 +69 -7
- package/dist-cjs/lib/license/Watermark.js.map +3 -3
- package/dist-cjs/lib/license/useLicenseManagerState.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/dom.js +12 -1
- package/dist-cjs/lib/utils/dom.js.map +2 -2
- package/dist-cjs/lib/utils/getPointerInfo.js +2 -2
- 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 +133 -126
- package/dist-esm/index.mjs +9 -7
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/TldrawEditor.mjs +8 -8
- package/dist-esm/lib/TldrawEditor.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 +15 -24
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +40 -113
- 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/derivations/parentsToChildren.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/BaseBoxShapeUtil.mjs.map +1 -1
- 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/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs +34 -14
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
- package/dist-esm/lib/hooks/useCanvasEvents.mjs +24 -18
- package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useDocumentEvents.mjs +11 -6
- package/dist-esm/lib/hooks/useDocumentEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs +2 -3
- 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 +9 -4
- 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 +6 -5
- package/dist-esm/lib/hooks/useSelectionEvents.mjs.map +2 -2
- package/dist-esm/lib/license/LicenseManager.mjs +141 -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 +70 -8
- package/dist-esm/lib/license/Watermark.mjs.map +3 -3
- package/dist-esm/lib/license/useLicenseManagerState.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/dom.mjs +12 -1
- package/dist-esm/lib/utils/dom.mjs.map +2 -2
- package/dist-esm/lib/utils/getPointerInfo.mjs +2 -2
- 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 +16 -3
- package/package.json +7 -7
- package/src/index.ts +4 -9
- package/src/lib/TldrawEditor.tsx +9 -16
- package/src/lib/components/Shape.tsx +6 -12
- package/src/lib/components/default-components/DefaultCanvas.tsx +12 -23
- package/src/lib/editor/Editor.test.ts +96 -0
- package/src/lib/editor/Editor.ts +75 -175
- package/src/lib/editor/derivations/notVisibleShapes.ts +6 -0
- package/src/lib/editor/derivations/parentsToChildren.ts +1 -1
- package/src/lib/editor/managers/FontManager/FontManager.test.ts +14 -4
- package/src/lib/editor/shapes/BaseBoxShapeUtil.tsx +2 -2
- package/src/lib/editor/shapes/ShapeUtil.ts +51 -8
- package/src/lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.ts +2 -1
- package/src/lib/editor/types/misc-types.ts +0 -6
- package/src/lib/exports/getSvgJsx.test.ts +874 -0
- package/src/lib/exports/getSvgJsx.tsx +76 -19
- package/src/lib/hooks/useCanvasEvents.ts +23 -17
- package/src/lib/hooks/useDocumentEvents.ts +11 -6
- package/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +2 -2
- package/src/lib/hooks/useGestureEvents.ts +2 -2
- package/src/lib/hooks/useHandleEvents.ts +9 -4
- package/src/lib/hooks/usePassThroughMouseOverEvents.ts +4 -1
- package/src/lib/hooks/usePassThroughWheelEvents.ts +6 -1
- package/src/lib/hooks/useSelectionEvents.ts +6 -5
- package/src/lib/license/LicenseManager.test.ts +721 -382
- package/src/lib/license/LicenseManager.ts +201 -58
- package/src/lib/license/LicenseProvider.tsx +74 -2
- package/src/lib/license/Watermark.tsx +75 -8
- package/src/lib/license/useLicenseManagerState.ts +2 -2
- 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/dom.test.ts +94 -0
- package/src/lib/utils/dom.ts +38 -1
- package/src/lib/utils/getPointerInfo.ts +2 -1
- package/src/lib/utils/reparenting.ts +3 -69
- package/src/version.ts +3 -3
- package/dist-cjs/lib/utils/nearestMultiple.js +0 -34
- 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-cjs/index.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ export declare abstract class BaseBoxShapeTool extends StateNode {
|
|
|
147
147
|
static id: string;
|
|
148
148
|
static initial: string;
|
|
149
149
|
static children(): TLStateNodeConstructor[];
|
|
150
|
-
abstract shapeType:
|
|
150
|
+
abstract shapeType: TLBaseBoxShape['type'];
|
|
151
151
|
onCreate?(_shape: null | TLShape): null | void;
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -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 */
|
|
@@ -983,7 +979,7 @@ export declare class EdgeScrollManager {
|
|
|
983
979
|
/** @public */
|
|
984
980
|
export declare class Editor extends EventEmitter<TLEventMap> {
|
|
985
981
|
readonly id: string;
|
|
986
|
-
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);
|
|
987
983
|
private readonly _getShapeVisibility?;
|
|
988
984
|
private getIsShapeHiddenCache;
|
|
989
985
|
isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
|
|
@@ -1050,22 +1046,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1050
1046
|
* @public
|
|
1051
1047
|
*/
|
|
1052
1048
|
readonly fonts: FontManager;
|
|
1053
|
-
/**
|
|
1054
|
-
* A manager for the editor's environment.
|
|
1055
|
-
*
|
|
1056
|
-
* @deprecated This is deprecated and will be removed in a future version. Use the `tlenv` global export instead.
|
|
1057
|
-
* @public
|
|
1058
|
-
*/
|
|
1059
|
-
readonly environment: {
|
|
1060
|
-
hasCanvasSupport: boolean;
|
|
1061
|
-
isAndroid: boolean;
|
|
1062
|
-
isChromeForIos: boolean;
|
|
1063
|
-
isDarwin: boolean;
|
|
1064
|
-
isFirefox: boolean;
|
|
1065
|
-
isIos: boolean;
|
|
1066
|
-
isSafari: boolean;
|
|
1067
|
-
isWebview: boolean;
|
|
1068
|
-
};
|
|
1069
1049
|
/**
|
|
1070
1050
|
* A manager for the editor's scribbles.
|
|
1071
1051
|
*
|
|
@@ -1108,7 +1088,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1108
1088
|
* @public
|
|
1109
1089
|
*/
|
|
1110
1090
|
shapeUtils: {
|
|
1111
|
-
readonly [K in string]?: ShapeUtil<
|
|
1091
|
+
readonly [K in string]?: ShapeUtil<TLShape>;
|
|
1112
1092
|
};
|
|
1113
1093
|
styleProps: {
|
|
1114
1094
|
[key: string]: Map<StyleProp<any>, string>;
|
|
@@ -1128,16 +1108,16 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1128
1108
|
*
|
|
1129
1109
|
* @public
|
|
1130
1110
|
*/
|
|
1131
|
-
getShapeUtil<S extends
|
|
1132
|
-
getShapeUtil<S extends
|
|
1111
|
+
getShapeUtil<S extends TLShape>(shape: S | TLShapePartial<S>): ShapeUtil<S>;
|
|
1112
|
+
getShapeUtil<S extends TLShape>(type: S['type']): ShapeUtil<S>;
|
|
1133
1113
|
getShapeUtil<T extends ShapeUtil>(type: T extends ShapeUtil<infer R> ? R['type'] : string): T;
|
|
1134
1114
|
/**
|
|
1135
1115
|
* Returns true if the editor has a shape util for the given shape / shape type.
|
|
1136
1116
|
*
|
|
1137
1117
|
* @param shape - A shape, shape partial, or shape type.
|
|
1138
1118
|
*/
|
|
1139
|
-
hasShapeUtil
|
|
1140
|
-
hasShapeUtil
|
|
1119
|
+
hasShapeUtil(shape: TLShape | TLShapePartial<TLShape>): boolean;
|
|
1120
|
+
hasShapeUtil(type: TLShape['type']): boolean;
|
|
1141
1121
|
hasShapeUtil<T extends ShapeUtil>(type: T extends ShapeUtil<infer R> ? R['type'] : string): boolean;
|
|
1142
1122
|
/**
|
|
1143
1123
|
* A map of shape utility classes (TLShapeUtils) by shape type.
|
|
@@ -1208,22 +1188,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1208
1188
|
* @public
|
|
1209
1189
|
*/
|
|
1210
1190
|
getCanRedo(): boolean;
|
|
1211
|
-
/**
|
|
1212
|
-
* Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
|
|
1213
|
-
* any redos.
|
|
1214
|
-
*
|
|
1215
|
-
* @example
|
|
1216
|
-
* ```ts
|
|
1217
|
-
* editor.mark()
|
|
1218
|
-
* editor.mark('flip shapes')
|
|
1219
|
-
* ```
|
|
1220
|
-
*
|
|
1221
|
-
* @param markId - The mark's id, usually the reason for adding the mark.
|
|
1222
|
-
*
|
|
1223
|
-
* @public
|
|
1224
|
-
* @deprecated use {@link Editor.markHistoryStoppingPoint} instead
|
|
1225
|
-
*/
|
|
1226
|
-
mark(markId?: string): this;
|
|
1227
1191
|
/**
|
|
1228
1192
|
* Create a new "mark", or stopping point, in the undo redo history. Creating a mark will clear
|
|
1229
1193
|
* any redos. You typically want to do this just before a user interaction begins or is handled.
|
|
@@ -1313,10 +1277,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1313
1277
|
* @public
|
|
1314
1278
|
*/
|
|
1315
1279
|
run(fn: () => void, opts?: TLEditorRunOptions): this;
|
|
1316
|
-
/**
|
|
1317
|
-
* @deprecated Use `Editor.run` instead.
|
|
1318
|
-
*/
|
|
1319
|
-
batch(fn: () => void, opts?: TLEditorRunOptions): this;
|
|
1320
1280
|
/* Excluded from this release type: annotateError */
|
|
1321
1281
|
/* Excluded from this release type: createErrorAnnotations */
|
|
1322
1282
|
/* Excluded from this release type: _crashingError */
|
|
@@ -1438,36 +1398,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1438
1398
|
hasOpenMenus: () => boolean;
|
|
1439
1399
|
isMenuOpen: (id: string) => boolean;
|
|
1440
1400
|
};
|
|
1441
|
-
/**
|
|
1442
|
-
* @deprecated Use `editor.menus.getOpenMenus` instead.
|
|
1443
|
-
*
|
|
1444
|
-
* @public
|
|
1445
|
-
*/
|
|
1446
|
-
getOpenMenus(): string[];
|
|
1447
|
-
/**
|
|
1448
|
-
* @deprecated Use `editor.menus.addOpenMenu` instead.
|
|
1449
|
-
*
|
|
1450
|
-
* @public
|
|
1451
|
-
*/
|
|
1452
|
-
addOpenMenu(id: string): this;
|
|
1453
|
-
/**
|
|
1454
|
-
* @deprecated Use `editor.menus.deleteOpenMenu` instead.
|
|
1455
|
-
*
|
|
1456
|
-
* @public
|
|
1457
|
-
*/
|
|
1458
|
-
deleteOpenMenu(id: string): this;
|
|
1459
|
-
/**
|
|
1460
|
-
* @deprecated Use `editor.menus.clearOpenMenus` instead.
|
|
1461
|
-
*
|
|
1462
|
-
* @public
|
|
1463
|
-
*/
|
|
1464
|
-
clearOpenMenus(): this;
|
|
1465
|
-
/**
|
|
1466
|
-
* @deprecated Use `editor.menus.hasAnyOpenMenus` instead.
|
|
1467
|
-
*
|
|
1468
|
-
* @public
|
|
1469
|
-
*/
|
|
1470
|
-
getIsMenuOpen(): boolean;
|
|
1471
1401
|
/**
|
|
1472
1402
|
* Set the cursor.
|
|
1473
1403
|
*
|
|
@@ -2797,8 +2727,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2797
2727
|
*
|
|
2798
2728
|
* @public
|
|
2799
2729
|
*/
|
|
2800
|
-
isShapeOfType<T extends
|
|
2801
|
-
isShapeOfType<T extends
|
|
2730
|
+
isShapeOfType<T extends TLShape>(shape: TLShape, type: T['type']): shape is T;
|
|
2731
|
+
isShapeOfType<T extends TLShape = TLShape>(shapeId: TLShapeId, type: T['type']): boolean;
|
|
2802
2732
|
/**
|
|
2803
2733
|
* Get a shape by its id.
|
|
2804
2734
|
*
|
|
@@ -2916,8 +2846,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2916
2846
|
* @public
|
|
2917
2847
|
*/
|
|
2918
2848
|
getShapeAndDescendantIds(ids: TLShapeId[]): Set<TLShapeId>;
|
|
2919
|
-
/** @deprecated Use {@link Editor.getDraggingOverShape} instead */
|
|
2920
|
-
getDroppingOverShape(point: Vec, droppingShapes: TLShape[]): TLShape | undefined;
|
|
2921
2849
|
/**
|
|
2922
2850
|
* Get the shape that some shapes should be dropped on at a given point.
|
|
2923
2851
|
*
|
|
@@ -3276,7 +3204,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3276
3204
|
*
|
|
3277
3205
|
* @public
|
|
3278
3206
|
*/
|
|
3279
|
-
canCreateShape
|
|
3207
|
+
canCreateShape(shape: OptionalKeys<TLShapePartial<TLShape>, 'id'> | TLShape['id']): boolean;
|
|
3280
3208
|
/**
|
|
3281
3209
|
* Get whether the provided shapes can be created.
|
|
3282
3210
|
*
|
|
@@ -3284,7 +3212,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3284
3212
|
*
|
|
3285
3213
|
* @public
|
|
3286
3214
|
*/
|
|
3287
|
-
canCreateShapes
|
|
3215
|
+
canCreateShapes(shapes: (OptionalKeys<TLShapePartial<TLShape>, 'id'> | TLShape['id'])[]): boolean;
|
|
3288
3216
|
/**
|
|
3289
3217
|
* Create a single shape.
|
|
3290
3218
|
*
|
|
@@ -3298,7 +3226,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3298
3226
|
*
|
|
3299
3227
|
* @public
|
|
3300
3228
|
*/
|
|
3301
|
-
createShape<
|
|
3229
|
+
createShape<TShape extends TLShape>(shape: OptionalKeys<TLShapePartial<TShape>, 'id'>): this;
|
|
3302
3230
|
/**
|
|
3303
3231
|
* Create shapes.
|
|
3304
3232
|
*
|
|
@@ -3312,7 +3240,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3312
3240
|
*
|
|
3313
3241
|
* @public
|
|
3314
3242
|
*/
|
|
3315
|
-
createShapes<
|
|
3243
|
+
createShapes<TShape extends TLShape = TLShape>(shapes: OptionalKeys<TLShapePartial<TShape>, 'id'>[]): this;
|
|
3316
3244
|
private animatingShapes;
|
|
3317
3245
|
/**
|
|
3318
3246
|
* Animate a shape.
|
|
@@ -3398,7 +3326,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3398
3326
|
*
|
|
3399
3327
|
* @public
|
|
3400
3328
|
*/
|
|
3401
|
-
updateShape<T extends
|
|
3329
|
+
updateShape<T extends TLShape = TLShape>(partial: null | TLShapePartial<T> | undefined): this;
|
|
3402
3330
|
/**
|
|
3403
3331
|
* Update shapes using partials of each shape.
|
|
3404
3332
|
*
|
|
@@ -3411,7 +3339,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3411
3339
|
*
|
|
3412
3340
|
* @public
|
|
3413
3341
|
*/
|
|
3414
|
-
updateShapes<T extends
|
|
3342
|
+
updateShapes<T extends TLShape>(partials: (null | TLShapePartial<T> | undefined)[]): this;
|
|
3415
3343
|
/* Excluded from this release type: _updateShapes */
|
|
3416
3344
|
/* Excluded from this release type: _getUnlockedShapeIds */
|
|
3417
3345
|
/**
|
|
@@ -3629,14 +3557,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3629
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.
|
|
3630
3558
|
*
|
|
3631
3559
|
* @param info - Info about the external content.
|
|
3560
|
+
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3632
3561
|
*/
|
|
3633
|
-
putExternalContent<E>(info: TLExternalContent<E
|
|
3562
|
+
putExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3563
|
+
force?: boolean;
|
|
3564
|
+
}): Promise<void>;
|
|
3634
3565
|
/**
|
|
3635
3566
|
* Handle replacing external content.
|
|
3636
3567
|
*
|
|
3637
3568
|
* @param info - Info about the external content.
|
|
3569
|
+
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3638
3570
|
*/
|
|
3639
|
-
replaceExternalContent<E>(info: TLExternalContent<E
|
|
3571
|
+
replaceExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3572
|
+
force?: boolean;
|
|
3573
|
+
}): Promise<void>;
|
|
3640
3574
|
/**
|
|
3641
3575
|
* Get content that can be exported for the given shape ids.
|
|
3642
3576
|
*
|
|
@@ -3692,8 +3626,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3692
3626
|
svg: string;
|
|
3693
3627
|
width: number;
|
|
3694
3628
|
} | undefined>;
|
|
3695
|
-
/** @deprecated Use {@link Editor.getSvgString} or {@link Editor.getSvgElement} instead. */
|
|
3696
|
-
getSvg(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<SVGSVGElement | undefined>;
|
|
3697
3629
|
/**
|
|
3698
3630
|
* Get an exported image of the given shapes.
|
|
3699
3631
|
*
|
|
@@ -3708,6 +3640,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3708
3640
|
height: number;
|
|
3709
3641
|
width: number;
|
|
3710
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
|
+
}>;
|
|
3711
3657
|
/**
|
|
3712
3658
|
* The app's current input state.
|
|
3713
3659
|
*
|
|
@@ -4149,6 +4095,7 @@ export declare abstract class Geometry2d {
|
|
|
4149
4095
|
isLabel: boolean;
|
|
4150
4096
|
isEmptyLabel: boolean;
|
|
4151
4097
|
isInternal: boolean;
|
|
4098
|
+
excludeFromShapeBounds: boolean;
|
|
4152
4099
|
debugColor?: string;
|
|
4153
4100
|
ignore?: boolean;
|
|
4154
4101
|
constructor(opts: Geometry2dOptions);
|
|
@@ -4172,12 +4119,14 @@ export declare abstract class Geometry2d {
|
|
|
4172
4119
|
* along the edge it is as a fraction of the total length.
|
|
4173
4120
|
*/
|
|
4174
4121
|
uninterpolateAlongEdge(point: VecLike, _filters?: Geometry2dFilters): number;
|
|
4175
|
-
/** @deprecated Iterate the vertices instead. */
|
|
4176
|
-
nearestPointOnLineSegment(A: VecLike, B: VecLike): Vec;
|
|
4177
4122
|
isPointInBounds(point: VecLike, margin?: number): boolean;
|
|
4123
|
+
overlapsPolygon(_polygon: VecLike[]): boolean;
|
|
4178
4124
|
transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
|
|
4179
4125
|
private _vertices;
|
|
4180
4126
|
get vertices(): Vec[];
|
|
4127
|
+
getBoundsVertices(): Vec[];
|
|
4128
|
+
private _boundsVertices;
|
|
4129
|
+
get boundsVertices(): Vec[];
|
|
4181
4130
|
getBounds(): Box;
|
|
4182
4131
|
private _bounds;
|
|
4183
4132
|
get bounds(): Box;
|
|
@@ -4374,6 +4323,7 @@ export declare class Group2d extends Geometry2d {
|
|
|
4374
4323
|
hitTestLineSegment(A: VecLike, B: VecLike, zoom: number, filters?: Geometry2dFilters): boolean;
|
|
4375
4324
|
intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
|
|
4376
4325
|
intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
|
|
4326
|
+
getBoundsVertices(): Vec[];
|
|
4377
4327
|
intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
|
|
4378
4328
|
intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
|
|
4379
4329
|
interpolateAlongEdge(t: number, filters?: Geometry2dFilters): Vec;
|
|
@@ -4383,6 +4333,7 @@ export declare class Group2d extends Geometry2d {
|
|
|
4383
4333
|
toSimpleSvgPath(): string;
|
|
4384
4334
|
getLength(filters?: Geometry2dFilters): number;
|
|
4385
4335
|
getSvgPathData(): string;
|
|
4336
|
+
overlapsPolygon(polygon: VecLike[]): boolean;
|
|
4386
4337
|
}
|
|
4387
4338
|
|
|
4388
4339
|
/** @public */
|
|
@@ -4623,12 +4574,16 @@ export declare function kickoutOccludedShapes(editor: Editor, shapeIds: TLShapeI
|
|
|
4623
4574
|
filter?(parent: TLShape): boolean;
|
|
4624
4575
|
}): void;
|
|
4625
4576
|
|
|
4577
|
+
/* Excluded from this release type: LICENSE_TIMEOUT */
|
|
4578
|
+
|
|
4626
4579
|
/* Excluded from this release type: LicenseFromKeyResult */
|
|
4627
4580
|
|
|
4628
4581
|
/* Excluded from this release type: LicenseInfo */
|
|
4629
4582
|
|
|
4630
4583
|
/* Excluded from this release type: LicenseManager */
|
|
4631
4584
|
|
|
4585
|
+
/* Excluded from this release type: LicenseState */
|
|
4586
|
+
|
|
4632
4587
|
/** @public */
|
|
4633
4588
|
export declare function linesIntersect(A: VecLike, B: VecLike, C: VecLike, D: VecLike): boolean;
|
|
4634
4589
|
|
|
@@ -4661,6 +4616,23 @@ export declare function loadSnapshot(store: TLStore, _snapshot: Partial<TLEditor
|
|
|
4661
4616
|
/** @public */
|
|
4662
4617
|
export declare function loopToHtmlElement(elm: Element): HTMLElement;
|
|
4663
4618
|
|
|
4619
|
+
/**
|
|
4620
|
+
* In tldraw, events are sometimes handled by multiple components. For example, the shapes might
|
|
4621
|
+
* have events, but the canvas handles events too. The way that the canvas handles events can
|
|
4622
|
+
* interfere with the with the shapes event handlers - for example, it calls `.preventDefault()` on
|
|
4623
|
+
* `pointerDown`, which also prevents `click` events from firing on the shapes.
|
|
4624
|
+
*
|
|
4625
|
+
* You can use `.stopPropagation()` to prevent the event from propagating to the rest of the DOM,
|
|
4626
|
+
* but that can impact non-tldraw event handlers set up elsewhere. By using `markEventAsHandled`,
|
|
4627
|
+
* you'll stop other parts of tldraw from handling the event without impacting other, non-tldraw
|
|
4628
|
+
* event handlers. See also {@link wasEventAlreadyHandled}.
|
|
4629
|
+
*
|
|
4630
|
+
* @public
|
|
4631
|
+
*/
|
|
4632
|
+
export declare function markEventAsHandled(e: {
|
|
4633
|
+
nativeEvent: Event;
|
|
4634
|
+
} | Event): void;
|
|
4635
|
+
|
|
4664
4636
|
/** @public */
|
|
4665
4637
|
export declare class Mat {
|
|
4666
4638
|
constructor(a: number, b: number, c: number, d: number, e: number, f: number);
|
|
@@ -5079,7 +5051,7 @@ export declare function setRuntimeOverrides(input: Partial<typeof runtime>): voi
|
|
|
5079
5051
|
export declare function setUserPreferences(user: TLUserPreferences): void;
|
|
5080
5052
|
|
|
5081
5053
|
/** @public */
|
|
5082
|
-
export declare abstract class ShapeUtil<Shape extends
|
|
5054
|
+
export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
5083
5055
|
editor: Editor;
|
|
5084
5056
|
/** Configure this shape utils {@link ShapeUtil.options | `options`}. */
|
|
5085
5057
|
static configure<T extends TLShapeUtilConstructor<any, any>>(this: T, options: T extends new (...args: any[]) => {
|
|
@@ -5234,7 +5206,34 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5234
5206
|
* @public
|
|
5235
5207
|
*/
|
|
5236
5208
|
canBeLaidOut(_shape: Shape, _info: TLShapeUtilCanBeLaidOutOpts): boolean;
|
|
5209
|
+
/**
|
|
5210
|
+
* Whether this shape can be culled. By default, shapes are culled for
|
|
5211
|
+
* performance reasons when they are outside of the viewport. Culled shapes are still rendered
|
|
5212
|
+
* to the DOM, but have their `display` property set to `none`.
|
|
5213
|
+
*
|
|
5214
|
+
* @param shape - The shape.
|
|
5215
|
+
*/
|
|
5216
|
+
canCull(_shape: Shape): boolean;
|
|
5237
5217
|
/* Excluded from this release type: providesBackgroundForChildren */
|
|
5218
|
+
/**
|
|
5219
|
+
* Get the clip path to apply to this shape's children.
|
|
5220
|
+
*
|
|
5221
|
+
* @param shape - The shape to get the clip path for
|
|
5222
|
+
* @returns Array of points defining the clipping polygon in local coordinates, or undefined if no clipping
|
|
5223
|
+
* @public
|
|
5224
|
+
*/
|
|
5225
|
+
getClipPath?(shape: Shape): undefined | Vec[];
|
|
5226
|
+
/**
|
|
5227
|
+
* Whether a specific child shape should be clipped by this shape.
|
|
5228
|
+
* Only called if getClipPath returns a valid polygon.
|
|
5229
|
+
*
|
|
5230
|
+
* If not defined, the default behavior is to clip all children.
|
|
5231
|
+
*
|
|
5232
|
+
* @param child - The child shape to check
|
|
5233
|
+
* @returns boolean indicating if this child should be clipped
|
|
5234
|
+
* @public
|
|
5235
|
+
*/
|
|
5236
|
+
shouldClipChild?(child: TLShape): boolean;
|
|
5238
5237
|
/**
|
|
5239
5238
|
* Whether the shape should hide its resize handles when selected.
|
|
5240
5239
|
*
|
|
@@ -5265,6 +5264,17 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5265
5264
|
* @public
|
|
5266
5265
|
*/
|
|
5267
5266
|
isAspectRatioLocked(_shape: Shape): boolean;
|
|
5267
|
+
/**
|
|
5268
|
+
* By default, the bounds of an image export are the bounds of all the shapes it contains, plus
|
|
5269
|
+
* some padding. If an export includes a shape where `isExportBoundsContainer` is true, then the
|
|
5270
|
+
* padding is skipped _if the bounds of that shape contains all the other shapes_. This is
|
|
5271
|
+
* useful in cases like annotating on top of an image, where you usually want to avoid extra
|
|
5272
|
+
* padding around the image if you don't need it.
|
|
5273
|
+
*
|
|
5274
|
+
* @param _shape - The shape to check
|
|
5275
|
+
* @returns True if this shape should be treated as an export bounds container
|
|
5276
|
+
*/
|
|
5277
|
+
isExportBoundsContainer(_shape: Shape): boolean;
|
|
5268
5278
|
/* Excluded from this release type: backgroundComponent */
|
|
5269
5279
|
/**
|
|
5270
5280
|
* Get the interpolated props for an animating shape. This is an optional method.
|
|
@@ -5820,7 +5830,14 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
|
|
|
5820
5830
|
onExit?(info: any, to: string): void;
|
|
5821
5831
|
}
|
|
5822
5832
|
|
|
5823
|
-
/**
|
|
5833
|
+
/**
|
|
5834
|
+
* Calls `event.stopPropagation()`.
|
|
5835
|
+
*
|
|
5836
|
+
* @deprecated Use {@link markEventAsHandled} instead, or manually call `event.stopPropagation()` if
|
|
5837
|
+
* that's what you really want.
|
|
5838
|
+
*
|
|
5839
|
+
* @public
|
|
5840
|
+
*/
|
|
5824
5841
|
export declare const stopEventPropagation: (e: any) => any;
|
|
5825
5842
|
|
|
5826
5843
|
/* Excluded from this release type: StoreName */
|
|
@@ -5952,9 +5969,11 @@ export declare type TLAnyBindingUtilConstructor = TLBindingUtilConstructor<any>;
|
|
|
5952
5969
|
export declare type TLAnyShapeUtilConstructor = TLShapeUtilConstructor<any>;
|
|
5953
5970
|
|
|
5954
5971
|
/** @public */
|
|
5955
|
-
export declare type TLBaseBoxShape =
|
|
5956
|
-
|
|
5957
|
-
|
|
5972
|
+
export declare type TLBaseBoxShape = Extract<TLShape, {
|
|
5973
|
+
props: {
|
|
5974
|
+
h: number;
|
|
5975
|
+
w: number;
|
|
5976
|
+
};
|
|
5958
5977
|
}>;
|
|
5959
5978
|
|
|
5960
5979
|
/** @public */
|
|
@@ -6311,12 +6330,6 @@ export declare interface TldrawEditorBaseProps {
|
|
|
6311
6330
|
* Options for syncing the editor's camera state with the URL.
|
|
6312
6331
|
*/
|
|
6313
6332
|
deepLinks?: TLDeepLinkOptions | true;
|
|
6314
|
-
/**
|
|
6315
|
-
* Predicate for whether or not a shape should be hidden.
|
|
6316
|
-
*
|
|
6317
|
-
* @deprecated Use {@link TldrawEditorBaseProps#getShapeVisibility} instead.
|
|
6318
|
-
*/
|
|
6319
|
-
isShapeHidden?(shape: TLShape, editor: Editor): boolean;
|
|
6320
6333
|
/**
|
|
6321
6334
|
* Provides a way to hide shapes.
|
|
6322
6335
|
*
|
|
@@ -6578,15 +6591,6 @@ export declare interface TLEditorOptions {
|
|
|
6578
6591
|
fontAssetUrls?: {
|
|
6579
6592
|
[key: string]: string | undefined;
|
|
6580
6593
|
};
|
|
6581
|
-
/**
|
|
6582
|
-
* A predicate that should return true if the given shape should be hidden.
|
|
6583
|
-
*
|
|
6584
|
-
* @deprecated Use {@link Editor#getShapeVisibility} instead.
|
|
6585
|
-
*
|
|
6586
|
-
* @param shape - The shape to check.
|
|
6587
|
-
* @param editor - The editor instance.
|
|
6588
|
-
*/
|
|
6589
|
-
isShapeHidden?(shape: TLShape, editor: Editor): boolean;
|
|
6590
6594
|
/**
|
|
6591
6595
|
* Provides a way to hide shapes.
|
|
6592
6596
|
*
|
|
@@ -7423,11 +7427,11 @@ export declare interface TLShapeUtilCanBeLaidOutOpts {
|
|
|
7423
7427
|
*
|
|
7424
7428
|
* @public
|
|
7425
7429
|
*/
|
|
7426
|
-
export declare interface TLShapeUtilCanBindOpts<Shape extends
|
|
7430
|
+
export declare interface TLShapeUtilCanBindOpts<Shape extends TLShape = TLShape> {
|
|
7427
7431
|
/** The type of shape referenced by the `fromId` of the binding. */
|
|
7428
|
-
fromShapeType:
|
|
7432
|
+
fromShapeType: TLShape['type'];
|
|
7429
7433
|
/** The type of shape referenced by the `toId` of the binding. */
|
|
7430
|
-
toShapeType:
|
|
7434
|
+
toShapeType: TLShape['type'];
|
|
7431
7435
|
/** The type of binding. */
|
|
7432
7436
|
bindingType: string;
|
|
7433
7437
|
}
|
|
@@ -7439,7 +7443,7 @@ export declare interface TLShapeUtilCanvasSvgDef {
|
|
|
7439
7443
|
}
|
|
7440
7444
|
|
|
7441
7445
|
/** @public */
|
|
7442
|
-
export declare interface TLShapeUtilConstructor<T extends
|
|
7446
|
+
export declare interface TLShapeUtilConstructor<T extends TLShape, U extends ShapeUtil<T> = ShapeUtil<T>> {
|
|
7443
7447
|
new (editor: Editor): U;
|
|
7444
7448
|
type: T['type'];
|
|
7445
7449
|
props?: RecordProps<T>;
|
|
@@ -7577,12 +7581,6 @@ export declare interface TLSvgExportOptions {
|
|
|
7577
7581
|
preserveAspectRatio?: React.SVGAttributes<SVGSVGElement>['preserveAspectRatio'];
|
|
7578
7582
|
}
|
|
7579
7583
|
|
|
7580
|
-
/**
|
|
7581
|
-
* @public
|
|
7582
|
-
* @deprecated use {@link TLImageExportOptions} instead
|
|
7583
|
-
*/
|
|
7584
|
-
export declare type TLSvgOptions = TLImageExportOptions;
|
|
7585
|
-
|
|
7586
7584
|
/** @public */
|
|
7587
7585
|
export declare interface TLSvgTextExternalContent extends TLBaseExternalContent {
|
|
7588
7586
|
type: 'svg-text';
|
|
@@ -7736,6 +7734,7 @@ export declare class TransformedGeometry2d extends Geometry2d {
|
|
|
7736
7734
|
private readonly decomposed;
|
|
7737
7735
|
constructor(geometry: Geometry2d, matrix: MatModel, opts?: TransformedGeometry2dOptions);
|
|
7738
7736
|
getVertices(filters: Geometry2dFilters): Vec[];
|
|
7737
|
+
getBoundsVertices(): Vec[];
|
|
7739
7738
|
nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;
|
|
7740
7739
|
hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean;
|
|
7741
7740
|
distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number;
|
|
@@ -7756,6 +7755,7 @@ export declare interface TransformedGeometry2dOptions {
|
|
|
7756
7755
|
isInternal?: boolean;
|
|
7757
7756
|
debugColor?: string;
|
|
7758
7757
|
ignore?: boolean;
|
|
7758
|
+
excludeFromShapeBounds?: boolean;
|
|
7759
7759
|
}
|
|
7760
7760
|
|
|
7761
7761
|
/** @public */
|
|
@@ -7990,8 +7990,6 @@ export declare class Vec {
|
|
|
7990
7990
|
lrp(B: VecLike, t: number): Vec;
|
|
7991
7991
|
equals(B: VecLike): boolean;
|
|
7992
7992
|
equalsXY(x: number, y: number): boolean;
|
|
7993
|
-
/** @deprecated use `uni` instead */
|
|
7994
|
-
norm(): this;
|
|
7995
7993
|
toFixed(): this;
|
|
7996
7994
|
toString(): string;
|
|
7997
7995
|
toJson(): VecModel;
|
|
@@ -8113,6 +8111,15 @@ export declare class Vec {
|
|
|
8113
8111
|
/** @public */
|
|
8114
8112
|
export declare type VecLike = Vec | VecModel;
|
|
8115
8113
|
|
|
8114
|
+
/**
|
|
8115
|
+
* Checks if an event has already been handled. See {@link markEventAsHandled}.
|
|
8116
|
+
*
|
|
8117
|
+
* @public
|
|
8118
|
+
*/
|
|
8119
|
+
export declare function wasEventAlreadyHandled(e: {
|
|
8120
|
+
nativeEvent: Event;
|
|
8121
|
+
} | Event): boolean;
|
|
8122
|
+
|
|
8116
8123
|
|
|
8117
8124
|
export * from "@tldraw/state";
|
|
8118
8125
|
export * from "@tldraw/state-react";
|
package/dist-cjs/index.js
CHANGED
|
@@ -70,6 +70,7 @@ __export(index_exports, {
|
|
|
70
70
|
HTMLContainer: () => import_HTMLContainer.HTMLContainer,
|
|
71
71
|
HandleSnaps: () => import_HandleSnaps.HandleSnaps,
|
|
72
72
|
HistoryManager: () => import_HistoryManager.HistoryManager,
|
|
73
|
+
LICENSE_TIMEOUT: () => import_LicenseProvider.LICENSE_TIMEOUT,
|
|
73
74
|
LicenseManager: () => import_LicenseManager.LicenseManager,
|
|
74
75
|
LoadingScreen: () => import_TldrawEditor.LoadingScreen,
|
|
75
76
|
LocalIndexedDb: () => import_LocalIndexedDb.LocalIndexedDb,
|
|
@@ -121,7 +122,6 @@ __export(index_exports, {
|
|
|
121
122
|
createTLStore: () => import_createTLStore.createTLStore,
|
|
122
123
|
createTLUser: () => import_createTLUser.createTLUser,
|
|
123
124
|
dataUrlToFile: () => import_assets.dataUrlToFile,
|
|
124
|
-
debugEnableLicensing: () => debugEnableLicensing,
|
|
125
125
|
debugFlags: () => import_debug_flags.debugFlags,
|
|
126
126
|
defaultTldrawOptions: () => import_options.defaultTldrawOptions,
|
|
127
127
|
defaultUserPreferences: () => import_TLUserPreferences.defaultUserPreferences,
|
|
@@ -166,6 +166,7 @@ __export(index_exports, {
|
|
|
166
166
|
loadSessionStateSnapshotIntoStore: () => import_TLSessionStateSnapshot.loadSessionStateSnapshotIntoStore,
|
|
167
167
|
loadSnapshot: () => import_TLEditorSnapshot.loadSnapshot,
|
|
168
168
|
loopToHtmlElement: () => import_dom.loopToHtmlElement,
|
|
169
|
+
markEventAsHandled: () => import_dom.markEventAsHandled,
|
|
169
170
|
maybeSnapToGrid: () => import_Pointing.maybeSnapToGrid,
|
|
170
171
|
normalizeWheel: () => import_normalizeWheel.normalizeWheel,
|
|
171
172
|
openWindow: () => import_window_open.openWindow,
|
|
@@ -229,7 +230,8 @@ __export(index_exports, {
|
|
|
229
230
|
useTransform: () => import_useTransform.useTransform,
|
|
230
231
|
useUniqueSafeId: () => import_useSafeId.useUniqueSafeId,
|
|
231
232
|
useViewportHeight: () => import_useViewportHeight.useViewportHeight,
|
|
232
|
-
userTypeValidator: () => import_TLUserPreferences.userTypeValidator
|
|
233
|
+
userTypeValidator: () => import_TLUserPreferences.userTypeValidator,
|
|
234
|
+
wasEventAlreadyHandled: () => import_dom.wasEventAlreadyHandled
|
|
233
235
|
});
|
|
234
236
|
module.exports = __toCommonJS(index_exports);
|
|
235
237
|
var import_utils = require("@tldraw/utils");
|
|
@@ -322,6 +324,7 @@ var import_useTLStore = require("./lib/hooks/useTLStore");
|
|
|
322
324
|
var import_useTransform = require("./lib/hooks/useTransform");
|
|
323
325
|
var import_useViewportHeight = require("./lib/hooks/useViewportHeight");
|
|
324
326
|
var import_LicenseManager = require("./lib/license/LicenseManager");
|
|
327
|
+
var import_LicenseProvider = require("./lib/license/LicenseProvider");
|
|
325
328
|
var import_options = require("./lib/options");
|
|
326
329
|
var import_Box = require("./lib/primitives/Box");
|
|
327
330
|
var import_easings = require("./lib/primitives/easings");
|
|
@@ -366,12 +369,9 @@ var import_hardReset = require("./lib/utils/sync/hardReset");
|
|
|
366
369
|
var import_LocalIndexedDb = require("./lib/utils/sync/LocalIndexedDb");
|
|
367
370
|
var import_uniq = require("./lib/utils/uniq");
|
|
368
371
|
var import_window_open = require("./lib/utils/window-open");
|
|
369
|
-
function debugEnableLicensing() {
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
372
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
373
373
|
"@tldraw/editor",
|
|
374
|
-
"3.16.0-internal.
|
|
374
|
+
"3.16.0-internal.71f83a8a571b",
|
|
375
375
|
"cjs"
|
|
376
376
|
);
|
|
377
377
|
//# sourceMappingURL=index.js.map
|