@tldraw/editor 5.2.0-canary.fe03bcdddf34 → 5.2.0-canary.fff413eea248

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 (87) hide show
  1. package/README.md +7 -1
  2. package/dist-cjs/index.d.ts +43 -47
  3. package/dist-cjs/index.js +4 -4
  4. package/dist-cjs/index.js.map +2 -2
  5. package/dist-cjs/lib/editor/Editor.js +92 -53
  6. package/dist-cjs/lib/editor/Editor.js.map +3 -3
  7. package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js +8 -58
  8. package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +2 -2
  9. package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js +3 -3
  10. package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js.map +2 -2
  11. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js +1 -2
  12. package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +2 -2
  13. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js +12 -2
  14. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +2 -2
  15. package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js +4 -2
  16. package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js.map +2 -2
  17. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +7 -3
  18. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
  19. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +15 -2
  20. package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
  21. package/dist-cjs/lib/editor/overlays/strokeShapeIndicators.js +79 -0
  22. package/dist-cjs/lib/editor/overlays/strokeShapeIndicators.js.map +7 -0
  23. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +3 -0
  24. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +2 -2
  25. package/dist-cjs/lib/editor/tools/StateNode.js.map +2 -2
  26. package/dist-cjs/lib/editor/types/event-types.js +0 -2
  27. package/dist-cjs/lib/editor/types/event-types.js.map +2 -2
  28. package/dist-cjs/lib/hooks/usePresence.js.map +2 -2
  29. package/dist-cjs/version.js +3 -3
  30. package/dist-cjs/version.js.map +1 -1
  31. package/dist-esm/index.d.mts +43 -47
  32. package/dist-esm/index.mjs +5 -7
  33. package/dist-esm/index.mjs.map +2 -2
  34. package/dist-esm/lib/editor/Editor.mjs +92 -53
  35. package/dist-esm/lib/editor/Editor.mjs.map +3 -3
  36. package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs +8 -58
  37. package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +2 -2
  38. package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs +3 -3
  39. package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs.map +2 -2
  40. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs +1 -2
  41. package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +2 -2
  42. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs +12 -2
  43. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +2 -2
  44. package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs +4 -2
  45. package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs.map +2 -2
  46. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +7 -3
  47. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
  48. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +15 -2
  49. package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
  50. package/dist-esm/lib/editor/overlays/strokeShapeIndicators.mjs +59 -0
  51. package/dist-esm/lib/editor/overlays/strokeShapeIndicators.mjs.map +7 -0
  52. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +3 -0
  53. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +2 -2
  54. package/dist-esm/lib/editor/tools/StateNode.mjs.map +2 -2
  55. package/dist-esm/lib/editor/types/event-types.mjs +0 -2
  56. package/dist-esm/lib/editor/types/event-types.mjs.map +2 -2
  57. package/dist-esm/lib/hooks/usePresence.mjs.map +2 -2
  58. package/dist-esm/version.mjs +3 -3
  59. package/dist-esm/version.mjs.map +1 -1
  60. package/editor.css +2 -0
  61. package/package.json +8 -8
  62. package/src/index.ts +2 -5
  63. package/src/lib/editor/Editor.ts +124 -64
  64. package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +54 -74
  65. package/src/lib/editor/managers/ClickManager/ClickManager.ts +15 -65
  66. package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.test.ts +43 -16
  67. package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.ts +8 -5
  68. package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +4 -4
  69. package/src/lib/editor/managers/FocusManager/FocusManager.ts +1 -2
  70. package/src/lib/editor/managers/FontManager/FontManager.test.ts +13 -9
  71. package/src/lib/editor/managers/HistoryManager/HistoryManager.ts +20 -2
  72. package/src/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.ts +9 -2
  73. package/src/lib/editor/managers/TextManager/TextManager.test.ts +16 -14
  74. package/src/lib/editor/managers/TextManager/TextManager.ts +17 -2
  75. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +12 -2
  76. package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +27 -2
  77. package/src/lib/editor/overlays/strokeShapeIndicators.ts +86 -0
  78. package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +4 -0
  79. package/src/lib/editor/tools/StateNode.ts +0 -2
  80. package/src/lib/editor/types/event-types.ts +2 -6
  81. package/src/lib/hooks/usePresence.ts +2 -2
  82. package/src/version.ts +3 -3
  83. package/dist-cjs/lib/editor/overlays/ShapeIndicatorOverlayUtil.js +0 -161
  84. package/dist-cjs/lib/editor/overlays/ShapeIndicatorOverlayUtil.js.map +0 -7
  85. package/dist-esm/lib/editor/overlays/ShapeIndicatorOverlayUtil.mjs +0 -141
  86. package/dist-esm/lib/editor/overlays/ShapeIndicatorOverlayUtil.mjs.map +0 -7
  87. package/src/lib/editor/overlays/ShapeIndicatorOverlayUtil.ts +0 -216
