@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
package/CHANGELOG.md CHANGED
@@ -1,3 +1,137 @@
1
+ # v3.12.0 (Tue Apr 15 2025)
2
+
3
+ ### Release Notes
4
+
5
+ #### events: explore using getCoalescedEvents, take 2 ([#5898](https://github.com/tldraw/tldraw/pull/5898))
6
+
7
+ - Improve draw fluidity on slower CPUs by using getCoalescedEvents.
8
+
9
+ #### Revert "events: explore using getCoalescedEvents (#5554)" ([#5895](https://github.com/tldraw/tldraw/pull/5895))
10
+
11
+ - Revert coalesced events for now until we investigate further.
12
+
13
+ #### events: fix wrong contentEditable check ([#5888](https://github.com/tldraw/tldraw/pull/5888))
14
+
15
+ - Fix regression of iPad Pencil drawing in certain cases.
16
+
17
+ #### a11y: add keyboard shortcut items; fix up focus ring in dotcom menus ([#5852](https://github.com/tldraw/tldraw/pull/5852))
18
+
19
+ - Add accessibility section to keyboard shortcuts dialog.
20
+
21
+ #### a11y: fix up watermark regression ([#5848](https://github.com/tldraw/tldraw/pull/5848))
22
+
23
+ - Fix mobile watermark.
24
+
25
+ #### a11y: add axe to be able to do audits ([#5840](https://github.com/tldraw/tldraw/pull/5840))
26
+
27
+ - a11y: add axe to be able to do audits
28
+
29
+ #### a11y: announce shapes as they're visited ([#5773](https://github.com/tldraw/tldraw/pull/5773))
30
+
31
+ - a11y: announce shapes as they're visited
32
+
33
+ #### a11y: navigable shapes ([#5761](https://github.com/tldraw/tldraw/pull/5761))
34
+
35
+ - a11y: navigable shapes using Tab and Cmd/Ctrl+Arrow
36
+
37
+ #### Geometry2d Improvements ([#5754](https://github.com/tldraw/tldraw/pull/5754))
38
+
39
+ - It's now easier to work with `Geometry2d` objects, with methods for intersections, transforming geometries, and filtering.
40
+
41
+ #### Fix unexpected artefacts showing up in exports when the page includes tailwind ([#5792](https://github.com/tldraw/tldraw/pull/5792))
42
+
43
+ - Prevent unexpected visual issues in exports from pages that include tailwindcss
44
+
45
+ #### isShapeHidden => getShapeVisibility, to allow children of hidden shapes to be visible ([#5762](https://github.com/tldraw/tldraw/pull/5762))
46
+
47
+ - Allow the children of a hidden shape to show themselves by returning a 'force_show' override from the `isShapeHidden` predicate.
48
+
49
+ #### fix zoom speed for pinch gestures ([#5771](https://github.com/tldraw/tldraw/pull/5771))
50
+
51
+ - Setting `zoomSpeed` in camera options no longer breaks zooming on safari trackpads and multitouch pinch to zoom.
52
+
53
+ #### a11y: add a live region to announce selected tools ([#5634](https://github.com/tldraw/tldraw/pull/5634))
54
+
55
+ - Adds better voiceover support when selecting an action (a11y)
56
+
57
+ #### events: explore using getCoalescedEvents ([#5554](https://github.com/tldraw/tldraw/pull/5554))
58
+
59
+ - Improve draw fluidity on slower CPUs by using getCoalescedEvents.
60
+
61
+ #### fix translation perf regression from rich text font detection ([#5743](https://github.com/tldraw/tldraw/pull/5743))
62
+
63
+ - Fix a performance regression when dragging many shapes at the same time.
64
+
65
+ #### Cache the fonts extracted from rich text. ([#5735](https://github.com/tldraw/tldraw/pull/5735))
66
+
67
+ - Improved performance while editing many geo shapes or text shapes.
68
+
69
+ #### When editing a text shape, don't mount the text editor for non-editing empty shapes unless they're hovered ([#5734](https://github.com/tldraw/tldraw/pull/5734))
70
+
71
+ - Fixed a bug causing a performance delay when editing text.
72
+
73
+ #### Add Frame colors ([#5283](https://github.com/tldraw/tldraw/pull/5283))
74
+
75
+ - Added `FrameShapeUtil.options.showColors` option to display colors for frames.
76
+
77
+ #### Fix Group2d `getSvgPathData()` missing move markers ([#5580](https://github.com/tldraw/tldraw/pull/5580))
78
+
79
+ - Fixed a bug with `Group2D.getSvgPathData()` so that children in the resulting SVG have their starting points defined correctly.
80
+
81
+ ---
82
+
83
+ #### 🐛 Bug Fix
84
+
85
+ - trying out zero custom mutators [#5814](https://github.com/tldraw/tldraw/pull/5814) ([@ds300](https://github.com/ds300) [@MitjaBezensek](https://github.com/MitjaBezensek))
86
+ - a11y: fix focus ring on share menu/embed dialog; also slider/watermark [#5837](https://github.com/tldraw/tldraw/pull/5837) ([@mimecuvalo](https://github.com/mimecuvalo))
87
+ - isShapeHidden => getShapeVisibility, to allow children of hidden shapes to be visible [#5762](https://github.com/tldraw/tldraw/pull/5762) ([@ds300](https://github.com/ds300))
88
+ - Disable currently broken docs links [#5778](https://github.com/tldraw/tldraw/pull/5778) ([@TodePond](https://github.com/TodePond))
89
+ - Better whyAmIRunning [#5746](https://github.com/tldraw/tldraw/pull/5746) ([@ds300](https://github.com/ds300))
90
+
91
+ #### 🐛 Bug Fixes
92
+
93
+ - Fix bad arrow bindings to text shapes (#5902) [#5904](https://github.com/tldraw/tldraw/pull/5904) ([@SomeHats](https://github.com/SomeHats))
94
+ - Revert "events: explore using getCoalescedEvents (#5554)" [#5895](https://github.com/tldraw/tldraw/pull/5895) ([@mimecuvalo](https://github.com/mimecuvalo))
95
+ - events: fix wrong contentEditable check [#5888](https://github.com/tldraw/tldraw/pull/5888) ([@mimecuvalo](https://github.com/mimecuvalo))
96
+ - a11y: fix up watermark regression [#5848](https://github.com/tldraw/tldraw/pull/5848) ([@mimecuvalo](https://github.com/mimecuvalo))
97
+ - Fix unexpected artefacts showing up in exports when the page includes tailwind [#5792](https://github.com/tldraw/tldraw/pull/5792) ([@SomeHats](https://github.com/SomeHats))
98
+ - fix zoom speed for pinch gestures [#5771](https://github.com/tldraw/tldraw/pull/5771) ([@SomeHats](https://github.com/SomeHats))
99
+ - fix translation perf regression from rich text font detection [#5743](https://github.com/tldraw/tldraw/pull/5743) ([@SomeHats](https://github.com/SomeHats))
100
+ - When editing a text shape, don't mount the text editor for non-editing empty shapes unless they're hovered [#5734](https://github.com/tldraw/tldraw/pull/5734) ([@steveruizok](https://github.com/steveruizok) [@mimecuvalo](https://github.com/mimecuvalo))
101
+ - Add Frame colors [#5283](https://github.com/tldraw/tldraw/pull/5283) ([@steveruizok](https://github.com/steveruizok) [@huppy-bot[bot]](https://github.com/huppy-bot[bot]) [@SomeHats](https://github.com/SomeHats))
102
+ - Fix Group2d `getSvgPathData()` missing move markers [#5580](https://github.com/tldraw/tldraw/pull/5580) ([@lorenzolewis](https://github.com/lorenzolewis))
103
+
104
+ #### 💄 Product Improvements
105
+
106
+ - events: explore using getCoalescedEvents, take 2 [#5898](https://github.com/tldraw/tldraw/pull/5898) ([@mimecuvalo](https://github.com/mimecuvalo))
107
+ - a11y: add keyboard shortcut items; fix up focus ring in dotcom menus [#5852](https://github.com/tldraw/tldraw/pull/5852) ([@mimecuvalo](https://github.com/mimecuvalo))
108
+ - a11y: add a live region to announce selected tools [#5634](https://github.com/tldraw/tldraw/pull/5634) ([@mimecuvalo](https://github.com/mimecuvalo))
109
+ - events: explore using getCoalescedEvents [#5554](https://github.com/tldraw/tldraw/pull/5554) ([@mimecuvalo](https://github.com/mimecuvalo))
110
+ - Cache the fonts extracted from rich text. [#5735](https://github.com/tldraw/tldraw/pull/5735) ([@steveruizok](https://github.com/steveruizok) [@mimecuvalo](https://github.com/mimecuvalo))
111
+
112
+ #### 🎉 New Features
113
+
114
+ - a11y: add axe to be able to do audits [#5840](https://github.com/tldraw/tldraw/pull/5840) ([@mimecuvalo](https://github.com/mimecuvalo))
115
+ - a11y: announce shapes as they're visited [#5773](https://github.com/tldraw/tldraw/pull/5773) ([@mimecuvalo](https://github.com/mimecuvalo))
116
+ - a11y: navigable shapes [#5761](https://github.com/tldraw/tldraw/pull/5761) ([@mimecuvalo](https://github.com/mimecuvalo))
117
+
118
+ #### 🛠️ API Changes
119
+
120
+ - Geometry2d Improvements [#5754](https://github.com/tldraw/tldraw/pull/5754) ([@SomeHats](https://github.com/SomeHats))
121
+
122
+ #### Authors: 8
123
+
124
+ - [@huppy-bot[bot]](https://github.com/huppy-bot[bot])
125
+ - alex ([@SomeHats](https://github.com/SomeHats))
126
+ - David Sheldrick ([@ds300](https://github.com/ds300))
127
+ - Lorenzo Lewis ([@lorenzolewis](https://github.com/lorenzolewis))
128
+ - Lu Wilson ([@TodePond](https://github.com/TodePond))
129
+ - Mime Čuvalo ([@mimecuvalo](https://github.com/mimecuvalo))
130
+ - Mitja Bezenšek ([@MitjaBezensek](https://github.com/MitjaBezensek))
131
+ - Steve Ruiz ([@steveruizok](https://github.com/steveruizok))
132
+
133
+ ---
134
+
1
135
  # v3.11.0 (Thu Mar 20 2025)
2
136
 
3
137
  ### Release Notes
@@ -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
 
package/dist-cjs/index.js CHANGED
@@ -62,6 +62,7 @@ __export(index_exports, {
62
62
  ErrorScreen: () => import_TldrawEditor.ErrorScreen,
63
63
  FontManager: () => import_FontManager.FontManager,
64
64
  Geometry2d: () => import_Geometry2d.Geometry2d,
65
+ Geometry2dFilters: () => import_Geometry2d.Geometry2dFilters,
65
66
  Group2d: () => import_Group2d.Group2d,
66
67
  GroupShapeUtil: () => import_GroupShapeUtil.GroupShapeUtil,
67
68
  HALF_PI: () => import_utils2.HALF_PI,
@@ -95,6 +96,7 @@ __export(index_exports, {
95
96
  Table: () => import_LocalIndexedDb.Table,
96
97
  TextManager: () => import_TextManager.TextManager,
97
98
  TldrawEditor: () => import_TldrawEditor.TldrawEditor,
99
+ TransformedGeometry2d: () => import_Geometry2d.TransformedGeometry2d,
98
100
  USER_COLORS: () => import_TLUserPreferences.USER_COLORS,
99
101
  UserPreferencesManager: () => import_UserPreferencesManager.UserPreferencesManager,
100
102
  Vec: () => import_Vec.Vec,
@@ -374,7 +376,7 @@ function debugEnableLicensing() {
374
376
  }
375
377
  (0, import_utils.registerTldrawLibraryVersion)(
376
378
  "@tldraw/editor",
377
- "3.12.0-internal.624e32507d98",
379
+ "3.13.0-canary.1793786aff8a",
378
380
  "cjs"
379
381
  );
380
382
  //# 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'\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).TLDR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,iCAAoC;AACpC,yBAAkE;AAClE,2BAA8B;AAC9B,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2CAA8C;AAC9C,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,gCAAmC;AACnC,wBAAiD;AACjD,0BAA6B;AAC7B,+BAAkC;AAClC,4BAQO;AACP,qBAAyD;AACzD,iBASO;AACP,iBAAiD;AACjD,iBAAkC;AAClC,qBAAwB;AACxB,mBAAsB;AACtB,sBAAyB;AACzB,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAAuB;AACvB,uBAA0B;AAC1B,wBAAmD;AACnD,qBAAwB;AACxB,qBAAwB;AACxB,uBAA0B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,uBAA0B;AAC1B,uBAaO;AACP,IAAAC,gBAgCO;AACP,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,sBAIO;AACP,qBAA6C;AAE7C,uBAA0B;AAC1B,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'\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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A;AACF;",
6
6
  "names": ["import_at", "import_utils"]
7
7
  }
@@ -94,6 +94,7 @@ const TldrawEditor = (0, import_react.memo)(function TldrawEditor2({
94
94
  className: (0, import_classnames.default)(`${TL_CONTAINER_CLASS} tl-theme__light`, className),
95
95
  onPointerDown: import_dom.stopEventPropagation,
96
96
  tabIndex: -1,
97
+ role: "application",
97
98
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
98
99
  import_ErrorBoundary.OptionalErrorBoundary,
99
100
  {
@@ -186,7 +187,9 @@ function TldrawEditorWithReadyStore({
186
187
  options,
187
188
  licenseKey,
188
189
  deepLinks: _deepLinks,
190
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
189
191
  isShapeHidden,
192
+ getShapeVisibility,
190
193
  assetUrls
191
194
  }) {
192
195
  const { ErrorFallback } = (0, import_useEditorComponents.useEditorComponents)();
@@ -231,6 +234,7 @@ function TldrawEditorWithReadyStore({
231
234
  options,
232
235
  licenseKey,
233
236
  isShapeHidden,
237
+ getShapeVisibility,
234
238
  fontAssetUrls: assetUrls?.fonts
235
239
  });
236
240
  editor2.updateViewportScreenBounds(canvasRef.current ?? container);
@@ -258,6 +262,7 @@ function TldrawEditorWithReadyStore({
258
262
  setEditor,
259
263
  licenseKey,
260
264
  isShapeHidden,
265
+ getShapeVisibility,
261
266
  textOptions,
262
267
  assetUrls
263
268
  ]