@tldraw/editor 3.12.0-internal.624e32507d98 → 3.13.0-canary.1793786aff8a

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 (102) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/dist-cjs/index.d.ts +170 -21
  3. package/dist-cjs/index.js +3 -1
  4. package/dist-cjs/index.js.map +2 -2
  5. package/dist-cjs/lib/TldrawEditor.js +5 -0
  6. package/dist-cjs/lib/TldrawEditor.js.map +2 -2
  7. package/dist-cjs/lib/components/GeometryDebuggingView.js +2 -2
  8. package/dist-cjs/lib/components/GeometryDebuggingView.js.map +2 -2
  9. package/dist-cjs/lib/components/default-components/DefaultCanvas.js +10 -1
  10. package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
  11. package/dist-cjs/lib/editor/Editor.js +208 -18
  12. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  13. package/dist-cjs/lib/editor/managers/FocusManager.js +1 -1
  14. package/dist-cjs/lib/editor/managers/FocusManager.js.map +2 -2
  15. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +12 -0
  16. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  17. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js +4 -13
  18. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +2 -2
  19. package/dist-cjs/lib/editor/types/selection-types.js.map +1 -1
  20. package/dist-cjs/lib/exports/StyleEmbedder.js +31 -60
  21. package/dist-cjs/lib/exports/StyleEmbedder.js.map +2 -2
  22. package/dist-cjs/lib/exports/cssRules.js +3 -9
  23. package/dist-cjs/lib/exports/cssRules.js.map +2 -2
  24. package/dist-cjs/lib/exports/exportToSvg.js +1 -4
  25. package/dist-cjs/lib/exports/exportToSvg.js.map +2 -2
  26. package/dist-cjs/lib/hooks/useCanvasEvents.js +2 -2
  27. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  28. package/dist-cjs/lib/hooks/useDocumentEvents.js +16 -0
  29. package/dist-cjs/lib/hooks/useDocumentEvents.js.map +2 -2
  30. package/dist-cjs/lib/license/Watermark.js +10 -20
  31. package/dist-cjs/lib/license/Watermark.js.map +2 -2
  32. package/dist-cjs/lib/primitives/geometry/Geometry2d.js +139 -16
  33. package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +3 -3
  34. package/dist-cjs/lib/primitives/geometry/Group2d.js +54 -11
  35. package/dist-cjs/lib/primitives/geometry/Group2d.js.map +2 -2
  36. package/dist-cjs/lib/primitives/intersect.js +20 -0
  37. package/dist-cjs/lib/primitives/intersect.js.map +2 -2
  38. package/dist-cjs/lib/utils/reorderShapes.js +2 -8
  39. package/dist-cjs/lib/utils/reorderShapes.js.map +2 -2
  40. package/dist-cjs/version.js +3 -3
  41. package/dist-cjs/version.js.map +1 -1
  42. package/dist-esm/index.d.mts +170 -21
  43. package/dist-esm/index.mjs +8 -2
  44. package/dist-esm/index.mjs.map +2 -2
  45. package/dist-esm/lib/TldrawEditor.mjs +5 -0
  46. package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
  47. package/dist-esm/lib/components/GeometryDebuggingView.mjs +3 -3
  48. package/dist-esm/lib/components/GeometryDebuggingView.mjs.map +2 -2
  49. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +10 -1
  50. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
  51. package/dist-esm/lib/editor/Editor.mjs +209 -18
  52. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  53. package/dist-esm/lib/editor/managers/FocusManager.mjs +1 -1
  54. package/dist-esm/lib/editor/managers/FocusManager.mjs.map +2 -2
  55. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +12 -0
  56. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  57. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs +4 -13
  58. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +2 -2
  59. package/dist-esm/lib/exports/StyleEmbedder.mjs +32 -61
  60. package/dist-esm/lib/exports/StyleEmbedder.mjs.map +2 -2
  61. package/dist-esm/lib/exports/cssRules.mjs +3 -9
  62. package/dist-esm/lib/exports/cssRules.mjs.map +2 -2
  63. package/dist-esm/lib/exports/exportToSvg.mjs +1 -4
  64. package/dist-esm/lib/exports/exportToSvg.mjs.map +2 -2
  65. package/dist-esm/lib/hooks/useCanvasEvents.mjs +2 -2
  66. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  67. package/dist-esm/lib/hooks/useDocumentEvents.mjs +16 -0
  68. package/dist-esm/lib/hooks/useDocumentEvents.mjs.map +2 -2
  69. package/dist-esm/lib/license/Watermark.mjs +10 -20
  70. package/dist-esm/lib/license/Watermark.mjs.map +2 -2
  71. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +143 -14
  72. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  73. package/dist-esm/lib/primitives/geometry/Group2d.mjs +55 -12
  74. package/dist-esm/lib/primitives/geometry/Group2d.mjs.map +2 -2
  75. package/dist-esm/lib/primitives/intersect.mjs +20 -0
  76. package/dist-esm/lib/primitives/intersect.mjs.map +2 -2
  77. package/dist-esm/lib/utils/reorderShapes.mjs +2 -8
  78. package/dist-esm/lib/utils/reorderShapes.mjs.map +2 -2
  79. package/dist-esm/version.mjs +3 -3
  80. package/dist-esm/version.mjs.map +1 -1
  81. package/editor.css +34 -19
  82. package/package.json +7 -7
  83. package/src/index.ts +12 -2
  84. package/src/lib/TldrawEditor.tsx +30 -3
  85. package/src/lib/components/GeometryDebuggingView.tsx +3 -3
  86. package/src/lib/components/default-components/DefaultCanvas.tsx +6 -1
  87. package/src/lib/editor/Editor.ts +315 -24
  88. package/src/lib/editor/managers/FocusManager.ts +1 -1
  89. package/src/lib/editor/shapes/ShapeUtil.ts +14 -0
  90. package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +7 -15
  91. package/src/lib/editor/types/selection-types.ts +3 -0
  92. package/src/lib/exports/StyleEmbedder.ts +34 -81
  93. package/src/lib/exports/cssRules.ts +5 -11
  94. package/src/lib/exports/exportToSvg.tsx +1 -5
  95. package/src/lib/hooks/useCanvasEvents.ts +6 -2
  96. package/src/lib/hooks/useDocumentEvents.ts +18 -0
  97. package/src/lib/license/Watermark.tsx +18 -29
  98. package/src/lib/primitives/geometry/Geometry2d.ts +216 -19
  99. package/src/lib/primitives/geometry/Group2d.ts +76 -13
  100. package/src/lib/primitives/intersect.ts +41 -0
  101. package/src/lib/utils/reorderShapes.ts +2 -9
  102. package/src/version.ts +3 -3
