@tldraw/editor 4.6.0-canary.a300e2d0a445 → 4.6.0-canary.a5ccc24cabd6

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.
Files changed (84) hide show
  1. package/dist-cjs/index.d.ts +310 -3
  2. package/dist-cjs/index.js +5 -1
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/components/MenuClickCapture.js +99 -38
  5. package/dist-cjs/lib/components/MenuClickCapture.js.map +2 -2
  6. package/dist-cjs/lib/editor/Editor.js +55 -1
  7. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  8. package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js +11 -0
  9. package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js.map +2 -2
  10. package/dist-cjs/lib/editor/managers/PerformanceManager/PerformanceApiAdapter.js +80 -0
  11. package/dist-cjs/lib/editor/managers/PerformanceManager/PerformanceApiAdapter.js.map +7 -0
  12. package/dist-cjs/lib/editor/managers/PerformanceManager/PerformanceManager.js +466 -0
  13. package/dist-cjs/lib/editor/managers/PerformanceManager/PerformanceManager.js.map +7 -0
  14. package/dist-cjs/lib/editor/managers/PerformanceManager/perf-types.js +17 -0
  15. package/dist-cjs/lib/editor/managers/PerformanceManager/perf-types.js.map +7 -0
  16. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +2 -2
  17. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  18. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js +1 -1
  19. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +2 -2
  20. package/dist-cjs/lib/editor/shapes/shared/getPerfectDashProps.js +6 -0
  21. package/dist-cjs/lib/editor/shapes/shared/getPerfectDashProps.js.map +2 -2
  22. package/dist-cjs/lib/editor/tools/StateNode.js +14 -17
  23. package/dist-cjs/lib/editor/tools/StateNode.js.map +2 -2
  24. package/dist-cjs/lib/hooks/useCanvasEvents.js +25 -4
  25. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  26. package/dist-cjs/lib/options.js +1 -0
  27. package/dist-cjs/lib/options.js.map +2 -2
  28. package/dist-cjs/lib/utils/runtime.js +2 -1
  29. package/dist-cjs/lib/utils/runtime.js.map +2 -2
  30. package/dist-cjs/lib/utils/sync/hardReset.js +0 -8
  31. package/dist-cjs/lib/utils/sync/hardReset.js.map +2 -2
  32. package/dist-cjs/version.js +3 -3
  33. package/dist-cjs/version.js.map +1 -1
  34. package/dist-esm/index.d.mts +310 -3
  35. package/dist-esm/index.mjs +5 -1
  36. package/dist-esm/index.mjs.map +2 -2
  37. package/dist-esm/lib/components/MenuClickCapture.mjs +100 -39
  38. package/dist-esm/lib/components/MenuClickCapture.mjs.map +2 -2
  39. package/dist-esm/lib/editor/Editor.mjs +56 -2
  40. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  41. package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs +11 -0
  42. package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs.map +2 -2
  43. package/dist-esm/lib/editor/managers/PerformanceManager/PerformanceApiAdapter.mjs +60 -0
  44. package/dist-esm/lib/editor/managers/PerformanceManager/PerformanceApiAdapter.mjs.map +7 -0
  45. package/dist-esm/lib/editor/managers/PerformanceManager/PerformanceManager.mjs +438 -0
  46. package/dist-esm/lib/editor/managers/PerformanceManager/PerformanceManager.mjs.map +7 -0
  47. package/dist-esm/lib/editor/managers/PerformanceManager/perf-types.mjs +1 -0
  48. package/dist-esm/lib/editor/managers/PerformanceManager/perf-types.mjs.map +7 -0
  49. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +2 -2
  50. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  51. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs +1 -1
  52. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +2 -2
  53. package/dist-esm/lib/editor/shapes/shared/getPerfectDashProps.mjs +6 -0
  54. package/dist-esm/lib/editor/shapes/shared/getPerfectDashProps.mjs.map +2 -2
  55. package/dist-esm/lib/editor/tools/StateNode.mjs +14 -17
  56. package/dist-esm/lib/editor/tools/StateNode.mjs.map +2 -2
  57. package/dist-esm/lib/hooks/useCanvasEvents.mjs +25 -4
  58. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  59. package/dist-esm/lib/options.mjs +1 -0
  60. package/dist-esm/lib/options.mjs.map +2 -2
  61. package/dist-esm/lib/utils/runtime.mjs +2 -1
  62. package/dist-esm/lib/utils/runtime.mjs.map +2 -2
  63. package/dist-esm/lib/utils/sync/hardReset.mjs +0 -8
  64. package/dist-esm/lib/utils/sync/hardReset.mjs.map +2 -2
  65. package/dist-esm/version.mjs +3 -3
  66. package/dist-esm/version.mjs.map +1 -1
  67. package/package.json +7 -7
  68. package/src/index.ts +15 -0
  69. package/src/lib/components/MenuClickCapture.tsx +129 -49
  70. package/src/lib/editor/Editor.ts +74 -6
  71. package/src/lib/editor/managers/InputsManager/InputsManager.ts +12 -0
  72. package/src/lib/editor/managers/PerformanceManager/PerformanceApiAdapter.ts +82 -0
  73. package/src/lib/editor/managers/PerformanceManager/PerformanceManager.test.ts +522 -0
  74. package/src/lib/editor/managers/PerformanceManager/PerformanceManager.ts +583 -0
  75. package/src/lib/editor/managers/PerformanceManager/perf-types.ts +196 -0
  76. package/src/lib/editor/shapes/ShapeUtil.ts +2 -2
  77. package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +1 -1
  78. package/src/lib/editor/shapes/shared/getPerfectDashProps.ts +7 -0
  79. package/src/lib/editor/tools/StateNode.ts +16 -18
  80. package/src/lib/hooks/useCanvasEvents.ts +40 -3
  81. package/src/lib/options.ts +7 -0
  82. package/src/lib/utils/runtime.ts +3 -1
  83. package/src/lib/utils/sync/hardReset.ts +0 -8
  84. package/src/version.ts +3 -3
