@tldraw/editor 3.14.0-canary.fb0390b30559 → 3.14.0-canary.fc011e3d07ba

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 (74) hide show
  1. package/CHANGELOG.md +4327 -0
  2. package/dist-cjs/index.d.ts +16 -122
  3. package/dist-cjs/index.js +1 -4
  4. package/dist-cjs/index.js.map +2 -2
  5. package/dist-cjs/lib/editor/Editor.js +25 -81
  6. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  7. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js +1 -3
  8. package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +2 -2
  9. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +2 -3
  10. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
  11. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +10 -0
  12. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  13. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +6 -13
  14. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +3 -3
  15. package/dist-cjs/lib/editor/tools/StateNode.js +3 -3
  16. package/dist-cjs/lib/editor/tools/StateNode.js.map +2 -2
  17. package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
  18. package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
  19. package/dist-cjs/lib/hooks/useCanvasEvents.js +2 -1
  20. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  21. package/dist-cjs/lib/primitives/geometry/Geometry2d.js +2 -6
  22. package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
  23. package/dist-cjs/lib/primitives/geometry/Group2d.js +6 -11
  24. package/dist-cjs/lib/primitives/geometry/Group2d.js.map +2 -2
  25. package/dist-cjs/lib/utils/dom.js +1 -1
  26. package/dist-cjs/lib/utils/dom.js.map +2 -2
  27. package/dist-cjs/version.js +3 -3
  28. package/dist-cjs/version.js.map +1 -1
  29. package/dist-esm/index.d.mts +16 -122
  30. package/dist-esm/index.mjs +1 -4
  31. package/dist-esm/index.mjs.map +2 -2
  32. package/dist-esm/lib/editor/Editor.mjs +25 -81
  33. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  34. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs +1 -3
  35. package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +2 -2
  36. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +2 -3
  37. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
  38. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +10 -0
  39. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  40. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +6 -13
  41. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +3 -3
  42. package/dist-esm/lib/editor/tools/StateNode.mjs +3 -3
  43. package/dist-esm/lib/editor/tools/StateNode.mjs.map +2 -2
  44. package/dist-esm/lib/hooks/useCanvasEvents.mjs +2 -1
  45. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  46. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +2 -6
  47. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  48. package/dist-esm/lib/primitives/geometry/Group2d.mjs +6 -11
  49. package/dist-esm/lib/primitives/geometry/Group2d.mjs.map +2 -2
  50. package/dist-esm/lib/utils/dom.mjs +1 -1
  51. package/dist-esm/lib/utils/dom.mjs.map +2 -2
  52. package/dist-esm/version.mjs +3 -3
  53. package/dist-esm/version.mjs.map +1 -1
  54. package/editor.css +12 -34
  55. package/package.json +7 -7
  56. package/src/index.ts +0 -6
  57. package/src/lib/editor/Editor.ts +36 -101
  58. package/src/lib/editor/managers/HistoryManager/HistoryManager.ts +1 -3
  59. package/src/lib/editor/managers/TextManager/TextManager.ts +2 -4
  60. package/src/lib/editor/shapes/ShapeUtil.ts +15 -47
  61. package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +17 -25
  62. package/src/lib/editor/tools/StateNode.ts +3 -3
  63. package/src/lib/editor/types/emit-types.ts +0 -4
  64. package/src/lib/editor/types/external-content.ts +2 -11
  65. package/src/lib/hooks/useCanvasEvents.ts +1 -0
  66. package/src/lib/primitives/geometry/Geometry2d.ts +2 -7
  67. package/src/lib/primitives/geometry/Group2d.ts +5 -11
  68. package/src/lib/utils/dom.ts +1 -1
  69. package/src/version.ts +3 -3
  70. package/dist-cjs/lib/utils/reparenting.js +0 -232
  71. package/dist-cjs/lib/utils/reparenting.js.map +0 -7
  72. package/dist-esm/lib/utils/reparenting.mjs +0 -216
  73. package/dist-esm/lib/utils/reparenting.mjs.map +0 -7
  74. package/src/lib/utils/reparenting.ts +0 -383
@@ -1631,13 +1631,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1631
1631
  * @public
1632
1632
  */
1633
1633
  getSelectionPageBounds(): Box | null;
1634
- /**
1635
- * The bounds of the selection bounding box in the current page space.
1636
- *
1637
- * @readonly
1638
- * @public
1639
- */
1640
- getSelectionScreenBounds(): Box | undefined;
1641
1634
  /* Excluded from this release type: getShapesSharedRotation */
