Compare commits

...

347 Commits

Author SHA1 Message Date
Trisha Lim
95f51ea783 Update gitignore 2025-01-24 14:51:57 +08:00
Trisha Lim
82b0268c4d Fix example readme instructions 2025-01-24 14:49:54 +08:00
Guido D'Orsi
f97ef696e3 Merge pull request #1244 from garden-co/changeset-release/main
Version Packages
2025-01-22 19:22:23 +01:00
github-actions[bot]
ad65cb8ab5 Version Packages 2025-01-22 18:22:06 +00:00
Guido D'Orsi
8d8131410a Merge pull request #1243 from garden-co/testing-migration-ctx
fix: correctly set the globalMe before the migration when calling createJazzTestAccount
2025-01-22 19:20:52 +01:00
Guido D'Orsi
7491711b72 fix: correctly set the globalMe before the migration when calling createJazzTestAccount 2025-01-22 19:19:07 +01:00
Giordano Ricci
5933aa59c1 Merge pull request #1242 from garden-co/changeset-release/main
Version Packages
2025-01-22 17:33:31 +00:00
github-actions[bot]
da96bec465 Version Packages 2025-01-22 17:30:19 +00:00
Guido D'Orsi
483422c0e9 Merge pull request #1241 from garden-co/guido/test
feat: API to setup a test sync in the test environment
2025-01-22 18:28:38 +01:00
Guido D'Orsi
3df93cc147 chore: changeset 2025-01-22 18:22:16 +01:00
Guido D'Orsi
d686edfa6c chore: add tests and use ref to track the current sync server 2025-01-22 18:22:15 +01:00
Giordano Ricci
497b0ade1f feat: API to setup a test sync in the test environment 2025-01-22 18:21:48 +01:00
Guido D'Orsi
86acbcd0d6 Merge pull request #1237 from garden-co/changeset-release/main
Version Packages
2025-01-22 12:51:45 +01:00
github-actions[bot]
9111c85445 Version Packages 2025-01-22 11:46:06 +00:00
Guido D'Orsi
1d87879787 Merge pull request #1231 from garden-co/revert-1229-revert-custom-logger
Restore cutom logger
2025-01-22 12:44:53 +01:00
Guido D'Orsi
7c777f2bdf test: cover the storage regression with a test 2025-01-22 12:41:51 +01:00
Benjamin S. Leveritt
aa8067b8d0 Merge pull request #1234 from garden-co/fix-clerk-example
chore: simplify clerk example auth-context
2025-01-22 10:15:21 +00:00
Guido D'Orsi
bd66cdeb78 chore: simplify clerk example auth-context 2025-01-22 10:29:54 +01:00
Guido D'Orsi
8d29e50669 feat: adapt the logger interface to pino 2025-01-21 17:52:40 +01:00
Guido D'Orsi
5a7398d242 Revert "Revert custom logger" 2025-01-21 17:08:37 +01:00
Guido D'Orsi
74b984fbe6 Merge pull request #1230 from garden-co/changeset-release/main
Version Packages
2025-01-21 16:53:36 +01:00
github-actions[bot]
f8e00204b4 Version Packages 2025-01-21 15:49:31 +00:00
Guido D'Orsi
76543df765 Merge pull request #1229 from garden-co/revert-custom-logger
Revert custom logger
2025-01-21 16:48:17 +01:00
Guido D'Orsi
15d4b2a5f7 chore: changeset 2025-01-21 16:44:37 +01:00
Guido D'Orsi
2e67f91fe0 Revert "feat: make it possible to customize the logger in cojson"
This reverts commit 5863badbb0.
2025-01-21 16:42:54 +01:00
Benjamin S. Leveritt
0eb21a3471 Merge pull request #1216 from boorad/feat/demo-auth-theme
fix: phone theme drives light/dark mode in Demo Auth
2025-01-20 13:27:19 +00:00
Guido D'Orsi
99e88d3497 Merge pull request #1220 from garden-co/changeset-release/main
Version Packages
2025-01-20 13:06:56 +01:00
github-actions[bot]
f09ce70d3c Version Packages 2025-01-20 11:57:26 +00:00
Guido D'Orsi
7d62e2735f Merge pull request #1219 from garden-co/custom-logger
feat: make it possible to customize the logger in cojson
2025-01-20 12:56:11 +01:00
Guido D'Orsi
5863badbb0 feat: make it possible to customize the logger in cojson 2025-01-20 12:34:31 +01:00
Guido D'Orsi
56d26222e7 Merge pull request #1214 from garden-co/feat/queue-optimization
perf: optimize queue processing under heavy load
2025-01-20 12:30:58 +01:00
Guido D'Orsi
bd34084104 Merge pull request #1218 from garden-co/feat/inspector-component
feat: in-app inspector component for react web
2025-01-20 12:27:09 +01:00
Guido D'Orsi
f5e6fe927d chore: clean deps 2025-01-20 12:21:56 +01:00
Guido D'Orsi
93c49639c2 feat: in-app inspector component 2025-01-19 19:58:07 +01:00
Brad Anderson
aabe7bef34 fix: phone theme drives light/dark mode in Demo Auth 2025-01-17 23:07:38 -05:00
Guido D'Orsi
909165d813 test: cover nested SchemaUnion 2025-01-18 00:27:33 +01:00
Guido D'Orsi
6bee742b65 Merge pull request #1207 from garden-co/changeset-release/main
Version Packages
2025-01-18 00:26:30 +01:00
github-actions[bot]
23486d01b9 Version Packages 2025-01-17 23:23:34 +00:00
Guido D'Orsi
b761d5a730 Merge pull request #1215 from garden-co/fix/auth-issues
fix: improve error management on initial auth, fixed an infinite loop when migration fails
2025-01-18 00:22:06 +01:00
Guido D'Orsi
9181e74fc8 chore: add ts-ignore on an error flagged by some Typescript versions 2025-01-18 00:14:54 +01:00
Guido D'Orsi
5e83864f41 fix: improve error management on initial auth, fixed an infinite loop when migration fails 2025-01-18 00:12:46 +01:00
Guido D'Orsi
789cf66de2 test: fix failing test 2025-01-17 20:00:44 +01:00
Guido D'Orsi
de5f2d6d5b Merge pull request #1213 from garden-co/fix/handle-unknown-covaule-types
perf: skip coValue content creation on access
2025-01-17 14:44:03 +01:00
Guido D'Orsi
4aa377dea7 chore: changeset 2025-01-17 14:42:05 +01:00
Guido D'Orsi
efbf3d84ac chore: changeset 2025-01-17 14:41:51 +01:00
Guido D'Orsi
b90393b43e perf: optimize queue processing under heavy load 2025-01-17 14:28:00 +01:00
Guido D'Orsi
31ae73fe0e perf: skip coValue content creation on access 2025-01-17 12:49:24 +01:00
Guido D'Orsi
7a5adfc4dc Merge pull request #1212 from garden-co/fix/handle-unknown-covaule-types
feat: handle unknown coValue content instead of triggering an error
2025-01-17 12:23:50 +01:00
Guido D'Orsi
850e264912 feat: handle unknown coValue content instead of triggering an error 2025-01-17 12:02:32 +01:00
Anselm Eickhoff
aa81779ad8 Update page.tsx 2025-01-17 09:59:40 +00:00
Guido D'Orsi
72c97c0835 Merge pull request #1208 from garden-co/0.9.8-changelog
docs: add the 0.9.8 changelog
2025-01-14 18:35:21 +01:00
Guido D'Orsi
12809a6733 docs: add the 0.9.8 changelog 2025-01-14 17:21:51 +01:00
Guido D'Orsi
c55aeff98e docs: fix CoMap load & subscribe docs example 2025-01-14 16:56:47 +01:00
Guido D'Orsi
16b76e401c docs: fix jazz-tools tsDoc generation 2025-01-14 16:48:42 +01:00
Guido D'Orsi
d2470efd6f test: add a test to cover an indirect communication between nodes 2025-01-14 16:45:11 +01:00
pax
1a97b1b77c Merge pull request #1205 from garden-co/JAZZ-647/fix-image-handling-in-rn-chat-demo
Fix image handling in RN Chat Demo
2025-01-14 17:43:54 +02:00
Guido D'Orsi
adde5b78f3 Merge pull request #1201 from garden-co/changeset-release/main
Version Packages
2025-01-14 16:24:28 +01:00
github-actions[bot]
06fd3a3686 Version Packages 2025-01-14 14:02:14 +00:00
Anselm Eickhoff
d231b6ae2a Merge pull request #1191 from garden-co/fix/create-jazz-app
Use example apps as starter with create-jazz-app
2025-01-14 14:00:52 +00:00
pax-k
f76274c19a chore: changeset 2025-01-14 15:15:59 +02:00
Benjamin S. Leveritt
e471fc5d23 Merge pull request #1204 from garden-co/jazz-648-homepage-generate-docs-pointing-to-wrong-jazz-react
Fix location of jazz-react entryPoint for docs gen
2025-01-14 13:15:35 +00:00
pax-k
cb1b602255 Merge remote-tracking branch 'upstream/main' into JAZZ-647/fix-image-handling-in-rn-chat-demo 2025-01-14 15:14:30 +02:00
pax-k
a728dbf632 fix: image handling in react-native 2025-01-14 15:14:06 +02:00
Benjamin S. Leveritt
84d06d180a Fix location of jazz-react entryPoint for docs gen 2025-01-14 13:13:18 +00:00
Benjamin S. Leveritt
342e4d9f5e Merge pull request #1173 from garden-co/jazz-534-richtext-changes
Improve coRichText support
2025-01-14 12:46:50 +00:00
Benjamin S. Leveritt
8eb92471ae Add changeset 2025-01-14 12:44:19 +00:00
Guido D'Orsi
0cfc32f591 Merge pull request #1198 from garden-co/changeset-release/main
Version Packages
2025-01-14 12:42:19 +01:00
github-actions[bot]
e8b1e07625 Version Packages 2025-01-14 10:20:58 +00:00
pax
f97946bd21 Merge pull request #1199 from garden-co/fix-react-usecontext-reference
Fix React.useContext() reference
2025-01-14 12:19:41 +02:00
pax-k
f7f461db31 chore: changeset 2025-01-14 12:04:47 +02:00
pax-k
653d09c337 fix: explicitly use useContext() instead of React.useContext() 2025-01-14 12:03:53 +02:00
pax-k
3fa5ac30ff chore: cleanup 2025-01-14 11:39:59 +02:00
Guido D'Orsi
4095041da9 Merge pull request #1179 from garden-co/jazz-640-api-make-the-current-active-account-the-default-in
Without me
2025-01-14 10:11:40 +01:00
Guido D'Orsi
c1c2f39cb5 test: fix failing test 2025-01-14 09:33:33 +01:00
Benjamin S. Leveritt
e5b93871f7 Add test for insertion at start 2025-01-14 08:22:04 +00:00
Benjamin S. Leveritt
896aeb571d Fix multiple insertions at start 2025-01-14 08:22:03 +00:00
Guido D'Orsi
f7f1a0aff0 fix: use groups as defult owner 2025-01-13 20:24:51 +01:00
Guido D'Orsi
3bc82dc382 Update homepage/homepage/app/docs/[framework]/[...slug]/guide/react.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-01-13 19:36:14 +01:00
Guido D'Orsi
99bac77ae7 Update homepage/homepage/app/docs/[framework]/[...slug]/guide/react.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-01-13 19:36:03 +01:00
Guido D'Orsi
5705ebdcad Update packages/jazz-tools/src/implementation/activeAccountContext.ts
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-01-13 19:35:54 +01:00
pax
f3fb445c9e Merge pull request #1197 from garden-co/JAZZ-638/set-specific-package-version-on-create-jazz-app
create-jazz-app gets the latest semver package version for jazz-* dependencies from NPM via HTTP
2025-01-13 18:19:08 +02:00
pax-k
c60fe8aae2 chore: cleanup 2025-01-13 18:15:43 +02:00
pax-k
d2a882e531 fix: actually throw an error if getLatestPackageVersions() fails, without falling back to "latest" 2025-01-13 18:11:37 +02:00
pax-k
036fa1f43b chore: changeset 2025-01-13 18:06:41 +02:00
pax-k
839b4af45c fix: fetching latest semver jazz-* package versions from NPM when using create-jazz-app, instead of using "latest" 2025-01-13 18:04:07 +02:00
Trisha Lim
3a9797ce75 Add changeset 2025-01-13 14:48:59 +00:00
Trisha Lim
b2f14c0339 Update examples README 2025-01-13 12:37:57 +00:00
Guido D'Orsi
5d9405ccc3 Merge pull request #1196 from garden-co/changeset-release/main
Version Packages
2025-01-13 12:09:46 +01:00
github-actions[bot]
d54db4358c Version Packages 2025-01-13 11:06:47 +00:00
Guido D'Orsi
a172f61494 fix: types for the WebSocket peer 2025-01-13 12:05:22 +01:00
Guido D'Orsi
225280d37a fix: fix type error and tsconfig 2025-01-12 23:45:40 +01:00
Guido D'Orsi
c735ab6b95 Merge pull request #1195 from garden-co/changeset-release/main
Version Packages
2025-01-12 23:37:50 +01:00
github-actions[bot]
d47e59783f Version Packages 2025-01-12 22:32:21 +00:00
Guido D'Orsi
8a390d255d fix: fix account type registration using the sources for the TS definitions 2025-01-12 23:31:15 +01:00
Guido D'Orsi
03540b22c1 fix: fix prepublish script on jazz-react-native-auth-clerk 2025-01-12 22:58:26 +01:00
Guido D'Orsi
fad96fe4f4 Merge pull request #1194 from garden-co/changeset-release/main
Version Packages
2025-01-12 22:54:05 +01:00
github-actions[bot]
19b706d125 Version Packages 2025-01-12 21:53:34 +00:00
Guido D'Orsi
c871912188 feat(rn): add clearUserCredentials API to programmatically delete the current user stored credentials 2025-01-12 22:52:05 +01:00
Guido D'Orsi
7124bd05c8 Merge pull request #1192 from garden-co/changeset-release/main
Version Packages
2025-01-12 20:13:38 +01:00
github-actions[bot]
783f444cff Version Packages 2025-01-12 15:44:47 +00:00
Guido D'Orsi
0f57687d81 Update .changeset 2025-01-12 16:42:24 +01:00
Guido D'Orsi
235bf1f4e4 Merge pull request #1190 from tobiaslins/fix-react-core-type-error
[jazz-react-core] Fix type error from `useRef`
2025-01-12 16:41:31 +01:00
Trisha Lim
2d7b4b6c82 Update create-jazz-app readme 2025-01-12 14:36:03 +00:00
Trisha Lim
68369c16da Clone example apps in create-jazz-app 2025-01-12 14:30:53 +00:00
Tobias Lins
90f36db63a Fix type error 2025-01-12 15:23:03 +01:00
Trisha Lim
f002110c28 Allow partial options in create-jazz-app 2025-01-12 13:53:37 +00:00
Guido D'Orsi
83513b624e Merge pull request #1187 from garden-co/changeset-release/main
Version Packages
2025-01-12 12:41:54 +01:00
github-actions[bot]
6042250940 Version Packages 2025-01-12 09:54:11 +00:00
Guido D'Orsi
f78c234780 fix(rn): add unstable_enablePackageExports to the metro config 2025-01-12 10:53:03 +01:00
Guido D'Orsi
21efae9276 Merge pull request #1185 from garden-co/changeset-release/main
Version Packages
2025-01-11 16:35:54 +01:00
github-actions[bot]
1e58606ae7 Version Packages 2025-01-11 14:44:01 +00:00
Guido D'Orsi
4a11682316 Merge pull request #1186 from tobiaslins/fix-priority-rn-sqlite
[React Native] Change priority of sqlite to `100`
2025-01-11 15:42:46 +01:00
Tobias Lins
3e92680b08 Update README.md 2025-01-11 15:12:37 +01:00
Tobias Lins
2be47d688b Change priority of sqlite to 100 2025-01-11 15:11:37 +01:00
Guido D'Orsi
2ddccdbca5 Update dull-walls-crash.md 2025-01-11 14:00:02 +01:00
Guido D'Orsi
ab05897cd6 Merge pull request #1183 from tobiaslins/improve-expo-secure-storage
[react native] don't require faceid for every KV operation
2025-01-11 13:56:16 +01:00
Tobias Lins
7cd691f5f0 Create dull-walls-crash.md 2025-01-11 13:48:08 +01:00
Tobias Lins
24a13af657 Improve initialization when using custom kv storage 2025-01-11 13:41:12 +01:00
Tobias Lins
b13530e84b don't require faceid for every get/set 2025-01-11 11:09:56 +01:00
Guido D'Orsi
3911b72f87 docs: fix version number on the rn upgrade docs 2025-01-11 00:23:32 +01:00
Guido D'Orsi
ec278cfcd8 Merge pull request #1182 from garden-co/changeset-release/main
Version Packages
2025-01-11 00:22:19 +01:00
github-actions[bot]
912730378e Version Packages 2025-01-10 21:59:07 +00:00
Guido D'Orsi
ac35f19f01 Merge pull request #1130 from tobiaslins/rn-storage-sqlite
feat: sqlite react native storage
2025-01-10 22:58:03 +01:00
Guido D'Orsi
c25a1af96e feat: update test and add active account management to testing utils 2025-01-10 17:20:47 +01:00
Guido D'Orsi
70667d06a1 fix: cover FileStream and createImage 2025-01-10 17:02:07 +01:00
Guido D'Orsi
31fd994d83 Merge pull request #1180 from garden-co/jazz-636-add-test-for-react-starter-app
Fix and test react starter app
2025-01-10 16:53:42 +01:00
Guido D'Orsi
fc934157f6 fix: remove unused import 2025-01-10 16:52:07 +01:00
Guido D'Orsi
0bbded1772 docs: update examples with the new simplified API 2025-01-10 16:50:51 +01:00
Trisha Lim
a6eea34c74 Run starter test 2025-01-10 15:35:16 +00:00
Trisha Lim
3605b746a9 Highlight new lines on upgrade guide 2025-01-10 15:32:02 +00:00
Trisha Lim
4b29a9aaa6 Test react starter app 2025-01-10 15:30:15 +00:00
Trisha Lim
e60a9f4a74 Fix react starter app 2025-01-10 15:26:56 +00:00
Guido D'Orsi
d1d773bc9c feat: make possible to call the load/subscribe/create API without passing me 2025-01-10 16:19:41 +01:00
Guido D'Orsi
55e8a269c0 fix: fix homepage type error 2025-01-10 12:45:42 +01:00
Guido D'Orsi
0db0aadd45 fix: fix homepage type error 2025-01-10 12:38:12 +01:00
Guido D'Orsi
83f3873e03 feat: make the persistence disabled by default 2025-01-10 12:26:14 +01:00
Guido D'Orsi
80fd3e9697 chore: changeset 2025-01-10 12:16:04 +01:00
Guido D'Orsi
bae8268b29 feat: add upgrade docs and option to disable storage 2025-01-10 12:14:16 +01:00
Benjamin S. Leveritt
466c5f695a Revert mark position calculations 2025-01-09 15:30:37 +00:00
Benjamin S. Leveritt
b6a70228ea Tidy up
Remove
2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
ac32c432da Fix test 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
066ac6bf98 Add subscription test 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
ccfa7d9943 Add sync test 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
90c76a01a6 Fix up import/exports 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
807b52cccf Remove unused test 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
fb7c6c6bbf Fix removeMark implementation with tests 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
12e619b990 Add tag type filter 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
aba2f8110c Fix removeMark 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
862e3fc7ed Fix insertMark 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
51fc92759a Add .length method 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
c8fac3381d Refactor mark validation fn 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
9723090f91 Stablises mark resolution 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
4783e08c69 Add annotations 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
34959ff0ec Fixes formatting in tests 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
bec9be84d5 Add subscription tests 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
277ee9d7e4 Add test for sync and loading 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
314518a87f Add tests for position ops 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
c280fa11c3 Add test for splitting nested children 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
929f5785a8 Fix docs
Passing tests

