Compare commits

..

88 Commits

Author SHA1 Message Date
Guido D'Orsi
a7b9ae0b76 Merge pull request #2350 from garden-co/changeset-release/main
Version Packages
2025-05-23 19:24:34 +02:00
github-actions[bot]
196efcf48e Version Packages 2025-05-23 17:23:15 +00:00
Guido D'Orsi
153aa972b3 Merge pull request #2351 from garden-co/fix/chat-rn-expo
fix: fix chat-rn-expo example app
2025-05-23 19:20:25 +02:00
Guido D'Orsi
4508524f77 feat: rename demo to minimal, change React Native template to minimal auth 2025-05-23 19:20:05 +02:00
Guido D'Orsi
e7e9062dff test: disable the chat navigation step on RN expo 2025-05-23 18:44:03 +02:00
Guido D'Orsi
65e8d135c1 fix: React 19 upgrade type fixes 2025-05-23 18:36:54 +02:00
Meg Culotta
0b8e84e22d Merge pull request #2352 from garden-co/feat/2345-add-example-links-to-readmes
Add URL's to live demos in all readme files in examples
2025-05-23 11:15:46 -05:00
Margaret Culotta
7b51e38cf6 Add all other examples 2025-05-23 11:11:57 -05:00
Margaret Culotta
fcc2cbdc93 Add URL's to live demos in all readme files in examples 2025-05-23 11:09:00 -05:00
Guido D'Orsi
5aa13b5afc feat: upgrade to React 19 2025-05-23 17:53:49 +02:00
Guido D'Orsi
dc746a2fc9 chore: changeset 2025-05-23 17:36:38 +02:00
Guido D'Orsi
ca39bae001 fix: fix chat-rn-expo when used as template 2025-05-23 17:35:49 +02:00
Guido D'Orsi
020b12fa32 fix: correct definition of react in peerDependencies 2025-05-23 17:33:26 +02:00
Guido D'Orsi
bfea02c229 Merge pull request #2348 from garden-co/feat/deprecate-with-helpers
fix: deprecate withHelpers
2025-05-23 14:45:01 +02:00
Guido D'Orsi
74e6495beb Merge pull request #2349 from garden-co/feat/default-catch
feat: add shallow support for default/catch
2025-05-23 14:40:01 +02:00
Guido D'Orsi
3fe683206a feat: add shallow support for default/catch 2025-05-23 14:37:15 +02:00
Guido D'Orsi
f869d9a4dd fix: deprecate withHelpers 2025-05-23 14:30:52 +02:00
Guido D'Orsi
0724cfb95e Merge pull request #2344 from garden-co/changeset-release/main
Version Packages
2025-05-23 09:54:27 +02:00
github-actions[bot]
3b7fd14976 Version Packages 2025-05-23 07:54:03 +00:00
Guido D'Orsi
55fbe8a0a8 Merge pull request #2343 from garden-co/feat/back-to-zod
fix: move back to zod and clean up zod re-export
2025-05-23 09:50:45 +02:00
Guido D'Orsi
22c2600ef1 fix: move back to zod and clean up zod re-export 2025-05-23 09:46:36 +02:00
Guido D'Orsi
d41feafebe Merge pull request #2342 from garden-co/changeset-release/main
Version Packages
2025-05-22 23:33:33 +02:00
github-actions[bot]
05e3e30451 Version Packages 2025-05-22 21:29:40 +00:00
Guido D'Orsi
637ae13131 chore: changeset 2025-05-22 23:26:46 +02:00
Guido D'Orsi
4a601a6441 Merge pull request #2340 from garden-co/fix/zod-fork
fix: switch to our zod fork with RN fixes
2025-05-22 23:24:29 +02:00
Guido D'Orsi
15b422f711 fix: switch to our zod fork with RN fixes 2025-05-22 19:48:58 +02:00
Trisha Lim
2e42825971 Merge pull request #2332 from garden-co/fix/passkey-svelte
fix(passkey-svelte): use AccountCoState instead of useAccount
2025-05-22 14:07:22 +01:00
Trisha Lim
089cdb2031 fix(passkey-svelte): use AccountCoState instead of useAccount 2025-05-22 13:55:06 +01:00
Guido D'Orsi
fa3cf6d0c1 Merge pull request #2331 from garden-co/changeset-release/main
Version Packages
2025-05-22 14:26:58 +02:00
github-actions[bot]
d823700a7c Version Packages 2025-05-22 12:23:10 +00:00
Guido D'Orsi
ed472e834a Merge pull request #2329 from garden-co/fix-z-create
fix: reduce the z exported APIs to the ones we support and fix compatible types
2025-05-22 14:18:56 +02:00
Guido D'Orsi
365b0ea3a9 fix: reduce the z exported APIs to the ones we support and fix compatible types 2025-05-22 14:14:39 +02:00
Benjamin S. Leveritt
43c831167f Merge pull request #2328 from garden-co/2327-remove-auto-generated-api-reference-content
Hides the API Ref links
2025-05-22 12:48:00 +01:00
Benjamin S. Leveritt
cac0f1ad2b Hides the API Ref links 2025-05-22 11:10:46 +01:00
Guido D'Orsi
f66b7c1a5a Merge pull request #2326 from garden-co/changeset-release/main
Version Packages
2025-05-22 11:49:26 +02:00
github-actions[bot]
1b57cfc3f6 Version Packages 2025-05-22 09:45:36 +00:00
Guido D'Orsi
a805e27b0a Merge pull request #2322 from garden-co/fix-z-create
fix: fixes create types for CoList, CoRecord, CoFeed and CoFileStream
2025-05-22 11:42:24 +02:00
Guido D'Orsi
9d6d9fe7a5 fix: fixes create types for CoList, CoRecord, CoFeed and CoFileStream 2025-05-22 11:33:03 +02:00
Benjamin S. Leveritt
409758afd0 Adds tests for co.fileStream()'s this 2025-05-22 10:53:46 +02:00
Guido D'Orsi
e0bc532345 Merge pull request #2321 from garden-co/changeset-release/main
Version Packages
2025-05-22 10:14:43 +02:00
github-actions[bot]
87e02c0516 Version Packages 2025-05-22 08:14:27 +00:00
Guido D'Orsi
405f9be7b9 Merge pull request #2320 from garden-co/fix-z-create
fix: fix coMap.create with optional references
2025-05-22 10:10:01 +02:00
Guido D'Orsi
c82bf737bf Merge pull request #2319 from garden-co/fix-z-enum
feat: export the co.loaded alias
2025-05-22 10:08:49 +02:00
Guido D'Orsi
91cbb2f9d4 fix: fix coMap.create with optional types 2025-05-22 09:58:44 +02:00
Guido D'Orsi
cfbba59c6d test: reproduce the create type errors 2025-05-21 20:44:04 +02:00
Guido D'Orsi
b1209e2e09 docs: bring co.loaded in the upgrade guide 2025-05-21 19:38:06 +02:00
Guido D'Orsi
20b3d88135 feat: export the co.loaded alias 2025-05-21 19:25:47 +02:00
Guido D'Orsi
d9ad1f4de5 Merge pull request #2317 from garden-co/changeset-release/main
Version Packages
2025-05-21 18:16:49 +02:00
github-actions[bot]
c90153e0c9 Version Packages 2025-05-21 15:57:01 +00:00
Guido D'Orsi
a4241c0f4b Merge pull request #2315 from garden-co/fix-z-enum
fix: support z.enum
2025-05-21 17:53:00 +02:00
Benjamin S. Leveritt
e1ff7a65a8 Merge pull request #2316 from garden-co/fix-file-share-svelte
fix-file-share-svelte
2025-05-21 16:51:08 +01:00
Guido D'Orsi
011af55446 fix: support z.enum 2025-05-21 17:48:38 +02:00
Benjamin S. Leveritt
e9dbcf53c8 Fix formatting 2025-05-21 16:30:59 +01:00
Benjamin S. Leveritt
3da21b95ec Fix type issues 2025-05-21 16:30:49 +01:00
Benjamin S. Leveritt
a6d0dd07a1 Add type checking to build process
Can’t fathom why it’s not in there by default.
2025-05-21 15:51:25 +01:00
Benjamin S. Leveritt
ac474c4afb Merge pull request #2313 from garden-co/1888-type-check-every-react-example
Final mop-up for React docs type checks
2025-05-21 13:54:36 +01:00
Benjamin S. Leveritt
afe8e1f3b2 Merge pull request #2312 from garden-co/2311-fix-type-check-on-organization-pattern
Fixes org pattern doc
2025-05-21 13:45:40 +01:00
Benjamin S. Leveritt
b12b3808fa Merge pull request #2310 from garden-co/2212-remove-skiperrorchecking-workaround-in-jazz-react-typedoc-options
Remove typedoc check skip
2025-05-21 13:37:14 +01:00
Benjamin S. Leveritt
08ec8fe709 Fixes org pattern doc 2025-05-21 13:27:52 +01:00
Benjamin S. Leveritt
f70cae6bf6 Final mop-up for React docs type checks
Closes #1888
2025-05-21 13:27:12 +01:00
Benjamin S. Leveritt
59fe373863 Remove typedoc check skip 2025-05-21 13:23:35 +01:00
Guido D'Orsi
be58b4c1d8 Merge pull request #2308 from garden-co/changeset-release/main
Version Packages
2025-05-21 13:47:28 +02:00
github-actions[bot]
96c520ae4d Version Packages 2025-05-21 11:46:24 +00:00
Benjamin S. Leveritt
a9553b4945 Merge pull request #2307 from garden-co/2220-type-check-ImageDefinition
2220-type-check-ImageDefinition
2025-05-21 12:43:43 +01:00
Guido D'Orsi
fa516522e3 Merge pull request #2301 from garden-co/fix/svelte-zod
feat: make jazz-svelte compatible with the 0.14 changes
2025-05-21 13:16:18 +02:00
Benjamin S. Leveritt
59e4b5da54 Add typechecked vanillaJS docs 2025-05-21 11:51:24 +01:00
Benjamin S. Leveritt
2fa3f94b4a Add typechecked React docs 2025-05-21 11:51:07 +01:00
Guido D'Orsi
a2f8461e26 docs: add vanilla and expo 2025-05-21 12:47:50 +02:00
Guido D'Orsi
cabaf079be docs(0-14): svelte upgrade guide, fill todo sections 2025-05-21 12:40:08 +02:00
Trisha Lim
d8de4a7ada Merge pull request #2294 from garden-co/docs/groups-type-check
docs: type check Groups
2025-05-21 10:37:53 +01:00
Benjamin S. Leveritt
e510a544b7 Merge pull request #2300 from garden-co/2220-type-check-filestreams
Fix typechecking for FileStreams
2025-05-21 10:35:38 +01:00
Guido D'Orsi
b2ee30630d feat: make jazz-svelte compatible with the 0.14 changes 2025-05-21 11:11:35 +02:00
Benjamin S. Leveritt
ab0d4f364a Fix typechecking for FileStreams 2025-05-21 09:45:42 +01:00
Trisha Lim
6d9c6ae698 docs: add twoslash type checks to Group Inheritance 2025-05-20 16:01:41 +01:00
Trisha Lim
914af3deae docs: add twoslash type checks to Public Sharing 2025-05-20 15:52:56 +01:00
Trisha Lim
4ad8e9ae78 docs: add twoslash type checks to Groups 2025-05-20 15:29:08 +01:00
Trisha Lim
1e0b496555 docs: add twoslash type check to CoLists, CoFeeds (#2281)
* docs: add twoslash type check to CoLists

* revert to not using a list type

* twoslash type check for CoFeed
2025-05-20 15:04:24 +01:00
Guido D'Orsi
0088aa8b25 Merge pull request #2292 from garden-co/changeset-release/main
Version Packages
2025-05-20 15:48:40 +02:00
github-actions[bot]
35a66df1e4 Version Packages 2025-05-20 12:52:45 +00:00
Guido D'Orsi
3b2fa64a82 Merge pull request #2291 from garden-co/fix/test
fix: restore custom AccountSchema support in testing utils
2025-05-20 14:46:22 +02:00
Guido D'Orsi
3d1027f278 chore: changeset 2025-05-20 14:46:04 +02:00
Guido D'Orsi
cc78386163 Merge pull request #2290 from garden-co/feat/extand-parent
feat: make possible to extend a group without having access to it
2025-05-20 14:17:56 +02:00
Guido D'Orsi
c240eed6a4 fix: Fix custom AccountSchema support in testing utils 2025-05-20 13:19:59 +02:00
Guido D'Orsi
2a9b7f5d52 test: more tests on group extend 2025-05-20 12:44:31 +02:00
Guido D'Orsi
f2fbd29de5 feat: make possible to extend a group without having access to it 2025-05-20 11:54:11 +02:00
Benjamin S. Leveritt
c960176a2a Merge pull request #2285 from garden-co/update-subscriptions-and-loading-for-zod
Update subscriptions and loading docs for 0.14
2025-05-20 06:43:46 +01:00
Benjamin S. Leveritt
fd4bae4cc1 Replace Resolved with Loaded 2025-05-19 22:16:41 +01:00
Benjamin S. Leveritt
ae32b7c19b Updates code expamples 2025-05-19 22:07:55 +01:00
251 changed files with 10126 additions and 5386 deletions

View File

@@ -1,5 +1,106 @@
# betterauth
## 0.1.14
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react-auth-betterauth@0.14.10
- jazz-inspector@0.14.10
- jazz-react@0.14.10
- jazz-tools@0.14.10
- jazz-betterauth-server-plugin@0.14.10
- jazz-betterauth-client-plugin@0.14.10
## 0.1.13
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-betterauth-server-plugin@0.14.9
- jazz-inspector@0.14.9
- jazz-react@0.14.9
- jazz-react-auth-betterauth@0.14.9
- jazz-betterauth-client-plugin@0.14.9
## 0.1.12
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-betterauth-server-plugin@0.14.8
- jazz-inspector@0.14.8
- jazz-react@0.14.8
- jazz-react-auth-betterauth@0.14.8
- jazz-betterauth-client-plugin@0.14.8
## 0.1.11
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-betterauth-server-plugin@0.14.7
- jazz-inspector@0.14.7
- jazz-react@0.14.7
- jazz-react-auth-betterauth@0.14.7
- jazz-betterauth-client-plugin@0.14.7
## 0.1.10
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-betterauth-server-plugin@0.14.6
- jazz-inspector@0.14.6
- jazz-react@0.14.6
- jazz-react-auth-betterauth@0.14.6
- jazz-betterauth-client-plugin@0.14.6
## 0.1.9
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-betterauth-server-plugin@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
- jazz-react-auth-betterauth@0.14.5
- jazz-betterauth-client-plugin@0.14.5
## 0.1.8
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-betterauth-server-plugin@0.14.4
- jazz-inspector@0.14.4
- jazz-react@0.14.4
- jazz-react-auth-betterauth@0.14.4
- jazz-betterauth-client-plugin@0.14.4
## 0.1.7
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-betterauth-server-plugin@0.14.2
- jazz-inspector@0.14.2
- jazz-react@0.14.2
- jazz-react-auth-betterauth@0.14.2
- jazz-betterauth-client-plugin@0.14.2
## 0.1.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "betterauth",
"version": "0.1.6",
"version": "0.1.14",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,82 @@
# chat-rn-expo-clerk
## 1.0.133
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react-native-media-images@0.14.10
- jazz-tools@0.14.10
- jazz-expo@0.14.10
## 1.0.132
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-expo@0.14.9
- jazz-react-native-media-images@0.14.9
## 1.0.131
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-expo@0.14.8
- jazz-react-native-media-images@0.14.8
## 1.0.130
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-expo@0.14.7
- jazz-react-native-media-images@0.14.7
## 1.0.129
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-expo@0.14.6
- jazz-react-native-media-images@0.14.6
## 1.0.128
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-expo@0.14.5
- jazz-react-native-media-images@0.14.5
## 1.0.127
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-expo@0.14.4
- jazz-react-native-media-images@0.14.4
## 1.0.126
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-expo@0.14.2
- jazz-react-native-media-images@0.14.2
## 1.0.125
### Patch Changes

View File

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

View File

@@ -7,8 +7,10 @@ node_modules/
.expo/
dist/
web-build/
expo-env.d.ts
# Native
.kotlin/
*.orig.*
*.jks
*.p8
@@ -33,6 +35,5 @@ yarn-error.*
# typescript
*.tsbuildinfo
ios
android
android/
ios/

View File

@@ -1,934 +1,11 @@
# chat-rn-expo
## 1.0.112
### Patch Changes
- Updated dependencies [cdfc105]
- jazz-tools@0.14.1
- jazz-expo@0.14.1
## 1.0.111
### Patch Changes
- Updated dependencies [5835ed1]
- jazz-tools@0.14.0
- jazz-expo@0.14.0
## 1.0.110
### Patch Changes
- jazz-expo@0.13.32
## 1.0.109
### Patch Changes
- Updated dependencies [e5b170f]
- jazz-tools@0.13.31
- jazz-expo@0.13.31
## 1.0.108
### Patch Changes
- jazz-expo@0.13.30
- jazz-tools@0.13.30
## 1.0.107
### Patch Changes
- jazz-expo@0.13.29
- jazz-tools@0.13.29
## 1.0.106
### Patch Changes
- jazz-expo@0.13.28
- jazz-tools@0.13.28
## 1.0.105
### Patch Changes
- jazz-expo@0.13.27
- jazz-tools@0.13.27
## 1.0.104
### Patch Changes
- Updated dependencies [ff846d9]
- jazz-tools@0.13.26
- jazz-expo@0.13.26
## 1.0.103
### Patch Changes
- jazz-expo@0.13.25
- jazz-tools@0.13.25
## 1.0.102
### Patch Changes
- Updated dependencies [02a240c]
- jazz-tools@0.13.23
- jazz-expo@0.13.23
## 1.0.101
### Patch Changes
- jazz-expo@0.13.22
## 1.0.100
### Patch Changes
- jazz-expo@0.13.21
- jazz-tools@0.13.21
## 1.0.99
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-expo@0.13.20
## 1.0.98
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-expo@0.13.19
## 1.0.97
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-expo@0.13.18
## 1.0.96
### Patch Changes
- jazz-expo@0.13.17
- jazz-tools@0.13.17
## 1.0.95
### Patch Changes
- jazz-expo@0.13.16
- jazz-tools@0.13.16
## 1.0.94
### Patch Changes
- jazz-expo@0.13.15
- jazz-tools@0.13.15
## 1.0.93
### Patch Changes
- Updated dependencies [bd94012]
- jazz-expo@0.13.14
- jazz-tools@0.13.14
## 1.0.92
### Patch Changes
- jazz-expo@0.13.13
- jazz-tools@0.13.13
## 1.0.91
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-expo@0.13.12
## 1.0.90
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-expo@0.13.11
## 1.0.89
### Patch Changes
- jazz-expo@0.13.10
- jazz-tools@0.13.10
## 1.0.88
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-expo@0.13.9
## 1.0.87
### Patch Changes
- jazz-expo@0.13.8
## 1.0.86
### Patch Changes
- Updated dependencies [bc3d7bb]
- jazz-tools@0.13.7
- jazz-expo@0.13.7
## 1.0.85
### Patch Changes
- Updated dependencies [fe6f561]
- jazz-tools@0.13.5
- jazz-expo@0.13.5
## 1.0.84
### Patch Changes
- Updated dependencies [3129982]
- Updated dependencies [3129982]
- jazz-expo@0.13.4
- jazz-tools@0.13.4
## 1.0.83
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- jazz-expo@0.13.3
## 1.0.82
### Patch Changes
- jazz-expo@0.13.2
- jazz-tools@0.13.2
## 1.0.81
### Patch Changes
- Updated dependencies [63a7aa0]
- jazz-expo@0.13.1
## 1.0.80
### Patch Changes
- Updated dependencies [bce3bcc]
- Updated dependencies [afd1374]
- jazz-expo@0.13.0
- jazz-tools@0.13.0
## 1.0.88
### Patch Changes
- jazz-react-native@0.12.2
- jazz-tools@0.12.2
## 1.0.87
### Patch Changes
- jazz-react-native@0.12.1
- jazz-tools@0.12.1
## 1.0.86
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- jazz-tools@0.12.0
- jazz-react-native@0.12.0
## 1.0.85
### Patch Changes
- jazz-react-native@0.11.8
- jazz-tools@0.11.8
## 1.0.84
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react-native@0.11.7
## 1.0.83
### Patch Changes
- Updated dependencies [e7c85b7]
- jazz-react-native@0.11.6
- jazz-tools@0.11.6
## 1.0.82
### Patch Changes
- jazz-react-native@0.11.5
- jazz-tools@0.11.5
## 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
- Updated dependencies [3405d8f]
- jazz-react-native@0.10.10
## 1.0.70
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react-native@0.10.8
## 1.0.69
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react-native@0.10.7
- jazz-tools@0.10.7
## 1.0.68
### Patch Changes
- Updated dependencies [ada802b]
- jazz-tools@0.10.6
- jazz-react-native@0.10.6
## 1.0.67
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react-native@0.10.5
## 1.0.66
### Patch Changes
- jazz-react-native@0.10.4
- jazz-tools@0.10.4
## 1.0.65
### Patch Changes
- Updated dependencies [d8582fc]
- jazz-tools@0.10.3
- jazz-react-native@0.10.3
## 1.0.64
### Patch Changes
- jazz-react-native@0.10.2
- jazz-tools@0.10.2
## 1.0.63
### Patch Changes
- Updated dependencies [5a63cba]
- jazz-tools@0.10.1
- jazz-react-native@0.10.1
## 1.0.62
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-react-native@0.10.0
- jazz-tools@0.10.0
## 1.0.61
### Patch Changes
- jazz-react-native@0.9.23
- jazz-tools@0.9.23
## 1.0.60
### Patch Changes
- jazz-react-native@0.9.22
## 1.0.59
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-react-native@0.9.21
## 1.0.58
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-react-native@0.9.20
## 1.0.57
### Patch Changes
- jazz-react-native@0.9.19
- jazz-tools@0.9.19
## 1.0.56
### Patch Changes
- jazz-react-native@0.9.18
- jazz-tools@0.9.18
## 1.0.55
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-react-native@0.9.17
## 1.0.54
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-react-native@0.9.16
## 1.0.53
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-react-native@0.9.15
## 1.0.52
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-react-native@0.9.14
## 1.0.51
### Patch Changes
- jazz-react-native@0.9.13
- jazz-tools@0.9.13
## 1.0.50
### Patch Changes
- jazz-react-native@0.9.12
- jazz-tools@0.9.12
## 1.0.49
### Patch Changes
- jazz-react-native@0.9.11
- jazz-tools@0.9.11
## 1.0.48
### Patch Changes
- Updated dependencies [f76274c]
- Updated dependencies [5e83864]
- jazz-react-native@0.9.10
- jazz-tools@0.9.10
## 1.0.47
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-react-native@0.9.9
## 1.0.46
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react-native@0.9.8
## 1.0.45
### Patch Changes
- Updated dependencies [8a390d2]
- jazz-react-native@0.9.6
## 1.0.44
### Patch Changes
- Updated dependencies [c871912]
- jazz-react-native@0.9.5
## 1.0.43
### Patch Changes
- jazz-react-native@0.9.4
## 1.0.42
### Patch Changes
- Updated dependencies [7cd691f]
- jazz-react-native@0.9.3
## 1.0.41
### Patch Changes
- Updated dependencies [80fd3e9]
- jazz-react-native@0.9.2
## 1.0.40
### Patch Changes
- Updated dependencies [1b71969]
- jazz-tools@0.9.1
- jazz-react-native@0.9.1
## 1.0.39
### Patch Changes
- Updated dependencies [1da4d55]
- Updated dependencies [8eda792]
- Updated dependencies [1e5e3a1]
- jazz-react-native@0.9.0
- jazz-tools@0.9.0
## 1.0.38
### Patch Changes
- Updated dependencies [dc62b95]
- Updated dependencies [1de26f8]
- jazz-tools@0.8.51
- jazz-react-native@0.8.51
## 1.0.37
### Patch Changes
- jazz-react-native@0.8.50
- jazz-tools@0.8.50
## 1.0.36
### Patch Changes
- jazz-react-native@0.8.49
- jazz-tools@0.8.49
## 1.0.35
### Patch Changes
- Updated dependencies [635e824]
- Updated dependencies [0a85982]
- jazz-tools@0.8.48
- jazz-react-native@0.8.48
## 1.0.34
### Patch Changes
- Updated dependencies [33ef9c4]
- jazz-react-native@0.8.47
## 1.0.33
### Patch Changes
- Updated dependencies [ab4ffbd]
- jazz-react-native@0.8.46
## 1.0.32
### Patch Changes
- Updated dependencies [7701307]
- Updated dependencies [fa41f8e]
- Updated dependencies [88d7d9a]
- Updated dependencies [60e35ea]
- jazz-react-native@0.8.45
- jazz-tools@0.8.45
## 1.0.31
### Patch Changes
- jazz-react-native@0.8.44
- jazz-tools@0.8.44
## 1.0.30
### Patch Changes
- jazz-react-native@0.8.41
- jazz-tools@0.8.41
## 1.0.29
### Patch Changes
- Updated dependencies [0c6b0f3]
- Updated dependencies [249eecb]
- jazz-react-native@0.8.39
- jazz-tools@0.8.39
## 1.0.28
### Patch Changes
- jazz-react-native@0.8.38
- jazz-tools@0.8.38
## 1.0.27
### Patch Changes
- jazz-react-native@0.8.37
- jazz-tools@0.8.37
## 1.0.26
### Patch Changes
- Updated dependencies [c84764a]
- Updated dependencies [441fe27]
- jazz-react-native@0.8.36
- jazz-tools@0.8.36
## 1.0.25
### Patch Changes
- Updated dependencies [8b87117]
- jazz-tools@0.8.35
- jazz-react-native@0.8.35
## 1.0.24
### Patch Changes
- jazz-react-native@0.8.34
- jazz-tools@0.8.34
## 1.0.23
### Patch Changes
- Updated dependencies [df42b2b]
- jazz-tools@0.8.32
- jazz-react-native@0.8.32
## 1.0.22
### Patch Changes
- jazz-react-native@0.8.31
- jazz-tools@0.8.31
## 1.0.21
### Patch Changes
- jazz-react-native@0.8.30
- jazz-tools@0.8.30
## 1.0.20
### Patch Changes
- jazz-react-native@0.8.29
- jazz-tools@0.8.29
## 1.0.19
### Patch Changes
- jazz-react-native@0.8.28
- jazz-tools@0.8.28
## 1.0.18
### Patch Changes
- jazz-react-native@0.8.27
- jazz-tools@0.8.27
## 1.0.17
### Patch Changes
- Updated dependencies [d348c2d]
- Updated dependencies [6902b5b]
- Updated dependencies [1a0cd3d]
- jazz-tools@0.8.23
- jazz-react-native@0.8.23
## 1.0.16
### Patch Changes
- Updated dependencies [149ca97]
- jazz-tools@0.8.21
- jazz-react-native@0.8.21
## 1.0.15
### Patch Changes
- Updated dependencies [3ef3ff3]
- jazz-react-native@0.8.20
## 1.0.14
### Patch Changes
- jazz-react-native@0.8.19
- jazz-tools@0.8.19
## 1.0.13
### Patch Changes
- jazz-react-native@0.8.18
- jazz-tools@0.8.18
## 1.0.12
### Patch Changes
- jazz-react-native@0.8.17
- jazz-tools@0.8.17
## 1.0.11
### Patch Changes
- jazz-react-native@0.8.16
- jazz-tools@0.8.16
## 1.0.10
### Patch Changes
- Updated dependencies [cce679b]
- jazz-tools@0.8.15
- jazz-react-native@0.8.15
## 1.0.9
### Patch Changes
- Updated dependencies [36273b3]
- jazz-tools@0.8.14
- jazz-react-native@0.8.14
## 1.0.8
### Patch Changes
- Updated dependencies [fd011d7]
- jazz-tools@0.8.13
- jazz-react-native@0.8.13
## 1.0.7
### Patch Changes
- jazz-react-native@0.8.12
- jazz-tools@0.8.12
## 1.0.6
### Patch Changes
- jazz-react-native@0.8.11
- jazz-tools@0.8.11
## 1.0.5
### Patch Changes
- b7639cf: feat(react-native): replaced react-native-mmkv with expo-secure-store and initialize it by default as kvStore in createJazzRNApp() (BREAKING)
- Updated dependencies [b7639cf]
- jazz-react-native@0.8.8
## 1.0.4
### Patch Changes
- Updated dependencies [32b05b6]
- jazz-react-native@0.8.7
## 1.0.3
### Patch Changes
- jazz-react-native@0.8.6
## 1.0.2
### Patch Changes
- Updated dependencies [c3f4e6b]
- Updated dependencies [d9152ed]
- jazz-react-native@0.8.5
- jazz-tools@0.8.5
## 1.0.1
### Patch Changes
- Updated dependencies
- jazz-react-native@0.8.3
- jazz-tools@0.8.3
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-tools@0.14.10
- jazz-expo@0.14.10

View File

@@ -1,24 +0,0 @@
# 🎷 Jazz + Expo + `react-navigation` + Demo Auth
## 🚀 How to Run
### 1. Inside the Workspace Root
First, install dependencies and build the project:
```bash
pnpm i
pnpm run build
```
### 2. Inside the `examples/chat-rn-expo` Directory
Next, navigate to the specific example project and run the following commands:
```bash
pnpm expo prebuild
pnpx pod-install
pnpm expo run:ios
```
This will set up and launch the app on iOS. For Android, you can replace the last command with `pnpm expo run:android`.

View File

@@ -1,55 +0,0 @@
const { withBuildProperties } = require("expo-build-properties");
const { withDangerousMod } = require("@expo/config-plugins");
const fs = require("fs/promises");
const path = require("path");
/**
* https://github.com/mrousavy/nitro/issues/422#issuecomment-2545988256
*/
function withCustomIosMod(config) {
// Use expo-build-properties to bump iOS deployment target
config = withBuildProperties(config, { ios: { deploymentTarget: "16.0" } });
// Patch the generated Podfile fallback to ensure platform is always 16.0
config = withDangerousMod(config, [
"ios",
async (modConfig) => {
const podfilePath = path.join(
modConfig.modRequest.platformProjectRoot,
"Podfile",
);
let contents = await fs.readFile(podfilePath, "utf-8");
// Check if the IPHONEOS_DEPLOYMENT_TARGET setting is already present
// We search for the key being assigned, e.g., config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] =
const deploymentTargetSettingExists =
/\.build_settings\s*\[\s*['"]IPHONEOS_DEPLOYMENT_TARGET['"]\s*\]\s*=/.test(
contents,
);
if (!deploymentTargetSettingExists) {
// IPHONEOS_DEPLOYMENT_TARGET setting not found, proceed to add it.
contents = contents.replace(
/(post_install\s+do\s+\|installer\|[\s\S]*?)(\r?\n\s end\s*)$/m,
`$1
# Expo Build Properties: force deployment target
# https://github.com/mrousavy/nitro/issues/422#issuecomment-2545988256
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
end
end
$2`,
);
}
await fs.writeFile(podfilePath, contents);
return modConfig;
},
]);
return config;
}
module.exports = ({ config }) => {
return withCustomIosMod(config);
};

View File

@@ -1,39 +1,31 @@
{
"expo": {
"name": "jazz-chat-rn-expo",
"scheme": "jazz-chat-rn-expo",
"slug": "jazz-chat-rn-expo",
"name": "chat-rn-expo",
"slug": "chat-rn-expo",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"splash": {
"image": "./assets/splash.png",
"image": "./assets/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.jazz.chatrn"
"bundleIdentifier": "com.anonymous.chatrnexpo"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.jazz.chatrn"
"edgeToEdgeEnabled": true,
"package": "com.anonymous.chatrnexpo"
},
"plugins": [
"expo-secure-store",
"expo-sqlite",
"expo-build-properties",
"expo-web-browser"
],
"extra": {
"eas": {
"projectId": "e0e61872-1906-4c84-b9d8-9be77355cad0"
}
},
"owner": "paxx"
"web": {
"favicon": "./assets/favicon.png"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -1,9 +0,0 @@
module.exports = function (api) {
api.cache(true);
return {
presets: [
["babel-preset-expo", { jsxImportSource: "nativewind" }],
"nativewind/babel",
],
};
};

View File

@@ -1,27 +0,0 @@
{
"cli": {
"version": ">= 12.5.1",
"appVersionSource": "remote"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"ios-simulator": {
"extends": "development",
"ios": {
"simulator": true
}
},
"preview": {
"distribution": "internal"
},
"production": {
"autoIncrement": true
}
},
"submit": {
"production": {}
}
}

View File

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

View File

@@ -1,4 +0,0 @@
import "./polyfills";
import { registerRootComponent } from "expo";
import App from "./src/App";
registerRootComponent(App);

View File

@@ -0,0 +1,9 @@
import { registerRootComponent } from "expo";
import "./polyfills";
import App from "./src/App";
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App);

View File

@@ -1,35 +0,0 @@
// Learn more https://docs.expo.dev/guides/monorepos
const { getDefaultConfig } = require("expo/metro-config");
const { withNativeWind } = require("nativewind/metro");
const { FileStore } = require("metro-cache");
const path = require("path");
// eslint-disable-next-line no-undef
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, "../..");
const config = getDefaultConfig(projectRoot, { isCSSEnabled: true });
// Since we are using pnpm, we have to setup the monorepo manually for Metro
// #1 - Watch all files in the monorepo
config.watchFolders = [workspaceRoot];
// #2 - Try resolving with project modules first, then workspace modules
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(workspaceRoot, "node_modules"),
];
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
config.resolver.requireCycleIgnorePatterns = [
/(^|\/|\\)node_modules($|\/|\\)/,
/(^|\/|\\)packages($|\/|\\)/,
];
// Use turborepo to restore the cache when possible
config.cacheStores = [
new FileStore({
root: path.join(projectRoot, "node_modules", ".cache", "metro"),
}),
];
// module.exports = config;
module.exports = withNativeWind(config, { input: "./global.css" });

View File

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

View File

@@ -1,53 +1,33 @@
{
"name": "chat-rn-expo",
"version": "1.0.112",
"main": "index.js",
"version": "1.0.1",
"main": "index.ts",
"scripts": {
"build": "tsc --noEmit && expo export -p ios",
"build": "expo prebuild",
"start": "expo start",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write",
"android": "expo run:android",
"ios": "expo prebuild && pnpx pod-install && expo run:ios",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
"@bacons/text-decoder": "0.0.0",
"@craftzdog/react-native-buffer": "6.0.5",
"@bacons/text-decoder": "^0.0.0",
"@craftzdog/react-native-buffer": "^6.0.5",
"@react-native-community/netinfo": "11.4.1",
"@react-navigation/native": "7.0.19",
"@react-navigation/native-stack": "7.2.1",
"clsx": "^2.0.0",
"expo": "53.0.8",
"expo-build-properties": "~0.14.6",
"expo-clipboard": "~7.1.4",
"expo-constants": "~17.1.6",
"expo-dev-client": "~5.1.8",
"expo-linking": "~7.1.4",
"expo-secure-store": "~14.2.3",
"expo-sqlite": "15.2.9",
"expo": "~53.0.9",
"expo-clipboard": "^7.1.4",
"expo-status-bar": "~2.2.3",
"expo-web-browser": "~14.1.6",
"jazz-expo": "workspace:*",
"jazz-tools": "workspace:*",
"nativewind": "^4.1.21",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-native": "0.79.2",
"react-native-get-random-values": "^1.11.0",
"react-native-safe-area-context": "5.4.0",
"react-native-screens": "4.10.0",
"react-native-nitro-modules": "0.25.2",
"react-native-quick-crypto": "1.0.0-beta.15",
"react-native-url-polyfill": "^2.0.0",
"readable-stream": "4.7.0"
"readable-stream": "^4.7.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/react": "~19.0.14",
"tailwindcss": "^3.4.17",
"typescript": "5.8.3"
"@types/react": "~19.0.10",
"typescript": "~5.8.3"
},
"private": true
}

View File

@@ -1,74 +1,18 @@
import "../global.css";
import {
NavigationContainer,
useNavigationContainerRef,
} from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import * as Linking from "expo-linking";
import { RNQuickCrypto } from "jazz-expo/crypto";
import React, { StrictMode, useEffect, useState } from "react";
import HandleInviteScreen from "./invite";
import { JazzProvider } from "jazz-expo";
import React, { StrictMode } from "react";
import { apiKey } from "./apiKey";
import ChatScreen from "./chat";
const Stack = createNativeStackNavigator();
const prefix = Linking.createURL("/");
const linking = {
prefixes: [prefix],
config: {
screens: {
HandleInviteScreen: {
path: "router/invite/:valueHint?/:valueID/:inviteSecret",
},
},
},
};
function App() {
const [initialRoute, setInitialRoute] = useState<
"ChatScreen" | "HandleInviteScreen"
>("ChatScreen");
const navigationRef = useNavigationContainerRef();
useEffect(() => {
Linking.getInitialURL().then((url) => {
if (url) {
if (url && url.includes("invite")) {
setInitialRoute("HandleInviteScreen");
}
}
});
}, []);
export default function App() {
return (
<StrictMode>
<JazzProvider
CryptoProvider={RNQuickCrypto}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
>
<NavigationContainer linking={linking} ref={navigationRef}>
<Stack.Navigator initialRouteName={initialRoute}>
<Stack.Screen
options={{ title: "Jazz Chat" }}
name="ChatScreen"
// @ts-ignore
component={ChatScreen}
/>
<Stack.Screen
name="HandleInviteScreen"
component={HandleInviteScreen}
/>
</Stack.Navigator>
</NavigationContainer>
<ChatScreen />
</JazzProvider>
</StrictMode>
);
}
export default App;

View File

@@ -1,7 +1,6 @@
import clsx from "clsx";
import * as Clipboard from "expo-clipboard";
import { Group, ID, Loaded, Profile } from "jazz-tools";
import { useEffect, useState } from "react";
import { Account, Group } from "jazz-tools";
import { useState } from "react";
import React, {
Button,
FlatList,
@@ -12,54 +11,38 @@ import React, {
TouchableOpacity,
View,
Alert,
StyleSheet,
} from "react-native";
import { useAccount, useCoState } from "jazz-expo";
import { Chat, Message } from "./schema";
export default function ChatScreen({ navigation }: { navigation: any }) {
const { me, logOut } = useAccount();
export default function ChatScreen() {
const { me, logOut } = useAccount(Account, { resolve: { profile: true } });
const [chatId, setChatId] = useState<string>();
const [chatIdInput, setChatIdInput] = useState<string>();
const loadedChat = useCoState(Chat, chatId, { resolve: { $each: true } });
const [message, setMessage] = useState("");
const profile = useCoState(Profile, me._refs.profile?.id, {});
function handleLogOut() {
setChatId(undefined);
logOut();
}
useEffect(() => {
navigation.setOptions({
headerRight: () => <Button onPress={handleLogOut} title="Logout" />,
headerLeft: () =>
loadedChat ? (
<Button
onPress={() => {
if (loadedChat?.id) {
Clipboard.setStringAsync(
`https://chat.jazz.tools/#/chat/${loadedChat.id}`,
);
Alert.alert("Copied to clipboard", `Chat ID: ${loadedChat.id}`);
}
}}
title="Share"
/>
) : null,
});
}, [navigation, loadedChat]);
const createChat = () => {
const group = Group.create({ owner: me });
const group = Group.create();
group.addMember("everyone", "writer");
const chat = Chat.create([], { owner: group });
const chat = Chat.create([], group);
setChatId(chat.id);
};
const joinChat = () => {
if (chatIdInput) {
setChatId(chatIdInput);
if (chatIdInput.startsWith("https://chat.jazz.tools/#/chat/")) {
setChatId(chatIdInput.split("/").pop());
} else {
setChatId(chatIdInput);
}
} else {
Alert.alert("Error", "Chat ID cannot be empty.");
}
@@ -75,41 +58,28 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
}
};
const renderMessageItem = ({ item }: { item: Loaded<typeof Message> }) => {
const renderMessageItem = ({ item }: { item: Message }) => {
const isMe = item._edits?.text?.by?.isMe;
return (
<View
className={clsx(
`rounded-lg p-1 px-1.5 max-w-[80%] `,
isMe ? `bg-gray-200 self-end text-right` : `bg-gray-300 self-start `,
)}
style={[
styles.messageContainer,
isMe ? styles.myMessage : styles.otherMessage,
]}
>
{!isMe ? (
<Text
className={clsx(
`text-xs text-gray-500`,
isMe ? "text-right" : "text-left",
)}
style={[
styles.messageSender,
{ textAlign: isMe ? "right" : "left" },
]}
>
{item?._edits?.text?.by?.profile?.name}
</Text>
) : null}
<View
className={clsx(
"flex relative items-end justify-between",
isMe ? "flex-row" : "flex-row",
)}
>
<Text className={clsx(`text-black text-md max-w-[85%]`)}>
{item.text}
</Text>
<Text
className={clsx(
"text-[10px] text-gray-500 text-right ml-2",
!isMe ? "mt-2" : "mt-1",
)}
>
<View style={styles.messageContent}>
<Text style={styles.messageText}>{item.text}</Text>
<Text style={[styles.messageTime, { marginTop: !isMe ? 8 : 4 }]}>
{item?._edits?.text?.madeAt?.getHours().toString().padStart(2, "0")}
:
{item?._edits?.text?.madeAt
@@ -123,31 +93,28 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
};
return (
<View className="flex flex-col h-full">
<View style={styles.container}>
{!loadedChat ? (
<View className="flex flex-col h-full items-center justify-center">
<Text className="text-m font-bold mb-6">Username</Text>
<View style={styles.welcomeContainer}>
<Text style={styles.usernameTitle}>Username</Text>
<TextInput
className="rounded h-12 p-2 mb-12 w-40 border border-gray-200 block"
value={profile?.name ?? ""}
style={styles.usernameInput}
value={me?.profile.name ?? ""}
onChangeText={(value) => {
if (profile) {
profile.name = value;
if (me?.profile) {
me.profile.name = value;
}
}}
textAlignVertical="center"
onSubmitEditing={sendMessage}
testID="username-input"
/>
<TouchableOpacity
onPress={createChat}
className="bg-blue-500 p-4 rounded-md"
>
<Text className="text-white font-semibold">Start new chat</Text>
<TouchableOpacity onPress={createChat} style={styles.newChatButton}>
<Text style={styles.newChatButtonText}>Start new chat</Text>
</TouchableOpacity>
<Text className="text-m font-bold mt-6">Join existing chat</Text>
<Text style={styles.joinChatTitle}>Join existing chat</Text>
<TextInput
className="rounded h-12 p-2 m-2 mt-4 w-80 border border-gray-200 block"
style={styles.chatIdInput}
placeholder="Chat ID"
value={chatIdInput ?? ""}
onChangeText={(value) => {
@@ -161,22 +128,38 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
}}
testID="chat-id-input"
/>
<TouchableOpacity
onPress={joinChat}
className="bg-green-500 p-4 rounded-md"
>
<Text className="text-white font-semibold">Join chat</Text>
<TouchableOpacity onPress={joinChat} style={styles.joinChatButton}>
<Text style={styles.newChatButtonText}>Join chat</Text>
</TouchableOpacity>
</View>
) : (
<>
<View style={styles.chatHeader}>
<Button
onPress={() => {
if (loadedChat?.id) {
Clipboard.setStringAsync(
`https://chat.jazz.tools/#/chat/${loadedChat.id}`,
);
Alert.alert(
"Copied to clipboard",
`Chat ID: ${loadedChat.id}`,
);
}
}}
title="Share"
/>
<Text style={{ fontWeight: "bold", fontSize: 18 }}>Jazz chat</Text>
<Button onPress={handleLogOut} title="Logout" />
</View>
<FlatList
contentContainerStyle={{
flexGrow: 1,
gap: 6,
padding: 8,
justifyContent: "flex-end",
}}
className="flex"
style={styles.messageList}
data={loadedChat}
keyExtractor={(item) => item.id}
renderItem={renderMessageItem}
@@ -185,11 +168,11 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
<KeyboardAvoidingView
keyboardVerticalOffset={110}
behavior="padding"
className="p-3 bg-white border-t border-gray-300"
style={styles.inputContainer}
>
<SafeAreaView className="flex flex-row items-center gap-2">
<SafeAreaView style={styles.inputRow}>
<TextInput
className="rounded-full h-8 py-0 px-2 border border-gray-200 block flex-1"
style={styles.messageInput}
value={message}
onChangeText={setMessage}
placeholder="Type a message..."
@@ -199,7 +182,7 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
/>
<TouchableOpacity
onPress={sendMessage}
className="bg-gray-300 text-white rounded-full h-8 w-8 items-center justify-center"
style={styles.sendButton}
testID="send-button"
>
<Text></Text>
@@ -211,3 +194,133 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: "column",
height: "100%",
},
chatHeader: {
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
padding: 8,
paddingTop: 48,
backgroundColor: "#f0f0f0",
},
welcomeContainer: {
flex: 1,
flexDirection: "column",
height: "100%",
alignItems: "center",
justifyContent: "center",
},
usernameTitle: {
fontSize: 16,
fontWeight: "bold",
marginBottom: 24,
},
usernameInput: {
borderRadius: 4,
height: 48,
padding: 8,
marginBottom: 48,
width: 160,
borderWidth: 1,
borderColor: "#e5e5e5",
},
newChatButton: {
backgroundColor: "#3b82f6",
padding: 16,
borderRadius: 6,
},
newChatButtonText: {
color: "white",
fontWeight: "600",
},
joinChatTitle: {
fontSize: 16,
fontWeight: "bold",
marginTop: 24,
},
chatIdInput: {
borderRadius: 4,
height: 48,
padding: 8,
margin: 8,
marginTop: 16,
width: 320,
borderWidth: 1,
borderColor: "#e5e5e5",
},
joinChatButton: {
backgroundColor: "#22c55e",
padding: 16,
borderRadius: 6,
},
messageList: {
display: "flex",
},
messageContainer: {
borderRadius: 8,
padding: 4,
paddingHorizontal: 6,
maxWidth: "80%",
},
myMessage: {
backgroundColor: "#e5e5e5",
alignSelf: "flex-end",
},
otherMessage: {
backgroundColor: "#d4d4d4",
alignSelf: "flex-start",
},
messageSender: {
fontSize: 12,
color: "#6b7280",
},
messageContent: {
flexDirection: "row",
alignItems: "flex-end",
justifyContent: "space-between",
},
messageText: {
color: "black",
fontSize: 16,
maxWidth: "85%",
},
messageTime: {
fontSize: 10,
color: "#6b7280",
marginLeft: 8,
},
inputContainer: {
padding: 12,
backgroundColor: "white",
borderTopWidth: 1,
borderTopColor: "#d4d4d4",
},
inputRow: {
flexDirection: "row",
alignItems: "center",
gap: 8,
},
messageInput: {
borderRadius: 9999,
height: 32,
paddingVertical: 0,
paddingHorizontal: 8,
borderWidth: 1,
borderColor: "#e5e5e5",
flex: 1,
},
sendButton: {
backgroundColor: "#d4d4d4",
borderRadius: 9999,
height: 32,
width: 32,
alignItems: "center",
justifyContent: "center",
},
});

View File

@@ -1,18 +0,0 @@
import { useAcceptInvite } from "jazz-expo";
import React, { Text } from "react-native";
import { Chat } from "./schema";
export default function HandleInviteScreen({
navigation,
}: {
navigation: any;
}) {
useAcceptInvite({
invitedObjectSchema: Chat,
onAccept: async (chatId) => {
navigation.navigate("ChatScreen", { chatId });
},
});
return <Text>Accepting invite...</Text>;
}

View File

@@ -3,5 +3,7 @@ import { co, z } from "jazz-tools";
export const Message = co.map({
text: z.string(),
});
export type Message = co.loaded<typeof Message>;
export const Chat = co.list(Message);
export type Chat = co.loaded<typeof Chat>;

View File

@@ -1,14 +0,0 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
// NOTE: Update this to include the paths to all of your component files.
content: [
"./app/**/*.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}",
"./src/**/*.{js,jsx,ts,tsx}",
],
presets: [require("nativewind/preset")],
theme: {
extend: {},
},
plugins: [],
};

View File

@@ -8,10 +8,7 @@ appId: com.jazz.chatrn
# - assertVisible: "Reload"
# - tapOn: "Reload"
# login
- assertVisible: "Logout"
- tapOn: "Logout"
- assertVisible: "Anonymous user"
- assertVisible: "Username"
- runFlow:
label: "Erase existing username"
file: erase_text.yml
@@ -43,12 +40,13 @@ appId: com.jazz.chatrn
# logout
- tapOn: "Logout"
- assertVisible: "Username"
- assertVisible: "Anonymous user"
# join chat
- tapOn:
id: "chat-id-input"
- inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
- tapOn: "Join chat"
- assertVisible: "boorad"
- assertVisible: "bro, low key, it do be like that tho"
# - tapOn:
# id: "chat-id-input"
# - inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
# - tapOn: "Join chat"
# - assertVisible: "boorad"
# - assertVisible: "bro, low key, it do be like that tho"

View File

@@ -3,14 +3,14 @@
# This script is necessary, because unlike ios, the android emulator action
# accepts a script, runs it as your tests, then terminates.
set -e
# set -e
# build and install the app
echo "Building and installing Android app."
echo "If it fails, its output will be in artifact: android-install.log..."
cd ./android/
./gradlew installRelease >> ~/output/android-install.log 2>&1
cd ..
# # build and install the app
# echo "Building and installing Android app."
# echo "If it fails, its output will be in artifact: android-install.log..."
# cd ./android/
# ./gradlew installRelease >> ~/output/android-install.log 2>&1
# cd ..
# run the e2e tests
export PATH="$PATH":"$HOME/.maestro/bin"

View File

@@ -1,8 +1,6 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true,
"moduleResolution": "bundler"
},
"exclude": ["src/tests"]
"strict": true
}
}

View File

@@ -1,5 +1,74 @@
# chat-rn
## 1.0.128
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react-native@0.14.10
- jazz-tools@0.14.10
## 1.0.127
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react-native@0.14.9
## 1.0.126
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react-native@0.14.8
## 1.0.125
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react-native@0.14.7
## 1.0.124
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react-native@0.14.6
## 1.0.123
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react-native@0.14.5
## 1.0.122
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react-native@0.14.4
## 1.0.121
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react-native@0.14.2
## 1.0.120
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.120",
"version": "1.0.128",
"main": "index.js",
"scripts": {
"android": "react-native run-android",
@@ -23,7 +23,7 @@
"cojson-transport-ws": "workspace:*",
"jazz-react-native": "workspace:*",
"jazz-tools": "workspace:*",
"react": "18.3.1",
"react": "19.0.0",
"react-native": "0.79.2",
"react-native-get-random-values": "^1.11.0",
"react-native-mmkv": "^3.2.0",

View File

@@ -1,5 +1,82 @@
# chat-vue
## 0.0.111
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-tools@0.14.10
- jazz-browser@0.14.10
- jazz-vue@0.14.10
## 0.0.110
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-browser@0.14.9
- jazz-vue@0.14.9
## 0.0.109
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-browser@0.14.8
- jazz-vue@0.14.8
## 0.0.108
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-browser@0.14.7
- jazz-vue@0.14.7
## 0.0.107
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-browser@0.14.6
- jazz-vue@0.14.6
## 0.0.106
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
- jazz-vue@0.14.5
## 0.0.105
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-browser@0.14.4
- jazz-vue@0.14.4
## 0.0.104
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-browser@0.14.2
- jazz-vue@0.14.2
## 0.0.103
### Patch Changes

View File

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

View File

@@ -1,5 +1,83 @@
# jazz-example-chat
## 0.0.209
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-inspector@0.14.10
- hash-slash@0.2.3
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.208
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-inspector@0.14.9
- jazz-react@0.14.9
## 0.0.207
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-inspector@0.14.8
- jazz-react@0.14.8
## 0.0.206
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-inspector@0.14.7
- jazz-react@0.14.7
## 0.0.205
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-inspector@0.14.6
- jazz-react@0.14.6
## 0.0.204
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
## 0.0.203
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-inspector@0.14.4
- jazz-react@0.14.4
## 0.0.202
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-inspector@0.14.2
- jazz-react@0.14.2
## 0.0.201
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.201",
"version": "0.0.209",
"type": "module",
"scripts": {
"dev": "vite",
@@ -19,14 +19,14 @@
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"zod": "4.0.0-beta.20250505T012514"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",

View File

@@ -1,5 +1,5 @@
import { createImage, useAccount, useCoState } from "jazz-react";
import { Account, Loaded, co } from "jazz-tools";
import { Account, co } from "jazz-tools";
import { useState } from "react";
import { Chat, Message } from "./schema.ts";
import {
@@ -91,7 +91,7 @@ export function ChatScreen(props: { chatID: string }) {
function ChatBubble(props: {
me: Account;
msg: Loaded<typeof Message, { text: true }>;
msg: co.loaded<typeof Message, { text: true }>;
}) {
if (!props.me.canRead(props.msg) || !props.msg.text?.toString()) {
return (

View File

@@ -4,5 +4,7 @@ export const Message = co.map({
text: co.plainText(),
image: z.optional(co.image()),
});
export type Message = co.loaded<typeof Message>;
export const Chat = co.list(Message);
export type Chat = co.loaded<typeof Chat>;

View File

@@ -1,6 +1,6 @@
import clsx from "clsx";
import { ProgressiveImg } from "jazz-react";
import { CoPlainText, ImageDefinition, Loaded } from "jazz-tools";
import { CoPlainText, ImageDefinition } from "jazz-tools";
import { ImageIcon } from "lucide-react";
import { useId, useRef } from "react";
@@ -81,7 +81,7 @@ export function BubbleText(props: {
);
}
export function BubbleImage(props: { image: Loaded<typeof ImageDefinition> }) {
export function BubbleImage(props: { image: ImageDefinition }) {
return (
<ProgressiveImg image={props.image}>
{({ src }) => (

View File

@@ -2,8 +2,8 @@
// This is NOT needed to make the chat work
import { Chat } from "@/schema.ts";
import { Loaded } from "jazz-tools";
export function onChatLoad(chat: Loaded<typeof Chat>) {
export function onChatLoad(chat: Chat) {
if (window.parent) {
chat.waitForSync().then(() => {
window.parent.postMessage(

View File

@@ -1,5 +1,82 @@
# minimal-auth-clerk
## 0.0.108
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react-auth-clerk@0.14.10
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.107
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
- jazz-react-auth-clerk@0.14.9
## 0.0.106
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
- jazz-react-auth-clerk@0.14.8
## 0.0.105
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
- jazz-react-auth-clerk@0.14.7
## 0.0.104
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
- jazz-react-auth-clerk@0.14.6
## 0.0.103
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
- jazz-react-auth-clerk@0.14.5
## 0.0.102
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
- jazz-react-auth-clerk@0.14.4
## 0.0.101
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
- jazz-react-auth-clerk@0.14.2
## 0.0.100
### Patch Changes

View File

@@ -2,7 +2,7 @@
This is an example of how to use clerk authentication with Jazz.
Live version: https://clerk-demo.jazz.tools
Live version: [https://clerk-demo.jazz.tools](https://clerk-demo.jazz.tools)
## Getting started

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.100",
"version": "0.0.108",
"type": "module",
"scripts": {
"dev": "vite",
@@ -17,14 +17,14 @@
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "5.6.2",

View File

@@ -4,6 +4,7 @@ import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { JazzProviderWithClerk } from "jazz-react-auth-clerk";
import { ReactNode } from "react";
import { apiKey } from "./apiKey";
// Import your publishable key
@@ -13,7 +14,7 @@ if (!PUBLISHABLE_KEY) {
throw new Error("Add your Clerk publishable key to the .env.local file");
}
function JazzProvider({ children }: { children: React.ReactNode }) {
function JazzProvider({ children }: { children: ReactNode }) {
const clerk = useClerk();
return (

View File

@@ -1,5 +1,89 @@
# file-share-svelte
## 0.0.93
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-tools@0.14.10
- jazz-inspector-element@0.14.10
- jazz-svelte@0.14.10
## 0.0.92
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-inspector-element@0.14.9
- jazz-svelte@0.14.9
## 0.0.91
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-inspector-element@0.14.8
- jazz-svelte@0.14.8
## 0.0.90
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-inspector-element@0.14.7
- jazz-svelte@0.14.7
## 0.0.89
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-inspector-element@0.14.6
- jazz-svelte@0.14.6
## 0.0.88
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector-element@0.14.5
- jazz-svelte@0.14.5
## 0.0.87
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-inspector-element@0.14.4
- jazz-svelte@0.14.4
## 0.0.86
### Patch Changes
- Updated dependencies [b2ee306]
- jazz-svelte@0.14.3
## 0.0.85
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-inspector-element@0.14.2
- jazz-svelte@0.14.2
## 0.0.84
### Patch Changes

View File

@@ -1,11 +1,11 @@
{
"name": "file-share-svelte",
"version": "0.0.84",
"version": "0.0.93",
"private": true,
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"build": "pnpm run check && vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import { slide } from 'svelte/transition';
import { SharedFile } from '$lib/schema';
import { FileStream } from 'jazz-tools';
import { type SharedFile } from '$lib/schema';
import { FileStream, type Loaded } from 'jazz-tools';
import { File, FileDown, Trash2, Link2 } from 'lucide-svelte';
import { toast } from 'svelte-sonner';
import { downloadFileBlob, formatFileSize } from '$lib/utils';
@@ -11,9 +11,9 @@
loading = false,
onDelete
}: {
file: SharedFile;
file: Loaded<SharedFile>;
loading?: boolean;
onDelete: (file: SharedFile) => void;
onDelete: (file: Loaded<SharedFile>) => void;
} = $props();
const isAdmin = $derived(file._owner?.myRole() === 'admin');
@@ -55,7 +55,7 @@
class="flex items-center justify-between rounded-lg border border-gray-200 bg-white p-4"
transition:slide={{ duration: 200 }}
>
<div class="flex items-center space-x-4 flex-grow">
<div class="flex flex-grow items-center space-x-4">
<div class="flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600">
<File class="h-6 w-6" />
</div>
@@ -64,7 +64,12 @@
<label class="sr-only" for={`file-name-${file.id}`}>File name</label>
<!-- Jazz values are reactive, but they are not recognized as reactive by Svelte -->
<!-- svelte-ignore binding_property_non_reactive -->
<input class="font-medium text-gray-900 w-full py-1" type="text" bind:value={file.name} id={`file-name-${file.id}`} />
<input
class="w-full py-1 font-medium text-gray-900"
type="text"
bind:value={file.name}
id={`file-name-${file.id}`}
/>
{:else}
<h3 class="font-medium text-gray-900">{file.name}</h3>
{/if}

View File

@@ -1,46 +1,31 @@
import { Account, CoList, CoMap, FileStream, Profile, coField, Group } from 'jazz-tools';
import { Group, co, z } from 'jazz-tools';
export class SharedFile extends CoMap {
name = coField.string;
file = coField.ref(FileStream);
createdAt = coField.Date;
uploadedAt = coField.Date;
size = coField.number;
}
export const SharedFile = co.map({
name: z.string(),
file: co.fileStream(),
createdAt: z.date(),
uploadedAt: z.date(),
size: z.number(),
});
export class FileShareProfile extends Profile {
name = coField.string;
}
export type SharedFile = typeof SharedFile;
export class ListOfSharedFiles extends CoList.Of(coField.ref(SharedFile)) {}
export const FileShareAccountRoot = co.map({
type: z.literal('file-share-account'),
sharedFiles: co.list(SharedFile),
})
export class FileShareAccountRoot extends CoMap {
type = coField.literal('file-share-account');
sharedFiles = coField.ref(ListOfSharedFiles);
}
export const FileShareAccount = co.account({
profile: co.profile(),
root: FileShareAccountRoot,
}).withMigration((account) => {
if (account.root === undefined) {
const publicGroup = Group.create({ owner: account });
publicGroup.addMember('everyone', 'reader');
export class FileShareAccount extends Account {
profile = coField.ref(FileShareProfile);
root = coField.ref(FileShareAccountRoot);
/** The account migration is run on account creation and on every log-in.
* You can use it to set up the account root and any other initial CoValues you need.
*/
async migrate() {
await this._refs.root?.load();
// Initialize root if it doesn't exist
if (this.root === undefined || this.root?.type !== 'file-share-account') {
// Create a group that will own all shared files
const publicGroup = Group.create({ owner: this });
publicGroup.addMember('everyone', 'reader');
this.root = FileShareAccountRoot.create(
{
type: 'file-share-account',
sharedFiles: ListOfSharedFiles.create([], { owner: publicGroup }),
},
);
}
account.root = FileShareAccountRoot.create({
type: 'file-share-account',
sharedFiles: co.list(SharedFile).create([], publicGroup),
}, publicGroup);
}
}
});

View File

@@ -1,7 +1,7 @@
<script lang="ts" module>
declare module 'jazz-svelte' {
interface Register {
Account: FileShareAccount;
Account: typeof FileShareAccount;
}
}
</script>

View File

@@ -1,21 +1,23 @@
<script lang="ts">
import { AccountCoState } from 'jazz-svelte';
import { SharedFile } from '$lib/schema';
import { FileStream } from 'jazz-tools';
import { SharedFile, FileShareAccount } from '$lib/schema';
import { FileStream, type Loaded } from 'jazz-tools';
import FileItem from '$lib/components/FileItem.svelte';
import { CloudUpload } from 'lucide-svelte';
const me = new AccountCoState({
const me = new AccountCoState(FileShareAccount, {
resolve: {
profile: true,
root: {
sharedFiles: {
$each: true
},
}
}
}
});
$inspect(me);
const sharedFiles = $derived(me.current?.root.sharedFiles);
let fileInput: HTMLInputElement;
@@ -53,7 +55,7 @@
}
}
async function deleteFile(file: SharedFile) {
async function deleteFile(file: Loaded<typeof SharedFile>) {
if (!sharedFiles) return;
const index = sharedFiles.indexOf(file);
@@ -107,10 +109,7 @@
{#if sharedFiles.length}
{#each sharedFiles as file}
{#if file}
<FileItem
{file}
onDelete={deleteFile}
/>
<FileItem {file} onDelete={deleteFile} />
{/if}
{/each}
{:else}

View File

@@ -1,19 +1,18 @@
<script lang="ts">
import { page } from '$app/stores';
import { CoState } from 'jazz-svelte';
import { CoState } from 'jazz-svelte';
import { SharedFile } from '$lib/schema';
import { File, FileDown, Link2 } from 'lucide-svelte';
import type { ID } from 'jazz-tools';
import { FileStream } from 'jazz-tools';
import { toast } from 'svelte-sonner';
import { downloadFileBlob } from '$lib/utils';
const fileId = $page.params.fileId;
const file = $derived(new CoState(SharedFile, fileId as ID<SharedFile>));
const file = $derived(new CoState(SharedFile, fileId));
const isAdmin = $derived(file.current?._owner?.myRole() === 'admin');
const fileStreamId = $derived(file.current?._refs.file?.id);
const fileStreamId = $derived(file.current?._refs?.file?.id);
async function downloadFile() {
if (!fileStreamId || !file.current) {

View File

@@ -1,5 +1,82 @@
# jazz-tailwind-demo-auth-starter
## 0.0.48
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-inspector@0.14.10
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.47
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-inspector@0.14.9
- jazz-react@0.14.9
## 0.0.46
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-inspector@0.14.8
- jazz-react@0.14.8
## 0.0.45
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-inspector@0.14.7
- jazz-react@0.14.7
## 0.0.44
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-inspector@0.14.6
- jazz-react@0.14.6
## 0.0.43
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
## 0.0.42
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-inspector@0.14.4
- jazz-react@0.14.4
## 0.0.41
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-inspector@0.14.2
- jazz-react@0.14.2
## 0.0.40
### Patch Changes

View File

@@ -2,7 +2,7 @@
This is an example of how to upload and render images with Jazz.
Live version: https://file-upload-demo.jazz.tools
Live version: [https://file-upload-demo.jazz.tools](https://file-upload-demo.jazz.tools)
## Getting started

View File

@@ -1,7 +1,7 @@
{
"name": "filestream",
"private": true,
"version": "0.0.40",
"version": "0.0.48",
"type": "module",
"scripts": {
"dev": "vite",
@@ -14,13 +14,13 @@
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"jazz-inspector": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"autoprefixer": "^10.4.20",
"globals": "^15.11.0",

View File

@@ -1,6 +1,6 @@
"use client";
import { useAccount } from "jazz-react";
import { FileStream, co } from "jazz-tools";
import { co } from "jazz-tools";
import { useRef, useState } from "react";
import { JazzAccount } from "./schema";
@@ -125,7 +125,7 @@ export function FileWidget() {
try {
setIsUploading(true);
me.profile.file = await FileStream.createFromBlob(file, {
me.profile.file = await co.fileStream().createFromBlob(file, {
onProgress: (p) => setProgress(Math.round(p * 100)),
});
} catch (error) {

View File

@@ -1,5 +1,75 @@
# form
## 0.1.49
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- hash-slash@0.2.3
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.1.48
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
## 0.1.47
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
## 0.1.46
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
## 0.1.45
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
## 0.1.44
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.1.43
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
## 0.1.42
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
## 0.1.41
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "form",
"private": true,
"version": "0.1.41",
"version": "0.1.49",
"type": "module",
"scripts": {
"dev": "vite",
@@ -14,15 +14,15 @@
"hash-slash": "workspace:*",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@playwright/test": "^1.50.1",
"@tailwindcss/forms": "^0.5.9",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"autoprefixer": "^10.4.20",
"globals": "^15.11.0",

View File

@@ -1,5 +1,74 @@
# image-upload
## 0.0.105
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.104
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
## 0.0.103
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
## 0.0.102
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
## 0.0.101
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
## 0.0.100
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.99
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
## 0.0.98
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
## 0.0.97
### Patch Changes

View File

@@ -2,7 +2,7 @@
This is an example of how to upload and render images with Jazz.
Live version: https://image-upload-demo.jazz.tools
Live version: [https://image-upload-demo.jazz.tools](https://image-upload-demo.jazz.tools)
## Getting started

View File

@@ -1,7 +1,7 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.97",
"version": "0.0.105",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,13 +13,13 @@
"dependencies": {
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "5.6.2",

View File

@@ -1,5 +1,55 @@
# jazz-example-inspector
## 0.0.158
### Patch Changes
- Updated dependencies [dc746a2]
- jazz-inspector@0.14.10
- hash-slash@0.2.3
## 0.0.157
### Patch Changes
- jazz-inspector@0.14.9
## 0.0.156
### Patch Changes
- jazz-inspector@0.14.8
## 0.0.155
### Patch Changes
- jazz-inspector@0.14.7
## 0.0.154
### Patch Changes
- jazz-inspector@0.14.6
## 0.0.153
### Patch Changes
- jazz-inspector@0.14.5
## 0.0.152
### Patch Changes
- jazz-inspector@0.14.4
## 0.0.151
### Patch Changes
- jazz-inspector@0.14.2
## 0.0.150
### Patch Changes

View File

@@ -1,6 +1,6 @@
# Jazz Inspector
Live address: https://inspector.jazz.tools
Live address: [https://inspector.jazz.tools](https://inspector.jazz.tools)
Use this to visually inspect a Jazz account or other CoValue.

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.150",
"version": "0.0.158",
"type": "module",
"scripts": {
"dev": "vite",
@@ -17,15 +17,15 @@
"cojson-transport-ws": "workspace:*",
"hash-slash": "workspace:*",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-router": "^6.16.0",
"react-router-dom": "^6.16.0",
"react-use": "^17.4.0"
},
"devDependencies": {
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.27",

View File

@@ -27,15 +27,15 @@
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"lucide-react": "^0.485.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"tailwind-merge": "^3.0.2",
"tailwindcss": "^4.0.17",
"tw-animate-css": "^1.2.5"
},
"devDependencies": {
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.4",
"jazz-run": "workspace:*",
"npm-run-all": "^4.1.5",

View File

@@ -10,7 +10,7 @@ import { Input } from "@/components/ui/input";
import { WORKER_ID } from "@/constants";
import { JoinGameRequest, WaitingRoom } from "@/schema";
import { createFileRoute, redirect } from "@tanstack/react-router";
import { Group, InboxSender, type Loaded } from "jazz-tools";
import { Group, InboxSender } from "jazz-tools";
import { ClipboardCopyIcon, Loader2Icon } from "lucide-react";
import { useEffect, useState } from "react";
@@ -29,10 +29,7 @@ export const Route = createFileRoute(
throw redirect({ to: "/" });
}
if (!waitingRoom?.account1?.isMe) {
const sender = await InboxSender.load<
Loaded<typeof JoinGameRequest>,
Loaded<typeof WaitingRoom>
>(
const sender = await InboxSender.load<JoinGameRequest, WaitingRoom>(
WORKER_ID,
me,
// { account1: {}, account2: {}, me, game: {} },

View File

@@ -4,6 +4,7 @@ export const Player = co.map({
account: co.account(),
playSelection: z.optional(z.literal(["rock", "paper", "scissors"])),
});
export type Player = co.loaded<typeof Player>;
export const Game = co.map({
player1: Player,
@@ -12,12 +13,14 @@ export const Game = co.map({
player1Score: z.number(),
player2Score: z.number(),
});
export type Game = co.loaded<typeof Game>;
export const WaitingRoom = co.map({
account1: co.account(),
account2: z.optional(co.account()),
game: z.optional(Game),
});
export type WaitingRoom = co.loaded<typeof WaitingRoom>;
export const PlayIntent = co.map({
type: z.literal("play"),
@@ -25,24 +28,29 @@ export const PlayIntent = co.map({
player: z.literal(["player1", "player2"]),
playSelection: z.literal(["rock", "paper", "scissors"]),
});
export type PlayIntent = co.loaded<typeof PlayIntent>;
export const NewGameIntent = co.map({
type: z.literal("newGame"),
gameId: z.string(),
});
export type NewGameIntent = co.loaded<typeof NewGameIntent>;
export const CreateGameRequest = co.map({
type: z.literal("createGame"),
});
export type CreateGameRequest = co.loaded<typeof CreateGameRequest>;
export const JoinGameRequest = co.map({
type: z.literal("joinGame"),
waitingRoom: WaitingRoom,
});
export type JoinGameRequest = co.loaded<typeof JoinGameRequest>;
export const InboxMessage = z.discriminatedUnion([
export const InboxMessage = z.discriminatedUnion("type", [
PlayIntent,
NewGameIntent,
CreateGameRequest,
JoinGameRequest,
]);
export type InboxMessage = co.loaded<typeof InboxMessage>;

View File

@@ -7,7 +7,7 @@ import {
WaitingRoom,
} from "@/schema";
import { startWorker } from "jazz-nodejs";
import { Account, Group, type Loaded, co } from "jazz-tools";
import { Account, Group, co } from "jazz-tools";
import { determineWinner } from "./lib/utils";
if (!process.env.VITE_JAZZ_WORKER_ACCOUNT || !process.env.JAZZ_WORKER_SECRET) {
@@ -124,10 +124,7 @@ function createPlayer({ account }: CreatePlayerParams) {
return player;
}
async function handleNewGameIntent(
_: string,
message: Loaded<typeof NewGameIntent>,
) {
async function handleNewGameIntent(_: string, message: NewGameIntent) {
const gameId = message.gameId;
const game = await Game.load(gameId, {
@@ -152,7 +149,7 @@ async function handleNewGameIntent(
}
}
async function handlePlayIntent(_: string, message: Loaded<typeof PlayIntent>) {
async function handlePlayIntent(_: string, message: PlayIntent) {
// determine current player, update game with outcome
const gameId = message.gameId;
if (!gameId) {

View File

@@ -1,5 +1,74 @@
# multi-cursors
## 0.0.101
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.100
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
## 0.0.99
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
## 0.0.98
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
## 0.0.97
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
## 0.0.96
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.95
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
## 0.0.94
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
## 0.0.93
### Patch Changes

View File

@@ -1,6 +1,7 @@
# Jazz Multi-Cursors Example
Track user presence on a canvas with multiple cursors and out of bounds indicators.
Live version: [https://multi-cursors-demo.jazz.tools/](https://multi-cursors-demo.jazz.tools/)
## Getting started

View File

@@ -1,7 +1,7 @@
{
"name": "multi-cursors",
"private": true,
"version": "0.0.93",
"version": "0.0.101",
"type": "module",
"scripts": {
"dev": "vite",
@@ -15,13 +15,14 @@
"@react-spring/web": "^9.7.5",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0",
"zod": "3.25.0-beta.20250518T002810"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"autoprefixer": "^10.4.20",
"globals": "^15.11.0",

View File

@@ -78,6 +78,7 @@ export function Cursor({
return (
<>
{/* @ts-expect-error - TODO: invalid after the React 19 upgrade */}
<animated.g
transform={to(
[springs.x, springs.y],
@@ -113,6 +114,7 @@ export function Cursor({
isOutOfBounds={isStrictlyOutOfBounds}
/>
{isStrictlyOutOfBounds ? (
// @ts-expect-error - TODO: invalid after the React 19 upgrade
<animated.g
transform={to(
[intersectionSprings.x, intersectionSprings.y],

View File

@@ -52,6 +52,7 @@ export function CursorLabel({
return (
<>
{/* @ts-expect-error - TODO: invalid after the React 19 upgrade */}
<animated.text
ref={textRef}
x={to([labelSprings.x], (x) => x)}

View File

@@ -1,5 +1,82 @@
# multiauth
## 0.0.49
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react-auth-clerk@0.14.10
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.48
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
- jazz-react-auth-clerk@0.14.9
## 0.0.47
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
- jazz-react-auth-clerk@0.14.8
## 0.0.46
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
- jazz-react-auth-clerk@0.14.7
## 0.0.45
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
- jazz-react-auth-clerk@0.14.6
## 0.0.44
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
- jazz-react-auth-clerk@0.14.5
## 0.0.43
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
- jazz-react-auth-clerk@0.14.4
## 0.0.42
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
- jazz-react-auth-clerk@0.14.2
## 0.0.41
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "multiauth",
"private": true,
"version": "0.0.41",
"version": "0.0.49",
"type": "module",
"scripts": {
"dev": "vite",
@@ -15,13 +15,13 @@
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "5.6.2",

View File

@@ -1,5 +1,82 @@
# jazz-example-musicplayer
## 0.0.130
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-inspector@0.14.10
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.129
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-inspector@0.14.9
- jazz-react@0.14.9
## 0.0.128
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-inspector@0.14.8
- jazz-react@0.14.8
## 0.0.127
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-inspector@0.14.7
- jazz-react@0.14.7
## 0.0.126
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-inspector@0.14.6
- jazz-react@0.14.6
## 0.0.125
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
## 0.0.124
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-inspector@0.14.4
- jazz-react@0.14.4
## 0.0.123
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-inspector@0.14.2
- jazz-react@0.14.2
## 0.0.122
### Patch Changes

View File

@@ -1,6 +1,6 @@
# Music player example with Jazz and React
Live version: https://music-demo.jazz.tools
Live version: [https://music-demo.jazz.tools](https://music-demo.jazz.tools)
## Getting started

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.122",
"version": "0.0.130",
"type": "module",
"scripts": {
"dev": "vite",
@@ -25,8 +25,8 @@
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-router": "^6.16.0",
"react-router-dom": "^6.16.0",
"tailwind-merge": "^1.14.0",
@@ -34,8 +34,8 @@
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.27",

View File

@@ -13,6 +13,7 @@ import { co, z } from "jazz-tools";
export const MusicTrackWaveform = co.map({
data: z.array(z.number()),
});
export type MusicTrackWaveform = co.loaded<typeof MusicTrackWaveform>;
export const MusicTrack = co.map({
/**
@@ -44,12 +45,13 @@ export const MusicTrack = co.map({
return z.optional(MusicTrack);
},
});
export type MusicTrack = co.loaded<typeof MusicTrack>;
export const Playlist = co.map({
title: z.string(),
tracks: co.list(MusicTrack), // CoList is the collaborative version of Array
});
export type Playlist = co.loaded<typeof Playlist>;
/** The account root is an app-specific per-user private `CoMap`
* where you can store top-level objects for that user */
export const MusicaAccountRoot = co.map({
@@ -69,7 +71,7 @@ export const MusicaAccountRoot = co.map({
exampleDataLoaded: z.optional(z.boolean()),
});
export type MusicaAccountRoot = co.loaded<typeof MusicaAccountRoot>;
export const MusicaAccount = co
.account({
/** the default user profile with a name */
@@ -97,5 +99,6 @@ export const MusicaAccount = co
});
}
});
export type MusicaAccount = co.loaded<typeof MusicaAccount>;
/** Walkthrough: Continue with ./2_main.tsx */

View File

@@ -1,5 +1,5 @@
import { getAudioFileData } from "@/lib/audio/getAudioFileData";
import { FileStream, Group, Loaded, co } from "jazz-tools";
import { FileStream, Group, co } from "jazz-tools";
import {
MusicTrack,
MusicTrackWaveform,
@@ -94,8 +94,8 @@ export async function createNewPlaylist() {
}
export async function addTrackToPlaylist(
playlist: Loaded<typeof Playlist>,
track: Loaded<typeof MusicTrack>,
playlist: Playlist,
track: MusicTrack,
) {
const alreadyAdded = playlist.tracks?.some(
(t) => t?.id === track.id || t?._refs.sourceTrack?.id === track.id,
@@ -118,8 +118,8 @@ export async function addTrackToPlaylist(
}
export async function removeTrackFromPlaylist(
playlist: Loaded<typeof Playlist>,
track: Loaded<typeof MusicTrack>,
playlist: Playlist,
track: MusicTrack,
) {
const notAdded = !playlist.tracks?.some(
(t) => t?.id === track.id || t?._refs.sourceTrack?.id === track.id,
@@ -142,21 +142,15 @@ export async function removeTrackFromPlaylist(
}
}
export async function updatePlaylistTitle(
playlist: Loaded<typeof Playlist>,
title: string,
) {
export async function updatePlaylistTitle(playlist: Playlist, title: string) {
playlist.title = title;
}
export async function updateMusicTrackTitle(
track: Loaded<typeof MusicTrack>,
title: string,
) {
export async function updateMusicTrackTitle(track: MusicTrack, title: string) {
track.title = title;
}
export async function updateActivePlaylist(playlist?: Loaded<typeof Playlist>) {
export async function updateActivePlaylist(playlist?: Playlist) {
const { root } = await MusicaAccount.getMe().ensureLoaded({
resolve: {
root: {
@@ -169,7 +163,7 @@ export async function updateActivePlaylist(playlist?: Loaded<typeof Playlist>) {
root.activePlaylist = playlist ?? root.rootPlaylist;
}
export async function updateActiveTrack(track: Loaded<typeof MusicTrack>) {
export async function updateActiveTrack(track: MusicTrack) {
const { root } = await MusicaAccount.getMe().ensureLoaded({
resolve: {
root: {},
@@ -180,7 +174,7 @@ export async function updateActiveTrack(track: Loaded<typeof MusicTrack>) {
}
export async function onAnonymousAccountDiscarded(
anonymousAccount: Loaded<typeof MusicaAccount>,
anonymousAccount: MusicaAccount,
) {
const { root: anonymousAccountRoot } = await anonymousAccount.ensureLoaded({
resolve: {

View File

@@ -2,7 +2,7 @@ import { MusicTrack, MusicaAccount, Playlist } from "@/1_schema";
import { usePlayMedia } from "@/lib/audio/usePlayMedia";
import { usePlayState } from "@/lib/audio/usePlayState";
import { useAccount } from "jazz-react";
import { FileStream, Loaded } from "jazz-tools";
import { FileStream } from "jazz-tools";
import { useRef, useState } from "react";
import { updateActivePlaylist, updateActiveTrack } from "./4_actions";
import { getNextTrack, getPrevTrack } from "./lib/getters";
@@ -22,7 +22,7 @@ export function useMediaPlayer() {
// Reference used to avoid out-of-order track loads
const lastLoadedTrackId = useRef<string | null>(null);
async function loadTrack(track: Loaded<typeof MusicTrack>) {
async function loadTrack(track: MusicTrack) {
lastLoadedTrackId.current = track.id;
setLoading(track.id);
@@ -64,10 +64,7 @@ export function useMediaPlayer() {
}
}
async function setActiveTrack(
track: Loaded<typeof MusicTrack>,
playlist?: Loaded<typeof Playlist>,
) {
async function setActiveTrack(track: MusicTrack, playlist?: Playlist) {
if (activeTrackId === track.id && lastLoadedTrackId.current !== null) {
playState.toggle();
return;

View File

@@ -4,7 +4,7 @@ import { useAudioManager } from "./AudioManager";
export function usePlayMedia() {
const audioManager = useAudioManager();
const previousMediaLoad = useRef<Promise<unknown>>();
const previousMediaLoad = useRef<Promise<unknown> | undefined>(undefined);
async function playMedia(file: Blob) {
// Wait for the previous load to finish

View File

@@ -1,5 +1,74 @@
# organization
## 0.0.101
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.100
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
## 0.0.99
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
## 0.0.98
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
## 0.0.97
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
## 0.0.96
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.95
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
## 0.0.94
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
## 0.0.93
### Patch Changes

View File

@@ -2,7 +2,7 @@
This is an example of how to share a set of data between users through a CoMap called Organization.
Different apps have different names for this concept, such as "teams" or "workspaces".
Live version: [https://jazz-organization.vercel.app/](https://jazz-organization.vercel.app/)
Refer to the [documentation](https://jazz.tools/docs/react/design-patterns/organization) for more information.
## Getting started

View File

@@ -1,7 +1,7 @@
{
"name": "organization",
"private": true,
"version": "0.0.93",
"version": "0.0.101",
"type": "module",
"scripts": {
"dev": "vite",
@@ -16,8 +16,8 @@
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-router": "^6.16.0",
"react-router-dom": "^6.16.0"
},
@@ -25,8 +25,8 @@
"@playwright/test": "^1.50.1",
"@biomejs/biome": "1.9.4",
"@tailwindcss/forms": "^0.5.9",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"autoprefixer": "^10.4.20",
"globals": "^15.11.0",

View File

@@ -1,5 +1,81 @@
# passkey-svelte
## 0.0.97
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-tools@0.14.10
- jazz-svelte@0.14.10
## 0.0.96
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-svelte@0.14.9
## 0.0.95
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-svelte@0.14.8
## 0.0.94
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-svelte@0.14.7
## 0.0.93
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-svelte@0.14.6
## 0.0.92
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-svelte@0.14.5
## 0.0.91
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-svelte@0.14.4
## 0.0.90
### Patch Changes
- Updated dependencies [b2ee306]
- jazz-svelte@0.14.3
## 0.0.89
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-svelte@0.14.2
## 0.0.88
### Patch Changes

View File

@@ -5,6 +5,7 @@ This example app demonstrates how to implement passkey authentication in a Svelt
## Features
This example showcases how to:
- Set up passkey authentication in a Svelte application
- Handle user registration with passkeys
- Manage authentication state
@@ -13,23 +14,26 @@ This example showcases how to:
## 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 passkey-svelte-app --example passkey-svelte
```
Go to the new project directory.
```bash
cd passkey-svelte-app
```
Run the dev server.
```bash
npm run dev
```
@@ -39,21 +43,25 @@ npm run dev
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/passkey-svelte/
```
Start the dev server.
```bash
pnpm dev
```

View File

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

View File

@@ -1 +1 @@
export const apiKey = "minimal-svelte-auth-passkey@garden.co"
export const apiKey = 'minimal-svelte-auth-passkey@garden.co';

View File

@@ -1,13 +1,13 @@
<script lang="ts">
import { JazzProvider, PasskeyAuthBasicUI } from 'jazz-svelte';
import {apiKey} from '../apiKey';
import { apiKey } from '../apiKey';
let { children } = $props();
</script>
<JazzProvider
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
peer: `wss://cloud.jazz.tools/?key=${apiKey}`
}}
>
<PasskeyAuthBasicUI appName="minimal-svelte-auth-passkey">

View File

@@ -1,15 +1,18 @@
<script lang="ts">
import { useAccount } from 'jazz-svelte';
import { AccountCoState } from 'jazz-svelte';
import { Account } from 'jazz-tools';
const account = useAccount({
root: {}
const account = new AccountCoState(Account, {
resolve: {
profile: true
}
});
$inspect(account);
</script>
<div class="container">
<h1>Welcome back, {account?.me?.profile?.name}</h1>
<h1>Welcome back, {account?.current?.profile?.name}</h1>
<button onclick={() => account.logOut()}>Log out</button>
</div>

View File

@@ -1,5 +1,74 @@
# minimal-auth-passkey
## 0.0.106
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.105
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
## 0.0.104
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
## 0.0.103
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
## 0.0.102
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
## 0.0.101
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.100
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
## 0.0.99
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
## 0.0.98
### Patch Changes

View File

@@ -2,7 +2,7 @@
This is an example of how to use passkey authentication with Jazz.
Live version: https://passkey-demo.jazz.tools
Live version: [https://passkey-demo.jazz.tools](https://passkey-demo.jazz.tools)
## Getting started

View File

@@ -1,7 +1,7 @@
{
"name": "passkey",
"private": true,
"version": "0.0.98",
"version": "0.0.106",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,13 +13,13 @@
"dependencies": {
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "5.6.2",

View File

@@ -1,5 +1,74 @@
# passphrase
## 0.0.103
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.102
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
## 0.0.101
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
## 0.0.100
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
## 0.0.99
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
## 0.0.98
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.97
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
## 0.0.96
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
## 0.0.95
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passphrase",
"private": true,
"version": "0.0.95",
"version": "0.0.103",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,13 +13,13 @@
"dependencies": {
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "5.6.2",

View File

@@ -1,5 +1,74 @@
# jazz-password-manager
## 0.0.127
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.126
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
## 0.0.125
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
## 0.0.124
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
## 0.0.123
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
## 0.0.122
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.121
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
## 0.0.120
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
## 0.0.119
### Patch Changes

View File

@@ -1,6 +1,6 @@
# Password manager example with Jazz and React
Live version: https://passwords-demo.jazz.tools
Live version: [https://passwords-demo.jazz.tools](https://passwords-demo.jazz.tools)
![Password Manager Screenshot](demo.png "Screenshot")

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-password-manager",
"private": true,
"version": "0.0.119",
"version": "0.0.127",
"type": "module",
"scripts": {
"dev": "vite",
@@ -14,14 +14,14 @@
"dependencies": {
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-hook-form": "^7.41.5",
"react-router-dom": "^6.16.0"
},
"devDependencies": {
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.3.3",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",

View File

@@ -5,8 +5,8 @@ import InviteModal from "./components/invite-modal";
import NewItemModal from "./components/new-item-modal";
import Table from "./components/table";
import { useAccount, useCoState } from "jazz-react";
import { Loaded, co } from "jazz-tools";
import { useAccount } from "jazz-react";
import { Loaded } from "jazz-tools";
import { useNavigate, useParams } from "react-router-dom";
import { Folder, PasswordItem, PasswordManagerAccount } from "./1_schema";
import {
@@ -20,7 +20,19 @@ import { Alert, AlertDescription } from "./components/alert";
import { PasswordItemFormValues } from "./types";
const VaultPage: React.FC = () => {
const { me, logOut } = useAccount(PasswordManagerAccount);
const { me, logOut } = useAccount(PasswordManagerAccount, {
resolve: {
root: {
folders: {
$each: {
items: {
$each: true,
},
},
},
},
},
});
const sharedFolderId = useParams<{ sharedFolderId: string }>().sharedFolderId;
const navigate = useNavigate();
@@ -28,6 +40,8 @@ const VaultPage: React.FC = () => {
useEffect(() => {
if (!sharedFolderId) return;
const me = PasswordManagerAccount.getMe();
addSharedFolder(sharedFolderId, me).then(() => {
navigate("/vault");
});
@@ -36,17 +50,13 @@ const VaultPage: React.FC = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const items = me.root?.folders?.flatMap(
const items = me?.root.folders.flatMap(
(folder) =>
folder?.items?.filter(
(item): item is Exclude<typeof item, null> => !!item,
) || [],
);
const folders = useCoState(co.list(Folder), me.root?._refs.folders?.id, {
resolve: {
$each: { items: { $each: true } },
},
});
const folders = me?.root.folders;
const [selectedFolder, setSelectedFolder] = useState<
Loaded<typeof Folder> | undefined
@@ -95,6 +105,7 @@ const VaultPage: React.FC = () => {
};
const handleCreateFolder = async () => {
if (!me) return;
if (newFolderName) {
try {
const newFolder = createFolder(newFolderName, me);
@@ -108,18 +119,20 @@ const VaultPage: React.FC = () => {
};
const handleDeleteFolder = async () => {
if (!me) return;
try {
const selectedFolderIndex = me.root?.folders?.findIndex(
const selectedFolderIndex = me.root.folders.findIndex(
(folder) => folder?.id === selectedFolder?.id,
);
if (selectedFolderIndex !== undefined && selectedFolderIndex > -1)
me.root?.folders?.splice(selectedFolderIndex, 1);
me.root.folders.splice(selectedFolderIndex, 1);
} catch (err) {
setError("Failed to create folder. Please try again.");
}
};
const handleLogout = async () => {
if (!me) return;
try {
logOut();
} catch (err) {
@@ -141,14 +154,14 @@ const VaultPage: React.FC = () => {
</Button>
<Button
onClick={() => setEditingItem(item)}
disabled={!me.canWrite(item)}
disabled={!me?.canWrite(item)}
>
Edit
</Button>
<Button
onClick={() => handleDeleteItem(item)}
variant="danger"
disabled={!me.canWrite(item)}
disabled={!me?.canWrite(item)}
>
Delete
</Button>
@@ -209,13 +222,13 @@ const VaultPage: React.FC = () => {
<div className="flex gap-2">
<Button
onClick={() => setIsNewItemModalOpen(true)}
disabled={!selectedFolder || !me.canWrite(selectedFolder)}
disabled={!selectedFolder || !me?.canWrite(selectedFolder)}
>
New Item
</Button>
<Button
onClick={() => setIsInviteModalOpen(true)}
disabled={!selectedFolder || !me.canWrite(selectedFolder)}
disabled={!selectedFolder || !me?.canWrite(selectedFolder)}
>
Share Folder
</Button>

View File

@@ -1,5 +1,74 @@
# jazz-example-pets
## 0.0.225
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.224
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react@0.14.9
## 0.0.223
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react@0.14.8
## 0.0.222
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react@0.14.7
## 0.0.221
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react@0.14.6
## 0.0.220
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.219
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react@0.14.4
## 0.0.218
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react@0.14.2
## 0.0.217
### Patch Changes

View File

@@ -1,6 +1,6 @@
# Rate My Pets example with Jazz and React
Live version: https://pets-demo.jazz.tools/
Live version: [https://pets-demo.jazz.tools/](https://pets-demo.jazz.tools/)
## Getting started

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-pets",
"private": true,
"version": "0.0.217",
"version": "0.0.225",
"type": "module",
"scripts": {
"dev": "vite",
@@ -23,8 +23,8 @@
"jazz-tools": "workspace:*",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-router": "^6.16.0",
"react-router-dom": "^6.16.0",
"tailwind-merge": "^1.14.0",
@@ -35,8 +35,8 @@
"@playwright/test": "^1.50.1",
"@types/node": "^22.5.1",
"@types/qrcode": "^1.5.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",

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