1642
1635
  /**
1643
1636
  * The rotation of the selection bounding box in the current page space.
@@ -2911,8 +2904,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2911
2904
  * @public
2912
2905
  */
2913
2906
  getShapeAndDescendantIds(ids: TLShapeId[]): Set<TLShapeId>;
2914
- /** @deprecated Use {@link Editor.getDraggingOverShape} instead */
2915
- getDroppingOverShape(point: Vec, droppingShapes: TLShape[]): TLShape | undefined;
2916
2907
  /**
2917
2908
  * Get the shape that some shapes should be dropped on at a given point.
2918
2909
  *
@@ -2923,7 +2914,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2923
2914
  *
2924
2915
  * @public
2925
2916
  */
2926
- getDraggingOverShape(point: Vec, droppingShapes: TLShape[]): TLShape | undefined;
2917
+ getDroppingOverShape(point: VecLike, droppingShapes?: TLShape[]): TLUnknownShape | undefined;
2927
2918
  /**
2928
2919
  * Get the shape that should be selected when you click on a given shape, assuming there is
2929
2920
  * nothing already selected. It will not return anything higher than or including the current
@@ -3264,22 +3255,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3264
3255
  * @public
3265
3256
  */
3266
3257
  getInitialMetaForShape(_shape: TLShape): JsonObject;
3267
- /**
3268
- * Get whether the provided shape can be created.
3269
- *
3270
- * @param shape - The shape or shape IDs to check.
3271
- *
3272
- * @public
3273
- */
3274
- canCreateShape<T extends TLUnknownShape>(shape: OptionalKeys<TLShapePartial<T>, 'id'> | T['id']): boolean;
3275
- /**
3276
- * Get whether the provided shapes can be created.
3277
- *
3278
- * @param shapes - The shapes or shape IDs to create.
3279
- *
3280
- * @public
3281
- */
3282
- canCreateShapes<T extends TLUnknownShape>(shapes: (OptionalKeys<TLShapePartial<T>, 'id'> | T['id'])[]): boolean;
3283
3258
  /**
3284
3259
  * Create a single shape.
3285
3260
  *
@@ -3626,12 +3601,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
3626
3601
  * @param info - Info about the external content.
3627
3602
  */
3628
3603
  putExternalContent<E>(info: TLExternalContent<E>): Promise<void>;
3629
- /**
3630
- * Handle replacing external content.
3631
- *
3632
- * @param info - Info about the external content.
3633
- */
3634
- replaceExternalContent<E>(info: TLExternalContent<E>): Promise<void>;
3635
3604
  /**
3636
3605
  * Get content that can be exported for the given shape ids.
3637
3606
  *
@@ -4098,7 +4067,6 @@ export declare abstract class Geometry2d {
4098
4067
  isFilled: boolean;
4099
4068
  isClosed: boolean;
4100
4069
  isLabel: boolean;
4101
- isEmptyLabel: boolean;
4102
4070
  isInternal: boolean;
4103
4071
  debugColor?: string;
4104
4072
  ignore?: boolean;
@@ -4190,21 +4158,6 @@ export declare function getCursor(cursor: TLCursorType, rotation?: number, color
4190
4158
  /** @public */
4191
4159
  export declare function getDefaultCdnBaseUrl(): string;
4192
4160
 
4193
- /**
4194
- * Get the shapes that will be reparented to new parents when the shapes are dropped.
4195
- *
4196
- * @param editor - The editor instance.
4197
- * @param shapes - The shapes to check.
4198
- * @param cb - A callback to filter out certain shapes.
4199
- * @returns An object with the shapes that will be reparented to new parents and the shapes that will be reparented to the page or their ancestral group.
4200
- *
4201
- * @public
4202
- */
4203
- export declare function getDroppedShapesToNewParents(editor: Editor, shapes: Set<TLShape> | TLShape[], cb?: (shape: TLShape, parent: TLShape) => boolean): {
4204
- remainingShapesToReparent: Set<TLShape>;
4205
- reparenting: Map<TLShapeId, TLShape[]>;
4206
- };
4207
-
4208
4161
  /** @public */
4209
4162
  export declare function getFontsFromRichText(editor: Editor, richText: TLRichText, initialState: RichTextFontVisitorState): TLFontFace[];
