@tldraw/editor 5.2.0-canary.43192064d0bf → 5.2.0-canary.4609171ef62f
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/README.md +7 -1
- package/dist-cjs/index.d.ts +152 -22
- package/dist-cjs/index.js +5 -5
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/components/MenuClickCapture.js +8 -5
- package/dist-cjs/lib/components/MenuClickCapture.js.map +2 -2
- package/dist-cjs/lib/components/Shape.js +47 -1
- package/dist-cjs/lib/components/Shape.js.map +3 -3
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +1 -16
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +99 -47
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js +3 -3
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/EditorManager.js +52 -0
- package/dist-cjs/lib/editor/managers/EditorManager.js.map +7 -0
- package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js +9 -11
- package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/FontManager/FontManager.js +28 -4
- package/dist-cjs/lib/editor/managers/FontManager/FontManager.js.map +3 -3
- package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js +24 -2
- package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js +12 -5
- package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js +4 -2
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +31 -22
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TickManager/TickManager.js +4 -8
- package/dist-cjs/lib/editor/managers/TickManager/TickManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +15 -2
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +3 -0
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +2 -2
- package/dist-cjs/lib/editor/types/event-types.js.map +2 -2
- package/dist-cjs/lib/globals/environment.js +6 -1
- package/dist-cjs/lib/globals/environment.js.map +2 -2
- package/dist-cjs/lib/hooks/EditorComponentsContext.js.map +2 -2
- package/dist-cjs/lib/hooks/useCanvasEvents.js +17 -8
- package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useEditorComponents.js +0 -1
- package/dist-cjs/lib/hooks/useEditorComponents.js.map +2 -2
- package/dist-cjs/lib/hooks/usePresence.js.map +2 -2
- package/dist-cjs/lib/hooks/useScreenBounds.js +1 -0
- package/dist-cjs/lib/hooks/useScreenBounds.js.map +2 -2
- package/dist-cjs/lib/license/LicenseManager.js +5 -1
- package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
- package/dist-cjs/lib/primitives/Vec.js +3 -2
- package/dist-cjs/lib/primitives/Vec.js.map +2 -2
- package/dist-cjs/lib/utils/dom.js +12 -0
- package/dist-cjs/lib/utils/dom.js.map +2 -2
- package/dist-cjs/lib/utils/getPointerInfo.js +2 -1
- package/dist-cjs/lib/utils/getPointerInfo.js.map +2 -2
- package/dist-cjs/lib/{hooks/useTransform.js → utils/pointer.js} +17 -23
- package/dist-cjs/lib/utils/pointer.js.map +7 -0
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +152 -22
- package/dist-esm/index.mjs +8 -8
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/components/MenuClickCapture.mjs +8 -5
- package/dist-esm/lib/components/MenuClickCapture.mjs.map +2 -2
- package/dist-esm/lib/components/Shape.mjs +48 -2
- package/dist-esm/lib/components/Shape.mjs.map +3 -3
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +1 -16
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +99 -47
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs +3 -3
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/EditorManager.mjs +32 -0
- package/dist-esm/lib/editor/managers/EditorManager.mjs.map +7 -0
- package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs +9 -11
- package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs +28 -4
- package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs.map +3 -3
- package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs +24 -2
- package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs +12 -5
- package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs +4 -2
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +31 -22
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs +4 -8
- package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +15 -2
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +3 -0
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +2 -2
- package/dist-esm/lib/editor/types/event-types.mjs.map +2 -2
- package/dist-esm/lib/globals/environment.mjs +6 -1
- package/dist-esm/lib/globals/environment.mjs.map +2 -2
- package/dist-esm/lib/hooks/EditorComponentsContext.mjs.map +2 -2
- package/dist-esm/lib/hooks/useCanvasEvents.mjs +17 -8
- package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useEditorComponents.mjs +0 -1
- package/dist-esm/lib/hooks/useEditorComponents.mjs.map +2 -2
- package/dist-esm/lib/hooks/usePresence.mjs.map +2 -2
- package/dist-esm/lib/hooks/useScreenBounds.mjs +1 -0
- package/dist-esm/lib/hooks/useScreenBounds.mjs.map +2 -2
- package/dist-esm/lib/license/LicenseManager.mjs +5 -1
- package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
- package/dist-esm/lib/primitives/Vec.mjs +3 -2
- package/dist-esm/lib/primitives/Vec.mjs.map +2 -2
- package/dist-esm/lib/utils/dom.mjs +12 -0
- package/dist-esm/lib/utils/dom.mjs.map +2 -2
- package/dist-esm/lib/utils/getPointerInfo.mjs +2 -1
- package/dist-esm/lib/utils/getPointerInfo.mjs.map +2 -2
- package/dist-esm/lib/utils/pointer.mjs +17 -0
- package/dist-esm/lib/utils/pointer.mjs.map +7 -0
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +15 -3
- package/package.json +10 -7
- package/src/index.ts +3 -5
- package/src/lib/components/MenuClickCapture.tsx +8 -4
- package/src/lib/components/Shape.tsx +88 -1
- package/src/lib/components/default-components/DefaultCanvas.tsx +1 -17
- package/src/lib/editor/Editor.test.ts +36 -0
- package/src/lib/editor/Editor.ts +149 -57
- package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.test.ts +43 -16
- package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.ts +8 -5
- package/src/lib/editor/managers/EditorManager.test.ts +51 -0
- package/src/lib/editor/managers/EditorManager.ts +60 -0
- package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +2 -1
- package/src/lib/editor/managers/FocusManager/FocusManager.ts +10 -14
- package/src/lib/editor/managers/FontManager/FontManager.test.ts +24 -1
- package/src/lib/editor/managers/FontManager/FontManager.ts +46 -1
- package/src/lib/editor/managers/HistoryManager/HistoryManager.test.ts +32 -0
- package/src/lib/editor/managers/HistoryManager/HistoryManager.ts +34 -4
- package/src/lib/editor/managers/InputsManager/InputsManager.test.ts +61 -0
- package/src/lib/editor/managers/InputsManager/InputsManager.ts +13 -4
- package/src/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.ts +9 -2
- package/src/lib/editor/managers/TextManager/TextManager.test.ts +61 -1
- package/src/lib/editor/managers/TextManager/TextManager.ts +50 -21
- package/src/lib/editor/managers/TickManager/TickManager.test.ts +0 -50
- package/src/lib/editor/managers/TickManager/TickManager.ts +5 -7
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +12 -2
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +27 -2
- package/src/lib/editor/shapes/ShapeUtil.ts +42 -0
- package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +5 -0
- package/src/lib/editor/types/event-types.ts +7 -0
- package/src/lib/globals/environment.ts +7 -0
- package/src/lib/hooks/EditorComponentsContext.tsx +0 -2
- package/src/lib/hooks/useCanvasEvents.ts +24 -12
- package/src/lib/hooks/useEditorComponents.tsx +0 -1
- package/src/lib/hooks/usePresence.ts +2 -2
- package/src/lib/hooks/useScreenBounds.ts +3 -0
- package/src/lib/license/LicenseManager.test.ts +24 -16
- package/src/lib/license/LicenseManager.ts +8 -2
- package/src/lib/primitives/Vec.ts +5 -2
- package/src/lib/test/ContentElementSlot.test.tsx +201 -0
- package/src/lib/utils/dom.ts +34 -0
- package/src/lib/utils/getPointerInfo.ts +2 -1
- package/src/lib/utils/pointer.test.ts +76 -0
- package/src/lib/utils/pointer.ts +42 -0
- package/src/version.ts +3 -3
- package/dist-cjs/lib/components/default-components/DefaultSelectionBackground.js +0 -49
- package/dist-cjs/lib/components/default-components/DefaultSelectionBackground.js.map +0 -7
- package/dist-cjs/lib/hooks/useTransform.js.map +0 -7
- package/dist-esm/lib/components/default-components/DefaultSelectionBackground.mjs +0 -19
- package/dist-esm/lib/components/default-components/DefaultSelectionBackground.mjs.map +0 -7
- package/dist-esm/lib/hooks/useTransform.mjs +0 -23
- package/dist-esm/lib/hooks/useTransform.mjs.map +0 -7
- package/src/lib/components/default-components/DefaultSelectionBackground.tsx +0 -25
- package/src/lib/hooks/useTransform.ts +0 -30
package/README.md
CHANGED
|
@@ -4,6 +4,12 @@ The core editor and composable parts for tldraw. [Click here](https://tldraw.dev
|
|
|
4
4
|
|
|
5
5
|
You might be more interested in the general package [tldraw](https://github.com/tldraw/tldraw/tree/main/packages/tldraw) instead of using this package directly.
|
|
6
6
|
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
Documentation for the most recent release can be found on [tldraw.dev/docs](https://tldraw.dev/docs), including [reference docs](https://tldraw.dev/reference/editor/Editor). Our release notes can be found [here](https://tldraw.dev/releases).
|
|
10
|
+
|
|
11
|
+
For more agent-friendly docs, see our [LLMs.txt](https://tldraw.dev/llms.txt).
|
|
12
|
+
|
|
7
13
|
## License
|
|
8
14
|
|
|
9
15
|
This project is part of the tldraw SDK. It is provided under the [tldraw SDK license](https://github.com/tldraw/tldraw/blob/main/LICENSE.md).
|
|
@@ -20,7 +26,7 @@ You can find tldraw on npm [here](https://www.npmjs.com/package/@tldraw/tldraw?a
|
|
|
20
26
|
|
|
21
27
|
## Contribution
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
Found a bug? Please [submit an issue](https://github.com/tldraw/tldraw/issues/new).
|
|
24
30
|
|
|
25
31
|
## Community
|
|
26
32
|
|
package/dist-cjs/index.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ import { TLUnknownAsset } from '@tldraw/tlschema';
|
|
|
89
89
|
import { TLUnknownBinding } from '@tldraw/tlschema';
|
|
90
90
|
import { TLUnknownShape } from '@tldraw/tlschema';
|
|
91
91
|
import { TLUser } from '@tldraw/tlschema';
|
|
92
|
+
import { TLUserId } from '@tldraw/tlschema';
|
|
92
93
|
import { TLUserStore } from '@tldraw/tlschema';
|
|
93
94
|
import { TLVideoAsset } from '@tldraw/tlschema';
|
|
94
95
|
import { UnknownRecord } from '@tldraw/store';
|
|
@@ -985,9 +986,6 @@ export declare const DefaultErrorFallback: TLErrorFallbackComponent;
|
|
|
985
986
|
/** @public @react */
|
|
986
987
|
export declare function DefaultGrid({ x, y, z, size }: TLGridProps): JSX.Element;
|
|
987
988
|
|
|
988
|
-
/** @public @react */
|
|
989
|
-
export declare function DefaultSelectionBackground({ bounds, rotation }: TLSelectionBackgroundProps): JSX.Element;
|
|
990
|
-
|
|
991
989
|
/** @public @react */
|
|
992
990
|
export declare const DefaultShapeWrapper: ForwardRefExoticComponent<TLShapeWrapperProps & RefAttributes<HTMLDivElement>>;
|
|
993
991
|
|
|
@@ -1576,6 +1574,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1576
1574
|
*/
|
|
1577
1575
|
markHistoryStoppingPoint(name?: string): string;
|
|
1578
1576
|
/* Excluded from this release type: getMarkIdMatching */
|
|
1577
|
+
/* Excluded from this release type: isReplayingHistory */
|
|
1579
1578
|
/**
|
|
1580
1579
|
* Coalesces all changes since the given mark into a single change, removing any intermediate marks.
|
|
1581
1580
|
*
|
|
@@ -2456,7 +2455,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2456
2455
|
* @param opts - The camera move options.
|
|
2457
2456
|
* @public
|
|
2458
2457
|
*/
|
|
2459
|
-
zoomToUser(userId:
|
|
2458
|
+
zoomToUser(userId: TLUserId, opts?: TLCameraMoveOptions): this;
|
|
2460
2459
|
/* Excluded from this release type: _willSetInitialBounds */
|
|
2461
2460
|
/**
|
|
2462
2461
|
* Update the viewport. The viewport will measure the size and screen position of its container
|
|
@@ -2609,7 +2608,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2609
2608
|
*
|
|
2610
2609
|
* @public
|
|
2611
2610
|
*/
|
|
2612
|
-
startFollowingUser(userId:
|
|
2611
|
+
startFollowingUser(userId: TLUserId): this;
|
|
2613
2612
|
/**
|
|
2614
2613
|
* Stop viewport-following a user.
|
|
2615
2614
|
*
|
|
@@ -3720,6 +3719,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3720
3719
|
* @public
|
|
3721
3720
|
*/
|
|
3722
3721
|
resizeShape(shape: TLShape | TLShapeId, scale: VecLike, opts?: TLResizeShapeOptions): this;
|
|
3722
|
+
/* Excluded from this release type: getResizeShapePartial */
|
|
3723
3723
|
/* Excluded from this release type: _scalePagePoint */
|
|
3724
3724
|
/* Excluded from this release type: _resizeUnalignedShape */
|
|
3725
3725
|
/**
|
|
@@ -4517,6 +4517,48 @@ export declare class EditorAtom<T> {
|
|
|
4517
4517
|
/** @public */
|
|
4518
4518
|
export declare const EditorContext: React_3.Context<Editor | null>;
|
|
4519
4519
|
|
|
4520
|
+
/**
|
|
4521
|
+
* Base class for editor-attached managers that need to clean up after themselves.
|
|
4522
|
+
*
|
|
4523
|
+
* Extending `EditorManager` gives a manager one consistent teardown contract: register
|
|
4524
|
+
* anything that needs undoing, and it runs automatically on `dispose()`. This keeps
|
|
4525
|
+
* subscription lifecycle symmetric — whatever sets a thing up is what tears it down — so
|
|
4526
|
+
* it can't be forgotten (the failure mode behind the strict-mode camera bug, #8892).
|
|
4527
|
+
*
|
|
4528
|
+
* Register cleanup by what you're creating:
|
|
4529
|
+
*
|
|
4530
|
+
* - Editor bus event (`tick`, `frame`, `change`, …): {@link EditorManager.addEditorEvent}
|
|
4531
|
+
* - Store side effect (`editor.sideEffects.register…`): `this.register(disposer)`
|
|
4532
|
+
* - Reaction (`react(...)` from `@tldraw/state`): `this.register(react(...))`
|
|
4533
|
+
* - DOM listener: `this.register(() => el.removeEventListener(...))`
|
|
4534
|
+
* - Other resource (cache, index, child manager): `this.register(() => x.dispose())`
|
|
4535
|
+
*
|
|
4536
|
+
* For timeouts, intervals, and animation frames prefer `editor.timers` (context-grouped
|
|
4537
|
+
* and auto-disposed) over raw `setTimeout`. For cleanup on the editor itself rather than a
|
|
4538
|
+
* manager, use `editor.disposables`.
|
|
4539
|
+
*
|
|
4540
|
+
* If a manager needs ordered teardown (e.g. pause a loop before cancelling it), override
|
|
4541
|
+
* `dispose()` and call `super.dispose()` last — see `TickManager`.
|
|
4542
|
+
*
|
|
4543
|
+
* @public
|
|
4544
|
+
*/
|
|
4545
|
+
export declare abstract class EditorManager {
|
|
4546
|
+
protected readonly editor: Editor;
|
|
4547
|
+
protected readonly disposables: Set<() => void>;
|
|
4548
|
+
constructor(editor: Editor);
|
|
4549
|
+
/**
|
|
4550
|
+
* Register a teardown function to run on `dispose()`. The universal way for a manager to
|
|
4551
|
+
* make a resource "see itself out". Returns the same function for convenience.
|
|
4552
|
+
*/
|
|
4553
|
+
protected register(dispose: () => void): () => void;
|
|
4554
|
+
/**
|
|
4555
|
+
* Subscribe to an editor bus event and register the matching unsubscribe, so the listener
|
|
4556
|
+
* is removed automatically on `dispose()`.
|
|
4557
|
+
*/
|
|
4558
|
+
protected addEditorEvent<E extends keyof TLEventMap>(event: E, fn: (...args: TLEventMap[E]) => void): void;
|
|
4559
|
+
/* Excluded from this release type: dispose */
|
|
4560
|
+
}
|
|
4561
|
+
|
|
4520
4562
|
/** @public @react */
|
|
4521
4563
|
export declare function EditorProvider({ editor, children }: EditorProviderProps): JSX.Element;
|
|
4522
4564
|
|
|
@@ -5009,6 +5051,8 @@ export declare class HistoryManager<R extends UnknownRecord> {
|
|
|
5009
5051
|
private flushPendingDiff;
|
|
5010
5052
|
getNumUndos(): number;
|
|
5011
5053
|
getNumRedos(): number;
|
|
5054
|
+
/* Excluded from this release type: _isReplaying */
|
|
5055
|
+
/* Excluded from this release type: isReplaying */
|
|
5012
5056
|
/* Excluded from this release type: _isInBatch */
|
|
5013
5057
|
batch(fn: () => void, opts?: TLHistoryBatchOptions): this;
|
|
5014
5058
|
_undo({ pushToRedoStack, toMark }: {
|
|
@@ -5036,9 +5080,9 @@ export declare type HTMLContainerProps = React_2.HTMLAttributes<HTMLDivElement>;
|
|
|
5036
5080
|
export declare const inlineBase64AssetStore: TLAssetStore;
|
|
5037
5081
|
|
|
5038
5082
|
/** @public */
|
|
5039
|
-
export declare class InputsManager {
|
|
5040
|
-
private readonly editor;
|
|
5083
|
+
export declare class InputsManager extends EditorManager {
|
|
5041
5084
|
constructor(editor: Editor);
|
|
5085
|
+
private _onFrame;
|
|
5042
5086
|
private _originPagePoint;
|
|
5043
5087
|
/**
|
|
5044
5088
|
* The most recent pointer down's position in the current page space.
|
|
@@ -5531,6 +5575,25 @@ export declare function maybeSnapToGrid(point: Vec, editor: Editor): Vec;
|
|
|
5531
5575
|
*/
|
|
5532
5576
|
export declare function MenuClickCapture(): false | JSX.Element;
|
|
5533
5577
|
|
|
5578
|
+
/**
|
|
5579
|
+
* Move an element into a new parent, preserving its state where the platform allows it.
|
|
5580
|
+
*
|
|
5581
|
+
* Uses `Node.moveBefore` (Chromium 133+, Firefox 144+) when both the element and parent are
|
|
5582
|
+
* connected to the same document — this moves the element without resetting its state, so
|
|
5583
|
+
* iframes don't reload and media keeps playing. Otherwise (older browsers, disconnected nodes,
|
|
5584
|
+
* or a cross-document move) it falls back to `appendChild`, which moves the element but resets
|
|
5585
|
+
* its state like an iframe reload.
|
|
5586
|
+
*
|
|
5587
|
+
* This is the primitive tldraw uses to adopt `ShapeUtil.getAppOwnedElement` elements, exposed so
|
|
5588
|
+
* apps can perform symmetric state-preserving moves from `ShapeUtil.onReleaseAppOwnedElement` —
|
|
5589
|
+
* for example moving an element to an off-canvas parking lot between editor sessions.
|
|
5590
|
+
*
|
|
5591
|
+
* @param parent - The element to move `element` into, as its last child.
|
|
5592
|
+
* @param element - The element to move.
|
|
5593
|
+
* @public
|
|
5594
|
+
*/
|
|
5595
|
+
export declare function moveElementInto(parent: HTMLElement, element: HTMLElement): void;
|
|
5596
|
+
|
|
5534
5597
|
/* Excluded from this release type: normalizeWheel */
|
|
5535
5598
|
|
|
5536
5599
|
/**
|
|
@@ -6030,6 +6093,19 @@ export declare function resizeScaled(shape: TLBaseShape<any, {
|
|
|
6030
6093
|
y: number;
|
|
6031
6094
|
};
|
|
6032
6095
|
|
|
6096
|
+
/**
|
|
6097
|
+
* The whole-pixel line-height for a given font size and tldraw's unitless line-height
|
|
6098
|
+
* multiplier. tldraw's theme stores line-height as a multiplier (e.g. 1.35); resolving it
|
|
6099
|
+
* to a whole pixel keeps line spacing identical across rendering engines, which otherwise
|
|
6100
|
+
* disagree on fractional line boxes (WebKit snaps them to whole pixels, Blink keeps the
|
|
6101
|
+
* fraction) and let multi-line text drift apart. Apply it everywhere line-height is used —
|
|
6102
|
+
* measurement, on-canvas render, and export — so geometry and rendering agree.
|
|
6103
|
+
* See https://github.com/tldraw/tldraw/issues/8970.
|
|
6104
|
+
*
|
|
6105
|
+
* @public
|
|
6106
|
+
*/
|
|
6107
|
+
export declare function resolveLineHeightPx(fontSize: number, lineHeight: number): number;
|
|
6108
|
+
|
|
6033
6109
|
/**
|
|
6034
6110
|
* Resolve a partial set of user-provided themes into a complete `TLThemes`
|
|
6035
6111
|
* record by merging with `DEFAULT_THEME`. The result is suitable for passing to
|
|
@@ -6962,6 +7038,45 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
6962
7038
|
* @public
|
|
6963
7039
|
*/
|
|
6964
7040
|
onEditEnd?(shape: Shape): void;
|
|
7041
|
+
/**
|
|
7042
|
+
* Provide an app-owned element to be rendered inside the shape, alongside the output of
|
|
7043
|
+
* {@link ShapeUtil.component}. While the shape remains mounted, tldraw guarantees the
|
|
7044
|
+
* element keeps the same DOM position: it is never unmounted, recreated, or relocated by
|
|
7045
|
+
* reordering, reparenting, culling, or re-renders. When adopting the element, tldraw uses
|
|
7046
|
+
* `Node.moveBefore` where available so stateful content like cross-origin iframes keeps
|
|
7047
|
+
* its state across the move, falling back to `appendChild` elsewhere.
|
|
7048
|
+
*
|
|
7049
|
+
* Pair this with {@link ShapeUtil.onReleaseAppOwnedElement} to reclaim the element before
|
|
7050
|
+
* the shape or editor unmounts.
|
|
7051
|
+
*
|
|
7052
|
+
* This is called once per shape mount, not on every prop change, so the adopted element is
|
|
7053
|
+
* not refreshed when the shape's props change. If the element's content depends on props,
|
|
7054
|
+
* return a stable element and mutate it in place (for example from {@link ShapeUtil.component}
|
|
7055
|
+
* or an effect) rather than returning a different element.
|
|
7056
|
+
*
|
|
7057
|
+
* @param shape - The shape.
|
|
7058
|
+
* @returns The element to adopt, or null to render nothing.
|
|
7059
|
+
* @public
|
|
7060
|
+
*/
|
|
7061
|
+
getAppOwnedElement?(shape: Shape): HTMLElement | null;
|
|
7062
|
+
/**
|
|
7063
|
+
* A callback called before the shape's app-owned element slot is destroyed: when the shape
|
|
7064
|
+
* unmounts (for example when it is deleted or the current page changes) or when the whole
|
|
7065
|
+
* editor unmounts, including error teardown. The slot is still connected to the document
|
|
7066
|
+
* when this is called, so the app can move the element to another connected parent with
|
|
7067
|
+
* `Node.moveBefore` to preserve its state. An element left in the slot is destroyed along
|
|
7068
|
+
* with it.
|
|
7069
|
+
*
|
|
7070
|
+
* This is not only a "shape deleted" signal: it also fires on page changes, editor unmount,
|
|
7071
|
+
* and (in dev under React StrictMode) on the throwaway mount/unmount cycle while the shape
|
|
7072
|
+
* still exists. Make it safe to call when the shape is still present, and check the store
|
|
7073
|
+
* (`this.editor.getShape(shape.id)`) if you need to distinguish deletion from a remount.
|
|
7074
|
+
*
|
|
7075
|
+
* @param shape - The shape.
|
|
7076
|
+
* @param element - The element returned by {@link ShapeUtil.getAppOwnedElement}.
|
|
7077
|
+
* @public
|
|
7078
|
+
*/
|
|
7079
|
+
onReleaseAppOwnedElement?(shape: Shape, element: HTMLElement): void;
|
|
6965
7080
|
}
|
|
6966
7081
|
|
|
6967
7082
|
/**
|
|
@@ -7246,8 +7361,7 @@ export declare const TAB_ID: string;
|
|
|
7246
7361
|
/* Excluded from this release type: Table */
|
|
7247
7362
|
|
|
7248
7363
|
/** @public */
|
|
7249
|
-
export declare class TextManager {
|
|
7250
|
-
editor: Editor;
|
|
7364
|
+
export declare class TextManager extends EditorManager {
|
|
7251
7365
|
private elm;
|
|
7252
7366
|
private poolElms;
|
|
7253
7367
|
constructor(editor: Editor);
|
|
@@ -7255,7 +7369,6 @@ export declare class TextManager {
|
|
|
7255
7369
|
private resetElementStyles;
|
|
7256
7370
|
private setElementStyles;
|
|
7257
7371
|
private getMeasureStyles;
|
|
7258
|
-
dispose(): void;
|
|
7259
7372
|
private ensurePoolSize;
|
|
7260
7373
|
private getPoolItem;
|
|
7261
7374
|
measureHtmlBatch(requests: BatchMeasurementRequest[]): TLMeasuredTextSize[];
|
|
@@ -7622,6 +7735,7 @@ export declare interface TLCropInfo<T extends TLShape> {
|
|
|
7622
7735
|
};
|
|
7623
7736
|
initialShape: T;
|
|
7624
7737
|
aspectRatioLocked?: boolean;
|
|
7738
|
+
isResizingFromCenter?: boolean;
|
|
7625
7739
|
}
|
|
7626
7740
|
|
|
7627
7741
|
/** @public */
|
|
@@ -8135,7 +8249,6 @@ export declare interface TLEditorComponents {
|
|
|
8135
8249
|
InFrontOfTheCanvas?: ComponentType | null;
|
|
8136
8250
|
LoadingScreen?: ComponentType | null;
|
|
8137
8251
|
OnTheCanvas?: ComponentType | null;
|
|
8138
|
-
SelectionBackground?: ComponentType<TLSelectionBackgroundProps> | null;
|
|
8139
8252
|
ShapeWrapper?: ComponentType<TLShapeWrapperProps & RefAttributes<HTMLDivElement>> | null;
|
|
8140
8253
|
Spinner?: ComponentType<React.SVGProps<SVGSVGElement>> | null;
|
|
8141
8254
|
SvgDefs?: ComponentType | null;
|
|
@@ -8288,6 +8401,7 @@ export declare const tlenv: {
|
|
|
8288
8401
|
isFirefox: boolean;
|
|
8289
8402
|
isIos: boolean;
|
|
8290
8403
|
isSafari: boolean;
|
|
8404
|
+
isTouchDevice: boolean;
|
|
8291
8405
|
isWebview: boolean;
|
|
8292
8406
|
};
|
|
8293
8407
|
|
|
@@ -9003,6 +9117,13 @@ export declare type TLPointerEvent = (info: TLPointerEventInfo) => void;
|
|
|
9003
9117
|
|
|
9004
9118
|
/** @public */
|
|
9005
9119
|
export declare type TLPointerEventInfo = TLBaseEventInfo & {
|
|
9120
|
+
/**
|
|
9121
|
+
* Whether this pen event appears to be direct manipulation on the display (e.g. Apple Pencil on
|
|
9122
|
+
* an iPad or a Surface Pen on a touchscreen) rather than indirect input from a desktop graphics
|
|
9123
|
+
* tablet (e.g. a Wacom Intuos). Only direct-display pens should auto-enable pen mode. Drawing and
|
|
9124
|
+
* pressure behavior is driven by `isPen` and applies to all pens regardless of this flag.
|
|
9125
|
+
*/
|
|
9126
|
+
isPenDirect?: boolean;
|
|
9006
9127
|
button: number;
|
|
9007
9128
|
isPen: boolean;
|
|
9008
9129
|
name: TLPointerEventName;
|
|
@@ -9097,12 +9218,6 @@ export declare type TLResizeShapeOptions = Partial<{
|
|
|
9097
9218
|
|
|
9098
9219
|
/* Excluded from this release type: TLRotationSnapshot */
|
|
9099
9220
|
|
|
9100
|
-
/** @public */
|
|
9101
|
-
export declare interface TLSelectionBackgroundProps {
|
|
9102
|
-
bounds: Box;
|
|
9103
|
-
rotation: number;
|
|
9104
|
-
}
|
|
9105
|
-
|
|
9106
9221
|
/** @public */
|
|
9107
9222
|
export declare type TLSelectionHandle = RotateCorner | SelectionCorner | SelectionEdge;
|
|
9108
9223
|
|
|
@@ -9617,13 +9732,13 @@ export declare function usePassThroughWheelEvents(ref: RefObject<HTMLElement | n
|
|
|
9617
9732
|
* @returns The list of peer UserIDs
|
|
9618
9733
|
* @public
|
|
9619
9734
|
*/
|
|
9620
|
-
export declare function usePeerIds():
|
|
9735
|
+
export declare function usePeerIds(): TLUserId[];
|
|
9621
9736
|
|
|
9622
9737
|
/**
|
|
9623
9738
|
* @returns The latest presence of the user matching userId
|
|
9624
9739
|
* @public
|
|
9625
9740
|
*/
|
|
9626
|
-
export declare function usePresence(userId:
|
|
9741
|
+
export declare function usePresence(userId: TLUserId): null | TLInstancePresence;
|
|
9627
9742
|
|
|
9628
9743
|
/* Excluded from this release type: USER_COLORS */
|
|
9629
9744
|
|
|
@@ -9663,7 +9778,25 @@ export declare class UserPreferencesManager {
|
|
|
9663
9778
|
getEdgeScrollSpeed(): number;
|
|
9664
9779
|
getAnimationSpeed(): number;
|
|
9665
9780
|
getAreKeyboardShortcutsEnabled(): boolean;
|
|
9781
|
+
/**
|
|
9782
|
+
* The current user's raw, app-provided id — the value set in the user's
|
|
9783
|
+
* {@link @tldraw/editor#TLUserPreferences}. Use this when you need the id your application
|
|
9784
|
+
* assigned to the user. To compare against or look up store records, use
|
|
9785
|
+
* {@link UserPreferencesManager.getRecordId} instead.
|
|
9786
|
+
*/
|
|
9787
|
+
getExternalId(): string;
|
|
9788
|
+
/**
|
|
9789
|
+
* @deprecated Use {@link UserPreferencesManager.getExternalId} for the raw app-provided id, or
|
|
9790
|
+
* {@link UserPreferencesManager.getRecordId} for the prefixed `TLUserId` record id.
|
|
9791
|
+
*/
|
|
9666
9792
|
getId(): string;
|
|
9793
|
+
/**
|
|
9794
|
+
* The current user's id as a tldraw {@link @tldraw/tlschema#TLUserId} record id (prefixed
|
|
9795
|
+
* with `user:`). Use this when comparing against or looking up store records, such as a
|
|
9796
|
+
* presence record's `userId` or `followingUserId`. For the raw, app-provided id, use
|
|
9797
|
+
* {@link UserPreferencesManager.getExternalId}.
|
|
9798
|
+
*/
|
|
9799
|
+
getRecordId(): TLUserId;
|
|
9667
9800
|
getName(): string;
|
|
9668
9801
|
getLocale(): string;
|
|
9669
9802
|
getColor(): string;
|
|
@@ -9713,9 +9846,6 @@ export declare function useTLSchemaFromUtils(opts: TLStoreSchemaOptions): StoreS
|
|
|
9713
9846
|
/** @public */
|
|
9714
9847
|
export declare function useTLStore(opts: TLStoreOptions): TLStore;
|
|
9715
9848
|
|
|
9716
|
-
/** @public */
|
|
9717
|
-
export declare function useTransform(ref: React.RefObject<HTMLElement | null | SVGElement>, x?: number, y?: number, scale?: number, rotate?: number, additionalOffset?: VecLike): void;
|
|
9718
|
-
|
|
9719
9849
|
/**
|
|
9720
9850
|
* React's useId hook returns a unique id for the component. However, it uses a colon in the id,
|
|
9721
9851
|
* which is not valid for CSS selectors. This hook replaces the colon with an underscore.
|
package/dist-cjs/index.js
CHANGED
|
@@ -40,7 +40,6 @@ __export(index_exports, {
|
|
|
40
40
|
DefaultCanvas: () => import_DefaultCanvas.DefaultCanvas,
|
|
41
41
|
DefaultErrorFallback: () => import_DefaultErrorFallback.DefaultErrorFallback,
|
|
42
42
|
DefaultGrid: () => import_DefaultGrid.DefaultGrid,
|
|
43
|
-
DefaultSelectionBackground: () => import_DefaultSelectionBackground.DefaultSelectionBackground,
|
|
44
43
|
DefaultShapeWrapper: () => import_DefaultShapeWrapper.DefaultShapeWrapper,
|
|
45
44
|
DefaultSpinner: () => import_DefaultSpinner.DefaultSpinner,
|
|
46
45
|
DefaultSvgDefs: () => import_DefaultSvgDefs.DefaultSvgDefs,
|
|
@@ -51,6 +50,7 @@ __export(index_exports, {
|
|
|
51
50
|
Editor: () => import_Editor.Editor,
|
|
52
51
|
EditorAtom: () => import_EditorAtom.EditorAtom,
|
|
53
52
|
EditorContext: () => import_useEditor.EditorContext,
|
|
53
|
+
EditorManager: () => import_EditorManager.EditorManager,
|
|
54
54
|
EditorProvider: () => import_useEditor.EditorProvider,
|
|
55
55
|
Ellipse2d: () => import_Ellipse2d.Ellipse2d,
|
|
56
56
|
ErrorBoundary: () => import_ErrorBoundary.ErrorBoundary,
|
|
@@ -178,6 +178,7 @@ __export(index_exports, {
|
|
|
178
178
|
loadSnapshot: () => import_TLEditorSnapshot.loadSnapshot,
|
|
179
179
|
loopToHtmlElement: () => import_dom.loopToHtmlElement,
|
|
180
180
|
maybeSnapToGrid: () => import_Pointing.maybeSnapToGrid,
|
|
181
|
+
moveElementInto: () => import_dom.moveElementInto,
|
|
181
182
|
normalizeWheel: () => import_normalizeWheel.normalizeWheel,
|
|
182
183
|
openWindow: () => import_runtime.openWindow,
|
|
183
184
|
parseDeepLinkString: () => import_deepLinks.parseDeepLinkString,
|
|
@@ -193,6 +194,7 @@ __export(index_exports, {
|
|
|
193
194
|
releasePointerCapture: () => import_dom.releasePointerCapture,
|
|
194
195
|
resizeBox: () => import_resizeBox.resizeBox,
|
|
195
196
|
resizeScaled: () => import_resizeScaled.resizeScaled,
|
|
197
|
+
resolveLineHeightPx: () => import_TextManager.resolveLineHeightPx,
|
|
196
198
|
resolveThemes: () => import_ThemeManager.resolveThemes,
|
|
197
199
|
rotateSelectionHandle: () => import_Box.rotateSelectionHandle,
|
|
198
200
|
runtime: () => import_runtime.runtime,
|
|
@@ -239,7 +241,6 @@ __export(index_exports, {
|
|
|
239
241
|
useTLSchemaFromUtils: () => import_useTLStore.useTLSchemaFromUtils,
|
|
240
242
|
useTLStore: () => import_useTLStore.useTLStore,
|
|
241
243
|
useTldrawCurrentUser: () => import_createTLCurrentUser.useTldrawCurrentUser,
|
|
242
|
-
useTransform: () => import_useTransform.useTransform,
|
|
243
244
|
useUniqueSafeId: () => import_useSafeId.useUniqueSafeId,
|
|
244
245
|
useViewportHeight: () => import_useViewportHeight.useViewportHeight,
|
|
245
246
|
userTypeValidator: () => import_TLUserPreferences.userTypeValidator
|
|
@@ -256,7 +257,6 @@ var import_DefaultBackground = require("./lib/components/default-components/Defa
|
|
|
256
257
|
var import_DefaultCanvas = require("./lib/components/default-components/DefaultCanvas");
|
|
257
258
|
var import_DefaultErrorFallback = require("./lib/components/default-components/DefaultErrorFallback");
|
|
258
259
|
var import_DefaultGrid = require("./lib/components/default-components/DefaultGrid");
|
|
259
|
-
var import_DefaultSelectionBackground = require("./lib/components/default-components/DefaultSelectionBackground");
|
|
260
260
|
var import_DefaultShapeWrapper = require("./lib/components/default-components/DefaultShapeWrapper");
|
|
261
261
|
var import_DefaultSpinner = require("./lib/components/default-components/DefaultSpinner");
|
|
262
262
|
var import_DefaultSvgDefs = require("./lib/components/default-components/DefaultSvgDefs");
|
|
@@ -278,6 +278,7 @@ var import_ClickManager = require("./lib/editor/managers/ClickManager/ClickManag
|
|
|
278
278
|
var import_EdgeScrollManager = require("./lib/editor/managers/EdgeScrollManager/EdgeScrollManager");
|
|
279
279
|
var import_FontManager = require("./lib/editor/managers/FontManager/FontManager");
|
|
280
280
|
var import_HistoryManager = require("./lib/editor/managers/HistoryManager/HistoryManager");
|
|
281
|
+
var import_EditorManager = require("./lib/editor/managers/EditorManager");
|
|
281
282
|
var import_InputsManager = require("./lib/editor/managers/InputsManager/InputsManager");
|
|
282
283
|
var import_ScribbleManager = require("./lib/editor/managers/ScribbleManager/ScribbleManager");
|
|
283
284
|
var import_BoundsSnaps = require("./lib/editor/managers/SnapManager/BoundsSnaps");
|
|
@@ -331,7 +332,6 @@ var import_usePresence = require("./lib/hooks/usePresence");
|
|
|
331
332
|
var import_useRefState = require("./lib/hooks/useRefState");
|
|
332
333
|
var import_useSafeId = require("./lib/hooks/useSafeId");
|
|
333
334
|
var import_useTLStore = require("./lib/hooks/useTLStore");
|
|
334
|
-
var import_useTransform = require("./lib/hooks/useTransform");
|
|
335
335
|
var import_useViewportHeight = require("./lib/hooks/useViewportHeight");
|
|
336
336
|
var import_LicenseManager = require("./lib/license/LicenseManager");
|
|
337
337
|
var import_LicenseProvider = require("./lib/license/LicenseProvider");
|
|
@@ -379,7 +379,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
379
379
|
var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
|
|
380
380
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
381
381
|
"@tldraw/editor",
|
|
382
|
-
"5.2.0-canary.
|
|
382
|
+
"5.2.0-canary.4609171ef62f",
|
|
383
383
|
"cjs"
|
|
384
384
|
);
|
|
385
385
|
//# 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 {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\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\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\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 TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\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 { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\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 { FontManager } 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 { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { CollaboratorsManager } from './lib/editor/managers/CollaboratorsManager/CollaboratorsManager'\nexport { PerformanceApiAdapter } from './lib/editor/managers/PerformanceManager/PerformanceApiAdapter'\nexport { PerformanceManager } from './lib/editor/managers/PerformanceManager/PerformanceManager'\nexport {\n\ttype TLCameraEndPerfEvent,\n\ttype TLCameraStartPerfEvent,\n\ttype TLFramePerfEvent,\n\ttype TLInteractionEndPerfEvent,\n\ttype TLInteractionStartPerfEvent,\n\ttype TLPerfEventMap,\n\ttype TLPerfFrameTimeStats,\n\ttype TLPerfLongAnimationFrame,\n\ttype TLPerfLongAnimationFrameScript,\n\ttype TLShapeOperationPerfEvent,\n\ttype TLUndoRedoPerfEvent,\n} from './lib/editor/managers/PerformanceManager/perf-types'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { BaseFrameLikeShapeUtil } from './lib/editor/shapes/BaseFrameLikeShapeUtil'\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\tgetOverlayDisplayValues,\n\ttype OverlayOptionsWithDisplayValues,\n} from './lib/editor/overlays/getOverlayDisplayValues'\nexport { OverlayManager, type TLOverlayEntry } from './lib/editor/overlays/OverlayManager'\nexport {\n\tOverlayUtil,\n\ttype TLAnyOverlayUtilConstructor,\n\ttype TLOverlay,\n\ttype TLOverlayUtilConstructor,\n} from './lib/editor/overlays/OverlayUtil'\nexport { strokeShapeIndicators } from './lib/editor/overlays/strokeShapeIndicators'\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 { useColorMode } from './lib/hooks/useColorMode'\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 { 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 { 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\nexport { getColorValue } from './lib/editor/managers/ThemeManager/defaultThemes'\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;AAAA;AAAA,mBAA6C;AAG7C,0BAAc,0BAHd;AAKA,0BAAc,gCALd;AAOA,0BAAc,0BAPd;AASA,0BAAc,6BATd;AAWA,0BAAc,0BAXd;AAaA,0BAAc,6BAbd;AAeA,+BAAkC;AAClC,2BAGO;AACP,kCAGO;AACP,yBAA8C;
|
|
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 {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\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 TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\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 { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\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 { FontManager } from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { EditorManager } from './lib/editor/managers/EditorManager'\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\tresolveLineHeightPx,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { CollaboratorsManager } from './lib/editor/managers/CollaboratorsManager/CollaboratorsManager'\nexport { PerformanceApiAdapter } from './lib/editor/managers/PerformanceManager/PerformanceApiAdapter'\nexport { PerformanceManager } from './lib/editor/managers/PerformanceManager/PerformanceManager'\nexport {\n\ttype TLCameraEndPerfEvent,\n\ttype TLCameraStartPerfEvent,\n\ttype TLFramePerfEvent,\n\ttype TLInteractionEndPerfEvent,\n\ttype TLInteractionStartPerfEvent,\n\ttype TLPerfEventMap,\n\ttype TLPerfFrameTimeStats,\n\ttype TLPerfLongAnimationFrame,\n\ttype TLPerfLongAnimationFrameScript,\n\ttype TLShapeOperationPerfEvent,\n\ttype TLUndoRedoPerfEvent,\n} from './lib/editor/managers/PerformanceManager/perf-types'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { BaseFrameLikeShapeUtil } from './lib/editor/shapes/BaseFrameLikeShapeUtil'\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\tgetOverlayDisplayValues,\n\ttype OverlayOptionsWithDisplayValues,\n} from './lib/editor/overlays/getOverlayDisplayValues'\nexport { OverlayManager, type TLOverlayEntry } from './lib/editor/overlays/OverlayManager'\nexport {\n\tOverlayUtil,\n\ttype TLAnyOverlayUtilConstructor,\n\ttype TLOverlay,\n\ttype TLOverlayUtilConstructor,\n} from './lib/editor/overlays/OverlayUtil'\nexport { strokeShapeIndicators } from './lib/editor/overlays/strokeShapeIndicators'\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 { useColorMode } from './lib/hooks/useColorMode'\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 { 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 { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\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\tmoveElementInto,\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\nexport { getColorValue } from './lib/editor/managers/ThemeManager/defaultThemes'\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;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,2BAGO;AACP,kCAGO;AACP,yBAA8C;AAE9C,iCAGO;AACP,4BAA+B;AAC/B,4BAA+B;AAC/B,2BAIO;AACP,2BAAuD;AACvD,8BAAiC;AACjC,0BAAqD;AACrD,iCAIO;AACP,2BASO;AAGP,2BAA2D;AAC3D,8BAKO;AACP,oCAOO;AACP,+BAQO;AACP,uBAAyE;AACzE,uBAAuD;AACvD,yBASO;AACP,oBAMO;AACP,0BAAgD;AAChD,+BAAkC;AAClC,yBAA4B;AAC5B,4BAA+B;AAC/B,2BAA8B;AAC9B,2BAA8B;AAC9B,6BAIO;AACP,yBAIO;AACP,yBAAqD;AACrD,yBAMO;AACP,iCAAoC;AACpC,yBAOO;AACP,2BAA8B;AAC9B,0BAA4C;AAC5C,yBAA4B;AAC5B,kCAAqC;AACrC,mCAAsC;AACtC,gCAAmC;AAcnC,oCAAuC;AACvC,8BAAsD;AACtD,oCAAuC;AACvC,4BAA+B;AAC/B,uBAiBO;AACP,qCAGO;AACP,4BAAoD;AACpD,yBAKO;AACP,mCAAsC;AACtC,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,0BAA6B;AAC7B,uBAA0B;AAC1B,uBAMO;AACP,iCAAoC;AAEpC,sBAA2C;AAC3C,iCAAoC;AACpC,yBAAkE;AAClE,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2CAA8C;AAC9C,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,wBAAiD;AACjD,+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,iBAYO;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;AAQrB,IAAAC,wBAA8B;AAAA,IAN9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
6
|
"names": ["import_utils", "import_defaultThemes"]
|
|
7
7
|
}
|
|
@@ -30,6 +30,7 @@ var import_useEditor = require("../hooks/useEditor");
|
|
|
30
30
|
var import_Vec = require("../primitives/Vec");
|
|
31
31
|
var import_dom = require("../utils/dom");
|
|
32
32
|
var import_getPointerInfo = require("../utils/getPointerInfo");
|
|
33
|
+
var import_pointer = require("../utils/pointer");
|
|
33
34
|
function MenuClickCapture() {
|
|
34
35
|
const editor = (0, import_useEditor.useEditor)();
|
|
35
36
|
const isMenuOpen = (0, import_state_react.useValue)("is menu open", () => editor.menus.hasAnyOpenMenus(), [editor]);
|
|
@@ -72,16 +73,17 @@ function MenuClickCapture() {
|
|
|
72
73
|
}, [editor]);
|
|
73
74
|
const handlePointerDown = (0, import_react.useCallback)(
|
|
74
75
|
(e) => {
|
|
75
|
-
|
|
76
|
+
const button = (0, import_pointer.getPointerEventButton)(e);
|
|
77
|
+
if (button !== 0 && button !== 2) return;
|
|
76
78
|
(0, import_react_dom.flushSync)(() => setIsPointing(true));
|
|
77
79
|
(0, import_dom.setPointerCapture)(e.currentTarget, e);
|
|
78
80
|
rPointerState.current = {
|
|
79
81
|
isDown: true,
|
|
80
82
|
isDragging: false,
|
|
81
|
-
button
|
|
83
|
+
button,
|
|
82
84
|
start: new import_Vec.Vec(e.clientX, e.clientY)
|
|
83
85
|
};
|
|
84
|
-
if (
|
|
86
|
+
if (button === 2) {
|
|
85
87
|
if (!editor.options.rightClickPanning) {
|
|
86
88
|
swallowNextNativeContextMenu();
|
|
87
89
|
editor.menus.clearOpenMenus();
|
|
@@ -123,12 +125,13 @@ function MenuClickCapture() {
|
|
|
123
125
|
);
|
|
124
126
|
const handlePointerUp = (0, import_react.useCallback)(
|
|
125
127
|
(e) => {
|
|
126
|
-
const isStaticRightClick =
|
|
128
|
+
const isStaticRightClick = rPointerState.current.button === 2 && !rPointerState.current.isDragging;
|
|
127
129
|
editor.dispatch({
|
|
128
130
|
type: "pointer",
|
|
129
131
|
target: "canvas",
|
|
130
132
|
name: "pointer_up",
|
|
131
|
-
...(0, import_getPointerInfo.getPointerInfo)(editor, e)
|
|
133
|
+
...(0, import_getPointerInfo.getPointerInfo)(editor, e),
|
|
134
|
+
button: rPointerState.current.button === 2 ? 2 : (0, import_pointer.getPointerEventButton)(e)
|
|
132
135
|
});
|
|
133
136
|
if (isStaticRightClick && editor.options.rightClickPanning) {
|
|
134
137
|
const canvas = editor.getContainer().querySelector(".tl-canvas");
|