@@ -996,6 +996,7 @@ export declare const defaultTldrawOptions: {
996
996
  readonly onBeforePasteFromClipboard: undefined;
997
997
  readonly onClipboardPasteRaw: undefined;
998
998
  readonly quickZoomPreservesScreenBounds: true;
999
+ readonly rightClickPanning: true;
999
1000
  readonly snapThreshold: 8;
1000
1001
  readonly spacebarPanning: true;
1001
1002
  readonly temporaryAssetPreviewLifetimeMs: 180000;
@@ -1166,6 +1167,12 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1166
1167
  * @public
1167
1168
  */
1168
1169
  readonly snaps: SnapManager;
1170
+ /**
1171
+ * A manager for performance measurement hooks.
1172
+ *
1173
+ * @public
1174
+ */
1175
+ readonly performance: PerformanceManager;
1169
1176
  /* Excluded from this release type: _spatialIndex */
1170
1177
  /**
1171
1178
  * A manager for the any asynchronous events and making sure they're
@@ -4775,7 +4782,7 @@ export declare class GroupShapeUtil extends ShapeUtil<TLGroupShape> {
4775
4782
  static type: "group";
4776
4783
  static props: RecordProps<TLGroupShape>;
4777
4784
  static migrations: TLPropsMigrations;
4778
- hideSelectionBoundsFg(): boolean;
4785
+ hideSelectionBoundsFg(shape: TLGroupShape): boolean;
4779
4786
  canBind(): boolean;
4780
4787
  canResize(): boolean;
4781
4788
  canResizeChildren(): boolean;
@@ -5061,6 +5068,12 @@ export declare class InputsManager {
5061
5068
  get isPointing(): boolean;
5062
5069
  set isPointing(isPointing: boolean);
5063
5070
  /* Excluded from this release type: setIsPointing */
5071
+ private _isRightPointing;
5072
+ /**
5073
+ * Whether the user is right-click pointing (before drag threshold).
5074
+ */
5075
+ getIsRightPointing(): boolean;
5076
+ /* Excluded from this release type: setIsRightPointing */
5064
5077
  private _isPinching;
5065
5078
  /**
5066
5079
  * Whether the user is pinching.
@@ -5417,6 +5430,94 @@ export declare function parseDeepLinkString(deepLinkString: string): TLDeepLink;
5417
5430
  /** @public */
5418
5431
  export declare type PerfectDashTerminal = 'none' | 'outset' | 'skip';
5419
5432
 
5433
+ /**
5434
+ * Optional adapter that pipes PerformanceManager events into browser
5435
+ * `performance.mark()` / `performance.measure()` for DevTools integration.
5436
+ *
5437
+ * Tree-shakeable — only included if imported.
5438
+ *
5439
+ * @example
5440
+ * ```ts
5441
+ * const adapter = new PerformanceApiAdapter(editor.performance)
5442
+ * // ... later
5443
+ * adapter.dispose()
5444
+ * ```
5445
+ *
5446
+ * @public
5447
+ */
5448
+ export declare class PerformanceApiAdapter {
5449
+ private cleanups;
5450
+ constructor(perfManager: PerformanceManager);
5451
+ /** Remove all listeners and stop piping events. @public */
5452
+ dispose(): void;
5453
+ }
5454
+
5455
+ /**
5456
+ * Manages performance event subscriptions for the editor. Available as `editor.performance`.
5457
+ *
5458
+ * Listeners are lazy — internal editor hooks (frame, shape events) are only attached while
5459
+ * at least one subscriber exists, so there is zero overhead when unused.
5460
+ *
5461
+ * @example
5462
+ * ```ts
5463
+ * const unsub = editor.performance.on('interaction-end', (event) => {
5464
+ * console.log(`${event.name}: ${event.fps.toFixed(1)} fps, p95=${event.p95FrameTime.toFixed(1)}ms`)
5465
+ * })
5466
+ * ```
5467
+ *
5468
+ * @public
5469
+ */
5470
+ export declare class PerformanceManager {
5471
+ /* Excluded from this release type: emitter */
5472
+ private editor;
5473
+ private activeInteraction;
5474
+ private activeCamera;
5475
+ private frameCleanup;
5476
+ private shapeCreatedCleanup;
5477
+ private shapeEditedCleanup;
5478
+ private shapeDeletedCleanup;
5479
+ private loafObserver;
5480
+ constructor(editor: Editor);
5481
+ /**
5482
+ * Subscribe to a performance event. Returns an unsubscribe function.
5483
+ *
5484
+ * @example
5485
+ * ```ts
5486
+ * const unsub = editor.performance.on('interaction-end', (event) => {
5487
+ * sendToAnalytics({ name: event.name, fps: event.fps, p95: event.p95FrameTime })
5488
+ * })
5489
+ * // later: unsub()
5490
+ * ```
5491
+ *
5492
+ * @public
5493
+ */
5494
+ on<K extends keyof TLPerfEventMap>(event: K, fn: (...args: TLPerfEventMap[K]) => void): () => void;
5495
+ /**
5496
+ * Subscribe to a performance event once. The listener is removed after the first invocation.
5497
+ * Returns an unsubscribe function for early removal.
5498
+ *
5499
+ * @public
5500
+ */
5501
+ once<K extends keyof TLPerfEventMap>(event: K, fn: (...args: TLPerfEventMap[K]) => void): () => void;
5502
+ /* Excluded from this release type: dispose */
5503
+ /* Excluded from this release type: _notifyInteractionStart */
5504
+ /* Excluded from this release type: _notifyInteractionEnd */
5505
+ /* Excluded from this release type: _notifyCameraOperation */
5506
+ /* Excluded from this release type: _notifyUndoRedo */
5507
+ private _startCameraSession;
5508
+ private _endCameraSession;
5509
+ private _onFrame;
5510
+ private _onShapesCreated;
5511
+ private _onShapesEdited;
5512
+ private _onShapesDeleted;
5513
+ private _startLoafObserver;
5514
+ private _stopLoafObserver;
5515
+ private _needsFrameListener;
5516
+ private _needsLoafObserver;
5517
+ private _maybeAttachLazyListeners;
5518
+ private _maybeDetachLazyListeners;
5519
+ }
5520
+
5420
5521
  /**
5421
5522
  * Find the approximate perimeter of an ellipse.
5422
5523
  *
@@ -6008,7 +6109,7 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
6008
6109
  *
6009
6110
  * @public
6010
6111
  */
6011
- canBind(_opts: TLShapeUtilCanBindOpts): boolean;
6112
+ canBind(opts: TLShapeUtilCanBindOpts): boolean;
6012
6113
  /**
6013
6114
  * Whether the shape can be double clicked to edit.
6014
6115
  *
@@ -6189,7 +6290,7 @@ export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
6189
6290
  * @param type - The shape type.
6190
6291
  * @public
6191
6292
  */
6192
- canReceiveNewChildrenOfType(shape: Shape, _type: TLShape['type']): boolean;
6293
+ canReceiveNewChildrenOfType(shape: Shape, type: TLShape['type']): boolean;
6193
6294
  /**
6194
6295
  * Get the shape as an SVG object.
6195
6296
  *
@@ -6632,6 +6733,8 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
6632
6733
  static children?: () => TLStateNodeConstructor[];
6633
6734
  static isLockable: boolean;
6634
6735
  static useCoalescedEvents: boolean;
6736
+ /** Set to `true` in subclasses to emit interaction-start/end performance events when this state is entered/exited. */
6737
+ static trackPerformance: boolean;
6635
6738
  id: string;
6636
6739
  type: 'branch' | 'leaf' | 'root';
6637
6740
  shapeType?: string;
@@ -7005,6 +7108,29 @@ export declare interface TLCameraConstraints {
7005
7108
  };
7006
7109
  }
