Compare commits
1088 Commits
cojson-sto
...
cojson@0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67776c77a0 | ||
|
|
e6868d3030 | ||
|
|
c8ae3a36ca | ||
|
|
bf9c158455 | ||
|
|
1301112a6b | ||
|
|
c447f08029 | ||
|
|
5a63cbae9b | ||
|
|
7d06f1dbf4 | ||
|
|
e48a3e4c27 | ||
|
|
a326ed971c | ||
|
|
b5f1bb35d1 | ||
|
|
b4ed7b0587 | ||
|
|
652ff8f53c | ||
|
|
f519cd7356 | ||
|
|
20babc2e41 | ||
|
|
6fc8efc1b5 | ||
|
|
e30bd2f489 | ||
|
|
0b9cc2e0aa | ||
|
|
610543c5b8 | ||
|
|
53dbfee385 | ||
|
|
9c577b98cd | ||
|
|
6139803679 | ||
|
|
b2c03ca8c4 | ||
|
|
3feb3e82ff | ||
|
|
95e9bdb624 | ||
|
|
68127a95d0 | ||
|
|
690e65ac06 | ||
|
|
6f007a9470 | ||
|
|
23c588c717 | ||
|
|
494d902e79 | ||
|
|
eebee4db6a | ||
|
|
44f38f3438 | ||
|
|
bb2052e1f2 | ||
|
|
40af02acb3 | ||
|
|
950db502c2 | ||
|
|
3bdb753b78 | ||
|
|
33293f3b64 | ||
|
|
d5d448670d | ||
|
|
e3c3913c74 | ||
|
|
2ee2fcaa27 | ||
|
|
edc77c4bd5 | ||
|
|
0ce25f143b | ||
|
|
e35018a5fa | ||
|
|
0d05c927f1 | ||
|
|
4ef43e3477 | ||
|
|
d7ce078f17 | ||
|
|
95349d59f8 | ||
|
|
bb13b6e41d | ||
|
|
3c2da2f0db | ||
|
|
7bac26cf7f | ||
|
|
d3d9200acf | ||
|
|
60558ee664 | ||
|
|
6354135af4 | ||
|
|
69a0befb7b | ||
|
|
c48aa7358a | ||
|
|
01517d1463 | ||
|
|
cdd7e6454f | ||
|
|
2e030ea942 | ||
|
|
5207c00582 | ||
|
|
22fa01b9c5 | ||
|
|
f5a1e42dd6 | ||
|
|
58fe07351e | ||
|
|
25e79fd001 | ||
|
|
53868a4d50 | ||
|
|
21f6f4d933 | ||
|
|
21f691b6da | ||
|
|
45c46ff14a | ||
|
|
6dad0878da | ||
|
|
3b6552d728 | ||
|
|
e83ce5d6c8 | ||
|
|
b6c672a1ad | ||
|
|
e2cfa60caa | ||
|
|
fa8f4e03d2 | ||
|
|
ac3d9fa2c3 | ||
|
|
ff325ebf2a | ||
|
|
71825cb90a | ||
|
|
d1281e560a | ||
|
|
a1dc7f38ed | ||
|
|
581118b918 | ||
|
|
ab378b3d16 | ||
|
|
dd034643da | ||
|
|
bc2e531c05 | ||
|
|
334f6cf2d8 | ||
|
|
31296a6ce2 | ||
|
|
6fc8ae8293 | ||
|
|
a1d6e7147b | ||
|
|
0d111b15f8 | ||
|
|
95b9c4825f | ||
|
|
65e26d9ba4 | ||
|
|
cabce37133 | ||
|
|
20c4484066 | ||
|
|
17dc5fc37f | ||
|
|
05d907b675 | ||
|
|
62cb650356 | ||
|
|
9f833b3931 | ||
|
|
f0d123979c | ||
|
|
90078a4bce | ||
|
|
2d3aa76bf0 | ||
|
|
86bd86b966 | ||
|
|
bebd0ede64 | ||
|
|
14bdd496f7 | ||
|
|
91fcb3f6b6 | ||
|
|
ff94cadd7b | ||
|
|
60fe8f9106 | ||
|
|
5158581b0c | ||
|
|
ee511b4934 | ||
|
|
bc13653236 | ||
|
|
fe28e254a3 | ||
|
|
82179812de | ||
|
|
d42c2aa014 | ||
|
|
ff92316488 | ||
|
|
00f1072f5a | ||
|
|
c2d56b5eb8 | ||
|
|
0d9eacc1ec | ||
|
|
75491e65c0 | ||
|
|
a93df6fcb2 | ||
|
|
b5962b4f81 | ||
|
|
b5be0273a6 | ||
|
|
62a1aec555 | ||
|
|
5053a6fc80 | ||
|
|
f038c2d378 | ||
|
|
febafecfdd | ||
|
|
394feb715d | ||
|
|
76c125e628 | ||
|
|
10ac9d8659 | ||
|
|
9a6d950727 | ||
|
|
326d3b90c2 | ||
|
|
499f39340b | ||
|
|
54eba823ad | ||
|
|
61e787ec89 | ||
|
|
95d42b1340 | ||
|
|
bf9840ea46 | ||
|
|
74dbbaf4d4 | ||
|
|
c2ae5b6206 | ||
|
|
25de660d27 | ||
|
|
de90f45f41 | ||
|
|
dda79df1c3 | ||
|
|
26ea68999b | ||
|
|
4cfb4af1da | ||
|
|
11eaa99af7 | ||
|
|
93231c27f4 | ||
|
|
e7b9c90eef | ||
|
|
70c9a5db88 | ||
|
|
2e6c2498b5 | ||
|
|
e7fd617ca9 | ||
|
|
bd5b03b18d | ||
|
|
3a7ab9b3a1 | ||
|
|
0cf789622c | ||
|
|
d63f5eec5e | ||
|
|
42bd8b76a1 | ||
|
|
73742656ae | ||
|
|
f71f26d1dc | ||
|
|
95822300d7 | ||
|
|
679fe040cf | ||
|
|
14b6149f50 | ||
|
|
4446738940 | ||
|
|
c8ad016d9c | ||
|
|
498954fd09 | ||
|
|
198f6d3627 | ||
|
|
f701f2a4f4 | ||
|
|
94131ba6d6 | ||
|
|
c0e892313f | ||
|
|
b426342c02 | ||
|
|
bbbd773c3f | ||
|
|
7d5f4e5881 | ||
|
|
29c44538dc | ||
|
|
198f995b21 | ||
|
|
2d639667a3 | ||
|
|
1be017d69d | ||
|
|
03df4fee8e | ||
|
|
c658ed3404 | ||
|
|
99e58e60dc | ||
|
|
a9ad0284e9 | ||
|
|
6e2d791c4b | ||
|
|
f9be857bbb | ||
|
|
1288ac140e | ||
|
|
7f07f7e049 | ||
|
|
b22589bbad | ||
|
|
be144adeee | ||
|
|
513619b04e | ||
|
|
81f6a75aac | ||
|
|
913d03de75 | ||
|
|
2d0172d839 | ||
|
|
27d46641e3 | ||
|
|
1014816d79 | ||
|
|
441194acb7 | ||
|
|
c9bea7200f | ||
|
|
9eaa88bd83 | ||
|
|
6ada48d57a | ||
|
|
8fa978df21 | ||
|
|
df7356fd24 | ||
|
|
153fa4ce44 | ||
|
|
6105bd2c88 | ||
|
|
c06d63eec1 | ||
|
|
4ee7359370 | ||
|
|
7b5c47b377 | ||
|
|
7ad57e88f3 | ||
|
|
c181e55557 | ||
|
|
5574be699b | ||
|
|
b3142cb8ed | ||
|
|
cb08d9d1a3 | ||
|
|
7e0cd721e6 | ||
|
|
4d01cbae03 | ||
|
|
13f6389559 | ||
|
|
f6ea9bcc50 | ||
|
|
f6f2766eac | ||
|
|
f8f63bface | ||
|
|
5ec561fec4 | ||
|
|
277787cbd2 | ||
|
|
dda4336721 | ||
|
|
59ddff40ab | ||
|
|
064d19b48c | ||
|
|
3ea269f4d8 | ||
|
|
c4b8befe27 | ||
|
|
06f667ef2a | ||
|
|
bac3cc7bf8 | ||
|
|
6ad0a9f886 | ||
|
|
9b12932b66 | ||
|
|
82bb0d51d9 | ||
|
|
39dede92e8 | ||
|
|
84f4e6e48d | ||
|
|
e629dea585 | ||
|
|
2faf22ffff | ||
|
|
2273505a13 | ||
|
|
19eb29d831 | ||
|
|
738c4c2bd7 | ||
|
|
64e2273475 | ||
|
|
5a85c89154 | ||
|
|
8898b10e89 | ||
|
|
dc2d4e25f7 | ||
|
|
9275c4f6c0 | ||
|
|
cb75cc62b2 | ||
|
|
b141f6a62f | ||
|
|
4a251a528c | ||
|
|
ac3c2df474 | ||
|
|
681f973d4b | ||
|
|
338be7622f | ||
|
|
1227047b03 | ||
|
|
9afde8d0be | ||
|
|
c2ca1feba0 | ||
|
|
f8b6119996 | ||
|
|
98c265304a | ||
|
|
675e3e8046 | ||
|
|
4acba8c990 | ||
|
|
a93adeb1fe | ||
|
|
a7c90f749e | ||
|
|
cf8773f3de | ||
|
|
3be94ae1e7 | ||
|
|
6a8aa06d18 | ||
|
|
dc17889209 | ||
|
|
4dab70eea3 | ||
|
|
55f9d8e120 | ||
|
|
15b9457ed8 | ||
|
|
898297e95c | ||
|
|
0fc4f24cd5 | ||
|
|
63b5ad9edf | ||
|
|
873c3264ca | ||
|
|
34f89e48aa | ||
|
|
b01cc1fe9d | ||
|
|
3a6e34589f | ||
|
|
68e9c85d8f | ||
|
|
1b124ff5c7 | ||
|
|
a1d512d9d7 | ||
|
|
51bf6b7fdc | ||
|
|
b5826fc0a5 | ||
|
|
becdd2f451 | ||
|
|
3b20bf354f | ||
|
|
ab2645765d | ||
|
|
2dec852ce2 | ||
|
|
8cb09379f4 | ||
|
|
fff7fe934b | ||
|
|
9fb2e61e01 | ||
|
|
24b3b6afc1 | ||
|
|
c2eed7e2c4 | ||
|
|
f97ef696e3 | ||
|
|
ad65cb8ab5 | ||
|
|
8d8131410a | ||
|
|
7491711b72 | ||
|
|
5933aa59c1 | ||
|
|
da96bec465 | ||
|
|
483422c0e9 | ||
|
|
3df93cc147 | ||
|
|
d686edfa6c | ||
|
|
497b0ade1f | ||
|
|
794927cac3 | ||
|
|
4c8d128eee | ||
|
|
86acbcd0d6 | ||
|
|
9111c85445 | ||
|
|
1d87879787 | ||
|
|
7c777f2bdf | ||
|
|
aa8067b8d0 | ||
|
|
bd66cdeb78 | ||
|
|
8d29e50669 | ||
|
|
5a7398d242 | ||
|
|
74b984fbe6 | ||
|
|
f8e00204b4 | ||
|
|
76543df765 | ||
|
|
15d4b2a5f7 | ||
|
|
2e67f91fe0 | ||
|
|
df106ca680 | ||
|
|
c58f93b597 | ||
|
|
3f2a0ead1b | ||
|
|
c9e6d2998e | ||
|
|
0eb21a3471 | ||
|
|
99e88d3497 | ||
|
|
f09ce70d3c | ||
|
|
7d62e2735f | ||
|
|
40634c6ec1 | ||
|
|
5863badbb0 | ||
|
|
8bc758ce95 | ||
|
|
56d26222e7 | ||
|
|
bd34084104 | ||
|
|
f5e6fe927d | ||
|
|
93c49639c2 | ||
|
|
aabe7bef34 | ||
|
|
909165d813 | ||
|
|
6bee742b65 | ||
|
|
23486d01b9 | ||
|
|
b761d5a730 | ||
|
|
9181e74fc8 | ||
|
|
5e83864f41 | ||
|
|
73079ca1b7 | ||
|
|
789cf66de2 | ||
|
|
c36f19a97f | ||
|
|
109338923a | ||
|
|
f4c2501b06 | ||
|
|
9161229474 | ||
|
|
265f2f40bf | ||
|
|
d2935ac2ae | ||
|
|
aaf00b8a20 | ||
|
|
f9c6a49d2a | ||
|
|
2f54a48a3d | ||
|
|
be4dd0a787 | ||
|
|
f3f072e7cf | ||
|
|
a6270bf552 | ||
|
|
de5f2d6d5b | ||
|
|
4aa377dea7 | ||
|
|
efbf3d84ac | ||
|
|
b90393b43e | ||
|
|
31ae73fe0e | ||
|
|
7a5adfc4dc | ||
|
|
850e264912 | ||
|
|
aa81779ad8 | ||
|
|
72c97c0835 | ||
|
|
12809a6733 | ||
|
|
c55aeff98e | ||
|
|
16b76e401c | ||
|
|
d2470efd6f | ||
|
|
1a97b1b77c | ||
|
|
adde5b78f3 | ||
|
|
06fd3a3686 | ||
|
|
d231b6ae2a | ||
|
|
f76274c19a | ||
|
|
e471fc5d23 | ||
|
|
cb1b602255 | ||
|
|
a728dbf632 | ||
|
|
84d06d180a | ||
|
|
342e4d9f5e | ||
|
|
8eb92471ae | ||
|
|
0cfc32f591 | ||
|
|
e8b1e07625 | ||
|
|
f97946bd21 | ||
|
|
f7f461db31 | ||
|
|
653d09c337 | ||
|
|
3fa5ac30ff | ||
|
|
4095041da9 | ||
|
|
c1c2f39cb5 | ||
|
|
e5b93871f7 | ||
|
|
896aeb571d | ||
|
|
f7f1a0aff0 | ||
|
|
3bc82dc382 | ||
|
|
99bac77ae7 | ||
|
|
5705ebdcad | ||
|
|
f3fb445c9e | ||
|
|
c60fe8aae2 | ||
|
|
d2a882e531 | ||
|
|
036fa1f43b | ||
|
|
839b4af45c | ||
|
|
3a9797ce75 | ||
|
|
b2f14c0339 | ||
|
|
5d9405ccc3 | ||
|
|
d54db4358c | ||
|
|
a172f61494 | ||
|
|
225280d37a | ||
|
|
c735ab6b95 | ||
|
|
d47e59783f | ||
|
|
8a390d255d | ||
|
|
03540b22c1 | ||
|
|
fad96fe4f4 | ||
|
|
19b706d125 | ||
|
|
c871912188 | ||
|
|
7124bd05c8 | ||
|
|
783f444cff | ||
|
|
0f57687d81 | ||
|
|
235bf1f4e4 | ||
|
|
2d7b4b6c82 | ||
|
|
68369c16da | ||
|
|
90f36db63a | ||
|
|
f002110c28 | ||
|
|
83513b624e | ||
|
|
6042250940 | ||
|
|
f78c234780 | ||
|
|
21efae9276 | ||
|
|
1e58606ae7 | ||
|
|
4a11682316 | ||
|
|
3e92680b08 | ||
|
|
2be47d688b | ||
|
|
2ddccdbca5 | ||
|
|
ab05897cd6 | ||
|
|
7cd691f5f0 | ||
|
|
24a13af657 | ||
|
|
b13530e84b | ||
|
|
3911b72f87 | ||
|
|
ec278cfcd8 | ||
|
|
912730378e | ||
|
|
ac35f19f01 | ||
|
|
c25a1af96e | ||
|
|
70667d06a1 | ||
|
|
31fd994d83 | ||
|
|
fc934157f6 | ||
|
|
0bbded1772 | ||
|
|
a6eea34c74 | ||
|
|
3605b746a9 | ||
|
|
4b29a9aaa6 | ||
|
|
e60a9f4a74 | ||
|
|
d1d773bc9c | ||
|
|
55e8a269c0 | ||
|
|
0db0aadd45 | ||
|
|
83f3873e03 | ||
|
|
80fd3e9697 | ||
|
|
bae8268b29 | ||
|
|
466c5f695a | ||
|
|
b6a70228ea | ||
|
|
ac32c432da | ||
|
|
066ac6bf98 | ||
|
|
ccfa7d9943 | ||
|
|
90c76a01a6 | ||
|
|
807b52cccf | ||
|
|
fb7c6c6bbf | ||
|
|
12e619b990 | ||
|
|
aba2f8110c | ||
|
|
862e3fc7ed | ||
|
|
51fc92759a | ||
|
|
c8fac3381d | ||
|
|
9723090f91 | ||
|
|
4783e08c69 | ||
|
|
34959ff0ec | ||
|
|
bec9be84d5 | ||
|
|
277ee9d7e4 | ||
|
|
314518a87f | ||
|
|
c280fa11c3 | ||
|
|
929f5785a8 | ||
|
|
9ae92c19ab | ||
|
|
599bb7355e | ||
|
|
ad76a2f44f | ||
|
|
3a3ad44f13 | ||
|
|
db01bfb0a8 | ||
|
|
3e9b7e829c | ||
|
|
530720f2b9 | ||
|
|
a5d6d364db | ||
|
|
cb7e580942 | ||
|
|
8653fc7eb1 | ||
|
|
d077702250 | ||
|
|
472b15d940 | ||
|
|
f71176b362 | ||
|
|
aa5f988776 | ||
|
|
328311e781 | ||
|
|
f2875de83d | ||
|
|
2108f918b4 | ||
|
|
32441bdcd6 | ||
|
|
b80b9c08db | ||
|
|
4f09c94098 | ||
|
|
5e47f2fb52 | ||
|
|
47f2f62b4f | ||
|
|
61642b2536 | ||
|
|
20d12c5aa1 | ||
|
|
dd9ac6e4f8 | ||
|
|
1b7196938f | ||
|
|
5d9818914c | ||
|
|
f33ec81f19 | ||
|
|
a9dbcc29d0 | ||
|
|
f30f92d1b6 | ||
|
|
33d250d0e1 | ||
|
|
f025ffa7b1 | ||
|
|
6467bb89b3 | ||
|
|
7fc9195068 | ||
|
|
2e7e276abf | ||
|
|
cc249d3e8b | ||
|
|
2db8b35cf7 | ||
|
|
f098002da5 | ||
|
|
0b47d279c0 | ||
|
|
a3234f3912 | ||
|
|
2a6f2bbb4b | ||
|
|
fcdad5d80d | ||
|
|
dfa15c1e0f | ||
|
|
bead3462e7 | ||
|
|
246f91937c | ||
|
|
468de3d3af | ||
|
|
ee292b8855 | ||
|
|
38a6361aed | ||
|
|
0231650b6b | ||
|
|
35e4af88d0 | ||
|
|
a44a1496ca | ||
|
|
7ebc77c95f | ||
|
|
de20b17989 | ||
|
|
cae4b244e8 | ||
|
|
eed5aec08d | ||
|
|
90fa0e0588 | ||
|
|
9b1361a009 | ||
|
|
ad8b962255 | ||
|
|
2269bd4d8f | ||
|
|
ce977cdb46 | ||
|
|
8065c8515c | ||
|
|
4e292e0253 | ||
|
|
b3bd55f969 | ||
|
|
dd91354eb4 | ||
|
|
27c294166b | ||
|
|
c8e783fa33 | ||
|
|
90325c18eb | ||
|
|
b5ae832fe7 | ||
|
|
03897e0a5f | ||
|
|
0cdf004902 | ||
|
|
9dd8d9510b | ||
|
|
f56663c4cf | ||
|
|
6de44dd8d1 | ||
|
|
e8dc5eb07c | ||
|
|
5669e346f8 | ||
|
|
41e88b82b7 | ||
|
|
97e7c7ce13 | ||
|
|
7fea37b0a3 | ||
|
|
b97a0954b2 | ||
|
|
afe73c05fe | ||
|
|
459eafccd0 | ||
|
|
816333a4a8 | ||
|
|
b6345ac469 | ||
|
|
9f01d9c73a | ||
|
|
1da4d558b1 | ||
|
|
559e3360a4 | ||
|
|
be922788f6 | ||
|
|
09d32ee5f2 | ||
|
|
0547ea823d | ||
|
|
a7aa70bd8f | ||
|
|
ee9f868bb4 | ||
|
|
133abd5d8f | ||
|
|
1a789717f0 | ||
|
|
d4d98c4b48 | ||
|
|
f4fc60707f | ||
|
|
8527c3fef9 | ||
|
|
c279174465 | ||
|
|
49fa18825b | ||
|
|
32d7dca15b | ||
|
|
8ba2d47e48 | ||
|
|
290ea0f234 | ||
|
|
c4d5cad2d4 | ||
|
|
718543cf83 | ||
|
|
ca8f21358e | ||
|
|
d56fc0874c | ||
|
|
d09584fa88 | ||
|
|
ade4890ede | ||
|
|
b734c66a90 | ||
|
|
bc979ba26e | ||
|
|
906acaf417 | ||
|
|
432724f63e | ||
|
|
51d8fb7e77 | ||
|
|
1e5e3a1599 | ||
|
|
37699c1831 | ||
|
|
6c6da24281 | ||
|
|
2d85476433 | ||
|
|
cdc8a6b568 | ||
|
|
1b539483d1 | ||
|
|
25eab61cd0 | ||
|
|
43a782937f | ||
|
|
de1a3ee84a | ||
|
|
315a00bcb5 | ||
|
|
ed4ee686b5 | ||
|
|
b4dc466526 | ||
|
|
af9ea3dc4b | ||
|
|
67abc0e437 | ||
|
|
b12eb407cb | ||
|
|
2034ef2dcb | ||
|
|
343b4c0c80 | ||
|
|
41e4083f97 | ||
|
|
15f81e889f | ||
|
|
8d7fb18a08 | ||
|
|
43378ef2b7 | ||
|
|
1ca1d15639 | ||
|
|
bdd67ef34d | ||
|
|
dc62b9569b | ||
|
|
6fd920face | ||
|
|
0689ed3767 | ||
|
|
a4e1aa7f56 | ||
|
|
ca5d7cb2ee | ||
|
|
25dfd90c5a | ||
|
|
90096d65e9 | ||
|
|
0e7f1aa44a | ||
|
|
66badc061e | ||
|
|
eecdd5215e | ||
|
|
99b9605579 | ||
|
|
830f0c00ca | ||
|
|
635e824eb0 | ||
|
|
c2a55c09e0 | ||
|
|
33b64743ed | ||
|
|
74a419e2df | ||
|
|
170e135c79 | ||
|
|
305917236e | ||
|
|
68932ee4ce | ||
|
|
71e881afcb | ||
|
|
f32af158f0 | ||
|
|
cf22cfcc88 | ||
|
|
c5b5eacba5 | ||
|
|
380bcb2d14 | ||
|
|
956a4d1b5e | ||
|
|
b7fb4b4b0b | ||
|
|
4433745cff | ||
|
|
8eda79227b | ||
|
|
1a3ec55e6e | ||
|
|
e0d9bb3db3 | ||
|
|
93f73b3b86 | ||
|
|
7e96af0602 | ||
|
|
3a5d8d1ff4 | ||
|
|
d558c085e6 | ||
|
|
07e52f50b3 | ||
|
|
9a775c67d5 | ||
|
|
a64d05f9a5 | ||
|
|
e43a6d4418 | ||
|
|
70182c5b28 | ||
|
|
1de26f8be9 | ||
|
|
af6c0878c3 | ||
|
|
579384a6df | ||
|
|
3376a02fde | ||
|
|
8440699193 | ||
|
|
d7f4ba5b9e | ||
|
|
58a785db40 | ||
|
|
7546e8bffc | ||
|
|
ad57ac21e0 | ||
|
|
f8b9854286 | ||
|
|
10ea7332e6 | ||
|
|
0a859821bc | ||
|
|
b9408c6119 | ||
|
|
c6c26b0ad1 | ||
|
|
9527c8a019 | ||
|
|
69bdcc0273 | ||
|
|
62cfd3bce4 | ||
|
|
edf6328905 | ||
|
|
1d2b8d92d7 | ||
|
|
697dd370ee | ||
|
|
33ef9c43d0 | ||
|
|
f74134164b | ||
|
|
50939729e5 | ||
|
|
dcf945b514 | ||
|
|
0b8425d9b4 | ||
|
|
986805dcba | ||
|
|
89dae1d889 | ||
|
|
c3418f6bed | ||
|
|
f5a63d13c1 | ||
|
|
e9778cc4ca | ||
|
|
7d955d053e | ||
|
|
ae6d2c6daf | ||
|
|
44aa86978f | ||
|
|
eedb208e4c | ||
|
|
454fbbfc17 | ||
|
|
686e3e998c | ||
|
|
7a2f249614 | ||
|
|
59a0c86dd1 | ||
|
|
7701307ab7 | ||
|
|
1e7dadd31b | ||
|
|
b57bb88328 | ||
|
|
afd25d766f | ||
|
|
222f8c5063 | ||
|
|
857e0d5c48 | ||
|
|
be903ede57 | ||
|
|
9b654ad1fb | ||
|
|
a7bc15fdf2 | ||
|
|
0489d4a894 | ||
|
|
1ef3226ed8 | ||
|
|
e14a2c0a5d | ||
|
|
6a7ef2ba60 | ||
|
|
94d95ceeb6 | ||
|
|
ab4ffbd130 | ||
|
|
e322e6034b | ||
|
|
bbf49ae7cd | ||
|
|
04bcf94ae4 | ||
|
|
22ad297e4b | ||
|
|
2ee58780a5 | ||
|
|
fca6a0bfc2 | ||
|
|
6f0bd7f5ea | ||
|
|
4dea285879 | ||
|
|
0c68349a27 | ||
|
|
e761a8e5d5 | ||
|
|
45c1e113ea | ||
|
|
88d7d9add0 | ||
|
|
36d3be25a1 | ||
|
|
99e731d6f8 | ||
|
|
0027bc73b5 | ||
|
|
2304412c20 | ||
|
|
b697b91f1d | ||
|
|
6694dbc53f | ||
|
|
af9eb02d46 | ||
|
|
4e8c70f8d9 | ||
|
|
fa41f8eec2 | ||
|
|
60e35eab71 | ||
|
|
80f563e4f0 | ||
|
|
c321d99ec6 | ||
|
|
135fa2d164 | ||
|
|
5d20c81ed5 | ||
|
|
8ee6db5102 | ||
|
|
a8e7f52700 | ||
|
|
1e6f6fce53 | ||
|
|
025dfaedc4 | ||
|
|
d681aa242a | ||
|
|
a4f0a0737e | ||
|
|
4583401502 | ||
|
|
99a614038d | ||
|
|
762d1fac23 | ||
|
|
9d7fabb1cf | ||
|
|
7c9a872f50 | ||
|
|
9ed8dd509b | ||
|
|
0d771b9acc | ||
|
|
3e191685e4 | ||
|
|
7b2fd31a75 | ||
|
|
dda7c243d7 | ||
|
|
cce6a2f243 | ||
|
|
63001da65a | ||
|
|
b094605109 | ||
|
|
e4bc39ed21 | ||
|
|
67d4f538ec | ||
|
|
f5b527886f | ||
|
|
dba767ae7b | ||
|
|
bb39c0b7fa | ||
|
|
57c846a904 | ||
|
|
4390d4b266 | ||
|
|
1427f071d4 | ||
|
|
2d31e8edce | ||
|
|
09cad40565 | ||
|
|
3accbc06e2 | ||
|
|
39ae4fc8c1 | ||
|
|
ae60eb0d01 | ||
|
|
05eb330173 | ||
|
|
5d1e192245 | ||
|
|
c5e059b3a9 | ||
|
|
d1785c0178 | ||
|
|
9b95c32edb | ||
|
|
d87781d33f | ||
|
|
ad50ec2d9d | ||
|
|
fef055b9fb | ||
|
|
cdc7f9f841 | ||
|
|
ff6940de56 | ||
|
|
cad54e4018 | ||
|
|
c657880a22 | ||
|
|
79b02dee3c | ||
|
|
ee29cb300c | ||
|
|
36f0ab7571 | ||
|
|
829be3cafa | ||
|
|
7c322796aa | ||
|
|
36d50d96dd | ||
|
|
1fd26b9d05 | ||
|
|
40f161d4d0 | ||
|
|
655a601a8e | ||
|
|
c7a28e5003 | ||
|
|
ae429d0a1c | ||
|
|
26c390be66 | ||
|
|
a0a0962f28 | ||
|
|
32834ef9e3 | ||
|
|
13be2a3235 | ||
|
|
7fa6e4333d | ||
|
|
093f08b5e0 | ||
|
|
f374545692 | ||
|
|
9a8f2747fe | ||
|
|
84b7c9ab89 | ||
|
|
3863d834ce | ||
|
|
4c860075ee | ||
|
|
79480ddf0c | ||
|
|
8d447b8725 | ||
|
|
238fd47089 | ||
|
|
29ac1fbe88 | ||
|
|
95fd27d3e3 | ||
|
|
533d7684c9 | ||
|
|
798403a57d | ||
|
|
ddf060e64c | ||
|
|
51515f629c | ||
|
|
65e012f401 | ||
|
|
a1ba29fd47 | ||
|
|
b6b76ab2b9 | ||
|
|
77dbd4e205 | ||
|
|
baa8aff33f | ||
|
|
63703489ab | ||
|
|
325250272b | ||
|
|
219ba975a5 | ||
|
|
f5a3394d40 | ||
|
|
4a5209237f | ||
|
|
d7eb50abc1 | ||
|
|
4908d7cfd3 | ||
|
|
38b19ab980 | ||
|
|
9e2486c332 | ||
|
|
e905c84a34 | ||
|
|
b097c38617 | ||
|
|
385dfc89ff | ||
|
|
d89e4c3412 | ||
|
|
bbeee086ce | ||
|
|
718e9418e2 | ||
|
|
507a00fe6a | ||
|
|
8e940130d2 | ||
|
|
ac216b9f2e | ||
|
|
93230df2cb | ||
|
|
c13daa140b | ||
|
|
3c9439d0cc | ||
|
|
d38d4928c7 | ||
|
|
596901cba6 | ||
|
|
2a1fda3758 | ||
|
|
f3581d1086 | ||
|
|
4ac2b75194 | ||
|
|
cfa78ed628 | ||
|
|
94095aff28 | ||
|
|
a70f7a4c49 | ||
|
|
2270ae113e | ||
|
|
92b64e05ca | ||
|
|
cb6b9af57d | ||
|
|
fc00369d87 | ||
|
|
0b260f339d | ||
|
|
8f50dd48f6 | ||
|
|
d3af4fecd1 | ||
|
|
4ec13a9515 | ||
|
|
79262351fa | ||
|
|
01292230e8 | ||
|
|
9b31d3241d | ||
|
|
77dfd4f883 | ||
|
|
9150c238e4 | ||
|
|
67bd5ab07f | ||
|
|
2678c83a99 | ||
|
|
4c1364a5cb | ||
|
|
f546811a23 | ||
|
|
eb9164633c | ||
|
|
db5e5d8392 | ||
|
|
a18d870faa | ||
|
|
d434b23a34 | ||
|
|
dd363d613f | ||
|
|
9d41f7a16a | ||
|
|
dfddc3603a | ||
|
|
5c09f0f41a | ||
|
|
139fcbe172 | ||
|
|
507b3b890a | ||
|
|
06ad39c418 | ||
|
|
7077a41c2d | ||
|
|
9572729cc9 | ||
|
|
9f08ca8cd8 | ||
|
|
8e0bf8a8d8 | ||
|
|
5b72d1f89b | ||
|
|
e10d09e6ab | ||
|
|
2007815745 | ||
|
|
1f826734d4 | ||
|
|
80383dac3b | ||
|
|
b9ed9e3f13 | ||
|
|
96f844af5e | ||
|
|
994fbf3524 | ||
|
|
6eba301599 | ||
|
|
322438f361 | ||
|
|
f2f3481773 | ||
|
|
b96bab59d0 | ||
|
|
aa21072ceb | ||
|
|
01442948d0 | ||
|
|
6c26902a73 | ||
|
|
b12f9dc675 | ||
|
|
bb6d9791dc | ||
|
|
024b24f5fa | ||
|
|
facfc51e84 | ||
|
|
6e4a7411dd | ||
|
|
a02b53cbe3 | ||
|
|
a0548ecb25 | ||
|
|
970414c8c3 | ||
|
|
d62a5c74f9 | ||
|
|
5d35469b91 | ||
|
|
6cd79a0631 | ||
|
|
5122cd027b | ||
|
|
9d9bb97da3 | ||
|
|
9db3f2120b | ||
|
|
cb4ccd5d33 | ||
|
|
3121551e8a | ||
|
|
1a65ffd913 | ||
|
|
80301e51bb | ||
|
|
5686db9b89 | ||
|
|
21a56fc96b | ||
|
|
eb22a24f17 | ||
|
|
4f3de09154 | ||
|
|
f2f865da50 | ||
|
|
c0d12dba26 | ||
|
|
cd0717f35d | ||
|
|
4515395bb9 | ||
|
|
7cee49f2b2 | ||
|
|
9414fbfb23 | ||
|
|
9c6ea58ef5 | ||
|
|
0685436b0c | ||
|
|
daa11aa915 | ||
|
|
bbdb1ef429 | ||
|
|
508537928f | ||
|
|
eaeeedc3a4 | ||
|
|
15cdfd406c | ||
|
|
76262c1a03 | ||
|
|
fc43a2384b | ||
|
|
d1698eed6f | ||
|
|
6d68dc1bbf | ||
|
|
1fb49b266a | ||
|
|
49f0ab1545 | ||
|
|
641bbddd64 | ||
|
|
7e22f53718 | ||
|
|
4c44468129 | ||
|
|
b0c5ecd7b6 | ||
|
|
5bf9d69e9f | ||
|
|
3ecf11ded9 | ||
|
|
709d60b365 | ||
|
|
f135babcb8 | ||
|
|
36a85d4313 | ||
|
|
7316379247 | ||
|
|
0cf59b6549 | ||
|
|
bcaff2f24a | ||
|
|
d2a5087e65 | ||
|
|
8627d47afc | ||
|
|
47f625cbd4 | ||
|
|
34b65ef67a | ||
|
|
51209d5314 | ||
|
|
309dffcc67 | ||
|
|
716b87da0a | ||
|
|
3c58879a10 | ||
|
|
ed16031f12 | ||
|
|
90d9e1ca91 | ||
|
|
95828596f8 | ||
|
|
d794a555dc | ||
|
|
a6c143f33f | ||
|
|
1db615d1b1 | ||
|
|
9b45c44b29 | ||
|
|
ecc7c9672d | ||
|
|
d645970cb0 | ||
|
|
e9864cda9d | ||
|
|
d4e9afc4e2 | ||
|
|
4fc4f029a2 | ||
|
|
fb06319dae | ||
|
|
a4886fede8 | ||
|
|
b2ca4ec52e | ||
|
|
b2c8a1a27d | ||
|
|
5469c1f347 | ||
|
|
d36e7cd55a | ||
|
|
03ccdb93af | ||
|
|
eb8bd20931 | ||
|
|
9819811c91 | ||
|
|
350e59b187 | ||
|
|
c2cad4b68c | ||
|
|
0c6b0f37ed | ||
|
|
a3541f24ee | ||
|
|
f8be4e8bc0 | ||
|
|
c8015ddee1 | ||
|
|
44227bd6e8 | ||
|
|
d582429488 | ||
|
|
3db0639636 | ||
|
|
c75cd9da37 | ||
|
|
da13ecac5c | ||
|
|
c4af72e1ca | ||
|
|
e43ca2bc98 | ||
|
|
bcdd8e9125 | ||
|
|
2d6352a2dc | ||
|
|
749350cb59 | ||
|
|
07e9a73c52 | ||
|
|
1ef9998b23 | ||
|
|
b00ee914c3 | ||
|
|
f488c09545 | ||
|
|
0d6ea25e56 | ||
|
|
9ffe6d0c63 | ||
|
|
249eecb68f | ||
|
|
cdbde2970d | ||
|
|
24a1b045d3 | ||
|
|
a21c3068cd | ||
|
|
55ab4844d6 | ||
|
|
6e131eb0dc | ||
|
|
8a0cb69c72 | ||
|
|
d01286b723 | ||
|
|
0b636d26f3 | ||
|
|
f41a1b0d1d | ||
|
|
28930ee1d5 | ||
|
|
0a8753dfe0 | ||
|
|
3ca8b13f6c | ||
|
|
e06c18150a | ||
|
|
4c4499ce86 | ||
|
|
afa4c825ca | ||
|
|
60e04cb193 | ||
|
|
843a012f33 | ||
|
|
bd510a13ce | ||
|
|
0d6853bbdd | ||
|
|
a238dde78a | ||
|
|
59997fbf71 | ||
|
|
b56d7e3e7c | ||
|
|
2f5bd74206 | ||
|
|
a4864d93d2 | ||
|
|
19376e6abd | ||
|
|
22f6db8141 | ||
|
|
3d9f12e9ea | ||
|
|
68620a3df9 | ||
|
|
1767f024d9 | ||
|
|
c55924a04a | ||
|
|
31e00a96ae | ||
|
|
7bb834f399 | ||
|
|
667f36e1cf | ||
|
|
07669923ad | ||
|
|
9082a099ee | ||
|
|
aba059db28 | ||
|
|
ae6b9c8dd2 | ||
|
|
7b9f96bf1a | ||
|
|
8df49546fe | ||
|
|
bb4460f422 | ||
|
|
2099099afc | ||
|
|
06b0758d7c | ||
|
|
6135250e57 | ||
|
|
aacd03bbdd | ||
|
|
ca7f250d47 | ||
|
|
83ad506b94 | ||
|
|
e9751f5b69 | ||
|
|
c84764acd5 | ||
|
|
c2a805bffa | ||
|
|
8728dde42b | ||
|
|
9dd9366734 | ||
|
|
48dd00f453 | ||
|
|
cc361aefe5 | ||
|
|
9e4438cb54 | ||
|
|
08706d557a | ||
|
|
02c1ec63cc | ||
|
|
df797dedcd | ||
|
|
74cb08e7d4 | ||
|
|
73720a8cc4 | ||
|
|
50c77fa788 | ||
|
|
9977a4ee85 | ||
|
|
441fe27802 | ||
|
|
1afbd2c7cc | ||
|
|
4955e39af5 | ||
|
|
ace151696c | ||
|
|
db9560ebc5 | ||
|
|
80b572710e | ||
|
|
bbb9d45969 | ||
|
|
83e9a3eaa8 | ||
|
|
9ff7e68f7d | ||
|
|
06740e840a | ||
|
|
b0e2c4fd4b | ||
|
|
4c1922c10e | ||
|
|
76bad9b5c3 | ||
|
|
7f16f2705e | ||
|
|
d12594e521 | ||
|
|
cf96350b01 | ||
|
|
947030433f | ||
|
|
b4cebd732e | ||
|
|
d0d95e6d5d | ||
|
|
a75383ac6a | ||
|
|
de503b6120 | ||
|
|
f7ae41254f | ||
|
|
8f348b28c6 | ||
|
|
3b185b4cd3 | ||
|
|
df5dc513bf | ||
|
|
8e6783ad88 | ||
|
|
79bf6f478f | ||
|
|
7fd93a5a61 | ||
|
|
8f9687323f | ||
|
|
47ee25786f | ||
|
|
0009aa19b2 | ||
|
|
741b9cbada | ||
|
|
259ade3099 | ||
|
|
b6f2da2221 | ||
|
|
44157945a0 | ||
|
|
4ff7bb500a | ||
|
|
db5ea54338 | ||
|
|
7c7880a9b2 | ||
|
|
49082a5aad | ||
|
|
ab7c899a9e | ||
|
|
b6653555f5 | ||
|
|
c9fd16ce21 | ||
|
|
e60f34d9e6 | ||
|
|
a04c7dca7a | ||
|
|
e067c29d81 | ||
|
|
81c470e9fa | ||
|
|
52d5a14fdf | ||
|
|
1357306d1b | ||
|
|
fca6be8da0 | ||
|
|
3c6d9b20c1 | ||
|
|
e386f2ba8d | ||
|
|
c2d292effc | ||
|
|
f597316267 | ||
|
|
17f8bc25c3 | ||
|
|
c1d652cf7f | ||
|
|
10f3e4aabd | ||
|
|
63f5574003 | ||
|
|
9bb5c4ca5f | ||
|
|
a107e17c44 | ||
|
|
d2d2801537 | ||
|
|
d5af8df158 |
@@ -6,18 +6,23 @@
|
|||||||
"linked": [
|
"linked": [
|
||||||
[
|
[
|
||||||
"cojson",
|
"cojson",
|
||||||
"jazz-tools",
|
"cojson-storage",
|
||||||
"jazz-browser",
|
|
||||||
"jazz-browser-media-images",
|
|
||||||
"jazz-browser-auth-clerk",
|
|
||||||
"jazz-react-auth-clerk",
|
|
||||||
"jazz-react",
|
|
||||||
"jazz-react-native",
|
|
||||||
"jazz-nodejs",
|
|
||||||
"jazz-run",
|
|
||||||
"cojson-transport-ws",
|
|
||||||
"cojson-storage-indexeddb",
|
"cojson-storage-indexeddb",
|
||||||
"cojson-storage-sqlite"
|
"cojson-storage-sqlite",
|
||||||
|
"cojson-transport-ws",
|
||||||
|
"jazz-browser",
|
||||||
|
"jazz-auth-clerk",
|
||||||
|
"jazz-browser-media-images",
|
||||||
|
"jazz-nodejs",
|
||||||
|
"jazz-react",
|
||||||
|
"jazz-react-auth-clerk",
|
||||||
|
"jazz-react-native",
|
||||||
|
"jazz-react-native-auth-clerk",
|
||||||
|
"jazz-react-native-media-images",
|
||||||
|
"jazz-run",
|
||||||
|
"jazz-svelte",
|
||||||
|
"jazz-tools",
|
||||||
|
"jazz-vue"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"access": "public",
|
"access": "public",
|
||||||
|
|||||||
36
.github/actions/source-code/action.yml
vendored
Normal file
36
.github/actions/source-code/action.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Get and Build Source Code
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Enable latestcorepack
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||||
|
npm install -g corepack@latest
|
||||||
|
echo "After : corepack version => $(corepack --version)"
|
||||||
|
corepack enable
|
||||||
|
pnpm --version
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: useblacksmith/setup-node@v5
|
||||||
|
with:
|
||||||
|
node-version-file: '.node-version'
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Get pnpm store directory
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- uses: useblacksmith/cache@v5
|
||||||
|
name: Setup pnpm cache
|
||||||
|
with:
|
||||||
|
path: ${{ env.STORE_PATH }}
|
||||||
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pnpm-store-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
shell: bash
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
33
.github/workflows/build-examples.yaml
vendored
33
.github/workflows/build-examples.yaml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-examples:
|
build-examples:
|
||||||
runs-on: ubuntu-latest
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
example: [
|
example: [
|
||||||
@@ -23,36 +23,13 @@ jobs:
|
|||||||
]
|
]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Enable corepack
|
- name: Setup Source Code
|
||||||
run: corepack enable
|
uses: ./.github/actions/source-code/
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version-file: '.node-version'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ env.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
|
|
||||||
- name: Pnpm Build
|
- name: Pnpm Build
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
26
.github/workflows/build-starters.yaml
vendored
Normal file
26
.github/workflows/build-starters.yaml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Build Starters
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-starters:
|
||||||
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
starter: ["react-demo-auth-tailwind"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Setup Source Code
|
||||||
|
uses: ./.github/actions/source-code/
|
||||||
|
|
||||||
|
- name: Pnpm Build
|
||||||
|
run: |
|
||||||
|
pnpm install
|
||||||
|
pnpm turbo build;
|
||||||
|
working-directory: ./starters/${{ matrix.starter }}
|
||||||
2
.github/workflows/code-quality.yml
vendored
2
.github/workflows/code-quality.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
quality:
|
quality:
|
||||||
runs-on: ubuntu-latest
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
91
.github/workflows/e2e-rn-test.yml
vendored
Normal file
91
.github/workflows/e2e-rn-test.yml
vendored
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
name: End-to-End Tests for React Native
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
paths:
|
||||||
|
- ".github/workflows/e2e-rn-test.yml"
|
||||||
|
- "examples/chat-rn/**"
|
||||||
|
- "examples/chat-rn-clerk/**"
|
||||||
|
- "packages/jazz-react-native*/**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
e2e-tests:
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Source Code
|
||||||
|
uses: ./.github/actions/source-code/
|
||||||
|
|
||||||
|
- name: Create Output Directory
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/output
|
||||||
|
|
||||||
|
- name: Pnpm Build
|
||||||
|
run: pnpm turbo build --filter="./packages/*"
|
||||||
|
|
||||||
|
- name: iOS Simulator
|
||||||
|
id: ios-simulator
|
||||||
|
uses: futureware-tech/simulator-action@v4
|
||||||
|
with:
|
||||||
|
os: iOS
|
||||||
|
wait_for_boot: true
|
||||||
|
|
||||||
|
- name: chat-rn App Pre Build
|
||||||
|
working-directory: ./examples/chat-rn
|
||||||
|
run: |
|
||||||
|
pnpm build
|
||||||
|
pnpm expo prebuild --clean
|
||||||
|
|
||||||
|
- name: chat-rn App Build
|
||||||
|
working-directory: ./examples/chat-rn/ios
|
||||||
|
run: |
|
||||||
|
xcodebuild -scheme "jazzchatrn" \
|
||||||
|
-workspace jazzchatrn.xcworkspace \
|
||||||
|
-archivePath $RUNNER_TEMP/jazzchatrn.xcarchive \
|
||||||
|
-derivedDataPath $RUNNER_TEMP/build \
|
||||||
|
-destination "id=${{ steps.ios-simulator.outputs.udid }}" \
|
||||||
|
-configuration Release \
|
||||||
|
-sdk iphonesimulator \
|
||||||
|
build
|
||||||
|
xcrun simctl install booted $RUNNER_TEMP/build/Build/Products/Release-iphonesimulator/jazzchatrn.app
|
||||||
|
xcrun simctl spawn booted log stream --level debug | tee ~/output/sim.log &
|
||||||
|
|
||||||
|
|
||||||
|
- name: Install Maestro
|
||||||
|
run: |
|
||||||
|
curl -fsSL "https://get.maestro.mobile.dev" | bash
|
||||||
|
|
||||||
|
- name: chat-rn App Test
|
||||||
|
id: e2e_test
|
||||||
|
working-directory: ./examples/chat-rn
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
export PATH="$PATH":"$HOME/.maestro/bin"
|
||||||
|
export MAESTRO_DRIVER_STARTUP_TIMEOUT=300000 # setting to 5 mins 👀
|
||||||
|
export MAESTRO_CLI_NO_ANALYTICS=1
|
||||||
|
maestro test test/e2e/flow.yml
|
||||||
|
|
||||||
|
- name: Copy Maestro and Diagnostic Files
|
||||||
|
if: steps.e2e_test.outcome != 'success'
|
||||||
|
run: |
|
||||||
|
cp -r ~/Library/Logs/DiagnosticReports/* ~/output
|
||||||
|
cp -r ~/.maestro/tests/* ~/output
|
||||||
|
|
||||||
|
- name: Upload Output Files
|
||||||
|
if: steps.e2e_test.outcome != 'success'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: e2e-test-output
|
||||||
|
path: ~/output/*
|
||||||
|
retention-days: 5
|
||||||
|
|
||||||
|
- name: Exit with Test Result
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ "${{ steps.e2e_test.outcome }}" != "success" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
31
.github/workflows/jazz-run.yml
vendored
31
.github/workflows/jazz-run.yml
vendored
@@ -8,38 +8,16 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Enable corepack
|
- name: Setup Source Code
|
||||||
run: corepack enable
|
uses: ./.github/actions/source-code/
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version-file: '.node-version'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ env.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Build jazz-run
|
- name: Build jazz-run
|
||||||
run: pnpm exec turbo build && chmod +x dist/index.js;
|
run: pnpm exec turbo build && chmod +x dist/index.js;
|
||||||
@@ -48,4 +26,3 @@ jobs:
|
|||||||
- name: Run create account
|
- name: Run create account
|
||||||
run: ./dist/index.js account create --name "Jazz Run CI test"
|
run: ./dist/index.js account create --name "Jazz Run CI test"
|
||||||
working-directory: ./packages/jazz-run
|
working-directory: ./packages/jazz-run
|
||||||
|
|
||||||
38
.github/workflows/playwright.yml
vendored
38
.github/workflows/playwright.yml
vendored
@@ -9,52 +9,26 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
runs-on: ubuntu-latest
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
project: ["tests/e2e", "examples/chat", "examples/music-player", "examples/pets", "examples/onboarding"]
|
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "examples/onboarding", "starters/react-demo-auth-tailwind"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Enable corepack
|
- name: Setup Source Code
|
||||||
run: corepack enable
|
uses: ./.github/actions/source-code/
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version-file: '.node-version'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ env.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Pnpm Build
|
- name: Pnpm Build
|
||||||
run: pnpm turbo build
|
run: pnpm turbo build
|
||||||
working-directory: ./${{ matrix.project }}
|
working-directory: ./${{ matrix.project }}
|
||||||
|
|
||||||
- name: Build jazz-run
|
|
||||||
run: pnpm exec turbo build && chmod +x dist/index.js;
|
|
||||||
working-directory: ./packages/jazz-run
|
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
run: pnpm exec playwright install --with-deps
|
run: pnpm exec playwright install
|
||||||
working-directory: ./${{ matrix.project }}
|
working-directory: ./${{ matrix.project }}
|
||||||
|
|
||||||
- name: Run Playwright tests
|
- name: Run Playwright tests
|
||||||
|
|||||||
102
.github/workflows/pre-release.yml
vendored
Normal file
102
.github/workflows/pre-release.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
name: Pre-Publish tagged Pull Requests
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-release:
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'pre-release')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Source Code
|
||||||
|
uses: ./.github/actions/source-code/
|
||||||
|
|
||||||
|
- name: Pnpm Build
|
||||||
|
run: pnpm turbo build --filter="./packages/*"
|
||||||
|
|
||||||
|
- name: Pre publish
|
||||||
|
run: pnpm exec pkg-pr-new publish --json output.json --comment=off "./packages/*"
|
||||||
|
|
||||||
|
- name: Post or update comment
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
const fs = require('fs');
|
||||||
|
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
|
||||||
|
|
||||||
|
const packages = output.packages
|
||||||
|
.map((p) => `- ${p.name}: ${p.url}`)
|
||||||
|
.join('\n');
|
||||||
|
|
||||||
|
const sha =
|
||||||
|
context.event_name === 'pull_request'
|
||||||
|
? context.payload.pull_request.head.sha
|
||||||
|
: context.payload.after;
|
||||||
|
|
||||||
|
const resolutions = Object.fromEntries(
|
||||||
|
output.packages.map((p) => [p.name, p.url])
|
||||||
|
);
|
||||||
|
|
||||||
|
const commitUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/commit/${sha}`;
|
||||||
|
|
||||||
|
const body = `## Jazz pre-release
|
||||||
|
|
||||||
|
### Packages:
|
||||||
|
|
||||||
|
\`\`\`json
|
||||||
|
${JSON.stringify(resolutions, null, 4)}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
[View Commit](${commitUrl})`;
|
||||||
|
|
||||||
|
async function logPublishInfo() {
|
||||||
|
console.log('\n' + '='.repeat(50));
|
||||||
|
console.log('Publish Information');
|
||||||
|
console.log('='.repeat(50));
|
||||||
|
console.log('\nPublished Packages:');
|
||||||
|
console.log(output.packages);
|
||||||
|
console.log('\nTemplates:');
|
||||||
|
console.log(templates);
|
||||||
|
console.log(`\nCommit URL: ${commitUrl}`);
|
||||||
|
console.log('\n' + '='.repeat(50));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context.eventName === 'pull_request') {
|
||||||
|
if (context.issue.number) {
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: body,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (context.eventName === 'push') {
|
||||||
|
const pullRequests = await github.rest.pulls.list({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: 'open',
|
||||||
|
head: `${context.repo.owner}:${context.ref.replace(
|
||||||
|
'refs/heads/',
|
||||||
|
''
|
||||||
|
)}`,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (pullRequests.data.length > 0) {
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
issue_number: pullRequests.data[0].number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: body,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
'No open pull request found for this push. Logging publish information to console:'
|
||||||
|
);
|
||||||
|
await logPublishInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
46
.github/workflows/release.yml
vendored
46
.github/workflows/release.yml
vendored
@@ -4,41 +4,26 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
debug_enabled:
|
||||||
|
type: boolean
|
||||||
|
description: "Run tmate session for debugging"
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
|
||||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Enable corepack
|
- name: Setup Source Code
|
||||||
run: corepack enable
|
uses: ./.github/actions/source-code/
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version-file: '.node-version'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ env.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Create Release Pull Request or Publish to npm
|
- name: Create Release Pull Request or Publish to npm
|
||||||
id: changesets
|
id: changesets
|
||||||
@@ -48,4 +33,11 @@ jobs:
|
|||||||
publish: pnpm release
|
publish: pnpm release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
|
# Enable tmate debugging only if the workflow is manually triggered, debug_enabled is true, and the workflow failed
|
||||||
|
- name: Setup tmate session for debugging
|
||||||
|
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
|
||||||
|
uses: mxschmitt/action-tmate@v3
|
||||||
|
with:
|
||||||
|
timeout-minutes: 15
|
||||||
|
|||||||
33
.github/workflows/unit-test.yml
vendored
33
.github/workflows/unit-test.yml
vendored
@@ -9,39 +9,20 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
unit-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Enable corepack
|
- name: Setup Source Code
|
||||||
run: corepack enable
|
uses: ./.github/actions/source-code/
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: '.node-version'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ env.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Pnpm Build
|
- name: Pnpm Build
|
||||||
run: pnpm turbo build
|
run: pnpm turbo build --filter="./packages/*"
|
||||||
|
|
||||||
|
- name: Install Playwright Browsers
|
||||||
|
run: pnpm exec playwright install
|
||||||
|
|
||||||
- name: Unit Tests
|
- name: Unit Tests
|
||||||
run: pnpm test:ci
|
run: pnpm test:ci
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,6 +5,7 @@ docsTmp
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.turbo
|
.turbo
|
||||||
coverage
|
coverage
|
||||||
|
.direnv
|
||||||
|
|
||||||
# Next.js
|
# Next.js
|
||||||
**/.next
|
**/.next
|
||||||
@@ -18,3 +19,5 @@ test-results
|
|||||||
.husky
|
.husky
|
||||||
|
|
||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
|
|
||||||
|
.svelte-kit
|
||||||
@@ -1 +1 @@
|
|||||||
20
|
22
|
||||||
@@ -59,7 +59,7 @@ representative at an online or offline event.
|
|||||||
## Enforcement
|
## Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
reported to [the community leaders responsible for enforcement](mailto:hello@gcmp.io).
|
reported to [the community leaders responsible for enforcement](mailto:hello@garden.co).
|
||||||
All complaints will be reviewed and investigated promptly and fairly.
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
All community leaders are obligated to respect the privacy and security of the
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Thank you for considering contributing to Jazz! Jazz is an open-source framework
|
|||||||
|
|
||||||
### 1. Reporting Bugs
|
### 1. Reporting Bugs
|
||||||
|
|
||||||
If you find a bug, please [open an issue with as much detail as possible](https://github.com/gardencmp/jazz/issues). Include:
|
If you find a bug, please [open an issue with as much detail as possible](https://github.com/garden-co/jazz/issues). Include:
|
||||||
|
|
||||||
- A clear and descriptive title.
|
- A clear and descriptive title.
|
||||||
- Steps to reproduce the issue.
|
- Steps to reproduce the issue.
|
||||||
@@ -40,7 +40,7 @@ You'll need Node.js 20.x or 22.x installed (we're working on support for 23.x),
|
|||||||
|
|
||||||
1. **Clone the repository**:
|
1. **Clone the repository**:
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/gardencmp/jazz.git
|
git clone https://github.com/garden-co/jazz.git
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Install dependencies**:
|
2. **Install dependencies**:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright 2024, Garden Computing, Inc.
|
Copyright 2025, Garden Computing, Inc.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|||||||
@@ -15,6 +15,6 @@ For community and support, please join our [Discord](https://discord.gg/utDMjHYg
|
|||||||
- Homepage: [jazz.tools](https://jazz.tools)
|
- Homepage: [jazz.tools](https://jazz.tools)
|
||||||
- Docs: [jazz.tools/docs](https://jazz.tools/docs)
|
- Docs: [jazz.tools/docs](https://jazz.tools/docs)
|
||||||
- Community & support: [Discord](https://discord.gg/utDMjHYg42)
|
- Community & support: [Discord](https://discord.gg/utDMjHYg42)
|
||||||
- Updates: [X](https://x.com/jazz_tools) & [Email](https://gcmp.io/news)
|
- Updates: [X](https://x.com/jazz_tools) & [Email](https://garden.co/news)
|
||||||
|
|
||||||
Copyright 2024 — Garden Computing, Inc.
|
Copyright 2025 — Garden Computing, Inc.
|
||||||
|
|||||||
59
biome.json
59
biome.json
@@ -25,7 +25,62 @@
|
|||||||
"linter": {
|
"linter": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"rules": {
|
"rules": {
|
||||||
"recommended": true
|
"recommended": true,
|
||||||
|
"correctness": {
|
||||||
|
"useImportExtensions": {
|
||||||
|
"level": "error",
|
||||||
|
"options": {
|
||||||
|
"suggestedExtensions": {
|
||||||
|
"ts": {
|
||||||
|
"module": "js",
|
||||||
|
"component": "jsx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"include": ["**/package.json"],
|
||||||
|
"linter": {
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"formatter": {
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": ["packages/**/src/**"],
|
||||||
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
|
"rules": {
|
||||||
|
"recommended": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": ["packages/**/src/tests/**", "packages/**/src/test/**"],
|
||||||
|
"linter": {
|
||||||
|
"rules": {
|
||||||
|
"correctness": {
|
||||||
|
"useImportExtensions": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": ["packages/cojson-storage-indexeddb/**"],
|
||||||
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
|
"rules": {
|
||||||
|
"recommended": true,
|
||||||
|
"suspicious": {
|
||||||
|
"noExplicitAny": "info"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
36
examples/book-shelf/.gitignore
vendored
36
examples/book-shelf/.gitignore
vendored
@@ -1,36 +0,0 @@
|
|||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
/node_modules
|
|
||||||
/.pnp
|
|
||||||
.pnp.js
|
|
||||||
.yarn/install-state.gz
|
|
||||||
|
|
||||||
# testing
|
|
||||||
/coverage
|
|
||||||
|
|
||||||
# next.js
|
|
||||||
/.next/
|
|
||||||
/out/
|
|
||||||
|
|
||||||
# production
|
|
||||||
/build
|
|
||||||
|
|
||||||
# misc
|
|
||||||
.DS_Store
|
|
||||||
*.pem
|
|
||||||
|
|
||||||
# debug
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# local env files
|
|
||||||
.env*.local
|
|
||||||
|
|
||||||
# vercel
|
|
||||||
.vercel
|
|
||||||
|
|
||||||
# typescript
|
|
||||||
*.tsbuildinfo
|
|
||||||
next-env.d.ts
|
|
||||||
@@ -1,229 +0,0 @@
|
|||||||
# jazz-example-book-shelf
|
|
||||||
|
|
||||||
## 0.1.27
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [9212ab8]
|
|
||||||
- Updated dependencies [8b87117]
|
|
||||||
- jazz-react@0.8.35
|
|
||||||
- jazz-tools@0.8.35
|
|
||||||
- jazz-browser-media-images@0.8.35
|
|
||||||
|
|
||||||
## 0.1.26
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.34
|
|
||||||
- jazz-tools@0.8.34
|
|
||||||
- jazz-browser-media-images@0.8.34
|
|
||||||
|
|
||||||
## 0.1.25
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-browser-media-images@0.8.33
|
|
||||||
- jazz-react@0.8.33
|
|
||||||
|
|
||||||
## 0.1.24
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [df42b2b]
|
|
||||||
- jazz-tools@0.8.32
|
|
||||||
- jazz-react@0.8.32
|
|
||||||
- jazz-browser-media-images@0.8.32
|
|
||||||
|
|
||||||
## 0.1.23
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.31
|
|
||||||
- jazz-tools@0.8.31
|
|
||||||
- jazz-browser-media-images@0.8.31
|
|
||||||
|
|
||||||
## 0.1.22
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.30
|
|
||||||
- jazz-tools@0.8.30
|
|
||||||
- jazz-browser-media-images@0.8.30
|
|
||||||
|
|
||||||
## 0.1.21
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.29
|
|
||||||
- jazz-tools@0.8.29
|
|
||||||
- jazz-browser-media-images@0.8.29
|
|
||||||
|
|
||||||
## 0.1.20
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.28
|
|
||||||
- jazz-tools@0.8.28
|
|
||||||
- jazz-browser-media-images@0.8.28
|
|
||||||
|
|
||||||
## 0.1.19
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.27
|
|
||||||
- jazz-tools@0.8.27
|
|
||||||
- jazz-browser-media-images@0.8.27
|
|
||||||
|
|
||||||
## 0.1.18
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [59d37df]
|
|
||||||
- jazz-react@0.8.26
|
|
||||||
|
|
||||||
## 0.1.17
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-browser-media-images@0.8.24
|
|
||||||
- jazz-react@0.8.24
|
|
||||||
|
|
||||||
## 0.1.16
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [d348c2d]
|
|
||||||
- Updated dependencies [6902b5b]
|
|
||||||
- Updated dependencies [1a0cd3d]
|
|
||||||
- jazz-tools@0.8.23
|
|
||||||
- jazz-react@0.8.23
|
|
||||||
- jazz-browser-media-images@0.8.23
|
|
||||||
|
|
||||||
## 0.1.15
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [59cc64d]
|
|
||||||
- jazz-react@0.8.22
|
|
||||||
- jazz-browser-media-images@0.8.22
|
|
||||||
|
|
||||||
## 0.1.14
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [149ca97]
|
|
||||||
- jazz-tools@0.8.21
|
|
||||||
- jazz-react@0.8.21
|
|
||||||
- jazz-browser-media-images@0.8.21
|
|
||||||
|
|
||||||
## 0.1.13
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [dd9b13f]
|
|
||||||
- Updated dependencies [a69ed0b]
|
|
||||||
- Updated dependencies [3ef3ff3]
|
|
||||||
- Updated dependencies [c6931b8]
|
|
||||||
- jazz-react@0.8.20
|
|
||||||
- jazz-browser-media-images@0.8.20
|
|
||||||
|
|
||||||
## 0.1.12
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.19
|
|
||||||
- jazz-tools@0.8.19
|
|
||||||
- jazz-browser-media-images@0.8.19
|
|
||||||
|
|
||||||
## 0.1.11
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.18
|
|
||||||
- jazz-tools@0.8.18
|
|
||||||
- jazz-browser-media-images@0.8.18
|
|
||||||
|
|
||||||
## 0.1.10
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.17
|
|
||||||
- jazz-tools@0.8.17
|
|
||||||
- jazz-browser-media-images@0.8.17
|
|
||||||
|
|
||||||
## 0.1.9
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [2af107c]
|
|
||||||
- jazz-react@0.8.16
|
|
||||||
- jazz-browser-media-images@0.8.16
|
|
||||||
- jazz-tools@0.8.16
|
|
||||||
|
|
||||||
## 0.1.8
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [cce679b]
|
|
||||||
- jazz-tools@0.8.15
|
|
||||||
- jazz-browser-media-images@0.8.15
|
|
||||||
- jazz-react@0.8.15
|
|
||||||
|
|
||||||
## 0.1.7
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [36273b3]
|
|
||||||
- jazz-tools@0.8.14
|
|
||||||
- jazz-browser-media-images@0.8.14
|
|
||||||
- jazz-react@0.8.14
|
|
||||||
|
|
||||||
## 0.1.6
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [fd011d7]
|
|
||||||
- jazz-tools@0.8.13
|
|
||||||
- jazz-browser-media-images@0.8.13
|
|
||||||
- jazz-react@0.8.13
|
|
||||||
|
|
||||||
## 0.1.5
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [3cc6aee]
|
|
||||||
- jazz-react@0.8.12
|
|
||||||
- jazz-tools@0.8.12
|
|
||||||
- jazz-browser-media-images@0.8.12
|
|
||||||
|
|
||||||
## 0.1.4
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react@0.8.11
|
|
||||||
- jazz-tools@0.8.11
|
|
||||||
- jazz-browser-media-images@0.8.11
|
|
||||||
|
|
||||||
## 0.1.3
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-browser-media-images@0.8.7
|
|
||||||
- jazz-react@0.8.7
|
|
||||||
|
|
||||||
## 0.1.2
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-browser-media-images@0.8.6
|
|
||||||
- jazz-react@0.8.6
|
|
||||||
|
|
||||||
## 0.1.1
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [c3f4e6b]
|
|
||||||
- Updated dependencies [d9152ed]
|
|
||||||
- jazz-tools@0.8.5
|
|
||||||
- jazz-browser-media-images@0.8.5
|
|
||||||
- jazz-react@0.8.5
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
FROM caddy:2.7.3-alpine
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/gardencmp/jazz"
|
|
||||||
|
|
||||||
COPY ./dist /usr/share/caddy/
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
# Book shelf example with Jazz and Next.js
|
|
||||||
|
|
||||||
This is an example of a book shelf where you can add and review books.
|
|
||||||
It shows you how to create and edit data, upload images, and share data publicly.
|
|
||||||
|
|
||||||
Live version: https://books-demo.jazz.tools
|
|
||||||
|
|
||||||
## Installing & running the example locally
|
|
||||||
|
|
||||||
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
|
|
||||||
|
|
||||||
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
|
|
||||||
```bash
|
|
||||||
npx degit gardencmp/jazz jazz
|
|
||||||
```
|
|
||||||
|
|
||||||
Go to the book-shelf example directory:
|
|
||||||
```bash
|
|
||||||
cd jazz/examples/book-shelf
|
|
||||||
```
|
|
||||||
|
|
||||||
Install and build dependencies:
|
|
||||||
```bash
|
|
||||||
pnpm i && npx turbo build
|
|
||||||
```
|
|
||||||
|
|
||||||
Start the dev server:
|
|
||||||
```bash
|
|
||||||
pnpm dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## Questions / problems / feedback
|
|
||||||
|
|
||||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
|
||||||
|
|
||||||
|
|
||||||
## Configuration: sync server
|
|
||||||
|
|
||||||
By default, the example app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
|
|
||||||
|
|
||||||
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<Jazz.Provider>` provider component in [./src/components/JazzAndAuth.tsx](./src/components/JazzAndAuth.tsx).
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
job "example-bookShelf$BRANCH_SUFFIX" {
|
|
||||||
region = "global"
|
|
||||||
datacenters = ["*"]
|
|
||||||
|
|
||||||
group "static" {
|
|
||||||
count = 4
|
|
||||||
|
|
||||||
network {
|
|
||||||
port "http" {
|
|
||||||
to = 80
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
constraint {
|
|
||||||
attribute = "${node.class}"
|
|
||||||
operator = "="
|
|
||||||
value = "cloud"
|
|
||||||
}
|
|
||||||
|
|
||||||
spread {
|
|
||||||
attribute = "${node.datacenter}"
|
|
||||||
weight = 100
|
|
||||||
}
|
|
||||||
|
|
||||||
constraint {
|
|
||||||
distinct_hosts = true
|
|
||||||
}
|
|
||||||
|
|
||||||
task "server" {
|
|
||||||
driver = "docker"
|
|
||||||
|
|
||||||
config {
|
|
||||||
image = "$DOCKER_TAG"
|
|
||||||
ports = ["http"]
|
|
||||||
|
|
||||||
auth = {
|
|
||||||
username = "$DOCKER_USER"
|
|
||||||
password = "$DOCKER_PASSWORD"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
service {
|
|
||||||
tags = ["public"]
|
|
||||||
name = "example-bookShelf$BRANCH_SUFFIX"
|
|
||||||
port = "http"
|
|
||||||
provider = "consul"
|
|
||||||
}
|
|
||||||
|
|
||||||
resources {
|
|
||||||
cpu = 50 # MHz
|
|
||||||
memory = 50 # MB
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# deploy bump 4
|
|
||||||
5
examples/book-shelf/next-env.d.ts
vendored
5
examples/book-shelf/next-env.d.ts
vendored
@@ -1,5 +0,0 @@
|
|||||||
/// <reference types="next" />
|
|
||||||
/// <reference types="next/image-types/global" />
|
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
|
||||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
|
||||||
const nextConfig = {};
|
|
||||||
|
|
||||||
export default nextConfig;
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "jazz-example-book-shelf",
|
|
||||||
"version": "0.1.27",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"dev": "next dev",
|
|
||||||
"format-and-lint": "biome check .",
|
|
||||||
"format-and-lint:fix": "biome check . --write",
|
|
||||||
"build": "next build",
|
|
||||||
"start": "next start"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"clsx": "^2.0.0",
|
|
||||||
"jazz-browser-media-images": "workspace:0.8.35",
|
|
||||||
"jazz-react": "workspace:0.8.35",
|
|
||||||
"jazz-tools": "workspace:0.8.35",
|
|
||||||
"next": "14.2.5",
|
|
||||||
"react": "^18.2.0",
|
|
||||||
"react-dom": "^18.2.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^22.5.1",
|
|
||||||
"@types/react": "^18.2.19",
|
|
||||||
"@types/react-dom": "^18.2.7",
|
|
||||||
"postcss": "^8.4.27",
|
|
||||||
"tailwindcss": "3.3.2",
|
|
||||||
"typescript": "^5.3.3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/** @type {import('postcss-load-config').Config} */
|
|
||||||
const config = {
|
|
||||||
plugins: {
|
|
||||||
tailwindcss: {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { Button } from "@/components/Button";
|
|
||||||
import { Container } from "@/components/Container";
|
|
||||||
import { useAccount } from "@/components/JazzAndAuth";
|
|
||||||
import RatingInput from "@/components/RatingInput";
|
|
||||||
import { BookReview, ListOfBookReviews } from "@/schema";
|
|
||||||
import { createImage } from "jazz-browser-media-images";
|
|
||||||
import { Group, ImageDefinition } from "jazz-tools";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { ChangeEvent, useState } from "react";
|
|
||||||
|
|
||||||
export default function AddBookReview() {
|
|
||||||
const { me } = useAccount();
|
|
||||||
|
|
||||||
const [title, setTitle] = useState("");
|
|
||||||
const [author, setAuthor] = useState("");
|
|
||||||
const [review, setReview] = useState("");
|
|
||||||
const [rating, setRating] = useState(0);
|
|
||||||
const [dateRead, setDateRead] = useState(
|
|
||||||
new Date().toISOString().split("T")[0],
|
|
||||||
);
|
|
||||||
const [coverImage, setCoverImage] = useState<ImageDefinition | undefined>();
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const onDateChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
||||||
const date = new Date(event.currentTarget.value)
|
|
||||||
.toISOString()
|
|
||||||
.split("T")[0];
|
|
||||||
setDateRead(date);
|
|
||||||
};
|
|
||||||
|
|
||||||
const onImageChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
||||||
const file = event.currentTarget.files?.[0];
|
|
||||||
const group = Group.create({ owner: me });
|
|
||||||
group.addMember("everyone", "reader");
|
|
||||||
|
|
||||||
if (file) {
|
|
||||||
createImage(file, { owner: group }).then((image) => {
|
|
||||||
setCoverImage(image);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const onSubmit = (event: React.FormEvent<HTMLFormElement>) => {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
if (!me?.profile) return;
|
|
||||||
|
|
||||||
const bookReview = BookReview.create(
|
|
||||||
{
|
|
||||||
title,
|
|
||||||
author,
|
|
||||||
review,
|
|
||||||
rating,
|
|
||||||
dateRead: new Date(dateRead),
|
|
||||||
cover: coverImage,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
owner: me.profile._owner,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!me.profile.bookReviews) {
|
|
||||||
me.profile.bookReviews = ListOfBookReviews.create([], {
|
|
||||||
owner: me.profile._owner,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
me.profile.bookReviews.push(bookReview);
|
|
||||||
router.push("/");
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Container className="grid max-w-lg gap-8 py-8">
|
|
||||||
<h1 className="text-lg font-semibold text-black">Add book review</h1>
|
|
||||||
<form action="" className="grid gap-4" onSubmit={onSubmit}>
|
|
||||||
<label className="grid gap-1 text-sm text-gray-600">
|
|
||||||
Cover
|
|
||||||
<input type="file" onChange={onImageChange} />
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label className="grid gap-1 text-sm text-gray-600">
|
|
||||||
Title
|
|
||||||
<input
|
|
||||||
className="rounded border border-gray-300 px-2 py-1 shadow-sm"
|
|
||||||
type="text"
|
|
||||||
value={title}
|
|
||||||
required
|
|
||||||
onChange={(e) => setTitle(e.target.value)}
|
|
||||||
></input>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label className="grid gap-1 text-sm text-gray-600">
|
|
||||||
Author
|
|
||||||
<input
|
|
||||||
className="rounded border border-gray-300 px-2 py-1 shadow-sm"
|
|
||||||
type="text"
|
|
||||||
value={author}
|
|
||||||
required
|
|
||||||
onChange={(e) => setAuthor(e.target.value)}
|
|
||||||
></input>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label className="grid gap-1 text-sm text-gray-600">
|
|
||||||
Date read
|
|
||||||
<input
|
|
||||||
className="rounded border border-gray-300 px-2 py-1 shadow-sm"
|
|
||||||
type="date"
|
|
||||||
value={dateRead}
|
|
||||||
required
|
|
||||||
onChange={onDateChange}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<div className="grid gap-1 text-sm text-gray-600">
|
|
||||||
Rating
|
|
||||||
<RatingInput
|
|
||||||
value={rating}
|
|
||||||
onChange={(rating) => setRating(rating)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label className="grid gap-1 text-sm text-gray-600">
|
|
||||||
Review
|
|
||||||
<textarea
|
|
||||||
className="rounded border border-gray-300 px-2 py-1 shadow-sm"
|
|
||||||
value={review}
|
|
||||||
onChange={(e) => setReview(e.target.value)}
|
|
||||||
></textarea>
|
|
||||||
</label>
|
|
||||||
<Button variant="primary" type="submit">
|
|
||||||
Add
|
|
||||||
</Button>
|
|
||||||
</form>
|
|
||||||
</Container>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,172 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { BookCover } from "@/components/BookCover";
|
|
||||||
import { Container } from "@/components/Container";
|
|
||||||
import { useCoState } from "@/components/JazzAndAuth";
|
|
||||||
import Rating from "@/components/Rating";
|
|
||||||
import RatingInput from "@/components/RatingInput";
|
|
||||||
import { BookReview } from "@/schema";
|
|
||||||
import clsx from "clsx";
|
|
||||||
import { Group, ID } from "jazz-tools";
|
|
||||||
|
|
||||||
const BookReviewTitle = ({
|
|
||||||
bookReview,
|
|
||||||
readOnly,
|
|
||||||
}: {
|
|
||||||
bookReview: BookReview;
|
|
||||||
readOnly: boolean;
|
|
||||||
}) => {
|
|
||||||
const className = "font-serif text-2xl font-bold lg:text-4xl";
|
|
||||||
|
|
||||||
if (readOnly) {
|
|
||||||
return <h1 className={className}>{bookReview.title}</h1>;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<input
|
|
||||||
value={bookReview.title}
|
|
||||||
placeholder="Book title"
|
|
||||||
className={clsx(
|
|
||||||
className,
|
|
||||||
"w-full rounded border border-transparent px-2 py-1 hover:border-gray-300 hover:shadow-sm",
|
|
||||||
)}
|
|
||||||
onChange={(e) => (bookReview.title = e.target.value)}
|
|
||||||
></input>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const BookReviewAuthor = ({
|
|
||||||
bookReview,
|
|
||||||
readOnly,
|
|
||||||
}: {
|
|
||||||
bookReview: BookReview;
|
|
||||||
readOnly: boolean;
|
|
||||||
}) => {
|
|
||||||
const className = "text-gray-700";
|
|
||||||
|
|
||||||
if (readOnly) {
|
|
||||||
return <p className={className}>by {bookReview.author}</p>;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<input
|
|
||||||
value={bookReview.author}
|
|
||||||
placeholder="Author"
|
|
||||||
className={clsx(
|
|
||||||
className,
|
|
||||||
"w-full rounded border border-transparent px-2 py-1 hover:border-gray-300 hover:shadow-sm",
|
|
||||||
)}
|
|
||||||
onChange={(e) => (bookReview.author = e.target.value)}
|
|
||||||
></input>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const BookReviewDateRead = ({
|
|
||||||
bookReview,
|
|
||||||
readOnly,
|
|
||||||
}: {
|
|
||||||
bookReview: BookReview;
|
|
||||||
readOnly: boolean;
|
|
||||||
}) => {
|
|
||||||
const className = "text-gray-700 max-w-[10rem]";
|
|
||||||
|
|
||||||
if (readOnly) {
|
|
||||||
return (
|
|
||||||
bookReview.dateRead && (
|
|
||||||
<p className={className}>{bookReview.dateRead.toLocaleDateString()}</p>
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<input
|
|
||||||
type="date"
|
|
||||||
value={bookReview.dateRead?.toISOString().split("T")[0]}
|
|
||||||
placeholder="Date read"
|
|
||||||
className={clsx(
|
|
||||||
className,
|
|
||||||
"w-full rounded border border-transparent px-2 py-1 hover:border-gray-300 hover:shadow-sm",
|
|
||||||
)}
|
|
||||||
onChange={(e) => {
|
|
||||||
const date = new Date(e.target.value);
|
|
||||||
bookReview.dateRead = date;
|
|
||||||
}}
|
|
||||||
></input>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const BookReviewReview = ({
|
|
||||||
bookReview,
|
|
||||||
readOnly,
|
|
||||||
}: {
|
|
||||||
bookReview: BookReview;
|
|
||||||
readOnly: boolean;
|
|
||||||
}) => {
|
|
||||||
const className = "text-sm leading-relaxed text-gray-600";
|
|
||||||
|
|
||||||
if (readOnly) {
|
|
||||||
if (bookReview.review) {
|
|
||||||
return <p className={className}>{bookReview.review}</p>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<textarea
|
|
||||||
value={bookReview.review}
|
|
||||||
placeholder="Write your review here..."
|
|
||||||
className={clsx(
|
|
||||||
className,
|
|
||||||
"w-full rounded border border-transparent px-2 py-1 hover:border-gray-300 hover:shadow-sm",
|
|
||||||
)}
|
|
||||||
onChange={(e) => (bookReview.review = e.target.value)}
|
|
||||||
></textarea>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const BookReviewRating = ({
|
|
||||||
bookReview,
|
|
||||||
readOnly,
|
|
||||||
}: {
|
|
||||||
bookReview: BookReview;
|
|
||||||
readOnly: boolean;
|
|
||||||
}) => {
|
|
||||||
const className = "text-2xl sm:mx-0";
|
|
||||||
|
|
||||||
if (readOnly) {
|
|
||||||
return <Rating className={className} rating={bookReview.rating} />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<RatingInput
|
|
||||||
className={clsx(className, "p-2")}
|
|
||||||
onChange={(rating) => (bookReview.rating = rating)}
|
|
||||||
value={bookReview.rating}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function Page({ params }: { params: { slug: string } }) {
|
|
||||||
const bookReview = useCoState(BookReview, params.slug as ID<BookReview>);
|
|
||||||
|
|
||||||
if (!bookReview) return <></>;
|
|
||||||
|
|
||||||
const readOnly = !(bookReview._owner.castAs(Group).myRole() === "admin");
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Container className="grid gap-12 py-8">
|
|
||||||
<div className="flex flex-col gap-6 sm:flex-row md:gap-10">
|
|
||||||
<div className="w-[180px]">
|
|
||||||
<BookCover bookReview={bookReview} readOnly={readOnly} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="-mx-2 grid max-w-lg flex-1 gap-3 sm:mx-0">
|
|
||||||
<BookReviewTitle bookReview={bookReview} readOnly={readOnly} />
|
|
||||||
<BookReviewAuthor bookReview={bookReview} readOnly={readOnly} />
|
|
||||||
<BookReviewDateRead bookReview={bookReview} readOnly={readOnly} />
|
|
||||||
<BookReviewRating bookReview={bookReview} readOnly={readOnly} />
|
|
||||||
<BookReviewReview bookReview={bookReview} readOnly={readOnly} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Container>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
@@ -1,13 +0,0 @@
|
|||||||
@tailwind base;
|
|
||||||
@tailwind components;
|
|
||||||
@tailwind utilities;
|
|
||||||
|
|
||||||
@layer base {
|
|
||||||
:focus {
|
|
||||||
@apply outline-none;
|
|
||||||
}
|
|
||||||
|
|
||||||
:focus-visible {
|
|
||||||
@apply ring-2 ring-purple-600/75 dark:ring-2 dark:ring-white/75;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import type { Metadata } from "next";
|
|
||||||
import { Inter } from "next/font/google";
|
|
||||||
import "./globals.css";
|
|
||||||
import { JazzAndAuth } from "@/components/JazzAndAuth";
|
|
||||||
import { Nav } from "@/components/Nav";
|
|
||||||
import clsx from "clsx";
|
|
||||||
import { Fraunces } from "next/font/google";
|
|
||||||
|
|
||||||
const fraunces = Fraunces({
|
|
||||||
subsets: ["latin"],
|
|
||||||
display: "swap",
|
|
||||||
variable: "--font-fraunces",
|
|
||||||
});
|
|
||||||
|
|
||||||
const inter = Inter({ subsets: ["latin"] });
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
|
||||||
title: "Jazz Book Shelf",
|
|
||||||
description: "Jazz Book Shelf",
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function RootLayout({
|
|
||||||
children,
|
|
||||||
}: Readonly<{
|
|
||||||
children: React.ReactNode;
|
|
||||||
}>) {
|
|
||||||
return (
|
|
||||||
<html lang="en">
|
|
||||||
<body className={clsx(inter.className, fraunces.variable)}>
|
|
||||||
<JazzAndAuth>
|
|
||||||
<header>
|
|
||||||
<Nav />
|
|
||||||
</header>
|
|
||||||
<main>{children}</main>
|
|
||||||
</JazzAndAuth>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { Container } from "@/components/Container";
|
|
||||||
import { useAccount } from "@/components/JazzAndAuth";
|
|
||||||
import UserProfile from "@/components/UserProfile";
|
|
||||||
import { JazzAccount } from "@/schema";
|
|
||||||
import { ID } from "jazz-tools";
|
|
||||||
|
|
||||||
export default function Home() {
|
|
||||||
const { me } = useAccount();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Container className="grid gap-12 py-8">
|
|
||||||
<UserProfile id={me?.id as ID<JazzAccount>} />
|
|
||||||
|
|
||||||
<label className="flex flex-wrap items-center gap-3">
|
|
||||||
Share your profile:
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
className="w-full rounded border p-1"
|
|
||||||
value={`${window.location.origin}/user/${me?.id}`}
|
|
||||||
readOnly
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</Container>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { Container } from "@/components/Container";
|
|
||||||
import UserProfile from "@/components/UserProfile";
|
|
||||||
import { JazzAccount } from "@/schema";
|
|
||||||
import { ID } from "jazz-tools";
|
|
||||||
|
|
||||||
export default function Page({ params }: { params: { slug: string } }) {
|
|
||||||
const { slug } = params;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Container className="py-8">
|
|
||||||
<UserProfile id={slug as ID<JazzAccount>} />
|
|
||||||
</Container>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
import { Button } from "@/components/Button";
|
|
||||||
import { useAccount } from "@/components/JazzAndAuth";
|
|
||||||
import PlusIcon from "@/components/icons/PlusIcon";
|
|
||||||
import { BookReview } from "@/schema";
|
|
||||||
import clsx from "clsx";
|
|
||||||
import { createImage } from "jazz-browser-media-images";
|
|
||||||
import { ProgressiveImg } from "jazz-react";
|
|
||||||
import { Group, ImageDefinition } from "jazz-tools";
|
|
||||||
import { ChangeEvent, useRef, useState } from "react";
|
|
||||||
|
|
||||||
const BookCoverContainer = ({
|
|
||||||
children,
|
|
||||||
className = "",
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
className?: string;
|
|
||||||
}) => {
|
|
||||||
return (
|
|
||||||
<div className={clsx("h-[240px] lg:h-[260px]", className)}>{children}</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const MockCover = ({ bookReview }: { bookReview: BookReview }) => {
|
|
||||||
return (
|
|
||||||
<div className="flex h-full flex-col items-center justify-center gap-3 rounded-l-sm rounded-r-md bg-gray-100 px-3 text-center shadow-lg">
|
|
||||||
<p className="font-medium">{bookReview.title}</p>
|
|
||||||
<p className="text-xs">{bookReview.author}</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export function BookCoverReadOnly({
|
|
||||||
bookReview,
|
|
||||||
className,
|
|
||||||
}: {
|
|
||||||
bookReview: BookReview;
|
|
||||||
className?: string;
|
|
||||||
}) {
|
|
||||||
if (bookReview.cover) {
|
|
||||||
return (
|
|
||||||
<BookCoverContainer className={className}>
|
|
||||||
<ProgressiveImg image={bookReview.cover}>
|
|
||||||
{({ src }) => (
|
|
||||||
<img
|
|
||||||
className="max-h-full max-w-full rounded-l-sm rounded-r-md shadow-lg"
|
|
||||||
src={src}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</ProgressiveImg>
|
|
||||||
</BookCoverContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<BookCoverContainer className={className}>
|
|
||||||
<MockCover bookReview={bookReview} />
|
|
||||||
</BookCoverContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function BookCoverInput({ bookReview }: { bookReview: BookReview }) {
|
|
||||||
const { me } = useAccount();
|
|
||||||
const inputRef = useRef<HTMLInputElement>(null);
|
|
||||||
|
|
||||||
const onImageChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
||||||
if (!me?.profile) return;
|
|
||||||
|
|
||||||
const file = event.currentTarget.files?.[0];
|
|
||||||
|
|
||||||
if (file) {
|
|
||||||
createImage(file, { owner: me.profile._owner }).then((image) => {
|
|
||||||
bookReview.cover = image;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const onUploadClick = () => {
|
|
||||||
inputRef.current?.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
const remove = () => {
|
|
||||||
bookReview.cover = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (bookReview.cover) {
|
|
||||||
return (
|
|
||||||
<div className="group relative inline-block">
|
|
||||||
<BookCoverReadOnly
|
|
||||||
className="transition-opacity group-hover:opacity-40"
|
|
||||||
bookReview={bookReview}
|
|
||||||
/>
|
|
||||||
<div className="absolute left-0 top-0 hidden h-full w-full items-center justify-center rounded-l-sm rounded-r-md group-hover:flex">
|
|
||||||
<Button
|
|
||||||
variant="tertiary"
|
|
||||||
type="button"
|
|
||||||
className="shadow"
|
|
||||||
onClick={remove}
|
|
||||||
>
|
|
||||||
Remove
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<BookCoverContainer className="flex w-[180px] flex-col justify-center rounded-l-sm rounded-r-md bg-gray-100 p-3 shadow-lg">
|
|
||||||
<button
|
|
||||||
className="flex h-full w-full flex-col items-center justify-center gap-3 text-gray-500 transition-colors hover:text-gray-600"
|
|
||||||
type="button"
|
|
||||||
onClick={onUploadClick}
|
|
||||||
>
|
|
||||||
<PlusIcon className="h-10 w-10" />
|
|
||||||
Upload book cover
|
|
||||||
</button>
|
|
||||||
<label className="sr-only">
|
|
||||||
Cover
|
|
||||||
<input ref={inputRef} type="file" onChange={onImageChange} />
|
|
||||||
</label>
|
|
||||||
</BookCoverContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function BookCover({
|
|
||||||
bookReview,
|
|
||||||
readOnly,
|
|
||||||
}: {
|
|
||||||
bookReview: BookReview;
|
|
||||||
readOnly?: boolean;
|
|
||||||
}) {
|
|
||||||
if (readOnly) return <BookCoverReadOnly bookReview={bookReview} />;
|
|
||||||
|
|
||||||
return <BookCoverInput bookReview={bookReview} />;
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
import { BookCover } from "@/components/BookCover";
|
|
||||||
import Rating from "@/components/Rating";
|
|
||||||
import RatingInput from "@/components/RatingInput";
|
|
||||||
import { BookReview } from "@/schema";
|
|
||||||
import { Group } from "jazz-tools";
|
|
||||||
|
|
||||||
export function BookReviewHeader({ bookReview }: { bookReview: BookReview }) {
|
|
||||||
const { title, author, rating, review, dateRead } = bookReview;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="grid gap-5">
|
|
||||||
<div>
|
|
||||||
<h1 className="mb-1 font-serif text-2xl font-bold md:mb-3 lg:text-4xl">
|
|
||||||
{title}
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<p className="text-gray-500">by {author}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{bookReview._owner.castAs(Group).myRole() === "admin" ? (
|
|
||||||
<RatingInput
|
|
||||||
onChange={(rating) => (bookReview.rating = rating)}
|
|
||||||
value={rating}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<Rating className="mx-auto text-2xl sm:mx-0" rating={rating} />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { BookCover, BookCoverReadOnly } from "@/components/BookCover";
|
|
||||||
import { useCoState } from "@/components/JazzAndAuth";
|
|
||||||
import StarIcon from "@/components/icons/StarIcon";
|
|
||||||
import { ID } from "jazz-tools";
|
|
||||||
import Link from "next/link";
|
|
||||||
import { BookReview } from "../schema";
|
|
||||||
|
|
||||||
export function BookReviewThumbnail({ id }: { id: ID<BookReview> }) {
|
|
||||||
const bookReview = useCoState(BookReview, id);
|
|
||||||
|
|
||||||
if (!bookReview) return <></>;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="inline-flex shrink-0 gap-4 rounded border p-4 sm:block sm:space-y-6 sm:border-0 sm:p-0 md:w-[200px]">
|
|
||||||
<Link href={`/book/${bookReview.id}`} className="sm:block sm:flex-1">
|
|
||||||
<BookCoverReadOnly bookReview={bookReview} />
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
<div className="flex-1">
|
|
||||||
<Link href={`/book/${bookReview.id}`}>
|
|
||||||
<h2 className="mb-1 text-sm font-medium">{bookReview.title}</h2>
|
|
||||||
</Link>
|
|
||||||
<div className="mb-2 flex flex-col gap-2 text-sm text-gray-500 sm:flex-row sm:items-center">
|
|
||||||
<p>{bookReview.author}</p>
|
|
||||||
<div className="flex items-center gap-0.5 text-xs font-semibold leading-none">
|
|
||||||
<StarIcon className="-mt-px text-base text-yellow-400" />
|
|
||||||
{bookReview.rating}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
import clsx from "clsx";
|
|
||||||
import Link from "next/link";
|
|
||||||
import type { ComponentProps } from "react";
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
variant?: "primary" | "secondary" | "tertiary";
|
|
||||||
className?: string;
|
|
||||||
size?: "sm" | "md" | "lg";
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AnchorProps
|
|
||||||
extends Props,
|
|
||||||
React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
||||||
href: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type ButtonProps = ComponentProps<"button"> & Props;
|
|
||||||
|
|
||||||
export function Button(props: AnchorProps | ButtonProps) {
|
|
||||||
const {
|
|
||||||
className: customClassName = "",
|
|
||||||
variant = "primary",
|
|
||||||
children,
|
|
||||||
size = "md",
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
const variantClassNames = {
|
|
||||||
base: "inline-flex gap-2 items-center justify-center rounded-full overflow-hidden transition-colors",
|
|
||||||
primary:
|
|
||||||
"bg-purple-300 font-medium text-purple-950 px-4 py-2 rounded-full hover:bg-purple-200",
|
|
||||||
secondary:
|
|
||||||
"rounded-full bg-slate-100 font-medium text-slate-600 hover:bg-slate-200",
|
|
||||||
tertiary: "rounded-full bg-white text-purple-950 font-medium",
|
|
||||||
};
|
|
||||||
|
|
||||||
const sizeClassNames = {
|
|
||||||
sm: "py-1.5 px-3 text-sm",
|
|
||||||
md: "py-2 px-5",
|
|
||||||
lg: "py-2 md:py-2.5 px-6 md:text-lg",
|
|
||||||
};
|
|
||||||
|
|
||||||
const className = clsx(
|
|
||||||
customClassName,
|
|
||||||
variantClassNames.base,
|
|
||||||
variantClassNames[variant],
|
|
||||||
sizeClassNames[size],
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!!(props as AnchorProps).href) {
|
|
||||||
const anchorProps = props as AnchorProps;
|
|
||||||
return (
|
|
||||||
<Link href={anchorProps.href} className={className}>
|
|
||||||
{children}
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const buttonProps = props as ButtonProps;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<button {...buttonProps} className={className}>
|
|
||||||
{children}
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import clsx from "clsx";
|
|
||||||
|
|
||||||
export function Container({
|
|
||||||
children,
|
|
||||||
className,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
className?: string;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<div className={clsx("mx-auto max-w-4xl px-4", className)}>{children}</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { JazzAccount } from "@/schema";
|
|
||||||
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
|
|
||||||
|
|
||||||
const Jazz = createJazzReactApp({
|
|
||||||
AccountSchema: JazzAccount,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const { useAccount, useCoState } = Jazz;
|
|
||||||
|
|
||||||
export function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
|
||||||
const [auth, authState] = useDemoAuth();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Jazz.Provider
|
|
||||||
auth={auth}
|
|
||||||
// replace `you@example.com` with your email as a temporary API key
|
|
||||||
peer="wss://cloud.jazz.tools/?key=you@example.com"
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Jazz.Provider>
|
|
||||||
{authState.state !== "signedIn" && (
|
|
||||||
<DemoAuthBasicUI appName="Jazz Book Shelf" state={authState} />
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { Button } from "@/components/Button";
|
|
||||||
import { Container } from "@/components/Container";
|
|
||||||
import { useAccount } from "@/components/JazzAndAuth";
|
|
||||||
import Link from "next/link";
|
|
||||||
|
|
||||||
export function Nav() {
|
|
||||||
const { me, logOut } = useAccount();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<nav className="border-b py-3">
|
|
||||||
<Container className="flex items-center justify-between gap-12 text-sm">
|
|
||||||
<Link href="/" className="font-serif text-lg font-semibold">
|
|
||||||
Jazz Book Shelf
|
|
||||||
</Link>
|
|
||||||
<div className="flex items-center gap-4 text-sm">
|
|
||||||
<p>{me?.profile?.name}</p>
|
|
||||||
<Button variant="secondary" onClick={logOut}>
|
|
||||||
Log out
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</Container>
|
|
||||||
</nav>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import StarIcon from "@/components/icons/StarIcon";
|
|
||||||
import StarOutlineIcon from "@/components/icons/StarOutlineIcon";
|
|
||||||
|
|
||||||
export default function Rating({
|
|
||||||
rating,
|
|
||||||
className = "",
|
|
||||||
}: {
|
|
||||||
rating?: number;
|
|
||||||
className?: string;
|
|
||||||
}) {
|
|
||||||
const max = 5;
|
|
||||||
const outline = max - (rating || 0);
|
|
||||||
return (
|
|
||||||
<div className={`inline-flex gap-0.5 text-yellow-400 ${className}`}>
|
|
||||||
{rating ? [...Array(rating)].map((x, i) => <StarIcon key={i} />) : <></>}
|
|
||||||
{[...Array(outline)].map((x, i) => (
|
|
||||||
<StarOutlineIcon key={i} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import StarIcon from "@/components/icons/StarIcon";
|
|
||||||
import StarOutlineIcon from "@/components/icons/StarOutlineIcon";
|
|
||||||
import clsx from "clsx";
|
|
||||||
|
|
||||||
interface RatingInputProps {
|
|
||||||
value?: number;
|
|
||||||
onChange: (value: number) => void;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function RatingInput({
|
|
||||||
value = 0,
|
|
||||||
onChange,
|
|
||||||
className,
|
|
||||||
}: RatingInputProps) {
|
|
||||||
const handleChange = (newRating: number) => {
|
|
||||||
onChange(newRating > 5 ? 5 : newRating);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={clsx(className, "flex gap-0.5 text-2xl text-yellow-400")}>
|
|
||||||
{[...Array(5)].map((_, i) => {
|
|
||||||
return i < value ? (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="focus:outline-none"
|
|
||||||
onClick={() => handleChange(i + 1)}
|
|
||||||
key={i}
|
|
||||||
>
|
|
||||||
<StarIcon />
|
|
||||||
</button>
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="focus:outline-none"
|
|
||||||
onClick={() => handleChange(i + 1)}
|
|
||||||
key={i}
|
|
||||||
>
|
|
||||||
<StarOutlineIcon />
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { BookReviewThumbnail } from "@/components/BookReviewThumbnail";
|
|
||||||
import { Button } from "@/components/Button";
|
|
||||||
import { useCoState } from "@/components/JazzAndAuth";
|
|
||||||
import { JazzAccount, JazzProfile, ListOfBookReviews } from "@/schema";
|
|
||||||
import { Group, ID } from "jazz-tools";
|
|
||||||
|
|
||||||
export default function UserProfile({ id }: { id: ID<JazzAccount> }) {
|
|
||||||
const user = useCoState(JazzAccount, id);
|
|
||||||
const profile = useCoState(JazzProfile, user?.profile?.id);
|
|
||||||
|
|
||||||
const bookReviews = useCoState(
|
|
||||||
ListOfBookReviews,
|
|
||||||
user?.profile?._refs.bookReviews?.id,
|
|
||||||
[{}],
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="grid gap-4">
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<h1 className="font-serif text-lg font-medium sm:text-2xl">
|
|
||||||
{profile?.name}'s book shelf
|
|
||||||
</h1>
|
|
||||||
{profile?._owner.castAs(Group).myRole() === "admin" && (
|
|
||||||
<Button href="/add" variant="primary">
|
|
||||||
Add book
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="grid gap-4 md:grid-cols-4">
|
|
||||||
{bookReviews?.map((bookReview) => (
|
|
||||||
<BookReviewThumbnail key={bookReview.id} id={bookReview.id} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
export default function StarIcon({ className }: { className?: string }) {
|
|
||||||
return (
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="currentColor"
|
|
||||||
className={className}
|
|
||||||
width="1em"
|
|
||||||
height="1em"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
fillRule="evenodd"
|
|
||||||
d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z"
|
|
||||||
clipRule="evenodd"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
export default function StarOutlineIcon({ className }: { className?: string }) {
|
|
||||||
return (
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
fill="none"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
strokeWidth={1.5}
|
|
||||||
stroke="currentColor"
|
|
||||||
className={className}
|
|
||||||
width="1em"
|
|
||||||
height="1em"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
d="M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
import {
|
|
||||||
Account,
|
|
||||||
CoList,
|
|
||||||
CoMap,
|
|
||||||
Encoders,
|
|
||||||
ImageDefinition,
|
|
||||||
Profile,
|
|
||||||
co,
|
|
||||||
} from "jazz-tools";
|
|
||||||
|
|
||||||
export class BookReview extends CoMap {
|
|
||||||
title = co.string;
|
|
||||||
author = co.string;
|
|
||||||
rating = co.number;
|
|
||||||
dateRead? = co.encoded(Encoders.Date);
|
|
||||||
review? = co.string;
|
|
||||||
cover? = co.ref(ImageDefinition, { optional: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ListOfBookReviews extends CoList.Of(co.ref(BookReview)) {}
|
|
||||||
|
|
||||||
/** The profile is an app-specific per-user public `CoMap`
|
|
||||||
* where you can store top-level objects for that user */
|
|
||||||
export class JazzProfile extends Profile {
|
|
||||||
bookReviews = co.ref(ListOfBookReviews);
|
|
||||||
}
|
|
||||||
|
|
||||||
export class JazzAccount extends Account {
|
|
||||||
profile = co.ref(JazzProfile);
|
|
||||||
|
|
||||||
/** The account migration is run on account creation and on every log-in.
|
|
||||||
* You can use it to set up the account root and any other initial CoValues you need.
|
|
||||||
*/
|
|
||||||
migrate(this: JazzAccount, creationProps?: { name: string }) {
|
|
||||||
super.migrate(creationProps);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import type { Config } from "tailwindcss";
|
|
||||||
const colors = require("tailwindcss/colors");
|
|
||||||
|
|
||||||
const config: Config = {
|
|
||||||
content: [
|
|
||||||
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
|
|
||||||
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
|
|
||||||
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
|
|
||||||
],
|
|
||||||
theme: {
|
|
||||||
extend: {
|
|
||||||
fontFamily: {
|
|
||||||
serif: ["var(--font-fraunces)"],
|
|
||||||
},
|
|
||||||
colors: {
|
|
||||||
purple: {
|
|
||||||
...colors.purple,
|
|
||||||
950: "#211f5a",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: [],
|
|
||||||
};
|
|
||||||
export default config;
|
|
||||||
@@ -1 +1 @@
|
|||||||
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_ZXZpZGVudC1kYW5lLTg5LmNsZXJrLmFjY291bnRzLmRldiQ
|
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_ZXZpZGVudC1kYW5lLTg5LmNsZXJrLmFjY291bnRzLmRldiQ
|
||||||
|
|||||||
@@ -1,5 +1,379 @@
|
|||||||
# chat-rn-clerk
|
# chat-rn-clerk
|
||||||
|
|
||||||
|
## 1.0.66
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5a63cba]
|
||||||
|
- jazz-tools@0.10.1
|
||||||
|
- jazz-react-native@0.10.1
|
||||||
|
- jazz-react-native-auth-clerk@0.10.1
|
||||||
|
- jazz-react-native-media-images@0.10.1
|
||||||
|
|
||||||
|
## 1.0.65
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [498954f]
|
||||||
|
- Updated dependencies [d42c2aa]
|
||||||
|
- Updated dependencies [dd03464]
|
||||||
|
- Updated dependencies [b426342]
|
||||||
|
- jazz-react-native-auth-clerk@0.10.0
|
||||||
|
- jazz-react-native@0.10.0
|
||||||
|
- jazz-tools@0.10.0
|
||||||
|
- jazz-react-native-media-images@0.10.0
|
||||||
|
|
||||||
|
## 1.0.64
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.23
|
||||||
|
- jazz-react-native-auth-clerk@0.9.23
|
||||||
|
- jazz-tools@0.9.23
|
||||||
|
- jazz-react-native-media-images@0.9.23
|
||||||
|
|
||||||
|
## 1.0.63
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.22
|
||||||
|
- jazz-react-native-auth-clerk@0.9.22
|
||||||
|
|
||||||
|
## 1.0.62
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1be017d]
|
||||||
|
- jazz-tools@0.9.21
|
||||||
|
- jazz-react-native@0.9.21
|
||||||
|
- jazz-react-native-auth-clerk@0.9.21
|
||||||
|
- jazz-react-native-media-images@0.9.21
|
||||||
|
|
||||||
|
## 1.0.61
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b01cc1f]
|
||||||
|
- jazz-tools@0.9.20
|
||||||
|
- jazz-react-native@0.9.20
|
||||||
|
- jazz-react-native-auth-clerk@0.9.20
|
||||||
|
- jazz-react-native-media-images@0.9.20
|
||||||
|
|
||||||
|
## 1.0.60
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.19
|
||||||
|
- jazz-react-native-auth-clerk@0.9.19
|
||||||
|
- jazz-tools@0.9.19
|
||||||
|
- jazz-react-native-media-images@0.9.19
|
||||||
|
|
||||||
|
## 1.0.59
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.18
|
||||||
|
- jazz-react-native-auth-clerk@0.9.18
|
||||||
|
- jazz-tools@0.9.18
|
||||||
|
- jazz-react-native-media-images@0.9.18
|
||||||
|
|
||||||
|
## 1.0.58
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c2ca1fe]
|
||||||
|
- Updated dependencies [1227047]
|
||||||
|
- jazz-tools@0.9.17
|
||||||
|
- jazz-react-native@0.9.17
|
||||||
|
- jazz-react-native-auth-clerk@0.9.17
|
||||||
|
- jazz-react-native-media-images@0.9.17
|
||||||
|
|
||||||
|
## 1.0.57
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [24b3b6a]
|
||||||
|
- jazz-react-native-auth-clerk@0.9.16
|
||||||
|
- jazz-tools@0.9.16
|
||||||
|
- jazz-react-native@0.9.16
|
||||||
|
- jazz-react-native-media-images@0.9.16
|
||||||
|
|
||||||
|
## 1.0.56
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7491711]
|
||||||
|
- jazz-tools@0.9.15
|
||||||
|
- jazz-react-native@0.9.15
|
||||||
|
- jazz-react-native-auth-clerk@0.9.15
|
||||||
|
- jazz-react-native-media-images@0.9.15
|
||||||
|
|
||||||
|
## 1.0.55
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3df93cc]
|
||||||
|
- jazz-tools@0.9.14
|
||||||
|
- jazz-react-native@0.9.14
|
||||||
|
- jazz-react-native-auth-clerk@0.9.14
|
||||||
|
- jazz-react-native-media-images@0.9.14
|
||||||
|
|
||||||
|
## 1.0.54
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.13
|
||||||
|
- jazz-react-native-auth-clerk@0.9.13
|
||||||
|
- jazz-tools@0.9.13
|
||||||
|
- jazz-react-native-media-images@0.9.13
|
||||||
|
|
||||||
|
## 1.0.53
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.12
|
||||||
|
- jazz-react-native-auth-clerk@0.9.12
|
||||||
|
- jazz-tools@0.9.12
|
||||||
|
- jazz-react-native-media-images@0.9.12
|
||||||
|
|
||||||
|
## 1.0.52
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.11
|
||||||
|
- jazz-react-native-auth-clerk@0.9.11
|
||||||
|
- jazz-tools@0.9.11
|
||||||
|
- jazz-react-native-media-images@0.9.11
|
||||||
|
|
||||||
|
## 1.0.51
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- f76274c: Fix image handling in react-native
|
||||||
|
- Updated dependencies [f76274c]
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react-native@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-react-native-auth-clerk@0.9.10
|
||||||
|
- jazz-react-native-media-images@0.9.10
|
||||||
|
|
||||||
|
## 1.0.50
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8eb9247]
|
||||||
|
- jazz-tools@0.9.9
|
||||||
|
- jazz-react-native@0.9.9
|
||||||
|
- jazz-react-native-auth-clerk@0.9.9
|
||||||
|
- jazz-react-native-media-images@0.9.9
|
||||||
|
|
||||||
|
## 1.0.49
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [d1d773b]
|
||||||
|
- jazz-tools@0.9.8
|
||||||
|
- jazz-react-native@0.9.8
|
||||||
|
- jazz-react-native-auth-clerk@0.9.8
|
||||||
|
- jazz-react-native-media-images@0.9.8
|
||||||
|
|
||||||
|
## 1.0.48
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8a390d2]
|
||||||
|
- jazz-react-native@0.9.6
|
||||||
|
- jazz-react-native-auth-clerk@0.9.6
|
||||||
|
|
||||||
|
## 1.0.47
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c871912]
|
||||||
|
- jazz-react-native@0.9.5
|
||||||
|
- jazz-react-native-auth-clerk@0.9.5
|
||||||
|
|
||||||
|
## 1.0.46
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.4
|
||||||
|
- jazz-react-native-auth-clerk@0.9.4
|
||||||
|
|
||||||
|
## 1.0.45
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7cd691f]
|
||||||
|
- jazz-react-native@0.9.3
|
||||||
|
- jazz-react-native-auth-clerk@0.9.3
|
||||||
|
|
||||||
|
## 1.0.44
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [80fd3e9]
|
||||||
|
- jazz-react-native@0.9.2
|
||||||
|
- jazz-react-native-auth-clerk@0.9.2
|
||||||
|
|
||||||
|
## 1.0.43
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1b71969]
|
||||||
|
- jazz-tools@0.9.1
|
||||||
|
- jazz-react-native@0.9.1
|
||||||
|
- jazz-react-native-auth-clerk@0.9.1
|
||||||
|
- jazz-react-native-media-images@0.9.1
|
||||||
|
|
||||||
|
## 1.0.42
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1da4d55]
|
||||||
|
- Updated dependencies [8eda792]
|
||||||
|
- Updated dependencies [1e5e3a1]
|
||||||
|
- jazz-react-native@0.9.0
|
||||||
|
- jazz-tools@0.9.0
|
||||||
|
- jazz-react-native-auth-clerk@0.9.0
|
||||||
|
- jazz-react-native-media-images@0.9.0
|
||||||
|
|
||||||
|
## 1.0.41
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [dc62b95]
|
||||||
|
- Updated dependencies [1de26f8]
|
||||||
|
- jazz-tools@0.8.51
|
||||||
|
- jazz-react-native@0.8.51
|
||||||
|
- jazz-react-native-auth-clerk@0.8.51
|
||||||
|
- jazz-react-native-media-images@0.8.51
|
||||||
|
|
||||||
|
## 1.0.40
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.50
|
||||||
|
- jazz-react-native-auth-clerk@0.8.50
|
||||||
|
- jazz-tools@0.8.50
|
||||||
|
- jazz-react-native-media-images@0.8.50
|
||||||
|
|
||||||
|
## 1.0.39
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.49
|
||||||
|
- jazz-react-native-auth-clerk@0.8.49
|
||||||
|
- jazz-tools@0.8.49
|
||||||
|
- jazz-react-native-media-images@0.8.49
|
||||||
|
|
||||||
|
## 1.0.38
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [635e824]
|
||||||
|
- Updated dependencies [0a85982]
|
||||||
|
- jazz-tools@0.8.48
|
||||||
|
- jazz-react-native@0.8.48
|
||||||
|
- jazz-react-native-auth-clerk@0.8.48
|
||||||
|
- jazz-react-native-media-images@0.8.48
|
||||||
|
|
||||||
|
## 1.0.37
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [33ef9c4]
|
||||||
|
- jazz-react-native@0.8.47
|
||||||
|
- jazz-react-native-auth-clerk@0.8.47
|
||||||
|
|
||||||
|
## 1.0.36
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ab4ffbd]
|
||||||
|
- jazz-react-native@0.8.46
|
||||||
|
- jazz-react-native-auth-clerk@0.8.46
|
||||||
|
|
||||||
|
## 1.0.35
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7701307]
|
||||||
|
- Updated dependencies [fa41f8e]
|
||||||
|
- Updated dependencies [88d7d9a]
|
||||||
|
- Updated dependencies [60e35ea]
|
||||||
|
- jazz-react-native@0.8.45
|
||||||
|
- jazz-tools@0.8.45
|
||||||
|
- jazz-react-native-auth-clerk@0.8.45
|
||||||
|
- jazz-react-native-media-images@0.8.45
|
||||||
|
|
||||||
|
## 1.0.34
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.44
|
||||||
|
- jazz-react-native-auth-clerk@0.8.44
|
||||||
|
- jazz-tools@0.8.44
|
||||||
|
- jazz-react-native-media-images@0.8.44
|
||||||
|
|
||||||
|
## 1.0.33
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- cdc7f9f: Fixing react-native examples
|
||||||
|
- Updated dependencies [cdc7f9f]
|
||||||
|
- jazz-react-native-auth-clerk@0.8.43
|
||||||
|
|
||||||
|
## 1.0.32
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.41
|
||||||
|
- jazz-react-native-auth-clerk@0.8.41
|
||||||
|
- jazz-tools@0.8.41
|
||||||
|
- jazz-react-native-media-images@0.8.41
|
||||||
|
|
||||||
|
## 1.0.31
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [0c6b0f3]
|
||||||
|
- Updated dependencies [249eecb]
|
||||||
|
- jazz-react-native@0.8.39
|
||||||
|
- jazz-tools@0.8.39
|
||||||
|
- jazz-react-native-auth-clerk@0.8.39
|
||||||
|
- jazz-react-native-media-images@0.8.39
|
||||||
|
|
||||||
|
## 1.0.30
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.38
|
||||||
|
- jazz-react-native-auth-clerk@0.8.38
|
||||||
|
- jazz-tools@0.8.38
|
||||||
|
- jazz-react-native-media-images@0.8.38
|
||||||
|
|
||||||
|
## 1.0.29
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.37
|
||||||
|
- jazz-react-native-auth-clerk@0.8.37
|
||||||
|
- jazz-tools@0.8.37
|
||||||
|
- jazz-react-native-media-images@0.8.28
|
||||||
|
|
||||||
|
## 1.0.28
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- c84764a: feat: added jazz-react-native-auth-clerk package
|
||||||
|
- Updated dependencies [c84764a]
|
||||||
|
- Updated dependencies [441fe27]
|
||||||
|
- jazz-react-native-auth-clerk@0.8.36
|
||||||
|
- jazz-react-native@0.8.36
|
||||||
|
- jazz-tools@0.8.36
|
||||||
|
- jazz-react-native-media-images@0.8.27
|
||||||
|
|
||||||
## 1.0.27
|
## 1.0.27
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -35,7 +35,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"expo-secure-store"
|
"expo-secure-store",
|
||||||
|
"expo-font",
|
||||||
|
"expo-router",
|
||||||
|
[
|
||||||
|
"expo-image-picker",
|
||||||
|
{
|
||||||
|
"photosPermission": "The app accesses your photos to let you share them with your friends."
|
||||||
|
}
|
||||||
|
]
|
||||||
],
|
],
|
||||||
"extra": {
|
"extra": {
|
||||||
"eas": {
|
"eas": {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Redirect, Stack } from "expo-router";
|
import { Redirect, Stack } from "expo-router";
|
||||||
|
import { useIsAuthenticated } from "jazz-react-native";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useAuth } from "../../src/auth-context";
|
|
||||||
|
|
||||||
export default function HomeLayout() {
|
export default function HomeLayout() {
|
||||||
const { isAuthenticated } = useAuth();
|
const isAuthenticated = useIsAuthenticated();
|
||||||
|
|
||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
return <Redirect href={"/chat"} />;
|
return <Redirect href={"/chat"} />;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Redirect, Stack } from "expo-router";
|
import { Redirect, Stack } from "expo-router";
|
||||||
import { useAuth } from "../../src/auth-context";
|
import { useIsAuthenticated } from "jazz-react-native";
|
||||||
|
|
||||||
export default function UnAuthenticatedLayout() {
|
export default function UnAuthenticatedLayout() {
|
||||||
const { isAuthenticated } = useAuth();
|
const isAuthenticated = useIsAuthenticated();
|
||||||
|
|
||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
return <Redirect href={"/chat"} />;
|
return <Redirect href={"/chat"} />;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import "../global.css";
|
||||||
import { ClerkLoaded, ClerkProvider } from "@clerk/clerk-expo";
|
import { ClerkLoaded, ClerkProvider } from "@clerk/clerk-expo";
|
||||||
import { useFonts } from "expo-font";
|
import { useFonts } from "expo-font";
|
||||||
import { Slot } from "expo-router";
|
import { Slot } from "expo-router";
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import { useAccount, useCoState } from "@/src/jazz";
|
|
||||||
import { Chat, Message } from "@/src/schema";
|
import { Chat, Message } from "@/src/schema";
|
||||||
import { useFocusEffect, useNavigation } from "@react-navigation/native";
|
import { useNavigation } from "@react-navigation/native";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import * as Clipboard from "expo-clipboard";
|
import * as Clipboard from "expo-clipboard";
|
||||||
|
import * as ImagePicker from "expo-image-picker";
|
||||||
import { useLocalSearchParams } from "expo-router";
|
import { useLocalSearchParams } from "expo-router";
|
||||||
|
import { useAccount, useCoState } from "jazz-react-native";
|
||||||
|
import { ProgressiveImg } from "jazz-react-native";
|
||||||
|
import { createImage } from "jazz-react-native-media-images";
|
||||||
import { Group, ID } from "jazz-tools";
|
import { Group, ID } from "jazz-tools";
|
||||||
import { useEffect, useLayoutEffect, useState } from "react";
|
import { useEffect, useLayoutEffect, useState } from "react";
|
||||||
import React, {
|
import React, {
|
||||||
@@ -16,6 +19,8 @@ import React, {
|
|||||||
KeyboardAvoidingView,
|
KeyboardAvoidingView,
|
||||||
TextInput,
|
TextInput,
|
||||||
Button,
|
Button,
|
||||||
|
Image,
|
||||||
|
ActivityIndicator,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
|
|
||||||
export default function Conversation() {
|
export default function Conversation() {
|
||||||
@@ -25,6 +30,7 @@ export default function Conversation() {
|
|||||||
const [message, setMessage] = useState("");
|
const [message, setMessage] = useState("");
|
||||||
const loadedChat = useCoState(Chat, chat?.id, [{}]);
|
const loadedChat = useCoState(Chat, chat?.id, [{}]);
|
||||||
const navigation = useNavigation();
|
const navigation = useNavigation();
|
||||||
|
const [isUploading, setIsUploading] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (chat) return;
|
if (chat) return;
|
||||||
@@ -81,6 +87,32 @@ export default function Conversation() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleImageUpload = async () => {
|
||||||
|
try {
|
||||||
|
const result = await ImagePicker.launchImageLibraryAsync({
|
||||||
|
mediaTypes: ImagePicker.MediaTypeOptions.Images,
|
||||||
|
base64: true,
|
||||||
|
quality: 0.7,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!result.canceled && result.assets[0].base64 && chat) {
|
||||||
|
setIsUploading(true);
|
||||||
|
const base64Uri = `data:image/jpeg;base64,${result.assets[0].base64}`;
|
||||||
|
|
||||||
|
const image = await createImage(base64Uri, {
|
||||||
|
owner: chat._owner,
|
||||||
|
maxSize: 2048,
|
||||||
|
});
|
||||||
|
|
||||||
|
chat.push(Message.create({ text: "", image }, { owner: chat._owner }));
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
Alert.alert("Error", "Failed to upload image");
|
||||||
|
} finally {
|
||||||
|
setIsUploading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const renderMessageItem = ({ item }: { item: Message }) => {
|
const renderMessageItem = ({ item }: { item: Message }) => {
|
||||||
const isMe = item._edits.text.by?.isMe;
|
const isMe = item._edits.text.by?.isMe;
|
||||||
return (
|
return (
|
||||||
@@ -106,14 +138,27 @@ export default function Conversation() {
|
|||||||
isMe ? "flex-row" : "flex-row",
|
isMe ? "flex-row" : "flex-row",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Text
|
{item.image && (
|
||||||
className={clsx(
|
<ProgressiveImg image={item.image} maxWidth={1024}>
|
||||||
!isMe ? "text-black" : "text-gray-200",
|
{({ src, res, originalSize }) => (
|
||||||
`text-md max-w-[85%]`,
|
<Image
|
||||||
)}
|
source={{ uri: src }}
|
||||||
>
|
className="w-48 h-48 rounded-lg mb-2"
|
||||||
{item.text}
|
resizeMode="cover"
|
||||||
</Text>
|
/>
|
||||||
|
)}
|
||||||
|
</ProgressiveImg>
|
||||||
|
)}
|
||||||
|
{item.text && (
|
||||||
|
<Text
|
||||||
|
className={clsx(
|
||||||
|
!isMe ? "text-black" : "text-gray-200",
|
||||||
|
`text-md max-w-[85%]`,
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{item.text}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
<Text
|
<Text
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"text-[10px] text-right ml-2",
|
"text-[10px] text-right ml-2",
|
||||||
@@ -147,6 +192,17 @@ export default function Conversation() {
|
|||||||
className="p-3 bg-white border-t border-gray-300"
|
className="p-3 bg-white border-t border-gray-300"
|
||||||
>
|
>
|
||||||
<SafeAreaView className="flex-row items-center gap-2">
|
<SafeAreaView className="flex-row items-center gap-2">
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={handleImageUpload}
|
||||||
|
disabled={isUploading}
|
||||||
|
className="h-10 w-10 items-center justify-center"
|
||||||
|
>
|
||||||
|
{isUploading ? (
|
||||||
|
<ActivityIndicator size="small" color="#0000ff" />
|
||||||
|
) : (
|
||||||
|
<Text className="text-2xl">🖼️</Text>
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
<TextInput
|
<TextInput
|
||||||
className="flex-1 rounded-full h-10 px-4 bg-gray-100 border border-gray-300 focus:border-blue-500 focus:bg-white"
|
className="flex-1 rounded-full h-10 px-4 bg-gray-100 border border-gray-300 focus:border-blue-500 focus:bg-white"
|
||||||
value={message}
|
value={message}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import React, {
|
|||||||
} from "react-native";
|
} from "react-native";
|
||||||
|
|
||||||
import { useUser } from "@clerk/clerk-expo";
|
import { useUser } from "@clerk/clerk-expo";
|
||||||
import { useAccount } from "../../src/jazz";
|
import { useAccount } from "jazz-react-native";
|
||||||
import { Chat } from "../../src/schema";
|
import { Chat } from "../../src/schema";
|
||||||
|
|
||||||
export default function ChatScreen() {
|
export default function ChatScreen() {
|
||||||
@@ -20,10 +20,15 @@ export default function ChatScreen() {
|
|||||||
const navigation = useNavigation();
|
const navigation = useNavigation();
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
|
|
||||||
|
function handleLogOut() {
|
||||||
|
logOut();
|
||||||
|
router.navigate("/");
|
||||||
|
}
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
navigation.setOptions({
|
navigation.setOptions({
|
||||||
headerTitle: "Chat",
|
headerTitle: "Chat",
|
||||||
headerRight: () => <Button onPress={logOut} title="Logout" />,
|
headerRight: () => <Button onPress={handleLogOut} title="Logout" />,
|
||||||
});
|
});
|
||||||
}, [navigation]);
|
}, [navigation]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
module.exports = function (api) {
|
module.exports = function (api) {
|
||||||
api.cache(true);
|
api.cache(true);
|
||||||
return {
|
return {
|
||||||
presets: ["babel-preset-expo"],
|
presets: [
|
||||||
plugins: ["nativewind/babel"],
|
["babel-preset-expo", { jsxImportSource: "nativewind" }],
|
||||||
|
"nativewind/babel",
|
||||||
|
],
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Platform } from "react-native";
|
|||||||
export interface TokenCache {
|
export interface TokenCache {
|
||||||
getToken: (key: string) => Promise<string | undefined | null>;
|
getToken: (key: string) => Promise<string | undefined | null>;
|
||||||
saveToken: (key: string, token: string) => Promise<void>;
|
saveToken: (key: string, token: string) => Promise<void>;
|
||||||
clearToken?: (key: string) => void;
|
clearToken: (key: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const createTokenCache = (): TokenCache => {
|
const createTokenCache = (): TokenCache => {
|
||||||
@@ -27,6 +27,9 @@ const createTokenCache = (): TokenCache => {
|
|||||||
saveToken: (key: string, token: string) => {
|
saveToken: (key: string, token: string) => {
|
||||||
return SecureStore.setItemAsync(key, token);
|
return SecureStore.setItemAsync(key, token);
|
||||||
},
|
},
|
||||||
|
clearToken: (key: string) => {
|
||||||
|
return SecureStore.deleteItemAsync(key);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
3
examples/chat-rn-clerk/global.css
Normal file
3
examples/chat-rn-clerk/global.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
// Learn more https://docs.expo.dev/guides/monorepos
|
// Learn more https://docs.expo.dev/guides/monorepos
|
||||||
const { getDefaultConfig } = require("expo/metro-config");
|
const { getDefaultConfig } = require("expo/metro-config");
|
||||||
|
const { withNativeWind } = require("nativewind/metro");
|
||||||
const { FileStore } = require("metro-cache");
|
const { FileStore } = require("metro-cache");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
@@ -18,8 +19,10 @@ config.resolver.nodeModulesPaths = [
|
|||||||
path.resolve(workspaceRoot, "node_modules"),
|
path.resolve(workspaceRoot, "node_modules"),
|
||||||
];
|
];
|
||||||
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
|
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
|
||||||
config.resolver.unstable_enablePackageExports = true;
|
config.resolver.requireCycleIgnorePatterns = [
|
||||||
config.resolver.requireCycleIgnorePatterns = [/(^|\/|\\)node_modules($|\/|\\)/];
|
/(^|\/|\\)node_modules($|\/|\\)/,
|
||||||
|
/(^|\/|\\)packages($|\/|\\)/,
|
||||||
|
];
|
||||||
|
|
||||||
// Use turborepo to restore the cache when possible
|
// Use turborepo to restore the cache when possible
|
||||||
config.cacheStores = [
|
config.cacheStores = [
|
||||||
@@ -28,4 +31,5 @@ config.cacheStores = [
|
|||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports = config;
|
// module.exports = config;
|
||||||
|
module.exports = withNativeWind(config, { input: "./global.css" });
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn-clerk",
|
"name": "chat-rn-clerk",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"version": "1.0.27",
|
"version": "1.0.66",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "expo export -p ios",
|
"build": "expo export -p ios",
|
||||||
"start": "expo start",
|
"start": "expo start",
|
||||||
@@ -17,62 +17,63 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
||||||
"@bam.tech/react-native-image-resizer": "^3.0.10",
|
"@bam.tech/react-native-image-resizer": "^3.0.11",
|
||||||
"@clerk/clerk-expo": "^2.2.21",
|
"@clerk/clerk-expo": "^2.2.21",
|
||||||
"@expo/vector-icons": "^14.0.2",
|
"@expo/vector-icons": "^14.0.2",
|
||||||
"@react-native-community/netinfo": "^11.3.1",
|
"@op-engineering/op-sqlite": "^11.2.12",
|
||||||
"@react-navigation/native": "^6.1.18",
|
"@react-native-community/netinfo": "^11.4.1",
|
||||||
"@react-navigation/native-stack": "^6.11.0",
|
"@react-navigation/native": "^7.0.13",
|
||||||
|
"@react-navigation/native-stack": "^7.1.14",
|
||||||
"base-64": "^1.0.0",
|
"base-64": "^1.0.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"expo": "~51.0.37",
|
"expo": "^52.0.0",
|
||||||
"expo-build-properties": "~0.12.5",
|
"expo-build-properties": "~0.13.1",
|
||||||
"expo-clipboard": "~6.0.3",
|
"expo-clipboard": "~7.0.0",
|
||||||
"expo-constants": "~16.0.2",
|
"expo-constants": "~17.0.3",
|
||||||
"expo-crypto": "~13.0.2",
|
"expo-crypto": "~14.0.1",
|
||||||
"expo-dev-client": "~4.0.28",
|
"expo-dev-client": "~5.0.5",
|
||||||
"expo-file-system": "^17.0.1",
|
"expo-file-system": "^18.0.4",
|
||||||
"expo-font": "~12.0.4",
|
"expo-font": "~13.0.1",
|
||||||
"expo-linking": "~6.3.1",
|
"expo-image-picker": "~16.0.4",
|
||||||
"expo-router": "~3.5.23",
|
"expo-linking": "~7.0.3",
|
||||||
"expo-secure-store": "~13.0.2",
|
"expo-router": "~4.0.11",
|
||||||
"expo-splash-screen": "~0.27.5",
|
"expo-secure-store": "~14.0.0",
|
||||||
"expo-status-bar": "~1.12.1",
|
"expo-splash-screen": "~0.29.16",
|
||||||
"expo-system-ui": "~3.0.7",
|
"expo-status-bar": "~2.0.0",
|
||||||
"expo-web-browser": "~13.0.3",
|
"expo-system-ui": "~4.0.5",
|
||||||
"jazz-react-auth-clerk": "workspace:*",
|
"expo-web-browser": "~14.0.1",
|
||||||
"jazz-react-native": "workspace:*",
|
"jazz-react-native": "workspace:*",
|
||||||
|
"jazz-react-native-auth-clerk": "workspace:*",
|
||||||
"jazz-react-native-media-images": "workspace:*",
|
"jazz-react-native-media-images": "workspace:*",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:*",
|
||||||
"nativewind": "^2.0.11",
|
"nativewind": "^4.1.21",
|
||||||
"react": "^18.2.0",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.3.1",
|
||||||
"react-native": "~0.74.5",
|
"react-native": "~0.76.3",
|
||||||
"react-native-fetch-api": "^3.0.0",
|
"react-native-fetch-api": "^3.0.0",
|
||||||
"react-native-gesture-handler": "~2.16.1",
|
"react-native-gesture-handler": "~2.20.2",
|
||||||
"react-native-get-random-values": "^1.11.0",
|
"react-native-get-random-values": "^1.11.0",
|
||||||
"react-native-mmkv": "3.0.1",
|
|
||||||
"react-native-polyfill-globals": "^3.1.0",
|
"react-native-polyfill-globals": "^3.1.0",
|
||||||
"react-native-quick-base64": "^2.1.2",
|
"react-native-quick-base64": "^2.1.2",
|
||||||
"react-native-reanimated": "~3.10.1",
|
"react-native-reanimated": "~3.16.3",
|
||||||
"react-native-safe-area-context": "4.10.5",
|
"react-native-safe-area-context": "4.12.0",
|
||||||
"react-native-screens": "3.31.1",
|
"react-native-screens": "4.1.0",
|
||||||
"react-native-url-polyfill": "^2.0.0",
|
"react-native-url-polyfill": "^2.0.0",
|
||||||
"react-native-web": "~0.19.10",
|
"react-native-web": "~0.19.13",
|
||||||
"text-encoding": "^0.7.0",
|
"text-encoding": "^0.7.0",
|
||||||
"web-streams-polyfill": "^3.2.1"
|
"web-streams-polyfill": "^3.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.0",
|
"@babel/core": "^7.20.0",
|
||||||
"@types/jest": "^29.5.3",
|
"@types/jest": "^29.5.3",
|
||||||
"@types/react": "^18.2.19",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-test-renderer": "^18.0.7",
|
"@types/react-test-renderer": "^18.0.7",
|
||||||
"jest": "^29.2.1",
|
"jest": "^29.2.1",
|
||||||
"jest-expo": "~51.0.3",
|
"jest-expo": "~52.0.2",
|
||||||
"react-test-renderer": "18.2.0",
|
"react-test-renderer": "18.2.0",
|
||||||
"tailwindcss": "3.3.2",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "^5.3.3"
|
"typescript": "~5.6.2"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
|||||||
1
examples/chat-rn-clerk/src/apiKey.ts
Normal file
1
examples/chat-rn-clerk/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const apiKey = "chat-rn-clerk-example-jazz@garden.co";
|
||||||
@@ -1,62 +1,21 @@
|
|||||||
import { useClerk, useUser } from "@clerk/clerk-expo";
|
import { useClerk } from "@clerk/clerk-expo";
|
||||||
import { useJazzClerkAuth } from "jazz-react-auth-clerk";
|
import { JazzProviderWithClerk } from "jazz-react-native-auth-clerk";
|
||||||
import React, {
|
import React, { PropsWithChildren } from "react";
|
||||||
useContext,
|
import { apiKey } from "./apiKey";
|
||||||
createContext,
|
|
||||||
useEffect,
|
|
||||||
useState,
|
|
||||||
PropsWithChildren,
|
|
||||||
} from "react";
|
|
||||||
import { Text, View } from "react-native";
|
|
||||||
import { Jazz } from "./jazz";
|
|
||||||
|
|
||||||
const AuthContext = createContext<{
|
|
||||||
isAuthenticated: boolean;
|
|
||||||
isLoading: boolean;
|
|
||||||
}>({
|
|
||||||
isAuthenticated: false,
|
|
||||||
isLoading: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
export function useAuth() {
|
|
||||||
return useContext(AuthContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function JazzAndAuth({ children }: PropsWithChildren) {
|
export function JazzAndAuth({ children }: PropsWithChildren) {
|
||||||
const { isSignedIn, isLoaded: isClerkLoaded } = useUser();
|
|
||||||
const clerk = useClerk();
|
const clerk = useClerk();
|
||||||
const [auth, state] = useJazzClerkAuth(clerk);
|
|
||||||
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (isSignedIn && isClerkLoaded && auth) {
|
|
||||||
setIsAuthenticated(true);
|
|
||||||
} else {
|
|
||||||
setIsAuthenticated(false);
|
|
||||||
}
|
|
||||||
}, [isSignedIn, isClerkLoaded, auth]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthContext.Provider
|
<JazzProviderWithClerk
|
||||||
value={{ isAuthenticated, isLoading: !isClerkLoaded || !auth }}
|
clerk={clerk}
|
||||||
|
storage="sqlite"
|
||||||
|
sync={{
|
||||||
|
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||||
|
when: "signedUp", // This makes the app work in local mode when the user is not authenticated
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{state?.errors?.length > 0 &&
|
{children}
|
||||||
state.errors.map((error) => (
|
</JazzProviderWithClerk>
|
||||||
<View key={error}>
|
|
||||||
<Text style={{ color: "red" }}>{error}</Text>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
{auth ? (
|
|
||||||
<Jazz.Provider
|
|
||||||
auth={auth}
|
|
||||||
peer="wss://cloud.jazz.tools/?key=chat-rn-clerk-example-jazz@gcmp.io"
|
|
||||||
storage={undefined}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Jazz.Provider>
|
|
||||||
) : (
|
|
||||||
children
|
|
||||||
)}
|
|
||||||
</AuthContext.Provider>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
import { createJazzRNApp } from "jazz-react-native";
|
|
||||||
|
|
||||||
export const Jazz = createJazzRNApp();
|
|
||||||
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
|
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
import { CoList, CoMap, co } from "jazz-tools";
|
import { CoList, CoMap, ImageDefinition, co } from "jazz-tools";
|
||||||
|
|
||||||
export class Message extends CoMap {
|
export class Message extends CoMap {
|
||||||
text = co.string;
|
text = co.string;
|
||||||
|
image = co.optional.ref(ImageDefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Chat extends CoList.Of(co.ref(Message)) {}
|
export class Chat extends CoList.Of(co.ref(Message)) {}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
// NOTE: Update this to include the paths to all of your component files.
|
||||||
content: [
|
content: [
|
||||||
"./app/**/*.{js,jsx,ts,tsx}",
|
"./app/**/*.{js,jsx,ts,tsx}",
|
||||||
"./components/**/*.{js,jsx,ts,tsx}",
|
"./components/**/*.{js,jsx,ts,tsx}",
|
||||||
"./src/**/*.{js,jsx,ts,tsx}",
|
"./src/**/*.{js,jsx,ts,tsx}",
|
||||||
],
|
],
|
||||||
|
presets: [require("nativewind/preset")],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {},
|
extend: {},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
"@/*": ["./*"]
|
"@/*": ["./*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["**/*.ts", "**/*.tsx"]
|
"include": ["**/*.ts", "**/*.tsx", "nativewind-env.d.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,301 @@
|
|||||||
# chat-rn
|
# chat-rn
|
||||||
|
|
||||||
|
## 1.0.63
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5a63cba]
|
||||||
|
- jazz-tools@0.10.1
|
||||||
|
- jazz-react-native@0.10.1
|
||||||
|
|
||||||
|
## 1.0.62
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [498954f]
|
||||||
|
- Updated dependencies [d42c2aa]
|
||||||
|
- Updated dependencies [dd03464]
|
||||||
|
- Updated dependencies [b426342]
|
||||||
|
- jazz-react-native@0.10.0
|
||||||
|
- jazz-tools@0.10.0
|
||||||
|
|
||||||
|
## 1.0.61
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.23
|
||||||
|
- jazz-tools@0.9.23
|
||||||
|
|
||||||
|
## 1.0.60
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.22
|
||||||
|
|
||||||
|
## 1.0.59
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1be017d]
|
||||||
|
- jazz-tools@0.9.21
|
||||||
|
- jazz-react-native@0.9.21
|
||||||
|
|
||||||
|
## 1.0.58
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b01cc1f]
|
||||||
|
- jazz-tools@0.9.20
|
||||||
|
- jazz-react-native@0.9.20
|
||||||
|
|
||||||
|
## 1.0.57
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.19
|
||||||
|
- jazz-tools@0.9.19
|
||||||
|
|
||||||
|
## 1.0.56
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.18
|
||||||
|
- jazz-tools@0.9.18
|
||||||
|
|
||||||
|
## 1.0.55
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c2ca1fe]
|
||||||
|
- Updated dependencies [1227047]
|
||||||
|
- jazz-tools@0.9.17
|
||||||
|
- jazz-react-native@0.9.17
|
||||||
|
|
||||||
|
## 1.0.54
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [24b3b6a]
|
||||||
|
- jazz-tools@0.9.16
|
||||||
|
- jazz-react-native@0.9.16
|
||||||
|
|
||||||
|
## 1.0.53
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7491711]
|
||||||
|
- jazz-tools@0.9.15
|
||||||
|
- jazz-react-native@0.9.15
|
||||||
|
|
||||||
|
## 1.0.52
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3df93cc]
|
||||||
|
- jazz-tools@0.9.14
|
||||||
|
- jazz-react-native@0.9.14
|
||||||
|
|
||||||
|
## 1.0.51
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.13
|
||||||
|
- jazz-tools@0.9.13
|
||||||
|
|
||||||
|
## 1.0.50
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.12
|
||||||
|
- jazz-tools@0.9.12
|
||||||
|
|
||||||
|
## 1.0.49
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.11
|
||||||
|
- jazz-tools@0.9.11
|
||||||
|
|
||||||
|
## 1.0.48
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [f76274c]
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react-native@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
|
||||||
|
## 1.0.47
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8eb9247]
|
||||||
|
- jazz-tools@0.9.9
|
||||||
|
- jazz-react-native@0.9.9
|
||||||
|
|
||||||
|
## 1.0.46
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [d1d773b]
|
||||||
|
- jazz-tools@0.9.8
|
||||||
|
- jazz-react-native@0.9.8
|
||||||
|
|
||||||
|
## 1.0.45
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8a390d2]
|
||||||
|
- jazz-react-native@0.9.6
|
||||||
|
|
||||||
|
## 1.0.44
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c871912]
|
||||||
|
- jazz-react-native@0.9.5
|
||||||
|
|
||||||
|
## 1.0.43
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.4
|
||||||
|
|
||||||
|
## 1.0.42
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7cd691f]
|
||||||
|
- jazz-react-native@0.9.3
|
||||||
|
|
||||||
|
## 1.0.41
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [80fd3e9]
|
||||||
|
- jazz-react-native@0.9.2
|
||||||
|
|
||||||
|
## 1.0.40
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1b71969]
|
||||||
|
- jazz-tools@0.9.1
|
||||||
|
- jazz-react-native@0.9.1
|
||||||
|
|
||||||
|
## 1.0.39
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1da4d55]
|
||||||
|
- Updated dependencies [8eda792]
|
||||||
|
- Updated dependencies [1e5e3a1]
|
||||||
|
- jazz-react-native@0.9.0
|
||||||
|
- jazz-tools@0.9.0
|
||||||
|
|
||||||
|
## 1.0.38
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [dc62b95]
|
||||||
|
- Updated dependencies [1de26f8]
|
||||||
|
- jazz-tools@0.8.51
|
||||||
|
- jazz-react-native@0.8.51
|
||||||
|
|
||||||
|
## 1.0.37
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.50
|
||||||
|
- jazz-tools@0.8.50
|
||||||
|
|
||||||
|
## 1.0.36
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.49
|
||||||
|
- jazz-tools@0.8.49
|
||||||
|
|
||||||
|
## 1.0.35
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [635e824]
|
||||||
|
- Updated dependencies [0a85982]
|
||||||
|
- jazz-tools@0.8.48
|
||||||
|
- jazz-react-native@0.8.48
|
||||||
|
|
||||||
|
## 1.0.34
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [33ef9c4]
|
||||||
|
- jazz-react-native@0.8.47
|
||||||
|
|
||||||
|
## 1.0.33
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ab4ffbd]
|
||||||
|
- jazz-react-native@0.8.46
|
||||||
|
|
||||||
|
## 1.0.32
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7701307]
|
||||||
|
- Updated dependencies [fa41f8e]
|
||||||
|
- Updated dependencies [88d7d9a]
|
||||||
|
- Updated dependencies [60e35ea]
|
||||||
|
- jazz-react-native@0.8.45
|
||||||
|
- jazz-tools@0.8.45
|
||||||
|
|
||||||
|
## 1.0.31
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.44
|
||||||
|
- jazz-tools@0.8.44
|
||||||
|
|
||||||
|
## 1.0.30
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.41
|
||||||
|
- jazz-tools@0.8.41
|
||||||
|
|
||||||
|
## 1.0.29
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [0c6b0f3]
|
||||||
|
- Updated dependencies [249eecb]
|
||||||
|
- jazz-react-native@0.8.39
|
||||||
|
- jazz-tools@0.8.39
|
||||||
|
|
||||||
|
## 1.0.28
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.38
|
||||||
|
- jazz-tools@0.8.38
|
||||||
|
|
||||||
|
## 1.0.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.37
|
||||||
|
- jazz-tools@0.8.37
|
||||||
|
|
||||||
|
## 1.0.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c84764a]
|
||||||
|
- Updated dependencies [441fe27]
|
||||||
|
- jazz-react-native@0.8.36
|
||||||
|
- jazz-tools@0.8.36
|
||||||
|
|
||||||
## 1.0.25
|
## 1.0.25
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
module.exports = function (api) {
|
module.exports = function (api) {
|
||||||
api.cache(true);
|
api.cache(true);
|
||||||
return {
|
return {
|
||||||
presets: ["babel-preset-expo"],
|
presets: [
|
||||||
plugins: ["nativewind/babel"],
|
["babel-preset-expo", { jsxImportSource: "nativewind" }],
|
||||||
|
"nativewind/babel",
|
||||||
|
],
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
3
examples/chat-rn/global.css
Normal file
3
examples/chat-rn/global.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
// Learn more https://docs.expo.dev/guides/monorepos
|
// Learn more https://docs.expo.dev/guides/monorepos
|
||||||
const { getDefaultConfig } = require("expo/metro-config");
|
const { getDefaultConfig } = require("expo/metro-config");
|
||||||
|
const { withNativeWind } = require("nativewind/metro");
|
||||||
const { FileStore } = require("metro-cache");
|
const { FileStore } = require("metro-cache");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
@@ -7,7 +8,7 @@ const path = require("path");
|
|||||||
const projectRoot = __dirname;
|
const projectRoot = __dirname;
|
||||||
const workspaceRoot = path.resolve(projectRoot, "../..");
|
const workspaceRoot = path.resolve(projectRoot, "../..");
|
||||||
|
|
||||||
const config = getDefaultConfig(projectRoot);
|
const config = getDefaultConfig(projectRoot, { isCSSEnabled: true });
|
||||||
|
|
||||||
// Since we are using pnpm, we have to setup the monorepo manually for Metro
|
// Since we are using pnpm, we have to setup the monorepo manually for Metro
|
||||||
// #1 - Watch all files in the monorepo
|
// #1 - Watch all files in the monorepo
|
||||||
@@ -18,8 +19,10 @@ config.resolver.nodeModulesPaths = [
|
|||||||
path.resolve(workspaceRoot, "node_modules"),
|
path.resolve(workspaceRoot, "node_modules"),
|
||||||
];
|
];
|
||||||
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
|
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
|
||||||
config.resolver.unstable_enablePackageExports = true;
|
config.resolver.requireCycleIgnorePatterns = [
|
||||||
config.resolver.requireCycleIgnorePatterns = [/(^|\/|\\)node_modules($|\/|\\)/];
|
/(^|\/|\\)node_modules($|\/|\\)/,
|
||||||
|
/(^|\/|\\)packages($|\/|\\)/,
|
||||||
|
];
|
||||||
|
|
||||||
// Use turborepo to restore the cache when possible
|
// Use turborepo to restore the cache when possible
|
||||||
config.cacheStores = [
|
config.cacheStores = [
|
||||||
@@ -28,4 +31,5 @@ config.cacheStores = [
|
|||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports = config;
|
// module.exports = config;
|
||||||
|
module.exports = withNativeWind(config, { input: "./global.css" });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn",
|
"name": "chat-rn",
|
||||||
"version": "1.0.25",
|
"version": "1.0.63",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "expo export -p ios",
|
"build": "expo export -p ios",
|
||||||
@@ -13,41 +13,41 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
||||||
"@react-native-community/netinfo": "^11.3.1",
|
"@op-engineering/op-sqlite": "^11.2.12",
|
||||||
"@react-navigation/native": "^6.1.18",
|
"@react-native-community/netinfo": "^11.4.1",
|
||||||
"@react-navigation/native-stack": "^6.11.0",
|
"@react-navigation/native": "^7.0.13",
|
||||||
|
"@react-navigation/native-stack": "^7.1.14",
|
||||||
"base-64": "^1.0.0",
|
"base-64": "^1.0.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"expo": "~51.0.37",
|
"expo": "^52.0.0",
|
||||||
"expo-build-properties": "~0.12.5",
|
"expo-build-properties": "~0.13.1",
|
||||||
"expo-clipboard": "~6.0.3",
|
"expo-clipboard": "~7.0.0",
|
||||||
"expo-constants": "~16.0.2",
|
"expo-constants": "~17.0.3",
|
||||||
"expo-crypto": "~13.0.2",
|
"expo-crypto": "~14.0.1",
|
||||||
"expo-dev-client": "~4.0.28",
|
"expo-dev-client": "~5.0.5",
|
||||||
"expo-linking": "~6.3.1",
|
"expo-linking": "~7.0.3",
|
||||||
"expo-secure-store": "~13.0.2",
|
"expo-secure-store": "~14.0.0",
|
||||||
"expo-status-bar": "~1.12.1",
|
"expo-status-bar": "~2.0.0",
|
||||||
"expo-web-browser": "~13.0.3",
|
"expo-web-browser": "~14.0.1",
|
||||||
"jazz-react-native": "workspace:*",
|
"jazz-react-native": "workspace:*",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:*",
|
||||||
"nativewind": "^2.0.11",
|
"nativewind": "^4.1.21",
|
||||||
"react": "^18.2.0",
|
"react": "^18.3.1",
|
||||||
"react-native": "~0.74.5",
|
"react-native": "~0.76.3",
|
||||||
"react-native-fetch-api": "^3.0.0",
|
"react-native-fetch-api": "^3.0.0",
|
||||||
"react-native-get-random-values": "^1.11.0",
|
"react-native-get-random-values": "^1.11.0",
|
||||||
"react-native-mmkv": "3.0.1",
|
|
||||||
"react-native-polyfill-globals": "^3.1.0",
|
"react-native-polyfill-globals": "^3.1.0",
|
||||||
"react-native-safe-area-context": "4.10.5",
|
"react-native-safe-area-context": "4.12.0",
|
||||||
"react-native-screens": "3.31.1",
|
"react-native-screens": "4.1.0",
|
||||||
"react-native-url-polyfill": "^2.0.0",
|
"react-native-url-polyfill": "^2.0.0",
|
||||||
"text-encoding": "^0.7.0",
|
"text-encoding": "^0.7.0",
|
||||||
"web-streams-polyfill": "^3.2.1"
|
"web-streams-polyfill": "^3.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.0",
|
"@babel/core": "^7.20.0",
|
||||||
"@types/react": "^18.2.19",
|
"@types/react": "^18.3.12",
|
||||||
"tailwindcss": "3.3.2",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "^5.3.3"
|
"typescript": "~5.6.2"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import "../global.css";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
NavigationContainer,
|
NavigationContainer,
|
||||||
useNavigationContainerRef,
|
useNavigationContainerRef,
|
||||||
@@ -7,9 +9,9 @@ import * as Linking from "expo-linking";
|
|||||||
import React, { StrictMode, useEffect, useState } from "react";
|
import React, { StrictMode, useEffect, useState } from "react";
|
||||||
import HandleInviteScreen from "./invite";
|
import HandleInviteScreen from "./invite";
|
||||||
|
|
||||||
import { DemoAuthBasicUI, useDemoAuth } from "jazz-react-native";
|
import { JazzProvider } from "jazz-react-native";
|
||||||
|
import { apiKey } from "./apiKey";
|
||||||
import ChatScreen from "./chat";
|
import ChatScreen from "./chat";
|
||||||
import { Jazz } from "./jazz";
|
|
||||||
|
|
||||||
const Stack = createNativeStackNavigator();
|
const Stack = createNativeStackNavigator();
|
||||||
|
|
||||||
@@ -27,12 +29,10 @@ const linking = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const [auth, state] = useDemoAuth();
|
|
||||||
const [initialRoute, setInitialRoute] = useState<
|
const [initialRoute, setInitialRoute] = useState<
|
||||||
"ChatScreen" | "HandleInviteScreen"
|
"ChatScreen" | "HandleInviteScreen"
|
||||||
>("ChatScreen");
|
>("ChatScreen");
|
||||||
const navigationRef = useNavigationContainerRef();
|
const navigationRef = useNavigationContainerRef();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Linking.getInitialURL().then((url) => {
|
Linking.getInitialURL().then((url) => {
|
||||||
if (url) {
|
if (url) {
|
||||||
@@ -43,16 +43,13 @@ function App() {
|
|||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (!auth) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<Jazz.Provider
|
<JazzProvider
|
||||||
auth={auth}
|
storage="sqlite"
|
||||||
peer="wss://cloud.jazz.tools/?key=chat-rn-example-jazz@gcmp.io"
|
sync={{
|
||||||
storage={undefined}
|
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<NavigationContainer linking={linking} ref={navigationRef}>
|
<NavigationContainer linking={linking} ref={navigationRef}>
|
||||||
<Stack.Navigator initialRouteName={initialRoute}>
|
<Stack.Navigator initialRouteName={initialRoute}>
|
||||||
@@ -68,10 +65,7 @@ function App() {
|
|||||||
/>
|
/>
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
</Jazz.Provider>
|
</JazzProvider>
|
||||||
{state.state !== "signedIn" ? (
|
|
||||||
<DemoAuthBasicUI appName="Jazz Chat" state={state} />
|
|
||||||
) : null}
|
|
||||||
</StrictMode>
|
</StrictMode>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
1
examples/chat-rn/src/apiKey.ts
Normal file
1
examples/chat-rn/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const apiKey = "chat-rn-example-jazz@garden.co";
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import * as Clipboard from "expo-clipboard";
|
import * as Clipboard from "expo-clipboard";
|
||||||
import { Group, ID } from "jazz-tools";
|
import { Group, ID, Profile } from "jazz-tools";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import React, {
|
import React, {
|
||||||
Button,
|
Button,
|
||||||
@@ -14,50 +14,46 @@ import React, {
|
|||||||
Alert,
|
Alert,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
|
|
||||||
import { useAccount, useCoState } from "./jazz";
|
import { useAccount, useCoState } from "jazz-react-native";
|
||||||
import { Chat, Message } from "./schema";
|
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 [chat, setChat] = useState<Chat>();
|
const [chatId, setChatId] = useState<ID<Chat>>();
|
||||||
|
const loadedChat = useCoState(Chat, chatId, [{}]);
|
||||||
const [message, setMessage] = useState("");
|
const [message, setMessage] = useState("");
|
||||||
const loadedChat = useCoState(Chat, chat?.id, [{}]);
|
const profile = useCoState(Profile, me._refs.profile?.id, {});
|
||||||
|
|
||||||
|
function handleLogOut() {
|
||||||
|
setChatId(undefined);
|
||||||
|
logOut();
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
navigation.setOptions({
|
navigation.setOptions({
|
||||||
headerRight: () => <Button onPress={logOut} title="Logout" />,
|
headerRight: () => <Button onPress={handleLogOut} title="Logout" />,
|
||||||
headerLeft: () =>
|
headerLeft: () =>
|
||||||
chat ? (
|
loadedChat ? (
|
||||||
<Button
|
<Button
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (chat?.id) {
|
if (loadedChat?.id) {
|
||||||
Clipboard.setStringAsync(
|
Clipboard.setStringAsync(
|
||||||
`https://chat.jazz.tools/#/chat/${chat.id}`,
|
`https://chat.jazz.tools/#/chat/${loadedChat.id}`,
|
||||||
);
|
);
|
||||||
Alert.alert("Copied to clipboard", `Chat ID: ${chat.id}`);
|
Alert.alert("Copied to clipboard", `Chat ID: ${loadedChat.id}`);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
title="Share"
|
title="Share"
|
||||||
/>
|
/>
|
||||||
) : null,
|
) : null,
|
||||||
});
|
});
|
||||||
}, [navigation, chat]);
|
}, [navigation, loadedChat]);
|
||||||
|
|
||||||
const createChat = () => {
|
const createChat = () => {
|
||||||
const group = Group.create({ owner: me });
|
const group = Group.create({ owner: me });
|
||||||
group.addMember("everyone", "writer");
|
group.addMember("everyone", "writer");
|
||||||
const chat = Chat.create([], { owner: group });
|
const chat = Chat.create([], { owner: group });
|
||||||
setChat(chat);
|
setChatId(chat.id);
|
||||||
};
|
|
||||||
|
|
||||||
const loadChat = async (chatId: ID<Chat>) => {
|
|
||||||
try {
|
|
||||||
const chat = await Chat.load(chatId, me, []);
|
|
||||||
setChat(chat);
|
|
||||||
} catch (error) {
|
|
||||||
console.log("Error loading chat", error);
|
|
||||||
Alert.alert("Error", `Error loading chat: ${error}`);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const joinChat = () => {
|
const joinChat = () => {
|
||||||
@@ -73,7 +69,7 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
|||||||
text: "Join",
|
text: "Join",
|
||||||
onPress: (chatId) => {
|
onPress: (chatId) => {
|
||||||
if (chatId) {
|
if (chatId) {
|
||||||
loadChat(chatId as ID<Chat>);
|
setChatId(chatId as ID<Chat>);
|
||||||
} else {
|
} else {
|
||||||
Alert.alert("Error", "Chat ID cannot be empty.");
|
Alert.alert("Error", "Chat ID cannot be empty.");
|
||||||
}
|
}
|
||||||
@@ -85,9 +81,11 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sendMessage = () => {
|
const sendMessage = () => {
|
||||||
if (!chat) return;
|
if (!loadedChat) return;
|
||||||
if (message.trim()) {
|
if (message.trim()) {
|
||||||
chat.push(Message.create({ text: message }, { owner: chat._owner }));
|
loadedChat.push(
|
||||||
|
Message.create({ text: message }, { owner: loadedChat?._owner }),
|
||||||
|
);
|
||||||
setMessage("");
|
setMessage("");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -137,8 +135,21 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View className="flex flex-col h-full">
|
<View className="flex flex-col h-full">
|
||||||
{!chat ? (
|
{!loadedChat ? (
|
||||||
<View className="flex flex-col h-full items-center justify-center">
|
<View className="flex flex-col h-full items-center justify-center">
|
||||||
|
<Text className="text-m font-bold mb-6">Username</Text>
|
||||||
|
<TextInput
|
||||||
|
className="rounded h-12 p-2 mb-12 w-40 border border-gray-200 block"
|
||||||
|
value={profile?.name ?? ""}
|
||||||
|
onChangeText={(value) => {
|
||||||
|
if (profile) {
|
||||||
|
profile.name = value;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
textAlignVertical="center"
|
||||||
|
onSubmitEditing={sendMessage}
|
||||||
|
testID="username-input"
|
||||||
|
/>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={createChat}
|
onPress={createChat}
|
||||||
className="bg-blue-500 p-4 rounded-md"
|
className="bg-blue-500 p-4 rounded-md"
|
||||||
@@ -180,10 +191,12 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
|||||||
placeholder="Type a message..."
|
placeholder="Type a message..."
|
||||||
textAlignVertical="center"
|
textAlignVertical="center"
|
||||||
onSubmitEditing={sendMessage}
|
onSubmitEditing={sendMessage}
|
||||||
|
testID="message-input"
|
||||||
/>
|
/>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={sendMessage}
|
onPress={sendMessage}
|
||||||
className="bg-gray-300 text-white rounded-full h-8 w-8 items-center justify-center"
|
className="bg-gray-300 text-white rounded-full h-8 w-8 items-center justify-center"
|
||||||
|
testID="send-button"
|
||||||
>
|
>
|
||||||
<Text>↑</Text>
|
<Text>↑</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
|
import { useAcceptInvite } from "jazz-react-native";
|
||||||
import React, { Text } from "react-native";
|
import React, { Text } from "react-native";
|
||||||
import { useAcceptInvite } from "./jazz";
|
|
||||||
import { Chat } from "./schema";
|
import { Chat } from "./schema";
|
||||||
|
|
||||||
type ChatScreenParams = {
|
|
||||||
valueHint?: string;
|
|
||||||
valueID?: string;
|
|
||||||
inviteSecret?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function HandleInviteScreen({
|
export default function HandleInviteScreen({
|
||||||
navigation,
|
navigation,
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
import { createJazzRNApp } from "jazz-react-native";
|
|
||||||
|
|
||||||
export const Jazz = createJazzRNApp();
|
|
||||||
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
|
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
// NOTE: Update this to include the paths to all of your component files.
|
||||||
content: [
|
content: [
|
||||||
"./app/**/*.{js,jsx,ts,tsx}",
|
"./app/**/*.{js,jsx,ts,tsx}",
|
||||||
"./components/**/*.{js,jsx,ts,tsx}",
|
"./components/**/*.{js,jsx,ts,tsx}",
|
||||||
"./src/**/*.{js,jsx,ts,tsx}",
|
"./src/**/*.{js,jsx,ts,tsx}",
|
||||||
],
|
],
|
||||||
|
presets: [require("nativewind/preset")],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {},
|
extend: {},
|
||||||
},
|
},
|
||||||
|
|||||||
16
examples/chat-rn/test/e2e/erase_text.yml
Normal file
16
examples/chat-rn/test/e2e/erase_text.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# this sub-flow exists to work around an ios issue where the text field is not
|
||||||
|
# fully erased. The tap into the input field hits the middle, and clears all
|
||||||
|
# text to the left. If there's more to the right, it slides left, and thus we
|
||||||
|
# repeat this step. https://maestro.mobile.dev/api-reference/commands/erasetext
|
||||||
|
appId: com.jazz.chatrn
|
||||||
|
---
|
||||||
|
- copyTextFrom:
|
||||||
|
id: ${id}
|
||||||
|
- repeat:
|
||||||
|
times: 4
|
||||||
|
commands:
|
||||||
|
- tapOn:
|
||||||
|
id: ${id}
|
||||||
|
- eraseText
|
||||||
|
- copyTextFrom:
|
||||||
|
id: ${id}
|
||||||
47
examples/chat-rn/test/e2e/flow.yml
Normal file
47
examples/chat-rn/test/e2e/flow.yml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
appId: com.jazz.chatrn
|
||||||
|
---
|
||||||
|
- launchApp
|
||||||
|
|
||||||
|
# # handle Expo screens (for local dev)
|
||||||
|
# - assertVisible: "Continue"
|
||||||
|
# - tapOn: "Continue"
|
||||||
|
# - assertVisible: "Reload"
|
||||||
|
# - tapOn: "Reload"
|
||||||
|
|
||||||
|
# login
|
||||||
|
- assertVisible: "Anonymous user"
|
||||||
|
- runFlow:
|
||||||
|
label: "Erase existing username"
|
||||||
|
file: erase_text.yml
|
||||||
|
env:
|
||||||
|
id: "username-input"
|
||||||
|
- inputText: "boorad"
|
||||||
|
- assertVisible: "boorad"
|
||||||
|
|
||||||
|
# start new chat
|
||||||
|
- tapOn: "Start new chat"
|
||||||
|
- assertVisible: "Share"
|
||||||
|
- assertVisible: "Jazz Chat"
|
||||||
|
- assertVisible: "Logout"
|
||||||
|
|
||||||
|
# send a message
|
||||||
|
- runFlow:
|
||||||
|
label: "Erase existing message"
|
||||||
|
file: erase_text.yml
|
||||||
|
env:
|
||||||
|
id: "message-input"
|
||||||
|
- inputText: "bro, low key, it do be like that tho"
|
||||||
|
- tapOn:
|
||||||
|
id: "send-button"
|
||||||
|
- assertVisible: "bro, low key, it do be like that tho"
|
||||||
|
|
||||||
|
# get invite code
|
||||||
|
- tapOn: "Share"
|
||||||
|
- assertVisible: "Copied to clipboard"
|
||||||
|
- tapOn: "OK"
|
||||||
|
# this assert doesn't work. maestro.copiedText only populates from `copyTextFrom`
|
||||||
|
# - assertTrue: ${maestro.copiedText.startsWith("co_z")}
|
||||||
|
|
||||||
|
# logout
|
||||||
|
- tapOn: "Logout"
|
||||||
|
- assertVisible: "Anonymous user"
|
||||||
@@ -1,5 +1,290 @@
|
|||||||
# chat-vue
|
# chat-vue
|
||||||
|
|
||||||
|
## 0.0.50
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5a63cba]
|
||||||
|
- jazz-tools@0.10.1
|
||||||
|
- jazz-browser@0.10.1
|
||||||
|
- jazz-vue@0.10.1
|
||||||
|
|
||||||
|
## 0.0.49
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [498954f]
|
||||||
|
- Updated dependencies [d42c2aa]
|
||||||
|
- Updated dependencies [dd03464]
|
||||||
|
- Updated dependencies [b426342]
|
||||||
|
- jazz-browser@0.10.0
|
||||||
|
- jazz-tools@0.10.0
|
||||||
|
- jazz-vue@0.10.0
|
||||||
|
|
||||||
|
## 0.0.48
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.9.23
|
||||||
|
- jazz-tools@0.9.23
|
||||||
|
- jazz-vue@0.9.23
|
||||||
|
|
||||||
|
## 0.0.47
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.9.22
|
||||||
|
- jazz-vue@0.9.22
|
||||||
|
|
||||||
|
## 0.0.46
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1be017d]
|
||||||
|
- jazz-tools@0.9.21
|
||||||
|
- jazz-browser@0.9.21
|
||||||
|
- jazz-vue@0.9.21
|
||||||
|
|
||||||
|
## 0.0.45
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b01cc1f]
|
||||||
|
- jazz-tools@0.9.20
|
||||||
|
- jazz-browser@0.9.20
|
||||||
|
- jazz-vue@0.9.20
|
||||||
|
|
||||||
|
## 0.0.44
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.9.19
|
||||||
|
- jazz-tools@0.9.19
|
||||||
|
- jazz-vue@0.9.19
|
||||||
|
|
||||||
|
## 0.0.43
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.9.18
|
||||||
|
- jazz-tools@0.9.18
|
||||||
|
- jazz-vue@0.9.18
|
||||||
|
|
||||||
|
## 0.0.42
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c2ca1fe]
|
||||||
|
- Updated dependencies [1227047]
|
||||||
|
- jazz-tools@0.9.17
|
||||||
|
- jazz-browser@0.9.17
|
||||||
|
- jazz-vue@0.9.17
|
||||||
|
|
||||||
|
## 0.0.41
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [24b3b6a]
|
||||||
|
- jazz-tools@0.9.16
|
||||||
|
- jazz-browser@0.9.16
|
||||||
|
- jazz-vue@0.9.16
|
||||||
|
|
||||||
|
## 0.0.40
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7491711]
|
||||||
|
- jazz-tools@0.9.15
|
||||||
|
- jazz-browser@0.9.15
|
||||||
|
- jazz-vue@0.9.15
|
||||||
|
|
||||||
|
## 0.0.39
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3df93cc]
|
||||||
|
- jazz-tools@0.9.14
|
||||||
|
- jazz-browser@0.9.14
|
||||||
|
- jazz-vue@0.9.14
|
||||||
|
|
||||||
|
## 0.0.38
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.9.13
|
||||||
|
- jazz-tools@0.9.13
|
||||||
|
- jazz-vue@0.9.13
|
||||||
|
|
||||||
|
## 0.0.37
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.9.12
|
||||||
|
- jazz-tools@0.9.12
|
||||||
|
- jazz-vue@0.9.12
|
||||||
|
|
||||||
|
## 0.0.36
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.9.11
|
||||||
|
- jazz-tools@0.9.11
|
||||||
|
- jazz-vue@0.9.11
|
||||||
|
|
||||||
|
## 0.0.35
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser@0.9.10
|
||||||
|
- jazz-vue@0.9.10
|
||||||
|
|
||||||
|
## 0.0.34
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8eb9247]
|
||||||
|
- jazz-tools@0.9.9
|
||||||
|
- jazz-browser@0.9.9
|
||||||
|
- jazz-vue@0.9.9
|
||||||
|
|
||||||
|
## 0.0.33
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [d1d773b]
|
||||||
|
- jazz-tools@0.9.8
|
||||||
|
- jazz-browser@0.9.8
|
||||||
|
- jazz-vue@0.9.8
|
||||||
|
|
||||||
|
## 0.0.32
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1b71969]
|
||||||
|
- Updated dependencies [5d98189]
|
||||||
|
- jazz-browser@0.9.1
|
||||||
|
- jazz-tools@0.9.1
|
||||||
|
- jazz-vue@0.9.1
|
||||||
|
|
||||||
|
## 0.0.31
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [9dd8d95]
|
||||||
|
- Updated dependencies [8eda792]
|
||||||
|
- jazz-vue@0.9.0
|
||||||
|
- jazz-tools@0.9.0
|
||||||
|
- jazz-browser@0.9.0
|
||||||
|
|
||||||
|
## 0.0.30
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [dc62b95]
|
||||||
|
- Updated dependencies [1de26f8]
|
||||||
|
- jazz-tools@0.8.51
|
||||||
|
- jazz-browser@0.8.51
|
||||||
|
- jazz-vue@0.8.51
|
||||||
|
|
||||||
|
## 0.0.29
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.8.50
|
||||||
|
- jazz-tools@0.8.50
|
||||||
|
- jazz-vue@0.8.50
|
||||||
|
|
||||||
|
## 0.0.28
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.8.49
|
||||||
|
- jazz-tools@0.8.49
|
||||||
|
- jazz-vue@0.8.49
|
||||||
|
|
||||||
|
## 0.0.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [635e824]
|
||||||
|
- Updated dependencies [0a85982]
|
||||||
|
- jazz-tools@0.8.48
|
||||||
|
- jazz-browser@0.8.48
|
||||||
|
- jazz-vue@0.8.48
|
||||||
|
|
||||||
|
## 0.0.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [6f0bd7f]
|
||||||
|
- Updated dependencies [fa41f8e]
|
||||||
|
- Updated dependencies [88d7d9a]
|
||||||
|
- Updated dependencies [60e35ea]
|
||||||
|
- jazz-browser@0.8.45
|
||||||
|
- jazz-tools@0.8.45
|
||||||
|
- jazz-vue@0.8.45
|
||||||
|
|
||||||
|
## 0.0.25
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.8.44
|
||||||
|
- jazz-tools@0.8.44
|
||||||
|
- jazz-vue@0.8.44
|
||||||
|
|
||||||
|
## 0.0.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ac216b9]
|
||||||
|
- jazz-browser@0.8.41
|
||||||
|
- jazz-tools@0.8.41
|
||||||
|
- jazz-vue@0.8.41
|
||||||
|
|
||||||
|
## 0.0.23
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.8.40
|
||||||
|
- jazz-vue@0.8.40
|
||||||
|
|
||||||
|
## 0.0.22
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [e386f2b]
|
||||||
|
- Updated dependencies [249eecb]
|
||||||
|
- jazz-browser@0.8.39
|
||||||
|
- jazz-tools@0.8.39
|
||||||
|
- jazz-vue@0.8.39
|
||||||
|
|
||||||
|
## 0.0.21
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.8.38
|
||||||
|
- jazz-tools@0.8.38
|
||||||
|
- jazz-vue@0.8.38
|
||||||
|
|
||||||
|
## 0.0.20
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser@0.8.37
|
||||||
|
- jazz-tools@0.8.37
|
||||||
|
- jazz-vue@0.8.25
|
||||||
|
|
||||||
|
## 0.0.19
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [441fe27]
|
||||||
|
- jazz-tools@0.8.36
|
||||||
|
- jazz-browser@0.8.36
|
||||||
|
- jazz-vue@0.8.24
|
||||||
|
|
||||||
## 0.0.18
|
## 0.0.18
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,29 +1,55 @@
|
|||||||
# Chat example with Jazz and Vue
|
# Chat example with Jazz and Vue
|
||||||
|
|
||||||
## Installing & running the example locally
|
## Getting started
|
||||||
|
|
||||||
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
|
You can either
|
||||||
|
1. Clone the jazz repository, and run the app within the monorepo.
|
||||||
|
2. Or create a new Jazz project using this example as a template.
|
||||||
|
|
||||||
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
|
|
||||||
|
### Using the example as a template
|
||||||
|
|
||||||
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npx degit gardencmp/jazz jazz
|
npx create-jazz-app@latest --example chat-vue --project-name chat-vue
|
||||||
```
|
```
|
||||||
|
|
||||||
Go to the todo-vue example directory:
|
Go to the new project directory.
|
||||||
```bash
|
```bash
|
||||||
cd jazz/examples/chat-vue
|
cd chat-vue
|
||||||
```
|
```
|
||||||
|
|
||||||
Install and build dependencies:
|
Run the dev server.
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using the monorepo
|
||||||
|
|
||||||
|
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
|
||||||
|
|
||||||
|
Clone the jazz repository.
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/garden-co/jazz.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Install and build dependencies.
|
||||||
```bash
|
```bash
|
||||||
pnpm i && npx turbo build
|
pnpm i && npx turbo build
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the dev server:
|
Go to the example directory.
|
||||||
|
```bash
|
||||||
|
cd jazz/examples/chat-vue/
|
||||||
|
```
|
||||||
|
|
||||||
|
Start the dev server.
|
||||||
```bash
|
```bash
|
||||||
pnpm dev
|
pnpm dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
|
||||||
|
|
||||||
## Questions / problems / feedback
|
## Questions / problems / feedback
|
||||||
|
|
||||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-vue",
|
"name": "chat-vue",
|
||||||
"version": "0.0.18",
|
"version": "0.0.50",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -25,14 +25,14 @@
|
|||||||
"@vitejs/plugin-vue": "^5.1.4",
|
"@vitejs/plugin-vue": "^5.1.4",
|
||||||
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
||||||
"@vue/tsconfig": "^0.5.1",
|
"@vue/tsconfig": "^0.5.1",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.20",
|
||||||
"eslint": "^8.46.0",
|
"eslint": "^9.7.0",
|
||||||
"eslint-plugin-vue": "^9.28.0",
|
"eslint-plugin-vue": "^9.28.0",
|
||||||
"npm-run-all2": "^6.2.3",
|
"npm-run-all2": "^6.2.3",
|
||||||
"postcss": "^8.4.27",
|
"postcss": "^8.4.27",
|
||||||
"tailwindcss": "3.3.2",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "~5.6.2",
|
||||||
"vite": "^5.0.10",
|
"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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useAccount } from "jazz-vue";
|
||||||
import AppContainer from "./components/AppContainer.vue";
|
import AppContainer from "./components/AppContainer.vue";
|
||||||
import TopBar from "./components/TopBar.vue";
|
import TopBar from "./components/TopBar.vue";
|
||||||
import { useAccount } from "./main";
|
|
||||||
|
|
||||||
const { me, logOut } = useAccount();
|
const { me, logOut } = useAccount();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
1
examples/chat-vue/src/apiKey.ts
Normal file
1
examples/chat-vue/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const apiKey = "chat-example-jazz@garden.co";
|
||||||
@@ -1,36 +1,31 @@
|
|||||||
import "./index.css";
|
import { DemoAuthBasicUI, JazzProvider } from "jazz-vue";
|
||||||
import { DemoAuthBasicUI, createJazzVueApp, useDemoAuth } from "jazz-vue";
|
|
||||||
import { createApp, defineComponent, h } from "vue";
|
import { createApp, defineComponent, h } from "vue";
|
||||||
import App from "./App.vue";
|
import App from "./App.vue";
|
||||||
|
import "./index.css";
|
||||||
|
import { apiKey } from "@/apiKey";
|
||||||
import router from "./router";
|
import router from "./router";
|
||||||
|
|
||||||
const Jazz = createJazzVueApp();
|
|
||||||
export const { useAccount, useCoState } = Jazz;
|
|
||||||
const { JazzProvider } = Jazz;
|
|
||||||
|
|
||||||
const RootComponent = defineComponent({
|
const RootComponent = defineComponent({
|
||||||
name: "RootComponent",
|
name: "RootComponent",
|
||||||
setup() {
|
setup() {
|
||||||
const { authMethod, state } = useDemoAuth();
|
return () =>
|
||||||
|
|
||||||
return () => [
|
|
||||||
h(
|
h(
|
||||||
JazzProvider,
|
JazzProvider,
|
||||||
{
|
{
|
||||||
auth: authMethod.value,
|
sync: {
|
||||||
peer: "wss://mesh.jazz.tools/?key=chat-example-jazz@gcmp.io",
|
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
h(
|
||||||
default: () => h(App),
|
DemoAuthBasicUI,
|
||||||
},
|
{
|
||||||
),
|
appName: "Jazz Vue Chat",
|
||||||
|
},
|
||||||
state.state !== "signedIn" &&
|
{
|
||||||
h(DemoAuthBasicUI, {
|
default: () => h(App),
|
||||||
appName: "Jazz Chat",
|
},
|
||||||
state,
|
),
|
||||||
}),
|
);
|
||||||
];
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -26,12 +26,12 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { ID } from "jazz-tools";
|
import type { ID } from "jazz-tools";
|
||||||
|
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";
|
||||||
import ChatBubble from "../components/ChatBubble.vue";
|
import ChatBubble from "../components/ChatBubble.vue";
|
||||||
import ChatInput from "../components/ChatInput.vue";
|
import ChatInput from "../components/ChatInput.vue";
|
||||||
import EmptyChatMessage from "../components/EmptyChatMessage.vue";
|
import EmptyChatMessage from "../components/EmptyChatMessage.vue";
|
||||||
import { useCoState } from "../main";
|
|
||||||
import { Chat, Message } from "../schema";
|
import { Chat, Message } from "../schema";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Group } from "jazz-tools";
|
import { Group } from "jazz-tools";
|
||||||
|
import { useAccount } from "jazz-vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useAccount } from "../main";
|
|
||||||
import { Chat } from "../schema";
|
import { Chat } from "../schema";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
|
||||||
export default {
|
|
||||||
purge: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
|
|
||||||
theme: {
|
|
||||||
extend: {},
|
|
||||||
},
|
|
||||||
plugins: [],
|
|
||||||
};
|
|
||||||
11
examples/chat-vue/tailwind.config.ts
Normal file
11
examples/chat-vue/tailwind.config.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import type { Config } from "tailwindcss";
|
||||||
|
|
||||||
|
const config: Config = {
|
||||||
|
content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
@@ -1,5 +1,307 @@
|
|||||||
# jazz-example-chat
|
# jazz-example-chat
|
||||||
|
|
||||||
|
## 0.0.146
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5a63cba]
|
||||||
|
- jazz-tools@0.10.1
|
||||||
|
- jazz-browser-media-images@0.10.1
|
||||||
|
- jazz-react@0.10.1
|
||||||
|
|
||||||
|
## 0.0.145
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [498954f]
|
||||||
|
- Updated dependencies [d42c2aa]
|
||||||
|
- Updated dependencies [dd03464]
|
||||||
|
- Updated dependencies [b426342]
|
||||||
|
- jazz-react@0.10.0
|
||||||
|
- jazz-tools@0.10.0
|
||||||
|
- jazz-browser-media-images@0.10.0
|
||||||
|
|
||||||
|
## 0.0.144
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.9.23
|
||||||
|
- jazz-tools@0.9.23
|
||||||
|
- jazz-browser-media-images@0.9.23
|
||||||
|
|
||||||
|
## 0.0.143
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser-media-images@0.9.22
|
||||||
|
- jazz-react@0.9.22
|
||||||
|
|
||||||
|
## 0.0.142
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1be017d]
|
||||||
|
- jazz-tools@0.9.21
|
||||||
|
- jazz-browser-media-images@0.9.21
|
||||||
|
- jazz-react@0.9.21
|
||||||
|
|
||||||
|
## 0.0.141
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b01cc1f]
|
||||||
|
- jazz-tools@0.9.20
|
||||||
|
- jazz-browser-media-images@0.9.20
|
||||||
|
- jazz-react@0.9.20
|
||||||
|
|
||||||
|
## 0.0.140
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.9.19
|
||||||
|
- jazz-tools@0.9.19
|
||||||
|
- jazz-browser-media-images@0.9.19
|
||||||
|
|
||||||
|
## 0.0.139
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.9.18
|
||||||
|
- jazz-tools@0.9.18
|
||||||
|
- jazz-browser-media-images@0.9.18
|
||||||
|
|
||||||
|
## 0.0.138
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c2ca1fe]
|
||||||
|
- Updated dependencies [1227047]
|
||||||
|
- jazz-tools@0.9.17
|
||||||
|
- jazz-browser-media-images@0.9.17
|
||||||
|
- jazz-react@0.9.17
|
||||||
|
|
||||||
|
## 0.0.137
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [24b3b6a]
|
||||||
|
- jazz-tools@0.9.16
|
||||||
|
- jazz-browser-media-images@0.9.16
|
||||||
|
- jazz-react@0.9.16
|
||||||
|
|
||||||
|
## 0.0.136
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7491711]
|
||||||
|
- jazz-tools@0.9.15
|
||||||
|
- jazz-browser-media-images@0.9.15
|
||||||
|
- jazz-react@0.9.15
|
||||||
|
|
||||||
|
## 0.0.135
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3df93cc]
|
||||||
|
- jazz-tools@0.9.14
|
||||||
|
- jazz-browser-media-images@0.9.14
|
||||||
|
- jazz-react@0.9.14
|
||||||
|
|
||||||
|
## 0.0.134
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.9.13
|
||||||
|
- jazz-tools@0.9.13
|
||||||
|
- jazz-browser-media-images@0.9.13
|
||||||
|
|
||||||
|
## 0.0.133
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.9.12
|
||||||
|
- jazz-tools@0.9.12
|
||||||
|
- jazz-browser-media-images@0.9.12
|
||||||
|
|
||||||
|
## 0.0.132
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.9.11
|
||||||
|
- jazz-tools@0.9.11
|
||||||
|
- jazz-browser-media-images@0.9.11
|
||||||
|
|
||||||
|
## 0.0.131
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- f76274c: Fix image handling in react-native
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser-media-images@0.9.10
|
||||||
|
|
||||||
|
## 0.0.130
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8eb9247]
|
||||||
|
- jazz-tools@0.9.9
|
||||||
|
- jazz-browser-media-images@0.9.9
|
||||||
|
- jazz-react@0.9.9
|
||||||
|
|
||||||
|
## 0.0.129
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [d1d773b]
|
||||||
|
- jazz-tools@0.9.8
|
||||||
|
- jazz-react@0.9.8
|
||||||
|
- jazz-browser-media-images@0.9.8
|
||||||
|
|
||||||
|
## 0.0.128
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.9.4
|
||||||
|
|
||||||
|
## 0.0.127
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1b71969]
|
||||||
|
- jazz-react@0.9.1
|
||||||
|
- jazz-tools@0.9.1
|
||||||
|
- jazz-browser-media-images@0.9.1
|
||||||
|
|
||||||
|
## 0.0.126
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [956a4d1]
|
||||||
|
- Updated dependencies [8eda792]
|
||||||
|
- jazz-react@0.9.0
|
||||||
|
- jazz-tools@0.9.0
|
||||||
|
- jazz-browser-media-images@0.9.0
|
||||||
|
|
||||||
|
## 0.0.125
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [dc62b95]
|
||||||
|
- Updated dependencies [1de26f8]
|
||||||
|
- jazz-tools@0.8.51
|
||||||
|
- jazz-browser-media-images@0.8.51
|
||||||
|
- jazz-react@0.8.51
|
||||||
|
|
||||||
|
## 0.0.124
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.8.50
|
||||||
|
- jazz-tools@0.8.50
|
||||||
|
- jazz-browser-media-images@0.8.50
|
||||||
|
|
||||||
|
## 0.0.123
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.8.49
|
||||||
|
- jazz-tools@0.8.49
|
||||||
|
- jazz-browser-media-images@0.8.49
|
||||||
|
|
||||||
|
## 0.0.122
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [635e824]
|
||||||
|
- Updated dependencies [0a85982]
|
||||||
|
- jazz-tools@0.8.48
|
||||||
|
- jazz-browser-media-images@0.8.48
|
||||||
|
- jazz-react@0.8.48
|
||||||
|
|
||||||
|
## 0.0.121
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [6f0bd7f]
|
||||||
|
- Updated dependencies [fca6a0b]
|
||||||
|
- Updated dependencies [fa41f8e]
|
||||||
|
- Updated dependencies [88d7d9a]
|
||||||
|
- Updated dependencies [60e35ea]
|
||||||
|
- cojson@0.8.45
|
||||||
|
- jazz-tools@0.8.45
|
||||||
|
- jazz-react@0.8.45
|
||||||
|
- jazz-browser-media-images@0.8.45
|
||||||
|
|
||||||
|
## 0.0.120
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5d20c81]
|
||||||
|
- cojson@0.8.44
|
||||||
|
- jazz-react@0.8.44
|
||||||
|
- jazz-tools@0.8.44
|
||||||
|
- jazz-browser-media-images@0.8.44
|
||||||
|
|
||||||
|
## 0.0.119
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3252502]
|
||||||
|
- Updated dependencies [6370348]
|
||||||
|
- Updated dependencies [ac216b9]
|
||||||
|
- cojson@0.8.41
|
||||||
|
- jazz-react@0.8.41
|
||||||
|
- jazz-tools@0.8.41
|
||||||
|
- jazz-browser-media-images@0.8.41
|
||||||
|
|
||||||
|
## 0.0.118
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-browser-media-images@0.8.40
|
||||||
|
- jazz-react@0.8.40
|
||||||
|
|
||||||
|
## 0.0.117
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [249eecb]
|
||||||
|
- Updated dependencies [3121551]
|
||||||
|
- jazz-tools@0.8.39
|
||||||
|
- cojson@0.8.39
|
||||||
|
- jazz-browser-media-images@0.8.39
|
||||||
|
- jazz-react@0.8.39
|
||||||
|
|
||||||
|
## 0.0.116
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b00ee91]
|
||||||
|
- Updated dependencies [f488c09]
|
||||||
|
- cojson@0.8.38
|
||||||
|
- jazz-react@0.8.38
|
||||||
|
- jazz-tools@0.8.38
|
||||||
|
|
||||||
|
## 0.0.115
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3d9f12e]
|
||||||
|
- cojson@0.8.37
|
||||||
|
- jazz-react@0.8.37
|
||||||
|
- jazz-tools@0.8.37
|
||||||
|
|
||||||
|
## 0.0.114
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [441fe27]
|
||||||
|
- cojson@0.8.36
|
||||||
|
- jazz-tools@0.8.36
|
||||||
|
- jazz-react@0.8.36
|
||||||
|
|
||||||
## 0.0.113
|
## 0.0.113
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM caddy:2.7.3-alpine
|
FROM caddy:2.7.3-alpine
|
||||||
LABEL org.opencontainers.image.source="https://github.com/gardencmp/jazz"
|
LABEL org.opencontainers.image.source="https://github.com/garden-co/jazz"
|
||||||
|
|
||||||
COPY ./dist /usr/share/caddy/
|
COPY ./dist /usr/share/caddy/
|
||||||
@@ -2,30 +2,56 @@
|
|||||||
|
|
||||||
Live version: [https://chat.jazz.tools](https://chat.jazz.tools)
|
Live version: [https://chat.jazz.tools](https://chat.jazz.tools)
|
||||||
|
|
||||||
## Installing & running the example locally
|
## Getting started
|
||||||
|
|
||||||
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
|
You can either
|
||||||
|
1. Clone the jazz repository, and run the app within the monorepo.
|
||||||
|
2. Or create a new Jazz project using this example as a template.
|
||||||
|
|
||||||
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
|
|
||||||
|
### Using the example as a template
|
||||||
|
|
||||||
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npx degit gardencmp/jazz jazz
|
npx create-jazz-app@latest --example chat --project-name chat
|
||||||
```
|
```
|
||||||
|
|
||||||
Go to the chat example directory:
|
Go to the new project directory.
|
||||||
```bash
|
```bash
|
||||||
cd jazz/examples/chat
|
cd chat
|
||||||
```
|
```
|
||||||
|
|
||||||
Install and build dependencies:
|
Run the dev server.
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using the monorepo
|
||||||
|
|
||||||
|
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
|
||||||
|
|
||||||
|
Clone the jazz repository.
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/garden-co/jazz.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Install and build dependencies.
|
||||||
```bash
|
```bash
|
||||||
pnpm i && npx turbo build
|
pnpm i && npx turbo build
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the dev server:
|
Go to the example directory.
|
||||||
|
```bash
|
||||||
|
cd jazz/examples/chat/
|
||||||
|
```
|
||||||
|
|
||||||
|
Start the dev server.
|
||||||
```bash
|
```bash
|
||||||
pnpm dev
|
pnpm dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
|
||||||
|
|
||||||
## Questions / problems / feedback
|
## Questions / problems / feedback
|
||||||
|
|
||||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
||||||
@@ -34,4 +60,4 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
|
|||||||
|
|
||||||
By default, the example app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
|
By default, the example app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
|
||||||
|
|
||||||
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<Jazz.Provider>` provider component in [./src/main.tsx](./src/main.tsx).
|
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<JazzProvider>` provider component in [./src/main.tsx](./src/main.tsx).
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Jazz Chat Example</title>
|
<title>Jazz Chat Example</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="h-full">
|
<body class="h-full bg-white text-stone-700 dark:text-stone-400 dark:bg-stone-925">
|
||||||
<div id="root" class="h-full"></div>
|
<div id="root" class="h-full"></div>
|
||||||
<script type="module" src="/src/app.tsx"></script>
|
<script type="module" src="/src/app.tsx"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-chat",
|
"name": "jazz-example-chat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.113",
|
"version": "0.0.146",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -13,37 +13,25 @@
|
|||||||
"test:ui": "playwright test --ui"
|
"test:ui": "playwright test --ui"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@radix-ui/react-checkbox": "^1.0.4",
|
|
||||||
"@radix-ui/react-slot": "^1.0.2",
|
|
||||||
"@radix-ui/react-toast": "^1.1.4",
|
|
||||||
"class-variance-authority": "^0.7.0",
|
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"cojson": "workspace:0.8.35",
|
"hash-slash": "workspace:*",
|
||||||
"hash-slash": "workspace:0.2.1",
|
"jazz-browser-media-images": "workspace:*",
|
||||||
"jazz-react": "workspace:0.8.35",
|
"jazz-react": "workspace:*",
|
||||||
"jazz-tools": "workspace:0.8.35",
|
"jazz-tools": "workspace:*",
|
||||||
"lucide-react": "^0.274.0",
|
"lucide-react": "^0.274.0",
|
||||||
"qrcode": "^1.5.3",
|
"react": "^18.3.1",
|
||||||
"react": "^18.2.0",
|
"react-dom": "^18.3.1"
|
||||||
"react-dom": "^18.2.0",
|
|
||||||
"react-router": "^6.16.0",
|
|
||||||
"react-router-dom": "^6.16.0",
|
|
||||||
"react-use": "^17.4.0",
|
|
||||||
"tailwind-merge": "^1.14.0",
|
|
||||||
"tailwindcss-animate": "^1.0.7",
|
|
||||||
"uniqolor": "^1.1.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@playwright/test": "^1.46.1",
|
"@playwright/test": "^1.50.1",
|
||||||
"@types/qrcode": "^1.5.1",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react": "^18.2.19",
|
"@types/react-dom": "^18.3.1",
|
||||||
"@types/react-dom": "^18.2.7",
|
|
||||||
"@vitejs/plugin-react-swc": "^3.3.2",
|
"@vitejs/plugin-react-swc": "^3.3.2",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.20",
|
||||||
"is-ci": "^3.0.1",
|
"is-ci": "^3.0.1",
|
||||||
"postcss": "^8.4.27",
|
"postcss": "^8.4.27",
|
||||||
"tailwindcss": "3.3.2",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "~5.6.2",
|
||||||
"vite": "^5.0.10"
|
"vite": "^6.0.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
examples/chat/src/apiKey.ts
Normal file
1
examples/chat/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const apiKey = "chat-example-jazz@garden.co";
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
import { inIframe, onChatLoad } from "@/util.ts";
|
import { apiKey } from "@/apiKey.ts";
|
||||||
|
import { getRandomUsername, inIframe, onChatLoad } from "@/util.ts";
|
||||||
import { useIframeHashRouter } from "hash-slash";
|
import { useIframeHashRouter } from "hash-slash";
|
||||||
|
import { JazzProvider, useAccount } from "jazz-react";
|
||||||
import { Group, ID } from "jazz-tools";
|
import { Group, ID } from "jazz-tools";
|
||||||
|
import { StrictMode } from "react";
|
||||||
|
import { createRoot } from "react-dom/client";
|
||||||
import { ChatScreen } from "./chatScreen.tsx";
|
import { ChatScreen } from "./chatScreen.tsx";
|
||||||
import { useAccount } from "./main.tsx";
|
|
||||||
import { Chat } from "./schema.ts";
|
import { Chat } from "./schema.ts";
|
||||||
|
import { ThemeProvider } from "./themeProvider.tsx";
|
||||||
import { AppContainer, TopBar } from "./ui.tsx";
|
import { AppContainer, TopBar } from "./ui.tsx";
|
||||||
|
|
||||||
export function App() {
|
export function App() {
|
||||||
@@ -12,19 +16,28 @@ export function App() {
|
|||||||
|
|
||||||
const createChat = () => {
|
const createChat = () => {
|
||||||
if (!me) return;
|
if (!me) return;
|
||||||
const group = Group.create({ owner: me });
|
const group = Group.create();
|
||||||
group.addMember("everyone", "writer");
|
group.addMember("everyone", "writer");
|
||||||
const chat = Chat.create([], { owner: group });
|
const chat = Chat.create([], group);
|
||||||
router.navigate("/#/chat/" + chat.id);
|
router.navigate("/#/chat/" + chat.id);
|
||||||
|
|
||||||
// for https://jazz.tools marketing site demo only
|
// for https://jazz.tools marketing site demo only
|
||||||
onChatLoad(chat, me);
|
onChatLoad(chat);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppContainer>
|
<AppContainer>
|
||||||
<TopBar>
|
<TopBar>
|
||||||
<p>{me?.profile?.name}</p>
|
<input
|
||||||
|
type="text"
|
||||||
|
value={me?.profile?.name ?? ""}
|
||||||
|
className="bg-transparent"
|
||||||
|
onChange={(e) => {
|
||||||
|
if (!me?.profile) return;
|
||||||
|
me.profile.name = e.target.value;
|
||||||
|
}}
|
||||||
|
placeholder="Set username"
|
||||||
|
/>
|
||||||
{!inIframe && <button onClick={logOut}>Log out</button>}
|
{!inIframe && <button onClick={logOut}>Log out</button>}
|
||||||
</TopBar>
|
</TopBar>
|
||||||
{router.route({
|
{router.route({
|
||||||
@@ -34,3 +47,21 @@ export function App() {
|
|||||||
</AppContainer>
|
</AppContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const url = new URL(window.location.href);
|
||||||
|
const defaultProfileName = url.searchParams.get("user") ?? getRandomUsername();
|
||||||
|
|
||||||
|
createRoot(document.getElementById("root")!).render(
|
||||||
|
<ThemeProvider>
|
||||||
|
<StrictMode>
|
||||||
|
<JazzProvider
|
||||||
|
sync={{
|
||||||
|
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||||
|
}}
|
||||||
|
defaultProfileName={defaultProfileName}
|
||||||
|
>
|
||||||
|
<App />
|
||||||
|
</JazzProvider>
|
||||||
|
</StrictMode>
|
||||||
|
</ThemeProvider>,
|
||||||
|
);
|
||||||
|
|||||||
@@ -1,21 +1,46 @@
|
|||||||
|
import { createImage } from "jazz-browser-media-images";
|
||||||
|
import { useCoState } from "jazz-react";
|
||||||
import { ID } from "jazz-tools";
|
import { ID } from "jazz-tools";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useCoState } from "./main.tsx";
|
|
||||||
import { Chat, Message } from "./schema.ts";
|
import { Chat, Message } from "./schema.ts";
|
||||||
import {
|
import {
|
||||||
BubbleBody,
|
BubbleBody,
|
||||||
BubbleContainer,
|
BubbleContainer,
|
||||||
|
BubbleImage,
|
||||||
BubbleInfo,
|
BubbleInfo,
|
||||||
|
BubbleText,
|
||||||
ChatBody,
|
ChatBody,
|
||||||
ChatInput,
|
|
||||||
EmptyChatMessage,
|
EmptyChatMessage,
|
||||||
|
ImageInput,
|
||||||
|
InputBar,
|
||||||
|
TextInput,
|
||||||
} from "./ui.tsx";
|
} from "./ui.tsx";
|
||||||
|
|
||||||
export function ChatScreen(props: { chatID: ID<Chat> }) {
|
export function ChatScreen(props: { chatID: ID<Chat> }) {
|
||||||
const chat = useCoState(Chat, props.chatID, [{}]);
|
const chat = useCoState(Chat, props.chatID, [{}]);
|
||||||
const [showNLastMessages, setShowNLastMessages] = useState(30);
|
const [showNLastMessages, setShowNLastMessages] = useState(30);
|
||||||
|
|
||||||
return chat ? (
|
if (!chat)
|
||||||
|
return (
|
||||||
|
<div className="flex-1 flex justify-center items-center">Loading...</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
const sendImage = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
const file = event.currentTarget.files?.[0];
|
||||||
|
|
||||||
|
if (!file) return;
|
||||||
|
|
||||||
|
if (file.size > 5000000) {
|
||||||
|
alert("Please upload an image less than 5MB.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
createImage(file, { owner: chat._owner }).then((image) => {
|
||||||
|
chat.push(Message.create({ text: file.name, image: image }, chat._owner));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
<>
|
<>
|
||||||
<ChatBody>
|
<ChatBody>
|
||||||
{chat.length > 0 ? (
|
{chat.length > 0 ? (
|
||||||
@@ -35,24 +60,31 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</ChatBody>
|
</ChatBody>
|
||||||
<ChatInput
|
|
||||||
onSubmit={(text) => {
|
<InputBar>
|
||||||
chat.push(Message.create({ text }, { owner: chat._owner }));
|
<ImageInput onImageChange={sendImage} />
|
||||||
}}
|
|
||||||
/>
|
<TextInput
|
||||||
|
onSubmit={(text) => {
|
||||||
|
chat.push(Message.create({ text }, { owner: chat._owner }));
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</InputBar>
|
||||||
</>
|
</>
|
||||||
) : (
|
|
||||||
<div className="flex-1 flex justify-center items-center">Loading...</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ChatBubble(props: { msg: Message }) {
|
function ChatBubble(props: { msg: Message }) {
|
||||||
const lastEdit = props.msg._edits.text;
|
const lastEdit = props.msg._edits.text;
|
||||||
const fromMe = lastEdit.by?.isMe;
|
const fromMe = lastEdit.by?.isMe;
|
||||||
|
const { text, image } = props.msg;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BubbleContainer fromMe={fromMe}>
|
<BubbleContainer fromMe={fromMe}>
|
||||||
<BubbleBody fromMe={fromMe}>{props.msg.text}</BubbleBody>
|
<BubbleBody fromMe={fromMe}>
|
||||||
|
{image && <BubbleImage image={image} />}
|
||||||
|
<BubbleText text={text} />
|
||||||
|
</BubbleBody>
|
||||||
<BubbleInfo by={lastEdit.by?.profile?.name} madeAt={lastEdit.madeAt} />
|
<BubbleInfo by={lastEdit.by?.profile?.name} madeAt={lastEdit.madeAt} />
|
||||||
</BubbleContainer>
|
</BubbleContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,78 +1,3 @@
|
|||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
@layer base {
|
|
||||||
:root {
|
|
||||||
--background: 0 0% 100%;
|
|
||||||
--foreground: 20 14.3% 4.1%;
|
|
||||||
|
|
||||||
--card: 0 0% 100%;
|
|
||||||
--card-foreground: 20 14.3% 4.1%;
|
|
||||||
|
|
||||||
--popover: 0 0% 100%;
|
|
||||||
--popover-foreground: 20 14.3% 4.1%;
|
|
||||||
|
|
||||||
--primary: 24 9.8% 10%;
|
|
||||||
--primary-foreground: 60 9.1% 97.8%;
|
|
||||||
|
|
||||||
--secondary: 60 4.8% 95.9%;
|
|
||||||
--secondary-foreground: 24 9.8% 10%;
|
|
||||||
|
|
||||||
--muted: 60 4.8% 95.9%;
|
|
||||||
--muted-foreground: 25 5.3% 44.7%;
|
|
||||||
|
|
||||||
--accent: 60 4.8% 95.9%;
|
|
||||||
--accent-foreground: 24 9.8% 10%;
|
|
||||||
|
|
||||||
--destructive: 0 84.2% 60.2%;
|
|
||||||
--destructive-foreground: 60 9.1% 97.8%;
|
|
||||||
|
|
||||||
--border: 20 5.9% 90%;
|
|
||||||
--input: 20 5.9% 90%;
|
|
||||||
--ring: 20 14.3% 4.1%;
|
|
||||||
|
|
||||||
--radius: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dark {
|
|
||||||
--background: 20 14.3% 4.1%;
|
|
||||||
--foreground: 60 9.1% 97.8%;
|
|
||||||
|
|
||||||
--card: 20 14.3% 4.1%;
|
|
||||||
--card-foreground: 60 9.1% 97.8%;
|
|
||||||
|
|
||||||
--popover: 20 14.3% 4.1%;
|
|
||||||
--popover-foreground: 60 9.1% 97.8%;
|
|
||||||
|
|
||||||
--primary: 60 9.1% 97.8%;
|
|
||||||
--primary-foreground: 24 9.8% 10%;
|
|
||||||
|
|
||||||
--secondary: 12 6.5% 15.1%;
|
|
||||||
--secondary-foreground: 60 9.1% 97.8%;
|
|
||||||
|
|
||||||
--muted: 12 6.5% 15.1%;
|
|
||||||
--muted-foreground: 24 5.4% 63.9%;
|
|
||||||
|
|
||||||
--accent: 12 6.5% 15.1%;
|
|
||||||
--accent-foreground: 60 9.1% 97.8%;
|
|
||||||
|
|
||||||
--destructive: 0 62.8% 30.6%;
|
|
||||||
--destructive-foreground: 60 9.1% 97.8%;
|
|
||||||
|
|
||||||
--border: 12 6.5% 15.1%;
|
|
||||||
--input: 12 6.5% 15.1%;
|
|
||||||
--ring: 24 5.7% 82.9%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@layer base {
|
|
||||||
* {
|
|
||||||
@apply border-border;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
@apply bg-background text-foreground;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user