@@ -89,6 +89,7 @@ import { TLUnknownAsset } from '@tldraw/tlschema';
89
89
  import { TLUnknownBinding } from '@tldraw/tlschema';
90
90
  import { TLUnknownShape } from '@tldraw/tlschema';
91
91
  import { TLUser } from '@tldraw/tlschema';
92
+ import { TLUserId } from '@tldraw/tlschema';
92
93
  import { TLUserStore } from '@tldraw/tlschema';
93
94
  import { TLVideoAsset } from '@tldraw/tlschema';
94
95
  import { UnknownRecord } from '@tldraw/store';
@@ -746,6 +747,7 @@ export declare class ClickManager {
746
747
  private _clickTimeout?;
747
748
  private _clickScreenPoint?;
748
749
  private _previousScreenPoint?;
750
+ private _isPressingWhilePending;
749
751
  _getClickTimeout(state: TLClickState, id?: string): void;
750
752
  /* Excluded from this release type: _clickState */
751
753
  /**
@@ -2455,7 +2457,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2455
2457
  * @param opts - The camera move options.
2456
2458
  * @public
2457
2459
  */
2458
- zoomToUser(userId: string, opts?: TLCameraMoveOptions): this;
2460
+ zoomToUser(userId: TLUserId, opts?: TLCameraMoveOptions): this;
2459
2461
  /* Excluded from this release type: _willSetInitialBounds */
2460
2462
  /**
2461
2463
  * Update the viewport. The viewport will measure the size and screen position of its container
@@ -2608,7 +2610,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2608
2610
  *
2609
2611
  * @public
2610
2612
  */
2611
- startFollowingUser(userId: string): this;
2613
+ startFollowingUser(userId: TLUserId): this;
2612
2614
  /**
2613
2615
  * Stop viewport-following a user.
2614
2616
  *
@@ -3719,6 +3721,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3719
3721
  * @public
3720
3722
  */
3721
3723
  resizeShape(shape: TLShape | TLShapeId, scale: VecLike, opts?: TLResizeShapeOptions): this;
3724
+ /* Excluded from this release type: getResizeShapePartial */
3722
3725
  /* Excluded from this release type: _scalePagePoint */
3723
3726
  /* Excluded from this release type: _resizeUnalignedShape */
3724
3727
  /**
@@ -6029,6 +6032,19 @@ export declare function resizeScaled(shape: TLBaseShape<any, {
6029
6032
  y: number;
6030
6033
  };
6031
6034
 
6035
+ /**
6036
+ * The whole-pixel line-height for a given font size and tldraw's unitless line-height
6037
+ * multiplier. tldraw's theme stores line-height as a multiplier (e.g. 1.35); resolving it
6038
+ * to a whole pixel keeps line spacing identical across rendering engines, which otherwise
6039
+ * disagree on fractional line boxes (WebKit snaps them to whole pixels, Blink keeps the
6040
+ * fraction) and let multi-line text drift apart. Apply it everywhere line-height is used —
6041
+ * measurement, on-canvas render, and export — so geometry and rendering agree.
6042
+ * See https://github.com/tldraw/tldraw/issues/8970.
6043
+ *
6044
+ * @public
6045
+ */
6046
+ export declare function resolveLineHeightPx(fontSize: number, lineHeight: number): number;
6047
+
6032
6048
  /**
6033
6049
  * Resolve a partial set of user-provided themes into a complete `TLThemes`
6034
6050
  * record by merging with `DEFAULT_THEME`. The result is suitable for passing to
@@ -6266,32 +6282,6 @@ export declare function setRuntimeOverrides(input: Partial<typeof runtime>): voi
6266
6282
  /** @public */
6267
6283
  export declare function setUserPreferences(user: TLUserPreferences): void;
6268
6284
 
6269
- /**
6270
- * Overlay util for shape indicators — the selection / hover / hint outlines drawn
6271
- * under the selection foreground. Paints local indicators in the theme's
6272
- * selection color.
6273
- *
6274
- * Remote collaborator selection indicators are drawn by a separate overlay util
6275
- * (e.g. `CollaboratorShapeIndicatorOverlayUtil` from `tldraw`) that runs at a
6276
- * lower z-index so peer selections appear under the local indicators.
6277
- *
6278
- * Non-interactive: contributes no hit-test geometry.
6279
- *
6280
- * @public
6281
- */
6282
- export declare class ShapeIndicatorOverlayUtil extends OverlayUtil<TLShapeIndicatorOverlay> {
6283
- static type: string;
6284
- options: {
6285
- hintedLineWidth: number;
6286
- lineWidth: number;
6287
- zIndex: number;
6288
- };
6289
- private _instanceFlags$;
6290
- isActive(): boolean;
6291
- getOverlays(): TLShapeIndicatorOverlay[];
6292
- render(ctx: CanvasRenderingContext2D, overlays: TLShapeIndicatorOverlay[]): void;
6293
- }
6294
-
6295
6285
  /** @public */
6296
6286
  export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
6297
6287
  editor: Editor;
@@ -7166,8 +7156,6 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
7166
7156
  onLongPress?(info: TLPointerEventInfo): void;
7167
7157
  onPointerUp?(info: TLPointerEventInfo): void;
7168
7158
  onDoubleClick?(info: TLClickEventInfo): void;
7169
- onTripleClick?(info: TLClickEventInfo): void;
7170
- onQuadrupleClick?(info: TLClickEventInfo): void;
7171
7159
  onRightClick?(info: TLPointerEventInfo): void;
7172
7160
  onMiddleClick?(info: TLPointerEventInfo): void;
7173
7161
  onKeyDown?(info: TLKeyboardEventInfo): void;
@@ -7199,8 +7187,8 @@ export declare function stopEventPropagation(e: any): any;
7199
7187
  * arrows with labels or complex arrowheads) can't be batched — they still