7007
7110
 
7111
+ /**
7112
+ * Emitted when a camera operation ends (after a 50ms debounce), with aggregated frame time stats.
7113
+ * @public
7114
+ */
7115
+ export declare interface TLCameraEndPerfEvent extends TLPerfFrameTimeStats {
7116
+ /** Whether this was a pan or zoom operation. */
7117
+ type: 'panning' | 'zooming';
7118
+ /** Total shapes on the current page. */
7119
+ shapeCount: number;
7120
+ /** Number of shapes visible (not culled) in the viewport. */
7121
+ visibleShapeCount: number;
7122
+ /** Number of shapes culled (off-screen) from rendering. */
7123
+ culledShapeCount: number;
7124
+ /** Viewport width in screen pixels. */
7125
+ viewportWidth: number;
7126
+ /** Viewport height in screen pixels. */
7127
+ viewportHeight: number;
7128
+ /** Camera zoom level (`camera.z`) at session end. */
7129
+ zoomLevel: number;
7130
+ /** `performance.now()` when the camera session ended. */
7131
+ timestamp: number;
7132
+ }
7133
+
7008
7134
  /** @public */
7009
7135
  export declare interface TLCameraMoveOptions {
7010
7136
  /** Whether to move the camera immediately, rather than on the next tick. */
@@ -7043,6 +7169,17 @@ export declare interface TLCameraOptions {
7043
7169
  constraints?: TLCameraConstraints;
7044
7170
  }
7045
7171
 
7172
+ /**
7173
+ * Emitted when a camera operation (pan or zoom) begins.
7174
+ * @public
7175
+ */
7176
+ export declare interface TLCameraStartPerfEvent {
7177
+ /** Whether this is a pan or zoom operation. */
7178
+ type: 'panning' | 'zooming';
7179
+ /** `performance.now()` when the camera session started. */
7180
+ timestamp: number;
7181
+ }
7182
+
7046
7183
  /** @public */
7047
7184
  export declare type TLCancelEvent = (info: TLCancelEventInfo) => void;
7048
7185
 
@@ -7530,6 +7667,12 @@ export declare interface TldrawOptions {
7530
7667
  * When false, the spacebar will not pan the camera.
7531
7668
  */
7532
7669
  readonly spacebarPanning: boolean;
7670
+ /**
7671
+ * Whether to allow right-click + drag to pan the camera. When true, right-click + drag pans the
7672
+ * camera and a static right-click opens the context menu at the release position. When false,
7673
+ * right-click opens the context menu on press (no drag-to-pan).
7674
+ */
7675
+ readonly rightClickPanning: boolean;
7533
7676
  /**
7534
7677
  * The default padding (in pixels) used when zooming to fit content in the viewport.
7535
7678
  * This affects methods like `zoomToFit()`, `zoomToSelection()`, and `zoomToBounds()`.
@@ -7981,6 +8124,21 @@ export declare interface TLFilesExternalContent extends TLBaseExternalContent {
7981
8124
  ignoreParent?: boolean;
7982
8125
  }
7983
8126
 
8127
+ /**
8128
+ * Emitted every animation frame when at least one `'frame'` listener is registered.
8129
+ * @public
8130
+ */
8131
+ export declare interface TLFramePerfEvent {
8132
+ /** Time since the last frame in ms. */
8133
+ elapsed: number;
8134
+ /** Total shapes on the current page. */
8135
+ shapeCount: number;
8136
+ /** Number of shapes culled (off-screen) from rendering. */
8137
+ culledShapeCount: number;
8138
+ /** Number of shapes visible (not culled) in the viewport. */
8139
+ visibleShapeCount: number;
8140
+ }
8141
+
7984
8142
  /** Additional options for the {@link ShapeUtil.getGeometry} method.
7985
8143
  *
7986
8144
  * @public
@@ -8123,6 +8281,38 @@ export declare type TLIndicatorPath = {
8123
8281
  path: Path2D;
8124
8282
  } | Path2D;
8125
8283
 
8284
+ /**
8285
+ * Emitted when an interaction state is exited, with aggregated frame time stats.
8286
+ * @public
8287
+ */
8288
+ export declare interface TLInteractionEndPerfEvent extends TLPerfFrameTimeStats {
8289
+ /** The state node id (e.g. `'translating'`). */
8290
+ name: string;
8291
+ /** Full tool path (e.g. `'select.translating'`). */
8292
+ path: string;
8293
+ /** Total shapes on the current page. */
8294
+ shapeCount: number;
8295
+ /** Breakdown of selected shape types at interaction start (e.g. `{ geo: 2, draw: 1 }`). */
8296
+ selectedShapeTypes: Record<string, number>;
8297
+ /** Camera zoom level (`camera.z`) at interaction end. */
8298
+ zoomLevel: number;
8299
+ /** `performance.now()` when the interaction ended. */
8300
+ timestamp: number;
8301
+ }
8302
+
8303
+ /**
8304
+ * Emitted when an interaction state (e.g. translating, resizing) is entered.
8305
+ * @public
8306
+ */
8307
+ export declare interface TLInteractionStartPerfEvent {
8308
+ /** The state node id (e.g. `'translating'`). */
8309
+ name: string;
8310
+ /** Full tool path (e.g. `'select.translating'`). */
8311
+ path: string;
8312
+ /** `performance.now()` when the interaction started. */
8313
+ timestamp: number;
8314
+ }
8315
+
8126
8316
  /** @public */
8127
8317
  export declare type TLInterruptEvent = (info: TLInterruptEventInfo) => void;
8128
8318
 
@@ -8370,6 +8560,94 @@ export declare const tlmenus: {
8370
8560
  */
8371
8561
  export declare type TLOnMountHandler = (editor: Editor) => (() => undefined | void) | undefined | void;
8372
8562
 
8563
+ /**
8564
+ * Map of all performance event names to their payload types.
8565
+ * Used with {@link PerformanceManager.on} and {@link PerformanceManager.once}.
8566
+ * @public
8567
+ */
8568
+ export declare interface TLPerfEventMap {
8569
+ /** An interaction state was entered. */
8570
+ 'interaction-start': [TLInteractionStartPerfEvent];
8571
+ /** An interaction state was exited, with aggregated frame time stats. */
8572
+ 'interaction-end': [TLInteractionEndPerfEvent];
8573
+ /** A camera operation (pan/zoom) began. */
8574
+ 'camera-start': [TLCameraStartPerfEvent];
8575
+ /** A camera operation ended (after debounce), with aggregated frame time stats. */
8576
+ 'camera-end': [TLCameraEndPerfEvent];
8577
+ /** Shapes were created. */
8578
+ 'shapes-created': [TLShapeOperationPerfEvent];
8579
+ /** Shapes were updated. */
8580
+ 'shapes-updated': [TLShapeOperationPerfEvent];
8581
+ /** Shapes were deleted. */
8582
+ 'shapes-deleted': [TLShapeOperationPerfEvent];
8583
+ /** An animation frame was rendered. Only fires when listeners are registered. */
8584
+ frame: [TLFramePerfEvent];
8585
+ /** An undo operation was performed. */
8586
+ undo: [TLUndoRedoPerfEvent];
8587
+ /** A redo operation was performed. */
8588
+ redo: [TLUndoRedoPerfEvent];
8589
+ }
8590
+
8591
+ /**
8592
+ * Common frame time statistics shared by interaction and camera end events.
8593
+ * @public
8594
+ */
8595
+ export declare interface TLPerfFrameTimeStats {
8596
+ /** Total duration of the session in ms. */
8597
+ duration: number;
8598
+ /** Average frames per second during the session. */
8599
+ fps: number;
8600
+ /** Total number of frames recorded. */
8601
+ frameCount: number;
8602
+ /** Mean frame duration in ms. */
8603
+ avgFrameTime: number;
8604
+ /** Median (p50) frame duration in ms. */
8605
+ medianFrameTime: number;
8606
+ /** 95th percentile frame duration in ms. */
8607
+ p95FrameTime: number;
8608
+ /** 99th percentile frame duration in ms. */
8609
+ p99FrameTime: number;
8610
+ /** Shortest frame duration in ms. */
8611
+ minFrameTime: number;
8612
+ /** Longest frame duration in ms. */
8613
+ maxFrameTime: number;
8614
+ /** Raw frame durations for local analysis. Exclude when sending to analytics. */
8615
+ frameTimes: number[];
8616
+ /**
8617
+ * Long animation frames observed during this period (Chromium 123+).
8618
+ * Only present when the browser supports the Long Animation Frames API and
8619
+ * at least one long frame was observed.
8620
+ * Exclude when sending to analytics — entries are large and contain script URLs.
8621
+ */
8622
+ longAnimationFrames?: TLPerfLongAnimationFrame[];
8623
+ }
8624
+
8625
+ /**
8626
+ * A long animation frame observed by the browser during an interaction.
8627
+ * Available only in browsers that support the Long Animation Frames API (Chromium 123+).
8628
+ * @public
8629
+ */
8630
+ export declare interface TLPerfLongAnimationFrame {
8631
+ /** Frame start time (relative to timeOrigin). */
8632
+ startTime: number;
8633
+ /** Total frame duration in ms. */
8634
+ duration: number;
8635
+ /** Time the main thread was blocked in ms. */
8636
+ blockingDuration: number;
8637
+ /** Scripts that contributed to the long frame. */
8638
+ scripts: TLPerfLongAnimationFrameScript[];
8639
+ }
8640
+
8641
+ /** A script attribution entry from a long animation frame. @public */
8642
+ export declare interface TLPerfLongAnimationFrameScript {
8643
+ /** The script source URL (may be empty for inline scripts). */
8644
+ sourceURL: string;
8645
+ /** The function name or invoker description. */
8646
+ invoker: string;
8647
+ /** Time spent in this script in ms. */
8648
+ duration: number;
8649
+ }
8650
+
8373
8651
  /** @public */
8374
8652
  export declare type TLPinchEvent = (info: TLPinchEventInfo) => void;
8375
8653
 
@@ -8557,6 +8835,21 @@ export declare interface TLShapeIndicatorsProps {
8557
8835
  showAll?: boolean;
8558
8836
  }
8559
8837
 
8838
+ /**
8839
+ * Emitted when shapes are created, updated, or deleted.
8840
+ * @public
8841
+ */
8842
+ export declare interface TLShapeOperationPerfEvent {
8843
+ /** The operation type. */
8844
+ operation: 'create' | 'delete' | 'update';
8845
+ /** Number of shapes affected. */
8846
+ count: number;
8847
+ /** Breakdown by shape type (e.g. `{ geo: 2, draw: 1 }`). */
8848
+ shapeTypes: Record<string, number>;
8849
+ /** `performance.now()` when the operation occurred. */
8850
+ timestamp: number;
8851
+ }
8852
+
8560
8853
  /**
8561
8854
  * Options passed to {@link ShapeUtil.canBeLaidOut}.
8562
8855
  *
@@ -8642,6 +8935,7 @@ export declare interface TLStateNodeConstructor {
8642
8935
  children?(): TLStateNodeConstructor[];
8643
8936
  isLockable: boolean;
8644
8937
  useCoalescedEvents: boolean;
8938
+ trackPerformance: boolean;
8645
8939
  }
8646
8940
 
8647
8941
  /** @public */
@@ -8819,6 +9113,19 @@ export declare interface TLTldrawExternalContentSource {
8819
9113
  data: TLContent;
8820
9114
  }
8821
9115
 
9116
+ /**
9117
+ * Emitted after an undo or redo operation.
9118
+ * @public
9119
+ */
9120
+ export declare interface TLUndoRedoPerfEvent {
9121
+ /** Whether this was an undo or redo. */
9122
+ type: 'redo' | 'undo';
9123
+ /** Number of undo steps remaining. */
9124
+ undoDepth: number;
9125
+ /** Number of redo steps remaining. */
9126
+ redoDepth: number;
9127
+ }
9128
+
8822
9129
  /** @public */
8823
9130
  export declare interface TLUpdatePointerOptions {
8824
9131
  /** Whether to update the pointer immediately, rather than on the next tick. */
package/dist-cjs/index.js CHANGED
@@ -82,6 +82,8 @@ __export(index_exports, {
82
82
  OptionalErrorBoundary: () => import_ErrorBoundary.OptionalErrorBoundary,
83
83
  PI: () => import_utils2.PI,
84
84
  PI2: () => import_utils2.PI2,
85
+ PerformanceApiAdapter: () => import_PerformanceApiAdapter.PerformanceApiAdapter,
86
+ PerformanceManager: () => import_PerformanceManager.PerformanceManager,
85
87
  Point2d: () => import_Point2d.Point2d,
86
88
  Polygon2d: () => import_Polygon2d.Polygon2d,
87
89
  Polyline2d: () => import_Polyline2d.Polyline2d,
@@ -301,6 +303,8 @@ var import_TextManager = require("./lib/editor/managers/TextManager/TextManager"
301
303
  var import_defaultThemes = require("./lib/editor/managers/ThemeManager/defaultThemes");
302
304
  var import_ThemeManager = require("./lib/editor/managers/ThemeManager/ThemeManager");
303
305
  var import_TickManager = require("./lib/editor/managers/TickManager/TickManager");
306
+ var import_PerformanceApiAdapter = require("./lib/editor/managers/PerformanceManager/PerformanceApiAdapter");
307
+ var import_PerformanceManager = require("./lib/editor/managers/PerformanceManager/PerformanceManager");
304
308
  var import_UserPreferencesManager = require("./lib/editor/managers/UserPreferencesManager/UserPreferencesManager");
305
309
  var import_BaseBoxShapeUtil = require("./lib/editor/shapes/BaseBoxShapeUtil");
306
310
  var import_GroupShapeUtil = require("./lib/editor/shapes/group/GroupShapeUtil");
@@ -385,7 +389,7 @@ var import_uniq = require("./lib/utils/uniq");
385
389
  var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
386
390
  (0, import_utils.registerTldrawLibraryVersion)(
387
391
  "@tldraw/editor",
388
- "4.6.0-canary.a300e2d0a445",
392
+ "4.6.0-canary.a5ccc24cabd6",
389
393
  "cjs"
390
394
  );
391
395
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport {\n\tcreateTLCurrentUser,\n\tuseTldrawCurrentUser,\n\ttype TLCurrentUser,\n} from './lib/config/createTLCurrentUser'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tdefaultUserStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { type TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport { FontManager } from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { 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 { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT } from './lib/license/LicenseProvider'\nexport {\n\tdefaultTldrawOptions,\n\ttype TLClipboardPasteRawInfo,\n\ttype TLClipboardWriteInfo,\n\ttype TldrawOptions,\n} from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\telementShouldCaptureKeys,\n\tgetGlobalDocument,\n\tgetGlobalWindow,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n\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,mBAA6C;AAG7C,0BAAc,0BAHd;AAKA,0BAAc,gCALd;AAOA,0BAAc,0BAPd;AASA,0BAAc,6BATd;AAWA,0BAAc,0BAXd;AAaA,0BAAc,6BAbd;AAeA,+BAAkC;AAClC,0BAAgD;AAChD,2BAGO;AACP,qCAGO;AACP,2BAGO;AACP,kCAGO;AACP,yBAA8C;AAC9C,2BAGO;AACP,4BAGO;AACP,6BAGO;AACP,wCAGO;AACP,wCAGO;AAEP,mCAGO;AAEP,oCAGO;AACP,iCAGO;AACP,iCAGO;AACP,4BAA+B;AAC/B,4BAA+B;AAC/B,2BAIO;AACP,2BAAuD;AACvD,8BAAiC;AACjC,0BAAqD;AACrD,iCAIO;AACP,2BASO;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,6BAIO;AACP,yBAIO;AACP,yBAAqD;AACrD,yBAMO;AACP,iCAAoC;AACpC,yBAMO;AACP,2BAA8B;AAC9B,0BAA4C;AAC5C,yBAA4B;AAC5B,oCAAuC;AACvC,8BAAsD;AACtD,4BAA+B;AAC/B,uBAiBO;AACP,iCAGO;AACP,uBAAiD;AACjD,0BAA6B;AAC7B,8BAAiC;AACjC,sBAAgC;AAChC,uBAAuD;AAGvD,yBAiCO;AA4CP,8BAKO;AACP,sBAAiD;AACjD,2BAA8B;AAC9B,yBAAqC;AACrC,mBAAwB;AACxB,kBAAuB;AACvB,0BAKO;AACP,0BAA6B;AAC7B,uBAA0B;AAC1B,uBAMO;AACP,iCAAoC;AAEpC,sBAA2C;AAC3C,iCAAoC;AACpC,yBAAkE;AAClE,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2CAA8C;AAC9C,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,gCAAmC;AACnC,wBAAiD;AACjD,0BAA6B;AAC7B,+BAAkC;AAClC,4BAQO;AACP,6BAAgC;AAChC,qBAKO;AACP,iBASO;AACP,qBAAwB;AACxB,mBAAsB;AACtB,sBAAyB;AACzB,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAAuB;AACvB,uBAA0B;AAC1B,gCAA6C;AAC7C,wBAMO;AACP,qBAAwB;AACxB,qBAAwB;AACxB,uBAA0B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,uBAA0B;AAC1B,uBAaO;AACP,iBAAiD;AACjD,IAAAA,gBAgCO;AACP,iBAAkC;AAClC,0BAYO;AACP,oBAAoD;AACpD,kCAAgE;AAChE,yBAOO;AACP,uBAKO;AACP,iBAWO;AACP,wBAA2B;AAC3B,gCAAmC;AACnC,4BAA+B;AAC/B,kCAAqC;AACrC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAAoE;AACpE,sBAOO;AACP,sBAIO;AACP,qBAMO;AACP,6BAIO;AACP,uBAA0B;AAC1B,4BAAsD;AAEtD,kBAAqB;AAQrB,IAAAC,wBAA8B;AAAA,IAN9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport {\n\tcreateTLCurrentUser,\n\tuseTldrawCurrentUser,\n\ttype TLCurrentUser,\n} from './lib/config/createTLCurrentUser'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tdefaultUserStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { type TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport { FontManager } from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { 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 { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { 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 { useSelectionEvents } from './lib/hooks/useSelectionEvents'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT } from './lib/license/LicenseProvider'\nexport {\n\tdefaultTldrawOptions,\n\ttype TLClipboardPasteRawInfo,\n\ttype TLClipboardWriteInfo,\n\ttype TldrawOptions,\n} from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\telementShouldCaptureKeys,\n\tgetGlobalDocument,\n\tgetGlobalWindow,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n\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,mBAA6C;AAG7C,0BAAc,0BAHd;AAKA,0BAAc,gCALd;AAOA,0BAAc,0BAPd;AASA,0BAAc,6BATd;AAWA,0BAAc,0BAXd;AAaA,0BAAc,6BAbd;AAeA,+BAAkC;AAClC,0BAAgD;AAChD,2BAGO;AACP,qCAGO;AACP,2BAGO;AACP,kCAGO;AACP,yBAA8C;AAC9C,2BAGO;AACP,4BAGO;AACP,6BAGO;AACP,wCAGO;AACP,wCAGO;AAEP,mCAGO;AAEP,oCAGO;AACP,iCAGO;AACP,iCAGO;AACP,4BAA+B;AAC/B,4BAA+B;AAC/B,2BAIO;AACP,2BAAuD;AACvD,8BAAiC;AACjC,0BAAqD;AACrD,iCAIO;AACP,2BASO;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,6BAIO;AACP,yBAIO;AACP,yBAAqD;AACrD,yBAMO;AACP,iCAAoC;AACpC,yBAMO;AACP,2BAA8B;AAC9B,0BAA4C;AAC5C,yBAA4B;AAC5B,mCAAsC;AACtC,gCAAmC;AAcnC,oCAAuC;AACvC,8BAAsD;AACtD,4BAA+B;AAC/B,uBAiBO;AACP,iCAGO;AACP,uBAAiD;AACjD,0BAA6B;AAC7B,8BAAiC;AACjC,sBAAgC;AAChC,uBAAuD;AAGvD,yBAiCO;AA4CP,8BAKO;AACP,sBAAiD;AACjD,2BAA8B;AAC9B,yBAAqC;AACrC,mBAAwB;AACxB,kBAAuB;AACvB,0BAKO;AACP,0BAA6B;AAC7B,uBAA0B;AAC1B,uBAMO;AACP,iCAAoC;AAEpC,sBAA2C;AAC3C,iCAAoC;AACpC,yBAAkE;AAClE,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2CAA8C;AAC9C,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,gCAAmC;AACnC,wBAAiD;AACjD,0BAA6B;AAC7B,+BAAkC;AAClC,4BAQO;AACP,6BAAgC;AAChC,qBAKO;AACP,iBASO;AACP,qBAAwB;AACxB,mBAAsB;AACtB,sBAAyB;AACzB,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAAuB;AACvB,uBAA0B;AAC1B,gCAA6C;AAC7C,wBAMO;AACP,qBAAwB;AACxB,qBAAwB;AACxB,uBAA0B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,uBAA0B;AAC1B,uBAaO;AACP,iBAAiD;AACjD,IAAAA,gBAgCO;AACP,iBAAkC;AAClC,0BAYO;AACP,oBAAoD;AACpD,kCAAgE;AAChE,yBAOO;AACP,uBAKO;AACP,iBAWO;AACP,wBAA2B;AAC3B,gCAAmC;AACnC,4BAA+B;AAC/B,kCAAqC;AACrC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAAoE;AACpE,sBAOO;AACP,sBAIO;AACP,qBAMO;AACP,6BAIO;AACP,uBAA0B;AAC1B,4BAAsD;AAEtD,kBAAqB;AAQrB,IAAAC,wBAA8B;AAAA,IAN9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": ["import_utils", "import_defaultThemes"]
7
7
  }