jazz-tools 0.14.28 → 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 +14 -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.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/exports.ts +117 -0
- package/src/tools/index.ts +8 -0
- package/src/tools/testing.ts +301 -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-AUQIX4E7.js +0 -4827
- package/dist/chunk-AUQIX4E7.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.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/exports.ts +0 -108
- /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}/coFeed.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}/coFeed.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}/coFeed.test.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-native-core/provider.tsx","../../src/react-native-core/ReactNativeContextManager.ts","../../src/react-native-core/platform.ts","../../src/react-native-core/storage/kv-store-context.ts","../../src/react-native-core/storage/sqlite-react-native.ts","../../src/react-native-core/auth/DemoAuthUI.tsx","../../src/react-native-core/auth/auth.ts","../../src/react-native-core/hooks.tsx","../../src/react-native-core/media.tsx","../../src/react-native-core/index.ts"],"sourcesContent":["import {\n Account,\n AccountClass,\n AnyAccountSchema,\n CoValueFromRaw,\n InstanceOfSchema,\n JazzContextType,\n KvStore,\n} from \"jazz-tools\";\nimport { JazzContext, JazzContextManagerContext } from \"jazz-tools/react-core\";\nimport React, { useEffect, useRef } from \"react\";\nimport { JazzContextManagerProps } from \"./ReactNativeContextManager.js\";\nimport { ReactNativeContextManager } from \"./ReactNativeContextManager.js\";\nimport { setupKvStore } from \"./platform.js\";\n\nexport type JazzProviderProps<\n S extends\n | (AccountClass<Account> & CoValueFromRaw<Account>)\n | AnyAccountSchema,\n> = {\n children: React.ReactNode;\n kvStore?: KvStore;\n} & JazzContextManagerProps<S>;\n\n/** @category Context & Hooks */\nexport function JazzProviderCore<\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 kvStore,\n onAnonymousAccountDiscarded,\n CryptoProvider,\n logOutReplacement,\n}: JazzProviderProps<S>) {\n setupKvStore(kvStore);\n\n const [contextManager] = React.useState(\n () => new ReactNativeContextManager<S>(),\n );\n\n const onAnonymousAccountDiscardedRefCallback = useRefCallback(\n onAnonymousAccountDiscarded,\n );\n const onLogOutRefCallback = useRefCallback(onLogOut);\n const logOutReplacementRefCallback = useRefCallback(logOutReplacement);\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 CryptoProvider,\n };\n if (contextManager.propsChanged(props)) {\n contextManager.createContext(props).catch((error) => {\n console.log(error.stack);\n console.error(\"Error creating Jazz 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 {\n Account,\n AccountClass,\n CoValueFromRaw,\n JazzContextManager,\n KvStore,\n SyncConfig,\n} from \"jazz-tools\";\nimport type {\n AnyAccountSchema,\n InstanceOfSchema,\n JazzContextManagerAuthProps,\n} from \"jazz-tools\";\nimport {\n BaseReactNativeContextOptions,\n createJazzReactNativeContext,\n createJazzReactNativeGuestContext,\n} from \"./platform.js\";\nimport { KvStoreContext } from \"./storage/kv-store-context.js\";\n\nexport type JazzContextManagerProps<\n S extends\n | (AccountClass<Account> & CoValueFromRaw<Account>)\n | AnyAccountSchema,\n> = {\n guestMode?: boolean;\n sync: SyncConfig;\n onLogOut?: () => void;\n logOutReplacement?: () => void;\n storage?: BaseReactNativeContextOptions[\"storage\"];\n AccountSchema?: S;\n defaultProfileName?: string;\n onAnonymousAccountDiscarded?: (\n anonymousAccount: InstanceOfSchema<S>,\n ) => Promise<void>;\n CryptoProvider?: BaseReactNativeContextOptions[\"CryptoProvider\"];\n};\n\nexport class ReactNativeContextManager<\n S extends\n | (AccountClass<Account> & CoValueFromRaw<Account>)\n | AnyAccountSchema,\n> extends JazzContextManager<InstanceOfSchema<S>, JazzContextManagerProps<S>> {\n async getNewContext(\n props: JazzContextManagerProps<S>,\n authProps?: JazzContextManagerAuthProps,\n ) {\n if (props.guestMode) {\n return createJazzReactNativeGuestContext({\n sync: props.sync,\n storage: props.storage,\n authSecretStorage: this.authSecretStorage,\n CryptoProvider: props.CryptoProvider,\n });\n } else {\n return createJazzReactNativeContext<S>({\n sync: props.sync,\n storage: props.storage,\n AccountSchema: props.AccountSchema,\n credentials: authProps?.credentials,\n newAccountProps: authProps?.newAccountProps,\n defaultProfileName: props.defaultProfileName,\n authSecretStorage: this.authSecretStorage,\n CryptoProvider: props.CryptoProvider,\n });\n }\n }\n\n getKvStore(): KvStore {\n return KvStoreContext.getInstance().getStorage();\n }\n\n propsChanged(props: JazzContextManagerProps<S>) {\n if (!this.props) {\n return true;\n }\n\n return (\n this.props.sync.when !== props.sync.when ||\n this.props.sync.peer !== props.sync.peer ||\n this.props.guestMode !== props.guestMode\n );\n }\n}\n","import NetInfo from \"@react-native-community/netinfo\";\nimport { LocalNode, Peer, RawAccountID } from \"cojson\";\nimport { PureJSCrypto } from \"cojson/dist/crypto/PureJSCrypto\"; // Importing from dist to not rely on the exports field\nimport {\n Account,\n AccountClass,\n AccountSchema,\n AgentID,\n AnyAccountSchema,\n AuthCredentials,\n AuthSecretStorage,\n CoValue,\n CoValueClass,\n CoValueFromRaw,\n CryptoProvider,\n ID,\n InstanceOfSchema,\n NewAccountProps,\n SessionID,\n SyncConfig,\n createInviteLink as baseCreateInviteLink,\n createAnonymousJazzContext,\n createJazzContext,\n} from \"jazz-tools\";\nimport { KvStore, KvStoreContext } from \"./storage/kv-store-context.js\";\nimport { SQLiteReactNative } from \"./storage/sqlite-react-native.js\";\n\nimport { SQLiteDatabaseDriverAsync } from \"cojson-storage\";\nimport { WebSocketPeerWithReconnection } from \"cojson-transport-ws\";\nimport type { RNQuickCrypto } from \"./crypto/RNQuickCrypto.js\";\n\nexport type BaseReactNativeContextOptions = {\n sync: SyncConfig;\n reconnectionTimeout?: number;\n storage?: SQLiteDatabaseDriverAsync | \"disabled\";\n CryptoProvider?: typeof PureJSCrypto | typeof RNQuickCrypto;\n authSecretStorage: AuthSecretStorage;\n};\n\nclass ReactNativeWebSocketPeerWithReconnection extends WebSocketPeerWithReconnection {\n onNetworkChange(callback: (connected: boolean) => void): () => void {\n return NetInfo.addEventListener((state) =>\n callback(state.isConnected ?? false),\n );\n }\n}\n\nasync function setupPeers(options: BaseReactNativeContextOptions) {\n const CryptoProvider = options.CryptoProvider || PureJSCrypto;\n const crypto = await CryptoProvider.create();\n let node: LocalNode | undefined = undefined;\n\n const peersToLoadFrom: Peer[] = [];\n\n if (options.storage && options.storage !== \"disabled\") {\n const storage = await SQLiteReactNative.asPeer({\n adapter: options.storage,\n });\n peersToLoadFrom.push(storage);\n }\n\n if (options.sync.when === \"never\") {\n return {\n toggleNetwork: () => {},\n peersToLoadFrom,\n setNode: () => {},\n crypto,\n };\n }\n\n const wsPeer = new ReactNativeWebSocketPeerWithReconnection({\n peer: options.sync.peer,\n reconnectionTimeout: options.reconnectionTimeout,\n addPeer: (peer) => {\n if (node) {\n node.syncManager.addPeer(peer);\n } else {\n peersToLoadFrom.push(peer);\n }\n },\n removePeer: (peer) => {\n peersToLoadFrom.splice(peersToLoadFrom.indexOf(peer), 1);\n },\n });\n\n function toggleNetwork(enabled: boolean) {\n if (enabled) {\n wsPeer.enable();\n } else {\n wsPeer.disable();\n }\n }\n\n function setNode(value: LocalNode) {\n node = value;\n }\n\n if (options.sync.when === \"always\" || !options.sync.when) {\n toggleNetwork(true);\n }\n\n return {\n toggleNetwork,\n peersToLoadFrom,\n setNode,\n crypto,\n };\n}\n\nexport async function createJazzReactNativeGuestContext(\n options: BaseReactNativeContextOptions,\n) {\n const { toggleNetwork, peersToLoadFrom, setNode, crypto } =\n await setupPeers(options);\n\n const context = await createAnonymousJazzContext({\n crypto,\n peersToLoadFrom,\n });\n\n setNode(context.agent.node);\n\n options.authSecretStorage.emitUpdate(null);\n\n return {\n guest: context.agent,\n node: context.agent.node,\n done: () => {\n // TODO: Sync all the covalues before closing the connection & context\n toggleNetwork(false);\n context.done();\n },\n logOut: () => {\n return context.logOut();\n },\n };\n}\n\nexport type ReactNativeContextOptions<\n S extends\n | (AccountClass<Account> & CoValueFromRaw<Account>)\n | AnyAccountSchema,\n> = {\n credentials?: AuthCredentials;\n AccountSchema?: S;\n newAccountProps?: NewAccountProps;\n defaultProfileName?: string;\n} & BaseReactNativeContextOptions;\n\nexport async function createJazzReactNativeContext<\n S extends\n | (AccountClass<Account> & CoValueFromRaw<Account>)\n | AnyAccountSchema,\n>(options: ReactNativeContextOptions<S>) {\n const { toggleNetwork, peersToLoadFrom, setNode, crypto } =\n await setupPeers(options);\n\n let unsubscribeAuthUpdate = () => {};\n\n if (options.sync.when === \"signedUp\") {\n const authSecretStorage = options.authSecretStorage;\n const credentials = options.credentials ?? (await authSecretStorage.get());\n\n // To update the internal state with the current credentials\n authSecretStorage.emitUpdate(credentials);\n\n function handleAuthUpdate(isAuthenticated: boolean) {\n if (isAuthenticated) {\n toggleNetwork(true);\n } else {\n toggleNetwork(false);\n }\n }\n\n unsubscribeAuthUpdate = authSecretStorage.onUpdate(handleAuthUpdate);\n handleAuthUpdate(authSecretStorage.isAuthenticated);\n }\n\n const context = await createJazzContext({\n credentials: options.credentials,\n newAccountProps: options.newAccountProps,\n peersToLoadFrom,\n crypto,\n defaultProfileName: options.defaultProfileName,\n AccountSchema: options.AccountSchema,\n sessionProvider: provideLockSession,\n authSecretStorage: options.authSecretStorage,\n });\n\n setNode(context.node);\n\n return {\n me: context.account,\n node: context.node,\n authSecretStorage: context.authSecretStorage,\n done: () => {\n // TODO: Sync all the covalues before closing the connection & context\n toggleNetwork(false);\n unsubscribeAuthUpdate();\n context.done();\n },\n logOut: () => {\n unsubscribeAuthUpdate();\n return context.logOut();\n },\n };\n}\n\n/** @category Auth Providers */\nexport type SessionProvider = (\n accountID: ID<Account> | AgentID,\n) => Promise<SessionID>;\n\nexport async function provideLockSession(\n accountID: ID<Account> | AgentID,\n crypto: CryptoProvider,\n) {\n const sessionDone = () => {};\n\n const kvStore = KvStoreContext.getInstance().getStorage();\n\n const sessionID =\n ((await kvStore.get(accountID)) as SessionID) ||\n crypto.newRandomSessionID(accountID as RawAccountID | AgentID);\n await kvStore.set(accountID, sessionID);\n\n return Promise.resolve({\n sessionID,\n sessionDone,\n });\n}\n\n/** @category Invite Links */\nexport function createInviteLink<C extends CoValue>(\n value: C,\n role: \"reader\" | \"writer\" | \"admin\",\n { baseURL, valueHint }: { baseURL?: string; valueHint?: string } = {},\n): string {\n return baseCreateInviteLink(value, role, baseURL ?? \"\", valueHint);\n}\n\nexport function setupKvStore(\n kvStore: KvStore | undefined,\n): KvStore | undefined {\n if (!kvStore) {\n return undefined;\n }\n KvStoreContext.getInstance().initialize(kvStore);\n return kvStore;\n}\n","export interface KvStore {\n get(key: string): Promise<string | null>;\n set(key: string, value: string): Promise<void>;\n delete(key: string): Promise<void>;\n clearAll(): Promise<void>;\n}\n\nexport class KvStoreContext {\n private static instance: KvStoreContext;\n private storageInstance: KvStore | null = null;\n\n private constructor() {}\n\n public static getInstance(): KvStoreContext {\n if (!KvStoreContext.instance) {\n KvStoreContext.instance = new KvStoreContext();\n }\n return KvStoreContext.instance;\n }\n\n public isInitialized(): boolean {\n return this.storageInstance !== null;\n }\n\n public initialize(store: KvStore): void {\n if (!this.storageInstance) {\n this.storageInstance = store;\n }\n }\n\n public getStorage(): KvStore {\n if (!this.storageInstance) {\n throw new Error(\"Storage instance is not initialized.\");\n }\n return this.storageInstance;\n }\n}\n\nexport default KvStoreContext;\n","import { type Peer } from \"cojson\";\nimport { SQLiteDatabaseDriverAsync, SQLiteNodeBaseAsync } from \"cojson-storage\";\n\nexport interface SQLiteConfig {\n adapter: SQLiteDatabaseDriverAsync;\n}\n\nexport class SQLiteReactNative extends SQLiteNodeBaseAsync {\n static async asPeer(config: SQLiteConfig): Promise<Peer> {\n if (!config.adapter) {\n throw new Error(\"SQLite adapter is required\");\n }\n\n return SQLiteNodeBaseAsync.create({\n db: config.adapter,\n localNodeName: \"localNode\",\n });\n }\n}\n","import { useDemoAuth } from \"jazz-tools/react-core\";\nimport React, { useState } from \"react\";\nimport {\n StyleSheet,\n Text,\n TextInput,\n TouchableOpacity,\n View,\n useColorScheme,\n} from \"react-native\";\n\nexport const DemoAuthBasicUI = ({\n appName,\n auth,\n children,\n}: {\n appName: string;\n auth: ReturnType<typeof useDemoAuth>;\n children: React.ReactNode;\n}) => {\n const colorScheme = useColorScheme();\n const darkMode = colorScheme === \"dark\";\n const [username, setUsername] = useState<string>(\"\");\n const [errorMessage, setErrorMessage] = useState<string | null>(null);\n\n const handleSignUp = () => {\n setErrorMessage(null);\n\n auth.signUp(username).catch((error) => {\n setErrorMessage(error.message);\n });\n };\n\n const handleLogIn = (username: string) => {\n setErrorMessage(null);\n\n auth.logIn(username).catch((error) => {\n setErrorMessage(error.message);\n });\n };\n\n if (auth.state === \"signedIn\") {\n return children;\n }\n\n return (\n <View\n style={[\n styles.container,\n darkMode ? styles.darkBackground : styles.lightBackground,\n ]}\n >\n <View style={styles.formContainer}>\n <Text\n style={[\n styles.headerText,\n darkMode ? styles.darkText : styles.lightText,\n ]}\n >\n {appName}\n </Text>\n\n {errorMessage && <Text style={styles.errorText}>{errorMessage}</Text>}\n\n <TextInput\n placeholder=\"Display name\"\n value={username}\n onChangeText={setUsername}\n placeholderTextColor={darkMode ? \"#fff\" : \"#000\"}\n style={[\n styles.textInput,\n darkMode ? styles.darkInput : styles.lightInput,\n ]}\n />\n\n <TouchableOpacity\n onPress={handleSignUp}\n style={[\n styles.button,\n darkMode ? styles.darkButton : styles.lightButton,\n ]}\n >\n <Text\n style={darkMode ? styles.darkButtonText : styles.lightButtonText}\n >\n Sign Up as new account\n </Text>\n </TouchableOpacity>\n\n <View style={styles.existingUsersContainer}>\n {auth.existingUsers.map((user) => (\n <TouchableOpacity\n key={user}\n onPress={() => handleLogIn(user)}\n style={[\n styles.existingUserButton,\n darkMode ? styles.darkUserButton : styles.lightUserButton,\n ]}\n >\n <Text style={darkMode ? styles.darkText : styles.lightText}>\n Log In as \"{user}\"\n </Text>\n </TouchableOpacity>\n ))}\n </View>\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 20,\n },\n formContainer: {\n width: \"80%\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n headerText: {\n fontSize: 24,\n marginBottom: 20,\n },\n errorText: {\n color: \"red\",\n marginVertical: 5,\n textAlign: \"center\",\n },\n textInput: {\n borderWidth: 1,\n padding: 10,\n marginVertical: 10,\n width: \"100%\",\n borderRadius: 6,\n },\n darkInput: {\n borderColor: \"#444\",\n backgroundColor: \"#000\",\n color: \"#fff\",\n },\n lightInput: {\n borderColor: \"#ddd\",\n backgroundColor: \"#fff\",\n color: \"#000\",\n },\n button: {\n paddingVertical: 15,\n paddingHorizontal: 10,\n borderRadius: 6,\n width: \"100%\",\n marginVertical: 10,\n },\n darkButton: {\n backgroundColor: \"#444\",\n },\n lightButton: {\n backgroundColor: \"#ddd\",\n },\n darkButtonText: {\n color: \"#fff\",\n textAlign: \"center\",\n },\n lightButtonText: {\n color: \"#000\",\n textAlign: \"center\",\n },\n existingUsersContainer: {\n width: \"100%\",\n marginTop: 20,\n },\n existingUserButton: {\n paddingVertical: 15,\n paddingHorizontal: 10,\n borderRadius: 6,\n marginVertical: 5,\n },\n darkUserButton: {\n backgroundColor: \"#222\",\n },\n lightUserButton: {\n backgroundColor: \"#eee\",\n },\n loadingText: {\n fontSize: 18,\n color: \"#888\",\n },\n darkText: {\n color: \"#fff\",\n },\n lightText: {\n color: \"#000\",\n },\n darkBackground: {\n backgroundColor: \"#000\",\n },\n lightBackground: {\n backgroundColor: \"#fff\",\n },\n});\n","import { KvStoreContext } from \"../storage/kv-store-context.js\";\n\nexport * from \"./DemoAuthUI.js\";\n\nexport function clearUserCredentials() {\n const kvStore = KvStoreContext.getInstance().getStorage();\n\n // TODO: Migrate the Auth methods to use the same storage key/interface\n return Promise.all([\n kvStore.delete(\"demo-auth-logged-in-secret\"),\n kvStore.delete(\"jazz-clerk-auth\"),\n kvStore.delete(\"jazz-logged-in-secret\"),\n ]);\n}\n","import { useEffect } from \"react\";\n\nimport { CoValueOrZodSchema, parseInviteLink } from \"jazz-tools\";\nimport { useJazzContext } from \"jazz-tools/react-core\";\nimport { Linking } from \"react-native\";\n\nexport {\n useCoState,\n experimental_useInboxSender,\n useDemoAuth,\n usePassphraseAuth,\n useJazzContext,\n useAuthSecretStorage,\n useIsAuthenticated,\n useAccount,\n} from \"jazz-tools/react-core\";\n\nexport function useAcceptInviteNative<S extends CoValueOrZodSchema>({\n invitedObjectSchema,\n onAccept,\n forValueHint,\n}: {\n invitedObjectSchema: S;\n onAccept: (projectID: string) => void;\n forValueHint?: string;\n}): void {\n const context = useJazzContext();\n\n if (!(\"me\" in context)) {\n throw new Error(\n \"useAcceptInviteNative can't be used in a JazzProvider with auth === 'guest'.\",\n );\n }\n\n useEffect(() => {\n const handleDeepLink = ({ url }: { url: string }) => {\n const result = parseInviteLink(url);\n if (result && result.valueHint === forValueHint) {\n context.me\n .acceptInvite(\n result.valueID,\n result.inviteSecret,\n invitedObjectSchema,\n )\n .then(() => {\n onAccept(result.valueID);\n })\n .catch((e) => {\n console.error(\"Failed to accept invite\", e);\n });\n }\n };\n\n const linkingListener = Linking.addEventListener(\"url\", handleDeepLink);\n\n void Linking.getInitialURL().then((url) => {\n if (url) handleDeepLink({ url });\n });\n\n return () => {\n linkingListener.remove();\n };\n }, [context, onAccept, invitedObjectSchema, forValueHint]);\n}\n","import { ImageDefinition, Loaded } from \"jazz-tools\";\nimport React, { useEffect, useState } from \"react\";\n\n/** @category Media */\nexport function useProgressiveImgNative({\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 && highestRes.res !== lastHighestRes) {\n lastHighestRes = highestRes.res;\n // use the base64 data directly\n const chunks = highestRes.stream.getChunks();\n if (chunks?.chunks && chunks.chunks.length > 0) {\n // convert chunks to base64\n const totalLength = chunks.chunks.reduce(\n (acc, chunk) => acc + chunk.length,\n 0,\n );\n const combinedArray = new Uint8Array(totalLength);\n let offset = 0;\n chunks.chunks.forEach((chunk) => {\n combinedArray.set(chunk, offset);\n offset += chunk.length;\n });\n\n // Create data URL\n const base64 = btoa(\n Array.from(combinedArray, (byte) => String.fromCharCode(byte)).join(\n \"\",\n ),\n );\n const dataUrl = `data:${chunks.mimeType};base64,${base64}`;\n\n setCurrent({\n src: dataUrl,\n res: highestRes.res,\n });\n } else {\n // Fallback to placeholder if chunks aren't available\n console.warn(\"No chunks available for image\", image.id);\n setCurrent({\n src: update?.placeholderDataURL,\n res: \"placeholder\",\n });\n }\n } else if (!highestRes) {\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 ProgressiveImgNative({\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}) {\n const result = useProgressiveImgNative({ image, maxWidth, targetWidth });\n return result && children(result);\n}\n","export * from \"./provider.js\";\nexport * from \"./auth/auth.js\";\nexport * from \"./hooks.js\";\nexport * from \"./media.js\";\nexport * from \"./storage/kv-store-context.js\";\n\nexport { SQLiteDatabaseDriverAsync } from \"cojson-storage\";\nexport { parseInviteLink } from \"jazz-tools\";\nexport { createInviteLink, setupKvStore } from \"./platform.js\";\n"],"mappings":";AASA,SAAS,aAAa,iCAAiC;AACvD,OAAO,SAAS,WAAW,cAAc;;;ACVzC;AAAA,EAIE;AAAA,OAGK;;;ACPP,OAAO,aAAa;AAEpB,SAAS,oBAAoB;AAC7B;AAAA,EAiBE,oBAAoB;AAAA,EACpB;AAAA,EACA;AAAA,OACK;;;AChBA,IAAM,iBAAN,MAAM,gBAAe;AAAA,EAIlB,cAAc;AAFtB,SAAQ,kBAAkC;AAAA,EAEnB;AAAA,EAEvB,OAAc,cAA8B;AAC1C,QAAI,CAAC,gBAAe,UAAU;AAC5B,sBAAe,WAAW,IAAI,gBAAe;AAAA,IAC/C;AACA,WAAO,gBAAe;AAAA,EACxB;AAAA,EAEO,gBAAyB;AAC9B,WAAO,KAAK,oBAAoB;AAAA,EAClC;AAAA,EAEO,WAAW,OAAsB;AACtC,QAAI,CAAC,KAAK,iBAAiB;AACzB,WAAK,kBAAkB;AAAA,IACzB;AAAA,EACF;AAAA,EAEO,aAAsB;AAC3B,QAAI,CAAC,KAAK,iBAAiB;AACzB,YAAM,IAAI,MAAM,sCAAsC;AAAA,IACxD;AACA,WAAO,KAAK;AAAA,EACd;AACF;;;ACnCA,SAAoC,2BAA2B;AAMxD,IAAM,oBAAN,cAAgC,oBAAoB;AAAA,EACzD,aAAa,OAAO,QAAqC;AACvD,QAAI,CAAC,OAAO,SAAS;AACnB,YAAM,IAAI,MAAM,4BAA4B;AAAA,IAC9C;AAEA,WAAO,oBAAoB,OAAO;AAAA,MAChC,IAAI,OAAO;AAAA,MACX,eAAe;AAAA,IACjB,CAAC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IAAI,WAAW,WAAW;AAChD,cAAI,SAAS;AACb,iBAAO,OAAO,QAAQ,CAAC,UAAU;AAC/B,0BAAc,IAAI,OAAO,MAAM;AAC/B,sBAAU,MAAM;AAAA,UAClB,CAAC;AAGD,gBAAM,SAAS;AAAA,YACb,MAAM,KAAK,eAAe,CAAC,SAAS,OAAO,aAAa,IAAI,CAAC,EAAE;AAAA,cAC7D;AAAA,YACF;AAAA,UACF;AACA,gBAAM,UAAU,QAAQ,OAAO,QAAQ,WAAW,MAAM;AAExD,qBAAW;AAAA,YACT,KAAK;AAAA,YACL,KAAK,WAAW;AAAA,UAClB,CAAC;AAAA,QACH,OAAO;AAEL,kBAAQ,KAAK,iCAAiC,MAAM,EAAE;AACtD,qBAAW;AAAA,YACT,KAAK,QAAQ;AAAA,YACb,KAAK;AAAA,UACP,CAAC;AAAA,QACH;AAAA,MACF,WAAW,CAAC,YAAY;AACtB,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,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASG;AACD,QAAM,SAAS,wBAAwB,EAAE,OAAO,UAAU,YAAY,CAAC;AACvE,SAAO,UAAU,SAAS,MAAM;AAClC;;;AC5FA,SAAS,6BAAAE,kCAAiC;AAC1C,SAAS,mBAAAC,wBAAuB;","names":["CryptoProvider","handleAuthUpdate","AccountSchema","CryptoProvider","jsx","username","useEffect","useJazzContext","useEffect","useState","SQLiteDatabaseDriverAsync","parseInviteLink"]}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { ImageDefinition, Loaded } from "jazz-tools";
|
2
|
+
import React from "react";
|
3
|
+
/** @category Media */
|
4
|
+
export declare function useProgressiveImgNative({ 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 ProgressiveImgNative({ 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-native-core/media.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,sBAAsB;AACtB,wBAAgB,uBAAuB,CAAC,EACtC,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;;;;EAkEA;AAED,sBAAsB;AACtB,wBAAgB,oBAAoB,CAAC,EACnC,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,mBAGA"}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { LocalNode, RawAccountID } from "cojson";
|
2
|
+
import { PureJSCrypto } from "cojson/dist/crypto/PureJSCrypto";
|
3
|
+
import { Account, AccountClass, AgentID, AnyAccountSchema, AuthCredentials, AuthSecretStorage, CoValue, CoValueFromRaw, CryptoProvider, ID, InstanceOfSchema, NewAccountProps, SessionID, SyncConfig } from "jazz-tools";
|
4
|
+
import { KvStore } from "./storage/kv-store-context.js";
|
5
|
+
import { SQLiteDatabaseDriverAsync } from "cojson-storage";
|
6
|
+
import type { RNQuickCrypto } from "./crypto/RNQuickCrypto.js";
|
7
|
+
export type BaseReactNativeContextOptions = {
|
8
|
+
sync: SyncConfig;
|
9
|
+
reconnectionTimeout?: number;
|
10
|
+
storage?: SQLiteDatabaseDriverAsync | "disabled";
|
11
|
+
CryptoProvider?: typeof PureJSCrypto | typeof RNQuickCrypto;
|
12
|
+
authSecretStorage: AuthSecretStorage;
|
13
|
+
};
|
14
|
+
export declare function createJazzReactNativeGuestContext(options: BaseReactNativeContextOptions): Promise<{
|
15
|
+
guest: import("jazz-tools").AnonymousJazzAgent;
|
16
|
+
node: LocalNode;
|
17
|
+
done: () => void;
|
18
|
+
logOut: () => Promise<void>;
|
19
|
+
}>;
|
20
|
+
export type ReactNativeContextOptions<S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema> = {
|
21
|
+
credentials?: AuthCredentials;
|
22
|
+
AccountSchema?: S;
|
23
|
+
newAccountProps?: NewAccountProps;
|
24
|
+
defaultProfileName?: string;
|
25
|
+
} & BaseReactNativeContextOptions;
|
26
|
+
export declare function createJazzReactNativeContext<S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema>(options: ReactNativeContextOptions<S>): Promise<{
|
27
|
+
me: InstanceOfSchema<S>;
|
28
|
+
node: LocalNode;
|
29
|
+
authSecretStorage: AuthSecretStorage;
|
30
|
+
done: () => void;
|
31
|
+
logOut: () => Promise<void>;
|
32
|
+
}>;
|
33
|
+
/** @category Auth Providers */
|
34
|
+
export type SessionProvider = (accountID: ID<Account> | AgentID) => Promise<SessionID>;
|
35
|
+
export declare function provideLockSession(accountID: ID<Account> | AgentID, crypto: CryptoProvider): Promise<{
|
36
|
+
sessionID: `${RawAccountID}_session_z${string}` | `sealer_z${string}/signer_z${string}_session_z${string}`;
|
37
|
+
sessionDone: () => void;
|
38
|
+
}>;
|
39
|
+
/** @category Invite Links */
|
40
|
+
export declare function createInviteLink<C extends CoValue>(value: C, role: "reader" | "writer" | "admin", { baseURL, valueHint }?: {
|
41
|
+
baseURL?: string;
|
42
|
+
valueHint?: string;
|
43
|
+
}): string;
|
44
|
+
export declare function setupKvStore(kvStore: KvStore | undefined): KvStore | undefined;
|
45
|
+
//# sourceMappingURL=platform.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/react-native-core/platform.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAQ,YAAY,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACL,OAAO,EACP,YAAY,EAEZ,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,OAAO,EAEP,cAAc,EACd,cAAc,EACd,EAAE,EACF,gBAAgB,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,GAAG,OAAO,EAChC,MAAM,EAAE,cAAc;;;GAevB;AAED,6BAA6B;AAC7B,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,EAChD,KAAK,EAAE,CAAC,EACR,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,EACnC,EAAE,OAAO,EAAE,SAAS,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACpE,MAAM,CAER;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,OAAO,GAAG,SAAS,CAMrB"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Account, AccountClass, AnyAccountSchema, CoValueFromRaw, KvStore } from "jazz-tools";
|
2
|
+
import React from "react";
|
3
|
+
import { JazzContextManagerProps } from "./ReactNativeContextManager.js";
|
4
|
+
export type JazzProviderProps<S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema> = {
|
5
|
+
children: React.ReactNode;
|
6
|
+
kvStore?: KvStore;
|
7
|
+
} & JazzContextManagerProps<S>;
|
8
|
+
/** @category Context & Hooks */
|
9
|
+
export declare function JazzProviderCore<S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema>({ children, guestMode, sync, storage, AccountSchema, defaultProfileName, onLogOut, kvStore, onAnonymousAccountDiscarded, CryptoProvider, logOutReplacement, }: 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-native-core/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,cAAc,EAGd,OAAO,EACR,MAAM,YAAY,CAAC;AAEpB,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,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,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAE/B,gCAAgC;AAChC,wBAAgB,gBAAgB,CAC9B,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,OAAO,EACP,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,GAClB,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAiEtB"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export interface KvStore {
|
2
|
+
get(key: string): Promise<string | null>;
|
3
|
+
set(key: string, value: string): Promise<void>;
|
4
|
+
delete(key: string): Promise<void>;
|
5
|
+
clearAll(): Promise<void>;
|
6
|
+
}
|
7
|
+
export declare class KvStoreContext {
|
8
|
+
private static instance;
|
9
|
+
private storageInstance;
|
10
|
+
private constructor();
|
11
|
+
static getInstance(): KvStoreContext;
|
12
|
+
isInitialized(): boolean;
|
13
|
+
initialize(store: KvStore): void;
|
14
|
+
getStorage(): KvStore;
|
15
|
+
}
|
16
|
+
export default KvStoreContext;
|
17
|
+
//# sourceMappingURL=kv-store-context.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"kv-store-context.d.ts","sourceRoot":"","sources":["../../../src/react-native-core/storage/kv-store-context.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;IACxC,OAAO,CAAC,eAAe,CAAwB;IAE/C,OAAO;WAEO,WAAW,IAAI,cAAc;IAOpC,aAAa,IAAI,OAAO;IAIxB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAMhC,UAAU,IAAI,OAAO;CAM7B;AAED,eAAe,cAAc,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { type Peer } from "cojson";
|
2
|
+
import { SQLiteDatabaseDriverAsync, SQLiteNodeBaseAsync } from "cojson-storage";
|
3
|
+
export interface SQLiteConfig {
|
4
|
+
adapter: SQLiteDatabaseDriverAsync;
|
5
|
+
}
|
6
|
+
export declare class SQLiteReactNative extends SQLiteNodeBaseAsync {
|
7
|
+
static asPeer(config: SQLiteConfig): Promise<Peer>;
|
8
|
+
}
|
9
|
+
//# sourceMappingURL=sqlite-react-native.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sqlite-react-native.d.ts","sourceRoot":"","sources":["../../../src/react-native-core/storage/sqlite-react-native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEhF,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,yBAAyB,CAAC;CACpC;AAED,qBAAa,iBAAkB,SAAQ,mBAAmB;WAC3C,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAUzD"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/react-native-core/testing.tsx"],"sourcesContent":["export * from \"jazz-tools/react-core/testing\";\n"],"mappings":";AAAA,cAAc;","names":[]}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Account, Group, ImageDefinition, Loaded } from "jazz-tools";
|
2
|
+
/** @category Image creation */
|
3
|
+
export declare function createImageNative(base64ImageDataURI: string, options?: {
|
4
|
+
owner?: Group | Account;
|
5
|
+
maxSize?: 256 | 1024 | 2048;
|
6
|
+
}): Promise<Loaded<typeof ImageDefinition>>;
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-native-media-images/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EAEP,KAAK,EACL,eAAe,EACf,MAAM,EACP,MAAM,YAAY,CAAC;AAwFpB,+BAA+B;AAC/B,wBAAsB,iBAAiB,CACrC,kBAAkB,EAAE,MAAM,EAC1B,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;CACxB,GACL,OAAO,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC,CAsIzC"}
|
@@ -0,0 +1,177 @@
|
|
1
|
+
// src/react-native-media-images/index.ts
|
2
|
+
import ImageResizer from "@bam.tech/react-native-image-resizer";
|
3
|
+
import * as FileSystem from "expo-file-system";
|
4
|
+
import {
|
5
|
+
FileStream,
|
6
|
+
ImageDefinition
|
7
|
+
} from "jazz-tools";
|
8
|
+
import { Image } from "react-native";
|
9
|
+
function arrayBuffer(blob) {
|
10
|
+
return new Promise((resolve, reject) => {
|
11
|
+
const reader = new FileReader();
|
12
|
+
reader.onloadend = () => {
|
13
|
+
resolve(reader.result);
|
14
|
+
};
|
15
|
+
reader.onerror = (error) => {
|
16
|
+
reject(error);
|
17
|
+
};
|
18
|
+
reader.readAsArrayBuffer(blob);
|
19
|
+
});
|
20
|
+
}
|
21
|
+
async function fileUriToBlob(uri) {
|
22
|
+
try {
|
23
|
+
const response = await fetch(uri);
|
24
|
+
const blob = await response.blob();
|
25
|
+
blob.arrayBuffer = () => arrayBuffer(blob);
|
26
|
+
return blob;
|
27
|
+
} catch (error) {
|
28
|
+
console.error("Failed to convert file URI to Blob:", error);
|
29
|
+
throw new Error("Failed to convert file URI to Blob");
|
30
|
+
}
|
31
|
+
}
|
32
|
+
async function convertFileContentsToBase64DataURI(fileUri, contentType) {
|
33
|
+
try {
|
34
|
+
const base64 = await FileSystem.readAsStringAsync(fileUri, {
|
35
|
+
encoding: FileSystem.EncodingType.Base64
|
36
|
+
});
|
37
|
+
return `data:${contentType};base64,${base64}`;
|
38
|
+
} catch (error) {
|
39
|
+
console.error("Failed to convert file to base64:", error);
|
40
|
+
return null;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
function base64DataURIToParts(base64Data) {
|
44
|
+
const parts = base64Data.split(",");
|
45
|
+
const contentType = parts[0]?.split(":")?.[1]?.split(";")?.[0] || "";
|
46
|
+
const data = parts[1] || "";
|
47
|
+
return { contentType, data };
|
48
|
+
}
|
49
|
+
function contentTypeToFormat(contentType) {
|
50
|
+
if (contentType.includes("image/png")) return "PNG";
|
51
|
+
if (contentType.includes("image/jpeg")) return "JPEG";
|
52
|
+
if (contentType.includes("image/webp")) return "WEBP";
|
53
|
+
return "PNG";
|
54
|
+
}
|
55
|
+
async function base64DataURIToBlob(base64Data) {
|
56
|
+
const { contentType, data } = base64DataURIToParts(base64Data);
|
57
|
+
const byteCharacters = atob(data);
|
58
|
+
const byteNumbers = new Array(byteCharacters.length);
|
59
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
60
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
61
|
+
}
|
62
|
+
const byteArray = new Uint8Array(byteNumbers);
|
63
|
+
const blob = new Blob(byteArray, { type: contentType });
|
64
|
+
blob.arrayBuffer = () => arrayBuffer(blob);
|
65
|
+
return blob;
|
66
|
+
}
|
67
|
+
async function getImageDimensions(uri) {
|
68
|
+
return new Promise((resolve, reject) => {
|
69
|
+
Image.getSize(
|
70
|
+
uri,
|
71
|
+
(width, height) => resolve({ width, height }),
|
72
|
+
(error) => {
|
73
|
+
console.error("Failed to get image dimensions:", error);
|
74
|
+
reject(new Error("Failed to get image dimensions"));
|
75
|
+
}
|
76
|
+
);
|
77
|
+
});
|
78
|
+
}
|
79
|
+
async function createImageNative(base64ImageDataURI, options = {}) {
|
80
|
+
try {
|
81
|
+
const { contentType } = base64DataURIToParts(base64ImageDataURI);
|
82
|
+
const format = contentTypeToFormat(contentType);
|
83
|
+
let originalWidth, originalHeight;
|
84
|
+
try {
|
85
|
+
({ width: originalWidth, height: originalHeight } = await getImageDimensions(base64ImageDataURI));
|
86
|
+
} catch (error) {
|
87
|
+
console.error("Error getting image dimensions:", error);
|
88
|
+
throw new Error("Failed to get image dimensions");
|
89
|
+
}
|
90
|
+
let placeholderImage;
|
91
|
+
try {
|
92
|
+
placeholderImage = await ImageResizer.createResizedImage(
|
93
|
+
base64ImageDataURI,
|
94
|
+
8,
|
95
|
+
8,
|
96
|
+
format,
|
97
|
+
100,
|
98
|
+
0
|
99
|
+
);
|
100
|
+
} catch (error) {
|
101
|
+
console.error("Error creating placeholder image:", error);
|
102
|
+
throw new Error("Failed to create placeholder image");
|
103
|
+
}
|
104
|
+
const placeholderDataURL = await convertFileContentsToBase64DataURI(
|
105
|
+
placeholderImage.uri,
|
106
|
+
contentType
|
107
|
+
);
|
108
|
+
if (!placeholderDataURL) {
|
109
|
+
throw new Error("Failed to create placeholder data URL");
|
110
|
+
}
|
111
|
+
const imageDefinition = ImageDefinition.create(
|
112
|
+
{
|
113
|
+
originalSize: [originalWidth, originalHeight],
|
114
|
+
placeholderDataURL
|
115
|
+
},
|
116
|
+
options.owner
|
117
|
+
);
|
118
|
+
const addImageStream = async (width, height, label) => {
|
119
|
+
try {
|
120
|
+
const resizedImage = await ImageResizer.createResizedImage(
|
121
|
+
base64ImageDataURI,
|
122
|
+
width,
|
123
|
+
height,
|
124
|
+
format,
|
125
|
+
80,
|
126
|
+
0
|
127
|
+
);
|
128
|
+
const binaryStream = await FileStream.createFromBlob(
|
129
|
+
await fileUriToBlob(resizedImage.uri),
|
130
|
+
imageDefinition._owner
|
131
|
+
);
|
132
|
+
imageDefinition[label] = binaryStream;
|
133
|
+
} catch (error) {
|
134
|
+
console.error(`Error adding image stream for ${label}:`, error);
|
135
|
+
throw new Error(`Failed to add image stream for ${label}`);
|
136
|
+
}
|
137
|
+
};
|
138
|
+
if (originalWidth > 256 || originalHeight > 256) {
|
139
|
+
const width = originalWidth > originalHeight ? 256 : Math.round(256 * (originalWidth / originalHeight));
|
140
|
+
const height = originalHeight > originalWidth ? 256 : Math.round(256 * (originalHeight / originalWidth));
|
141
|
+
await addImageStream(width, height, `${width}x${height}`);
|
142
|
+
}
|
143
|
+
if (options.maxSize === 256) return imageDefinition;
|
144
|
+
if (originalWidth > 1024 || originalHeight > 1024) {
|
145
|
+
const width = originalWidth > originalHeight ? 1024 : Math.round(1024 * (originalWidth / originalHeight));
|
146
|
+
const height = originalHeight > originalWidth ? 1024 : Math.round(1024 * (originalHeight / originalWidth));
|
147
|
+
await addImageStream(width, height, `${width}x${height}`);
|
148
|
+
}
|
149
|
+
if (options.maxSize === 1024) return imageDefinition;
|
150
|
+
if (originalWidth > 2048 || originalHeight > 2048) {
|
151
|
+
const width = originalWidth > originalHeight ? 2048 : Math.round(2048 * (originalWidth / originalHeight));
|
152
|
+
const height = originalHeight > originalWidth ? 2048 : Math.round(2048 * (originalHeight / originalWidth));
|
153
|
+
await addImageStream(width, height, `${width}x${height}`);
|
154
|
+
}
|
155
|
+
if (options.maxSize === 2048) return imageDefinition;
|
156
|
+
if (options.maxSize === void 0 || options.maxSize > 2048) {
|
157
|
+
try {
|
158
|
+
const originalBinaryStream = await FileStream.createFromBlob(
|
159
|
+
await base64DataURIToBlob(base64ImageDataURI),
|
160
|
+
imageDefinition._owner
|
161
|
+
);
|
162
|
+
imageDefinition[`${originalWidth}x${originalHeight}`] = originalBinaryStream;
|
163
|
+
} catch (error) {
|
164
|
+
console.error("Error adding original image stream:", error);
|
165
|
+
throw new Error("Failed to add original image stream");
|
166
|
+
}
|
167
|
+
}
|
168
|
+
return imageDefinition;
|
169
|
+
} catch (error) {
|
170
|
+
console.error("Error in createImage:", error);
|
171
|
+
throw error;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
export {
|
175
|
+
createImageNative
|
176
|
+
};
|
177
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/react-native-media-images/index.ts"],"sourcesContent":["import ImageResizer from \"@bam.tech/react-native-image-resizer\";\nimport * as FileSystem from \"expo-file-system\";\nimport {\n Account,\n FileStream,\n Group,\n ImageDefinition,\n Loaded,\n} from \"jazz-tools\";\nimport { Image } from \"react-native\";\n\nfunction arrayBuffer(blob: Blob): Promise<ArrayBuffer> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n resolve(reader.result as ArrayBuffer);\n };\n reader.onerror = (error) => {\n reject(error);\n };\n reader.readAsArrayBuffer(blob);\n });\n}\n\nasync function fileUriToBlob(uri: string): Promise<Blob> {\n try {\n const response = await fetch(uri);\n const blob = await response.blob();\n blob.arrayBuffer = () => arrayBuffer(blob);\n return blob;\n } catch (error) {\n console.error(\"Failed to convert file URI to Blob:\", error);\n throw new Error(\"Failed to convert file URI to Blob\");\n }\n}\n\nasync function convertFileContentsToBase64DataURI(\n fileUri: string,\n contentType: string,\n) {\n try {\n const base64 = await FileSystem.readAsStringAsync(fileUri, {\n encoding: FileSystem.EncodingType.Base64,\n });\n return `data:${contentType};base64,${base64}`;\n } catch (error) {\n console.error(\"Failed to convert file to base64:\", error);\n return null;\n }\n}\n\nfunction base64DataURIToParts(base64Data: string) {\n const parts = base64Data.split(\",\");\n const contentType = parts[0]?.split(\":\")?.[1]?.split(\";\")?.[0] || \"\";\n const data = parts[1] || \"\";\n return { contentType, data };\n}\n\nfunction contentTypeToFormat(contentType: string) {\n if (contentType.includes(\"image/png\")) return \"PNG\";\n if (contentType.includes(\"image/jpeg\")) return \"JPEG\";\n if (contentType.includes(\"image/webp\")) return \"WEBP\";\n return \"PNG\";\n}\n\nasync function base64DataURIToBlob(base64Data: string) {\n const { contentType, data } = base64DataURIToParts(base64Data);\n const byteCharacters = atob(data);\n\n const byteNumbers = new Array(byteCharacters.length);\n for (let i = 0; i < byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n }\n const byteArray = new Uint8Array(byteNumbers);\n\n // @ts-expect-error byteArray has data\n const blob = new Blob(byteArray, { type: contentType });\n blob.arrayBuffer = () => arrayBuffer(blob);\n return blob;\n}\n\nasync function getImageDimensions(\n uri: string,\n): Promise<{ width: number; height: number }> {\n return new Promise((resolve, reject) => {\n Image.getSize(\n uri,\n (width, height) => resolve({ width, height }),\n (error) => {\n console.error(\"Failed to get image dimensions:\", error);\n reject(new Error(\"Failed to get image dimensions\"));\n },\n );\n });\n}\n\n/** @category Image creation */\nexport async function createImageNative(\n base64ImageDataURI: string,\n options: {\n owner?: Group | Account;\n maxSize?: 256 | 1024 | 2048;\n } = {},\n): Promise<Loaded<typeof ImageDefinition>> {\n try {\n const { contentType } = base64DataURIToParts(base64ImageDataURI);\n const format = contentTypeToFormat(contentType);\n\n let originalWidth, originalHeight;\n try {\n ({ width: originalWidth, height: originalHeight } =\n await getImageDimensions(base64ImageDataURI));\n } catch (error) {\n console.error(\"Error getting image dimensions:\", error);\n throw new Error(\"Failed to get image dimensions\");\n }\n\n let placeholderImage;\n try {\n placeholderImage = await ImageResizer.createResizedImage(\n base64ImageDataURI,\n 8,\n 8,\n format,\n 100,\n 0,\n );\n } catch (error) {\n console.error(\"Error creating placeholder image:\", error);\n throw new Error(\"Failed to create placeholder image\");\n }\n\n const placeholderDataURL = await convertFileContentsToBase64DataURI(\n placeholderImage.uri,\n contentType,\n );\n\n if (!placeholderDataURL) {\n throw new Error(\"Failed to create placeholder data URL\");\n }\n\n const imageDefinition = ImageDefinition.create(\n {\n originalSize: [originalWidth, originalHeight],\n placeholderDataURL,\n },\n options.owner,\n );\n\n const addImageStream = async (\n width: number,\n height: number,\n label: string,\n ) => {\n try {\n const resizedImage = await ImageResizer.createResizedImage(\n base64ImageDataURI,\n width,\n height,\n format,\n 80,\n 0,\n );\n\n const binaryStream = await FileStream.createFromBlob(\n await fileUriToBlob(resizedImage.uri),\n imageDefinition._owner,\n );\n\n imageDefinition[label] = binaryStream;\n } catch (error) {\n console.error(`Error adding image stream for ${label}:`, error);\n throw new Error(`Failed to add image stream for ${label}`);\n }\n };\n\n if (originalWidth > 256 || originalHeight > 256) {\n const width =\n originalWidth > originalHeight\n ? 256\n : Math.round(256 * (originalWidth / originalHeight));\n const height =\n originalHeight > originalWidth\n ? 256\n : Math.round(256 * (originalHeight / originalWidth));\n await addImageStream(width, height, `${width}x${height}`);\n }\n\n if (options.maxSize === 256) return imageDefinition;\n\n if (originalWidth > 1024 || originalHeight > 1024) {\n const width =\n originalWidth > originalHeight\n ? 1024\n : Math.round(1024 * (originalWidth / originalHeight));\n const height =\n originalHeight > originalWidth\n ? 1024\n : Math.round(1024 * (originalHeight / originalWidth));\n await addImageStream(width, height, `${width}x${height}`);\n }\n\n if (options.maxSize === 1024) return imageDefinition;\n\n if (originalWidth > 2048 || originalHeight > 2048) {\n const width =\n originalWidth > originalHeight\n ? 2048\n : Math.round(2048 * (originalWidth / originalHeight));\n const height =\n originalHeight > originalWidth\n ? 2048\n : Math.round(2048 * (originalHeight / originalWidth));\n await addImageStream(width, height, `${width}x${height}`);\n }\n\n if (options.maxSize === 2048) return imageDefinition;\n\n if (options.maxSize === undefined || options.maxSize > 2048) {\n try {\n const originalBinaryStream = await FileStream.createFromBlob(\n await base64DataURIToBlob(base64ImageDataURI),\n imageDefinition._owner,\n );\n imageDefinition[`${originalWidth}x${originalHeight}`] =\n originalBinaryStream;\n } catch (error) {\n console.error(\"Error adding original image stream:\", error);\n throw new Error(\"Failed to add original image stream\");\n }\n }\n\n return imageDefinition;\n } catch (error) {\n console.error(\"Error in createImage:\", error);\n throw error;\n }\n}\n"],"mappings":";AAAA,OAAO,kBAAkB;AACzB,YAAY,gBAAgB;AAC5B;AAAA,EAEE;AAAA,EAEA;AAAA,OAEK;AACP,SAAS,aAAa;AAEtB,SAAS,YAAY,MAAkC;AACrD,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,SAAS,IAAI,WAAW;AAC9B,WAAO,YAAY,MAAM;AACvB,cAAQ,OAAO,MAAqB;AAAA,IACtC;AACA,WAAO,UAAU,CAAC,UAAU;AAC1B,aAAO,KAAK;AAAA,IACd;AACA,WAAO,kBAAkB,IAAI;AAAA,EAC/B,CAAC;AACH;AAEA,eAAe,cAAc,KAA4B;AACvD,MAAI;AACF,UAAM,WAAW,MAAM,MAAM,GAAG;AAChC,UAAM,OAAO,MAAM,SAAS,KAAK;AACjC,SAAK,cAAc,MAAM,YAAY,IAAI;AACzC,WAAO;AAAA,EACT,SAAS,OAAO;AACd,YAAQ,MAAM,uCAAuC,KAAK;AAC1D,UAAM,IAAI,MAAM,oCAAoC;AAAA,EACtD;AACF;AAEA,eAAe,mCACb,SACA,aACA;AACA,MAAI;AACF,UAAM,SAAS,MAAiB,6BAAkB,SAAS;AAAA,MACzD,UAAqB,wBAAa;AAAA,IACpC,CAAC;AACD,WAAO,QAAQ,WAAW,WAAW,MAAM;AAAA,EAC7C,SAAS,OAAO;AACd,YAAQ,MAAM,qCAAqC,KAAK;AACxD,WAAO;AAAA,EACT;AACF;AAEA,SAAS,qBAAqB,YAAoB;AAChD,QAAM,QAAQ,WAAW,MAAM,GAAG;AAClC,QAAM,cAAc,M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>) | AnyAccountSchema">
|
2
|
+
import type { AuthSecretStorage, InstanceOfSchema } from "jazz-tools";
|
3
|
+
import {
|
4
|
+
Account,
|
5
|
+
type AccountClass,
|
6
|
+
type AnyAccountSchema,
|
7
|
+
type CoValueFromRaw,
|
8
|
+
} from "jazz-tools";
|
9
|
+
import {
|
10
|
+
JazzBrowserContextManager,
|
11
|
+
type JazzContextManagerProps,
|
12
|
+
} from "jazz-tools/browser";
|
13
|
+
import { type Snippet, setContext, untrack } from "svelte";
|
14
|
+
import { JAZZ_AUTH_CTX, JAZZ_CTX, type JazzContext } from "./jazz.svelte.js";
|
15
|
+
|
16
|
+
let props: JazzContextManagerProps<S> & { children?: Snippet } = $props();
|
17
|
+
|
18
|
+
const contextManager = new JazzBrowserContextManager<S>();
|
19
|
+
|
20
|
+
const ctx = $state<JazzContext<InstanceOfSchema<S>>>({ current: undefined });
|
21
|
+
|
22
|
+
setContext<JazzContext<InstanceOfSchema<S>>>(JAZZ_CTX, ctx);
|
23
|
+
setContext<AuthSecretStorage>(
|
24
|
+
JAZZ_AUTH_CTX,
|
25
|
+
contextManager.getAuthSecretStorage(),
|
26
|
+
);
|
27
|
+
|
28
|
+
$effect(() => {
|
29
|
+
props.sync.when;
|
30
|
+
props.sync.peer;
|
31
|
+
props.storage;
|
32
|
+
props.guestMode;
|
33
|
+
return untrack(() => {
|
34
|
+
if (!props.sync) return;
|
35
|
+
|
36
|
+
contextManager
|
37
|
+
.createContext({
|
38
|
+
sync: props.sync,
|
39
|
+
storage: props.storage,
|
40
|
+
guestMode: props.guestMode,
|
41
|
+
AccountSchema: props.AccountSchema,
|
42
|
+
defaultProfileName: props.defaultProfileName,
|
43
|
+
onAnonymousAccountDiscarded: props.onAnonymousAccountDiscarded,
|
44
|
+
onLogOut: props.onLogOut,
|
45
|
+
})
|
46
|
+
.catch((error) => {
|
47
|
+
console.error("Error creating Jazz browser context:", error);
|
48
|
+
});
|
49
|
+
});
|
50
|
+
});
|
51
|
+
|
52
|
+
$effect(() => {
|
53
|
+
return contextManager.subscribe(() => {
|
54
|
+
ctx.current = contextManager.getCurrentValue();
|
55
|
+
});
|
56
|
+
});
|
57
|
+
</script>
|
58
|
+
|
59
|
+
{#if ctx.current}
|
60
|
+
{@render props.children?.()}
|
61
|
+
{/if}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { Account, type AccountClass, type AnyAccountSchema, type CoValueFromRaw } from "jazz-tools";
|
2
|
+
declare class __sveltets_Render<S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema> {
|
3
|
+
props(): any;
|
4
|
+
events(): {};
|
5
|
+
slots(): {};
|
6
|
+
bindings(): "";
|
7
|
+
exports(): {};
|
8
|
+
}
|
9
|
+
interface $$IsomorphicComponent {
|
10
|
+
new <S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<S>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<S>['props']>, ReturnType<__sveltets_Render<S>['events']>, ReturnType<__sveltets_Render<S>['slots']>> & {
|
11
|
+
$$bindings?: ReturnType<__sveltets_Render<S>['bindings']>;
|
12
|
+
} & ReturnType<__sveltets_Render<S>['exports']>;
|
13
|
+
<S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema>(internal: unknown, props: ReturnType<__sveltets_Render<S>['props']> & {}): ReturnType<__sveltets_Render<S>['exports']>;
|
14
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
15
|
+
}
|
16
|
+
declare const Provider: $$IsomorphicComponent;
|
17
|
+
type Provider<S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema> = InstanceType<typeof Provider<S>>;
|
18
|
+
export default Provider;
|
19
|
+
//# sourceMappingURL=Provider.svelte.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Provider.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/Provider.svel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,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACxM,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD,QAAA,MAAM,QAAQ,EAAE,qBAAmC,CAAC;AAClC,KAAK,QAAQ,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,gBAAgB,IAAI,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACnI,eAAe,QAAQ,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { BrowserPasskeyAuth } from "jazz-tools/browser";
|
2
|
+
export type PasskeyAuth = {
|
3
|
+
current: BrowserPasskeyAuth;
|
4
|
+
state: "anonymous" | "signedIn";
|
5
|
+
};
|
6
|
+
/** @category Auth Providers */
|
7
|
+
export declare function usePasskeyAuth({ appName, appHostname, }: {
|
8
|
+
appName: string;
|
9
|
+
appHostname?: string;
|
10
|
+
}): PasskeyAuth;
|
11
|
+
//# sourceMappingURL=PasskeyAuth.svelte.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PasskeyAuth.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/auth/PasskeyAuth.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAIxD,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,KAAK,EAAE,WAAW,GAAG,UAAU,CAAC;CACjC,CAAC;AAEF,+BAA+B;AAC/B,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,WAAW,GACZ,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,WAAW,CAyBd"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { BrowserPasskeyAuth } from "jazz-tools/browser";
|
2
|
+
import { getAuthSecretStorage, getJazzContext } from "../jazz.svelte.js";
|
3
|
+
import { useIsAuthenticated } from "./useIsAuthenticated.svelte.js";
|
4
|
+
/** @category Auth Providers */
|
5
|
+
export function usePasskeyAuth({ appName, appHostname, }) {
|
6
|
+
const context = getJazzContext();
|
7
|
+
const authSecretStorage = getAuthSecretStorage();
|
8
|
+
const auth = new BrowserPasskeyAuth(context.current.node.crypto, context.current.authenticate, authSecretStorage, appName, appHostname);
|
9
|
+
if ("guest" in context.current) {
|
10
|
+
throw new Error("Passkey auth is not supported in guest mode");
|
11
|
+
}
|
12
|
+
const isAuthenticated = useIsAuthenticated();
|
13
|
+
const state = $derived(isAuthenticated.current ? "signedIn" : "anonymous");
|
14
|
+
return {
|
15
|
+
current: auth,
|
16
|
+
get state() {
|
17
|
+
return state;
|
18
|
+
},
|
19
|
+
};
|
20
|
+
}
|