Pārlūkot izejas kodu

[improvement] repo shuffle (#214)

* move folders out of packages

* Remove custom yarn stuff, remove duplicate readme

* Remove stitches config

* Add README script.

* bump deps

* Fix script

* Update package.json
main
Steve Ruiz 3 gadus atpakaļ
vecāks
revīzija
b68a4681e1
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
90 mainītis faili ar 1084 papildinājumiem un 148265 dzēšanām
  1. 0
    147191
      .yarn/releases/yarn-1.19.0.cjs
  2. 0
    5
      .yarnrc
  3. 134
    48
      README.md
  4. Binārs
      card-repo.png
  5. 0
    0
      dev/.env.local
  6. 0
    0
      dev/LICENSE
  7. 0
    0
      dev/README.md
  8. 0
    0
      dev/esbuild.config.mjs
  9. 3
    4
      dev/package.json
  10. 0
    0
      dev/src/app.tsx
  11. 0
    0
      dev/src/assets/local.tldr
  12. 0
    0
      dev/src/basic.tsx
  13. 0
    0
      dev/src/changing-id.tsx
  14. 0
    0
      dev/src/components/editor.tsx
  15. 0
    0
      dev/src/controlled.tsx
  16. 0
    0
      dev/src/embedded.tsx
  17. 0
    0
      dev/src/imperative.tsx
  18. 0
    0
      dev/src/index.html
  19. 0
    0
      dev/src/index.tsx
  20. 0
    0
      dev/src/multiplayer/cursors.tsx
  21. 0
    0
      dev/src/multiplayer/index.ts
  22. 0
    0
      dev/src/multiplayer/multiplayer.tsx
  23. 0
    0
      dev/src/no-size-embedded.tsx
  24. 0
    0
      dev/src/styles.css
  25. 3
    3
      dev/tsconfig.json
  26. 0
    0
      dev/tsconfig.tsbuildinfo
  27. 9
    7
      package.json
  28. 0
    147
      packages/tldraw/README.md
  29. 2
    3
      packages/tldraw/package.json
  30. 10
    0
      packages/tldraw/scripts/copy-readme.js
  31. 1
    1
      packages/tldraw/tsconfig.json
  32. 0
    2
      packages/www/public/sw.js
  33. 0
    1
      packages/www/public/sw.js.map
  34. 0
    1
      packages/www/public/workbox-7288c796.js.map
  35. 0
    0
      www/.eslintrc.json
  36. 0
    0
      www/.gitignore
  37. 0
    0
      www/LICENSE
  38. 0
    0
      www/README.md
  39. 0
    0
      www/components/editor.tsx
  40. 0
    0
      www/components/multiplayer-editor.tsx
  41. 0
    0
      www/next-env.d.ts
  42. 0
    0
      www/next.config.js
  43. 0
    0
      www/package.json
  44. 0
    0
      www/pages/_app.tsx
  45. 0
    0
      www/pages/_document.tsx
  46. 0
    0
      www/pages/api/auth/[...nextauth].ts
  47. 0
    0
      www/pages/index.tsx
  48. 0
    0
      www/pages/k/[id].tsx
  49. 0
    0
      www/pages/k/index.tsx
  50. 0
    0
      www/pages/r/[id].tsx
  51. 0
    0
      www/pages/r/index.tsx
  52. 0
    0
      www/pages/shhh.tsx
  53. 0
    0
      www/pages/shhhmp.tsx
  54. 0
    0
      www/pages/signout.tsx
  55. 0
    0
      www/pages/sponsorware.tsx
  56. 0
    0
      www/pages/u/[id].tsx
  57. 0
    0
      www/pages/u/index.tsx
  58. 0
    0
      www/public/android-chrome-192x192.png
  59. 0
    0
      www/public/android-chrome-512x512.png
  60. 0
    0
      www/public/android-chrome-maskable-192x192.png
  61. 0
    0
      www/public/android-chrome-maskable-512x512.png
  62. 0
    0
      www/public/android-chrome-maskable-beta-512x512.png
  63. 0
    0
      www/public/apple-touch-icon.png
  64. 0
    0
      www/public/favicon-16x16.png
  65. 0
    0
      www/public/favicon-32x32.png
  66. 0
    0
      www/public/favicon.ico
  67. 0
    0
      www/public/flat.png
  68. 0
    0
      www/public/icons/Redo.svg
  69. 0
    0
      www/public/icons/Trash.svg
  70. 0
    0
      www/public/icons/Undo.svg
  71. 0
    0
      www/public/icons/grab.svg
  72. 0
    0
      www/public/icons/pointer.svg
  73. 0
    0
      www/public/icons/resize.svg
  74. 0
    0
      www/public/images/hello.mp4
  75. 0
    0
      www/public/manifest.json
  76. 2
    0
      www/public/sw.js
  77. 1
    0
      www/public/sw.js.map
  78. 0
    0
      www/public/vercel.svg
  79. 2
    2
      www/public/workbox-a6b3f14f.js
  80. 1
    0
      www/public/workbox-a6b3f14f.js.map
  81. 0
    0
      www/public/worker-zTyDOkV9qnCPfL6KDOfO4.js
  82. 0
    0
      www/styles/globals.css
  83. 0
    0
      www/styles/index.ts
  84. 0
    0
      www/styles/stitches.config.ts
  85. 6
    20
      www/tsconfig.json
  86. 0
    0
      www/utils/gtag.ts
  87. 0
    0
      www/utils/sentry.ts
  88. 0
    0
      www/utils/useGtag.ts
  89. 0
    0
      www/worker/index.js
  90. 910
    830
      yarn.lock

+ 0
- 147191
.yarn/releases/yarn-1.19.0.cjs
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 0
- 5
.yarnrc Parādīt failu

@@ -1,5 +0,0 @@
1
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
-# yarn lockfile v1
3
-
4
-
5
-yarn-path ".yarn/releases/yarn-1.19.0.cjs"

+ 134
- 48
README.md Parādīt failu

@@ -1,61 +1,147 @@
1
-# tldraw
1
+# @tldraw/tldraw
2 2
 
3
-A tiny little drawing app.
3
+> `This library is not yet released and these docs are partially out of date!`
4 4
 
5
-Visit [tldraw.com](https://tldraw.com/).
5
+This package contains the [tldraw](https://tldraw.com) editor as a standalone React component.
6 6
 
7
-## Author
7
+## Installation
8 8
 
9
-- [steveruizok](https://twitter.com/steveruizok)
10
-- ...and more!
9
+```bash
10
+npm i @tldraw/tldraw
11
+```
11 12
 
12
-## Support
13
+or
13 14
 
14
-To support this project (and gain access to the project while it is in development) you can [sponsor the author](https://github.com/sponsors/steveruizok) on GitHub. Thanks!
15
+```bash
16
+yarn add @tldraw/tldraw
17
+```
15 18
 
16
-## Documentation
17
-
18
-In progress! Check the README files in [packages/core](packages/core/README.md) and [packages/tldraw](packages/tldraw/README.md).
19
-
20
-## Examples
21
-
22
-- [@tldraw/core example](https://codesandbox.io/s/tldraw-core-example-88c74)
23
-- [@tldraw/tldraw example](https://codesandbox.io/s/tldraw-example-n539u)
24
-
25
-## Local Development
26
-
27
-### The tldraw packages
28
-
29
-To work on the packages (@tldraw/core or @tldraw/tldraw), you'll want to run the (extremely fast) dev server.
19
+## Usage
30 20
 
31
-1. Download or clone the repository.
21
+Import the `TLDraw` React component and use it in your app.
32 22
 
33
-   ```bash
34
-   git clone https://github.com/tldraw/tldraw.git
35
-   ```
23
+```tsx
24
+import { TLDraw } from '@tldraw/tldraw'
36 25
 
37
-2. Install dependencies.
26
+function App() {
27
+  return <TLDraw />
28
+}
29
+```
38 30
 
39
-   ```bash
40
-   yarn
41
-   ```
42
-
43
-3. Start the development server.
44
-
45
-   ```bash
46
-   yarn start
47
-   ```
48
-
49
-4. Open the local site at `https://localhost:5000`.
50
-
51
-### The tldraw app
52
-
53
-To work on the app itself (that embeds @tldraw/tldraw), run the Next.js app. This won't directly respond to changes to packages, so for concurrent package dev work be sure to use the package dev server instead. (This is being worked on.)
54
-
55
-1. Start the development server.
31
+## Documentation
56 32
 
57
-   ```bash
58
-   yarn start:www
59
-   ```
33
+### `TLDraw`
34
+
35
+The `TLDraw` React component is the [tldraw](https://tldraw.com) editor exported as a standalone component. You can control the editor through props, or through the `TLDrawState`'s imperative API.
36
+
37
+| Prop            | Type                            | Description                                                                                                                                                             |
38
+| --------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39
+| `id`            | `string`                        | (optional) An id under which to persist the component's state.                                                                                                          |
40
+| `document`      | `TLDrawDocument`                | (optional) An initial [`TLDrawDocument`](#tldrawdocument) object.                                                                                                       |
41
+| `currentPageId` | `string`                        | (optional) A current page id, referencing the `TLDrawDocument` object provided via the `document` prop.                                                                 |
42
+| `onMount`       | `(TLDrawState) => void`         | (optional) A callback function that will be called when the editor first mounts, receiving the current `TLDrawState`.                                                   |
43
+| `onChange`      | `(TLDrawState, string) => void` | (optional) A callback function that will be called whenever the `TLDrawState` updates. The update will include the current `TLDrawState` and the reason for the change. |
44
+
45
+### `TLDrawDocument`
60 46
 
61
-2. Open the local site at `https://localhost:3000`.
47
+A `TLDrawDocument` is an object with three properties:
48
+
49
+- `id` - A unique ID for this document
50
+- `pages` - A table of `TLPage` objects
51
+- `pageStates` - A table of `TLPageState` objects
52
+
53
+```ts
54
+const tldocument: TLDrawDocument = {
55
+  id: 'doc',
56
+  pages: {
57
+    page1: {
58
+      id: 'page1',
59
+      shapes: {},
60
+      bindings: {},
61
+    },
62
+  },
63
+  pageStates: {
64
+    page1: {
65
+      id: 'page1',
66
+      selectedIds: [],
67
+      currentParentId: 'page1',
68
+      camera: {
69
+        point: [0, 0],
70
+        zoom: 1,
71
+      },
72
+    },
73
+  },
74
+}
75
+```
76
+
77
+**Important:** In the `pages` object, each `TLPage` object must be keyed under its `id` property. Likewise, each `TLPageState` object must be keyed under its `id`. In addition, each `TLPageState` object must have an `id` that matches its corresponding page.
78
+
79
+In the example above, the page above with the id `page1`is at `tldocument.pages["page1"]`. Its corresponding page state has the same id (`page1`) and is at `tldocument.pageStates["page1"]`.
80
+
81
+### Shapes
82
+
83
+Your `TLPage` objects may include shapes: objects that fit one of the `TLDrawShape` interfaces listed below. All `TLDrawShapes` extends a common interface:
84
+
85
+| Property              | Type         | Description                                                     |
86
+| --------------------- | ------------ | --------------------------------------------------------------- |
87
+| `id`                  | `string`     | A unique ID for the shape.                                      |
88
+| `name`                | `string`     | The shape's name.                                               |
89
+| `type`                | `string`     | The shape's type.                                               |
90
+| `parentId`            | `string`     | The ID of the shape's parent (a shape or its page).             |
91
+| `childIndex`          | `number`     | The shape's order within its parent's children, indexed from 1. |
92
+| `point`               | `number[]`   | The `[x, y]` position of the shape.                             |
93
+| `rotation`            | `number[]`   | (optional) The shape's rotation in radians.                     |
94
+| `children`            | `string[]`   | (optional) The shape's child shape ids.                         |
95
+| `handles`             | `TLHandle{}` | (optional) A table of `TLHandle` objects.                       |
96
+| `isLocked`            | `boolean`    | True if the shape is locked.                                    |
97
+| `isHidden`            | `boolean`    | True if the shape is hidden.                                    |
98
+| `isEditing`           | `boolean`    | True if the shape is currently editing.                         |
99
+| `isGenerated`         | `boolean`    | True if the shape is generated.                                 |
100
+| `isAspectRatioLocked` | `boolean`    | True if the shape's aspect ratio is locked.                     |
101
+
102
+> **Important:** In order for re-ordering to work correctly, a shape's `childIndex` values _must_ start from 1, not 0. The page or parent shape's "bottom-most" child should have a `childIndex` of 1.
103
+
104
+The `ShapeStyle` object is a common style API for all shapes.
105
+
106
+| Property   | Type         | Description                             |
107
+| ---------- | ------------ | --------------------------------------- |
108
+| `size`     | `SizeStyle`  | The size of the shape's stroke.         |
109
+| `dash`     | `DashStyle`  | The style of the shape's stroke.        |
110
+| `color`    | `ColorStyle` | The shape's color.                      |
111
+| `isFilled` | `boolean`    | (optional) True if the shape is filled. |
112
+
113
+#### Draw
114
+
115
+| Property | Type         | Description                               |
116
+| -------- | ------------ | ----------------------------------------- |
117
+| `points` | `number[][]` | An array of points as `[x, y, pressure]`. |
118
+
119
+##### Rectangle
120
+
121
+| Property | Type       | Description                             |
122
+| -------- | ---------- | --------------------------------------- |
123
+| `size`   | `number[]` | The `[width, height]` of the rectangle. |
124
+
125
+#### Ellipse
126
+
127
+| Property | Type       | Description                         |
128
+| -------- | ---------- | ----------------------------------- |
129
+| `radius` | `number[]` | The `[x, y]` radius of the ellipse. |
130
+
131
+#### Arrow
132
+
133
+| Property  | Type     | Description                                                             |
134
+| --------- | -------- | ----------------------------------------------------------------------- |
135
+| `handles` | `object` | An object with three `TLHandle` properties: `start`, `end`, and `bend`. |
136
+
137
+#### Text
138
+
139
+| Property | Type     | Description               |
140
+| -------- | -------- | ------------------------- |
141
+| `text`   | `string` | The shape's text content. |
142
+
143
+## Development
144
+
145
+### Running unit tests
146
+
147
+Run `nx test tldraw` to execute the unit tests via [Jest](https://jestjs.io).

Binārs
card-repo.png Parādīt failu


packages/dev/.env.local → dev/.env.local Parādīt failu


packages/dev/LICENSE → dev/LICENSE Parādīt failu


packages/dev/README.md → dev/README.md Parādīt failu


packages/dev/esbuild.config.mjs → dev/esbuild.config.mjs Parādīt failu


packages/dev/package.json → dev/package.json Parādīt failu

@@ -19,10 +19,9 @@
19 19
   ],
20 20
   "sideEffects": false,
21 21
   "dependencies": {
22
-    "@liveblocks/client": "^0.12.0",
23
-    "@liveblocks/react": "^0.12.0",
22
+    "@liveblocks/client": "^0.12.1",
23
+    "@liveblocks/react": "^0.12.1",
24 24
     "@tldraw/tldraw": "^0.0.133",
25
-    "idb": "^6.1.2",
26 25
     "react": ">=16.8",
27 26
     "react-dom": "^16.8 || ^17.0",
28 27
     "react-router": "^5.2.1",
@@ -40,4 +39,4 @@
40 39
     "typescript": "4.2.3"
41 40
   },
42 41
   "gitHead": "a7dac0f83ad998e205c2aab58182cb4ba4e099a6"
43
-}
42
+}

packages/dev/src/app.tsx → dev/src/app.tsx Parādīt failu


packages/dev/src/assets/local.tldr → dev/src/assets/local.tldr Parādīt failu


packages/dev/src/basic.tsx → dev/src/basic.tsx Parādīt failu


packages/dev/src/changing-id.tsx → dev/src/changing-id.tsx Parādīt failu


packages/dev/src/components/editor.tsx → dev/src/components/editor.tsx Parādīt failu


packages/dev/src/controlled.tsx → dev/src/controlled.tsx Parādīt failu


packages/dev/src/embedded.tsx → dev/src/embedded.tsx Parādīt failu


packages/dev/src/imperative.tsx → dev/src/imperative.tsx Parādīt failu


packages/dev/src/index.html → dev/src/index.html Parādīt failu


packages/dev/src/index.tsx → dev/src/index.tsx Parādīt failu


packages/dev/src/multiplayer/cursors.tsx → dev/src/multiplayer/cursors.tsx Parādīt failu


packages/dev/src/multiplayer/index.ts → dev/src/multiplayer/index.ts Parādīt failu


packages/dev/src/multiplayer/multiplayer.tsx → dev/src/multiplayer/multiplayer.tsx Parādīt failu


packages/dev/src/no-size-embedded.tsx → dev/src/no-size-embedded.tsx Parādīt failu


packages/dev/src/styles.css → dev/src/styles.css Parādīt failu


packages/dev/tsconfig.json → dev/tsconfig.json Parādīt failu

@@ -1,5 +1,5 @@
1 1
 {
2
-  "extends": "../../tsconfig.base.json",
2
+  "extends": "../tsconfig.base.json",
3 3
   "include": ["src"],
4 4
   "exclude": ["node_modules", "dist", "docs"],
5 5
   "compilerOptions": {
@@ -9,12 +9,12 @@
9 9
     "emitDeclarationOnly": false,
10 10
     "paths": {
11 11
       "+*": ["./*"],
12
-      "@tldraw/tldraw": ["../tldraw"]
12
+      "@tldraw/tldraw": ["../packages/tldraw"]
13 13
     }
14 14
   },
15 15
   "references": [
16 16
     {
17
-      "path": "../tldraw"
17
+      "path": "../packages/tldraw"
18 18
     }
19 19
   ],
20 20
   "typedocOptions": {

packages/dev/tsconfig.tsbuildinfo → dev/tsconfig.tsbuildinfo Parādīt failu


+ 9
- 7
package.json Parādīt failu

@@ -1,8 +1,8 @@
1 1
 {
2 2
   "name": "tldraw",
3 3
   "private": true,
4
-  "author": "@steveruizok",
5 4
   "description": "A tiny little drawing app.",
5
+  "author": "@steveruizok",
6 6
   "repository": {
7 7
     "type": "git",
8 8
     "url": "git+https://github.com/tldraw/tldraw.git"
@@ -10,16 +10,16 @@
10 10
   "license": "MIT",
11 11
   "workspaces": [
12 12
     "packages/tldraw",
13
-    "packages/dev",
14
-    "packages/www"
13
+    "dev",
14
+    "www"
15 15
   ],
16 16
   "scripts": {
17 17
     "test": "jest",
18 18
     "test:watch": "jest --watchAll",
19 19
     "lerna": "lerna",
20 20
     "start": "lerna run start:pre && lerna run start --stream --parallel",
21
-    "start:www": "yarn build:packages && lerna run start --parallel & cd packages/www && yarn dev",
22
-    "build": "yarn build:packages && cd packages/www && yarn build",
21
+    "start:www": "yarn build:packages && lerna run start --parallel & cd www && yarn dev",
22
+    "build": "yarn build:packages && cd www && yarn build",
23 23
     "build:packages": "cd packages/tldraw && yarn build",
24 24
     "publish:patch": "yarn build:packages && lerna publish patch",
25 25
     "docs": "lerna run docs",
@@ -45,7 +45,9 @@
45 45
     "typedoc": "^0.22.3",
46 46
     "typescript": "^4.4.2"
47 47
   },
48
-  "dependencies": {},
48
+  "dependencies": {
49
+    "www": "0.0.133"
50
+  },
49 51
   "prettier": {
50 52
     "trailingComma": "es5",
51 53
     "singleQuote": true,
@@ -78,4 +80,4 @@
78 80
       "\\~(.*)": "<rootDir>/packages/tldraw/src/$1"
79 81
     }
80 82
   }
81
-}
83
+}

+ 0
- 147
packages/tldraw/README.md Parādīt failu

@@ -1,147 +0,0 @@
1
-# @tldraw/tldraw
2
-
3
-> `This library is not yet released and these docs are partially out of date!`
4
-
5
-This package contains the [tldraw](https://tldraw.com) editor as a standalone React component.
6
-
7
-## Installation
8
-
9
-```bash
10
-npm i @tldraw/tldraw
11
-```
12
-
13
-or
14
-
15
-```bash
16
-yarn add @tldraw/tldraw
17
-```
18
-
19
-## Usage
20
-
21
-Import the `TLDraw` React component and use it in your app.
22
-
23
-```tsx
24
-import { TLDraw } from '@tldraw/tldraw'
25
-
26
-function App() {
27
-  return <TLDraw />
28
-}
29
-```
30
-
31
-## Documentation
32
-
33
-### `TLDraw`
34
-
35
-The `TLDraw` React component is the [tldraw](https://tldraw.com) editor exported as a standalone component. You can control the editor through props, or through the `TLDrawState`'s imperative API.
36
-
37
-| Prop            | Type                            | Description                                                                                                                                                             |
38
-| --------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39
-| `id`            | `string`                        | (optional) An id under which to persist the component's state.                                                                                                          |
40
-| `document`      | `TLDrawDocument`                | (optional) An initial [`TLDrawDocument`](#tldrawdocument) object.                                                                                                       |
41
-| `currentPageId` | `string`                        | (optional) A current page id, referencing the `TLDrawDocument` object provided via the `document` prop.                                                                 |
42
-| `onMount`       | `(TLDrawState) => void`         | (optional) A callback function that will be called when the editor first mounts, receiving the current `TLDrawState`.                                                   |
43
-| `onChange`      | `(TLDrawState, string) => void` | (optional) A callback function that will be called whenever the `TLDrawState` updates. The update will include the current `TLDrawState` and the reason for the change. |
44
-
45
-### `TLDrawDocument`
46
-
47
-A `TLDrawDocument` is an object with three properties:
48
-
49
-- `id` - A unique ID for this document
50
-- `pages` - A table of `TLPage` objects
51
-- `pageStates` - A table of `TLPageState` objects
52
-
53
-```ts
54
-const tldocument: TLDrawDocument = {
55
-  id: 'doc',
56
-  pages: {
57
-    page1: {
58
-      id: 'page1',
59
-      shapes: {},
60
-      bindings: {},
61
-    },
62
-  },
63
-  pageStates: {
64
-    page1: {
65
-      id: 'page1',
66
-      selectedIds: [],
67
-      currentParentId: 'page1',
68
-      camera: {
69
-        point: [0, 0],
70
-        zoom: 1,
71
-      },
72
-    },
73
-  },
74
-}
75
-```
76
-
77
-**Important:** In the `pages` object, each `TLPage` object must be keyed under its `id` property. Likewise, each `TLPageState` object must be keyed under its `id`. In addition, each `TLPageState` object must have an `id` that matches its corresponding page.
78
-
79
-In the example above, the page above with the id `page1`is at `tldocument.pages["page1"]`. Its corresponding page state has the same id (`page1`) and is at `tldocument.pageStates["page1"]`.
80
-
81
-### Shapes
82
-
83
-Your `TLPage` objects may include shapes: objects that fit one of the `TLDrawShape` interfaces listed below. All `TLDrawShapes` extends a common interface:
84
-
85
-| Property              | Type         | Description                                                     |
86
-| --------------------- | ------------ | --------------------------------------------------------------- |
87
-| `id`                  | `string`     | A unique ID for the shape.                                      |
88
-| `name`                | `string`     | The shape's name.                                               |
89
-| `type`                | `string`     | The shape's type.                                               |
90
-| `parentId`            | `string`     | The ID of the shape's parent (a shape or its page).             |
91
-| `childIndex`          | `number`     | The shape's order within its parent's children, indexed from 1. |
92
-| `point`               | `number[]`   | The `[x, y]` position of the shape.                             |
93
-| `rotation`            | `number[]`   | (optional) The shape's rotation in radians.                     |
94
-| `children`            | `string[]`   | (optional) The shape's child shape ids.                         |
95
-| `handles`             | `TLHandle{}` | (optional) A table of `TLHandle` objects.                       |
96
-| `isLocked`            | `boolean`    | True if the shape is locked.                                    |
97
-| `isHidden`            | `boolean`    | True if the shape is hidden.                                    |
98
-| `isEditing`           | `boolean`    | True if the shape is currently editing.                         |
99
-| `isGenerated`         | `boolean`    | True if the shape is generated.                                 |
100
-| `isAspectRatioLocked` | `boolean`    | True if the shape's aspect ratio is locked.                     |
101
-
102
-> **Important:** In order for re-ordering to work correctly, a shape's `childIndex` values _must_ start from 1, not 0. The page or parent shape's "bottom-most" child should have a `childIndex` of 1.
103
-
104
-The `ShapeStyle` object is a common style API for all shapes.
105
-
106
-| Property   | Type         | Description                             |
107
-| ---------- | ------------ | --------------------------------------- |
108
-| `size`     | `SizeStyle`  | The size of the shape's stroke.         |
109
-| `dash`     | `DashStyle`  | The style of the shape's stroke.        |
110
-| `color`    | `ColorStyle` | The shape's color.                      |
111
-| `isFilled` | `boolean`    | (optional) True if the shape is filled. |
112
-
113
-#### Draw
114
-
115
-| Property | Type         | Description                               |
116
-| -------- | ------------ | ----------------------------------------- |
117
-| `points` | `number[][]` | An array of points as `[x, y, pressure]`. |
118
-
119
-##### Rectangle
120
-
121
-| Property | Type       | Description                             |
122
-| -------- | ---------- | --------------------------------------- |
123
-| `size`   | `number[]` | The `[width, height]` of the rectangle. |
124
-
125
-#### Ellipse
126
-
127
-| Property | Type       | Description                         |
128
-| -------- | ---------- | ----------------------------------- |
129
-| `radius` | `number[]` | The `[x, y]` radius of the ellipse. |
130
-
131
-#### Arrow
132
-
133
-| Property  | Type     | Description                                                             |
134
-| --------- | -------- | ----------------------------------------------------------------------- |
135
-| `handles` | `object` | An object with three `TLHandle` properties: `start`, `end`, and `bend`. |
136
-
137
-#### Text
138
-
139
-| Property | Type     | Description               |
140
-| -------- | -------- | ------------------------- |
141
-| `text`   | `string` | The shape's text content. |
142
-
143
-## Development
144
-
145
-### Running unit tests
146
-
147
-Run `nx test tldraw` to execute the unit tests via [Jest](https://jestjs.io).

+ 2
- 3
packages/tldraw/package.json Parādīt failu

@@ -20,7 +20,7 @@
20 20
   "typings": "./dist/types/index.d.ts",
21 21
   "scripts": {
22 22
     "start": "node scripts/dev & yarn types:dev",
23
-    "build": "node scripts/build && yarn types:build",
23
+    "build": "node scripts/build && yarn types:build && node scripts/copy-readme",
24 24
     "types:pre": "tsc",
25 25
     "types:dev": "tsc -w",
26 26
     "types:build": "tsc -p tsconfig.build.json && tsconfig-replace-paths -p tsconfig.build.json",
@@ -47,7 +47,6 @@
47 47
     "@radix-ui/react-radio-group": "^0.1.1",
48 48
     "@radix-ui/react-tooltip": "^0.1.1",
49 49
     "@stitches/core": "^1.2.5",
50
-    "@stitches/react": "^1.0.0",
51 50
     "@tldraw/core": "^0.1.13",
52 51
     "@tldraw/intersect": "^0.1.3",
53 52
     "@tldraw/vec": "^0.1.3",
@@ -56,4 +55,4 @@
56 55
     "rko": "^0.5.25"
57 56
   },
58 57
   "gitHead": "083b36e167b6911927a6b58cbbb830b11b33f00a"
59
-}
58
+}

+ 10
- 0
packages/tldraw/scripts/copy-readme.js Parādīt failu

@@ -0,0 +1,10 @@
1
+/* eslint-disable */
2
+const fs = require('fs')
3
+
4
+const filesToCopy = ['README.md', 'card-repo.png']
5
+
6
+filesToCopy.forEach((file) => {
7
+  fs.copyFile(`../../${file}`, `./dist/${file}`, (err) => {
8
+    if (err) throw err
9
+  })
10
+})

+ 1
- 1
packages/tldraw/tsconfig.json Parādīt failu

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "extends": "../../tsconfig.base.json",
3
-  "include": ["src", "src/test/old-doc.json"],
3
+  "include": ["src"],
4 4
   "exclude": ["node_modules", "dist", "docs"],
5 5
   "compilerOptions": {
6 6
     "resolveJsonModule": true,

+ 0
- 2
packages/www/public/sw.js
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 0
- 1
packages/www/public/sw.js.map
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 0
- 1
packages/www/public/workbox-7288c796.js.map
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


packages/www/.eslintrc.json → www/.eslintrc.json Parādīt failu


packages/www/.gitignore → www/.gitignore Parādīt failu


packages/www/LICENSE → www/LICENSE Parādīt failu


packages/www/README.md → www/README.md Parādīt failu


packages/www/components/editor.tsx → www/components/editor.tsx Parādīt failu


packages/www/components/multiplayer-editor.tsx → www/components/multiplayer-editor.tsx Parādīt failu


packages/www/next-env.d.ts → www/next-env.d.ts Parādīt failu


packages/www/next.config.js → www/next.config.js Parādīt failu


packages/www/package.json → www/package.json Parādīt failu


packages/www/pages/_app.tsx → www/pages/_app.tsx Parādīt failu


packages/www/pages/_document.tsx → www/pages/_document.tsx Parādīt failu


packages/www/pages/api/auth/[...nextauth].ts → www/pages/api/auth/[...nextauth].ts Parādīt failu


packages/www/pages/index.tsx → www/pages/index.tsx Parādīt failu


packages/www/pages/k/[id].tsx → www/pages/k/[id].tsx Parādīt failu


packages/www/pages/k/index.tsx → www/pages/k/index.tsx Parādīt failu


packages/www/pages/r/[id].tsx → www/pages/r/[id].tsx Parādīt failu


packages/www/pages/r/index.tsx → www/pages/r/index.tsx Parādīt failu


packages/www/pages/shhh.tsx → www/pages/shhh.tsx Parādīt failu


packages/www/pages/shhhmp.tsx → www/pages/shhhmp.tsx Parādīt failu


packages/www/pages/signout.tsx → www/pages/signout.tsx Parādīt failu


packages/www/pages/sponsorware.tsx → www/pages/sponsorware.tsx Parādīt failu


packages/www/pages/u/[id].tsx → www/pages/u/[id].tsx Parādīt failu


packages/www/pages/u/index.tsx → www/pages/u/index.tsx Parādīt failu


packages/www/public/android-chrome-192x192.png → www/public/android-chrome-192x192.png Parādīt failu


packages/www/public/android-chrome-512x512.png → www/public/android-chrome-512x512.png Parādīt failu


packages/www/public/android-chrome-maskable-192x192.png → www/public/android-chrome-maskable-192x192.png Parādīt failu


packages/www/public/android-chrome-maskable-512x512.png → www/public/android-chrome-maskable-512x512.png Parādīt failu


packages/www/public/android-chrome-maskable-beta-512x512.png → www/public/android-chrome-maskable-beta-512x512.png Parādīt failu


packages/www/public/apple-touch-icon.png → www/public/apple-touch-icon.png Parādīt failu


packages/www/public/favicon-16x16.png → www/public/favicon-16x16.png Parādīt failu


packages/www/public/favicon-32x32.png → www/public/favicon-32x32.png Parādīt failu


packages/www/public/favicon.ico → www/public/favicon.ico Parādīt failu


packages/www/public/flat.png → www/public/flat.png Parādīt failu


packages/www/public/icons/Redo.svg → www/public/icons/Redo.svg Parādīt failu


packages/www/public/icons/Trash.svg → www/public/icons/Trash.svg Parādīt failu


packages/www/public/icons/Undo.svg → www/public/icons/Undo.svg Parādīt failu


packages/www/public/icons/grab.svg → www/public/icons/grab.svg Parādīt failu


packages/www/public/icons/pointer.svg → www/public/icons/pointer.svg Parādīt failu


packages/www/public/icons/resize.svg → www/public/icons/resize.svg Parādīt failu


packages/www/public/images/hello.mp4 → www/public/images/hello.mp4 Parādīt failu


packages/www/public/manifest.json → www/public/manifest.json Parādīt failu


+ 2
- 0
www/public/sw.js
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 1
- 0
www/public/sw.js.map
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


packages/www/public/vercel.svg → www/public/vercel.svg Parādīt failu


www/public/workbox-a6b3f14f.js
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 1
- 0
www/public/workbox-a6b3f14f.js.map
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


packages/www/public/worker-7ryd46WBzPy7BjiSHTKb0.js → www/public/worker-zTyDOkV9qnCPfL6KDOfO4.js Parādīt failu


packages/www/styles/globals.css → www/styles/globals.css Parādīt failu


packages/www/styles/index.ts → www/styles/index.ts Parādīt failu


packages/www/styles/stitches.config.ts → www/styles/stitches.config.ts Parādīt failu


packages/www/tsconfig.json → www/tsconfig.json Parādīt failu

@@ -2,11 +2,7 @@
2 2
   "compilerOptions": {
3 3
     "composite": true,
4 4
     "target": "es5",
5
-    "lib": [
6
-      "dom",
7
-      "dom.iterable",
8
-      "esnext"
9
-    ],
5
+    "lib": ["dom", "dom.iterable", "esnext"],
10 6
     "allowJs": true,
11 7
     "skipLibCheck": true,
12 8
     "strict": false,
@@ -20,27 +16,17 @@
20 16
     "baseUrl": ".",
21 17
     "rootDir": ".",
22 18
     "paths": {
23
-      "-*": [
24
-        "./*"
25
-      ],
26
-      "@tldraw/tldraw": [
27
-        "../tldraw"
28
-      ]
19
+      "-*": ["./*"],
20
+      "@tldraw/tldraw": ["../packages/tldraw"]
29 21
     },
30 22
     "incremental": true,
31 23
     "resolveJsonModule": true
32 24
   },
33
-  "include": [
34
-    "next-env.d.ts",
35
-    "**/*.ts",
36
-    "**/*.tsx"
37
-  ],
38
-  "exclude": [
39
-    "node_modules"
40
-  ],
25
+  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
26
+  "exclude": ["node_modules"],
41 27
   "references": [
42 28
     {
43
-      "path": "../tldraw"
29
+      "path": "../packages/tldraw"
44 30
     }
45 31
   ]
46 32
 }

packages/www/utils/gtag.ts → www/utils/gtag.ts Parādīt failu


packages/www/utils/sentry.ts → www/utils/sentry.ts Parādīt failu


packages/www/utils/useGtag.ts → www/utils/useGtag.ts Parādīt failu


packages/www/worker/index.js → www/worker/index.js Parādīt failu


+ 910
- 830
yarn.lock
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


Notiek ielāde…
Atcelt
Saglabāt