Wykres commitów

337 Commity (a4fff303bf5c8ba4f63117e58b7f2dfe49a8abf1)

Autor SHA1 Wiadomość Data
David Sheldrick a4fff303bf update lazyrepo 2023-06-05 18:32:32 +01:00
Steve Ruiz 735f1c41b7
rename app to editor (#1503)
This PR renames `App`, `app` and all appy names to `Editor`, `editor`,
and editorry names.

### Change Type

- [x] `major` — Breaking Change

### Release Notes

- Rename `App` to `Editor` and many other things that reference `app` to
`editor`.
2023-06-02 15:21:45 +00:00
Steve Ruiz 0c4174c0b8
[refactor] User-facing APIs (#1478)
This PR updates our user-facing APIs for the Tldraw and TldrawEditor
components, as well as the Editor (App). It mainly incorporates surface
changes from #1450 without any changes to validators or migrators,
incorporating feedback / discussion with @SomeHats and @ds300.

Here we:
- remove the TldrawEditorConfig
- bring back a loose version of shape definitions
- make a separation between "core" shapes and "default" shapes
- do not allow custom shapes, migrators or validators to overwrite core
shapes
- but _do_ allow new shapes

## `<Tldraw>` component

In this PR, the `Tldraw` component wraps both the `TldrawEditor`
component and our `TldrawUi` component. It accepts a union of props for
both components. Previously, this component also added local syncing via
a `useLocalSyncClient` hook call, however that has been pushed down to
the `TldrawEditor` component.

## `<TldrawEditor>` component

The `TldrawEditor` component now more neatly wraps up the different ways
that the editor can be configured.

## The store prop (`TldrawEditorProps.store`)

There are three main ways for the `TldrawEditor` component to be run:
1. with an externally defined store
2. with an externally defined syncing store (local or remote)
3. with an internally defined store
4. with an internally defined locally syncing store

The `store` prop allows for these configurations.

If the `store` prop is defined, it may be defined either as a `TLStore`
or as a `SyncedStore`. If the store is a `TLStore`, then the Editor will
assume that the store is ready to go; if it is defined as a SyncedStore,
then the component will display the loading / error screens as needed,
or the final editor once the store's status is "synced".

When the store is left undefined, then the `TldrawEditor` will create
its own internal store using the optional `instanceId`, `initialData`,
or `shapes` props to define the store / store schema.

If the `persistenceKey` prop is left undefined, then the store will not
be synced. If the `persistenceKey` is defined, then the store will be
synced locally. In the future, we may also here accept the API key /
roomId / etc for creating a remotely synced store.

The `SyncedStore` type has been expanded to also include types used for
remote syncing, e.g. with `ConnectionStatus`.

## Tools

By default, the App has two "baked-in" tools: the select tool and the
zoom tool. These cannot (for now) be replaced or removed. The default
tools are used by default, but may be replaced by other tools if
provided.

## Shapes

By default, the App has a set of "core" shapes:
- group
- embed
- bookmark
- image
- video
- text

That cannot by overwritten because they're created by the app at
different moments, such as when double clicking on the canvas or via a
copy and paste event. In follow up PRs, we'll split these out so that
users can replace parts of the code where these shapes are created.

### Change Type

- [x] `major` — Breaking Change

### Test Plan

- [x] Unit Tests
2023-06-01 15:47:34 +00:00
Steve Ruiz 2992ad85d9
[chore] remove benchmark (#1489)
This PR removes unused scripts related to benchmarking, and some other
unused dependencies.

### Change Type

- [x] `internal` — Any other changes that don't affect the published
package (will not publish a new version)
2023-05-30 15:43:28 +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
David Sheldrick f5c5b05dc7
[chore] update lazyrepo (#1211) 2023-05-02 12:25:26 +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 fd9200c200 1.29 2023-03-10 11:42:43 +00:00
Steve Ruiz 3d1d329b6f 1.28.0 2023-02-06 14:26:40 +00:00
Steve Ruiz 55a8831a6b 1.27.0 2023-01-15 11:22:09 +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
Steve Ruiz 24cad6959f 1.7.24 2022-12-03 14:12:31 +00:00
Steve Ruiz c5ff2da775 1.25.2 2022-11-14 15:53:12 +00:00
Steve Ruiz 0f2abaf286 1.26.1 2022-11-09 16:35:43 +00:00
Steve Ruiz 6e275f09ef 1.26.0 2022-10-26 14:06:20 +01:00
Steve Ruiz 0eebdddb5b 1.24.0 2022-10-04 13:08:31 +01:00
Steve Ruiz 8e55e263bf 1.24.5 2022-09-09 09:54:48 +01:00
Steve Ruiz 5e24e5a4cb 1.24.4 2022-09-08 13:36:08 +01:00
Steve Ruiz 0549660244 1.24.3 2022-09-08 11:33:57 +01:00
Steve Ruiz b56a3a6982 1.24.1 2022-09-08 10:58:42 +01:00
Steve Ruiz 7774d00e74
[fix] Buttons (#964)
* fix buttons

* update dependencies
2022-09-08 10:45:08 +01:00
Steve Ruiz 760f6494e3 1.24.0 2022-09-08 09:48:50 +01:00
Steve Ruiz d0cd924ca7
[chore] remove mobx (#961)
* remove mobx as dependency

* fix bugs
2022-09-08 09:38:28 +01:00
Steve Ruiz 34ce1ed68c 1.22.0 2022-09-07 15:25:47 +01:00
Steve Ruiz ca91e56b29
[improvement] faster svg paths (#959)
* improve svg paths

* split methods add tldraw 1.2.0
2022-09-07 14:05:30 +01:00
Steve Ruiz 9dab372b81 1.22.1 2022-09-01 17:24:33 +01:00
Steve Ruiz 3cfae6278c
Remove share menu (#946)
* Remove share menu

* Delete ShareMenu.tsx

* Remove alert, etc
2022-09-01 16:19:22 +01:00
Steve Ruiz f98310e5bf 1.22.0 2022-09-01 10:13:32 +01:00
David Sheldrick 1be09d2204
Merge pull request #917 from judicaelandria/feat/share-via-link
feat: share via URL
2022-09-01 09:16:54 +01:00
Steve Ruiz a22124b3a7 1.21.1 2022-08-28 08:19:11 +01:00
Judicael f6073f3021 feat: share via link 2022-08-17 22:01:32 +03:00
Thomas Steiner c8badf8072
Another attempt at making use of the `browser-fs-access` npm package directly (#894)
* Fight with TypeScript

* Make TypeScript happy(?)

* Apply suggestions from code review

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>

* Update yarn.lock

* Fix favicons

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2022-08-11 08:41:50 +01:00
Gwenaël Gallon 25f39a65fc
Chore: update and optimize turbo (#885)
* Update turbo to latest

* Update turbo.json

* The --stream flag has been deprecated

* Remove unused start:all

* build:packages -> use new --filter

* build:apps -> use new --filter

* build:www -> use new --filter

* build:core -> use new --filter

* build -> fix tldraw-example dependencies

* Optimize test* and lint

* start & start:core -> use new --filter

* start:electron -> use new --filter

* Remove unused start:apps

* Update turbo.json

* Caching ESLint

See Pro Tip : https://turborepo.org/docs/core-concepts/caching#configuring-cache-outputs

* Optimize test:watch

* start:www -> use new filter

* start:vscode -> use new filter

* Update build:core

* Optimize start and start:core

* Clean build:core

* Remove unused command

* Revert "Merge branch 'main' into chore/update-turbo"

This reverts commit a481c24205, reversing
changes made to a0f2f337b3.

* Update start:electron

* Remove unused deploy in turbo.json

* Add start:extension

* Add package:electron and package:vscode

* Add publish:vscode

* Revet Revert: revert "Merge branch 'main' into chore/update-turbo"

* Update vscode extension build

* Clean tldraw-example tsconfig.json

* Uniform script commands

* Fix start for www

* remove mention of removed packages

* add build:core

* Add force to build step

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2022-08-11 07:08:32 +01:00
Steve Ruiz a0007142e0
[chore] epic purge (#893)
* remove extension / electron app

* switch examples to vite

* Update licenses

* Add script

* fix titles
2022-08-10 00:18:59 +01:00
Gwenaël Gallon 3c2c26c11e
Fix: workflow failure with missing lint command and added lint for apps/examples (#866)
* Add turbo run lint

* Add lint to all apps and examples

* Update eslint with monorepo configuration

see: https://typescript-eslint.io/docs/linting/typed-linting/monorepos#one-tsconfigjson-per-package-and-an-optional-one-in-the-root

* Remove unused rules

* Exclude @tldraw/www from global eslint config

* Remove duplicated eslint

* Fix eslint prefer-const errors

* Fix eslint no-unused-vars warning

* Update package.json

* Fix eslint no-unused-vars warning

* bump eslint@^8.20.0

* Correct "Fix eslint no-unused-vars warning"

This reverts commit 0158a2585a.
2022-07-30 08:27:54 +01:00
with-heart 82f9278976
chore: remove typedoc and docs scripts (#864) 2022-07-29 15:22:08 +01:00
Judicael 6267cefa1d
update radix ui primitives (#842) 2022-07-24 23:57:47 +01:00
Steve Ruiz 3e8f585049 1.20.0 2022-07-23 15:09:37 +01:00
Judicael 77337b1281
feat: add help panel (#816)
* feat: add help panel

* feat: added all the shortcuts and responsive

* improve help panel

* add modal for the shortcut

* add grid

* fix language menu

* add responsive grid

* Styling keyboard shortcuts / panel

* fix links ts issue

* Improve styling

* Fix translation bug

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2022-07-19 10:04:38 +01:00
Steve Ruiz 2352985e94
[feature] Iframe warning (#800) 2022-07-08 21:25:08 +01:00
Steve Ruiz 1e80d1ac21 1.19.1 2022-07-08 20:35:10 +01:00
Steve Ruiz 5ac091339a 1.19.0 2022-07-07 12:06:30 +01:00
Steve Ruiz 10b653c13e 1.18.3 2022-07-03 18:58:50 +01:00
Steve Ruiz 9ccec77634 1.18.2 2022-06-30 08:59:09 +01:00