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,238 @@
|
|
1
|
+
import ImageResizer from "@bam.tech/react-native-image-resizer";
|
2
|
+
import * as FileSystem from "expo-file-system";
|
3
|
+
import {
|
4
|
+
Account,
|
5
|
+
FileStream,
|
6
|
+
Group,
|
7
|
+
ImageDefinition,
|
8
|
+
Loaded,
|
9
|
+
} from "jazz-tools";
|
10
|
+
import { Image } from "react-native";
|
11
|
+
|
12
|
+
function arrayBuffer(blob: Blob): Promise<ArrayBuffer> {
|
13
|
+
return new Promise((resolve, reject) => {
|
14
|
+
const reader = new FileReader();
|
15
|
+
reader.onloadend = () => {
|
16
|
+
resolve(reader.result as ArrayBuffer);
|
17
|
+
};
|
18
|
+
reader.onerror = (error) => {
|
19
|
+
reject(error);
|
20
|
+
};
|
21
|
+
reader.readAsArrayBuffer(blob);
|
22
|
+
});
|
23
|
+
}
|
24
|
+
|
25
|
+
async function fileUriToBlob(uri: string): Promise<Blob> {
|
26
|
+
try {
|
27
|
+
const response = await fetch(uri);
|
28
|
+
const blob = await response.blob();
|
29
|
+
blob.arrayBuffer = () => arrayBuffer(blob);
|
30
|
+
return blob;
|
31
|
+
} catch (error) {
|
32
|
+
console.error("Failed to convert file URI to Blob:", error);
|
33
|
+
throw new Error("Failed to convert file URI to Blob");
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
async function convertFileContentsToBase64DataURI(
|
38
|
+
fileUri: string,
|
39
|
+
contentType: string,
|
40
|
+
) {
|
41
|
+
try {
|
42
|
+
const base64 = await FileSystem.readAsStringAsync(fileUri, {
|
43
|
+
encoding: FileSystem.EncodingType.Base64,
|
44
|
+
});
|
45
|
+
return `data:${contentType};base64,${base64}`;
|
46
|
+
} catch (error) {
|
47
|
+
console.error("Failed to convert file to base64:", error);
|
48
|
+
return null;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
function base64DataURIToParts(base64Data: string) {
|
53
|
+
const parts = base64Data.split(",");
|
54
|
+
const contentType = parts[0]?.split(":")?.[1]?.split(";")?.[0] || "";
|
55
|
+
const data = parts[1] || "";
|
56
|
+
return { contentType, data };
|
57
|
+
}
|
58
|
+
|
59
|
+
function contentTypeToFormat(contentType: string) {
|
60
|
+
if (contentType.includes("image/png")) return "PNG";
|
61
|
+
if (contentType.includes("image/jpeg")) return "JPEG";
|
62
|
+
if (contentType.includes("image/webp")) return "WEBP";
|
63
|
+
return "PNG";
|
64
|
+
}
|
65
|
+
|
66
|
+
async function base64DataURIToBlob(base64Data: string) {
|
67
|
+
const { contentType, data } = base64DataURIToParts(base64Data);
|
68
|
+
const byteCharacters = atob(data);
|
69
|
+
|
70
|
+
const byteNumbers = new Array(byteCharacters.length);
|
71
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
72
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
73
|
+
}
|
74
|
+
const byteArray = new Uint8Array(byteNumbers);
|
75
|
+
|
76
|
+
// @ts-expect-error byteArray has data
|
77
|
+
const blob = new Blob(byteArray, { type: contentType });
|
78
|
+
blob.arrayBuffer = () => arrayBuffer(blob);
|
79
|
+
return blob;
|
80
|
+
}
|
81
|
+
|
82
|
+
async function getImageDimensions(
|
83
|
+
uri: string,
|
84
|
+
): Promise<{ width: number; height: number }> {
|
85
|
+
return new Promise((resolve, reject) => {
|
86
|
+
Image.getSize(
|
87
|
+
uri,
|
88
|
+
(width, height) => resolve({ width, height }),
|
89
|
+
(error) => {
|
90
|
+
console.error("Failed to get image dimensions:", error);
|
91
|
+
reject(new Error("Failed to get image dimensions"));
|
92
|
+
},
|
93
|
+
);
|
94
|
+
});
|
95
|
+
}
|
96
|
+
|
97
|
+
/** @category Image creation */
|
98
|
+
export async function createImageNative(
|
99
|
+
base64ImageDataURI: string,
|
100
|
+
options: {
|
101
|
+
owner?: Group | Account;
|
102
|
+
maxSize?: 256 | 1024 | 2048;
|
103
|
+
} = {},
|
104
|
+
): Promise<Loaded<typeof ImageDefinition>> {
|
105
|
+
try {
|
106
|
+
const { contentType } = base64DataURIToParts(base64ImageDataURI);
|
107
|
+
const format = contentTypeToFormat(contentType);
|
108
|
+
|
109
|
+
let originalWidth, originalHeight;
|
110
|
+
try {
|
111
|
+
({ width: originalWidth, height: originalHeight } =
|
112
|
+
await getImageDimensions(base64ImageDataURI));
|
113
|
+
} catch (error) {
|
114
|
+
console.error("Error getting image dimensions:", error);
|
115
|
+
throw new Error("Failed to get image dimensions");
|
116
|
+
}
|
117
|
+
|
118
|
+
let placeholderImage;
|
119
|
+
try {
|
120
|
+
placeholderImage = await ImageResizer.createResizedImage(
|
121
|
+
base64ImageDataURI,
|
122
|
+
8,
|
123
|
+
8,
|
124
|
+
format,
|
125
|
+
100,
|
126
|
+
0,
|
127
|
+
);
|
128
|
+
} catch (error) {
|
129
|
+
console.error("Error creating placeholder image:", error);
|
130
|
+
throw new Error("Failed to create placeholder image");
|
131
|
+
}
|
132
|
+
|
133
|
+
const placeholderDataURL = await convertFileContentsToBase64DataURI(
|
134
|
+
placeholderImage.uri,
|
135
|
+
contentType,
|
136
|
+
);
|
137
|
+
|
138
|
+
if (!placeholderDataURL) {
|
139
|
+
throw new Error("Failed to create placeholder data URL");
|
140
|
+
}
|
141
|
+
|
142
|
+
const imageDefinition = ImageDefinition.create(
|
143
|
+
{
|
144
|
+
originalSize: [originalWidth, originalHeight],
|
145
|
+
placeholderDataURL,
|
146
|
+
},
|
147
|
+
options.owner,
|
148
|
+
);
|
149
|
+
|
150
|
+
const addImageStream = async (
|
151
|
+
width: number,
|
152
|
+
height: number,
|
153
|
+
label: string,
|
154
|
+
) => {
|
155
|
+
try {
|
156
|
+
const resizedImage = await ImageResizer.createResizedImage(
|
157
|
+
base64ImageDataURI,
|
158
|
+
width,
|
159
|
+
height,
|
160
|
+
format,
|
161
|
+
80,
|
162
|
+
0,
|
163
|
+
);
|
164
|
+
|
165
|
+
const binaryStream = await FileStream.createFromBlob(
|
166
|
+
await fileUriToBlob(resizedImage.uri),
|
167
|
+
imageDefinition._owner,
|
168
|
+
);
|
169
|
+
|
170
|
+
imageDefinition[label] = binaryStream;
|
171
|
+
} catch (error) {
|
172
|
+
console.error(`Error adding image stream for ${label}:`, error);
|
173
|
+
throw new Error(`Failed to add image stream for ${label}`);
|
174
|
+
}
|
175
|
+
};
|
176
|
+
|
177
|
+
if (originalWidth > 256 || originalHeight > 256) {
|
178
|
+
const width =
|
179
|
+
originalWidth > originalHeight
|
180
|
+
? 256
|
181
|
+
: Math.round(256 * (originalWidth / originalHeight));
|
182
|
+
const height =
|
183
|
+
originalHeight > originalWidth
|
184
|
+
? 256
|
185
|
+
: Math.round(256 * (originalHeight / originalWidth));
|
186
|
+
await addImageStream(width, height, `${width}x${height}`);
|
187
|
+
}
|
188
|
+
|
189
|
+
if (options.maxSize === 256) return imageDefinition;
|
190
|
+
|
191
|
+
if (originalWidth > 1024 || originalHeight > 1024) {
|
192
|
+
const width =
|
193
|
+
originalWidth > originalHeight
|
194
|
+
? 1024
|
195
|
+
: Math.round(1024 * (originalWidth / originalHeight));
|
196
|
+
const height =
|
197
|
+
originalHeight > originalWidth
|
198
|
+
? 1024
|
199
|
+
: Math.round(1024 * (originalHeight / originalWidth));
|
200
|
+
await addImageStream(width, height, `${width}x${height}`);
|
201
|
+
}
|
202
|
+
|
203
|
+
if (options.maxSize === 1024) return imageDefinition;
|
204
|
+
|
205
|
+
if (originalWidth > 2048 || originalHeight > 2048) {
|
206
|
+
const width =
|
207
|
+
originalWidth > originalHeight
|
208
|
+
? 2048
|
209
|
+
: Math.round(2048 * (originalWidth / originalHeight));
|
210
|
+
const height =
|
211
|
+
originalHeight > originalWidth
|
212
|
+
? 2048
|
213
|
+
: Math.round(2048 * (originalHeight / originalWidth));
|
214
|
+
await addImageStream(width, height, `${width}x${height}`);
|
215
|
+
}
|
216
|
+
|
217
|
+
if (options.maxSize === 2048) return imageDefinition;
|
218
|
+
|
219
|
+
if (options.maxSize === undefined || options.maxSize > 2048) {
|
220
|
+
try {
|
221
|
+
const originalBinaryStream = await FileStream.createFromBlob(
|
222
|
+
await base64DataURIToBlob(base64ImageDataURI),
|
223
|
+
imageDefinition._owner,
|
224
|
+
);
|
225
|
+
imageDefinition[`${originalWidth}x${originalHeight}`] =
|
226
|
+
originalBinaryStream;
|
227
|
+
} catch (error) {
|
228
|
+
console.error("Error adding original image stream:", error);
|
229
|
+
throw new Error("Failed to add original image stream");
|
230
|
+
}
|
231
|
+
}
|
232
|
+
|
233
|
+
return imageDefinition;
|
234
|
+
} catch (error) {
|
235
|
+
console.error("Error in createImage:", error);
|
236
|
+
throw error;
|
237
|
+
}
|
238
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<script lang="ts" generics="S extends (AccountClass<Account> & CoValueFromRaw<Account>) | 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,42 @@
|
|
1
|
+
import { BrowserPasskeyAuth } from "jazz-tools/browser";
|
2
|
+
import { getAuthSecretStorage, getJazzContext } from "../jazz.svelte.js";
|
3
|
+
import { useIsAuthenticated } from "./useIsAuthenticated.svelte.js";
|
4
|
+
|
5
|
+
export type PasskeyAuth = {
|
6
|
+
current: BrowserPasskeyAuth;
|
7
|
+
state: "anonymous" | "signedIn";
|
8
|
+
};
|
9
|
+
|
10
|
+
/** @category Auth Providers */
|
11
|
+
export function usePasskeyAuth({
|
12
|
+
appName,
|
13
|
+
appHostname,
|
14
|
+
}: {
|
15
|
+
appName: string;
|
16
|
+
appHostname?: string;
|
17
|
+
}): PasskeyAuth {
|
18
|
+
const context = getJazzContext();
|
19
|
+
const authSecretStorage = getAuthSecretStorage();
|
20
|
+
const auth = new BrowserPasskeyAuth(
|
21
|
+
context.current.node.crypto,
|
22
|
+
context.current.authenticate,
|
23
|
+
authSecretStorage,
|
24
|
+
appName,
|
25
|
+
appHostname,
|
26
|
+
);
|
27
|
+
|
28
|
+
if ("guest" in context.current) {
|
29
|
+
throw new Error("Passkey auth is not supported in guest mode");
|
30
|
+
}
|
31
|
+
|
32
|
+
const isAuthenticated = useIsAuthenticated();
|
33
|
+
|
34
|
+
const state = $derived(isAuthenticated.current ? "signedIn" : "anonymous");
|
35
|
+
|
36
|
+
return {
|
37
|
+
current: auth,
|
38
|
+
get state() {
|
39
|
+
return state;
|
40
|
+
},
|
41
|
+
};
|
42
|
+
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
<script lang="ts">
|
2
|
+
import type { Snippet } from "svelte";
|
3
|
+
import { usePasskeyAuth } from "./PasskeyAuth.svelte.js";
|
4
|
+
|
5
|
+
let { appName, children }: { appName: string; children?: Snippet } = $props();
|
6
|
+
|
7
|
+
const auth = usePasskeyAuth({ appName });
|
8
|
+
|
9
|
+
let error = $state<string | undefined>(undefined);
|
10
|
+
|
11
|
+
function signUp(e: Event) {
|
12
|
+
const formData = new FormData(e.currentTarget as HTMLFormElement);
|
13
|
+
const name = formData.get("name") as string;
|
14
|
+
|
15
|
+
if (!name) {
|
16
|
+
error = "Name is required";
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
e.preventDefault();
|
20
|
+
error = undefined;
|
21
|
+
auth.current.signUp(name).catch((e) => {
|
22
|
+
error = e.message;
|
23
|
+
});
|
24
|
+
}
|
25
|
+
|
26
|
+
function logIn(e: Event) {
|
27
|
+
error = undefined;
|
28
|
+
e.preventDefault();
|
29
|
+
e.stopPropagation();
|
30
|
+
auth.current.logIn().catch((e) => {
|
31
|
+
error = e.message;
|
32
|
+
});
|
33
|
+
}
|
34
|
+
</script>
|
35
|
+
|
36
|
+
{#if auth.state === 'anonymous'}
|
37
|
+
<div
|
38
|
+
style="width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center;"
|
39
|
+
>
|
40
|
+
<div style="max-width: 18rem; display: flex; flex-direction: column; gap: 2rem;">
|
41
|
+
{#if error}
|
42
|
+
<div style="color: red;">
|
43
|
+
{error}
|
44
|
+
</div>
|
45
|
+
{/if}
|
46
|
+
<form onsubmit={signUp}>
|
47
|
+
<input type="text" name="name" placeholder="Display name" autocomplete="name" />
|
48
|
+
<input type="submit" value="Sign up" />
|
49
|
+
</form>
|
50
|
+
<button onclick={logIn}> Log in with existing account </button>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
{:else}
|
54
|
+
{@render children?.()}
|
55
|
+
{/if}
|
56
|
+
|
57
|
+
<style>
|
58
|
+
form {
|
59
|
+
display: flex;
|
60
|
+
flex-direction: column;
|
61
|
+
gap: 0.5rem;
|
62
|
+
}
|
63
|
+
|
64
|
+
button,
|
65
|
+
input[type='submit'] {
|
66
|
+
background: #000;
|
67
|
+
color: #fff;
|
68
|
+
padding: 6px 12px;
|
69
|
+
border: none;
|
70
|
+
border-radius: 6px;
|
71
|
+
min-height: 38px;
|
72
|
+
cursor: pointer;
|
73
|
+
}
|
74
|
+
|
75
|
+
input[type='text'] {
|
76
|
+
border: 2px solid #000;
|
77
|
+
padding: 6px 12px;
|
78
|
+
border-radius: 6px;
|
79
|
+
min-height: 24px;
|
80
|
+
}
|
81
|
+
</style>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { PassphraseAuth } from "jazz-tools";
|
2
|
+
import { untrack } from "svelte";
|
3
|
+
import { createSubscriber } from "svelte/reactivity";
|
4
|
+
import { getAuthSecretStorage, getJazzContext } from "../jazz.svelte.js";
|
5
|
+
import { useIsAuthenticated } from "./useIsAuthenticated.svelte.js";
|
6
|
+
|
7
|
+
/** @category Auth Providers */
|
8
|
+
export function usePassphraseAuth({
|
9
|
+
wordlist,
|
10
|
+
}: {
|
11
|
+
wordlist: string[];
|
12
|
+
}) {
|
13
|
+
const context = getJazzContext();
|
14
|
+
const authSecretStorage = getAuthSecretStorage();
|
15
|
+
const auth = new PassphraseAuth(
|
16
|
+
context.current.node.crypto,
|
17
|
+
context.current.authenticate,
|
18
|
+
context.current.register,
|
19
|
+
authSecretStorage,
|
20
|
+
wordlist,
|
21
|
+
);
|
22
|
+
|
23
|
+
auth.loadCurrentAccountPassphrase();
|
24
|
+
|
25
|
+
const subscribe = createSubscriber((update) => {
|
26
|
+
const off = auth.subscribe(update);
|
27
|
+
|
28
|
+
return () => off();
|
29
|
+
});
|
30
|
+
|
31
|
+
const isAuthenticated = useIsAuthenticated();
|
32
|
+
|
33
|
+
const state = $derived(isAuthenticated.current ? "signedIn" : "anonymous");
|
34
|
+
|
35
|
+
return {
|
36
|
+
logIn: auth.logIn,
|
37
|
+
signUp: auth.signUp,
|
38
|
+
registerNewAccount: auth.registerNewAccount,
|
39
|
+
generateRandomPassphrase: auth.generateRandomPassphrase,
|
40
|
+
get passphrase() {
|
41
|
+
subscribe();
|
42
|
+
|
43
|
+
return auth.passphrase;
|
44
|
+
},
|
45
|
+
get state() {
|
46
|
+
return state;
|
47
|
+
},
|
48
|
+
};
|
49
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { createSubscriber } from "svelte/reactivity";
|
2
|
+
import { getAuthSecretStorage } from "../jazz.svelte.js";
|
3
|
+
|
4
|
+
export function useIsAuthenticated() {
|
5
|
+
const authSecretStorage = getAuthSecretStorage();
|
6
|
+
|
7
|
+
const subscribe = createSubscriber((update) => {
|
8
|
+
const off = authSecretStorage.onUpdate(update);
|
9
|
+
|
10
|
+
return () => off();
|
11
|
+
});
|
12
|
+
|
13
|
+
function getCurrent() {
|
14
|
+
subscribe();
|
15
|
+
|
16
|
+
return authSecretStorage.isAuthenticated;
|
17
|
+
}
|
18
|
+
|
19
|
+
return {
|
20
|
+
/** @deprecated Use `current` instead */
|
21
|
+
get value() {
|
22
|
+
return getCurrent();
|
23
|
+
},
|
24
|
+
get current() {
|
25
|
+
return getCurrent();
|
26
|
+
},
|
27
|
+
};
|
28
|
+
}
|
@@ -0,0 +1,172 @@
|
|
1
|
+
import type {
|
2
|
+
Account,
|
3
|
+
AccountClass,
|
4
|
+
AnyAccountSchema,
|
5
|
+
CoValueFromRaw,
|
6
|
+
CoValueOrZodSchema,
|
7
|
+
InstanceOfSchema,
|
8
|
+
Loaded,
|
9
|
+
ResolveQuery,
|
10
|
+
ResolveQueryStrict,
|
11
|
+
} from "jazz-tools";
|
12
|
+
import { anySchemaToCoSchema, subscribeToCoValue } from "jazz-tools";
|
13
|
+
import { untrack } from "svelte";
|
14
|
+
import { createSubscriber } from "svelte/reactivity";
|
15
|
+
import { useIsAuthenticated } from "./auth/useIsAuthenticated.svelte.js";
|
16
|
+
import { getJazzContext } from "./jazz.svelte";
|
17
|
+
|
18
|
+
export class CoState<
|
19
|
+
V extends CoValueOrZodSchema,
|
20
|
+
R extends ResolveQuery<V> = true,
|
21
|
+
> {
|
22
|
+
#value: Loaded<V, R> | undefined | null = undefined;
|
23
|
+
#ctx = getJazzContext<InstanceOfSchema<AccountClass<Account>>>();
|
24
|
+
#id: string | undefined | null;
|
25
|
+
#subscribe: () => void;
|
26
|
+
#update = () => {};
|
27
|
+
|
28
|
+
constructor(
|
29
|
+
Schema: V,
|
30
|
+
id: string | undefined | null | (() => string | undefined | null),
|
31
|
+
options?: { resolve?: ResolveQueryStrict<V, R> },
|
32
|
+
) {
|
33
|
+
this.#id = $derived.by(typeof id === "function" ? id : () => id);
|
34
|
+
|
35
|
+
this.#subscribe = createSubscriber((update) => {
|
36
|
+
this.#update = update;
|
37
|
+
});
|
38
|
+
|
39
|
+
$effect.pre(() => {
|
40
|
+
const ctx = this.#ctx.current;
|
41
|
+
const id = this.#id;
|
42
|
+
|
43
|
+
return untrack(() => {
|
44
|
+
if (!ctx || !id) {
|
45
|
+
return this.update(undefined);
|
46
|
+
}
|
47
|
+
const agent = "me" in ctx ? ctx.me : ctx.guest;
|
48
|
+
|
49
|
+
const unsubscribe = subscribeToCoValue(
|
50
|
+
anySchemaToCoSchema(Schema),
|
51
|
+
id,
|
52
|
+
{
|
53
|
+
// @ts-expect-error The resolve query type isn't compatible with the anySchemaToCoSchema conversion
|
54
|
+
resolve: options?.resolve,
|
55
|
+
loadAs: agent,
|
56
|
+
onUnavailable: () => {
|
57
|
+
this.update(null);
|
58
|
+
},
|
59
|
+
onUnauthorized: () => {
|
60
|
+
this.update(null);
|
61
|
+
},
|
62
|
+
syncResolution: true,
|
63
|
+
},
|
64
|
+
(value) => {
|
65
|
+
this.update(value as Loaded<V, R>);
|
66
|
+
},
|
67
|
+
);
|
68
|
+
|
69
|
+
return () => {
|
70
|
+
unsubscribe();
|
71
|
+
};
|
72
|
+
});
|
73
|
+
});
|
74
|
+
}
|
75
|
+
|
76
|
+
update(value: Loaded<V, R> | undefined | null) {
|
77
|
+
if (this.#value === value) return;
|
78
|
+
this.#value = value;
|
79
|
+
this.#update();
|
80
|
+
}
|
81
|
+
|
82
|
+
get current() {
|
83
|
+
this.#subscribe();
|
84
|
+
return this.#value;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
export class AccountCoState<
|
89
|
+
A extends
|
90
|
+
| (AccountClass<Account> & CoValueFromRaw<Account>)
|
91
|
+
| AnyAccountSchema,
|
92
|
+
R extends ResolveQuery<A> = true,
|
93
|
+
> {
|
94
|
+
#value: Loaded<A, R> | undefined | null = undefined;
|
95
|
+
#ctx = getJazzContext<InstanceOfSchema<A>>();
|
96
|
+
#subscribe: () => void;
|
97
|
+
#update = () => {};
|
98
|
+
|
99
|
+
constructor(Schema: A, options?: { resolve?: ResolveQueryStrict<A, R> }) {
|
100
|
+
this.#subscribe = createSubscriber((update) => {
|
101
|
+
this.#update = update;
|
102
|
+
});
|
103
|
+
|
104
|
+
$effect.pre(() => {
|
105
|
+
const ctx = this.#ctx.current;
|
106
|
+
|
107
|
+
return untrack(() => {
|
108
|
+
if (!ctx || !("me" in ctx)) {
|
109
|
+
return this.update(undefined);
|
110
|
+
}
|
111
|
+
|
112
|
+
const me = ctx.me;
|
113
|
+
|
114
|
+
const unsubscribe = subscribeToCoValue(
|
115
|
+
anySchemaToCoSchema(Schema),
|
116
|
+
me.id,
|
117
|
+
{
|
118
|
+
// @ts-expect-error The resolve query type isn't compatible with the anySchemaToCoSchema conversion
|
119
|
+
resolve: options?.resolve,
|
120
|
+
loadAs: me,
|
121
|
+
onUnavailable: () => {
|
122
|
+
this.update(null);
|
123
|
+
},
|
124
|
+
onUnauthorized: () => {
|
125
|
+
this.update(null);
|
126
|
+
},
|
127
|
+
syncResolution: true,
|
128
|
+
},
|
129
|
+
(value) => {
|
130
|
+
this.update(value as Loaded<A, R>);
|
131
|
+
},
|
132
|
+
);
|
133
|
+
|
134
|
+
return () => {
|
135
|
+
unsubscribe();
|
136
|
+
};
|
137
|
+
});
|
138
|
+
});
|
139
|
+
}
|
140
|
+
|
141
|
+
update(value: Loaded<A, R> | undefined | null) {
|
142
|
+
if (this.#value === value) return;
|
143
|
+
this.#value = value;
|
144
|
+
this.#update();
|
145
|
+
}
|
146
|
+
|
147
|
+
logOut = () => {
|
148
|
+
this.#ctx.current?.logOut();
|
149
|
+
};
|
150
|
+
|
151
|
+
get current() {
|
152
|
+
this.#subscribe();
|
153
|
+
|
154
|
+
return this.#value;
|
155
|
+
}
|
156
|
+
|
157
|
+
get agent() {
|
158
|
+
if (!this.#ctx.current) {
|
159
|
+
throw new Error("No context found");
|
160
|
+
}
|
161
|
+
|
162
|
+
return "me" in this.#ctx.current
|
163
|
+
? this.#ctx.current.me
|
164
|
+
: this.#ctx.current.guest;
|
165
|
+
}
|
166
|
+
|
167
|
+
#isAuthenticated = useIsAuthenticated();
|
168
|
+
|
169
|
+
get isAuthenticated() {
|
170
|
+
return this.#isAuthenticated.current;
|
171
|
+
}
|
172
|
+
}
|