You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: review and update guide pages (Fable) (tldraw#9091)
In order to keep the documentation guides accurate and readable, this PR
reviews all 104 guide pages under `apps/docs/content` (getting started,
learn tldraw, SDK features, starter kits, and community — not the
generated reference docs or release notes) against the current SDK
source, and updates pages where needed. Pages that were already accurate
and clean are untouched.
Every API symbol, code example, internal link, and example link on each
page was verified against the packages' source and API reports. Changes
fall into three groups:
### Accuracy fixes
- Removed or replaced stale APIs: `defineMigrations`, the
`CollaboratorCursor` component override (now
`CollaboratorCursorOverlayUtil`), `@tldraw/tldraw` package references,
deprecated `indicator`/`inputs.currentPagePoint`/`isDragging` accessors,
and a nonexistent `editor.getDocumentState()`.
- Fixed code examples that wouldn't work as written: missing imports and
declarations, `editor.canUndo` without parens, a non-reactive
preferences read, wrong argument order in a starter-kit example, invalid
wrangler TOML, an `updateAssets` pattern that dropped required props.
- Corrected behavior claims: license tracking for hobby licenses,
`locale` prop precedence, animation speed direction, camera x/y
semantics, image-export error handling, embed sandbox/fallback behavior,
edge-scrolling insets, handle angle snapping, and others.
- Fixed broken or moved example links (persistence had six), a duplicate
starter-kit `order` conflict, and a sentence-case/anchor mismatch.
### New content
Four SDK feature pages were TODO stubs and are now full guides written
from source: **arrow shape**, **eraser**, **grid**, and **pen mode**.
They keep `status: draft` — flip to `published` when you're happy with
them.
### Clarity and style
Sentence-cased headings and labels, direct openings, short paragraphs,
trailing-gerund and hollow-filler cleanup, redundant sections removed,
and consistent `[Symbol](?)` API-link usage per the repo writing guides.
### Verification
- `yarn check-links` passes (no broken links).
- `yarn refresh-content` passes against freshly built package API files:
all MDX parses and every `[Symbol](?)` API link resolves. (This required
rebuilding `packages/*/api/api.json` locally; one bad API link added
during review was caught and removed this way.)
### Policy update
tldraw has closed external contributions. The contributing page now
states that the source is available to read but contributions are not
accepted, the translations page no longer invites translation help (and
drops the inaccurate "Lokalise for open source" section), and the
community section description no longer calls tldraw an open source
project.
### Change type
- [x] `other`
### Release notes
- Update documentation guides for accuracy, clarity, and style; add full
guides for the arrow shape, eraser, grid, and pen mode pages.
Copy file name to clipboardExpand all lines: apps/docs/content/community/contributing.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,4 +8,4 @@ order: 1
8
8
9
9
tldraw's source code is available on GitHub at [github.com/tldraw/tldraw](https://github.com/tldraw/tldraw). While you can read the code, we are not accepting external contributions.
10
10
11
-
The best way to help improve tldraw is to share your feedback. To report a bug or request a feature, [open an issue](https://github.com/tldraw/tldraw/issues) on GitHub or let us know on [Discord](https://discord.tldraw.com/?utm_source=docs&utm_medium=organic&utm_campaign=sociallink). If a code example would help the discussion, fork the repository and link to your branch in the issue.
11
+
The best way to help improve tldraw is to share your feedback. To report a bug or request a feature, [open an issue](https://github.com/tldraw/tldraw/issues) on GitHub or let us know on [Discord](https://discord.tldraw.com/?utm_source=docs&utm_medium=organic&utm_campaign=sociallink). If a code example would help the discussion, please fork the repository and link to your branch in the issue.
Copy file name to clipboardExpand all lines: apps/docs/content/community/license.mdx
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,17 @@ date: 9/13/2023
6
6
order: 2
7
7
---
8
8
9
-
This article is about the [tldraw license](/legal/tldraw-license). The tldraw SDK's source code and published packages are provided under the tldraw license.
9
+
The tldraw SDK's source code and published packages are provided under the [tldraw license](/legal/tldraw-license).
10
10
11
11
Under its default terms, the tldraw SDK license permits use **only in development**.
12
12
13
-
To use the tldraw SDK **in production**, you need either a:
13
+
To use the tldraw SDK **in production**, you need one of the following:
14
14
15
-
-[trial license](#Trial-license) for evaluation;
16
-
-[commercial license](#Commercial-license) for commercial projects; or a
17
-
-[hobby license](#Hobby-license) for non-commercial projects.
15
+
-a [trial license](#Trial-license) for evaluation
16
+
-a [commercial license](#Commercial-license) for commercial projects
17
+
-a [hobby license](#Hobby-license) for non-commercial projects
18
18
19
-
The SDK enforces its license using [license keys](#License-keys).
20
-
21
-
Trial, commercial, and hobby licenses each come with a license key. The SDK will work in production only when provided with a valid and active license key. See the [License Keys](#License-keys) section for more information about license keys.
19
+
Trial, commercial, and hobby licenses each come with a license key. The SDK will work in production only when provided with a valid and active license key. See the [License keys](#License-keys) section for more information.
22
20
23
21
### Trial license
24
22
@@ -54,10 +52,10 @@ When using the tldraw SDK under a commercial or hobby license, no information is
54
52
55
53
When using the tldraw SDK in production under a trial license, the tldraw SDK will ping tldraw's servers with a hash of the license key. This information is primarily for analytics purposes. No user data, canvas contents, or personally-identifiable information (PII) is sent or saved.
56
54
57
-
## Notes on Open Source
55
+
## Notes on open source
58
56
59
-
While the tldraw SDK is [source available](https://github.com/tldraw/tldraw), it is not permissively licensed. Many of our examples and demos are available under an MIT licenses, and you should feel free to use this code as if it were your own; however any source code or packages licensed by the tldraw SDK would not be [Open Source](https://opensource.org/osd) by any definition.
57
+
While the tldraw SDK is [source available](https://github.com/tldraw/tldraw), it is not permissively licensed. Many of our examples and demos are available under the MIT license, and you should feel free to use this code as if it were your own; however, any source code or packages covered by the tldraw SDK license would not be [Open Source](https://opensource.org/osd) by any definition.
60
58
61
-
If you wish to include tldraw in an open source project, you may do so but the SDK itself must remain under its original license. This means that you and your down-stream users will require their own trial, commercial, or hobby license in order to use the SDK in production. In this case, please also see our [trademark guidelines](https://tldraw.dev/legal/trademark-guidelines) that limit the use of the tldraw name and branding.
59
+
If you wish to include tldraw in an open source project, you may do so but the SDK itself must remain under its original license. This means that you and your downstream users will require their own trial, commercial, or hobby license in order to use the SDK in production. In this case, please also see our [trademark guidelines](https://tldraw.dev/legal/trademark-guidelines) that limit the use of the tldraw name and branding.
62
60
63
61
The tldraw SDK is a product of a company. See [tldraw.dev](https://tldraw.dev/company) for more information about the company and the team.
Copy file name to clipboardExpand all lines: apps/docs/content/community/translations.mdx
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,8 @@ date: 11/7/2023
6
6
order: 0
7
7
---
8
8
9
-
The tldraw user interface (in [@tldraw/ui](/docs/user-interface)) is currently translated into over thirty different languages, with twenty languages at above 70% completion. Where a key's translation is missing in the user's current language language, the default (English) translation will be used instead.
9
+
The tldraw [user interface](/docs/user-interface) is translated into more than forty languages. Where a key's translation is missing in the user's current language, the default (English) translation is used instead.
10
10
11
-
## Contributing translations
11
+
We manage our translations through [Lokalise](https://lokalise.com).
12
12
13
-
We manage our translations through [Lokalise](https://www.lokalise.com), a long-time tldraw sponsor. If you would like to help by translating or reviewing translations, please let us know on [Discord](https://discord.tldraw.com/?utm_source=docs&utm_medium=organic&utm_campaign=sociallink) so that we can add you to the project.
14
-
15
-
## Lokalise for open source
16
-
17
-
tldraw is proud to partner with [Lokalise](https://lokalise.com) through their Innovation and Research Plan. This initiative provides our developers with industry-leading localization technology, empowering the next generation of language professionals to master modern, AI-driven workflows.
13
+
To learn how the SDK detects and applies languages, see [Internationalization](/sdk-features/internationalization).
Copy file name to clipboardExpand all lines: apps/docs/content/docs/ai.mdx
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ editor.createShape({
79
79
For richer AI output, create a custom shape that renders generated content. This approach works well for live HTML previews, interactive prototypes, or any content that needs special rendering:
80
80
81
81
```tsx
82
-
// Abbreviated example—a full ShapeUtil also requires getDefaultProps, getGeometry, and indicator
82
+
// Abbreviated example—a full ShapeUtil also requires getDefaultProps, getGeometry, and getIndicatorPath
@@ -149,7 +149,8 @@ The [Agent starter kit](/starter-kits/agent) provides a complete implementation.
149
149
The agent exposes a simple API for triggering canvas operations:
150
150
151
151
```tsx
152
-
const agent =useTldrawAgent(editor)
152
+
// Inside a component wrapped by TldrawAgentAppProvider
153
+
const agent =useAgent()
153
154
154
155
// Simple prompt
155
156
agent.prompt('Draw a flowchart showing user authentication')
@@ -178,8 +179,8 @@ This dual approach—visual screenshots plus structured data—gives the model b
178
179
Agents perform operations through typed action schemas. Each action has a defined structure, and the agent system validates, sanitizes, and applies actions to the editor:
179
180
180
181
```tsx
181
-
// Simplified illustration—the actual implementation converts through a SimpleShape
182
-
//intermediate format. See CreateActionUtil in the agent starter kit for the full code.
182
+
// Simplified illustration—the actual implementation converts through an intermediate
183
+
//shape format. See CreateActionUtil in the agent starter kit for the full code.
Access shape data directly from the store for text extraction or structured analysis:
217
+
Access shape data directly from the store for text extraction or structured analysis. Use [ShapeUtil#getText](?) to extract a shape's text content as a plain string:
Copy file name to clipboardExpand all lines: apps/docs/content/docs/collaboration.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ Collaboration involves three concerns:
53
53
54
54
-**Synchronizing data** — Getting document changes in and out of the [store](/sdk-features/store). See [Persistence](/docs/persistence) for the basics, or [Collaboration](/sdk-features/collaboration) for building custom sync.
55
55
-**User presence** — Sharing cursor positions, selections, and viewports with other users. See [Collaboration](/sdk-features/collaboration) for presence APIs and [Cursors](/sdk-features/cursors) for customizing how collaborator cursors appear.
56
-
-**Collaboration UI** — The visual elements that show other users on the canvas. See [UI components](/sdk-features/ui-components) for overriding components like `CollaboratorCursor` and `SharePanel`. Collaborator brushes, scribbles, and hints are rendered via the [OverlayUtil](?) system.
56
+
-**Collaboration UI** — The visual elements that show other users on the canvas. See [UI components](/sdk-features/ui-components) for overriding components like `SharePanel`. The [OverlayUtil](?) system renders collaborator cursors, brushes, scribbles, and selection indicators—see [Overlay utils](/sdk-features/overlay-utils).
Copy file name to clipboardExpand all lines: apps/docs/content/docs/driver.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ Every input method returns `this`, so calls can be chained. Call `dispose` when
43
43
44
44
## Simulating input
45
45
46
-
Pointer, keyboard, wheel, and pinch events all flow through `editor.dispatch`, so they go through the editor's normal tool state machines—a `pointerDown` → `pointerMove`... → `pointerUp` sequence against the draw tool produces real draw shapes, not an image overlay:
46
+
Pointer, keyboard, wheel, and pinch events all flow through `editor.dispatch`, so they go through the editor's normal tool state machines. A `pointerDown` → `pointerMove` → `pointerUp` sequence with the draw tool active creates real draw shapes:
|`vertex`| A primary control point that defines part of the shape's geometry |
49
+
|`virtual`| A secondary handle that isn't a vertex, like the arrow's midpoint bend handle|
50
+
|`create`| A handle for adding new geometry, like inserting a point into a line segment|
51
+
|`clone`| A handle for duplicating the shape, used by notes for quick adjacent copies |
52
52
53
-
Most custom shapes use `vertex` handles. The `virtual` and `create` types are used by the line shape to let users add points to a path.
53
+
Most custom shapes use `vertex` handles. The arrow shape uses a `virtual` handle for its midpoint, and the line shape uses `create` handles to let users add points between vertices.
54
54
55
55
## Responding to handle drags
56
56
57
-
When a user drags a handle, tldraw calls `onHandleDrag` with the updated handle position. Return the new shape props:
57
+
When a user drags a handle, tldraw calls `onHandleDrag` with the updated handle position. Return the updated shape:
When the user holds Shift while dragging, handles snap to 15-degree angles. By default, this is relative to the shape's position. You can snap relative to another handle by setting `snapReferenceHandleId`:
114
+
When the user holds Shift while dragging, handles snap to 15-degree angles. By default, the angle is measured relative to an adjacent vertex handle on the shape. You can use a different reference handle by setting `snapReferenceHandleId`:
Copy file name to clipboardExpand all lines: apps/docs/content/docs/indicators.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ keywords:
12
12
- custom shapes
13
13
---
14
14
15
-
Indicators are the outlines that appear around shapes when they're selected or hovered. They provide visual feedback about which shapes are active. They also help users understand the bounds of each shape.
15
+
Indicators are the outlines that appear around shapes when they're selected or hovered. They show which shapes are active and where each shape's bounds are.
16
16
17
17
## How indicators work
18
18
@@ -112,8 +112,8 @@ In multiplayer sessions, indicators show other users' selections. These appear w
0 commit comments