@tldraw/editor 3.8.0-canary.a5d08406113a → 3.8.0-canary.a6600c088213
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 +250 -58
- package/dist-cjs/index.js +14 -8
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +2 -5
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/config/TLSessionStateSnapshot.js.map +2 -2
- package/dist-cjs/lib/config/createTLStore.js +4 -2
- package/dist-cjs/lib/config/createTLStore.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +83 -19
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SnapManager/BoundsSnaps.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TextManager.js +1 -0
- package/dist-cjs/lib/editor/managers/TextManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/shared/resizeScaled.js +66 -0
- package/dist-cjs/lib/editor/shapes/shared/resizeScaled.js.map +7 -0
- package/dist-cjs/lib/editor/types/SvgExportContext.js.map +2 -2
- package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
- package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
- package/dist-cjs/lib/editor/types/misc-types.js.map +1 -1
- package/dist-cjs/lib/exports/StyleEmbedder.js.map +2 -2
- package/dist-cjs/lib/exports/exportToSvg.js.map +2 -2
- package/dist-cjs/lib/exports/getSvgAsImage.js +83 -0
- package/dist-cjs/lib/exports/getSvgAsImage.js.map +7 -0
- package/dist-cjs/lib/exports/getSvgJsx.js +16 -3
- package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
- package/dist-cjs/lib/hooks/useLocalStore.js +1 -1
- package/dist-cjs/lib/hooks/useLocalStore.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/browserCanvasMaxSize.js +75 -0
- package/dist-cjs/lib/utils/browserCanvasMaxSize.js.map +7 -0
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js +3 -1
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +250 -58
- package/dist-esm/index.mjs +7 -1
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +2 -5
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/config/TLSessionStateSnapshot.mjs.map +2 -2
- package/dist-esm/lib/config/createTLStore.mjs +4 -2
- package/dist-esm/lib/config/createTLStore.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +83 -19
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SnapManager/BoundsSnaps.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TextManager.mjs +1 -0
- package/dist-esm/lib/editor/managers/TextManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/shared/resizeScaled.mjs +46 -0
- package/dist-esm/lib/editor/shapes/shared/resizeScaled.mjs.map +7 -0
- package/dist-esm/lib/editor/types/SvgExportContext.mjs.map +2 -2
- package/dist-esm/lib/exports/StyleEmbedder.mjs.map +2 -2
- package/dist-esm/lib/exports/exportToSvg.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgAsImage.mjs +63 -0
- package/dist-esm/lib/exports/getSvgAsImage.mjs.map +7 -0
- package/dist-esm/lib/exports/getSvgJsx.mjs +16 -3
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
- package/dist-esm/lib/hooks/useLocalStore.mjs +1 -1
- package/dist-esm/lib/hooks/useLocalStore.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/browserCanvasMaxSize.mjs +45 -0
- package/dist-esm/lib/utils/browserCanvasMaxSize.mjs.map +7 -0
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs +3 -1
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +2 -1
- package/package.json +22 -20
- package/src/index.ts +19 -1
- package/src/lib/components/default-components/DefaultCanvas.tsx +2 -5
- package/src/lib/config/TLSessionStateSnapshot.ts +3 -1
- package/src/lib/config/createTLStore.ts +4 -2
- package/src/lib/editor/Editor.ts +132 -42
- package/src/lib/editor/managers/SnapManager/BoundsSnaps.ts +4 -4
- package/src/lib/editor/managers/TextManager.ts +1 -0
- package/src/lib/editor/shapes/ShapeUtil.ts +30 -1
- package/src/lib/editor/shapes/shared/resizeScaled.ts +61 -0
- package/src/lib/editor/types/SvgExportContext.tsx +21 -0
- package/src/lib/editor/types/emit-types.ts +1 -0
- package/src/lib/editor/types/external-content.ts +90 -50
- package/src/lib/editor/types/misc-types.ts +55 -2
- package/src/lib/exports/StyleEmbedder.ts +1 -1
- package/src/lib/exports/exportToSvg.tsx +2 -2
- package/src/lib/exports/getSvgAsImage.ts +92 -0
- package/src/lib/exports/getSvgJsx.tsx +17 -2
- package/src/lib/hooks/useLocalStore.ts +1 -1
- package/src/lib/options.ts +6 -0
- package/src/lib/utils/browserCanvasMaxSize.ts +65 -0
- package/src/lib/utils/sync/TLLocalSyncClient.ts +3 -1
- package/src/version.ts +3 -3
package/dist-esm/index.d.mts
CHANGED
|
@@ -68,6 +68,7 @@ import { TLPropsMigrations } from '@tldraw/tlschema';
|
|
|
68
68
|
import { TLRecord } from '@tldraw/tlschema';
|
|
69
69
|
import { TLScribble } from '@tldraw/tlschema';
|
|
70
70
|
import { TLShape } from '@tldraw/tlschema';
|
|
71
|
+
import { TLShapeCrop } from '@tldraw/tlschema';
|
|
71
72
|
import { TLShapeId } from '@tldraw/tlschema';
|
|
72
73
|
import { TLShapePartial } from '@tldraw/tlschema';
|
|
73
74
|
import { TLStore } from '@tldraw/tlschema';
|
|
@@ -536,6 +537,8 @@ export declare type BoxLike = Box | BoxModel;
|
|
|
536
537
|
*/
|
|
537
538
|
export declare function canonicalizeRotation(a: number): number;
|
|
538
539
|
|
|
540
|
+
/* Excluded from this release type: CanvasMaxSize */
|
|
541
|
+
|
|
539
542
|
/**
|
|
540
543
|
* Get the center of a circle from three points.
|
|
541
544
|
*
|
|
@@ -615,6 +618,8 @@ export declare function clamp(n: number, min: number, max: number): number;
|
|
|
615
618
|
*/
|
|
616
619
|
export declare function clampRadians(r: number): number;
|
|
617
620
|
|
|
621
|
+
/* Excluded from this release type: clampToBrowserMaxCanvasSize */
|
|
622
|
+
|
|
618
623
|
/** @public */
|
|
619
624
|
export declare class ClickManager {
|
|
620
625
|
editor: Editor;
|
|
@@ -880,6 +885,7 @@ export declare const defaultTldrawOptions: {
|
|
|
880
885
|
readonly maxPointsPerDrawShape: 500;
|
|
881
886
|
readonly maxShapesPerPage: 4000;
|
|
882
887
|
readonly multiClickDurationMs: 200;
|
|
888
|
+
readonly noteShapeResizeMode: "none";
|
|
883
889
|
readonly temporaryAssetPreviewLifetimeMs: 180000;
|
|
884
890
|
readonly textShadowLod: 0.35;
|
|
885
891
|
};
|
|
@@ -1113,6 +1119,14 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1113
1119
|
getShapeUtil<S extends TLUnknownShape>(shape: S | TLShapePartial<S>): ShapeUtil<S>;
|
|
1114
1120
|
getShapeUtil<S extends TLUnknownShape>(type: S['type']): ShapeUtil<S>;
|
|
1115
1121
|
getShapeUtil<T extends ShapeUtil>(type: T extends ShapeUtil<infer R> ? R['type'] : string): T;
|
|
1122
|
+
/**
|
|
1123
|
+
* Returns true if the editor has a shape util for the given shape / shape type.
|
|
1124
|
+
*
|
|
1125
|
+
* @param shape - A shape, shape partial, or shape type.
|
|
1126
|
+
*/
|
|
1127
|
+
hasShapeUtil<S extends TLUnknownShape>(shape: S | TLShapePartial<S>): boolean;
|
|
1128
|
+
hasShapeUtil<S extends TLUnknownShape>(type: S['type']): boolean;
|
|
1129
|
+
hasShapeUtil<T extends ShapeUtil>(type: T extends ShapeUtil<infer R> ? R['type'] : string): boolean;
|
|
1116
1130
|
/**
|
|
1117
1131
|
* A map of shape utility classes (TLShapeUtils) by shape type.
|
|
1118
1132
|
*
|
|
@@ -2348,6 +2362,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2348
2362
|
*/
|
|
2349
2363
|
getAsset<T extends TLAsset>(asset: T | T['id']): T | undefined;
|
|
2350
2364
|
resolveAssetUrl(assetId: null | TLAssetId, context: {
|
|
2365
|
+
dpr?: number;
|
|
2351
2366
|
screenScale?: number;
|
|
2352
2367
|
shouldResolveToOriginal?: boolean;
|
|
2353
2368
|
}): Promise<null | string>;
|
|
@@ -2355,7 +2370,10 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2355
2370
|
* Upload an asset to the store's asset service, returning a URL that can be used to resolve the
|
|
2356
2371
|
* asset.
|
|
2357
2372
|
*/
|
|
2358
|
-
uploadAsset(asset: TLAsset, file: File, abortSignal?: AbortSignal): Promise<
|
|
2373
|
+
uploadAsset(asset: TLAsset, file: File, abortSignal?: AbortSignal): Promise<{
|
|
2374
|
+
meta?: JsonObject;
|
|
2375
|
+
src: string;
|
|
2376
|
+
}>;
|
|
2359
2377
|
private _getShapeGeometryCache;
|
|
2360
2378
|
/**
|
|
2361
2379
|
* Get the geometry of a shape.
|
|
@@ -3426,7 +3444,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3426
3444
|
*
|
|
3427
3445
|
* @public
|
|
3428
3446
|
*/
|
|
3429
|
-
registerExternalAssetHandler<T extends
|
|
3447
|
+
registerExternalAssetHandler<T extends TLExternalAsset['type']>(type: T, handler: ((info: TLExternalAsset & {
|
|
3430
3448
|
type: T;
|
|
3431
3449
|
}) => Promise<TLAsset>) | null): this;
|
|
3432
3450
|
/**
|
|
@@ -3472,8 +3490,8 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3472
3490
|
* @param info - Info about the external content.
|
|
3473
3491
|
* @returns The asset.
|
|
3474
3492
|
*/
|
|
3475
|
-
getAssetForExternalContent(info:
|
|
3476
|
-
hasExternalAssetHandler(type:
|
|
3493
|
+
getAssetForExternalContent(info: TLExternalAsset): Promise<TLAsset | undefined>;
|
|
3494
|
+
hasExternalAssetHandler(type: TLExternalAsset['type']): boolean;
|
|
3477
3495
|
/* Excluded from this release type: externalContentHandlers */
|
|
3478
3496
|
/**
|
|
3479
3497
|
* Register an external content handler. This handler will be called when the editor receives
|
|
@@ -3538,7 +3556,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3538
3556
|
*
|
|
3539
3557
|
* @public
|
|
3540
3558
|
*/
|
|
3541
|
-
getSvgElement(shapes: TLShape[] | TLShapeId[], opts?:
|
|
3559
|
+
getSvgElement(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<{
|
|
3542
3560
|
height: number;
|
|
3543
3561
|
svg: SVGSVGElement;
|
|
3544
3562
|
width: number;
|
|
@@ -3553,13 +3571,27 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3553
3571
|
*
|
|
3554
3572
|
* @public
|
|
3555
3573
|
*/
|
|
3556
|
-
getSvgString(shapes: TLShape[] | TLShapeId[], opts?:
|
|
3574
|
+
getSvgString(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<{
|
|
3557
3575
|
height: number;
|
|
3558
3576
|
svg: string;
|
|
3559
3577
|
width: number;
|
|
3560
3578
|
} | undefined>;
|
|
3561
3579
|
/** @deprecated Use {@link Editor.getSvgString} or {@link Editor.getSvgElement} instead. */
|
|
3562
|
-
getSvg(shapes: TLShape[] | TLShapeId[], opts?:
|
|
3580
|
+
getSvg(shapes: TLShape[] | TLShapeId[], opts?: TLSvgExportOptions): Promise<SVGSVGElement | undefined>;
|
|
3581
|
+
/**
|
|
3582
|
+
* Get an exported image of the given shapes.
|
|
3583
|
+
*
|
|
3584
|
+
* @param shapes - The shapes (or shape ids) to export.
|
|
3585
|
+
* @param opts - Options for the export.
|
|
3586
|
+
*
|
|
3587
|
+
* @returns A blob of the image.
|
|
3588
|
+
* @public
|
|
3589
|
+
*/
|
|
3590
|
+
toImage(shapes: TLShape[] | TLShapeId[], opts?: TLImageExportOptions): Promise<{
|
|
3591
|
+
blob: Blob;
|
|
3592
|
+
height: number;
|
|
3593
|
+
width: number;
|
|
3594
|
+
}>;
|
|
3563
3595
|
/**
|
|
3564
3596
|
* The app's current input state.
|
|
3565
3597
|
*
|
|
@@ -4073,6 +4105,15 @@ export declare function getPolygonVertices(width: number, height: number, sides:
|
|
|
4073
4105
|
/** @public */
|
|
4074
4106
|
export declare function getSnapshot(store: TLStore): TLEditorSnapshot;
|
|
4075
4107
|
|
|
4108
|
+
/** @public */
|
|
4109
|
+
export declare function getSvgAsImage(svgString: string, options: {
|
|
4110
|
+
height: number;
|
|
4111
|
+
pixelRatio?: number;
|
|
4112
|
+
quality?: number;
|
|
4113
|
+
type: 'jpeg' | 'png' | 'webp';
|
|
4114
|
+
width: number;
|
|
4115
|
+
}): Promise<Blob | null>;
|
|
4116
|
+
|
|
4076
4117
|
/**
|
|
4077
4118
|
* Turn an array of points into a path of quadradic curves.
|
|
4078
4119
|
*
|
|
@@ -4652,6 +4693,23 @@ export declare interface ResizeBoxOptions {
|
|
|
4652
4693
|
maxHeight?: number;
|
|
4653
4694
|
}
|
|
4654
4695
|
|
|
4696
|
+
/**
|
|
4697
|
+
* Resize a shape that has a scale prop.
|
|
4698
|
+
*
|
|
4699
|
+
* @param shape - The shape to resize
|
|
4700
|
+
* @param info - The resize info
|
|
4701
|
+
*
|
|
4702
|
+
* @public */
|
|
4703
|
+
export declare function resizeScaled(shape: TLBaseShape<any, {
|
|
4704
|
+
scale: number;
|
|
4705
|
+
}>, { initialBounds, scaleX, scaleY, newPoint, handle }: TLResizeInfo<any>): {
|
|
4706
|
+
props: {
|
|
4707
|
+
scale: number;
|
|
4708
|
+
};
|
|
4709
|
+
x: number;
|
|
4710
|
+
y: number;
|
|
4711
|
+
};
|
|
4712
|
+
|
|
4655
4713
|
/** @public */
|
|
4656
4714
|
export declare const ROTATE_CORNER_TO_SELECTION_CORNER: {
|
|
4657
4715
|
readonly bottom_left_rotate: "bottom_left";
|
|
@@ -5023,6 +5081,15 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
|
|
|
5023
5081
|
* @public
|
|
5024
5082
|
*/
|
|
5025
5083
|
onBeforeUpdate?(prev: Shape, next: Shape): Shape | void;
|
|
5084
|
+
/**
|
|
5085
|
+
* A callback called when a shape changes from a crop.
|
|
5086
|
+
*
|
|
5087
|
+
* @param shape - The shape at the start of the crop.
|
|
5088
|
+
* @param info - Info about the crop.
|
|
5089
|
+
* @returns A change to apply to the shape, or void.
|
|
5090
|
+
* @public
|
|
5091
|
+
*/
|
|
5092
|
+
onCrop?(shape: Shape, info: TLCropInfo<Shape>): Omit<TLShapePartial<Shape>, 'id' | 'type'> | undefined | void;
|
|
5026
5093
|
/**
|
|
5027
5094
|
* A callback called when some other shapes are dragged over this one.
|
|
5028
5095
|
*
|
|
@@ -5404,10 +5471,27 @@ export declare interface SvgExportContext {
|
|
|
5404
5471
|
* method depending on your use-case.
|
|
5405
5472
|
*/
|
|
5406
5473
|
waitUntil(promise: Promise<void>): void;
|
|
5474
|
+
/**
|
|
5475
|
+
* Resolve an asset URL in the context of this export. Supply the asset ID and the width in
|
|
5476
|
+
* shape-pixels it'll be displayed at, and this will resolve the asset according to the export
|
|
5477
|
+
* options.
|
|
5478
|
+
*/
|
|
5479
|
+
resolveAssetUrl(assetId: TLAssetId, width: number): Promise<null | string>;
|
|
5407
5480
|
/**
|
|
5408
5481
|
* Whether the export should be in dark mode.
|
|
5409
5482
|
*/
|
|
5410
5483
|
readonly isDarkMode: boolean;
|
|
5484
|
+
/**
|
|
5485
|
+
* The scale of the export - how much CSS pixels will be scaled up/down by.
|
|
5486
|
+
*/
|
|
5487
|
+
readonly scale: number;
|
|
5488
|
+
/**
|
|
5489
|
+
* Use this value to optionally downscale images in the export. If we're exporting directly to
|
|
5490
|
+
* an SVG, this will usually be null, and you shouldn't downscale images. If the export is to a
|
|
5491
|
+
* raster format like PNG, this will be the number of raster pixels in the resulting bitmap per
|
|
5492
|
+
* CSS pixel in the resulting SVG.
|
|
5493
|
+
*/
|
|
5494
|
+
readonly pixelRatio: null | number;
|
|
5411
5495
|
}
|
|
5412
5496
|
|
|
5413
5497
|
/** @public */
|
|
@@ -5498,6 +5582,12 @@ export declare interface TLBaseEventInfo {
|
|
|
5498
5582
|
accelKey: boolean;
|
|
5499
5583
|
}
|
|
5500
5584
|
|
|
5585
|
+
/** @public */
|
|
5586
|
+
export declare interface TLBaseExternalContent {
|
|
5587
|
+
sources?: TLExternalContentSource[];
|
|
5588
|
+
point?: VecLike;
|
|
5589
|
+
}
|
|
5590
|
+
|
|
5501
5591
|
/** @public */
|
|
5502
5592
|
export declare interface TLBindingUtilConstructor<T extends TLUnknownBinding, U extends BindingUtil<T> = BindingUtil<T>> {
|
|
5503
5593
|
new (editor: Editor): U;
|
|
@@ -5663,6 +5753,24 @@ export declare interface TLContent {
|
|
|
5663
5753
|
schema: SerializedSchema;
|
|
5664
5754
|
}
|
|
5665
5755
|
|
|
5756
|
+
/**
|
|
5757
|
+
* Info about a crop.
|
|
5758
|
+
* @param handle - The handle being dragged.
|
|
5759
|
+
* @param change - The distance the handle is moved.
|
|
5760
|
+
* @param initialShape - The shape at the start of the resize.
|
|
5761
|
+
* @public
|
|
5762
|
+
*/
|
|
5763
|
+
export declare interface TLCropInfo<T extends TLShape> {
|
|
5764
|
+
handle: SelectionHandle;
|
|
5765
|
+
change: Vec;
|
|
5766
|
+
crop: TLShapeCrop;
|
|
5767
|
+
uncroppedSize: {
|
|
5768
|
+
h: number;
|
|
5769
|
+
w: number;
|
|
5770
|
+
};
|
|
5771
|
+
initialShape: T;
|
|
5772
|
+
}
|
|
5773
|
+
|
|
5666
5774
|
/** @public */
|
|
5667
5775
|
export declare interface TLCursorProps {
|
|
5668
5776
|
className?: string;
|
|
@@ -5915,6 +6023,11 @@ export declare interface TldrawOptions {
|
|
|
5915
6023
|
readonly exportProvider: ComponentType<{
|
|
5916
6024
|
children: React.ReactNode;
|
|
5917
6025
|
}>;
|
|
6026
|
+
/**
|
|
6027
|
+
* How should the note shape resize? By default it does not resize (except automatically based on its text content),
|
|
6028
|
+
* but you can set it to be user-resizable using scale.
|
|
6029
|
+
*/
|
|
6030
|
+
readonly noteShapeResizeMode: 'none' | 'scale';
|
|
5918
6031
|
}
|
|
5919
6032
|
|
|
5920
6033
|
/** @public */
|
|
@@ -6016,6 +6129,13 @@ export declare interface TLEditorSnapshot {
|
|
|
6016
6129
|
session: TLSessionStateSnapshot;
|
|
6017
6130
|
}
|
|
6018
6131
|
|
|
6132
|
+
/** @public */
|
|
6133
|
+
export declare interface TLEmbedExternalContent<EmbedDefinition> extends TLBaseExternalContent {
|
|
6134
|
+
type: 'embed';
|
|
6135
|
+
url: string;
|
|
6136
|
+
embed: EmbedDefinition;
|
|
6137
|
+
}
|
|
6138
|
+
|
|
6019
6139
|
/** @public */
|
|
6020
6140
|
export declare type TLEnterEventHandler = (info: any, from: string) => void;
|
|
6021
6141
|
|
|
@@ -6041,6 +6161,13 @@ export declare interface TLErrorBoundaryProps {
|
|
|
6041
6161
|
fallback: TLErrorFallbackComponent;
|
|
6042
6162
|
}
|
|
6043
6163
|
|
|
6164
|
+
/** @public */
|
|
6165
|
+
export declare interface TLErrorExternalContentSource {
|
|
6166
|
+
type: 'error';
|
|
6167
|
+
data: null | string;
|
|
6168
|
+
reason: string;
|
|
6169
|
+
}
|
|
6170
|
+
|
|
6044
6171
|
/** @public */
|
|
6045
6172
|
export declare type TLErrorFallbackComponent = ComponentType<{
|
|
6046
6173
|
editor?: Editor;
|
|
@@ -6086,6 +6213,7 @@ export declare interface TLEventMap {
|
|
|
6086
6213
|
}];
|
|
6087
6214
|
'stop-camera-animation': [];
|
|
6088
6215
|
'stop-following': [];
|
|
6216
|
+
'before-event': [TLEventInfo];
|
|
6089
6217
|
event: [TLEventInfo];
|
|
6090
6218
|
tick: [number];
|
|
6091
6219
|
frame: [number];
|
|
@@ -6100,58 +6228,40 @@ export declare type TLEventMapHandler<T extends keyof TLEventMap> = (...args: TL
|
|
|
6100
6228
|
/** @public */
|
|
6101
6229
|
export declare type TLEventName = 'cancel' | 'complete' | 'interrupt' | 'tick' | 'wheel' | TLCLickEventName | TLKeyboardEventName | TLPinchEventName | TLPointerEventName;
|
|
6102
6230
|
|
|
6231
|
+
/** @public */
|
|
6232
|
+
export declare interface TLExcalidrawExternalContentSource {
|
|
6233
|
+
type: 'excalidraw';
|
|
6234
|
+
data: any;
|
|
6235
|
+
}
|
|
6236
|
+
|
|
6103
6237
|
/** @public */
|
|
6104
6238
|
export declare type TLExitEventHandler = (info: any, to: string) => void;
|
|
6105
6239
|
|
|
6106
6240
|
/** @public */
|
|
6107
|
-
export declare type
|
|
6108
|
-
|
|
6109
|
-
|
|
6241
|
+
export declare type TLExportType = 'jpeg' | 'png' | 'svg' | 'webp';
|
|
6242
|
+
|
|
6243
|
+
/** @public */
|
|
6244
|
+
export declare type TLExternalAsset = TLFileExternalAsset | TLUrlExternalAsset;
|
|
6245
|
+
|
|
6246
|
+
/** @public */
|
|
6247
|
+
export declare type TLExternalContent<EmbedDefinition> = TLEmbedExternalContent<EmbedDefinition> | TLFilesExternalContent | TLSvgTextExternalContent | TLTextExternalContent | TLUrlExternalContent;
|
|
6248
|
+
|
|
6249
|
+
/** @public */
|
|
6250
|
+
export declare type TLExternalContentSource = TLErrorExternalContentSource | TLExcalidrawExternalContentSource | TLTextExternalContentSource | TLTldrawExternalContentSource;
|
|
6251
|
+
|
|
6252
|
+
/** @public */
|
|
6253
|
+
export declare interface TLFileExternalAsset {
|
|
6110
6254
|
type: 'file';
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
};
|
|
6255
|
+
file: File;
|
|
6256
|
+
assetId?: TLAssetId;
|
|
6257
|
+
}
|
|
6115
6258
|
|
|
6116
6259
|
/** @public */
|
|
6117
|
-
export declare
|
|
6118
|
-
|
|
6119
|
-
sources?: TLExternalContentSource[];
|
|
6120
|
-
} & ({
|
|
6121
|
-
embed: EmbedDefinition;
|
|
6122
|
-
type: 'embed';
|
|
6123
|
-
url: string;
|
|
6124
|
-
} | {
|
|
6260
|
+
export declare interface TLFilesExternalContent extends TLBaseExternalContent {
|
|
6261
|
+
type: 'files';
|
|
6125
6262
|
files: File[];
|
|
6126
6263
|
ignoreParent: boolean;
|
|
6127
|
-
|
|
6128
|
-
} | {
|
|
6129
|
-
text: string;
|
|
6130
|
-
type: 'svg-text';
|
|
6131
|
-
} | {
|
|
6132
|
-
text: string;
|
|
6133
|
-
type: 'text';
|
|
6134
|
-
} | {
|
|
6135
|
-
type: 'url';
|
|
6136
|
-
url: string;
|
|
6137
|
-
});
|
|
6138
|
-
|
|
6139
|
-
/** @public */
|
|
6140
|
-
export declare type TLExternalContentSource = {
|
|
6141
|
-
data: any;
|
|
6142
|
-
type: 'excalidraw';
|
|
6143
|
-
} | {
|
|
6144
|
-
data: null | string;
|
|
6145
|
-
reason: string;
|
|
6146
|
-
type: 'error';
|
|
6147
|
-
} | {
|
|
6148
|
-
data: string;
|
|
6149
|
-
subtype: 'html' | 'json' | 'text' | 'url';
|
|
6150
|
-
type: 'text';
|
|
6151
|
-
} | {
|
|
6152
|
-
data: TLContent;
|
|
6153
|
-
type: 'tldraw';
|
|
6154
|
-
};
|
|
6264
|
+
}
|
|
6155
6265
|
|
|
6156
6266
|
/** @public */
|
|
6157
6267
|
export declare interface TLGridProps {
|
|
@@ -6209,15 +6319,16 @@ export declare interface TLHistoryMark {
|
|
|
6209
6319
|
}
|
|
6210
6320
|
|
|
6211
6321
|
/** @public */
|
|
6212
|
-
export declare interface TLImageExportOptions {
|
|
6213
|
-
|
|
6214
|
-
|
|
6322
|
+
export declare interface TLImageExportOptions extends TLSvgExportOptions {
|
|
6323
|
+
/**
|
|
6324
|
+
* If the export is being converted to a lossy bitmap format (e.g. jpeg), this is the quality of
|
|
6325
|
+
* the export. This is a number between 0 and 1.
|
|
6326
|
+
*/
|
|
6215
6327
|
quality?: number;
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
preserveAspectRatio?: React.SVGAttributes<SVGSVGElement>['preserveAspectRatio'];
|
|
6328
|
+
/**
|
|
6329
|
+
* The format to export as. Defaults to 'png'.
|
|
6330
|
+
*/
|
|
6331
|
+
format?: TLExportType;
|
|
6221
6332
|
}
|
|
6222
6333
|
|
|
6223
6334
|
/** @public */
|
|
@@ -6721,12 +6832,75 @@ export declare type TLStoreWithStatus = {
|
|
|
6721
6832
|
readonly store: TLStore;
|
|
6722
6833
|
};
|
|
6723
6834
|
|
|
6835
|
+
/** @public */
|
|
6836
|
+
export declare interface TLSvgExportOptions {
|
|
6837
|
+
/**
|
|
6838
|
+
* The bounding box, in page coordinates, of the area being exported.
|
|
6839
|
+
*/
|
|
6840
|
+
bounds?: Box;
|
|
6841
|
+
/**
|
|
6842
|
+
* The logical scale of the export. This scales the resulting size of the SVG being generated.
|
|
6843
|
+
*/
|
|
6844
|
+
scale?: number;
|
|
6845
|
+
/**
|
|
6846
|
+
* When exporting an SVG, the expected pixel ratio of the export will be passed in to
|
|
6847
|
+
* {@link @tldraw/tlschema#TLAssetStore.resolve} as the `dpr` property, so that assets can be
|
|
6848
|
+
* downscaled to the appropriate resolution.
|
|
6849
|
+
*
|
|
6850
|
+
* When exporting to a bitmap image format, the size of the resulting image will be multiplied
|
|
6851
|
+
* by this number.
|
|
6852
|
+
*
|
|
6853
|
+
* For SVG exports, this defaults to undefined - which means we'll request original-quality
|
|
6854
|
+
* assets. For bitmap exports, this defaults to 2.
|
|
6855
|
+
*/
|
|
6856
|
+
pixelRatio?: number;
|
|
6857
|
+
/**
|
|
6858
|
+
* Should the background color be included in the export? If false, the generated image will be
|
|
6859
|
+
* transparent (if exporting to a format that supports transparency).
|
|
6860
|
+
*/
|
|
6861
|
+
background?: boolean;
|
|
6862
|
+
/**
|
|
6863
|
+
* How much padding to include around the bounds of exports? Defaults to 32px.
|
|
6864
|
+
*/
|
|
6865
|
+
padding?: number;
|
|
6866
|
+
/**
|
|
6867
|
+
* Should the export be rendered in dark mode (true) or light mode (false)? Defaults to the
|
|
6868
|
+
* current instance's dark mode setting.
|
|
6869
|
+
*/
|
|
6870
|
+
darkMode?: boolean;
|
|
6871
|
+
/**
|
|
6872
|
+
* The
|
|
6873
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio | `preserveAspectRatio` }
|
|
6874
|
+
* attribute of the SVG element.
|
|
6875
|
+
*/
|
|
6876
|
+
preserveAspectRatio?: React.SVGAttributes<SVGSVGElement>['preserveAspectRatio'];
|
|
6877
|
+
}
|
|
6878
|
+
|
|
6724
6879
|
/**
|
|
6725
6880
|
* @public
|
|
6726
6881
|
* @deprecated use {@link TLImageExportOptions} instead
|
|
6727
6882
|
*/
|
|
6728
6883
|
export declare type TLSvgOptions = TLImageExportOptions;
|
|
6729
6884
|
|
|
6885
|
+
/** @public */
|
|
6886
|
+
export declare interface TLSvgTextExternalContent extends TLBaseExternalContent {
|
|
6887
|
+
type: 'svg-text';
|
|
6888
|
+
text: string;
|
|
6889
|
+
}
|
|
6890
|
+
|
|
6891
|
+
/** @public */
|
|
6892
|
+
export declare interface TLTextExternalContent extends TLBaseExternalContent {
|
|
6893
|
+
type: 'text';
|
|
6894
|
+
text: string;
|
|
6895
|
+
}
|
|
6896
|
+
|
|
6897
|
+
/** @public */
|
|
6898
|
+
export declare interface TLTextExternalContentSource {
|
|
6899
|
+
type: 'text';
|
|
6900
|
+
data: string;
|
|
6901
|
+
subtype: 'html' | 'json' | 'text' | 'url';
|
|
6902
|
+
}
|
|
6903
|
+
|
|
6730
6904
|
/** @public */
|
|
6731
6905
|
export declare type TLTickEvent = (info: TLTickEventInfo) => void;
|
|
6732
6906
|
|
|
@@ -6744,6 +6918,24 @@ export declare interface TLTickEventInfo {
|
|
|
6744
6918
|
*/
|
|
6745
6919
|
export declare const tltime: Timers;
|
|
6746
6920
|
|
|
6921
|
+
/** @public */
|
|
6922
|
+
export declare interface TLTldrawExternalContentSource {
|
|
6923
|
+
type: 'tldraw';
|
|
6924
|
+
data: TLContent;
|
|
6925
|
+
}
|
|
6926
|
+
|
|
6927
|
+
/** @public */
|
|
6928
|
+
export declare interface TLUrlExternalAsset {
|
|
6929
|
+
type: 'url';
|
|
6930
|
+
url: string;
|
|
6931
|
+
}
|
|
6932
|
+
|
|
6933
|
+
/** @public */
|
|
6934
|
+
export declare interface TLUrlExternalContent extends TLBaseExternalContent {
|
|
6935
|
+
type: 'url';
|
|
6936
|
+
url: string;
|
|
6937
|
+
}
|
|
6938
|
+
|
|
6747
6939
|
/** @public */
|
|
6748
6940
|
export declare interface TLUser {
|
|
6749
6941
|
readonly userPreferences: Signal<TLUserPreferences>;
|
package/dist-esm/index.mjs
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
useStateTracking,
|
|
24
24
|
useValue
|
|
25
25
|
} from "@tldraw/state-react";
|
|
26
|
+
import { resizeScaled } from "./lib/editor/shapes/shared/resizeScaled.mjs";
|
|
26
27
|
import { LocalIndexedDb, Table } from "./lib/utils/sync/LocalIndexedDb.mjs";
|
|
27
28
|
export * from "@tldraw/store";
|
|
28
29
|
export * from "@tldraw/tlschema";
|
|
@@ -142,6 +143,7 @@ import {
|
|
|
142
143
|
import {
|
|
143
144
|
EVENT_NAME_MAP
|
|
144
145
|
} from "./lib/editor/types/event-types.mjs";
|
|
146
|
+
import { getSvgAsImage } from "./lib/exports/getSvgAsImage.mjs";
|
|
145
147
|
import { tlenv } from "./lib/globals/environment.mjs";
|
|
146
148
|
import { tlmenus } from "./lib/globals/menus.mjs";
|
|
147
149
|
import { tltime } from "./lib/globals/time.mjs";
|
|
@@ -250,6 +252,7 @@ import {
|
|
|
250
252
|
SharedStyleMap
|
|
251
253
|
} from "./lib/utils/SharedStylesMap.mjs";
|
|
252
254
|
import { dataUrlToFile, getDefaultCdnBaseUrl } from "./lib/utils/assets.mjs";
|
|
255
|
+
import { clampToBrowserMaxCanvasSize } from "./lib/utils/browserCanvasMaxSize.mjs";
|
|
253
256
|
import {
|
|
254
257
|
debugFlags,
|
|
255
258
|
featureFlags
|
|
@@ -285,7 +288,7 @@ function debugEnableLicensing() {
|
|
|
285
288
|
}
|
|
286
289
|
registerTldrawLibraryVersion(
|
|
287
290
|
"@tldraw/editor",
|
|
288
|
-
"3.8.0-canary.
|
|
291
|
+
"3.8.0-canary.a6600c088213",
|
|
289
292
|
"esm"
|
|
290
293
|
);
|
|
291
294
|
export {
|
|
@@ -377,6 +380,7 @@ export {
|
|
|
377
380
|
centerOfCircleFromThreePoints,
|
|
378
381
|
clamp,
|
|
379
382
|
clampRadians,
|
|
383
|
+
clampToBrowserMaxCanvasSize,
|
|
380
384
|
clockwiseAngleDist,
|
|
381
385
|
computed,
|
|
382
386
|
coreShapes,
|
|
@@ -407,6 +411,7 @@ export {
|
|
|
407
411
|
getPolygonVertices,
|
|
408
412
|
getRotationSnapshot,
|
|
409
413
|
getSnapshot,
|
|
414
|
+
getSvgAsImage,
|
|
410
415
|
getSvgPathFromPoints,
|
|
411
416
|
getUserPreferences,
|
|
412
417
|
hardReset,
|
|
@@ -443,6 +448,7 @@ export {
|
|
|
443
448
|
refreshPage,
|
|
444
449
|
releasePointerCapture,
|
|
445
450
|
resizeBox,
|
|
451
|
+
resizeScaled,
|
|
446
452
|
rotateSelectionHandle,
|
|
447
453
|
runtime,
|
|
448
454
|
sanitizeId,
|
package/dist-esm/index.mjs.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'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\nexport {\n\tEMPTY_ARRAY,\n\tEffectScheduler,\n\tatom,\n\tcomputed,\n\treact,\n\ttransact,\n\ttransaction,\n\twhyAmIRunning,\n\ttype Atom,\n\ttype Signal,\n} from '@tldraw/state'\nexport {\n\ttrack,\n\tuseAtom,\n\tuseComputed,\n\tuseQuickReactor,\n\tuseReactor,\n\tuseStateTracking,\n\tuseValue,\n} from '@tldraw/state-react'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\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 { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport { DefaultShapeIndicators } from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tTAB_ID,\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tUSER_COLORS,\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\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 { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager'\nexport { ScribbleManager, type ScribbleItem } from './lib/editor/managers/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 { TextManager, type TLMeasureTextSpanOpts } from './lib/editor/managers/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport { getPerfectDashProps } from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\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 {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\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 TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\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 TLExternalAssetContent,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\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 TLImageExportOptions,\n\ttype TLSvgOptions,\n} from './lib/editor/types/misc-types'\nexport { type TLResizeHandle, type TLSelectionHandle } from './lib/editor/types/selection-types'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport { EditorContext, useEditor, useMaybeEditor } from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\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 { Geometry2d, type Geometry2dOptions } 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 {\n\tHALF_PI,\n\tPI,\n\tPI2,\n\tSIN,\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\tisSafeFloat,\n\tperimeterOfEllipse,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport {\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\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,oCAAoC;AAC7C,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,gBAAgB,aAA6B;AAEtD,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,qBAA8C;AACvD,SAAS,wBAAwB;AACjC,SAAS,oBAA4C;AACrD,SAAS,yBAAyB;AAClC,SAAS,oBAAuC;AAChD;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP,SAAS,mBAAqC;AAC9C;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AAEP;AAAA,EACC;AAAA,OAEM;AAEP,SAAS,8BAA8B;AACvC;AAAA,EACC;AAAA,OAEM;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAKM;AACP,SAAS,cAAc,qBAAkC;AAEzD,SAAS,kBAAkD;AAC3D,SAAS,2BAA2B,wBAAwB,aAAa;AACzE;AAAA,EACC;AAAA,OAKM;AACP;AAAA,EACC;AAAA,OAQM;AACP,SAAS,oBAAuC;AAChD,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,uBAA0C;AACnD;AAAA,EACC;AAAA,OAGM;AACP,SAAS,mBAA4C;AACrD;AAAA,EACC;AAAA,OAKM;AACP,SAAS,mBAA+C;AACxD,SAAS,8BAA8B;AACvC,SAAS,wBAA6C;AACtD;AAAA,EACC;AAAA,
|
|
4
|
+
"sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\nexport {\n\tEMPTY_ARRAY,\n\tEffectScheduler,\n\tatom,\n\tcomputed,\n\treact,\n\ttransact,\n\ttransaction,\n\twhyAmIRunning,\n\ttype Atom,\n\ttype Signal,\n} from '@tldraw/state'\nexport {\n\ttrack,\n\tuseAtom,\n\tuseComputed,\n\tuseQuickReactor,\n\tuseReactor,\n\tuseStateTracking,\n\tuseValue,\n} from '@tldraw/state-react'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\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 { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport { DefaultShapeIndicators } from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tTAB_ID,\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tUSER_COLORS,\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\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 { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager'\nexport { ScribbleManager, type ScribbleItem } from './lib/editor/managers/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 { TextManager, type TLMeasureTextSpanOpts } from './lib/editor/managers/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLHandleDragInfo,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport { getPerfectDashProps } from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\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 {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\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 TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\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 TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\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 TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLSvgOptions,\n} from './lib/editor/types/misc-types'\nexport { type TLResizeHandle, type TLSelectionHandle } from './lib/editor/types/selection-types'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport { EditorContext, useEditor, useMaybeEditor } from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\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 { Geometry2d, type Geometry2dOptions } 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 {\n\tHALF_PI,\n\tPI,\n\tPI2,\n\tSIN,\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\tisSafeFloat,\n\tperimeterOfEllipse,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\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\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|