From be9bde3b508cf59f7eceaca85f26ea661634347b Mon Sep 17 00:00:00 2001
From: jon-dez <48642222+jon-dez@users.noreply.github.com>
Date: Mon, 18 Nov 2024 21:29:56 -0500
Subject: [PATCH] Update tldraw package to 3.4.1
---
manifest.json | 2 +-
package-lock.json | 97 +-
package.json | 2 +-
patches/@tldraw+editor+3.2.0.patch | 31218 ---------------------------
patches/@tldraw+editor+3.4.1.patch | 174 +
patches/tldraw+3.2.0.patch | 760 -
patches/tldraw+3.4.1.patch | 503 +
src/utils/constants.ts | 2 +-
8 files changed, 729 insertions(+), 32029 deletions(-)
delete mode 100644 patches/@tldraw+editor+3.2.0.patch
create mode 100644 patches/@tldraw+editor+3.4.1.patch
delete mode 100644 patches/tldraw+3.2.0.patch
create mode 100644 patches/tldraw+3.4.1.patch
diff --git a/manifest.json b/manifest.json
index c2504b6..a1a4b06 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
{
"id": "tldraw",
"name": "Tldraw",
- "version": "1.14.1",
+ "version": "1.15.0",
"minAppVersion": "0.15.0",
"description": "Integrates Tldraw into Obsidian, allowing users to draw and edit content on a virtual whiteboard.",
"author": "Sam Alhaqab",
diff --git a/package-lock.json b/package-lock.json
index 7c09671..965a432 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,7 +13,7 @@
"patch-package": "^8.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
- "tldraw": "^3.2.0",
+ "tldraw": "^3.4.1",
"use-debounce": "^9.0.4",
"zustand": "^4.3.9"
},
@@ -2008,23 +2008,24 @@
"integrity": "sha512-A9+lCBZoaMJlVKcRBz2YByCG+Cp2t6nAnMnNba+XiWxnj6r4JUFqfsgwocMBZU9LPtdxC6wB56ySYpc7LQIoJg=="
},
"node_modules/@tldraw/editor": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/@tldraw/editor/-/editor-3.2.0.tgz",
- "integrity": "sha512-2HAIAh4qw7g5varnnxzJVyVjS4AzcbzY8ZegqFETQxBxxprGrxRXKf+kYxhA4ac5XAyAt5UV52b+qQ6tvpKHuw==",
- "dependencies": {
- "@tldraw/state": "3.2.0",
- "@tldraw/state-react": "3.2.0",
- "@tldraw/store": "3.2.0",
- "@tldraw/tlschema": "3.2.0",
- "@tldraw/utils": "3.2.0",
- "@tldraw/validate": "3.2.0",
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/@tldraw/editor/-/editor-3.4.1.tgz",
+ "integrity": "sha512-LYa02QbwVgCrNmW79jDxijaYjly/TqvuMm8BwIlHwAU9sId8mkkqzICFqZbfc8YIWTDFQppQtQjVlRZR/0YWkQ==",
+ "dependencies": {
+ "@tldraw/state": "3.4.1",
+ "@tldraw/state-react": "3.4.1",
+ "@tldraw/store": "3.4.1",
+ "@tldraw/tlschema": "3.4.1",
+ "@tldraw/utils": "3.4.1",
+ "@tldraw/validate": "3.4.1",
"@types/core-js": "^2.5.5",
"@use-gesture/react": "^10.2.27",
"classnames": "^2.3.2",
"core-js": "^3.31.1",
"eventemitter3": "^4.0.7",
"idb": "^7.1.1",
- "is-plain-object": "^5.0.0"
+ "is-plain-object": "^5.0.0",
+ "lodash.isequal": "^4.5.0"
},
"peerDependencies": {
"react": "^18.2.0",
@@ -2032,20 +2033,20 @@
}
},
"node_modules/@tldraw/state": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/@tldraw/state/-/state-3.2.0.tgz",
- "integrity": "sha512-JGXkrmbq+ffyEVsstvxljEhubTxDDVoXU+xk/wlsD0/ug/UMxynGyIkfUmsn18rc8l6aM14SeThg1knKB2K/uQ==",
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/@tldraw/state/-/state-3.4.1.tgz",
+ "integrity": "sha512-IviSzQcSgG/dtyDNyIhhuLhmAQSjUf7B/ou99q3Rd//x1Z6FsAxWM4r64Egp62LWpEmUUaFBJMFt8BXHewBHVg==",
"dependencies": {
- "@tldraw/utils": "3.2.0"
+ "@tldraw/utils": "3.4.1"
}
},
"node_modules/@tldraw/state-react": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/@tldraw/state-react/-/state-react-3.2.0.tgz",
- "integrity": "sha512-OTc8J9G8+8R/1MhaBkEM9PGt6g9QRD1ExGiL7+bZiNkz3mGMvgKTBjcUKkVE8JT9bd1myQDWI4MHmFSXWD17+w==",
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/@tldraw/state-react/-/state-react-3.4.1.tgz",
+ "integrity": "sha512-w1qUpejI4zmfshnb8RBfCbMrHD6rUQ1HXEpPHfSz4Jd5QqYW6Tlhm0nSCap0iUjRWQf4N6DvKzPcv53MI+KbTA==",
"dependencies": {
- "@tldraw/state": "3.2.0",
- "@tldraw/utils": "3.2.0"
+ "@tldraw/state": "3.4.1",
+ "@tldraw/utils": "3.4.1"
},
"peerDependencies": {
"react": "^18.2.0",
@@ -2053,12 +2054,12 @@
}
},
"node_modules/@tldraw/store": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/@tldraw/store/-/store-3.2.0.tgz",
- "integrity": "sha512-kS66jGzZw28qARnWqGoj446Wzrxhzh6tq+YZakXNmO5FxegghstpGLkitoFkOlpSPUqAIqlvbiy6S2RjzuB43A==",
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/@tldraw/store/-/store-3.4.1.tgz",
+ "integrity": "sha512-Jaq/6Nh8HOkH/GtJXlN7y1QSvcrO9+OkVrrJ6zeKZ5ESuJPu8lFVI6rGvt9fkLyKuNv7/lTH6nNNeY/Rek9LZg==",
"dependencies": {
- "@tldraw/state": "3.2.0",
- "@tldraw/utils": "3.2.0",
+ "@tldraw/state": "3.4.1",
+ "@tldraw/utils": "3.4.1",
"lodash.isequal": "^4.5.0"
},
"peerDependencies": {
@@ -2066,23 +2067,23 @@
}
},
"node_modules/@tldraw/tlschema": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/@tldraw/tlschema/-/tlschema-3.2.0.tgz",
- "integrity": "sha512-cG+EiuFRk074KW4RDLQNHPn3PU8sVjwmx9kthl58fkVYEssqHPxnFUcz1EOFGs7HvSXMRXJD3758CVtKB4WZug==",
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/@tldraw/tlschema/-/tlschema-3.4.1.tgz",
+ "integrity": "sha512-OE2GaK3UbtvPpIuPKuuLEp1wZdTgyEazYS16Whb84yi7670wh79qpNjC8701c79qXyxjmx8o8PN8bLkFh4hV2w==",
"dependencies": {
- "@tldraw/state": "3.2.0",
- "@tldraw/store": "3.2.0",
- "@tldraw/utils": "3.2.0",
- "@tldraw/validate": "3.2.0"
+ "@tldraw/state": "3.4.1",
+ "@tldraw/store": "3.4.1",
+ "@tldraw/utils": "3.4.1",
+ "@tldraw/validate": "3.4.1"
},
"peerDependencies": {
"react": "^18.2.0"
}
},
"node_modules/@tldraw/utils": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/@tldraw/utils/-/utils-3.2.0.tgz",
- "integrity": "sha512-YXDFYfN0zIFDi+zq8UUQizFqBIvl072hKX4c04K0jDn6K7Ox9G9tmMwbA3RyFHvzfHYGV8IEY/pLEjHCH/SRoQ==",
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/@tldraw/utils/-/utils-3.4.1.tgz",
+ "integrity": "sha512-9xulZB3jNwzV8yKVABEQ1iFV9uG4rqZblVeEX3EOZUF81/neZxsKxqPpYj3ExRurAtAxvJ12MVFSiMah7HNkZA==",
"dependencies": {
"fractional-indexing-jittered": "^0.9.1",
"lodash.throttle": "^4.1.1",
@@ -2090,11 +2091,11 @@
}
},
"node_modules/@tldraw/validate": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/@tldraw/validate/-/validate-3.2.0.tgz",
- "integrity": "sha512-UFt5P5kiAYoL6bX+pq2WGxfMj+ntBpLEmZhIjAa9kscAF5rDKVFrWl5BRn7Dy39+mx/+DEy/348kxgu/55lA6Q==",
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/@tldraw/validate/-/validate-3.4.1.tgz",
+ "integrity": "sha512-W2yOYnhi30EPOkBWKWNh0Bo44qbZ3DVkD4fI7YAFMKM/bjTYAuwK1o4TQYQ3QVRGkfngAcrG7xz3V/0IZRt6dA==",
"dependencies": {
- "@tldraw/utils": "3.2.0"
+ "@tldraw/utils": "3.4.1"
}
},
"node_modules/@types/codemirror": {
@@ -2601,9 +2602,9 @@
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
"node_modules/core-js": {
- "version": "3.38.1",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.38.1.tgz",
- "integrity": "sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw==",
+ "version": "3.39.0",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.39.0.tgz",
+ "integrity": "sha512-raM0ew0/jJUqkJ0E6e8UDtl+y/7ktFivgWvqw8dNSQeNWoSDLvQ1H/RN3aPXB9tBd4/FhyR4RDPGhsNIMsAn7g==",
"hasInstallScript": true,
"funding": {
"type": "opencollective",
@@ -4005,9 +4006,9 @@
"peer": true
},
"node_modules/tldraw": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/tldraw/-/tldraw-3.2.0.tgz",
- "integrity": "sha512-bu5vByx5g6JtBht7cYvOiv42W5uFcNCr8lCZxqIgORMCkg8EoWxDnxbkah2ZNJzG+cOkm/0G9JJlDfdKyaLy0A==",
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/tldraw/-/tldraw-3.4.1.tgz",
+ "integrity": "sha512-V8oMcNqNx+aI7TG/oVeBL2RyH+wB66sfjqegW/a+Vx4PrvANsQqz/adU/WckBWqaU6JctpN/N5V14yXBnrKh7A==",
"dependencies": {
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-context-menu": "^2.1.5",
@@ -4017,8 +4018,8 @@
"@radix-ui/react-select": "^1.2.0",
"@radix-ui/react-slider": "^1.1.0",
"@radix-ui/react-toast": "^1.1.1",
- "@tldraw/editor": "3.2.0",
- "@tldraw/store": "3.2.0",
+ "@tldraw/editor": "3.4.1",
+ "@tldraw/store": "3.4.1",
"canvas-size": "^1.2.6",
"classnames": "^2.3.2",
"hotkeys-js": "^3.11.2",
diff --git a/package.json b/package.json
index a380086..1bfeead 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
"patch-package": "^8.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
- "tldraw": "^3.2.0",
+ "tldraw": "^3.4.1",
"use-debounce": "^9.0.4",
"zustand": "^4.3.9"
}
diff --git a/patches/@tldraw+editor+3.2.0.patch b/patches/@tldraw+editor+3.2.0.patch
deleted file mode 100644
index ad3936b..0000000
--- a/patches/@tldraw+editor+3.2.0.patch
+++ /dev/null
@@ -1,31218 +0,0 @@
-diff --git a/node_modules/@tldraw/editor/dist-cjs/dist-esm/index.d.mts b/node_modules/@tldraw/editor/dist-cjs/dist-esm/index.d.mts
-new file mode 100644
-index 0000000..d6747f5
---- /dev/null
-+++ b/node_modules/@tldraw/editor/dist-cjs/dist-esm/index.d.mts
-@@ -0,0 +1,6877 @@
-+///
-+
-+import { Atom } from '@tldraw/state';
-+import { atom } from '@tldraw/state';
-+import { BoxModel } from '@tldraw/tlschema';
-+import { ComponentType } from 'react';
-+import { Computed } from '@tldraw/state';
-+import { computed } from '@tldraw/state';
-+import { Dispatch } from 'react';
-+import { EffectScheduler } from '@tldraw/state';
-+import { EMPTY_ARRAY } from '@tldraw/state';
-+import EventEmitter from 'eventemitter3';
-+import { HistoryEntry } from '@tldraw/store';
-+import { IndexKey } from '@tldraw/utils';
-+import { JsonObject } from '@tldraw/utils';
-+import { JSX as JSX_2 } from 'react/jsx-runtime';
-+import { LegacyMigrations } from '@tldraw/store';
-+import { MigrationSequence } from '@tldraw/store';
-+import { NamedExoticComponent } from 'react';
-+import { PerformanceTracker } from '@tldraw/utils';
-+import { PointerEventHandler } from 'react';
-+import { react } from '@tldraw/state';
-+import { default as React_2 } from 'react';
-+import * as React_3 from 'react';
-+import { ReactElement } from 'react';
-+import { ReactNode } from 'react';
-+import { RecordProps } from '@tldraw/tlschema';
-+import { RecordsDiff } from '@tldraw/store';
-+import { SerializedSchema } from '@tldraw/store';
-+import { SerializedStore } from '@tldraw/store';
-+import { SetStateAction } from 'react';
-+import { Signal } from '@tldraw/state';
-+import { Store } from '@tldraw/store';
-+import { StoreSchema } from '@tldraw/store';
-+import { StoreSideEffects } from '@tldraw/store';
-+import { StyleProp } from '@tldraw/tlschema';
-+import { StylePropValue } from '@tldraw/tlschema';
-+import { Timers } from '@tldraw/utils';
-+import { TLAsset } from '@tldraw/tlschema';
-+import { TLAssetId } from '@tldraw/tlschema';
-+import { TLAssetPartial } from '@tldraw/tlschema';
-+import { TLAssetStore } from '@tldraw/tlschema';
-+import { TLBaseShape } from '@tldraw/tlschema';
-+import { TLBinding } from '@tldraw/tlschema';
-+import { TLBindingCreate } from '@tldraw/tlschema';
-+import { TLBindingId } from '@tldraw/tlschema';
-+import { TLBindingUpdate } from '@tldraw/tlschema';
-+import { TLBookmarkAsset } from '@tldraw/tlschema';
-+import { TLCamera } from '@tldraw/tlschema';
-+import { TLCursor } from '@tldraw/tlschema';
-+import { TLCursorType } from '@tldraw/tlschema';
-+import { TLDefaultDashStyle } from '@tldraw/tlschema';
-+import { TLDefaultHorizontalAlignStyle } from '@tldraw/tlschema';
-+import { TLDocument } from '@tldraw/tlschema';
-+import { TLGroupShape } from '@tldraw/tlschema';
-+import { TLHandle } from '@tldraw/tlschema';
-+import { TLImageAsset } from '@tldraw/tlschema';
-+import { TLInstance } from '@tldraw/tlschema';
-+import { TLInstancePageState } from '@tldraw/tlschema';
-+import { TLInstancePresence } from '@tldraw/tlschema';
-+import { TLPage } from '@tldraw/tlschema';
-+import { TLPageId } from '@tldraw/tlschema';
-+import { TLParentId } from '@tldraw/tlschema';
-+import { TLPropsMigrations } from '@tldraw/tlschema';
-+import { TLRecord } from '@tldraw/tlschema';
-+import { TLScribble } from '@tldraw/tlschema';
-+import { TLShape } from '@tldraw/tlschema';
-+import { TLShapeId } from '@tldraw/tlschema';
-+import { TLShapePartial } from '@tldraw/tlschema';
-+import { TLStore } from '@tldraw/tlschema';
-+import { TLStoreProps } from '@tldraw/tlschema';
-+import { TLStoreSnapshot } from '@tldraw/tlschema';
-+import { TLUnknownBinding } from '@tldraw/tlschema';
-+import { TLUnknownShape } from '@tldraw/tlschema';
-+import { TLVideoAsset } from '@tldraw/tlschema';
-+import { track } from '@tldraw/state-react';
-+import { transact } from '@tldraw/state';
-+import { transaction } from '@tldraw/state';
-+import { UnknownRecord } from '@tldraw/store';
-+import { useAtom } from '@tldraw/state-react';
-+import { useComputed } from '@tldraw/state-react';
-+import { useQuickReactor } from '@tldraw/state-react';
-+import { useReactor } from '@tldraw/state-react';
-+import { useStateTracking } from '@tldraw/state-react';
-+import { useValue } from '@tldraw/state-react';
-+import { VecModel } from '@tldraw/tlschema';
-+import { whyAmIRunning } from '@tldraw/state';
-+
-+/**
-+ * Get the angle of a point on an arc.
-+ * @param fromAngle - The angle from center to arc's start point (A) on the circle
-+ * @param toAngle - The angle from center to arc's end point (B) on the circle
-+ * @param direction - The direction of the arc (1 = counter-clockwise, -1 = clockwise)
-+ * @returns The distance in radians between the two angles according to the direction
-+ * @public
-+ */
-+export declare function angleDistance(fromAngle: number, toAngle: number, direction: number): number;
-+
-+/* Excluded from this release type: applyRotationToSnapshotShapes */
-+
-+/**
-+ * Whether two numbers numbers a and b are approximately equal.
-+ *
-+ * @param a - The first point.
-+ * @param b - The second point.
-+ * @public
-+ */
-+export declare function approximately(a: number, b: number, precision?: number): boolean;
-+
-+/** @public */
-+export declare class Arc2d extends Geometry2d {
-+ _center: Vec;
-+ radius: number;
-+ start: Vec;
-+ end: Vec;
-+ largeArcFlag: number;
-+ sweepFlag: number;
-+ measure: number;
-+ angleStart: number;
-+ angleEnd: number;
-+ constructor(config: Omit & {
-+ center: Vec;
-+ end: Vec;
-+ largeArcFlag: number;
-+ start: Vec;
-+ sweepFlag: number;
-+ });
-+ nearestPoint(point: Vec): Vec;
-+ hitTestLineSegment(A: Vec, B: Vec): boolean;
-+ getVertices(): Vec[];
-+ getSvgPathData(first?: boolean): string;
-+ getLength(): number;
-+}
-+
-+/**
-+ * Checks whether two angles are approximately at right-angles or parallel to each other
-+ *
-+ * @param a - Angle a (radians)
-+ * @param b - Angle b (radians)
-+ * @returns True iff the angles are approximately at right-angles or parallel to each other
-+ * @public
-+ */
-+export declare function areAnglesCompatible(a: number, b: number): boolean;
-+
-+export { Atom }
-+
-+export { atom }
-+
-+/** @public */
-+export declare function average(A: VecLike, B: VecLike): string;
-+
-+/** @public */
-+export declare abstract class BaseBoxShapeTool extends StateNode {
-+ static id: string;
-+ static initial: string;
-+ static children(): TLStateNodeConstructor[];
-+ abstract shapeType: string;
-+ onCreate?(_shape: null | TLShape): null | void;
-+}
-+
-+/** @public */
-+export declare abstract class BaseBoxShapeUtil extends ShapeUtil {
-+ getGeometry(shape: Shape): Geometry2d;
-+ onResize(shape: any, info: TLResizeInfo): any;
-+ getHandleSnapGeometry(shape: Shape): HandleSnapGeometry;
-+ getInterpolatedProps(startShape: Shape, endShape: Shape, t: number): Shape['props'];
-+}
-+
-+/**
-+ * Options passed to {@link BindingUtil.onBeforeChange} and {@link BindingUtil.onAfterChange},
-+ * describing the data associated with a binding being changed.
-+ *
-+ * @public
-+ */
-+export declare interface BindingOnChangeOptions {
-+ /** The binding record before the change is made. */
-+ bindingBefore: Binding;
-+ /** The binding record after the change is made. */
-+ bindingAfter: Binding;
-+}
-+
-+/**
-+ * Options passed to {@link BindingUtil.onBeforeCreate} and {@link BindingUtil.onAfterCreate},
-+ * describing a the creating a binding.
-+ *
-+ * @public
-+ */
-+export declare interface BindingOnCreateOptions {
-+ /** The binding being created. */
-+ binding: Binding;
-+}
-+
-+/**
-+ * Options passed to {@link BindingUtil.onBeforeDelete} and {@link BindingUtil.onAfterDelete},
-+ * describing a binding being deleted.
-+ *
-+ * @public
-+ */
-+export declare interface BindingOnDeleteOptions {
-+ /** The binding being deleted. */
-+ binding: Binding;
-+}
-+
-+/**
-+ * Options passed to {@link BindingUtil.onAfterChangeFromShape} and
-+ * {@link BindingUtil.onAfterChangeToShape}, describing a bound shape being changed.
-+ *
-+ * @public
-+ */
-+export declare interface BindingOnShapeChangeOptions {
-+ /** The binding record linking these two shapes. */
-+ binding: Binding;
-+ /** The shape record before the change is made. */
-+ shapeBefore: TLShape;
-+ /** The shape record after the change is made. */
-+ shapeAfter: TLShape;
-+}
-+
-+/**
-+ * Options passed to {@link BindingUtil.onBeforeDeleteFromShape} and
-+ * {@link BindingUtil.onBeforeDeleteToShape}, describing a bound shape that is about to be deleted.
-+ *
-+ * See {@link BindingOnShapeIsolateOptions} for discussion on when to use the delete vs. the isolate
-+ * callbacks.
-+ *
-+ * @public
-+ */
-+export declare interface BindingOnShapeDeleteOptions {
-+ /** The binding record that refers to the shape in question. */
-+ binding: Binding;
-+ /** The shape that is about to be deleted. */
-+ shape: TLShape;
-+}
-+
-+/**
-+ * Options passed to {@link BindingUtil.onBeforeIsolateFromShape} and
-+ * {@link BindingUtil.onBeforeIsolateToShape}, describing a shape that is about to be isolated from
-+ * the one that it's bound to.
-+ *
-+ * Isolation happens whenever two bound shapes are separated. For example
-+ * 1. One is deleted, but the other is not.
-+ * 1. One is copied, but the other is not.
-+ * 1. One is duplicated, but the other is not.
-+ *
-+ * In each of these cases, if the remaining shape depends on the binding for its rendering, it may
-+ * now be in an inconsistent state. For example, tldraw's arrow shape depends on the binding to know
-+ * where the end of the arrow is. If we removed the binding without doing anything else, the arrow
-+ * would suddenly be pointing to the wrong location. Instead, when the shape the arrow is pointing
-+ * to is deleted, or the arrow is copied/duplicated, we use an isolation callback. The callback
-+ * updates the arrow based on the binding that's about to be removed, so it doesn't end up pointing
-+ * to the wrong place.
-+ *
-+ * For this style of consistency update, use isolation callbacks. For actions specific to deletion
-+ * (like deleting a sticker when the shape it's bound to is removed), use the delete callbacks
-+ * ({@link BindingUtil.onBeforeDeleteFromShape} and {@link BindingUtil.onBeforeDeleteToShape})
-+ * instead.
-+ *
-+ * @public
-+ */
-+export declare interface BindingOnShapeIsolateOptions {
-+ /** The binding record that refers to the shape in question. */
-+ binding: Binding;
-+ /**
-+ * The shape being removed. For deletion, this is the deleted shape. For copy/duplicate, this is
-+ * the shape that _isn't_ being copied/duplicated and is getting left behind.
-+ */
-+ removedShape: TLShape;
-+}
-+
-+/** @public */
-+export declare abstract class BindingUtil {
-+ editor: Editor;
-+ constructor(editor: Editor);
-+ static props?: RecordProps;
-+ static migrations?: TLPropsMigrations;
-+ /**
-+ * The type of the binding util, which should match the binding's type.
-+ *
-+ * @public
-+ */
-+ static type: string;
-+ /**
-+ * Get the default props for a binding.
-+ *
-+ * @public
-+ */
-+ abstract getDefaultProps(): Partial;
-+ /**
-+ * Called whenever a store operation involving this binding type has completed. This is useful
-+ * for working with networks of related bindings that may need to update together.
-+ *
-+ * @example
-+ * ```ts
-+ * class MyBindingUtil extends BindingUtil {
-+ * changedBindingIds = new Set()
-+ *
-+ * onOperationComplete() {
-+ * doSomethingWithChangedBindings(this.changedBindingIds)
-+ * this.changedBindingIds.clear()
-+ * }
-+ *
-+ * onAfterChange({ bindingAfter }: BindingOnChangeOptions) {
-+ * this.changedBindingIds.add(bindingAfter.id)
-+ * }
-+ * }
-+ * ```
-+ *
-+ * @public
-+ */
-+ onOperationComplete?(): void;
-+ /**
-+ * Called when a binding is about to be created. See {@link BindingOnCreateOptions} for details.
-+ *
-+ * You can optionally return a new binding to replace the one being created - for example, to
-+ * set different initial props.
-+ *
-+ * @public
-+ */
-+ onBeforeCreate?(options: BindingOnCreateOptions): Binding | void;
-+ /**
-+ * Called after a binding has been created. See {@link BindingOnCreateOptions} for details.
-+ *
-+ * @public
-+ */
-+ onAfterCreate?(options: BindingOnCreateOptions): void;
-+ /**
-+ * Called when a binding is about to be changed. See {@link BindingOnChangeOptions} for details.
-+ *
-+ * Note that this only fires when the binding record is changing, not when the shapes
-+ * associated change. Use {@link BindingUtil.onAfterChangeFromShape} and
-+ * {@link BindingUtil.onAfterChangeToShape} for that.
-+ *
-+ * You can optionally return a new binding to replace the one being changed - for example, to
-+ * enforce constraints on the binding's props.
-+ *
-+ * @public
-+ */
-+ onBeforeChange?(options: BindingOnChangeOptions): Binding | void;
-+ /**
-+ * Called after a binding has been changed. See {@link BindingOnChangeOptions} for details.
-+ *
-+ * Note that this only fires when the binding record is changing, not when the shapes
-+ * associated change. Use {@link BindingUtil.onAfterChangeFromShape} and
-+ * {@link BindingUtil.onAfterChangeToShape} for that.
-+ *
-+ * @public
-+ */
-+ onAfterChange?(options: BindingOnChangeOptions): void;
-+ /**
-+ * Called when a binding is about to be deleted. See {@link BindingOnDeleteOptions} for details.
-+ *
-+ * @public
-+ */
-+ onBeforeDelete?(options: BindingOnDeleteOptions): void;
-+ /**
-+ * Called after a binding has been deleted. See {@link BindingOnDeleteOptions} for details.
-+ *
-+ * @public
-+ */
-+ onAfterDelete?(options: BindingOnDeleteOptions): void;
-+ /**
-+ * Called after the shape referenced in a binding's `fromId` is changed. Use this to propagate
-+ * any changes to the binding itself or the other shape as needed. See
-+ * {@link BindingOnShapeChangeOptions} for details.
-+ *
-+ * @public
-+ */
-+ onAfterChangeFromShape?(options: BindingOnShapeChangeOptions): void;
-+ /**
-+ * Called after the shape referenced in a binding's `toId` is changed. Use this to propagate any
-+ * changes to the binding itself or the other shape as needed. See
-+ * {@link BindingOnShapeChangeOptions} for details.
-+ *
-+ * @public
-+ */
-+ onAfterChangeToShape?(options: BindingOnShapeChangeOptions): void;
-+ /**
-+ * Called before the shape referenced in a binding's `fromId` is about to be deleted. Use this
-+ * with care - you may want to use {@link BindingUtil.onBeforeIsolateToShape} instead. See
-+ * {@link BindingOnShapeDeleteOptions} for details.
-+ *
-+ * @public
-+ */
-+ onBeforeDeleteFromShape?(options: BindingOnShapeDeleteOptions): void;
-+ /**
-+ * Called before the shape referenced in a binding's `toId` is about to be deleted. Use this
-+ * with care - you may want to use {@link BindingUtil.onBeforeIsolateFromShape} instead. See
-+ * {@link BindingOnShapeDeleteOptions} for details.
-+ *
-+ * @public
-+ */
-+ onBeforeDeleteToShape?(options: BindingOnShapeDeleteOptions): void;
-+ /**
-+ * Called before the shape referenced in a binding's `fromId` is about to be isolated from the
-+ * shape referenced in `toId`. See {@link BindingOnShapeIsolateOptions} for discussion on what
-+ * isolation means, and when/how to use this callback.
-+ */
-+ onBeforeIsolateFromShape?(options: BindingOnShapeIsolateOptions): void;
-+ /**
-+ * Called before the shape referenced in a binding's `toId` is about to be isolated from the
-+ * shape referenced in `fromId`. See {@link BindingOnShapeIsolateOptions} for discussion on what
-+ * isolation means, and when/how to use this callback.
-+ */
-+ onBeforeIsolateToShape?(options: BindingOnShapeIsolateOptions): void;
-+}
-+
-+/**
-+ * When moving or resizing shapes, the bounds of the shape can snap to key geometry on other nearby
-+ * shapes. Customize how a shape snaps to others with {@link ShapeUtil.getBoundsSnapGeometry}.
-+ *
-+ * @public
-+ */
-+export declare interface BoundsSnapGeometry {
-+ /**
-+ * Points that this shape will snap to. By default, this will be the corners and center of the
-+ * shapes bounding box. To disable snapping to a specific point, use an empty array.
-+ */
-+ points?: VecModel[];
-+}
-+
-+/** @public */
-+export declare interface BoundsSnapPoint {
-+ id: string;
-+ x: number;
-+ y: number;
-+ handle?: SelectionCorner;
-+}
-+
-+/** @public */
-+export declare class BoundsSnaps {
-+ readonly manager: SnapManager;
-+ readonly editor: Editor;
-+ constructor(manager: SnapManager);
-+ private getSnapPointsCache;
-+ getSnapPoints(shapeId: TLShapeId): BoundsSnapPoint[];
-+ private getSnappablePoints;
-+ private getSnappableGapNodes;
-+ private getVisibleGaps;
-+ snapTranslateShapes({ lockedAxis, initialSelectionPageBounds, initialSelectionSnapPoints, dragDelta, }: {
-+ dragDelta: Vec;
-+ initialSelectionPageBounds: Box;
-+ initialSelectionSnapPoints: BoundsSnapPoint[];
-+ lockedAxis: 'x' | 'y' | null;
-+ }): SnapData;
-+ snapResizeShapes({ initialSelectionPageBounds, dragDelta, handle: originalHandle, isAspectRatioLocked, isResizingFromCenter, }: {
-+ dragDelta: Vec;
-+ handle: SelectionCorner | SelectionEdge;
-+ initialSelectionPageBounds: Box;
-+ isAspectRatioLocked: boolean;
-+ isResizingFromCenter: boolean;
-+ }): SnapData;
-+ private collectPointSnaps;
-+ private collectGapSnaps;
-+ private getPointSnapLines;
-+ private getGapSnapLines;
-+}
-+
-+/** @public */
-+export declare class Box {
-+ constructor(x?: number, y?: number, w?: number, h?: number);
-+ x: number;
-+ y: number;
-+ w: number;
-+ h: number;
-+ get point(): Vec;
-+ set point(val: Vec);
-+ get minX(): number;
-+ set minX(n: number);
-+ get midX(): number;
-+ get maxX(): number;
-+ get minY(): number;
-+ set minY(n: number);
-+ get midY(): number;
-+ get maxY(): number;
-+ get width(): number;
-+ set width(n: number);
-+ get height(): number;
-+ set height(n: number);
-+ get aspectRatio(): number;
-+ get center(): Vec;
-+ set center(v: Vec);
-+ get corners(): Vec[];
-+ get cornersAndCenter(): Vec[];
-+ get sides(): Array<[Vec, Vec]>;
-+ get size(): Vec;
-+ toFixed(): this;
-+ setTo(B: Box): this;
-+ set(x?: number, y?: number, w?: number, h?: number): this;
-+ expand(A: Box): this;
-+ expandBy(n: number): this;
-+ scale(n: number): this;
-+ clone(): Box;
-+ translate(delta: VecLike): this;
-+ snapToGrid(size: number): void;
-+ collides(B: Box): boolean;
-+ contains(B: Box): boolean;
-+ includes(B: Box): boolean;
-+ containsPoint(V: VecLike, margin?: number): boolean;
-+ getHandlePoint(handle: SelectionCorner | SelectionEdge): Vec;
-+ toJson(): BoxModel;
-+ resize(handle: SelectionCorner | SelectionEdge | string, dx: number, dy: number): void;
-+ union(box: BoxModel): this;
-+ static From(box: BoxModel): Box;
-+ static FromCenter(center: VecLike, size: VecLike): Box;
-+ static FromPoints(points: VecLike[]): Box;
-+ static Expand(A: Box, B: Box): Box;
-+ static ExpandBy(A: Box, n: number): Box;
-+ static Collides(A: Box, B: Box): boolean;
-+ static Contains(A: Box, B: Box): boolean;
-+ static Includes(A: Box, B: Box): boolean;
-+ static ContainsPoint(A: Box, B: VecLike, margin?: number): boolean;
-+ static Common(boxes: Box[]): Box;
-+ static Sides(A: Box, inset?: number): Vec[][];
-+ static Resize(box: Box, handle: SelectionCorner | SelectionEdge | string, dx: number, dy: number, isAspectRatioLocked?: boolean): {
-+ box: Box;
-+ scaleX: number;
-+ scaleY: number;
-+ };
-+ equals(other: Box | BoxModel): boolean;
-+ static Equals(a: Box | BoxModel, b: Box | BoxModel): boolean;
-+ zeroFix(): this;
-+ static ZeroFix(other: Box | BoxModel): Box;
-+}
-+
-+/** @public */
-+export declare type BoxLike = Box | BoxModel;
-+
-+/**
-+ * @param a - Any angle in radians
-+ * @returns A number between 0 and 2 * PI
-+ * @public
-+ */
-+export declare function canonicalizeRotation(a: number): number;
-+
-+/**
-+ * Get the center of a circle from three points.
-+ *
-+ * @param a - The first point
-+ * @param b - The second point
-+ * @param c - The third point
-+ *
-+ * @returns The center of the circle or null if the points are collinear
-+ *
-+ * @public
-+ */
-+export declare function centerOfCircleFromThreePoints(a: VecLike, b: VecLike, c: VecLike): null | Vec;
-+
-+/** @public */
-+export declare class Circle2d extends Geometry2d {
-+ config: Omit & {
-+ isFilled: boolean;
-+ radius: number;
-+ x?: number;
-+ y?: number;
-+ };
-+ _center: Vec;
-+ radius: number;
-+ x: number;
-+ y: number;
-+ constructor(config: Omit & {
-+ isFilled: boolean;
-+ radius: number;
-+ x?: number;
-+ y?: number;
-+ });
-+ getBounds(): Box;
-+ getVertices(): Vec[];
-+ nearestPoint(point: Vec): Vec;
-+ hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean;
-+ getSvgPathData(): string;
-+}
-+
-+/**
-+ * Clamp a value into a range.
-+ *
-+ * @example
-+ *
-+ * ```ts
-+ * const A = clamp(0, 1) // 1
-+ * ```
-+ *
-+ * @param n - The number to clamp.
-+ * @param min - The minimum value.
-+ * @public
-+ */
-+export declare function clamp(n: number, min: number): number;
-+
-+/**
-+ * Clamp a value into a range.
-+ *
-+ * @example
-+ *
-+ * ```ts
-+ * const A = clamp(0, 1, 10) // 1
-+ * const B = clamp(11, 1, 10) // 10
-+ * const C = clamp(5, 1, 10) // 5
-+ * ```
-+ *
-+ * @param n - The number to clamp.
-+ * @param min - The minimum value.
-+ * @param max - The maximum value.
-+ * @public
-+ */
-+export declare function clamp(n: number, min: number, max: number): number;
-+
-+/**
-+ * Clamp radians within 0 and 2PI
-+ *
-+ * @param r - The radian value.
-+ * @public
-+ */
-+export declare function clampRadians(r: number): number;
-+
-+/** @public */
-+export declare class ClickManager {
-+ editor: Editor;
-+ constructor(editor: Editor);
-+ private _clickId;
-+ private _clickTimeout?;
-+ private _clickScreenPoint?;
-+ private _previousScreenPoint?;
-+ _getClickTimeout(state: TLClickState, id?: string): void;
-+ /* Excluded from this release type: _clickState */
-+ /**
-+ * The current click state.
-+ *
-+ * @public
-+ */
-+ get clickState(): TLClickState | undefined;
-+ lastPointerInfo: TLPointerEventInfo;
-+ handlePointerEvent(info: TLPointerEventInfo): TLClickEventInfo | TLPointerEventInfo;
-+ /* Excluded from this release type: cancelDoubleClickTimeout */
-+}
-+
-+/**
-+ * Get the clockwise angle distance between two angles.
-+ *
-+ * @param a0 - The first angle.
-+ * @param a1 - The second angle.
-+ * @public
-+ */
-+export declare function clockwiseAngleDist(a0: number, a1: number): number;
-+
-+export { computed }
-+
-+/* Excluded from this release type: ContainerProvider */
-+
-+/** @public */
-+export declare const coreShapes: readonly [typeof GroupShapeUtil];
-+
-+/**
-+ * Get the counter-clockwise angle distance between two angles.
-+ *
-+ * @param a0 - The first angle.
-+ * @param a1 - The second angle.
-+ * @public
-+ */
-+export declare function counterClockwiseAngleDist(a0: number, a1: number): number;
-+
-+/**
-+ * Converts a deep link descriptor to a url-safe string
-+ *
-+ * @example
-+ * ```ts
-+ * const url = `https://example.com?d=${createDeepLinkString({ type: 'shapes', shapeIds: ['shape:1', 'shape:2'] })}`
-+ * navigator.clipboard.writeText(url)
-+ * ```
-+ *
-+ * @param deepLink - the deep link descriptor
-+ * @returns a url-safe string
-+ *
-+ * @public
-+ */
-+export declare function createDeepLinkString(deepLink: TLDeepLink): string;
-+
-+/**
-+ * Creates a signal of the instance state for a given store.
-+ * @public
-+ * @param store - The store to create the instance state snapshot signal for
-+ * @returns
-+ */
-+export declare function createSessionStateSnapshotSignal(store: TLStore): Signal;
-+
-+/**
-+ * A helper for creating a TLStore schema from either an object with shapeUtils, bindingUtils, and
-+ * migrations, or a schema.
-+ *
-+ * @param opts - Options for creating the schema.
-+ *
-+ * @public
-+ */
-+export declare function createTLSchemaFromUtils(opts: TLStoreSchemaOptions): StoreSchema;
-+
-+/**
-+ * A helper for creating a TLStore.
-+ *
-+ * @param opts - Options for creating the store.
-+ *
-+ * @public
-+ */
-+export declare function createTLStore({ initialData, defaultName, id, assets, onMount, collaboration, ...rest }?: TLStoreOptions): TLStore;
-+
-+/** @public */
-+export declare function createTLUser(opts?: {
-+ setUserPreferences?: ((userPreferences: TLUserPreferences) => void) | undefined;
-+ userPreferences?: Signal | undefined;
-+}): TLUser;
-+
-+/** @public */
-+export declare class CubicBezier2d extends Polyline2d {
-+ a: Vec;
-+ b: Vec;
-+ c: Vec;
-+ d: Vec;
-+ constructor(config: Omit & {
-+ cp1: Vec;
-+ cp2: Vec;
-+ end: Vec;
-+ start: Vec;
-+ });
-+ getVertices(): Vec[];
-+ midPoint(): Vec;
-+ nearestPoint(A: Vec): Vec;
-+ getSvgPathData(first?: boolean): string;
-+ static GetAtT(segment: CubicBezier2d, t: number): Vec;
-+ getLength(precision?: number): number;
-+}
-+
-+/** @public */
-+export declare class CubicSpline2d extends Geometry2d {
-+ points: Vec[];
-+ constructor(config: Omit & {
-+ points: Vec[];
-+ });
-+ _segments?: CubicBezier2d[];
-+ get segments(): CubicBezier2d[];
-+ getLength(): number;
-+ getVertices(): Vec[];
-+ nearestPoint(A: Vec): Vec;
-+ hitTestLineSegment(A: Vec, B: Vec): boolean;
-+ getSvgPathData(): string;
-+}
-+
-+/** @public */
-+export declare function dataUrlToFile(url: string, filename: string, mimeType: string): Promise;
-+
-+/**
-+ * @deprecated Licensing is now enabled in the tldraw SDK.
-+ * @public */
-+export declare function debugEnableLicensing(): void;
-+
-+/* Excluded from this release type: DebugFlag */
-+
-+/* Excluded from this release type: DebugFlagDef */
-+
-+/* Excluded from this release type: DebugFlagDefaults */
-+
-+/* Excluded from this release type: debugFlags */
-+
-+/* Excluded from this release type: DEFAULT_ANIMATION_OPTIONS */
-+
-+/* Excluded from this release type: DEFAULT_CAMERA_OPTIONS */
-+
-+/** @public @react */
-+export declare function DefaultBackground(): JSX_2.Element;
-+
-+/** @public @react */
-+export declare const DefaultBrush: ({ brush, color, opacity, className }: TLBrushProps) => JSX_2.Element;
-+
-+/** @public @react */
-+export declare function DefaultCanvas({ className }: TLCanvasComponentProps): JSX_2.Element;
-+
-+/** @public @react */
-+export declare function DefaultCollaboratorHint({ className, zoom, point, color, viewport, opacity, }: TLCollaboratorHintProps): JSX_2.Element;
-+
-+/** @public @react */
-+export declare const DefaultCursor: NamedExoticComponent;
-+
-+/** @public @react */
-+export declare const DefaultErrorFallback: TLErrorFallbackComponent;
-+
-+/** @public @react */
-+export declare function DefaultGrid({ x, y, z, size }: TLGridProps): JSX_2.Element;
-+
-+/** @public @react */
-+export declare function DefaultHandle({ handle, isCoarse, className, zoom }: TLHandleProps): JSX_2.Element;
-+
-+/** @public @react */
-+export declare const DefaultHandles: ({ children }: TLHandlesProps) => JSX_2.Element;
-+
-+/** @public @react */
-+export declare function DefaultScribble({ scribble, zoom, color, opacity, className }: TLScribbleProps): JSX_2.Element | null;
-+
-+/** @public @react */
-+export declare function DefaultSelectionBackground({ bounds, rotation }: TLSelectionBackgroundProps): JSX_2.Element;
-+
-+/** @public @react */
-+export declare function DefaultSelectionForeground({ bounds, rotation }: TLSelectionForegroundProps): JSX_2.Element;
-+
-+/** @public @react */
-+export declare const DefaultShapeIndicator: NamedExoticComponent;
-+
-+/** @public @react */
-+export declare const DefaultShapeIndicators: NamedExoticComponent