@@ -986,8 +986,8 @@ export declare class EdgeScrollManager {
986
986
  /** @public */
987
987
  export declare class Editor extends EventEmitter<TLEventMap> {
988
988
  readonly id: string;
989
- constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options, isShapeHidden, fontAssetUrls, }: TLEditorOptions);
990
- private readonly _isShapeHiddenPredicate?;
989
+ constructor({ store, user, shapeUtils, bindingUtils, tools, getContainer, cameraOptions, textOptions, initialState, autoFocus, inferDarkMode, options, isShapeHidden, getShapeVisibility, fontAssetUrls, }: TLEditorOptions);
990
+ private readonly _getShapeVisibility?;
991
991
  private getIsShapeHiddenCache;
992
992
  isShapeHidden(shapeOrId: TLShape | TLShapeId): boolean;
993
993
  readonly options: TldrawOptions;
@@ -1577,6 +1577,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1577
1577
  * @public
1578
1578
  */
1579
1579
  selectAll(): this;
1580
+ selectAdjacentShape(direction: TLAdjacentDirection): void;
1581
+ /**
1582
+ * Generates a reading order for shapes based on rows grouping.
1583
+ * Tries to keep a natural reading order (left-to-right, top-to-bottom).
1584
+ *
1585
+ * @public
1586
+ */
1587
+ getCurrentPageShapesInReadingOrder(): TLShape[];
1588
+ /**
1589
+ * Find the nearest adjacent shape in a specific direction.
1590
+ *
1591
+ * @public
1592
+ */
1593
+ getNearestAdjacentShape(currentShapeId: TLShapeId, direction: 'down' | 'left' | 'right' | 'up'): TLShapeId;
1580
1594
  /**
1581
1595
  * Clear the selection.
1582
1596
  *
@@ -1991,6 +2005,15 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1991
2005
  * @public
1992
2006
  */
