@tldraw/editor 3.15.0-canary.039c346f1d6f → 3.15.0-canary.0cc217d04ad3

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 (61) hide show
  1. package/dist-cjs/index.d.ts +1 -1
  2. package/dist-cjs/index.js +1 -1
  3. package/dist-cjs/lib/components/SVGContainer.js +1 -1
  4. package/dist-cjs/lib/components/SVGContainer.js.map +2 -2
  5. package/dist-cjs/lib/components/default-components/DefaultBrush.js +1 -1
  6. package/dist-cjs/lib/components/default-components/DefaultBrush.js.map +2 -2
  7. package/dist-cjs/lib/components/default-components/DefaultCanvas.js +1 -1
  8. package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
  9. package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js +1 -1
  10. package/dist-cjs/lib/components/default-components/DefaultCollaboratorHint.js.map +2 -2
  11. package/dist-cjs/lib/components/default-components/DefaultCursor.js +1 -1
  12. package/dist-cjs/lib/components/default-components/DefaultCursor.js.map +2 -2
  13. package/dist-cjs/lib/components/default-components/DefaultGrid.js +1 -1
  14. package/dist-cjs/lib/components/default-components/DefaultGrid.js.map +2 -2
  15. package/dist-cjs/lib/components/default-components/DefaultHandles.js +1 -1
  16. package/dist-cjs/lib/components/default-components/DefaultHandles.js.map +2 -2
  17. package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js +1 -1
  18. package/dist-cjs/lib/components/default-components/DefaultShapeIndicator.js.map +2 -2
  19. package/dist-cjs/lib/components/default-components/DefaultSnapIndictor.js +1 -1
  20. package/dist-cjs/lib/components/default-components/DefaultSnapIndictor.js.map +2 -2
  21. package/dist-cjs/lib/editor/Editor.js +4 -6
  22. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  23. package/dist-cjs/version.js +3 -3
  24. package/dist-cjs/version.js.map +1 -1
  25. package/dist-esm/index.d.mts +1 -1
  26. package/dist-esm/index.mjs +1 -1
  27. package/dist-esm/lib/components/SVGContainer.mjs +1 -1
  28. package/dist-esm/lib/components/SVGContainer.mjs.map +2 -2
  29. package/dist-esm/lib/components/default-components/DefaultBrush.mjs +1 -1
  30. package/dist-esm/lib/components/default-components/DefaultBrush.mjs.map +2 -2
  31. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +1 -1
  32. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
  33. package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs +1 -1
  34. package/dist-esm/lib/components/default-components/DefaultCollaboratorHint.mjs.map +2 -2
  35. package/dist-esm/lib/components/default-components/DefaultCursor.mjs +1 -1
  36. package/dist-esm/lib/components/default-components/DefaultCursor.mjs.map +2 -2
  37. package/dist-esm/lib/components/default-components/DefaultGrid.mjs +1 -1
  38. package/dist-esm/lib/components/default-components/DefaultGrid.mjs.map +2 -2
  39. package/dist-esm/lib/components/default-components/DefaultHandles.mjs +1 -1
  40. package/dist-esm/lib/components/default-components/DefaultHandles.mjs.map +2 -2
  41. package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs +1 -1
  42. package/dist-esm/lib/components/default-components/DefaultShapeIndicator.mjs.map +2 -2
  43. package/dist-esm/lib/components/default-components/DefaultSnapIndictor.mjs +1 -1
  44. package/dist-esm/lib/components/default-components/DefaultSnapIndictor.mjs.map +2 -2
  45. package/dist-esm/lib/editor/Editor.mjs +4 -6
  46. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  47. package/dist-esm/version.mjs +3 -3
  48. package/dist-esm/version.mjs.map +1 -1
  49. package/editor.css +2 -2
  50. package/package.json +9 -8
  51. package/src/lib/components/SVGContainer.tsx +1 -1
  52. package/src/lib/components/default-components/DefaultBrush.tsx +1 -1
  53. package/src/lib/components/default-components/DefaultCanvas.tsx +1 -1
  54. package/src/lib/components/default-components/DefaultCollaboratorHint.tsx +1 -1
  55. package/src/lib/components/default-components/DefaultCursor.tsx +1 -1
  56. package/src/lib/components/default-components/DefaultGrid.tsx +1 -1
  57. package/src/lib/components/default-components/DefaultHandles.tsx +5 -1
  58. package/src/lib/components/default-components/DefaultShapeIndicator.tsx +1 -1
  59. package/src/lib/components/default-components/DefaultSnapIndictor.tsx +1 -1
  60. package/src/lib/editor/Editor.ts +6 -5
  61. package/src/version.ts +3 -3