4210
4163
 
@@ -4558,20 +4511,6 @@ export declare function intersectPolygonPolygon(polygonA: VecLike[], polygonB: V
4558
4511
  */
4559
4512
  export declare const isSafeFloat: (n: number) => boolean;
4560
4513
 
4561
- /**
4562
- * Reparents shapes that are no longer contained within their parent shapes.
4563
- * todo: rename me to something more descriptive, like `reparentOccludedShapes` or `reparentAutoDroppedShapes`
4564
- *
4565
- * @param editor - The editor instance.
4566
- * @param shapeIds - The IDs of the shapes to reparent.
4567
- * @param opts - Optional options, including a callback to filter out certain parents, such as when removing a frame.
4568
- *
4569
- * @public
4570
- */
4571
- export declare function kickoutOccludedShapes(editor: Editor, shapeIds: TLShapeId[], opts?: {
4572
- filter?(parent: TLShape): boolean;
4573
- }): void;
4574
-
4575
4514
  /* Excluded from this release type: LicenseFromKeyResult */
4576
4515
 
4577
4516
  /* Excluded from this release type: LicenseInfo */
@@ -5251,6 +5190,14 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5251
5190
  * @public
5252
5191
  */
5253
5192
  canReceiveNewChildrenOfType(_shape: Shape, _type: TLShape['type']): boolean;
5193
+ /**
5194
+ * Get whether the shape can receive children of a given type.
5195
+ *
5196
+ * @param shape - The shape type.
5197
+ * @param shapes - The shapes that are being dropped.
5198
+ * @public
5199
+ */
5200
+ canDropShapes(_shape: Shape, _shapes: TLShape[]): boolean;
5254
5201
  /**
5255
5202
  * Get the shape as an SVG object.
5256
5203
  *
@@ -5338,15 +5285,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5338
5285
  */
5339
5286
  onCrop?(shape: Shape, info: TLCropInfo<Shape>): Omit<TLShapePartial<Shape>, 'id' | 'type'> | undefined | void;
5340
5287
  /**
5341
- * A callback called when some other shapes are dragged into this one. This fires when the shapes are dragged over the shape for the first time.
5342
- *
5343
- * @param shape - The shape.
5344
- * @param shapes - The shapes that are being dragged in.
5345
- * @public
5346
- */
5347
- onDragShapesIn?(shape: Shape, shapes: TLShape[], info: TLDragShapesInInfo): void;
5348
- /**
5349
- * A callback called when some other shapes are dragged over this one. This fires when the shapes are dragged over the shape for the first time (after the onDragShapesIn callback), and again on every update while the shapes are being dragged.
5288
+ * A callback called when some other shapes are dragged over this one.
5350
5289
  *
5351
5290
  * @example
5352
5291
  *
@@ -5360,7 +5299,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5360
5299
  * @param shapes - The shapes that are being dragged over this one.
5361
5300
  * @public
5362
5301
  */
5363
- onDragShapesOver?(shape: Shape, shapes: TLShape[], info: TLDragShapesOverInfo): void;
5302
+ onDragShapesOver?(shape: Shape, shapes: TLShape[]): void;
5364
5303
  /**
5365
5304
  * A callback called when some other shapes are dragged out of this one.
5366
5305
  *
@@ -5368,7 +5307,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5368
5307
  * @param shapes - The shapes that are being dragged out.
5369
5308
  * @public
5370
5309
  */
5371
- onDragShapesOut?(shape: Shape, shapes: TLShape[], info: TLDragShapesOutInfo): void;
5310
+ onDragShapesOut?(shape: Shape, shapes: TLShape[]): void;
5372
5311
  /**
5373
5312
  * A callback called when some other shapes are dropped over this one.
5374
5313
  *
@@ -5376,7 +5315,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5376
5315
  * @param shapes - The shapes that are being dropped over this one.
5377
5316
  * @public
5378
5317
  */
5379
- onDropShapesOver?(shape: Shape, shapes: TLShape[], info: TLDropShapesOverInfo): void;
5318
+ onDropShapesOver?(shape: Shape, shapes: TLShape[]): void;
5380
5319
  /**
5381
5320
  * A callback called when a shape starts being resized.
5382
5321
  *
@@ -5678,7 +5617,7 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
5678
5617
  transition(id: string, info?: any): this;
5679
5618
  handleEvent(info: Exclude<TLEventInfo, TLPinchEventInfo>): void;
5680
5619
  enter(info: any, from: string): void;
5681
- exit(info: any, to: string): void;
5620
+ exit(info: any, from: string): void;
5682
5621
  /**
5683
5622
  * This is a hack / escape hatch that will tell the editor to
5684
5623
  * report a different state as active (in `getCurrentToolId()`) when
@@ -6050,7 +5989,6 @@ export declare interface TLCropInfo<T extends TLShape> {
6050
5989
  w: number;
6051
5990
  };
6052
5991
  initialShape: T;
6053
- aspectRatioLocked?: boolean;
6054
5992
  }
6055
5993
 
6056
5994
  /** @public */
@@ -6109,29 +6047,6 @@ export declare interface TLDeepLinkOptions {
6109
6047
  onChange?(url: URL, editor: Editor): void;
6110
6048
  }
6111
6049
 
6112
- /** @public */
6113
- export declare interface TLDragShapesInInfo {
6114
- initialDraggingOverShapeId: null | TLShapeId;
6115
- prevDraggingOverShapeId: null | TLShapeId;
6116
- initialParentIds: Map<TLShapeId, TLParentId>;
6117
- initialIndices: Map<TLShapeId, IndexKey>;
6118
- }
6119
-
6120
- /** @public */
6121
- export declare interface TLDragShapesOutInfo {
6122
- nextDraggingOverShapeId: null | TLShapeId;
6123
- initialDraggingOverShapeId: null | TLShapeId;
6124
- initialParentIds: Map<TLShapeId, TLParentId>;
6125
- initialIndices: Map<TLShapeId, IndexKey>;
6126
- }
6127
-
6128
- /** @public */
6129
- export declare interface TLDragShapesOverInfo {
6130
- initialDraggingOverShapeId: null | TLShapeId;
6131
- initialParentIds: Map<TLShapeId, TLParentId>;
6132
- initialIndices: Map<TLShapeId, IndexKey>;
6133
- }
6134
-
6135
6050
  /** @public @react */
6136
6051
  export declare const TldrawEditor: React_2.NamedExoticComponent<TldrawEditorProps>;
6137
6052
 
@@ -6379,13 +6294,6 @@ export declare interface TldrawOptions {
6379
6294
  readonly branding?: string;
6380
6295
  }
6381
6296
 
6382
- /** @public */
6383
- export declare interface TLDropShapesOverInfo {
6384
- initialDraggingOverShapeId: null | TLShapeId;
6385
- initialParentIds: Map<TLShapeId, TLParentId>;
6386
- initialIndices: Map<TLShapeId, IndexKey>;
6387
- }
6388
-
6389
6297
  /** @public */
6390
6298
  export declare interface TLEditorComponents {
6391
6299
  Background?: ComponentType | null;
@@ -6608,10 +6516,6 @@ export declare interface TLEventMap {
6608
6516
  };
6609
6517
  shapeId: TLShapeId;
6610
6518
  }];