1993
2007
  zoomToSelection(opts?: TLCameraMoveOptions): this;
2008
+ /**
2009
+ * Zoom the camera to the current selection if offscreen.
2010
+ *
2011
+ * @public
2012
+ */
2013
+ zoomToSelectionIfOffscreen(padding?: number, opts?: {
2014
+ inset?: number;
2015
+ targetZoom?: number;
2016
+ } & TLCameraMoveOptions): void;
1994
2017
  /**
1995
2018
  * Zoom the camera to fit a bounding box (in the current page space).
1996
2019
  *
@@ -2422,7 +2445,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2422
2445
  }>;
2423
2446
  private _shapeGeometryCaches;
2424
2447
  /**
2425
- * Get the geometry of a shape.
2448
+ * Get the geometry of a shape in shape-space.
2426
2449
  *
2427
2450
  * @example
2428
2451
  * ```ts
@@ -2437,6 +2460,23 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2437
2460
  * @public
2438
2461
  */
2439
2462
  getShapeGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
2463
+ private _shapePageGeometryCaches;
2464
+ /**
2465
+ * Get the geometry of a shape in page-space.
2466
+ *
2467
+ * @example
2468
+ * ```ts
2469
+ * editor.getShapePageGeometry(myShape)
2470
+ * editor.getShapePageGeometry(myShapeId)
2471
+ * editor.getShapePageGeometry(myShapeId, { context: "arrow" })
2472
+ * ```
2473
+ *
2474
+ * @param shape - The shape (or shape id) to get the geometry for.
2475
+ * @param opts - Additional options about the request for geometry. Passed to {@link ShapeUtil.getGeometry}.
2476
+ *
2477
+ * @public
2478
+ */
2479
+ getShapePageGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
2440
2480
  /* Excluded from this release type: _getShapeHandlesCache */
2441
2481
  /**
2442
2482
  * Get the handles (if any) for a shape.
@@ -4040,17 +4080,25 @@ export declare abstract class Geometry2d {
4040
4080
  isFilled: boolean;
4041
4081
  isClosed: boolean;
4042
4082
  isLabel: boolean;
4083
+ isInternal: boolean;
4043
4084
  debugColor?: string;
4044
4085
  ignore?: boolean;
4045
4086
  constructor(opts: Geometry2dOptions);
4046
- abstract getVertices(): Vec[];
4047
- abstract nearestPoint(point: Vec): Vec;
4048
- hitTestPoint(point: Vec, margin?: number, hitInside?: boolean): boolean;
4049
- distanceToPoint(point: Vec, hitInside?: boolean): number;
4050
- distanceToLineSegment(A: Vec, B: Vec): number;
4051
- hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean;
4087
+ isExcludedByFilter(filters?: Geometry2dFilters): boolean;
4088
+ abstract getVertices(filters: Geometry2dFilters): Vec[];
4089
+ abstract nearestPoint(point: Vec, _filters?: Geometry2dFilters): Vec;
4090
+ hitTestPoint(point: Vec, margin?: number, hitInside?: boolean, _filters?: Geometry2dFilters): boolean;
4091
+ distanceToPoint(point: Vec, hitInside?: boolean, filters?: Geometry2dFilters): number;
4092
+ distanceToLineSegment(A: Vec, B: Vec, filters?: Geometry2dFilters): number;
4093
+ hitTestLineSegment(A: Vec, B: Vec, distance?: number, filters?: Geometry2dFilters): boolean;
4094
+ intersectLineSegment(A: VecLike, B: VecLike, _filters?: Geometry2dFilters): VecLike[];
4095
+ intersectCircle(center: VecLike, radius: number, _filters?: Geometry2dFilters): VecLike[];
4096
+ intersectPolygon(polygon: VecLike[], _filters?: Geometry2dFilters): VecLike[];
4097
+ intersectPolyline(polyline: VecLike[], _filters?: Geometry2dFilters): VecLike[];
4098
+ /** @deprecated Iterate the vertices instead. */
4052
4099
  nearestPointOnLineSegment(A: Vec, B: Vec): Vec;
