jazz-tools 0.14.27 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.svelte-kit/__package__/Provider.svelte +61 -0
- package/.svelte-kit/__package__/Provider.svelte.d.ts +19 -0
- package/.svelte-kit/__package__/Provider.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PasskeyAuth.svelte.d.ts +11 -0
- package/.svelte-kit/__package__/auth/PasskeyAuth.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PasskeyAuth.svelte.js +20 -0
- package/.svelte-kit/__package__/auth/PasskeyAuthBasicUI.svelte +81 -0
- package/.svelte-kit/__package__/auth/PasskeyAuthBasicUI.svelte.d.ts +9 -0
- package/.svelte-kit/__package__/auth/PasskeyAuthBasicUI.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PassphraseAuth.svelte.d.ts +12 -0
- package/.svelte-kit/__package__/auth/PassphraseAuth.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PassphraseAuth.svelte.js +30 -0
- package/.svelte-kit/__package__/auth/index.d.ts +4 -0
- package/.svelte-kit/__package__/auth/index.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/index.js +3 -0
- package/.svelte-kit/__package__/auth/useIsAuthenticated.svelte.d.ts +6 -0
- package/.svelte-kit/__package__/auth/useIsAuthenticated.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/useIsAuthenticated.svelte.js +22 -0
- package/.svelte-kit/__package__/index.d.ts +6 -0
- package/.svelte-kit/__package__/index.d.ts.map +1 -0
- package/.svelte-kit/__package__/index.js +5 -0
- package/.svelte-kit/__package__/jazz.class.svelte.d.ts +21 -0
- package/.svelte-kit/__package__/jazz.class.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/jazz.class.svelte.js +117 -0
- package/.svelte-kit/__package__/jazz.svelte.d.ts +39 -0
- package/.svelte-kit/__package__/jazz.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/jazz.svelte.js +70 -0
- package/.svelte-kit/__package__/testing.d.ts +10 -0
- package/.svelte-kit/__package__/testing.d.ts.map +1 -0
- package/.svelte-kit/__package__/testing.js +23 -0
- package/.turbo/turbo-build.log +180 -11
- package/CHANGELOG.md +21 -0
- package/README.md +2 -2
- package/dist/browser/BrowserContextManager.d.ts +31 -0
- package/dist/browser/BrowserContextManager.d.ts.map +1 -0
- package/dist/browser/auth/LocalStorageKVStore.d.ts +9 -0
- package/dist/browser/auth/LocalStorageKVStore.d.ts.map +1 -0
- package/dist/browser/auth/PasskeyAuth.d.ts +27 -0
- package/dist/browser/auth/PasskeyAuth.d.ts.map +1 -0
- package/dist/browser/createBrowserContext.d.ts +47 -0
- package/dist/browser/createBrowserContext.d.ts.map +1 -0
- package/dist/browser/index.d.ts +23 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +469 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/storageOptions.d.ts +8 -0
- package/dist/browser/storageOptions.d.ts.map +1 -0
- package/dist/browser/tests/LocalStorageKVStore.test.d.ts +2 -0
- package/dist/browser/tests/LocalStorageKVStore.test.d.ts.map +1 -0
- package/dist/browser/tests/PasskeyAuth.test.d.ts +2 -0
- package/dist/browser/tests/PasskeyAuth.test.d.ts.map +1 -0
- package/dist/browser/tests/createInviteLink.test.d.ts +2 -0
- package/dist/browser/tests/createInviteLink.test.d.ts.map +1 -0
- package/dist/browser/tests/storageOptions.test.d.ts +2 -0
- package/dist/browser/tests/storageOptions.test.d.ts.map +1 -0
- package/dist/browser/tests/utils.d.ts +11 -0
- package/dist/browser/tests/utils.d.ts.map +1 -0
- package/dist/browser/utils/export-account-inspector.d.ts +6 -0
- package/dist/browser/utils/export-account-inspector.d.ts.map +1 -0
- package/dist/browser-media-images/index.d.ts +7 -0
- package/dist/browser-media-images/index.d.ts.map +1 -0
- package/dist/browser-media-images/index.js +70 -0
- package/dist/browser-media-images/index.js.map +1 -0
- package/dist/chunk-FSIM7N33.js +4827 -0
- package/dist/chunk-FSIM7N33.js.map +1 -0
- package/dist/expo/auth/clerk/index.d.ts +7 -0
- package/dist/expo/auth/clerk/index.d.ts.map +1 -0
- package/dist/expo/crypto.d.ts +2 -0
- package/dist/expo/crypto.d.ts.map +1 -0
- package/dist/expo/crypto.js +3 -0
- package/dist/expo/crypto.js.map +1 -0
- package/dist/expo/index.d.ts +6 -0
- package/dist/expo/index.d.ts.map +1 -0
- package/dist/expo/index.js +168 -0
- package/dist/expo/index.js.map +1 -0
- package/dist/expo/provider.d.ts +4 -0
- package/dist/expo/provider.d.ts.map +1 -0
- package/dist/expo/storage/expo-secure-store-adapter.d.ts +8 -0
- package/dist/expo/storage/expo-secure-store-adapter.d.ts.map +1 -0
- package/dist/expo/storage/expo-sqlite-adapter.d.ts +18 -0
- package/dist/expo/storage/expo-sqlite-adapter.d.ts.map +1 -0
- package/dist/expo/testing.d.ts +2 -0
- package/dist/expo/testing.d.ts.map +1 -0
- package/dist/expo/testing.js +3 -0
- package/dist/expo/testing.js.map +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +172 -6
- package/dist/index.js.map +1 -1
- package/dist/inspector/custom-element-CWW72LEG.js +31971 -0
- package/dist/inspector/custom-element-CWW72LEG.js.map +1 -0
- package/dist/inspector/custom-element.d.ts +13 -0
- package/dist/inspector/custom-element.d.ts.map +1 -0
- package/dist/inspector/index.d.ts +12 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +2027 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/inspector/register-custom-element.d.ts +2 -0
- package/dist/inspector/register-custom-element.d.ts.map +1 -0
- package/dist/inspector/register-custom-element.js +5 -0
- package/dist/inspector/register-custom-element.js.map +1 -0
- package/dist/inspector/ui/badge.d.ts +4 -0
- package/dist/inspector/ui/badge.d.ts.map +1 -0
- package/dist/inspector/ui/button.d.ts +9 -0
- package/dist/inspector/ui/button.d.ts.map +1 -0
- package/dist/inspector/ui/card.d.ts +10 -0
- package/dist/inspector/ui/card.d.ts.map +1 -0
- package/dist/inspector/ui/global-styles.d.ts +4 -0
- package/dist/inspector/ui/global-styles.d.ts.map +1 -0
- package/dist/inspector/ui/grid.d.ts +4 -0
- package/dist/inspector/ui/grid.d.ts.map +1 -0
- package/dist/inspector/ui/heading.d.ts +4 -0
- package/dist/inspector/ui/heading.d.ts.map +1 -0
- package/dist/inspector/ui/icon.d.ts +30 -0
- package/dist/inspector/ui/icon.d.ts.map +1 -0
- package/dist/inspector/ui/icons/chevron-down-icon.d.ts +2 -0
- package/dist/inspector/ui/icons/chevron-down-icon.d.ts.map +1 -0
- package/dist/inspector/ui/icons/delete-icon.d.ts +2 -0
- package/dist/inspector/ui/icons/delete-icon.d.ts.map +1 -0
- package/dist/inspector/ui/icons/link-icon.d.ts +2 -0
- package/dist/inspector/ui/icons/link-icon.d.ts.map +1 -0
- package/dist/inspector/ui/input.d.ts +11 -0
- package/dist/inspector/ui/input.d.ts.map +1 -0
- package/dist/inspector/ui/select.d.ts +5 -0
- package/dist/inspector/ui/select.d.ts.map +1 -0
- package/dist/inspector/ui/table.d.ts +8 -0
- package/dist/inspector/ui/table.d.ts.map +1 -0
- package/dist/inspector/ui/text.d.ts +10 -0
- package/dist/inspector/ui/text.d.ts.map +1 -0
- package/dist/inspector/viewer/account-or-group-text.d.ts +8 -0
- package/dist/inspector/viewer/account-or-group-text.d.ts.map +1 -0
- package/dist/inspector/viewer/account-view.d.ts +8 -0
- package/dist/inspector/viewer/account-view.d.ts.map +1 -0
- package/dist/inspector/viewer/breadcrumbs.d.ts +9 -0
- package/dist/inspector/viewer/breadcrumbs.d.ts.map +1 -0
- package/dist/inspector/viewer/co-stream-view.d.ts +18 -0
- package/dist/inspector/viewer/co-stream-view.d.ts.map +1 -0
- package/dist/inspector/viewer/grid-view.d.ts +9 -0
- package/dist/inspector/viewer/grid-view.d.ts.map +1 -0
- package/dist/inspector/viewer/group-view.d.ts +8 -0
- package/dist/inspector/viewer/group-view.d.ts.map +1 -0
- package/dist/inspector/viewer/inpsector-button.d.ts +6 -0
- package/dist/inspector/viewer/inpsector-button.d.ts.map +1 -0
- package/dist/inspector/viewer/new-app.d.ts +11 -0
- package/dist/inspector/viewer/new-app.d.ts.map +1 -0
- package/dist/inspector/viewer/page-stack.d.ts +15 -0
- package/dist/inspector/viewer/page-stack.d.ts.map +1 -0
- package/dist/inspector/viewer/page.d.ts +16 -0
- package/dist/inspector/viewer/page.d.ts.map +1 -0
- package/dist/inspector/viewer/raw-data-card.d.ts +5 -0
- package/dist/inspector/viewer/raw-data-card.d.ts.map +1 -0
- package/dist/inspector/viewer/role-display.d.ts +6 -0
- package/dist/inspector/viewer/role-display.d.ts.map +1 -0
- package/dist/inspector/viewer/table-viewer.d.ts +9 -0
- package/dist/inspector/viewer/table-viewer.d.ts.map +1 -0
- package/dist/inspector/viewer/type-icon.d.ts +11 -0
- package/dist/inspector/viewer/type-icon.d.ts.map +1 -0
- package/dist/inspector/viewer/types.d.ts +7 -0
- package/dist/inspector/viewer/types.d.ts.map +1 -0
- package/dist/inspector/viewer/use-page-path.d.ts +10 -0
- package/dist/inspector/viewer/use-page-path.d.ts.map +1 -0
- package/dist/inspector/viewer/use-resolve-covalue.d.ts +67 -0
- package/dist/inspector/viewer/use-resolve-covalue.d.ts.map +1 -0
- package/dist/inspector/viewer/value-renderer.d.ts +12 -0
- package/dist/inspector/viewer/value-renderer.d.ts.map +1 -0
- package/dist/prosemirror/index.d.ts +3 -0
- package/dist/prosemirror/index.d.ts.map +1 -0
- package/dist/prosemirror/index.js +2185 -0
- package/dist/prosemirror/index.js.map +1 -0
- package/dist/prosemirror/lib/converter.d.ts +33 -0
- package/dist/prosemirror/lib/converter.d.ts.map +1 -0
- package/dist/prosemirror/lib/plugin.d.ts +43 -0
- package/dist/prosemirror/lib/plugin.d.ts.map +1 -0
- package/dist/prosemirror/lib/sync.d.ts +35 -0
- package/dist/prosemirror/lib/sync.d.ts.map +1 -0
- package/dist/prosemirror/tests/plugin.test.d.ts +2 -0
- package/dist/prosemirror/tests/plugin.test.d.ts.map +1 -0
- package/dist/react/auth/Clerk.d.ts +7 -0
- package/dist/react/auth/Clerk.d.ts.map +1 -0
- package/dist/react/auth/DemoAuth.d.ts +5 -0
- package/dist/react/auth/DemoAuth.d.ts.map +1 -0
- package/dist/react/auth/PasskeyAuth.d.ts +24 -0
- package/dist/react/auth/PasskeyAuth.d.ts.map +1 -0
- package/dist/react/auth/PassphraseAuth.d.ts +6 -0
- package/dist/react/auth/PassphraseAuth.d.ts.map +1 -0
- package/dist/react/auth/auth.d.ts +6 -0
- package/dist/react/auth/auth.d.ts.map +1 -0
- package/dist/react/hooks.d.ts +9 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +700 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/media.d.ts +24 -0
- package/dist/react/media.d.ts.map +1 -0
- package/dist/react/provider.d.ts +10 -0
- package/dist/react/provider.d.ts.map +1 -0
- package/dist/react/ssr.d.ts +4 -0
- package/dist/react/ssr.d.ts.map +1 -0
- package/dist/react/ssr.js +25 -0
- package/dist/react/ssr.js.map +1 -0
- package/dist/react/testing.d.ts +2 -0
- package/dist/react/testing.d.ts.map +1 -0
- package/dist/react/testing.js +5 -0
- package/dist/react/testing.js.map +1 -0
- package/dist/react/tests/testUtils.d.ts +14 -0
- package/dist/react/tests/testUtils.d.ts.map +1 -0
- package/dist/react/tests/useAcceptInvite.test.d.ts +2 -0
- package/dist/react/tests/useAcceptInvite.test.d.ts.map +1 -0
- package/dist/react-core/auth/DemoAuth.d.ts +17 -0
- package/dist/react-core/auth/DemoAuth.d.ts.map +1 -0
- package/dist/react-core/auth/PassphraseAuth.d.ts +21 -0
- package/dist/react-core/auth/PassphraseAuth.d.ts.map +1 -0
- package/dist/react-core/auth/index.d.ts +3 -0
- package/dist/react-core/auth/index.d.ts.map +1 -0
- package/dist/react-core/chunk-7DYMJ74I.js +12 -0
- package/dist/react-core/chunk-7DYMJ74I.js.map +1 -0
- package/dist/react-core/hooks.d.ts +17 -0
- package/dist/react-core/hooks.d.ts.map +1 -0
- package/dist/react-core/index.d.ts +4 -0
- package/dist/react-core/index.d.ts.map +1 -0
- package/dist/react-core/index.js +302 -0
- package/dist/react-core/index.js.map +1 -0
- package/dist/react-core/provider.d.ts +5 -0
- package/dist/react-core/provider.d.ts.map +1 -0
- package/dist/react-core/testing.d.ts +10 -0
- package/dist/react-core/testing.d.ts.map +1 -0
- package/dist/react-core/testing.js +43 -0
- package/dist/react-core/testing.js.map +1 -0
- package/dist/react-core/tests/fixtures.d.ts.map +1 -0
- package/dist/react-core/tests/testUtils.d.ts +15 -0
- package/dist/react-core/tests/testUtils.d.ts.map +1 -0
- package/dist/react-core/tests/useAccount.test.d.ts +2 -0
- package/dist/react-core/tests/useAccount.test.d.ts.map +1 -0
- package/dist/react-core/tests/useCoState.test.d.ts +2 -0
- package/dist/react-core/tests/useCoState.test.d.ts.map +1 -0
- package/dist/react-core/tests/useInboxSender.test.d.ts +2 -0
- package/dist/react-core/tests/useInboxSender.test.d.ts.map +1 -0
- package/dist/react-core/tests/useIsAuthenticated.test.d.ts +2 -0
- package/dist/react-core/tests/useIsAuthenticated.test.d.ts.map +1 -0
- package/dist/react-core/tests/usePassPhraseAuth.test.d.ts +2 -0
- package/dist/react-core/tests/usePassPhraseAuth.test.d.ts.map +1 -0
- package/dist/react-core/utils.d.ts +4 -0
- package/dist/react-core/utils.d.ts.map +1 -0
- package/dist/react-native/crypto.d.ts +2 -0
- package/dist/react-native/crypto.d.ts.map +1 -0
- package/dist/react-native/crypto.js +3 -0
- package/dist/react-native/crypto.js.map +1 -0
- package/dist/react-native/index.d.ts +5 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +103 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/provider.d.ts +4 -0
- package/dist/react-native/provider.d.ts.map +1 -0
- package/dist/react-native/storage/mmkv-store-adapter.d.ts +8 -0
- package/dist/react-native/storage/mmkv-store-adapter.d.ts.map +1 -0
- package/dist/react-native/storage/op-sqlite-adapter.d.ts +13 -0
- package/dist/react-native/storage/op-sqlite-adapter.d.ts.map +1 -0
- package/dist/react-native/testing.d.ts +2 -0
- package/dist/react-native/testing.d.ts.map +1 -0
- package/dist/react-native/testing.js +3 -0
- package/dist/react-native/testing.js.map +1 -0
- package/dist/react-native-core/ReactNativeContextManager.d.ts +31 -0
- package/dist/react-native-core/ReactNativeContextManager.d.ts.map +1 -0
- package/dist/react-native-core/auth/DemoAuthUI.d.ts +8 -0
- package/dist/react-native-core/auth/DemoAuthUI.d.ts.map +1 -0
- package/dist/react-native-core/auth/auth.d.ts +3 -0
- package/dist/react-native-core/auth/auth.d.ts.map +1 -0
- package/dist/react-native-core/crypto/RNQuickCrypto.d.ts +15 -0
- package/dist/react-native-core/crypto/RNQuickCrypto.d.ts.map +1 -0
- package/dist/react-native-core/crypto/index.d.ts +2 -0
- package/dist/react-native-core/crypto/index.d.ts.map +1 -0
- package/dist/react-native-core/crypto.js +65 -0
- package/dist/react-native-core/crypto.js.map +1 -0
- package/dist/react-native-core/hooks.d.ts +8 -0
- package/dist/react-native-core/hooks.d.ts.map +1 -0
- package/dist/react-native-core/index.d.ts +9 -0
- package/dist/react-native-core/index.d.ts.map +1 -0
- package/dist/react-native-core/index.js +669 -0
- package/dist/react-native-core/index.js.map +1 -0
- package/dist/react-native-core/media.d.ts +24 -0
- package/dist/react-native-core/media.d.ts.map +1 -0
- package/dist/react-native-core/platform.d.ts +45 -0
- package/dist/react-native-core/platform.d.ts.map +1 -0
- package/dist/react-native-core/provider.d.ts +10 -0
- package/dist/react-native-core/provider.d.ts.map +1 -0
- package/dist/react-native-core/storage/kv-store-context.d.ts +17 -0
- package/dist/react-native-core/storage/kv-store-context.d.ts.map +1 -0
- package/dist/react-native-core/storage/sqlite-react-native.d.ts +9 -0
- package/dist/react-native-core/storage/sqlite-react-native.d.ts.map +1 -0
- package/dist/react-native-core/testing.js +3 -0
- package/dist/react-native-core/testing.js.map +1 -0
- package/dist/react-native-media-images/index.d.ts +7 -0
- package/dist/react-native-media-images/index.d.ts.map +1 -0
- package/dist/react-native-media-images/index.js +177 -0
- package/dist/react-native-media-images/index.js.map +1 -0
- package/dist/svelte/Provider.svelte +61 -0
- package/dist/svelte/Provider.svelte.d.ts +19 -0
- package/dist/svelte/Provider.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PasskeyAuth.svelte.d.ts +11 -0
- package/dist/svelte/auth/PasskeyAuth.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PasskeyAuth.svelte.js +20 -0
- package/dist/svelte/auth/PasskeyAuthBasicUI.svelte +81 -0
- package/dist/svelte/auth/PasskeyAuthBasicUI.svelte.d.ts +9 -0
- package/dist/svelte/auth/PasskeyAuthBasicUI.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PassphraseAuth.svelte.d.ts +12 -0
- package/dist/svelte/auth/PassphraseAuth.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PassphraseAuth.svelte.js +30 -0
- package/dist/svelte/auth/index.d.ts +4 -0
- package/dist/svelte/auth/index.d.ts.map +1 -0
- package/dist/svelte/auth/index.js +3 -0
- package/dist/svelte/auth/useIsAuthenticated.svelte.d.ts +6 -0
- package/dist/svelte/auth/useIsAuthenticated.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/useIsAuthenticated.svelte.js +22 -0
- package/dist/svelte/index.d.ts +6 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +5 -0
- package/dist/svelte/jazz.class.svelte.d.ts +21 -0
- package/dist/svelte/jazz.class.svelte.d.ts.map +1 -0
- package/dist/svelte/jazz.class.svelte.js +117 -0
- package/dist/svelte/jazz.svelte.d.ts +39 -0
- package/dist/svelte/jazz.svelte.d.ts.map +1 -0
- package/dist/svelte/jazz.svelte.js +70 -0
- package/dist/svelte/testing.d.ts +10 -0
- package/dist/svelte/testing.d.ts.map +1 -0
- package/dist/svelte/testing.js +23 -0
- package/dist/testing.d.ts +1 -42
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +2 -2
- package/dist/testing.js.map +1 -1
- package/dist/tiptap/index.d.ts +11 -0
- package/dist/tiptap/index.d.ts.map +1 -0
- package/dist/tiptap/index.js +22 -0
- package/dist/tiptap/index.js.map +1 -0
- package/dist/tools/auth/AuthSecretStorage.d.ts.map +1 -0
- package/dist/tools/auth/DemoAuth.d.ts.map +1 -0
- package/dist/tools/auth/InMemoryKVStore.d.ts.map +1 -0
- package/dist/tools/auth/KvStoreContext.d.ts.map +1 -0
- package/dist/tools/auth/PassphraseAuth.d.ts.map +1 -0
- package/dist/tools/auth/clerk/getClerkUsername.d.ts +3 -0
- package/dist/tools/auth/clerk/getClerkUsername.d.ts.map +1 -0
- package/dist/tools/auth/clerk/index.d.ts +25 -0
- package/dist/tools/auth/clerk/index.d.ts.map +1 -0
- package/dist/tools/auth/clerk/tests/JazzClerkAuth.test.d.ts +2 -0
- package/dist/tools/auth/clerk/tests/JazzClerkAuth.test.d.ts.map +1 -0
- package/dist/tools/auth/clerk/tests/getClerkUsername.test.d.ts +2 -0
- package/dist/tools/auth/clerk/tests/getClerkUsername.test.d.ts.map +1 -0
- package/dist/tools/auth/clerk/tests/types.test.d.ts +2 -0
- package/dist/tools/auth/clerk/tests/types.test.d.ts.map +1 -0
- package/dist/tools/auth/clerk/types.d.ts +32 -0
- package/dist/tools/auth/clerk/types.d.ts.map +1 -0
- package/dist/tools/coValues/CoValueBase.d.ts.map +1 -0
- package/dist/tools/coValues/account.d.ts.map +1 -0
- package/dist/tools/coValues/coFeed.d.ts +368 -0
- package/dist/tools/coValues/coFeed.d.ts.map +1 -0
- package/dist/tools/coValues/coList.d.ts.map +1 -0
- package/dist/tools/coValues/coMap.d.ts.map +1 -0
- package/dist/tools/coValues/coPlainText.d.ts.map +1 -0
- package/dist/tools/coValues/coRichText.d.ts.map +1 -0
- package/dist/tools/coValues/deepLoading.d.ts.map +1 -0
- package/dist/tools/coValues/extensions/imageDef.d.ts.map +1 -0
- package/dist/tools/coValues/group.d.ts.map +1 -0
- package/dist/tools/coValues/inbox.d.ts.map +1 -0
- package/dist/tools/coValues/interfaces.d.ts.map +1 -0
- package/dist/tools/coValues/profile.d.ts.map +1 -0
- package/dist/tools/coValues/registeredSchemas.d.ts.map +1 -0
- package/dist/tools/coValues/schemaUnion.d.ts.map +1 -0
- package/dist/tools/exports.d.ts +24 -0
- package/dist/tools/exports.d.ts.map +1 -0
- package/dist/tools/implementation/ContextManager.d.ts.map +1 -0
- package/dist/tools/implementation/activeAccountContext.d.ts.map +1 -0
- package/dist/tools/implementation/anonymousJazzAgent.d.ts.map +1 -0
- package/dist/tools/implementation/createContext.d.ts.map +1 -0
- package/dist/tools/implementation/devtoolsFormatters.d.ts.map +1 -0
- package/dist/tools/implementation/errors.d.ts.map +1 -0
- package/dist/tools/implementation/inspect.d.ts.map +1 -0
- package/dist/tools/implementation/invites.d.ts.map +1 -0
- package/dist/tools/implementation/refs.d.ts.map +1 -0
- package/dist/tools/implementation/schema.d.ts.map +1 -0
- package/dist/tools/implementation/symbols.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/coExport.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/unionUtils.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/zodCo.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/zodReExport.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/zodSchema.d.ts.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/internal.d.ts.map +1 -0
- package/dist/tools/lib/cache.d.ts.map +1 -0
- package/dist/tools/lib/cache.test.d.ts.map +1 -0
- package/dist/tools/lib/migration.d.ts.map +1 -0
- package/dist/tools/subscribe/CoValueCoreSubscription.d.ts.map +1 -0
- package/dist/tools/subscribe/JazzError.d.ts.map +1 -0
- package/dist/tools/subscribe/SubscriptionScope.d.ts.map +1 -0
- package/dist/tools/subscribe/index.d.ts.map +1 -0
- package/dist/tools/subscribe/types.d.ts.map +1 -0
- package/dist/tools/subscribe/utils.d.ts.map +1 -0
- package/dist/tools/testing.d.ts +43 -0
- package/dist/tools/testing.d.ts.map +1 -0
- package/dist/tools/tests/AuthSecretStorage.test.d.ts.map +1 -0
- package/dist/tools/tests/ContextManager.test.d.ts.map +1 -0
- package/dist/tools/tests/DemoAuth.test.d.ts.map +1 -0
- package/dist/tools/tests/PassphraseAuth.test.d.ts.map +1 -0
- package/dist/tools/tests/account.test.d.ts.map +1 -0
- package/dist/tools/tests/coFeed.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coFeed.test.d.ts.map +1 -0
- package/dist/tools/tests/coList.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coList.test.d.ts.map +1 -0
- package/dist/tools/tests/coMap.record.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coMap.record.test.d.ts.map +1 -0
- package/dist/tools/tests/coMap.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coMap.test.d.ts.map +1 -0
- package/dist/tools/tests/coPlainText.test.d.ts.map +1 -0
- package/dist/tools/tests/createContext.test.d.ts.map +1 -0
- package/dist/tools/tests/deepLoading.test.d.ts.map +1 -0
- package/dist/tools/tests/fixtures.d.ts +2 -0
- package/dist/tools/tests/fixtures.d.ts.map +1 -0
- package/dist/tools/tests/groupsAndAccounts.test.d.ts.map +1 -0
- package/dist/tools/tests/imageDef.test.d.ts.map +1 -0
- package/dist/tools/tests/inbox.test.d.ts.map +1 -0
- package/dist/tools/tests/interfaces.test.d.ts.map +1 -0
- package/dist/tools/tests/invites.test.d.ts.map +1 -0
- package/dist/tools/tests/load.test.d.ts.map +1 -0
- package/dist/tools/tests/patterns/notifications.test.d.ts.map +1 -0
- package/dist/tools/tests/patterns/requestToJoin.test.d.ts.map +1 -0
- package/dist/tools/tests/schema.test.d.ts.map +1 -0
- package/dist/tools/tests/schemaUnion.test.d.ts.map +1 -0
- package/dist/tools/tests/subscribe.test.d.ts.map +1 -0
- package/dist/tools/tests/testing.test.d.ts.map +1 -0
- package/dist/tools/tests/utils.d.ts.map +1 -0
- package/dist/tools/tests/zod.test.d.ts.map +1 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/worker/index.d.ts +25 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +93 -0
- package/dist/worker/index.js.map +1 -0
- package/package.json +193 -11
- package/src/browser/BrowserContextManager.ts +85 -0
- package/src/browser/auth/LocalStorageKVStore.ts +21 -0
- package/src/browser/auth/PasskeyAuth.ts +175 -0
- package/src/browser/createBrowserContext.ts +326 -0
- package/src/browser/index.ts +72 -0
- package/src/browser/storageOptions.ts +17 -0
- package/src/browser/tests/LocalStorageKVStore.test.ts +67 -0
- package/src/browser/tests/PasskeyAuth.test.ts +242 -0
- package/src/browser/tests/createInviteLink.test.ts +18 -0
- package/src/browser/tests/storageOptions.test.ts +33 -0
- package/src/browser/tests/utils.ts +93 -0
- package/src/browser/utils/export-account-inspector.ts +58 -0
- package/src/browser-media-images/index.ts +130 -0
- package/src/expo/auth/clerk/README.md +44 -0
- package/src/expo/auth/clerk/index.tsx +80 -0
- package/src/expo/crypto.ts +1 -0
- package/src/expo/index.ts +6 -0
- package/src/expo/provider.tsx +29 -0
- package/src/expo/storage/expo-secure-store-adapter.ts +29 -0
- package/src/expo/storage/expo-sqlite-adapter.ts +94 -0
- package/src/expo/testing.ts +1 -0
- package/src/index.ts +1 -3
- package/src/inspector/custom-element.tsx +63 -0
- package/src/inspector/index.ts +23 -0
- package/src/inspector/register-custom-element.ts +3 -0
- package/src/inspector/ui/badge.tsx +20 -0
- package/src/inspector/ui/button.tsx +81 -0
- package/src/inspector/ui/card.tsx +23 -0
- package/src/inspector/ui/global-styles.tsx +74 -0
- package/src/inspector/ui/grid.tsx +48 -0
- package/src/inspector/ui/heading.tsx +15 -0
- package/src/inspector/ui/icon.tsx +71 -0
- package/src/inspector/ui/icons/chevron-down-icon.tsx +16 -0
- package/src/inspector/ui/icons/delete-icon.tsx +19 -0
- package/src/inspector/ui/icons/link-icon.tsx +18 -0
- package/src/inspector/ui/input.tsx +51 -0
- package/src/inspector/ui/select.tsx +73 -0
- package/src/inspector/ui/table.tsx +90 -0
- package/src/inspector/ui/text.tsx +62 -0
- package/src/inspector/viewer/account-or-group-text.tsx +52 -0
- package/src/inspector/viewer/account-view.tsx +34 -0
- package/src/inspector/viewer/breadcrumbs.tsx +52 -0
- package/src/inspector/viewer/co-stream-view.tsx +374 -0
- package/src/inspector/viewer/grid-view.tsx +90 -0
- package/src/inspector/viewer/group-view.tsx +67 -0
- package/src/inspector/viewer/inpsector-button.tsx +89 -0
- package/src/inspector/viewer/new-app.tsx +171 -0
- package/src/inspector/viewer/page-stack.tsx +56 -0
- package/src/inspector/viewer/page.tsx +199 -0
- package/src/inspector/viewer/raw-data-card.tsx +53 -0
- package/src/inspector/viewer/role-display.tsx +28 -0
- package/src/inspector/viewer/table-viewer.tsx +184 -0
- package/src/inspector/viewer/type-icon.tsx +63 -0
- package/src/inspector/viewer/types.ts +11 -0
- package/src/inspector/viewer/use-page-path.ts +52 -0
- package/src/inspector/viewer/use-resolve-covalue.ts +214 -0
- package/src/inspector/viewer/value-renderer.tsx +266 -0
- package/src/prosemirror/index.ts +2 -0
- package/src/prosemirror/lib/converter.ts +50 -0
- package/src/prosemirror/lib/plugin.ts +120 -0
- package/src/prosemirror/lib/sync.ts +96 -0
- package/src/prosemirror/tests/plugin.test.ts +127 -0
- package/src/react/auth/Clerk.tsx +82 -0
- package/src/react/auth/DemoAuth.tsx +121 -0
- package/src/react/auth/PasskeyAuth.tsx +168 -0
- package/src/react/auth/PassphraseAuth.tsx +196 -0
- package/src/react/auth/auth.ts +9 -0
- package/src/react/hooks.tsx +53 -0
- package/src/react/index.ts +16 -0
- package/src/react/media.tsx +74 -0
- package/src/react/provider.tsx +114 -0
- package/src/react/scratch.tsx +50 -0
- package/src/react/ssr.ts +25 -0
- package/src/react/testing.tsx +1 -0
- package/src/react/tests/testUtils.tsx +54 -0
- package/src/react/tests/useAcceptInvite.test.ts +55 -0
- package/src/react-core/auth/DemoAuth.tsx +47 -0
- package/src/react-core/auth/PassphraseAuth.tsx +58 -0
- package/src/react-core/auth/index.ts +2 -0
- package/src/react-core/hooks.ts +310 -0
- package/src/react-core/index.ts +3 -0
- package/src/react-core/provider.tsx +11 -0
- package/src/react-core/testing.tsx +42 -0
- package/src/react-core/tests/testUtils.tsx +65 -0
- package/src/react-core/tests/useAccount.test.ts +238 -0
- package/src/react-core/tests/useCoState.test.ts +553 -0
- package/src/react-core/tests/useDemoAuth.test.tsx +84 -0
- package/src/react-core/tests/useInboxSender.test.ts +58 -0
- package/src/react-core/tests/useIsAuthenticated.test.ts +34 -0
- package/src/react-core/tests/usePassPhraseAuth.test.ts +180 -0
- package/src/react-core/utils.ts +28 -0
- package/src/react-native/crypto.ts +1 -0
- package/src/react-native/index.ts +5 -0
- package/src/react-native/provider.tsx +30 -0
- package/src/react-native/storage/mmkv-store-adapter.ts +24 -0
- package/src/react-native/storage/op-sqlite-adapter.ts +79 -0
- package/src/react-native/testing.ts +1 -0
- package/src/react-native-core/ReactNativeContextManager.ts +84 -0
- package/src/react-native-core/auth/DemoAuthUI.tsx +202 -0
- package/src/react-native-core/auth/auth.ts +14 -0
- package/src/react-native-core/crypto/RNQuickCrypto.ts +92 -0
- package/src/react-native-core/crypto/index.ts +1 -0
- package/src/react-native-core/hooks.tsx +64 -0
- package/src/react-native-core/index.ts +9 -0
- package/src/react-native-core/media.tsx +99 -0
- package/src/react-native-core/platform.ts +250 -0
- package/src/react-native-core/provider.tsx +115 -0
- package/src/react-native-core/storage/sqlite-react-native.ts +19 -0
- package/src/react-native-core/testing.tsx +1 -0
- package/src/react-native-media-images/index.ts +238 -0
- package/src/svelte/Provider.svelte +61 -0
- package/src/svelte/auth/PasskeyAuth.svelte.ts +42 -0
- package/src/svelte/auth/PasskeyAuthBasicUI.svelte +81 -0
- package/src/svelte/auth/PassphraseAuth.svelte.ts +49 -0
- package/src/svelte/auth/index.ts +3 -0
- package/src/svelte/auth/useIsAuthenticated.svelte.ts +28 -0
- package/src/svelte/index.ts +5 -0
- package/src/svelte/jazz.class.svelte.ts +172 -0
- package/src/svelte/jazz.svelte.ts +109 -0
- package/src/svelte/testing.ts +42 -0
- package/src/testing.ts +1 -312
- package/src/tiptap/index.ts +28 -0
- package/src/tools/auth/KvStoreContext.ts +39 -0
- package/src/tools/auth/clerk/getClerkUsername.ts +36 -0
- package/src/tools/auth/clerk/index.ts +174 -0
- package/src/tools/auth/clerk/tests/JazzClerkAuth.test.ts +284 -0
- package/src/tools/auth/clerk/tests/getClerkUsername.test.ts +81 -0
- package/src/tools/auth/clerk/tests/types.test.ts +49 -0
- package/src/tools/auth/clerk/types.ts +56 -0
- package/src/tools/coValues/coFeed.ts +943 -0
- package/src/tools/exports.ts +117 -0
- package/src/tools/index.ts +8 -0
- package/src/tools/testing.ts +301 -0
- package/src/tools/tests/coFeed.test.ts +771 -0
- package/src/tools/tests/fixtures.ts +2050 -0
- package/src/worker/index.ts +127 -0
- package/tsconfig.json +10 -3
- package/tsconfig.svelte.json +6 -0
- package/tsup.config.ts +143 -9
- package/dist/auth/AuthSecretStorage.d.ts.map +0 -1
- package/dist/auth/DemoAuth.d.ts.map +0 -1
- package/dist/auth/InMemoryKVStore.d.ts.map +0 -1
- package/dist/auth/KvStoreContext.d.ts.map +0 -1
- package/dist/auth/PassphraseAuth.d.ts.map +0 -1
- package/dist/chunk-G3QC4FAY.js +0 -4826
- package/dist/chunk-G3QC4FAY.js.map +0 -1
- package/dist/coValues/CoValueBase.d.ts.map +0 -1
- package/dist/coValues/account.d.ts.map +0 -1
- package/dist/coValues/coFeed.d.ts +0 -367
- package/dist/coValues/coFeed.d.ts.map +0 -1
- package/dist/coValues/coList.d.ts.map +0 -1
- package/dist/coValues/coMap.d.ts.map +0 -1
- package/dist/coValues/coPlainText.d.ts.map +0 -1
- package/dist/coValues/coRichText.d.ts.map +0 -1
- package/dist/coValues/deepLoading.d.ts.map +0 -1
- package/dist/coValues/extensions/imageDef.d.ts.map +0 -1
- package/dist/coValues/group.d.ts.map +0 -1
- package/dist/coValues/inbox.d.ts.map +0 -1
- package/dist/coValues/interfaces.d.ts.map +0 -1
- package/dist/coValues/profile.d.ts.map +0 -1
- package/dist/coValues/registeredSchemas.d.ts.map +0 -1
- package/dist/coValues/schemaUnion.d.ts.map +0 -1
- package/dist/exports.d.ts +0 -23
- package/dist/exports.d.ts.map +0 -1
- package/dist/implementation/ContextManager.d.ts.map +0 -1
- package/dist/implementation/activeAccountContext.d.ts.map +0 -1
- package/dist/implementation/anonymousJazzAgent.d.ts.map +0 -1
- package/dist/implementation/createContext.d.ts.map +0 -1
- package/dist/implementation/devtoolsFormatters.d.ts.map +0 -1
- package/dist/implementation/errors.d.ts.map +0 -1
- package/dist/implementation/inspect.d.ts.map +0 -1
- package/dist/implementation/invites.d.ts.map +0 -1
- package/dist/implementation/refs.d.ts.map +0 -1
- package/dist/implementation/schema.d.ts.map +0 -1
- package/dist/implementation/symbols.d.ts.map +0 -1
- package/dist/implementation/zodSchema/coExport.d.ts.map +0 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +0 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts.map +0 -1
- package/dist/implementation/zodSchema/unionUtils.d.ts.map +0 -1
- package/dist/implementation/zodSchema/zodCo.d.ts.map +0 -1
- package/dist/implementation/zodSchema/zodReExport.d.ts.map +0 -1
- package/dist/implementation/zodSchema/zodSchema.d.ts.map +0 -1
- package/dist/internal.d.ts.map +0 -1
- package/dist/lib/cache.d.ts.map +0 -1
- package/dist/lib/cache.test.d.ts.map +0 -1
- package/dist/lib/migration.d.ts.map +0 -1
- package/dist/subscribe/CoValueCoreSubscription.d.ts.map +0 -1
- package/dist/subscribe/JazzError.d.ts.map +0 -1
- package/dist/subscribe/SubscriptionScope.d.ts.map +0 -1
- package/dist/subscribe/index.d.ts.map +0 -1
- package/dist/subscribe/types.d.ts.map +0 -1
- package/dist/subscribe/utils.d.ts.map +0 -1
- package/dist/tests/AuthSecretStorage.test.d.ts.map +0 -1
- package/dist/tests/ContextManager.test.d.ts.map +0 -1
- package/dist/tests/DemoAuth.test.d.ts.map +0 -1
- package/dist/tests/PassphraseAuth.test.d.ts.map +0 -1
- package/dist/tests/account.test.d.ts.map +0 -1
- package/dist/tests/coFeed.test-d.d.ts.map +0 -1
- package/dist/tests/coFeed.test.d.ts.map +0 -1
- package/dist/tests/coList.test-d.d.ts.map +0 -1
- package/dist/tests/coList.test.d.ts.map +0 -1
- package/dist/tests/coMap.record.test-d.d.ts.map +0 -1
- package/dist/tests/coMap.record.test.d.ts.map +0 -1
- package/dist/tests/coMap.test-d.d.ts.map +0 -1
- package/dist/tests/coMap.test.d.ts.map +0 -1
- package/dist/tests/coPlainText.test.d.ts.map +0 -1
- package/dist/tests/createContext.test.d.ts.map +0 -1
- package/dist/tests/deepLoading.test.d.ts.map +0 -1
- package/dist/tests/fixtures.d.ts.map +0 -1
- package/dist/tests/groupsAndAccounts.test.d.ts.map +0 -1
- package/dist/tests/imageDef.test.d.ts.map +0 -1
- package/dist/tests/inbox.test.d.ts.map +0 -1
- package/dist/tests/interfaces.test.d.ts.map +0 -1
- package/dist/tests/invites.test.d.ts.map +0 -1
- package/dist/tests/load.test.d.ts.map +0 -1
- package/dist/tests/patterns/notifications.test.d.ts.map +0 -1
- package/dist/tests/patterns/requestToJoin.test.d.ts.map +0 -1
- package/dist/tests/schema.test.d.ts.map +0 -1
- package/dist/tests/schemaUnion.test.d.ts.map +0 -1
- package/dist/tests/subscribe.test.d.ts.map +0 -1
- package/dist/tests/testing.test.d.ts.map +0 -1
- package/dist/tests/utils.d.ts.map +0 -1
- package/dist/tests/zod.test.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/src/coValues/coFeed.ts +0 -938
- package/src/exports.ts +0 -108
- package/src/tests/coFeed.test.ts +0 -722
- /package/dist/{tests → react-core/tests}/fixtures.d.ts +0 -0
- /package/dist/{auth → tools/auth}/AuthSecretStorage.d.ts +0 -0
- /package/dist/{auth → tools/auth}/DemoAuth.d.ts +0 -0
- /package/dist/{auth → tools/auth}/InMemoryKVStore.d.ts +0 -0
- /package/dist/{auth → tools/auth}/KvStoreContext.d.ts +0 -0
- /package/dist/{auth → tools/auth}/PassphraseAuth.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/CoValueBase.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/account.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coList.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coMap.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coPlainText.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coRichText.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/deepLoading.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/extensions/imageDef.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/group.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/inbox.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/interfaces.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/profile.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/registeredSchemas.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/schemaUnion.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/ContextManager.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/activeAccountContext.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/anonymousJazzAgent.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/createContext.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/devtoolsFormatters.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/errors.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/inspect.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/invites.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/refs.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/schema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/symbols.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/coExport.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/AccountSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoFeedSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoListSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoMapSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoRecordSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/FileStreamSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/PlainTextSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/RichTextSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/unionUtils.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/zodCo.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/zodReExport.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/zodSchema.d.ts +0 -0
- /package/dist/{internal.d.ts → tools/internal.d.ts} +0 -0
- /package/dist/{lib → tools/lib}/cache.d.ts +0 -0
- /package/dist/{lib → tools/lib}/cache.test.d.ts +0 -0
- /package/dist/{lib → tools/lib}/migration.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/CoValueCoreSubscription.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/JazzError.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/SubscriptionScope.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/index.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/types.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/utils.d.ts +0 -0
- /package/dist/{tests → tools/tests}/AuthSecretStorage.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/ContextManager.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/DemoAuth.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/PassphraseAuth.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/account.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coFeed.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coFeed.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coList.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coList.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.record.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.record.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coPlainText.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/createContext.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/deepLoading.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/groupsAndAccounts.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/imageDef.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/inbox.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/interfaces.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/invites.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/load.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/patterns/notifications.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/patterns/requestToJoin.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/schema.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/schemaUnion.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/subscribe.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/testing.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/utils.d.ts +0 -0
- /package/dist/{tests → tools/tests}/zod.test.d.ts +0 -0
- /package/dist/{types.d.ts → tools/types.d.ts} +0 -0
- /package/src/{tests → react-core/tests}/fixtures.ts +0 -0
- /package/src/{auth/KvStoreContext.ts → react-native-core/storage/kv-store-context.ts} +0 -0
- /package/src/{auth → tools/auth}/AuthSecretStorage.ts +0 -0
- /package/src/{auth → tools/auth}/DemoAuth.ts +0 -0
- /package/src/{auth → tools/auth}/InMemoryKVStore.ts +0 -0
- /package/src/{auth → tools/auth}/PassphraseAuth.ts +0 -0
- /package/src/{coValues → tools/coValues}/CoValueBase.ts +0 -0
- /package/src/{coValues → tools/coValues}/account.ts +0 -0
- /package/src/{coValues → tools/coValues}/coList.ts +0 -0
- /package/src/{coValues → tools/coValues}/coMap.ts +0 -0
- /package/src/{coValues → tools/coValues}/coPlainText.ts +0 -0
- /package/src/{coValues → tools/coValues}/coRichText.ts +0 -0
- /package/src/{coValues → tools/coValues}/deepLoading.ts +0 -0
- /package/src/{coValues → tools/coValues}/extensions/imageDef.ts +0 -0
- /package/src/{coValues → tools/coValues}/group.ts +0 -0
- /package/src/{coValues → tools/coValues}/inbox.ts +0 -0
- /package/src/{coValues → tools/coValues}/interfaces.ts +0 -0
- /package/src/{coValues → tools/coValues}/profile.ts +0 -0
- /package/src/{coValues → tools/coValues}/registeredSchemas.ts +0 -0
- /package/src/{coValues → tools/coValues}/schemaUnion.ts +0 -0
- /package/src/{implementation → tools/implementation}/ContextManager.ts +0 -0
- /package/src/{implementation → tools/implementation}/activeAccountContext.ts +0 -0
- /package/src/{implementation → tools/implementation}/anonymousJazzAgent.ts +0 -0
- /package/src/{implementation → tools/implementation}/createContext.ts +0 -0
- /package/src/{implementation → tools/implementation}/devtoolsFormatters.ts +0 -0
- /package/src/{implementation → tools/implementation}/errors.ts +0 -0
- /package/src/{implementation → tools/implementation}/inspect.ts +0 -0
- /package/src/{implementation → tools/implementation}/invites.ts +0 -0
- /package/src/{implementation → tools/implementation}/refs.ts +0 -0
- /package/src/{implementation → tools/implementation}/schema.ts +0 -0
- /package/src/{implementation → tools/implementation}/symbols.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/coExport.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodFieldToCoFieldDef.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodSchemaToCoSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/AccountSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoFeedSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoListSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoMapSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoRecordSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/FileStreamSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/PlainTextSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/RichTextSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/unionUtils.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/zodCo.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/zodReExport.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/zodSchema.ts +0 -0
- /package/src/{internal.ts → tools/internal.ts} +0 -0
- /package/src/{lib → tools/lib}/cache.test.ts +0 -0
- /package/src/{lib → tools/lib}/cache.ts +0 -0
- /package/src/{lib → tools/lib}/migration.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/CoValueCoreSubscription.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/JazzError.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/SubscriptionScope.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/index.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/types.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/utils.ts +0 -0
- /package/src/{tests → tools/tests}/AuthSecretStorage.test.ts +0 -0
- /package/src/{tests → tools/tests}/ContextManager.test.ts +0 -0
- /package/src/{tests → tools/tests}/DemoAuth.test.ts +0 -0
- /package/src/{tests → tools/tests}/PassphraseAuth.test.ts +0 -0
- /package/src/{tests → tools/tests}/account.test.ts +0 -0
- /package/src/{tests → tools/tests}/coFeed.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coList.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coList.test.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.record.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.record.test.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.test.ts +0 -0
- /package/src/{tests → tools/tests}/coPlainText.test.ts +0 -0
- /package/src/{tests → tools/tests}/createContext.test.ts +0 -0
- /package/src/{tests → tools/tests}/deepLoading.test.ts +0 -0
- /package/src/{tests → tools/tests}/groupsAndAccounts.test.ts +0 -0
- /package/src/{tests → tools/tests}/imageDef.test.ts +0 -0
- /package/src/{tests → tools/tests}/inbox.test.ts +0 -0
- /package/src/{tests → tools/tests}/interfaces.test.ts +0 -0
- /package/src/{tests → tools/tests}/invites.test.ts +0 -0
- /package/src/{tests → tools/tests}/load.test.ts +0 -0
- /package/src/{tests → tools/tests}/patterns/notifications.test.ts +0 -0
- /package/src/{tests → tools/tests}/patterns/requestToJoin.test.ts +0 -0
- /package/src/{tests → tools/tests}/schema.test.ts +0 -0
- /package/src/{tests → tools/tests}/schemaUnion.test.ts +0 -0
- /package/src/{tests → tools/tests}/subscribe.test.ts +0 -0
- /package/src/{tests → tools/tests}/testing.test.ts +0 -0
- /package/src/{tests → tools/tests}/utils.ts +0 -0
- /package/src/{tests → tools/tests}/zod.test.ts +0 -0
- /package/src/{types.ts → tools/types.ts} +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/react/provider.tsx","../../src/react/hooks.tsx","../../src/react/index.ts","../../src/react/auth/Clerk.tsx","../../src/react/auth/DemoAuth.tsx","../../src/react/auth/PasskeyAuth.tsx","../../src/react/auth/PassphraseAuth.tsx","../../src/react/auth/auth.ts","../../src/react/media.tsx"],"sourcesContent":["import {\n Account,\n AccountClass,\n AnyAccountSchema,\n CoValueFromRaw,\n InstanceOfSchema,\n JazzContextType,\n} from \"jazz-tools\";\nimport {\n JazzBrowserContextManager,\n JazzContextManagerProps,\n} from \"jazz-tools/browser\";\nimport { JazzContext, JazzContextManagerContext } from \"jazz-tools/react-core\";\nimport React, { useEffect, useRef } from \"react\";\n\nexport type JazzProviderProps<\n S extends\n | (AccountClass<Account> & CoValueFromRaw<Account>)\n | AnyAccountSchema,\n> = {\n children: React.ReactNode;\n enableSSR?: boolean;\n} & JazzContextManagerProps<S>;\n\n/** @category Context & Hooks */\nexport function JazzReactProvider<\n S extends\n | (AccountClass<Account> & CoValueFromRaw<Account>)\n | AnyAccountSchema,\n>({\n children,\n guestMode,\n sync,\n storage,\n AccountSchema,\n defaultProfileName,\n onLogOut,\n logOutReplacement,\n onAnonymousAccountDiscarded,\n enableSSR,\n}: JazzProviderProps<S>) {\n const [contextManager] = React.useState(\n () =>\n new JazzBrowserContextManager<S>({\n useAnonymousFallback: enableSSR,\n }),\n );\n\n const onLogOutRefCallback = useRefCallback(onLogOut);\n const logOutReplacementRefCallback = useRefCallback(logOutReplacement);\n const onAnonymousAccountDiscardedRefCallback = useRefCallback(\n onAnonymousAccountDiscarded,\n );\n const logoutReplacementActiveRef = useRef(false);\n logoutReplacementActiveRef.current = Boolean(logOutReplacement);\n\n const value = React.useSyncExternalStore<\n JazzContextType<InstanceOfSchema<S>> | undefined\n >(\n React.useCallback(\n (callback) => {\n const props = {\n AccountSchema,\n guestMode,\n sync,\n storage,\n defaultProfileName,\n onLogOut: onLogOutRefCallback,\n logOutReplacement: logoutReplacementActiveRef.current\n ? logOutReplacementRefCallback\n : undefined,\n onAnonymousAccountDiscarded: onAnonymousAccountDiscardedRefCallback,\n } satisfies JazzContextManagerProps<S>;\n\n if (contextManager.propsChanged(props)) {\n contextManager.createContext(props).catch((error) => {\n console.error(\"Error creating Jazz browser context:\", error);\n });\n }\n\n return contextManager.subscribe(callback);\n },\n [sync, guestMode].concat(storage as any),\n ),\n () => contextManager.getCurrentValue(),\n () => contextManager.getCurrentValue(),\n );\n\n useEffect(() => {\n // In development mode we don't return a cleanup function because otherwise\n // the double effect execution would mark the context as done immediately.\n if (process.env.NODE_ENV === \"development\") return;\n\n return () => {\n contextManager.done();\n };\n }, []);\n\n return (\n <JazzContext.Provider value={value}>\n <JazzContextManagerContext.Provider value={contextManager}>\n {value && children}\n </JazzContextManagerContext.Provider>\n </JazzContext.Provider>\n );\n}\n\nfunction useRefCallback<T extends (...args: any[]) => any>(callback?: T) {\n const callbackRef = React.useRef(callback);\n callbackRef.current = callback;\n return useRef(\n (...args: Parameters<T>): ReturnType<T> => callbackRef.current?.(...args),\n ).current;\n}\n","import { consumeInviteLinkFromWindowLocation } from \"jazz-tools/browser\";\nimport { useEffect } from \"react\";\n\nimport { CoValueOrZodSchema } from \"jazz-tools\";\nimport { useJazzContext } from \"jazz-tools/react-core\";\n\nexport { useCoState, useAuthSecretStorage } from \"jazz-tools/react-core\";\n\nexport function useAcceptInvite<S extends CoValueOrZodSchema>({\n invitedObjectSchema,\n onAccept,\n forValueHint,\n}: {\n invitedObjectSchema: S;\n onAccept: (valueID: string) => void;\n forValueHint?: string;\n}): void {\n const context = useJazzContext();\n\n if (!(\"me\" in context)) {\n throw new Error(\n \"useAcceptInvite can't be used in a JazzProvider with auth === 'guest'.\",\n );\n }\n\n useEffect(() => {\n const handleInvite = () => {\n const result = consumeInviteLinkFromWindowLocation({\n as: context.me,\n invitedObjectSchema,\n forValueHint,\n });\n\n result\n .then((result) => result && onAccept(result?.valueID))\n .catch((e) => {\n console.error(\"Failed to accept invite\", e);\n });\n };\n\n handleInvite();\n\n window.addEventListener(\"hashchange\", handleInvite);\n\n return () => window.removeEventListener(\"hashchange\", handleInvite);\n }, [onAccept]);\n}\n\nexport {\n experimental_useInboxSender,\n useJazzContext,\n useAccount,\n} from \"jazz-tools/react-core\";\n","export { JazzReactProvider } from \"./provider.js\";\nexport type { JazzProviderProps } from \"./provider.js\";\nexport {\n useAccount,\n useCoState,\n useAcceptInvite,\n experimental_useInboxSender,\n useJazzContext,\n useAuthSecretStorage,\n} from \"./hooks.js\";\n\nexport { createInviteLink, parseInviteLink } from \"jazz-tools/browser\";\n\nexport * from \"./auth/auth.js\";\nexport * from \"./media.js\";\nexport { createImage } from \"jazz-tools/browser-media-images\";\n","import { JazzClerkAuth, type MinimalClerkClient } from \"jazz-tools\";\nimport {\n Account,\n AccountClass,\n AnyAccountSchema,\n CoValueFromRaw,\n InMemoryKVStore,\n KvStoreContext,\n} from \"jazz-tools\";\nimport { LocalStorageKVStore } from \"jazz-tools/browser\";\nimport { useAuthSecretStorage, useJazzContext } from \"jazz-tools/react-core\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { JazzProviderProps, JazzReactProvider } from \"../provider.js\";\n\nfunction useJazzClerkAuth(clerk: MinimalClerkClient) {\n const context = useJazzContext();\n const authSecretStorage = useAuthSecretStorage();\n\n if (\"guest\" in context) {\n throw new Error(\"Clerk auth is not supported in guest mode\");\n }\n\n const authMethod = useMemo(() => {\n return new JazzClerkAuth(context.authenticate, authSecretStorage);\n }, []);\n\n useEffect(() => {\n return authMethod.registerListener(clerk);\n }, []);\n}\n\nfunction RegisterClerkAuth(props: {\n clerk: MinimalClerkClient;\n children: React.ReactNode;\n}) {\n useJazzClerkAuth(props.clerk);\n\n return props.children;\n}\n\nexport const JazzReactProviderWithClerk = <\n S extends\n | (AccountClass<Account> & CoValueFromRaw<Account>)\n | AnyAccountSchema,\n>(\n props: { clerk: MinimalClerkClient } & JazzProviderProps<S>,\n) => {\n const [isLoaded, setIsLoaded] = useState(false);\n\n /**\n * This effect ensures that a logged-in Clerk user is authenticated before the JazzReactProvider is mounted.\n *\n * This is done to optimize the initial load.\n */\n useEffect(() => {\n setupKvStore();\n\n JazzClerkAuth.initializeAuth(props.clerk).then(() => {\n setIsLoaded(true);\n });\n }, []);\n\n if (!isLoaded) {\n return null;\n }\n\n return (\n <JazzReactProvider {...props} logOutReplacement={props.clerk.signOut}>\n <RegisterClerkAuth clerk={props.clerk}>\n {props.children}\n </RegisterClerkAuth>\n </JazzReactProvider>\n );\n};\n\nfunction setupKvStore() {\n KvStoreContext.getInstance().initialize(\n typeof window === \"undefined\"\n ? new InMemoryKVStore()\n : new LocalStorageKVStore(),\n );\n}\n","import { useDemoAuth } from \"jazz-tools/react-core\";\nimport { useState } from \"react\";\n\nexport const DemoAuthBasicUI = (props: {\n appName: string;\n children?: React.ReactNode;\n}) => {\n const auth = useDemoAuth();\n\n const [username, setUsername] = useState<string>(\"\");\n\n const darkMode =\n typeof window !== \"undefined\"\n ? window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n : false;\n\n if (auth.state === \"signedIn\") return props.children ?? null;\n\n const { signUp, logIn, existingUsers } = auth;\n\n return (\n <div\n style={{\n minHeight: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n width: \"18rem\",\n maxWidth: \"calc(100vw - 2rem)\",\n gap: \"2rem\",\n margin: \"0 auto\",\n }}\n >\n <h1\n style={{\n color: darkMode ? \"#fff\" : \"#000\",\n textAlign: \"center\",\n fontSize: \"1.5rem\",\n fontWeight: \"bold\",\n }}\n >\n {props.appName}\n </h1>\n <form\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"0.5rem\",\n }}\n onSubmit={(e) => {\n e.preventDefault();\n signUp(username);\n }}\n >\n <input\n placeholder=\"Display name\"\n value={username}\n onChange={(e) => setUsername(e.target.value)}\n autoComplete=\"webauthn\"\n style={{\n border: darkMode ? \"1px solid #444\" : \"1px solid #ddd\",\n padding: \"11px 8px\",\n borderRadius: \"6px\",\n background: darkMode ? \"#000\" : \"#fff\",\n color: darkMode ? \"#fff\" : \"#000\",\n }}\n />\n <input\n type=\"submit\"\n value=\"Sign up\"\n style={{\n padding: \"13px 5px\",\n border: \"none\",\n borderRadius: \"6px\",\n cursor: \"pointer\",\n background: darkMode ? \"#444\" : \"#ddd\",\n color: darkMode ? \"#fff\" : \"#000\",\n }}\n />\n </form>\n {existingUsers.length > 0 && (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"0.5rem\",\n }}\n >\n <p\n style={{\n color: darkMode ? \"#e2e2e2\" : \"#000\",\n textAlign: \"center\",\n paddingTop: \"0.5rem\",\n borderTop: \"1px solid\",\n borderColor: darkMode ? \"#111\" : \"#e2e2e2\",\n }}\n >\n Log in as\n </p>\n {existingUsers.map((user) => (\n <button\n key={user}\n onClick={() => logIn(user)}\n type=\"button\"\n aria-label={`Log in as ${user}`}\n style={{\n background: darkMode ? \"#0d0d0d\" : \"#eee\",\n color: darkMode ? \"#fff\" : \"#000\",\n padding: \"0.5rem\",\n border: \"none\",\n borderRadius: \"6px\",\n }}\n >\n {user}\n </button>\n ))}\n </div>\n )}\n </div>\n );\n};\n","import { BrowserPasskeyAuth } from \"jazz-tools/browser\";\nimport {\n useAuthSecretStorage,\n useIsAuthenticated,\n useJazzContext,\n} from \"jazz-tools/react-core\";\nimport { useMemo, useState } from \"react\";\n\n/**\n * `usePasskeyAuth` hook provides a `JazzAuth` object for passkey authentication.\n *\n * @example\n * ```ts\n * const auth = usePasskeyAuth({ appName, appHostname });\n * ```\n *\n * @category Auth Providers\n */\nexport function usePasskeyAuth({\n appName,\n appHostname,\n}: {\n appName: string;\n appHostname?: string;\n}) {\n const context = useJazzContext();\n const authSecretStorage = useAuthSecretStorage();\n\n if (\"guest\" in context) {\n throw new Error(\"Passkey auth is not supported in guest mode\");\n }\n\n const authMethod = useMemo(() => {\n return new BrowserPasskeyAuth(\n context.node.crypto,\n context.authenticate,\n authSecretStorage,\n appName,\n appHostname,\n );\n }, [appName, appHostname, authSecretStorage]);\n\n const isAuthenticated = useIsAuthenticated();\n\n return {\n state: isAuthenticated ? \"signedIn\" : \"anonymous\",\n logIn: authMethod.logIn,\n signUp: authMethod.signUp,\n } as const;\n}\n\nexport const PasskeyAuthBasicUI = (props: {\n appName: string;\n appHostname?: string;\n children?: React.ReactNode;\n}) => {\n const [username, setUsername] = useState<string>(\"\");\n const [error, setError] = useState<string | null>(null);\n\n const auth = usePasskeyAuth({\n appName: props.appName,\n appHostname: props.appHostname,\n });\n\n if (auth.state === \"signedIn\") {\n return props.children ?? null;\n }\n\n const { logIn, signUp } = auth;\n\n function handleError(error: Error) {\n if (error.cause instanceof Error) {\n setError(error.cause.message);\n } else {\n setError(error.message);\n }\n }\n\n return (\n <div\n style={{\n width: \"100vw\",\n height: \"100vh\",\n display: \"flex\",\n flexWrap: \"wrap\",\n justifyContent: \"center\",\n alignItems: error ? \"inherit\" : \"center\",\n }}\n >\n {error && (\n <div\n style={{\n color: \"red\",\n width: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"end\",\n padding: \"1rem\",\n }}\n >\n {error}\n </div>\n )}\n <div\n style={{\n width: \"18rem\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"2rem\",\n }}\n >\n <form\n style={{\n width: \"18rem\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"0.5rem\",\n }}\n onSubmit={(e) => {\n e.preventDefault();\n setError(null);\n signUp(username).catch(handleError);\n }}\n >\n <input\n placeholder=\"Display name\"\n value={username}\n onChange={(e) => setUsername(e.target.value)}\n autoComplete=\"webauthn\"\n style={{\n border: \"2px solid #000\",\n padding: \"11px 8px\",\n borderRadius: \"6px\",\n }}\n />\n <input\n type=\"submit\"\n value=\"Sign up\"\n style={{\n background: \"#000\",\n color: \"#fff\",\n padding: \"13px 5px\",\n border: \"none\",\n borderRadius: \"6px\",\n cursor: \"pointer\",\n }}\n />\n </form>\n <button\n onClick={() => {\n setError(null);\n logIn().catch(handleError);\n }}\n style={{\n background: \"#000\",\n color: \"#fff\",\n padding: \"13px 5px\",\n border: \"none\",\n borderRadius: \"6px\",\n cursor: \"pointer\",\n }}\n >\n Log in with existing account\n </button>\n </div>\n </div>\n );\n};\n","import { usePassphraseAuth } from \"jazz-tools/react-core\";\nimport { useState } from \"react\";\n\nexport function PassphraseAuthBasicUI(props: {\n appName: string;\n wordlist: string[];\n children?: React.ReactNode;\n}) {\n const auth = usePassphraseAuth({\n wordlist: props.wordlist,\n });\n\n const [step, setStep] = useState<\"initial\" | \"create\" | \"login\">(\"initial\");\n const [loginPassphrase, setLoginPassphrase] = useState(\"\");\n const [isCopied, setIsCopied] = useState(false);\n\n if (auth.state === \"signedIn\") {\n return props.children ?? null;\n }\n\n const handleCreateAccount = async () => {\n setStep(\"create\");\n };\n\n const handleLogin = () => {\n setStep(\"login\");\n };\n\n const handleBack = () => {\n setStep(\"initial\");\n setLoginPassphrase(\"\");\n };\n\n const handleCopy = async () => {\n await navigator.clipboard.writeText(auth.passphrase);\n setIsCopied(true);\n };\n\n const handleLoginSubmit = async () => {\n await auth.logIn(loginPassphrase); // Sets the state to signed in\n\n // Reset the state in case of logout\n setStep(\"initial\");\n setLoginPassphrase(\"\");\n };\n\n const handleNext = async () => {\n await auth.signUp(); // Sets the state to signed in\n\n // Reset the state in case of logout\n setStep(\"initial\");\n setLoginPassphrase(\"\");\n };\n\n return (\n <div style={containerStyle}>\n <div style={cardStyle}>\n {step === \"initial\" && (\n <div>\n <h1 style={headingStyle}>{props.appName}</h1>\n <button onClick={handleCreateAccount} style={primaryButtonStyle}>\n Create new account\n </button>\n <button onClick={handleLogin} style={secondaryButtonStyle}>\n Log in\n </button>\n </div>\n )}\n\n {step === \"create\" && (\n <>\n <h1 style={headingStyle}>Your Passphrase</h1>\n <p\n style={{\n fontSize: \"0.875rem\",\n color: \"#4b5563\",\n textAlign: \"center\",\n marginBottom: \"1rem\",\n }}\n >\n Please copy and store this passphrase somewhere safe. You'll need\n it to log in.\n </p>\n <textarea\n readOnly\n value={auth.passphrase}\n style={textareaStyle}\n rows={5}\n />\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n gap: \"1rem\",\n }}\n >\n <button onClick={handleBack} style={secondaryButtonStyle}>\n Back\n </button>\n <button onClick={handleCopy} style={primaryButtonStyle}>\n {isCopied ? \"Copied!\" : \"Copy Passphrase\"}\n </button>\n <button onClick={handleNext} style={primaryButtonStyle}>\n I have saved it!\n </button>\n </div>\n </>\n )}\n\n {step === \"login\" && (\n <div>\n <h1 style={headingStyle}>Log In</h1>\n <textarea\n value={loginPassphrase}\n onChange={(e) => setLoginPassphrase(e.target.value)}\n placeholder=\"Enter your passphrase\"\n style={textareaStyle}\n rows={5}\n />\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n gap: \"1rem\",\n }}\n >\n <button onClick={handleBack} style={secondaryButtonStyle}>\n Back\n </button>\n <button onClick={handleLoginSubmit} style={primaryButtonStyle}>\n Log In\n </button>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n\nconst containerStyle: React.CSSProperties = {\n minHeight: \"100vh\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: \"#f3f4f6\",\n};\n\nconst cardStyle: React.CSSProperties = {\n backgroundColor: \"white\",\n padding: \"2rem\",\n borderRadius: \"0.5rem\",\n boxShadow:\n \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)\",\n width: \"24rem\",\n};\n\nconst buttonStyle: React.CSSProperties = {\n width: \"100%\",\n padding: \"0.5rem 1rem\",\n borderRadius: \"0.25rem\",\n fontWeight: \"bold\",\n cursor: \"pointer\",\n marginBottom: \"1rem\",\n};\n\nconst primaryButtonStyle: React.CSSProperties = {\n ...buttonStyle,\n backgroundColor: \"black\",\n color: \"white\",\n border: \"none\",\n};\n\nconst secondaryButtonStyle: React.CSSProperties = {\n ...buttonStyle,\n backgroundColor: \"white\",\n color: \"black\",\n border: \"1px solid black\",\n};\n\nconst headingStyle: React.CSSProperties = {\n color: \"black\",\n fontSize: \"1.5rem\",\n fontWeight: \"bold\",\n textAlign: \"center\",\n marginBottom: \"1rem\",\n};\n\nconst textareaStyle: React.CSSProperties = {\n width: \"100%\",\n padding: \"0.5rem\",\n border: \"1px solid #d1d5db\",\n borderRadius: \"0.25rem\",\n marginBottom: \"1rem\",\n boxSizing: \"border-box\",\n};\n","export { JazzReactProviderWithClerk } from \"./Clerk.js\";\nexport { DemoAuthBasicUI } from \"./DemoAuth.js\";\nexport { usePasskeyAuth, PasskeyAuthBasicUI } from \"./PasskeyAuth.js\";\nexport { PassphraseAuthBasicUI } from \"./PassphraseAuth.js\";\nexport {\n useIsAuthenticated,\n useDemoAuth,\n usePassphraseAuth,\n} from \"jazz-tools/react-core\";\n","import { ImageDefinition, Loaded } from \"jazz-tools\";\nimport React, { useEffect, useState } from \"react\";\n\n/** @category Media */\nexport function useProgressiveImg({\n image,\n maxWidth,\n targetWidth,\n}: {\n image: Loaded<typeof ImageDefinition> | null | undefined;\n maxWidth?: number;\n targetWidth?: number;\n}) {\n const [current, setCurrent] = useState<\n { src?: string; res?: `${number}x${number}` | \"placeholder\" } | undefined\n >(undefined);\n\n useEffect(() => {\n let lastHighestRes: string | undefined;\n if (!image) return;\n const unsub = image.subscribe({}, (update) => {\n const highestRes = ImageDefinition.highestResAvailable(update, {\n maxWidth,\n targetWidth,\n });\n if (highestRes) {\n if (highestRes.res !== lastHighestRes) {\n lastHighestRes = highestRes.res;\n const blob = highestRes.stream.toBlob();\n if (blob) {\n const blobURI = URL.createObjectURL(blob);\n setCurrent({ src: blobURI, res: highestRes.res });\n return () => {\n setTimeout(() => URL.revokeObjectURL(blobURI), 200);\n };\n }\n }\n } else {\n setCurrent({\n src: update?.placeholderDataURL,\n res: \"placeholder\",\n });\n }\n });\n\n return unsub;\n }, [image?.id, maxWidth]);\n\n return {\n src: current?.src,\n res: current?.res,\n originalSize: image?.originalSize,\n };\n}\n\n/** @category Media */\nexport function ProgressiveImg({\n children,\n image,\n maxWidth,\n targetWidth,\n}: {\n children: (result: {\n src: string | undefined;\n res: `${number}x${number}` | \"placeholder\" | undefined;\n originalSize: readonly [number, number] | undefined;\n }) => React.ReactNode;\n image: Loaded<typeof ImageDefinition> | null | undefined;\n maxWidth?: number;\n targetWidth?: number;\n}): React.ReactNode {\n const result = useProgressiveImg({ image, maxWidth, targetWidth });\n return result ? children(result) : null;\n}\n"],"mappings":";;;AAQA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,aAAa,iCAAiC;AACvD,OAAO,SAAS,WAAW,cAAc;AAuFnC;AA3EC,SAAS,kBAId;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,CAAC,cAAc,IAAI,MAAM;AAAA,IAC7B,MACE,IAAI,0BAA6B;AAAA,MAC/B,sBAAsB;AAAA,IACxB,CAAC;AAAA,EACL;AAEA,QAAM,sBAAsB,eAAe,QAAQ;AACnD,QAAM,+BAA+B,eAAe,iBAAiB;AACrE,QAAM,yCAAyC;AAAA,IAC7C;AAAA,EACF;AACA,QAAM,6BAA6B,OAAO,KAAK;AAC/C,6BAA2B,UAAU,QAAQ,iBAAiB;AAE9D,QAAM,QAAQ,MAAM;AAAA,IAGlB,MAAM;AAAA,MACJ,CAAC,aAAa;AACZ,cAAM,QAAQ;AAAA,UACZ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACV,mBAAmB,2BAA2B,UAC1C,+BACA;AAAA,UACJ,6BAA6B;AAAA,QAC/B;AAEA,YAAI,eAAe,aAAa,KAAK,GAAG;AACtC,yBAAe,cAAc,KAAK,EAAE,MAAM,CAAC,UAAU;AACnD,oBAAQ,MAAM,wCAAwC,KAAK;AAAA,UAC7D,CAAC;AAAA,QACH;AAEA,eAAO,eAAe,UAAU,QAAQ;AAAA,MAC1C;AAAA,MACA,CAAC,MAAM,SAAS,E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AgB,aAAAC,YAAW,YAAAC,iBAAgB;AAGpC,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,CAAC,SAAS,UAAU,IAAIA,UAE5B,MAAS;AAEX,EAAAD,WAAU,MAAM;AACd,QAAI;AACJ,QAAI,CAAC,MAAO;AACZ,UAAM,QAAQ,MAAM,UAAU,CAAC,GAAG,CAAC,WAAW;AAC5C,YAAM,aAAa,gBAAgB,oBAAoB,QAAQ;AAAA,QAC7D;AAAA,QACA;AAAA,MACF,CAAC;AACD,UAAI,YAAY;AACd,YAAI,WAAW,QAAQ,gBAAgB;AACrC,2BAAiB,WAAW;AAC5B,gBAAM,OAAO,WAAW,OAAO,OAAO;AACtC,cAAI,MAAM;AACR,kBAAM,UAAU,IAAI,gBAAgB,IAAI;AACxC,uBAAW,EAAE,KAAK,SAAS,KAAK,WAAW,IAAI,CAAC;AAChD,mBAAO,MAAM;AACX,yBAAW,MAAM,IAAI,gBAAgB,OAAO,GAAG,GAAG;AAAA,YACpD;AAAA,UACF;AAAA,QACF;AAAA,MACF,OAAO;AACL,mBAAW;AAAA,UACT,KAAK,QAAQ;AAAA,UACb,KAAK;AAAA,QACP,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAED,WAAO;AAAA,EACT,GAAG,CAAC,OAAO,IAAI,QAAQ,CAAC;AAExB,SAAO;AAAA,IACL,KAAK,SAAS;AAAA,IACd,KAAK,SAAS;AAAA,IACd,cAAc,OAAO;AAAA,EACvB;AACF;AAGO,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASoB;AAClB,QAAM,SAAS,kBAAkB,EAAE,OAAO,UAAU,YAAY,CAAC;AACjE,SAAO,SAAS,SAAS,MAAM,IAAI;AACrC;;;AN1DA,SAAS,mBAAmB;","names":["useEffect","useJazzContext","result","useAuthSecretStorage","useJazzContext","useEffect","jsx","useJazzContext","useAuthSecretStorage","useEffect","useState","jsx","useAuthSecretStorage","useJazzContext","useMemo","useState","jsx","jsxs","error","useState","jsx","jsxs","useIsAuthenticated","useDemoAuth","usePassphraseAuth","useEffect","useState"]}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { ImageDefinition, Loaded } from "jazz-tools";
|
2
|
+
import React from "react";
|
3
|
+
/** @category Media */
|
4
|
+
export declare function useProgressiveImg({ image, maxWidth, targetWidth, }: {
|
5
|
+
image: Loaded<typeof ImageDefinition> | null | undefined;
|
6
|
+
maxWidth?: number;
|
7
|
+
targetWidth?: number;
|
8
|
+
}): {
|
9
|
+
src: string | undefined;
|
10
|
+
res: `${number}x${number}` | "placeholder" | undefined;
|
11
|
+
originalSize: [number, number] | undefined;
|
12
|
+
};
|
13
|
+
/** @category Media */
|
14
|
+
export declare function ProgressiveImg({ children, image, maxWidth, targetWidth, }: {
|
15
|
+
children: (result: {
|
16
|
+
src: string | undefined;
|
17
|
+
res: `${number}x${number}` | "placeholder" | undefined;
|
18
|
+
originalSize: readonly [number, number] | undefined;
|
19
|
+
}) => React.ReactNode;
|
20
|
+
image: Loaded<typeof ImageDefinition> | null | undefined;
|
21
|
+
maxWidth?: number;
|
22
|
+
targetWidth?: number;
|
23
|
+
}): React.ReactNode;
|
24
|
+
//# sourceMappingURL=media.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/react/media.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,sBAAsB;AACtB,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,WAAW,GACZ,EAAE;IACD,KAAK,EAAE,MAAM,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;EAyCA;AAED,sBAAsB;AACtB,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE;QACjB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;QACxB,GAAG,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,GAAG,aAAa,GAAG,SAAS,CAAC;QACvD,YAAY,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;KACrD,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,KAAK,CAAC,SAAS,CAGlB"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Account, AccountClass, AnyAccountSchema, CoValueFromRaw } from "jazz-tools";
|
2
|
+
import { JazzContextManagerProps } from "jazz-tools/browser";
|
3
|
+
import React from "react";
|
4
|
+
export type JazzProviderProps<S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema> = {
|
5
|
+
children: React.ReactNode;
|
6
|
+
enableSSR?: boolean;
|
7
|
+
} & JazzContextManagerProps<S>;
|
8
|
+
/** @category Context & Hooks */
|
9
|
+
export declare function JazzReactProvider<S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema>({ children, guestMode, sync, storage, AccountSchema, defaultProfileName, onLogOut, logOutReplacement, onAnonymousAccountDiscarded, enableSSR, }: JazzProviderProps<S>): import("react/jsx-runtime").JSX.Element;
|
10
|
+
//# sourceMappingURL=provider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/react/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,cAAc,EAGf,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,MAAM,MAAM,iBAAiB,CAC3B,CAAC,SACG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,GACjD,gBAAgB,IAClB;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAE/B,gCAAgC;AAChC,wBAAgB,iBAAiB,CAC/B,CAAC,SACG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,GACjD,gBAAgB,EACpB,EACA,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,2BAA2B,EAC3B,SAAS,GACV,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAiEtB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/react/ssr.ts"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,IAAI,EAAE,MAAM,CAAC;CACd,2CAkBA"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// src/react/ssr.ts
|
2
|
+
import { WebSocketPeerWithReconnection } from "cojson-transport-ws";
|
3
|
+
import { PureJSCrypto } from "cojson/dist/crypto/PureJSCrypto";
|
4
|
+
import { createAnonymousJazzContext } from "jazz-tools";
|
5
|
+
function createSSRJazzAgent(opts) {
|
6
|
+
const ssrNode = createAnonymousJazzContext({
|
7
|
+
crypto: new PureJSCrypto(),
|
8
|
+
peersToLoadFrom: []
|
9
|
+
});
|
10
|
+
const wsPeer = new WebSocketPeerWithReconnection({
|
11
|
+
peer: opts.peer,
|
12
|
+
reconnectionTimeout: 100,
|
13
|
+
addPeer: (peer) => {
|
14
|
+
ssrNode.agent.node.syncManager.addPeer(peer);
|
15
|
+
},
|
16
|
+
removePeer: () => {
|
17
|
+
}
|
18
|
+
});
|
19
|
+
wsPeer.enable();
|
20
|
+
return ssrNode.agent;
|
21
|
+
}
|
22
|
+
export {
|
23
|
+
createSSRJazzAgent
|
24
|
+
};
|
25
|
+
//# sourceMappingURL=ssr.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/react/ssr.ts"],"sourcesContent":["import { WebSocketPeerWithReconnection } from \"cojson-transport-ws\";\nimport { PureJSCrypto } from \"cojson/dist/crypto/PureJSCrypto\";\nimport { createAnonymousJazzContext } from \"jazz-tools\";\n\nexport function createSSRJazzAgent(opts: {\n peer: string;\n}) {\n const ssrNode = createAnonymousJazzContext({\n crypto: new PureJSCrypto(),\n peersToLoadFrom: [],\n });\n\n const wsPeer = new WebSocketPeerWithReconnection({\n peer: opts.peer,\n reconnectionTimeout: 100,\n addPeer: (peer) => {\n ssrNode.agent.node.syncManager.addPeer(peer);\n },\n removePeer: () => {},\n });\n\n wsPeer.enable();\n\n return ssrNode.agent;\n}\n"],"mappings":";AAAA,SAAS,qCAAqC;AAC9C,SAAS,oBAAoB;AAC7B,SAAS,kCAAkC;AAEpC,SAAS,mBAAmB,MAEhC;AACD,QAAM,UAAU,2BAA2B;AAAA,IACzC,QAAQ,IAAI,aAAa;AAAA,IACzB,iBAAiB,CAAC;AAAA,EACpB,CAAC;AAED,QAAM,SAAS,IAAI,8BAA8B;AAAA,IAC/C,MAAM,KAAK;AAAA,IACX,qBAAqB;AAAA,IACrB,SAAS,CAAC,SAAS;AACjB,cAAQ,MAAM,KAAK,YAAY,QAAQ,IAAI;AAAA,IAC7C;AAAA,IACA,YAAY,MAAM;AAAA,IAAC;AAAA,EACrB,CAAC;AAED,SAAO,OAAO;AAEd,SAAO,QAAQ;AACjB;","names":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/react/testing.tsx"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/react/testing.tsx"],"sourcesContent":["export * from \"jazz-tools/react-core/testing\";\n"],"mappings":";;;AAAA,cAAc;","names":[]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { RenderHookOptions, RenderOptions } from "@testing-library/react";
|
2
|
+
import { Account, AnonymousJazzAgent } from "jazz-tools";
|
3
|
+
import React from "react";
|
4
|
+
type JazzExtendedOptions = {
|
5
|
+
account: Account | {
|
6
|
+
guest: AnonymousJazzAgent;
|
7
|
+
};
|
8
|
+
};
|
9
|
+
declare const customRender: (ui: React.ReactNode, options: RenderOptions & JazzExtendedOptions) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries.js"), HTMLElement, HTMLElement>;
|
10
|
+
declare const customRenderHook: <TProps, TResult>(callback: (props: TProps) => TResult, options: RenderHookOptions<TProps> & JazzExtendedOptions) => import("@testing-library/react").RenderHookResult<TResult, TProps>;
|
11
|
+
export * from "@testing-library/react";
|
12
|
+
export { customRender as render };
|
13
|
+
export { customRenderHook as renderHook };
|
14
|
+
//# sourceMappingURL=testUtils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"testUtils.d.ts","sourceRoot":"","sources":["../../../src/react/tests/testUtils.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EAGd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,OAAO,GAAG;QAAE,KAAK,EAAE,kBAAkB,CAAA;KAAE,CAAC;CAClD,CAAC;AAEF,QAAA,MAAM,YAAY,OACZ,KAAK,CAAC,SAAS,WACV,aAAa,GAAG,mBAAmB,oIAa7C,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAAI,MAAM,EAAE,OAAO,YAC7B,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,WAC3B,iBAAiB,CAAC,MAAM,CAAC,GAAG,mBAAmB,uEAazD,CAAC;AAGF,cAAc,wBAAwB,CAAC;AAGvC,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,CAAC;AAClC,OAAO,EAAE,gBAAgB,IAAI,UAAU,EAAE,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useAcceptInvite.test.d.ts","sourceRoot":"","sources":["../../../src/react/tests/useAcceptInvite.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/**
|
2
|
+
* `useDemoAuth` is a hook that provides a `JazzAuth` object for demo authentication.
|
3
|
+
*
|
4
|
+
*
|
5
|
+
* ```ts
|
6
|
+
* const { state, logIn, signUp, existingUsers } = useDemoAuth();
|
7
|
+
* ```
|
8
|
+
*
|
9
|
+
* @category Auth Providers
|
10
|
+
*/
|
11
|
+
export declare function useDemoAuth(): {
|
12
|
+
readonly state: "anonymous" | "signedIn";
|
13
|
+
readonly logIn: (username: string) => Promise<void>;
|
14
|
+
readonly signUp: (username: string) => Promise<void>;
|
15
|
+
readonly existingUsers: string[];
|
16
|
+
};
|
17
|
+
//# sourceMappingURL=DemoAuth.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DemoAuth.d.ts","sourceRoot":"","sources":["../../../src/react-core/auth/DemoAuth.tsx"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,WAAW;;;gCAmBO,MAAM;;EAYvC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/**
|
2
|
+
* `usePassphraseAuth` hook provides a `JazzAuth` object for passphrase authentication.
|
3
|
+
*
|
4
|
+
* @example
|
5
|
+
* ```ts
|
6
|
+
* const auth = usePassphraseAuth({ appName, appHostname, wordlist });
|
7
|
+
* ```
|
8
|
+
*
|
9
|
+
* @category Auth Providers
|
10
|
+
*/
|
11
|
+
export declare function usePassphraseAuth({ wordlist, }: {
|
12
|
+
wordlist: string[];
|
13
|
+
}): {
|
14
|
+
readonly state: "anonymous" | "signedIn";
|
15
|
+
readonly logIn: (passphrase: string) => Promise<void>;
|
16
|
+
readonly signUp: (name?: string) => Promise<string>;
|
17
|
+
readonly registerNewAccount: (passphrase: string, name: string) => Promise<string>;
|
18
|
+
readonly generateRandomPassphrase: () => string;
|
19
|
+
readonly passphrase: string;
|
20
|
+
};
|
21
|
+
//# sourceMappingURL=PassphraseAuth.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PassphraseAuth.d.ts","sourceRoot":"","sources":["../../../src/react-core/auth/PassphraseAuth.tsx"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;;;;;;;EAsCA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react-core/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use client";
|
2
|
+
|
3
|
+
// src/react-core/provider.tsx
|
4
|
+
import React from "react";
|
5
|
+
var JazzContext = React.createContext(void 0);
|
6
|
+
var JazzContextManagerContext = React.createContext(void 0);
|
7
|
+
|
8
|
+
export {
|
9
|
+
JazzContext,
|
10
|
+
JazzContextManagerContext
|
11
|
+
};
|
12
|
+
//# sourceMappingURL=chunk-7DYMJ74I.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/react-core/provider.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Account, JazzContextManager, JazzContextType } from \"jazz-tools\";\n\nexport const JazzContext = React.createContext<\n JazzContextType<Account> | undefined\n>(undefined);\n\nexport const JazzContextManagerContext = React.createContext<\n JazzContextManager<Account, {}> | undefined\n>(undefined);\n"],"mappings":";;;AAAA,OAAO,WAAW;AAIX,IAAM,cAAc,MAAM,cAE/B,MAAS;AAEJ,IAAM,4BAA4B,MAAM,cAE7C,MAAS;","names":[]}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Account, AccountClass, AnonymousJazzAgent, AnyAccountSchema, CoValue, CoValueOrZodSchema, JazzContextManager, JazzContextType, Loaded, ResolveQuery, ResolveQueryStrict } from "jazz-tools";
|
2
|
+
export declare function useJazzContext<Acc extends Account>(): JazzContextType<Acc>;
|
3
|
+
export declare function useJazzContextManager<Acc extends Account>(): JazzContextManager<Acc, {}>;
|
4
|
+
export declare function useAuthSecretStorage(): import("jazz-tools").AuthSecretStorage;
|
5
|
+
export declare function useIsAuthenticated(): boolean;
|
6
|
+
export declare function useCoState<S extends CoValueOrZodSchema, const R extends ResolveQuery<S> = true>(Schema: S, id: string | undefined, options?: {
|
7
|
+
resolve?: ResolveQueryStrict<S, R>;
|
8
|
+
}): Loaded<S, R> | undefined | null;
|
9
|
+
export declare function useAccount<A extends AccountClass<Account> | AnyAccountSchema, R extends ResolveQuery<A> = true>(AccountSchema?: A, options?: {
|
10
|
+
resolve?: ResolveQueryStrict<A, R>;
|
11
|
+
}): {
|
12
|
+
me: Loaded<A, R> | undefined | null;
|
13
|
+
agent: AnonymousJazzAgent | Loaded<A, true>;
|
14
|
+
logOut: () => void;
|
15
|
+
};
|
16
|
+
export declare function experimental_useInboxSender<I extends CoValue, O extends CoValue | undefined>(inboxOwnerID: string | undefined): (message: I) => Promise<O extends CoValue ? string : undefined>;
|
17
|
+
//# sourceMappingURL=hooks.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|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;AAED,wBAAgB,2BAA2B,CACzC,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,OAAO,GAAG,SAAS,EAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,aAad,CAAC,qDAsBpB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
@@ -0,0 +1,302 @@
|
|
1
|
+
"use client";
|
2
|
+
import {
|
3
|
+
JazzContext,
|
4
|
+
JazzContextManagerContext
|
5
|
+
} from "./chunk-7DYMJ74I.js";
|
6
|
+
|
7
|
+
// src/react-core/hooks.ts
|
8
|
+
import React, {
|
9
|
+
useCallback,
|
10
|
+
useContext,
|
11
|
+
useRef,
|
12
|
+
useSyncExternalStore
|
13
|
+
} from "react";
|
14
|
+
import {
|
15
|
+
Account,
|
16
|
+
InboxSender,
|
17
|
+
SubscriptionScope,
|
18
|
+
anySchemaToCoSchema
|
19
|
+
} from "jazz-tools";
|
20
|
+
|
21
|
+
// src/react-core/utils.ts
|
22
|
+
function getCurrentAccountFromContextManager(contextManager) {
|
23
|
+
const context = contextManager.getCurrentValue();
|
24
|
+
if (!context) {
|
25
|
+
throw new Error("No context found");
|
26
|
+
}
|
27
|
+
return "me" in context ? context.me : context.guest;
|
28
|
+
}
|
29
|
+
|
30
|
+
// src/react-core/hooks.ts
|
31
|
+
function useJazzContext() {
|
32
|
+
const value = useContext(JazzContext);
|
33
|
+
if (!value) {
|
34
|
+
throw new Error(
|
35
|
+
"You need to set up a JazzProvider on top of your app to use this hook."
|
36
|
+
);
|
37
|
+
}
|
38
|
+
return value;
|
39
|
+
}
|
40
|
+
function useJazzContextManager() {
|
41
|
+
const value = useContext(JazzContextManagerContext);
|
42
|
+
if (!value) {
|
43
|
+
throw new Error(
|
44
|
+
"You need to set up a JazzProvider on top of your app to use this hook."
|
45
|
+
);
|
46
|
+
}
|
47
|
+
return value;
|
48
|
+
}
|
49
|
+
function useAuthSecretStorage() {
|
50
|
+
const value = useContext(JazzContextManagerContext);
|
51
|
+
if (!value) {
|
52
|
+
throw new Error(
|
53
|
+
"You need to set up a JazzProvider on top of your app to use this useAuthSecretStorage."
|
54
|
+
);
|
55
|
+
}
|
56
|
+
return value.getAuthSecretStorage();
|
57
|
+
}
|
58
|
+
function useIsAuthenticated() {
|
59
|
+
const authSecretStorage = useAuthSecretStorage();
|
60
|
+
return useSyncExternalStore(
|
61
|
+
useCallback(
|
62
|
+
(callback) => {
|
63
|
+
return authSecretStorage.onUpdate(callback);
|
64
|
+
},
|
65
|
+
[authSecretStorage]
|
66
|
+
),
|
67
|
+
() => authSecretStorage.isAuthenticated,
|
68
|
+
() => authSecretStorage.isAuthenticated
|
69
|
+
);
|
70
|
+
}
|
71
|
+
function useCoValueSubscription(Schema, id, options) {
|
72
|
+
const contextManager = useJazzContextManager();
|
73
|
+
const createSubscription = () => {
|
74
|
+
if (!id) {
|
75
|
+
return {
|
76
|
+
subscription: null,
|
77
|
+
contextManager,
|
78
|
+
id,
|
79
|
+
Schema
|
80
|
+
};
|
81
|
+
}
|
82
|
+
const node = contextManager.getCurrentValue().node;
|
83
|
+
const subscription2 = new SubscriptionScope(
|
84
|
+
node,
|
85
|
+
options?.resolve ?? true,
|
86
|
+
id,
|
87
|
+
{
|
88
|
+
ref: anySchemaToCoSchema(Schema),
|
89
|
+
optional: true
|
90
|
+
}
|
91
|
+
);
|
92
|
+
return {
|
93
|
+
subscription: subscription2,
|
94
|
+
contextManager,
|
95
|
+
id,
|
96
|
+
Schema
|
97
|
+
};
|
98
|
+
};
|
99
|
+
const [subscription, setSubscription] = React.useState(createSubscription);
|
100
|
+
React.useLayoutEffect(() => {
|
101
|
+
if (subscription.contextManager !== contextManager || subscription.id !== id || subscription.Schema !== Schema) {
|
102
|
+
subscription.subscription?.destroy();
|
103
|
+
setSubscription(createSubscription());
|
104
|
+
}
|
105
|
+
return contextManager.subscribe(() => {
|
106
|
+
subscription.subscription?.destroy();
|
107
|
+
setSubscription(createSubscription());
|
108
|
+
});
|
109
|
+
}, [Schema, id, contextManager]);
|
110
|
+
return subscription.subscription;
|
111
|
+
}
|
112
|
+
function useCoState(Schema, id, options) {
|
113
|
+
const subscription = useCoValueSubscription(Schema, id, options);
|
114
|
+
const value = React.useSyncExternalStore(
|
115
|
+
React.useCallback(
|
116
|
+
(callback) => {
|
117
|
+
if (!subscription) {
|
118
|
+
return () => {
|
119
|
+
};
|
120
|
+
}
|
121
|
+
return subscription.subscribe(callback);
|
122
|
+
},
|
123
|
+
[subscription]
|
124
|
+
),
|
125
|
+
() => subscription ? subscription.getCurrentValue() : null,
|
126
|
+
() => subscription ? subscription.getCurrentValue() : null
|
127
|
+
);
|
128
|
+
return value;
|
129
|
+
}
|
130
|
+
function useAccountSubscription(Schema, options) {
|
131
|
+
const contextManager = useJazzContextManager();
|
132
|
+
const createSubscription = () => {
|
133
|
+
const agent = getCurrentAccountFromContextManager(contextManager);
|
134
|
+
if (agent._type === "Anonymous") {
|
135
|
+
return {
|
136
|
+
subscription: null,
|
137
|
+
contextManager,
|
138
|
+
agent
|
139
|
+
};
|
140
|
+
}
|
141
|
+
const resolve = options?.resolve ?? true;
|
142
|
+
const node = contextManager.getCurrentValue().node;
|
143
|
+
const subscription2 = new SubscriptionScope(node, resolve, agent.id, {
|
144
|
+
ref: anySchemaToCoSchema(Schema),
|
145
|
+
optional: true
|
146
|
+
});
|
147
|
+
return {
|
148
|
+
subscription: subscription2,
|
149
|
+
contextManager,
|
150
|
+
Schema
|
151
|
+
};
|
152
|
+
};
|
153
|
+
const [subscription, setSubscription] = React.useState(createSubscription);
|
154
|
+
React.useLayoutEffect(() => {
|
155
|
+
if (subscription.contextManager !== contextManager || subscription.Schema !== Schema) {
|
156
|
+
subscription.subscription?.destroy();
|
157
|
+
setSubscription(createSubscription());
|
158
|
+
}
|
159
|
+
return contextManager.subscribe(() => {
|
160
|
+
subscription.subscription?.destroy();
|
161
|
+
setSubscription(createSubscription());
|
162
|
+
});
|
163
|
+
}, [Schema, contextManager]);
|
164
|
+
return subscription.subscription;
|
165
|
+
}
|
166
|
+
function useAccount(AccountSchema = Account, options) {
|
167
|
+
const contextManager = useJazzContextManager();
|
168
|
+
const subscription = useAccountSubscription(AccountSchema, options);
|
169
|
+
const agent = getCurrentAccountFromContextManager(contextManager);
|
170
|
+
const value = React.useSyncExternalStore(
|
171
|
+
React.useCallback(
|
172
|
+
(callback) => {
|
173
|
+
if (!subscription) {
|
174
|
+
return () => {
|
175
|
+
};
|
176
|
+
}
|
177
|
+
return subscription.subscribe(callback);
|
178
|
+
},
|
179
|
+
[subscription]
|
180
|
+
),
|
181
|
+
() => subscription ? subscription.getCurrentValue() : null,
|
182
|
+
() => subscription ? subscription.getCurrentValue() : null
|
183
|
+
);
|
184
|
+
return {
|
185
|
+
me: value,
|
186
|
+
agent,
|
187
|
+
logOut: contextManager.logOut
|
188
|
+
};
|
189
|
+
}
|
190
|
+
function experimental_useInboxSender(inboxOwnerID) {
|
191
|
+
const context = useJazzContext();
|
192
|
+
if (!("me" in context)) {
|
193
|
+
throw new Error(
|
194
|
+
"useInboxSender can't be used in a JazzProvider with auth === 'guest'."
|
195
|
+
);
|
196
|
+
}
|
197
|
+
const me = context.me;
|
198
|
+
const inboxRef = useRef(void 0);
|
199
|
+
const sendMessage = useCallback(
|
200
|
+
async (message) => {
|
201
|
+
if (!inboxOwnerID) throw new Error("Inbox owner ID is required");
|
202
|
+
if (!inboxRef.current) {
|
203
|
+
const inbox2 = InboxSender.load(inboxOwnerID, me);
|
204
|
+
inboxRef.current = inbox2;
|
205
|
+
}
|
206
|
+
let inbox = await inboxRef.current;
|
207
|
+
if (inbox.owner.id !== inboxOwnerID) {
|
208
|
+
const req = InboxSender.load(inboxOwnerID, me);
|
209
|
+
inboxRef.current = req;
|
210
|
+
inbox = await req;
|
211
|
+
}
|
212
|
+
return inbox.sendMessage(message);
|
213
|
+
},
|
214
|
+
[inboxOwnerID]
|
215
|
+
);
|
216
|
+
return sendMessage;
|
217
|
+
}
|
218
|
+
|
219
|
+
// src/react-core/auth/DemoAuth.tsx
|
220
|
+
import { DemoAuth } from "jazz-tools";
|
221
|
+
import { useEffect, useMemo, useState } from "react";
|
222
|
+
function useDemoAuth() {
|
223
|
+
const context = useJazzContext();
|
224
|
+
const authSecretStorage = useAuthSecretStorage();
|
225
|
+
if ("guest" in context) {
|
226
|
+
throw new Error("Demo auth is not supported in guest mode");
|
227
|
+
}
|
228
|
+
const authMethod = useMemo(() => {
|
229
|
+
return new DemoAuth(context.authenticate, authSecretStorage);
|
230
|
+
}, []);
|
231
|
+
const isAuthenticated = useIsAuthenticated();
|
232
|
+
const [existingUsers, setExistingUsers] = useState([]);
|
233
|
+
useEffect(() => {
|
234
|
+
authMethod.getExistingUsers().then(setExistingUsers);
|
235
|
+
}, [authMethod]);
|
236
|
+
function handleSignUp(username) {
|
237
|
+
return authMethod.signUp(username).then(() => {
|
238
|
+
setExistingUsers(existingUsers.concat([username]));
|
239
|
+
});
|
240
|
+
}
|
241
|
+
return {
|
242
|
+
state: isAuthenticated ? "signedIn" : "anonymous",
|
243
|
+
logIn: authMethod.logIn,
|
244
|
+
signUp: handleSignUp,
|
245
|
+
existingUsers
|
246
|
+
};
|
247
|
+
}
|
248
|
+
|
249
|
+
// src/react-core/auth/PassphraseAuth.tsx
|
250
|
+
import { PassphraseAuth } from "jazz-tools";
|
251
|
+
import { useCallback as useCallback2, useMemo as useMemo2, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
252
|
+
function usePassphraseAuth({
|
253
|
+
wordlist
|
254
|
+
}) {
|
255
|
+
const context = useJazzContext();
|
256
|
+
const authSecretStorage = useAuthSecretStorage();
|
257
|
+
if ("guest" in context) {
|
258
|
+
throw new Error("Passphrase auth is not supported in guest mode");
|
259
|
+
}
|
260
|
+
const authMethod = useMemo2(() => {
|
261
|
+
return new PassphraseAuth(
|
262
|
+
context.node.crypto,
|
263
|
+
context.authenticate,
|
264
|
+
context.register,
|
265
|
+
authSecretStorage,
|
266
|
+
wordlist
|
267
|
+
);
|
268
|
+
}, [wordlist]);
|
269
|
+
const passphrase = useSyncExternalStore2(
|
270
|
+
useCallback2(
|
271
|
+
(callback) => {
|
272
|
+
authMethod.loadCurrentAccountPassphrase();
|
273
|
+
return authMethod.subscribe(callback);
|
274
|
+
},
|
275
|
+
[authMethod]
|
276
|
+
),
|
277
|
+
() => authMethod.passphrase
|
278
|
+
);
|
279
|
+
const isAuthenticated = useIsAuthenticated();
|
280
|
+
return {
|
281
|
+
state: isAuthenticated ? "signedIn" : "anonymous",
|
282
|
+
logIn: authMethod.logIn,
|
283
|
+
signUp: authMethod.signUp,
|
284
|
+
registerNewAccount: authMethod.registerNewAccount,
|
285
|
+
generateRandomPassphrase: authMethod.generateRandomPassphrase,
|
286
|
+
passphrase
|
287
|
+
};
|
288
|
+
}
|
289
|
+
export {
|
290
|
+
JazzContext,
|
291
|
+
JazzContextManagerContext,
|
292
|
+
experimental_useInboxSender,
|
293
|
+
useAccount,
|
294
|
+
useAuthSecretStorage,
|
295
|
+
useCoState,
|
296
|
+
useDemoAuth,
|
297
|
+
useIsAuthenticated,
|
298
|
+
useJazzContext,
|
299
|
+
useJazzContextManager,
|
300
|
+
usePassphraseAuth
|
301
|
+
};
|
302
|
+
//# sourceMappingURL=index.js.map
|