Remove duplicate `createPlainText` from inherited account
2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
9ae92c19ab Fix imports for coPlainText 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
599bb7355e Fix comment 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
ad76a2f44f Fix libs for coPlainText 2025-01-09 14:55:43 +00:00
Anselm Eickhoff
3a3ad44f13 More progress 2025-01-09 14:55:42 +00:00
Anselm Eickhoff
db01bfb0a8 More implementation 2025-01-09 14:55:42 +00:00
Guido D'Orsi
3e9b7e829c Merge pull request #1175 from garden-co/jazz-639-fix-passkey-svelte
Fix imports for passkey-svelte
2025-01-09 15:51:05 +01:00
Benjamin S. Leveritt
530720f2b9 Fix imports 2025-01-09 14:47:23 +00:00
Benjamin S. Leveritt
a5d6d364db Merge pull request #877 from garden-co/benjamin-jazz-534
Bring CoPlainText up to current
2025-01-09 13:05:56 +00:00
Benjamin S. Leveritt
cb7e580942 Simplify Segmenter comment
Co-authored-by: Guido D'Orsi <guido@float.com>
2025-01-09 12:02:51 +00:00
Benjamin S. Leveritt
8653fc7eb1 Improve thrown error for envs missing Segmenter 2025-01-09 12:02:51 +00:00
Benjamin S. Leveritt
d077702250 Move segmenter into constructor
Chore: Fix formatting
2025-01-09 12:02:51 +00:00
Benjamin S. Leveritt
472b15d940 Move segmenter into class 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
f71176b362 Chore: Fix formatting 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
aa5f988776 Fix imports 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
328311e781 Moves Document into component 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
f2875de83d Add comments 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
2108f918b4 Chore: Format source 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
32441bdcd6 Fix export types 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
b80b9c08db Fix exports for rich-text example 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
4f09c94098 Fix libs for coPlainText 2025-01-09 10:58:15 +00:00
pax
5e47f2fb52 Merge pull request #1168 from garden-co/changeset-release/main
Version Packages
2025-01-09 12:22:38 +02:00
github-actions[bot]
47f2f62b4f Version Packages 2025-01-09 10:19:41 +00:00
pax
61642b2536 Merge pull request #1170 from garden-co/feat/anonymous-auth
feat: add Onboarding auth to handle users onboarding without an auth screen
2025-01-09 12:18:12 +02:00
pax-k
20d12c5aa1 chore: formatting 2025-01-09 12:16:56 +02:00
pax-k
dd9ac6e4f8 fix: migrate DemoAuth old localStorage key to new one 2025-01-09 12:16:23 +02:00
Guido D'Orsi
1b7196938f feat: add Onboarding auth to handle users onboarding without an auth screen 2025-01-09 11:11:06 +01:00
pax-k
5d9818914c chore: changeset 2025-01-09 12:08:40 +02:00
pax-k
f33ec81f19 fix: DemoAuth localStorage key name 2025-01-09 12:01:08 +02:00
Guido D'Orsi
a9dbcc29d0 fix: migrate starter to jazz 0.9 2025-01-09 09:35:08 +01:00
Anselm Eickhoff
f30f92d1b6 Merge pull request #1167 from garden-co/fix/set-fixed-version-starter-app
Set fixed version for packages in starter apps (temporary fix)
2025-01-08 22:52:37 +00:00
Trisha Lim
33d250d0e1 Add changeset 2025-01-08 22:27:33 +00:00
Trisha Lim
f025ffa7b1 Set fixed version for packages in starter apps 2025-01-08 22:20:00 +00:00
Guido D'Orsi
6467bb89b3 docs: fix ensureLoaded migrate example 2025-01-08 21:58:00 +01:00
Trisha Lim
7fc9195068 Fix face id icon 2025-01-08 18:30:28 +00:00
Guido D'Orsi
2e7e276abf Merge pull request #1158 from garden-co/homepage-doc-improvements
Homepage doc improvements
2025-01-08 19:17:31 +01:00
Guido D'Orsi
cc249d3e8b docs: update the migration docs and comment the TODO 2025-01-08 19:17:21 +01:00
Guido D'Orsi
2db8b35cf7 feat: simplify storage setup and update docs 2025-01-08 18:12:22 +01:00
Anselm
f098002da5 Add todos 2025-01-08 17:03:19 +00:00
Anselm
0b47d279c0 Accounts and migrations docs sketch 2025-01-08 17:03:03 +00:00
Guido D'Orsi
a3234f3912 Merge remote-tracking branch 'origin/main' into pr-rn-storage-sqlite 2025-01-08 16:38:35 +01:00
Guido D'Orsi
2a6f2bbb4b Merge pull request #1144 from garden-co/changeset-release/main
Version Packages
2025-01-08 14:28:34 +01:00
github-actions[bot]
fcdad5d80d Version Packages 2025-01-08 12:05:19 +00:00
Guido D'Orsi
dfa15c1e0f Merge pull request #1128 from garden-co/next
Jazz 0.9.0 - Top level imports for hooks and simplified app setup
2025-01-08 13:04:05 +01:00
Guido D'Orsi
bead3462e7 Merge pull request #1151 from garden-co/react-0.9.0-migration-docs
feat(svelte): syncronously resolve local values in useCoState
2025-01-08 12:57:00 +01:00
Guido D'Orsi
246f91937c feat(svelte): syncronously resolve local values in useCoState 2025-01-08 12:49:41 +01:00
Guido D'Orsi
468de3d3af Merge pull request #1150 from garden-co/react-0.9.0-migration-docs
docs: migration docs for rn, vue and svelte
2025-01-08 12:49:15 +01:00
Guido D'Orsi
ee292b8855 docs: migration docs for rn, vue and svelte 2025-01-08 12:40:26 +01:00
Guido D'Orsi
38a6361aed Merge remote-tracking branch 'origin/main' into next 2025-01-08 12:28:01 +01:00
Guido D'Orsi
0231650b6b Merge pull request #1148 from garden-co/styling/code-snippet
Styling improvements for code snippets
2025-01-08 12:26:36 +01:00
Guido D'Orsi
35e4af88d0 Merge pull request #1139 from garden-co/top-level-imports-vue
feat(jazz-vue): simplify app setup and make composables available as top-level imports
2025-01-08 12:01:29 +01:00
Guido D'Orsi
a44a1496ca Merge pull request #1145 from garden-co/react-0.9.0-migration-docs
docs: migration docs for jazz-react 0.9.0
2025-01-08 11:26:15 +01:00
Tobias Lins
7ebc77c95f Update chat.tsx 2025-01-08 09:54:55 +01:00
Tobias Lins
de20b17989 Update App.tsx 2025-01-08 09:53:37 +01:00
Tobias Lins
cae4b244e8 Update polyfills.js 2025-01-08 09:52:53 +01:00
Tobias Lins
eed5aec08d Cleanup 2025-01-08 09:51:29 +01:00
Tobias Lins
90fa0e0588 Merge remote-tracking branch 'upstream/main' into rn-storage-sqlite 2025-01-08 09:26:44 +01:00
Trisha Lim
9b1361a009 Styling improvements for code snippets 2025-01-07 20:50:14 +00:00
Giordano Ricci
ad8b962255 Merge pull request #1146 from garden-co/gio/status-page
Feat: add status page to homepage
2025-01-07 18:31:17 +00:00
Guido D'Orsi
2269bd4d8f docs: improvements 2025-01-07 19:28:27 +01:00
Giordano Ricci
ce977cdb46 update queries & color map 2025-01-07 18:26:55 +00:00
Giordano Ricci
8065c8515c add fallback 2025-01-07 18:05:32 +00:00
Giordano Ricci
4e292e0253 remove unstable cache 2025-01-07 17:57:26 +00:00
Guido D'Orsi
b3bd55f969 chore: add comment 2025-01-07 18:51:06 +01:00
Guido D'Orsi
dd91354eb4 docs: migration docs for jazz-react 0.9.0 2025-01-07 18:51:05 +01:00
Guido D'Orsi
27c294166b Merge remote-tracking branch 'origin/main' into next 2025-01-07 18:50:47 +01:00
Giordano Ricci
c8e783fa33 make slogan optional, remove it from status page 2025-01-07 17:47:02 +00:00
Giordano Ricci
90325c18eb remove apex styling 2025-01-07 17:46:29 +00:00
Giordano Ricci
b5ae832fe7 add GRAFANA_SERVICE_ACCOUNT to turbo 2025-01-07 17:43:39 +00:00
Giordano Ricci
03897e0a5f remove apexchart, cache 2025-01-07 17:31:58 +00:00
Guido D'Orsi
0cdf004902 Merge pull request #1129 from garden-co/jazz-621-add-upgrade-guides-section-to-document-breaking-changes
Add upgrade guides section to docs
2025-01-07 17:10:23 +01:00
Guido D'Orsi
9dd8d9510b feat: simplify app setup and make hooks available as top-level imports 2025-01-07 16:08:31 +01:00
Giordano Ricci
f56663c4cf fix queries/data 2025-01-07 13:55:08 +00:00
Guido D'Orsi
6de44dd8d1 feat: move the common test API to jazz-tools 2025-01-07 14:36:12 +01:00
Trisha Lim
e8dc5eb07c Status page styling (#1136) 2025-01-07 13:24:35 +00:00
Guido D'Orsi
5669e346f8 test: remove flaky tests 2025-01-07 14:05:45 +01:00
Guido D'Orsi
41e88b82b7 Merge pull request #1117 from garden-co/react-native-top-level-hooks
feat: top-level imports for react native hooks
2025-01-07 14:04:23 +01:00
Guido D'Orsi
97e7c7ce13 Merge pull request #1077 from garden-co/perf-bulk-operations
feat: add the assign method to RawCoMap to create bulk transactions and optimize RawCoMap init
2025-01-07 14:03:52 +01:00
Guido D'Orsi
7fea37b0a3 Merge pull request #1081 from garden-co/coList-appendItems
feat: add the appendItems method to CoList to add many items in a single transaction
2025-01-07 14:03:37 +01:00
Guido D'Orsi
b97a0954b2 Merge pull request #1143 from garden-co/fix/rn-key-username
fix(DemoAuth): fix username key serialization
2025-01-07 13:33:12 +01:00
pax-k
afe73c05fe chore: cleanup 2025-01-07 14:31:44 +02:00
github-actions[bot]
459eafccd0 Version Packages 2025-01-07 12:21:13 +00:00
Guido D'Orsi
816333a4a8 fix: handle re-login after an auth failure 2025-01-07 13:20:56 +01:00
Guido D'Orsi
b6345ac469 fix: Fix the double context creation in React development mode 2025-01-07 13:12:39 +01:00
Guido D'Orsi
9f01d9c73a fix: improve error management when loading existing accounts 2025-01-07 13:08:52 +01:00
Guido D'Orsi
1da4d558b1 fix(DemoAuth): fix username key serialization 2025-01-07 12:56:21 +01:00
Anselm Eickhoff
559e3360a4 Merge pull request #1141 from garden-co/jazz-626-move-book-shelf-example-into-personal-repo
Remove book shelf app
2025-01-07 11:48:07 +00:00
Guido D'Orsi
be922788f6 Merge pull request #1140 from garden-co/fix/react-starter
Fix: missing dependencies in react starter
2025-01-07 12:36:44 +01:00
Trisha Lim
09d32ee5f2 Add changeset 2025-01-07 11:17:12 +00:00
Trisha Lim
0547ea823d Remove book shelf app 2025-01-07 11:16:53 +00:00
Trisha Lim
a7aa70bd8f Fix: missing dependencies in react starter 2025-01-07 11:04:37 +00:00
Guido D'Orsi
ee9f868bb4 chore: use pnpm to run the prepublishOnly hook 2025-01-07 11:59:07 +01:00
Guido D'Orsi
133abd5d8f Merge pull request #1125 from garden-co/changeset-release/main
Version Packages
2025-01-07 11:47:02 +01:00
github-actions[bot]
1a789717f0 Version Packages 2025-01-07 10:15:13 +00:00
Trisha Lim
d4d98c4b48 Create react starter app for create-jazz-app (#1112) 2025-01-07 10:14:02 +00:00
Anselm Eickhoff
f4fc60707f More progress 2025-01-07 07:51:07 +00:00
Anselm Eickhoff
8527c3fef9 More plaintext progress 2025-01-07 07:50:26 +00:00
Anselm Eickhoff
c279174465 Rich text progress 2025-01-07 07:50:26 +00:00
Anselm
49fa18825b Progress on text 2025-01-07 07:50:26 +00:00
Anselm
32d7dca15b More implementation 2025-01-07 07:50:25 +00:00
Anselm
8ba2d47e48 Implement RawCoPlainText 2025-01-07 07:40:30 +00:00
Giordano Ricci
290ea0f234 wip: status page first commit 2025-01-06 11:46:11 +00:00
Tobias Lins
c4d5cad2d4 Fixes 2025-01-05 10:53:59 +01:00
Tobias Lins
718543cf83 fix tx support 2025-01-04 16:52:05 +01:00
Tobias Lins
ca8f21358e Move to other library 2025-01-04 12:42:22 +01:00
Guido D'Orsi
d56fc0874c Merge pull request #1118 from garden-co/svelte-top-level-hooks
feat: top-level imports for svelte hooks
2025-01-04 12:23:20 +01:00
Tobias Lins
d09584fa88 WIP sqlite react native storage 2025-01-04 11:24:13 +01:00
Guido D'Orsi
ade4890ede chore: changeset 2025-01-03 18:45:36 +01:00
Guido D'Orsi
b734c66a90 fix(testing): mock crypto functions incompatible with jsDom 2025-01-03 18:44:00 +01:00
Trisha Lim
bc979ba26e Hide/show content based on framework 2025-01-03 17:20:14 +00:00
Guido D'Orsi
906acaf417 fix: handle kvStore init inside RNDemoAuth 2025-01-03 18:11:28 +01:00
Trisha Lim
432724f63e Render example guide 2025-01-03 17:09:42 +00:00
Guido D'Orsi
51d8fb7e77 Merge pull request #1127 from tobiaslins/fix-chat-rn-example
[react native] Fix permissions of messages and fix chat loading
2025-01-03 18:03:16 +01:00
Guido D'Orsi
1e5e3a1599 feat: top-level imports for react native hooks 2025-01-03 17:45:45 +01:00
Guido D'Orsi
37699c1831 test: update svelte tests 2025-01-03 17:45:14 +01:00
Guido D'Orsi
6c6da24281 feat: top-level imports for svelte hooks 2025-01-03 17:45:13 +01:00
Guido D'Orsi
2d85476433 chore: update the version history example 2025-01-03 17:39:14 +01:00
Trisha Lim
cdc8a6b568 Add example guides 2025-01-03 15:22:01 +00:00
Trisha Lim
1b539483d1 Add page in docs for upgrade guides 2025-01-03 14:37:20 +00:00
Guido D'Orsi
25eab61cd0 Merge pull request #1104 from garden-co/jazz-361-make-jazz-react-hooks-global
feat: top-level imports for Jazz react hooks
2025-01-03 15:16:37 +01:00
Guido D'Orsi
43a782937f chore: update docs 2025-01-03 15:16:10 +01:00
Guido D'Orsi
de1a3ee84a Update homepage/homepage/app/docs/[framework]/[...slug]/project-setup/react.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-01-03 15:14:33 +01:00
Tobias Lins
315a00bcb5 Update chat.tsx 2025-01-03 14:42:17 +01:00
Tobias Lins
ed4ee686b5 Fix permissions of messages and fix chat loading 2025-01-03 14:38:44 +01:00
Anselm Eickhoff
b4dc466526 Merge pull request #1120 from garden-co/jazz-608-add-version-history-example-app
Add version history example app
2025-01-03 11:27:10 +00:00
Trisha Lim
af9ea3dc4b Change key type to string 2025-01-03 11:21:44 +00:00
Guido D'Orsi
67abc0e437 Merge pull request #1103 from garden-co/jazz-616-simplify-the-create-calls-by-accepting-account-group-as
feat: simplify the .create calls by accepting Account | Group as second param
2025-01-03 11:54:07 +01:00
Guido D'Orsi
b12eb407cb Merge remote-tracking branch 'origin/main' into jazz-361-make-jazz-react-hooks-global 2025-01-03 11:10:11 +01:00
Guido D'Orsi
2034ef2dcb Merge pull request #1123 from garden-co/changeset-release/main
Version Packages
2025-01-02 22:31:49 +01:00
github-actions[bot]
343b4c0c80 Version Packages 2025-01-02 21:30:25 +00:00
Guido D'Orsi
41e4083f97 Merge pull request #1124 from garden-co/fix-range-error-flatMap
fix: handle circular references in group inheritance
2025-01-02 22:29:16 +01:00
Guido D'Orsi
15f81e889f fix: handle circular references in group inheritance 2025-01-02 22:18:12 +01:00
Guido D'Orsi
8d7fb18a08 Merge pull request #1122 from garden-co/fix-range-error-flatMap
fix(permissions): fix group self-extension
2025-01-02 21:24:40 +01:00
Guido D'Orsi
43378ef2b7 fix(permissions): fix group self-extension 2025-01-02 21:20:35 +01:00
Trisha Lim
1ca1d15639 Update readme 2025-01-02 18:04:34 +00:00
Trisha Lim
bdd67ef34d Add version history example to examples page 2025-01-02 17:55:10 +00:00
Trisha Lim
dc62b9569b Add changeset 2025-01-02 17:55:10 +00:00
Trisha Lim
6fd920face Add verstion history example app 2025-01-02 17:55:10 +00:00
Guido D'Orsi
0689ed3767 Merge pull request #1121 from garden-co/changeset-release/main
Version Packages
2025-01-02 18:35:58 +01:00
github-actions[bot]
a4e1aa7f56 Version Packages 2025-01-02 17:35:18 +00:00
Guido D'Orsi
ca5d7cb2ee Merge pull request #1119 from garden-co/fix-range-error-flatMap
fix(permissions): fixes the transactions collection to avoid RangeError issues
2025-01-02 18:34:10 +01:00
Guido D'Orsi
25dfd90c5a fix(permissions): fixes the transactions collection to avoid RangeError issues 2025-01-02 18:25:53 +01:00
Guido D'Orsi
90096d65e9 chore: remove unused import 2025-01-02 17:22:03 +01:00
Guido D'Orsi
0e7f1aa44a chore: move platform agnostic code in jazz-react-core 2025-01-02 16:52:24 +01:00
Guido D'Orsi
66badc061e Merge pull request #1099 from garden-co/changeset-release/main
Version Packages
2025-01-02 16:31:02 +01:00
github-actions[bot]
eecdd5215e Version Packages 2025-01-02 13:48:31 +00:00
Guido D'Orsi
99b9605579 Merge pull request #1094 from garden-co/jazz-612-give-the-ability-to-reader-writer-and-writeonly-roles-to-set
feat: give the ability to extend a group to users that have any access to the parent
2025-01-02 14:47:13 +01:00
Guido D'Orsi
830f0c00ca Merge pull request #1116 from garden-co/fix/load-with-empty-schema
fix(CoMap): fix loading of CoMaps with an empty schema
2025-01-02 14:17:41 +01:00
Guido D'Orsi
635e824eb0 fix(CoMap): fix loading of CoMaps with an empty schema 2025-01-02 14:14:25 +01:00
Trisha Lim
c2a55c09e0 Fix indention 2025-01-02 12:59:50 +00:00
Trisha Lim
33b64743ed Make preview interactive in react guide 2025-01-02 12:59:50 +00:00
Trisha Lim
74a419e2df Add comment 2025-01-02 12:59:12 +00:00
Trisha Lim
170e135c79 Remove render-code-samples from turbo.json 2025-01-02 12:59:12 +00:00
Trisha Lim
305917236e Exclude h1 from table of contents 2025-01-02 12:59:12 +00:00
Guido D'Orsi
68932ee4ce feat(react): hard deprecate the previous way of creating React Jazz apps 2025-01-02 13:38:17 +01:00
Guido D'Orsi
71e881afcb Merge pull request #1109 from garden-co/fix/missing-titles
Add titles to doc pages
2025-01-02 10:44:17 +01:00
Trisha Lim
f32af158f0 Add titles to doc pages 2024-12-31 15:13:47 +00:00
Guido D'Orsi
cf22cfcc88 fix: fix typescript errors 2024-12-30 19:15:04 +01:00
Guido D'Orsi
c5b5eacba5 docs(guide): fix the snippets indentation 2024-12-30 18:34:53 +01:00
Guido D'Orsi
380bcb2d14 chore: simplfy comment about the AccountSchema registration 2024-12-30 18:21:32 +01:00
Guido D'Orsi
956a4d1b5e chore: migrate to use top-level hook imports 2024-12-30 18:16:06 +01:00
Guido D'Orsi
b7fb4b4b0b docs: update React docs to use the top-level imports 2024-12-30 18:15:09 +01:00
Guido D'Orsi
4433745cff feat: simplify App creation and make the hooks available as top-level imports 2024-12-30 18:14:57 +01:00
Guido D'Orsi
8eda79227b perf(subscribe): add an option to resolve locally available CoValues syncronously 2024-12-30 18:11:19 +01:00
Guido D'Orsi
1a3ec55e6e feat: makes possible to directly import the crypto module 2024-12-30 17:53:35 +01:00
Anselm Eickhoff
e0d9bb3db3 Merge pull request #1105 from garden-co/jazz-615-remove-demo-and-code-from-examples 2024-12-30 15:24:22 +00:00
Guido D'Orsi
93f73b3b86 Merge pull request #1069 from garden-co/jazz-598-add-form-design-pattern-to-docs
Add form design pattern to docs
2024-12-30 16:10:59 +01:00
Guido D'Orsi
7e96af0602 Merge pull request #1106 from garden-co/jazz-613-add-docs-for-create-jazz-app
Mention create-jazz-app in docs
2024-12-30 16:10:11 +01:00
Trisha Lim
3a5d8d1ff4 Remove example demos 2024-12-30 14:55:19 +00:00
Trisha Lim
d558c085e6 Mention create-jazz-app in docs 2024-12-30 14:53:14 +00:00
Trisha Lim
07e52f50b3 Remove sentence about list of orders 2024-12-30 14:40:19 +00:00
Trisha Lim
9a775c67d5 Link to docs from example readme 2024-12-30 14:35:25 +00:00
Trisha Lim
a64d05f9a5 Simplify form design pattern docs 2024-12-30 14:30:10 +00:00
Trisha Lim
e43a6d4418 Address feedback 2024-12-30 11:56:34 +00:00
Trisha Lim
70182c5b28 Add form design pattern to docs 2024-12-30 11:56:34 +00:00
Guido D'Orsi
1de26f8be9 feat: simplify the .create calls by accepting Account | Group as second param 2024-12-30 12:11:51 +01:00
Anselm Eickhoff
af6c0878c3 Merge pull request #1101 from garden-co/gcmp-hp-fixes
More blog fixes
2024-12-30 11:01:45 +00:00
Anselm
579384a6df Update socials 2024-12-30 10:50:08 +00:00
Anselm
3376a02fde Fix OG pictures 2024-12-30 10:09:33 +00:00
Anselm Eickhoff
8440699193 Merge pull request #1091 from garden-co/jazz-611-missing-inbox-error 2024-12-29 15:12:04 +00:00
Anselm Eickhoff
d7f4ba5b9e Merge pull request #1098 from garden-co/docs/collapse-auth-items 2024-12-29 12:38:03 +00:00
Anselm Eickhoff
58a785db40 Merge pull request #1097 from garden-co/explode-docs-nav 2024-12-29 12:37:51 +00:00
Trisha Lim
7546e8bffc Docs side nav: move examples higher, collapse auth items 2024-12-29 11:03:41 +00:00
Guido D'Orsi
10ea7332e6 feat: give the ability to extend a group to users that have any access to the parent 2024-12-27 21:16:50 +01:00
Guido D'Orsi
0a859821bc feat(Account): remove the requirement of calling super.migrate when defining the account migration 2024-12-27 11:35:14 +01:00
Anselm
b9408c6119 Fix OG some more 2024-12-26 16:25:10 +00:00
Anselm
c6c26b0ad1 Fix metadata 2024-12-26 16:23:31 +00:00
Guido D'Orsi
0489d4a894 feat: add the appendItems method to CoList to add many items in a single transaction 2024-12-23 12:35:55 +01:00
Guido D'Orsi
1ef3226ed8 feat: add the assign method to RawCoMap to create bulk transactions and optimize RawCoMap init 2024-12-23 11:09:23 +01:00
538 changed files with 22109 additions and 6696 deletions

52
.github/workflows/build-starters.yaml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Build Starters
on:
push:
branches: [ "main" ]
jobs:
build-starters:
runs-on: ubuntu-latest
strategy:
matrix:
starter: [
"react-demo-auth-tailwind",
]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Enable corepack
run: corepack enable
- 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
run: |
pnpm install
pnpm turbo build;
working-directory: ./starters/${{ matrix.starter }}

View File

@@ -13,7 +13,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "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:
- uses: actions/checkout@v3

View File

@@ -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

View File

@@ -1,297 +0,0 @@
# jazz-example-book-shelf
## 0.1.35
### Patch Changes
- Updated dependencies [fa41f8e]
- Updated dependencies [88d7d9a]
- Updated dependencies [60e35ea]
- jazz-tools@0.8.45
- jazz-react@0.8.45
- jazz-browser-media-images@0.8.45
## 0.1.34
### Patch Changes
- jazz-react@0.8.44
- jazz-tools@0.8.44
- jazz-browser-media-images@0.8.44
## 0.1.33
### Patch Changes
- jazz-react@0.8.41
- jazz-tools@0.8.41
- jazz-browser-media-images@0.8.41
## 0.1.32
### Patch Changes
- jazz-browser-media-images@0.8.40
- jazz-react@0.8.40
## 0.1.31
### Patch Changes
- Updated dependencies [249eecb]
- jazz-tools@0.8.39
- jazz-browser-media-images@0.8.39
- jazz-react@0.8.39
## 0.1.30
### Patch Changes
- jazz-react@0.8.38
- jazz-tools@0.8.38
- jazz-browser-media-images@0.8.38
## 0.1.29
### Patch Changes
- jazz-react@0.8.37
- jazz-tools@0.8.37
- jazz-browser-media-images@0.8.37
## 0.1.28
### Patch Changes
- Updated dependencies [441fe27]
- jazz-tools@0.8.36
- jazz-react@0.8.36
- jazz-browser-media-images@0.8.36
## 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

View File

@@ -1,4 +0,0 @@
FROM caddy:2.7.3-alpine
LABEL org.opencontainers.image.source="https://github.com/garden-co/jazz"
COPY ./dist /usr/share/caddy/

View File

@@ -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).

View File

@@ -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

View File

@@ -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.

View File

@@ -1,4 +0,0 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
export default nextConfig;

View File

@@ -1,29 +0,0 @@
{
"name": "jazz-example-book-shelf",
"version": "0.1.35",
"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.45",
"jazz-react": "workspace:0.8.45",
"jazz-tools": "workspace:0.8.45",
"next": "14.2.5",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^22.5.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.15",
"typescript": "~5.6.2"
}
}

