Compare commits
370 Commits
jazz-react
...
cojson-sto
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47ad35085e | ||
|
|
0b0d06ea44 | ||
|
|
ec546b4cd6 | ||
|
|
cadc5ef913 | ||
|
|
f961dedbd0 | ||
|
|
c7b27e902b | ||
|
|
b1cbc9283a | ||
|
|
f2c7c20a75 | ||
|
|
53705d0ac1 | ||
|
|
4031b7532f | ||
|
|
5ac43c300d | ||
|
|
064174501e | ||
|
|
b0c2a5a53f | ||
|
|
24d9a6b7e1 | ||
|
|
e270295387 | ||
|
|
67fa7be0d4 | ||
|
|
3431076350 | ||
|
|
e8092141e8 | ||
|
|
a2aac6791d | ||
|
|
aebd1519c3 | ||
|
|
2e0378639c | ||
|
|
5ba76eeab5 | ||
|
|
279fc1c390 | ||
|
|
865b0e81a7 | ||
|
|
829ab08873 | ||
|
|
2c9b08a080 | ||
|
|
48bda8854f | ||
|
|
2858db7419 | ||
|
|
96ed9adf59 | ||
|
|
5e4905ca99 | ||
|
|
1d4949b70c | ||
|
|
7dacfd03f9 | ||
|
|
bd4191520e | ||
|
|
e3dfb1b06e | ||
|
|
7de210f225 | ||
|
|
d456a8c124 | ||
|
|
1676ff852a | ||
|
|
2217e12ba6 | ||
|
|
a8af6efe1a | ||
|
|
519eda0ac2 | ||
|
|
a8725abfb4 | ||
|
|
2229e5a64f | ||
|
|
ee11b30d3a | ||
|
|
ef78d58729 | ||
|
|
40e2dd0ece | ||
|
|
b60c7c1ce0 | ||
|
|
69cd362114 | ||
|
|
526bf0a3cf | ||
|
|
439f0fe57e | ||
|
|
686433f42e | ||
|
|
3ba258e181 | ||
|
|
d6e143e4d5 | ||
|
|
3e6229da4d | ||
|
|
adfc9a6032 | ||
|
|
1a6879b1c2 | ||
|
|
172fec56f6 | ||
|
|
13892071f5 | ||
|
|
b62d75b847 | ||
|
|
beafbd3088 | ||
|
|
653d8ba69f | ||
|
|
6c23dab790 | ||
|
|
80530a4065 | ||
|
|
e14e61f7d9 | ||
|
|
2ba5ea684e | ||
|
|
a8466946d3 | ||
|
|
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 | ||
|
|
02a240ce75 | ||
|
|
6b781cf4a6 | ||
|
|
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 | ||
|
|
b675249960 | ||
|
|
05198e4181 | ||
|
|
ec9cb40fa4 | ||
|
|
dafea6039b | ||
|
|
ccc5f89ed7 | ||
|
|
fae9b521b8 | ||
|
|
ec1e2e4539 | ||
|
|
9550dcd6e7 | ||
|
|
4547525579 | ||
|
|
856ba0c1fa | ||
|
|
aaf217c61b | ||
|
|
29e05c4ad4 | ||
|
|
65719f21a3 | ||
|
|
05ff90c3c4 | ||
|
|
07408970bd | ||
|
|
ebd5ae2985 | ||
|
|
b0270e72d2 | ||
|
|
95c3001a7f | ||
|
|
4ba3ea6b4e | ||
|
|
fc6eab7efe | ||
|
|
c30fb098fe | ||
|
|
2ff226cf9a | ||
|
|
08bd887ab7 | ||
|
|
3396ed4b72 | ||
|
|
a703bc3102 | ||
|
|
18dc96c7b1 | ||
|
|
f8d9e9f5c8 | ||
|
|
e9e7f45e02 | ||
|
|
3b96af8686 | ||
|
|
49fb6311ad | ||
|
|
bce150c391 | ||
|
|
f8f07941fa | ||
|
|
6a1b01417b | ||
|
|
db60152b73 | ||
|
|
ebf082c145 | ||
|
|
f8b98ee3e1 | ||
|
|
01ef60bf04 | ||
|
|
17273a60e7 | ||
|
|
0439f4c404 | ||
|
|
e47fe35b15 | ||
|
|
f9e4520d64 | ||
|
|
91f23ee555 | ||
|
|
d06df65bd9 | ||
|
|
e9b9b85695 | ||
|
|
6a97cfd53d | ||
|
|
3497beea9e | ||
|
|
7ecd643719 | ||
|
|
4c26d43e2e | ||
|
|
b089f0bb5d | ||
|
|
d6c99a3ab9 | ||
|
|
fb41802011 | ||
|
|
e4313d94ed | ||
|
|
30bc01a4fd | ||
|
|
de6eccd197 | ||
|
|
ca6e98359c | ||
|
|
092fed118a | ||
|
|
3bb702d520 | ||
|
|
5f1979a61a | ||
|
|
1861867708 | ||
|
|
9ef32e0039 | ||
|
|
375db82ad4 | ||
|
|
1d2ed44548 | ||
|
|
e0dd4b678a | ||
|
|
db113ba816 | ||
|
|
6f58c43b48 | ||
|
|
0ff0710226 | ||
|
|
ce5c5a1558 | ||
|
|
500fc29a9e | ||
|
|
b7976929d0 | ||
|
|
6db4e8837c | ||
|
|
588a9aff0b | ||
|
|
399057b262 | ||
|
|
12daa15ef7 | ||
|
|
9356ffbd4e | ||
|
|
866d1b310a | ||
|
|
225103b095 | ||
|
|
328227316c | ||
|
|
dd5fe12dfe | ||
|
|
f837cfe994 | ||
|
|
f80bef8fef | ||
|
|
1bba26081b | ||
|
|
9efb2e2dd8 | ||
|
|
4b12b051e3 | ||
|
|
6bf2ddb7a8 | ||
|
|
978c30a7ca | ||
|
|
e2c02824e7 | ||
|
|
e05dff9c32 | ||
|
|
267ea4cf46 | ||
|
|
53b2cd93eb | ||
|
|
95cee57379 | ||
|
|
a5df996d67 | ||
|
|
a518e8b667 | ||
|
|
673197cf8e | ||
|
|
9a9aa1e811 | ||
|
|
cdc5cbd6d6 | ||
|
|
f55097c480 | ||
|
|
e9695fa2eb | ||
|
|
0c11110567 | ||
|
|
f2db858221 | ||
|
|
a362cbba51 | ||
|
|
39c2586d3b | ||
|
|
e5eed7bd35 | ||
|
|
39ae497153 | ||
|
|
e0b5df7f9e | ||
|
|
264c1c1fa5 | ||
|
|
54b2907f08 | ||
|
|
f3e0b1ed74 | ||
|
|
ca9162476c | ||
|
|
f98f6f1a7a | ||
|
|
2624d037f3 | ||
|
|
2d7917b169 | ||
|
|
06db1dd423 |
@@ -15,6 +15,7 @@
|
||||
"jazz-browser-media-images",
|
||||
"jazz-expo",
|
||||
"jazz-inspector",
|
||||
"jazz-inspector-element",
|
||||
"jazz-nodejs",
|
||||
"jazz-react",
|
||||
"jazz-react-core",
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
"packages/jazz-svelte/**",
|
||||
"examples/*svelte*/**",
|
||||
"examples/jazz-paper-scissors/src/routeTree.gen.ts",
|
||||
"homepage/homepage/**"
|
||||
"homepage/homepage/**",
|
||||
"**/package.json"
|
||||
]
|
||||
},
|
||||
"formatter": {
|
||||
|
||||
@@ -1,5 +1,122 @@
|
||||
# chat-rn-expo-clerk
|
||||
|
||||
## 1.0.115
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-expo@0.13.23
|
||||
- jazz-react-native-media-images@0.13.23
|
||||
|
||||
## 1.0.114
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-expo@0.13.22
|
||||
|
||||
## 1.0.113
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-expo@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
- jazz-react-native-media-images@0.13.21
|
||||
|
||||
## 1.0.112
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-expo@0.13.20
|
||||
- jazz-react-native-media-images@0.13.20
|
||||
|
||||
## 1.0.111
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-expo@0.13.19
|
||||
- jazz-react-native-media-images@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-expo@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
- jazz-react-native-media-images@0.13.13
|
||||
|
||||
## 1.0.104
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-expo@0.13.12
|
||||
- jazz-react-native-media-images@0.13.12
|
||||
|
||||
## 1.0.103
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-expo@0.13.11
|
||||
- jazz-react-native-media-images@0.13.11
|
||||
|
||||
## 1.0.102
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-expo@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
- jazz-react-native-media-images@0.13.10
|
||||
|
||||
## 1.0.101
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "chat-rn-expo-clerk",
|
||||
"main": "index.js",
|
||||
"version": "1.0.101",
|
||||
"version": "1.0.115",
|
||||
"scripts": {
|
||||
"build": "expo export -p ios",
|
||||
"start": "expo start",
|
||||
|
||||
@@ -1,5 +1,109 @@
|
||||
# chat-rn-expo
|
||||
|
||||
## 1.0.102
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-expo@0.13.23
|
||||
|
||||
## 1.0.101
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-expo@0.13.22
|
||||
|
||||
## 1.0.100
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-expo@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 1.0.99
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-expo@0.13.20
|
||||
|
||||
## 1.0.98
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-expo@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-expo@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 1.0.91
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-expo@0.13.12
|
||||
|
||||
## 1.0.90
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-expo@0.13.11
|
||||
|
||||
## 1.0.89
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-expo@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 1.0.88
|
||||
|
||||
### Patch Changes
|
||||
|
||||
55
examples/chat-rn-expo/app.config.js
Normal file
55
examples/chat-rn-expo/app.config.js
Normal file
@@ -0,0 +1,55 @@
|
||||
const { withBuildProperties } = require("expo-build-properties");
|
||||
const { withDangerousMod } = require("@expo/config-plugins");
|
||||
const fs = require("fs/promises");
|
||||
const path = require("path");
|
||||
|
||||
/**
|
||||
* https://github.com/mrousavy/nitro/issues/422#issuecomment-2545988256
|
||||
*/
|
||||
function withCustomIosMod(config) {
|
||||
// Use expo-build-properties to bump iOS deployment target
|
||||
config = withBuildProperties(config, { ios: { deploymentTarget: "16.0" } });
|
||||
// Patch the generated Podfile fallback to ensure platform is always 16.0
|
||||
config = withDangerousMod(config, [
|
||||
"ios",
|
||||
async (modConfig) => {
|
||||
const podfilePath = path.join(
|
||||
modConfig.modRequest.platformProjectRoot,
|
||||
"Podfile",
|
||||
);
|
||||
let contents = await fs.readFile(podfilePath, "utf-8");
|
||||
|
||||
// Check if the IPHONEOS_DEPLOYMENT_TARGET setting is already present
|
||||
// We search for the key being assigned, e.g., config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] =
|
||||
const deploymentTargetSettingExists =
|
||||
/\.build_settings\s*\[\s*['"]IPHONEOS_DEPLOYMENT_TARGET['"]\s*\]\s*=/.test(
|
||||
contents,
|
||||
);
|
||||
|
||||
if (!deploymentTargetSettingExists) {
|
||||
// IPHONEOS_DEPLOYMENT_TARGET setting not found, proceed to add it.
|
||||
contents = contents.replace(
|
||||
/(post_install\s+do\s+\|installer\|[\s\S]*?)(\r?\n\s end\s*)$/m,
|
||||
`$1
|
||||
|
||||
# Expo Build Properties: force deployment target
|
||||
# https://github.com/mrousavy/nitro/issues/422#issuecomment-2545988256
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
|
||||
end
|
||||
end
|
||||
$2`,
|
||||
);
|
||||
}
|
||||
|
||||
await fs.writeFile(podfilePath, contents);
|
||||
return modConfig;
|
||||
},
|
||||
]);
|
||||
return config;
|
||||
}
|
||||
|
||||
module.exports = ({ config }) => {
|
||||
return withCustomIosMod(config);
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chat-rn-expo",
|
||||
"version": "1.0.88",
|
||||
"version": "1.0.102",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "expo export -p ios",
|
||||
@@ -36,6 +36,8 @@
|
||||
"react-dom": "18.3.1",
|
||||
"react-native": "0.76.7",
|
||||
"react-native-get-random-values": "^1.11.0",
|
||||
"react-native-nitro-modules": "0.25.2",
|
||||
"react-native-quick-crypto": "1.0.0-beta.15",
|
||||
"react-native-safe-area-context": "4.12.0",
|
||||
"react-native-screens": "4.4.0",
|
||||
"react-native-url-polyfill": "^2.0.0",
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from "@react-navigation/native";
|
||||
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
||||
import * as Linking from "expo-linking";
|
||||
import { RNQuickCrypto } from "jazz-expo/crypto";
|
||||
import React, { StrictMode, useEffect, useState } from "react";
|
||||
import HandleInviteScreen from "./invite";
|
||||
|
||||
@@ -46,6 +47,7 @@ function App() {
|
||||
return (
|
||||
<StrictMode>
|
||||
<JazzProvider
|
||||
CryptoProvider={RNQuickCrypto}
|
||||
sync={{
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
}}
|
||||
|
||||
@@ -20,6 +20,7 @@ import { Chat, Message } from "./schema";
|
||||
export default function ChatScreen({ navigation }: { navigation: any }) {
|
||||
const { me, logOut } = useAccount();
|
||||
const [chatId, setChatId] = useState<ID<Chat>>();
|
||||
const [chatIdInput, setChatIdInput] = useState<string>();
|
||||
const loadedChat = useCoState(Chat, chatId, { resolve: { $each: true } });
|
||||
const [message, setMessage] = useState("");
|
||||
const profile = useCoState(Profile, me._refs.profile?.id, {});
|
||||
@@ -57,27 +58,11 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
||||
};
|
||||
|
||||
const joinChat = () => {
|
||||
Alert.prompt(
|
||||
"Join Chat",
|
||||
"Enter the Chat ID (example: co_zBGEHYvRfGuT2YSBraY3njGjnde)",
|
||||
[
|
||||
{
|
||||
text: "Cancel",
|
||||
style: "cancel",
|
||||
},
|
||||
{
|
||||
text: "Join",
|
||||
onPress: (chatId) => {
|
||||
if (chatId) {
|
||||
setChatId(chatId as ID<Chat>);
|
||||
} else {
|
||||
Alert.alert("Error", "Chat ID cannot be empty.");
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
"plain-text",
|
||||
);
|
||||
if (chatIdInput) {
|
||||
setChatId(chatIdInput as ID<Chat>);
|
||||
} else {
|
||||
Alert.alert("Error", "Chat ID cannot be empty.");
|
||||
}
|
||||
};
|
||||
|
||||
const sendMessage = () => {
|
||||
@@ -160,9 +145,25 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
||||
>
|
||||
<Text className="text-white font-semibold">Start new chat</Text>
|
||||
</TouchableOpacity>
|
||||
<Text className="text-m font-bold mt-6">Join existing chat</Text>
|
||||
<TextInput
|
||||
className="rounded h-12 p-2 m-2 mt-4 w-80 border border-gray-200 block"
|
||||
placeholder="Chat ID"
|
||||
value={chatIdInput ?? ""}
|
||||
onChangeText={(value) => {
|
||||
setChatIdInput(value);
|
||||
}}
|
||||
textAlignVertical="center"
|
||||
onSubmitEditing={() => {
|
||||
if (chatIdInput) {
|
||||
setChatId(chatIdInput as ID<Chat>);
|
||||
}
|
||||
}}
|
||||
testID="chat-id-input"
|
||||
/>
|
||||
<TouchableOpacity
|
||||
onPress={joinChat}
|
||||
className="bg-green-500 p-4 rounded-md mt-4"
|
||||
className="bg-green-500 p-4 rounded-md"
|
||||
>
|
||||
<Text className="text-white font-semibold">Join chat</Text>
|
||||
</TouchableOpacity>
|
||||
@@ -172,7 +173,6 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
||||
<FlatList
|
||||
contentContainerStyle={{
|
||||
flexGrow: 1,
|
||||
flex: 1,
|
||||
gap: 6,
|
||||
padding: 8,
|
||||
}}
|
||||
|
||||
@@ -9,6 +9,8 @@ appId: com.jazz.chatrn
|
||||
# - tapOn: "Reload"
|
||||
|
||||
# login
|
||||
- assertVisible: "Logout"
|
||||
- tapOn: "Logout"
|
||||
- assertVisible: "Anonymous user"
|
||||
- runFlow:
|
||||
label: "Erase existing username"
|
||||
@@ -42,9 +44,11 @@ appId: com.jazz.chatrn
|
||||
# logout
|
||||
- tapOn: "Logout"
|
||||
- assertVisible: "Anonymous user"
|
||||
# This doesn't work on CI, maybe because Android has a different alert dialog
|
||||
# - tapOn: "Join chat"
|
||||
# - inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
|
||||
# - pressKey: "enter"
|
||||
# - assertVisible: "boorad"
|
||||
# - assertVisible: "bro, low key, it do be like that tho"
|
||||
|
||||
# join chat
|
||||
- tapOn:
|
||||
id: "chat-id-input"
|
||||
- inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
|
||||
- tapOn: "Join chat"
|
||||
- assertVisible: "boorad"
|
||||
- assertVisible: "bro, low key, it do be like that tho"
|
||||
|
||||
@@ -1,5 +1,153 @@
|
||||
# chat-rn
|
||||
|
||||
## 1.0.110
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6b781cf]
|
||||
- Updated dependencies [02a240c]
|
||||
- cojson@0.13.23
|
||||
- jazz-tools@0.13.23
|
||||
- cojson-transport-ws@0.13.23
|
||||
- jazz-react-native@0.13.23
|
||||
|
||||
## 1.0.109
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.13.22
|
||||
|
||||
## 1.0.108
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [e14e61f]
|
||||
- cojson@0.13.21
|
||||
- cojson-transport-ws@0.13.21
|
||||
- jazz-react-native@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 1.0.107
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [adfc9a6]
|
||||
- Updated dependencies [1389207]
|
||||
- Updated dependencies [d6e143e]
|
||||
- Updated dependencies [439f0fe]
|
||||
- Updated dependencies [3e6229d]
|
||||
- cojson@0.13.20
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react-native@0.13.20
|
||||
- cojson-transport-ws@0.13.20
|
||||
|
||||
## 1.0.106
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react-native@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ec9cb40]
|
||||
- cojson@0.13.13
|
||||
- cojson-transport-ws@0.13.13
|
||||
- jazz-react-native@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 1.0.99
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- Updated dependencies [65719f2]
|
||||
- jazz-tools@0.13.12
|
||||
- cojson@0.13.12
|
||||
- jazz-react-native@0.13.12
|
||||
- cojson-transport-ws@0.13.12
|
||||
|
||||
## 1.0.98
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- Updated dependencies [3396ed4]
|
||||
- Updated dependencies [17273a6]
|
||||
- Updated dependencies [267ea4c]
|
||||
- cojson@0.13.11
|
||||
- jazz-tools@0.13.11
|
||||
- cojson-transport-ws@0.13.11
|
||||
- jazz-react-native@0.13.11
|
||||
|
||||
## 1.0.97
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [f837cfe]
|
||||
- cojson@0.13.10
|
||||
- cojson-transport-ws@0.13.10
|
||||
- jazz-react-native@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 1.0.96
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chat-rn",
|
||||
"version": "1.0.96",
|
||||
"version": "1.0.110",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"android": "react-native run-android",
|
||||
|
||||
@@ -1,5 +1,116 @@
|
||||
# chat-vue
|
||||
|
||||
## 0.0.93
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-browser@0.13.23
|
||||
- jazz-vue@0.13.23
|
||||
|
||||
## 0.0.92
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
- jazz-vue@0.13.21
|
||||
|
||||
## 0.0.91
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-browser@0.13.20
|
||||
- jazz-vue@0.13.20
|
||||
|
||||
## 0.0.90
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-browser@0.13.19
|
||||
- jazz-vue@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
- jazz-vue@0.13.13
|
||||
|
||||
## 0.0.83
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- Updated dependencies [29e05c4]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-browser@0.13.12
|
||||
- jazz-vue@0.13.12
|
||||
|
||||
## 0.0.82
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-browser@0.13.11
|
||||
- jazz-vue@0.13.11
|
||||
|
||||
## 0.0.81
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
- jazz-vue@0.13.10
|
||||
|
||||
## 0.0.80
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chat-vue",
|
||||
"version": "0.0.80",
|
||||
"version": "0.0.93",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,116 @@
|
||||
# jazz-example-chat
|
||||
|
||||
## 0.0.191
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-inspector@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.190
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7de210f]
|
||||
- jazz-inspector@0.13.21
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.189
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-inspector@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.188
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-inspector@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.13.13
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.181
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-inspector@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.180
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-inspector@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.179
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.13.10
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.178
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-chat",
|
||||
"private": true,
|
||||
"version": "0.0.178",
|
||||
"version": "0.0.191",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,115 @@
|
||||
# minimal-auth-clerk
|
||||
|
||||
## 0.0.90
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
- jazz-react-auth-clerk@0.13.23
|
||||
|
||||
## 0.0.89
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-react-auth-clerk@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.88
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
- jazz-react-auth-clerk@0.13.20
|
||||
|
||||
## 0.0.87
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
- jazz-react-auth-clerk@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-react-auth-clerk@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.80
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
- jazz-react-auth-clerk@0.13.12
|
||||
|
||||
## 0.0.79
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
- jazz-react-auth-clerk@0.13.11
|
||||
|
||||
## 0.0.78
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-react-auth-clerk@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.77
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "clerk",
|
||||
"private": true,
|
||||
"version": "0.0.77",
|
||||
"version": "0.0.90",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,112 @@
|
||||
# file-share-svelte
|
||||
|
||||
## 0.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ec546b4]
|
||||
- jazz-svelte@0.13.24
|
||||
|
||||
## 0.0.73
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3431076]
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-svelte@0.13.23
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-inspector-element@0.13.23
|
||||
|
||||
## 0.0.72
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector-element@0.13.21
|
||||
- jazz-svelte@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.71
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-svelte@0.13.20
|
||||
|
||||
## 0.0.70
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-svelte@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.63
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-svelte@0.13.12
|
||||
|
||||
## 0.0.62
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-svelte@0.13.11
|
||||
|
||||
## 0.0.61
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.60
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "file-share-svelte",
|
||||
"version": "0.0.60",
|
||||
"version": "0.0.74",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -39,6 +39,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/typography": "^0.5.15",
|
||||
"jazz-inspector-element": "workspace:*",
|
||||
"jazz-svelte": "workspace:*",
|
||||
"jazz-tools": "workspace:*",
|
||||
"lucide-svelte": "^0.463.0",
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
import { SharedFile } from '$lib/schema';
|
||||
import { FileStream } from 'jazz-tools';
|
||||
import { File, FileDown, Trash2, Link2 } from 'lucide-svelte';
|
||||
import { useAccount } from 'jazz-svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { formatFileSize } from '$lib/utils';
|
||||
import { downloadFileBlob, formatFileSize } from '$lib/utils';
|
||||
|
||||
const {
|
||||
file,
|
||||
@@ -17,32 +16,22 @@
|
||||
onDelete: (file: SharedFile) => void;
|
||||
} = $props();
|
||||
|
||||
const { me } = useAccount();
|
||||
const isAdmin = $derived(me && file._owner?.myRole() === 'admin');
|
||||
const isAdmin = $derived(file._owner?.myRole() === 'admin');
|
||||
const fileStreamId = $derived(file._refs.file?.id);
|
||||
|
||||
async function downloadFile() {
|
||||
if (!file._refs.file?.id || !me) {
|
||||
if (!fileStreamId) {
|
||||
toast.error('Failed to download file');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const fileId = file._refs.file.id;
|
||||
|
||||
// Load the file as a blob, can take a while
|
||||
const blob = await FileStream.loadAsBlob(fileId, me, {});
|
||||
const blob = await FileStream.loadAsBlob(fileStreamId);
|
||||
if (!blob) {
|
||||
toast.error('Failed to download file');
|
||||
return;
|
||||
}
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = file.name;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
downloadFileBlob(blob, file.name);
|
||||
toast.success('File downloaded successfully');
|
||||
} catch (error) {
|
||||
console.error('Error downloading file:', error);
|
||||
@@ -66,14 +55,19 @@
|
||||
class="flex items-center justify-between rounded-lg border border-gray-200 bg-white p-4"
|
||||
transition:slide={{ duration: 200 }}
|
||||
>
|
||||
<div class="flex items-center space-x-4">
|
||||
<div class="flex items-center space-x-4 flex-grow">
|
||||
<div class="flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600">
|
||||
<File class="h-6 w-6" />
|
||||
</div>
|
||||
<div>
|
||||
<a href="/file/{file.id}" class="hover:text-blue-600 hover:underline">
|
||||
<div class="flex-grow">
|
||||
{#if isAdmin}
|
||||
<label class="sr-only" for={`file-name-${file.id}`}>File name</label>
|
||||
<!-- Jazz values are reactive, but they are not recognized as reactive by Svelte -->
|
||||
<!-- svelte-ignore binding_property_non_reactive -->
|
||||
<input class="font-medium text-gray-900 w-full py-1" type="text" bind:value={file.name} id={`file-name-${file.id}`} />
|
||||
{:else}
|
||||
<h3 class="font-medium text-gray-900">{file.name}</h3>
|
||||
</a>
|
||||
{/if}
|
||||
<p class="text-sm text-gray-500">
|
||||
{isAdmin ? 'Owned by you' : ''} • Uploaded {new Date(
|
||||
file.createdAt || 0
|
||||
|
||||
@@ -15,9 +15,8 @@ export class FileShareProfile extends Profile {
|
||||
export class ListOfSharedFiles extends CoList.Of(co.ref(SharedFile)) {}
|
||||
|
||||
export class FileShareAccountRoot extends CoMap {
|
||||
type = co.string;
|
||||
type = co.literal('file-share-account');
|
||||
sharedFiles = co.ref(ListOfSharedFiles);
|
||||
publicGroup = co.ref(Group);
|
||||
}
|
||||
|
||||
export class FileShareAccount extends Account {
|
||||
@@ -31,7 +30,7 @@ export class FileShareAccount extends Account {
|
||||
await this._refs.root?.load();
|
||||
|
||||
// Initialize root if it doesn't exist
|
||||
if (!this.root || this.root.type !== 'file-share-account') {
|
||||
if (this.root === undefined || this.root?.type !== 'file-share-account') {
|
||||
// Create a group that will own all shared files
|
||||
const publicGroup = Group.create({ owner: this });
|
||||
publicGroup.addMember('everyone', 'reader');
|
||||
@@ -40,9 +39,7 @@ export class FileShareAccount extends Account {
|
||||
{
|
||||
type: 'file-share-account',
|
||||
sharedFiles: ListOfSharedFiles.create([], { owner: publicGroup }),
|
||||
publicGroup
|
||||
},
|
||||
{ owner: this }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,3 +20,13 @@ export function formatFileSize(bytes: number): string {
|
||||
export function generateTempFileId(fileName: string | undefined, createdAt: Date | undefined): string {
|
||||
return `file-${fileName ?? 'unknown'}-${createdAt?.getTime() ?? 0}`;
|
||||
}
|
||||
|
||||
export function downloadFileBlob(blob: Blob, fileName: string) {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = fileName;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
}
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { JazzProvider } from 'jazz-svelte';
|
||||
import { PasskeyAuthBasicUI, usePasskeyAuth } from 'jazz-svelte';
|
||||
import "jazz-inspector-element"
|
||||
import { PasskeyAuthBasicUI } from 'jazz-svelte';
|
||||
import { Toaster } from 'svelte-sonner';
|
||||
import '../app.css';
|
||||
import { FileShareAccount } from '$lib/schema';
|
||||
@@ -29,6 +30,7 @@
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
}}
|
||||
>
|
||||
<jazz-inspector></jazz-inspector>
|
||||
<PasskeyAuthBasicUI appName="File Share">
|
||||
<div class="min-h-screen bg-gray-100">
|
||||
{@render children()}
|
||||
|
||||
@@ -1,54 +1,38 @@
|
||||
<script lang="ts">
|
||||
import { useAccount, useCoState } from 'jazz-svelte';
|
||||
import { SharedFile, ListOfSharedFiles } from '$lib/schema';
|
||||
import { createInviteLink } from 'jazz-svelte';
|
||||
import { AccountCoState } from 'jazz-svelte';
|
||||
import { SharedFile } from '$lib/schema';
|
||||
import { FileStream } from 'jazz-tools';
|
||||
import FileItem from '$lib/components/FileItem.svelte';
|
||||
import { SvelteMap } from 'svelte/reactivity';
|
||||
import { generateTempFileId } from '$lib/utils';
|
||||
import { CloudUpload } from 'lucide-svelte';
|
||||
|
||||
const { me, logOut } = useAccount();
|
||||
const me = new AccountCoState({
|
||||
resolve: {
|
||||
profile: true,
|
||||
root: {
|
||||
sharedFiles: {
|
||||
$each: true
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const mySharedFilesId = me?.root?._refs.sharedFiles.id;
|
||||
const sharedFiles = $derived(useCoState(ListOfSharedFiles, mySharedFilesId, [{}]));
|
||||
const sharedFiles = $derived(me.current?.root.sharedFiles);
|
||||
|
||||
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) {
|
||||
const input = event.target as HTMLInputElement;
|
||||
const files = input.files;
|
||||
|
||||
if (!files || !files.length || !me.root?.sharedFiles || !me.root.publicGroup) return;
|
||||
if (!files?.length || !sharedFiles) return;
|
||||
|
||||
const file = files[0];
|
||||
const fileName = file.name;
|
||||
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 {
|
||||
const ownership = { owner: me.root.publicGroup };
|
||||
|
||||
// Create a FileStream from the uploaded file
|
||||
const fileStream = await FileStream.createFromBlob(file, ownership);
|
||||
const fileStream = await FileStream.createFromBlob(file, sharedFiles._owner);
|
||||
|
||||
// Create the shared file entry
|
||||
const sharedFile = SharedFile.create(
|
||||
@@ -59,29 +43,22 @@
|
||||
uploadedAt: new Date(),
|
||||
size: file.size
|
||||
},
|
||||
ownership
|
||||
sharedFiles._owner
|
||||
);
|
||||
|
||||
// Add the file to the user's files list
|
||||
me.root.sharedFiles.push(sharedFile);
|
||||
sharedFiles.push(sharedFile);
|
||||
} finally {
|
||||
uploadingFiles.delete(fileId);
|
||||
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) {
|
||||
if (!me?.root?.sharedFiles || !sharedFiles.current) return;
|
||||
if (!sharedFiles) return;
|
||||
|
||||
const index = sharedFiles.current.indexOf(file);
|
||||
const index = sharedFiles.indexOf(file);
|
||||
if (index > -1) {
|
||||
me.root.sharedFiles.splice(index, 1);
|
||||
sharedFiles.splice(index, 1);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -91,11 +68,11 @@
|
||||
<div class="mb-12 flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="mb-2 text-4xl font-bold text-gray-900">File Share</h1>
|
||||
<h2 class="text-xl text-gray-600">Welcome back, {me?.profile?.name}</h2>
|
||||
<h2 class="text-xl text-gray-600">Welcome back, {me.current?.profile.name}</h2>
|
||||
</div>
|
||||
|
||||
<button
|
||||
onclick={logOut}
|
||||
onclick={me.logOut}
|
||||
class="rounded-lg bg-red-500 px-6 py-2.5 text-sm font-medium text-white transition-colors hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2"
|
||||
>
|
||||
Log Out
|
||||
@@ -126,14 +103,12 @@
|
||||
|
||||
<!-- Files List -->
|
||||
<div class="space-y-4">
|
||||
{#if sharedFiles.current}
|
||||
{#if !(sharedFiles.current.length === 0 && uploadingFiles.size === 0)}
|
||||
{#each [...sharedFiles.current, ...uploadingFiles.values()] as file (generateTempFileId(file?.name, file?.createdAt))}
|
||||
{#if sharedFiles}
|
||||
{#if sharedFiles.length}
|
||||
{#each sharedFiles as file}
|
||||
{#if file}
|
||||
<FileItem
|
||||
{file}
|
||||
loading={uploadingFiles.has(generateTempFileId(file?.name, file?.createdAt))}
|
||||
onShare={shareFile}
|
||||
onDelete={deleteFile}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -1,39 +1,33 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { useAccount, useCoState } from 'jazz-svelte';
|
||||
import { CoState } from 'jazz-svelte';
|
||||
import { SharedFile } from '$lib/schema';
|
||||
import { File, FileDown, Link2 } from 'lucide-svelte';
|
||||
import type { ID } from 'jazz-tools';
|
||||
import { FileStream } from 'jazz-tools';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { downloadFileBlob } from '$lib/utils';
|
||||
|
||||
const { me } = useAccount();
|
||||
const fileId = $page.params.fileId;
|
||||
|
||||
const file = $state(useCoState(SharedFile, fileId as ID<SharedFile>, {}));
|
||||
const isAdmin = $derived(me && file.current?._owner?.myRole() === 'admin');
|
||||
const file = $derived(new CoState(SharedFile, fileId as ID<SharedFile>));
|
||||
const isAdmin = $derived(file.current?._owner?.myRole() === 'admin');
|
||||
|
||||
const fileStreamId = $derived(file.current?._refs.file?.id);
|
||||
|
||||
async function downloadFile() {
|
||||
if (!file.current?._refs.file?.id || !me) {
|
||||
if (!fileStreamId || !file.current) {
|
||||
toast.error('Failed to download file');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const fileId = file.current._refs.file.id;
|
||||
const blob = await FileStream.loadAsBlob(fileId, me, {});
|
||||
const blob = await FileStream.loadAsBlob(fileStreamId);
|
||||
if (!blob) {
|
||||
toast.error('Failed to download file');
|
||||
return;
|
||||
}
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = file.current.name;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
downloadFileBlob(blob, file.current.name);
|
||||
toast.success('File downloaded successfully');
|
||||
} catch (error) {
|
||||
console.error('Error downloading file:', error);
|
||||
|
||||
@@ -59,7 +59,7 @@ test('can login with passkey and upload file', async ({ page, browser }) => {
|
||||
await fileChooser.setFiles(filePath);
|
||||
|
||||
// Verify the uploaded file appears in the list
|
||||
await expect(page.getByText('test-file.txt')).toBeVisible();
|
||||
await expect(page.getByRole("textbox", { name: "File name" })).toHaveValue("test-file.txt");
|
||||
|
||||
await page.getByRole('button', { name: 'Share file' }).click();
|
||||
const inviteLink = await page.evaluate(() => navigator.clipboard.readText());
|
||||
|
||||
@@ -1,5 +1,116 @@
|
||||
# jazz-tailwind-demo-auth-starter
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-inspector@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7de210f]
|
||||
- jazz-inspector@0.13.21
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-inspector@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-inspector@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.13.13
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-inspector@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-inspector@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.13.10
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "filestream",
|
||||
"private": true,
|
||||
"version": "0.0.17",
|
||||
"version": "0.0.30",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -189,7 +189,7 @@ export function FileWidget() {
|
||||
);
|
||||
}
|
||||
|
||||
const fileData = me?.profile?.file?.getChunks();
|
||||
const fileData = me?.profile?.file?.getMetadata();
|
||||
const mimeType = fileData?.mimeType || "unknown";
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# form
|
||||
|
||||
## 0.1.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.1.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.1.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.1.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.1.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.1.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.1.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.1.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "form",
|
||||
"private": true,
|
||||
"version": "0.1.18",
|
||||
"version": "0.1.31",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# image-upload
|
||||
|
||||
## 0.0.87
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.86
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.85
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.84
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.77
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.76
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-upload",
|
||||
"private": true,
|
||||
"version": "0.0.74",
|
||||
"version": "0.0.87",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,129 @@
|
||||
# jazz-example-inspector
|
||||
|
||||
## 0.0.141
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6b781cf]
|
||||
- cojson@0.13.23
|
||||
- cojson-transport-ws@0.13.23
|
||||
- jazz-inspector@0.13.23
|
||||
|
||||
## 0.0.140
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7de210f]
|
||||
- Updated dependencies [e14e61f]
|
||||
- jazz-inspector@0.13.21
|
||||
- cojson@0.13.21
|
||||
- cojson-transport-ws@0.13.21
|
||||
|
||||
## 0.0.139
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [adfc9a6]
|
||||
- Updated dependencies [1389207]
|
||||
- Updated dependencies [d6e143e]
|
||||
- Updated dependencies [3e6229d]
|
||||
- cojson@0.13.20
|
||||
- cojson-transport-ws@0.13.20
|
||||
- jazz-inspector@0.13.20
|
||||
|
||||
## 0.0.138
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ec9cb40]
|
||||
- cojson@0.13.13
|
||||
- cojson-transport-ws@0.13.13
|
||||
- jazz-inspector@0.13.13
|
||||
|
||||
## 0.0.131
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [65719f2]
|
||||
- cojson@0.13.12
|
||||
- jazz-inspector@0.13.12
|
||||
- cojson-transport-ws@0.13.12
|
||||
|
||||
## 0.0.130
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- Updated dependencies [3396ed4]
|
||||
- Updated dependencies [267ea4c]
|
||||
- cojson@0.13.11
|
||||
- cojson-transport-ws@0.13.11
|
||||
- jazz-inspector@0.13.11
|
||||
|
||||
## 0.0.129
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [f837cfe]
|
||||
- cojson@0.13.10
|
||||
- cojson-transport-ws@0.13.10
|
||||
- jazz-inspector@0.13.10
|
||||
|
||||
## 0.0.128
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-inspector-app",
|
||||
"private": true,
|
||||
"version": "0.0.128",
|
||||
"version": "0.0.141",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
"dev:worker": "tsx --watch --env-file=.env ./src/worker.ts",
|
||||
"build": "vite build && tsc",
|
||||
"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": {
|
||||
"@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";
|
||||
@@ -8,7 +8,10 @@ export function cn(...inputs: ClassValue[]) {
|
||||
/**
|
||||
* Given a player selections, returns the winner of the current game.
|
||||
*/
|
||||
export function determineWinner(player1Choice: string, player2Choice: string) {
|
||||
export function determineWinner(
|
||||
player1Choice: "rock" | "paper" | "scissors",
|
||||
player2Choice: "rock" | "paper" | "scissors",
|
||||
) {
|
||||
if (player1Choice === player2Choice) {
|
||||
return "draw";
|
||||
} else if (
|
||||
|
||||
@@ -3,6 +3,7 @@ import { StrictMode } from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
|
||||
import "./index.css";
|
||||
import { apiKey } from "@/apiKey.ts";
|
||||
import { JazzProvider } from "jazz-react";
|
||||
import { App } from "./app";
|
||||
|
||||
@@ -13,7 +14,7 @@ if (rootElement && !rootElement.innerHTML) {
|
||||
<StrictMode>
|
||||
<JazzProvider
|
||||
sync={{
|
||||
peer: "wss://cloud.jazz.tools/?key=jazz-paper-scissors@garden.co",
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
}}
|
||||
>
|
||||
<JazzInspector />
|
||||
|
||||
@@ -10,139 +10,139 @@
|
||||
|
||||
// Import Routes
|
||||
|
||||
import { Route as rootRoute } from "./routes/__root";
|
||||
import { Route as AuthenticatedImport } from "./routes/_authenticated";
|
||||
import { Route as IndexImport } from "./routes/index";
|
||||
import { Route as AuthenticatedWaitingRoomWaitingRoomIdImport } from "./routes/_authenticated/waiting-room.$waitingRoomId";
|
||||
import { Route as AuthenticatedGameGameIdImport } from "./routes/_authenticated/game.$gameId";
|
||||
import { Route as rootRoute } from './routes/__root'
|
||||
import { Route as AuthenticatedImport } from './routes/_authenticated'
|
||||
import { Route as IndexImport } from './routes/index'
|
||||
import { Route as AuthenticatedWaitingRoomWaitingRoomIdImport } from './routes/_authenticated/waiting-room.$waitingRoomId'
|
||||
import { Route as AuthenticatedGameGameIdImport } from './routes/_authenticated/game.$gameId'
|
||||
|
||||
// Create/Update Routes
|
||||
|
||||
const AuthenticatedRoute = AuthenticatedImport.update({
|
||||
id: "/_authenticated",
|
||||
id: '/_authenticated',
|
||||
getParentRoute: () => rootRoute,
|
||||
} as any);
|
||||
} as any)
|
||||
|
||||
const IndexRoute = IndexImport.update({
|
||||
id: "/",
|
||||
path: "/",
|
||||
id: '/',
|
||||
path: '/',
|
||||
getParentRoute: () => rootRoute,
|
||||
} as any);
|
||||
} as any)
|
||||
|
||||
const AuthenticatedWaitingRoomWaitingRoomIdRoute =
|
||||
AuthenticatedWaitingRoomWaitingRoomIdImport.update({
|
||||
id: "/waiting-room/$waitingRoomId",
|
||||
path: "/waiting-room/$waitingRoomId",
|
||||
id: '/waiting-room/$waitingRoomId',
|
||||
path: '/waiting-room/$waitingRoomId',
|
||||
getParentRoute: () => AuthenticatedRoute,
|
||||
} as any);
|
||||
} as any)
|
||||
|
||||
const AuthenticatedGameGameIdRoute = AuthenticatedGameGameIdImport.update({
|
||||
id: "/game/$gameId",
|
||||
path: "/game/$gameId",
|
||||
id: '/game/$gameId',
|
||||
path: '/game/$gameId',
|
||||
getParentRoute: () => AuthenticatedRoute,
|
||||
} as any);
|
||||
} as any)
|
||||
|
||||
// Populate the FileRoutesByPath interface
|
||||
|
||||
declare module "@tanstack/react-router" {
|
||||
declare module '@tanstack/react-router' {
|
||||
interface FileRoutesByPath {
|
||||
"/": {
|
||||
id: "/";
|
||||
path: "/";
|
||||
fullPath: "/";
|
||||
preLoaderRoute: typeof IndexImport;
|
||||
parentRoute: typeof rootRoute;
|
||||
};
|
||||
"/_authenticated": {
|
||||
id: "/_authenticated";
|
||||
path: "";
|
||||
fullPath: "";
|
||||
preLoaderRoute: typeof AuthenticatedImport;
|
||||
parentRoute: typeof rootRoute;
|
||||
};
|
||||
"/_authenticated/game/$gameId": {
|
||||
id: "/_authenticated/game/$gameId";
|
||||
path: "/game/$gameId";
|
||||
fullPath: "/game/$gameId";
|
||||
preLoaderRoute: typeof AuthenticatedGameGameIdImport;
|
||||
parentRoute: typeof AuthenticatedImport;
|
||||
};
|
||||
"/_authenticated/waiting-room/$waitingRoomId": {
|
||||
id: "/_authenticated/waiting-room/$waitingRoomId";
|
||||
path: "/waiting-room/$waitingRoomId";
|
||||
fullPath: "/waiting-room/$waitingRoomId";
|
||||
preLoaderRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdImport;
|
||||
parentRoute: typeof AuthenticatedImport;
|
||||
};
|
||||
'/': {
|
||||
id: '/'
|
||||
path: '/'
|
||||
fullPath: '/'
|
||||
preLoaderRoute: typeof IndexImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/_authenticated': {
|
||||
id: '/_authenticated'
|
||||
path: ''
|
||||
fullPath: ''
|
||||
preLoaderRoute: typeof AuthenticatedImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/_authenticated/game/$gameId': {
|
||||
id: '/_authenticated/game/$gameId'
|
||||
path: '/game/$gameId'
|
||||
fullPath: '/game/$gameId'
|
||||
preLoaderRoute: typeof AuthenticatedGameGameIdImport
|
||||
parentRoute: typeof AuthenticatedImport
|
||||
}
|
||||
'/_authenticated/waiting-room/$waitingRoomId': {
|
||||
id: '/_authenticated/waiting-room/$waitingRoomId'
|
||||
path: '/waiting-room/$waitingRoomId'
|
||||
fullPath: '/waiting-room/$waitingRoomId'
|
||||
preLoaderRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdImport
|
||||
parentRoute: typeof AuthenticatedImport
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create and export the route tree
|
||||
|
||||
interface AuthenticatedRouteChildren {
|
||||
AuthenticatedGameGameIdRoute: typeof AuthenticatedGameGameIdRoute;
|
||||
AuthenticatedWaitingRoomWaitingRoomIdRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdRoute;
|
||||
AuthenticatedGameGameIdRoute: typeof AuthenticatedGameGameIdRoute
|
||||
AuthenticatedWaitingRoomWaitingRoomIdRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
|
||||
}
|
||||
|
||||
const AuthenticatedRouteChildren: AuthenticatedRouteChildren = {
|
||||
AuthenticatedGameGameIdRoute: AuthenticatedGameGameIdRoute,
|
||||
AuthenticatedWaitingRoomWaitingRoomIdRoute:
|
||||
AuthenticatedWaitingRoomWaitingRoomIdRoute,
|
||||
};
|
||||
}
|
||||
|
||||
const AuthenticatedRouteWithChildren = AuthenticatedRoute._addFileChildren(
|
||||
AuthenticatedRouteChildren,
|
||||
);
|
||||
)
|
||||
|
||||
export interface FileRoutesByFullPath {
|
||||
"/": typeof IndexRoute;
|
||||
"": typeof AuthenticatedRouteWithChildren;
|
||||
"/game/$gameId": typeof AuthenticatedGameGameIdRoute;
|
||||
"/waiting-room/$waitingRoomId": typeof AuthenticatedWaitingRoomWaitingRoomIdRoute;
|
||||
'/': typeof IndexRoute
|
||||
'': typeof AuthenticatedRouteWithChildren
|
||||
'/game/$gameId': typeof AuthenticatedGameGameIdRoute
|
||||
'/waiting-room/$waitingRoomId': typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
|
||||
}
|
||||
|
||||
export interface FileRoutesByTo {
|
||||
"/": typeof IndexRoute;
|
||||
"": typeof AuthenticatedRouteWithChildren;
|
||||
"/game/$gameId": typeof AuthenticatedGameGameIdRoute;
|
||||
"/waiting-room/$waitingRoomId": typeof AuthenticatedWaitingRoomWaitingRoomIdRoute;
|
||||
'/': typeof IndexRoute
|
||||
'': typeof AuthenticatedRouteWithChildren
|
||||
'/game/$gameId': typeof AuthenticatedGameGameIdRoute
|
||||
'/waiting-room/$waitingRoomId': typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
|
||||
}
|
||||
|
||||
export interface FileRoutesById {
|
||||
__root__: typeof rootRoute;
|
||||
"/": typeof IndexRoute;
|
||||
"/_authenticated": typeof AuthenticatedRouteWithChildren;
|
||||
"/_authenticated/game/$gameId": typeof AuthenticatedGameGameIdRoute;
|
||||
"/_authenticated/waiting-room/$waitingRoomId": typeof AuthenticatedWaitingRoomWaitingRoomIdRoute;
|
||||
__root__: typeof rootRoute
|
||||
'/': typeof IndexRoute
|
||||
'/_authenticated': typeof AuthenticatedRouteWithChildren
|
||||
'/_authenticated/game/$gameId': typeof AuthenticatedGameGameIdRoute
|
||||
'/_authenticated/waiting-room/$waitingRoomId': typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
|
||||
}
|
||||
|
||||
export interface FileRouteTypes {
|
||||
fileRoutesByFullPath: FileRoutesByFullPath;
|
||||
fullPaths: "/" | "" | "/game/$gameId" | "/waiting-room/$waitingRoomId";
|
||||
fileRoutesByTo: FileRoutesByTo;
|
||||
to: "/" | "" | "/game/$gameId" | "/waiting-room/$waitingRoomId";
|
||||
fileRoutesByFullPath: FileRoutesByFullPath
|
||||
fullPaths: '/' | '' | '/game/$gameId' | '/waiting-room/$waitingRoomId'
|
||||
fileRoutesByTo: FileRoutesByTo
|
||||
to: '/' | '' | '/game/$gameId' | '/waiting-room/$waitingRoomId'
|
||||
id:
|
||||
| "__root__"
|
||||
| "/"
|
||||
| "/_authenticated"
|
||||
| "/_authenticated/game/$gameId"
|
||||
| "/_authenticated/waiting-room/$waitingRoomId";
|
||||
fileRoutesById: FileRoutesById;
|
||||
| '__root__'
|
||||
| '/'
|
||||
| '/_authenticated'
|
||||
| '/_authenticated/game/$gameId'
|
||||
| '/_authenticated/waiting-room/$waitingRoomId'
|
||||
fileRoutesById: FileRoutesById
|
||||
}
|
||||
|
||||
export interface RootRouteChildren {
|
||||
IndexRoute: typeof IndexRoute;
|
||||
AuthenticatedRoute: typeof AuthenticatedRouteWithChildren;
|
||||
IndexRoute: typeof IndexRoute
|
||||
AuthenticatedRoute: typeof AuthenticatedRouteWithChildren
|
||||
}
|
||||
|
||||
const rootRouteChildren: RootRouteChildren = {
|
||||
IndexRoute: IndexRoute,
|
||||
AuthenticatedRoute: AuthenticatedRouteWithChildren,
|
||||
};
|
||||
}
|
||||
|
||||
export const routeTree = rootRoute
|
||||
._addFileChildren(rootRouteChildren)
|
||||
._addFileTypes<FileRouteTypes>();
|
||||
._addFileTypes<FileRouteTypes>()
|
||||
|
||||
/* ROUTE_MANIFEST_START
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ import { type ID } from "jazz-tools";
|
||||
import { Badge, CircleHelp, Scissors, ScrollText } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const playIcon = (selection: string | undefined) => {
|
||||
const playIcon = (selection: "rock" | "paper" | "scissors" | undefined) => {
|
||||
switch (selection) {
|
||||
case "rock":
|
||||
return <Badge className="w-5 h-5" />;
|
||||
@@ -45,14 +45,14 @@ export const Route = createFileRoute("/_authenticated/game/$gameId")({
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
const { gameId, me, loaderGame } = Route.useLoaderData();
|
||||
const { gameId, loaderGame } = Route.useLoaderData();
|
||||
|
||||
const isPlayer1 = loaderGame.player1?.account?.isMe;
|
||||
const player = isPlayer1 ? "player1" : "player2";
|
||||
|
||||
const [playSelection, setPlaySelection] = useState(
|
||||
loaderGame[player]?.playSelection ?? "",
|
||||
);
|
||||
const [playSelection, setPlaySelection] = useState<
|
||||
"rock" | "paper" | "scissors" | undefined
|
||||
>(loaderGame[player]?.playSelection);
|
||||
const sendInboxMessage = experimental_useInboxSender(WORKER_ID);
|
||||
|
||||
const game = useCoState(Game, gameId as ID<Game>);
|
||||
@@ -62,7 +62,7 @@ function RouteComponent() {
|
||||
|
||||
return loaderGame.subscribe((game) => {
|
||||
if (gameCompleted && !game.outcome) {
|
||||
setPlaySelection(""); // Reset play selection when one player clicks on "Start a new game"
|
||||
setPlaySelection(undefined); // Reset play selection when one player clicks on "Start a new game"
|
||||
}
|
||||
|
||||
gameCompleted = Boolean(game.outcome);
|
||||
@@ -82,7 +82,10 @@ function RouteComponent() {
|
||||
|
||||
const opponentSelection = opponentPlayer?.playSelection;
|
||||
|
||||
const onSubmit = async (playSelection: string) => {
|
||||
const onSubmit = async (
|
||||
playSelection: "rock" | "paper" | "scissors" | undefined,
|
||||
) => {
|
||||
if (!playSelection) return;
|
||||
sendInboxMessage(
|
||||
PlayIntent.create({ type: "play", gameId, player, playSelection }),
|
||||
);
|
||||
@@ -117,7 +120,9 @@ function RouteComponent() {
|
||||
) : null}
|
||||
<CardContent>
|
||||
<div>
|
||||
{playSelection === "" ? "Make Your Selection" : "Your Selection: "}
|
||||
{playSelection === undefined
|
||||
? "Make Your Selection"
|
||||
: "Your Selection: "}
|
||||
</div>
|
||||
<CardSmall>{playIcon(playSelection)}</CardSmall>
|
||||
{gameComplete ? null : (
|
||||
@@ -148,7 +153,7 @@ function RouteComponent() {
|
||||
<div className="m-4">
|
||||
<Button
|
||||
disabled={
|
||||
playSelection === "" ||
|
||||
playSelection === undefined ||
|
||||
Boolean(currentPlayer?.playSelection)
|
||||
}
|
||||
onClick={() => onSubmit(playSelection)}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Account, CoMap, SchemaUnion, co } from "jazz-tools";
|
||||
import { Account, CoMap, co } from "jazz-tools";
|
||||
|
||||
export class Game extends CoMap {
|
||||
player1 = co.ref(Player);
|
||||
@@ -30,7 +30,7 @@ export class Game extends CoMap {
|
||||
|
||||
export class Player extends CoMap {
|
||||
account = co.ref(Account);
|
||||
playSelection? = co.string;
|
||||
playSelection? = co.literal("rock", "paper", "scissors");
|
||||
}
|
||||
|
||||
export class WaitingRoom extends CoMap {
|
||||
@@ -47,7 +47,7 @@ export class PlayIntent extends InboxMessage {
|
||||
type = co.literal("play");
|
||||
gameId = co.string;
|
||||
player = co.literal("player1", "player2");
|
||||
playSelection = co.string;
|
||||
playSelection = co.literal("rock", "paper", "scissors");
|
||||
}
|
||||
|
||||
export class NewGameIntent extends InboxMessage {
|
||||
|
||||
@@ -186,9 +186,9 @@ async function handlePlayIntent(_: ID<Account>, message: PlayIntent) {
|
||||
// once both players have a selection, determine the winner
|
||||
if (
|
||||
!!player1Selection &&
|
||||
player1Selection !== "" &&
|
||||
player1Selection !== undefined &&
|
||||
!!player2Selection &&
|
||||
player2Selection !== ""
|
||||
player2Selection !== undefined
|
||||
) {
|
||||
const outcome = determineWinner(player1Selection, player2Selection);
|
||||
game.outcome = outcome;
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# multi-cursors
|
||||
|
||||
## 0.0.83
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.82
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.81
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.80
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.73
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.72
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.71
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.70
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "multi-cursors",
|
||||
"private": true,
|
||||
"version": "0.0.70",
|
||||
"version": "0.0.83",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,115 @@
|
||||
# multiauth
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
- jazz-react-auth-clerk@0.13.23
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-react-auth-clerk@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
- jazz-react-auth-clerk@0.13.20
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
- jazz-react-auth-clerk@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-react-auth-clerk@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
- jazz-react-auth-clerk@0.13.12
|
||||
|
||||
## 0.0.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
- jazz-react-auth-clerk@0.13.11
|
||||
|
||||
## 0.0.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-react-auth-clerk@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "multiauth",
|
||||
"private": true,
|
||||
"version": "0.0.18",
|
||||
"version": "0.0.31",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,116 @@
|
||||
# jazz-example-musicplayer
|
||||
|
||||
## 0.0.112
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-inspector@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.111
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7de210f]
|
||||
- jazz-inspector@0.13.21
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.110
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-inspector@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.109
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-inspector@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.13.13
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.102
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-inspector@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.101
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-inspector@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.100
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.13.10
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.99
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-music-player",
|
||||
"private": true,
|
||||
"version": "0.0.99",
|
||||
"version": "0.0.112",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# organization
|
||||
|
||||
## 0.0.83
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.82
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.81
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.80
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.73
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.72
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.71
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.70
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "organization",
|
||||
"private": true,
|
||||
"version": "0.0.70",
|
||||
"version": "0.0.83",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,110 @@
|
||||
# passkey-svelte
|
||||
|
||||
## 0.0.78
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ec546b4]
|
||||
- jazz-svelte@0.13.24
|
||||
|
||||
## 0.0.77
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3431076]
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-svelte@0.13.23
|
||||
- jazz-tools@0.13.23
|
||||
|
||||
## 0.0.76
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-svelte@0.13.20
|
||||
|
||||
## 0.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-svelte@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-svelte@0.13.12
|
||||
|
||||
## 0.0.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-svelte@0.13.11
|
||||
|
||||
## 0.0.65
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "passkey-svelte",
|
||||
"version": "0.0.64",
|
||||
"version": "0.0.78",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# minimal-auth-passkey
|
||||
|
||||
## 0.0.88
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.87
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.86
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.85
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.78
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.77
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.76
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "passkey",
|
||||
"private": true,
|
||||
"version": "0.0.75",
|
||||
"version": "0.0.88",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# passphrase
|
||||
|
||||
## 0.0.85
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.84
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.83
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.82
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.73
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.72
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "passphrase",
|
||||
"private": true,
|
||||
"version": "0.0.72",
|
||||
"version": "0.0.85",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# jazz-password-manager
|
||||
|
||||
## 0.0.109
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.108
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.107
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.106
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.99
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.98
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.97
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.96
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-password-manager",
|
||||
"private": true,
|
||||
"version": "0.0.96",
|
||||
"version": "0.0.109",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# jazz-example-pets
|
||||
|
||||
## 0.0.207
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.206
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.205
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.204
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.197
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.196
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.195
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.194
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-pets",
|
||||
"private": true,
|
||||
"version": "0.0.194",
|
||||
"version": "0.0.207",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# reactions
|
||||
|
||||
## 0.0.87
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.86
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.85
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.84
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.77
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.76
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "reactions",
|
||||
"private": true,
|
||||
"version": "0.0.74",
|
||||
"version": "0.0.87",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
106
examples/richtext/CHANGELOG.md
Normal file
106
examples/richtext/CHANGELOG.md
Normal file
@@ -0,0 +1,106 @@
|
||||
# richtext
|
||||
|
||||
## 0.0.77
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
- jazz-richtext-prosemirror@0.1.11
|
||||
|
||||
## 0.0.76
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
- jazz-richtext-prosemirror@0.1.10
|
||||
|
||||
## 0.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
- jazz-richtext-prosemirror@0.1.9
|
||||
|
||||
## 0.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
- jazz-richtext-prosemirror@0.1.8
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
- jazz-richtext-prosemirror@0.1.2
|
||||
|
||||
## 0.0.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
- jazz-richtext-prosemirror@0.1.1
|
||||
|
||||
## 0.0.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-richtext-prosemirror@0.1.0
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
117
examples/richtext/README.md
Normal file
117
examples/richtext/README.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# Jazz RichText Example
|
||||
|
||||
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
|
||||
|
||||
This example shows how to implement collaborative rich text editing using:
|
||||
|
||||
- **Jazz** for real-time synchronization
|
||||
- **CoRichText** for collaborative rich text data structures
|
||||
- **ProseMirror** for the rich text editor UI
|
||||
- **React** for the component framework
|
||||
|
||||
The example features:
|
||||
|
||||
- Side-by-side plaintext and rich text editors
|
||||
- Real-time collaboration across devices
|
||||
- Persistent document storage
|
||||
## Getting started
|
||||
|
||||
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.
|
||||
|
||||
|
||||
### Using the example as a template
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npx create-jazz-app@latest richtext-app --example richtext
|
||||
```
|
||||
|
||||
Go to the new project directory.
|
||||
```bash
|
||||
cd richtext-app
|
||||
```
|
||||
|
||||
Run the dev server.
|
||||
```bash
|
||||
npm run 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.
|
||||
|
||||
## How it works
|
||||
|
||||
This example demonstrates two key functionalities:
|
||||
|
||||
1. **CoRichText** - Jazz's collaborative rich text data structure
|
||||
2. **Rich text integration** - Using ProseMirror with Jazz
|
||||
|
||||
### Key components
|
||||
|
||||
- `src/schema.ts` - Defines the data model, including the `bio` field using CoRichText
|
||||
- `src/Editor.tsx` - Implements both plaintext and rich text editor views
|
||||
- `jazz-richtext-prosemirror` - Provides the plugin that connects Jazz to ProseMirror
|
||||
|
||||
### Implementation details
|
||||
|
||||
The example shows how to:
|
||||
|
||||
- Create and store CoRichText values
|
||||
- Set up a plaintext editor with CoRichText
|
||||
- Set up a ProseMirror editor with a Jazz plugin
|
||||
|
||||
## Extending this example
|
||||
|
||||
You can extend this example by:
|
||||
|
||||
- Adding formatting options to the rich text toolbar
|
||||
- Implementing custom schema elements in ProseMirror
|
||||
- Adding multiple collaborative documents
|
||||
- Building document history or versioning
|
||||
|
||||
## Configuration: sync server
|
||||
|
||||
By default, the app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
|
||||
|
||||
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<Jazz.Provider>` provider component in [./src/main.tsx](./src/main.tsx).
|
||||
|
||||
## Learn more
|
||||
|
||||
To learn more about Jazz's collaborative text capabilities:
|
||||
|
||||
- [Jazz documentation](https://jazz.tools/docs)
|
||||
- [CoText documentation](https://jazz.tools/docs/using-covalues/cotext)
|
||||
- [ProseMirror documentation](https://prosemirror.net/docs/)
|
||||
|
||||
## Questions / problems / feedback
|
||||
|
||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
||||
BIN
examples/richtext/favicon.ico
Normal file
BIN
examples/richtext/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
13
examples/richtext/index.html
Normal file
13
examples/richtext/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en" class="h-full">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/png" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Rich text example app | Jazz</title>
|
||||
</head>
|
||||
<body class="h-full flex flex-col">
|
||||
<div id="root" class="align-self-center flex-1"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
42
examples/richtext/package.json
Normal file
42
examples/richtext/package.json
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "richtext",
|
||||
"private": true,
|
||||
"version": "0.0.77",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"preview": "vite preview",
|
||||
"test:e2e": "playwright test",
|
||||
"test:e2e:ui": "playwright test --ui",
|
||||
"format-and-lint": "biome check .",
|
||||
"format-and-lint:fix": "biome check . --write"
|
||||
},
|
||||
"dependencies": {
|
||||
"jazz-react": "workspace:*",
|
||||
"jazz-richtext-prosemirror": "workspace:*",
|
||||
"jazz-tools": "workspace:*",
|
||||
"prosemirror-example-setup": "^1.2.3",
|
||||
"prosemirror-model": "^1.25.0",
|
||||
"prosemirror-schema-basic": "^1.2.4",
|
||||
"prosemirror-schema-list": "^1.5.1",
|
||||
"prosemirror-state": "^1.4.3",
|
||||
"prosemirror-view": "^1.39.1",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@types/react": "~18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"globals": "^15.11.0",
|
||||
"is-ci": "^3.0.1",
|
||||
"postcss": "^8.4.27",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "5.6.2",
|
||||
"vite": "6.0.11"
|
||||
}
|
||||
}
|
||||
46
examples/richtext/playwright.config.ts
Normal file
46
examples/richtext/playwright.config.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { defineConfig, devices } from "@playwright/test";
|
||||
import isCI from "is-ci";
|
||||
|
||||
/**
|
||||
* See https://playwright.dev/docs/test-configuration.
|
||||
*/
|
||||
export default defineConfig({
|
||||
testDir: "./tests",
|
||||
/* Run tests in files in parallel */
|
||||
fullyParallel: true,
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
forbidOnly: isCI,
|
||||
/* Retry on CI only */
|
||||
retries: isCI ? 2 : 0,
|
||||
/* Opt out of parallel tests on CI. */
|
||||
workers: isCI ? 1 : undefined,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
reporter: "html",
|
||||
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
use: {
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
baseURL: "http://localhost:5173/",
|
||||
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: "on-first-retry",
|
||||
permissions: ["clipboard-read", "clipboard-write"],
|
||||
},
|
||||
|
||||
/* Configure projects for major browsers */
|
||||
projects: [
|
||||
{
|
||||
name: "chromium",
|
||||
use: { ...devices["Desktop Chrome"] },
|
||||
},
|
||||
],
|
||||
|
||||
/* Run your local dev server before starting the tests */
|
||||
webServer: [
|
||||
{
|
||||
command: "pnpm preview --port 5173",
|
||||
url: "http://localhost:5173/",
|
||||
reuseExistingServer: !isCI,
|
||||
},
|
||||
],
|
||||
});
|
||||
6
examples/richtext/postcss.config.js
Normal file
6
examples/richtext/postcss.config.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
39
examples/richtext/src/App.tsx
Normal file
39
examples/richtext/src/App.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import { useAccount, useIsAuthenticated } from "jazz-react";
|
||||
import { AuthButton } from "./AuthButton.tsx";
|
||||
import { Editor } from "./Editor.tsx";
|
||||
import { Logo } from "./Logo.tsx";
|
||||
|
||||
function App() {
|
||||
const { me } = useAccount({ resolve: { profile: true, root: true } });
|
||||
|
||||
const isAuthenticated = useIsAuthenticated();
|
||||
|
||||
return (
|
||||
<>
|
||||
<header>
|
||||
<nav className="container flex justify-between items-center py-3">
|
||||
{isAuthenticated ? (
|
||||
<span>You're logged in.</span>
|
||||
) : (
|
||||
<span>Authenticate to share the data with another device.</span>
|
||||
)}
|
||||
<AuthButton />
|
||||
</nav>
|
||||
</header>
|
||||
<main className="container mt-16 flex flex-col gap-8">
|
||||
<Logo />
|
||||
|
||||
<div className="text-center">
|
||||
<h1>
|
||||
Welcome{me?.profile.firstName ? <>, {me?.profile.firstName}</> : ""}
|
||||
!
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<Editor />
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
45
examples/richtext/src/AuthButton.tsx
Normal file
45
examples/richtext/src/AuthButton.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
"use client";
|
||||
|
||||
import { useAccount, usePasskeyAuth } from "jazz-react";
|
||||
import { APPLICATION_NAME } from "./main";
|
||||
|
||||
export function AuthButton() {
|
||||
const { logOut } = useAccount();
|
||||
|
||||
const auth = usePasskeyAuth({
|
||||
appName: APPLICATION_NAME,
|
||||
});
|
||||
|
||||
function handleLogOut() {
|
||||
logOut();
|
||||
window.history.pushState({}, "", "/");
|
||||
}
|
||||
|
||||
if (auth.state === "signedIn") {
|
||||
return (
|
||||
<button
|
||||
className="bg-stone-100 py-1.5 px-3 text-sm rounded-md"
|
||||
onClick={handleLogOut}
|
||||
>
|
||||
Log out
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex gap-2">
|
||||
<button
|
||||
className="bg-stone-100 py-1.5 px-3 text-sm rounded-md"
|
||||
onClick={() => auth.signUp("")}
|
||||
>
|
||||
Sign up
|
||||
</button>
|
||||
<button
|
||||
onClick={() => auth.logIn()}
|
||||
className="bg-stone-100 py-1.5 px-3 text-sm rounded-md"
|
||||
>
|
||||
Log in
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
74
examples/richtext/src/Editor.tsx
Normal file
74
examples/richtext/src/Editor.tsx
Normal file
@@ -0,0 +1,74 @@
|
||||
import { useAccount } from "jazz-react";
|
||||
import { createJazzPlugin } from "jazz-richtext-prosemirror";
|
||||
import { exampleSetup } from "prosemirror-example-setup";
|
||||
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 { EditorView } from "prosemirror-view";
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
export function Editor() {
|
||||
const { me } = useAccount({ resolve: { profile: true, root: true } });
|
||||
const editorRef = useRef<HTMLDivElement>(null);
|
||||
const viewRef = useRef<EditorView | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
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 jazzPlugin = createJazzPlugin(me.profile.bio);
|
||||
|
||||
// Only create the editor if it doesn't exist
|
||||
if (!viewRef.current) {
|
||||
viewRef.current = new EditorView(editorRef.current, {
|
||||
state: EditorState.create({
|
||||
schema,
|
||||
plugins: [...setupPlugins, jazzPlugin],
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (viewRef.current) {
|
||||
viewRef.current.destroy();
|
||||
viewRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [me?.id, me?.profile.bio?.id]); // Only recreate if the account or the bio changes
|
||||
|
||||
if (!me) return null;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col">
|
||||
<div className="flex-1 flex flex-col md:flex-row gap-4 p-8">
|
||||
<div className="flex-1 flex flex-col gap-2">
|
||||
<label className="text-sm font-medium text-stone-600 dark:text-stone-400">
|
||||
Plaintext
|
||||
</label>
|
||||
<textarea
|
||||
className="flex-1 border border-stone-200 dark:border-stone-700 rounded shadow-sm py-2 px-3 font-mono text-sm bg-stone-50 dark:bg-stone-900 text-stone-900 dark:text-stone-100 whitespace-pre-wrap break-words resize-none"
|
||||
value={me.profile.bio?.toString()}
|
||||
onChange={(e) => me.profile.bio?.applyDiff(e.target.value)}
|
||||
rows={10}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 flex flex-col gap-2">
|
||||
<label className="text-sm font-medium text-stone-600 dark:text-stone-400">
|
||||
Richtext
|
||||
</label>
|
||||
<div
|
||||
ref={editorRef}
|
||||
className="flex-1 border border-stone-200 dark:border-stone-700 rounded shadow-sm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
21
examples/richtext/src/Logo.tsx
Normal file
21
examples/richtext/src/Logo.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
export function Logo() {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 386 146"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="text-black w-48 mx-auto"
|
||||
>
|
||||
<path
|
||||
d="M176.725 33.865H188.275V22.7H176.725V33.865ZM164.9 129.4H172.875C182.72 129.4 188.275 123.9 188.275 114.22V43.6H176.725V109.545C176.725 115.65 173.975 118.51 167.925 118.51H164.9V129.4ZM245.298 53.28C241.613 45.47 233.363 41.95 222.748 41.95C208.998 41.95 200.748 48.44 197.888 58.615L208.613 61.915C210.648 55.315 216.368 52.565 222.638 52.565C231.933 52.565 235.673 56.415 236.058 64.61C226.433 65.93 216.643 67.195 209.768 69.23C200.583 72.145 195.743 77.865 195.743 86.83C195.743 96.51 202.673 104.65 215.818 104.65C225.443 104.65 232.318 101.35 237.213 94.365V103H247.388V66.425C247.388 61.475 247.168 57.185 245.298 53.28ZM217.853 95.245C210.483 95.245 207.128 91.34 207.128 86.72C207.128 82.045 210.593 79.515 215.323 77.92C220.328 76.435 226.983 75.5 235.948 74.18C235.893 76.93 235.673 80.725 234.738 83.475C233.418 89.25 227.643 95.245 217.853 95.245ZM251.22 103H301.545V92.715H269.535L303.195 45.47V43.6H254.3V53.885H284.935L251.22 101.185V103ZM304.815 103H355.14V92.715H323.13L356.79 45.47V43.6H307.895V53.885H338.53L304.815 101.185V103Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
fillRule="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"
|
||||
fill="#3313F7"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
1
examples/richtext/src/apiKey.ts
Normal file
1
examples/richtext/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const apiKey = "richtext-example@garden.co";
|
||||
10
examples/richtext/src/index.css
Normal file
10
examples/richtext/src/index.css
Normal file
@@ -0,0 +1,10 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
.ProseMirror ul {
|
||||
@apply list-disc;
|
||||
}
|
||||
.ProseMirror ol {
|
||||
@apply list-decimal;
|
||||
}
|
||||
32
examples/richtext/src/main.tsx
Normal file
32
examples/richtext/src/main.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { JazzProvider } from "jazz-react";
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./App.tsx";
|
||||
import "./index.css";
|
||||
import "prosemirror-example-setup/style/style.css";
|
||||
import "prosemirror-view/style/prosemirror.css";
|
||||
import "prosemirror-menu/style/menu.css";
|
||||
import { apiKey } from "./apiKey.ts";
|
||||
import { JazzAccount } from "./schema.ts";
|
||||
|
||||
// We use this to identify the app in the passkey auth
|
||||
export const APPLICATION_NAME = "Jazz richtext example";
|
||||
|
||||
declare module "jazz-react" {
|
||||
export interface Register {
|
||||
Account: JazzAccount;
|
||||
}
|
||||
}
|
||||
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<StrictMode>
|
||||
<JazzProvider
|
||||
sync={{
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
}}
|
||||
AccountSchema={JazzAccount}
|
||||
>
|
||||
<App />
|
||||
</JazzProvider>
|
||||
</StrictMode>,
|
||||
);
|
||||
70
examples/richtext/src/schema.ts
Normal file
70
examples/richtext/src/schema.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* Learn about schemas here:
|
||||
* https://jazz.tools/docs/react/schemas/covalues
|
||||
*/
|
||||
|
||||
import { Account, CoMap, CoRichText, Group, Profile, co } from "jazz-tools";
|
||||
|
||||
/** The account profile is an app-specific per-user public `CoMap`
|
||||
* where you can store top-level objects for that user */
|
||||
export class JazzProfile extends Profile {
|
||||
/**
|
||||
* Learn about CoValue field/item types here:
|
||||
* https://jazz.tools/docs/react/schemas/covalues#covalue-fielditem-types
|
||||
*/
|
||||
firstName = co.string;
|
||||
bio = co.ref(CoRichText);
|
||||
|
||||
// Add public fields here
|
||||
}
|
||||
|
||||
/** The account root is an app-specific per-user private `CoMap`
|
||||
* where you can store top-level objects for that user */
|
||||
export class AccountRoot extends CoMap {
|
||||
dateOfBirth = co.Date;
|
||||
|
||||
// Add private fields here
|
||||
|
||||
get age() {
|
||||
if (!this.dateOfBirth) return null;
|
||||
|
||||
return new Date().getFullYear() - this.dateOfBirth.getFullYear();
|
||||
}
|
||||
}
|
||||
|
||||
export class JazzAccount extends Account {
|
||||
profile = co.ref(JazzProfile);
|
||||
root = co.ref(AccountRoot);
|
||||
|
||||
/** The account migration is run on account creation and on every log-in.
|
||||
* You can use it to set up the account root and any other initial CoValues you need.
|
||||
*/
|
||||
migrate(this: JazzAccount) {
|
||||
if (this.root === undefined) {
|
||||
const group = Group.create();
|
||||
|
||||
this.root = AccountRoot.create(
|
||||
{
|
||||
dateOfBirth: new Date("1/1/1990"),
|
||||
},
|
||||
group,
|
||||
);
|
||||
}
|
||||
|
||||
if (this.profile === undefined) {
|
||||
const group = Group.create();
|
||||
group.addMember("everyone", "reader"); // The profile info is visible to everyone
|
||||
|
||||
this.profile = JazzProfile.create(
|
||||
{
|
||||
name: "Anonymous user",
|
||||
firstName: "",
|
||||
bio: CoRichText.create("<p>A <strong>hu<em>man</strong></em>.</p>", {
|
||||
owner: group,
|
||||
}),
|
||||
},
|
||||
group,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
1
examples/richtext/src/vite-env.d.ts
vendored
Normal file
1
examples/richtext/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
23
examples/richtext/tailwind.config.ts
Normal file
23
examples/richtext/tailwind.config.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
const config: Config = {
|
||||
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
|
||||
theme: {
|
||||
extend: {
|
||||
container: {
|
||||
center: true,
|
||||
padding: {
|
||||
DEFAULT: "0.75rem",
|
||||
sm: "1rem",
|
||||
},
|
||||
screens: {
|
||||
lg: "600px",
|
||||
xl: "600px",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
} as const;
|
||||
|
||||
export default config;
|
||||
24
examples/richtext/tsconfig.app.json
Normal file
24
examples/richtext/tsconfig.app.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
"moduleResolution": "Bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
7
examples/richtext/tsconfig.json
Normal file
7
examples/richtext/tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{ "path": "./tsconfig.app.json" },
|
||||
{ "path": "./tsconfig.node.json" }
|
||||
]
|
||||
}
|
||||
22
examples/richtext/tsconfig.node.json
Normal file
22
examples/richtext/tsconfig.node.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
"moduleResolution": "Bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
8
examples/richtext/vercel.json
Normal file
8
examples/richtext/vercel.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"build": {
|
||||
"env": {
|
||||
"APP_NAME": "richtext"
|
||||
}
|
||||
},
|
||||
"ignoreCommand": "node ../../ignore-vercel-build.js"
|
||||
}
|
||||
7
examples/richtext/vite.config.ts
Normal file
7
examples/richtext/vite.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
});
|
||||
@@ -1,5 +1,116 @@
|
||||
# todo-vue
|
||||
|
||||
## 0.0.91
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-browser@0.13.23
|
||||
- jazz-vue@0.13.23
|
||||
|
||||
## 0.0.90
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
- jazz-vue@0.13.21
|
||||
|
||||
## 0.0.89
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-browser@0.13.20
|
||||
- jazz-vue@0.13.20
|
||||
|
||||
## 0.0.88
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-browser@0.13.19
|
||||
- jazz-vue@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
- jazz-vue@0.13.13
|
||||
|
||||
## 0.0.81
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- Updated dependencies [29e05c4]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-browser@0.13.12
|
||||
- jazz-vue@0.13.12
|
||||
|
||||
## 0.0.80
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-browser@0.13.11
|
||||
- jazz-vue@0.13.11
|
||||
|
||||
## 0.0.79
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
- jazz-vue@0.13.10
|
||||
|
||||
## 0.0.78
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "todo-vue",
|
||||
"version": "0.0.78",
|
||||
"version": "0.0.91",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,102 @@
|
||||
# jazz-example-todo
|
||||
|
||||
## 0.0.206
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.205
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.204
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.203
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.196
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.195
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.194
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.193
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-todo",
|
||||
"private": true,
|
||||
"version": "0.0.193",
|
||||
"version": "0.0.206",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -11,6 +11,7 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@faker-js/faker": "^9.7.0",
|
||||
"@radix-ui/react-checkbox": "^1.0.4",
|
||||
"@radix-ui/react-slot": "^1.1.1",
|
||||
"@radix-ui/react-toast": "^1.1.4",
|
||||
|
||||
@@ -41,12 +41,9 @@ export class TodoAccount extends Account {
|
||||
*/
|
||||
migrate() {
|
||||
if (!this._refs.root) {
|
||||
this.root = TodoAccountRoot.create(
|
||||
{
|
||||
projects: ListOfProjects.create([], { owner: this }),
|
||||
},
|
||||
{ owner: this },
|
||||
);
|
||||
this.root = TodoAccountRoot.create({
|
||||
projects: ListOfProjects.create([]),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
ThemeProvider,
|
||||
TitleAndLogo,
|
||||
} from "./basicComponents/index.ts";
|
||||
import { TaskGenerator } from "./components/TaskGenerator.tsx";
|
||||
import { wordlist } from "./wordlist.ts";
|
||||
|
||||
/**
|
||||
@@ -95,6 +96,10 @@ export default function App() {
|
||||
path: "/invite/*",
|
||||
element: <p>Accepting invite...</p>,
|
||||
},
|
||||
{
|
||||
path: "/generate",
|
||||
element: <TaskGenerator />,
|
||||
},
|
||||
]);
|
||||
|
||||
// `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
|
||||
// sync updates from other devices or participants!
|
||||
// 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
|
||||
// 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,116 @@
|
||||
# version-history
|
||||
|
||||
## 0.0.85
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [02a240c]
|
||||
- jazz-tools@0.13.23
|
||||
- jazz-inspector@0.13.23
|
||||
- jazz-react@0.13.23
|
||||
|
||||
## 0.0.84
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7de210f]
|
||||
- jazz-inspector@0.13.21
|
||||
- jazz-react@0.13.21
|
||||
- jazz-tools@0.13.21
|
||||
|
||||
## 0.0.83
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [439f0fe]
|
||||
- jazz-tools@0.13.20
|
||||
- jazz-inspector@0.13.20
|
||||
- jazz-react@0.13.20
|
||||
|
||||
## 0.0.82
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80530a4]
|
||||
- jazz-tools@0.13.19
|
||||
- jazz-inspector@0.13.19
|
||||
- jazz-react@0.13.19
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.13.13
|
||||
- jazz-react@0.13.13
|
||||
- jazz-tools@0.13.13
|
||||
|
||||
## 0.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4547525]
|
||||
- jazz-tools@0.13.12
|
||||
- jazz-inspector@0.13.12
|
||||
- jazz-react@0.13.12
|
||||
|
||||
## 0.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17273a6]
|
||||
- jazz-tools@0.13.11
|
||||
- jazz-inspector@0.13.11
|
||||
- jazz-react@0.13.11
|
||||
|
||||
## 0.0.73
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.13.10
|
||||
- jazz-react@0.13.10
|
||||
- jazz-tools@0.13.10
|
||||
|
||||
## 0.0.72
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "version-history",
|
||||
"private": true,
|
||||
"version": "0.0.72",
|
||||
"version": "0.0.85",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "gcmp-design-system",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"name": "@garden-co/design-system",
|
||||
"version": "0.1.3",
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
@@ -24,17 +23,17 @@
|
||||
"react-dom": "^18",
|
||||
"resend": "^4.0.0",
|
||||
"tailwind-merge": "^1.14.0",
|
||||
"tailwindcss-animate": "^1.0.7"
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"postcss": "^8",
|
||||
"@tailwindcss/typography": "^0.5.16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.3.3",
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@csstools/postcss-oklab-function": "^3.0.6",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5.3.3"
|
||||
"@types/react-dom": "^18"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { ImageResponse } from "next/og";
|
||||
import { JazzLogo } from "../atoms/logos/JazzLogo";
|
||||
|
||||
export const imageSize = {
|
||||
width: 1200,
|
||||
height: 630,
|
||||
};
|
||||
|
||||
export const imageContentType = "image/png";
|
||||
|
||||
export default async function OpenGraphImage({ title }: { title: string }) {
|
||||
const manropeSemiBold = await readFile(
|
||||
join(process.cwd(), "public/fonts/Manrope-SemiBold.ttf"),
|
||||
);
|
||||
|
||||
return new ImageResponse(
|
||||
<div
|
||||
style={{
|
||||
fontSize: "7em",
|
||||
background: "white",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-start",
|
||||
padding: "77px",
|
||||
letterSpacing: "-0.05em",
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
<div
|
||||
style={{ display: "flex", position: "absolute", bottom: 35, right: 45 }}
|
||||
>
|
||||
<JazzLogo width={193} height={73} />
|
||||
</div>
|
||||
</div>,
|
||||
{
|
||||
...imageSize,
|
||||
fonts: [
|
||||
{
|
||||
name: "Manrope",
|
||||
data: manropeSemiBold,
|
||||
},
|
||||
],
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -1,37 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
|
||||
import { Manrope } from "next/font/google";
|
||||
import { Inter } from "next/font/google";
|
||||
import localFont from "next/font/local";
|
||||
|
||||
const manrope = Manrope({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-manrope",
|
||||
display: "swap",
|
||||
});
|
||||
const inter = Inter({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-inter",
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
const commitMono = localFont({
|
||||
src: [
|
||||
{
|
||||
path: "../../fonts/CommitMono-Regular.woff2",
|
||||
weight: "400",
|
||||
style: "normal",
|
||||
},
|
||||
{
|
||||
path: "../../fonts/CommitMono-Regular.woff",
|
||||
weight: "400",
|
||||
style: "normal",
|
||||
},
|
||||
],
|
||||
variable: "--font-commit-mono",
|
||||
display: "swap",
|
||||
});
|
||||
import { fontClasses } from "../fonts";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Jazz Design System by Garden Computing, Inc",
|
||||
@@ -47,9 +16,7 @@ export default function RootLayout({
|
||||
<html lang="en" className="h-full">
|
||||
<body
|
||||
className={[
|
||||
manrope.variable,
|
||||
commitMono.variable,
|
||||
inter.className,
|
||||
...fontClasses,
|
||||
"h-full",
|
||||
"bg-white dark:bg-stone-950 text-default",
|
||||
].join(" ")}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user