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,168 @@
|
|
1
|
+
import { BrowserPasskeyAuth } from "jazz-tools/browser";
|
2
|
+
import {
|
3
|
+
useAuthSecretStorage,
|
4
|
+
useIsAuthenticated,
|
5
|
+
useJazzContext,
|
6
|
+
} from "jazz-tools/react-core";
|
7
|
+
import { useMemo, useState } from "react";
|
8
|
+
|
9
|
+
/**
|
10
|
+
* `usePasskeyAuth` hook provides a `JazzAuth` object for passkey authentication.
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
* ```ts
|
14
|
+
* const auth = usePasskeyAuth({ appName, appHostname });
|
15
|
+
* ```
|
16
|
+
*
|
17
|
+
* @category Auth Providers
|
18
|
+
*/
|
19
|
+
export function usePasskeyAuth({
|
20
|
+
appName,
|
21
|
+
appHostname,
|
22
|
+
}: {
|
23
|
+
appName: string;
|
24
|
+
appHostname?: string;
|
25
|
+
}) {
|
26
|
+
const context = useJazzContext();
|
27
|
+
const authSecretStorage = useAuthSecretStorage();
|
28
|
+
|
29
|
+
if ("guest" in context) {
|
30
|
+
throw new Error("Passkey auth is not supported in guest mode");
|
31
|
+
}
|
32
|
+
|
33
|
+
const authMethod = useMemo(() => {
|
34
|
+
return new BrowserPasskeyAuth(
|
35
|
+
context.node.crypto,
|
36
|
+
context.authenticate,
|
37
|
+
authSecretStorage,
|
38
|
+
appName,
|
39
|
+
appHostname,
|
40
|
+
);
|
41
|
+
}, [appName, appHostname, authSecretStorage]);
|
42
|
+
|
43
|
+
const isAuthenticated = useIsAuthenticated();
|
44
|
+
|
45
|
+
return {
|
46
|
+
state: isAuthenticated ? "signedIn" : "anonymous",
|
47
|
+
logIn: authMethod.logIn,
|
48
|
+
signUp: authMethod.signUp,
|
49
|
+
} as const;
|
50
|
+
}
|
51
|
+
|
52
|
+
export const PasskeyAuthBasicUI = (props: {
|
53
|
+
appName: string;
|
54
|
+
appHostname?: string;
|
55
|
+
children?: React.ReactNode;
|
56
|
+
}) => {
|
57
|
+
const [username, setUsername] = useState<string>("");
|
58
|
+
const [error, setError] = useState<string | null>(null);
|
59
|
+
|
60
|
+
const auth = usePasskeyAuth({
|
61
|
+
appName: props.appName,
|
62
|
+
appHostname: props.appHostname,
|
63
|
+
});
|
64
|
+
|
65
|
+
if (auth.state === "signedIn") {
|
66
|
+
return props.children ?? null;
|
67
|
+
}
|
68
|
+
|
69
|
+
const { logIn, signUp } = auth;
|
70
|
+
|
71
|
+
function handleError(error: Error) {
|
72
|
+
if (error.cause instanceof Error) {
|
73
|
+
setError(error.cause.message);
|
74
|
+
} else {
|
75
|
+
setError(error.message);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
return (
|
80
|
+
<div
|
81
|
+
style={{
|
82
|
+
width: "100vw",
|
83
|
+
height: "100vh",
|
84
|
+
display: "flex",
|
85
|
+
flexWrap: "wrap",
|
86
|
+
justifyContent: "center",
|
87
|
+
alignItems: error ? "inherit" : "center",
|
88
|
+
}}
|
89
|
+
>
|
90
|
+
{error && (
|
91
|
+
<div
|
92
|
+
style={{
|
93
|
+
color: "red",
|
94
|
+
width: "100%",
|
95
|
+
display: "flex",
|
96
|
+
justifyContent: "center",
|
97
|
+
alignItems: "end",
|
98
|
+
padding: "1rem",
|
99
|
+
}}
|
100
|
+
>
|
101
|
+
{error}
|
102
|
+
</div>
|
103
|
+
)}
|
104
|
+
<div
|
105
|
+
style={{
|
106
|
+
width: "18rem",
|
107
|
+
display: "flex",
|
108
|
+
flexDirection: "column",
|
109
|
+
gap: "2rem",
|
110
|
+
}}
|
111
|
+
>
|
112
|
+
<form
|
113
|
+
style={{
|
114
|
+
width: "18rem",
|
115
|
+
display: "flex",
|
116
|
+
flexDirection: "column",
|
117
|
+
gap: "0.5rem",
|
118
|
+
}}
|
119
|
+
onSubmit={(e) => {
|
120
|
+
e.preventDefault();
|
121
|
+
setError(null);
|
122
|
+
signUp(username).catch(handleError);
|
123
|
+
}}
|
124
|
+
>
|
125
|
+
<input
|
126
|
+
placeholder="Display name"
|
127
|
+
value={username}
|
128
|
+
onChange={(e) => setUsername(e.target.value)}
|
129
|
+
autoComplete="webauthn"
|
130
|
+
style={{
|
131
|
+
border: "2px solid #000",
|
132
|
+
padding: "11px 8px",
|
133
|
+
borderRadius: "6px",
|
134
|
+
}}
|
135
|
+
/>
|
136
|
+
<input
|
137
|
+
type="submit"
|
138
|
+
value="Sign up"
|
139
|
+
style={{
|
140
|
+
background: "#000",
|
141
|
+
color: "#fff",
|
142
|
+
padding: "13px 5px",
|
143
|
+
border: "none",
|
144
|
+
borderRadius: "6px",
|
145
|
+
cursor: "pointer",
|
146
|
+
}}
|
147
|
+
/>
|
148
|
+
</form>
|
149
|
+
<button
|
150
|
+
onClick={() => {
|
151
|
+
setError(null);
|
152
|
+
logIn().catch(handleError);
|
153
|
+
}}
|
154
|
+
style={{
|
155
|
+
background: "#000",
|
156
|
+
color: "#fff",
|
157
|
+
padding: "13px 5px",
|
158
|
+
border: "none",
|
159
|
+
borderRadius: "6px",
|
160
|
+
cursor: "pointer",
|
161
|
+
}}
|
162
|
+
>
|
163
|
+
Log in with existing account
|
164
|
+
</button>
|
165
|
+
</div>
|
166
|
+
</div>
|
167
|
+
);
|
168
|
+
};
|
@@ -0,0 +1,196 @@
|
|
1
|
+
import { usePassphraseAuth } from "jazz-tools/react-core";
|
2
|
+
import { useState } from "react";
|
3
|
+
|
4
|
+
export function PassphraseAuthBasicUI(props: {
|
5
|
+
appName: string;
|
6
|
+
wordlist: string[];
|
7
|
+
children?: React.ReactNode;
|
8
|
+
}) {
|
9
|
+
const auth = usePassphraseAuth({
|
10
|
+
wordlist: props.wordlist,
|
11
|
+
});
|
12
|
+
|
13
|
+
const [step, setStep] = useState<"initial" | "create" | "login">("initial");
|
14
|
+
const [loginPassphrase, setLoginPassphrase] = useState("");
|
15
|
+
const [isCopied, setIsCopied] = useState(false);
|
16
|
+
|
17
|
+
if (auth.state === "signedIn") {
|
18
|
+
return props.children ?? null;
|
19
|
+
}
|
20
|
+
|
21
|
+
const handleCreateAccount = async () => {
|
22
|
+
setStep("create");
|
23
|
+
};
|
24
|
+
|
25
|
+
const handleLogin = () => {
|
26
|
+
setStep("login");
|
27
|
+
};
|
28
|
+
|
29
|
+
const handleBack = () => {
|
30
|
+
setStep("initial");
|
31
|
+
setLoginPassphrase("");
|
32
|
+
};
|
33
|
+
|
34
|
+
const handleCopy = async () => {
|
35
|
+
await navigator.clipboard.writeText(auth.passphrase);
|
36
|
+
setIsCopied(true);
|
37
|
+
};
|
38
|
+
|
39
|
+
const handleLoginSubmit = async () => {
|
40
|
+
await auth.logIn(loginPassphrase); // Sets the state to signed in
|
41
|
+
|
42
|
+
// Reset the state in case of logout
|
43
|
+
setStep("initial");
|
44
|
+
setLoginPassphrase("");
|
45
|
+
};
|
46
|
+
|
47
|
+
const handleNext = async () => {
|
48
|
+
await auth.signUp(); // Sets the state to signed in
|
49
|
+
|
50
|
+
// Reset the state in case of logout
|
51
|
+
setStep("initial");
|
52
|
+
setLoginPassphrase("");
|
53
|
+
};
|
54
|
+
|
55
|
+
return (
|
56
|
+
<div style={containerStyle}>
|
57
|
+
<div style={cardStyle}>
|
58
|
+
{step === "initial" && (
|
59
|
+
<div>
|
60
|
+
<h1 style={headingStyle}>{props.appName}</h1>
|
61
|
+
<button onClick={handleCreateAccount} style={primaryButtonStyle}>
|
62
|
+
Create new account
|
63
|
+
</button>
|
64
|
+
<button onClick={handleLogin} style={secondaryButtonStyle}>
|
65
|
+
Log in
|
66
|
+
</button>
|
67
|
+
</div>
|
68
|
+
)}
|
69
|
+
|
70
|
+
{step === "create" && (
|
71
|
+
<>
|
72
|
+
<h1 style={headingStyle}>Your Passphrase</h1>
|
73
|
+
<p
|
74
|
+
style={{
|
75
|
+
fontSize: "0.875rem",
|
76
|
+
color: "#4b5563",
|
77
|
+
textAlign: "center",
|
78
|
+
marginBottom: "1rem",
|
79
|
+
}}
|
80
|
+
>
|
81
|
+
Please copy and store this passphrase somewhere safe. You'll need
|
82
|
+
it to log in.
|
83
|
+
</p>
|
84
|
+
<textarea
|
85
|
+
readOnly
|
86
|
+
value={auth.passphrase}
|
87
|
+
style={textareaStyle}
|
88
|
+
rows={5}
|
89
|
+
/>
|
90
|
+
<div
|
91
|
+
style={{
|
92
|
+
display: "flex",
|
93
|
+
justifyContent: "space-between",
|
94
|
+
gap: "1rem",
|
95
|
+
}}
|
96
|
+
>
|
97
|
+
<button onClick={handleBack} style={secondaryButtonStyle}>
|
98
|
+
Back
|
99
|
+
</button>
|
100
|
+
<button onClick={handleCopy} style={primaryButtonStyle}>
|
101
|
+
{isCopied ? "Copied!" : "Copy Passphrase"}
|
102
|
+
</button>
|
103
|
+
<button onClick={handleNext} style={primaryButtonStyle}>
|
104
|
+
I have saved it!
|
105
|
+
</button>
|
106
|
+
</div>
|
107
|
+
</>
|
108
|
+
)}
|
109
|
+
|
110
|
+
{step === "login" && (
|
111
|
+
<div>
|
112
|
+
<h1 style={headingStyle}>Log In</h1>
|
113
|
+
<textarea
|
114
|
+
value={loginPassphrase}
|
115
|
+
onChange={(e) => setLoginPassphrase(e.target.value)}
|
116
|
+
placeholder="Enter your passphrase"
|
117
|
+
style={textareaStyle}
|
118
|
+
rows={5}
|
119
|
+
/>
|
120
|
+
<div
|
121
|
+
style={{
|
122
|
+
display: "flex",
|
123
|
+
justifyContent: "space-between",
|
124
|
+
gap: "1rem",
|
125
|
+
}}
|
126
|
+
>
|
127
|
+
<button onClick={handleBack} style={secondaryButtonStyle}>
|
128
|
+
Back
|
129
|
+
</button>
|
130
|
+
<button onClick={handleLoginSubmit} style={primaryButtonStyle}>
|
131
|
+
Log In
|
132
|
+
</button>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
)}
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
);
|
139
|
+
}
|
140
|
+
|
141
|
+
const containerStyle: React.CSSProperties = {
|
142
|
+
minHeight: "100vh",
|
143
|
+
display: "flex",
|
144
|
+
alignItems: "center",
|
145
|
+
justifyContent: "center",
|
146
|
+
backgroundColor: "#f3f4f6",
|
147
|
+
};
|
148
|
+
|
149
|
+
const cardStyle: React.CSSProperties = {
|
150
|
+
backgroundColor: "white",
|
151
|
+
padding: "2rem",
|
152
|
+
borderRadius: "0.5rem",
|
153
|
+
boxShadow:
|
154
|
+
"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
|
155
|
+
width: "24rem",
|
156
|
+
};
|
157
|
+
|
158
|
+
const buttonStyle: React.CSSProperties = {
|
159
|
+
width: "100%",
|
160
|
+
padding: "0.5rem 1rem",
|
161
|
+
borderRadius: "0.25rem",
|
162
|
+
fontWeight: "bold",
|
163
|
+
cursor: "pointer",
|
164
|
+
marginBottom: "1rem",
|
165
|
+
};
|
166
|
+
|
167
|
+
const primaryButtonStyle: React.CSSProperties = {
|
168
|
+
...buttonStyle,
|
169
|
+
backgroundColor: "black",
|
170
|
+
color: "white",
|
171
|
+
border: "none",
|
172
|
+
};
|
173
|
+
|
174
|
+
const secondaryButtonStyle: React.CSSProperties = {
|
175
|
+
...buttonStyle,
|
176
|
+
backgroundColor: "white",
|
177
|
+
color: "black",
|
178
|
+
border: "1px solid black",
|
179
|
+
};
|
180
|
+
|
181
|
+
const headingStyle: React.CSSProperties = {
|
182
|
+
color: "black",
|
183
|
+
fontSize: "1.5rem",
|
184
|
+
fontWeight: "bold",
|
185
|
+
textAlign: "center",
|
186
|
+
marginBottom: "1rem",
|
187
|
+
};
|
188
|
+
|
189
|
+
const textareaStyle: React.CSSProperties = {
|
190
|
+
width: "100%",
|
191
|
+
padding: "0.5rem",
|
192
|
+
border: "1px solid #d1d5db",
|
193
|
+
borderRadius: "0.25rem",
|
194
|
+
marginBottom: "1rem",
|
195
|
+
boxSizing: "border-box",
|
196
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export { JazzReactProviderWithClerk } from "./Clerk.js";
|
2
|
+
export { DemoAuthBasicUI } from "./DemoAuth.js";
|
3
|
+
export { usePasskeyAuth, PasskeyAuthBasicUI } from "./PasskeyAuth.js";
|
4
|
+
export { PassphraseAuthBasicUI } from "./PassphraseAuth.js";
|
5
|
+
export {
|
6
|
+
useIsAuthenticated,
|
7
|
+
useDemoAuth,
|
8
|
+
usePassphraseAuth,
|
9
|
+
} from "jazz-tools/react-core";
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { consumeInviteLinkFromWindowLocation } from "jazz-tools/browser";
|
2
|
+
import { useEffect } from "react";
|
3
|
+
|
4
|
+
import { CoValueOrZodSchema } from "jazz-tools";
|
5
|
+
import { useJazzContext } from "jazz-tools/react-core";
|
6
|
+
|
7
|
+
export { useCoState, useAuthSecretStorage } from "jazz-tools/react-core";
|
8
|
+
|
9
|
+
export function useAcceptInvite<S extends CoValueOrZodSchema>({
|
10
|
+
invitedObjectSchema,
|
11
|
+
onAccept,
|
12
|
+
forValueHint,
|
13
|
+
}: {
|
14
|
+
invitedObjectSchema: S;
|
15
|
+
onAccept: (valueID: string) => void;
|
16
|
+
forValueHint?: string;
|
17
|
+
}): void {
|
18
|
+
const context = useJazzContext();
|
19
|
+
|
20
|
+
if (!("me" in context)) {
|
21
|
+
throw new Error(
|
22
|
+
"useAcceptInvite can't be used in a JazzProvider with auth === 'guest'.",
|
23
|
+
);
|
24
|
+
}
|
25
|
+
|
26
|
+
useEffect(() => {
|
27
|
+
const handleInvite = () => {
|
28
|
+
const result = consumeInviteLinkFromWindowLocation({
|
29
|
+
as: context.me,
|
30
|
+
invitedObjectSchema,
|
31
|
+
forValueHint,
|
32
|
+
});
|
33
|
+
|
34
|
+
result
|
35
|
+
.then((result) => result && onAccept(result?.valueID))
|
36
|
+
.catch((e) => {
|
37
|
+
console.error("Failed to accept invite", e);
|
38
|
+
});
|
39
|
+
};
|
40
|
+
|
41
|
+
handleInvite();
|
42
|
+
|
43
|
+
window.addEventListener("hashchange", handleInvite);
|
44
|
+
|
45
|
+
return () => window.removeEventListener("hashchange", handleInvite);
|
46
|
+
}, [onAccept]);
|
47
|
+
}
|
48
|
+
|
49
|
+
export {
|
50
|
+
experimental_useInboxSender,
|
51
|
+
useJazzContext,
|
52
|
+
useAccount,
|
53
|
+
} from "jazz-tools/react-core";
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export { JazzReactProvider } from "./provider.js";
|
2
|
+
export type { JazzProviderProps } from "./provider.js";
|
3
|
+
export {
|
4
|
+
useAccount,
|
5
|
+
useCoState,
|
6
|
+
useAcceptInvite,
|
7
|
+
experimental_useInboxSender,
|
8
|
+
useJazzContext,
|
9
|
+
useAuthSecretStorage,
|
10
|
+
} from "./hooks.js";
|
11
|
+
|
12
|
+
export { createInviteLink, parseInviteLink } from "jazz-tools/browser";
|
13
|
+
|
14
|
+
export * from "./auth/auth.js";
|
15
|
+
export * from "./media.js";
|
16
|
+
export { createImage } from "jazz-tools/browser-media-images";
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import { ImageDefinition, Loaded } from "jazz-tools";
|
2
|
+
import React, { useEffect, useState } from "react";
|
3
|
+
|
4
|
+
/** @category Media */
|
5
|
+
export function useProgressiveImg({
|
6
|
+
image,
|
7
|
+
maxWidth,
|
8
|
+
targetWidth,
|
9
|
+
}: {
|
10
|
+
image: Loaded<typeof ImageDefinition> | null | undefined;
|
11
|
+
maxWidth?: number;
|
12
|
+
targetWidth?: number;
|
13
|
+
}) {
|
14
|
+
const [current, setCurrent] = useState<
|
15
|
+
{ src?: string; res?: `${number}x${number}` | "placeholder" } | undefined
|
16
|
+
>(undefined);
|
17
|
+
|
18
|
+
useEffect(() => {
|
19
|
+
let lastHighestRes: string | undefined;
|
20
|
+
if (!image) return;
|
21
|
+
const unsub = image.subscribe({}, (update) => {
|
22
|
+
const highestRes = ImageDefinition.highestResAvailable(update, {
|
23
|
+
maxWidth,
|
24
|
+
targetWidth,
|
25
|
+
});
|
26
|
+
if (highestRes) {
|
27
|
+
if (highestRes.res !== lastHighestRes) {
|
28
|
+
lastHighestRes = highestRes.res;
|
29
|
+
const blob = highestRes.stream.toBlob();
|
30
|
+
if (blob) {
|
31
|
+
const blobURI = URL.createObjectURL(blob);
|
32
|
+
setCurrent({ src: blobURI, res: highestRes.res });
|
33
|
+
return () => {
|
34
|
+
setTimeout(() => URL.revokeObjectURL(blobURI), 200);
|
35
|
+
};
|
36
|
+
}
|
37
|
+
}
|
38
|
+
} else {
|
39
|
+
setCurrent({
|
40
|
+
src: update?.placeholderDataURL,
|
41
|
+
res: "placeholder",
|
42
|
+
});
|
43
|
+
}
|
44
|
+
});
|
45
|
+
|
46
|
+
return unsub;
|
47
|
+
}, [image?.id, maxWidth]);
|
48
|
+
|
49
|
+
return {
|
50
|
+
src: current?.src,
|
51
|
+
res: current?.res,
|
52
|
+
originalSize: image?.originalSize,
|
53
|
+
};
|
54
|
+
}
|
55
|
+
|
56
|
+
/** @category Media */
|
57
|
+
export function ProgressiveImg({
|
58
|
+
children,
|
59
|
+
image,
|
60
|
+
maxWidth,
|
61
|
+
targetWidth,
|
62
|
+
}: {
|
63
|
+
children: (result: {
|
64
|
+
src: string | undefined;
|
65
|
+
res: `${number}x${number}` | "placeholder" | undefined;
|
66
|
+
originalSize: readonly [number, number] | undefined;
|
67
|
+
}) => React.ReactNode;
|
68
|
+
image: Loaded<typeof ImageDefinition> | null | undefined;
|
69
|
+
maxWidth?: number;
|
70
|
+
targetWidth?: number;
|
71
|
+
}): React.ReactNode {
|
72
|
+
const result = useProgressiveImg({ image, maxWidth, targetWidth });
|
73
|
+
return result ? children(result) : null;
|
74
|
+
}
|
@@ -0,0 +1,114 @@
|
|
1
|
+
import {
|
2
|
+
Account,
|
3
|
+
AccountClass,
|
4
|
+
AnyAccountSchema,
|
5
|
+
CoValueFromRaw,
|
6
|
+
InstanceOfSchema,
|
7
|
+
JazzContextType,
|
8
|
+
} from "jazz-tools";
|
9
|
+
import {
|
10
|
+
JazzBrowserContextManager,
|
11
|
+
JazzContextManagerProps,
|
12
|
+
} from "jazz-tools/browser";
|
13
|
+
import { JazzContext, JazzContextManagerContext } from "jazz-tools/react-core";
|
14
|
+
import React, { useEffect, useRef } from "react";
|
15
|
+
|
16
|
+
export type JazzProviderProps<
|
17
|
+
S extends
|
18
|
+
| (AccountClass<Account> & CoValueFromRaw<Account>)
|
19
|
+
| AnyAccountSchema,
|
20
|
+
> = {
|
21
|
+
children: React.ReactNode;
|
22
|
+
enableSSR?: boolean;
|
23
|
+
} & JazzContextManagerProps<S>;
|
24
|
+
|
25
|
+
/** @category Context & Hooks */
|
26
|
+
export function JazzReactProvider<
|
27
|
+
S extends
|
28
|
+
| (AccountClass<Account> & CoValueFromRaw<Account>)
|
29
|
+
| AnyAccountSchema,
|
30
|
+
>({
|
31
|
+
children,
|
32
|
+
guestMode,
|
33
|
+
sync,
|
34
|
+
storage,
|
35
|
+
AccountSchema,
|
36
|
+
defaultProfileName,
|
37
|
+
onLogOut,
|
38
|
+
logOutReplacement,
|
39
|
+
onAnonymousAccountDiscarded,
|
40
|
+
enableSSR,
|
41
|
+
}: JazzProviderProps<S>) {
|
42
|
+
const [contextManager] = React.useState(
|
43
|
+
() =>
|
44
|
+
new JazzBrowserContextManager<S>({
|
45
|
+
useAnonymousFallback: enableSSR,
|
46
|
+
}),
|
47
|
+
);
|
48
|
+
|
49
|
+
const onLogOutRefCallback = useRefCallback(onLogOut);
|
50
|
+
const logOutReplacementRefCallback = useRefCallback(logOutReplacement);
|
51
|
+
const onAnonymousAccountDiscardedRefCallback = useRefCallback(
|
52
|
+
onAnonymousAccountDiscarded,
|
53
|
+
);
|
54
|
+
const logoutReplacementActiveRef = useRef(false);
|
55
|
+
logoutReplacementActiveRef.current = Boolean(logOutReplacement);
|
56
|
+
|
57
|
+
const value = React.useSyncExternalStore<
|
58
|
+
JazzContextType<InstanceOfSchema<S>> | undefined
|
59
|
+
>(
|
60
|
+
React.useCallback(
|
61
|
+
(callback) => {
|
62
|
+
const props = {
|
63
|
+
AccountSchema,
|
64
|
+
guestMode,
|
65
|
+
sync,
|
66
|
+
storage,
|
67
|
+
defaultProfileName,
|
68
|
+
onLogOut: onLogOutRefCallback,
|
69
|
+
logOutReplacement: logoutReplacementActiveRef.current
|
70
|
+
? logOutReplacementRefCallback
|
71
|
+
: undefined,
|
72
|
+
onAnonymousAccountDiscarded: onAnonymousAccountDiscardedRefCallback,
|
73
|
+
} satisfies JazzContextManagerProps<S>;
|
74
|
+
|
75
|
+
if (contextManager.propsChanged(props)) {
|
76
|
+
contextManager.createContext(props).catch((error) => {
|
77
|
+
console.error("Error creating Jazz browser context:", error);
|
78
|
+
});
|
79
|
+
}
|
80
|
+
|
81
|
+
return contextManager.subscribe(callback);
|
82
|
+
},
|
83
|
+
[sync, guestMode].concat(storage as any),
|
84
|
+
),
|
85
|
+
() => contextManager.getCurrentValue(),
|
86
|
+
() => contextManager.getCurrentValue(),
|
87
|
+
);
|
88
|
+
|
89
|
+
useEffect(() => {
|
90
|
+
// In development mode we don't return a cleanup function because otherwise
|
91
|
+
// the double effect execution would mark the context as done immediately.
|
92
|
+
if (process.env.NODE_ENV === "development") return;
|
93
|
+
|
94
|
+
return () => {
|
95
|
+
contextManager.done();
|
96
|
+
};
|
97
|
+
}, []);
|
98
|
+
|
99
|
+
return (
|
100
|
+
<JazzContext.Provider value={value}>
|
101
|
+
<JazzContextManagerContext.Provider value={contextManager}>
|
102
|
+
{value && children}
|
103
|
+
</JazzContextManagerContext.Provider>
|
104
|
+
</JazzContext.Provider>
|
105
|
+
);
|
106
|
+
}
|
107
|
+
|
108
|
+
function useRefCallback<T extends (...args: any[]) => any>(callback?: T) {
|
109
|
+
const callbackRef = React.useRef(callback);
|
110
|
+
callbackRef.current = callback;
|
111
|
+
return useRef(
|
112
|
+
(...args: Parameters<T>): ReturnType<T> => callbackRef.current?.(...args),
|
113
|
+
).current;
|
114
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { FileStream, ImageDefinition } from "jazz-tools";
|
2
|
+
import { createJazzTestAccount } from "jazz-tools/testing";
|
3
|
+
|
4
|
+
// Simple document environment
|
5
|
+
global.document = {
|
6
|
+
createElement: () =>
|
7
|
+
({ src: "", onload: null }) as unknown as HTMLImageElement,
|
8
|
+
} as unknown as Document;
|
9
|
+
global.window = { innerWidth: 1000 } as unknown as Window & typeof globalThis;
|
10
|
+
|
11
|
+
const me = await createJazzTestAccount();
|
12
|
+
|
13
|
+
const mediumSizeBlob = new Blob([], { type: "image/jpeg" });
|
14
|
+
const image = ImageDefinition.create(
|
15
|
+
{
|
16
|
+
originalSize: [1920, 1080],
|
17
|
+
},
|
18
|
+
{ owner: me },
|
19
|
+
);
|
20
|
+
image["100x100"] = await FileStream.createFromBlob(mediumSizeBlob, {
|
21
|
+
owner: me,
|
22
|
+
});
|
23
|
+
image["1920x1080"] = await FileStream.createFromBlob(mediumSizeBlob, {
|
24
|
+
owner: me,
|
25
|
+
});
|
26
|
+
const imageElement = document.createElement("img");
|
27
|
+
// ---cut---
|
28
|
+
// Start with placeholder for immediate display
|
29
|
+
if (image.placeholderDataURL) {
|
30
|
+
imageElement.src = image.placeholderDataURL;
|
31
|
+
}
|
32
|
+
|
33
|
+
// Then load the best resolution for the current display
|
34
|
+
const screenWidth = window.innerWidth;
|
35
|
+
const bestRes = ImageDefinition.highestResAvailable(image, {
|
36
|
+
targetWidth: screenWidth,
|
37
|
+
});
|
38
|
+
|
39
|
+
if (bestRes) {
|
40
|
+
const blob = bestRes.stream.toBlob();
|
41
|
+
if (blob) {
|
42
|
+
const url = URL.createObjectURL(blob);
|
43
|
+
imageElement.src = url;
|
44
|
+
|
45
|
+
// Remember to revoke the URL when no longer needed
|
46
|
+
imageElement.onload = () => {
|
47
|
+
URL.revokeObjectURL(url);
|
48
|
+
};
|
49
|
+
}
|
50
|
+
}
|
package/src/react/ssr.ts
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
import { WebSocketPeerWithReconnection } from "cojson-transport-ws";
|
2
|
+
import { PureJSCrypto } from "cojson/dist/crypto/PureJSCrypto";
|
3
|
+
import { createAnonymousJazzContext } from "jazz-tools";
|
4
|
+
|
5
|
+
export function createSSRJazzAgent(opts: {
|
6
|
+
peer: string;
|
7
|
+
}) {
|
8
|
+
const ssrNode = createAnonymousJazzContext({
|
9
|
+
crypto: new PureJSCrypto(),
|
10
|
+
peersToLoadFrom: [],
|
11
|
+
});
|
12
|
+
|
13
|
+
const wsPeer = new WebSocketPeerWithReconnection({
|
14
|
+
peer: opts.peer,
|
15
|
+
reconnectionTimeout: 100,
|
16
|
+
addPeer: (peer) => {
|
17
|
+
ssrNode.agent.node.syncManager.addPeer(peer);
|
18
|
+
},
|
19
|
+
removePeer: () => {},
|
20
|
+
});
|
21
|
+
|
22
|
+
wsPeer.enable();
|
23
|
+
|
24
|
+
return ssrNode.agent;
|
25
|
+
}
|