Compare commits

..

292 Commits

Author SHA1 Message Date
Guido D'Orsi
7d496b03e4 Merge pull request #1638 from garden-co/changeset-release/main
Version Packages
2025-03-14 15:41:18 +01:00
github-actions[bot]
261c9aa51d Version Packages 2025-03-14 14:31:36 +00:00
Guido D'Orsi
5ac5d732a9 Merge pull request #1650 from garden-co/purejs-fallback
fix: use PureJSCrypto as fallback when WasmCrypto fails to initialize
2025-03-14 15:29:23 +01:00
Guido D'Orsi
f2e9bc9f92 Merge pull request #1660 from garden-co/feat/inspector-position
add changeset
2025-03-14 15:21:44 +01:00
Guido D'Orsi
6d4b8ecfde Merge pull request #1655 from garden-co/fix/e2e-rn-test
test: fix the mobile e2e tests
2025-03-14 15:20:09 +01:00
Guido D'Orsi
2da366e1cd fix: comment out the re-login stuff 2025-03-14 10:17:57 +01:00
Trisha Lim
e902405c93 add changeset 2025-03-14 11:17:02 +07:00
Trisha Lim
ecbf6d0248 add inspector to version history example 2025-03-14 11:15:27 +07:00
Guido D'Orsi
f44a4fa7a2 Merge pull request #1654 from garden-co/feat/inspector-position
Custom positioning of inspector widget button
2025-03-13 14:34:46 +01:00
Guido D'Orsi
b72d478ba1 Merge pull request #1625 from garden-co/music-player-ux
Music player: Allow deleting tracks and playlists
2025-03-13 13:08:18 +01:00
Guido D'Orsi
d0fd66df00 test: fix the mobile e2e tests 2025-03-13 11:05:01 +01:00
Benjamin S. Leveritt
b2bdfc702e Merge pull request #1645 from garden-co/feat/filestream-example-to-examples-page
add filestream example to examples page
2025-03-13 08:13:56 +00:00
Trisha Lim
dc3d6a28f6 add docs for inspector button position 2025-03-13 12:05:40 +07:00
Trisha Lim
43e339a4bc Custom positioning of inspector widget button 2025-03-13 11:35:29 +07:00
Guido D'Orsi
e1a66fd76b Merge pull request #1651 from garden-co/fix-message-not-readable
fix(chat-example): render "message not readable" if a message is not readable
2025-03-12 22:31:06 +01:00
pax-k
2074e45158 chore: changeset 2025-03-12 19:10:42 +02:00
pax-k
b06dac36a5 fix(chat-example): render "message not readable" if a message is not readable #1646 2025-03-12 19:08:11 +02:00
Guido D'Orsi
7f036c170e fix: use PureJSCrypto as fallback when WasmCrypto fails to initialize 2025-03-12 16:21:21 +01:00
Guido D'Orsi
ce612394dc chore: move the cloudflare test to use WASM 2025-03-12 16:19:17 +01:00
Benjamin S. Leveritt
b3b12a020e Merge pull request #1648 from garden-co/1643-add-colistapplydiff-tests
Fixes CoList.splice to support insertions at start
2025-03-12 14:13:24 +00:00
Benjamin S. Leveritt
a91f343d6d Adds changeset 2025-03-12 14:12:58 +00:00
Benjamin S. Leveritt
59a7ae94b4 Add comment 2025-03-12 14:03:48 +00:00
Benjamin S. Leveritt
c74f1aea8d Fixes CoList.splice to support insertions at start 2025-03-12 13:59:09 +00:00
Trisha Lim
debdb6dccc update readme of filestream example 2025-03-12 20:54:14 +07:00
Trisha Lim
11a952d45b add filestream example to examples page 2025-03-12 20:51:33 +07:00
Guido D'Orsi
3df07327f1 Merge pull request #1641 from garden-co/ref-assign-validation
fix: throw an error when assigning invalid values to ref fields
2025-03-12 14:49:01 +01:00
Guido D'Orsi
c66a3fb8e9 Merge pull request #1640 from garden-co/jmsv/1632/colist-sort-tests
CoList sort tests
2025-03-11 17:26:36 +01:00
Guido D'Orsi
57a3dbe2b4 fix: throw an error when assigning invalid values to ref fields 2025-03-11 17:08:11 +01:00
James Vickery
3f1cbcdaee add another push + sort + expect 2025-03-11 15:50:37 +00:00
James Vickery
bd1bf3fd2c colist sort tests 2025-03-11 15:46:13 +00:00
Anselm Eickhoff
065e84fc7d Merge pull request #1608 from garden-co/even-simpler-pricing 2025-03-11 15:43:58 +00:00
Anselm
341b056e09 Track fake sign ups and slight layout change 2025-03-11 14:41:40 +00:00
Anselm Eickhoff
75bf523b6a Merge pull request #1639 from garden-co/fix/missing-shadow-hero
fix(home): missing shadow on create-jazz-app section
2025-03-11 14:19:49 +00:00
Trisha Lim
2ad11eff11 fix(home): missing shadow on create-jazz-app section 2025-03-11 21:08:47 +07:00
Anselm Eickhoff
2bfab83df6 Merge pull request #1615 from garden-co/deemphasize-local-first
De-emphasise local-first on homepage
2025-03-11 13:42:34 +00:00
Benjamin S. Leveritt
9526674a95 Addressses feedback, adds backticks 2025-03-11 20:33:12 +07:00
Benjamin S. Leveritt
4f2424f5e8 Updates CoList docs to call out Deleting Items
Fixes #1602
2025-03-11 20:33:12 +07:00
Anselm
58c7305e47 More explanation improvements 2025-03-11 13:33:09 +00:00
Anselm
c05dd58c7d Slight wording changes 2025-03-11 13:25:25 +00:00
Anselm
cc3d31fc3b Address PR comments 2025-03-11 13:14:24 +00:00
James Vickery
83433fcfe2 Merge pull request #1637 from garden-co/jmsv/1635/registered-account-types
Use RegisteredAccount type
2025-03-11 12:33:35 +00:00
Anselm Eickhoff
7cdfc62593 Merge pull request #1634 from garden-co/chore/jazz-inspector-changeset
add changeset for #1591
2025-03-11 12:33:27 +00:00
James Vickery
a717754bb4 patch 2025-03-11 12:30:33 +00:00
James Vickery
1617940ce2 RegisteredAccount type for by props 2025-03-11 12:15:17 +00:00
Guido D'Orsi
d8508c260e Merge pull request #1636 from garden-co/show-account-registration-in-more-places
Show Account registration in more places in docs
2025-03-11 11:13:52 +01:00
Anselm Eickhoff
7e754cae9d Show Account registration in more places 2025-03-11 09:57:39 +00:00
Benjamin S. Leveritt
5e7b59293d Merge pull request #1595 from garden-co/817-add-minimal-filestream-example
adds filestream example
2025-03-11 08:53:56 +00:00
Trisha Lim
d133d4724d add changeset 2025-03-11 10:52:49 +07:00
3f765d5e-ac23-4170-97a5-68b8feee155b
e6ef9b6819 Update page.tsx 2025-03-11 10:51:13 +07:00
Benjamin S. Leveritt
91f9ea1823 Prioritise specific framework pages over vanilla 2025-03-11 10:39:55 +07:00
Benjamin S. Leveritt
3404fa99bf Bail on typing item.done 2025-03-11 10:39:55 +07:00
Benjamin S. Leveritt
4bdf0b064b Add fallback for frameworks we have yet to provide 2025-03-11 10:39:55 +07:00
Benjamin S. Leveritt
1e1372bb71 Adds VanillaJS to the Framework selector 2025-03-11 10:39:55 +07:00
Anselm
b1be0bbdf3 Fix more NextJS issues 2025-03-10 13:36:54 +00:00
Anselm
d4f2f6fd99 Fix NextJS issues 2025-03-10 13:32:48 +00:00
Anselm
f901c4628d More improvements and fixes 2025-03-10 13:27:12 +00:00
Nikita
c970eec586 allow deleting tracks and playlists 2025-03-10 14:08:50 +01:00
Guido D'Orsi
eab128d8e8 Merge pull request #1617 from garden-co/changeset-release/main
Version Packages
2025-03-10 13:04:18 +01:00
github-actions[bot]
8793c218e7 Version Packages 2025-03-10 11:50:03 +00:00
Guido D'Orsi
57858a7cf0 Merge pull request #1624 from garden-co/better-error-logging
feat: improve error logging
2025-03-10 12:46:31 +01:00
Guido D'Orsi
68b0242793 feat: improve error logging 2025-03-10 12:40:55 +01:00
Anselm Eickhoff
9d9a067df5 Merge pull request #1621 from garden-co/fix/react-guide-optional-field
fix(react guide): update syntax for optional field
2025-03-10 10:30:11 +00:00
Trisha Lim
99779b522b fix(react guide): update syntax for optional field 2025-03-10 17:24:30 +07:00
Guido D'Orsi
80b80b5d71 Merge pull request #1610 from garden-co/changeset-release/main
Version Packages
2025-03-07 17:47:20 +01:00
Guido D'Orsi
d777b78ce4 Merge pull request #1614 from garden-co/fix/missing-apikey-ts
Move api key of react starter into apiKey.ts
2025-03-07 17:46:56 +01:00
Anselm
ca909a09a5 First pass 2025-03-07 11:00:37 +00:00
Trisha Lim
c0a77b99bb Move api key of react starter into apiKey.ts 2025-03-07 17:47:48 +07:00
github-actions[bot]
24516116f3 Version Packages 2025-03-07 08:42:35 +00:00
Guido D'Orsi
ed0e15144c fix: reset the useCoState value when the id becomes undefined 2025-03-07 09:40:06 +01:00
Trisha Lim
ad9afc14ba use equal col widths 2025-03-07 14:26:13 +07:00
Benjamin S. Leveritt
f51cf1b9ff Merge pull request #1563 from garden-co/jazz-773-add-tone-and-voice-document
jazz-773-add-tone-and-voice-document
2025-03-06 19:13:05 +00:00
Benjamin S. Leveritt
31beb0a3b4 Removes key takeaways 2025-03-06 19:11:15 +00:00
Benjamin S. Leveritt
d1b2c50801 Replaces teammate > friend 2025-03-06 19:11:15 +00:00
Benjamin S. Leveritt
0261fb5031 Adds note about docs 2025-03-06 19:10:54 +00:00
Benjamin S. Leveritt
e421af1147 Adds a tone and voice doc 2025-03-06 19:10:54 +00:00
Benjamin S. Leveritt
05df8e3b61 Merge pull request #1609 from garden-co/1606-port-applydiff-to-colist-from-corichtext
Adds `applyDiff` to `CoList`
2025-03-06 19:09:45 +00:00
Benjamin S. Leveritt
6892dc6a87 Adds changeset 2025-03-06 19:08:37 +00:00
Nikos Papadopoulos
846a22fb87 moves the apikey into src/apiKey.ts 2025-03-06 18:16:21 +00:00
Benjamin S. Leveritt
84badaa18b Adds applyDiff to CoList
Closes #1606
2025-03-06 17:49:50 +00:00
Nikos Papadopoulos
50133de036 updates vercel configuration 2025-03-06 17:26:26 +00:00
Nikos Papadopoulos
8eff068bdf adds drag and drop upload feature 2025-03-06 17:26:26 +00:00
Nikos Papadopoulos
77383b20c6 switches sync peer from localhost to cloud 2025-03-06 17:26:26 +00:00
Nikos Papadopoulos
4965807ce9 adds filestream example 2025-03-06 17:26:12 +00:00
Anselm
b424ff04fb Remove add-ons 2025-03-06 17:16:48 +00:00
Anselm
0f4bf6ab77 Merge branch 'main' into even-simpler-pricing 2025-03-06 17:10:25 +00:00
Trisha Lim
23059ec701 change copy icon 2025-03-06 21:06:13 +07:00
Trisha Lim
52a2533b9e cleanup 2025-03-06 21:06:13 +07:00
Trisha Lim
5df7aaf742 mobile view 2025-03-06 21:06:13 +07:00
Trisha Lim
1a818f88b2 add create-jazz-app command to hero 2025-03-06 21:06:13 +07:00
Guido D'Orsi
2e12ec55ac Merge pull request #1551 from garden-co/example-counter
feat(examples): multi-auth example
2025-03-06 14:35:28 +01:00
Guido D'Orsi
6c94c2cd3d Merge pull request #1605 from garden-co/changeset-release/main
Version Packages
2025-03-06 13:54:08 +01:00
github-actions[bot]
98c4221340 Version Packages 2025-03-06 12:46:19 +00:00
Guido D'Orsi
7b00a8155f fix: align packages versions to 0.11 2025-03-06 13:44:06 +01:00
Guido D'Orsi
cc5aea708a fix: remove the prepublish hook 2025-03-06 13:35:35 +01:00
Guido D'Orsi
87c7306632 fix(release): build packages with turbo before publishing 2025-03-06 13:30:59 +01:00
Guido D'Orsi
a65219ba52 Merge pull request #1578 from garden-co/changeset-release/main
Version Packages
2025-03-06 13:23:02 +01:00
github-actions[bot]
689595fd0a Version Packages 2025-03-06 12:21:42 +00:00
Guido D'Orsi
efbf2b65a8 Merge pull request #1492 from garden-co/0-11-0
Jazz 0.11.0 - Better permissions checks and members API
2025-03-06 13:19:38 +01:00
Guido D'Orsi
912232192f docs: release notes final touches 2025-03-06 13:18:24 +01:00
Guido D'Orsi
11b5d77064 fix: check auth state when accepting an invite 2025-03-06 13:04:07 +01:00
Guido D'Orsi
63b88b591d test(music-player): uncomment remove track test 2025-03-06 13:02:21 +01:00
Guido D'Orsi
87d0544d98 chore: fix type errors 2025-03-05 18:55:37 +01:00
Guido D'Orsi
d43dcc2c94 Merge pull request #1592 from garden-co/revert-1557-1556-update-homepage-typedoc-to-027
Revert "1556-update-homepage-typedoc-to-027"
2025-03-05 18:55:09 +01:00
Guido D'Orsi
093a166db1 Revert "1556-update-homepage-typedoc-to-027" 2025-03-05 18:54:57 +01:00
Guido D'Orsi
593f3ed83e Revert "Fix typing"
This reverts commit 6a2a176361.
2025-03-05 18:48:55 +01:00
Guido D'Orsi
6c6c89e068 Revert "Bumps typedoc and typescript versions"
This reverts commit 824bbc8bab.
2025-03-05 18:45:30 +01:00
Guido D'Orsi
c1646f6bbb Merge pull request #1570 from garden-co/trisha/1224-add-status-to-footer
Add status to footer, remove releases
2025-03-05 18:03:51 +01:00
Guido D'Orsi
b7deb3c937 chore: changeset 2025-03-05 17:59:56 +01:00
Guido D'Orsi
9b425701e4 Merge pull request #1589 from 3f765d5e-ac23-4170-97a5-68b8feee155b/3f765d5e-ac23-4170-97a5-68b8feee155b-patch-3
Add React 19 to peer deps
2025-03-05 17:58:51 +01:00
Guido D'Orsi
07dcf54aca chore: fix type errors 2025-03-05 17:52:50 +01:00
Guido D'Orsi
8ed33c18ca Merge remote-tracking branch 'origin/main' into 0-11-0 2025-03-05 17:48:33 +01:00
Guido D'Orsi
6a96d8b53b feat: add getParentGroups API to Group and Account 2025-03-05 17:27:28 +01:00
Nikos Papadopoulos
a1bcbda72e Merge pull request #1522 from garden-co/jazz-758-allow-optional-fields-in-types-passed-to-cojson-see
Fix and test cases for reported issue with optional fields
2025-03-05 16:03:25 +00:00
Nikos Papadopoulos
0f67e0a988 adds changeset 2025-03-05 15:54:29 +00:00
3f765d5e-ac23-4170-97a5-68b8feee155b
6c7a3ebf82 Add React 19 to peer deps
Hope that's enough to make the peer dep warning go away. Been running inspector with react 19 and no problems so far
2025-03-05 16:46:31 +01:00
Guido D'Orsi
27ce186152 fix(co.json): accept null values and improve the function check 2025-03-05 15:51:17 +01:00
Nikos Papadopoulos
77ae2cc186 Revert "fixes CoJsonValue type"
This reverts commit d6d9218b3e.
2025-03-05 10:53:56 +00:00
Guido D'Orsi
66600c0c27 Merge pull request #1584 from garden-co/clarification-profile-changes
docs: clarify better the situation on profile migrations
2025-03-05 11:06:42 +01:00
Guido D'Orsi
81d5261f4d docs: clarify better the situation on profile migrations 2025-03-05 11:01:02 +01:00
Guido D'Orsi
d748dea90f test: cover invalid actions on revokeExtend 2025-03-05 10:24:03 +01:00
Guido D'Orsi
707e544b83 docs: add the 0.11.0 group APIs 2025-03-05 10:17:00 +01:00
Guido D'Orsi
f3cbaee890 Merge pull request #1500 from garden-co/jazz-760-jazz-0110-upgrade-guide
jazz 0.11.0 upgrade guide
2025-03-05 10:03:04 +01:00
Trisha Lim
60ce483db7 add changeset 2025-03-05 15:51:33 +07:00
Trisha Lim
c08a41398d Make initial commit on create-jazz-app apps 2025-03-05 15:51:33 +07:00
Nikos Papadopoulos
d6d9218b3e fixes CoJsonValue type 2025-03-04 19:20:08 +00:00
Anselm
667e301f12 Simplify JSON related types and test for more cases 2025-03-04 17:33:02 +00:00
Guido D'Orsi
b15f904347 chore: fix a type error 2025-03-04 18:02:48 +01:00
Nikos Papadopoulos
0c150a4c74 fix attempt 0 2025-03-04 16:50:01 +00:00
Guido D'Orsi
66de2dacb6 docs: whats new 2025-03-04 17:13:57 +01:00
Guido D'Orsi
ae1425db8a Merge remote-tracking branch 'origin/main' into 0-11-0 2025-03-04 17:08:49 +01:00
Guido D'Orsi
a164b102f5 docs: add revokeExtend to the migration docs 2025-03-04 16:49:25 +01:00
Guido D'Orsi
a6db9a438e Merge remote-tracking branch 'origin/0-11-0' into jazz-760-jazz-0110-upgrade-guide 2025-03-04 16:38:49 +01:00
Nikita
a35249a831 Fix CoMap.toJSON() with encoded fields (#1577)
* encode -> encoded

* add test and changeset

* patch
2025-03-04 15:56:08 +01:00
Guido D'Orsi
36e246be79 docs: add the this type to the migration examples 2025-03-04 15:37:29 +01:00
Trisha Lim
b894455c9e Remove unnecessary owner argument in react examples 2025-03-04 19:28:16 +07:00
Guido D'Orsi
11f7277675 Merge pull request #1566 from garden-co/changeset-release/main
Version Packages
2025-03-04 13:19:34 +01:00
github-actions[bot]
d992f5c552 Version Packages 2025-03-04 12:18:11 +00:00
Guido D'Orsi
a5ec31f079 Merge pull request #1573 from garden-co/fix-race-conditions-ctx-creation
fix(ContextManager): avoid race conditions on context creation
2025-03-04 13:15:59 +01:00
Guido D'Orsi
2f99de0976 fix(ContextManager): avoid race conditions on context creation 2025-03-04 13:10:29 +01:00
Anselm Eickhoff
d5503b4581 Merge pull request #1555 from garden-co/1554-start-a-faq-document
Adds an FAQ
2025-03-04 11:32:13 +00:00
Trisha Lim
a462254199 Add status to footer, remove releases 2025-03-04 17:21:22 +07:00
Guido D'Orsi
f86e278b00 fix: change the log level of permission errors to debug 2025-03-03 23:43:49 +01:00
Emil Sayahi
34cbdc3e4c feat!(Groups): API to unextend group (#1512)
* feat!(Groups): API to unextend group

See: #1504

* feat!(Groups): API to unextend group

See: #1504

* test(groupsAndAccounts): revoking group extensions

* test(cojson): group, permissions test for unextend

* chore: add changeset

* test(permissions): unextend reading & grandparents

* feat!(Groups): API to unextend group

See: #1504

* test(groupsAndAccounts): revoking group extensions

* test(cojson): group, permissions test for unextend

* chore: add changeset

* test(permissions): unextend reading & grandparents

* feat(music-player): removing tracks from playlists

* fix(music-player): remove unused import
2025-03-03 14:13:35 -05:00
Emil Sayahi
c563c3675f fix(multiauth): update lockfile 2025-03-03 13:09:39 -05:00
Emil Sayahi
05372df4be Merge branch 'main' into example-counter 2025-03-03 13:03:33 -05:00
Emil Sayahi
c32c405bfd feat(examples): empty multi-auth example 2025-03-03 13:00:27 -05:00
Benjamin S. Leveritt
09e2090939 Tweaks heading 2025-03-03 14:07:45 +00:00
Benjamin S. Leveritt
2ffe10cc79 Rework order, update from suggestions 2025-03-03 12:08:13 +00:00
Benjamin S. Leveritt
9a4cef30cf Update homepage/homepage/app/(docs)/docs/[framework]/[...slug]/faq.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-03-03 12:03:19 +00:00
Anselm Eickhoff
3c0b2cb689 Merge pull request #1557 from garden-co/1556-update-homepage-typedoc-to-027
1556-update-homepage-typedoc-to-027
2025-03-03 11:49:54 +00:00
Benjamin S. Leveritt
6a2a176361 Fix typing 2025-03-03 11:35:37 +00:00
Benjamin S. Leveritt
824bbc8bab Bumps typedoc and typescript versions 2025-03-03 11:35:15 +00:00
Benjamin S. Leveritt
71b9517eda Adds an FAQ
Fixes #1554
2025-03-03 10:34:09 +00:00
Emil Sayahi
e7ae6d95ba feat(examples): multi-auth counter example 2025-02-28 14:55:45 -05:00
Guido D'Orsi
8bdf6908b8 Merge pull request #1529 from garden-co/changeset-release/main
Version Packages
2025-02-28 20:18:53 +01:00
github-actions[bot]
12bc4fb2d3 Version Packages 2025-02-28 19:08:19 +00:00
Guido D'Orsi
75211e3c82 fix: fixes invalid authentication state when logging out after signUp (#1549) 2025-02-28 14:06:18 -05:00
Guido D'Orsi
029c32d86c chore: fix type errors 2025-02-28 18:44:16 +01:00
Benjamin S. Leveritt
3185a20777 Merge pull request #1447 from garden-co/jazz-496-draft-using-coValue-docs
jazz-496-draft-using-coValue-docs
2025-02-28 13:42:26 +00:00
Benjamin S. Leveritt
0c3905f93f Add example, fix copy 2025-02-28 13:40:38 +00:00
Guido D'Orsi
45bed3ea80 Merge remote-tracking branch 'origin/main' into 0-11-0 2025-02-28 14:12:02 +01:00
Guido D'Orsi
8a31f56770 Merge pull request #1542 from garden-co/jazz-731-prevent-duplicate-accounts-on-inspector
Prevent duplicate accounts from being added in inspector
2025-02-28 14:10:21 +01:00
Guido D'Orsi
43fa1ecba4 chore: correctly rename the interface 2025-02-28 11:20:47 +01:00
Guido D'Orsi
4373e290fe Merge pull request #1543 from garden-co/typecheck-tests
fix: include tests in the typescript validation on cojson and jazz-tools
2025-02-28 11:19:18 +01:00
Guido D'Orsi
037ed4d59d fix: include tests in the typescript validation on cojson and jazz-tools 2025-02-28 11:01:57 +01:00
Benjamin S. Leveritt
c030128b28 Fix comment 2025-02-28 09:53:15 +00:00
Nikita
34946c18bc prevent duplicate accounts from being added in inspector 2025-02-28 10:52:21 +01:00
Benjamin S. Leveritt
fcca08655a Update nav for new organisation 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
adcd08c95a Copy tweaks from feedback 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
937e20b248 Add back-references to example 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
a759d9a7aa Partially hide unused pages
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
38af5b8dc8 Tweak copy
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
b9473da159 Adds CoFeeds doc
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
cb1126ac15 Updates CoList examples
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
989211f02f Removes performance section
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
49a1a9d6f0 Adds CoLists doc
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
2f32599987 Improve ComputedProject example
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
9ede39c229 Rework into CoMaps doc
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
ca3eb9dbd8 Adds Subscription docs
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
12273cf35b Typo
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
b3d4944608 Removes error handling section
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
2068aaff13 Removes owners
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
9dfad43433 Fix link
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
db4986059e Updates metadata for latest copy
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
ed5369e99b Updates the metadata copy and examples
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
2671fca1dc Adds reviewed copy for Reading + examples
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
c81a2dcd0b Updates Writing examples and copy
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
b7a19c0693 Updates creation examples
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
2678bdbcca Updates examples
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
ee7823b33e Fix Account and Group casing
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
46683235ba Removes transactions content 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
8ce7bb808c Improves accuracy of examples 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
3a69928ebc Adds CodeGroups, improves copy 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
00790a1535 Adds drafts to nav 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
56ccf5ea65 Adds metadata and writing drafts 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
4814595724 Adds Reading draft 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
706357ac4f Adds Creation draft 2025-02-28 09:46:13 +00:00
Benjamin S. Leveritt
4fcc8edc70 Merge pull request #1539 from garden-co/1538-fix-linting-for-cojson-transport-ws
1538-fix-linting-for-cojson-transport-ws
2025-02-28 08:24:47 +00:00
Nikos Papadopoulos
141ea11bf1 Rename interface 2025-02-27 19:08:52 +00:00
Benjamin S. Leveritt
0f8ba9966b Fix resolve returning void (which biome doesn't like)
Closes #1538
2025-02-27 17:18:57 +00:00
Benjamin S. Leveritt
91fa2e092a Add comment about using any 2025-02-27 17:08:06 +00:00
Benjamin S. Leveritt
ff52d6df3e Adds linting to cojson-transport-ws
Fixes #1538
2025-02-27 17:08:06 +00:00
Benjamin S. Leveritt
a539b9e26b Merge pull request #1536 from garden-co/1533-fix-linting-for-cojson-storage-packages
Closes #1533
2025-02-27 17:05:44 +00:00
Benjamin S. Leveritt
f3129a7914 Fix return on transaction 2025-02-27 16:40:25 +00:00
Guido D'Orsi
d349b794e1 Merge pull request #1534 from boorad/feat/clerk-expo-offline
feat: Clerk and Expo offline support
2025-02-27 17:24:20 +01:00
Guido D'Orsi
273b478381 Merge pull request #1535 from garden-co/test/group-members-sync
test(groupAndAccounts): enable sync and add members test
2025-02-27 17:24:01 +01:00
Benjamin S. Leveritt
fad14dcff6 Fix imports in jazz-nodejs 2025-02-27 16:21:54 +00:00
Benjamin S. Leveritt
b99f13c948 Adds a few more tweaks to the linter, and fixes 2025-02-27 16:21:54 +00:00
Benjamin S. Leveritt
e7cb337a24 Fix linting issues in cojson-storage-rn-sqlite 2025-02-27 16:21:54 +00:00
Benjamin S. Leveritt
85c9a432c3 Adds linting checks and fixes to cojson-storage 2025-02-27 16:21:54 +00:00
Guido D'Orsi
1d29f74df6 test(groupAndAccounts): enable sync and add members test 2025-02-27 17:16:27 +01:00
Brad Anderson
c28d1c331c feat: Clerk and Expo offline support 2025-02-27 10:01:46 -05:00
Guido D'Orsi
474ea89b81 Merge pull request #1532 from juliusv/patch-2
Fix missing useAccount import + incorrect "old" marker in React guide
2025-02-27 15:10:48 +01:00
Julius Volz
4772309fb6 Fix missing useAccount import + incorrect "old" marker in React guide 2025-02-27 13:43:20 +01:00
Guido D'Orsi
393d066b25 docs: add the Group.members schema and everyone changes 2025-02-27 11:45:51 +01:00
Guido D'Orsi
45bff625c4 Merge branch '0-11-0' into jazz-760-jazz-0110-upgrade-guide 2025-02-27 11:40:42 +01:00
Guido D'Orsi
a8fca7b5f7 Merge pull request #1459 from garden-co/declaration-files-migration
feat: migrate to declaration files
2025-02-27 11:28:21 +01:00
Guido D'Orsi
658a0602ea Merge pull request #1528 from garden-co/fix/group-members-type
feat(Group.members): use the global AccountSchema and remove everyone from the returned values
2025-02-27 11:28:04 +01:00
Guido D'Orsi
f039e8f097 feat(Group.members): use the global AccountSchema and remove everyone from the returned values 2025-02-27 11:20:57 +01:00
pax
1501510cfc Merge pull request #1493 from garden-co/cursor-rules-with-create-jazz-app
Cursor rules with create-jazz-app
2025-02-27 12:09:01 +02:00
Guido D'Orsi
eda1588907 Merge pull request #1527 from garden-co/changeset-release/main
Version Packages
2025-02-27 09:56:16 +01:00
Guido D'Orsi
dc9da28bf9 Merge remote-tracking branch 'origin/0-11-0' into declaration-files-migration 2025-02-27 09:55:15 +01:00
github-actions[bot]
b14e0bfe24 Version Packages 2025-02-26 17:58:41 +00:00
Guido D'Orsi
87aa43b46b Merge pull request #1507 from garden-co/jazz-747-passphrase-auth-restore-support-for-rerolling-the-passphrase
feat(PasskeyAuth): support random passphrase generation
2025-02-26 18:54:42 +01:00
Guido D'Orsi
b93ce9fb7e chore: rever to use property initializers 2025-02-26 18:54:32 +01:00
Guido D'Orsi
e6db8f2a02 test(permissions): rewrite flaky tests 2025-02-26 18:53:32 +01:00
Guido D'Orsi
f0c8f7b3eb Merge pull request #1526 from garden-co/upgrade-guide-permissions-docs
docs: update the 0.11 upgrade guide with the new permissions APIs
2025-02-26 17:46:09 +01:00
Guido D'Orsi
a7d83e1c10 feat(passphrase-example): inline the UI and implement the passphrase reroll flow 2025-02-26 16:29:05 +01:00
Guido D'Orsi
76a693da15 Update packages/jazz-tools/src/tests/PassphraseAuth.test.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2025-02-26 16:23:02 +01:00
Guido D'Orsi
945163b7bc docs: fix typos in the upgrade guide 2025-02-26 15:34:20 +01:00
Guido D'Orsi
3142e503ae docs: update the 0.11 upgrade guide with the new permissions APIs 2025-02-26 15:33:00 +01:00
pax
df2f021cfd Merge pull request #1509 from garden-co/changeset-release/main
Version Packages
2025-02-26 16:25:01 +02:00
Guido D'Orsi
932a21e62a Merge pull request #1521 from garden-co/permission-checks-simplified
feat: add shortcut methods to account to check permissions on covalues
2025-02-26 14:45:33 +01:00
Guido D'Orsi
628a33eb12 feat: add shortcut methods to account to check permissions on covalues 2025-02-26 14:45:22 +01:00
github-actions[bot]
50b15d2d1d Version Packages 2025-02-26 13:43:02 +00:00
pax
48bf7cb188 Merge pull request #1519 from garden-co/create-jazz-app-dev-deps-handling
fix(create-jazz-app): handle workspace devDependencies
2025-02-26 15:40:53 +02:00
Nikos Papadopoulos
20eef64b47 Added a new test case to validate a reported issue with optional fields 2025-02-26 13:16:05 +00:00
pax-k
e2e0af34b5 chore: changeset 2025-02-26 15:04:57 +02:00
Trisha Lim
6a5bcd3063 Fix missing og meta tags 2025-02-26 19:34:15 +07:00
Giordano Ricci
c64f38b6c9 docs for usePassKeyAuth changes 2025-02-26 12:02:39 +00:00
Giordano Ricci
e5e047660b nicer alert 2025-02-26 11:57:20 +00:00
Giordano Ricci
a65d6bed73 reorganize sections 2025-02-26 11:17:48 +00:00
pax-k
bf7e62ec76 fix(create-jazz-app): handle workspace devDependencies 2025-02-26 11:58:44 +02:00
Guido D'Orsi
71dda6b10b docs(contributing): fix the build step 2025-02-25 21:33:35 +01:00
Giordano Ricci
d4f7891890 add more docs 2025-02-25 16:39:37 +00:00
Emil Sayahi
4612e0545e fix: type inference on useCoState (#1489)
* fix: type inference on `useCoState`

The `id` parameter should be `ID<CoValue>` so the type inference picks up the CoValue type only from the `Schema` parameter.

See: #1476

* fix: type inference on loading & subscribing API

* test: add type inference `useCoState` tests

* chore: changeset
2025-02-25 10:35:53 -05:00
Guido D'Orsi
07feedd641 feat(PasskeyAuth): support random passphrase generation 2025-02-25 15:35:48 +01:00
Guido D'Orsi
edbd567f11 Merge pull request #1491 from garden-co/remove-neverthrow-from-agent
chore: remove neverthrow from the agent/sealer id getters
2025-02-25 15:22:07 +01:00
Giordano Ricci
6eef92b602 jazz 0.11.0 upgrade guide 2025-02-25 13:01:16 +00:00
Guido D'Orsi
dfbb4b8c69 Merge pull request #1478 from garden-co/jazz-749-migrations-make-migrations-work-with-profiles
fix: allow profile migrations, enforce profile ownership
2025-02-25 13:58:59 +01:00
Giordano Ricci
5f2d8e143c remove profile.name forced write 2025-02-25 12:35:39 +00:00
Guido D'Orsi
4d8bb9cdb8 Merge pull request #1495 from garden-co/changeset-release/main
Version Packages
2025-02-25 12:37:27 +01:00
github-actions[bot]
1971448f5d Version Packages 2025-02-25 11:31:50 +00:00
Guido D'Orsi
240f071951 Merge pull request #1502 from garden-co/jazz-730-passkeyauth-update-the-profile-name-only-if-the-value-on
Jazz 730 passkeyauth update the profile name only if the value on
2025-02-25 12:30:43 +01:00
Guido D'Orsi
0e861e7df8 Merge pull request #1501 from garden-co/revert-1487-jazz-730-passkeyauth-update-the-profile-name-only-if-the-value-on
Revert "fix(PasskeyAuth): set name iff username given"
2025-02-25 12:30:04 +01:00
Guido D'Orsi
6e3f1efcd0 Revert "fix(PasskeyAuth): set name iff username given (#1487)"
This reverts commit d469d68771.
2025-02-25 12:29:28 +01:00
Giordano Ricci
d560b4ddfb fixpermission resolution chain 2025-02-25 11:19:34 +00:00
Guido D'Orsi
eb87d10783 Merge pull request #1498 from garden-co/remove-quick-crypto
fix: don't export RNQuickCrypto to avoid install errors
2025-02-25 12:14:22 +01:00
Guido D'Orsi
5a54e4aa50 fix: don't export RNQuickCrypto to avoid install errors 2025-02-25 11:51:57 +01:00
Guido D'Orsi
73d6fd1a85 tests: add more permissions tests on inheritance 2025-02-25 11:42:58 +01:00
Guido D'Orsi
16b0a22ded chore: remove RNQuickCrypto from the chat example 2025-02-25 10:42:16 +01:00
pax-k
6a8ce1e32d chore(create-jazz-app): only copy .cursor dir 2025-02-24 23:58:32 +02:00
pax-k
10a4b0e888 Merge branch 'main' into cursor-rules-with-create-jazz-app 2025-02-24 23:44:06 +02:00
pax-k
3c973c84ce fix(create-jazz-app): git init inside new project 2025-02-24 23:40:50 +02:00
Emil Sayahi
d469d68771 fix(PasskeyAuth): set name iff username given (#1487)
* fix(PasskeyAuth): set name iff username given

If an empty username is passed to `signUp`, the `profile.name` of the user is not updated.

See: #1433

* chore: changeset

* docs(changeset): mention PasskeyAuth

Co-authored-by: Guido D'Orsi <gu.dorsi@gmail.com>

---------

Co-authored-by: Guido D'Orsi <gu.dorsi@gmail.com>
2025-02-24 16:23:09 -05:00
pax
c068d7a369 Merge pull request #1494 from garden-co/update-cursor-docs
fix: cursor docs structure
2025-02-24 22:31:15 +02:00
pax-k
25088ed5db fix: cursor docs structure 2025-02-24 22:29:04 +02:00
Guido D'Orsi
46f5133510 test: revoking access on a child group doesn't block access to that group if a more permissive role is inheritable 2025-02-24 20:17:58 +01:00
Giordano Ricci
b3f2e67d9d restore correct behavior in test 2025-02-24 19:17:30 +00:00
Giordano Ricci
f689cd20fc add tests 2025-02-24 19:05:34 +00:00
pax-k
21e74998e8 fix(cursor-docs): markdown references to examples 2025-02-24 20:53:17 +02:00
pax-k
a2e9ae4731 chore: refactored cursor rule name 2025-02-24 20:47:39 +02:00
Giordano Ricci
e22de9ff4c add changeset 2025-02-24 18:45:37 +00:00
Giordano Ricci
735bd41242 fix permsissions checks 2025-02-24 18:41:23 +00:00
Giordano Ricci
71998bde62 throw a meaningful error when trying to access an inbox with inusfficient permissions 2025-02-24 18:40:44 +00:00
Giordano Ricci
f01b714e29 remove profile visibility requirements 2025-02-24 18:40:44 +00:00
Giordano Ricci
028eca9f81 throw error is profile has an account owner 2025-02-24 18:40:44 +00:00
Giordano Ricci
d3d4118b86 fix tests 2025-02-24 18:40:43 +00:00
Giordano Ricci
45f1fe19ac fix: allow profile migrations, enforce profile ownership 2025-02-24 18:40:43 +00:00
pax-k
0514a7e64b chore: run pre-publish workflow when PR labels change 2025-02-24 20:35:40 +02:00
Emil Sayahi
ad2db5e6cb docs(changeset): mention PasskeyAuth
Co-authored-by: Guido D'Orsi <gu.dorsi@gmail.com>
2025-02-24 12:57:16 -05:00
pax-k
b063cccdfc chore: changeset 2025-02-24 19:16:37 +02:00
pax-k
d89d2978ff feat: added cursor-docs to create-jazz-app 2025-02-24 19:16:00 +02:00
Guido D'Orsi
221ca30790 chore: remove neverthrow from the agent/sealer id getters 2025-02-24 18:11:06 +01:00
Guido D'Orsi
480890d2e9 Merge pull request #1467 from garden-co/feat/return-inherited-members
feat: return inherited members and add getRoleOf and hasPermissions methods to Group
2025-02-24 17:49:18 +01:00
Emil Sayahi
18428eaaa1 chore: changeset 2025-02-24 11:47:41 -05:00
Emil Sayahi
5ed31f2678 fix(PasskeyAuth): set name iff username given
If an empty username is passed to `signUp`, the `profile.name` of the user is not updated.

See: #1433
2025-02-24 11:11:57 -05:00
Guido D'Orsi
b9d194a80e feat: return inherited members and add getRoleOf and hasPermissions methods to Group 2025-02-24 12:55:14 +01:00
Guido D'Orsi
2359e85ebd feat: enable the declarationMap option 2025-02-21 18:55:20 +01:00
Guido D'Orsi
a4713df30c feat: migrate to declaration files 2025-02-21 16:07:51 +01:00
Anselm
65336464fc Simplified 2025-01-07 14:22:22 +00:00
Anselm
a628f5cc97 Even simpler pricing 2025-01-06 16:23:05 +00:00
348 changed files with 14305 additions and 1710 deletions

View File

@@ -9,12 +9,15 @@
"cojson-storage",
"cojson-storage-indexeddb",
"cojson-storage-sqlite",
"cojson-storage-rn-sqlite",
"cojson-transport-ws",
"jazz-browser",
"jazz-auth-clerk",
"jazz-browser-media-images",
"jazz-inspector",
"jazz-nodejs",
"jazz-react",
"jazz-react-core",
"jazz-react-auth-clerk",
"jazz-react-native",
"jazz-react-native-auth-clerk",

View File

@@ -1,7 +1,7 @@
name: Pre-Publish tagged Pull Requests
on:
pull_request:
types: [opened, synchronize, reopened]
types: [opened, synchronize, reopened, labeled]
jobs:
pre-release:
@@ -99,4 +99,4 @@ jobs:
);
await logPublishInfo();
}
}
}

View File

@@ -25,6 +25,9 @@ jobs:
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Build packages
run: pnpm exec turbo run build --filter='./packages/*'
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1

View File

@@ -36,7 +36,7 @@ We welcome all ideas! If you have suggestions, feel free to open an issue marked
### 5. Local Setup
You'll need Node.js 20.x or 22.x installed (we're working on support for 23.x), and pnpm 9.x installed. If you're using nix, run `nix develop` to get a shell with the correct versions of everything installed.
You'll need Node.js 22.x installed (we're working on support for 23.x), and pnpm 9.x installed. If you're using nix, run `nix develop` to get a shell with the correct versions of everything installed.
1. **Clone the repository**:
```bash
@@ -54,6 +54,12 @@ You'll need Node.js 20.x or 22.x installed (we're working on support for 23.x),
cd homepage && pnpm install
```
4. **Go back to the project root**:
```bash
cd ..
```
4. **Build the packages**:
```bash

View File

@@ -12,7 +12,9 @@
"**/ios/**",
"**/android/**",
"packages/jazz-svelte/**",
"examples/*svelte*/**"
"examples/*svelte*/**",
"homepage/homepage/**",
"**/package.json"
]
},
"formatter": {
@@ -42,15 +44,6 @@
}
},
"overrides": [
{
"include": ["**/package.json"],
"linter": {
"enabled": false
},
"formatter": {
"enabled": false
}
},
{
"include": ["packages/**/src/**"],
"linter": {
@@ -61,21 +54,24 @@
}
},
{
"include": ["packages/**/src/tests/**", "packages/**/src/test/**"],
"include": ["packages/cojson-storage*/**", "cojson-transport-ws/**"],
"linter": {
"enabled": true,
"rules": {
"correctness": {
"useImportExtensions": "off"
}
"recommended": true
}
}
},
{
"include": ["packages/cojson-storage-indexeddb/**"],
"include": ["packages/**/src/tests/**"],
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"useImportExtensions": "off"
},
"style": {
"noNonNullAssertion": "off"
},
"suspicious": {
"noExplicitAny": "info"
}

View File

@@ -1,5 +1,107 @@
# chat-rn-clerk
## 1.0.85
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react-native@0.11.4
- jazz-react-native-auth-clerk@0.11.4
- jazz-react-native-media-images@0.11.4
## 1.0.84
### Patch Changes
- jazz-react-native@0.11.3
- jazz-react-native-auth-clerk@0.11.3
- jazz-tools@0.11.3
- jazz-react-native-media-images@0.11.3
## 1.0.83
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react-native@0.11.2
- jazz-react-native-auth-clerk@0.11.2
- jazz-react-native-media-images@0.11.2
## 1.0.82
### Patch Changes
- jazz-react-native@0.11.1
- jazz-react-native-auth-clerk@0.11.1
## 1.0.81
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-react-native-media-images@0.11.0
- jazz-react-native-auth-clerk@0.11.0
- jazz-react-native@0.11.0
## 1.0.80
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-react-native@0.10.15
- jazz-react-native-auth-clerk@0.10.15
- jazz-react-native-media-images@0.10.15
## 1.0.79
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react-native@0.10.14
- jazz-react-native-auth-clerk@0.10.14
- jazz-react-native-media-images@0.10.14
## 1.0.78
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-react-native@0.10.13
- jazz-react-native-auth-clerk@0.10.13
- jazz-react-native-media-images@0.10.13
## 1.0.77
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react-native@0.10.12
- jazz-react-native-auth-clerk@0.10.12
- jazz-react-native-media-images@0.10.12
## 1.0.76
### Patch Changes
- Updated dependencies [5a54e4a]
- jazz-react-native@0.10.11
- jazz-react-native-auth-clerk@0.10.11
## 1.0.75
### Patch Changes

View File

@@ -1,5 +1,6 @@
import "../global.css";
import { ClerkLoaded, ClerkProvider } from "@clerk/clerk-expo";
import { secureStore } from "@clerk/clerk-expo/secure-store";
import { useFonts } from "expo-font";
import { Slot } from "expo-router";
import * as SplashScreen from "expo-splash-screen";
@@ -33,7 +34,11 @@ export default function RootLayout() {
}
return (
<ClerkProvider tokenCache={tokenCache} publishableKey={publishableKey}>
<ClerkProvider
tokenCache={tokenCache}
publishableKey={publishableKey}
__experimental_resourceCache={secureStore}
>
<ClerkLoaded>
<JazzAndAuth>
<Slot />

View File

@@ -1,7 +1,7 @@
{
"name": "chat-rn-clerk",
"main": "index.js",
"version": "1.0.75",
"version": "1.0.85",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",

View File

@@ -1,5 +1,89 @@
# chat-rn
## 1.0.81
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react-native@0.11.4
## 1.0.80
### Patch Changes
- jazz-react-native@0.11.3
- jazz-tools@0.11.3
## 1.0.79
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react-native@0.11.2
## 1.0.78
### Patch Changes
- jazz-react-native@0.11.1
## 1.0.77
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-react-native@0.11.0
## 1.0.76
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-react-native@0.10.15
## 1.0.75
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react-native@0.10.14
## 1.0.74
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-react-native@0.10.13
## 1.0.73
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react-native@0.10.12
## 1.0.72
### Patch Changes
- Updated dependencies [5a54e4a]
- jazz-react-native@0.10.11
## 1.0.71
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.71",
"version": "1.0.81",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",
@@ -35,8 +35,6 @@
"react": "^18.3.1",
"react-native": "~0.76.3",
"react-native-get-random-values": "^1.11.0",
"react-native-nitro-modules": "0.21.0",
"react-native-quick-crypto": "1.0.0-beta.12",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "4.1.0",
"react-native-url-polyfill": "^2.0.0",

View File

@@ -9,7 +9,7 @@ import * as Linking from "expo-linking";
import React, { StrictMode, useEffect, useState } from "react";
import HandleInviteScreen from "./invite";
import { JazzProvider, RNQuickCrypto } from "jazz-react-native";
import { JazzProvider } from "jazz-react-native";
import { apiKey } from "./apiKey";
import ChatScreen from "./chat";
@@ -50,7 +50,6 @@ function App() {
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
CryptoProvider={RNQuickCrypto}
>
<NavigationContainer linking={linking} ref={navigationRef}>
<Stack.Navigator initialRouteName={initialRoute}>

View File

@@ -25,11 +25,8 @@ appId: com.jazz.chatrn
- assertVisible: "Logout"
# send a message
- runFlow:
label: "Erase existing message"
file: erase_text.yml
env:
id: "message-input"
- tapOn:
id: "message-input"
- inputText: "bro, low key, it do be like that tho"
- tapOn:
id: "send-button"
@@ -44,5 +41,10 @@ appId: com.jazz.chatrn
# logout
- tapOn: "Logout"
- assertVisible: "boorad"
- assertVisible: "bro, low key, it do be like that tho"
- assertVisible: "Anonymous user"
# This doesn't work on CI, maybe because Android has a different alert dialog
# - tapOn: "Join chat"
# - inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
# - pressKey: "enter"
# - assertVisible: "boorad"
# - assertVisible: "bro, low key, it do be like that tho"

View File

@@ -1,5 +1,85 @@
# chat-vue
## 0.0.66
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-browser@0.11.4
- jazz-vue@0.11.4
## 0.0.65
### Patch Changes
- jazz-browser@0.11.3
- jazz-tools@0.11.3
- jazz-vue@0.11.3
## 0.0.64
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-browser@0.11.2
- jazz-vue@0.11.2
## 0.0.63
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [18428ea]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-browser@0.11.0
- jazz-vue@0.11.0
## 0.0.62
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-browser@0.10.15
- jazz-vue@0.10.15
## 0.0.61
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-browser@0.10.14
- jazz-vue@0.10.14
## 0.0.60
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-browser@0.10.13
- jazz-vue@0.10.13
## 0.0.59
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-vue@0.10.12
- jazz-browser@0.10.12
## 0.0.58
### Patch Changes

View File

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

View File

@@ -1,5 +1,91 @@
# jazz-example-chat
## 0.0.163
### Patch Changes
- 2074e45: In the chat app example, show a "Message not readable" placeholder, if messages from a chat list are not readable by the user.
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-browser-media-images@0.11.4
- jazz-react@0.11.4
## 0.0.162
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
- jazz-browser-media-images@0.11.3
## 0.0.161
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
- jazz-browser-media-images@0.11.2
## 0.0.160
### Patch Changes
- jazz-react@0.11.1
## 0.0.159
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-browser-media-images@0.11.0
- jazz-react@0.11.0
## 0.0.158
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-browser-media-images@0.10.15
- jazz-react@0.10.15
## 0.0.157
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
- jazz-browser-media-images@0.10.14
## 0.0.156
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-browser-media-images@0.10.13
- jazz-react@0.10.13
## 0.0.155
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
- jazz-browser-media-images@0.10.12
## 0.0.154
### Patch Changes

View File

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

View File

@@ -1,6 +1,6 @@
import { createImage } from "jazz-browser-media-images";
import { useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import { useAccount, useCoState } from "jazz-react";
import { Account, ID } from "jazz-tools";
import { useState } from "react";
import { Chat, Message } from "./schema.ts";
import {
@@ -17,6 +17,7 @@ import {
} from "./ui.tsx";
export function ChatScreen(props: { chatID: ID<Chat> }) {
const account = useAccount();
const chat = useCoState(Chat, props.chatID, [{}]);
const [showNLastMessages, setShowNLastMessages] = useState(30);
@@ -47,7 +48,7 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
chat
.slice(-showNLastMessages)
.reverse() // this plus flex-col-reverse on ChatBody gives us scroll-to-bottom behavior
.map((msg) => <ChatBubble msg={msg} key={msg.id} />)
.map((msg) => <ChatBubble me={account.me} msg={msg} key={msg.id} />)
) : (
<EmptyChatMessage />
)}
@@ -74,7 +75,20 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
);
}
function ChatBubble(props: { msg: Message }) {
function ChatBubble(props: { me: Account; msg: Message }) {
if (!props.me.canRead(props.msg)) {
return (
<BubbleContainer fromMe={false}>
<BubbleBody fromMe={false}>
<BubbleText
text="Message not readable"
className="text-gray-500 italic"
/>
</BubbleBody>
</BubbleContainer>
);
}
const lastEdit = props.msg._edits.text;
const fromMe = lastEdit.by?.isMe;
const { text, image } = props.msg;

View File

@@ -70,8 +70,12 @@ export function BubbleBody(props: {
);
}
export function BubbleText(props: { text: string }) {
return <p className="px-2 leading-relaxed">{props.text}</p>;
export function BubbleText(props: { text: string; className?: string }) {
return (
<p className={clsx("px-2 leading-relaxed", props.className)}>
{props.text}
</p>
);
}
export function BubbleImage(props: { image: ImageDefinition }) {

View File

@@ -1,5 +1,91 @@
# minimal-auth-clerk
## 0.0.62
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react@0.11.4
- jazz-react-auth-clerk@0.11.4
## 0.0.61
### Patch Changes
- jazz-react@0.11.3
- jazz-react-auth-clerk@0.11.3
- jazz-tools@0.11.3
## 0.0.60
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
- jazz-react-auth-clerk@0.11.2
## 0.0.59
### Patch Changes
- jazz-react@0.11.1
- jazz-react-auth-clerk@0.11.1
## 0.0.58
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-react-auth-clerk@0.11.0
- jazz-react@0.11.0
## 0.0.57
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-react@0.10.15
- jazz-react-auth-clerk@0.10.15
## 0.0.56
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
- jazz-react-auth-clerk@0.10.14
## 0.0.55
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-react@0.10.13
- jazz-react-auth-clerk@0.10.13
## 0.0.54
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
- jazz-react-auth-clerk@0.10.12
## 0.0.53
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.53",
"version": "0.0.62",
"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.10.9",
"jazz-react-auth-clerk": "workspace:0.11.4",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View File

@@ -1,5 +1,76 @@
# file-share-svelte
## 0.0.46
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-svelte@0.11.4
## 0.0.45
### Patch Changes
- jazz-svelte@0.11.3
- jazz-tools@0.11.3
## 0.0.44
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-svelte@0.11.2
## 0.0.43
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-svelte@0.11.0
## 0.0.42
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-svelte@0.10.15
## 0.0.41
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-svelte@0.10.14
## 0.0.40
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-svelte@0.10.13
## 0.0.39
### Patch Changes
- Updated dependencies [4612e05]
- jazz-svelte@0.10.12
- jazz-tools@0.10.12
## 0.0.38
### Patch Changes

View File

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

28
examples/filestream/.gitignore vendored Normal file
View File

@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
/test-results/
/playwright-report/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
playwright-report

View File

@@ -0,0 +1,277 @@
# jazz-tailwind-demo-auth-starter
## 0.0.2
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react@0.11.4
## 0.0.52
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-react@0.10.15
## 0.0.51
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
## 0.0.50
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-react@0.10.13
## 0.0.49
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
## 0.0.48
### Patch Changes
- jazz-react@0.10.9
## 0.0.47
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
## 0.0.46
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
## 0.0.45
### Patch Changes
- Updated dependencies [1d71ca1]
- Updated dependencies [ada802b]
- jazz-react@0.10.6
- jazz-tools@0.10.6
## 0.0.44
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react@0.10.5
## 0.0.43
### Patch Changes
- jazz-react@0.10.4
- jazz-tools@0.10.4
## 0.0.42
### Patch Changes
- Updated dependencies [d8582fc]
- jazz-tools@0.10.3
- jazz-react@0.10.3
## 0.0.41
### Patch Changes
- jazz-react@0.10.2
- jazz-tools@0.10.2
## 0.0.40
### Patch Changes
- Updated dependencies [5a63cba]
- jazz-tools@0.10.1
- jazz-react@0.10.1
## 0.0.39
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-react@0.10.0
- jazz-tools@0.10.0
## 0.0.38
### Patch Changes
- jazz-react@0.9.23
- jazz-tools@0.9.23
## 0.0.37
### Patch Changes
- jazz-react@0.9.22
## 0.0.36
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-react@0.9.21
## 0.0.35
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-react@0.9.20
## 0.0.34
### Patch Changes
- jazz-react@0.9.19
- jazz-tools@0.9.19
## 0.0.33
### Patch Changes
- jazz-react@0.9.18
- jazz-tools@0.9.18
## 0.0.32
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-react@0.9.17
## 0.0.31
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-react@0.9.16
## 0.0.30
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-react@0.9.15
## 0.0.29
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-react@0.9.14
## 0.0.28
### Patch Changes
- jazz-react@0.9.13
- jazz-tools@0.9.13
## 0.0.27
### Patch Changes
- jazz-react@0.9.12
- jazz-tools@0.9.12
## 0.0.26
### Patch Changes
- jazz-react@0.9.11
- jazz-tools@0.9.11
## 0.0.25
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
## 0.0.24
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-react@0.9.9
## 0.0.23
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
## 0.0.22
### Patch Changes
- jazz-react@0.9.4
## 0.0.21
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
## 0.0.20
### Patch Changes
- Updated dependencies [956a4d1]
- Updated dependencies [8eda792]
- jazz-react@0.9.0
- jazz-tools@0.9.0
## 0.0.19
### Patch Changes
- Updated dependencies [dc62b95]
- Updated dependencies [1de26f8]
- jazz-tools@0.8.51
- jazz-react@0.8.51

View File

@@ -0,0 +1,66 @@
# File upload example with Jazz and React
This is an example of how to upload and render images with Jazz.
Live version: https://file-upload-demo.jazz.tools
## Getting started
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx create-jazz-app@latest --example file-upload --project-name file-upload
```
Go to the new project directory.
```bash
cd file-upload
```
Run the dev server.
```bash
npm run dev
```
### Using the monorepo
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
Clone the jazz repository.
```bash
git clone https://github.com/garden-co/jazz.git
```
Install and build dependencies.
```bash
pnpm i && npx turbo build
```
Go to the example directory.
```bash
cd jazz/examples/file-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.
## 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 `JazzProvider` component in [./src/main.tsx](./src/main.tsx).

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz | React + Demo Auth + Tailwind</title>
</head>
<body class="h-full flex flex-col">
<div id="root" class="align-self-center flex-1"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@@ -0,0 +1,32 @@
{
"name": "filestream",
"private": true,
"version": "0.0.2",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"preview": "vite preview",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write"
},
"dependencies": {
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"autoprefixer": "^10.4.20",
"globals": "^15.11.0",
"is-ci": "^3.0.1",
"postcss": "^8.5.3",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",
"vite": "^6.0.11"
}
}

View File

@@ -0,0 +1,46 @@
import { defineConfig, devices } from "@playwright/test";
import isCI from "is-ci";
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: isCI,
/* Retry on CI only */
retries: isCI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: isCI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:5173/",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
permissions: ["clipboard-read", "clipboard-write"],
},
/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
/* Run your local dev server before starting the tests */
webServer: [
{
command: "pnpm preview --port 5173",
url: "http://localhost:5173/",
reuseExistingServer: !isCI,
},
],
});

View File

@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

View File

@@ -0,0 +1,37 @@
import { FileWidget } from "./FileWidget.js";
import { Logo } from "./Logo.tsx";
function App() {
return (
<>
<main className="container mt-16 flex flex-col gap-8">
<Logo />
<FileWidget />
<p className="text-center">
Edit the form above,{" "}
<button
type="button"
onClick={() => window.location.reload()}
className="font-semibold underline"
>
refresh
</button>{" "}
this page, and see your changes persist.
</p>
<p className="text-center my-16">
Go to{" "}
<a
className="font-semibold underline"
href="https://jazz.tools/docs/react/guide"
>
jazz.tools/docs/react/guide
</a>{" "}
for a full tutorial.
</p>
</main>
</>
);
}
export default App;

View File

@@ -0,0 +1,269 @@
"use client";
import { useAccount } from "jazz-react";
import { FileStream } from "jazz-tools";
import { useRef, useState } from "react";
export function FileWidget() {
const inputRef = useRef<HTMLInputElement>(null);
const dragAndDropElementRef = useRef<HTMLDivElement>(null);
const [isUploading, setIsUploading] = useState(false);
const [progress, setProgress] = useState(0);
const [error, setError] = useState<string | null>(null);
const { me } = useAccount();
async function handleUpload(event: React.FormEvent) {
event.preventDefault();
setError(null);
if (!me?.profile) {
setError("User profile not found");
return;
}
setProgress(0);
const file = inputRef.current?.files?.[0];
if (!file) {
setError("Please select a file");
return;
}
try {
setIsUploading(true);
me.profile.file = await FileStream.createFromBlob(file, {
onProgress: (p) => setProgress(Math.round(p * 100)),
});
} catch (error) {
setError(
error instanceof Error ? error.message : "Failed to upload file",
);
console.error("Error uploading file:", error);
} finally {
setIsUploading(false);
}
}
function handleDelete() {
if (!me?.profile) return;
delete me.profile?.file;
}
async function handleDownload() {
if (!me?.profile) return;
const file = me.profile.file;
if (!file) return;
try {
const blob = file.toBlob();
const url = URL.createObjectURL(blob || new Blob());
const a = document.createElement("a");
a.href = url;
a.download = file.id || "download";
a.click();
URL.revokeObjectURL(url);
} catch (error) {
console.error("Error downloading file:", error);
}
}
function formatFileSize(bytes?: number): string {
if (!bytes) return "0 Bytes";
const k = 1024;
const sizes = ["Bytes", "KB", "MB", "GB"];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
}
const onDragEnter = (e: React.DragEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
dragAndDropElementRef?.current?.classList.replace(
"border-stone-400",
"border-blue-700",
);
};
const onDragOver = (e: React.DragEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
dragAndDropElementRef?.current?.classList.replace(
"border-stone-400",
"border-blue-700",
);
};
const onDragLeave = (e: React.DragEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
dragAndDropElementRef?.current?.classList.replace(
"border-blue-700",
"border-stone-400",
);
};
const onDrop = async (e: React.DragEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
dragAndDropElementRef?.current?.classList.replace(
"border-blue-700",
"border-stone-400",
);
if (!me?.profile) {
setError("User profile not found");
return;
}
const droppedFiles = e.dataTransfer.files;
if (!droppedFiles || droppedFiles.length === 0) {
return;
}
const file = droppedFiles[0];
setProgress(0);
try {
setIsUploading(true);
me.profile.file = await FileStream.createFromBlob(file, {
onProgress: (p) => setProgress(Math.round(p * 100)),
});
} catch (error) {
setError(
error instanceof Error ? error.message : "Failed to upload file",
);
console.error("Error uploading file:", error);
} finally {
setIsUploading(false);
}
};
if (me?.profile?.file == null) {
return (
<div className="flex flex-col gap-4">
<div
className="flex flex-col border-2 border-dashed border-stone-400 h-48 items-center justify-center bg-stone-100 m-5 rounded-md"
ref={dragAndDropElementRef}
onDragEnter={onDragEnter}
onDragOver={onDragOver}
onDragLeave={onDragLeave}
onDrop={onDrop}
>
<p>Drag & drop your file here</p>
</div>
<form onSubmit={handleUpload} className="flex gap-2">
<input
className="bg-stone-100 py-1.5 px-2 text-sm rounded-md w-4/5"
ref={inputRef}
type="file"
accept="file"
onChange={() => setError(null)}
disabled={isUploading}
/>
<button
type="submit"
className="bg-stone-100 py-1.5 px-3 text-sm rounded-md disabled:opacity-50"
disabled={isUploading}
>
{isUploading ? `Uploading...` : "Upload file"}
</button>
</form>
{error && (
<div className="text-red-800 text-sm pl-4" role="alert">
{error}
</div>
)}
{isUploading && (
<div className="flex gap-2 items-center">
<div className="py-1.5 px-3 text-sm">Progress: {progress}%</div>
<div className="h-2 bg-stone-200 rounded-full flex-1">
<div
className="h-full bg-blue-500 rounded-full transition-all duration-300"
style={{ width: `${progress}%` }}
/>
</div>
</div>
)}
</div>
);
}
const fileData = me?.profile?.file?.getChunks();
const mimeType = fileData?.mimeType || "unknown";
return (
<div className="gap-2">
<div className="p-4">
<div className="space-y-2">
<div className="flex justify-between">
<span className="font-bold">File name</span>
<span>{fileData?.fileName}</span>
</div>
<div className="flex justify-between">
<span className="font-bold">Type</span>
<span>{mimeType}</span>
</div>
<div className="flex justify-between">
<span className="font-bold">Size</span>
<span>{formatFileSize(fileData?.totalSizeBytes)}</span>
</div>
</div>
</div>
<div className="flex gap-2 justify-end">
<button
className="bg-stone-100 py-1.5 px-3 text-sm rounded-md"
onClick={handleDelete}
>
Delete file
</button>
<button
className="bg-stone-100 py-1.5 px-3 text-sm rounded-md"
onClick={handleDownload}
>
Download file
</button>
</div>
<div className="w-full justify-center pt-8">
{fileData?.mimeType?.startsWith("image/") && (
<div className="flex justify-center">
<img
src={URL.createObjectURL(
me?.profile?.file?.toBlob() || new Blob(),
)}
alt="File preview"
className="max-w-xs mb-4"
/>
</div>
)}
{fileData?.mimeType?.startsWith("audio/") && (
<div className="flex justify-center">
<audio
src={URL.createObjectURL(
me?.profile?.file?.toBlob() || new Blob(),
)}
controls
className="w-full mb-4"
/>
</div>
)}
{fileData?.mimeType?.startsWith("video/") && (
<div className="flex justify-center">
<video
src={URL.createObjectURL(
me?.profile?.file?.toBlob() || new Blob(),
)}
controls
className="w-full mb-4"
/>
</div>
)}
</div>
</div>
);
}

View File

@@ -0,0 +1,21 @@
export function Logo() {
return (
<svg
viewBox="0 0 386 146"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="text-black w-48 mx-auto"
>
<path
d="M176.725 33.865H188.275V22.7H176.725V33.865ZM164.9 129.4H172.875C182.72 129.4 188.275 123.9 188.275 114.22V43.6H176.725V109.545C176.725 115.65 173.975 118.51 167.925 118.51H164.9V129.4ZM245.298 53.28C241.613 45.47 233.363 41.95 222.748 41.95C208.998 41.95 200.748 48.44 197.888 58.615L208.613 61.915C210.648 55.315 216.368 52.565 222.638 52.565C231.933 52.565 235.673 56.415 236.058 64.61C226.433 65.93 216.643 67.195 209.768 69.23C200.583 72.145 195.743 77.865 195.743 86.83C195.743 96.51 202.673 104.65 215.818 104.65C225.443 104.65 232.318 101.35 237.213 94.365V103H247.388V66.425C247.388 61.475 247.168 57.185 245.298 53.28ZM217.853 95.245C210.483 95.245 207.128 91.34 207.128 86.72C207.128 82.045 210.593 79.515 215.323 77.92C220.328 76.435 226.983 75.5 235.948 74.18C235.893 76.93 235.673 80.725 234.738 83.475C233.418 89.25 227.643 95.245 217.853 95.245ZM251.22 103H301.545V92.715H269.535L303.195 45.47V43.6H254.3V53.885H284.935L251.22 101.185V103ZM304.815 103H355.14V92.715H323.13L356.79 45.47V43.6H307.895V53.885H338.53L304.815 101.185V103Z"
fill="currentColor"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M136.179 44.8277C136.179 44.8277 136.179 44.8277 136.179 44.8276V21.168C117.931 28.5527 97.9854 32.6192 77.0897 32.6192C65.1466 32.6192 53.5138 31.2908 42.331 28.7737V51.4076C42.331 51.4076 42.331 51.4076 42.331 51.4076V81.1508C41.2955 80.4385 40.1568 79.8458 38.9405 79.3915C36.1732 78.358 33.128 78.0876 30.1902 78.6145C27.2524 79.1414 24.5539 80.4419 22.4358 82.3516C20.3178 84.2613 18.8754 86.6944 18.291 89.3433C17.7066 91.9921 18.0066 94.7377 19.1528 97.2329C20.2991 99.728 22.2403 101.861 24.7308 103.361C27.2214 104.862 30.1495 105.662 33.1448 105.662H33.1455C33.6061 105.662 33.8365 105.662 34.0314 105.659C44.5583 105.449 53.042 96.9656 53.2513 86.4386C53.2534 86.3306 53.2544 86.2116 53.2548 86.0486H53.2552V85.7149L53.2552 85.5521V82.0762L53.2552 53.1993C61.0533 54.2324 69.0092 54.7656 77.0897 54.7656C77.6696 54.7656 78.2489 54.7629 78.8276 54.7574V110.696C77.792 109.983 76.6533 109.391 75.437 108.936C72.6697 107.903 69.6246 107.632 66.6867 108.159C63.7489 108.686 61.0504 109.987 58.9323 111.896C56.8143 113.806 55.3719 116.239 54.7875 118.888C54.2032 121.537 54.5031 124.283 55.6494 126.778C56.7956 129.273 58.7368 131.405 61.2273 132.906C63.7179 134.406 66.646 135.207 69.6414 135.207C70.1024 135.207 70.3329 135.207 70.5279 135.203C81.0548 134.994 89.5385 126.51 89.7478 115.983C89.7517 115.788 89.7517 115.558 89.7517 115.097V111.621L89.7517 54.3266C101.962 53.4768 113.837 51.4075 125.255 48.2397V80.9017C124.219 80.1894 123.081 79.5966 121.864 79.1424C119.097 78.1089 116.052 77.8384 113.114 78.3653C110.176 78.8922 107.478 80.1927 105.36 82.1025C103.242 84.0122 101.799 86.4453 101.215 89.0941C100.631 91.743 100.931 94.4886 102.077 96.9837C103.223 99.4789 105.164 101.612 107.655 103.112C110.145 104.612 113.073 105.413 116.069 105.413C116.53 105.413 116.76 105.413 116.955 105.409C127.482 105.2 135.966 96.7164 136.175 86.1895C136.179 85.9945 136.179 85.764 136.179 85.3029V81.8271L136.179 44.8277Z"
fill="#3313F7"
/>
</svg>
);
}

View File

@@ -0,0 +1 @@
export const apiKey = "filestream-example-jazz@garden.co";

View File

@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@@ -0,0 +1,29 @@
import { JazzProvider } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import { apiKey } from "./apiKey.ts";
import "./index.css";
import { JazzAccount } from "./schema.ts";
// We use this to identify the app in the passkey auth
export const APPLICATION_NAME = "Jazz File Stream Example";
declare module "jazz-react" {
export interface Register {
Account: JazzAccount;
}
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<JazzProvider
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
AccountSchema={JazzAccount}
>
<App />
</JazzProvider>
</StrictMode>,
);

View File

@@ -0,0 +1,14 @@
import { Account, FileStream, Profile, co } from "jazz-tools";
export class JazzProfile extends Profile {
file = co.ref(FileStream, { optional: true });
}
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) {}
}

1
examples/filestream/src/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
/// <reference types="vite/client" />

View File

@@ -0,0 +1,23 @@
import type { Config } from "tailwindcss";
const config: Config = {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {
container: {
center: true,
padding: {
DEFAULT: "0.75rem",
sm: "1rem",
},
screens: {
lg: "600px",
xl: "600px",
},
},
},
},
plugins: [],
} as const;
export default config;

View File

@@ -0,0 +1,9 @@
import { expect, test } from "@playwright/test";
test("home page loads", async ({ page }) => {
await page.goto("/");
await expect(page.getByText("Welcome!")).toBeVisible();
await page.getByLabel("Name").fill("Bob");
await expect(page.getByText("Welcome, Bob!")).toBeVisible();
});

View File

@@ -0,0 +1,24 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src"]
}

View File

@@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2022",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}

View File

@@ -0,0 +1,8 @@
{
"build": {
"env": {
"APP_NAME": "filestream"
}
},
"ignoreCommand": "node ../../ignore-vercel-build.js"
}

View File

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

View File

@@ -1,5 +1,94 @@
# form
## 0.1.4
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-browser-media-images@0.11.4
- jazz-react@0.11.4
## 0.1.3
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
- jazz-browser-media-images@0.11.3
## 0.1.2
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
- jazz-browser-media-images@0.11.2
## 0.1.1
### Patch Changes
- jazz-react@0.11.1
## 0.1.0
### Minor Changes
- 18428ea: PasskeyAuth: Sets `profile.name` only if a non-empty username is passed to `signUp`
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-browser-media-images@0.11.0
- jazz-react@0.11.0
## 0.0.53
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-browser-media-images@0.10.15
- jazz-react@0.10.15
## 0.0.52
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
- jazz-browser-media-images@0.10.14
## 0.0.51
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-browser-media-images@0.10.13
- jazz-react@0.10.13
## 0.0.50
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
- jazz-browser-media-images@0.10.12
## 0.0.49
### Patch Changes

View File

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

View File

@@ -1,5 +1,90 @@
# image-upload
## 0.0.60
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-browser-media-images@0.11.4
- jazz-react@0.11.4
## 0.0.59
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
- jazz-browser-media-images@0.11.3
## 0.0.58
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
- jazz-browser-media-images@0.11.2
## 0.0.57
### Patch Changes
- jazz-react@0.11.1
## 0.0.56
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-browser-media-images@0.11.0
- jazz-react@0.11.0
## 0.0.55
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-browser-media-images@0.10.15
- jazz-react@0.10.15
## 0.0.54
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
- jazz-browser-media-images@0.10.14
## 0.0.53
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-browser-media-images@0.10.13
- jazz-react@0.10.13
## 0.0.52
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
- jazz-browser-media-images@0.10.12
## 0.0.51
### Patch Changes

View File

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

View File

@@ -1,5 +1,41 @@
# jazz-example-inspector
## 0.0.113
### Patch Changes
- Updated dependencies [7f036c1]
- cojson@0.11.4
- cojson-transport-ws@0.11.4
## 0.0.112
### Patch Changes
- Updated dependencies [68b0242]
- cojson-transport-ws@0.11.3
- cojson@0.11.3
## 0.0.111
### Patch Changes
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [e22de9f]
- Updated dependencies [34cbdc3]
- Updated dependencies [0f67e0a]
- cojson@0.11.0
- cojson-transport-ws@0.11.0
## 0.0.110
### Patch Changes
- Updated dependencies [f86e278]
- cojson@0.10.15
- cojson-transport-ws@0.10.15
## 0.0.109
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.109",
"version": "0.0.113",
"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.10.8",
"cojson-transport-ws": "workspace:0.10.8",
"cojson": "workspace:0.11.4",
"cojson-transport-ws": "workspace:0.11.4",
"hash-slash": "workspace:0.2.2",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",

View File

@@ -83,7 +83,10 @@ export default function CoJsonViewerApp() {
const addAccount = (id: RawAccountID, secret: AgentSecret) => {
const newAccount = { id, secret };
setAccounts([...accounts, newAccount]);
const accountExists = accounts.some((account) => account.id === id);
if (!accountExists) {
setAccounts([...accounts, newAccount]);
}
setCurrentAccount(newAccount);
};

1
examples/multiauth/.env Normal file
View File

@@ -0,0 +1 @@
VITE_CLERK_PUBLISHABLE_KEY=pk_test_ZXZpZGVudC1kYW5lLTg5LmNsZXJrLmFjY291bnRzLmRldiQ

24
examples/multiauth/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -0,0 +1,29 @@
# multiauth
## 0.0.3
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react@0.11.4
- jazz-react-auth-clerk@0.11.4
## 0.0.2
### Patch Changes
- jazz-react@0.11.3
- jazz-react-auth-clerk@0.11.3
- jazz-tools@0.11.3
## 0.0.1
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
- jazz-react-auth-clerk@0.11.2

View File

@@ -0,0 +1,43 @@
# Multi-auth example with Jazz and React
This example demonstrates using Jazz with multiple authentication methods; in this case, Clerk and passphrases are able to be used.
## Getting started
To run this example, you may either:
* Clone the Jazz monorepo and run this example from within.
* Create a new Jazz project using this example as a template, and run that new project.
### Using this example as a template
1. Create a new Jazz project, and use this example as a template.
```bash
npx create-jazz-app@latest --example counter --project-name counter
```
2. Navigate to the new project and start the development server.
```bash
cd counter
npm run dev
```
### Using the monorepo
This requires `pnpm` to be installed; see [https://pnpm.io/installation](https://pnpm.io/installation).
1. Clone the `jazz` repository.
```bash
git clone https://github.com/garden-co/jazz.git
```
2. Install dependencies.
```bash
cd jazz
pnpm install
```
3. Navigate to the example and start the development server.
```bash
cd examples/counter
pnpm dev
```
The example should be running at [http://localhost:5173](http://localhost:5173) by default.

View File

@@ -0,0 +1,28 @@
import js from "@eslint/js";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
);

View File

@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz Multi-auth (React)</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@@ -0,0 +1,30 @@
{
"name": "multiauth",
"private": true,
"version": "0.0.3",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"preview": "vite preview",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write"
},
"dependencies": {
"@clerk/clerk-react": "^5.4.1",
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "~5.6.2",
"vite": "^6.0.11"
}
}

View File

@@ -0,0 +1,12 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
.card {
padding: 2em;
display: flex;
flex-direction: column;
}

View File

@@ -0,0 +1,12 @@
import { Home } from "./components/Home.tsx";
import "./App.css";
export default function App() {
return (
<div className="card">
<h1>Jazz Multi-auth (React)</h1>
<Home />
</div>
);
}

View File

@@ -0,0 +1 @@
export const apiKey = "counter-example@garden.co";

View File

@@ -0,0 +1,26 @@
import { useAccount, useIsAuthenticated } from "jazz-react";
export function Home() {
const { me, logOut } = useAccount({ root: {} });
const isAuthenticated = useIsAuthenticated();
if (!me) return;
if (!isAuthenticated) return;
return (
<div
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
gap: "1rem",
}}
>
<div className="container">
<h1>You're logged in</h1>
<p>Welcome back, {me?.profile?.name}</p>
<button onClick={() => logOut()}>Logout</button>
</div>
</div>
);
}

View File

@@ -0,0 +1,184 @@
import { SignInButton } from "@clerk/clerk-react";
import { usePassphraseAuth } from "jazz-react";
import { JazzProviderProps, useIsAuthenticated } from "jazz-react";
import { useState } from "react";
import "../index.css";
import { useClerk } from "@clerk/clerk-react";
import { JazzProviderWithClerk } from "jazz-react-auth-clerk";
import { wordlist } from "../wordlist.ts";
export function OmniAuthContainer(props: {
appName: string;
wordlist: string[];
children?: React.ReactNode;
}) {
const isAuthenticated = useIsAuthenticated();
const passphraseAuth = usePassphraseAuth({
wordlist: props.wordlist,
});
const [step, setStep] = useState<
"initial" | "create" | "loginWithPassphrase" | "loginWithClerk"
>("initial");
const [loginPassphrase, setLoginPassphrase] = useState("");
const [isCopied, setIsCopied] = useState(false);
const [currentPassphrase, setCurrentPassphrase] = useState(() =>
passphraseAuth.generateRandomPassphrase(),
);
if (passphraseAuth.state === "signedIn" || isAuthenticated) {
return props.children ?? null;
}
const handleCreateAccount = async () => {
setStep("create");
};
const handleLoginWithPassphrase = () => {
setStep("loginWithPassphrase");
};
const handleLoginWithClerk = () => {
setStep("loginWithClerk");
};
const handleReroll = () => {
const newPassphrase = passphraseAuth.generateRandomPassphrase();
setCurrentPassphrase(newPassphrase);
setIsCopied(false);
};
const handleBack = () => {
setStep("initial");
setLoginPassphrase("");
};
const handleCopy = async () => {
await navigator.clipboard.writeText(passphraseAuth.passphrase);
setIsCopied(true);
};
const handleLoginSubmit = async () => {
await passphraseAuth.logIn(loginPassphrase);
setStep("initial");
setLoginPassphrase("");
};
const handleNext = async () => {
await passphraseAuth.registerNewAccount(currentPassphrase, "My Account");
setStep("initial");
setLoginPassphrase("");
};
return (
<div className="auth-container">
<div className="auth-card">
{step === "initial" && (
<div>
<h1 className="auth-heading">{props.appName}</h1>
<button
onClick={handleCreateAccount}
className="auth-button-primary"
>
Signup with passphrase
</button>
<button
onClick={handleLoginWithPassphrase}
className="auth-button-secondary"
>
Login with passphrase
</button>
<button
onClick={handleLoginWithClerk}
className="auth-button-secondary"
>
Login with Clerk
</button>
</div>
)}
{step === "create" && (
<>
<h1 className="auth-heading">Your Passphrase</h1>
<p className="auth-description">
Please copy and store this passphrase somewhere safe. You'll need
it to log in.
</p>
<textarea
readOnly
value={currentPassphrase}
className="auth-textarea"
rows={5}
/>
<button onClick={handleCopy} className="auth-button-primary">
{isCopied ? "Copied!" : "Copy"}
</button>
<div className="auth-button-group">
<button onClick={handleBack} className="auth-button-secondary">
Back
</button>
<button onClick={handleReroll} className="auth-button-secondary">
Generate New Passphrase
</button>
<button onClick={handleNext} className="auth-button-primary">
Register
</button>
</div>
</>
)}
{step === "loginWithPassphrase" && (
<div>
<h1 className="auth-heading">Log In</h1>
<textarea
value={loginPassphrase}
onChange={(e) => setLoginPassphrase(e.target.value)}
placeholder="Enter your passphrase"
className="auth-textarea"
rows={5}
/>
<div className="auth-button-group">
<button onClick={handleBack} className="auth-button-secondary">
Back
</button>
<button
onClick={handleLoginSubmit}
className="auth-button-primary"
>
Log In
</button>
</div>
</div>
)}
{step === "loginWithClerk" && <SignInButton />}
</div>
</div>
);
}
export function OmniAuth({
children,
AccountSchema,
sync,
}: {
children: React.ReactNode;
} & JazzProviderProps) {
const clerk = useClerk();
return (
<JazzProviderWithClerk
clerk={clerk}
sync={sync}
AccountSchema={AccountSchema}
>
<OmniAuthContainer
appName="Jazz Multi-Authentication Example"
wordlist={wordlist}
>
{children}
</OmniAuthContainer>
</JazzProviderWithClerk>
);
}

View File

@@ -0,0 +1,151 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
body {
margin: auto 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}
h1 {
font-size: 2.2em;
line-height: 1.1;
font-weight: 500;
letter-spacing: 0.6px;
}
button {
border-radius: 6px;
border: 1px solid white;
color: inherit;
padding: 0.5rem 1rem;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: transparent;
cursor: pointer;
transition: all 0.05s ease, border-color 0.1s ease;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
button:hover {
background-color: #313131;
}
button:active {
border-color: #3313f7;
transform: translateY(2px);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
@media (prefers-color-scheme: light) {
:root {
color: rgb(21, 20, 20);
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
border-color: #e5e4e2;
}
button:hover {
border-color: rgb(47, 46, 46);
background-color: white;
}
button:active {
border-color: #3313f7;
}
}
.auth-container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: #f3f4f6;
}
.auth-card {
background-color: white;
padding: 2rem;
border-radius: 0.5rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px
rgba(0, 0, 0, 0.06);
width: 28rem;
}
.auth-button-primary,
.auth-button-secondary {
width: 100%;
padding: 0.5rem 1rem;
border-radius: 0.25rem;
font-weight: bold;
cursor: pointer;
margin-bottom: 1rem;
}
.auth-button-primary {
background-color: black;
color: white;
border: none;
}
.auth-button-secondary {
background-color: white;
color: black;
border: 1px solid black;
}
.auth-heading {
color: black;
font-size: 1.5rem;
font-weight: bold;
text-align: center;
margin-bottom: 1rem;
}
.auth-textarea {
width: 100%;
padding: 0.5rem;
border: 1px solid #d1d5db;
border-radius: 0.25rem;
margin-bottom: 1rem;
box-sizing: border-box;
}
.auth-description {
font-size: 0.875rem;
color: #4b5563;
text-align: center;
margin-bottom: 1rem;
}
.auth-button-group {
display: flex;
justify-content: space-between;
gap: 1rem;
}

View File

@@ -0,0 +1,29 @@
import { ClerkProvider } from "@clerk/clerk-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import "./index.css";
import { apiKey } from "./apiKey.ts";
import { OmniAuth } from "./components/OmniAuth.tsx";
// Import your publishable key
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
if (!PUBLISHABLE_KEY) {
throw new Error("Add your Clerk publishable key to the .env.local file");
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
<OmniAuth
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
when: "signedUp", // This makes the app work in local mode when the user is not authenticated
}}
>
<App />
</OmniAuth>
</ClerkProvider>
</StrictMode>,
);

1
examples/multiauth/src/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
/// <reference types="vite/client" />

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src"]
}

View File

@@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2022",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}

View File

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

View File

@@ -1,5 +1,95 @@
# jazz-example-musicplayer
## 0.0.84
### Patch Changes
- Updated dependencies [d133d47]
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- Updated dependencies [e902405]
- jazz-inspector@0.11.4
- jazz-tools@0.11.4
- jazz-react@0.11.4
## 0.0.83
### Patch Changes
- jazz-inspector@0.11.3
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.82
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-inspector@0.11.2
- jazz-react@0.11.2
## 0.0.81
### Patch Changes
- Updated dependencies [7b00a81]
- jazz-inspector@0.11.1
- jazz-react@0.11.1
## 0.0.80
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [b7deb3c]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-react@0.11.0
- jazz-inspector@0.10.13
## 0.0.79
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-inspector@0.10.12
- jazz-react@0.10.15
## 0.0.78
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-inspector@0.10.11
- jazz-react@0.10.14
## 0.0.77
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-inspector@0.10.10
- jazz-react@0.10.13
## 0.0.76
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-inspector@0.10.9
- jazz-react@0.10.12
## 0.0.75
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.75",
"version": "0.0.84",
"type": "module",
"scripts": {
"dev": "vite",
@@ -22,8 +22,8 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-inspector": "workspace:*",
"jazz-react": "workspace:0.10.9",
"jazz-tools": "workspace:0.10.8",
"jazz-react": "workspace:0.11.4",
"jazz-tools": "workspace:0.11.4",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",

View File

@@ -112,34 +112,31 @@ export async function addTrackToPlaylist(
playlist.tracks?.push(track);
return;
}
}
/**
* Since musicTracks are created as private values (see uploadMusicTracks)
* to make them shareable as part of the playlist we are cloning them
* and setting the playlist group as owner of the clone
*
* Doing this for backwards compatibility for when the Group inheritance wasn't possible
*/
const blob = await FileStream.loadAsBlob(track._refs.file.id);
const waveform = await MusicTrackWaveform.load(track._refs.waveform.id, {});
if (!blob || !waveform) return;
const trackClone = MusicTrack.create(
{
file: await FileStream.createFromBlob(blob, playlist._owner),
duration: track.duration,
waveform: MusicTrackWaveform.create(
{ data: waveform.data },
playlist._owner,
),
title: track.title,
sourceTrack: track,
},
playlist._owner,
export async function removeTrackFromPlaylist(
playlist: Playlist,
track: MusicTrack,
) {
const notAdded = !playlist.tracks?.some(
(t) => t?.id === track.id || t?._refs.sourceTrack?.id === track.id,
);
playlist.tracks?.push(trackClone);
if (notAdded) return;
if (track._owner._type === "Group" && playlist._owner._type === "Group") {
const trackGroup = track._owner;
await trackGroup.revokeExtend(playlist._owner);
const index =
playlist.tracks?.findIndex(
(t) => t?.id === track.id || t?._refs.sourceTrack?.id === track.id,
) ?? -1;
if (index > -1) {
playlist.tracks?.splice(index, 1);
}
return;
}
}
export async function updatePlaylistTitle(playlist: Playlist, title: string) {
@@ -197,3 +194,16 @@ export async function onAnonymousAccountDiscarded(
me.root.rootPlaylist.tracks.push(track);
}
}
export async function deletePlaylist(playlistId: string) {
const { root } = await MusicaAccount.getMe().ensureLoaded({
root: {
playlists: [],
},
});
const index = root.playlists.findIndex((p) => p?.id === playlistId);
if (index > -1) {
root.playlists.splice(index, 1);
}
}

View File

@@ -1,4 +1,4 @@
import { useAcceptInvite } from "jazz-react";
import { useAcceptInvite, useIsAuthenticated } from "jazz-react";
import { ID } from "jazz-tools";
import { useCallback } from "react";
import { useNavigate } from "react-router-dom";
@@ -7,6 +7,8 @@ import { MusicaAccount, Playlist } from "./1_schema";
export function InvitePage() {
const navigate = useNavigate();
const isAuthenticated = useIsAuthenticated();
useAcceptInvite({
invitedObjectSchema: Playlist,
onAccept: useCallback(
@@ -32,5 +34,9 @@ export function InvitePage() {
),
});
return <p>Accepting invite....</p>;
return isAuthenticated ? (
<p>Accepting invite....</p>
) : (
<p>Please sign in to accept the invite.</p>
);
}

View File

@@ -1,5 +1,5 @@
import { MusicTrack, Playlist } from "@/1_schema";
import { addTrackToPlaylist } from "@/4_actions";
import { addTrackToPlaylist, removeTrackFromPlaylist } from "@/4_actions";
import {
DropdownMenu,
DropdownMenuContent,
@@ -10,6 +10,7 @@ import { cn } from "@/lib/utils";
import { useAccount, useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import { MoreHorizontal } from "lucide-react";
import { Fragment } from "react/jsx-runtime";
import { MusicTrackTitleInput } from "./MusicTrackTitleInput";
import { Button } from "./ui/button";
@@ -46,6 +47,21 @@ export function MusicTrackRow({
addTrackToPlaylist(playlist, track);
}
function handleRemoveFromPlaylist(playlist: Playlist) {
if (!track) return;
removeTrackFromPlaylist(playlist, track);
}
function deleteTrack() {
if (!me || !track) return;
const tracks = me.root.rootPlaylist?.tracks;
if (!tracks) return;
const index = tracks.findIndex((t) => t?.id === trackId);
if (index !== -1) {
tracks.splice(index, 1);
}
}
return (
<li
className={
@@ -84,13 +100,30 @@ export function MusicTrackRow({
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
key={`delete`}
onSelect={async () => {
if (!track) return;
deleteTrack();
}}
>
Delete
</DropdownMenuItem>
{playlists.map((playlist, index) => (
<DropdownMenuItem
key={index}
onSelect={() => handleAddToPlaylist(playlist)}
>
Add to {playlist.title}
</DropdownMenuItem>
<Fragment key={index}>
<DropdownMenuItem
key={`add-${index}`}
onSelect={() => handleAddToPlaylist(playlist)}
>
Add to {playlist.title}
</DropdownMenuItem>
<DropdownMenuItem
key={`remove-${index}`}
onSelect={() => handleRemoveFromPlaylist(playlist)}
>
Remove from {playlist.title}
</DropdownMenuItem>
</Fragment>
))}
</DropdownMenuContent>
</DropdownMenu>

View File

@@ -1,4 +1,6 @@
import { deletePlaylist } from "@/4_actions";
import { useAccount } from "jazz-react";
import { Trash2 } from "lucide-react";
import { useNavigate, useParams } from "react-router";
import { LocalOnlyTag } from "./LocalOnlyTag";
@@ -24,6 +26,13 @@ export function SidePanel() {
navigate(`/playlist/${playlistId}`);
}
async function handleDeletePlaylist(playlistId: string) {
if (confirm("Are you sure you want to delete this playlist?")) {
await deletePlaylist(playlistId);
navigate(`/`);
}
}
return (
<aside className="w-64 p-6 bg-white overflow-y-auto">
<div className="flex items-center mb-1">
@@ -65,18 +74,28 @@ export function SidePanel() {
</a>
</li>
{me?.root.playlists.map((playlist, index) => (
<li key={index}>
<li
key={index}
className={`px-2 py-1 flex transition-all duration-300 rounded items-center justify-between ${
playlist.id === playlistId ? "bg-blue-100" : ""
}`}
>
<a
href="#"
className={`block px-2 py-1 text-sm rounded ${
playlist.id === playlistId
? "bg-blue-100 text-blue-600"
: "hover:bg-blue-100"
}`}
className={`w-full text-sm`}
onClick={(evt) => handlePlaylistClick(evt, playlist.id)}
>
{playlist.title}
</a>
{playlist.id === playlistId && (
<button
onClick={() => handleDeletePlaylist(playlist.id)}
className="ml-2 text-red-600 hover:text-red-800 animate-in fade-in scale-in duration-200"
aria-label={`Delete ${playlist.title}`}
>
<Trash2 size={16} />
</button>
)}
</li>
))}
</ul>

View File

@@ -82,3 +82,47 @@ test("create a new playlist and share", async ({
await luigiHome.playMusicTrack("Super Mario World");
await luigiHome.expectActiveTrackPlaying();
});
test("create a new playlist, share, then remove track", async ({
page: marioPage,
browser,
}) => {
// Create playlist with a song and share
await marioPage.goto("/");
const marioHome = new HomePage(marioPage);
await marioHome.expectMusicTrack("Example song");
await marioHome.editTrackTitle("Example song", "Super Mario World");
await marioHome.createPlaylist();
await marioHome.editPlaylistTitle("Save the princess");
await marioHome.navigateToPlaylist("All tracks");
await marioHome.addTrackToPlaylist("Super Mario World", "Save the princess");
await marioHome.navigateToPlaylist("Save the princess");
await marioHome.expectMusicTrack("Super Mario World");
await marioHome.signUp("Mario");
const url = await marioHome.getShareLink();
await sleep(4000); // Wait for the sync to complete
// Retrieve shared playlist
const luigiContext = await browser.newContext();
await mockAuthenticator(luigiContext);
const luigiPage = await luigiContext.newPage();
await luigiPage.goto("/");
const luigiHome = new HomePage(luigiPage);
await luigiHome.signUp("Luigi");
await luigiPage.goto(url);
await luigiHome.expectMusicTrack("Super Mario World");
// Remove track from playlist
await marioHome.navigateToHome();
await marioHome.removeTrackFromPlaylist(
"Super Mario World",
"Save the princess",
);
await sleep(4000); // Wait for the sync to complete
// Expect that the track is removed from the playlist
await marioHome.navigateToPlaylist("Save the princess");
await marioHome.notExpectMusicTrack("Super Mario World");
await luigiHome.notExpectMusicTrack("Super Mario World");
});

View File

@@ -33,6 +33,14 @@ export class HomePage {
).toBeVisible();
}
async notExpectMusicTrack(trackName: string) {
await expect(
this.page.getByRole("button", {
name: `Play ${trackName}`,
}),
).not.toBeVisible();
}
async playMusicTrack(trackName: string) {
await this.page
.getByRole("button", {
@@ -65,6 +73,14 @@ export class HomePage {
.click();
}
async navigateToHome() {
await this.page
.getByRole("link", {
name: "All tracks",
})
.click();
}
async getShareLink() {
await this.page
.getByRole("button", {
@@ -95,6 +111,20 @@ export class HomePage {
.click();
}
async removeTrackFromPlaylist(trackTitle: string, playlistTitle: string) {
await this.page
.getByRole("button", {
name: `Open ${trackTitle} menu`,
})
.click();
await this.page
.getByRole("menuitem", {
name: `Remove from ${playlistTitle}`,
})
.click();
}
async signUp(name: string) {
await this.page.getByRole("button", { name: "Sign up" }).click();
await this.page.getByRole("textbox", { name: "Username" }).fill(name);

View File

@@ -1,5 +1,82 @@
# organization
## 0.0.56
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react@0.11.4
## 0.0.55
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.54
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
## 0.0.53
### Patch Changes
- jazz-react@0.11.1
## 0.0.52
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-react@0.11.0
## 0.0.51
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-react@0.10.15
## 0.0.50
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
## 0.0.49
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-react@0.10.13
## 0.0.48
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
## 0.0.47
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "organization",
"private": true,
"version": "0.0.47",
"version": "0.0.56",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -23,7 +23,7 @@ export function CreateOrganization() {
return;
}
const group = Group.create({ owner: me });
const group = Group.create();
me.root.organizations.push(draft as Organization);

View File

@@ -1,5 +1,4 @@
import { useCoState } from "jazz-react";
import { Account, Group, ID } from "jazz-tools";
import { Group } from "jazz-tools";
import { Organization } from "../schema.ts";
export function OrganizationMembers({
@@ -10,26 +9,13 @@ export function OrganizationMembers({
return (
<>
{group.members.map((member) => (
<Member
key={member.id}
accountId={member.id as ID<Account>}
role={member.role}
/>
<div key={member.id} className="px-4 py-5 sm:px-6">
<strong className="font-medium">
{member.account.profile?.name}
</strong>{" "}
({member.role})
</div>
))}
</>
);
}
function Member({
accountId,
role,
}: { accountId: ID<Account>; role?: string }) {
const account = useCoState(Account, accountId, { profile: {} });
if (!account?.profile) return;
return (
<div className="px-4 py-5 sm:px-6">
<strong className="font-medium">{account.profile.name}</strong> ({role})
</div>
);
}

View File

@@ -1,5 +1,54 @@
# passkey-svelte
## 0.0.50
### Patch Changes
- jazz-svelte@0.11.4
## 0.0.49
### Patch Changes
- jazz-svelte@0.11.3
## 0.0.48
### Patch Changes
- jazz-svelte@0.11.2
## 0.0.47
### Patch Changes
- jazz-svelte@0.11.0
## 0.0.46
### Patch Changes
- jazz-svelte@0.10.15
## 0.0.45
### Patch Changes
- jazz-svelte@0.10.14
## 0.0.44
### Patch Changes
- jazz-svelte@0.10.13
## 0.0.43
### Patch Changes
- Updated dependencies [4612e05]
- jazz-svelte@0.10.12
## 0.0.42
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "passkey-svelte",
"version": "0.0.42",
"version": "0.0.50",
"type": "module",
"private": true,
"scripts": {

View File

@@ -1,5 +1,82 @@
# minimal-auth-passkey
## 0.0.61
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react@0.11.4
## 0.0.60
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.59
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
## 0.0.58
### Patch Changes
- jazz-react@0.11.1
## 0.0.57
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-react@0.11.0
## 0.0.56
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-react@0.10.15
## 0.0.55
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
## 0.0.54
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-react@0.10.13
## 0.0.53
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
## 0.0.52
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passkey",
"private": true,
"version": "0.0.52",
"version": "0.0.61",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,82 @@
# passphrase
## 0.0.58
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react@0.11.4
## 0.0.57
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.56
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
## 0.0.55
### Patch Changes
- jazz-react@0.11.1
## 0.0.54
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-react@0.11.0
## 0.0.53
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-react@0.10.15
## 0.0.52
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
## 0.0.51
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-react@0.10.13
## 0.0.50
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
## 0.0.49
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passphrase",
"private": true,
"version": "0.0.49",
"version": "0.0.58",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -66,3 +66,72 @@ main {
margin: 0 auto;
text-align: center;
}
.auth-container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: #f3f4f6;
}
.auth-card {
background-color: white;
padding: 2rem;
border-radius: 0.5rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px
rgba(0, 0, 0, 0.06);
width: 28rem;
}
.auth-button-primary,
.auth-button-secondary {
width: 100%;
padding: 0.5rem 1rem;
border-radius: 0.25rem;
font-weight: bold;
cursor: pointer;
margin-bottom: 1rem;
}
.auth-button-primary {
background-color: black;
color: white;
border: none;
}
.auth-button-secondary {
background-color: white;
color: black;
border: 1px solid black;
}
.auth-heading {
color: black;
font-size: 1.5rem;
font-weight: bold;
text-align: center;
margin-bottom: 1rem;
}
.auth-textarea {
width: 100%;
padding: 0.5rem;
border: 1px solid #d1d5db;
border-radius: 0.25rem;
margin-bottom: 1rem;
box-sizing: border-box;
}
.auth-description {
font-size: 0.875rem;
color: #4b5563;
text-align: center;
margin-bottom: 1rem;
}
.auth-button-group {
display: flex;
justify-content: space-between;
gap: 1rem;
}

View File

@@ -1,10 +1,142 @@
import { JazzProvider, PassphraseAuthBasicUI } from "jazz-react";
import { StrictMode } from "react";
import { JazzProvider, usePassphraseAuth } from "jazz-react";
import { StrictMode, useState } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { wordlist } from "./wordlist.ts";
function PassphraseAuthBasicUI(props: {
appName: string;
wordlist: string[];
children?: React.ReactNode;
}) {
const auth = usePassphraseAuth({
wordlist: props.wordlist,
});
const [step, setStep] = useState<"initial" | "create" | "login">("initial");
const [loginPassphrase, setLoginPassphrase] = useState("");
const [isCopied, setIsCopied] = useState(false);
const [currentPassphrase, setCurrentPassphrase] = useState(() =>
auth.generateRandomPassphrase(),
);
if (auth.state === "signedIn") {
return props.children ?? null;
}
const handleCreateAccount = async () => {
setStep("create");
};
const handleLogin = () => {
setStep("login");
};
const handleReroll = () => {
const newPassphrase = auth.generateRandomPassphrase();
setCurrentPassphrase(newPassphrase);
setIsCopied(false);
};
const handleBack = () => {
setStep("initial");
setLoginPassphrase("");
};
const handleCopy = async () => {
await navigator.clipboard.writeText(auth.passphrase);
setIsCopied(true);
};
const handleLoginSubmit = async () => {
await auth.logIn(loginPassphrase);
setStep("initial");
setLoginPassphrase("");
};
const handleNext = async () => {
await auth.registerNewAccount(currentPassphrase, "My Account");
setStep("initial");
setLoginPassphrase("");
};
return (
<div className="auth-container">
<div className="auth-card">
{step === "initial" && (
<div>
<h1 className="auth-heading">{props.appName}</h1>
<button
onClick={handleCreateAccount}
className="auth-button-primary"
>
Create new account
</button>
<button onClick={handleLogin} className="auth-button-secondary">
Log in
</button>
</div>
)}
{step === "create" && (
<>
<h1 className="auth-heading">Your Passphrase</h1>
<p className="auth-description">
Please copy and store this passphrase somewhere safe. You'll need
it to log in.
</p>
<textarea
readOnly
value={currentPassphrase}
className="auth-textarea"
rows={5}
/>
<button onClick={handleCopy} className="auth-button-primary">
{isCopied ? "Copied!" : "Copy"}
</button>
<div className="auth-button-group">
<button onClick={handleBack} className="auth-button-secondary">
Back
</button>
<button onClick={handleReroll} className="auth-button-secondary">
Generate New Passphrase
</button>
<button onClick={handleNext} className="auth-button-primary">
Register
</button>
</div>
</>
)}
{step === "login" && (
<div>
<h1 className="auth-heading">Log In</h1>
<textarea
value={loginPassphrase}
onChange={(e) => setLoginPassphrase(e.target.value)}
placeholder="Enter your passphrase"
className="auth-textarea"
rows={5}
/>
<div className="auth-button-group">
<button onClick={handleBack} className="auth-button-secondary">
Back
</button>
<button
onClick={handleLoginSubmit}
className="auth-button-primary"
>
Log In
</button>
</div>
</div>
)}
</div>
</div>
);
}
function JazzAndAuth({ children }: { children: React.ReactNode }) {
return (
<JazzProvider

View File

@@ -1,5 +1,82 @@
# jazz-password-manager
## 0.0.82
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react@0.11.4
## 0.0.81
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.80
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
## 0.0.79
### Patch Changes
- jazz-react@0.11.1
## 0.0.78
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-react@0.11.0
## 0.0.77
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-react@0.10.15
## 0.0.76
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
## 0.0.75
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-react@0.10.13
## 0.0.74
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
## 0.0.73
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-password-manager",
"private": true,
"version": "0.0.73",
"version": "0.0.82",
"type": "module",
"scripts": {
"dev": "vite",
@@ -12,8 +12,8 @@
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
},
"dependencies": {
"jazz-react": "workspace:0.10.9",
"jazz-tools": "workspace:0.10.8",
"jazz-react": "workspace:0.11.4",
"jazz-tools": "workspace:0.11.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.41.5",

View File

@@ -6,7 +6,7 @@ import NewItemModal from "./components/new-item-modal";
import Table from "./components/table";
import { useAccount, useCoState } from "jazz-react";
import { CoMapInit, Group, ID } from "jazz-tools";
import { CoMapInit, ID } from "jazz-tools";
import { useNavigate, useParams } from "react-router-dom";
import { Folder, FolderList, PasswordItem } from "./1_schema";
import {
@@ -136,20 +136,14 @@ const VaultPage: React.FC = () => {
</Button>
<Button
onClick={() => setEditingItem(item)}
disabled={
item._owner.castAs(Group).myRole() !== "admin" &&
item._owner.castAs(Group).myRole() !== "writer"
}
disabled={!me.canWrite(item)}
>
Edit
</Button>
<Button
onClick={() => handleDeleteItem(item)}
variant="danger"
disabled={
item._owner.castAs(Group).myRole() !== "admin" &&
item._owner.castAs(Group).myRole() !== "writer"
}
disabled={!me.canWrite(item)}
>
Delete
</Button>
@@ -210,21 +204,13 @@ const VaultPage: React.FC = () => {
<div className="flex gap-2">
<Button
onClick={() => setIsNewItemModalOpen(true)}
disabled={
!selectedFolder ||
(selectedFolder._owner.castAs(Group).myRole() !== "admin" &&
selectedFolder._owner.castAs(Group).myRole() !== "writer")
}
disabled={!selectedFolder || !me.canWrite(selectedFolder)}
>
New Item
</Button>
<Button
onClick={() => setIsInviteModalOpen(true)}
disabled={
!selectedFolder ||
(selectedFolder._owner.castAs(Group).myRole() !== "admin" &&
selectedFolder._owner.castAs(Group).myRole() !== "writer")
}
disabled={!selectedFolder || !me.canWrite(selectedFolder)}
>
Share Folder
</Button>

View File

@@ -21,11 +21,9 @@ const InviteModal: React.FC<InviteModalProps> = ({
>("reader");
const [inviteLink, setInviteLink] = useState("");
const members = selectedFolder?._owner.castAs(Group).members;
const members = selectedFolder?._owner.members;
const invitedMembers = members
? members
.filter((m) => !m.account?.isMe && m.role !== "revoked")
.map((m) => m.account)
? members.filter((m) => !m.account?.isMe).map((m) => m.account)
: [];
const handleCreateInviteLink = () => {

View File

@@ -1,5 +1,90 @@
# jazz-example-pets
## 0.0.180
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-browser-media-images@0.11.4
- jazz-react@0.11.4
## 0.0.179
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
- jazz-browser-media-images@0.11.3
## 0.0.178
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react@0.11.2
- jazz-browser-media-images@0.11.2
## 0.0.177
### Patch Changes
- jazz-react@0.11.1
## 0.0.176
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-browser-media-images@0.11.0
- jazz-react@0.11.0
## 0.0.175
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-browser-media-images@0.10.15
- jazz-react@0.10.15
## 0.0.174
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react@0.10.14
- jazz-browser-media-images@0.10.14
## 0.0.173
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-browser-media-images@0.10.13
- jazz-react@0.10.13
## 0.0.172
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react@0.10.12
- jazz-browser-media-images@0.10.12
## 0.0.171
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-pets",
"private": true,
"version": "0.0.171",
"version": "0.0.180",
"type": "module",
"scripts": {
"dev": "vite",
@@ -19,9 +19,9 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-browser-media-images": "workspace:0.10.9",
"jazz-react": "workspace:0.10.9",
"jazz-tools": "workspace:0.10.8",
"jazz-browser-media-images": "workspace:0.11.4",
"jazz-react": "workspace:0.11.4",
"jazz-tools": "workspace:0.11.4",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",
@@ -41,7 +41,7 @@
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",
"jazz-run": "workspace:0.10.8",
"jazz-run": "workspace:0.11.4",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",

View File

@@ -34,7 +34,7 @@ export function NewPetPostForm() {
if (newPetPost) {
newPetPost.name = name;
} else {
const petPostGroup = Group.create({ owner: me });
const petPostGroup = Group.create();
const petPost = PartialPetPost.create(
{
name,

View File

@@ -2,7 +2,7 @@ import { useParams } from "react-router";
import { PetPost, PetReactions, ReactionTypes } from "./1_schema";
import { ProgressiveImg } from "jazz-react";
import { ProgressiveImg, useAccount } from "jazz-react";
import { useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import uniqolor from "uniqolor";
@@ -26,6 +26,7 @@ const reactionEmojiMap: {
export function RatePetPostUI() {
const petPostID = useParams<{ petPostId: ID<PetPost> }>().petPostId;
const { me } = useAccount();
const petPost = useCoState(PetPost, petPostID);
return (
@@ -60,7 +61,7 @@ export function RatePetPostUI() {
))}
</div>
{petPost?._owner.myRole() === "admin" && petPost.reactions && (
{petPost && me.canAdmin(petPost) && petPost.reactions && (
<ReactionOverview petReactions={petPost.reactions} />
)}
</div>

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