Update readme (#2027)

This PR updates the tldraw readme.

### Change Type

- [x] `patch` — Bug fix
This commit is contained in:
Steve Ruiz 2023-10-06 13:10:33 +01:00 committed by GitHub
parent fa32173409
commit 53a8fd6c69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 37 deletions

1
apps/examples/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.vercel

View file

@ -55,127 +55,127 @@ type Example = {
export const allExamples: Example[] = [ export const allExamples: Example[] = [
{ {
title: 'Basic (development)', title: 'Basic (development)',
path: '/develop', path: 'develop',
element: <BasicExample />, element: <BasicExample />,
}, },
{ {
title: 'Collaboration (with Yjs)', title: 'Collaboration (with Yjs)',
path: '/yjs', path: 'yjs',
element: <YjsExample />, element: <YjsExample />,
}, },
{ {
title: 'Editor API', title: 'Editor API',
path: '/api', path: 'api',
element: <APIExample />, element: <APIExample />,
}, },
{ {
title: 'Multiple editors', title: 'Multiple editors',
path: '/multiple', path: 'multiple',
element: <MultipleExample />, element: <MultipleExample />,
}, },
{ {
title: 'Readonly Example', title: 'Readonly Example',
path: '/readonly', path: 'readonly',
element: <ReadOnlyExample />, element: <ReadOnlyExample />,
}, },
{ {
title: 'Scroll example', title: 'Scroll example',
path: '/scroll', path: 'scroll',
element: <ScrollExample />, element: <ScrollExample />,
}, },
{ {
title: 'Custom shapes / tools', title: 'Custom shapes / tools',
path: '/custom-config', path: 'custom-config',
element: <CustomConfigExample />, element: <CustomConfigExample />,
}, },
{ {
title: 'Sublibraries', title: 'Sublibraries',
path: '/exploded', path: 'exploded',
element: <ExplodedExample />, element: <ExplodedExample />,
}, },
{ {
title: 'Error boundary', title: 'Error boundary',
path: '/error-boundary', path: 'error-boundary',
element: <ErrorBoundaryExample />, element: <ErrorBoundaryExample />,
}, },
{ {
title: 'Custom UI', title: 'Custom UI',
path: '/custom-ui', path: 'custom-ui',
element: <CustomUiExample />, element: <CustomUiExample />,
}, },
{ {
title: 'Hide UI', title: 'Hide UI',
path: '/hide-ui', path: 'hide-ui',
element: <HideUiExample />, element: <HideUiExample />,
}, },
{ {
title: 'UI components', title: 'UI components',
path: '/custom-components', path: 'custom-components',
element: <CustomComponentsExample />, element: <CustomComponentsExample />,
}, },
{ {
title: 'UI events', title: 'UI events',
path: '/ui-events', path: 'ui-events',
element: <UiEventsExample />, element: <UiEventsExample />,
}, },
{ {
title: 'Canvas events', title: 'Canvas events',
path: '/canvas-events', path: 'canvas-events',
element: <CanvasEventsExample />, element: <CanvasEventsExample />,
}, },
{ {
title: 'Store events', title: 'Store events',
path: '/store-events', path: 'store-events',
element: <StoreEventsExample />, element: <StoreEventsExample />,
}, },
{ {
title: 'User presence', title: 'User presence',
path: '/user-presence', path: 'user-presence',
element: <UserPresenceExample />, element: <UserPresenceExample />,
}, },
{ {
title: 'UI zones', title: 'UI zones',
path: '/zones', path: 'zones',
element: <ZonesExample />, element: <ZonesExample />,
}, },
{ {
title: 'Persistence', title: 'Persistence',
path: '/persistence', path: 'persistence',
element: <PersistenceExample />, element: <PersistenceExample />,
}, },
{ {
title: 'Snapshots', title: 'Snapshots',
path: '/snapshots', path: 'snapshots',
element: <SnapshotExample />, element: <SnapshotExample />,
}, },
{ {
title: 'Custom styles', title: 'Custom styles',
path: '/custom-styles', path: 'custom-styles',
element: <CustomStylesExample />, element: <CustomStylesExample />,
}, },
{ {
title: 'Shape meta property', title: 'Shape meta property',
path: '/shape-meta', path: 'shape-meta',
element: <ShapeMetaExample />, element: <ShapeMetaExample />,
}, },
{ {
title: 'Only editor', title: 'Only editor',
path: '/only-editor', path: 'only-editor',
element: <OnlyEditorExample />, element: <OnlyEditorExample />,
}, },
{ {
title: 'Asset props', title: 'Asset props',
path: '/asset-props', path: 'asset-props',
element: <AssetPropsExample />, element: <AssetPropsExample />,
}, },
{ {
title: 'External content sources', title: 'External content sources',
path: '/external-content-sources', path: 'external-content-sources',
element: <ExternalContentSourcesExample />, element: <ExternalContentSourcesExample />,
}, },
// not listed // not listed
{ {
path: '/end-to-end', path: 'end-to-end',
element: <EndToEnd />, element: <EndToEnd />,
}, },
] ]
@ -201,12 +201,13 @@ function App() {
} }
const router = createBrowserRouter([ const router = createBrowserRouter([
...allExamples,
{ {
path: '/', path: '/',
element: <App />, element: <App />,
}, },
...allExamples,
]) ])
const rootElement = document.getElementById('root') const rootElement = document.getElementById('root')
const root = createRoot(rootElement!) const root = createRoot(rootElement!)

View file

@ -1,24 +1,26 @@
<div alt style="text-align: center; transform: scale(.5);"> <div alt style="text-align: center; transform: scale(.5);">
<picture> <picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/tldraw/tldraw-lite/raw/main/assets/github-hero-dark.png" /> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/tldraw/tldraw/raw/main/assets/github-hero-dark.png" />
<img alt="Signia" src="https://github.com/tldraw/tldraw-lite/raw/main/assets/github-hero-light.png" /> <img alt="tldraw" src="https://github.com/tldraw/tldraw/raw/main/assets/github-hero-light.png" />
</picture> </picture>
</div> </div>
# @tldraw/tldraw # @tldraw/tldraw
This is the alpha version of [tldraw](https://beta.tldraw.com). It is very much a work in progress. This is the pre-release version of [tldraw](https://github.com/tldraw/tldraw).
See the pre-release docs at [canary.tldraw.dev](https://canary.tldraw.com).
## Installation ## Installation
Install the `@tldraw/tldraw` package using `@alpha` for the latest alpha release. Install the `@tldraw/tldraw` package using `@canary` for the latest canary release. (Or `@alpha` for the latest alpha release.)
```bash ```bash
yarn add @tldraw/tldraw@alpha yarn add @tldraw/tldraw@canary
# or # or
npm install @tldraw/tldraw@alpha npm install @tldraw/tldraw@canary
# or # or
pnpm i @tldraw/tldraw@alpha pnpm i @tldraw/tldraw@canary
``` ```
Then start the local development server. Then start the local development server.
@ -37,15 +39,14 @@ An extremely minimal usage (without our UI) might look like this:
```tsx ```tsx
import { Tldraw } from '@tldraw/tldraw' import { Tldraw } from '@tldraw/tldraw'
import '@tldraw/tldraw/styles-editor.css' import '@tldraw/tldraw/tldraw.css'
import '@tldraw/tldraw/styles-ui.css'
export default function () { export default function () {
return <Tldraw /> return <Tldraw />
} }
``` ```
See the [examples repo](https://github.com/tldraw/tldraw-examples) for more examples. See the [examples folder](https://github.com/tldraw/tldraw/tree/main/apps/examples) for more examples.
## License ## License

View file

@ -13,7 +13,7 @@
"rewrites": [ "rewrites": [
{ {
"source": "/(.*)", "source": "/(.*)",
"destination": "/index.html" "destination": "/"
} }
] ]
} }