@@ -1,8 +1,8 @@
1
- const version = "3.15.0-canary.039c346f1d6f";
1
+ const version = "3.15.0-canary.0cc217d04ad3";
2
2
  const publishDates = {
3
3
  major: "2024-09-13T14:36:29.063Z",
4
- minor: "2025-07-11T16:17:04.725Z",
5
- patch: "2025-07-11T16:17:04.725Z"
4
+ minor: "2025-07-16T07:49:37.307Z",
5
+ patch: "2025-07-16T07:49:37.307Z"
6
6
  };
7
7
  export {
8
8
  publishDates,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/version.ts"],
4
- "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.15.0-canary.039c346f1d6f'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-07-11T16:17:04.725Z',\n\tpatch: '2025-07-11T16:17:04.725Z',\n}\n"],
4
+ "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.15.0-canary.0cc217d04ad3'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-07-16T07:49:37.307Z',\n\tpatch: '2025-07-16T07:49:37.307Z',\n}\n"],
5
5
  "mappings": "AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
6
6
  "names": []
7
7
  }
package/editor.css CHANGED
@@ -167,7 +167,7 @@
167
167
  --color-text: hsl(0, 0%, 0%);
168
168
  --color-text-0: hsl(0, 0%, 11%);
169
169
  --color-text-1: hsl(0, 0%, 18%);
170
- --color-text-3: hsl(220, 2%, 65%);
170
+ --color-text-3: hsl(204, 4%, 45%);
171
171
  --color-text-shadow: hsl(0, 0%, 100%);
172
172
  --color-text-highlight: hsl(52, 100%, 50%);
173
173
  --color-text-highlight-p3: color(display-p3 0.972 0.8205 0.05);
@@ -222,7 +222,7 @@
222
222
  --color-text: hsl(210, 17%, 98%);
223
223
  --color-text-0: hsl(0, 9%, 94%);
224
224
  --color-text-1: hsl(0, 0%, 85%);
225
- --color-text-3: hsl(210, 6%, 45%);
225
+ --color-text-3: hsl(204, 4%, 75%);
226
226
  --color-text-shadow: hsl(210, 13%, 18%);
227
227
  --color-text-highlight: hsl(52, 100%, 41%);
228
228
  --color-text-highlight-p3: color(display-p3 0.8078 0.6225 0.0312);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tldraw/editor",