7200
7188
  * stroke individually inside a save/restore with `ctx.clip` applied.
7201
7189
  *
7202
- * Shared by {@link ShapeIndicatorOverlayUtil} and any overlay util that paints
7203
- * shape indicators (e.g. collaborator selections).
7190
+ * Shared by any overlay util that paints shape indicators (e.g. collaborator
7191
+ * selections).
7204
7192
  *
7205
7193
  * @public
7206
7194
  */
@@ -7567,17 +7555,17 @@ export declare type TLClickEvent = (info: TLClickEventInfo) => void;
7567
7555
  export declare type TLClickEventInfo = TLBaseEventInfo & {
7568
7556
  button: number;
7569
7557
  name: TLCLickEventName;
7570
- phase: 'down' | 'settle' | 'up';
7558
+ phase: 'down' | 'settle-down' | 'settle-up' | 'up';
7571
7559
  point: VecLike;
7572
7560
  pointerId: number;
7573
7561
  type: 'click';
7574
7562
  } & TLPointerEventTarget;
7575
7563
 
7576
7564
  /** @public */
7577
- export declare type TLCLickEventName = 'double_click' | 'quadruple_click' | 'triple_click';
7565
+ export declare type TLCLickEventName = 'double_click';
7578
7566
 
7579
7567
  /** @public */
7580
- export declare type TLClickState = 'idle' | 'overflow' | 'pendingDouble' | 'pendingOverflow' | 'pendingQuadruple' | 'pendingTriple';
7568
+ export declare type TLClickState = 'idle' | 'overflow' | 'pendingDouble' | 'pendingOverflow';
7581
7569
 
7582
7570
  /**
7583
7571
  * Raw clipboard paste payload, before tldraw parses clipboard contents into {@link TLExternalContent}.
@@ -8357,8 +8345,6 @@ export declare interface TLEventHandlers {
8357
8345
  onLongPress: TLPointerEvent;
8358
8346
  onRightClick: TLPointerEvent;
8359
8347
  onDoubleClick: TLClickEvent;
8360
- onTripleClick: TLClickEvent;
8361
- onQuadrupleClick: TLClickEvent;
8362
8348
  onMiddleClick: TLPointerEvent;
8363
8349
  onPointerUp: TLPointerEvent;
8364
8350
  onKeyDown: TLKeyboardEvent;
@@ -9165,14 +9151,6 @@ export declare type TLShapeErrorFallbackComponent = ComponentType<{
9165
9151
  error: any;
9166
9152
  }>;
9167
9153
 
9168
- /** @public */
9169
- export declare interface TLShapeIndicatorOverlay extends TLOverlay {
9170
- props: {
9171
- hintingShapeIds: TLShapeId[];
9172
- idsToDisplay: TLShapeId[];
9173
- };
9174
- }
9175
-
9176
9154
  /**
9177
9155
  * Emitted when shapes are created, updated, or deleted.
9178
9156
  * @public
@@ -9654,13 +9632,13 @@ export declare function usePassThroughWheelEvents(ref: RefObject<HTMLElement | n
9654
9632
  * @returns The list of peer UserIDs
9655
9633
  * @public
9656
9634
  */
9657
- export declare function usePeerIds(): string[];
9635
+ export declare function usePeerIds(): TLUserId[];
9658
9636
 
9659
9637
  /**
9660
9638
  * @returns The latest presence of the user matching userId
9661
9639
  * @public
9662
9640
  */
9663
- export declare function usePresence(userId: string): null | TLInstancePresence;
9641
+ export declare function usePresence(userId: TLUserId): null | TLInstancePresence;
9664
9642
 
9665
9643
  /* Excluded from this release type: USER_COLORS */
9666
9644
 