6611
- 'created-shapes': [TLRecord[]];
6612
- 'edited-shapes': [TLRecord[]];
6613
- 'deleted-shapes': [TLShapeId[]];
6614
- edit: [];
6615
6519
  }
6616
6520
 
6617
6521
  /** @public */
@@ -6642,7 +6546,7 @@ export declare type TLExportType = 'jpeg' | 'png' | 'svg' | 'webp';
6642
6546
  export declare type TLExternalAsset = TLFileExternalAsset | TLUrlExternalAsset;
6643
6547
 
6644
6548
  /** @public */
6645
- export declare type TLExternalContent<EmbedDefinition> = TLEmbedExternalContent<EmbedDefinition> | TLExcalidrawExternalContent | TLFileReplaceExternalContent | TLFilesExternalContent | TLSvgTextExternalContent | TLTextExternalContent | TLTldrawExternalContent | TLUrlExternalContent;
6549
+ export declare type TLExternalContent<EmbedDefinition> = TLEmbedExternalContent<EmbedDefinition> | TLExcalidrawExternalContent | TLFilesExternalContent | TLSvgTextExternalContent | TLTextExternalContent | TLTldrawExternalContent | TLUrlExternalContent;
6646
6550
 
6647
6551
  /** @public */
6648
6552
  export declare type TLExternalContentSource = TLErrorExternalContentSource | TLExcalidrawExternalContentSource | TLTextExternalContentSource | TLTldrawExternalContentSource;
