@tldraw/editor 4.6.0-canary.75bb66f25b8f → 4.6.0-canary.7cb931b72e36
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 +164 -18
- package/dist-cjs/index.js +5 -4
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/TldrawEditor.js +4 -2
- package/dist-cjs/lib/TldrawEditor.js.map +2 -2
- package/dist-cjs/lib/config/{createTLUser.js → createTLCurrentUser.js} +9 -9
- package/dist-cjs/lib/config/createTLCurrentUser.js.map +7 -0
- package/dist-cjs/lib/config/createTLStore.js +23 -0
- package/dist-cjs/lib/config/createTLStore.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +107 -4
- package/dist-cjs/lib/editor/Editor.js.map +3 -3
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js +4 -4
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js +10 -0
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/types/clipboard-types.js.map +1 -1
- package/dist-cjs/lib/options.js +3 -0
- package/dist-cjs/lib/options.js.map +2 -2
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js +2 -1
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +164 -18
- package/dist-esm/index.mjs +12 -5
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/TldrawEditor.mjs +4 -2
- package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
- package/dist-esm/lib/config/{createTLUser.mjs → createTLCurrentUser.mjs} +6 -6
- package/dist-esm/lib/config/createTLCurrentUser.mjs.map +7 -0
- package/dist-esm/lib/config/createTLStore.mjs +27 -1
- package/dist-esm/lib/config/createTLStore.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +109 -4
- package/dist-esm/lib/editor/Editor.mjs.map +3 -3
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs +4 -4
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +10 -0
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/options.mjs +3 -0
- package/dist-esm/lib/options.mjs.map +2 -2
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +2 -1
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +13 -0
- package/package.json +7 -7
- package/src/index.ts +12 -2
- package/src/lib/TldrawEditor.tsx +8 -6
- package/src/lib/config/{createTLUser.ts → createTLCurrentUser.ts} +6 -6
- package/src/lib/config/createTLStore.ts +35 -1
- package/src/lib/editor/Editor.ts +135 -3
- package/src/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.ts +4 -4
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +2 -2
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +2 -2
- package/src/lib/editor/shapes/ShapeUtil.ts +11 -0
- package/src/lib/editor/types/clipboard-types.ts +2 -1
- package/src/lib/options.ts +108 -0
- package/src/lib/primitives/geometry/Geometry2d.ts +2 -1
- package/src/version.ts +3 -3
- package/dist-cjs/lib/config/createTLUser.js.map +0 -7
- package/dist-esm/lib/config/createTLUser.mjs.map +0 -7
package/dist-cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Atom } from '@tldraw/state';
|
|
2
2
|
import { AtomSet } from '@tldraw/store';
|
|
3
|
+
import { Awaitable } from '@tldraw/utils';
|
|
3
4
|
import { BoxModel } from '@tldraw/tlschema';
|
|
4
5
|
import { ComponentType } from 'react';
|
|
5
6
|
import { Computed } from '@tldraw/state';
|
|
@@ -82,6 +83,8 @@ import { TLStoreSchema } from '@tldraw/tlschema';
|
|
|
82
83
|
import { TLStoreSnapshot } from '@tldraw/tlschema';
|
|
83
84
|
import { TLUnknownBinding } from '@tldraw/tlschema';
|
|
84
85
|
import { TLUnknownShape } from '@tldraw/tlschema';
|
|
86
|
+
import { TLUser } from '@tldraw/tlschema';
|
|
87
|
+
import { TLUserStore } from '@tldraw/tlschema';
|
|
85
88
|
import { TLVideoAsset } from '@tldraw/tlschema';
|
|
86
89
|
import { UnknownRecord } from '@tldraw/store';
|
|
87
90
|
import { VecModel } from '@tldraw/tlschema';
|
|
@@ -717,6 +720,12 @@ export declare function createDeepLinkString(deepLink: TLDeepLink): string;
|
|
|
717
720
|
*/
|
|
718
721
|
export declare function createSessionStateSnapshotSignal(store: TLStore): Signal<null | TLSessionStateSnapshot>;
|
|
719
722
|
|
|
723
|
+
/** @public */
|
|
724
|
+
export declare function createTLCurrentUser(opts?: {
|
|
725
|
+
setUserPreferences?: ((userPreferences: TLUserPreferences) => void) | undefined;
|
|
726
|
+
userPreferences?: Signal<TLUserPreferences, unknown> | undefined;
|
|
727
|
+
}): TLCurrentUser;
|
|
728
|
+
|
|
720
729
|
/**
|
|
721
730
|
* A helper for creating a TLStore schema from either an object with shapeUtils, bindingUtils, and
|
|
722
731
|
* migrations, or a schema.
|
|
@@ -734,13 +743,7 @@ export declare function createTLSchemaFromUtils(opts: TLStoreSchemaOptions): Sto
|
|
|
734
743
|
*
|
|
735
744
|
* @public
|
|
736
745
|
*/
|
|
737
|
-
export declare function createTLStore({ initialData, defaultName, id, assets, onMount, collaboration, ...rest }?: TLStoreOptions): TLStore;
|
|
738
|
-
|
|
739
|
-
/** @public */
|
|
740
|
-
export declare function createTLUser(opts?: {
|
|
741
|
-
setUserPreferences?: ((userPreferences: TLUserPreferences) => void) | undefined;
|
|
742
|
-
userPreferences?: Signal<TLUserPreferences, unknown> | undefined;
|
|
743
|
-
}): TLUser;
|
|
746
|
+
export declare function createTLStore({ initialData, defaultName, id, assets, users, onMount, collaboration, ...rest }?: TLStoreOptions): TLStore;
|
|
744
747
|
|
|
745
748
|
/** @public */
|
|
746
749
|
export declare class CubicBezier2d extends Polyline2d {
|
|
@@ -929,6 +932,9 @@ export declare const defaultTldrawOptions: {
|
|
|
929
932
|
readonly maxShapesPerPage: 4000;
|
|
930
933
|
readonly multiClickDurationMs: 200;
|
|
931
934
|
readonly nonce: undefined;
|
|
935
|
+
readonly onBeforeCopyToClipboard: undefined;
|
|
936
|
+
readonly onBeforePasteFromClipboard: undefined;
|
|
937
|
+
readonly onClipboardPasteRaw: undefined;
|
|
932
938
|
readonly quickZoomPreservesScreenBounds: true;
|
|
933
939
|
readonly snapThreshold: 8;
|
|
934
940
|
readonly spacebarPanning: true;
|
|
@@ -959,6 +965,9 @@ export declare const defaultUserPreferences: Readonly<{
|
|
|
959
965
|
name: "";
|
|
960
966
|
}>;
|
|
961
967
|
|
|
968
|
+
/** @public */
|
|
969
|
+
export declare const defaultUserStore: TLUserStore;
|
|
970
|
+
|
|
962
971
|
/**
|
|
963
972
|
* Convert degrees to radians.
|
|
964
973
|
*
|
|
@@ -2265,6 +2274,32 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2265
2274
|
* @public
|
|
2266
2275
|
*/
|
|
2267
2276
|
getCollaboratorsOnCurrentPage(): TLInstancePresence[];
|
|
2277
|
+
/**
|
|
2278
|
+
* Get the current user's ID for attribution purposes.
|
|
2279
|
+
* Also ensures a `user:` record exists in the store for the current user.
|
|
2280
|
+
* Returns `null` when the user store has no current user.
|
|
2281
|
+
*
|
|
2282
|
+
* @public
|
|
2283
|
+
*/
|
|
2284
|
+
getAttributionUserId(): null | string;
|
|
2285
|
+
/* Excluded from this release type: _ensureUserRecord */
|
|
2286
|
+
/**
|
|
2287
|
+
* Resolve a display name for a user ID. Asks the
|
|
2288
|
+
* {@link @tldraw/tlschema#TLUserStore} first (the app's source of truth),
|
|
2289
|
+
* falling back to the `user:` record in the store.
|
|
2290
|
+
*
|
|
2291
|
+
* @public
|
|
2292
|
+
*/
|
|
2293
|
+
getAttributionDisplayName(userId: null | string): null | string;
|
|
2294
|
+
/**
|
|
2295
|
+
* Resolve a user record by ID. Asks the
|
|
2296
|
+
* {@link @tldraw/tlschema#TLUserStore} first (the app's source of truth),
|
|
2297
|
+
* falling back to the `user:` record in the store.
|
|
2298
|
+
*
|
|
2299
|
+
* @public
|
|
2300
|
+
*/
|
|
2301
|
+
getAttributionUser(userId: null | string): null | TLUser;
|
|
2302
|
+
/* Excluded from this release type: _getReferencedUserIds */
|
|
2268
2303
|
private _isLockedOnFollowingUser;
|
|
2269
2304
|
/**
|
|
2270
2305
|
* Start viewport-following a user.
|
|
@@ -5953,6 +5988,14 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
5953
5988
|
*/
|
|
5954
5989
|
getHandleSnapGeometry(shape: Shape): HandleSnapGeometry;
|
|
5955
5990
|
getText(shape: Shape): string | undefined;
|
|
5991
|
+
/**
|
|
5992
|
+
* Return user IDs referenced in shape-specific props.
|
|
5993
|
+
* Used when copying shapes to include referenced users on the clipboard.
|
|
5994
|
+
* Override this if your shape stores user IDs in custom props.
|
|
5995
|
+
*
|
|
5996
|
+
* @public
|
|
5997
|
+
*/
|
|
5998
|
+
getReferencedUserIds(shape: Shape): string[];
|
|
5956
5999
|
getAriaDescriptor(shape: Shape): string | undefined;
|
|
5957
6000
|
/**
|
|
5958
6001
|
* A callback called just before a shape is created. This method provides a last chance to modify
|
|
@@ -6736,6 +6779,40 @@ export declare type TLCLickEventName = 'double_click' | 'quadruple_click' | 'tri
|
|
|
6736
6779
|
/** @public */
|
|
6737
6780
|
export declare type TLClickState = 'idle' | 'overflow' | 'pendingDouble' | 'pendingOverflow' | 'pendingQuadruple' | 'pendingTriple';
|
|
6738
6781
|
|
|
6782
|
+
/**
|
|
6783
|
+
* Raw clipboard paste payload, before tldraw parses clipboard contents into {@link TLExternalContent}.
|
|
6784
|
+
*
|
|
6785
|
+
* - `native-event`: from the `paste` event — `clipboardData` is available synchronously (unlike async
|
|
6786
|
+
* `navigator.clipboard.read()`).
|
|
6787
|
+
* - `clipboard-read`: from an explicit `navigator.clipboard.read()` call — only `ClipboardItem[]`
|
|
6788
|
+
* exists
|
|
6789
|
+
* (no `DataTransfer`).
|
|
6790
|
+
*
|
|
6791
|
+
* @public
|
|
6792
|
+
*/
|
|
6793
|
+
export declare type TLClipboardPasteRawInfo = {
|
|
6794
|
+
readonly clipboardData: DataTransfer | null;
|
|
6795
|
+
readonly editor: Editor;
|
|
6796
|
+
readonly event: ClipboardEvent;
|
|
6797
|
+
readonly point: undefined | VecLike;
|
|
6798
|
+
readonly source: 'native-event';
|
|
6799
|
+
} | {
|
|
6800
|
+
readonly clipboardItems: readonly ClipboardItem[];
|
|
6801
|
+
readonly editor: Editor;
|
|
6802
|
+
readonly point: undefined | VecLike;
|
|
6803
|
+
readonly source: 'clipboard-read';
|
|
6804
|
+
};
|
|
6805
|
+
|
|
6806
|
+
/**
|
|
6807
|
+
* Identifies how a clipboard write was triggered (copy vs cut, keyboard vs menu).
|
|
6808
|
+
*
|
|
6809
|
+
* @public
|
|
6810
|
+
*/
|
|
6811
|
+
export declare interface TLClipboardWriteInfo {
|
|
6812
|
+
readonly operation: 'copy' | 'cut';
|
|
6813
|
+
readonly source: 'menu' | 'native';
|
|
6814
|
+
}
|
|
6815
|
+
|
|
6739
6816
|
/** @public */
|
|
6740
6817
|
export declare interface TLCollaboratorHintProps {
|
|
6741
6818
|
userId: string;
|
|
@@ -6763,6 +6840,7 @@ export declare interface TLContent {
|
|
|
6763
6840
|
rootShapeIds: TLShapeId[];
|
|
6764
6841
|
assets: TLAsset[];
|
|
6765
6842
|
schema: SerializedSchema;
|
|
6843
|
+
users?: TLUser[];
|
|
6766
6844
|
}
|
|
6767
6845
|
|
|
6768
6846
|
/**
|
|
@@ -6784,6 +6862,12 @@ export declare interface TLCropInfo<T extends TLShape> {
|
|
|
6784
6862
|
aspectRatioLocked?: boolean;
|
|
6785
6863
|
}
|
|
6786
6864
|
|
|
6865
|
+
/** @public */
|
|
6866
|
+
export declare interface TLCurrentUser {
|
|
6867
|
+
readonly userPreferences: Signal<TLUserPreferences>;
|
|
6868
|
+
readonly setUserPreferences: (userPreferences: TLUserPreferences) => void;
|
|
6869
|
+
}
|
|
6870
|
+
|
|
6787
6871
|
/** @public */
|
|
6788
6872
|
export declare interface TLCursorProps {
|
|
6789
6873
|
userId: string;
|
|
@@ -6911,7 +6995,7 @@ export declare interface TldrawEditorBaseProps {
|
|
|
6911
6995
|
/**
|
|
6912
6996
|
* The user interacting with the editor.
|
|
6913
6997
|
*/
|
|
6914
|
-
user?:
|
|
6998
|
+
user?: TLCurrentUser;
|
|
6915
6999
|
/**
|
|
6916
7000
|
* Whether to infer dark mode from the user's OS. Defaults to false.
|
|
6917
7001
|
*/
|
|
@@ -7175,6 +7259,72 @@ export declare interface TldrawOptions {
|
|
|
7175
7259
|
* viewport's page dimensions regardless of overview zoom changes.
|
|
7176
7260
|
*/
|
|
7177
7261
|
readonly quickZoomPreservesScreenBounds: boolean;
|
|
7262
|
+
/**
|
|
7263
|
+
* Called before content is written to the clipboard during a copy or cut operation.
|
|
7264
|
+
* Receives the serialized content (shapes, bindings, assets) and can filter or transform
|
|
7265
|
+
* it before it reaches the clipboard.
|
|
7266
|
+
*
|
|
7267
|
+
* Return a modified `TLContent` object to change what is copied or cut. Return `false` to
|
|
7268
|
+
* cancel the clipboard write (for cut, the selected shapes are not removed). Return `void`
|
|
7269
|
+
* (or `undefined`) to pass through unchanged. You may return a `Promise` of those values if
|
|
7270
|
+
* the hook is async.
|
|
7271
|
+
*
|
|
7272
|
+
* @example
|
|
7273
|
+
* ```tsx
|
|
7274
|
+
* // Filter out "locked" shapes from copy
|
|
7275
|
+
* onBeforeCopyToClipboard({ content, operation }) {
|
|
7276
|
+
* return {
|
|
7277
|
+
* ...content,
|
|
7278
|
+
* shapes: content.shapes.filter(s => !s.meta.locked),
|
|
7279
|
+
* rootShapeIds: content.rootShapeIds.filter(id =>
|
|
7280
|
+
* content.shapes.find(s => s.id === id && !s.meta.locked)
|
|
7281
|
+
* ),
|
|
7282
|
+
* }
|
|
7283
|
+
* }
|
|
7284
|
+
* ```
|
|
7285
|
+
*/
|
|
7286
|
+
onBeforeCopyToClipboard?(info: {
|
|
7287
|
+
content: TLContent;
|
|
7288
|
+
editor: Editor;
|
|
7289
|
+
} & TLClipboardWriteInfo): Awaitable<false | TLContent | void>;
|
|
7290
|
+
/**
|
|
7291
|
+
* Called before pasted content is processed and shapes are created. Receives the parsed
|
|
7292
|
+
* external content from the clipboard and can filter, transform, or cancel it.
|
|
7293
|
+
*
|
|
7294
|
+
* Return `false` to cancel the paste. Return a modified content object to transform it.
|
|
7295
|
+
* Return `void` (or `undefined`) to pass through unchanged. You may return a `Promise` of
|
|
7296
|
+
* those values if the hook is async.
|
|
7297
|
+
*
|
|
7298
|
+
* This only fires for clipboard paste operations (keyboard shortcuts and menu actions),
|
|
7299
|
+
* not for file drops or programmatic `putExternalContent` calls.
|
|
7300
|
+
*
|
|
7301
|
+
* @example
|
|
7302
|
+
* ```tsx
|
|
7303
|
+
* // Block pasting of image files
|
|
7304
|
+
* onBeforePasteFromClipboard({ content }) {
|
|
7305
|
+
* if (content.type === 'files') {
|
|
7306
|
+
* const nonImages = content.files.filter(f => !f.type.startsWith('image/'))
|
|
7307
|
+
* if (nonImages.length === 0) return false
|
|
7308
|
+
* return { ...content, files: nonImages }
|
|
7309
|
+
* }
|
|
7310
|
+
* }
|
|
7311
|
+
* ```
|
|
7312
|
+
*/
|
|
7313
|
+
onBeforePasteFromClipboard?(info: {
|
|
7314
|
+
content: TLExternalContent<unknown>;
|
|
7315
|
+
editor: Editor;
|
|
7316
|
+
point?: VecLike;
|
|
7317
|
+
source: 'clipboard-read' | 'native-event';
|
|
7318
|
+
}): Awaitable<false | TLExternalContent<unknown> | void>;
|
|
7319
|
+
/**
|
|
7320
|
+
* Called first for keyboard and menu paste, **before** tldraw handles or parses clipboard data
|
|
7321
|
+
* (and before {@link TldrawOptions.onBeforePasteFromClipboard}).
|
|
7322
|
+
*
|
|
7323
|
+
* Return `false` to cancel tldraw's default paste handling for this gesture (same convention as
|
|
7324
|
+
* {@link TldrawOptions.onBeforePasteFromClipboard}). Use this when you handle paste yourself from
|
|
7325
|
+
* raw clipboard data, or to block the gesture entirely. Return `void` (or `undefined`) to continue.
|
|
7326
|
+
*/
|
|
7327
|
+
onClipboardPasteRaw?(info: TLClipboardPasteRawInfo): false | void;
|
|
7178
7328
|
/**
|
|
7179
7329
|
* Called when content is dropped on the canvas. Provides the page position
|
|
7180
7330
|
* where the drop occurred and the underlying drag event object.
|
|
@@ -7253,7 +7403,7 @@ export declare interface TLEditorOptions {
|
|
|
7253
7403
|
/**
|
|
7254
7404
|
* A user defined externally to replace the default user.
|
|
7255
7405
|
*/
|
|
7256
|
-
user?:
|
|
7406
|
+
user?: TLCurrentUser;
|
|
7257
7407
|
/**
|
|
7258
7408
|
* The editor's initial active tool (or other state node id).
|
|
7259
7409
|
*/
|
|
@@ -8233,6 +8383,8 @@ export declare interface TLStoreBaseOptions {
|
|
|
8233
8383
|
defaultName?: string;
|
|
8234
8384
|
/** How should this store upload & resolve assets? */
|
|
8235
8385
|
assets?: TLAssetStore;
|
|
8386
|
+
/** How should this store resolve users for attribution? */
|
|
8387
|
+
users?: TLUserStore;
|
|
8236
8388
|
/** Called when the store is connected to an {@link @tldraw/editor#Editor}. */
|
|
8237
8389
|
onMount?(editor: Editor): (() => void) | void;
|
|
8238
8390
|
}
|
|
@@ -8420,12 +8572,6 @@ export declare interface TLUrlExternalContent extends TLBaseExternalContent {
|
|
|
8420
8572
|
url: string;
|
|
8421
8573
|
}
|
|
8422
8574
|
|
|
8423
|
-
/** @public */
|
|
8424
|
-
export declare interface TLUser {
|
|
8425
|
-
readonly userPreferences: Signal<TLUserPreferences>;
|
|
8426
|
-
readonly setUserPreferences: (userPreferences: TLUserPreferences) => void;
|
|
8427
|
-
}
|
|
8428
|
-
|
|
8429
8575
|
/**
|
|
8430
8576
|
* A user of tldraw
|
|
8431
8577
|
*
|
|
@@ -8608,7 +8754,7 @@ export declare class UserPreferencesManager {
|
|
|
8608
8754
|
systemColorScheme: Atom<"dark" | "light", unknown>;
|
|
8609
8755
|
disposables: Set<() => void>;
|
|
8610
8756
|
dispose(): void;
|
|
8611
|
-
constructor(user:
|
|
8757
|
+
constructor(user: TLCurrentUser, inferDarkMode: boolean);
|
|
8612
8758
|
updateUserPreferences(userPreferences: Partial<TLUserPreferences>): void;
|
|
8613
8759
|
getUserPreferences(): {
|
|
8614
8760
|
animationSpeed: number;
|
|
@@ -8679,10 +8825,10 @@ export declare function useSvgExportContext(): null | SvgExportContext;
|
|
|
8679
8825
|
/**
|
|
8680
8826
|
* @public
|
|
8681
8827
|
*/
|
|
8682
|
-
export declare function
|
|
8828
|
+
export declare function useTldrawCurrentUser(opts: {
|
|
8683
8829
|
setUserPreferences?: (userPreferences: TLUserPreferences) => void;
|
|
8684
8830
|
userPreferences?: Signal<TLUserPreferences> | TLUserPreferences;
|
|
8685
|
-
}):
|
|
8831
|
+
}): TLCurrentUser;
|
|
8686
8832
|
|
|
8687
8833
|
/** @public */
|
|
8688
8834
|
export declare function useTLSchemaFromUtils(opts: TLStoreSchemaOptions): StoreSchema<TLRecord, TLStoreProps>;
|
package/dist-cjs/index.js
CHANGED
|
@@ -122,13 +122,14 @@ __export(index_exports, {
|
|
|
122
122
|
createDebugValue: () => import_debug_flags.createDebugValue,
|
|
123
123
|
createDeepLinkString: () => import_deepLinks.createDeepLinkString,
|
|
124
124
|
createSessionStateSnapshotSignal: () => import_TLSessionStateSnapshot.createSessionStateSnapshotSignal,
|
|
125
|
+
createTLCurrentUser: () => import_createTLCurrentUser.createTLCurrentUser,
|
|
125
126
|
createTLSchemaFromUtils: () => import_createTLStore.createTLSchemaFromUtils,
|
|
126
127
|
createTLStore: () => import_createTLStore.createTLStore,
|
|
127
|
-
createTLUser: () => import_createTLUser.createTLUser,
|
|
128
128
|
dataUrlToFile: () => import_assets.dataUrlToFile,
|
|
129
129
|
debugFlags: () => import_debug_flags.debugFlags,
|
|
130
130
|
defaultTldrawOptions: () => import_options.defaultTldrawOptions,
|
|
131
131
|
defaultUserPreferences: () => import_TLUserPreferences.defaultUserPreferences,
|
|
132
|
+
defaultUserStore: () => import_createTLStore.defaultUserStore,
|
|
132
133
|
degreesToRadians: () => import_utils2.degreesToRadians,
|
|
133
134
|
elementShouldCaptureKeys: () => import_dom.elementShouldCaptureKeys,
|
|
134
135
|
extractSessionStateFromLegacySnapshot: () => import_TLSessionStateSnapshot.extractSessionStateFromLegacySnapshot,
|
|
@@ -235,7 +236,7 @@ __export(index_exports, {
|
|
|
235
236
|
useSvgExportContext: () => import_SvgExportContext.useSvgExportContext,
|
|
236
237
|
useTLSchemaFromUtils: () => import_useTLStore.useTLSchemaFromUtils,
|
|
237
238
|
useTLStore: () => import_useTLStore.useTLStore,
|
|
238
|
-
|
|
239
|
+
useTldrawCurrentUser: () => import_createTLCurrentUser.useTldrawCurrentUser,
|
|
239
240
|
useTransform: () => import_useTransform.useTransform,
|
|
240
241
|
useUniqueSafeId: () => import_useSafeId.useUniqueSafeId,
|
|
241
242
|
useViewportHeight: () => import_useViewportHeight.useViewportHeight,
|
|
@@ -271,8 +272,8 @@ var import_ErrorBoundary = require("./lib/components/ErrorBoundary");
|
|
|
271
272
|
var import_HTMLContainer = require("./lib/components/HTMLContainer");
|
|
272
273
|
var import_MenuClickCapture = require("./lib/components/MenuClickCapture");
|
|
273
274
|
var import_SVGContainer = require("./lib/components/SVGContainer");
|
|
275
|
+
var import_createTLCurrentUser = require("./lib/config/createTLCurrentUser");
|
|
274
276
|
var import_createTLStore = require("./lib/config/createTLStore");
|
|
275
|
-
var import_createTLUser = require("./lib/config/createTLUser");
|
|
276
277
|
var import_defaultShapes = require("./lib/config/defaultShapes");
|
|
277
278
|
var import_TLEditorSnapshot = require("./lib/config/TLEditorSnapshot");
|
|
278
279
|
var import_TLSessionStateSnapshot = require("./lib/config/TLSessionStateSnapshot");
|
|
@@ -375,7 +376,7 @@ var import_LocalIndexedDb = require("./lib/utils/sync/LocalIndexedDb");
|
|
|
375
376
|
var import_uniq = require("./lib/utils/uniq");
|
|
376
377
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
377
378
|
"@tldraw/editor",
|
|
378
|
-
"4.6.0-canary.
|
|
379
|
+
"4.6.0-canary.7cb931b72e36",
|
|
379
380
|
"cjs"
|
|
380
381
|
);
|
|
381
382
|
//# sourceMappingURL=index.js.map
|
package/dist-cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT } from './lib/license/LicenseProvider'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\telementShouldCaptureKeys,\n\tgetGlobalDocument,\n\tgetGlobalWindow,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAG7C,0BAAc,0BAHd;AAKA,0BAAc,gCALd;AAOA,0BAAc,0BAPd;AASA,0BAAc,6BATd;AAWA,0BAAc,0BAXd;AAaA,0BAAc,6BAbd;AAeA,+BAAkC;AAClC,0BAAgD;AAChD,2BAGO;AACP,qCAGO;AACP,2BAGO;AACP,kCAGO;AACP,yBAA8C;AAC9C,2BAGO;AACP,4BAGO;AACP,6BAGO;AACP,wCAGO;AACP,wCAGO;AAEP,mCAGO;AAEP,oCAGO;AACP,iCAGO;AACP,iCAGO;AACP,4BAA+B;AAC/B,4BAA+B;AAC/B,2BAIO;AACP,2BAAuD;AACvD,8BAAiC;AACjC,0BAAqD;AACrD,
|
|
4
|
+
"sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport {\n\tcreateTLCurrentUser,\n\tuseTldrawCurrentUser,\n\ttype TLCurrentUser,\n} from './lib/config/createTLCurrentUser'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tdefaultUserStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT } from './lib/license/LicenseProvider'\nexport {\n\tdefaultTldrawOptions,\n\ttype TLClipboardPasteRawInfo,\n\ttype TLClipboardWriteInfo,\n\ttype TldrawOptions,\n} from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\telementShouldCaptureKeys,\n\tgetGlobalDocument,\n\tgetGlobalWindow,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAG7C,0BAAc,0BAHd;AAKA,0BAAc,gCALd;AAOA,0BAAc,0BAPd;AASA,0BAAc,6BATd;AAWA,0BAAc,0BAXd;AAaA,0BAAc,6BAbd;AAeA,+BAAkC;AAClC,0BAAgD;AAChD,2BAGO;AACP,qCAGO;AACP,2BAGO;AACP,kCAGO;AACP,yBAA8C;AAC9C,2BAGO;AACP,4BAGO;AACP,6BAGO;AACP,wCAGO;AACP,wCAGO;AAEP,mCAGO;AAEP,oCAGO;AACP,iCAGO;AACP,iCAGO;AACP,4BAA+B;AAC/B,4BAA+B;AAC/B,2BAIO;AACP,2BAAuD;AACvD,8BAAiC;AACjC,0BAAqD;AACrD,iCAIO;AACP,2BASO;AAEP,2BAA2D;AAC3D,8BAKO;AACP,oCAOO;AACP,+BAQO;AACP,uBAAyE;AACzE,yBASO;AACP,oBAMO;AACP,0BAAgD;AAChD,+BAAkC;AAClC,yBAIO;AACP,4BAA+B;AAC/B,2BAA8B;AAC9B,6BAIO;AACP,yBAIO;AACP,yBAAqD;AACrD,yBAMO;AACP,iCAAoC;AACpC,yBAMO;AACP,yBAA4B;AAC5B,oCAAuC;AACvC,8BAAsD;AACtD,4BAA+B;AAC/B,uBAiBO;AACP,iCAGO;AACP,uBAAiD;AACjD,0BAA6B;AAC7B,8BAAiC;AACjC,sBAAgC;AAChC,uBAAuD;AAGvD,yBAiCO;AA4CP,8BAKO;AACP,sBAAiD;AACjD,2BAA8B;AAC9B,yBAAqC;AACrC,mBAAwB;AACxB,kBAAuB;AACvB,0BAKO;AACP,uBAA0B;AAC1B,uBAMO;AACP,iCAAoC;AAEpC,sBAA2C;AAC3C,iCAAoC;AACpC,yBAAkE;AAClE,2BAA8B;AAC9B,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2CAA8C;AAC9C,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,gCAAmC;AACnC,wBAAiD;AACjD,0BAA6B;AAC7B,+BAAkC;AAClC,4BAQO;AACP,6BAAgC;AAChC,qBAKO;AACP,iBASO;AACP,qBAAwB;AACxB,mBAAsB;AACtB,sBAAyB;AACzB,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAAuB;AACvB,uBAA0B;AAC1B,gCAA6C;AAC7C,wBAMO;AACP,qBAAwB;AACxB,qBAAwB;AACxB,uBAA0B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,uBAA0B;AAC1B,uBAaO;AACP,iBAAiD;AACjD,IAAAA,gBAgCO;AACP,iBAAkC;AAClC,0BAYO;AACP,oBAAoD;AACpD,kCAAgE;AAChE,yBAOO;AACP,uBAKO;AACP,iBAWO;AACP,wBAA2B;AAC3B,gCAAmC;AACnC,4BAA+B;AAC/B,kCAAqC;AACrC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAAoE;AACpE,sBAOO;AACP,sBAIO;AACP,qBAMO;AACP,6BAIO;AACP,uBAA0B;AAC1B,4BAAsD;AAEtD,kBAAqB;AAAA,IAErB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
6
|
"names": ["import_utils"]
|
|
7
7
|
}
|
|
@@ -46,7 +46,7 @@ var import_react = __toESM(require("react"), 1);
|
|
|
46
46
|
var import_version = require("../version");
|
|
47
47
|
var import_DefaultErrorFallback = require("./components/default-components/DefaultErrorFallback");
|
|
48
48
|
var import_ErrorBoundary = require("./components/ErrorBoundary");
|
|
49
|
-
var
|
|
49
|
+
var import_createTLCurrentUser = require("./config/createTLCurrentUser");
|
|
50
50
|
var import_Editor = require("./editor/Editor");
|
|
51
51
|
var import_EditorComponentsContext = require("./hooks/EditorComponentsContext");
|
|
52
52
|
var import_useContainer = require("./hooks/useContainer");
|
|
@@ -81,7 +81,7 @@ const TldrawEditor = (0, import_react.memo)(function TldrawEditor2({
|
|
|
81
81
|
...rest
|
|
82
82
|
}) {
|
|
83
83
|
const [container, setContainer] = (0, import_react.useState)(null);
|
|
84
|
-
const user = (0, import_react.useMemo)(() => _user ?? (0,
|
|
84
|
+
const user = (0, import_react.useMemo)(() => _user ?? (0, import_createTLCurrentUser.createTLCurrentUser)(), [_user]);
|
|
85
85
|
const ErrorFallback = components?.ErrorFallback === void 0 ? import_DefaultErrorFallback.DefaultErrorFallback : components?.ErrorFallback;
|
|
86
86
|
const mergedOptions = (0, import_react.useMemo)(() => {
|
|
87
87
|
let result = _options;
|
|
@@ -139,6 +139,7 @@ function TldrawEditorWithOwnStore(props) {
|
|
|
139
139
|
sessionId,
|
|
140
140
|
user,
|
|
141
141
|
assets,
|
|
142
|
+
users,
|
|
142
143
|
migrations
|
|
143
144
|
} = props;
|
|
144
145
|
const syncedStore = (0, import_useLocalStore.useLocalStore)({
|
|
@@ -150,6 +151,7 @@ function TldrawEditorWithOwnStore(props) {
|
|
|
150
151
|
defaultName,
|
|
151
152
|
snapshot,
|
|
152
153
|
assets,
|
|
154
|
+
users,
|
|
153
155
|
migrations
|
|
154
156
|
});
|
|
155
157
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithLoadingStore, { ...props, store: syncedStore, user });
|