@@ -9700,7 +9678,25 @@ export declare class UserPreferencesManager {
9700
9678
  getEdgeScrollSpeed(): number;
9701
9679
  getAnimationSpeed(): number;
9702
9680
  getAreKeyboardShortcutsEnabled(): boolean;
9681
+ /**
9682
+ * The current user's raw, app-provided id — the value set in the user's
9683
+ * {@link @tldraw/editor#TLUserPreferences}. Use this when you need the id your application
9684
+ * assigned to the user. To compare against or look up store records, use
9685
+ * {@link UserPreferencesManager.getRecordId} instead.
9686
+ */
9687
+ getExternalId(): string;
9688
+ /**
9689
+ * @deprecated Use {@link UserPreferencesManager.getExternalId} for the raw app-provided id, or
9690
+ * {@link UserPreferencesManager.getRecordId} for the prefixed `TLUserId` record id.
9691
+ */
9703
9692
  getId(): string;
9693
+ /**
9694
+ * The current user's id as a tldraw {@link @tldraw/tlschema#TLUserId} record id (prefixed
9695
+ * with `user:`). Use this when comparing against or looking up store records, such as a
9696
+ * presence record's `userId` or `followingUserId`. For the raw, app-provided id, use
9697
+ * {@link UserPreferencesManager.getExternalId}.
9698
+ */
9699
+ getRecordId(): TLUserId;
9704
9700
  getName(): string;
9705
9701
  getLocale(): string;
9706
9702
  getColor(): string;
@@ -82,7 +82,8 @@ import {
82
82
  } from "./lib/editor/managers/SnapManager/SnapManager.mjs";
83
83
  import { SpatialIndexManager } from "./lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs";
84
84
  import {
85
- TextManager
85
+ TextManager,
86
+ resolveLineHeightPx
86
87
  } from "./lib/editor/managers/TextManager/TextManager.mjs";
87
88
  import { DEFAULT_THEME } from "./lib/editor/managers/ThemeManager/defaultThemes.mjs";
88
89
  import { ThemeManager, resolveThemes } from "./lib/editor/managers/ThemeManager/ThemeManager.mjs";
@@ -104,10 +105,7 @@ import { OverlayManager } from "./lib/editor/overlays/OverlayManager.mjs";
104
105
  import {
105
106
  OverlayUtil
106
107
  } from "./lib/editor/overlays/OverlayUtil.mjs";
107
- import {
108
- ShapeIndicatorOverlayUtil,
109
- strokeShapeIndicators
110
- } from "./lib/editor/overlays/ShapeIndicatorOverlayUtil.mjs";
108
+ import { strokeShapeIndicators } from "./lib/editor/overlays/strokeShapeIndicators.mjs";
111
109
  import {
112
110
  getPerfectDashProps
113
111
  } from "./lib/editor/shapes/shared/getPerfectDashProps.mjs";
@@ -300,7 +298,7 @@ import { LocalIndexedDb, Table } from "./lib/utils/sync/LocalIndexedDb.mjs";
300
298
  import { uniq } from "./lib/utils/uniq.mjs";
301
299
  registerTldrawLibraryVersion(
302
300
  "@tldraw/editor",
303
- "5.2.0-canary.fe03bcdddf34",
301
+ "5.2.0-canary.fff413eea248",
304
302
  "esm"
305
303
  );
306
304
  import { getColorValue } from "./lib/editor/managers/ThemeManager/defaultThemes.mjs";
@@ -374,7 +372,6 @@ export {
374
372
  SIN,
375
373
  SVGContainer,
376
374
  ScribbleManager,
377
- ShapeIndicatorOverlayUtil,
378
375
  ShapeUtil,
379
376
  SharedStyleMap,
380
377
  SnapManager,
@@ -480,6 +477,7 @@ export {
480
477
  releasePointerCapture,
481
478
  resizeBox,
482
479
  resizeScaled,
480
+ resolveLineHeightPx,
483
481
  resolveThemes,
484
482
  rotateSelectionHandle,
485
483
  runtime,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport {\n\tcreateTLCurrentUser,\n\tuseTldrawCurrentUser,\n\ttype TLCurrentUser,\n} from './lib/config/createTLCurrentUser'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tdefaultUserStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { type TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport { FontManager } from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { CollaboratorsManager } from './lib/editor/managers/CollaboratorsManager/CollaboratorsManager'\nexport { PerformanceApiAdapter } from './lib/editor/managers/PerformanceManager/PerformanceApiAdapter'\nexport { PerformanceManager } from './lib/editor/managers/PerformanceManager/PerformanceManager'\nexport {\n\ttype TLCameraEndPerfEvent,\n\ttype TLCameraStartPerfEvent,\n\ttype TLFramePerfEvent,\n\ttype TLInteractionEndPerfEvent,\n\ttype TLInteractionStartPerfEvent,\n\ttype TLPerfEventMap,\n\ttype TLPerfFrameTimeStats,\n\ttype TLPerfLongAnimationFrame,\n\ttype TLPerfLongAnimationFrameScript,\n\ttype TLShapeOperationPerfEvent,\n\ttype TLUndoRedoPerfEvent,\n} from './lib/editor/managers/PerformanceManager/perf-types'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { BaseFrameLikeShapeUtil } from './lib/editor/shapes/BaseFrameLikeShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetOverlayDisplayValues,\n\ttype OverlayOptionsWithDisplayValues,\n} from './lib/editor/overlays/getOverlayDisplayValues'\nexport { OverlayManager, type TLOverlayEntry } from './lib/editor/overlays/OverlayManager'\nexport {\n\tOverlayUtil,\n\ttype TLAnyOverlayUtilConstructor,\n\ttype TLOverlay,\n\ttype TLOverlayUtilConstructor,\n} from './lib/editor/overlays/OverlayUtil'\nexport {\n\tShapeIndicatorOverlayUtil,\n\tstrokeShapeIndicators,\n\ttype TLShapeIndicatorOverlay,\n} from './lib/editor/overlays/ShapeIndicatorOverlayUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { useColorMode } from './lib/hooks/useColorMode'\nexport { getCursor } from './lib/hooks/useCursor'\nexport {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT } from './lib/license/LicenseProvider'\nexport {\n\tdefaultTldrawOptions,\n\ttype TLClipboardPasteRawInfo,\n\ttype TLClipboardWriteInfo,\n\ttype TldrawOptions,\n} from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\telementShouldCaptureKeys,\n\tgetGlobalDocument,\n\tgetGlobalWindow,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n\nexport { getColorValue } from './lib/editor/managers/ThemeManager/defaultThemes'\n"],
5
- "mappings": "AAAA,SAAS,oCAAoC;AAG7C,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,SAAS,yBAAyB;AAClC;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP,SAAS,mBAAqC;AAC9C;AAAA,EACC;AAAA,OAEM;AAEP;AAAA,EACC;AAAA,OAEM;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,qBAA8C;AACvD,SAAS,wBAAwB;AACjC,SAAS,oBAA4C;AACrD;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKM;AAGP,SAAS,kBAAkD;AAC3D;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,SAAS,2BAA2B,wBAAwB,aAAa;AACzE,SAAS,iBAA8C;AACvD;AAAA,EACC;AAAA,OAQM;AACP;AAAA,EACC;AAAA,OAKM;AACP,SAAS,oBAAuC;AAChD,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B;AAAA,EACC;AAAA,OAGM;AACP;AAAA,EACC;AAAA,OAGM;AACP,SAAS,mBAA4C;AACrD;AAAA,EACC;AAAA,OAKM;A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M;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACM;AACP,SAAS,kBAAkB;AAC3B,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,8BAA8B,6BAA6B;AACpE;AAAA,EACC;AAAA,OAMM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB,aAA6B;AAEtD,SAAS,YAAY;AAErB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,qBAAqB;",
4
+ "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport {\n\tcreateTLCurrentUser,\n\tuseTldrawCurrentUser,\n\ttype TLCurrentUser,\n} from './lib/config/createTLCurrentUser'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tdefaultUserStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { type TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport { FontManager } from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\tresolveLineHeightPx,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { CollaboratorsManager } from './lib/editor/managers/CollaboratorsManager/CollaboratorsManager'\nexport { PerformanceApiAdapter } from './lib/editor/managers/PerformanceManager/PerformanceApiAdapter'\nexport { PerformanceManager } from './lib/editor/managers/PerformanceManager/PerformanceManager'\nexport {\n\ttype TLCameraEndPerfEvent,\n\ttype TLCameraStartPerfEvent,\n\ttype TLFramePerfEvent,\n\ttype TLInteractionEndPerfEvent,\n\ttype TLInteractionStartPerfEvent,\n\ttype TLPerfEventMap,\n\ttype TLPerfFrameTimeStats,\n\ttype TLPerfLongAnimationFrame,\n\ttype TLPerfLongAnimationFrameScript,\n\ttype TLShapeOperationPerfEvent,\n\ttype TLUndoRedoPerfEvent,\n} from './lib/editor/managers/PerformanceManager/perf-types'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { BaseFrameLikeShapeUtil } from './lib/editor/shapes/BaseFrameLikeShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetOverlayDisplayValues,\n\ttype OverlayOptionsWithDisplayValues,\n} from './lib/editor/overlays/getOverlayDisplayValues'\nexport { OverlayManager, type TLOverlayEntry } from './lib/editor/overlays/OverlayManager'\nexport {\n\tOverlayUtil,\n\ttype TLAnyOverlayUtilConstructor,\n\ttype TLOverlay,\n\ttype TLOverlayUtilConstructor,\n} from './lib/editor/overlays/OverlayUtil'\nexport { strokeShapeIndicators } from './lib/editor/overlays/strokeShapeIndicators'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { useColorMode } from './lib/hooks/useColorMode'\nexport { getCursor } from './lib/hooks/useCursor'\nexport {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { 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,SAAS,oCAAoC;AAG7C,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,cAAc;AAEd,SAAS,yBAAyB;AAClC;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP,SAAS,mBAAqC;AAC9C;AAAA,EACC;AAAA,OAEM;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EM;AACP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB,aAA6B;AAEtD,SAAS,YAAY;AAErB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,qBAAqB;",
6
6
  "names": []
7
7
  }
@@ -2185,7 +2185,7 @@ class Editor extends EventEmitter {
2185
2185
  return baseCamera;
2186
2186
  }
2187
2187
  _getFollowingPresence(targetUserId) {
2188
- const visited = [this.user.getId()];
2188
+ const visited = [this.user.getRecordId()];
2189
2189
  const collaborators = this.getCollaborators();
2190
2190
  let leaderPresence = null;
2191
2191
  while (targetUserId && !visited.includes(targetUserId)) {
@@ -2373,6 +2373,11 @@ class Editor extends EventEmitter {
2373
2373
  getConstrainedCamera(point, opts) {
2374
2374
  const currentCamera = this.getCamera();
2375
2375
  let { x, y, z = currentCamera.z } = point;
2376
+ const preserveFocalPoint = (current, requested, rz, z2) => {
2377
+ const cz = currentCamera.z;
2378
+ if (rz === cz) return current;
2379
+ return current + (requested - current) * (1 / z2 - 1 / cz) / (1 / rz - 1 / cz);
2380
+ };
2376
2381
  if (!opts?.force) {
2377
2382
  const cameraOptions = this.getCameraOptions();
2378
2383
  const zoomMin = cameraOptions.zoomSteps[0];
@@ -2392,14 +2397,10 @@ class Editor extends EventEmitter {
2392
2397
  z = this.getInitialZoom();
2393
2398
  }
2394
2399
  if (z < minZ || z > maxZ) {
2395
- const { x: cx, y: cy, z: cz } = currentCamera;
2396
- const cxA = -cx + vsb.w / cz / 2;
2397
- const cyA = -cy + vsb.h / cz / 2;
2400
+ const rz = z;
2398
2401
  z = clamp(z, minZ, maxZ);
2399
- const cxB = -cx + vsb.w / z / 2;
2400
- const cyB = -cy + vsb.h / z / 2;
2401
- x = cx + cxB - cxA;
2402
- y = cy + cyB - cyA;
2402
+ x = preserveFocalPoint(currentCamera.x, x, rz, z);
2403
+ y = preserveFocalPoint(currentCamera.y, y, rz, z);
2403
2404
  }
2404
2405
  const minX = px / z - bounds.x;
2405
2406
  const minY = py / z - bounds.y;
@@ -2468,10 +2469,10 @@ class Editor extends EventEmitter {
2468
2469
  }
2469
2470
  } else {
2470
2471
  if (z > zoomMax || z < zoomMin) {
2471
- const { x: cx, y: cy, z: cz } = currentCamera;
2472
+ const rz = z;
2472
2473
  z = clamp(z, zoomMin, zoomMax);
2473
- x = cx + (-cx + vsb.w / z / 2) - (-cx + vsb.w / cz / 2);
2474
- y = cy + (-cy + vsb.h / z / 2) - (-cy + vsb.h / cz / 2);
2474
+ x = preserveFocalPoint(currentCamera.x, x, rz, z);
2475
+ y = preserveFocalPoint(currentCamera.y, y, rz, z);
2475
2476
  }
2476
2477
  }
2477
2478
  }
@@ -2894,14 +2895,25 @@ class Editor extends EventEmitter {
2894
2895
  this.off("stop-camera-animation", cancel);
2895
2896
  };
2896
2897
  this.once("stop-camera-animation", cancel);
2898
+ const dirZ = direction.z ?? 0;
2897
2899
  const moveCamera = (elapsed) => {
2898
2900
  const { x: cx, y: cy, z: cz } = this.getCamera();
2899
- const movementVec = Vec.Mul(direction, currentSpeed * elapsed / cz);
2901
+ const dx = direction.x * (currentSpeed * elapsed) / cz;
2902
+ const dy = direction.y * (currentSpeed * elapsed) / cz;
2903
+ let newCx = cx + dx;
2904
+ let newCy = cy + dy;
2905
+ let newCz = cz;
2906
+ if (dirZ !== 0) {
2907
+ newCz = cz * (1 + dirZ * currentSpeed * elapsed);
2908
+ const center = this.getViewportScreenCenter();
2909
+ newCx += center.x / newCz - center.x / cz;
2910
+ newCy += center.y / newCz - center.y / cz;
2911
+ }
2900
2912
  currentSpeed *= 1 - friction;
2901
2913
  if (currentSpeed < speedThreshold) {
2902
2914
  cancel();
2903
2915
  } else {
2904
- this._setCamera(new Vec(cx + movementVec.x, cy + movementVec.y, cz));
2916
+ this._setCamera(new Vec(newCx, newCy, newCz));
2905
2917
  }
2906
2918
  };
2907
2919
  this.on("tick", moveCamera);
@@ -3221,7 +3233,7 @@ class Editor extends EventEmitter {
3221
3233
  */
3222
3234
  startFollowingUser(userId) {
3223
3235
  this.stopFollowingUser();
3224
- const thisUserId = this.user.getId();
3236
+ const thisUserId = this.user.getExternalId();
3225
3237
  if (!thisUserId) {
3226
3238
  console.warn("You should set the userId for the current instance before following a user");
3227
3239
  }
@@ -5925,24 +5937,40 @@ class Editor extends EventEmitter {
5925
5937
  * @public
5926
5938
  */
5927
5939
  resizeShape(shape, scale, opts = {}) {
5940
+ const partial = this.getResizeShapePartial(shape, scale, opts);
5941
+ if (partial) this.updateShapes([partial]);
5942
+ return this;
5943
+ }
5944
+ /**
5945
+ * Get the update for a resized shape without committing it to the store. Interactions that
5946
+ * resize many shapes at once use this to collect all of the updates and commit them in a
5947
+ * single batch. Returns null when there is nothing to update.
5948
+ *
5949
+ * Shapes that are rotated out of alignment with the scale axis cannot be resized with a
5950
+ * single update; those shapes are resized immediately (as `resizeShape` would do) and null
5951
+ * is returned.
5952
+ *
5953
+ * @internal
5954
+ */
5955
+ getResizeShapePartial(shape, scale, opts = {}) {
5928
5956
  const id = typeof shape === "string" ? shape : shape.id;
5929
- if (this.getIsReadonly()) return this;
5957
+ if (this.getIsReadonly()) return null;
5930
5958
  if (!Number.isFinite(scale.x)) scale = new Vec(1, scale.y);
5931
5959
  if (!Number.isFinite(scale.y)) scale = new Vec(scale.x, 1);
5932
5960
  const initialShape = opts.initialShape ?? this.getShape(id);
5933
- if (!initialShape) return this;
5961
+ if (!initialShape) return null;
5934
5962
  const scaleOrigin = opts.scaleOrigin ?? this.getShapePageBounds(id)?.center;
5935
- if (!scaleOrigin) return this;
5963
+ if (!scaleOrigin) return null;
5936
5964
  const pageTransform = opts.initialPageTransform ? Mat.Cast(opts.initialPageTransform) : this.getShapePageTransform(id);
5937
- if (!pageTransform) return this;
5965
+ if (!pageTransform) return null;
5938
5966
  const pageRotation = pageTransform.rotation();
5939
- if (pageRotation == null) return this;
5967
+ if (pageRotation == null) return null;
5940
5968
  const scaleAxisRotation = opts.scaleAxisRotation ?? pageRotation;
5941
5969
  const initialBounds = opts.initialBounds ?? this.getShapeGeometry(id).bounds;
5942
- if (!initialBounds) return this;
5970
+ if (!initialBounds) return null;
5943
5971
  const isAspectRatioLocked = opts.isAspectRatioLocked ?? this.getShapeUtil(initialShape).isAspectRatioLocked(initialShape);
5944
5972
  if (!areAnglesCompatible(pageRotation, scaleAxisRotation)) {
5945
- return this._resizeUnalignedShape(id, scale, {
5973
+ this._resizeUnalignedShape(id, scale, {
5946
5974
  ...opts,
5947
5975
  initialBounds,
5948
5976
  scaleOrigin,
@@ -5951,6 +5979,7 @@ class Editor extends EventEmitter {
5951
5979
  isAspectRatioLocked,
5952
5980
  initialShape
5953
5981
  });
5982
+ return null;
5954
5983
  }
5955
5984
  const util = this.getShapeUtil(initialShape);
5956
5985
  if (isAspectRatioLocked) {
@@ -5960,7 +5989,7 @@ class Editor extends EventEmitter {
5960
5989
  scale = new Vec(Math.sign(scale.x) * Math.abs(scale.y), scale.y);
5961
5990
  }
5962
5991
  }
5963
- let didResize = false;
5992
+ let workingShape = null;
5964
5993
  if (util.onResize && util.canResize(initialShape)) {
5965
5994
  const newPagePoint = this._scalePagePoint(
5966
5995
  Mat.applyToPoint(pageTransform, new Vec(0, 0)),
@@ -5978,7 +6007,7 @@ class Editor extends EventEmitter {
5978
6007
  myScale.y = areWidthAndHeightAlignedWithCorrectAxis ? scale.y : scale.x;
5979
6008
  const initialPagePoint = Mat.applyToPoint(pageTransform, new Vec());
5980
6009
  const { x, y } = this.getPointInParentSpace(initialShape.id, initialPagePoint);
5981
- let workingShape = initialShape;
6010
+ workingShape = initialShape;
5982
6011
  if (!opts.skipStartAndEndCallbacks) {
5983
6012
  workingShape = applyPartialToRecordWithProps(
5984
6013
  initialShape,
@@ -5998,9 +6027,6 @@ class Editor extends EventEmitter {
5998
6027
  initialShape
5999
6028
  }
6000
6029
  );
6001
- if (resizedShape) {
6002
- didResize = true;
6003
- }
6004
6030
  workingShape = applyPartialToRecordWithProps(workingShape, {
6005
6031
  id,
6006
6032
  type: initialShape.type,
@@ -6014,32 +6040,36 @@ class Editor extends EventEmitter {
6014
6040
  util.onResizeEnd?.(initialShape, workingShape) ?? void 0
6015
6041
  );
6016
6042
  }
6017
- this.updateShapes([workingShape]);
6043
+ if (resizedShape) {
6044
+ return workingShape;
6045
+ }
6018
6046
  }
6019
- if (!didResize) {
6020
- const initialPageCenter = Mat.applyToPoint(pageTransform, initialBounds.center);
6021
- const newPageCenter = this._scalePagePoint(
6022
- initialPageCenter,
6023
- scaleOrigin,
6024
- scale,
6025
- scaleAxisRotation
6026
- );
6027
- const initialPageCenterInParentSpace = this.getPointInParentSpace(
6028
- initialShape.id,
6029
- initialPageCenter
6030
- );
6031
- const newPageCenterInParentSpace = this.getPointInParentSpace(initialShape.id, newPageCenter);
6032
- const delta = Vec.Sub(newPageCenterInParentSpace, initialPageCenterInParentSpace);
6033
- this.updateShapes([
6034
- {
6035
- id,
6036
- type: initialShape.type,
6037
- x: initialShape.x + delta.x,
6038
- y: initialShape.y + delta.y
6039
- }
6040
- ]);
6047
+ const initialPageCenter = Mat.applyToPoint(pageTransform, initialBounds.center);
6048
+ const newPageCenter = this._scalePagePoint(
6049
+ initialPageCenter,
6050
+ scaleOrigin,
6051
+ scale,
6052
+ scaleAxisRotation
6053
+ );
6054
+ const initialPageCenterInParentSpace = this.getPointInParentSpace(
6055
+ initialShape.id,
6056
+ initialPageCenter
6057
+ );
6058
+ const newPageCenterInParentSpace = this.getPointInParentSpace(initialShape.id, newPageCenter);
6059
+ const delta = Vec.Sub(newPageCenterInParentSpace, initialPageCenterInParentSpace);
6060
+ if (workingShape) {
6061
+ return {
6062
+ ...workingShape,
6063
+ x: initialShape.x + delta.x,
6064
+ y: initialShape.y + delta.y
6065
+ };
6041
6066
  }
6042
- return this;
6067
+ return {
6068
+ id,
6069
+ type: initialShape.type,
6070
+ x: initialShape.x + delta.x,
6071
+ y: initialShape.y + delta.y
6072
+ };
6043
6073
  }
6044
6074
  /** @internal */
6045
6075
  _scalePagePoint(point, scaleOrigin, scale, scaleAxisRotation) {
@@ -8158,7 +8188,10 @@ class Editor extends EventEmitter {
8158
8188
  inputs.buttons.add(info.button);
8159
8189
  inputs.setIsPointing(true);
8160
8190
  inputs.setIsDragging(false);
8161
- if (!isPenMode && isPen) this.updateInstanceState({ isPenMode: true });
8191
+ if (!isPenMode && isPen) {
8192
+ this.updateInstanceState({ isPenMode: true });
8193
+ this.interrupt();
8194
+ }
8162
8195
  if (info.button === STYLUS_ERASER_BUTTON) {
8163
8196
  this._restoreToolId = this.getCurrentToolId();
8164
8197
  this.complete();
@@ -8261,7 +8294,10 @@ class Editor extends EventEmitter {
8261
8294
  this.setCursor({ type: this._prevCursor, rotation: 0 });
8262
8295
  }
8263
8296
  if (slideSpeed > 0) {
8264
- this.slideCamera({ speed: slideSpeed, direction: slideDirection });
8297
+ this.slideCamera({
8298
+ speed: slideSpeed,
8299
+ direction: { x: slideDirection.x, y: slideDirection.y, z: 0 }
8300
+ });
8265
8301
  }
8266
8302
  this._selectedShapeIdsAtPointerDown = [];
8267
8303
  this._didCaptureSelectionAtPointerDown = false;
@@ -8269,7 +8305,10 @@ class Editor extends EventEmitter {
8269
8305
  }
8270
8306
  }
8271
8307
  if (slideSpeed > 0) {
8272
- this.slideCamera({ speed: slideSpeed, direction: slideDirection });
8308
+ this.slideCamera({
8309
+ speed: slideSpeed,
8310
+ direction: { x: slideDirection.x, y: slideDirection.y, z: 0 }
8311
+ });
8273
8312
  }
8274
8313
  } else {
8275
8314
  if (info.button === STYLUS_ERASER_BUTTON) {