Compare commits
195 Commits
jazz-nodej
...
jazz-react
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ba5ea684e | ||
|
|
105b240076 | ||
|
|
097dd8a646 | ||
|
|
138dd7ee8b | ||
|
|
5b17085b30 | ||
|
|
cb7bdffabe | ||
|
|
90892523da | ||
|
|
693a058890 | ||
|
|
4d20f1bcfc | ||
|
|
36bf3924ff | ||
|
|
6b6fc8b31a | ||
|
|
1649f06667 | ||
|
|
e9bd290dec | ||
|
|
9d76292db5 | ||
|
|
66373bade3 | ||
|
|
40118a0b2c | ||
|
|
86b57415b8 | ||
|
|
cdbc37a144 | ||
|
|
e996c71e83 | ||
|
|
0f704a2330 | ||
|
|
2f206e7613 | ||
|
|
761759c893 | ||
|
|
15c57e24ad | ||
|
|
580e2577c9 | ||
|
|
3804198c02 | ||
|
|
537d56a30e | ||
|
|
5524d3e0cb | ||
|
|
3d2682e3a7 | ||
|
|
0c131f3af4 | ||
|
|
fada6b0eb5 | ||
|
|
c8b94475cd | ||
|
|
162a024345 | ||
|
|
7cd195b3a4 | ||
|
|
ccad5a3c70 | ||
|
|
4268d189cb | ||
|
|
d48712986f | ||
|
|
ba2fda5de1 | ||
|
|
b1d26f23d6 | ||
|
|
e7766746d9 | ||
|
|
7c64d104a6 | ||
|
|
1870a1268a | ||
|
|
a8222368d0 | ||
|
|
72d11ce003 | ||
|
|
5fbf9770d2 | ||
|
|
707dedb33e | ||
|
|
86d42d9e49 | ||
|
|
64f01915f4 | ||
|
|
9a8fd2ce47 | ||
|
|
4dc7cdb4e6 | ||
|
|
84b993944d | ||
|
|
fa064443a0 | ||
|
|
32e9678394 | ||
|
|
b1850efd7f | ||
|
|
922e3c8244 | ||
|
|
1c063455d1 | ||
|
|
35abeba323 | ||
|
|
84f623097f | ||
|
|
73015a3438 | ||
|
|
7c3bf78fef | ||
|
|
68cb6064a5 | ||
|
|
992d5e572e | ||
|
|
c75a3042ce | ||
|
|
fa8b20899d | ||
|
|
f24cad1909 | ||
|
|
8b2df0e5e2 | ||
|
|
f93222079f | ||
|
|
514f4c9a72 | ||
|
|
d5daf060c9 | ||
|
|
604cd4e3a9 | ||
|
|
3446b38f69 | ||
|
|
de12b03d3f | ||
|
|
c3db5cf0b5 | ||
|
|
e7f2521b41 | ||
|
|
0c6cd571c9 | ||
|
|
e1d56a45f7 | ||
|
|
e40e01fce0 | ||
|
|
d70343d864 | ||
|
|
160ab768e9 | ||
|
|
4ff03f67d9 | ||
|
|
5a81adffec | ||
|
|
f4fdb3c14e | ||
|
|
d001144a87 | ||
|
|
ded473b75e | ||
|
|
602c34b0f2 | ||
|
|
77cf06945a | ||
|
|
61f39bb56f | ||
|
|
7cc51b77f3 | ||
|
|
bf303d58e3 | ||
|
|
def5c474e6 | ||
|
|
c81dca23ad | ||
|
|
b470f63f86 | ||
|
|
5c7072bf6e | ||
|
|
bd62b1342a | ||
|
|
af314e8584 | ||
|
|
8ad1878f86 | ||
|
|
2fe5cd1326 | ||
|
|
2ae0b8df0d | ||
|
|
77dc51d466 | ||
|
|
bd645db4cc | ||
|
|
af46c68a4a | ||
|
|
fb58cb9299 | ||
|
|
b3605c0c22 | ||
|
|
63fb80e50d | ||
|
|
133b8abcbe | ||
|
|
e272849026 | ||
|
|
c4fdfeaa48 | ||
|
|
3f0859c3f2 | ||
|
|
6e286bac7e | ||
|
|
235aab15b6 | ||
|
|
a440121ac9 | ||
|
|
6209bd2285 | ||
|
|
8ad9fc57cc | ||
|
|
a763b947b8 | ||
|
|
026a26da3c | ||
|
|
d8d1addf2b | ||
|
|
937a34c76e | ||
|
|
c6142a1f64 | ||
|
|
f3fb2dee52 | ||
|
|
15996ced64 | ||
|
|
9fb98e2114 | ||
|
|
f55f779ea1 | ||
|
|
18c98fc3f5 | ||
|
|
41b286b672 | ||
|
|
3c97e8e7f2 | ||
|
|
7996a2aa9c | ||
|
|
ba944c20ed | ||
|
|
0b89fadfdd | ||
|
|
1e50cebf55 | ||
|
|
ca8c5c0b02 | ||
|
|
a0aa261cab | ||
|
|
5d3d11e87c | ||
|
|
4a9ed21ea2 | ||
|
|
2ddfc9d92b | ||
|
|
a032fda936 | ||
|
|
c6fb8dc845 | ||
|
|
bf399d72c1 | ||
|
|
60fefe8158 | ||
|
|
9be66e196c | ||
|
|
04d96e52e0 | ||
|
|
5b483dac6f | ||
|
|
fadb4bf76e | ||
|
|
98a25b1fd6 | ||
|
|
69499e3965 | ||
|
|
d67ced14c4 | ||
|
|
95ae69ead2 | ||
|
|
4170f13858 | ||
|
|
45e4a77afb | ||
|
|
603538e255 | ||
|
|
afb49f3666 | ||
|
|
c6de2ce8b8 | ||
|
|
cdc4229df7 | ||
|
|
fa19f7471f | ||
|
|
75f3af2cc1 | ||
|
|
5ae77ee57e | ||
|
|
6df5d72dfd | ||
|
|
b91b33e9be | ||
|
|
fd7226585b | ||
|
|
712b67b782 | ||
|
|
88ea30a6f8 | ||
|
|
f4cbe395d5 | ||
|
|
c59fb5dc1f | ||
|
|
c712ef28e8 | ||
|
|
c62a4a1c69 | ||
|
|
87a7cf202f | ||
|
|
9a9b424ff2 | ||
|
|
dfe6146aa3 | ||
|
|
8b26728914 | ||
|
|
f5003ac8ec | ||
|
|
ee71ba99e2 | ||
|
|
56c7a2dda2 | ||
|
|
d28ce598e2 | ||
|
|
e050f17945 | ||
|
|
14475991c8 | ||
|
|
15d9ec4b38 | ||
|
|
f911545ae3 | ||
|
|
ad71530cc0 | ||
|
|
c33c02691f | ||
|
|
51c19770a8 | ||
|
|
5c2c7d4188 | ||
|
|
334d27d53d | ||
|
|
a5396a42ce | ||
|
|
8a60897086 | ||
|
|
5cfe38d547 | ||
|
|
3f7aa34726 | ||
|
|
008750d401 | ||
|
|
72708f82ea | ||
|
|
30f65f1c91 | ||
|
|
67d55ce0ee | ||
|
|
e887f37713 | ||
|
|
82a515d493 | ||
|
|
bd94012507 | ||
|
|
e1dbab1517 | ||
|
|
dafea6039b | ||
|
|
ccc5f89ed7 | ||
|
|
06db1dd423 |
@@ -1,5 +1,47 @@
|
|||||||
# chat-rn-expo-clerk
|
# chat-rn-expo-clerk
|
||||||
|
|
||||||
|
## 1.0.110
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-expo@0.13.18
|
||||||
|
- jazz-react-native-media-images@0.13.18
|
||||||
|
|
||||||
|
## 1.0.109
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
- jazz-react-native-media-images@0.13.17
|
||||||
|
|
||||||
|
## 1.0.108
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
- jazz-react-native-media-images@0.13.16
|
||||||
|
|
||||||
|
## 1.0.107
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
- jazz-react-native-media-images@0.13.15
|
||||||
|
|
||||||
|
## 1.0.106
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bd94012]
|
||||||
|
- jazz-expo@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
- jazz-react-native-media-images@0.13.14
|
||||||
|
|
||||||
## 1.0.105
|
## 1.0.105
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn-expo-clerk",
|
"name": "chat-rn-expo-clerk",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"version": "1.0.105",
|
"version": "1.0.110",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "expo export -p ios",
|
"build": "expo export -p ios",
|
||||||
"start": "expo start",
|
"start": "expo start",
|
||||||
|
|||||||
@@ -1,5 +1,42 @@
|
|||||||
# chat-rn-expo
|
# chat-rn-expo
|
||||||
|
|
||||||
|
## 1.0.97
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-expo@0.13.18
|
||||||
|
|
||||||
|
## 1.0.96
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 1.0.95
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 1.0.94
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 1.0.93
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bd94012]
|
||||||
|
- jazz-expo@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 1.0.92
|
## 1.0.92
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn-expo",
|
"name": "chat-rn-expo",
|
||||||
"version": "1.0.92",
|
"version": "1.0.97",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "expo export -p ios",
|
"build": "expo export -p ios",
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ appId: com.jazz.chatrn
|
|||||||
# - tapOn: "Reload"
|
# - tapOn: "Reload"
|
||||||
|
|
||||||
# login
|
# login
|
||||||
|
- assertVisible: "Logout"
|
||||||
|
- tapOn: "Logout"
|
||||||
- assertVisible: "Anonymous user"
|
- assertVisible: "Anonymous user"
|
||||||
- runFlow:
|
- runFlow:
|
||||||
label: "Erase existing username"
|
label: "Erase existing username"
|
||||||
|
|||||||
@@ -1,5 +1,60 @@
|
|||||||
# chat-rn
|
# chat-rn
|
||||||
|
|
||||||
|
## 1.0.105
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [9089252]
|
||||||
|
- Updated dependencies [b470f63]
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- Updated dependencies [66373ba]
|
||||||
|
- Updated dependencies [f24cad1]
|
||||||
|
- cojson@0.13.18
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- cojson-transport-ws@0.13.18
|
||||||
|
- jazz-react-native@0.13.18
|
||||||
|
|
||||||
|
## 1.0.104
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [9fb98e2]
|
||||||
|
- Updated dependencies [0b89fad]
|
||||||
|
- cojson@0.13.17
|
||||||
|
- cojson-transport-ws@0.13.17
|
||||||
|
- jazz-react-native@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 1.0.103
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c6fb8dc]
|
||||||
|
- cojson@0.13.16
|
||||||
|
- cojson-transport-ws@0.13.16
|
||||||
|
- jazz-react-native@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 1.0.102
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c712ef2]
|
||||||
|
- cojson@0.13.15
|
||||||
|
- cojson-transport-ws@0.13.15
|
||||||
|
- jazz-react-native@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 1.0.101
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5c2c7d4]
|
||||||
|
- cojson@0.13.14
|
||||||
|
- cojson-transport-ws@0.13.14
|
||||||
|
- jazz-react-native@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 1.0.100
|
## 1.0.100
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn",
|
"name": "chat-rn",
|
||||||
"version": "1.0.100",
|
"version": "1.0.105",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"android": "react-native run-android",
|
"android": "react-native run-android",
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# chat-vue
|
# chat-vue
|
||||||
|
|
||||||
|
## 0.0.89
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-browser@0.13.18
|
||||||
|
- jazz-vue@0.13.18
|
||||||
|
|
||||||
|
## 0.0.88
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
- jazz-vue@0.13.17
|
||||||
|
|
||||||
|
## 0.0.87
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
- jazz-vue@0.13.16
|
||||||
|
|
||||||
|
## 0.0.86
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
- jazz-vue@0.13.15
|
||||||
|
|
||||||
|
## 0.0.85
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
- jazz-vue@0.13.14
|
||||||
|
|
||||||
## 0.0.84
|
## 0.0.84
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-vue",
|
"name": "chat-vue",
|
||||||
"version": "0.0.84",
|
"version": "0.0.89",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# jazz-example-chat
|
# jazz-example-chat
|
||||||
|
|
||||||
|
## 0.0.187
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-inspector@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.186
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.17
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.185
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.16
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.184
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.15
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.183
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.14
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.182
|
## 0.0.182
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-chat",
|
"name": "jazz-example-chat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.182",
|
"version": "0.0.187",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# minimal-auth-clerk
|
# minimal-auth-clerk
|
||||||
|
|
||||||
|
## 0.0.86
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
- jazz-react-auth-clerk@0.13.18
|
||||||
|
|
||||||
|
## 0.0.85
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-react-auth-clerk@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.84
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-react-auth-clerk@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.83
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-react-auth-clerk@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-react-auth-clerk@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.81
|
## 0.0.81
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "clerk",
|
"name": "clerk",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.81",
|
"version": "0.0.86",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# file-share-svelte
|
# file-share-svelte
|
||||||
|
|
||||||
|
## 0.0.69
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-svelte@0.13.18
|
||||||
|
|
||||||
|
## 0.0.68
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.67
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.66
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.65
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.64
|
## 0.0.64
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "file-share-svelte",
|
"name": "file-share-svelte",
|
||||||
"version": "0.0.64",
|
"version": "0.0.69",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
const fileId = file._refs.file.id;
|
const fileId = file._refs.file.id;
|
||||||
|
|
||||||
// Load the file as a blob, can take a while
|
// Load the file as a blob, can take a while
|
||||||
const blob = await FileStream.loadAsBlob(fileId, me, {});
|
const blob = await FileStream.loadAsBlob(fileId);
|
||||||
if (!blob) {
|
if (!blob) {
|
||||||
toast.error('Failed to download file');
|
toast.error('Failed to download file');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,48 +1,26 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { useAccount, useCoState } from 'jazz-svelte';
|
import { useAccount, useCoState } from 'jazz-svelte';
|
||||||
import { SharedFile, ListOfSharedFiles } from '$lib/schema';
|
import { SharedFile, ListOfSharedFiles } from '$lib/schema';
|
||||||
import { createInviteLink } from 'jazz-svelte';
|
|
||||||
import { FileStream } from 'jazz-tools';
|
import { FileStream } from 'jazz-tools';
|
||||||
import FileItem from '$lib/components/FileItem.svelte';
|
import FileItem from '$lib/components/FileItem.svelte';
|
||||||
import { SvelteMap } from 'svelte/reactivity';
|
|
||||||
import { generateTempFileId } from '$lib/utils';
|
|
||||||
import { CloudUpload } from 'lucide-svelte';
|
import { CloudUpload } from 'lucide-svelte';
|
||||||
|
|
||||||
const { me, logOut } = useAccount();
|
const { me, logOut } = useAccount();
|
||||||
|
|
||||||
const mySharedFilesId = me?.root?._refs.sharedFiles.id;
|
const mySharedFilesId = me?.root?._refs.sharedFiles.id;
|
||||||
const sharedFiles = $derived(useCoState(ListOfSharedFiles, mySharedFilesId, [{}]));
|
const sharedFiles = $derived(useCoState(ListOfSharedFiles, mySharedFilesId));
|
||||||
|
|
||||||
let fileInput: HTMLInputElement;
|
let fileInput: HTMLInputElement;
|
||||||
|
|
||||||
type PendingSharedFile = {
|
|
||||||
name: string;
|
|
||||||
id: string;
|
|
||||||
createdAt: Date;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Track files that are currently uploading
|
|
||||||
const uploadingFiles = new SvelteMap<string, PendingSharedFile>();
|
|
||||||
|
|
||||||
async function handleFileUpload(event: Event) {
|
async function handleFileUpload(event: Event) {
|
||||||
const input = event.target as HTMLInputElement;
|
const input = event.target as HTMLInputElement;
|
||||||
const files = input.files;
|
const files = input.files;
|
||||||
|
|
||||||
if (!files || !files.length || !me.root?.sharedFiles || !me.root.publicGroup) return;
|
if (!files || !files.length || !me?.root?.sharedFiles || !me?.root?.publicGroup) return;
|
||||||
|
|
||||||
const file = files[0];
|
const file = files[0];
|
||||||
const fileName = file.name;
|
const fileName = file.name;
|
||||||
const createdAt = new Date();
|
const createdAt = new Date();
|
||||||
const fileId = generateTempFileId(fileName, createdAt);
|
|
||||||
|
|
||||||
const tempFile: PendingSharedFile = {
|
|
||||||
name: fileName,
|
|
||||||
id: fileId,
|
|
||||||
createdAt
|
|
||||||
};
|
|
||||||
|
|
||||||
// Add to uploading files
|
|
||||||
uploadingFiles.set(fileId, tempFile);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ownership = { owner: me.root.publicGroup };
|
const ownership = { owner: me.root.publicGroup };
|
||||||
@@ -65,17 +43,10 @@
|
|||||||
// Add the file to the user's files list
|
// Add the file to the user's files list
|
||||||
me.root.sharedFiles.push(sharedFile);
|
me.root.sharedFiles.push(sharedFile);
|
||||||
} finally {
|
} finally {
|
||||||
uploadingFiles.delete(fileId);
|
|
||||||
fileInput.value = ''; // reset input
|
fileInput.value = ''; // reset input
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function shareFile(file: SharedFile) {
|
|
||||||
const inviteLink = createInviteLink(file, 'reader');
|
|
||||||
await navigator.clipboard.writeText(inviteLink);
|
|
||||||
alert('Share link copied to clipboard!');
|
|
||||||
}
|
|
||||||
|
|
||||||
async function deleteFile(file: SharedFile) {
|
async function deleteFile(file: SharedFile) {
|
||||||
if (!me?.root?.sharedFiles || !sharedFiles.current) return;
|
if (!me?.root?.sharedFiles || !sharedFiles.current) return;
|
||||||
|
|
||||||
@@ -127,13 +98,11 @@
|
|||||||
<!-- Files List -->
|
<!-- Files List -->
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
{#if sharedFiles.current}
|
{#if sharedFiles.current}
|
||||||
{#if !(sharedFiles.current.length === 0 && uploadingFiles.size === 0)}
|
{#if !(sharedFiles.current.length === 0)}
|
||||||
{#each [...sharedFiles.current, ...uploadingFiles.values()] as file (generateTempFileId(file?.name, file?.createdAt))}
|
{#each sharedFiles.current as file}
|
||||||
{#if file}
|
{#if file}
|
||||||
<FileItem
|
<FileItem
|
||||||
{file}
|
{file}
|
||||||
loading={uploadingFiles.has(generateTempFileId(file?.name, file?.createdAt))}
|
|
||||||
onShare={shareFile}
|
|
||||||
onDelete={deleteFile}
|
onDelete={deleteFile}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# jazz-tailwind-demo-auth-starter
|
# jazz-tailwind-demo-auth-starter
|
||||||
|
|
||||||
|
## 0.0.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-inspector@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.25
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.17
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.16
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.23
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.15
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.22
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.14
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.21
|
## 0.0.21
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "filestream",
|
"name": "filestream",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.21",
|
"version": "0.0.26",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# form
|
# form
|
||||||
|
|
||||||
|
## 0.1.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.1.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.1.25
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.1.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.1.23
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.1.22
|
## 0.1.22
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "form",
|
"name": "form",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.22",
|
"version": "0.1.27",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# image-upload
|
# image-upload
|
||||||
|
|
||||||
|
## 0.0.83
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.81
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.80
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.79
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.78
|
## 0.0.78
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "image-upload",
|
"name": "image-upload",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.78",
|
"version": "0.0.83",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,54 @@
|
|||||||
# jazz-example-inspector
|
# jazz-example-inspector
|
||||||
|
|
||||||
|
## 0.0.137
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [9089252]
|
||||||
|
- Updated dependencies [b470f63]
|
||||||
|
- Updated dependencies [66373ba]
|
||||||
|
- Updated dependencies [f24cad1]
|
||||||
|
- cojson@0.13.18
|
||||||
|
- cojson-transport-ws@0.13.18
|
||||||
|
- jazz-inspector@0.13.18
|
||||||
|
|
||||||
|
## 0.0.136
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [9fb98e2]
|
||||||
|
- Updated dependencies [0b89fad]
|
||||||
|
- cojson@0.13.17
|
||||||
|
- cojson-transport-ws@0.13.17
|
||||||
|
- jazz-inspector@0.13.17
|
||||||
|
|
||||||
|
## 0.0.135
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c6fb8dc]
|
||||||
|
- cojson@0.13.16
|
||||||
|
- cojson-transport-ws@0.13.16
|
||||||
|
- jazz-inspector@0.13.16
|
||||||
|
|
||||||
|
## 0.0.134
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c712ef2]
|
||||||
|
- cojson@0.13.15
|
||||||
|
- cojson-transport-ws@0.13.15
|
||||||
|
- jazz-inspector@0.13.15
|
||||||
|
|
||||||
|
## 0.0.133
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5c2c7d4]
|
||||||
|
- cojson@0.13.14
|
||||||
|
- cojson-transport-ws@0.13.14
|
||||||
|
- jazz-inspector@0.13.14
|
||||||
|
|
||||||
## 0.0.132
|
## 0.0.132
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-inspector-app",
|
"name": "jazz-inspector-app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.132",
|
"version": "0.0.137",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
"dev:worker": "tsx --watch --env-file=.env ./src/worker.ts",
|
"dev:worker": "tsx --watch --env-file=.env ./src/worker.ts",
|
||||||
"build": "vite build && tsc",
|
"build": "vite build && tsc",
|
||||||
"serve": "vite preview",
|
"serve": "vite preview",
|
||||||
"generate-env": "tsx generate-env.ts"
|
"generate-env": "tsx generate-env.ts",
|
||||||
|
"format-and-lint": "biome check .",
|
||||||
|
"format-and-lint:fix": "biome check . --write"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@radix-ui/react-label": "^2.1.2",
|
"@radix-ui/react-label": "^2.1.2",
|
||||||
|
|||||||
1
examples/jazz-paper-scissors/src/apiKey.ts
Normal file
1
examples/jazz-paper-scissors/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const apiKey = "jazz-paper-scissors@garden.co";
|
||||||
@@ -3,6 +3,7 @@ import { StrictMode } from "react";
|
|||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
|
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
import { apiKey } from "@/apiKey.ts";
|
||||||
import { JazzProvider } from "jazz-react";
|
import { JazzProvider } from "jazz-react";
|
||||||
import { App } from "./app";
|
import { App } from "./app";
|
||||||
|
|
||||||
@@ -13,7 +14,7 @@ if (rootElement && !rootElement.innerHTML) {
|
|||||||
<StrictMode>
|
<StrictMode>
|
||||||
<JazzProvider
|
<JazzProvider
|
||||||
sync={{
|
sync={{
|
||||||
peer: "wss://cloud.jazz.tools/?key=jazz-paper-scissors@garden.co",
|
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<JazzInspector />
|
<JazzInspector />
|
||||||
|
|||||||
@@ -10,139 +10,139 @@
|
|||||||
|
|
||||||
// Import Routes
|
// Import Routes
|
||||||
|
|
||||||
import { Route as rootRoute } from "./routes/__root";
|
import { Route as rootRoute } from './routes/__root'
|
||||||
import { Route as AuthenticatedImport } from "./routes/_authenticated";
|
import { Route as AuthenticatedImport } from './routes/_authenticated'
|
||||||
import { Route as IndexImport } from "./routes/index";
|
import { Route as IndexImport } from './routes/index'
|
||||||
import { Route as AuthenticatedWaitingRoomWaitingRoomIdImport } from "./routes/_authenticated/waiting-room.$waitingRoomId";
|
import { Route as AuthenticatedWaitingRoomWaitingRoomIdImport } from './routes/_authenticated/waiting-room.$waitingRoomId'
|
||||||
import { Route as AuthenticatedGameGameIdImport } from "./routes/_authenticated/game.$gameId";
|
import { Route as AuthenticatedGameGameIdImport } from './routes/_authenticated/game.$gameId'
|
||||||
|
|
||||||
// Create/Update Routes
|
// Create/Update Routes
|
||||||
|
|
||||||
const AuthenticatedRoute = AuthenticatedImport.update({
|
const AuthenticatedRoute = AuthenticatedImport.update({
|
||||||
id: "/_authenticated",
|
id: '/_authenticated',
|
||||||
getParentRoute: () => rootRoute,
|
getParentRoute: () => rootRoute,
|
||||||
} as any);
|
} as any)
|
||||||
|
|
||||||
const IndexRoute = IndexImport.update({
|
const IndexRoute = IndexImport.update({
|
||||||
id: "/",
|
id: '/',
|
||||||
path: "/",
|
path: '/',
|
||||||
getParentRoute: () => rootRoute,
|
getParentRoute: () => rootRoute,
|
||||||
} as any);
|
} as any)
|
||||||
|
|
||||||
const AuthenticatedWaitingRoomWaitingRoomIdRoute =
|
const AuthenticatedWaitingRoomWaitingRoomIdRoute =
|
||||||
AuthenticatedWaitingRoomWaitingRoomIdImport.update({
|
AuthenticatedWaitingRoomWaitingRoomIdImport.update({
|
||||||
id: "/waiting-room/$waitingRoomId",
|
id: '/waiting-room/$waitingRoomId',
|
||||||
path: "/waiting-room/$waitingRoomId",
|
path: '/waiting-room/$waitingRoomId',
|
||||||
getParentRoute: () => AuthenticatedRoute,
|
getParentRoute: () => AuthenticatedRoute,
|
||||||
} as any);
|
} as any)
|
||||||
|
|
||||||
const AuthenticatedGameGameIdRoute = AuthenticatedGameGameIdImport.update({
|
const AuthenticatedGameGameIdRoute = AuthenticatedGameGameIdImport.update({
|
||||||
id: "/game/$gameId",
|
id: '/game/$gameId',
|
||||||
path: "/game/$gameId",
|
path: '/game/$gameId',
|
||||||
getParentRoute: () => AuthenticatedRoute,
|
getParentRoute: () => AuthenticatedRoute,
|
||||||
} as any);
|
} as any)
|
||||||
|
|
||||||
// Populate the FileRoutesByPath interface
|
// Populate the FileRoutesByPath interface
|
||||||
|
|
||||||
declare module "@tanstack/react-router" {
|
declare module '@tanstack/react-router' {
|
||||||
interface FileRoutesByPath {
|
interface FileRoutesByPath {
|
||||||
"/": {
|
'/': {
|
||||||
id: "/";
|
id: '/'
|
||||||
path: "/";
|
path: '/'
|
||||||
fullPath: "/";
|
fullPath: '/'
|
||||||
preLoaderRoute: typeof IndexImport;
|
preLoaderRoute: typeof IndexImport
|
||||||
parentRoute: typeof rootRoute;
|
parentRoute: typeof rootRoute
|
||||||
};
|
}
|
||||||
"/_authenticated": {
|
'/_authenticated': {
|
||||||
id: "/_authenticated";
|
id: '/_authenticated'
|
||||||
path: "";
|
path: ''
|
||||||
fullPath: "";
|
fullPath: ''
|
||||||
preLoaderRoute: typeof AuthenticatedImport;
|
preLoaderRoute: typeof AuthenticatedImport
|
||||||
parentRoute: typeof rootRoute;
|
parentRoute: typeof rootRoute
|
||||||
};
|
}
|
||||||
"/_authenticated/game/$gameId": {
|
'/_authenticated/game/$gameId': {
|
||||||
id: "/_authenticated/game/$gameId";
|
id: '/_authenticated/game/$gameId'
|
||||||
path: "/game/$gameId";
|
path: '/game/$gameId'
|
||||||
fullPath: "/game/$gameId";
|
fullPath: '/game/$gameId'
|
||||||
preLoaderRoute: typeof AuthenticatedGameGameIdImport;
|
preLoaderRoute: typeof AuthenticatedGameGameIdImport
|
||||||
parentRoute: typeof AuthenticatedImport;
|
parentRoute: typeof AuthenticatedImport
|
||||||
};
|
}
|
||||||
"/_authenticated/waiting-room/$waitingRoomId": {
|
'/_authenticated/waiting-room/$waitingRoomId': {
|
||||||
id: "/_authenticated/waiting-room/$waitingRoomId";
|
id: '/_authenticated/waiting-room/$waitingRoomId'
|
||||||
path: "/waiting-room/$waitingRoomId";
|
path: '/waiting-room/$waitingRoomId'
|
||||||
fullPath: "/waiting-room/$waitingRoomId";
|
fullPath: '/waiting-room/$waitingRoomId'
|
||||||
preLoaderRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdImport;
|
preLoaderRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdImport
|
||||||
parentRoute: typeof AuthenticatedImport;
|
parentRoute: typeof AuthenticatedImport
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create and export the route tree
|
// Create and export the route tree
|
||||||
|
|
||||||
interface AuthenticatedRouteChildren {
|
interface AuthenticatedRouteChildren {
|
||||||
AuthenticatedGameGameIdRoute: typeof AuthenticatedGameGameIdRoute;
|
AuthenticatedGameGameIdRoute: typeof AuthenticatedGameGameIdRoute
|
||||||
AuthenticatedWaitingRoomWaitingRoomIdRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdRoute;
|
AuthenticatedWaitingRoomWaitingRoomIdRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
|
||||||
}
|
}
|
||||||
|
|
||||||
const AuthenticatedRouteChildren: AuthenticatedRouteChildren = {
|
const AuthenticatedRouteChildren: AuthenticatedRouteChildren = {
|
||||||
AuthenticatedGameGameIdRoute: AuthenticatedGameGameIdRoute,
|
AuthenticatedGameGameIdRoute: AuthenticatedGameGameIdRoute,
|
||||||
AuthenticatedWaitingRoomWaitingRoomIdRoute:
|
AuthenticatedWaitingRoomWaitingRoomIdRoute:
|
||||||
AuthenticatedWaitingRoomWaitingRoomIdRoute,
|
AuthenticatedWaitingRoomWaitingRoomIdRoute,
|
||||||
};
|
}
|
||||||
|
|
||||||
const AuthenticatedRouteWithChildren = AuthenticatedRoute._addFileChildren(
|
const AuthenticatedRouteWithChildren = AuthenticatedRoute._addFileChildren(
|
||||||
AuthenticatedRouteChildren,
|
AuthenticatedRouteChildren,
|
||||||
);
|
)
|
||||||
|
|
||||||
export interface FileRoutesByFullPath {
|
export interface FileRoutesByFullPath {
|
||||||
"/": typeof IndexRoute;
|
'/': typeof IndexRoute
|
||||||
"": typeof AuthenticatedRouteWithChildren;
|
'': typeof AuthenticatedRouteWithChildren
|
||||||
"/game/$gameId": typeof AuthenticatedGameGameIdRoute;
|
'/game/$gameId': typeof AuthenticatedGameGameIdRoute
|
||||||
"/waiting-room/$waitingRoomId": typeof AuthenticatedWaitingRoomWaitingRoomIdRoute;
|
'/waiting-room/$waitingRoomId': typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FileRoutesByTo {
|
export interface FileRoutesByTo {
|
||||||
"/": typeof IndexRoute;
|
'/': typeof IndexRoute
|
||||||
"": typeof AuthenticatedRouteWithChildren;
|
'': typeof AuthenticatedRouteWithChildren
|
||||||
"/game/$gameId": typeof AuthenticatedGameGameIdRoute;
|
'/game/$gameId': typeof AuthenticatedGameGameIdRoute
|
||||||
"/waiting-room/$waitingRoomId": typeof AuthenticatedWaitingRoomWaitingRoomIdRoute;
|
'/waiting-room/$waitingRoomId': typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FileRoutesById {
|
export interface FileRoutesById {
|
||||||
__root__: typeof rootRoute;
|
__root__: typeof rootRoute
|
||||||
"/": typeof IndexRoute;
|
'/': typeof IndexRoute
|
||||||
"/_authenticated": typeof AuthenticatedRouteWithChildren;
|
'/_authenticated': typeof AuthenticatedRouteWithChildren
|
||||||
"/_authenticated/game/$gameId": typeof AuthenticatedGameGameIdRoute;
|
'/_authenticated/game/$gameId': typeof AuthenticatedGameGameIdRoute
|
||||||
"/_authenticated/waiting-room/$waitingRoomId": typeof AuthenticatedWaitingRoomWaitingRoomIdRoute;
|
'/_authenticated/waiting-room/$waitingRoomId': typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FileRouteTypes {
|
export interface FileRouteTypes {
|
||||||
fileRoutesByFullPath: FileRoutesByFullPath;
|
fileRoutesByFullPath: FileRoutesByFullPath
|
||||||
fullPaths: "/" | "" | "/game/$gameId" | "/waiting-room/$waitingRoomId";
|
fullPaths: '/' | '' | '/game/$gameId' | '/waiting-room/$waitingRoomId'
|
||||||
fileRoutesByTo: FileRoutesByTo;
|
fileRoutesByTo: FileRoutesByTo
|
||||||
to: "/" | "" | "/game/$gameId" | "/waiting-room/$waitingRoomId";
|
to: '/' | '' | '/game/$gameId' | '/waiting-room/$waitingRoomId'
|
||||||
id:
|
id:
|
||||||
| "__root__"
|
| '__root__'
|
||||||
| "/"
|
| '/'
|
||||||
| "/_authenticated"
|
| '/_authenticated'
|
||||||
| "/_authenticated/game/$gameId"
|
| '/_authenticated/game/$gameId'
|
||||||
| "/_authenticated/waiting-room/$waitingRoomId";
|
| '/_authenticated/waiting-room/$waitingRoomId'
|
||||||
fileRoutesById: FileRoutesById;
|
fileRoutesById: FileRoutesById
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RootRouteChildren {
|
export interface RootRouteChildren {
|
||||||
IndexRoute: typeof IndexRoute;
|
IndexRoute: typeof IndexRoute
|
||||||
AuthenticatedRoute: typeof AuthenticatedRouteWithChildren;
|
AuthenticatedRoute: typeof AuthenticatedRouteWithChildren
|
||||||
}
|
}
|
||||||
|
|
||||||
const rootRouteChildren: RootRouteChildren = {
|
const rootRouteChildren: RootRouteChildren = {
|
||||||
IndexRoute: IndexRoute,
|
IndexRoute: IndexRoute,
|
||||||
AuthenticatedRoute: AuthenticatedRouteWithChildren,
|
AuthenticatedRoute: AuthenticatedRouteWithChildren,
|
||||||
};
|
}
|
||||||
|
|
||||||
export const routeTree = rootRoute
|
export const routeTree = rootRoute
|
||||||
._addFileChildren(rootRouteChildren)
|
._addFileChildren(rootRouteChildren)
|
||||||
._addFileTypes<FileRouteTypes>();
|
._addFileTypes<FileRouteTypes>()
|
||||||
|
|
||||||
/* ROUTE_MANIFEST_START
|
/* ROUTE_MANIFEST_START
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export const Route = createFileRoute("/_authenticated/game/$gameId")({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function RouteComponent() {
|
function RouteComponent() {
|
||||||
const { gameId, me, loaderGame } = Route.useLoaderData();
|
const { gameId, loaderGame } = Route.useLoaderData();
|
||||||
|
|
||||||
const isPlayer1 = loaderGame.player1?.account?.isMe;
|
const isPlayer1 = loaderGame.player1?.account?.isMe;
|
||||||
const player = isPlayer1 ? "player1" : "player2";
|
const player = isPlayer1 ? "player1" : "player2";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Account, CoMap, SchemaUnion, co } from "jazz-tools";
|
import { Account, CoMap, co } from "jazz-tools";
|
||||||
|
|
||||||
export class Game extends CoMap {
|
export class Game extends CoMap {
|
||||||
player1 = co.ref(Player);
|
player1 = co.ref(Player);
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# multi-cursors
|
# multi-cursors
|
||||||
|
|
||||||
|
## 0.0.79
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.78
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.77
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.76
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.75
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.74
|
## 0.0.74
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-cursors",
|
"name": "multi-cursors",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.74",
|
"version": "0.0.79",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# multiauth
|
# multiauth
|
||||||
|
|
||||||
|
## 0.0.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
- jazz-react-auth-clerk@0.13.18
|
||||||
|
|
||||||
|
## 0.0.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-react-auth-clerk@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.25
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-react-auth-clerk@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-react-auth-clerk@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.23
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-react-auth-clerk@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.22
|
## 0.0.22
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "multiauth",
|
"name": "multiauth",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.22",
|
"version": "0.0.27",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# jazz-example-musicplayer
|
# jazz-example-musicplayer
|
||||||
|
|
||||||
|
## 0.0.108
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-inspector@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.107
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.17
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.106
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.16
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.105
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.15
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.104
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.14
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.103
|
## 0.0.103
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-music-player",
|
"name": "jazz-example-music-player",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.103",
|
"version": "0.0.108",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# organization
|
# organization
|
||||||
|
|
||||||
|
## 0.0.79
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.78
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.77
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.76
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.75
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.74
|
## 0.0.74
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "organization",
|
"name": "organization",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.74",
|
"version": "0.0.79",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# passkey-svelte
|
# passkey-svelte
|
||||||
|
|
||||||
|
## 0.0.73
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-svelte@0.13.18
|
||||||
|
|
||||||
|
## 0.0.72
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.71
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.70
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.69
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.68
|
## 0.0.68
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "passkey-svelte",
|
"name": "passkey-svelte",
|
||||||
"version": "0.0.68",
|
"version": "0.0.73",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# minimal-auth-passkey
|
# minimal-auth-passkey
|
||||||
|
|
||||||
|
## 0.0.84
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.83
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.81
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.80
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.79
|
## 0.0.79
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "passkey",
|
"name": "passkey",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.79",
|
"version": "0.0.84",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# passphrase
|
# passphrase
|
||||||
|
|
||||||
|
## 0.0.81
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.80
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.79
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.78
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.77
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.76
|
## 0.0.76
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "passphrase",
|
"name": "passphrase",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.76",
|
"version": "0.0.81",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# jazz-password-manager
|
# jazz-password-manager
|
||||||
|
|
||||||
|
## 0.0.105
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.104
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.103
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.102
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.101
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.100
|
## 0.0.100
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-password-manager",
|
"name": "jazz-password-manager",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.100",
|
"version": "0.0.105",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# jazz-example-pets
|
# jazz-example-pets
|
||||||
|
|
||||||
|
## 0.0.203
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.202
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.201
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.200
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.199
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.198
|
## 0.0.198
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-pets",
|
"name": "jazz-example-pets",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.198",
|
"version": "0.0.203",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# reactions
|
# reactions
|
||||||
|
|
||||||
|
## 0.0.83
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.81
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.80
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.79
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.78
|
## 0.0.78
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "reactions",
|
"name": "reactions",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.78",
|
"version": "0.0.83",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,48 @@
|
|||||||
# richtext
|
# richtext
|
||||||
|
|
||||||
|
## 0.0.73
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- Updated dependencies [133b8ab]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-richtext-prosemirror@0.1.7
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.72
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [133b8ab]
|
||||||
|
- jazz-richtext-prosemirror@0.1.6
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.71
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
- jazz-richtext-prosemirror@0.1.5
|
||||||
|
|
||||||
|
## 0.0.70
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
- jazz-richtext-prosemirror@0.1.4
|
||||||
|
|
||||||
|
## 0.0.69
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
- jazz-richtext-prosemirror@0.1.3
|
||||||
|
|
||||||
## 0.0.68
|
## 0.0.68
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
A demonstration of collaborative rich text editing with Jazz, React, and ProseMirror.
|
A demonstration of collaborative rich text editing with Jazz, React, and ProseMirror.
|
||||||
|
|
||||||
|
Live version: [https://richtext-demo.jazz.tools](https://richtext-demo.jazz.tools)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This example shows how to implement collaborative rich text editing using:
|
This example shows how to implement collaborative rich text editing using:
|
||||||
@@ -16,23 +18,52 @@ The example features:
|
|||||||
- Side-by-side plaintext and rich text editors
|
- Side-by-side plaintext and rich text editors
|
||||||
- Real-time collaboration across devices
|
- Real-time collaboration across devices
|
||||||
- Persistent document storage
|
- Persistent document storage
|
||||||
|
## Getting started
|
||||||
|
|
||||||
## Running locally
|
You can either
|
||||||
|
1. Clone the jazz repository, and run the app within the monorepo.
|
||||||
|
2. Or create a new Jazz project using this example as a template.
|
||||||
|
|
||||||
Install dependencies:
|
|
||||||
|
|
||||||
|
### Using the example as a template
|
||||||
|
|
||||||
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm i
|
npx create-jazz-app@latest richtext-app --example richtext
|
||||||
# or
|
|
||||||
yarn
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, run the development server:
|
Go to the new project directory.
|
||||||
|
```bash
|
||||||
|
cd richtext-app
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the dev server.
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
npm run dev
|
||||||
# or
|
```
|
||||||
yarn dev
|
|
||||||
|
### Using the monorepo
|
||||||
|
|
||||||
|
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
|
||||||
|
|
||||||
|
Clone the jazz repository.
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/garden-co/jazz.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Install and build dependencies.
|
||||||
|
```bash
|
||||||
|
pnpm i && npx turbo build
|
||||||
|
```
|
||||||
|
|
||||||
|
Go to the example directory.
|
||||||
|
```bash
|
||||||
|
cd jazz/examples/richtext/
|
||||||
|
```
|
||||||
|
|
||||||
|
Start the dev server.
|
||||||
|
```bash
|
||||||
|
pnpm dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
|
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "richtext",
|
"name": "richtext",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.68",
|
"version": "0.0.73",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
"prosemirror-example-setup": "^1.2.3",
|
"prosemirror-example-setup": "^1.2.3",
|
||||||
"prosemirror-model": "^1.25.0",
|
"prosemirror-model": "^1.25.0",
|
||||||
"prosemirror-schema-basic": "^1.2.4",
|
"prosemirror-schema-basic": "^1.2.4",
|
||||||
|
"prosemirror-schema-list": "^1.5.1",
|
||||||
"prosemirror-state": "^1.4.3",
|
"prosemirror-state": "^1.4.3",
|
||||||
"prosemirror-view": "^1.39.1",
|
"prosemirror-view": "^1.39.1",
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { useAccount } from "jazz-react";
|
import { useAccount } from "jazz-react";
|
||||||
import { createJazzPlugin } from "jazz-richtext-prosemirror";
|
import { createJazzPlugin } from "jazz-richtext-prosemirror";
|
||||||
import { exampleSetup } from "prosemirror-example-setup";
|
import { exampleSetup } from "prosemirror-example-setup";
|
||||||
import { schema } from "prosemirror-schema-basic";
|
import { Schema } from "prosemirror-model";
|
||||||
|
import { schema as basicSchema } from "prosemirror-schema-basic";
|
||||||
|
import { addListNodes } from "prosemirror-schema-list";
|
||||||
import { EditorState } from "prosemirror-state";
|
import { EditorState } from "prosemirror-state";
|
||||||
import { EditorView } from "prosemirror-view";
|
import { EditorView } from "prosemirror-view";
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
@@ -14,6 +16,11 @@ export function Editor() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!me || !editorRef.current || !me.profile.bio) return;
|
if (!me || !editorRef.current || !me.profile.bio) return;
|
||||||
|
|
||||||
|
const schema = new Schema({
|
||||||
|
nodes: addListNodes(basicSchema.spec.nodes, "paragraph block*", "block"),
|
||||||
|
marks: basicSchema.spec.marks,
|
||||||
|
});
|
||||||
|
|
||||||
const setupPlugins = exampleSetup({ schema });
|
const setupPlugins = exampleSetup({ schema });
|
||||||
const jazzPlugin = createJazzPlugin(me.profile.bio);
|
const jazzPlugin = createJazzPlugin(me.profile.bio);
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
.ProseMirror ul {
|
||||||
|
@apply list-disc;
|
||||||
|
}
|
||||||
|
.ProseMirror ol {
|
||||||
|
@apply list-decimal;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# todo-vue
|
# todo-vue
|
||||||
|
|
||||||
|
## 0.0.87
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-browser@0.13.18
|
||||||
|
- jazz-vue@0.13.18
|
||||||
|
|
||||||
|
## 0.0.86
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
- jazz-vue@0.13.17
|
||||||
|
|
||||||
|
## 0.0.85
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
- jazz-vue@0.13.16
|
||||||
|
|
||||||
|
## 0.0.84
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
- jazz-vue@0.13.15
|
||||||
|
|
||||||
|
## 0.0.83
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
- jazz-vue@0.13.14
|
||||||
|
|
||||||
## 0.0.82
|
## 0.0.82
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "todo-vue",
|
"name": "todo-vue",
|
||||||
"version": "0.0.82",
|
"version": "0.0.87",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,41 @@
|
|||||||
# jazz-example-todo
|
# jazz-example-todo
|
||||||
|
|
||||||
|
## 0.0.202
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.201
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.200
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.199
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.198
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.197
|
## 0.0.197
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-todo",
|
"name": "jazz-example-todo",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.197",
|
"version": "0.0.202",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@faker-js/faker": "^9.7.0",
|
||||||
"@radix-ui/react-checkbox": "^1.0.4",
|
"@radix-ui/react-checkbox": "^1.0.4",
|
||||||
"@radix-ui/react-slot": "^1.1.1",
|
"@radix-ui/react-slot": "^1.1.1",
|
||||||
"@radix-ui/react-toast": "^1.1.4",
|
"@radix-ui/react-toast": "^1.1.4",
|
||||||
|
|||||||
@@ -41,12 +41,9 @@ export class TodoAccount extends Account {
|
|||||||
*/
|
*/
|
||||||
migrate() {
|
migrate() {
|
||||||
if (!this._refs.root) {
|
if (!this._refs.root) {
|
||||||
this.root = TodoAccountRoot.create(
|
this.root = TodoAccountRoot.create({
|
||||||
{
|
projects: ListOfProjects.create([]),
|
||||||
projects: ListOfProjects.create([], { owner: this }),
|
});
|
||||||
},
|
|
||||||
{ owner: this },
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import {
|
|||||||
ThemeProvider,
|
ThemeProvider,
|
||||||
TitleAndLogo,
|
TitleAndLogo,
|
||||||
} from "./basicComponents/index.ts";
|
} from "./basicComponents/index.ts";
|
||||||
|
import { TaskGenerator } from "./components/TaskGenerator.tsx";
|
||||||
import { wordlist } from "./wordlist.ts";
|
import { wordlist } from "./wordlist.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,6 +96,10 @@ export default function App() {
|
|||||||
path: "/invite/*",
|
path: "/invite/*",
|
||||||
element: <p>Accepting invite...</p>,
|
element: <p>Accepting invite...</p>,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/generate",
|
||||||
|
element: <TaskGenerator />,
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// `useAcceptInvite()` is a hook that accepts an invite link from the URL hash,
|
// `useAcceptInvite()` is a hook that accepts an invite link from the URL hash,
|
||||||
|
|||||||
@@ -35,7 +35,11 @@ export function ProjectTodoTable() {
|
|||||||
// content - whether we create edits locally, load persisted data, or receive
|
// content - whether we create edits locally, load persisted data, or receive
|
||||||
// sync updates from other devices or participants!
|
// sync updates from other devices or participants!
|
||||||
// It also recursively resolves and subsribes to all referenced CoValues.
|
// It also recursively resolves and subsribes to all referenced CoValues.
|
||||||
const project = useCoState(TodoProject, projectId);
|
const project = useCoState(TodoProject, projectId, {
|
||||||
|
resolve: {
|
||||||
|
tasks: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
// `createTask` is similar to `createProject` we saw earlier, creating a new CoMap
|
// `createTask` is similar to `createProject` we saw earlier, creating a new CoMap
|
||||||
// for a new task (in the same group as the project), and then
|
// for a new task (in the same group as the project), and then
|
||||||
|
|||||||
61
examples/todo/src/components/TaskGenerator.tsx
Normal file
61
examples/todo/src/components/TaskGenerator.tsx
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import { TodoAccount } from "@/1_schema";
|
||||||
|
import { FormEvent, useState } from "react";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { generateRandomProject } from "../generate";
|
||||||
|
|
||||||
|
export function TaskGenerator() {
|
||||||
|
const [isGenerating, setIsGenerating] = useState(false);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const handleSubmit = async (e: FormEvent<HTMLFormElement>) => {
|
||||||
|
e.preventDefault();
|
||||||
|
const formData = new FormData(e.currentTarget);
|
||||||
|
const numTasks = Math.max(
|
||||||
|
1,
|
||||||
|
parseInt(formData.get("numTasks") as string) || 1,
|
||||||
|
);
|
||||||
|
|
||||||
|
setIsGenerating(true);
|
||||||
|
const project = generateRandomProject(numTasks);
|
||||||
|
|
||||||
|
const { root } = await TodoAccount.getMe().ensureLoaded({
|
||||||
|
resolve: {
|
||||||
|
root: {
|
||||||
|
projects: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
root.projects.push(project);
|
||||||
|
|
||||||
|
navigate(`/project/${project.id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="p-4 border rounded-lg shadow-sm bg-white">
|
||||||
|
<h2 className="text-lg font-semibold mb-4">Generate Random Tasks</h2>
|
||||||
|
<form onSubmit={handleSubmit} className="flex flex-col gap-4">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<label htmlFor="numTasks" className="text-sm font-medium">
|
||||||
|
Number of tasks:
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
id="numTasks"
|
||||||
|
name="numTasks"
|
||||||
|
type="number"
|
||||||
|
min="1"
|
||||||
|
defaultValue={5}
|
||||||
|
className="w-20 px-2 py-1 border rounded"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={isGenerating}
|
||||||
|
className="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:bg-blue-300"
|
||||||
|
>
|
||||||
|
{isGenerating ? "Generating..." : "Generate Tasks"}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
25
examples/todo/src/generate.ts
Normal file
25
examples/todo/src/generate.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { faker } from "@faker-js/faker";
|
||||||
|
import { ListOfTasks, Task, TodoProject } from "./1_schema";
|
||||||
|
|
||||||
|
export function generateRandomProject(numTasks: number): TodoProject {
|
||||||
|
// Generate a random project title
|
||||||
|
const projectTitle = faker.company.catchPhrase();
|
||||||
|
|
||||||
|
// Create a list of tasks
|
||||||
|
const tasks = ListOfTasks.create([]);
|
||||||
|
|
||||||
|
// Generate random tasks
|
||||||
|
for (let i = 0; i < numTasks; i++) {
|
||||||
|
const task = Task.create({
|
||||||
|
done: faker.datatype.boolean(),
|
||||||
|
text: faker.lorem.sentence({ min: 3, max: 8 }),
|
||||||
|
});
|
||||||
|
tasks.push(task);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create and return the project
|
||||||
|
return TodoProject.create({
|
||||||
|
title: projectTitle,
|
||||||
|
tasks: tasks,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,5 +1,46 @@
|
|||||||
# version-history
|
# version-history
|
||||||
|
|
||||||
|
## 0.0.81
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [761759c]
|
||||||
|
- jazz-tools@0.13.18
|
||||||
|
- jazz-inspector@0.13.18
|
||||||
|
- jazz-react@0.13.18
|
||||||
|
|
||||||
|
## 0.0.80
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.17
|
||||||
|
- jazz-react@0.13.17
|
||||||
|
- jazz-tools@0.13.17
|
||||||
|
|
||||||
|
## 0.0.79
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.16
|
||||||
|
- jazz-react@0.13.16
|
||||||
|
- jazz-tools@0.13.16
|
||||||
|
|
||||||
|
## 0.0.78
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.15
|
||||||
|
- jazz-react@0.13.15
|
||||||
|
- jazz-tools@0.13.15
|
||||||
|
|
||||||
|
## 0.0.77
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.14
|
||||||
|
- jazz-react@0.13.14
|
||||||
|
- jazz-tools@0.13.14
|
||||||
|
|
||||||
## 0.0.76
|
## 0.0.76
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "version-history",
|
"name": "version-history",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.76",
|
"version": "0.0.81",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import {
|
|||||||
AlertTriangleIcon,
|
AlertTriangleIcon,
|
||||||
ArrowDownIcon,
|
ArrowDownIcon,
|
||||||
ArrowRightIcon,
|
ArrowRightIcon,
|
||||||
|
BoldIcon,
|
||||||
BookTextIcon,
|
BookTextIcon,
|
||||||
BoxIcon,
|
BoxIcon,
|
||||||
BracesIcon,
|
BracesIcon,
|
||||||
@@ -20,6 +21,7 @@ import {
|
|||||||
HashIcon,
|
HashIcon,
|
||||||
ImageIcon,
|
ImageIcon,
|
||||||
InfoIcon,
|
InfoIcon,
|
||||||
|
ItalicIcon,
|
||||||
LinkIcon,
|
LinkIcon,
|
||||||
LockKeyholeIcon,
|
LockKeyholeIcon,
|
||||||
type LucideIcon,
|
type LucideIcon,
|
||||||
@@ -87,6 +89,10 @@ const icons = {
|
|||||||
colist: Brackets,
|
colist: Brackets,
|
||||||
user: UserIcon,
|
user: UserIcon,
|
||||||
group: UsersIcon,
|
group: UsersIcon,
|
||||||
|
|
||||||
|
// text editor icons
|
||||||
|
bold: BoldIcon,
|
||||||
|
italic: ItalicIcon,
|
||||||
};
|
};
|
||||||
|
|
||||||
// copied from tailwind line height https://tailwindcss.com/docs/font-size
|
// copied from tailwind line height https://tailwindcss.com/docs/font-size
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function JazzLogo({
|
|||||||
fillRule="evenodd"
|
fillRule="evenodd"
|
||||||
clipRule="evenodd"
|
clipRule="evenodd"
|
||||||
d="M136.179 44.8277C136.179 44.8277 136.179 44.8277 136.179 44.8276V21.168C117.931 28.5527 97.9854 32.6192 77.0897 32.6192C65.1466 32.6192 53.5138 31.2908 42.331 28.7737V51.4076C42.331 51.4076 42.331 51.4076 42.331 51.4076V81.1508C41.2955 80.4385 40.1568 79.8458 38.9405 79.3915C36.1732 78.358 33.128 78.0876 30.1902 78.6145C27.2524 79.1414 24.5539 80.4419 22.4358 82.3516C20.3178 84.2613 18.8754 86.6944 18.291 89.3433C17.7066 91.9921 18.0066 94.7377 19.1528 97.2329C20.2991 99.728 22.2403 101.861 24.7308 103.361C27.2214 104.862 30.1495 105.662 33.1448 105.662H33.1455C33.6061 105.662 33.8365 105.662 34.0314 105.659C44.5583 105.449 53.042 96.9656 53.2513 86.4386C53.2534 86.3306 53.2544 86.2116 53.2548 86.0486H53.2552V85.7149L53.2552 85.5521V82.0762L53.2552 53.1993C61.0533 54.2324 69.0092 54.7656 77.0897 54.7656C77.6696 54.7656 78.2489 54.7629 78.8276 54.7574V110.696C77.792 109.983 76.6533 109.391 75.437 108.936C72.6697 107.903 69.6246 107.632 66.6867 108.159C63.7489 108.686 61.0504 109.987 58.9323 111.896C56.8143 113.806 55.3719 116.239 54.7875 118.888C54.2032 121.537 54.5031 124.283 55.6494 126.778C56.7956 129.273 58.7368 131.405 61.2273 132.906C63.7179 134.406 66.646 135.207 69.6414 135.207C70.1024 135.207 70.3329 135.207 70.5279 135.203C81.0548 134.994 89.5385 126.51 89.7478 115.983C89.7517 115.788 89.7517 115.558 89.7517 115.097V111.621L89.7517 54.3266C101.962 53.4768 113.837 51.4075 125.255 48.2397V80.9017C124.219 80.1894 123.081 79.5966 121.864 79.1424C119.097 78.1089 116.052 77.8384 113.114 78.3653C110.176 78.8922 107.478 80.1927 105.36 82.1025C103.242 84.0122 101.799 86.4453 101.215 89.0941C100.631 91.743 100.931 94.4886 102.077 96.9837C103.223 99.4789 105.164 101.612 107.655 103.112C110.145 104.612 113.073 105.413 116.069 105.413C116.53 105.413 116.76 105.413 116.955 105.409C127.482 105.2 135.966 96.7164 136.175 86.1895C136.179 85.9945 136.179 85.764 136.179 85.3029V81.8271L136.179 44.8277Z"
|
d="M136.179 44.8277C136.179 44.8277 136.179 44.8277 136.179 44.8276V21.168C117.931 28.5527 97.9854 32.6192 77.0897 32.6192C65.1466 32.6192 53.5138 31.2908 42.331 28.7737V51.4076C42.331 51.4076 42.331 51.4076 42.331 51.4076V81.1508C41.2955 80.4385 40.1568 79.8458 38.9405 79.3915C36.1732 78.358 33.128 78.0876 30.1902 78.6145C27.2524 79.1414 24.5539 80.4419 22.4358 82.3516C20.3178 84.2613 18.8754 86.6944 18.291 89.3433C17.7066 91.9921 18.0066 94.7377 19.1528 97.2329C20.2991 99.728 22.2403 101.861 24.7308 103.361C27.2214 104.862 30.1495 105.662 33.1448 105.662H33.1455C33.6061 105.662 33.8365 105.662 34.0314 105.659C44.5583 105.449 53.042 96.9656 53.2513 86.4386C53.2534 86.3306 53.2544 86.2116 53.2548 86.0486H53.2552V85.7149L53.2552 85.5521V82.0762L53.2552 53.1993C61.0533 54.2324 69.0092 54.7656 77.0897 54.7656C77.6696 54.7656 78.2489 54.7629 78.8276 54.7574V110.696C77.792 109.983 76.6533 109.391 75.437 108.936C72.6697 107.903 69.6246 107.632 66.6867 108.159C63.7489 108.686 61.0504 109.987 58.9323 111.896C56.8143 113.806 55.3719 116.239 54.7875 118.888C54.2032 121.537 54.5031 124.283 55.6494 126.778C56.7956 129.273 58.7368 131.405 61.2273 132.906C63.7179 134.406 66.646 135.207 69.6414 135.207C70.1024 135.207 70.3329 135.207 70.5279 135.203C81.0548 134.994 89.5385 126.51 89.7478 115.983C89.7517 115.788 89.7517 115.558 89.7517 115.097V111.621L89.7517 54.3266C101.962 53.4768 113.837 51.4075 125.255 48.2397V80.9017C124.219 80.1894 123.081 79.5966 121.864 79.1424C119.097 78.1089 116.052 77.8384 113.114 78.3653C110.176 78.8922 107.478 80.1927 105.36 82.1025C103.242 84.0122 101.799 86.4453 101.215 89.0941C100.631 91.743 100.931 94.4886 102.077 96.9837C103.223 99.4789 105.164 101.612 107.655 103.112C110.145 104.612 113.073 105.413 116.069 105.413C116.53 105.413 116.76 105.413 116.955 105.409C127.482 105.2 135.966 96.7164 136.175 86.1895C136.179 85.9945 136.179 85.764 136.179 85.3029V81.8271L136.179 44.8277Z"
|
||||||
className="fill-primary"
|
fill="#146AFF"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { clsx } from "clsx";
|
import { clsx } from "clsx";
|
||||||
import { useEffect, useId, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { Icon } from "../atoms/Icon";
|
import { Icon } from "../atoms/Icon";
|
||||||
|
|
||||||
// TODO: add tabs feature, and remove CodeExampleTabs
|
// TODO: add tabs feature, and remove CodeExampleTabs
|
||||||
@@ -84,9 +84,25 @@ export function CodeGroup({
|
|||||||
}) {
|
}) {
|
||||||
const textRef = useRef<HTMLPreElement | null>(null);
|
const textRef = useRef<HTMLPreElement | null>(null);
|
||||||
const [code, setCode] = useState<string>();
|
const [code, setCode] = useState<string>();
|
||||||
|
|
||||||
|
const filterText = (node: Node): string => {
|
||||||
|
if (
|
||||||
|
node instanceof Element &&
|
||||||
|
(node.classList.contains("twoslash-popup-container") ||
|
||||||
|
node.classList.contains("twoslash-completion-cursor"))
|
||||||
|
) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (node.nodeType === Node.TEXT_NODE) {
|
||||||
|
return node.textContent ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return Array.from(node.childNodes).map(filterText).join("");
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (textRef.current) {
|
if (textRef.current) {
|
||||||
setCode(textRef.current.innerText);
|
setCode(filterText(textRef.current));
|
||||||
}
|
}
|
||||||
}, [children]);
|
}, [children]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { readFile } from "node:fs/promises";
|
|
||||||
import { join } from "node:path";
|
|
||||||
import { ImageResponse } from "next/og";
|
import { ImageResponse } from "next/og";
|
||||||
import { JazzLogo } from "../atoms/logos/JazzLogo";
|
import { JazzLogo } from "../atoms/logos/JazzLogo";
|
||||||
|
|
||||||
@@ -10,28 +8,112 @@ export const imageSize = {
|
|||||||
|
|
||||||
export const imageContentType = "image/png";
|
export const imageContentType = "image/png";
|
||||||
|
|
||||||
export default async function OpenGraphImage({ title }: { title: string }) {
|
async function loadManropeGoogleFont() {
|
||||||
const manropeSemiBold = await readFile(
|
const url = `https://fonts.googleapis.com/css2?family=Manrope:wght@600`;
|
||||||
join(process.cwd(), "public/fonts/Manrope-SemiBold.ttf"),
|
const css = await (await fetch(url)).text();
|
||||||
|
const resource = css.match(
|
||||||
|
/src: url\((.+)\) format\('(opentype|truetype)'\)/,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (resource) {
|
||||||
|
const response = await fetch(resource[1]);
|
||||||
|
if (response.status == 200) {
|
||||||
|
return await response.arrayBuffer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error("failed to load font data");
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function OpenGraphImage({
|
||||||
|
title,
|
||||||
|
framework,
|
||||||
|
contents,
|
||||||
|
topic,
|
||||||
|
subtopic,
|
||||||
|
}: {
|
||||||
|
title: string;
|
||||||
|
framework?: string;
|
||||||
|
contents?: string[];
|
||||||
|
topic?: string;
|
||||||
|
subtopic?: string;
|
||||||
|
}) {
|
||||||
|
if (!title) {
|
||||||
|
throw new Error(
|
||||||
|
`No title from tocItems in opengraph-image.tsx ${framework} ${topic} ${subtopic}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: "7em",
|
|
||||||
background: "white",
|
background: "white",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
flexDirection: "column",
|
||||||
justifyContent: "flex-start",
|
alignItems: "flex-start",
|
||||||
|
justifyContent: "center",
|
||||||
padding: "77px",
|
padding: "77px",
|
||||||
letterSpacing: "-0.05em",
|
letterSpacing: "-0.05em",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{title}
|
|
||||||
<div
|
<div
|
||||||
style={{ display: "flex", position: "absolute", bottom: 35, right: 45 }}
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: "1rem",
|
||||||
|
fontSize: "4rem",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{title}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
right: 15,
|
||||||
|
top: 10,
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "flex-start",
|
||||||
|
fontSize: "3rem",
|
||||||
|
color: "#888888",
|
||||||
|
letterSpacing: "-0.03em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={{ display: "flex", color: "#BBB", paddingRight: "0.5rem" }}>
|
||||||
|
{framework}
|
||||||
|
</div>
|
||||||
|
{topic && (
|
||||||
|
<span style={{ color: "#CCC", paddingRight: "0.5rem" }}>
|
||||||
|
/ {topic}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{subtopic && <span style={{ color: "#DDD" }}>/ {subtopic}</span>}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
marginTop: "1rem",
|
||||||
|
gap: "0.2rem",
|
||||||
|
fontSize: "2rem",
|
||||||
|
color: "#888888",
|
||||||
|
letterSpacing: "-0.03em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{contents?.map((content) => (
|
||||||
|
<div key={content}>{content}</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
position: "absolute",
|
||||||
|
bottom: 35,
|
||||||
|
right: 45,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<JazzLogo width={193} height={73} />
|
<JazzLogo width={193} height={73} />
|
||||||
</div>
|
</div>
|
||||||
@@ -41,7 +123,9 @@ export default async function OpenGraphImage({ title }: { title: string }) {
|
|||||||
fonts: [
|
fonts: [
|
||||||
{
|
{
|
||||||
name: "Manrope",
|
name: "Manrope",
|
||||||
data: manropeSemiBold,
|
data: await loadManropeGoogleFont(),
|
||||||
|
style: "normal",
|
||||||
|
weight: 600,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { packages } from "@/content/packages";
|
import { packages } from "@/content/packages";
|
||||||
import { clsx } from "clsx";
|
|
||||||
import { Icon } from "@garden-co/design-system/src/components/atoms/Icon";
|
import { Icon } from "@garden-co/design-system/src/components/atoms/Icon";
|
||||||
|
import { clsx } from "clsx";
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { OpenGraphImage, imageSize, imageContentType } from '@garden-co/design-system/src/components/organisms/OpenGraphImage';
|
||||||
|
import { getMdxWithToc } from '@/lib/docMdxContent';
|
||||||
|
export const title = "Quickstart";
|
||||||
|
export const size = imageSize;
|
||||||
|
export const contentType = imageContentType;
|
||||||
|
export const alt = "Quickstart";
|
||||||
|
|
||||||
|
export default async function Image({ params }: { params: Promise<{ framework: string, topic: string, subtopic: string }> }) {
|
||||||
|
const { framework, topic, subtopic } = await params;
|
||||||
|
const { tocItems } = await getMdxWithToc(framework, [topic, subtopic]);
|
||||||
|
|
||||||
|
const title = tocItems[0]?.value;
|
||||||
|
|
||||||
|
if (!title) {
|
||||||
|
throw new Error(`No title from tocItems in opengraph-image.tsx ${framework} ${topic} ${subtopic}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return OpenGraphImage({
|
||||||
|
title: title,
|
||||||
|
framework,
|
||||||
|
contents: tocItems[0]?.children?.map((child) => child.value) ?? [],
|
||||||
|
topic,
|
||||||
|
subtopic,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import { OpenGraphImage, imageSize, imageContentType } from '@garden-co/design-system/src/components/organisms/OpenGraphImage';
|
||||||
|
import { getMdxWithToc } from '@/lib/docMdxContent';
|
||||||
|
export const title = "Quickstart";
|
||||||
|
export const size = imageSize;
|
||||||
|
export const contentType = imageContentType;
|
||||||
|
export const alt = "Quickstart";
|
||||||
|
|
||||||
|
export default async function Image({ params }: { params: Promise<{ framework: string, topic: string }> }) {
|
||||||
|
const { framework, topic } = await params;
|
||||||
|
const { tocItems } = await getMdxWithToc(framework, [topic]);
|
||||||
|
|
||||||
|
// console.log('tocItems', tocItems);
|
||||||
|
|
||||||
|
const title = tocItems[0]?.value;
|
||||||
|
|
||||||
|
if (!title) {
|
||||||
|
throw new Error(`No title from tocItems in opengraph-image.tsx ${framework} ${topic}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return OpenGraphImage({
|
||||||
|
title: title,
|
||||||
|
framework,
|
||||||
|
contents: tocItems[0]?.children?.map((child) => child.value) ?? [],
|
||||||
|
topic,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { getMdxWithToc } from "@/lib/docMdxContent";
|
||||||
|
import {
|
||||||
|
OpenGraphImage,
|
||||||
|
imageSize,
|
||||||
|
imageContentType,
|
||||||
|
} from "@garden-co/design-system/src/components/organisms/OpenGraphImage";
|
||||||
|
|
||||||
|
export const title = "Quickstart";
|
||||||
|
export const size = imageSize;
|
||||||
|
export const contentType = imageContentType;
|
||||||
|
export const alt = "Jazz Docs | Quickstart";
|
||||||
|
|
||||||
|
export default async function Image({
|
||||||
|
params,
|
||||||
|
}: {
|
||||||
|
params: Promise<{ framework: string }>;
|
||||||
|
}) {
|
||||||
|
const { framework } = await params;
|
||||||
|
const { tocItems } = await getMdxWithToc(framework, []);
|
||||||
|
|
||||||
|
const title = tocItems[0]?.value;
|
||||||
|
|
||||||
|
if (!title) {
|
||||||
|
throw new Error(`No title from tocItems in opengraph-image.tsx ${framework}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return OpenGraphImage({
|
||||||
|
title: title,
|
||||||
|
framework,
|
||||||
|
contents: tocItems[0]?.children?.map((child) => child.value) ?? [],
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -6,11 +6,11 @@ import { ReactNativeLogo } from "@/components/icons/ReactNativeLogo";
|
|||||||
import { SvelteLogo } from "@/components/icons/SvelteLogo";
|
import { SvelteLogo } from "@/components/icons/SvelteLogo";
|
||||||
import { VueLogo } from "@/components/icons/VueLogo";
|
import { VueLogo } from "@/components/icons/VueLogo";
|
||||||
import { Example, features, tech } from "@/content/example";
|
import { Example, features, tech } from "@/content/example";
|
||||||
import { clsx } from "clsx";
|
|
||||||
import { H2 } from "@garden-co/design-system/src/components/atoms/Headings";
|
import { H2 } from "@garden-co/design-system/src/components/atoms/Headings";
|
||||||
import { Icon } from "@garden-co/design-system/src/components/atoms/Icon";
|
import { Icon } from "@garden-co/design-system/src/components/atoms/Icon";
|
||||||
import { GappedGrid } from "@garden-co/design-system/src/components/molecules/GappedGrid";
|
import { GappedGrid } from "@garden-co/design-system/src/components/molecules/GappedGrid";
|
||||||
import { HeroHeader } from "@garden-co/design-system/src/components/molecules/HeroHeader";
|
import { HeroHeader } from "@garden-co/design-system/src/components/molecules/HeroHeader";
|
||||||
|
import { clsx } from "clsx";
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
const title = "Examples";
|
const title = "Examples";
|
||||||
@@ -198,6 +198,12 @@ const MusicIllustration = () => (
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const JazzPaperScissorsIllustration = () => (
|
||||||
|
<div className="flex flex-col items-center justify-center h-full p-8 text-4xl">
|
||||||
|
✊ ✋ ✌️
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
const ImageUploadIllustration = () => (
|
const ImageUploadIllustration = () => (
|
||||||
<div className="flex flex-col items-center justify-center h-full p-8">
|
<div className="flex flex-col items-center justify-center h-full p-8">
|
||||||
<div className="p-3 w-[12rem] h-[8rem] border border-dashed border-blue dark:border-blue-500 rounded-lg flex gap-2 flex-col items-center justify-center">
|
<div className="p-3 w-[12rem] h-[8rem] border border-dashed border-blue dark:border-blue-500 rounded-lg flex gap-2 flex-col items-center justify-center">
|
||||||
@@ -255,14 +261,14 @@ const ReactionsIllustration = () => (
|
|||||||
|
|
||||||
const MultiCursorIllustration = () => (
|
const MultiCursorIllustration = () => (
|
||||||
<div className="flex bg-stone-100 h-full flex-col items-center justify-center dark:bg-transparent p-4">
|
<div className="flex bg-stone-100 h-full flex-col items-center justify-center dark:bg-transparent p-4">
|
||||||
<div className=" bg-white md:aspect-[3/2] flex flex-col rounded-md shadow-xl shadow-stone-400/20 dark:shadow-none">
|
<div className=" bg-white min-w-64 md:aspect-[3/2] flex flex-col rounded-md shadow-xl shadow-stone-400/20 dark:shadow-none">
|
||||||
<div className="w-full py-2 flex items-center gap-1.5 px-2 border-b dark:border-b-stone-200">
|
<div className="w-full py-2 flex items-center gap-1.5 px-2 border-b dark:border-b-stone-200">
|
||||||
<span className="rounded-full size-2 bg-stone-200"></span>
|
<span className="rounded-full size-2 bg-stone-200"></span>
|
||||||
<span className="rounded-full size-2 bg-stone-200"></span>
|
<span className="rounded-full size-2 bg-stone-200"></span>
|
||||||
<span className="rounded-full size-2 bg-stone-200"></span>
|
<span className="rounded-full size-2 bg-stone-200"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="h-full mx-auto flex flex-col justify-center p-12 sm:p-16">
|
<div className="h-full mx-auto flex flex-col justify-center p-12">
|
||||||
<div className="inline-block relative px-1 ring-1 ring-blue-400">
|
<div className="inline-block relative px-1 ring-1 ring-blue-400">
|
||||||
<div className="absolute size-2 bg-white border border-blue-400 -left-1 -top-1"></div>
|
<div className="absolute size-2 bg-white border border-blue-400 -left-1 -top-1"></div>
|
||||||
<div className="absolute size-2 bg-white border border-blue-400 -right-1 -top-1"></div>
|
<div className="absolute size-2 bg-white border border-blue-400 -right-1 -top-1"></div>
|
||||||
@@ -285,6 +291,21 @@ const MultiCursorIllustration = () => (
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const CoTextIllustration = () => (
|
||||||
|
<div className="flex bg-stone-100 h-full flex-col items-center justify-center dark:bg-transparent p-4">
|
||||||
|
<div className=" bg-white md:aspect-[3/2] min-w-64 flex flex-col rounded-md shadow-xl shadow-stone-400/20 dark:shadow-none">
|
||||||
|
<div className="flex gap-2 p-3 border-b">
|
||||||
|
<Icon name="bold" size="xs" />
|
||||||
|
<Icon name="italic" size="xs" />
|
||||||
|
<Icon name="code" size="xs" />
|
||||||
|
</div>
|
||||||
|
<div className="py-2 px-3 text-xl text-stone-800">
|
||||||
|
<em>Hello</em>, <strong>world!</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
const PetIllustration = () => (
|
const PetIllustration = () => (
|
||||||
<div className="h-full p-4 bg-[url('/dog.jpg')] bg-cover bg-center p-4 flex items-end">
|
<div className="h-full p-4 bg-[url('/dog.jpg')] bg-cover bg-center p-4 flex items-end">
|
||||||
<div className="inline-flex justify-center gap-1 mx-auto">
|
<div className="inline-flex justify-center gap-1 mx-auto">
|
||||||
@@ -434,9 +455,19 @@ const reactExamples: Example[] = [
|
|||||||
"Track user presence on a canvas with multiple cursors and out of bounds indicators.",
|
"Track user presence on a canvas with multiple cursors and out of bounds indicators.",
|
||||||
tech: [tech.react],
|
tech: [tech.react],
|
||||||
features: [features.coFeed],
|
features: [features.coFeed],
|
||||||
demoUrl: "https://jazz-multi-cursors.vercel.app",
|
demoUrl: "https://multi-cursors-demo.jazz.tools",
|
||||||
illustration: <MultiCursorIllustration />,
|
illustration: <MultiCursorIllustration />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Collaborative rich text",
|
||||||
|
slug: "richtext",
|
||||||
|
description:
|
||||||
|
"Handle multiple users editing the same text, integrated with a ProseMirror editor for rich text.",
|
||||||
|
tech: [tech.react],
|
||||||
|
features: [features.coRichText, features.coPlainText],
|
||||||
|
demoUrl: "https://richtext-demo.jazz.tools",
|
||||||
|
illustration: <CoTextIllustration />,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Rate my pet",
|
name: "Rate my pet",
|
||||||
slug: "pets",
|
slug: "pets",
|
||||||
@@ -477,6 +508,16 @@ const reactExamples: Example[] = [
|
|||||||
demoUrl: "https://music-demo.jazz.tools",
|
demoUrl: "https://music-demo.jazz.tools",
|
||||||
illustration: <MusicIllustration />,
|
illustration: <MusicIllustration />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Jazz paper scissors",
|
||||||
|
slug: "jazz-paper-scissors",
|
||||||
|
description:
|
||||||
|
"A game that shows how to communicate with other accounts through the experimental Inbox API.",
|
||||||
|
tech: [tech.react],
|
||||||
|
features: [features.serverWorker, features.inbox],
|
||||||
|
illustration: <JazzPaperScissorsIllustration />,
|
||||||
|
demoUrl: "https://jazz-paper-scissors.vercel.app",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Clerk",
|
name: "Clerk",
|
||||||
slug: "clerk",
|
slug: "clerk",
|
||||||
@@ -511,6 +552,7 @@ const reactExamples: Example[] = [
|
|||||||
tech: [tech.react],
|
tech: [tech.react],
|
||||||
features: [features.inviteLink],
|
features: [features.inviteLink],
|
||||||
illustration: <OrganizationIllustration />,
|
illustration: <OrganizationIllustration />,
|
||||||
|
demoUrl: "https://jazz-organization.vercel.app",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Version history",
|
name: "Version history",
|
||||||
@@ -519,6 +561,7 @@ const reactExamples: Example[] = [
|
|||||||
"Track and restore previous versions of your data, and see who made the changes.",
|
"Track and restore previous versions of your data, and see who made the changes.",
|
||||||
tech: [tech.react],
|
tech: [tech.react],
|
||||||
illustration: <VersionHistoryIllustration />,
|
illustration: <VersionHistoryIllustration />,
|
||||||
|
demoUrl: "https://jazz-version-history.vercel.app",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -566,7 +609,6 @@ const vueExamples: Example[] = [
|
|||||||
description: "A todo list where you can collaborate with invited guests.",
|
description: "A todo list where you can collaborate with invited guests.",
|
||||||
tech: [tech.vue],
|
tech: [tech.vue],
|
||||||
features: [features.inviteLink],
|
features: [features.inviteLink],
|
||||||
demoUrl: "https://todo-demo.jazz.tools",
|
|
||||||
illustration: (
|
illustration: (
|
||||||
<div className="h-full w-full bg-cover bg-[url('/todo.jpg')] bg-left-bottom"></div>
|
<div className="h-full w-full bg-cover bg-[url('/todo.jpg')] bg-left-bottom"></div>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import LatencyChart from "@/components/LatencyChart";
|
import LatencyChart from "@/components/LatencyChart";
|
||||||
import { clsx } from "clsx";
|
|
||||||
import { HeroHeader } from "@garden-co/design-system/src/components/molecules/HeroHeader";
|
import { HeroHeader } from "@garden-co/design-system/src/components/molecules/HeroHeader";
|
||||||
|
import { clsx } from "clsx";
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ pre.shiki .line {
|
|||||||
.twoslash-popup-code pre.shiki .line {
|
.twoslash-popup-code pre.shiki .line {
|
||||||
display: inline;
|
display: inline;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
white-space: break-spaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
html.dark .shiki {
|
html.dark .shiki {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import type { Metadata } from "next";
|
|
||||||
import { fontClasses } from "@garden-co/design-system/src/fonts";
|
|
||||||
import { ThemeProvider } from "@/components/ThemeProvider";
|
import { ThemeProvider } from "@/components/ThemeProvider";
|
||||||
import { JazzFooter } from "@/components/footer";
|
import { JazzFooter } from "@/components/footer";
|
||||||
import { marketingCopy } from "@/content/marketingCopy";
|
import { marketingCopy } from "@/content/marketingCopy";
|
||||||
|
import { fontClasses } from "@garden-co/design-system/src/fonts";
|
||||||
import { Analytics } from "@vercel/analytics/react";
|
import { Analytics } from "@vercel/analytics/react";
|
||||||
import { SpeedInsights } from "@vercel/speed-insights/next";
|
import { SpeedInsights } from "@vercel/speed-insights/next";
|
||||||
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
const metaTags = {
|
const metaTags = {
|
||||||
title: `Jazz - ${marketingCopy.headline}`,
|
title: `Jazz - ${marketingCopy.headline}`,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { marketingCopy } from "@/content/marketingCopy";
|
import { marketingCopy } from "@/content/marketingCopy";
|
||||||
import OpenGraphImage, {
|
import {
|
||||||
|
OpenGraphImage,
|
||||||
imageSize,
|
imageSize,
|
||||||
imageContentType,
|
imageContentType,
|
||||||
} from "@garden-co/design-system/src/components/organisms/OpenGraphImage";
|
} from "@garden-co/design-system/src/components/organisms/OpenGraphImage";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { track } from "@vercel/analytics";
|
|
||||||
import { Button } from "@garden-co/design-system/src/components/atoms/Button";
|
import { Button } from "@garden-co/design-system/src/components/atoms/Button";
|
||||||
|
import { track } from "@vercel/analytics";
|
||||||
|
|
||||||
export function FakeGetStartedButton({ tier }: { tier: "starter" | "indie" }) {
|
export function FakeGetStartedButton({ tier }: { tier: "starter" | "indie" }) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { clsx } from "clsx";
|
|
||||||
import { Button } from "@garden-co/design-system/src/components/atoms/Button";
|
import { Button } from "@garden-co/design-system/src/components/atoms/Button";
|
||||||
|
import { clsx } from "clsx";
|
||||||
import {
|
import {
|
||||||
CircleCheckIcon,
|
CircleCheckIcon,
|
||||||
LucideBuilding2,
|
LucideBuilding2,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { clsx } from "clsx";
|
|
||||||
import { Icon } from "@garden-co/design-system/src/components/atoms/Icon";
|
import { Icon } from "@garden-co/design-system/src/components/atoms/Icon";
|
||||||
|
import { clsx } from "clsx";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { JazzNav } from "@/components/nav";
|
import { JazzNav } from "@/components/nav";
|
||||||
import { clsx } from "clsx";
|
|
||||||
import { NavSection } from "@garden-co/design-system/src/components/organisms/Nav";
|
import { NavSection } from "@garden-co/design-system/src/components/organisms/Nav";
|
||||||
|
import { clsx } from "clsx";
|
||||||
|
|
||||||
export function SideNavLayout({
|
export function SideNavLayout({
|
||||||
children,
|
children,
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
import { TableOfContents } from "@/components/docs/TableOfContents";
|
import { TableOfContents } from "@/components/docs/TableOfContents";
|
||||||
import { JazzMobileNav } from "@/components/nav";
|
import { JazzMobileNav } from "@/components/nav";
|
||||||
import { TocEntry } from "@stefanprobst/rehype-extract-toc";
|
|
||||||
import type { IconName } from "@garden-co/design-system/src/components/atoms/Icon";
|
import type { IconName } from "@garden-co/design-system/src/components/atoms/Icon";
|
||||||
import { NavSection } from "@garden-co/design-system/src/components/organisms/Nav";
|
import { NavSection } from "@garden-co/design-system/src/components/organisms/Nav";
|
||||||
|
import { TocEntry } from "@stefanprobst/rehype-extract-toc";
|
||||||
|
|
||||||
export default function DocsLayout({
|
export default function DocsLayout({
|
||||||
children,
|
children,
|
||||||
@@ -19,8 +19,7 @@ export default function DocsLayout({
|
|||||||
navIcon?: IconName;
|
navIcon?: IconName;
|
||||||
tocItems?: TocEntry[];
|
tocItems?: TocEntry[];
|
||||||
}) {
|
}) {
|
||||||
const tableOfContentsItems =
|
const tableOfContentsItems = tocItems ?? [];
|
||||||
tocItems?.length && tocItems[0].children ? tocItems[0].children : [];
|
|
||||||
|
|
||||||
const navSections: NavSection[] = [
|
const navSections: NavSection[] = [
|
||||||
{
|
{
|
||||||
|
|||||||
10
homepage/homepage/components/docs/Framework.tsx
Normal file
10
homepage/homepage/components/docs/Framework.tsx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { frameworkNames } from "@/content/framework";
|
||||||
|
import { useFramework } from "@/lib/use-framework";
|
||||||
|
|
||||||
|
export function Framework() {
|
||||||
|
const framework = useFramework();
|
||||||
|
|
||||||
|
return <>{frameworkNames[framework].label}</>;
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Framework } from "@/content/framework";
|
import { Framework, frameworkNames } from "@/content/framework";
|
||||||
import { useFramework } from "@/lib/use-framework";
|
import { useFramework } from "@/lib/use-framework";
|
||||||
import { Button } from "@garden-co/design-system/src/components/atoms/Button";
|
import { Button } from "@garden-co/design-system/src/components/atoms/Button";
|
||||||
import { Icon } from "@garden-co/design-system/src/components/atoms/Icon";
|
import { Icon } from "@garden-co/design-system/src/components/atoms/Icon";
|
||||||
@@ -13,39 +13,6 @@ import {
|
|||||||
import { usePathname, useRouter } from "next/navigation";
|
import { usePathname, useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
const frameworks: Record<
|
|
||||||
Framework,
|
|
||||||
{
|
|
||||||
label: string;
|
|
||||||
experimental: boolean;
|
|
||||||
}
|
|
||||||
> = {
|
|
||||||
[Framework.React]: {
|
|
||||||
label: "React",
|
|
||||||
experimental: false,
|
|
||||||
},
|
|
||||||
[Framework.ReactNative]: {
|
|
||||||
label: "React Native",
|
|
||||||
experimental: false,
|
|
||||||
},
|
|
||||||
[Framework.ReactNativeExpo]: {
|
|
||||||
label: "React Native (Expo)",
|
|
||||||
experimental: false,
|
|
||||||
},
|
|
||||||
[Framework.Vanilla]: {
|
|
||||||
label: "VanillaJS",
|
|
||||||
experimental: false,
|
|
||||||
},
|
|
||||||
[Framework.Svelte]: {
|
|
||||||
label: "Svelte",
|
|
||||||
experimental: true,
|
|
||||||
},
|
|
||||||
[Framework.Vue]: {
|
|
||||||
label: "Vue",
|
|
||||||
experimental: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export function FrameworkSelect() {
|
export function FrameworkSelect() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const defaultFramework = useFramework();
|
const defaultFramework = useFramework();
|
||||||
@@ -66,11 +33,11 @@ export function FrameworkSelect() {
|
|||||||
as={Button}
|
as={Button}
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
>
|
>
|
||||||
{frameworks[selectedFramework].label}
|
{frameworkNames[selectedFramework].label}
|
||||||
<Icon name="chevronDown" size="sm" className="text-muted" />
|
<Icon name="chevronDown" size="sm" className="text-muted" />
|
||||||
</DropdownButton>
|
</DropdownButton>
|
||||||
<DropdownMenu className="w-[--button-width] z-50" anchor="bottom start">
|
<DropdownMenu className="w-[--button-width] z-50" anchor="bottom start">
|
||||||
{Object.entries(frameworks).map(([key, framework]) => (
|
{Object.entries(frameworkNames).map(([key, framework]) => (
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
className="items-baseline"
|
className="items-baseline"
|
||||||
key={key}
|
key={key}
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
import type { Toc, TocEntry } from "@stefanprobst/rehype-extract-toc";
|
import type { Toc, TocEntry } from "@stefanprobst/rehype-extract-toc";
|
||||||
import { clsx } from "clsx";
|
import { clsx } from "clsx";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
|
|
||||||
const TocList = ({
|
const TocList = ({
|
||||||
items,
|
items,
|
||||||
level,
|
level,
|
||||||
currentId,
|
currentId,
|
||||||
}: { items: Toc; level: number; currentId: string }) => {
|
}: { items: Toc; level: number; currentId: string }) => {
|
||||||
|
|
||||||
const isActive = (item: TocEntry) => {
|
const isActive = (item: TocEntry) => {
|
||||||
if (!item.id) return false;
|
if (!item.id) return false;
|
||||||
if (item.id === currentId) return true;
|
if (item.id === currentId) return true;
|
||||||
@@ -20,7 +21,7 @@ const TocList = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ul className="space-y-2" style={{ paddingLeft: level ? "1rem" : "0" }}>
|
<ul className="space-y-2" style={{ paddingLeft: (level > 0) ? "1rem" : "0" }}>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<li key={item.id} className="space-y-2">
|
<li key={item.id} className="space-y-2">
|
||||||
{item.id && (
|
{item.id && (
|
||||||
@@ -57,8 +58,10 @@ export function TableOfContents({
|
|||||||
}) {
|
}) {
|
||||||
const [currentId, setCurrentId] = useState<string>("");
|
const [currentId, setCurrentId] = useState<string>("");
|
||||||
|
|
||||||
|
const itemsUnderH1 = useMemo(() => items[0]?.children || [], [items]);
|
||||||
|
|
||||||
const getHeadings = useCallback(() => {
|
const getHeadings = useCallback(() => {
|
||||||
return items
|
return itemsUnderH1
|
||||||
.flatMap((node) => {
|
.flatMap((node) => {
|
||||||
const headings = [node];
|
const headings = [node];
|
||||||
if (node.children) {
|
if (node.children) {
|
||||||
@@ -78,17 +81,17 @@ export function TableOfContents({
|
|||||||
return { id: item.id, top };
|
return { id: item.id, top };
|
||||||
})
|
})
|
||||||
.filter((x): x is { id: string; top: number } => x !== null);
|
.filter((x): x is { id: string; top: number } => x !== null);
|
||||||
}, [items]);
|
}, [itemsUnderH1]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (items.length === 0) return;
|
if (itemsUnderH1.length === 0) return;
|
||||||
|
|
||||||
const onScroll = () => {
|
const onScroll = () => {
|
||||||
const headings = getHeadings();
|
const headings = getHeadings();
|
||||||
if (headings.length === 0) return;
|
if (headings.length === 0) return;
|
||||||
|
|
||||||
const top = window.scrollY;
|
const top = window.scrollY;
|
||||||
let current = headings[0].id;
|
let current = headings[0]?.id;
|
||||||
|
|
||||||
for (const heading of headings) {
|
for (const heading of headings) {
|
||||||
if (top >= heading.top - 500) {
|
if (top >= heading.top - 500) {
|
||||||
@@ -98,7 +101,7 @@ export function TableOfContents({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setCurrentId(current);
|
current && setCurrentId(current);
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener("scroll", onScroll, { passive: true });
|
window.addEventListener("scroll", onScroll, { passive: true });
|
||||||
@@ -107,14 +110,14 @@ export function TableOfContents({
|
|||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener("scroll", onScroll);
|
window.removeEventListener("scroll", onScroll);
|
||||||
};
|
};
|
||||||
}, [getHeadings, items]);
|
}, [getHeadings, itemsUnderH1]);
|
||||||
|
|
||||||
if (!items.length) return null;
|
if (!itemsUnderH1.length) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
<p className="font-medium text-highlight mb-3">On this page</p>
|
<p className="font-medium text-highlight mb-3">On this page</p>
|
||||||
<TocList items={items} level={0} currentId={currentId} />
|
<TocList items={itemsUnderH1} level={0} currentId={currentId} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import { Example } from "@/content/example";
|
import { Example } from "@/content/example";
|
||||||
import { InterpolateInCode } from "@/mdx-components";
|
import { InterpolateInCode } from "@/mdx-components";
|
||||||
import { DialogDescription } from "@headlessui/react";
|
|
||||||
import { Button } from "@garden-co/design-system/src/components/atoms/Button";
|
import { Button } from "@garden-co/design-system/src/components/atoms/Button";
|
||||||
import { CodeGroup } from "@garden-co/design-system/src/components/molecules/CodeGroup";
|
import { CodeGroup } from "@garden-co/design-system/src/components/molecules/CodeGroup";
|
||||||
import {
|
import {
|
||||||
@@ -11,6 +10,7 @@ import {
|
|||||||
DialogBody,
|
DialogBody,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@garden-co/design-system/src/components/organisms/Dialog";
|
} from "@garden-co/design-system/src/components/organisms/Dialog";
|
||||||
|
import { DialogDescription } from "@headlessui/react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import CreateJazzApp from "./CreateJazzApp.mdx";
|
import CreateJazzApp from "./CreateJazzApp.mdx";
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { CodeGroup as CodeGroupClient } from "@garden-co/design-system/src/compo
|
|||||||
import { AnchorHTMLAttributes, DetailedHTMLProps } from "react";
|
import { AnchorHTMLAttributes, DetailedHTMLProps } from "react";
|
||||||
import { FileDownloadLink as FileDownloadLinkClient } from "./FileDownloadLink";
|
import { FileDownloadLink as FileDownloadLinkClient } from "./FileDownloadLink";
|
||||||
import { ComingSoon as ComingSoonClient } from "./docs/ComingSoon";
|
import { ComingSoon as ComingSoonClient } from "./docs/ComingSoon";
|
||||||
|
import { Framework as FrameworkClient } from "./docs/Framework";
|
||||||
import { IssueTrackerPreview as IssueTrackerPreviewClient } from "./docs/IssueTrackerPreview";
|
import { IssueTrackerPreview as IssueTrackerPreviewClient } from "./docs/IssueTrackerPreview";
|
||||||
|
|
||||||
export function CodeExampleTabs(props: CodeExampleTabsProps) {
|
export function CodeExampleTabs(props: CodeExampleTabsProps) {
|
||||||
@@ -46,3 +47,7 @@ export function FileDownloadLink(
|
|||||||
) {
|
) {
|
||||||
return <FileDownloadLinkClient {...props} />;
|
return <FileDownloadLinkClient {...props} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function Framework() {
|
||||||
|
return <FrameworkClient />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
```tsx
|
```tsx
|
||||||
<JazzProvider
|
<JazzProvider
|
||||||
sync={{ peer: "wss://cloud.jazz.tools/?key=you@example.com" }}
|
sync={{
|
||||||
|
peer: "wss://cloud.jazz.tools/?key=you@example.com"
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</JazzProvider>
|
</JazzProvider>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { clsx } from "clsx";
|
|
||||||
import { Card } from "@garden-co/design-system/src/components/atoms/Card";
|
import { Card } from "@garden-co/design-system/src/components/atoms/Card";
|
||||||
import { H2 } from "@garden-co/design-system/src/components/atoms/Headings";
|
import { H2 } from "@garden-co/design-system/src/components/atoms/Headings";
|
||||||
import { Kicker } from "@garden-co/design-system/src/components/atoms/Kicker";
|
import { Kicker } from "@garden-co/design-system/src/components/atoms/Kicker";
|
||||||
import { GappedGrid } from "@garden-co/design-system/src/components/molecules/GappedGrid";
|
import { GappedGrid } from "@garden-co/design-system/src/components/molecules/GappedGrid";
|
||||||
|
import { clsx } from "clsx";
|
||||||
import CodeStepAction from "./CodeStepAction.mdx";
|
import CodeStepAction from "./CodeStepAction.mdx";
|
||||||
import CodeStepCloud from "./CodeStepCloud.mdx";
|
import CodeStepCloud from "./CodeStepCloud.mdx";
|
||||||
import CodeStepRender from "./CodeStepRender.mdx";
|
import CodeStepRender from "./CodeStepRender.mdx";
|
||||||
@@ -21,7 +21,7 @@ function Code({
|
|||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
className,
|
className,
|
||||||
"w-full h-full relative -right-2 -bottom-1 max-w-full lg:max-w-[480px] overflow-x-auto ml-auto overflow-hidden",
|
"w-full h-full relative -right-2 -bottom-1 max-w-full lg:max-w-[500px] ml-auto",
|
||||||
"shadow-xl shadow-blue/20",
|
"shadow-xl shadow-blue/20",
|
||||||
"rounded-tl-lg border",
|
"rounded-tl-lg border",
|
||||||
"flex-1 bg-white ring ring-4 ring-stone-400/20",
|
"flex-1 bg-white ring ring-4 ring-stone-400/20",
|
||||||
@@ -33,7 +33,9 @@ function Code({
|
|||||||
{fileName}
|
{fileName}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<pre className="text-xs lg:text-sm p-1 pb-2">{children}</pre>
|
<pre className="text-xs lg:text-sm p-1 pb-2 overflow-x-auto">
|
||||||
|
{children}
|
||||||
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -134,9 +134,20 @@ export async function onAnonymousAccountDiscarded(
|
|||||||
|
|
||||||
To see how this works, try uploading a song in the [music player demo](https://music-demo.jazz.tools/) and then log in with an existing account.
|
To see how this works, try uploading a song in the [music player demo](https://music-demo.jazz.tools/) and then log in with an existing account.
|
||||||
|
|
||||||
|
## Provider Configuration for Authentication
|
||||||
|
|
||||||
|
You can configure how authentication states work in your app with the [JazzProvider](/docs/project-setup/providers/). The provider offers several options that impact authentication behavior:
|
||||||
|
|
||||||
|
- `guestMode`: Enable/disable Guest Mode
|
||||||
|
- `onAnonymousAccountDiscarded`: Handle data migration when switching accounts
|
||||||
|
- `sync.when`: Control when data synchronization happens
|
||||||
|
- `defaultProfileName`: Set default name for new user profiles
|
||||||
|
|
||||||
|
For detailed information on all provider options, see [Provider Configuration options](/docs/project-setup/providers/#additional-options).
|
||||||
|
|
||||||
## Controlling sync for different authentication states
|
## Controlling sync for different authentication states
|
||||||
|
|
||||||
You can control network sync with [Providers](/docs/project-setup/providers) based on authentication state:
|
You can control network sync with [Providers](/docs/project-setup/providers/) based on authentication state:
|
||||||
|
|
||||||
- `when: "always"`: Sync is enabled for both Anonymous Authentication and Authenticated Account
|
- `when: "always"`: Sync is enabled for both Anonymous Authentication and Authenticated Account
|
||||||
- `when: "signedUp"`: Sync is enabled when the user is authenticated
|
- `when: "signedUp"`: Sync is enabled when the user is authenticated
|
||||||
@@ -197,7 +208,7 @@ function App() {
|
|||||||
|
|
||||||
### Configuring Guest Mode Access
|
### Configuring Guest Mode Access
|
||||||
|
|
||||||
You can configure Guest Mode access with the `guestMode` prop for [Providers](/docs/project-setup/providers).
|
You can configure Guest Mode access with the `guestMode` prop for [Providers](/docs/project-setup/providers/).
|
||||||
|
|
||||||
<ContentByFramework framework="react">
|
<ContentByFramework framework="react">
|
||||||
<CodeGroup>
|
<CodeGroup>
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export const docNavigationItems = [
|
|||||||
name: "Providers",
|
name: "Providers",
|
||||||
href: "/docs/project-setup/providers",
|
href: "/docs/project-setup/providers",
|
||||||
done: {
|
done: {
|
||||||
|
react: 100,
|
||||||
"react-native": 100,
|
"react-native": 100,
|
||||||
"react-native-expo": 100,
|
"react-native-expo": 100,
|
||||||
},
|
},
|
||||||
@@ -168,6 +169,11 @@ export const docNavigationItems = [
|
|||||||
href: "/docs/using-covalues/cofeeds",
|
href: "/docs/using-covalues/cofeeds",
|
||||||
done: 100,
|
done: 100,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "CoTexts",
|
||||||
|
href: "/docs/using-covalues/cotexts",
|
||||||
|
done: 100,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "FileStreams",
|
name: "FileStreams",
|
||||||
href: "/docs/using-covalues/filestreams",
|
href: "/docs/using-covalues/filestreams",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { CodeGroup } from '@/components/forMdx'
|
import { CodeGroup, ContentByFramework } from '@/components/forMdx'
|
||||||
import { JazzIcon } from "@garden-co/design-system/src/components/atoms/logos/JazzIcon";
|
import { JazzIcon } from "@garden-co/design-system/src/components/atoms/logos/JazzIcon";
|
||||||
|
|
||||||
# Jazz Inspector
|
# Jazz Inspector
|
||||||
@@ -9,11 +9,14 @@ For now, you can get your account credentials from the `jazz-logged-in-secret` l
|
|||||||
|
|
||||||
[https://inspector.jazz.tools](https://inspector.jazz.tools)
|
[https://inspector.jazz.tools](https://inspector.jazz.tools)
|
||||||
|
|
||||||
## Exporting current account to Inspector from your app
|
<ContentByFramework framework={["react", "svelte", "vue", "vanilla"]}>
|
||||||
|
## Exporting current account to Inspector from your app [!framework=react,svelte,vue,vanilla]
|
||||||
|
|
||||||
In development mode, you can launch the Inspector from your Jazz app to inspect your account by pressing `Cmd+J`.
|
In development mode, you can launch the Inspector from your Jazz app to inspect your account by pressing `Cmd+J`.
|
||||||
|
</ContentByFramework>
|
||||||
|
|
||||||
## Embedding the Inspector widget into your app
|
<ContentByFramework framework="react">
|
||||||
|
## Embedding the Inspector widget into your app [!framework=react]
|
||||||
|
|
||||||
Alternatively, you can embed the Inspector directly into your app, so you don't need to open a separate window.
|
Alternatively, you can embed the Inspector directly into your app, so you don't need to open a separate window.
|
||||||
|
|
||||||
@@ -40,7 +43,7 @@ import { JazzInspector } from "jazz-inspector";
|
|||||||
|
|
||||||
This will show the Inspector launch button on the right of your page.
|
This will show the Inspector launch button on the right of your page.
|
||||||
|
|
||||||
### Positioning the Inspector button
|
### Positioning the Inspector button [!framework=react]
|
||||||
|
|
||||||
You can also customize the button position with the following options:
|
You can also customize the button position with the following options:
|
||||||
|
|
||||||
@@ -67,3 +70,4 @@ For example:
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
Check out the [music player app](https://github.com/garden-co/jazz/blob/main/examples/music-player/src/2_main.tsx) for a full example.
|
Check out the [music player app](https://github.com/garden-co/jazz/blob/main/examples/music-player/src/2_main.tsx) for a full example.
|
||||||
|
</ContentByFramework>
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import { CodeGroup } from "@/components/forMdx";
|
|||||||
|
|
||||||
# Providers
|
# Providers
|
||||||
|
|
||||||
## Introduction
|
|
||||||
|
|
||||||
`<JazzProvider />` is the core component that connects your Expo application to Jazz. It handles:
|
`<JazzProvider />` is the core component that connects your Expo application to Jazz. It handles:
|
||||||
|
|
||||||
- **Data Synchronization**: Manages connections to peers and the Jazz cloud
|
- **Data Synchronization**: Manages connections to peers and the Jazz cloud
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import { CodeGroup } from "@/components/forMdx";
|
|||||||
|
|
||||||
# Providers
|
# Providers
|
||||||
|
|
||||||
## Introduction
|
|
||||||
|
|
||||||
`<JazzProvider />` is the core component that connects your React Native application to Jazz. It handles:
|
`<JazzProvider />` is the core component that connects your React Native application to Jazz. It handles:
|
||||||
|
|
||||||
- **Data Synchronization**: Manages connections to peers and the Jazz cloud
|
- **Data Synchronization**: Manages connections to peers and the Jazz cloud
|
||||||
|
|||||||
193
homepage/homepage/content/docs/project-setup/providers/react.mdx
Normal file
193
homepage/homepage/content/docs/project-setup/providers/react.mdx
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
export const metadata = { title: "Providers" };
|
||||||
|
|
||||||
|
import { CodeGroup } from "@/components/forMdx";
|
||||||
|
|
||||||
|
# Providers
|
||||||
|
|
||||||
|
`<JazzProvider />` is the core component that connects your React application to Jazz. It handles:
|
||||||
|
|
||||||
|
- **Data Synchronization**: Manages connections to peers and the Jazz cloud
|
||||||
|
- **Local Storage**: Persists data locally between app sessions
|
||||||
|
- **Schema Types**: Provides APIs for the [AccountSchema](/docs/schemas/accounts-and-migrations)
|
||||||
|
- **Authentication**: Connects your authentication system to Jazz
|
||||||
|
|
||||||
|
Our [Chat example app](https://jazz.tools/examples#chat) provides a complete implementation of JazzProvider with authentication and real-time data sync.
|
||||||
|
|
||||||
|
## Setting up the Provider
|
||||||
|
|
||||||
|
The `<JazzProvider />` accepts several configuration options:
|
||||||
|
|
||||||
|
<CodeGroup>
|
||||||
|
```tsx twoslash
|
||||||
|
// @filename: schema.ts
|
||||||
|
import { Account, co } from "jazz-tools";
|
||||||
|
|
||||||
|
export class MyAppAccount extends Account {
|
||||||
|
name = co.string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @filename: app.tsx
|
||||||
|
import * as React from "react";
|
||||||
|
// ---cut---
|
||||||
|
// App.tsx
|
||||||
|
import { JazzProvider } from "jazz-react";
|
||||||
|
import { MyAppAccount } from "./schema";
|
||||||
|
|
||||||
|
export function MyApp({ children }: { children: React.ReactNode }) {
|
||||||
|
return (
|
||||||
|
<JazzProvider
|
||||||
|
sync={{
|
||||||
|
peer: "wss://cloud.jazz.tools/?key=your-api-key",
|
||||||
|
when: "always" // When to sync: "always", "never", or "signedUp"
|
||||||
|
}}
|
||||||
|
AccountSchema={MyAppAccount}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</JazzProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
|
||||||
|
declare module "jazz-react" {
|
||||||
|
interface Register {
|
||||||
|
Account: MyAppAccount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</CodeGroup>
|
||||||
|
|
||||||
|
## Provider Options
|
||||||
|
|
||||||
|
### Sync Options
|
||||||
|
|
||||||
|
The `sync` property configures how your application connects to the Jazz network:
|
||||||
|
|
||||||
|
<CodeGroup>
|
||||||
|
```tsx twoslash
|
||||||
|
import { type SyncConfig } from "jazz-tools";
|
||||||
|
|
||||||
|
const syncConfig: SyncConfig = {
|
||||||
|
// Connection to Jazz Cloud or your own sync server
|
||||||
|
peer: "wss://cloud.jazz.tools/?key=your-api-key",
|
||||||
|
|
||||||
|
// When to sync: "always" (default), "never", or "signedUp"
|
||||||
|
when: "always",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</CodeGroup>
|
||||||
|
|
||||||
|
See [Authentication States](/docs/authentication/authentication-states#controlling-sync-for-different-authentication-states) for more details on how the `when` property affects synchronization based on authentication state.
|
||||||
|
|
||||||
|
### Account Schema
|
||||||
|
|
||||||
|
The `AccountSchema` property defines your application's account structure:
|
||||||
|
|
||||||
|
<CodeGroup>
|
||||||
|
```tsx twoslash
|
||||||
|
|
||||||
|
// @filename: schema.ts
|
||||||
|
import { Account, CoMap, co } from "jazz-tools";
|
||||||
|
// schema.ts
|
||||||
|
class Preferences extends CoMap {
|
||||||
|
theme = co.string;
|
||||||
|
notifications = co.boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define your custom account schema
|
||||||
|
export class MyAppAccount extends Account {
|
||||||
|
name = co.string;
|
||||||
|
preferences = co.ref(Preferences);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @filename: app.tsx
|
||||||
|
import * as React from "react";
|
||||||
|
import { JazzProvider } from "jazz-react";
|
||||||
|
import { SyncConfig } from "jazz-tools";
|
||||||
|
|
||||||
|
const syncConfig: SyncConfig = {
|
||||||
|
peer: "wss://cloud.jazz.tools/?key=your-api-key",
|
||||||
|
when: "always",
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---cut---
|
||||||
|
// app.tsx
|
||||||
|
import { MyAppAccount } from "./schema";
|
||||||
|
|
||||||
|
export function MyApp ({ children }: { children: React.ReactNode }) {
|
||||||
|
// Use in provider
|
||||||
|
return (
|
||||||
|
<JazzProvider
|
||||||
|
sync={syncConfig}
|
||||||
|
|
||||||
|
AccountSchema={MyAppAccount}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</JazzProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register type for useAccount
|
||||||
|
declare module "jazz-react" {
|
||||||
|
interface Register {
|
||||||
|
Account: MyAppAccount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</CodeGroup>
|
||||||
|
|
||||||
|
### Additional Options
|
||||||
|
|
||||||
|
The provider accepts these additional options:
|
||||||
|
|
||||||
|
<CodeGroup>
|
||||||
|
```tsx twoslash
|
||||||
|
import * as React from "react";
|
||||||
|
import { JazzProvider } from "jazz-react";
|
||||||
|
import { SyncConfig } from "jazz-tools";
|
||||||
|
|
||||||
|
const syncConfig: SyncConfig = {
|
||||||
|
peer: "wss://cloud.jazz.tools/?key=your-api-key",
|
||||||
|
when: "always",
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---cut---
|
||||||
|
// app.tsx
|
||||||
|
export function MyApp ({ children }: { children: React.ReactNode }) {
|
||||||
|
return (
|
||||||
|
<JazzProvider
|
||||||
|
sync={syncConfig}
|
||||||
|
|
||||||
|
// Enable guest mode for account-less access
|
||||||
|
guestMode={false}
|
||||||
|
|
||||||
|
// Set default name for new user profiles
|
||||||
|
defaultProfileName="New User"
|
||||||
|
|
||||||
|
// Handle user logout
|
||||||
|
onLogOut={() => {
|
||||||
|
console.log("User logged out");
|
||||||
|
}}
|
||||||
|
|
||||||
|
// Handle anonymous account data when user logs in to existing account
|
||||||
|
onAnonymousAccountDiscarded={(account) => {
|
||||||
|
console.log("Anonymous account discarded", account.id);
|
||||||
|
// Migrate data here
|
||||||
|
return Promise.resolve();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</JazzProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</CodeGroup>
|
||||||
|
|
||||||
|
See [Authentication States](/docs/authentication/authentication-states) for more information on authentication states, guest mode, and handling anonymous accounts.
|
||||||
|
|
||||||
|
## Authentication
|
||||||
|
|
||||||
|
`<JazzProvider />` works with various authentication methods to enable users to access their data across multiple devices. For a complete guide to authentication, see our [Authentication Overview](/docs/authentication/overview).
|
||||||
|
|
||||||
|
## Need Help?
|
||||||
|
|
||||||
|
If you have questions about configuring the Jazz Provider for your specific use case, [join our Discord community](https://discord.gg/utDMjHYg42) for help.
|
||||||
@@ -70,7 +70,7 @@ If you are not working within a monorepo, create a new file `metro.config.js` in
|
|||||||
// @noErrors: 2304
|
// @noErrors: 2304
|
||||||
// metro.config.js
|
// metro.config.js
|
||||||
const { getDefaultConfig } = require("expo/metro-config");
|
const { getDefaultConfig } = require("expo/metro-config");
|
||||||
const config = getDefaultConfig(projectRoot);
|
const config = getDefaultConfig(__dirname);
|
||||||
|
|
||||||
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
|
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
|
||||||
config.resolver.requireCycleIgnorePatterns = [/(^|\/|\\)node_modules($|\/|\\)/];
|
config.resolver.requireCycleIgnorePatterns = [/(^|\/|\\)node_modules($|\/|\\)/];
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user