4053
4100
  isPointInBounds(point: Vec, margin?: number): boolean;
4101
+ transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
4054
4102
  private _vertices;
4055
4103
  get vertices(): Vec[];
4056
4104
  getBounds(): Box;
@@ -4067,13 +4115,31 @@ export declare abstract class Geometry2d {
4067
4115
  abstract getSvgPathData(first: boolean): string;
4068
4116
  }
4069
4117
 
4118
+ /**
4119
+ * Filter geometry within a group.
4120
+ *
4121
+ * Filters are ignored when called directly on primitive geometries, but can be used to narrow down
4122
+ * the results of an operation on `Group2d` geometries.
4123
+ *
4124
+ * @public
4125
+ */
4126
+ export declare interface Geometry2dFilters {
4127
+ readonly includeLabels?: boolean;
4128
+ readonly includeInternal?: boolean;
4129
+ }
4130
+
4070
4131
  /** @public */
4071
- export declare interface Geometry2dOptions {
4132
+ export declare const Geometry2dFilters: {
4133
+ EXCLUDE_INTERNAL: Geometry2dFilters;
4134
+ EXCLUDE_LABELS: Geometry2dFilters;
4135
+ EXCLUDE_NON_STANDARD: Geometry2dFilters;
4136
+ INCLUDE_ALL: Geometry2dFilters;
4137
+ };
4138
+
4139
+ /** @public */
4140
+ export declare interface Geometry2dOptions extends TransformedGeometry2dOptions {
4072
4141
  isFilled: boolean;
4073
4142
  isClosed: boolean;
4074
- isLabel?: boolean;
4075
- debugColor?: string;
4076
- ignore?: boolean;
4077
4143
  }
4078
4144
 
4079
4145
  /**
@@ -4207,11 +4273,16 @@ export declare class Group2d extends Geometry2d {
4207
4273
  constructor(config: Omit<Geometry2dOptions, 'isClosed' | 'isFilled'> & {
4208
4274
  children: Geometry2d[];
4209
4275
  });
4210
- getVertices(): Vec[];
4211
- nearestPoint(point: Vec): Vec;
4212
- distanceToPoint(point: Vec, hitInside?: boolean): number;
4213
- hitTestPoint(point: Vec, margin: number, hitInside: boolean): boolean;
4214
- hitTestLineSegment(A: Vec, B: Vec, zoom: number): boolean;
4276
+ getVertices(filters: Geometry2dFilters): Vec[];
4277
+ nearestPoint(point: Vec, filters?: Geometry2dFilters): Vec;
4278
+ distanceToPoint(point: Vec, hitInside?: boolean, filters?: Geometry2dFilters): number;
4279
+ hitTestPoint(point: Vec, margin: number, hitInside: boolean, filters?: Geometry2dFilters): boolean;
4280
+ hitTestLineSegment(A: Vec, B: Vec, zoom: number, filters?: Geometry2dFilters): boolean;
4281
+ intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
4282
+ intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
4283
+ intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
4284
+ intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
4285
+ transform(transform: Mat): Geometry2d;
4215
4286
  getArea(): number;
4216
4287
  toSimpleSvgPath(): string;
4217
4288
  getLength(): number;
@@ -4223,6 +4294,7 @@ export declare class GroupShapeUtil extends ShapeUtil<TLGroupShape> {
4223
4294
  static type: "group";
4224
4295
  static props: RecordProps<TLGroupShape>;
4225
4296
  static migrations: TLPropsMigrations;
4297
+ canTabTo(): boolean;
4226
4298
  hideSelectionBoundsFg(): boolean;
4227
4299
  canBind(): boolean;
4228
4300
  getDefaultProps(): TLGroupShape['props'];
@@ -4990,6 +5062,13 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
4990
5062
  * @public
4991
5063
  */
4992
5064
  canSnap(_shape: Shape): boolean;
5065
+ /**
5066
+ * Whether the shape can be tabbed to.
5067
+ *
5068
+ * @param shape - The shape.
5069
+ * @public
5070
+ */
5071
+ canTabTo(_shape: Shape): boolean;
4993
5072
  /**
4994
5073
  * Whether the shape can be scrolled while editing.
4995
5074
  *
@@ -5151,6 +5230,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5151
5230
  */
5152
5231
  getHandleSnapGeometry(_shape: Shape): HandleSnapGeometry;
5153
5232
  getText(_shape: Shape): string | undefined;
5233
+ getAriaDescriptor(_shape: Shape): string | undefined;
5154
5234
  /**
5155
5235
  * A callback called just before a shape is created. This method provides a last chance to modify
5156
5236
  * the created shape.
@@ -5700,6 +5780,9 @@ export declare type TiptapEditor = Editor_2;
5700
5780
  */
5701
5781
  export declare type TiptapNode = Node_2;
5702
5782
 
5783
+ /** @public */
5784
+ export declare type TLAdjacentDirection = 'down' | 'left' | 'next' | 'prev' | 'right' | 'up';
5785
+
5703
5786
  /** @public */
5704
5787
  export declare type TLAnyBindingUtilConstructor = TLBindingUtilConstructor<any>;
5705
5788
 
@@ -6045,11 +6128,29 @@ export declare interface TldrawEditorBaseProps {
6045
6128
  /**
6046
6129
  * Predicate for whether or not a shape should be hidden.
6047
6130
  *
6131
+ * @deprecated Use {@link TldrawEditorBaseProps#getShapeVisibility} instead.
6132
+ */
6133
+ isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6134
+ /**
6135
+ * Provides a way to hide shapes.
6136
+ *
6048
6137
  * Hidden shapes will not render in the editor, and they will not be eligible for hit test via
6049
6138
  * {@link Editor#getShapeAtPoint} and {@link Editor#getShapesAtPoint}. But otherwise they will
6050
6139
  * remain in the store and participate in all other operations.
6140
+ *
6141
+ * @example
6142
+ * ```ts
6143
+ * getShapeVisibility={(shape, editor) => shape.meta.hidden ? 'hidden' : 'inherit'}
6144
+ * ```
6145
+ *
6146
+ * - `'inherit' | undefined` - (default) The shape will be visible unless its parent is hidden.
6147
+ * - `'hidden'` - The shape will be hidden.
6148
+ * - `'visible'` - The shape will be visible.
6149
+ *
6150
+ * @param shape - The shape to check.
6151
+ * @param editor - The editor instance.
6051
6152
  */
6052
- isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6153
+ getShapeVisibility?(shape: TLShape, editor: Editor): 'hidden' | 'inherit' | 'visible' | null | undefined;
6053
6154
  /**
6054
6155
  * The URLs for the fonts to use in the editor.
6055
6156
  */
@@ -6072,7 +6173,7 @@ export declare type TldrawEditorStoreProps = TldrawEditorWithoutStoreProps | Tld
6072
6173
 
6073
6174
  /**
6074
6175
  * Props for the {@link tldraw#Tldraw} and {@link TldrawEditor} components, when not passing in a
6075
- * {@link store#TLStore} directly. If you would like to pass in a store directly, use
6176
+ * `TLStore` directly. If you would like to pass in a store directly, use
6076
6177
  * {@link TldrawEditorWithStoreProps}.
6077
6178
  *
6078
6179
  * @public
@@ -6098,7 +6199,7 @@ export declare interface TldrawEditorWithoutStoreProps extends TLStoreBaseOption
6098
6199
 
6099
6200
  /**
6100
6201
  * Props for the {@link tldraw#Tldraw} and {@link TldrawEditor} components, when passing in a
6101
- * {@link store#TLStore} directly. If you would like tldraw to create a store for you, use
6202
+ * `TLStore` directly. If you would like tldraw to create a store for you, use
6102
6203
  * {@link TldrawEditorWithoutStoreProps}.
6103
6204
  *
6104
6205
  * @public
@@ -6277,10 +6378,29 @@ export declare interface TLEditorOptions {
6277
6378
  };
6278
6379
  /**
6279
6380
  * A predicate that should return true if the given shape should be hidden.
6381
+ *
6382
+ * @deprecated Use {@link Editor#getShapeVisibility} instead.
6383
+ *
6280
6384
  * @param shape - The shape to check.
6281
6385
  * @param editor - The editor instance.
6282
6386
  */
6283
6387
  isShapeHidden?(shape: TLShape, editor: Editor): boolean;
6388
+ /**
6389
+ * Provides a way to hide shapes.
6390
+ *
6391
+ * @example
6392
+ * ```ts
6393
+ * getShapeVisibility={(shape, editor) => shape.meta.hidden ? 'hidden' : 'inherit'}
6394
+ * ```
6395
+ *
6396
+ * - `'inherit' | undefined` - (default) The shape will be visible unless its parent is hidden.
6397
+ * - `'hidden'` - The shape will be hidden.
6398
+ * - `'visible'` - The shape will be visible.
6399
+ *
6400
+ * @param shape - The shape to check.
6401
+ * @param editor - The editor instance.
6402
+ */
6403
+ getShapeVisibility?(shape: TLShape, editor: Editor): 'hidden' | 'inherit' | 'visible' | null | undefined;
6284
6404
  }
6285
6405
 
6286
6406
  /**
@@ -7292,6 +7412,35 @@ export { transact }
7292
7412
 
7293
7413
  export { transaction }
7294
7414
 
7415
+ /** @public */
7416
+ export declare class TransformedGeometry2d extends Geometry2d {
7417
+ private readonly geometry;
7418
+ private readonly matrix;
7419
+ private readonly inverse;
7420
+ private readonly decomposed;
7421
+ constructor(geometry: Geometry2d, matrix: MatModel, opts?: TransformedGeometry2dOptions);
7422
+ getVertices(filters: Geometry2dFilters): Vec[];
7423
+ nearestPoint(point: Vec, filters?: Geometry2dFilters): Vec;
7424
+ hitTestPoint(point: Vec, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean;
7425
+ distanceToPoint(point: Vec, hitInside?: boolean, filters?: Geometry2dFilters): number;
7426
+ distanceToLineSegment(A: Vec, B: Vec, filters?: Geometry2dFilters): number;
7427
+ hitTestLineSegment(A: Vec, B: Vec, distance?: number, filters?: Geometry2dFilters): boolean;
7428
+ intersectLineSegment(A: VecLike, B: VecLike, filters?: Geometry2dFilters): VecLike[];
7429
+ intersectCircle(center: VecLike, radius: number, filters?: Geometry2dFilters): VecLike[];
7430
+ intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[];
7431
+ intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[];
7432
+ transform(transform: MatModel, opts?: TransformedGeometry2dOptions): Geometry2d;
7433
+ getSvgPathData(): string;
7434
+ }
7435
+
7436
+ /** @public */
7437
+ export declare interface TransformedGeometry2dOptions {
7438
+ isLabel?: boolean;
7439
+ isInternal?: boolean;
7440
+ debugColor?: string;
7441
+ ignore?: boolean;
7442
+ }
7443
+
7295
7444
  /** @public */
7296
7445
  export declare type UiEvent = TLCancelEvent | TLClickEvent | TLCompleteEvent | TLKeyboardEvent | TLPinchEvent | TLPointerEvent;
7297
7446
 
@@ -203,7 +203,11 @@ import { CubicBezier2d } from "./lib/primitives/geometry/CubicBezier2d.mjs";
203
203
  import { CubicSpline2d } from "./lib/primitives/geometry/CubicSpline2d.mjs";
204
204
  import { Edge2d } from "./lib/primitives/geometry/Edge2d.mjs";
205
205
  import { Ellipse2d } from "./lib/primitives/geometry/Ellipse2d.mjs";
206
- import { Geometry2d } from "./lib/primitives/geometry/Geometry2d.mjs";
206
+ import {
207
+ Geometry2d,
208
+ Geometry2dFilters,
209
+ TransformedGeometry2d
210
+ } from "./lib/primitives/geometry/Geometry2d.mjs";
207
211
  import { Group2d } from "./lib/primitives/geometry/Group2d.mjs";
208
212
  import { Point2d } from "./lib/primitives/geometry/Point2d.mjs";
209
213
  import { Polygon2d } from "./lib/primitives/geometry/Polygon2d.mjs";
@@ -299,7 +303,7 @@ function debugEnableLicensing() {
299
303
  }
300
304
  registerTldrawLibraryVersion(
301
305
  "@tldraw/editor",
302
- "3.12.0-internal.624e32507d98",
306
+ "3.13.0-canary.1793786aff8a",
303
307
  "esm"
304
308
  );
305
309
  export {
@@ -346,6 +350,7 @@ export {
346
350
  ErrorScreen,
347
351
  FontManager,
348
352
  Geometry2d,
353
+ Geometry2dFilters,
349
354
  Group2d,
350
355
  GroupShapeUtil,
351
356
  HALF_PI,
@@ -379,6 +384,7 @@ export {
379
384
  Table,
380
385
  TextManager,
381
386
  TldrawEditor,
387
+ TransformedGeometry2d,
382
388
  USER_COLORS,
383
389
  UserPreferencesManager,
384
390
  Vec,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\nimport 'core-js/stable/array/at.js'\nimport 'core-js/stable/array/flat-map.js'\nimport 'core-js/stable/array/flat.js'\nimport 'core-js/stable/string/at.js'\nimport 'core-js/stable/string/replace-all.js'\nexport {\n\tEMPTY_ARRAY,\n\tEffectScheduler,\n\tatom,\n\tcomputed,\n\treact,\n\ttransact,\n\ttransaction,\n\twhyAmIRunning,\n\ttype Atom,\n\ttype Signal,\n} from '@tldraw/state'\nexport {\n\ttrack,\n\tuseAtom,\n\tuseComputed,\n\tuseQuickReactor,\n\tuseReactor,\n\tuseStateTracking,\n\tuseValue,\n} from '@tldraw/state-react'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TLTextOptions,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n} from './lib/utils/richText'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\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'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager'\nexport { ScribbleManager, type ScribbleItem } from './lib/editor/managers/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { TextManager, type TLMeasureTextSpanOpts } from './lib/editor/managers/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype 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 { getPerfectDashProps } from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype 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 { type TLResizeHandle, type TLSelectionHandle } from './lib/editor/types/selection-types'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { getCursor } from './lib/hooks/useCursor'\nexport { EditorContext, useEditor, useMaybeEditor } from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsDarkMode } from './lib/hooks/useIsDarkMode'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { 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 { Geometry2d, type Geometry2dOptions } from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport {\n\tHALF_PI,\n\tPI,\n\tPI2,\n\tSIN,\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\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\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n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4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,SAAS,2BAA2B;AAE7C,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAKpB,SAAS,uBAAuB;AAEtC;AACD;AAEA;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'\nexport {\n\tEMPTY_ARRAY,\n\tEffectScheduler,\n\tatom,\n\tcomputed,\n\treact,\n\ttransact,\n\ttransaction,\n\twhyAmIRunning,\n\ttype Atom,\n\ttype Signal,\n} from '@tldraw/state'\nexport {\n\ttrack,\n\tuseAtom,\n\tuseComputed,\n\tuseQuickReactor,\n\tuseReactor,\n\tuseStateTracking,\n\tuseValue,\n} from '@tldraw/state-react'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TLTextOptions,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n} from './lib/utils/richText'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/validate'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TLOnMountHandler,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n} from './lib/TldrawEditor'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport { DefaultBrush, type TLBrushProps } from './lib/components/default-components/DefaultBrush'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultCollaboratorHint,\n\ttype TLCollaboratorHintProps,\n} from './lib/components/default-components/DefaultCollaboratorHint'\nexport {\n\tDefaultCursor,\n\ttype TLCursorProps,\n} from './lib/components/default-components/DefaultCursor'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultHandle,\n\ttype TLHandleProps,\n} from './lib/components/default-components/DefaultHandle'\nexport {\n\tDefaultHandles,\n\ttype TLHandlesProps,\n} from './lib/components/default-components/DefaultHandles'\nexport {\n\tDefaultScribble,\n\ttype TLScribbleProps,\n} from './lib/components/default-components/DefaultScribble'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport {\n\tDefaultSelectionForeground,\n\ttype TLSelectionForegroundProps,\n} from './lib/components/default-components/DefaultSelectionForeground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeIndicator,\n\ttype TLShapeIndicatorProps,\n} from './lib/components/default-components/DefaultShapeIndicator'\nexport { type TLShapeIndicatorErrorFallbackComponent } from './lib/components/default-components/DefaultShapeIndicatorErrorFallback'\nexport {\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'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager'\nexport {\n\tFontManager,\n\ttype TLFontFace,\n\ttype TLFontFaceSource,\n} from './lib/editor/managers/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager'\nexport { ScribbleManager, type ScribbleItem } from './lib/editor/managers/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { TextManager, type TLMeasureTextSpanOpts } from './lib/editor/managers/TextManager'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype 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 { getPerfectDashProps } from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype 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\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport { runtime, setRuntimeOverrides } from './lib/utils/runtime'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { uniq } from './lib/utils/uniq'\nexport { openWindow } from './lib/utils/window-open'\n\n/**\n * @deprecated Licensing is now enabled in the tldraw SDK.\n * @public */\nexport function debugEnableLicensing() {\n\t// noop\n\treturn\n}\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
+ "mappings": "AAAA,SAAS,oCAAoC;AAC7C,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGM;AACP;AAAA,EACC;AAAA,EACA;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ACrB,SAAS,kBAAkB;AAKpB,SAAS,uBAAuB;AAEtC;AACD;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": []
7
7
  }
@@ -67,6 +67,7 @@ const TldrawEditor = memo(function TldrawEditor2({
67
67
  className: classNames(`${TL_CONTAINER_CLASS} tl-theme__light`, className),
68
68
  onPointerDown: stopEventPropagation,
69
69
  tabIndex: -1,
70
+ role: "application",
70
71
  children: /* @__PURE__ */ jsx(
71
72
  OptionalErrorBoundary,
72
73
  {
@@ -163,7 +164,9 @@ function TldrawEditorWithReadyStore({
163
164
  options,
164
165
  licenseKey,
165
166
  deepLinks: _deepLinks,
167
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
166
168
  isShapeHidden,
169
+ getShapeVisibility,
167
170
  assetUrls
168
171
  }) {
169
172
  const { ErrorFallback } = useEditorComponents();
@@ -208,6 +211,7 @@ function TldrawEditorWithReadyStore({
208
211
  options,
209
212
  licenseKey,
210
213
  isShapeHidden,
214
+ getShapeVisibility,
211
215
  fontAssetUrls: assetUrls?.fonts
212
216
  });
213
217
  editor2.updateViewportScreenBounds(canvasRef.current ?? container);
@@ -235,6 +239,7 @@ function TldrawEditorWithReadyStore({
235
239
  setEditor,
236
240
  licenseKey,
237
241
  isShapeHidden,
242
+ getShapeVisibility,
238
243
  textOptions,
239
244
  assetUrls
240
245
  ]