3
- "description": "A tiny little drawing app (editor).",
4
- "version": "3.15.0-canary.039c346f1d6f",
3
+ "description": "tldraw infinite canvas SDK (editor).",
4
+ "version": "3.15.0-canary.0cc217d04ad3",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "keywords": [
19
19
  "tldraw",
20
+ "sdk",
20
21
  "drawing",
21
22
  "app",
22
23
  "development",
@@ -48,12 +49,12 @@
48
49
  "@tiptap/core": "^2.9.1",
49
50
  "@tiptap/pm": "^2.9.1",
50
51
  "@tiptap/react": "^2.9.1",
51
- "@tldraw/state": "3.15.0-canary.039c346f1d6f",
52
- "@tldraw/state-react": "3.15.0-canary.039c346f1d6f",
53
- "@tldraw/store": "3.15.0-canary.039c346f1d6f",
54
- "@tldraw/tlschema": "3.15.0-canary.039c346f1d6f",
55
- "@tldraw/utils": "3.15.0-canary.039c346f1d6f",
56
- "@tldraw/validate": "3.15.0-canary.039c346f1d6f",
52
+ "@tldraw/state": "3.15.0-canary.0cc217d04ad3",
53
+ "@tldraw/state-react": "3.15.0-canary.0cc217d04ad3",
54
+ "@tldraw/store": "3.15.0-canary.0cc217d04ad3",
55
+ "@tldraw/tlschema": "3.15.0-canary.0cc217d04ad3",
56
+ "@tldraw/utils": "3.15.0-canary.0cc217d04ad3",
57
+ "@tldraw/validate": "3.15.0-canary.0cc217d04ad3",
57
58
  "@types/core-js": "^2.5.8",
58
59
  "@use-gesture/react": "^10.3.1",
59
60
  "classnames": "^2.5.1",
@@ -7,7 +7,7 @@ export type SVGContainerProps = React.ComponentProps<'svg'>
7
7
  /** @public @react */
8
8
  export function SVGContainer({ children, className = '', ...rest }: SVGContainerProps) {
9
9
  return (
10
- <svg {...rest} className={classNames('tl-svg-container', className)}>
10
+ <svg {...rest} className={classNames('tl-svg-container', className)} aria-hidden="true">
11
11
  {children}
12
12
  </svg>
13
13
  )
@@ -21,7 +21,7 @@ export const DefaultBrush = ({ brush, color, opacity, className }: TLBrushProps)
21
21
  const h = toDomPrecision(Math.max(1, brush.h))
22
22
 
23
23
  return (
24
- <svg className="tl-overlays__item" ref={rSvg}>
24
+ <svg className="tl-overlays__item" ref={rSvg} aria-hidden="true">
25
25
  {color ? (
26
26
  <g className="tl-brush" opacity={opacity}>
27
27
  <rect width={w} height={h} fill={color} opacity={0.75} />
@@ -139,7 +139,7 @@ export function DefaultCanvas({ className }: TLCanvasComponentProps) {
139
139
  data-testid="canvas"
140
140
  {...events}
141
141
  >
142
- <svg className="tl-svg-context">
142
+ <svg className="tl-svg-context" aria-hidden="true">
143
143
  <defs>
144
144
  {shapeSvgDefs}
145
145
  <CursorDef />
@@ -39,7 +39,7 @@ export function DefaultCollaboratorHint({
39
39
  const cursorHintId = useSharedSafeId('cursor_hint')
40
40
 
41
41
  return (
42
- <svg ref={rSvg} className={classNames('tl-overlays__item', className)}>
42
+ <svg ref={rSvg} className={classNames('tl-overlays__item', className)} aria-hidden="true">
43
43
  <use
44
44
  href={`#${cursorHintId}`}
45
45
  color={color}
@@ -33,7 +33,7 @@ export const DefaultCursor = memo(function DefaultCursor({
33
33
 
34
34
  return (
35
35
  <div ref={rCursor} className={classNames('tl-overlays__item', className)}>
36
- <svg className="tl-cursor">
36
+ <svg className="tl-cursor" aria-hidden="true">
37
37
  <use href={`#${cursorId}`} color={color} />
38
38
  </svg>
39
39
  {chatMessage ? (
@@ -16,7 +16,7 @@ export function DefaultGrid({ x, y, z, size }: TLGridProps) {
16
16
  const editor = useEditor()
17
17
  const { gridSteps } = editor.options
18
18
  return (
19
- <svg className="tl-grid" version="1.1" xmlns="http://www.w3.org/2000/svg">
19
+ <svg className="tl-grid" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
20
20
  <defs>
21
21
  {gridSteps.map(({ min, mid, step }, i) => {
22
22
  const s = step * size * z
@@ -7,5 +7,9 @@ export interface TLHandlesProps {
7
7
 
8
8
  /** @public @react */
9
9
  export const DefaultHandles = ({ children }: TLHandlesProps) => {
10
- return <svg className="tl-user-handles tl-overlays__item">{children}</svg>
10
+ return (
11
+ <svg className="tl-user-handles tl-overlays__item" aria-hidden="true">
12
+ {children}
13
+ </svg>
14
+ )
11
15
  }
@@ -86,7 +86,7 @@ export const DefaultShapeIndicator = memo(function DefaultShapeIndicator({
86
86
  }, [hidden])
87
87
 
88
88
  return (
89
- <svg ref={rIndicator} className={classNames('tl-overlays__item', className)}>
89
+ <svg ref={rIndicator} className={classNames('tl-overlays__item', className)} aria-hidden="true">
90
90
  <g className="tl-shape-indicator" stroke={color ?? 'var(--color-selected)'} opacity={opacity}>
91
91
  <InnerIndicator editor={editor} id={shapeId} />
92
92
  </g>
@@ -163,7 +163,7 @@ export interface TLSnapIndicatorProps {
163
163
  /** @public @react */
164
164
  export function DefaultSnapIndicator({ className, line, zoom }: TLSnapIndicatorProps) {
165
165
  return (
166
- <svg className={classNames('tl-overlays__item', className)}>
166
+ <svg className={classNames('tl-overlays__item', className)} aria-hidden="true">
167
167
  {line.type === 'points' ? (
168
168
  <PointsSnapIndicator {...line} zoom={zoom} />
169
169
  ) : line.type === 'gaps' ? (
@@ -1863,10 +1863,11 @@ export class Editor extends EventEmitter<TLEventMap> {
1863
1863
  firstParentId &&
1864
1864
  selectedShapeIds.every((shapeId) => this.getShape(shapeId)?.parentId === firstParentId) &&
1865
1865
  !isPageId(firstParentId)
1866
+ const filteredShapes = isSelectedWithinContainer
1867
+ ? this.getCurrentPageShapes().filter((shape) => shape.parentId === firstParentId)
1868
+ : this.getCurrentPageShapes().filter((shape) => isPageId(shape.parentId))
1866
1869
  const readingOrderShapes = isSelectedWithinContainer
1867
- ? this._getShapesInReadingOrder(
1868
- this.getCurrentPageShapes().filter((shape) => shape.parentId === firstParentId)
1869
- )
1870
+ ? this._getShapesInReadingOrder(filteredShapes)
1870
1871
  : this.getCurrentPageShapesInReadingOrder()
1871
1872
  const currentShapeId: TLShapeId | undefined =
1872
1873
  selectedShapeIds.length === 1
@@ -1883,7 +1884,7 @@ export class Editor extends EventEmitter<TLEventMap> {
1883
1884
  adjacentShapeId = shapeIds[adjacentIndex]
1884
1885
  } else {
1885
1886
  if (!currentShapeId) return
1886
- adjacentShapeId = this.getNearestAdjacentShape(currentShapeId, direction)
1887
+ adjacentShapeId = this.getNearestAdjacentShape(filteredShapes, currentShapeId, direction)
1887
1888
  }
1888
1889
 
1889
1890
  const shape = this.getShape(adjacentShapeId)
@@ -1982,6 +1983,7 @@ export class Editor extends EventEmitter<TLEventMap> {
1982
1983
  * @public
1983
1984
  */
1984
1985
  getNearestAdjacentShape(
1986
+ shapes: TLShape[],
1985
1987
  currentShapeId: TLShapeId,
1986
1988
  direction: 'left' | 'right' | 'up' | 'down'
1987
1989
  ): TLShapeId {
@@ -1989,7 +1991,6 @@ export class Editor extends EventEmitter<TLEventMap> {
1989
1991
  const currentShape = this.getShape(currentShapeId)
1990
1992
  if (!currentShape) return currentShapeId
1991
1993
 
1992
- const shapes = this.getCurrentPageShapes()
1993
1994
  const tabbableShapes = shapes.filter(
1994
1995
  (shape) => this.getShapeUtil(shape).canTabTo(shape) && shape.id !== currentShapeId
1995
1996
  )
package/src/version.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // This file is automatically generated by internal/scripts/refresh-assets.ts.
2
2
  // Do not edit manually. Or do, I'm a comment, not a cop.
3
3
 
4
- export const version = '3.15.0-canary.039c346f1d6f'
4
+ export const version = '3.15.0-canary.0cc217d04ad3'
5
5
  export const publishDates = {
6
6
  major: '2024-09-13T14:36:29.063Z',
7
- minor: '2025-07-11T16:17:04.725Z',
8
- patch: '2025-07-11T16:17:04.725Z',
7
+ minor: '2025-07-16T07:49:37.307Z',
8
+ patch: '2025-07-16T07:49:37.307Z',
9
9
  }