Tldraw/apps/examples/src/examples
alex 87e3d60c90
rework canBind callback (#3797)
This PR reworks the `canBind` callback to work with customizable
bindings. It now accepts an object with a the shape, the other shape
(optional - it may not exist yet), the direction, and the type of the
binding. Devs can use this to create shapes that only participate in
certain binding types, can have bindings from but not to them, etc.

If you're implementing a binding, you can see if binding two shapes is
allowed using `editor.canBindShapes(fromShape, toShape, 'my binding
type')`

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features

### Release Notes

#### Breaking changes
The `canBind` flag now accepts an options object instead of just the
shape in question. If you're relying on its arguments, you need to
change from `canBind(shape) {}` to `canBind({shape}) {}`.
2024-05-23 13:32:02 +00:00
..
action-overrides Examples: update kbd shortcuts, add actions overrides example (#3330) 2024-04-05 10:04:38 +00:00
add-tool-to-toolbar Separate text-align property for shapes (#3627) 2024-04-29 10:58:15 +00:00
after-create-update-shape Camera options (#3282) 2024-05-04 17:39:04 +00:00
after-delete-shape Camera options (#3282) 2024-05-04 17:39:04 +00:00
api tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
asset-props tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
basic [dx] Allow vscode to search inside md files by default (#3105) 2024-03-11 14:08:04 +00:00
before-create-update-shape Camera options (#3282) 2024-05-04 17:39:04 +00:00
before-delete-shape Camera options (#3282) 2024-05-04 17:39:04 +00:00
bounds-snapping-shape Bindings (#3326) 2024-05-08 12:37:31 +00:00
camera-options Camera options followups (#3701) 2024-05-07 10:06:35 +00:00
canvas-events tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
changing-default-colors tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
context-toolbar ban using `@internal` items in examples (#3746) 2024-05-14 08:49:28 +00:00
custom-actions-menu Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
custom-components tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
custom-config rework canBind callback (#3797) 2024-05-23 13:32:02 +00:00
custom-context-menu Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
custom-debug-menu Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
custom-help-menu Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
custom-keyboard-shortcuts-dialog Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
custom-main-menu Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
custom-navigation-panel Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
custom-page-menu Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
custom-quick-actions Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
custom-renderer [culling] Improve setting of display none. (#3376) 2024-04-08 11:36:12 +00:00
custom-shape rework canBind callback (#3797) 2024-05-23 13:32:02 +00:00
custom-style-panel Automatic undo/redo (#3364) 2024-04-24 18:26:10 +00:00
custom-tool Add custom tool examples (#3064) 2024-03-05 09:27:53 +00:00
custom-toolbar Component-based toolbar customisation API (#3067) 2024-03-12 16:14:28 +00:00
custom-ui tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
custom-zoom-menu Make the custom menu examples a bit clearer (#3106) 2024-03-12 09:13:42 +00:00
drag-and-drop Stickies: release candidate (#3249) 2024-04-14 18:40:02 +00:00
editable-shape Bindings (#3326) 2024-05-08 12:37:31 +00:00
editor-focus Camera options followups (#3701) 2024-05-07 10:06:35 +00:00
error-boundary tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
exploded Bindings (#3326) 2024-05-08 12:37:31 +00:00
external-content-sources focus: rework and untangle existing focus management logic in the sdk (#3718) 2024-05-17 08:53:57 +00:00
external-dialog tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
external-ui tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
external-ui-context tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
floaty-window tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
force-mobile tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
hide-ui tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
hosted-images assets: rework mime-type detection to be consistent/centralized; add support for webp/webm, apng, avif (#3730) 2024-05-13 08:29:43 +00:00
image-annotator assets: rework mime-type detection to be consistent/centralized; add support for webp/webm, apng, avif (#3730) 2024-05-13 08:29:43 +00:00
image-component New migrations again (#3220) 2024-04-15 12:53:42 +00:00
infer-dark-mode [dx] Allow vscode to search inside md files by default (#3105) 2024-03-11 14:08:04 +00:00
inline tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
inline-behavior Add inline behaviour example (#3113) 2024-03-25 11:57:54 +00:00
inset tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
inset-canvas tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
interactive-shape Bindings (#3326) 2024-05-08 12:37:31 +00:00
keyboard-shortcuts Examples: update kbd shortcuts, add actions overrides example (#3330) 2024-04-05 10:04:38 +00:00
local-images tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
local-storage Revert "Protect local storage calls (#3043)" (#3063) 2024-03-04 15:48:31 +00:00
meta-migrations New migrations again (#3220) 2024-04-15 12:53:42 +00:00
meta-on-change tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
meta-on-create tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
multiple focus: rework and untangle existing focus management logic in the sdk (#3718) 2024-05-17 08:53:57 +00:00
only-editor New migrations again (#3220) 2024-04-15 12:53:42 +00:00
pdf-editor Force `interface` instead of `type` for better docs (#3815) 2024-05-22 15:55:49 +00:00
peristence-key [dx] Allow vscode to search inside md files by default (#3105) 2024-03-11 14:08:04 +00:00
pin-bindings rework canBind callback (#3797) 2024-05-23 13:32:02 +00:00
popup-shape Bindings (#3326) 2024-05-08 12:37:31 +00:00
readonly tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
screenshot-tool Add image annotator example (#3147) 2024-03-19 11:41:25 +00:00
scroll focus: rework and untangle existing focus management logic in the sdk (#3718) 2024-05-17 08:53:57 +00:00
selection-ui Selection UI example (plus fixes to pageToScreen) (#3015) 2024-03-01 17:42:35 +00:00
shape-meta tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
shape-with-custom-styles Example of using tldraw styles (#3017) 2024-03-02 16:42:43 +00:00
shape-with-migrations fix migration exports (#3586) 2024-04-24 14:36:08 +00:00
shape-with-tldraw-styles fix migration exports (#3586) 2024-04-24 14:36:08 +00:00
slides Bindings (#3326) 2024-05-08 12:37:31 +00:00
slideshow Force `interface` instead of `type` for better docs (#3815) 2024-05-22 15:55:49 +00:00
snapshots docs: smaller snapshot so it doesnt crash (#3768) 2024-05-17 13:11:52 +00:00
speech-bubble rework canBind callback (#3797) 2024-05-23 13:32:02 +00:00
static-assets tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
sticker-bindings rework canBind callback (#3797) 2024-05-23 13:32:02 +00:00
store-events tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
things-on-the-canvas Separate text-align property for shapes (#3627) 2024-04-29 10:58:15 +00:00
tool-with-child-states Separate text-align property for shapes (#3627) 2024-04-29 10:58:15 +00:00
ui-components-hidden Allow hiding debug panel. (#3261) 2024-03-26 10:03:20 +00:00
ui-events Camera options (#3282) 2024-05-04 17:39:04 +00:00
user-presence Automatic undo/redo (#3364) 2024-04-24 18:26:10 +00:00
yjs Examples tweaks (#2681) 2024-02-02 17:36:30 +00:00
zones tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00