@tldraw/editor 5.3.0-canary.ec4b74d7eb64 → 5.3.0-canary.f787d5794bf9
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 +167 -10
- package/dist-cjs/index.js +13 -3
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/TldrawEditor.js +24 -19
- package/dist-cjs/lib/TldrawEditor.js.map +2 -2
- package/dist-cjs/lib/components/EditorPortal.js +44 -0
- package/dist-cjs/lib/components/EditorPortal.js.map +7 -0
- package/dist-cjs/lib/components/LiveCollaborators.js +102 -0
- package/dist-cjs/lib/components/LiveCollaborators.js.map +7 -0
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +4 -10
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +3 -3
- package/dist-cjs/lib/components/default-components/DefaultCursor.js +59 -0
- package/dist-cjs/lib/components/default-components/DefaultCursor.js.map +7 -0
- package/dist-cjs/lib/editor/Editor.js +82 -17
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js +4 -4
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/FontManager/FontManager.js +9 -0
- package/dist-cjs/lib/editor/managers/FontManager/FontManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +8 -1
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
- package/dist-cjs/lib/hooks/EditorComponentsContext.js.map +2 -2
- package/dist-cjs/lib/hooks/useCursor.js +1 -0
- package/dist-cjs/lib/hooks/useCursor.js.map +2 -2
- package/dist-cjs/lib/hooks/useEditorComponents.js +2 -0
- package/dist-cjs/lib/hooks/useEditorComponents.js.map +2 -2
- package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js +25 -1
- package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useTransform.js +45 -0
- package/dist-cjs/lib/hooks/useTransform.js.map +7 -0
- package/dist-cjs/lib/hooks/useViewportHeight.js.map +2 -2
- package/dist-cjs/lib/license/LicenseManager.js +65 -7
- package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
- package/dist-cjs/lib/license/useLicenseManagerState.js +7 -0
- package/dist-cjs/lib/license/useLicenseManagerState.js.map +2 -2
- package/dist-cjs/lib/options.js +2 -1
- package/dist-cjs/lib/options.js.map +2 -2
- package/dist-cjs/lib/utils/collaborators.js +27 -0
- package/dist-cjs/lib/utils/collaborators.js.map +7 -0
- package/dist-cjs/lib/utils/getHtmlLayerTransform.js +33 -0
- package/dist-cjs/lib/utils/getHtmlLayerTransform.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 +167 -10
- package/dist-esm/index.mjs +19 -4
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/TldrawEditor.mjs +23 -18
- package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
- package/dist-esm/lib/components/EditorPortal.mjs +24 -0
- package/dist-esm/lib/components/EditorPortal.mjs.map +7 -0
- package/dist-esm/lib/components/LiveCollaborators.mjs +82 -0
- package/dist-esm/lib/components/LiveCollaborators.mjs.map +7 -0
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +5 -11
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCursor.mjs +29 -0
- package/dist-esm/lib/components/default-components/DefaultCursor.mjs.map +7 -0
- package/dist-esm/lib/editor/Editor.mjs +82 -17
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs +5 -5
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs +9 -0
- package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +8 -1
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/hooks/EditorComponentsContext.mjs.map +2 -2
- package/dist-esm/lib/hooks/useCursor.mjs +1 -0
- package/dist-esm/lib/hooks/useCursor.mjs.map +2 -2
- package/dist-esm/lib/hooks/useEditorComponents.mjs +2 -0
- package/dist-esm/lib/hooks/useEditorComponents.mjs.map +2 -2
- package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs +25 -1
- package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useTransform.mjs +25 -0
- package/dist-esm/lib/hooks/useTransform.mjs.map +7 -0
- package/dist-esm/lib/hooks/useViewportHeight.mjs.map +2 -2
- package/dist-esm/lib/license/LicenseManager.mjs +66 -8
- package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
- package/dist-esm/lib/license/useLicenseManagerState.mjs +7 -0
- package/dist-esm/lib/license/useLicenseManagerState.mjs.map +2 -2
- package/dist-esm/lib/options.mjs +2 -1
- package/dist-esm/lib/options.mjs.map +2 -2
- package/dist-esm/lib/utils/collaborators.mjs +7 -0
- package/dist-esm/lib/utils/collaborators.mjs.map +7 -0
- package/dist-esm/lib/utils/getHtmlLayerTransform.mjs +13 -0
- package/dist-esm/lib/utils/getHtmlLayerTransform.mjs.map +7 -0
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +53 -4
- package/package.json +7 -7
- package/src/index.ts +15 -2
- package/src/lib/TldrawEditor.tsx +21 -13
- package/src/lib/components/EditorPortal.tsx +77 -0
- package/src/lib/components/LiveCollaborators.tsx +133 -0
- package/src/lib/components/default-components/DefaultCanvas.tsx +5 -17
- package/src/lib/components/default-components/DefaultCursor.tsx +65 -0
- package/src/lib/editor/Editor.ts +127 -18
- package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.test.ts +46 -1
- package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.ts +10 -5
- package/src/lib/editor/managers/FontManager/FontManager.test.ts +66 -0
- package/src/lib/editor/managers/FontManager/FontManager.ts +14 -0
- package/src/lib/editor/managers/TextManager/TextManager.test.ts +42 -0
- package/src/lib/editor/managers/TextManager/TextManager.ts +11 -2
- package/src/lib/editor/shapes/ShapeUtil.ts +24 -0
- package/src/lib/editor/types/external-content.ts +5 -0
- package/src/lib/hooks/EditorComponentsContext.tsx +2 -0
- package/src/lib/hooks/useCursor.ts +1 -0
- package/src/lib/hooks/useEditorComponents.tsx +2 -0
- package/src/lib/hooks/usePassThroughWheelEvents.ts +44 -2
- package/src/lib/hooks/useTransform.ts +38 -0
- package/src/lib/hooks/useViewportHeight.ts +9 -1
- package/src/lib/license/LicenseManager.test.ts +245 -29
- package/src/lib/license/LicenseManager.ts +114 -6
- package/src/lib/license/useLicenseManagerState.ts +17 -1
- package/src/lib/options.ts +3 -1
- package/src/lib/test/EditorPortal.test.tsx +48 -0
- package/src/lib/utils/collaborators.test.ts +34 -0
- package/src/lib/utils/collaborators.ts +25 -0
- package/src/lib/utils/getHtmlLayerTransform.ts +22 -0
- package/src/version.ts +3 -3
- package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js +0 -51
- package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +0 -7
- package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs +0 -31
- package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +0 -7
- package/src/lib/hooks/usePassThroughMouseOverEvents.ts +0 -32
package/dist-cjs/index.d.ts
CHANGED
|
@@ -19,12 +19,14 @@ import { JsonObject } from '@tldraw/utils';
|
|
|
19
19
|
import { JSX } from 'react/jsx-runtime';
|
|
20
20
|
import { LegacyMigrations } from '@tldraw/store';
|
|
21
21
|
import { MigrationSequence } from '@tldraw/store';
|
|
22
|
+
import { NamedExoticComponent } from 'react';
|
|
22
23
|
import { Node as Node_2 } from '@tiptap/pm/model';
|
|
23
24
|
import { PerformanceTracker } from '@tldraw/utils';
|
|
24
25
|
import * as React_2 from 'react';
|
|
25
26
|
import { default as React_3 } from 'react';
|
|
26
27
|
import { ReactElement } from 'react';
|
|
27
28
|
import { ReactNode } from 'react';
|
|
29
|
+
import { ReactPortal } from 'react';
|
|
28
30
|
import { RecordProps } from '@tldraw/tlschema';
|
|
29
31
|
import { RecordsDiff } from '@tldraw/store';
|
|
30
32
|
import { RefAttributes } from 'react';
|
|
@@ -982,6 +984,15 @@ export declare function DefaultBackground(): JSX.Element;
|
|
|
982
984
|
/** @public @react */
|
|
983
985
|
export declare function DefaultCanvas({ className }: TLCanvasComponentProps): JSX.Element;
|
|
984
986
|
|
|
987
|
+
/**
|
|
988
|
+
* The default collaborator cursor: the arrow glyph plus a name tag or chat bubble. The arrow is a
|
|
989
|
+
* `<use>` of a shared `<defs>` symbol that `LiveCollaborators` renders, so a `DefaultCursor`
|
|
990
|
+
* used outside that layer draws no arrow.
|
|
991
|
+
*
|
|
992
|
+
* @public @react
|
|
993
|
+
*/
|
|
994
|
+
export declare const DefaultCursor: NamedExoticComponent<TLCursorProps>;
|
|
995
|
+
|
|
985
996
|
/** @public @react */
|
|
986
997
|
export declare const DefaultErrorFallback: TLErrorFallbackComponent;
|
|
987
998
|
|
|
@@ -1007,6 +1018,7 @@ export declare const defaultTldrawOptions: {
|
|
|
1007
1018
|
readonly cameraSlideFriction: 0.09;
|
|
1008
1019
|
readonly coarseDragDistanceSquared: 36;
|
|
1009
1020
|
readonly coarseHandleRadius: 20;
|
|
1021
|
+
readonly coarseHitTestMargin: 4;
|
|
1010
1022
|
readonly coarsePointerWidth: 12;
|
|
1011
1023
|
readonly collaboratorCheckIntervalMs: 1200;
|
|
1012
1024
|
readonly collaboratorIdleTimeoutMs: 3000;
|
|
@@ -1046,7 +1058,7 @@ export declare const defaultTldrawOptions: {
|
|
|
1046
1058
|
readonly step: 1;
|
|
1047
1059
|
}];
|
|
1048
1060
|
readonly handleRadius: 12;
|
|
1049
|
-
readonly hitTestMargin:
|
|
1061
|
+
readonly hitTestMargin: 3;
|
|
1050
1062
|
readonly laserDelayMs: 1200;
|
|
1051
1063
|
readonly laserFadeoutMs: 500;
|
|
1052
1064
|
readonly longPressDurationMs: 500;
|
|
@@ -3101,6 +3113,17 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3101
3113
|
* @public
|
|
3102
3114
|
*/
|
|
3103
3115
|
getCurrentPageBounds(): Box | undefined;
|
|
3116
|
+
/**
|
|
3117
|
+
* Get the hit-test margin in page space—the distance in page units within which a pointer is
|
|
3118
|
+
* considered to be touching a shape. This resolves to {@link TldrawOptions.hitTestMargin} (or
|
|
3119
|
+
* {@link TldrawOptions.coarseHitTestMargin} when using a coarse pointer) divided by the current
|
|
3120
|
+
* zoom level, so it stays a constant distance in screen space.
|
|
3121
|
+
*
|
|
3122
|
+
* @returns The hit-test margin in page space.
|
|
3123
|
+
*
|
|
3124
|
+
* @public
|
|
3125
|
+
*/
|
|
3126
|
+
getHitTestMargin(): number;
|
|
3104
3127
|
/**
|
|
3105
3128
|
* Get the top-most selected shape at the given point, ignoring groups.
|
|
3106
3129
|
*
|
|
@@ -3677,7 +3700,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3677
3700
|
*
|
|
3678
3701
|
* @public
|
|
3679
3702
|
*/
|
|
3680
|
-
alignShapes(shapes: TLShape[] | TLShapeId[], operation: 'bottom' | 'center-horizontal' | 'center-vertical' | 'left' | 'right' | 'top'): this;
|
|
3703
|
+
alignShapes(shapes: TLShape[] | TLShapeId[], operation: 'bottom' | 'center-horizontal' | 'center-vertical' | 'center' | 'left' | 'right' | 'top'): this;
|
|
3681
3704
|
/**
|
|
3682
3705
|
* Distribute shape positions.
|
|
3683
3706
|
*
|
|
@@ -4450,13 +4473,14 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
4450
4473
|
cancelDoubleClick(): void;
|
|
4451
4474
|
/* Excluded from this release type: _prevCursor */
|
|
4452
4475
|
/* Excluded from this release type: _shiftKeyTimeout */
|
|
4453
|
-
/* Excluded from this release type:
|
|
4476
|
+
/* Excluded from this release type: _releaseShiftKey */
|
|
4454
4477
|
/* Excluded from this release type: _altKeyTimeout */
|
|
4455
|
-
/* Excluded from this release type:
|
|
4478
|
+
/* Excluded from this release type: _releaseAltKey */
|
|
4456
4479
|
/* Excluded from this release type: _ctrlKeyTimeout */
|
|
4457
|
-
/* Excluded from this release type:
|
|
4480
|
+
/* Excluded from this release type: _releaseCtrlKey */
|
|
4458
4481
|
/* Excluded from this release type: _metaKeyTimeout */
|
|
4459
|
-
/* Excluded from this release type:
|
|
4482
|
+
/* Excluded from this release type: _releaseMetaKey */
|
|
4483
|
+
/* Excluded from this release type: _releaseDebouncedModifiers */
|
|
4460
4484
|
/* Excluded from this release type: _restoreToolId */
|
|
4461
4485
|
/* Excluded from this release type: _didPinch */
|
|
4462
4486
|
/* Excluded from this release type: _selectedShapeIdsAtPointerDown */
|
|
@@ -4574,6 +4598,52 @@ export declare abstract class EditorManager {
|
|
|
4574
4598
|
/* Excluded from this release type: dispose */
|
|
4575
4599
|
}
|
|
4576
4600
|
|
|
4601
|
+
/**
|
|
4602
|
+
* Renders its children into the end of the editor's container, escaping the canvas layer.
|
|
4603
|
+
*
|
|
4604
|
+
* Use this for anything anchored to canvas coordinates that also has to draw over the UI — a
|
|
4605
|
+
* popover on a shape, a comment thread, an annotation panel. The `OnTheCanvas` and
|
|
4606
|
+
* `InFrontOfTheCanvas` slots are fixed layers, each its own stacking context, so content mounted
|
|
4607
|
+
* there can't paint above whatever outranks its layer whatever z-index it asks for. Mount in
|
|
4608
|
+
* whichever slot suits your data flow, wrap the part that needs its own layer in this, and give
|
|
4609
|
+
* that part a z-index.
|
|
4610
|
+
*
|
|
4611
|
+
* This package's own layers stop at 250 (`--tl-layer-canvas-in-front`); above that belongs to
|
|
4612
|
+
* whatever renders the UI. In `tldraw` that's `--tl-layer-panels` (300) and `--tl-layer-menus`
|
|
4613
|
+
* (400), defined by `tldraw`'s stylesheet rather than this one.
|
|
4614
|
+
*
|
|
4615
|
+
* Positioning still resolves against the editor's container, so a `position: absolute` child uses
|
|
4616
|
+
* ordinary container coordinates.
|
|
4617
|
+
*
|
|
4618
|
+
* Prefer this over `createPortal(children, useContainer())`, which picks its DOM position from the
|
|
4619
|
+
* commit that mounts it — landing the node ahead of the UI and of the "skip to main content" link
|
|
4620
|
+
* that only works while nothing precedes it. This host is a real element placed last, so ordering
|
|
4621
|
+
* is fixed rather than dependent on mount timing.
|
|
4622
|
+
*
|
|
4623
|
+
* @example
|
|
4624
|
+
* ```tsx
|
|
4625
|
+
* // 400 clears tldraw's menus layer; the bare editor's own layers stop at 250.
|
|
4626
|
+
* function ShapeAnnotation({ point }: { point: VecLike }) {
|
|
4627
|
+
* return (
|
|
4628
|
+
* <EditorPortal>
|
|
4629
|
+
* <div style={{ position: 'absolute', left: point.x, top: point.y, zIndex: 400 }}>
|
|
4630
|
+
* Above the UI
|
|
4631
|
+
* </div>
|
|
4632
|
+
* </EditorPortal>
|
|
4633
|
+
* )
|
|
4634
|
+
* }
|
|
4635
|
+
* ```
|
|
4636
|
+
*
|
|
4637
|
+
* @public
|
|
4638
|
+
* @react
|
|
4639
|
+
*/
|
|
4640
|
+
export declare function EditorPortal({ children }: EditorPortalProps): ReactPortal | null;
|
|
4641
|
+
|
|
4642
|
+
/** @public */
|
|
4643
|
+
export declare interface EditorPortalProps {
|
|
4644
|
+
children: ReactNode;
|
|
4645
|
+
}
|
|
4646
|
+
|
|
4577
4647
|
/** @public @react */
|
|
4578
4648
|
export declare function EditorProvider({ editor, children }: EditorProviderProps): JSX.Element;
|
|
4579
4649
|
|
|
@@ -5437,6 +5507,24 @@ export declare function intersectPolygonPolygon(polygonA: VecLike[], polygonB: V
|
|
|
5437
5507
|
|
|
5438
5508
|
/* Excluded from this release type: isAccelKey */
|
|
5439
5509
|
|
|
5510
|
+
/**
|
|
5511
|
+
* Whether a collaborator's cursor (page coords) is inside the viewport, with a small margin for the
|
|
5512
|
+
* cursor glyph so it isn't culled the instant its hotspot crosses the edge.
|
|
5513
|
+
*
|
|
5514
|
+
* Single source of truth for the cursor/hint split: the DOM cursor layer renders a collaborator
|
|
5515
|
+
* when this is true, and `CollaboratorHintOverlayUtil` draws the viewport-edge hint when it's
|
|
5516
|
+
* false. Sharing the predicate keeps those two exhaustive and mutually exclusive — a margin change
|
|
5517
|
+
* can't open a dead zone (neither renders) or a double-render (both).
|
|
5518
|
+
*
|
|
5519
|
+
* @public
|
|
5520
|
+
*/
|
|
5521
|
+
export declare function isCursorInViewport(cursor: VecLike, viewport: {
|
|
5522
|
+
maxX: number;
|
|
5523
|
+
maxY: number;
|
|
5524
|
+
minX: number;
|
|
5525
|
+
minY: number;
|
|
5526
|
+
}, zoom: number): boolean;
|
|
5527
|
+
|
|
5440
5528
|
/**
|
|
5441
5529
|
* Check if a float is safe to use. ie: Not too big or small.
|
|
5442
5530
|
* @public
|
|
@@ -5458,6 +5546,8 @@ export declare function kickoutOccludedShapes(editor: Editor, shapeIds: TLShapeI
|
|
|
5458
5546
|
|
|
5459
5547
|
/* Excluded from this release type: LICENSE_TIMEOUT */
|
|
5460
5548
|
|
|
5549
|
+
/* Excluded from this release type: LicenseFeatureName */
|
|
5550
|
+
|
|
5461
5551
|
/* Excluded from this release type: LicenseFromKeyResult */
|
|
5462
5552
|
|
|
5463
5553
|
/* Excluded from this release type: LicenseInfo */
|
|
@@ -6781,6 +6871,29 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
|
6781
6871
|
* @public
|
|
6782
6872
|
*/
|
|
6783
6873
|
onBeforeCreate?(next: Shape): Shape | void;
|
|
6874
|
+
/**
|
|
6875
|
+
* A callback called when a shape is reproduced from an existing shape, either by duplicating
|
|
6876
|
+
* ({@link Editor.duplicateShapes}) or by pasting/putting content onto the page
|
|
6877
|
+
* ({@link Editor.putContentOntoCurrentPage}). This provides a last chance to modify the copy
|
|
6878
|
+
* before it's created — for example, to re-stamp attribution so the copy is credited to the
|
|
6879
|
+
* current user rather than the original author. It is not called when content is put with
|
|
6880
|
+
* `preserveIds` (e.g. {@link Editor.moveShapesToPage}), since the shape keeps its identity
|
|
6881
|
+
* and no copy is made.
|
|
6882
|
+
*
|
|
6883
|
+
* @example
|
|
6884
|
+
*
|
|
6885
|
+
* ```ts
|
|
6886
|
+
* onBeforeDuplicate = (source, duplicate) => {
|
|
6887
|
+
* return { ...duplicate, props: { ...duplicate.props, editedBy: this.editor.getAttributionUserId() } }
|
|
6888
|
+
* }
|
|
6889
|
+
* ```
|
|
6890
|
+
*
|
|
6891
|
+
* @param source - The shape being copied from.
|
|
6892
|
+
* @param duplicate - The new copy (with its own id), before it's created.
|
|
6893
|
+
* @returns The next shape or void.
|
|
6894
|
+
* @public
|
|
6895
|
+
*/
|
|
6896
|
+
onBeforeDuplicate?(source: Shape, duplicate: Shape): Shape | void;
|
|
6784
6897
|
/**
|
|
6785
6898
|
* A callback called just before a shape is updated. This method provides a last chance to modify
|
|
6786
6899
|
* the updated shape.
|
|
@@ -7513,6 +7626,11 @@ export declare interface TLBaseEventInfo {
|
|
|
7513
7626
|
|
|
7514
7627
|
/** @public */
|
|
7515
7628
|
export declare interface TLBaseExternalContent {
|
|
7629
|
+
/**
|
|
7630
|
+
* The other content sources found on the clipboard alongside this content. For example, when
|
|
7631
|
+
* pasting an image copied together with HTML and plain text, the `files` content will have
|
|
7632
|
+
* text sources for the HTML and plain text parts.
|
|
7633
|
+
*/
|
|
7516
7634
|
sources?: TLExternalContentSource[];
|
|
7517
7635
|
point?: VecLike;
|
|
7518
7636
|
}
|
|
@@ -7759,6 +7877,17 @@ export declare interface TLCurrentUser {
|
|
|
7759
7877
|
readonly setUserPreferences: (userPreferences: TLUserPreferences) => void;
|
|
7760
7878
|
}
|
|
7761
7879
|
|
|
7880
|
+
/** @public */
|
|
7881
|
+
export declare interface TLCursorProps {
|
|
7882
|
+
userId: string;
|
|
7883
|
+
className?: string;
|
|
7884
|
+
point: null | VecModel;
|
|
7885
|
+
zoom: number;
|
|
7886
|
+
color?: string;
|
|
7887
|
+
name: null | string;
|
|
7888
|
+
chatMessage: string;
|
|
7889
|
+
}
|
|
7890
|
+
|
|
7762
7891
|
/** @public */
|
|
7763
7892
|
export declare type TLDeepLink = {
|
|
7764
7893
|
bounds: BoxModel;
|
|
@@ -8047,6 +8176,7 @@ export declare interface TldrawOptions {
|
|
|
8047
8176
|
readonly collaboratorCheckIntervalMs: number;
|
|
8048
8177
|
readonly cameraMovingTimeoutMs: number;
|
|
8049
8178
|
readonly hitTestMargin: number;
|
|
8179
|
+
readonly coarseHitTestMargin: number;
|
|
8050
8180
|
readonly edgeScrollDelay: number;
|
|
8051
8181
|
readonly edgeScrollEaseDuration: number;
|
|
8052
8182
|
readonly edgeScrollSpeed: number;
|
|
@@ -8260,6 +8390,7 @@ export declare interface TLDropShapesOverInfo {
|
|
|
8260
8390
|
export declare interface TLEditorComponents {
|
|
8261
8391
|
Background?: ComponentType | null;
|
|
8262
8392
|
Canvas?: ComponentType<TLCanvasComponentProps> | null;
|
|
8393
|
+
CollaboratorCursor?: ComponentType<TLCursorProps> | null;
|
|
8263
8394
|
Grid?: ComponentType<TLGridProps> | null;
|
|
8264
8395
|
InFrontOfTheCanvas?: ComponentType | null;
|
|
8265
8396
|
LoadingScreen?: ComponentType | null;
|
|
@@ -9715,6 +9846,16 @@ export declare function useEditor(): Editor;
|
|
|
9715
9846
|
/** @public */
|
|
9716
9847
|
export declare function useEditorComponents(): Required<TLEditorComponents>;
|
|
9717
9848
|
|
|
9849
|
+
/**
|
|
9850
|
+
* The DOM node that {@link EditorPortal} renders into: an empty `display: contents` element the
|
|
9851
|
+
* editor renders last among its container's children, after the canvas and after the UI.
|
|
9852
|
+
*
|
|
9853
|
+
* Null until the container has mounted, so prefer {@link EditorPortal}, which handles that for you.
|
|
9854
|
+
*
|
|
9855
|
+
* @public
|
|
9856
|
+
*/
|
|
9857
|
+
export declare function useEditorPortalHost(): HTMLElement | null;
|
|
9858
|
+
|
|
9718
9859
|
/* Excluded from this release type: useEvent */
|
|
9719
9860
|
|
|
9720
9861
|
/** @public */
|
|
@@ -9726,6 +9867,10 @@ export declare function useIsCropping(shapeId: TLShapeId): boolean;
|
|
|
9726
9867
|
/** @public */
|
|
9727
9868
|
export declare function useIsEditing(shapeId: TLShapeId): boolean;
|
|
9728
9869
|
|
|
9870
|
+
/* Excluded from this release type: useLicenseContext */
|
|
9871
|
+
|
|
9872
|
+
/* Excluded from this release type: useLicenseFeatureFlag */
|
|
9873
|
+
|
|
9729
9874
|
/* Excluded from this release type: useLocalStore */
|
|
9730
9875
|
|
|
9731
9876
|
/** @public */
|
|
@@ -9733,9 +9878,6 @@ export declare function useMaybeEditor(): Editor | null;
|
|
|
9733
9878
|
|
|
9734
9879
|
/* Excluded from this release type: useOnMount */
|
|
9735
9880
|
|
|
9736
|
-
/** @public */
|
|
9737
|
-
export declare function usePassThroughMouseOverEvents(ref: RefObject<HTMLElement | null>): void;
|
|
9738
|
-
|
|
9739
9881
|
/** @public */
|
|
9740
9882
|
export declare function usePassThroughWheelEvents(ref: RefObject<HTMLElement | null>): void;
|
|
9741
9883
|
|
|
@@ -9862,6 +10004,13 @@ export declare function useTLSchemaFromUtils(opts: TLStoreSchemaOptions): StoreS
|
|
|
9862
10004
|
/** @public */
|
|
9863
10005
|
export declare function useTLStore(opts: TLStoreOptions): TLStore;
|
|
9864
10006
|
|
|
10007
|
+
/**
|
|
10008
|
+
* Position an element by writing its `transform` directly, outside React's render output — the
|
|
10009
|
+
* cheap path for elements that move at pointer/presence frequency.
|
|
10010
|
+
* @public
|
|
10011
|
+
*/
|
|
10012
|
+
export declare function useTransform(ref: React.RefObject<HTMLElement | null | SVGElement>, x?: number, y?: number, scale?: number, rotate?: number, additionalOffset?: VecLike): void;
|
|
10013
|
+
|
|
9865
10014
|
/**
|
|
9866
10015
|
* React's useId hook returns a unique id for the component. However, it uses a colon in the id,
|
|
9867
10016
|
* which is not valid for CSS selectors. This hook replaces the colon with an underscore.
|
|
@@ -9870,7 +10019,15 @@ export declare function useTLStore(opts: TLStoreOptions): TLStore;
|
|
|
9870
10019
|
*/
|
|
9871
10020
|
export declare function useUniqueSafeId(suffix?: string): SafeId;
|
|
9872
10021
|
|
|
9873
|
-
/**
|
|
10022
|
+
/**
|
|
10023
|
+
* The height of the visible viewport, including the visual viewport's own offset.
|
|
10024
|
+
*
|
|
10025
|
+
* @deprecated Read `window.visualViewport` directly: this flattens the visible rectangle to a
|
|
10026
|
+
* single scalar, and keeping UI clear of the software keyboard usually needs the other edges too.
|
|
10027
|
+
* Unused since v3.14; will be removed in a future release.
|
|
10028
|
+
*
|
|
10029
|
+
* @public
|
|
10030
|
+
*/
|
|
9874
10031
|
export declare function useViewportHeight(): number;
|
|
9875
10032
|
|
|
9876
10033
|
/* Excluded from this release type: ValidLicenseKeyResult */
|
package/dist-cjs/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
DEFAULT_THEME: () => import_defaultThemes.DEFAULT_THEME,
|
|
39
39
|
DefaultBackground: () => import_DefaultBackground.DefaultBackground,
|
|
40
40
|
DefaultCanvas: () => import_DefaultCanvas.DefaultCanvas,
|
|
41
|
+
DefaultCursor: () => import_DefaultCursor.DefaultCursor,
|
|
41
42
|
DefaultErrorFallback: () => import_DefaultErrorFallback.DefaultErrorFallback,
|
|
42
43
|
DefaultGrid: () => import_DefaultGrid.DefaultGrid,
|
|
43
44
|
DefaultShapeWrapper: () => import_DefaultShapeWrapper.DefaultShapeWrapper,
|
|
@@ -51,6 +52,7 @@ __export(index_exports, {
|
|
|
51
52
|
EditorAtom: () => import_EditorAtom.EditorAtom,
|
|
52
53
|
EditorContext: () => import_useEditor.EditorContext,
|
|
53
54
|
EditorManager: () => import_EditorManager.EditorManager,
|
|
55
|
+
EditorPortal: () => import_EditorPortal.EditorPortal,
|
|
54
56
|
EditorProvider: () => import_useEditor.EditorProvider,
|
|
55
57
|
Ellipse2d: () => import_Ellipse2d.Ellipse2d,
|
|
56
58
|
ErrorBoundary: () => import_ErrorBoundary.ErrorBoundary,
|
|
@@ -171,6 +173,7 @@ __export(index_exports, {
|
|
|
171
173
|
intersectPolygonBounds: () => import_intersect.intersectPolygonBounds,
|
|
172
174
|
intersectPolygonPolygon: () => import_intersect.intersectPolygonPolygon,
|
|
173
175
|
isAccelKey: () => import_keyboard.isAccelKey,
|
|
176
|
+
isCursorInViewport: () => import_collaborators.isCursorInViewport,
|
|
174
177
|
isSafeFloat: () => import_utils2.isSafeFloat,
|
|
175
178
|
kickoutOccludedShapes: () => import_reparenting.kickoutOccludedShapes,
|
|
176
179
|
linesIntersect: () => import_intersect.linesIntersect,
|
|
@@ -221,14 +224,16 @@ __export(index_exports, {
|
|
|
221
224
|
useDelaySvgExport: () => import_SvgExportContext.useDelaySvgExport,
|
|
222
225
|
useEditor: () => import_useEditor.useEditor,
|
|
223
226
|
useEditorComponents: () => import_useEditorComponents.useEditorComponents,
|
|
227
|
+
useEditorPortalHost: () => import_EditorPortal.useEditorPortalHost,
|
|
224
228
|
useEvent: () => import_useEvent.useEvent,
|
|
225
229
|
useGlobalMenuIsOpen: () => import_useGlobalMenuIsOpen.useGlobalMenuIsOpen,
|
|
226
230
|
useIsCropping: () => import_useIsCropping.useIsCropping,
|
|
227
231
|
useIsEditing: () => import_useIsEditing.useIsEditing,
|
|
232
|
+
useLicenseContext: () => import_LicenseProvider.useLicenseContext,
|
|
233
|
+
useLicenseFeatureFlag: () => import_useLicenseManagerState.useLicenseFeatureFlag,
|
|
228
234
|
useLocalStore: () => import_useLocalStore.useLocalStore,
|
|
229
235
|
useMaybeEditor: () => import_useEditor.useMaybeEditor,
|
|
230
236
|
useOnMount: () => import_TldrawEditor.useOnMount,
|
|
231
|
-
usePassThroughMouseOverEvents: () => import_usePassThroughMouseOverEvents.usePassThroughMouseOverEvents,
|
|
232
237
|
usePassThroughWheelEvents: () => import_usePassThroughWheelEvents.usePassThroughWheelEvents,
|
|
233
238
|
usePeerIds: () => import_usePeerIds.usePeerIds,
|
|
234
239
|
usePresence: () => import_usePresence.usePresence,
|
|
@@ -241,6 +246,7 @@ __export(index_exports, {
|
|
|
241
246
|
useTLSchemaFromUtils: () => import_useTLStore.useTLSchemaFromUtils,
|
|
242
247
|
useTLStore: () => import_useTLStore.useTLStore,
|
|
243
248
|
useTldrawCurrentUser: () => import_createTLCurrentUser.useTldrawCurrentUser,
|
|
249
|
+
useTransform: () => import_useTransform.useTransform,
|
|
244
250
|
useUniqueSafeId: () => import_useSafeId.useUniqueSafeId,
|
|
245
251
|
useViewportHeight: () => import_useViewportHeight.useViewportHeight,
|
|
246
252
|
userTypeValidator: () => import_TLUserPreferences.userTypeValidator
|
|
@@ -255,11 +261,13 @@ __reExport(index_exports, require("@tldraw/utils"), module.exports);
|
|
|
255
261
|
__reExport(index_exports, require("@tldraw/validate"), module.exports);
|
|
256
262
|
var import_DefaultBackground = require("./lib/components/default-components/DefaultBackground");
|
|
257
263
|
var import_DefaultCanvas = require("./lib/components/default-components/DefaultCanvas");
|
|
264
|
+
var import_DefaultCursor = require("./lib/components/default-components/DefaultCursor");
|
|
258
265
|
var import_DefaultErrorFallback = require("./lib/components/default-components/DefaultErrorFallback");
|
|
259
266
|
var import_DefaultGrid = require("./lib/components/default-components/DefaultGrid");
|
|
260
267
|
var import_DefaultShapeWrapper = require("./lib/components/default-components/DefaultShapeWrapper");
|
|
261
268
|
var import_DefaultSpinner = require("./lib/components/default-components/DefaultSpinner");
|
|
262
269
|
var import_DefaultSvgDefs = require("./lib/components/default-components/DefaultSvgDefs");
|
|
270
|
+
var import_EditorPortal = require("./lib/components/EditorPortal");
|
|
263
271
|
var import_ErrorBoundary = require("./lib/components/ErrorBoundary");
|
|
264
272
|
var import_HTMLContainer = require("./lib/components/HTMLContainer");
|
|
265
273
|
var import_MenuClickCapture = require("./lib/components/MenuClickCapture");
|
|
@@ -325,16 +333,18 @@ var import_useIdentity = require("./lib/hooks/useIdentity");
|
|
|
325
333
|
var import_useIsCropping = require("./lib/hooks/useIsCropping");
|
|
326
334
|
var import_useIsEditing = require("./lib/hooks/useIsEditing");
|
|
327
335
|
var import_useLocalStore = require("./lib/hooks/useLocalStore");
|
|
328
|
-
var import_usePassThroughMouseOverEvents = require("./lib/hooks/usePassThroughMouseOverEvents");
|
|
329
336
|
var import_usePassThroughWheelEvents = require("./lib/hooks/usePassThroughWheelEvents");
|
|
330
337
|
var import_usePeerIds = require("./lib/hooks/usePeerIds");
|
|
331
338
|
var import_usePresence = require("./lib/hooks/usePresence");
|
|
332
339
|
var import_useRefState = require("./lib/hooks/useRefState");
|
|
333
340
|
var import_useSafeId = require("./lib/hooks/useSafeId");
|
|
341
|
+
var import_useTransform = require("./lib/hooks/useTransform");
|
|
342
|
+
var import_collaborators = require("./lib/utils/collaborators");
|
|
334
343
|
var import_useTLStore = require("./lib/hooks/useTLStore");
|
|
335
344
|
var import_useViewportHeight = require("./lib/hooks/useViewportHeight");
|
|
336
345
|
var import_LicenseManager = require("./lib/license/LicenseManager");
|
|
337
346
|
var import_LicenseProvider = require("./lib/license/LicenseProvider");
|
|
347
|
+
var import_useLicenseManagerState = require("./lib/license/useLicenseManagerState");
|
|
338
348
|
var import_options = require("./lib/options");
|
|
339
349
|
var import_Box = require("./lib/primitives/Box");
|
|
340
350
|
var import_easings = require("./lib/primitives/easings");
|
|
@@ -379,7 +389,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
379
389
|
var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
|
|
380
390
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
381
391
|
"@tldraw/editor",
|
|
382
|
-
"5.3.0-canary.
|
|
392
|
+
"5.3.0-canary.f787d5794bf9",
|
|
383
393
|
"cjs"
|
|
384
394
|
);
|
|
385
395
|
//# 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 { 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,
|
|
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\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 { 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\tEditorPortal,\n\tuseEditorPortalHost,\n\ttype EditorPortalProps,\n} from './lib/components/EditorPortal'\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 { 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 { useTransform } from './lib/hooks/useTransform'\nexport { isCursorInViewport } from './lib/utils/collaborators'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\n// oxlint-disable-next-line typescript/no-deprecated\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFeatureName,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT, useLicenseContext } from './lib/license/LicenseProvider'\nexport { useLicenseFeatureFlag } from './lib/license/useLicenseManagerState'\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;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,2BAGO;AACP,kCAGO;AACP,yBAA8C;AAE9C,iCAGO;AACP,4BAA+B;AAC/B,4BAA+B;AAC/B,0BAIO;AACP,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,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,0BAA6B;AAC7B,2BAAmC;AACnC,wBAAiD;AAEjD,+BAAkC;AAClC,4BASO;AACP,6BAAmD;AACnD,oCAAsC;AACtC,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
|
}
|
|
@@ -35,10 +35,7 @@ __export(TldrawEditor_exports, {
|
|
|
35
35
|
useOnMount: () => useOnMount
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(TldrawEditor_exports);
|
|
38
|
-
var import_jsx_runtime = (
|
|
39
|
-
// Store is ready to go, whether externally synced or not
|
|
40
|
-
require("react/jsx-runtime")
|
|
41
|
-
);
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
39
|
var import_store = require("@tldraw/store");
|
|
43
40
|
var import_tlschema = require("@tldraw/tlschema");
|
|
44
41
|
var import_utils = require("@tldraw/utils");
|
|
@@ -46,6 +43,7 @@ var import_classnames = __toESM(require("classnames"), 1);
|
|
|
46
43
|
var import_react = __toESM(require("react"), 1);
|
|
47
44
|
var import_version = require("../version");
|
|
48
45
|
var import_DefaultErrorFallback = require("./components/default-components/DefaultErrorFallback");
|
|
46
|
+
var import_EditorPortal = require("./components/EditorPortal");
|
|
49
47
|
var import_ErrorBoundary = require("./components/ErrorBoundary");
|
|
50
48
|
var import_createTLCurrentUser = require("./config/createTLCurrentUser");
|
|
51
49
|
var import_Editor = require("./editor/Editor");
|
|
@@ -87,6 +85,7 @@ const TldrawEditor = (0, import_react.memo)(function TldrawEditor2({
|
|
|
87
85
|
(0, import_tlschema.registerColorsFromThemes)(resolvedThemes);
|
|
88
86
|
(0, import_tlschema.registerFontsFromThemes)(resolvedThemes);
|
|
89
87
|
const [container, setContainer] = (0, import_react.useState)(null);
|
|
88
|
+
const [portalHost, setPortalHost] = (0, import_react.useState)(null);
|
|
90
89
|
const user = (0, import_react.useMemo)(() => _user ?? (0, import_createTLCurrentUser.createTLCurrentUser)(), [_user]);
|
|
91
90
|
const ErrorFallback = components?.ErrorFallback === void 0 ? import_DefaultErrorFallback.DefaultErrorFallback : components?.ErrorFallback;
|
|
92
91
|
const mergedOptions = (0, import_react.useMemo)(() => {
|
|
@@ -108,7 +107,7 @@ const TldrawEditor = (0, import_react.memo)(function TldrawEditor2({
|
|
|
108
107
|
components,
|
|
109
108
|
options: (0, import_useIdentity.useShallowObjectIdentity)(mergedOptions)
|
|
110
109
|
};
|
|
111
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
112
111
|
"div",
|
|
113
112
|
{
|
|
114
113
|
ref: setContainer,
|
|
@@ -118,20 +117,26 @@ const TldrawEditor = (0, import_react.memo)(function TldrawEditor2({
|
|
|
118
117
|
tabIndex: -1,
|
|
119
118
|
role: "application",
|
|
120
119
|
"aria-label": _options?.branding ?? "tldraw",
|
|
121
|
-
children:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
+
import_ErrorBoundary.OptionalErrorBoundary,
|
|
123
|
+
{
|
|
124
|
+
fallback: ErrorFallback,
|
|
125
|
+
onError: (error) => (0, import_utils.annotateError)(error, { tags: { origin: "react.tldraw-before-app" } }),
|
|
126
|
+
children: container && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LicenseProvider.LicenseProvider, { licenseKey: rest.licenseKey, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useContainer.ContainerProvider, { container, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EditorPortal.EditorPortalProvider, { host: portalHost, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useEditorComponents.EditorComponentsProvider, { overrides: components, children: store ? store instanceof import_store.Store ? (
|
|
127
|
+
// Store is ready to go, whether externally synced or not
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithReadyStore, { ...withDefaults, store, user })
|
|
129
|
+
) : (
|
|
130
|
+
// Store is a synced store, so handle syncing stages internally
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithLoadingStore, { ...withDefaults, store, user })
|
|
132
|
+
) : (
|
|
133
|
+
// We have no store (it's undefined) so create one and possibly sync it
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawEditorWithOwnStore, { ...withDefaults, store, user })
|
|
135
|
+
) }) }) }) })
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "tl-portal-host", ref: setPortalHost })
|
|
139
|
+
]
|
|
135
140
|
}
|
|
136
141
|
);
|
|
137
142
|
});
|