tldraw/apps/examples
alex 93c2ed615c
[Snapping 1/5] Validation & strict types for fractional indexes (#2827)
Currently, we type our fractional index keys as `string` and don't have
any validation for them. I'm touching some of this code for my work on
line handles and wanted to change that:
- fractional indexes are now `IndexKey`s, not `string`s. `IndexKey`s
have a brand property so can't be used interchangeably with strings
(like our IDs)
- There's a new `T.indexKey` validator which we can use in our
validations to make sure we don't end up with nonsense keys.

This PR is part of a series - please don't merge it until the things
before it have landed!
1. #2827 (you are here)
2. #2831
3. #2793
4. #2841
5. #2845

### Change Type

- [x] `patch` — Bug fix

### Test Plan

1. Mostly relying on unit & end to end tests here - no user facing
changes.

- [x] Unit Tests
2024-02-14 17:53:30 +00:00
..
e2e [docs] Fix missing Persistence page (#2828) 2024-02-13 16:19:17 +00:00
public Examples tweaks (#2681) 2024-02-02 17:36:30 +00:00
src [Snapping 1/5] Validation & strict types for fractional indexes (#2827) 2024-02-14 17:53:30 +00:00
.gitignore feat: add new prop to force mobile mode layout (#1734) 2023-11-11 14:11:59 +00:00
LICENSE.md Change licenses to tldraw (#2167) 2023-12-19 10:41:01 +00:00
package.json examples: clean up Canvas/Store events and make UiEvents have code snippets (#2770) 2024-02-07 16:51:04 +00:00
README.md Fix trademark links (#2380) 2023-12-26 09:22:04 +00:00
tsconfig.json Add snapshot prop, examples (#1856) 2023-09-08 14:48:55 +00:00
vercel.json Restore vercel.jsons (#2650) 2024-01-25 23:24:22 +00:00
vite.config.ts Examples tweaks (#2681) 2024-02-02 17:36:30 +00:00

@tldraw/example

Community

Have questions, comments or feedback? Join our discord or start a discussion.

Distributions

You can find tldraw on npm here.

Contribution

Please see our contributing guide. Found a bug? Please submit an issue.

License

The tldraw source code and its distributions are provided under the tldraw license. This license does not permit commercial use.

If you wish to use this project in commercial product, you need to purchase a commercial license. Please contact us at hello@tldraw.com for more inforion about obtaining a commercial license.

Trademarks

Copyright (c) 2023-present tldraw Inc. The tldraw name and logo are trademarks of tldraw. Please see our trademark guidelines for info on acceptable usage.

Contact

Find us on Twitter at @tldraw or email hello@tldraw.com. You can also join our discord for quick help and support.