@@ -6654,19 +6558,11 @@ export declare interface TLFileExternalAsset {
6654
6558
  assetId?: TLAssetId;
6655
6559
  }
6656
6560
 
6657
- /** @public */
6658
- export declare interface TLFileReplaceExternalContent extends TLBaseExternalContent {
6659
- type: 'file-replace';
6660
- file: File;
6661
- shapeId: TLShapeId;
6662
- isImage: boolean;
6663
- }
6664
-
6665
6561
  /** @public */
6666
6562
  export declare interface TLFilesExternalContent extends TLBaseExternalContent {
6667
6563
  type: 'files';
6668
6564
  files: File[];
6669
- ignoreParent?: boolean;
6565
+ ignoreParent: boolean;
6670
6566
  }
6671
6567
 
6672
6568
  /**
@@ -6867,7 +6763,6 @@ export declare interface TLMeasureTextOpts {
6867
6763
  fontWeight: string;
6868
6764
  fontFamily: string;
6869
6765
  fontSize: number;
6870
- /** This must be a number, e.g. 1.35, not a pixel value. */
6871
6766
  lineHeight: number;
6872
6767
  /**
6873
6768
  * When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
@@ -7557,7 +7452,6 @@ export declare class TransformedGeometry2d extends Geometry2d {
7557
7452
  /** @public */
