Commit graph

970 commits

Author SHA1 Message Date
David Sheldrick
356a0d1e73
[chore] refactor user preferences (#1435)
- Remove TLUser, TLUserPresence
- Add first-class support for user preferences that persists across
rooms and tabs

### Change Type

<!-- 💡 Indicate the type of change your pull request is. -->
<!-- 🤷‍♀️ If you're not sure, don't select anything -->
<!-- ✂️ Feel free to delete unselected options -->

<!-- To select one, put an x in the box: [x] -->

- [ ] `patch` — Bug Fix
- [ ] `minor` — New Feature
- [x] `major` — Breaking Change
- [ ] `dependencies` — Dependency Update (publishes a `patch` release,
for devDependencies use `internal`)
- [ ] `documentation` — Changes to the documentation only (will not
publish a new version)
- [ ] `tests` — Changes to any testing-related code only (will not
publish a new version)
- [ ] `internal` — Any other changes that don't affect the published
package (will not publish a new version)

### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] Webdriver tests

### Release Notes

- Add a brief release note for your PR here.
2023-05-25 09:54:29 +00:00
Steve Ruiz
eb26964130
[refactor] restore createTLSchema (#1444)
This PR restores `createTLSchema`. 

It also:
- removes `TldrawEditorConfig.default`
- makes `config` a required property of `<TldrawEditor>`, though it's
created automatically in `<Tldraw>`.
- makes `config` a required property of `App`
- removes `TLShapeType` and replaces the rare usage with
`TLShape["type"]`
- adds `TLDefaultShape` for a union of our default shapes
- makes `TLShape` a union of `TLDefaultShape` and `TLUnknownShape`

### Change Type

- [x] `major` — Breaking Change

### Release Notes

- [editor] Simplifies custom shape definition
- [tldraw] Updates props for <TldrawEditor> component to require a
`TldrawEditorConfig`.
2023-05-24 10:48:31 +00:00
alex
0bd6410d9f
avoid lazy race conditions (#1364)
We had a few issues with lazy race conditions failing CI. This came from
scripts configured to invoke lazy again, rather than through expressing
dependencies between scripts.

This diff reconfigures lazy to articulate these sorts of things as
dependencies instead of through self-invocation. Instead of having lots
of separate `build-package`, `build-docs`, etc commands, we now just
have a build command with package overrides to express more specific
options

### Change Type
- [x] `internal` — Any other changes that don't affect the published
package (will not publish a new version)

### Release Notes
[internal only]
2023-05-12 15:41:40 +00:00
alex
880f82e658
New vite-based examples app (#1226)
Right now this examples app looks exactly the same as our old examples
app, but there are a couple of tiny differences:
- We use `vite` instead of our own esbuild setup for development and
bundling
- We use `@tldraw/assets` for smart asset hashing instead of copying the
assets to a public folder

You can use `@tldraw/assets` with vite with a bunch of extra config, but
it (plus a bunch of other bundlers) also support a special syntax for
specifying asset urls: `new URL('./my/asset.svg',
import.meta.url).href`. This approach is more standards-complient, but
doesn't work with every bundler just yet. This diff also adds a
url-based version of `@tldraw/assets`, although I'd like to tweak the
entry point - right now you need to import from
`@tldraw/assets/lib/urls`, but i'd like to find a way to get this to
`@tldraw/assets/urls` or something at some point.

There are a couple other extra fixes in here:
- vscode builds were broken, they're fixed now!
- there's also a little tweak to the `getBundlerAssetUrls` API to allow
passing in a function instead of an object for URL formatting
- there are new internal-only functions for injecting asset urls
globally instead of passing them in via react props. this means we can
get the benefits of cacheable URLs without having to clutter our
examples by passing them in
2023-05-05 13:10:36 +00:00
Steve Ruiz
0d16942222 readmes 2023-05-04 13:47:56 +01:00
David Sheldrick
f5c5b05dc7
[chore] update lazyrepo (#1211) 2023-05-02 12:25:26 +00:00
David Sheldrick
731da1bc77
derived presence state (#1204)
This PR adds

- A new `TLInstancePresence` record type, to collect info about the
presence state in a particular instance of the editor. This will
eventually be used to sync presence data instead of sending
instance-only state across the wire.
- **Record Scopes**

`RecordType` now has a `scope` property which can be one of three
things:
- `document`: the record belongs to the document and should be synced
and persisted freely. Currently: `TLDocument`, `TLPage`, `TLShape`, and
`TLAsset`
- `instance`: the record belongs to a single instance of the store and
should not be synced at all. It should not be persisted directly in most
cases, but rather compiled into a kind of 'instance configuration' to
store alongside the local document data so that when reopening the
associated document it can remember some of the previous instance state.
Currently: `TLInstance`, `TLInstancePageState`, `TLCamera`, `TLUser`,
`TLUserDocument`, `TLUserPresence`
- `presence`: the record belongs to a single instance of the store and
should not be persisted, but may be synced using the special presence
sync protocol. Currently just `TLInstancePresence`

This sets us up for the following changes, which are gonna be pretty
high-impact in terms of integrating tldraw into existing systems:

- Removing `instanceId` as a config option. Each instance gets a
randomly generated ID.
- We'd replace it with an `instanceConfig` option that has stuff like
selectedIds, camera positions, and so on. Then it's up to library users
to get and reinstate the instance config at persistence boundaries.
- Removing `userId` as config option, and removing the `TLUser` type
altogether.
- We might need to revisit when doing auth-enabled features like locking
shapes, but I suspect that will be separate.
2023-04-27 18:03:19 +00:00
Orange Mug
da613ea6ef
Fix to not ignore the userId option for <Tldraw/> component in @tldraw/tldraw (#1205)
The `userId` prop in the `<Tldraw/>` component from the `@tldraw/tldraw`
was previously ignored. This PR fixes that to make it operational again.
2023-04-27 10:03:21 +00:00
David Sheldrick
4c65cb8db4
[lite] upgrade lazyrepo (#1198)
* upgrade lazyrepo

* update lockfile + lazy.config
2023-04-25 14:32:17 +01:00
alex
29ed921c67 transfer-out: transfer out 2023-04-25 12:01:25 +01:00
alex
ec84f64e63 lite: delete all 2023-04-21 16:53:31 +01:00
Steve Ruiz
325d494a8a 1.29.2 2023-04-01 07:09:12 +01:00
Steve Ruiz
9967b281be
Update useKeyboardShortcuts.tsx (#1181) 2023-04-01 06:29:06 +01:00
alex
784b4503aa
alex/v2-file-notice: quick note when trying to open a v1 file (#1177) 2023-03-24 14:42:28 +00:00
alex
1051f4c28c
Add notice that tldraw will be down for maintenance (#1174)
* alex/offline-notice: offline notice

* alex/offline-notice: cleanup

* update copy

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2023-03-21 11:45:47 +00:00
Steve Ruiz
ef089bf0f6
Update StyleMenu.tsx (#1172) 2023-03-20 09:33:55 +00:00
Steve Ruiz
fd9200c200 1.29 2023-03-10 11:42:43 +00:00
Steve Ruiz
d0e265fc80
more user select (#1163) 2023-03-10 11:20:10 +00:00
Jang Min
257a7e750c
fix: add PreferencesMenu aria-label (#1131)
* Add aria-label

* Add DMCheckboxItemProps ariaLabel
2023-03-09 19:59:54 +00:00
Jang Min
967efd6b7f
test: aria-label check (#1133)
* Install jest-each

* Add accessibility.spec.tsx

It render App and click button to render context menu.
Then it check if aria-label exists.

* restore lock

* Delete package-lock.json

* Update accessibility.spec.tsx

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2023-03-09 19:59:31 +00:00
Jang Min
d00c06144d
Remove DropdownMenu.Root modal property (#1132) 2023-03-09 19:42:18 +00:00
Jang Min
80b4f5aedd
fix: copy and paste without selection occurs error (#1135)
* Add optional chaining

* dont allow empty clipboard data

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2023-03-09 19:41:23 +00:00
Steve Ruiz
a9f1a6ccc7
fix buttons, help button placement (#1145) 2023-02-10 13:51:30 +00:00
Karol Stawowski
b6dacdc1cd
fix: fix copy as png feature (#1143) 2023-02-10 13:42:25 +00:00
Steve Ruiz
3d1d329b6f 1.28.0 2023-02-06 14:26:40 +00:00
Jan Werder
0080a78bcd
Updated German translation (#1140) 2023-02-06 09:31:23 +00:00
Jang Min
d38f5a037b
feat: export menu accessibility (#1121)
* Move export submenu(Edit -> File)

* Add export menu to context menu with no selection

* Add export shortcuts
2023-02-02 16:14:39 +00:00
Jang Min
e02a5cb62e
Remove literals (#1114)
https://tldraw.com -> window.location.origin
2023-02-02 16:11:39 +00:00
Jang Min
34d06b17b3
Add aria-label to undo/redo buttons (#1115) 2023-02-02 16:10:42 +00:00
hiroshisuga
dd5c4ae66e
Update ja.json (#1126) 2023-02-02 16:09:13 +00:00
Mohammad Kazemi
0a6d35e8c2
Update Farsi language translation (#1128)
Added new words and translated them. Also edited and reviewed some of the old translation to make them more consistent.
2023-02-02 16:08:46 +00:00
JuanCasad0
7c688d52e0
Added Galician language + full spanish (#1122)
* Add files via upload

Added Galician translation and Spanish (completed)

* Update translations.ts

Added galician language (gl).

* Fixed identation

* Fixed identation
2023-02-02 16:07:25 +00:00
Simon Riisnæs Dagfinrud
6b7eb77846
Add/fix Norwegian translations (#1127)
* Add `nn-no` translation

* Correct `nb-no` translation

* Add Norwegian translations

* Fix typo
2023-02-02 16:06:41 +00:00
Kevin Park
e2a13d5992
Fix image export bug on multiplayer mode (#1130) 2023-02-02 16:06:09 +00:00
Steve Ruiz
55a8831a6b 1.27.0 2023-01-15 11:22:09 +00:00
KDSBrowne
6f87ff022a
add aria-labels to elements for screen readers (#1106) 2023-01-15 11:16:06 +00:00
Jang Min
60728e069a
fix(tooltip): add tooltips for undo/redo buttons (#1095)
* fix(tooltip): add lack tooltips for undo/redo buttons

* fix: change id of undo/redo buttons
2023-01-15 11:15:32 +00:00
Jang Min
33dde339aa
fix: change StyleMenu id(language-menu -> TD_StyleMenu) (#1102) 2023-01-15 11:14:58 +00:00
yashkumar barot
b5e2f00f6e
[bug] Zoom to 100% translated into Japanese should be 100%にズーム #1058 (#1105) 2023-01-15 11:14:29 +00:00
hiroshisuga
303b60c7e3
Update TldrawApp.ts (#1104) 2023-01-15 11:11:38 +00:00
Daniel Alberski
77943e6f85
fix: updated Polish translations (#1111) 2023-01-15 11:11:04 +00:00
Abedalrahman Shamia
b7d2254298
Add missing Arabic translations (#1113)
* add arabic missing translations

* fix image trans ar
2023-01-15 11:09:50 +00:00
Steve Ruiz
70ca73555b fix tests 2022-12-30 18:05:18 -06:00
Steve Ruiz
4208445a8c 1.26.4 2022-12-30 18:02:02 -06:00
Daniel Molkentin
065c3ddc4a
serve fonts locally via fontsource (#1091)
* [fix] serve fonts locally via fontsource (#1077)

* fix vscode extension build

Co-authored-by: zfgrnzfsberire <noreply@github.com>
2022-12-30 17:56:33 -06:00
Brian Hung
b74a6d71f1
create new ids for new shapes and map old ids to new ids (#1082)
* create new ids for new shapes and map old parent ids to new ids

* duplicate bindings and update shape handles

* spacing

Co-authored-by: Bruno <33330711+bybruno@users.noreply.github.com>

* Update duplicatePage.ts

* Update duplicatePage.ts

Co-authored-by: Bruno <33330711+bybruno@users.noreply.github.com>
Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2022-12-30 17:53:32 -06:00
hiroshisuga
9eb5e56319
Small translation change (#1088) 2022-12-30 16:19:40 -06:00
Cing Sian Dal
cd11fa4892
feat: added Myanmar (Burmese) translation (#1086) 2022-12-30 16:19:19 -06:00
hiroshisuga
ce09e0464a
translation fix (ja) (#1089) 2022-12-30 16:18:50 -06:00
Ahmad Saman
011ccb3052
feat: add kurdish language (#1078)
Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2022-12-16 18:10:39 +00:00