View File

@@ -1,8 +0,0 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};
export default config;

View File

@@ -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>
);
}

View File

@@ -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

View File

@@ -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;
}
}

View File

@@ -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>
);
}

View File

@@ -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>
);
}

View File

@@ -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>
);
}

View File

@@ -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} />;
}

View File

@@ -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>
);
}

View File

@@ -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>
);
}

View File

@@ -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>
);
}

View File

@@ -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>
);
}

View File

@@ -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} />
)}
</>
);
}

View File

@@ -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>
);
}

View File

@@ -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>
);
}

View File

@@ -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>
);
}

View File

@@ -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}&apos;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>
);
}

View File

@@ -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>
);
}

View File

@@ -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>
);
}

View File

@@ -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);
}
}

View File

@@ -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;

View File

@@ -1,5 +1,185 @@
# chat-rn-clerk
## 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

View File

@@ -37,7 +37,13 @@
],
"expo-secure-store",
"expo-font",
"expo-router"
"expo-router",
[
"expo-image-picker",
{
"photosPermission": "The app accesses your photos to let you share them with your friends."
}
]
],
"extra": {
"eas": {

View File

@@ -1,9 +1,12 @@
import { useAccount, useCoState } from "@/src/jazz";
import { Chat, Message } from "@/src/schema";
import { useFocusEffect, useNavigation } from "@react-navigation/native";
import { useNavigation } from "@react-navigation/native";
import clsx from "clsx";
import * as Clipboard from "expo-clipboard";
import * as ImagePicker from "expo-image-picker";
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 { useEffect, useLayoutEffect, useState } from "react";
import React, {
@@ -16,6 +19,8 @@ import React, {
KeyboardAvoidingView,
TextInput,
Button,
Image,
ActivityIndicator,
} from "react-native";
export default function Conversation() {
@@ -25,6 +30,7 @@ export default function Conversation() {
const [message, setMessage] = useState("");
const loadedChat = useCoState(Chat, chat?.id, [{}]);
const navigation = useNavigation();
const [isUploading, setIsUploading] = useState(false);
useEffect(() => {
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 isMe = item._edits.text.by?.isMe;
return (
@@ -106,14 +138,27 @@ export default function Conversation() {
isMe ? "flex-row" : "flex-row",
)}
>
<Text
className={clsx(
!isMe ? "text-black" : "text-gray-200",
`text-md max-w-[85%]`,
)}
>
{item.text}
</Text>
{item.image && (
<ProgressiveImg image={item.image} maxWidth={1024}>
{({ src, res, originalSize }) => (
<Image
source={{ uri: src }}
className="w-48 h-48 rounded-lg mb-2"
resizeMode="cover"
/>
)}
</ProgressiveImg>
)}
{item.text && (
<Text
className={clsx(
!isMe ? "text-black" : "text-gray-200",
`text-md max-w-[85%]`,
)}
>
{item.text}
</Text>
)}
<Text
className={clsx(
"text-[10px] text-right ml-2",
@@ -147,6 +192,17 @@ export default function Conversation() {
className="p-3 bg-white border-t border-gray-300"
>
<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
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}

View File

@@ -11,7 +11,7 @@ import React, {
} from "react-native";
import { useUser } from "@clerk/clerk-expo";
import { useAccount } from "../../src/jazz";
import { useAccount } from "jazz-react-native";
import { Chat } from "../../src/schema";
export default function ChatScreen() {

View File

@@ -1,7 +1,7 @@
{
"name": "chat-rn-clerk",
"main": "index.js",
"version": "1.0.37",
"version": "1.0.56",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",
@@ -20,6 +20,7 @@
"@bam.tech/react-native-image-resizer": "^3.0.11",
"@clerk/clerk-expo": "^2.2.21",
"@expo/vector-icons": "^14.0.2",
"@op-engineering/op-sqlite": "^11.2.12",
"@react-native-community/netinfo": "^11.4.1",
"@react-navigation/native": "^7.0.13",
"@react-navigation/native-stack": "^7.1.14",
@@ -34,6 +35,7 @@
"expo-dev-client": "~5.0.5",
"expo-file-system": "^18.0.4",
"expo-font": "~13.0.1",
"expo-image-picker": "~16.0.4",
"expo-linking": "~7.0.3",
"expo-router": "~4.0.11",
"expo-secure-store": "~14.0.0",

View File

@@ -1,15 +1,8 @@
import { useClerk, useUser } from "@clerk/clerk-expo";
import { JazzProvider, setupKvStore } from "jazz-react-native";
import { useJazzClerkAuth } from "jazz-react-native-auth-clerk";
import React, {
createContext,
PropsWithChildren,
useContext,
useEffect,
useState,
} from "react";
import React, { createContext, PropsWithChildren, useContext } from "react";
import { Text, View } from "react-native";
import { Jazz, kvStore } from "./jazz";
const AuthContext = createContext<{
isAuthenticated: boolean;
isLoading: boolean;
@@ -22,19 +15,13 @@ export function useAuth() {
return useContext(AuthContext);
}
const kvStore = setupKvStore();
export function JazzAndAuth({ children }: PropsWithChildren) {
const { isSignedIn, isLoaded: isClerkLoaded } = useUser();
const clerk = useClerk();
const [auth, state] = useJazzClerkAuth(clerk, kvStore);
const [isAuthenticated, setIsAuthenticated] = useState(false);
useEffect(() => {
if (isSignedIn && isClerkLoaded && auth) {
setIsAuthenticated(true);
} else {
setIsAuthenticated(false);
}
}, [isSignedIn, isClerkLoaded, auth]);
const isAuthenticated = Boolean(isSignedIn && isClerkLoaded && auth);
return (
<AuthContext.Provider
@@ -47,13 +34,13 @@ export function JazzAndAuth({ children }: PropsWithChildren) {
</View>
))}
{auth && clerk.user ? (
<Jazz.Provider
<JazzProvider
auth={auth}
storage="sqlite"
peer="wss://cloud.jazz.tools/?key=chat-rn-clerk-example-jazz@garden.co"
storage={undefined}
>
{children}
</Jazz.Provider>
</JazzProvider>
) : (
children
)}

View File

@@ -1,4 +0,0 @@
import { createJazzRNApp } from "jazz-react-native";
export const Jazz = createJazzRNApp();
export const { useAccount, useCoState, useAcceptInvite, kvStore } = Jazz;

View File

@@ -1,7 +1,8 @@
import { CoList, CoMap, co } from "jazz-tools";
import { CoList, CoMap, ImageDefinition, co } from "jazz-tools";
export class Message extends CoMap {
text = co.string;
image = co.optional.ref(ImageDefinition);
}
export class Chat extends CoList.Of(co.ref(Message)) {}

View File

@@ -1,5 +1,151 @@
# chat-rn
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.34",
"version": "1.0.53",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",
@@ -13,6 +13,7 @@
},
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
"@op-engineering/op-sqlite": "^11.2.12",
"@react-native-community/netinfo": "^11.4.1",
"@react-navigation/native": "^7.0.13",
"@react-navigation/native-stack": "^7.1.14",

View File

@@ -9,9 +9,8 @@ import * as Linking from "expo-linking";
import React, { StrictMode, useEffect, useState } from "react";
import HandleInviteScreen from "./invite";
import { DemoAuthBasicUI, useDemoAuth } from "jazz-react-native";
import { DemoAuthBasicUI, JazzProvider, useDemoAuth } from "jazz-react-native";
import ChatScreen from "./chat";
import { Jazz } from "./jazz";
const Stack = createNativeStackNavigator();
@@ -34,7 +33,6 @@ function App() {
"ChatScreen" | "HandleInviteScreen"
>("ChatScreen");
const navigationRef = useNavigationContainerRef();
useEffect(() => {
Linking.getInitialURL().then((url) => {
if (url) {
@@ -51,10 +49,10 @@ function App() {
return (
<StrictMode>
<Jazz.Provider
<JazzProvider
auth={auth}
storage="sqlite"
peer="wss://cloud.jazz.tools/?key=chat-rn-example-jazz@garden.co"
storage={undefined}
>
<NavigationContainer linking={linking} ref={navigationRef}>
<Stack.Navigator initialRouteName={initialRoute}>
@@ -70,7 +68,7 @@ function App() {
/>
</Stack.Navigator>
</NavigationContainer>
</Jazz.Provider>
</JazzProvider>
{state.state !== "signedIn" ? (
<DemoAuthBasicUI appName="Jazz Chat" state={state} />
) : null}

View File

@@ -14,50 +14,40 @@ import React, {
Alert,
} from "react-native";
import { useAccount, useCoState } from "./jazz";
import { useAccount, useCoState } from "jazz-react-native";
import { Chat, Message } from "./schema";
export default function ChatScreen({ navigation }: { navigation: any }) {
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 loadedChat = useCoState(Chat, chat?.id, [{}]);
useEffect(() => {
navigation.setOptions({
headerRight: () => <Button onPress={logOut} title="Logout" />,
headerLeft: () =>
chat ? (
loadedChat ? (
<Button
onPress={() => {
if (chat?.id) {
if (loadedChat?.id) {
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"
/>
) : null,
});
}, [navigation, chat]);
}, [navigation, loadedChat]);
const createChat = () => {
const group = Group.create({ owner: me });
group.addMember("everyone", "writer");
const chat = Chat.create([], { owner: group });
setChat(chat);
};
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}`);
}
setChatId(chat.id);
};
const joinChat = () => {
@@ -73,7 +63,7 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
text: "Join",
onPress: (chatId) => {
if (chatId) {
loadChat(chatId as ID<Chat>);
setChatId(chatId as ID<Chat>);
} else {
Alert.alert("Error", "Chat ID cannot be empty.");
}
@@ -85,9 +75,11 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
};
const sendMessage = () => {
if (!chat) return;
if (!loadedChat) return;
if (message.trim()) {
chat.push(Message.create({ text: message }, { owner: chat._owner }));
loadedChat.push(
Message.create({ text: message }, { owner: loadedChat?._owner }),
);
setMessage("");
}
};
@@ -137,7 +129,7 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
return (
<View className="flex flex-col h-full">
{!chat ? (
{!loadedChat ? (
<View className="flex flex-col h-full items-center justify-center">
<TouchableOpacity
onPress={createChat}

View File

@@ -1,13 +1,7 @@
import { useAcceptInvite } from "jazz-react-native";
import React, { Text } from "react-native";
import { useAcceptInvite } from "./jazz";
import { Chat } from "./schema";
type ChatScreenParams = {
valueHint?: string;
valueID?: string;
inviteSecret?: string;
};
export default function HandleInviteScreen({
navigation,
}: {

View File

@@ -1,4 +0,0 @@
import { createJazzRNApp } from "jazz-react-native";
export const Jazz = createJazzRNApp();
export const { useAccount, useCoState, useAcceptInvite } = Jazz;

View File

@@ -1,5 +1,130 @@
# chat-vue
## 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

View File

@@ -1,29 +1,59 @@
# 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
npx degit gardencmp/jazz jazz
npm create jazz-app@latest --example chat-vue --project-name chat-vue
```
or
```bash
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
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
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
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## 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.

View File

@@ -1,6 +1,6 @@
{
"name": "chat-vue",
"version": "0.0.26",
"version": "0.0.40",
"private": true,
"type": "module",
"scripts": {

View File

@@ -9,9 +9,9 @@
</template>
<script setup lang="ts">
import { useAccount } from "jazz-vue";
import AppContainer from "./components/AppContainer.vue";
import TopBar from "./components/TopBar.vue";
import { useAccount } from "./main";
const { me, logOut } = useAccount();
</script>

View File

@@ -1,13 +1,9 @@
import { DemoAuthBasicUI, createJazzVueApp, useDemoAuth } from "jazz-vue";
import { DemoAuthBasicUI, JazzProvider, useDemoAuth } from "jazz-vue";
import { createApp, defineComponent, h } from "vue";
import App from "./App.vue";
import "./index.css";
import router from "./router";
const Jazz = createJazzVueApp();
export const { useAccount, useCoState } = Jazz;
const { JazzProvider } = Jazz;
const RootComponent = defineComponent({
name: "RootComponent",
setup() {

View File

@@ -26,12 +26,12 @@
<script lang="ts">
import type { ID } from "jazz-tools";
import { useCoState } from "jazz-vue";
import { type PropType, computed, defineComponent, ref } from "vue";
import ChatBody from "../components/ChatBody.vue";
import ChatBubble from "../components/ChatBubble.vue";
import ChatInput from "../components/ChatInput.vue";
import EmptyChatMessage from "../components/EmptyChatMessage.vue";
import { useCoState } from "../main";
import { Chat, Message } from "../schema";
export default defineComponent({

View File

@@ -4,8 +4,8 @@
<script setup lang="ts">
import { Group } from "jazz-tools";
import { useAccount } from "jazz-vue";
import { useRouter } from "vue-router";
import { useAccount } from "../main";
import { Chat } from "../schema";
const router = useRouter();

View File

@@ -1,5 +1,136 @@
# jazz-example-chat
## 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

View File

@@ -2,30 +2,60 @@
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
npx degit gardencmp/jazz jazz
npm create jazz-app@latest --example chat --project-name chat
```
or
```bash
npx create-jazz-app@latest --example chat --project-name chat
```
Go to the chat example directory:
Go to the new project directory.
```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
pnpm i && npx turbo build
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/chat/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## 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.
@@ -34,4 +64,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.
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).

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.121",
"version": "0.0.136",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,9 +1,13 @@
import { inIframe, onChatLoad } from "@/util.ts";
import { useIframeHashRouter } from "hash-slash";
import { useAccount } from "jazz-react";
import { Group, ID } from "jazz-tools";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { ChatScreen } from "./chatScreen.tsx";
import { useAccount } from "./main.tsx";
import { JazzAndAuth } from "./jazz.tsx";
import { Chat } from "./schema.ts";
import { ThemeProvider } from "./themeProvider.tsx";
import { AppContainer, TopBar } from "./ui.tsx";
export function App() {
@@ -12,9 +16,9 @@ export function App() {
const createChat = () => {
if (!me) return;
const group = Group.create({ owner: me });
const group = Group.create();
group.addMember("everyone", "writer");
const chat = Chat.create([], { owner: group });
const chat = Chat.create([], group);
router.navigate("/#/chat/" + chat.id);
// for https://jazz.tools marketing site demo only
@@ -34,3 +38,13 @@ export function App() {
</AppContainer>
);
}
createRoot(document.getElementById("root")!).render(
<ThemeProvider>
<StrictMode>
<JazzAndAuth>
<App />
</JazzAndAuth>
</StrictMode>
</ThemeProvider>,
);

View File

@@ -1,7 +1,7 @@
import { createImage } from "jazz-browser-media-images";
import { useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import { useState } from "react";
import { useAccount, useCoState } from "./main.tsx";
import { Chat, Message } from "./schema.ts";
import {
BubbleBody,
@@ -18,7 +18,6 @@ import {
export function ChatScreen(props: { chatID: ID<Chat> }) {
const chat = useCoState(Chat, props.chatID, [{}]);
const { me } = useAccount();
const [showNLastMessages, setShowNLastMessages] = useState(30);
if (!chat)
@@ -27,8 +26,6 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
);
const sendImage = (event: React.ChangeEvent<HTMLInputElement>) => {
if (!me?.profile) return;
const file = event.currentTarget.files?.[0];
if (!file) return;
@@ -39,12 +36,7 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
}
createImage(file, { owner: chat._owner }).then((image) => {
chat.push(
Message.create(
{ text: file.name, image: image },
{ owner: chat._owner },
),
);
chat.push(Message.create({ text: file.name, image: image }, chat._owner));
});
};

View File

@@ -0,0 +1,19 @@
import { DemoAuthBasicUI, JazzProvider, useDemoAuth } from "jazz-react";
export function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, state] = useDemoAuth();
return (
<>
<JazzProvider
auth={auth}
peer="wss://cloud.jazz.tools/?key=chat-example-jazz@garden.co"
>
{children}
</JazzProvider>
{state.state !== "signedIn" && (
<DemoAuthBasicUI appName="Jazz Chat" state={state} />
)}
</>
);
}

View File

@@ -1,36 +0,0 @@
import { ThemeProvider } from "@/themeProvider.tsx";
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { App } from "./app.tsx";
const Jazz = createJazzReactApp();
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, state] = useDemoAuth();
return (
<>
<Jazz.Provider
auth={auth}
peer="wss://cloud.jazz.tools/?key=chat-example-jazz@garden.co"
>
{children}
</Jazz.Provider>
{state.state !== "signedIn" && (
<DemoAuthBasicUI appName="Jazz Chat" state={state} />
)}
</>
);
}
createRoot(document.getElementById("root")!).render(
<ThemeProvider>
<StrictMode>
<JazzAndAuth>
<App />
</JazzAndAuth>
</StrictMode>
</ThemeProvider>,
);

View File

@@ -1,5 +1,136 @@
# minimal-auth-clerk
## 0.0.35
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-react@0.9.15
- jazz-react-auth-clerk@0.9.15
## 0.0.34
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-react@0.9.14
- jazz-react-auth-clerk@0.9.14
## 0.0.33
### Patch Changes
- jazz-react@0.9.13
- jazz-react-auth-clerk@0.9.13
- jazz-tools@0.9.13
## 0.0.32
### Patch Changes
- jazz-react@0.9.12
- jazz-react-auth-clerk@0.9.12
- jazz-tools@0.9.12
## 0.0.31
### Patch Changes
- jazz-react@0.9.11
- jazz-react-auth-clerk@0.9.11
- jazz-tools@0.9.11
## 0.0.30
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
- jazz-react-auth-clerk@0.9.10
## 0.0.29
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-react@0.9.9
- jazz-react-auth-clerk@0.9.9
## 0.0.28
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
- jazz-react-auth-clerk@0.9.8
## 0.0.27
### Patch Changes
- jazz-react@0.9.4
- jazz-react-auth-clerk@0.9.4
## 0.0.26
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
- jazz-react-auth-clerk@0.9.1
## 0.0.25
### Patch Changes
- Updated dependencies [956a4d1]
- Updated dependencies [8eda792]
- jazz-react@0.9.0
- jazz-tools@0.9.0
- jazz-react-auth-clerk@0.9.0
## 0.0.24
### Patch Changes
- Updated dependencies [dc62b95]
- Updated dependencies [1de26f8]
- jazz-tools@0.8.51
- jazz-react@0.8.51
- jazz-react-auth-clerk@0.8.51
## 0.0.23
### Patch Changes
- jazz-react@0.8.50
- jazz-react-auth-clerk@0.8.50
- jazz-tools@0.8.50
## 0.0.22
### Patch Changes
- jazz-react@0.8.49
- jazz-react-auth-clerk@0.8.49
- jazz-tools@0.8.49
## 0.0.21
### Patch Changes
- Updated dependencies [635e824]
- Updated dependencies [0a85982]
- jazz-tools@0.8.48
- jazz-react@0.8.48
- jazz-react-auth-clerk@0.8.48
## 0.0.20
### Patch Changes

View File

@@ -4,30 +4,60 @@ This is an example of how to use clerk authentication with Jazz.
Live version: https://clerk-demo.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
npx degit gardencmp/jazz jazz
npm create jazz-app@latest --example clerk --project-name clerk
```
or
```bash
npx create-jazz-app@latest --example clerk --project-name clerk
```
Go to the clerk example directory:
Go to the new project directory.
```bash
cd jazz/examples/clerk
cd clerk
```
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
pnpm i && npx turbo build
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/clerk/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## 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.

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.20",
"version": "0.0.35",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,7 +13,7 @@
"dependencies": {
"@clerk/clerk-react": "^5.4.1",
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:0.8.45",
"jazz-react-auth-clerk": "workspace:0.9.15",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View File

@@ -1,4 +1,4 @@
import { useAccount } from "./main";
import { useAccount } from "jazz-react";
function App() {
const { me, logOut } = useAccount();

View File

@@ -1,10 +1,10 @@
import { ClerkProvider, SignInButton, useClerk } from "@clerk/clerk-react";
import { createJazzReactApp } from "jazz-react";
import { useJazzClerkAuth } from "jazz-react-auth-clerk";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { JazzProvider } from "jazz-react";
// Import your publishable key
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
@@ -13,9 +13,6 @@ if (!PUBLISHABLE_KEY) {
throw new Error("Add your Clerk publishable key to the .env.local file");
}
const Jazz = createJazzReactApp();
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const clerk = useClerk();
const [auth, state] = useJazzClerkAuth(clerk);
@@ -26,12 +23,12 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
<div key={error}>{error}</div>
))}
{clerk.user && auth ? (
<Jazz.Provider
<JazzProvider
auth={auth}
peer="wss://cloud.jazz.tools/?key=minimal-auth-clerk-example@garden.co"
>
{children}
</Jazz.Provider>
</JazzProvider>
) : (
<SignInButton />
)}

View File

@@ -1,5 +1,115 @@
# file-share-svelte
## 0.0.20
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-svelte@0.9.15
## 0.0.19
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-svelte@0.9.14
## 0.0.18
### Patch Changes
- jazz-svelte@0.9.13
- jazz-tools@0.9.13
## 0.0.17
### Patch Changes
- jazz-svelte@0.9.12
- jazz-tools@0.9.12
## 0.0.16
### Patch Changes
- jazz-svelte@0.9.11
- jazz-tools@0.9.11
## 0.0.15
### Patch Changes
- Updated dependencies [5e83864]
- jazz-tools@0.9.10
- jazz-svelte@0.9.10
## 0.0.14
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-svelte@0.9.9
## 0.0.13
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-svelte@0.9.8
## 0.0.12
### Patch Changes
- Updated dependencies [1b71969]
- jazz-tools@0.9.1
- jazz-svelte@0.9.1
## 0.0.11
### Patch Changes
- Updated dependencies [9dd8d95]
- Updated dependencies [8eda792]
- jazz-svelte@0.9.0
- jazz-tools@0.9.0
## 0.0.10
### Patch Changes
- Updated dependencies [dc62b95]
- Updated dependencies [1de26f8]
- jazz-tools@0.8.51
- jazz-svelte@0.8.51
## 0.0.9
### Patch Changes
- jazz-tools@0.8.50
- jazz-svelte@0.8.50
## 0.0.8
### Patch Changes
- jazz-tools@0.8.49
- jazz-svelte@0.8.49
## 0.0.7
### Patch Changes
- Updated dependencies [635e824]
- Updated dependencies [0a85982]
- jazz-tools@0.8.48
- jazz-svelte@0.8.48
## 0.0.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "file-share-svelte",
"version": "0.0.6",
"version": "0.0.20",
"private": true,
"type": "module",
"scripts": {

View File

@@ -3,7 +3,7 @@
import { SharedFile } from '$lib/schema';
import { FileStream } from 'jazz-tools';
import { File, FileDown, Trash2, Link2 } from 'lucide-svelte';
import { useAccount } from '$lib/jazz';
import { useAccount } from 'jazz-svelte';
import { toast } from 'svelte-sonner';
import { formatFileSize } from '$lib/utils';

View File

@@ -1,7 +0,0 @@
import { createJazzApp } from 'jazz-svelte';
import { FileShareAccount } from './schema';
export const { useAccount, useCoState, useAcceptInvite, useAccountOrGuest, Provider } =
createJazzApp({
AccountSchema: FileShareAccount
});

View File

@@ -27,9 +27,7 @@ export class FileShareAccount extends Account {
/** 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.
*/
async migrate(creationProps?: { name: string }) {
super.migrate(creationProps);
async migrate() {
await this._refs.root?.load();
// Initialize root if it doesn't exist

View File

@@ -1,8 +1,17 @@
<script lang="ts" module>
declare module 'jazz-svelte' {
interface Register {
Account: FileShareAccount;
}
}
</script>
<script lang="ts">
import { Provider } from '$lib/jazz';
import { JazzProvider } from 'jazz-svelte';
import { PasskeyAuthBasicUI, usePasskeyAuth } from 'jazz-svelte';
import { Toaster } from 'svelte-sonner';
import '../app.css';
import { FileShareAccount } from '$lib/schema';
let { children } = $props();
const auth = usePasskeyAuth({
@@ -24,9 +33,13 @@
</div>
{/if}
{#if auth.current}
<Provider auth={auth.current} peer="wss://cloud.jazz.tools/?key=file-share-svelte@garden.co">
<JazzProvider
AccountSchema={FileShareAccount}
auth={auth.current}
peer="wss://cloud.jazz.tools/?key=file-share-svelte@garden.co"
>
<div class="min-h-screen bg-gray-100">
{@render children()}
</div>
</Provider>
</JazzProvider>
{/if}

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { useAccount, useCoState } from '$lib/jazz';
import { useAccount, useCoState } from 'jazz-svelte';
import { SharedFile, ListOfSharedFiles } from '$lib/schema';
import { createInviteLink } from 'jazz-svelte';
import { FileStream } from 'jazz-tools';

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { useAccount, useCoState } from '$lib/jazz';
import { useAccount, useCoState } from 'jazz-svelte';
import { SharedFile } from '$lib/schema';
import { File, FileDown, Link2 } from 'lucide-svelte';
import type { ID } from 'jazz-tools';

View File

@@ -1,5 +1,135 @@
# form
## 0.0.31
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-browser-media-images@0.9.15
- jazz-react@0.9.15
## 0.0.30
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-browser-media-images@0.9.14
- jazz-react@0.9.14
## 0.0.29
### Patch Changes
- jazz-react@0.9.13
- jazz-tools@0.9.13
- jazz-browser-media-images@0.9.13
## 0.0.28
### Patch Changes
- jazz-react@0.9.12
- jazz-tools@0.9.12
- jazz-browser-media-images@0.9.12
## 0.0.27
### Patch Changes
- jazz-react@0.9.11
- jazz-tools@0.9.11
- jazz-browser-media-images@0.9.11
## 0.0.26
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
- jazz-browser-media-images@0.9.10
## 0.0.25
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-browser-media-images@0.9.9
- jazz-react@0.9.9
## 0.0.24
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
- jazz-browser-media-images@0.9.8
## 0.0.23
### Patch Changes
- jazz-react@0.9.4
## 0.0.22
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
- jazz-browser-media-images@0.9.1
## 0.0.21
### 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.20
### 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.19
### Patch Changes
- jazz-react@0.8.50
- jazz-tools@0.8.50
- jazz-browser-media-images@0.8.50
## 0.0.18
### Patch Changes
- jazz-react@0.8.49
- jazz-tools@0.8.49
- jazz-browser-media-images@0.8.49
## 0.0.17
### 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.16
### Patch Changes

View File

@@ -15,30 +15,62 @@ which has the same structure as `BubbleTeaOrder`, but with all fields set to `op
When the user is ready to submit the order, we treat `DraftBubbleTeaOrder` as a "real order" by
converting it into a `BubbleTeaOrder`.
## Installing & running the example locally
[See the full guide here.](https://jazz.tools/docs/react/design-patterns/form)
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
## Getting started
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx degit gardencmp/jazz jazz
npm create jazz-app@latest --example form --project-name form
```
or
```bash
npx create-jazz-app@latest --example form --project-name form
```
Go to the form example directory:
Go to the new project directory.
```bash
cd jazz/examples/form
cd form
```
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
pnpm i && npx turbo build
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/form/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## 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.
@@ -47,4 +79,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.
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).

View File

@@ -1,7 +1,7 @@
{
"name": "form",
"private": true,
"version": "0.0.16",
"version": "0.0.31",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,9 +1,9 @@
import { useIframeHashRouter } from "hash-slash";
import { useAccount } from "jazz-react";
import { ID } from "jazz-tools";
import { CreateOrder } from "./CreateOrder.tsx";
import { EditOrder } from "./EditOrder.tsx";
import { Orders } from "./Orders.tsx";
import { useAccount } from "./main";
import { BubbleTeaOrder } from "./schema.ts";
function App() {

View File

@@ -1,10 +1,10 @@
import { useIframeHashRouter } from "hash-slash";
import { useAccount, useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import { useState } from "react";
import { Errors } from "./Errors.tsx";
import { LinkToHome } from "./LinkToHome.tsx";
import { OrderForm } from "./OrderForm.tsx";
import { useAccount, useCoState } from "./main.tsx";
import {
BubbleTeaOrder,
DraftBubbleTeaOrder,
@@ -30,12 +30,9 @@ export function CreateOrder() {
me.root.orders.push(draft as BubbleTeaOrder);
// reset the draft
me.root.draft = DraftBubbleTeaOrder.create(
{
addOns: ListOfBubbleTeaAddOns.create([], { owner: me }),
},
{ owner: me },
);
me.root.draft = DraftBubbleTeaOrder.create({
addOns: ListOfBubbleTeaAddOns.create([]),
});
router.navigate("/");
};

View File

@@ -1,4 +1,4 @@
import { useAccount } from "./main.tsx";
import { useAccount } from "jazz-react";
export function DraftIndicator() {
const { me } = useAccount({

View File

@@ -1,8 +1,8 @@
import { useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import { LinkToHome } from "./LinkToHome.tsx";
import { OrderForm } from "./OrderForm.tsx";
import { OrderThumbnail } from "./OrderThumbnail.tsx";
import { useCoState } from "./main.tsx";
import { BubbleTeaOrder } from "./schema.ts";
export function EditOrder(props: { id: ID<BubbleTeaOrder> }) {

View File

@@ -1,6 +1,6 @@
import { useAccount } from "jazz-react";
import { DraftIndicator } from "./DraftIndicator.tsx";
import { OrderThumbnail } from "./OrderThumbnail.tsx";
import { useAccount } from "./main.tsx";
export function Orders() {
const { me } = useAccount({

View File

@@ -1,27 +1,22 @@
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
import { DemoAuthBasicUI, JazzProvider, useDemoAuth } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { JazzAccount } from "./schema.ts";
const Jazz = createJazzReactApp({
AccountSchema: JazzAccount,
});
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, authState] = useDemoAuth();
return (
<>
<Jazz.Provider
<JazzProvider
auth={auth}
peer="wss://cloud.jazz.tools/?key=form-example@garden.co"
AccountSchema={JazzAccount}
>
{children}
</Jazz.Provider>
</JazzProvider>
{authState.state !== "signedIn" && (
<DemoAuthBasicUI appName="Form" state={authState} />
@@ -30,6 +25,12 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
);
}
declare module "jazz-react" {
interface Register {
Account: JazzAccount;
}
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<JazzAndAuth>

View File

@@ -69,20 +69,19 @@ export class AccountRoot extends CoMap {
export class JazzAccount extends Account {
root = co.ref(AccountRoot);
migrate(this: JazzAccount, creationProps?: { name: string }) {
super.migrate(creationProps);
migrate() {
const account = this;
if (!this._refs.root) {
const ownership = { owner: this };
const orders = ListOfBubbleTeaOrders.create([], ownership);
const orders = ListOfBubbleTeaOrders.create([], account);
const draft = DraftBubbleTeaOrder.create(
{
addOns: ListOfBubbleTeaAddOns.create([], ownership),
addOns: ListOfBubbleTeaAddOns.create([], account),
},
ownership,
account,
);
this.root = AccountRoot.create({ draft, orders }, ownership);
this.root = AccountRoot.create({ draft, orders }, account);
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"root":["./src/app.tsx","./src/createorder.tsx","./src/draftindicator.tsx","./src/editorder.tsx","./src/errors.tsx","./src/linktohome.tsx","./src/orderform.tsx","./src/orderthumbnail.tsx","./src/orders.tsx","./src/main.tsx","./src/schema.ts","./src/vite-env.d.ts"],"version":"5.6.3"}

2
examples/form/vite.config.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
declare const _default: import("vite").UserConfig;
export default _default;

View File

@@ -0,0 +1,6 @@
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
});

View File

@@ -1,5 +1,135 @@
# image-upload
## 0.0.33
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-browser-media-images@0.9.15
- jazz-react@0.9.15
## 0.0.32
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-browser-media-images@0.9.14
- jazz-react@0.9.14
## 0.0.31
### Patch Changes
- jazz-react@0.9.13
- jazz-tools@0.9.13
- jazz-browser-media-images@0.9.13
## 0.0.30
### Patch Changes
- jazz-react@0.9.12
- jazz-tools@0.9.12
- jazz-browser-media-images@0.9.12
## 0.0.29
### Patch Changes
- jazz-react@0.9.11
- jazz-tools@0.9.11
- jazz-browser-media-images@0.9.11
## 0.0.28
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
- jazz-browser-media-images@0.9.10
## 0.0.27
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-browser-media-images@0.9.9
- jazz-react@0.9.9
## 0.0.26
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
- jazz-browser-media-images@0.9.8
## 0.0.25
### Patch Changes
- jazz-react@0.9.4
## 0.0.24
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
- jazz-browser-media-images@0.9.1
## 0.0.23
### 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.22
### 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.21
### Patch Changes
- jazz-react@0.8.50
- jazz-tools@0.8.50
- jazz-browser-media-images@0.8.50
## 0.0.20
### Patch Changes
- jazz-react@0.8.49
- jazz-tools@0.8.49
- jazz-browser-media-images@0.8.49
## 0.0.19
### 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.18
### Patch Changes

View File

@@ -4,30 +4,60 @@ This is an example of how to upload and render images with Jazz.
Live version: https://image-upload-demo.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
npx degit gardencmp/jazz jazz
npm create jazz-app@latest --example image-upload --project-name image-upload
```
or
```bash
npx create-jazz-app@latest --example image-upload --project-name image-upload
```
Go to the image-upload example directory:
Go to the new project directory.
```bash
cd jazz/examples/image-upload
cd image-upload
```
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
pnpm i && npx turbo build
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/image-upload/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## 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.

View File

@@ -1,7 +1,7 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.18",
"version": "0.0.33",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,5 @@
import { useAccount } from "jazz-react";
import ImageUpload from "./ImageUpload.tsx";
import { useAccount } from "./main";
function App() {
const { me, logOut } = useAccount();

View File

@@ -1,8 +1,7 @@
import { createImage } from "jazz-browser-media-images";
import { ProgressiveImg } from "jazz-react";
import { ProgressiveImg, useAccount } from "jazz-react";
import { ImageDefinition } from "jazz-tools";
import { ChangeEvent, useRef } from "react";
import { useAccount } from "./main.tsx";
function Image({ image }: { image: ImageDefinition }) {
return (

View File

@@ -1,27 +1,22 @@
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
import { DemoAuthBasicUI, JazzProvider, useDemoAuth } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { JazzAccount } from "./schema.ts";
const Jazz = createJazzReactApp({
AccountSchema: JazzAccount,
});
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, authState] = useDemoAuth();
return (
<>
<Jazz.Provider
<JazzProvider
auth={auth}
peer="wss://cloud.jazz.tools/?key=image-upload-example@garden.co"
AccountSchema={JazzAccount}
>
{children}
</Jazz.Provider>
</JazzProvider>
{authState.state !== "signedIn" && (
<DemoAuthBasicUI appName="Image upload" state={authState} />
@@ -30,6 +25,12 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
);
}
declare module "jazz-react" {
interface Register {
Account: JazzAccount;
}
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<JazzAndAuth>

View File

@@ -10,7 +10,5 @@ export class JazzAccount extends Account {
/** 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);
}
migrate(this: JazzAccount) {}
}

View File

@@ -1,5 +1,79 @@
# jazz-example-inspector
## 0.0.98
### Patch Changes
- Updated dependencies [8d29e50]
- cojson-transport-ws@0.9.13
- cojson@0.9.13
## 0.0.97
### Patch Changes
- Updated dependencies [15d4b2a]
- cojson-transport-ws@0.9.12
- cojson@0.9.12
## 0.0.96
### Patch Changes
- Updated dependencies [efbf3d8]
- Updated dependencies [5863bad]
- cojson@0.9.11
- cojson-transport-ws@0.9.11
## 0.0.95
### Patch Changes
- Updated dependencies [4aa377d]
- cojson@0.9.10
- cojson-transport-ws@0.9.10
## 0.0.94
### Patch Changes
- Updated dependencies [8eb9247]
- cojson@0.9.9
- cojson-transport-ws@0.9.9
## 0.0.93
### Patch Changes
- Updated dependencies [8eda792]
- Updated dependencies [1ef3226]
- cojson@0.9.0
- cojson-transport-ws@0.9.0
## 0.0.92
### Patch Changes
- Updated dependencies [43378ef]
- cojson@0.8.50
- cojson-transport-ws@0.8.50
## 0.0.91
### Patch Changes
- Updated dependencies [25dfd90]
- cojson@0.8.49
- cojson-transport-ws@0.8.49
## 0.0.90
### Patch Changes
- Updated dependencies [10ea733]
- cojson@0.8.48
- cojson-transport-ws@0.8.48
## 0.0.89
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector",
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.89",
"version": "0.0.98",
"type": "module",
"scripts": {
"dev": "vite",
@@ -16,8 +16,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cojson": "workspace:0.8.45",
"cojson-transport-ws": "workspace:0.8.45",
"cojson": "workspace:0.9.13",
"cojson-transport-ws": "workspace:0.9.13",
"hash-slash": "workspace:0.2.1",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",

View File

@@ -1,5 +1,126 @@
# jazz-example-musicplayer
## 0.0.56
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-inspector@0.9.15
- jazz-react@0.9.15
## 0.0.55
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-inspector@0.9.14
- jazz-react@0.9.14
## 0.0.54
### Patch Changes
- jazz-inspector@0.9.13
- jazz-react@0.9.13
- jazz-tools@0.9.13
## 0.0.53
### Patch Changes
- jazz-inspector@0.9.12
- jazz-react@0.9.12
- jazz-tools@0.9.12
## 0.0.52
### Patch Changes
- jazz-inspector@0.9.11
- jazz-react@0.9.11
- jazz-tools@0.9.11
## 0.0.51
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
## 0.0.50
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-react@0.9.9
## 0.0.49
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
## 0.0.48
### Patch Changes
- jazz-react@0.9.4
## 0.0.47
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
## 0.0.46
### Patch Changes
- Updated dependencies [956a4d1]
- Updated dependencies [8eda792]
- jazz-react@0.9.0
- jazz-tools@0.9.0
## 0.0.45
### Patch Changes
- Updated dependencies [dc62b95]
- Updated dependencies [1de26f8]
- jazz-tools@0.8.51
- jazz-react@0.8.51
## 0.0.44
### Patch Changes
- jazz-react@0.8.50
- jazz-tools@0.8.50
## 0.0.43
### Patch Changes
- jazz-react@0.8.49
- jazz-tools@0.8.49
## 0.0.42
### Patch Changes
- Updated dependencies [635e824]
- Updated dependencies [0a85982]
- jazz-tools@0.8.48
- jazz-react@0.8.48
## 0.0.41
### Patch Changes

View File

@@ -2,30 +2,60 @@
Live version: https://music-demo.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
npx degit gardencmp/jazz jazz
npm create jazz-app@latest --example music-player --project-name music-player
```
or
```bash
npx create-jazz-app@latest --example music-player --project-name music-player
```
Go to the music-player example directory:
Go to the new project directory.
```bash
cd jazz/examples/music-player
cd music-player
```
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
pnpm i && npx turbo build
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/music-player/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## 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.
@@ -34,4 +64,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.
You can also run a local sync server by running `npx cojson-simple-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/2_main.tsx](./src/2_main.tsx).
You can also run a local sync server by running `npx cojson-simple-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/2_main.tsx](./src/2_main.tsx).

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.41",
"version": "0.0.56",
"type": "module",
"scripts": {
"dev": "vite",
@@ -18,8 +18,9 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-react": "workspace:0.8.45",
"jazz-tools": "workspace:0.8.45",
"jazz-react": "workspace:0.9.15",
"jazz-tools": "workspace:0.9.15",
"jazz-inspector": "workspace:*",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",

View File

@@ -85,9 +85,7 @@ export class MusicaAccount extends Account {
* 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.
*/
async migrate(creationProps?: { name: string }) {
super.migrate(creationProps);
migrate() {
if (!this._refs.root) {
const ownership = { owner: this };

Some files were not shown because too many files have changed in this diff Show More