7558
7453
  export declare interface TransformedGeometry2dOptions {
7559
7454
  isLabel?: boolean;
7560
- isEmptyLabel?: boolean;
7561
7455
  isInternal?: boolean;
7562
7456
  debugColor?: string;
7563
7457
  ignore?: boolean;
package/dist-cjs/index.js CHANGED
@@ -128,7 +128,6 @@ __export(index_exports, {
128
128
  getArcMeasure: () => import_utils2.getArcMeasure,
129
129
  getCursor: () => import_useCursor.getCursor,
130
130
  getDefaultCdnBaseUrl: () => import_assets.getDefaultCdnBaseUrl,
131
- getDroppedShapesToNewParents: () => import_reparenting.getDroppedShapesToNewParents,
132
131
  getFontsFromRichText: () => import_richText.getFontsFromRichText,
133
132
  getFreshUserPreferences: () => import_TLUserPreferences.getFreshUserPreferences,
134
133
  getIncrementedName: () => import_getIncrementedName.getIncrementedName,
@@ -157,7 +156,6 @@ __export(index_exports, {
157
156
  intersectPolygonPolygon: () => import_intersect.intersectPolygonPolygon,
158
157
  isAccelKey: () => import_keyboard.isAccelKey,
159
158
  isSafeFloat: () => import_utils2.isSafeFloat,
160
- kickoutOccludedShapes: () => import_reparenting.kickoutOccludedShapes,
161
159
  linesIntersect: () => import_intersect.linesIntersect,
162
160
  loadSessionStateSnapshotIntoStore: () => import_TLSessionStateSnapshot.loadSessionStateSnapshotIntoStore,
163
161
  loadSnapshot: () => import_TLEditorSnapshot.loadSnapshot,
@@ -351,7 +349,6 @@ var import_hardResetEditor = require("./lib/utils/hardResetEditor");
351
349
  var import_keyboard = require("./lib/utils/keyboard");
352
350
  var import_normalizeWheel = require("./lib/utils/normalizeWheel");
353
351
  var import_refreshPage = require("./lib/utils/refreshPage");
354
- var import_reparenting = require("./lib/utils/reparenting");
355
352
  var import_richText = require("./lib/utils/richText");
356
353
  var import_rotation = require("./lib/utils/rotation");
357
354
  var import_runtime = require("./lib/utils/runtime");
@@ -364,7 +361,7 @@ function debugEnableLicensing() {
364
361
  }
365
362
  (0, import_utils.registerTldrawLibraryVersion)(
366
363
  "@tldraw/editor",
367
- "3.14.0-canary.fb0390b30559",
364
+ "3.14.0-canary.fc011e3d07ba",
368
365
  "cjs"
369
366
  );
370
367
  //# 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'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\n\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\n\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tTAB_ID,\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tUSER_COLORS,\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\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 {\n\tTextManager,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\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 { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\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 {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype 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 TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLSvgOptions,\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 { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport { EditorContext, useEditor, useMaybeEditor } from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { 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 TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport {\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 {\n\tHALF_PI,\n\tPI,\n\tPI2,\n\tSIN,\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TLTextOptions,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AC1B,kBAAqB;AACrB,yBAA2B;AAKpB,SAAS,uBAAuB;AAEtC;AACD;AAAA,IAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\n\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\n\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\n\tDefaultShapeIndicators,\n\ttype TLShapeIndicatorsProps,\n} from './lib/components/default-components/DefaultShapeIndicators'\nexport {\n\tDefaultSnapIndicator,\n\ttype TLSnapIndicatorProps,\n} from './lib/components/default-components/DefaultSnapIndictor'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tTAB_ID,\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tUSER_COLORS,\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { createTLUser, useTldrawUser, type TLUser } from './lib/config/createTLUser'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\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 {\n\tTextManager,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\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 { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\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 {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype 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 TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLSvgOptions,\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 { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport { EditorContext, useEditor, useMaybeEditor } from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { 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 TestEnvironment,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { defaultTldrawOptions, type TldrawOptions } from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport {\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 {\n\tHALF_PI,\n\tPI,\n\tPI2,\n\tSIN,\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { hardResetEditor } from './lib/utils/hardResetEditor'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { refreshPage } from './lib/utils/refreshPage'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TLTextOptions,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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,6BAIO;AACP,oBAAoD;AACpD,kCAAgE;AAChE,yBAMO;AACP,uBAKO;AACP,iBAOO;AACP,gCAAmC;AACnC,4BAA+B;AAC/B,kCAAqC;AACrC,6BAAgC;AAChC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAA4B;AAC5B,sBAOO;AACP,sBAIO;AACP,qBAA6C;AAC7C,4BAAsD;AAEtD,uBAA0B;AAC1B,kBAAqB;AACrB,yBAA2B;AAKpB,SAAS,uBAAuB;AAEtC;AACD;AAAA,IAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": ["import_at", "import_utils"]
7
7
  }
@@ -323,7 +323,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
323
323
  __publicField(this, "externalContentHandlers", {
324
324
  text: null,
325
325
  files: null,
326
- "file-replace": null,
327
326
  embed: null,
328
327
  "svg-text": null,
329
328
  url: null,
@@ -1642,19 +1641,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
1642
1641
  getSelectionPageBounds() {
1643
1642
  return this.getShapesPageBounds(this.getSelectedShapeIds());
1644
1643
  }
1645
- /**
1646
- * The bounds of the selection bounding box in the current page space.
1647
- *
1648
- * @readonly
1649
- * @public
1650
- */
1651
- getSelectionScreenBounds() {
1652
- const bounds = this.getSelectionPageBounds();
1653
- if (!bounds) return void 0;
1654
- const { x, y } = this.pageToScreen(bounds.point);
1655
- const zoom = this.getZoomLevel();
1656
- return new import_Box.Box(x, y, bounds.width * zoom, bounds.height * zoom);
1657
- }
1658
1644
  /**
1659
1645
  * @internal
1660
1646
  */
@@ -2788,7 +2774,7 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
2788
2774
  * @public
2789
2775
  */
2790
2776
  updateViewportScreenBounds(screenBounds, center = false) {
2791
- if (!(screenBounds instanceof import_Box.Box)) {
2777
+ if (screenBounds instanceof HTMLElement) {
2792
2778
  const rect = screenBounds.getBoundingClientRect();
2793
2779
  screenBounds = new import_Box.Box(
2794
2780
  rect.left || rect.x,
@@ -4131,7 +4117,7 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
4131
4117
  if (!id) return void 0;
4132
4118
  const freshShape = this.getShape(id);
4133
4119
  if (freshShape === void 0 || !(0, import_tlschema.isShapeId)(freshShape.parentId)) return void 0;
4134
- return this.getShape(freshShape.parentId);
4120
+ return this.store.get(freshShape.parentId);
4135
4121
  }
4136
4122
  /**
4137
4123
  * If siblingShape and targetShape are siblings, this returns targetShape. If targetShape has an
@@ -4263,9 +4249,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
4263
4249
  if (!pagePoint) continue;
4264
4250
  const newPoint = invertedParentTransform.applyToPoint(pagePoint);
4265
4251
  const newRotation = pageTransform.rotation() - parentPageRotation;
4266
- if (shape.id === parentId) {
4267
- throw Error("Attempted to reparent a shape to itself!");
4268
- }
4269
4252
  changes.push({
4270
4253
  id: shape.id,
4271
4254
  type: shape.type,
@@ -4358,10 +4341,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
4358
4341
  }
4359
4342
  return shapeIds;
4360
4343
  }
4361
- /** @deprecated Use {@link Editor.getDraggingOverShape} instead */
4362
- getDroppingOverShape(point, droppingShapes) {
4363
- return this.getDraggingOverShape(point, droppingShapes);
4364
- }
4365
4344
  /**
4366
4345
  * Get the shape that some shapes should be dropped on at a given point.
4367
4346
  *
@@ -4372,20 +4351,22 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
4372
4351
  *
4373
4352
  * @public
4374
4353
  */
4375
- getDraggingOverShape(point, droppingShapes) {
4376
- const draggingShapes = (0, import_utils.compact)(droppingShapes.map((s) => this.getShape(s))).filter(
4377
- (s) => !s.isLocked && !this.isShapeHidden(s)
4378
- );
4379
- const maybeDraggingOverShapes = this.getShapesAtPoint(point, {
4380
- hitInside: true,
4381
- margin: 0
4382
- }).filter(
4383
- (s) => !droppingShapes.includes(s) && !s.isLocked && !this.isShapeHidden(s) && !draggingShapes.includes(s)
4384
- );
4385
- for (const maybeDraggingOverShape of maybeDraggingOverShapes) {
4386
- const shapeUtil = this.getShapeUtil(maybeDraggingOverShape);
4387
- if (shapeUtil.onDragShapesOver || shapeUtil.onDragShapesIn || shapeUtil.onDragShapesOut || shapeUtil.onDropShapesOver) {
4388
- return maybeDraggingOverShape;
4354
+ getDroppingOverShape(point, droppingShapes = []) {
4355
+ const currentPageShapesSorted = this.getCurrentPageShapesSorted();
4356
+ for (let i = currentPageShapesSorted.length - 1; i >= 0; i--) {
4357
+ const shape = currentPageShapesSorted[i];
4358
+ if (
4359
+ // ignore hidden shapes
4360
+ this.isShapeHidden(shape) || // don't allow dropping on selected shapes
4361
+ this.getSelectedShapeIds().includes(shape.id) || // only allow shapes that can receive children
4362
+ !this.getShapeUtil(shape).canDropShapes(shape, droppingShapes) || // don't allow dropping a shape on itself or one of it's children
4363
+ droppingShapes.find((s) => s.id === shape.id || this.hasAncestor(shape, s.id))
4364
+ ) {
4365
+ continue;
4366
+ }
4367
+ const maskedPageBounds = this.getShapeMaskedPageBounds(shape.id);
4368
+ if (maskedPageBounds && maskedPageBounds.containsPoint(point) && this.getShapeGeometry(shape).hitTestPoint(this.getPointInShapeSpace(shape, point), 0, true)) {
4369
+ return shape;
4389
4370
  }
4390
4371
  }
4391
4372
  }
@@ -4662,8 +4643,7 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
4662
4643
  */
4663
4644
  duplicateShapes(shapes, offset) {
4664
4645
  this.run(() => {
4665
- const _ids = typeof shapes[0] === "string" ? shapes : shapes.map((s) => s.id);
4666
- const ids = this._shouldIgnoreShapeLock ? _ids : this._getUnlockedShapeIds(_ids);
4646
+ const ids = typeof shapes[0] === "string" ? shapes : shapes.map((s) => s.id);
4667
4647
  if (ids.length <= 0) return this;
4668
4648
  const initialIds = new Set(ids);
4669
4649
  const shapeIdSet = this.getShapeAndDescendantIds(ids);
@@ -4727,7 +4707,8 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
4727
4707
  shape.index = index;
4728
4708
  });
4729
4709
  const shapesToCreate = shapesToCreateWithOriginals.map(({ shape }) => shape);
4730
- if (!this.canCreateShapes(shapesToCreate)) {
4710
+ const maxShapesReached = shapesToCreate.length + this.getCurrentPageShapeIds().size > this.options.maxShapesPerPage;
4711
+ if (maxShapesReached) {
4731
4712
  alertMaxShapes(this);
4732
4713
  return;
4733
4714
  }
@@ -5742,26 +5723,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
5742
5723
  getInitialMetaForShape(_shape) {
5743
5724
  return {};
5744
5725
  }
5745
- /**
5746
- * Get whether the provided shape can be created.
5747
- *
5748
- * @param shape - The shape or shape IDs to check.
5749
- *
5750
- * @public
5751
- */
5752
- canCreateShape(shape) {
5753
- return this.canCreateShapes([shape]);
5754
- }
5755
- /**
5756
- * Get whether the provided shapes can be created.
5757
- *
5758
- * @param shapes - The shapes or shape IDs to create.
5759
- *
5760
- * @public
5761
- */
5762
- canCreateShapes(shapes) {
5763
- return shapes.length + this.getCurrentPageShapeIds().size <= this.options.maxShapesPerPage;
5764
- }
5765
5726
  /**
5766
5727
  * Create a single shape.
5767
5728
  *
@@ -5815,8 +5776,7 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
5815
5776
  let parentId = this.getFocusedGroupId();
5816
5777
  for (let i = currentPageShapesSorted.length - 1; i >= 0; i--) {
5817
5778
  const parent = currentPageShapesSorted[i];
5818
- const util = this.getShapeUtil(parent);
5819
- if (util.canReceiveNewChildrenOfType(parent, partial.type) && !this.isShapeHidden(parent) && this.isPointInShape(
5779
+ if (!this.isShapeHidden(parent) && this.getShapeUtil(parent).canReceiveNewChildrenOfType(parent, partial.type) && this.isPointInShape(
5820
5780
  parent,
5821
5781
  // If no parent is provided, then we can treat the
5822
5782
  // shape's provided x/y as being in the page's space.
@@ -5891,8 +5851,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
5891
5851
  ...shape.meta
5892
5852
  };
5893
5853
  });
5894
- this.emit("created-shapes", shapeRecordsToCreate);
5895
- this.emit("edit");
5896
5854
  this.store.put(shapeRecordsToCreate);
5897
5855
  });
5898
5856
  return this;
@@ -6134,8 +6092,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
6134
6092
  updated = this.getShapeUtil(shape).onBeforeUpdate?.(shape, updated) ?? updated;
6135
6093
  updates.push(updated);
6136
6094
  }
6137
- this.emit("edited-shapes", updates);
6138
- this.emit("edit");
6139
6095
  this.store.put(updates);
6140
6096
  });
6141
6097
  }
@@ -6157,8 +6113,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
6157
6113
  allShapeIdsToDelete.add(childId);
6158
6114
  });
6159
6115
  }
6160
- this.emit("deleted-shapes", [...allShapeIdsToDelete]);
6161
- this.emit("edit");
6162
6116
  return this.run(() => this.store.remove([...allShapeIdsToDelete]));
6163
6117
  }
6164
6118
  deleteShape(_id) {
@@ -6502,14 +6456,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
6502
6456
  async putExternalContent(info) {
6503
6457
  return this.externalContentHandlers[info.type]?.(info);
6504
6458
  }
6505
- /**
6506
- * Handle replacing external content.
6507
- *
6508
- * @param info - Info about the external content.
6509
- */
6510
- async replaceExternalContent(info) {
6511
- return this.externalContentHandlers[info.type]?.(info);
6512
- }
6513
6459
  /**
6514
6460
  * Get content that can be exported for the given shape ids.
6515
6461
  *
@@ -6927,9 +6873,7 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
6927
6873
  previousScreenPoint,
6928
6874
  previousPagePoint,
6929
6875
  currentScreenPoint,
6930
- currentPagePoint,
6931
- originScreenPoint,
6932
- originPagePoint
6876
+ currentPagePoint
6933
6877
  } = this.inputs;
6934
6878
  const { screenBounds } = this.store.unsafeGetWithoutCapture(import_tlschema.TLINSTANCE_ID);
6935
6879
  const { x: cx, y: cy, z: cz } = (0, import_state.unsafe__withoutCapture)(() => this.getCamera());
@@ -6947,8 +6891,8 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
6947
6891
  this.inputs.isPen = info.type === "pointer" && info.isPen;
6948
6892
  if (info.name === "pointer_down" || this.inputs.isPinching) {
6949
6893
  pointerVelocity.set(0, 0);
6950
- originScreenPoint.setTo(currentScreenPoint);
6951
- originPagePoint.setTo(currentPagePoint);
6894
+ this.inputs.originScreenPoint.setTo(currentScreenPoint);
6895
+ this.inputs.originPagePoint.setTo(currentPagePoint);
6952
6896
  }
6953
6897
  this.run(
6954
6898
  () => {