Compare commits
754 Commits
cojson-sto
...
cojson-sto
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d7d62d64f | ||
|
|
65a8227b2b | ||
|
|
a846e0730e | ||
|
|
e9c0e65170 | ||
|
|
14636606bd | ||
|
|
5118ff6585 | ||
|
|
51a0f86b99 | ||
|
|
fa61ab4eb5 | ||
|
|
d4cdd43cf7 | ||
|
|
c5d5fb25f7 | ||
|
|
38f2276fdd | ||
|
|
b92bfce041 | ||
|
|
e3fd7bf6e3 | ||
|
|
7526e444d6 | ||
|
|
28522bd062 | ||
|
|
824be82f94 | ||
|
|
8a9ef8ac78 | ||
|
|
5fb2f959f1 | ||
|
|
7a900d43f3 | ||
|
|
c8624d56d2 | ||
|
|
8ed7c3947d | ||
|
|
ec0e61a442 | ||
|
|
824d417d4e | ||
|
|
9f1ce81e09 | ||
|
|
48b32b6a72 | ||
|
|
03fec5f1b3 | ||
|
|
cdd7ac98cc | ||
|
|
8218a272ee | ||
|
|
25d146ead8 | ||
|
|
3f4d493286 | ||
|
|
d476b06d0e | ||
|
|
22baf1f547 | ||
|
|
d6ec873b1e | ||
|
|
160b30406b | ||
|
|
3e473eff50 | ||
|
|
47ad35085e | ||
|
|
0b0d06ea44 | ||
|
|
ec546b4cd6 | ||
|
|
cadc5ef913 | ||
|
|
f961dedbd0 | ||
|
|
c7b27e902b | ||
|
|
b1cbc9283a | ||
|
|
f2c7c20a75 | ||
|
|
53705d0ac1 | ||
|
|
4031b7532f | ||
|
|
5ac43c300d | ||
|
|
064174501e | ||
|
|
b0c2a5a53f | ||
|
|
24d9a6b7e1 | ||
|
|
e270295387 | ||
|
|
67fa7be0d4 | ||
|
|
3431076350 | ||
|
|
e8092141e8 | ||
|
|
a2aac6791d | ||
|
|
aebd1519c3 | ||
|
|
a9cf6da27a | ||
|
|
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 | ||
|
|
6dac7c7ce5 | ||
|
|
d0724a2c13 | ||
|
|
4c632e14a4 | ||
|
|
d7238267d9 | ||
|
|
a6cf01f867 | ||
|
|
17d148b1d2 | ||
|
|
2544782988 | ||
|
|
8f42c7a749 | ||
|
|
62aa4146af | ||
|
|
d423e3c4b3 | ||
|
|
bdac4d1188 | ||
|
|
47c9004d5f | ||
|
|
de19a6db37 | ||
|
|
cdc885994c | ||
|
|
6e1b27b0c9 | ||
|
|
64483ea09b | ||
|
|
1310c19bb0 | ||
|
|
dae58f8d54 | ||
|
|
b4af381043 | ||
|
|
6ac8bebf90 | ||
|
|
81d63606a6 | ||
|
|
29d0b6fa03 | ||
|
|
36cf5b1dbb | ||
|
|
13c1dc34f7 | ||
|
|
4530c4a9d2 | ||
|
|
ba8dc07630 | ||
|
|
c841b2da58 | ||
|
|
b42e5f5d82 | ||
|
|
24137a1269 | ||
|
|
22b5c4f083 | ||
|
|
5810572f54 | ||
|
|
ab3c61b7ca | ||
|
|
53b2cd93eb | ||
|
|
95cee57379 | ||
|
|
a5df996d67 | ||
|
|
a041ee5c4b | ||
|
|
a518e8b667 | ||
|
|
673197cf8e | ||
|
|
9a9aa1e811 | ||
|
|
793342b67a | ||
|
|
13074beebf | ||
|
|
9696bda2e9 | ||
|
|
87e0a23186 | ||
|
|
1acc9eb37b | ||
|
|
9ba228c804 | ||
|
|
a4bad7aab8 | ||
|
|
4e9aae1887 | ||
|
|
093bab7fbc | ||
|
|
b2449a3bae | ||
|
|
49784a7e65 | ||
|
|
bc3d7bbb18 | ||
|
|
935cd745ba | ||
|
|
608d06d46f | ||
|
|
7690e19014 | ||
|
|
4626c79c46 | ||
|
|
aad0bd60f4 | ||
|
|
1fbe8d9651 | ||
|
|
2ba762b4c8 | ||
|
|
f24855e8e5 | ||
|
|
e299fc9d51 | ||
|
|
0bd293f632 | ||
|
|
d8d186da09 | ||
|
|
9ddc5fa060 | ||
|
|
910683dce4 | ||
|
|
bb0f0ecbc0 | ||
|
|
1f54b4875a | ||
|
|
68759f1797 | ||
|
|
cdc5cbd6d6 | ||
|
|
f55097c480 | ||
|
|
e9695fa2eb | ||
|
|
0c11110567 | ||
|
|
f2db858221 | ||
|
|
a362cbba51 | ||
|
|
39c2586d3b | ||
|
|
4336342f74 | ||
|
|
3a5dfbe008 | ||
|
|
504e42b7ea | ||
|
|
6a9baa304f | ||
|
|
99b9b10d2d | ||
|
|
f42b73b09b | ||
|
|
41a62a8dde | ||
|
|
73f99a11b1 | ||
|
|
587d5267bb | ||
|
|
a747e1f466 | ||
|
|
95c967783b | ||
|
|
89ff69f005 | ||
|
|
e5eed7bd35 | ||
|
|
698d3b0a81 | ||
|
|
cb5e55d18f | ||
|
|
dcf8243551 | ||
|
|
39ae497153 | ||
|
|
cdab27084c | ||
|
|
17b499e68a | ||
|
|
f3f2344948 | ||
|
|
ce4064f6a7 | ||
|
|
d66bd6ee1f | ||
|
|
02c27ababc | ||
|
|
4296069148 | ||
|
|
e0b5df7f9e | ||
|
|
264c1c1fa5 | ||
|
|
54b2907f08 | ||
|
|
4dcb1d9af2 | ||
|
|
65862b085f | ||
|
|
8957684618 | ||
|
|
2c3ac8f2aa | ||
|
|
44332544ca | ||
|
|
421b225fed | ||
|
|
0ab6a5c739 | ||
|
|
65ce5dc40a | ||
|
|
c240395e76 | ||
|
|
25fd7e832f | ||
|
|
fa1f15d3af | ||
|
|
67a90b01f1 | ||
|
|
a20b4e4983 | ||
|
|
25de875826 | ||
|
|
0db0bdd97d | ||
|
|
0fd7d1c18a | ||
|
|
d4960e7f15 | ||
|
|
31ea2ef07a | ||
|
|
6e28ac946b | ||
|
|
cfce22fc63 | ||
|
|
752f453e80 | ||
|
|
19dabe8ffe | ||
|
|
d2234dc2ba | ||
|
|
21c935cb3d | ||
|
|
07d652c5e0 | ||
|
|
686b311590 | ||
|
|
80fe01e50d | ||
|
|
2ebb9351cd | ||
|
|
2dd7bdb007 | ||
|
|
d0e8b97926 | ||
|
|
f83897e64c | ||
|
|
ec4e56df61 | ||
|
|
f3e0b1ed74 | ||
|
|
ca9162476c | ||
|
|
f98f6f1a7a | ||
|
|
2624d037f3 | ||
|
|
66419abc66 | ||
|
|
608bd77f1c | ||
|
|
1b8029860e | ||
|
|
2d7917b169 | ||
|
|
4bec7b90c1 | ||
|
|
f822c3a787 | ||
|
|
7b25324660 | ||
|
|
6a81a1c9c5 | ||
|
|
4dd2c70f0f | ||
|
|
9d23d8ab6c | ||
|
|
a89611ae3b | ||
|
|
43433b75fe | ||
|
|
85830ad805 | ||
|
|
114f0fffab | ||
|
|
97e2e568cd | ||
|
|
d42298687c | ||
|
|
a19780566b | ||
|
|
dfc8935616 | ||
|
|
a6c0a4b4c8 | ||
|
|
19972d3183 | ||
|
|
566cddcd3e | ||
|
|
6e3dca448a | ||
|
|
6410d27f49 | ||
|
|
a2258ab728 | ||
|
|
c1f464bb41 | ||
|
|
0ca964c2f0 | ||
|
|
48d96956c6 | ||
|
|
c320615d8b | ||
|
|
2fd5f28404 | ||
|
|
e2ee06bebe | ||
|
|
daf6b5b3d2 | ||
|
|
038ac38e88 | ||
|
|
7e57eea71d | ||
|
|
34904eac47 | ||
|
|
0332daa038 | ||
|
|
924794a3a4 | ||
|
|
12e3d2ace0 | ||
|
|
d1bd998000 | ||
|
|
c803f8accb | ||
|
|
76e17835f9 | ||
|
|
db3dd94d82 | ||
|
|
4392888032 | ||
|
|
aa1c80e35b | ||
|
|
b4798fe733 | ||
|
|
582ab63d2f | ||
|
|
45ed69b943 | ||
|
|
ebb751bb38 | ||
|
|
5a39eec078 | ||
|
|
acb2d35bdc | ||
|
|
50d6c7770b | ||
|
|
d8019697a6 | ||
|
|
cc2ffeb286 | ||
|
|
cc204723d2 | ||
|
|
fc647f715b | ||
|
|
1c54a3b5e1 | ||
|
|
7fdb1952a6 | ||
|
|
6cfcb01cf0 | ||
|
|
bccff51061 | ||
|
|
02ec3fd436 | ||
|
|
ce177ca53e | ||
|
|
d7895504a4 | ||
|
|
699db46ed6 | ||
|
|
d303be6709 | ||
|
|
fe6f561afd | ||
|
|
93c7f6c253 | ||
|
|
3b2831f7de | ||
|
|
902e539f56 | ||
|
|
9e9946cf48 | ||
|
|
ecfc883419 | ||
|
|
a861fba3b1 | ||
|
|
37d9e60128 | ||
|
|
6db84dc673 | ||
|
|
f0ae3e47b6 | ||
|
|
4aded04223 | ||
|
|
06db1dd423 | ||
|
|
051e6c497e | ||
|
|
9b2a73b900 | ||
|
|
dd8ed599f7 | ||
|
|
33e51267e3 | ||
|
|
59251a58c4 | ||
|
|
e090b3992d | ||
|
|
31794684a0 | ||
|
|
14fcc8dde5 | ||
|
|
13f1821c04 | ||
|
|
4c3b85abcd | ||
|
|
4b0544fd0d | ||
|
|
568674a7fa | ||
|
|
ef012f07aa | ||
|
|
eee2330325 | ||
|
|
b83ec05ccc | ||
|
|
386525db48 | ||
|
|
a8809d840c | ||
|
|
005fc1f8c9 | ||
|
|
3129982582 | ||
|
|
5d7bb70c7d | ||
|
|
1a7a84f71b | ||
|
|
1d51bdc016 | ||
|
|
8da6f3a897 | ||
|
|
dca9293ae7 | ||
|
|
558bab2e58 | ||
|
|
2b362fd331 | ||
|
|
f03f1b6de8 | ||
|
|
bd57177586 | ||
|
|
9e0e2709a5 | ||
|
|
01b2ab7148 | ||
|
|
44b7d39467 | ||
|
|
5373ee2858 | ||
|
|
b19cab78d3 | ||
|
|
3f86dfce4f | ||
|
|
12f8bfa28f | ||
|
|
53211a4fca | ||
|
|
d0f188a072 | ||
|
|
9e55542872 | ||
|
|
0a6cd4e9b2 | ||
|
|
7af6cedfd6 | ||
|
|
847d379fe9 | ||
|
|
69954caee6 | ||
|
|
6a5bd28d07 | ||
|
|
ba58bc3ace | ||
|
|
94cb615a38 | ||
|
|
b130f46b6c | ||
|
|
989d59f978 | ||
|
|
c3dd099ee1 | ||
|
|
4dc7cf9389 | ||
|
|
882fd55d69 | ||
|
|
b2fdb8b9e5 | ||
|
|
e879ec981e | ||
|
|
980609ca87 | ||
|
|
71cd7396b7 | ||
|
|
dedc3e277c | ||
|
|
656866729d | ||
|
|
f93dd1f779 | ||
|
|
80d499f002 | ||
|
|
c9a87e52f3 | ||
|
|
3f98d9ab73 | ||
|
|
abb0e8fada | ||
|
|
be2e1f3c61 | ||
|
|
75f20d8176 | ||
|
|
e6bef5275b | ||
|
|
9813db1603 | ||
|
|
a3143f20a9 | ||
|
|
f54beb2d88 | ||
|
|
b7ce1e2da0 | ||
|
|
6dba138ec7 | ||
|
|
32f59a618f | ||
|
|
9b2de387ed | ||
|
|
b612258c5e | ||
|
|
09b59ed18b | ||
|
|
b7b186b67e | ||
|
|
f2ba925db6 | ||
|
|
bc9488241f | ||
|
|
4fc36779dd | ||
|
|
bc008aeb23 | ||
|
|
8ad45a421e | ||
|
|
197317efbf | ||
|
|
775ad975f3 | ||
|
|
eaedf455d4 | ||
|
|
017f6c8074 | ||
|
|
48dd922712 | ||
|
|
202b320ad1 | ||
|
|
ea094ae64b | ||
|
|
9412aeb938 | ||
|
|
785fc893ee | ||
|
|
4f5e471667 | ||
|
|
fc6b20d370 | ||
|
|
fe82631db6 | ||
|
|
e4886d1b03 | ||
|
|
dfb2b19209 | ||
|
|
1a92d6b1e5 | ||
|
|
d5c1f49cc5 | ||
|
|
7d6ce843de | ||
|
|
ae4be2be7a | ||
|
|
0298f0eb29 | ||
|
|
794c56dfac | ||
|
|
6b9382b5e9 | ||
|
|
08ae9b295f | ||
|
|
917e8a21d8 | ||
|
|
abdf4a3577 | ||
|
|
595e3c89df | ||
|
|
6b0e772c9f | ||
|
|
b9afa42662 | ||
|
|
5246a54118 | ||
|
|
a036391f69 | ||
|
|
039b1151bf | ||
|
|
6c79cfb109 | ||
|
|
b9f42bb733 | ||
|
|
542d839ed6 | ||
|
|
6ad24315bb | ||
|
|
3c1a4f124c | ||
|
|
48a83c356d | ||
|
|
756d52d106 | ||
|
|
83876a3523 | ||
|
|
b77c6d4edc | ||
|
|
c74fc11b25 | ||
|
|
7a636bd8c2 | ||
|
|
f6cc06b8dc | ||
|
|
6202436c9a | ||
|
|
65929a8e7e | ||
|
|
20e5786fc0 | ||
|
|
91bc3c432d | ||
|
|
1ff11cebf6 | ||
|
|
25cd967207 | ||
|
|
bcdc468a5d | ||
|
|
72d5112bac | ||
|
|
c1193c3c63 | ||
|
|
f30130b92f | ||
|
|
1a77233ecb | ||
|
|
09a95b8542 | ||
|
|
f46329ac68 | ||
|
|
c551839179 | ||
|
|
a0683f9d21 | ||
|
|
a56958c69e | ||
|
|
0b11a5f567 | ||
|
|
fac2d4a3b1 | ||
|
|
9f336103e8 | ||
|
|
1174942a4e | ||
|
|
267920b7dc | ||
|
|
63a7aa0f54 | ||
|
|
2b7534d30c | ||
|
|
be23a81b1b | ||
|
|
68416784fd | ||
|
|
84d3c09cb1 | ||
|
|
53e8c39e8d | ||
|
|
87b41fefad | ||
|
|
265a4e8cc5 | ||
|
|
623467503f | ||
|
|
3167ff16cd | ||
|
|
2e70b2b295 | ||
|
|
9a5e6eed16 | ||
|
|
28d74d73f8 | ||
|
|
6c9d90449a | ||
|
|
5398978d74 | ||
|
|
53148db482 | ||
|
|
44a0b54026 | ||
|
|
c877d377d2 |
@@ -15,6 +15,7 @@
|
|||||||
"jazz-browser-media-images",
|
"jazz-browser-media-images",
|
||||||
"jazz-expo",
|
"jazz-expo",
|
||||||
"jazz-inspector",
|
"jazz-inspector",
|
||||||
|
"jazz-inspector-element",
|
||||||
"jazz-nodejs",
|
"jazz-nodejs",
|
||||||
"jazz-react",
|
"jazz-react",
|
||||||
"jazz-react-core",
|
"jazz-react-core",
|
||||||
|
|||||||
5
.github/workflows/code-quality.yml
vendored
@@ -15,4 +15,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
- name: Run Biome
|
- name: Run Biome
|
||||||
run: biome ci .
|
run: biome ci .
|
||||||
|
|
||||||
|
- name: Check Catalog Dependencies
|
||||||
|
run: node scripts/check-catalog-deps.js
|
||||||
|
|||||||
2
.github/workflows/playwright.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "starters/react-passkey-auth"]
|
project: ["tests/e2e", "examples/chat", "examples/clerk", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "starters/react-passkey-auth"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
4
.gitignore
vendored
@@ -23,11 +23,9 @@ test-results
|
|||||||
.husky
|
.husky
|
||||||
|
|
||||||
.vscode/*
|
.vscode/*
|
||||||
|
.idea/*
|
||||||
|
|
||||||
.svelte-kit
|
.svelte-kit
|
||||||
|
|
||||||
.cursorrules
|
.cursorrules
|
||||||
.windsurfrules
|
.windsurfrules
|
||||||
|
|
||||||
|
|
||||||
.idea
|
|
||||||
|
|||||||
8
.idea/.gitignore
generated
vendored
@@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
6
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<profile version="1.0">
|
|
||||||
<option name="myName" value="Project Default" />
|
|
||||||
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
||||||
8
.idea/jazz.iml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/jazz.iml" filepath="$PROJECT_DIR$/.idea/jazz.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
19
.idea/php.xml
generated
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="MessDetectorOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PHPCSFixerOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PHPCodeSnifferOptionsConfiguration">
|
|
||||||
<option name="highlightLevel" value="WARNING" />
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PhpStanOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PsalmOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
6
.idea/prettier.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="PrettierConfiguration">
|
|
||||||
<option name="myConfigurationMode" value="AUTOMATIC" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
"**/android/**",
|
"**/android/**",
|
||||||
"packages/jazz-svelte/**",
|
"packages/jazz-svelte/**",
|
||||||
"examples/*svelte*/**",
|
"examples/*svelte*/**",
|
||||||
|
"examples/jazz-paper-scissors/src/routeTree.gen.ts",
|
||||||
"homepage/homepage/**",
|
"homepage/homepage/**",
|
||||||
"**/package.json"
|
"**/package.json"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,198 @@
|
|||||||
# chat-rn-expo-clerk
|
# chat-rn-expo-clerk
|
||||||
|
|
||||||
|
## 1.0.116
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
- jazz-react-native-media-images@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-expo@0.13.9
|
||||||
|
- jazz-react-native-media-images@0.13.9
|
||||||
|
|
||||||
|
## 1.0.100
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.8
|
||||||
|
|
||||||
|
## 1.0.99
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- jazz-expo@0.13.7
|
||||||
|
- jazz-react-native-media-images@0.13.7
|
||||||
|
|
||||||
|
## 1.0.98
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- jazz-expo@0.13.5
|
||||||
|
- jazz-react-native-media-images@0.13.5
|
||||||
|
|
||||||
|
## 1.0.97
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-expo@0.13.4
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
- jazz-react-native-media-images@0.13.4
|
||||||
|
|
||||||
|
## 1.0.96
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- jazz-expo@0.13.3
|
||||||
|
- jazz-react-native-media-images@0.13.3
|
||||||
|
|
||||||
|
## 1.0.95
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
- jazz-react-native-media-images@0.13.2
|
||||||
|
|
||||||
|
## 1.0.94
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [63a7aa0]
|
||||||
|
- jazz-expo@0.13.1
|
||||||
|
|
||||||
## 1.0.93
|
## 1.0.93
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -2,28 +2,39 @@ import "../global.css";
|
|||||||
import { ClerkLoaded, ClerkProvider } from "@clerk/clerk-expo";
|
import { ClerkLoaded, ClerkProvider } from "@clerk/clerk-expo";
|
||||||
import { secureStore } from "@clerk/clerk-expo/secure-store";
|
import { secureStore } from "@clerk/clerk-expo/secure-store";
|
||||||
import { useFonts } from "expo-font";
|
import { useFonts } from "expo-font";
|
||||||
import { Slot } from "expo-router";
|
import { Slot, useRouter, useSegments } from "expo-router";
|
||||||
import * as SplashScreen from "expo-splash-screen";
|
import * as SplashScreen from "expo-splash-screen";
|
||||||
|
import { useIsAuthenticated, useJazzContext } from "jazz-expo";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { tokenCache } from "../cache";
|
import { tokenCache } from "../cache";
|
||||||
import { JazzAndAuth } from "../src/auth-context";
|
import { JazzAndAuth } from "../src/auth-context";
|
||||||
|
|
||||||
SplashScreen.preventAutoHideAsync();
|
SplashScreen.preventAutoHideAsync();
|
||||||
|
|
||||||
export default function RootLayout() {
|
function InitialLayout() {
|
||||||
const [loaded] = useFonts({
|
const isAuthenticated = useIsAuthenticated();
|
||||||
SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"),
|
const segments = useSegments();
|
||||||
});
|
const router = useRouter();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (loaded) {
|
const inAuthGroup = segments[0] === "(auth)";
|
||||||
SplashScreen.hideAsync();
|
|
||||||
}
|
|
||||||
}, [loaded]);
|
|
||||||
|
|
||||||
if (!loaded) {
|
if (isAuthenticated && inAuthGroup) {
|
||||||
return null;
|
router.replace("/chat");
|
||||||
}
|
} else if (!isAuthenticated && !inAuthGroup) {
|
||||||
|
router.replace("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
SplashScreen.hideAsync();
|
||||||
|
}, [isAuthenticated, segments, router]);
|
||||||
|
|
||||||
|
return <Slot />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function RootLayout() {
|
||||||
|
const [fontsLoaded] = useFonts({
|
||||||
|
SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"),
|
||||||
|
});
|
||||||
|
|
||||||
const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY;
|
const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY;
|
||||||
|
|
||||||
@@ -33,6 +44,17 @@ export default function RootLayout() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (fontsLoaded) {
|
||||||
|
} else {
|
||||||
|
SplashScreen.preventAutoHideAsync();
|
||||||
|
}
|
||||||
|
}, [fontsLoaded]);
|
||||||
|
|
||||||
|
if (!fontsLoaded) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ClerkProvider
|
<ClerkProvider
|
||||||
tokenCache={tokenCache}
|
tokenCache={tokenCache}
|
||||||
@@ -41,7 +63,7 @@ export default function RootLayout() {
|
|||||||
>
|
>
|
||||||
<ClerkLoaded>
|
<ClerkLoaded>
|
||||||
<JazzAndAuth>
|
<JazzAndAuth>
|
||||||
<Slot />
|
<InitialLayout />
|
||||||
</JazzAndAuth>
|
</JazzAndAuth>
|
||||||
</ClerkLoaded>
|
</ClerkLoaded>
|
||||||
</ClerkProvider>
|
</ClerkProvider>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { useLocalSearchParams } from "expo-router";
|
|||||||
import { useAccount, useCoState } from "jazz-expo";
|
import { useAccount, useCoState } from "jazz-expo";
|
||||||
import { ProgressiveImg } from "jazz-expo";
|
import { ProgressiveImg } from "jazz-expo";
|
||||||
import { createImage } from "jazz-react-native-media-images";
|
import { createImage } from "jazz-react-native-media-images";
|
||||||
import { Group, ID } from "jazz-tools";
|
import { CoPlainText, Group, ID } from "jazz-tools";
|
||||||
import { useEffect, useLayoutEffect, useState } from "react";
|
import { useEffect, useLayoutEffect, useState } from "react";
|
||||||
import React, {
|
import React, {
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
@@ -71,8 +71,8 @@ export default function Conversation() {
|
|||||||
|
|
||||||
const loadChat = async (chatId: ID<Chat>) => {
|
const loadChat = async (chatId: ID<Chat>) => {
|
||||||
try {
|
try {
|
||||||
const chat = await Chat.load(chatId, me);
|
const chat = await Chat.load(chatId);
|
||||||
setChat(chat);
|
if (chat) setChat(chat);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error loading chat", error);
|
console.log("Error loading chat", error);
|
||||||
Alert.alert("Error", `Error loading chat: ${error}`);
|
Alert.alert("Error", `Error loading chat: ${error}`);
|
||||||
@@ -82,7 +82,12 @@ export default function Conversation() {
|
|||||||
const sendMessage = () => {
|
const sendMessage = () => {
|
||||||
if (!chat) return;
|
if (!chat) return;
|
||||||
if (message.trim()) {
|
if (message.trim()) {
|
||||||
chat.push(Message.create({ text: message }, { owner: chat._owner }));
|
chat.push(
|
||||||
|
Message.create(
|
||||||
|
{ text: CoPlainText.create(message, chat._owner) },
|
||||||
|
chat._owner,
|
||||||
|
),
|
||||||
|
);
|
||||||
setMessage("");
|
setMessage("");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -104,7 +109,12 @@ export default function Conversation() {
|
|||||||
maxSize: 2048,
|
maxSize: 2048,
|
||||||
});
|
});
|
||||||
|
|
||||||
chat.push(Message.create({ text: "", image }, { owner: chat._owner }));
|
chat.push(
|
||||||
|
Message.create(
|
||||||
|
{ text: CoPlainText.create("", chat._owner), image },
|
||||||
|
chat._owner,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Alert.alert("Error", "Failed to upload image");
|
Alert.alert("Error", "Failed to upload image");
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn-expo-clerk",
|
"name": "chat-rn-expo-clerk",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"version": "1.0.93",
|
"version": "1.0.116",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "expo export -p ios",
|
"build": "expo export -p ios",
|
||||||
"start": "expo start",
|
"start": "expo start",
|
||||||
@@ -12,9 +12,6 @@
|
|||||||
"web": "expo start --web",
|
"web": "expo start --web",
|
||||||
"run:ios": "pnpm expo prebuild && npx pod-install && pnpm expo run:ios"
|
"run:ios": "pnpm expo prebuild && npx pod-install && pnpm expo run:ios"
|
||||||
},
|
},
|
||||||
"jest": {
|
|
||||||
"preset": "jest-expo"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
||||||
"@bacons/text-decoder": "0.0.0",
|
"@bacons/text-decoder": "0.0.0",
|
||||||
@@ -60,14 +57,11 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.25.2",
|
"@babel/core": "^7.25.2",
|
||||||
"@types/jest": "^29.5.13",
|
|
||||||
"@types/react": "~18.3.12",
|
"@types/react": "~18.3.12",
|
||||||
"@types/react-test-renderer": "^19.0.0",
|
"@types/react-test-renderer": "^19.0.0",
|
||||||
"jest": "^29.6.3",
|
|
||||||
"jest-expo": "~52.0.2",
|
|
||||||
"react-test-renderer": "18.3.1",
|
"react-test-renderer": "18.3.1",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "~5.6.2"
|
"typescript": "5.6.2"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { useClerk } from "@clerk/clerk-expo";
|
import { useClerk } from "@clerk/clerk-expo";
|
||||||
// FIXME: why isn't the export working? IDE is fine, Metro doesn't like the non 'dist' import
|
import { JazzProviderWithClerk } from "jazz-expo/auth/clerk";
|
||||||
import { JazzProviderWithClerk } from "jazz-expo/dist/auth/clerk";
|
|
||||||
import React, { PropsWithChildren } from "react";
|
import React, { PropsWithChildren } from "react";
|
||||||
import { apiKey } from "./apiKey";
|
import { apiKey } from "./apiKey";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { CoList, CoMap, ImageDefinition, co } from "jazz-tools";
|
import { CoList, CoMap, CoPlainText, ImageDefinition, co } from "jazz-tools";
|
||||||
|
|
||||||
export class Message extends CoMap {
|
export class Message extends CoMap {
|
||||||
text = co.string;
|
text = co.ref(CoPlainText);
|
||||||
image = co.optional.ref(ImageDefinition);
|
image = co.optional.ref(ImageDefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,178 @@
|
|||||||
# chat-rn-expo
|
# chat-rn-expo
|
||||||
|
|
||||||
|
## 1.0.103
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-expo@0.13.9
|
||||||
|
|
||||||
|
## 1.0.87
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.8
|
||||||
|
|
||||||
|
## 1.0.86
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- jazz-expo@0.13.7
|
||||||
|
|
||||||
|
## 1.0.85
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- jazz-expo@0.13.5
|
||||||
|
|
||||||
|
## 1.0.84
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-expo@0.13.4
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
|
||||||
|
## 1.0.83
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- jazz-expo@0.13.3
|
||||||
|
|
||||||
|
## 1.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-expo@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
|
||||||
|
## 1.0.81
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [63a7aa0]
|
||||||
|
- jazz-expo@0.13.1
|
||||||
|
|
||||||
## 1.0.80
|
## 1.0.80
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
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",
|
"name": "chat-rn-expo",
|
||||||
"version": "1.0.80",
|
"version": "1.0.103",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "expo export -p ios",
|
"build": "expo export -p ios",
|
||||||
@@ -36,6 +36,8 @@
|
|||||||
"react-dom": "18.3.1",
|
"react-dom": "18.3.1",
|
||||||
"react-native": "0.76.7",
|
"react-native": "0.76.7",
|
||||||
"react-native-get-random-values": "^1.11.0",
|
"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-safe-area-context": "4.12.0",
|
||||||
"react-native-screens": "4.4.0",
|
"react-native-screens": "4.4.0",
|
||||||
"react-native-url-polyfill": "^2.0.0",
|
"react-native-url-polyfill": "^2.0.0",
|
||||||
@@ -45,7 +47,7 @@
|
|||||||
"@babel/core": "^7.25.2",
|
"@babel/core": "^7.25.2",
|
||||||
"@types/react": "~18.3.12",
|
"@types/react": "~18.3.12",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "~5.6.2"
|
"typescript": "5.6.2"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
} from "@react-navigation/native";
|
} from "@react-navigation/native";
|
||||||
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
||||||
import * as Linking from "expo-linking";
|
import * as Linking from "expo-linking";
|
||||||
|
import { RNQuickCrypto } from "jazz-expo/crypto";
|
||||||
import React, { StrictMode, useEffect, useState } from "react";
|
import React, { StrictMode, useEffect, useState } from "react";
|
||||||
import HandleInviteScreen from "./invite";
|
import HandleInviteScreen from "./invite";
|
||||||
|
|
||||||
@@ -46,6 +47,7 @@ function App() {
|
|||||||
return (
|
return (
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<JazzProvider
|
<JazzProvider
|
||||||
|
CryptoProvider={RNQuickCrypto}
|
||||||
sync={{
|
sync={{
|
||||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { Chat, Message } from "./schema";
|
|||||||
export default function ChatScreen({ navigation }: { navigation: any }) {
|
export default function ChatScreen({ navigation }: { navigation: any }) {
|
||||||
const { me, logOut } = useAccount();
|
const { me, logOut } = useAccount();
|
||||||
const [chatId, setChatId] = useState<ID<Chat>>();
|
const [chatId, setChatId] = useState<ID<Chat>>();
|
||||||
|
const [chatIdInput, setChatIdInput] = useState<string>();
|
||||||
const loadedChat = useCoState(Chat, chatId, { resolve: { $each: true } });
|
const loadedChat = useCoState(Chat, chatId, { resolve: { $each: true } });
|
||||||
const [message, setMessage] = useState("");
|
const [message, setMessage] = useState("");
|
||||||
const profile = useCoState(Profile, me._refs.profile?.id, {});
|
const profile = useCoState(Profile, me._refs.profile?.id, {});
|
||||||
@@ -57,27 +58,11 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const joinChat = () => {
|
const joinChat = () => {
|
||||||
Alert.prompt(
|
if (chatIdInput) {
|
||||||
"Join Chat",
|
setChatId(chatIdInput as ID<Chat>);
|
||||||
"Enter the Chat ID (example: co_zBGEHYvRfGuT2YSBraY3njGjnde)",
|
} else {
|
||||||
[
|
Alert.alert("Error", "Chat ID cannot be empty.");
|
||||||
{
|
}
|
||||||
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",
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const sendMessage = () => {
|
const sendMessage = () => {
|
||||||
@@ -160,9 +145,25 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
|||||||
>
|
>
|
||||||
<Text className="text-white font-semibold">Start new chat</Text>
|
<Text className="text-white font-semibold">Start new chat</Text>
|
||||||
</TouchableOpacity>
|
</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
|
<TouchableOpacity
|
||||||
onPress={joinChat}
|
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>
|
<Text className="text-white font-semibold">Join chat</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@@ -172,7 +173,6 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
|||||||
<FlatList
|
<FlatList
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
flex: 1,
|
|
||||||
gap: 6,
|
gap: 6,
|
||||||
padding: 8,
|
padding: 8,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ appId: com.jazz.chatrn
|
|||||||
# - tapOn: "Reload"
|
# - tapOn: "Reload"
|
||||||
|
|
||||||
# login
|
# login
|
||||||
|
- assertVisible: "Logout"
|
||||||
|
- tapOn: "Logout"
|
||||||
- assertVisible: "Anonymous user"
|
- assertVisible: "Anonymous user"
|
||||||
- runFlow:
|
- runFlow:
|
||||||
label: "Erase existing username"
|
label: "Erase existing username"
|
||||||
@@ -42,9 +44,11 @@ appId: com.jazz.chatrn
|
|||||||
# logout
|
# logout
|
||||||
- tapOn: "Logout"
|
- tapOn: "Logout"
|
||||||
- assertVisible: "Anonymous user"
|
- assertVisible: "Anonymous user"
|
||||||
# This doesn't work on CI, maybe because Android has a different alert dialog
|
|
||||||
# - tapOn: "Join chat"
|
# join chat
|
||||||
# - inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
|
- tapOn:
|
||||||
# - pressKey: "enter"
|
id: "chat-id-input"
|
||||||
# - assertVisible: "boorad"
|
- inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
|
||||||
# - assertVisible: "bro, low key, it do be like that tho"
|
- tapOn: "Join chat"
|
||||||
|
- assertVisible: "boorad"
|
||||||
|
- assertVisible: "bro, low key, it do be like that tho"
|
||||||
|
|||||||
@@ -1,5 +1,232 @@
|
|||||||
# chat-rn
|
# chat-rn
|
||||||
|
|
||||||
|
## 1.0.111
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [a846e07]
|
||||||
|
- cojson@0.13.25
|
||||||
|
- cojson-transport-ws@0.13.25
|
||||||
|
- jazz-react-native@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-react-native@0.13.9
|
||||||
|
|
||||||
|
## 1.0.95
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- Updated dependencies [4e9aae1]
|
||||||
|
- Updated dependencies [21c935c]
|
||||||
|
- Updated dependencies [aa1c80e]
|
||||||
|
- Updated dependencies [13074be]
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- cojson@0.13.7
|
||||||
|
- jazz-react-native@0.13.7
|
||||||
|
- cojson-transport-ws@0.13.7
|
||||||
|
|
||||||
|
## 1.0.94
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [e090b39]
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- cojson@0.13.5
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- cojson-transport-ws@0.13.5
|
||||||
|
- jazz-react-native@0.13.5
|
||||||
|
|
||||||
|
## 1.0.93
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
- jazz-react-native@0.13.4
|
||||||
|
|
||||||
|
## 1.0.92
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [b19cab7]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- cojson-transport-ws@0.13.3
|
||||||
|
- jazz-react-native@0.13.3
|
||||||
|
|
||||||
|
## 1.0.91
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c551839]
|
||||||
|
- cojson@0.13.2
|
||||||
|
- cojson-transport-ws@0.13.2
|
||||||
|
- jazz-react-native@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
|
||||||
|
## 1.0.90
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [63a7aa0]
|
||||||
|
- jazz-react-native@0.13.1
|
||||||
|
|
||||||
## 1.0.89
|
## 1.0.89
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn",
|
"name": "chat-rn",
|
||||||
"version": "1.0.89",
|
"version": "1.0.111",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"android": "react-native run-android",
|
"android": "react-native run-android",
|
||||||
"ios": "react-native run-ios",
|
"ios": "react-native run-ios",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"start": "react-native start",
|
"start": "react-native start",
|
||||||
"test": "jest",
|
|
||||||
"pods": "pod-install"
|
"pods": "pod-install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -47,16 +46,13 @@
|
|||||||
"@react-native/typescript-config": "0.76.7",
|
"@react-native/typescript-config": "0.76.7",
|
||||||
"@rnx-kit/metro-config": "^2.0.1",
|
"@rnx-kit/metro-config": "^2.0.1",
|
||||||
"@rnx-kit/metro-resolver-symlinks": "^0.2.1",
|
"@rnx-kit/metro-resolver-symlinks": "^0.2.1",
|
||||||
"@types/jest": "^29.5.13",
|
|
||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-test-renderer": "^18.0.0",
|
"@types/react-test-renderer": "^18.0.0",
|
||||||
"babel-jest": "^29.6.3",
|
|
||||||
"eslint": "^8.19.0",
|
"eslint": "^8.19.0",
|
||||||
"jest": "^29.6.3",
|
|
||||||
"pod-install": "^0.3.5",
|
"pod-install": "^0.3.5",
|
||||||
"prettier": "2.8.8",
|
"prettier": "2.8.8",
|
||||||
"react-test-renderer": "18.3.1",
|
"react-test-renderer": "18.3.1",
|
||||||
"typescript": "5.0.4"
|
"typescript": "5.6.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Clipboard from "@react-native-clipboard/clipboard";
|
import Clipboard from "@react-native-clipboard/clipboard";
|
||||||
import { useAccount, useCoState } from "jazz-react-native";
|
import { useAccount, useCoState } from "jazz-react-native";
|
||||||
import { Group, ID, Profile } from "jazz-tools";
|
import { CoPlainText, Group, ID, Profile } from "jazz-tools";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
@@ -83,7 +83,10 @@ export function ChatScreen({ navigation }: { navigation: any }) {
|
|||||||
if (!loadedChat) return;
|
if (!loadedChat) return;
|
||||||
if (message.trim()) {
|
if (message.trim()) {
|
||||||
loadedChat.push(
|
loadedChat.push(
|
||||||
Message.create({ text: message }, { owner: loadedChat?._owner }),
|
Message.create(
|
||||||
|
{ text: CoPlainText.create(message, loadedChat?._owner) },
|
||||||
|
loadedChat?._owner,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
setMessage("");
|
setMessage("");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { CoList, CoMap, co } from "jazz-tools";
|
import { CoList, CoMap, CoPlainText, co } from "jazz-tools";
|
||||||
|
|
||||||
export class Message extends CoMap {
|
export class Message extends CoMap {
|
||||||
text = co.string;
|
text = co.ref(CoPlainText);
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Chat extends CoList.Of(co.ref(Message)) {}
|
export class Chat extends CoList.Of(co.ref(Message)) {}
|
||||||
|
|||||||
@@ -1,5 +1,178 @@
|
|||||||
# chat-vue
|
# chat-vue
|
||||||
|
|
||||||
|
## 0.0.94
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
- jazz-vue@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-browser@0.13.9
|
||||||
|
- jazz-vue@0.13.9
|
||||||
|
|
||||||
|
## 0.0.79
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- jazz-browser@0.13.7
|
||||||
|
- jazz-vue@0.13.7
|
||||||
|
|
||||||
|
## 0.0.78
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- jazz-browser@0.13.5
|
||||||
|
- jazz-vue@0.13.5
|
||||||
|
|
||||||
|
## 0.0.77
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-browser@0.13.4
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
- jazz-vue@0.13.4
|
||||||
|
|
||||||
|
## 0.0.76
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- jazz-browser@0.13.3
|
||||||
|
- jazz-vue@0.13.3
|
||||||
|
|
||||||
|
## 0.0.75
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
- jazz-vue@0.13.2
|
||||||
|
|
||||||
## 0.0.74
|
## 0.0.74
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="icon" href="/favicon.ico">
|
<link rel="icon" href="./public/favicon.ico" type="image/png">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Vite App</title>
|
<title>Jazz Chat Vue Example</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-vue",
|
"name": "chat-vue",
|
||||||
"version": "0.0.74",
|
"version": "0.0.94",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build-type-check": "run-p type-check \"build-only {@}\" --",
|
"build-type-check": "run-p type-check \"build {@}\" --",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"type-check": "vue-tsc --build --force",
|
"type-check": "vue-tsc --build --force",
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
"npm-run-all2": "^6.2.3",
|
"npm-run-all2": "^6.2.3",
|
||||||
"postcss": "^8.4.27",
|
"postcss": "^8.4.27",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "5.6.2",
|
||||||
"vite": "^6.0.11",
|
"vite": "6.0.11",
|
||||||
"vite-plugin-vue-devtools": "^7.4.6",
|
"vite-plugin-vue-devtools": "^7.4.6",
|
||||||
"vue-tsc": "^2.1.6"
|
"vue-tsc": "^2.1.6"
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<BubbleContainer :fromMe="lastEdit.by?.isMe">
|
<BubbleContainer :fromMe="lastEdit.by?.isMe">
|
||||||
<BubbleBody>{{ msg.text }}</BubbleBody>
|
<BubbleBody>{{ msg.text }}</BubbleBody>
|
||||||
<BubbleInfo :by="lastEdit.by?.profile?.name" :madeAt="lastEdit.madeAt" />
|
<BubbleInfo :by="lastEdit.by?.profile?.name" :madeAt="lastEdit.madeAt" />
|
||||||
</BubbleContainer>
|
</BubbleContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent } from "vue";
|
import { computed, defineComponent } from "vue";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { CoList, CoMap, co } from "jazz-tools";
|
import { CoList, CoMap, CoPlainText, co } from "jazz-tools";
|
||||||
|
|
||||||
export class Message extends CoMap {
|
export class Message extends CoMap {
|
||||||
text = co.string;
|
text = co.ref(CoPlainText);
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Chat extends CoList.Of(co.ref(Message)) {}
|
export class Chat extends CoList.Of(co.ref(Message)) {}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { ID } from "jazz-tools";
|
import { CoPlainText, type ID } from "jazz-tools";
|
||||||
import { useCoState } from "jazz-vue";
|
import { useCoState } from "jazz-vue";
|
||||||
import { type PropType, computed, defineComponent, ref } from "vue";
|
import { type PropType, computed, defineComponent, ref } from "vue";
|
||||||
import ChatBody from "../components/ChatBody.vue";
|
import ChatBody from "../components/ChatBody.vue";
|
||||||
@@ -61,7 +61,12 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleSubmit(text: string) {
|
function handleSubmit(text: string) {
|
||||||
chat?.value?.push(Message.create({ text }, { owner: chat.value._owner }));
|
chat?.value?.push(
|
||||||
|
Message.create(
|
||||||
|
{ text: CoPlainText.create(text, chat.value._owner) },
|
||||||
|
chat.value._owner,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,5 +1,191 @@
|
|||||||
# jazz-example-chat
|
# jazz-example-chat
|
||||||
|
|
||||||
|
## 0.0.192
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.25
|
||||||
|
- jazz-react@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-inspector@0.13.9
|
||||||
|
- jazz-react@0.13.9
|
||||||
|
|
||||||
|
## 0.0.177
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [22b5c4f]
|
||||||
|
- Updated dependencies [31ea2ef]
|
||||||
|
- Updated dependencies [4530c4a]
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- jazz-inspector@0.13.7
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- jazz-react@0.13.7
|
||||||
|
|
||||||
|
## 0.0.176
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c320615]
|
||||||
|
- jazz-inspector@0.13.6
|
||||||
|
|
||||||
|
## 0.0.175
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [08ae9b2]
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- jazz-inspector@0.13.5
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- jazz-react@0.13.5
|
||||||
|
|
||||||
|
## 0.0.174
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-react@0.13.4
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
- jazz-inspector@0.13.4
|
||||||
|
|
||||||
|
## 0.0.173
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- Updated dependencies [017f6c8]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- jazz-inspector@0.13.3
|
||||||
|
- jazz-react@0.13.3
|
||||||
|
|
||||||
|
## 0.0.172
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ae4be2b]
|
||||||
|
- jazz-inspector@0.13.2
|
||||||
|
- jazz-react@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
|
||||||
## 0.0.171
|
## 0.0.171
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-chat",
|
"name": "jazz-example-chat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.171",
|
"version": "0.0.192",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
"is-ci": "^3.0.1",
|
"is-ci": "^3.0.1",
|
||||||
"postcss": "^8.4.27",
|
"postcss": "^8.4.27",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "5.6.2",
|
||||||
"vite": "^6.0.11"
|
"vite": "6.0.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -1,5 +1,5 @@
|
|||||||
import { createImage, useAccount, useCoState } from "jazz-react";
|
import { createImage, useAccount, useCoState } from "jazz-react";
|
||||||
import { Account, ID } from "jazz-tools";
|
import { Account, CoPlainText, ID } from "jazz-tools";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Chat, Message } from "./schema.ts";
|
import { Chat, Message } from "./schema.ts";
|
||||||
import {
|
import {
|
||||||
@@ -36,7 +36,15 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createImage(file, { owner: chat._owner }).then((image) => {
|
createImage(file, { owner: chat._owner }).then((image) => {
|
||||||
chat.push(Message.create({ text: file.name, image: image }, chat._owner));
|
chat.push(
|
||||||
|
Message.create(
|
||||||
|
{
|
||||||
|
text: CoPlainText.create(file.name, chat._owner),
|
||||||
|
image: image,
|
||||||
|
},
|
||||||
|
chat._owner,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -66,7 +74,12 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
|
|||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
onSubmit={(text) => {
|
onSubmit={(text) => {
|
||||||
chat.push(Message.create({ text }, { owner: chat._owner }));
|
chat.push(
|
||||||
|
Message.create(
|
||||||
|
{ text: CoPlainText.create(text, chat._owner) },
|
||||||
|
chat._owner,
|
||||||
|
),
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</InputBar>
|
</InputBar>
|
||||||
@@ -75,7 +88,7 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ChatBubble(props: { me: Account; msg: Message }) {
|
function ChatBubble(props: { me: Account; msg: Message }) {
|
||||||
if (!props.me.canRead(props.msg)) {
|
if (!props.me.canRead(props.msg) || !props.msg.text?.toString()) {
|
||||||
return (
|
return (
|
||||||
<BubbleContainer fromMe={false}>
|
<BubbleContainer fromMe={false}>
|
||||||
<BubbleBody fromMe={false}>
|
<BubbleBody fromMe={false}>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { CoList, CoMap, ImageDefinition, co } from "jazz-tools";
|
import { CoList, CoMap, CoPlainText, ImageDefinition, co } from "jazz-tools";
|
||||||
|
|
||||||
export class Message extends CoMap {
|
export class Message extends CoMap {
|
||||||
text = co.string;
|
text = co.ref(CoPlainText);
|
||||||
image = co.optional.ref(ImageDefinition);
|
image = co.optional.ref(ImageDefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { ProgressiveImg } from "jazz-react";
|
import { ProgressiveImg } from "jazz-react";
|
||||||
import { ImageDefinition } from "jazz-tools";
|
import { CoPlainText, ImageDefinition } from "jazz-tools";
|
||||||
import { ImageIcon } from "lucide-react";
|
import { ImageIcon } from "lucide-react";
|
||||||
import { useId, useRef } from "react";
|
import { useId, useRef } from "react";
|
||||||
|
|
||||||
@@ -70,7 +70,10 @@ export function BubbleBody(props: {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function BubbleText(props: { text: string; className?: string }) {
|
export function BubbleText(props: {
|
||||||
|
text: CoPlainText | string;
|
||||||
|
className?: string;
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<p className={clsx("px-2 leading-relaxed", props.className)}>
|
<p className={clsx("px-2 leading-relaxed", props.className)}>
|
||||||
{props.text}
|
{props.text}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ const config: Config = {
|
|||||||
blue: {
|
blue: {
|
||||||
...colors.indigo,
|
...colors.indigo,
|
||||||
500: "#5870F1",
|
500: "#5870F1",
|
||||||
DEFAULT: "#3313F7",
|
DEFAULT: "#146AFF",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
@@ -56,18 +56,6 @@ const config: Config = {
|
|||||||
plugins: [
|
plugins: [
|
||||||
plugin(({ addBase }) =>
|
plugin(({ addBase }) =>
|
||||||
addBase({
|
addBase({
|
||||||
":root": {
|
|
||||||
"--gcmp-border-color": stonePalette[200],
|
|
||||||
"--gcmp-invert-border-color": stonePalette[900],
|
|
||||||
},
|
|
||||||
"*": {
|
|
||||||
borderColor: "var(--gcmp-border-color)",
|
|
||||||
},
|
|
||||||
"@media (prefers-color-scheme: dark)": {
|
|
||||||
"*": {
|
|
||||||
borderColor: "var(--gcmp-invert-border-color)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"*:focus": {
|
"*:focus": {
|
||||||
outline: "none",
|
outline: "none",
|
||||||
},
|
},
|
||||||
|
|||||||
2
examples/clerk/.gitignore
vendored
@@ -22,3 +22,5 @@ dist-ssr
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
playwright-report
|
||||||
@@ -1,5 +1,184 @@
|
|||||||
# minimal-auth-clerk
|
# minimal-auth-clerk
|
||||||
|
|
||||||
|
## 0.0.91
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.25
|
||||||
|
- jazz-react-auth-clerk@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-react@0.13.9
|
||||||
|
- jazz-react-auth-clerk@0.13.9
|
||||||
|
|
||||||
|
## 0.0.76
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-auth-clerk@0.13.8
|
||||||
|
|
||||||
|
## 0.0.75
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- jazz-react@0.13.7
|
||||||
|
- jazz-react-auth-clerk@0.13.7
|
||||||
|
|
||||||
|
## 0.0.74
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- jazz-react@0.13.5
|
||||||
|
- jazz-react-auth-clerk@0.13.5
|
||||||
|
|
||||||
|
## 0.0.73
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-react-auth-clerk@0.13.4
|
||||||
|
- jazz-react@0.13.4
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
|
||||||
|
## 0.0.72
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- jazz-react@0.13.3
|
||||||
|
- jazz-react-auth-clerk@0.13.3
|
||||||
|
|
||||||
|
## 0.0.71
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.2
|
||||||
|
- jazz-react-auth-clerk@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
|
||||||
## 0.0.70
|
## 0.0.70
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "clerk",
|
"name": "clerk",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.70",
|
"version": "0.0.91",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc -b && vite build",
|
"build": "tsc -b && vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"format-and-lint": "biome check .",
|
"format-and-lint": "biome check .",
|
||||||
"format-and-lint:fix": "biome check . --write"
|
"format-and-lint:fix": "biome check . --write",
|
||||||
|
"test:e2e": "playwright test",
|
||||||
|
"test:e2e:ui": "playwright test --ui"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clerk/clerk-react": "^5.4.1",
|
"@clerk/clerk-react": "^5.4.1",
|
||||||
@@ -19,12 +21,13 @@
|
|||||||
"react-dom": "^18.3.1"
|
"react-dom": "^18.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@playwright/test": "^1.50.1",
|
||||||
"@biomejs/biome": "1.9.4",
|
"@biomejs/biome": "1.9.4",
|
||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"@vitejs/plugin-react": "^4.3.3",
|
"@vitejs/plugin-react": "^4.3.3",
|
||||||
"globals": "^15.11.0",
|
"globals": "^15.11.0",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "5.6.2",
|
||||||
"vite": "^6.0.11"
|
"vite": "6.0.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
53
examples/clerk/playwright.config.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { defineConfig, devices } from "@playwright/test";
|
||||||
|
import isCI from "is-ci";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read environment variables from file.
|
||||||
|
* https://github.com/motdotla/dotenv
|
||||||
|
*/
|
||||||
|
// import dotenv from 'dotenv';
|
||||||
|
// dotenv.config({ path: path.resolve(__dirname, '.env') });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { SignInButton } from "@clerk/clerk-react";
|
import { SignInButton, SignOutButton } from "@clerk/clerk-react";
|
||||||
import { useAccount, useIsAuthenticated } from "jazz-react";
|
import { useAccount, useIsAuthenticated } from "jazz-react";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const { me, logOut } = useAccount();
|
const { me } = useAccount();
|
||||||
|
|
||||||
const isAuthenticated = useIsAuthenticated();
|
const isAuthenticated = useIsAuthenticated();
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ function App() {
|
|||||||
<div className="container">
|
<div className="container">
|
||||||
<h1>You're logged in</h1>
|
<h1>You're logged in</h1>
|
||||||
<p>Welcome back, {me?.profile?.name}</p>
|
<p>Welcome back, {me?.profile?.name}</p>
|
||||||
<button onClick={() => logOut()}>Logout</button>
|
<SignOutButton>Logout</SignOutButton>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ClerkProvider, useClerk } from "@clerk/clerk-react";
|
import { ClerkProvider, SignOutButton, useClerk } from "@clerk/clerk-react";
|
||||||
import { StrictMode } from "react";
|
import { StrictMode } from "react";
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import App from "./App.tsx";
|
import App from "./App.tsx";
|
||||||
@@ -28,12 +28,23 @@ function JazzProvider({ children }: { children: React.ReactNode }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
createRoot(document.getElementById("root")!).render(
|
// Route to test that when the Clerk user expires, the app is logged out
|
||||||
<StrictMode>
|
if (location.search.includes("expirationTest")) {
|
||||||
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
|
createRoot(document.getElementById("root")!).render(
|
||||||
<JazzProvider>
|
<StrictMode>
|
||||||
<App />
|
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
|
||||||
</JazzProvider>
|
<SignOutButton>Simulate expiration</SignOutButton>
|
||||||
</ClerkProvider>
|
</ClerkProvider>
|
||||||
</StrictMode>,
|
</StrictMode>,
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
createRoot(document.getElementById("root")!).render(
|
||||||
|
<StrictMode>
|
||||||
|
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
|
||||||
|
<JazzProvider>
|
||||||
|
<App />
|
||||||
|
</JazzProvider>
|
||||||
|
</ClerkProvider>
|
||||||
|
</StrictMode>,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
36
examples/clerk/tests/expiration.spec.ts
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
|
test("login & expiration", async ({ page }) => {
|
||||||
|
await page.goto("/");
|
||||||
|
|
||||||
|
expect(page.getByText("You're not logged in")).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.getByRole("textbox", { name: "Email address" })
|
||||||
|
.fill("guido+clerk-test@garden.co");
|
||||||
|
|
||||||
|
await page.keyboard.press("Enter");
|
||||||
|
|
||||||
|
await page
|
||||||
|
.getByRole("textbox", { name: "Password" })
|
||||||
|
.fill("guido+clerk-test@garden.co");
|
||||||
|
|
||||||
|
await page.keyboard.press("Enter");
|
||||||
|
|
||||||
|
await page.waitForURL("/");
|
||||||
|
|
||||||
|
await page.getByText("You're logged in").waitFor({ state: "visible" });
|
||||||
|
|
||||||
|
expect(page.getByText("You're logged in")).toBeVisible();
|
||||||
|
|
||||||
|
await page.goto("/?expirationTest");
|
||||||
|
|
||||||
|
// Simulate expiration by logging out outside of Jazz
|
||||||
|
await page.getByRole("button", { name: "Simulate expiration" }).click();
|
||||||
|
|
||||||
|
await page.goto("/");
|
||||||
|
|
||||||
|
await page.getByText("You're not logged in").waitFor({ state: "visible" });
|
||||||
|
});
|
||||||
33
examples/clerk/tests/logout.spec.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
|
test("login & logout", async ({ page }) => {
|
||||||
|
await page.goto("/");
|
||||||
|
|
||||||
|
expect(page.getByText("You're not logged in")).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.getByRole("textbox", { name: "Email address" })
|
||||||
|
.fill("guido+clerk-test@garden.co");
|
||||||
|
|
||||||
|
await page.keyboard.press("Enter");
|
||||||
|
|
||||||
|
await page
|
||||||
|
.getByRole("textbox", { name: "Password" })
|
||||||
|
.fill("guido+clerk-test@garden.co");
|
||||||
|
|
||||||
|
await page.keyboard.press("Enter");
|
||||||
|
|
||||||
|
await page.waitForURL("/");
|
||||||
|
|
||||||
|
await page.getByText("You're logged in").waitFor({ state: "visible" });
|
||||||
|
|
||||||
|
expect(page.getByText("You're logged in")).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole("button", { name: "Logout" }).click();
|
||||||
|
|
||||||
|
await page.getByText("You're not logged in").waitFor({ state: "visible" });
|
||||||
|
|
||||||
|
expect(page.getByText("You're not logged in")).toBeVisible();
|
||||||
|
});
|
||||||
33
examples/clerk/tests/reload.spec.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
|
test("login & reload", async ({ page }) => {
|
||||||
|
await page.goto("/");
|
||||||
|
|
||||||
|
expect(page.getByText("You're not logged in")).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole("button", { name: "Sign in" }).click();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.getByRole("textbox", { name: "Email address" })
|
||||||
|
.fill("guido+clerk-test@garden.co");
|
||||||
|
|
||||||
|
await page.keyboard.press("Enter");
|
||||||
|
|
||||||
|
await page
|
||||||
|
.getByRole("textbox", { name: "Password" })
|
||||||
|
.fill("guido+clerk-test@garden.co");
|
||||||
|
|
||||||
|
await page.keyboard.press("Enter");
|
||||||
|
|
||||||
|
await page.waitForURL("/");
|
||||||
|
|
||||||
|
await page.getByText("You're logged in").waitFor({ state: "visible" });
|
||||||
|
|
||||||
|
expect(page.getByText("You're logged in")).toBeVisible();
|
||||||
|
|
||||||
|
await page.reload();
|
||||||
|
|
||||||
|
await page.getByText("You're logged in").waitFor({ state: "visible" });
|
||||||
|
|
||||||
|
expect(page.getByText("You're logged in")).toBeVisible();
|
||||||
|
});
|
||||||
@@ -1,5 +1,168 @@
|
|||||||
# file-share-svelte
|
# file-share-svelte
|
||||||
|
|
||||||
|
## 0.0.75
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
- jazz-inspector-element@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-svelte@0.13.9
|
||||||
|
|
||||||
|
## 0.0.59
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- jazz-svelte@0.13.7
|
||||||
|
|
||||||
|
## 0.0.58
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- jazz-svelte@0.13.5
|
||||||
|
|
||||||
|
## 0.0.57
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
- jazz-svelte@0.13.4
|
||||||
|
|
||||||
|
## 0.0.56
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- jazz-svelte@0.13.3
|
||||||
|
|
||||||
|
## 0.0.55
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-svelte@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
|
||||||
## 0.0.54
|
## 0.0.54
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "file-share-svelte",
|
"name": "file-share-svelte",
|
||||||
"version": "0.0.54",
|
"version": "0.0.75",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -33,12 +33,13 @@
|
|||||||
"svelte": "^5.0.0",
|
"svelte": "^5.0.0",
|
||||||
"svelte-check": "^4.0.0",
|
"svelte-check": "^4.0.0",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "5.6.2",
|
||||||
"typescript-eslint": "^8.0.0",
|
"typescript-eslint": "^8.0.0",
|
||||||
"vite": "^6.0.11"
|
"vite": "6.0.11"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tailwindcss/typography": "^0.5.15",
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
|
"jazz-inspector-element": "workspace:*",
|
||||||
"jazz-svelte": "workspace:*",
|
"jazz-svelte": "workspace:*",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:*",
|
||||||
"lucide-svelte": "^0.463.0",
|
"lucide-svelte": "^0.463.0",
|
||||||
|
|||||||
@@ -3,9 +3,8 @@
|
|||||||
import { SharedFile } from '$lib/schema';
|
import { SharedFile } from '$lib/schema';
|
||||||
import { FileStream } from 'jazz-tools';
|
import { FileStream } from 'jazz-tools';
|
||||||
import { File, FileDown, Trash2, Link2 } from 'lucide-svelte';
|
import { File, FileDown, Trash2, Link2 } from 'lucide-svelte';
|
||||||
import { useAccount } from 'jazz-svelte';
|
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
import { formatFileSize } from '$lib/utils';
|
import { downloadFileBlob, formatFileSize } from '$lib/utils';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
file,
|
file,
|
||||||
@@ -17,32 +16,22 @@
|
|||||||
onDelete: (file: SharedFile) => void;
|
onDelete: (file: SharedFile) => void;
|
||||||
} = $props();
|
} = $props();
|
||||||
|
|
||||||
const { me } = useAccount();
|
const isAdmin = $derived(file._owner?.myRole() === 'admin');
|
||||||
const isAdmin = $derived(me && file._owner?.myRole() === 'admin');
|
const fileStreamId = $derived(file._refs.file?.id);
|
||||||
|
|
||||||
async function downloadFile() {
|
async function downloadFile() {
|
||||||
if (!file._refs.file?.id || !me) {
|
if (!fileStreamId) {
|
||||||
toast.error('Failed to download file');
|
toast.error('Failed to download file');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const fileId = file._refs.file.id;
|
const blob = await FileStream.loadAsBlob(fileStreamId);
|
||||||
|
|
||||||
// Load the file as a blob, can take a while
|
|
||||||
const blob = await FileStream.loadAsBlob(fileId, me, {});
|
|
||||||
if (!blob) {
|
if (!blob) {
|
||||||
toast.error('Failed to download file');
|
toast.error('Failed to download file');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const url = URL.createObjectURL(blob);
|
downloadFileBlob(blob, file.name);
|
||||||
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);
|
|
||||||
toast.success('File downloaded successfully');
|
toast.success('File downloaded successfully');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error downloading file:', 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"
|
class="flex items-center justify-between rounded-lg border border-gray-200 bg-white p-4"
|
||||||
transition:slide={{ duration: 200 }}
|
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">
|
<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" />
|
<File class="h-6 w-6" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="flex-grow">
|
||||||
<a href="/file/{file.id}" class="hover:text-blue-600 hover:underline">
|
{#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>
|
<h3 class="font-medium text-gray-900">{file.name}</h3>
|
||||||
</a>
|
{/if}
|
||||||
<p class="text-sm text-gray-500">
|
<p class="text-sm text-gray-500">
|
||||||
{isAdmin ? 'Owned by you' : ''} • Uploaded {new Date(
|
{isAdmin ? 'Owned by you' : ''} • Uploaded {new Date(
|
||||||
file.createdAt || 0
|
file.createdAt || 0
|
||||||
|
|||||||
@@ -15,9 +15,8 @@ export class FileShareProfile extends Profile {
|
|||||||
export class ListOfSharedFiles extends CoList.Of(co.ref(SharedFile)) {}
|
export class ListOfSharedFiles extends CoList.Of(co.ref(SharedFile)) {}
|
||||||
|
|
||||||
export class FileShareAccountRoot extends CoMap {
|
export class FileShareAccountRoot extends CoMap {
|
||||||
type = co.string;
|
type = co.literal('file-share-account');
|
||||||
sharedFiles = co.ref(ListOfSharedFiles);
|
sharedFiles = co.ref(ListOfSharedFiles);
|
||||||
publicGroup = co.ref(Group);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FileShareAccount extends Account {
|
export class FileShareAccount extends Account {
|
||||||
@@ -31,7 +30,7 @@ export class FileShareAccount extends Account {
|
|||||||
await this._refs.root?.load();
|
await this._refs.root?.load();
|
||||||
|
|
||||||
// Initialize root if it doesn't exist
|
// 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
|
// Create a group that will own all shared files
|
||||||
const publicGroup = Group.create({ owner: this });
|
const publicGroup = Group.create({ owner: this });
|
||||||
publicGroup.addMember('everyone', 'reader');
|
publicGroup.addMember('everyone', 'reader');
|
||||||
@@ -40,9 +39,7 @@ export class FileShareAccount extends Account {
|
|||||||
{
|
{
|
||||||
type: 'file-share-account',
|
type: 'file-share-account',
|
||||||
sharedFiles: ListOfSharedFiles.create([], { owner: publicGroup }),
|
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 {
|
export function generateTempFileId(fileName: string | undefined, createdAt: Date | undefined): string {
|
||||||
return `file-${fileName ?? 'unknown'}-${createdAt?.getTime() ?? 0}`;
|
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">
|
<script lang="ts">
|
||||||
import { JazzProvider } from 'jazz-svelte';
|
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 { Toaster } from 'svelte-sonner';
|
||||||
import '../app.css';
|
import '../app.css';
|
||||||
import { FileShareAccount } from '$lib/schema';
|
import { FileShareAccount } from '$lib/schema';
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<jazz-inspector></jazz-inspector>
|
||||||
<PasskeyAuthBasicUI appName="File Share">
|
<PasskeyAuthBasicUI appName="File Share">
|
||||||
<div class="min-h-screen bg-gray-100">
|
<div class="min-h-screen bg-gray-100">
|
||||||
{@render children()}
|
{@render children()}
|
||||||
|
|||||||
@@ -1,54 +1,38 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { useAccount, useCoState } from 'jazz-svelte';
|
import { AccountCoState } from 'jazz-svelte';
|
||||||
import { SharedFile, ListOfSharedFiles } from '$lib/schema';
|
import { SharedFile } from '$lib/schema';
|
||||||
import { createInviteLink } from 'jazz-svelte';
|
|
||||||
import { FileStream } from 'jazz-tools';
|
import { FileStream } from 'jazz-tools';
|
||||||
import FileItem from '$lib/components/FileItem.svelte';
|
import FileItem from '$lib/components/FileItem.svelte';
|
||||||
import { SvelteMap } from 'svelte/reactivity';
|
|
||||||
import { generateTempFileId } from '$lib/utils';
|
|
||||||
import { CloudUpload } from 'lucide-svelte';
|
import { CloudUpload } from 'lucide-svelte';
|
||||||
|
|
||||||
const { me, logOut } = useAccount();
|
const me = new AccountCoState({
|
||||||
|
resolve: {
|
||||||
|
profile: true,
|
||||||
|
root: {
|
||||||
|
sharedFiles: {
|
||||||
|
$each: true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const mySharedFilesId = me?.root?._refs.sharedFiles.id;
|
const sharedFiles = $derived(me.current?.root.sharedFiles);
|
||||||
const sharedFiles = $derived(useCoState(ListOfSharedFiles, mySharedFilesId, [{}]));
|
|
||||||
|
|
||||||
let fileInput: HTMLInputElement;
|
let fileInput: HTMLInputElement;
|
||||||
|
|
||||||
type PendingSharedFile = {
|
|
||||||
name: string;
|
|
||||||
id: string;
|
|
||||||
createdAt: Date;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Track files that are currently uploading
|
|
||||||
const uploadingFiles = new SvelteMap<string, PendingSharedFile>();
|
|
||||||
|
|
||||||
async function handleFileUpload(event: Event) {
|
async function handleFileUpload(event: Event) {
|
||||||
const input = event.target as HTMLInputElement;
|
const input = event.target as HTMLInputElement;
|
||||||
const files = input.files;
|
const files = input.files;
|
||||||
|
|
||||||
if (!files || !files.length || !me.root?.sharedFiles || !me.root.publicGroup) return;
|
if (!files?.length || !sharedFiles) return;
|
||||||
|
|
||||||
const file = files[0];
|
const file = files[0];
|
||||||
const fileName = file.name;
|
const fileName = file.name;
|
||||||
const createdAt = new Date();
|
const createdAt = new Date();
|
||||||
const fileId = generateTempFileId(fileName, createdAt);
|
|
||||||
|
|
||||||
const tempFile: PendingSharedFile = {
|
|
||||||
name: fileName,
|
|
||||||
id: fileId,
|
|
||||||
createdAt
|
|
||||||
};
|
|
||||||
|
|
||||||
// Add to uploading files
|
|
||||||
uploadingFiles.set(fileId, tempFile);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ownership = { owner: me.root.publicGroup };
|
|
||||||
|
|
||||||
// Create a FileStream from the uploaded file
|
// 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
|
// Create the shared file entry
|
||||||
const sharedFile = SharedFile.create(
|
const sharedFile = SharedFile.create(
|
||||||
@@ -59,29 +43,22 @@
|
|||||||
uploadedAt: new Date(),
|
uploadedAt: new Date(),
|
||||||
size: file.size
|
size: file.size
|
||||||
},
|
},
|
||||||
ownership
|
sharedFiles._owner
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add the file to the user's files list
|
// Add the file to the user's files list
|
||||||
me.root.sharedFiles.push(sharedFile);
|
sharedFiles.push(sharedFile);
|
||||||
} finally {
|
} finally {
|
||||||
uploadingFiles.delete(fileId);
|
|
||||||
fileInput.value = ''; // reset input
|
fileInput.value = ''; // reset input
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function shareFile(file: SharedFile) {
|
|
||||||
const inviteLink = createInviteLink(file, 'reader');
|
|
||||||
await navigator.clipboard.writeText(inviteLink);
|
|
||||||
alert('Share link copied to clipboard!');
|
|
||||||
}
|
|
||||||
|
|
||||||
async function deleteFile(file: SharedFile) {
|
async function deleteFile(file: SharedFile) {
|
||||||
if (!me?.root?.sharedFiles || !sharedFiles.current) return;
|
if (!sharedFiles) return;
|
||||||
|
|
||||||
const index = sharedFiles.current.indexOf(file);
|
const index = sharedFiles.indexOf(file);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
me.root.sharedFiles.splice(index, 1);
|
sharedFiles.splice(index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -91,11 +68,11 @@
|
|||||||
<div class="mb-12 flex items-center justify-between">
|
<div class="mb-12 flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h1 class="mb-2 text-4xl font-bold text-gray-900">File Share</h1>
|
<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>
|
</div>
|
||||||
|
|
||||||
<button
|
<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"
|
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
|
Log Out
|
||||||
@@ -126,14 +103,12 @@
|
|||||||
|
|
||||||
<!-- Files List -->
|
<!-- Files List -->
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
{#if sharedFiles.current}
|
{#if sharedFiles}
|
||||||
{#if !(sharedFiles.current.length === 0 && uploadingFiles.size === 0)}
|
{#if sharedFiles.length}
|
||||||
{#each [...sharedFiles.current, ...uploadingFiles.values()] as file (generateTempFileId(file?.name, file?.createdAt))}
|
{#each sharedFiles as file}
|
||||||
{#if file}
|
{#if file}
|
||||||
<FileItem
|
<FileItem
|
||||||
{file}
|
{file}
|
||||||
loading={uploadingFiles.has(generateTempFileId(file?.name, file?.createdAt))}
|
|
||||||
onShare={shareFile}
|
|
||||||
onDelete={deleteFile}
|
onDelete={deleteFile}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,39 +1,33 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import { useAccount, useCoState } from 'jazz-svelte';
|
import { CoState } from 'jazz-svelte';
|
||||||
import { SharedFile } from '$lib/schema';
|
import { SharedFile } from '$lib/schema';
|
||||||
import { File, FileDown, Link2 } from 'lucide-svelte';
|
import { File, FileDown, Link2 } from 'lucide-svelte';
|
||||||
import type { ID } from 'jazz-tools';
|
import type { ID } from 'jazz-tools';
|
||||||
import { FileStream } from 'jazz-tools';
|
import { FileStream } from 'jazz-tools';
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
|
import { downloadFileBlob } from '$lib/utils';
|
||||||
|
|
||||||
const { me } = useAccount();
|
|
||||||
const fileId = $page.params.fileId;
|
const fileId = $page.params.fileId;
|
||||||
|
|
||||||
const file = $state(useCoState(SharedFile, fileId as ID<SharedFile>, {}));
|
const file = $derived(new CoState(SharedFile, fileId as ID<SharedFile>));
|
||||||
const isAdmin = $derived(me && file.current?._owner?.myRole() === 'admin');
|
const isAdmin = $derived(file.current?._owner?.myRole() === 'admin');
|
||||||
|
|
||||||
|
const fileStreamId = $derived(file.current?._refs.file?.id);
|
||||||
|
|
||||||
async function downloadFile() {
|
async function downloadFile() {
|
||||||
if (!file.current?._refs.file?.id || !me) {
|
if (!fileStreamId || !file.current) {
|
||||||
toast.error('Failed to download file');
|
toast.error('Failed to download file');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const fileId = file.current._refs.file.id;
|
const blob = await FileStream.loadAsBlob(fileStreamId);
|
||||||
const blob = await FileStream.loadAsBlob(fileId, me, {});
|
|
||||||
if (!blob) {
|
if (!blob) {
|
||||||
toast.error('Failed to download file');
|
toast.error('Failed to download file');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const url = URL.createObjectURL(blob);
|
downloadFileBlob(blob, file.current.name);
|
||||||
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);
|
|
||||||
toast.success('File downloaded successfully');
|
toast.success('File downloaded successfully');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error downloading file:', error);
|
console.error('Error downloading file:', error);
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -59,7 +59,7 @@ test('can login with passkey and upload file', async ({ page, browser }) => {
|
|||||||
await fileChooser.setFiles(filePath);
|
await fileChooser.setFiles(filePath);
|
||||||
|
|
||||||
// Verify the uploaded file appears in the list
|
// 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();
|
await page.getByRole('button', { name: 'Share file' }).click();
|
||||||
const inviteLink = await page.evaluate(() => navigator.clipboard.readText());
|
const inviteLink = await page.evaluate(() => navigator.clipboard.readText());
|
||||||
|
|||||||
@@ -1,5 +1,191 @@
|
|||||||
# jazz-tailwind-demo-auth-starter
|
# jazz-tailwind-demo-auth-starter
|
||||||
|
|
||||||
|
## 0.0.31
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.25
|
||||||
|
- jazz-react@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-inspector@0.13.9
|
||||||
|
- jazz-react@0.13.9
|
||||||
|
|
||||||
|
## 0.0.16
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [22b5c4f]
|
||||||
|
- Updated dependencies [31ea2ef]
|
||||||
|
- Updated dependencies [4530c4a]
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- jazz-inspector@0.13.7
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- jazz-react@0.13.7
|
||||||
|
|
||||||
|
## 0.0.15
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c320615]
|
||||||
|
- jazz-inspector@0.13.6
|
||||||
|
|
||||||
|
## 0.0.14
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [08ae9b2]
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- jazz-inspector@0.13.5
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- jazz-react@0.13.5
|
||||||
|
|
||||||
|
## 0.0.13
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-react@0.13.4
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
- jazz-inspector@0.13.4
|
||||||
|
|
||||||
|
## 0.0.12
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- Updated dependencies [017f6c8]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- jazz-inspector@0.13.3
|
||||||
|
- jazz-react@0.13.3
|
||||||
|
|
||||||
|
## 0.0.11
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ae4be2b]
|
||||||
|
- jazz-inspector@0.13.2
|
||||||
|
- jazz-react@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
|
||||||
## 0.0.10
|
## 0.0.10
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en" class="h-full">
|
<html lang="en" class="h-full">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/png" href="/favicon.ico" />
|
<link rel="icon" type="image/png" href="./public/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Jazz | React + Demo Auth + Tailwind</title>
|
<title>Jazz | React + Demo Auth + Tailwind</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "filestream",
|
"name": "filestream",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.10",
|
"version": "0.0.31",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
"is-ci": "^3.0.1",
|
"is-ci": "^3.0.1",
|
||||||
"postcss": "^8.5.3",
|
"postcss": "^8.5.3",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "5.6.2",
|
||||||
"vite": "^6.0.11"
|
"vite": "6.0.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
examples/filestream/public/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -189,7 +189,7 @@ export function FileWidget() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileData = me?.profile?.file?.getChunks();
|
const fileData = me?.profile?.file?.getMetadata();
|
||||||
const mimeType = fileData?.mimeType || "unknown";
|
const mimeType = fileData?.mimeType || "unknown";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export function Logo() {
|
|||||||
fillRule="evenodd"
|
fillRule="evenodd"
|
||||||
clipRule="evenodd"
|
clipRule="evenodd"
|
||||||
d="M136.179 44.8277C136.179 44.8277 136.179 44.8277 136.179 44.8276V21.168C117.931 28.5527 97.9854 32.6192 77.0897 32.6192C65.1466 32.6192 53.5138 31.2908 42.331 28.7737V51.4076C42.331 51.4076 42.331 51.4076 42.331 51.4076V81.1508C41.2955 80.4385 40.1568 79.8458 38.9405 79.3915C36.1732 78.358 33.128 78.0876 30.1902 78.6145C27.2524 79.1414 24.5539 80.4419 22.4358 82.3516C20.3178 84.2613 18.8754 86.6944 18.291 89.3433C17.7066 91.9921 18.0066 94.7377 19.1528 97.2329C20.2991 99.728 22.2403 101.861 24.7308 103.361C27.2214 104.862 30.1495 105.662 33.1448 105.662H33.1455C33.6061 105.662 33.8365 105.662 34.0314 105.659C44.5583 105.449 53.042 96.9656 53.2513 86.4386C53.2534 86.3306 53.2544 86.2116 53.2548 86.0486H53.2552V85.7149L53.2552 85.5521V82.0762L53.2552 53.1993C61.0533 54.2324 69.0092 54.7656 77.0897 54.7656C77.6696 54.7656 78.2489 54.7629 78.8276 54.7574V110.696C77.792 109.983 76.6533 109.391 75.437 108.936C72.6697 107.903 69.6246 107.632 66.6867 108.159C63.7489 108.686 61.0504 109.987 58.9323 111.896C56.8143 113.806 55.3719 116.239 54.7875 118.888C54.2032 121.537 54.5031 124.283 55.6494 126.778C56.7956 129.273 58.7368 131.405 61.2273 132.906C63.7179 134.406 66.646 135.207 69.6414 135.207C70.1024 135.207 70.3329 135.207 70.5279 135.203C81.0548 134.994 89.5385 126.51 89.7478 115.983C89.7517 115.788 89.7517 115.558 89.7517 115.097V111.621L89.7517 54.3266C101.962 53.4768 113.837 51.4075 125.255 48.2397V80.9017C124.219 80.1894 123.081 79.5966 121.864 79.1424C119.097 78.1089 116.052 77.8384 113.114 78.3653C110.176 78.8922 107.478 80.1927 105.36 82.1025C103.242 84.0122 101.799 86.4453 101.215 89.0941C100.631 91.743 100.931 94.4886 102.077 96.9837C103.223 99.4789 105.164 101.612 107.655 103.112C110.145 104.612 113.073 105.413 116.069 105.413C116.53 105.413 116.76 105.413 116.955 105.409C127.482 105.2 135.966 96.7164 136.175 86.1895C136.179 85.9945 136.179 85.764 136.179 85.3029V81.8271L136.179 44.8277Z"
|
d="M136.179 44.8277C136.179 44.8277 136.179 44.8277 136.179 44.8276V21.168C117.931 28.5527 97.9854 32.6192 77.0897 32.6192C65.1466 32.6192 53.5138 31.2908 42.331 28.7737V51.4076C42.331 51.4076 42.331 51.4076 42.331 51.4076V81.1508C41.2955 80.4385 40.1568 79.8458 38.9405 79.3915C36.1732 78.358 33.128 78.0876 30.1902 78.6145C27.2524 79.1414 24.5539 80.4419 22.4358 82.3516C20.3178 84.2613 18.8754 86.6944 18.291 89.3433C17.7066 91.9921 18.0066 94.7377 19.1528 97.2329C20.2991 99.728 22.2403 101.861 24.7308 103.361C27.2214 104.862 30.1495 105.662 33.1448 105.662H33.1455C33.6061 105.662 33.8365 105.662 34.0314 105.659C44.5583 105.449 53.042 96.9656 53.2513 86.4386C53.2534 86.3306 53.2544 86.2116 53.2548 86.0486H53.2552V85.7149L53.2552 85.5521V82.0762L53.2552 53.1993C61.0533 54.2324 69.0092 54.7656 77.0897 54.7656C77.6696 54.7656 78.2489 54.7629 78.8276 54.7574V110.696C77.792 109.983 76.6533 109.391 75.437 108.936C72.6697 107.903 69.6246 107.632 66.6867 108.159C63.7489 108.686 61.0504 109.987 58.9323 111.896C56.8143 113.806 55.3719 116.239 54.7875 118.888C54.2032 121.537 54.5031 124.283 55.6494 126.778C56.7956 129.273 58.7368 131.405 61.2273 132.906C63.7179 134.406 66.646 135.207 69.6414 135.207C70.1024 135.207 70.3329 135.207 70.5279 135.203C81.0548 134.994 89.5385 126.51 89.7478 115.983C89.7517 115.788 89.7517 115.558 89.7517 115.097V111.621L89.7517 54.3266C101.962 53.4768 113.837 51.4075 125.255 48.2397V80.9017C124.219 80.1894 123.081 79.5966 121.864 79.1424C119.097 78.1089 116.052 77.8384 113.114 78.3653C110.176 78.8922 107.478 80.1927 105.36 82.1025C103.242 84.0122 101.799 86.4453 101.215 89.0941C100.631 91.743 100.931 94.4886 102.077 96.9837C103.223 99.4789 105.164 101.612 107.655 103.112C110.145 104.612 113.073 105.413 116.069 105.413C116.53 105.413 116.76 105.413 116.955 105.409C127.482 105.2 135.966 96.7164 136.175 86.1895C136.179 85.9945 136.179 85.764 136.179 85.3029V81.8271L136.179 44.8277Z"
|
||||||
fill="#3313F7"
|
fill="#146AFF"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,157 @@
|
|||||||
# form
|
# form
|
||||||
|
|
||||||
|
## 0.1.32
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-react@0.13.9
|
||||||
|
|
||||||
|
## 0.1.17
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- jazz-react@0.13.7
|
||||||
|
|
||||||
|
## 0.1.16
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- jazz-react@0.13.5
|
||||||
|
|
||||||
|
## 0.1.15
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-react@0.13.4
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
|
||||||
|
## 0.1.14
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- jazz-react@0.13.3
|
||||||
|
|
||||||
|
## 0.1.13
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
|
||||||
## 0.1.12
|
## 0.1.12
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Jazz | Form example</title>
|
<title>Jazz | Form example</title>
|
||||||
|
<link rel="icon" type="image/png" href="./public/favicon.ico">
|
||||||
</head>
|
</head>
|
||||||
<body class="h-full flex flex-col bg-white text-stone-700 dark:text-stone-400 dark:bg-stone-925">
|
<body class="h-full flex flex-col bg-white text-stone-700 dark:text-stone-400 dark:bg-stone-925">
|
||||||
<div id="root" class="align-self-center flex-1"></div>
|
<div id="root" class="align-self-center flex-1"></div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "form",
|
"name": "form",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.12",
|
"version": "0.1.32",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"is-ci": "^3.0.1",
|
"is-ci": "^3.0.1",
|
||||||
"postcss": "^8.4.27",
|
"postcss": "^8.4.27",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "5.6.2",
|
||||||
"vite": "^6.0.11"
|
"vite": "6.0.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
examples/form/public/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -62,7 +62,7 @@ function CreateOrderForm({
|
|||||||
onSave: (draft: DraftBubbleTeaOrder) => void;
|
onSave: (draft: DraftBubbleTeaOrder) => void;
|
||||||
}) {
|
}) {
|
||||||
const draft = useCoState(DraftBubbleTeaOrder, id, {
|
const draft = useCoState(DraftBubbleTeaOrder, id, {
|
||||||
resolve: { addOns: true },
|
resolve: { addOns: true, instructions: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!draft) return;
|
if (!draft) return;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { CoPlainText } from "jazz-tools";
|
||||||
import {
|
import {
|
||||||
BubbleTeaAddOnTypes,
|
BubbleTeaAddOnTypes,
|
||||||
BubbleTeaBaseTeaTypes,
|
BubbleTeaBaseTeaTypes,
|
||||||
@@ -12,6 +13,18 @@ export function OrderForm({
|
|||||||
order: BubbleTeaOrder | DraftBubbleTeaOrder;
|
order: BubbleTeaOrder | DraftBubbleTeaOrder;
|
||||||
onSave?: (e: React.FormEvent<HTMLFormElement>) => void;
|
onSave?: (e: React.FormEvent<HTMLFormElement>) => void;
|
||||||
}) {
|
}) {
|
||||||
|
// Handles updates to the instructions field of the order.
|
||||||
|
// If instructions already exist, applyDiff updates them incrementally.
|
||||||
|
// Otherwise, creates a new CoPlainText instance for the instructions.
|
||||||
|
const handleInstructionsChange = (
|
||||||
|
e: React.ChangeEvent<HTMLTextAreaElement>,
|
||||||
|
) => {
|
||||||
|
if (order.instructions) {
|
||||||
|
return order.instructions.applyDiff(e.target.value);
|
||||||
|
}
|
||||||
|
order.instructions = CoPlainText.create(e.target.value, order._owner);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={onSave} className="grid gap-5">
|
<form onSubmit={onSave} className="grid gap-5">
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
@@ -88,9 +101,9 @@ export function OrderForm({
|
|||||||
<textarea
|
<textarea
|
||||||
name="instructions"
|
name="instructions"
|
||||||
id="instructions"
|
id="instructions"
|
||||||
value={order.instructions}
|
value={`${order.instructions}`}
|
||||||
className="dark:bg-transparent"
|
className="dark:bg-transparent"
|
||||||
onChange={(e) => (order.instructions = e.target.value)}
|
onChange={handleInstructionsChange}
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ export function Orders() {
|
|||||||
<section className="space-y-5">
|
<section className="space-y-5">
|
||||||
<a
|
<a
|
||||||
href={`/#/order`}
|
href={`/#/order`}
|
||||||
className="block relative p-3 bg-white border text-center rounded-md dark:bg-stone-900"
|
className="block relative p-3 bg-white border border-stone-200 text-center rounded-md dark:bg-stone-900 dark:border-stone-900"
|
||||||
>
|
>
|
||||||
<strong>Add new order</strong>
|
<strong>Add new order</strong>
|
||||||
<DraftIndicator />
|
<DraftIndicator />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<h1 className="text-lg pb-2 border-b mb-3">
|
<h1 className="text-lg pb-2 border-b mb-3 border-stone-200 dark:border-stone-700">
|
||||||
<strong>Your orders 🧋</strong>
|
<strong>Your orders 🧋</strong>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,14 @@
|
|||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--border-default: theme("colors.stone.200");
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark {
|
||||||
|
--border-default: theme("colors.stone.900");
|
||||||
|
}
|
||||||
|
|
||||||
@layer components {
|
@layer components {
|
||||||
strong {
|
strong {
|
||||||
@apply font-semibold text-stone-900 dark:text-white;
|
@apply font-semibold text-stone-900 dark:text-white;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Account, CoList, CoMap, co } from "jazz-tools";
|
import { Account, CoList, CoMap, CoPlainText, co } from "jazz-tools";
|
||||||
|
|
||||||
export const BubbleTeaAddOnTypes = [
|
export const BubbleTeaAddOnTypes = [
|
||||||
"Pearl",
|
"Pearl",
|
||||||
@@ -28,7 +28,7 @@ export class BubbleTeaOrder extends CoMap {
|
|||||||
addOns = co.ref(ListOfBubbleTeaAddOns);
|
addOns = co.ref(ListOfBubbleTeaAddOns);
|
||||||
deliveryDate = co.Date;
|
deliveryDate = co.Date;
|
||||||
withMilk = co.boolean;
|
withMilk = co.boolean;
|
||||||
instructions = co.optional.string;
|
instructions = co.optional.ref(CoPlainText);
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DraftBubbleTeaOrder extends CoMap {
|
export class DraftBubbleTeaOrder extends CoMap {
|
||||||
@@ -36,7 +36,7 @@ export class DraftBubbleTeaOrder extends CoMap {
|
|||||||
addOns = co.optional.ref(ListOfBubbleTeaAddOns);
|
addOns = co.optional.ref(ListOfBubbleTeaAddOns);
|
||||||
deliveryDate = co.optional.Date;
|
deliveryDate = co.optional.Date;
|
||||||
withMilk = co.optional.boolean;
|
withMilk = co.optional.boolean;
|
||||||
instructions = co.optional.string;
|
instructions = co.optional.ref(CoPlainText);
|
||||||
|
|
||||||
get hasChanges() {
|
get hasChanges() {
|
||||||
return Object.keys(this._edits).length > 1 || this.addOns?.hasChanges;
|
return Object.keys(this._edits).length > 1 || this.addOns?.hasChanges;
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ const config: Config = {
|
|||||||
colors: {
|
colors: {
|
||||||
stone: stonePaletteWithAlpha,
|
stone: stonePaletteWithAlpha,
|
||||||
},
|
},
|
||||||
|
borderColor: {
|
||||||
|
default: "var(--border-default)",
|
||||||
|
},
|
||||||
container: {
|
container: {
|
||||||
center: true,
|
center: true,
|
||||||
padding: {
|
padding: {
|
||||||
@@ -52,18 +55,6 @@ const config: Config = {
|
|||||||
formsPlugin,
|
formsPlugin,
|
||||||
plugin(({ addBase }) =>
|
plugin(({ addBase }) =>
|
||||||
addBase({
|
addBase({
|
||||||
":root": {
|
|
||||||
"--gcmp-border-color": stonePalette[200],
|
|
||||||
"--gcmp-invert-border-color": stonePalette[900],
|
|
||||||
},
|
|
||||||
"*": {
|
|
||||||
borderColor: "var(--gcmp-border-color)",
|
|
||||||
},
|
|
||||||
"@media (prefers-color-scheme: dark)": {
|
|
||||||
"*": {
|
|
||||||
borderColor: "var(--gcmp-invert-border-color)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"*:focus": {
|
"*:focus": {
|
||||||
outline: "none",
|
outline: "none",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,157 @@
|
|||||||
# image-upload
|
# image-upload
|
||||||
|
|
||||||
|
## 0.0.88
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.25
|
||||||
|
- jazz-tools@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [a6cf01f]
|
||||||
|
- jazz-tools@0.13.9
|
||||||
|
- jazz-react@0.13.9
|
||||||
|
|
||||||
|
## 0.0.73
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- jazz-tools@0.13.7
|
||||||
|
- jazz-react@0.13.7
|
||||||
|
|
||||||
|
## 0.0.72
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [fe6f561]
|
||||||
|
- jazz-tools@0.13.5
|
||||||
|
- jazz-react@0.13.5
|
||||||
|
|
||||||
|
## 0.0.71
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3129982]
|
||||||
|
- jazz-react@0.13.4
|
||||||
|
- jazz-tools@0.13.4
|
||||||
|
|
||||||
|
## 0.0.70
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [12f8bfa]
|
||||||
|
- Updated dependencies [bd57177]
|
||||||
|
- jazz-tools@0.13.3
|
||||||
|
- jazz-react@0.13.3
|
||||||
|
|
||||||
|
## 0.0.69
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.13.2
|
||||||
|
- jazz-tools@0.13.2
|
||||||
|
|
||||||
## 0.0.68
|
## 0.0.68
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Jazz | Image upload example</title>
|
<title>Jazz | Image upload example</title>
|
||||||
|
<link rel="icon" href="./public/favicon.ico" type="image/png">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "image-upload",
|
"name": "image-upload",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.68",
|
"version": "0.0.88",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"@vitejs/plugin-react": "^4.3.3",
|
"@vitejs/plugin-react": "^4.3.3",
|
||||||
"globals": "^15.11.0",
|
"globals": "^15.11.0",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "5.6.2",
|
||||||
"vite": "^6.0.11",
|
"vite": "6.0.11",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"postcss": "^8.4.27",
|
"postcss": "^8.4.27",
|
||||||
"tailwindcss": "^3.4.17"
|
"tailwindcss": "^3.4.17"
|
||||||
|
|||||||
BIN
examples/image-upload/public/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -1,5 +1,203 @@
|
|||||||
# jazz-example-inspector
|
# jazz-example-inspector
|
||||||
|
|
||||||
|
## 0.0.142
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [a846e07]
|
||||||
|
- cojson@0.13.25
|
||||||
|
- cojson-transport-ws@0.13.25
|
||||||
|
- jazz-inspector@0.13.25
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.9
|
||||||
|
|
||||||
|
## 0.0.127
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4530c4a: improve preview of Account types
|
||||||
|
- Updated dependencies [22b5c4f]
|
||||||
|
- Updated dependencies [31ea2ef]
|
||||||
|
- Updated dependencies [4530c4a]
|
||||||
|
- Updated dependencies [bc3d7bb]
|
||||||
|
- Updated dependencies [4e9aae1]
|
||||||
|
- Updated dependencies [21c935c]
|
||||||
|
- Updated dependencies [aa1c80e]
|
||||||
|
- Updated dependencies [13074be]
|
||||||
|
- jazz-inspector@0.13.7
|
||||||
|
- cojson@0.13.7
|
||||||
|
- cojson-transport-ws@0.13.7
|
||||||
|
|
||||||
|
## 0.0.126
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c320615]
|
||||||
|
- jazz-inspector@0.13.6
|
||||||
|
|
||||||
|
## 0.0.125
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [08ae9b2]
|
||||||
|
- Updated dependencies [e090b39]
|
||||||
|
- jazz-inspector@0.13.5
|
||||||
|
- cojson@0.13.5
|
||||||
|
- cojson-transport-ws@0.13.5
|
||||||
|
|
||||||
|
## 0.0.124
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-inspector@0.13.4
|
||||||
|
|
||||||
|
## 0.0.123
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b19cab7]
|
||||||
|
- Updated dependencies [017f6c8]
|
||||||
|
- cojson-transport-ws@0.13.3
|
||||||
|
- jazz-inspector@0.13.3
|
||||||
|
|
||||||
|
## 0.0.122
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ae4be2b]
|
||||||
|
- Updated dependencies [c551839]
|
||||||
|
- jazz-inspector@0.13.2
|
||||||
|
- cojson@0.13.2
|
||||||
|
- cojson-transport-ws@0.13.2
|
||||||
|
|
||||||
## 0.0.121
|
## 0.0.121
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
BIN
examples/inspector/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-inspector-app",
|
"name": "jazz-inspector-app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.121",
|
"version": "0.0.142",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"postcss": "^8.4.27",
|
"postcss": "^8.4.27",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "5.6.2",
|
||||||
"vite": "^6.0.11"
|
"vite": "6.0.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -18,7 +18,7 @@ import {
|
|||||||
PageStack,
|
PageStack,
|
||||||
Select,
|
Select,
|
||||||
} from "jazz-inspector";
|
} from "jazz-inspector";
|
||||||
import { resolveCoValue, useResolvedCoValue } from "jazz-inspector";
|
import { AccountOrGroupText } from "jazz-inspector";
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { usePagePath } from "./use-page-path";
|
import { usePagePath } from "./use-page-path";
|
||||||
|
|
||||||
@@ -239,7 +239,7 @@ function AccountSwitcher({
|
|||||||
{accounts.map((account) => (
|
{accounts.map((account) => (
|
||||||
<option key={account.id} value={account.id}>
|
<option key={account.id} value={account.id}>
|
||||||
{localNode ? (
|
{localNode ? (
|
||||||
<AccountNameDisplay accountId={account.id} node={localNode} />
|
<AccountOrGroupText coId={account.id} showId node={localNode} />
|
||||||
) : (
|
) : (
|
||||||
account.id
|
account.id
|
||||||
)}
|
)}
|
||||||
@@ -311,31 +311,3 @@ function AddAccountForm({
|
|||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AccountNameDisplay({
|
|
||||||
accountId,
|
|
||||||
node,
|
|
||||||
}: {
|
|
||||||
accountId: CoID<RawAccount>;
|
|
||||||
node: LocalNode;
|
|
||||||
}) {
|
|
||||||
const { snapshot } = useResolvedCoValue(accountId, node);
|
|
||||||
const [name, setName] = useState<string | null>(null);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (snapshot && typeof snapshot === "object" && "profile" in snapshot) {
|
|
||||||
const profileId = snapshot.profile as CoID<RawCoValue>;
|
|
||||||
resolveCoValue(profileId, node).then((profileResult) => {
|
|
||||||
if (
|
|
||||||
profileResult.snapshot &&
|
|
||||||
typeof profileResult.snapshot === "object" &&
|
|
||||||
"name" in profileResult.snapshot
|
|
||||||
) {
|
|
||||||
setName(profileResult.snapshot.name as string);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [snapshot, node]);
|
|
||||||
|
|
||||||
return name ? `${name} <${accountId}>` : accountId;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const config: Config = {
|
|||||||
800: "#2A12BE",
|
800: "#2A12BE",
|
||||||
900: "#12046A",
|
900: "#12046A",
|
||||||
950: "#1e1b4b",
|
950: "#1e1b4b",
|
||||||
DEFAULT: "#3313F7",
|
DEFAULT: "#146AFF",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
2
examples/jazz-paper-scissors/.env.example
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VITE_JAZZ_WORKER_ACCOUNT=
|
||||||
|
JAZZ_WORKER_SECRET=
|
||||||
3
examples/jazz-paper-scissors/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
dist
|
||||||
|
|
||||||
|
.env
|
||||||
8
examples/jazz-paper-scissors/.prettierignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Ignore artifacts:
|
||||||
|
build
|
||||||
|
coverage
|
||||||
|
|
||||||
|
**/.git
|
||||||
|
**/.svn
|
||||||
|
**/.hg
|
||||||
|
**/node_modules
|
||||||
24
examples/jazz-paper-scissors/README.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Jazz Paper Scissors
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
First of we need to create a new account for the dealer:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm generate-env
|
||||||
|
```
|
||||||
|
|
||||||
|
This will generate a .env file like this one
|
||||||
|
|
||||||
|
```
|
||||||
|
VITE_JAZZ_WORKER_ACCOUNT=co_zn95yzQd1z24DJCgayN53ShyuMR
|
||||||
|
JAZZ_WORKER_SECRET=sealerSecret_z3Tcq41gtELJRHk3SzQutR2DhkpvEScQQP8DG8yeSh7zJ/signerSecret_zDsLhoNRSxjXrX6oSGzGH3XQQHDyp8QS292p28RToANYq
|
||||||
|
```
|
||||||
|
|
||||||
|
This should be enough the setup everything
|
||||||
|
|
||||||
|
Then run pnpm dev to start both the local build and the worker
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm dev
|
||||||
|
```
|
||||||
21
examples/jazz-paper-scissors/components.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://ui.shadcn.com/schema.json",
|
||||||
|
"style": "new-york",
|
||||||
|
"rsc": false,
|
||||||
|
"tsx": true,
|
||||||
|
"tailwind": {
|
||||||
|
"config": "",
|
||||||
|
"css": "src/index.css",
|
||||||
|
"baseColor": "neutral",
|
||||||
|
"cssVariables": true,
|
||||||
|
"prefix": ""
|
||||||
|
},
|
||||||
|
"aliases": {
|
||||||
|
"components": "@/components",
|
||||||
|
"utils": "@/lib/utils",
|
||||||
|
"ui": "@/components/ui",
|
||||||
|
"lib": "@/lib",
|
||||||
|
"hooks": "@/hooks"
|
||||||
|
},
|
||||||
|
"iconLibrary": "lucide"
|
||||||
|
}
|
||||||
21
examples/jazz-paper-scissors/generate-env.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import * as fs from "fs";
|
||||||
|
import { createWorkerAccount } from "jazz-run/createWorkerAccount";
|
||||||
|
|
||||||
|
if (fs.existsSync(".env")) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
const account = await createWorkerAccount({
|
||||||
|
name: "jazz-paper-scissors-worker",
|
||||||
|
peer: "wss://cloud.jazz.tools/?key=jazz-paper-scissors@garden.co",
|
||||||
|
});
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
".env",
|
||||||
|
`
|
||||||
|
VITE_JAZZ_WORKER_ACCOUNT=${account.accountID}
|
||||||
|
JAZZ_WORKER_SECRET=${account.agentSecret}
|
||||||
|
`,
|
||||||
|
);
|
||||||
|
|
||||||
|
process.exit(0);
|
||||||
20
examples/jazz-paper-scissors/index.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<link rel="icon" href="/favicon.ico" />
|
||||||
|
<meta name="theme-color" content="#000000" />
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Web site created using create-tsrouter-app"
|
||||||
|
/>
|
||||||
|
<link rel="apple-touch-icon" href="/logo192.png" />
|
||||||
|
<link rel="manifest" href="/manifest.json" />
|
||||||
|
<title>Jazz example - Jazz Paper Scissors</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
46
examples/jazz-paper-scissors/package.json
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"name": "jazz-paper-scissors",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "npm-run-all --parallel dev:web dev:worker",
|
||||||
|
"dev:web": "vite",
|
||||||
|
"dev:worker": "tsx --watch --env-file=.env ./src/worker.ts",
|
||||||
|
"build": "vite build && tsc",
|
||||||
|
"serve": "vite preview",
|
||||||
|
"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",
|
||||||
|
"@radix-ui/react-separator": "^1.1.2",
|
||||||
|
"@radix-ui/react-slot": "^1.1.2",
|
||||||
|
"@tailwindcss/vite": "^4.0.17",
|
||||||
|
"@tanstack/react-router": "^1.115.0",
|
||||||
|
"@tanstack/react-router-devtools": "^1.114.29",
|
||||||
|
"@tanstack/router-plugin": "^1.114.30",
|
||||||
|
"class-variance-authority": "^0.7.1",
|
||||||
|
"clsx": "^2.1.1",
|
||||||
|
"jazz-inspector": "workspace:*",
|
||||||
|
"jazz-nodejs": "workspace:*",
|
||||||
|
"jazz-react": "workspace:*",
|
||||||
|
"jazz-tools": "workspace:*",
|
||||||
|
"lucide-react": "^0.485.0",
|
||||||
|
"react": "^18.3.1",
|
||||||
|
"react-dom": "^18.3.1",
|
||||||
|
"tailwind-merge": "^3.0.2",
|
||||||
|
"tailwindcss": "^4.0.17",
|
||||||
|
"tw-animate-css": "^1.2.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/react": "^18.3.12",
|
||||||
|
"@types/react-dom": "^18.3.1",
|
||||||
|
"@vitejs/plugin-react": "^4.3.4",
|
||||||
|
"jazz-run": "workspace:*",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"tsx": "^4.19.3",
|
||||||
|
"typescript": "~5.6.2",
|
||||||
|
"vite": "6.0.11"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
15
examples/jazz-paper-scissors/public/manifest.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"short_name": "TanStack App",
|
||||||
|
"name": "Create TanStack App Sample",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
||||||
3
examples/jazz-paper-scissors/public/robots.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# https://www.robotstxt.org/robotstxt.html
|
||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
1
examples/jazz-paper-scissors/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const apiKey = "jazz-paper-scissors@garden.co";
|
||||||
33
examples/jazz-paper-scissors/src/app.tsx
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { RouterProvider, createRouter } from "@tanstack/react-router";
|
||||||
|
import { useAccount } from "jazz-react";
|
||||||
|
import { routeTree } from "./routeTree.gen";
|
||||||
|
|
||||||
|
// Create a new router instance
|
||||||
|
const router = createRouter({
|
||||||
|
routeTree,
|
||||||
|
context: {
|
||||||
|
// @ts-expect-error - just a placeholder - me is set in the App component down below
|
||||||
|
me: undefined,
|
||||||
|
},
|
||||||
|
defaultPreload: "intent",
|
||||||
|
scrollRestoration: true,
|
||||||
|
defaultStructuralSharing: true,
|
||||||
|
defaultPreloadStaleTime: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Register the router instance for type safety
|
||||||
|
declare module "@tanstack/react-router" {
|
||||||
|
interface Register {
|
||||||
|
router: typeof router;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function App() {
|
||||||
|
const { me } = useAccount();
|
||||||
|
|
||||||
|
if (!me) {
|
||||||
|
return <div>Loading...</div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <RouterProvider router={router} context={{ me }} />;
|
||||||
|
}
|
||||||