jazz-tools 0.14.27 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.svelte-kit/__package__/Provider.svelte +61 -0
- package/.svelte-kit/__package__/Provider.svelte.d.ts +19 -0
- package/.svelte-kit/__package__/Provider.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PasskeyAuth.svelte.d.ts +11 -0
- package/.svelte-kit/__package__/auth/PasskeyAuth.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PasskeyAuth.svelte.js +20 -0
- package/.svelte-kit/__package__/auth/PasskeyAuthBasicUI.svelte +81 -0
- package/.svelte-kit/__package__/auth/PasskeyAuthBasicUI.svelte.d.ts +9 -0
- package/.svelte-kit/__package__/auth/PasskeyAuthBasicUI.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PassphraseAuth.svelte.d.ts +12 -0
- package/.svelte-kit/__package__/auth/PassphraseAuth.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PassphraseAuth.svelte.js +30 -0
- package/.svelte-kit/__package__/auth/index.d.ts +4 -0
- package/.svelte-kit/__package__/auth/index.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/index.js +3 -0
- package/.svelte-kit/__package__/auth/useIsAuthenticated.svelte.d.ts +6 -0
- package/.svelte-kit/__package__/auth/useIsAuthenticated.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/useIsAuthenticated.svelte.js +22 -0
- package/.svelte-kit/__package__/index.d.ts +6 -0
- package/.svelte-kit/__package__/index.d.ts.map +1 -0
- package/.svelte-kit/__package__/index.js +5 -0
- package/.svelte-kit/__package__/jazz.class.svelte.d.ts +21 -0
- package/.svelte-kit/__package__/jazz.class.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/jazz.class.svelte.js +117 -0
- package/.svelte-kit/__package__/jazz.svelte.d.ts +39 -0
- package/.svelte-kit/__package__/jazz.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/jazz.svelte.js +70 -0
- package/.svelte-kit/__package__/testing.d.ts +10 -0
- package/.svelte-kit/__package__/testing.d.ts.map +1 -0
- package/.svelte-kit/__package__/testing.js +23 -0
- package/.turbo/turbo-build.log +180 -11
- package/CHANGELOG.md +21 -0
- package/README.md +2 -2
- package/dist/browser/BrowserContextManager.d.ts +31 -0
- package/dist/browser/BrowserContextManager.d.ts.map +1 -0
- package/dist/browser/auth/LocalStorageKVStore.d.ts +9 -0
- package/dist/browser/auth/LocalStorageKVStore.d.ts.map +1 -0
- package/dist/browser/auth/PasskeyAuth.d.ts +27 -0
- package/dist/browser/auth/PasskeyAuth.d.ts.map +1 -0
- package/dist/browser/createBrowserContext.d.ts +47 -0
- package/dist/browser/createBrowserContext.d.ts.map +1 -0
- package/dist/browser/index.d.ts +23 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +469 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/storageOptions.d.ts +8 -0
- package/dist/browser/storageOptions.d.ts.map +1 -0
- package/dist/browser/tests/LocalStorageKVStore.test.d.ts +2 -0
- package/dist/browser/tests/LocalStorageKVStore.test.d.ts.map +1 -0
- package/dist/browser/tests/PasskeyAuth.test.d.ts +2 -0
- package/dist/browser/tests/PasskeyAuth.test.d.ts.map +1 -0
- package/dist/browser/tests/createInviteLink.test.d.ts +2 -0
- package/dist/browser/tests/createInviteLink.test.d.ts.map +1 -0
- package/dist/browser/tests/storageOptions.test.d.ts +2 -0
- package/dist/browser/tests/storageOptions.test.d.ts.map +1 -0
- package/dist/browser/tests/utils.d.ts +11 -0
- package/dist/browser/tests/utils.d.ts.map +1 -0
- package/dist/browser/utils/export-account-inspector.d.ts +6 -0
- package/dist/browser/utils/export-account-inspector.d.ts.map +1 -0
- package/dist/browser-media-images/index.d.ts +7 -0
- package/dist/browser-media-images/index.d.ts.map +1 -0
- package/dist/browser-media-images/index.js +70 -0
- package/dist/browser-media-images/index.js.map +1 -0
- package/dist/chunk-FSIM7N33.js +4827 -0
- package/dist/chunk-FSIM7N33.js.map +1 -0
- package/dist/expo/auth/clerk/index.d.ts +7 -0
- package/dist/expo/auth/clerk/index.d.ts.map +1 -0
- package/dist/expo/crypto.d.ts +2 -0
- package/dist/expo/crypto.d.ts.map +1 -0
- package/dist/expo/crypto.js +3 -0
- package/dist/expo/crypto.js.map +1 -0
- package/dist/expo/index.d.ts +6 -0
- package/dist/expo/index.d.ts.map +1 -0
- package/dist/expo/index.js +168 -0
- package/dist/expo/index.js.map +1 -0
- package/dist/expo/provider.d.ts +4 -0
- package/dist/expo/provider.d.ts.map +1 -0
- package/dist/expo/storage/expo-secure-store-adapter.d.ts +8 -0
- package/dist/expo/storage/expo-secure-store-adapter.d.ts.map +1 -0
- package/dist/expo/storage/expo-sqlite-adapter.d.ts +18 -0
- package/dist/expo/storage/expo-sqlite-adapter.d.ts.map +1 -0
- package/dist/expo/testing.d.ts +2 -0
- package/dist/expo/testing.d.ts.map +1 -0
- package/dist/expo/testing.js +3 -0
- package/dist/expo/testing.js.map +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +172 -6
- package/dist/index.js.map +1 -1
- package/dist/inspector/custom-element-CWW72LEG.js +31971 -0
- package/dist/inspector/custom-element-CWW72LEG.js.map +1 -0
- package/dist/inspector/custom-element.d.ts +13 -0
- package/dist/inspector/custom-element.d.ts.map +1 -0
- package/dist/inspector/index.d.ts +12 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +2027 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/inspector/register-custom-element.d.ts +2 -0
- package/dist/inspector/register-custom-element.d.ts.map +1 -0
- package/dist/inspector/register-custom-element.js +5 -0
- package/dist/inspector/register-custom-element.js.map +1 -0
- package/dist/inspector/ui/badge.d.ts +4 -0
- package/dist/inspector/ui/badge.d.ts.map +1 -0
- package/dist/inspector/ui/button.d.ts +9 -0
- package/dist/inspector/ui/button.d.ts.map +1 -0
- package/dist/inspector/ui/card.d.ts +10 -0
- package/dist/inspector/ui/card.d.ts.map +1 -0
- package/dist/inspector/ui/global-styles.d.ts +4 -0
- package/dist/inspector/ui/global-styles.d.ts.map +1 -0
- package/dist/inspector/ui/grid.d.ts +4 -0
- package/dist/inspector/ui/grid.d.ts.map +1 -0
- package/dist/inspector/ui/heading.d.ts +4 -0
- package/dist/inspector/ui/heading.d.ts.map +1 -0
- package/dist/inspector/ui/icon.d.ts +30 -0
- package/dist/inspector/ui/icon.d.ts.map +1 -0
- package/dist/inspector/ui/icons/chevron-down-icon.d.ts +2 -0
- package/dist/inspector/ui/icons/chevron-down-icon.d.ts.map +1 -0
- package/dist/inspector/ui/icons/delete-icon.d.ts +2 -0
- package/dist/inspector/ui/icons/delete-icon.d.ts.map +1 -0
- package/dist/inspector/ui/icons/link-icon.d.ts +2 -0
- package/dist/inspector/ui/icons/link-icon.d.ts.map +1 -0
- package/dist/inspector/ui/input.d.ts +11 -0
- package/dist/inspector/ui/input.d.ts.map +1 -0
- package/dist/inspector/ui/select.d.ts +5 -0
- package/dist/inspector/ui/select.d.ts.map +1 -0
- package/dist/inspector/ui/table.d.ts +8 -0
- package/dist/inspector/ui/table.d.ts.map +1 -0
- package/dist/inspector/ui/text.d.ts +10 -0
- package/dist/inspector/ui/text.d.ts.map +1 -0
- package/dist/inspector/viewer/account-or-group-text.d.ts +8 -0
- package/dist/inspector/viewer/account-or-group-text.d.ts.map +1 -0
- package/dist/inspector/viewer/account-view.d.ts +8 -0
- package/dist/inspector/viewer/account-view.d.ts.map +1 -0
- package/dist/inspector/viewer/breadcrumbs.d.ts +9 -0
- package/dist/inspector/viewer/breadcrumbs.d.ts.map +1 -0
- package/dist/inspector/viewer/co-stream-view.d.ts +18 -0
- package/dist/inspector/viewer/co-stream-view.d.ts.map +1 -0
- package/dist/inspector/viewer/grid-view.d.ts +9 -0
- package/dist/inspector/viewer/grid-view.d.ts.map +1 -0
- package/dist/inspector/viewer/group-view.d.ts +8 -0
- package/dist/inspector/viewer/group-view.d.ts.map +1 -0
- package/dist/inspector/viewer/inpsector-button.d.ts +6 -0
- package/dist/inspector/viewer/inpsector-button.d.ts.map +1 -0
- package/dist/inspector/viewer/new-app.d.ts +11 -0
- package/dist/inspector/viewer/new-app.d.ts.map +1 -0
- package/dist/inspector/viewer/page-stack.d.ts +15 -0
- package/dist/inspector/viewer/page-stack.d.ts.map +1 -0
- package/dist/inspector/viewer/page.d.ts +16 -0
- package/dist/inspector/viewer/page.d.ts.map +1 -0
- package/dist/inspector/viewer/raw-data-card.d.ts +5 -0
- package/dist/inspector/viewer/raw-data-card.d.ts.map +1 -0
- package/dist/inspector/viewer/role-display.d.ts +6 -0
- package/dist/inspector/viewer/role-display.d.ts.map +1 -0
- package/dist/inspector/viewer/table-viewer.d.ts +9 -0
- package/dist/inspector/viewer/table-viewer.d.ts.map +1 -0
- package/dist/inspector/viewer/type-icon.d.ts +11 -0
- package/dist/inspector/viewer/type-icon.d.ts.map +1 -0
- package/dist/inspector/viewer/types.d.ts +7 -0
- package/dist/inspector/viewer/types.d.ts.map +1 -0
- package/dist/inspector/viewer/use-page-path.d.ts +10 -0
- package/dist/inspector/viewer/use-page-path.d.ts.map +1 -0
- package/dist/inspector/viewer/use-resolve-covalue.d.ts +67 -0
- package/dist/inspector/viewer/use-resolve-covalue.d.ts.map +1 -0
- package/dist/inspector/viewer/value-renderer.d.ts +12 -0
- package/dist/inspector/viewer/value-renderer.d.ts.map +1 -0
- package/dist/prosemirror/index.d.ts +3 -0
- package/dist/prosemirror/index.d.ts.map +1 -0
- package/dist/prosemirror/index.js +2185 -0
- package/dist/prosemirror/index.js.map +1 -0
- package/dist/prosemirror/lib/converter.d.ts +33 -0
- package/dist/prosemirror/lib/converter.d.ts.map +1 -0
- package/dist/prosemirror/lib/plugin.d.ts +43 -0
- package/dist/prosemirror/lib/plugin.d.ts.map +1 -0
- package/dist/prosemirror/lib/sync.d.ts +35 -0
- package/dist/prosemirror/lib/sync.d.ts.map +1 -0
- package/dist/prosemirror/tests/plugin.test.d.ts +2 -0
- package/dist/prosemirror/tests/plugin.test.d.ts.map +1 -0
- package/dist/react/auth/Clerk.d.ts +7 -0
- package/dist/react/auth/Clerk.d.ts.map +1 -0
- package/dist/react/auth/DemoAuth.d.ts +5 -0
- package/dist/react/auth/DemoAuth.d.ts.map +1 -0
- package/dist/react/auth/PasskeyAuth.d.ts +24 -0
- package/dist/react/auth/PasskeyAuth.d.ts.map +1 -0
- package/dist/react/auth/PassphraseAuth.d.ts +6 -0
- package/dist/react/auth/PassphraseAuth.d.ts.map +1 -0
- package/dist/react/auth/auth.d.ts +6 -0
- package/dist/react/auth/auth.d.ts.map +1 -0
- package/dist/react/hooks.d.ts +9 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +700 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/media.d.ts +24 -0
- package/dist/react/media.d.ts.map +1 -0
- package/dist/react/provider.d.ts +10 -0
- package/dist/react/provider.d.ts.map +1 -0
- package/dist/react/ssr.d.ts +4 -0
- package/dist/react/ssr.d.ts.map +1 -0
- package/dist/react/ssr.js +25 -0
- package/dist/react/ssr.js.map +1 -0
- package/dist/react/testing.d.ts +2 -0
- package/dist/react/testing.d.ts.map +1 -0
- package/dist/react/testing.js +5 -0
- package/dist/react/testing.js.map +1 -0
- package/dist/react/tests/testUtils.d.ts +14 -0
- package/dist/react/tests/testUtils.d.ts.map +1 -0
- package/dist/react/tests/useAcceptInvite.test.d.ts +2 -0
- package/dist/react/tests/useAcceptInvite.test.d.ts.map +1 -0
- package/dist/react-core/auth/DemoAuth.d.ts +17 -0
- package/dist/react-core/auth/DemoAuth.d.ts.map +1 -0
- package/dist/react-core/auth/PassphraseAuth.d.ts +21 -0
- package/dist/react-core/auth/PassphraseAuth.d.ts.map +1 -0
- package/dist/react-core/auth/index.d.ts +3 -0
- package/dist/react-core/auth/index.d.ts.map +1 -0
- package/dist/react-core/chunk-7DYMJ74I.js +12 -0
- package/dist/react-core/chunk-7DYMJ74I.js.map +1 -0
- package/dist/react-core/hooks.d.ts +17 -0
- package/dist/react-core/hooks.d.ts.map +1 -0
- package/dist/react-core/index.d.ts +4 -0
- package/dist/react-core/index.d.ts.map +1 -0
- package/dist/react-core/index.js +302 -0
- package/dist/react-core/index.js.map +1 -0
- package/dist/react-core/provider.d.ts +5 -0
- package/dist/react-core/provider.d.ts.map +1 -0
- package/dist/react-core/testing.d.ts +10 -0
- package/dist/react-core/testing.d.ts.map +1 -0
- package/dist/react-core/testing.js +43 -0
- package/dist/react-core/testing.js.map +1 -0
- package/dist/react-core/tests/fixtures.d.ts.map +1 -0
- package/dist/react-core/tests/testUtils.d.ts +15 -0
- package/dist/react-core/tests/testUtils.d.ts.map +1 -0
- package/dist/react-core/tests/useAccount.test.d.ts +2 -0
- package/dist/react-core/tests/useAccount.test.d.ts.map +1 -0
- package/dist/react-core/tests/useCoState.test.d.ts +2 -0
- package/dist/react-core/tests/useCoState.test.d.ts.map +1 -0
- package/dist/react-core/tests/useInboxSender.test.d.ts +2 -0
- package/dist/react-core/tests/useInboxSender.test.d.ts.map +1 -0
- package/dist/react-core/tests/useIsAuthenticated.test.d.ts +2 -0
- package/dist/react-core/tests/useIsAuthenticated.test.d.ts.map +1 -0
- package/dist/react-core/tests/usePassPhraseAuth.test.d.ts +2 -0
- package/dist/react-core/tests/usePassPhraseAuth.test.d.ts.map +1 -0
- package/dist/react-core/utils.d.ts +4 -0
- package/dist/react-core/utils.d.ts.map +1 -0
- package/dist/react-native/crypto.d.ts +2 -0
- package/dist/react-native/crypto.d.ts.map +1 -0
- package/dist/react-native/crypto.js +3 -0
- package/dist/react-native/crypto.js.map +1 -0
- package/dist/react-native/index.d.ts +5 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +103 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/provider.d.ts +4 -0
- package/dist/react-native/provider.d.ts.map +1 -0
- package/dist/react-native/storage/mmkv-store-adapter.d.ts +8 -0
- package/dist/react-native/storage/mmkv-store-adapter.d.ts.map +1 -0
- package/dist/react-native/storage/op-sqlite-adapter.d.ts +13 -0
- package/dist/react-native/storage/op-sqlite-adapter.d.ts.map +1 -0
- package/dist/react-native/testing.d.ts +2 -0
- package/dist/react-native/testing.d.ts.map +1 -0
- package/dist/react-native/testing.js +3 -0
- package/dist/react-native/testing.js.map +1 -0
- package/dist/react-native-core/ReactNativeContextManager.d.ts +31 -0
- package/dist/react-native-core/ReactNativeContextManager.d.ts.map +1 -0
- package/dist/react-native-core/auth/DemoAuthUI.d.ts +8 -0
- package/dist/react-native-core/auth/DemoAuthUI.d.ts.map +1 -0
- package/dist/react-native-core/auth/auth.d.ts +3 -0
- package/dist/react-native-core/auth/auth.d.ts.map +1 -0
- package/dist/react-native-core/crypto/RNQuickCrypto.d.ts +15 -0
- package/dist/react-native-core/crypto/RNQuickCrypto.d.ts.map +1 -0
- package/dist/react-native-core/crypto/index.d.ts +2 -0
- package/dist/react-native-core/crypto/index.d.ts.map +1 -0
- package/dist/react-native-core/crypto.js +65 -0
- package/dist/react-native-core/crypto.js.map +1 -0
- package/dist/react-native-core/hooks.d.ts +8 -0
- package/dist/react-native-core/hooks.d.ts.map +1 -0
- package/dist/react-native-core/index.d.ts +9 -0
- package/dist/react-native-core/index.d.ts.map +1 -0
- package/dist/react-native-core/index.js +669 -0
- package/dist/react-native-core/index.js.map +1 -0
- package/dist/react-native-core/media.d.ts +24 -0
- package/dist/react-native-core/media.d.ts.map +1 -0
- package/dist/react-native-core/platform.d.ts +45 -0
- package/dist/react-native-core/platform.d.ts.map +1 -0
- package/dist/react-native-core/provider.d.ts +10 -0
- package/dist/react-native-core/provider.d.ts.map +1 -0
- package/dist/react-native-core/storage/kv-store-context.d.ts +17 -0
- package/dist/react-native-core/storage/kv-store-context.d.ts.map +1 -0
- package/dist/react-native-core/storage/sqlite-react-native.d.ts +9 -0
- package/dist/react-native-core/storage/sqlite-react-native.d.ts.map +1 -0
- package/dist/react-native-core/testing.js +3 -0
- package/dist/react-native-core/testing.js.map +1 -0
- package/dist/react-native-media-images/index.d.ts +7 -0
- package/dist/react-native-media-images/index.d.ts.map +1 -0
- package/dist/react-native-media-images/index.js +177 -0
- package/dist/react-native-media-images/index.js.map +1 -0
- package/dist/svelte/Provider.svelte +61 -0
- package/dist/svelte/Provider.svelte.d.ts +19 -0
- package/dist/svelte/Provider.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PasskeyAuth.svelte.d.ts +11 -0
- package/dist/svelte/auth/PasskeyAuth.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PasskeyAuth.svelte.js +20 -0
- package/dist/svelte/auth/PasskeyAuthBasicUI.svelte +81 -0
- package/dist/svelte/auth/PasskeyAuthBasicUI.svelte.d.ts +9 -0
- package/dist/svelte/auth/PasskeyAuthBasicUI.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PassphraseAuth.svelte.d.ts +12 -0
- package/dist/svelte/auth/PassphraseAuth.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PassphraseAuth.svelte.js +30 -0
- package/dist/svelte/auth/index.d.ts +4 -0
- package/dist/svelte/auth/index.d.ts.map +1 -0
- package/dist/svelte/auth/index.js +3 -0
- package/dist/svelte/auth/useIsAuthenticated.svelte.d.ts +6 -0
- package/dist/svelte/auth/useIsAuthenticated.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/useIsAuthenticated.svelte.js +22 -0
- package/dist/svelte/index.d.ts +6 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +5 -0
- package/dist/svelte/jazz.class.svelte.d.ts +21 -0
- package/dist/svelte/jazz.class.svelte.d.ts.map +1 -0
- package/dist/svelte/jazz.class.svelte.js +117 -0
- package/dist/svelte/jazz.svelte.d.ts +39 -0
- package/dist/svelte/jazz.svelte.d.ts.map +1 -0
- package/dist/svelte/jazz.svelte.js +70 -0
- package/dist/svelte/testing.d.ts +10 -0
- package/dist/svelte/testing.d.ts.map +1 -0
- package/dist/svelte/testing.js +23 -0
- package/dist/testing.d.ts +1 -42
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +2 -2
- package/dist/testing.js.map +1 -1
- package/dist/tiptap/index.d.ts +11 -0
- package/dist/tiptap/index.d.ts.map +1 -0
- package/dist/tiptap/index.js +22 -0
- package/dist/tiptap/index.js.map +1 -0
- package/dist/tools/auth/AuthSecretStorage.d.ts.map +1 -0
- package/dist/tools/auth/DemoAuth.d.ts.map +1 -0
- package/dist/tools/auth/InMemoryKVStore.d.ts.map +1 -0
- package/dist/tools/auth/KvStoreContext.d.ts.map +1 -0
- package/dist/tools/auth/PassphraseAuth.d.ts.map +1 -0
- package/dist/tools/auth/clerk/getClerkUsername.d.ts +3 -0
- package/dist/tools/auth/clerk/getClerkUsername.d.ts.map +1 -0
- package/dist/tools/auth/clerk/index.d.ts +25 -0
- package/dist/tools/auth/clerk/index.d.ts.map +1 -0
- package/dist/tools/auth/clerk/tests/JazzClerkAuth.test.d.ts +2 -0
- package/dist/tools/auth/clerk/tests/JazzClerkAuth.test.d.ts.map +1 -0
- package/dist/tools/auth/clerk/tests/getClerkUsername.test.d.ts +2 -0
- package/dist/tools/auth/clerk/tests/getClerkUsername.test.d.ts.map +1 -0
- package/dist/tools/auth/clerk/tests/types.test.d.ts +2 -0
- package/dist/tools/auth/clerk/tests/types.test.d.ts.map +1 -0
- package/dist/tools/auth/clerk/types.d.ts +32 -0
- package/dist/tools/auth/clerk/types.d.ts.map +1 -0
- package/dist/tools/coValues/CoValueBase.d.ts.map +1 -0
- package/dist/tools/coValues/account.d.ts.map +1 -0
- package/dist/tools/coValues/coFeed.d.ts +368 -0
- package/dist/tools/coValues/coFeed.d.ts.map +1 -0
- package/dist/tools/coValues/coList.d.ts.map +1 -0
- package/dist/tools/coValues/coMap.d.ts.map +1 -0
- package/dist/tools/coValues/coPlainText.d.ts.map +1 -0
- package/dist/tools/coValues/coRichText.d.ts.map +1 -0
- package/dist/tools/coValues/deepLoading.d.ts.map +1 -0
- package/dist/tools/coValues/extensions/imageDef.d.ts.map +1 -0
- package/dist/tools/coValues/group.d.ts.map +1 -0
- package/dist/tools/coValues/inbox.d.ts.map +1 -0
- package/dist/tools/coValues/interfaces.d.ts.map +1 -0
- package/dist/tools/coValues/profile.d.ts.map +1 -0
- package/dist/tools/coValues/registeredSchemas.d.ts.map +1 -0
- package/dist/tools/coValues/schemaUnion.d.ts.map +1 -0
- package/dist/tools/exports.d.ts +24 -0
- package/dist/tools/exports.d.ts.map +1 -0
- package/dist/tools/implementation/ContextManager.d.ts.map +1 -0
- package/dist/tools/implementation/activeAccountContext.d.ts.map +1 -0
- package/dist/tools/implementation/anonymousJazzAgent.d.ts.map +1 -0
- package/dist/tools/implementation/createContext.d.ts.map +1 -0
- package/dist/tools/implementation/devtoolsFormatters.d.ts.map +1 -0
- package/dist/tools/implementation/errors.d.ts.map +1 -0
- package/dist/tools/implementation/inspect.d.ts.map +1 -0
- package/dist/tools/implementation/invites.d.ts.map +1 -0
- package/dist/tools/implementation/refs.d.ts.map +1 -0
- package/dist/tools/implementation/schema.d.ts.map +1 -0
- package/dist/tools/implementation/symbols.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/coExport.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/unionUtils.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/zodCo.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/zodReExport.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/zodSchema.d.ts.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/internal.d.ts.map +1 -0
- package/dist/tools/lib/cache.d.ts.map +1 -0
- package/dist/tools/lib/cache.test.d.ts.map +1 -0
- package/dist/tools/lib/migration.d.ts.map +1 -0
- package/dist/tools/subscribe/CoValueCoreSubscription.d.ts.map +1 -0
- package/dist/tools/subscribe/JazzError.d.ts.map +1 -0
- package/dist/tools/subscribe/SubscriptionScope.d.ts.map +1 -0
- package/dist/tools/subscribe/index.d.ts.map +1 -0
- package/dist/tools/subscribe/types.d.ts.map +1 -0
- package/dist/tools/subscribe/utils.d.ts.map +1 -0
- package/dist/tools/testing.d.ts +43 -0
- package/dist/tools/testing.d.ts.map +1 -0
- package/dist/tools/tests/AuthSecretStorage.test.d.ts.map +1 -0
- package/dist/tools/tests/ContextManager.test.d.ts.map +1 -0
- package/dist/tools/tests/DemoAuth.test.d.ts.map +1 -0
- package/dist/tools/tests/PassphraseAuth.test.d.ts.map +1 -0
- package/dist/tools/tests/account.test.d.ts.map +1 -0
- package/dist/tools/tests/coFeed.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coFeed.test.d.ts.map +1 -0
- package/dist/tools/tests/coList.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coList.test.d.ts.map +1 -0
- package/dist/tools/tests/coMap.record.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coMap.record.test.d.ts.map +1 -0
- package/dist/tools/tests/coMap.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coMap.test.d.ts.map +1 -0
- package/dist/tools/tests/coPlainText.test.d.ts.map +1 -0
- package/dist/tools/tests/createContext.test.d.ts.map +1 -0
- package/dist/tools/tests/deepLoading.test.d.ts.map +1 -0
- package/dist/tools/tests/fixtures.d.ts +2 -0
- package/dist/tools/tests/fixtures.d.ts.map +1 -0
- package/dist/tools/tests/groupsAndAccounts.test.d.ts.map +1 -0
- package/dist/tools/tests/imageDef.test.d.ts.map +1 -0
- package/dist/tools/tests/inbox.test.d.ts.map +1 -0
- package/dist/tools/tests/interfaces.test.d.ts.map +1 -0
- package/dist/tools/tests/invites.test.d.ts.map +1 -0
- package/dist/tools/tests/load.test.d.ts.map +1 -0
- package/dist/tools/tests/patterns/notifications.test.d.ts.map +1 -0
- package/dist/tools/tests/patterns/requestToJoin.test.d.ts.map +1 -0
- package/dist/tools/tests/schema.test.d.ts.map +1 -0
- package/dist/tools/tests/schemaUnion.test.d.ts.map +1 -0
- package/dist/tools/tests/subscribe.test.d.ts.map +1 -0
- package/dist/tools/tests/testing.test.d.ts.map +1 -0
- package/dist/tools/tests/utils.d.ts.map +1 -0
- package/dist/tools/tests/zod.test.d.ts.map +1 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/worker/index.d.ts +25 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +93 -0
- package/dist/worker/index.js.map +1 -0
- package/package.json +193 -11
- package/src/browser/BrowserContextManager.ts +85 -0
- package/src/browser/auth/LocalStorageKVStore.ts +21 -0
- package/src/browser/auth/PasskeyAuth.ts +175 -0
- package/src/browser/createBrowserContext.ts +326 -0
- package/src/browser/index.ts +72 -0
- package/src/browser/storageOptions.ts +17 -0
- package/src/browser/tests/LocalStorageKVStore.test.ts +67 -0
- package/src/browser/tests/PasskeyAuth.test.ts +242 -0
- package/src/browser/tests/createInviteLink.test.ts +18 -0
- package/src/browser/tests/storageOptions.test.ts +33 -0
- package/src/browser/tests/utils.ts +93 -0
- package/src/browser/utils/export-account-inspector.ts +58 -0
- package/src/browser-media-images/index.ts +130 -0
- package/src/expo/auth/clerk/README.md +44 -0
- package/src/expo/auth/clerk/index.tsx +80 -0
- package/src/expo/crypto.ts +1 -0
- package/src/expo/index.ts +6 -0
- package/src/expo/provider.tsx +29 -0
- package/src/expo/storage/expo-secure-store-adapter.ts +29 -0
- package/src/expo/storage/expo-sqlite-adapter.ts +94 -0
- package/src/expo/testing.ts +1 -0
- package/src/index.ts +1 -3
- package/src/inspector/custom-element.tsx +63 -0
- package/src/inspector/index.ts +23 -0
- package/src/inspector/register-custom-element.ts +3 -0
- package/src/inspector/ui/badge.tsx +20 -0
- package/src/inspector/ui/button.tsx +81 -0
- package/src/inspector/ui/card.tsx +23 -0
- package/src/inspector/ui/global-styles.tsx +74 -0
- package/src/inspector/ui/grid.tsx +48 -0
- package/src/inspector/ui/heading.tsx +15 -0
- package/src/inspector/ui/icon.tsx +71 -0
- package/src/inspector/ui/icons/chevron-down-icon.tsx +16 -0
- package/src/inspector/ui/icons/delete-icon.tsx +19 -0
- package/src/inspector/ui/icons/link-icon.tsx +18 -0
- package/src/inspector/ui/input.tsx +51 -0
- package/src/inspector/ui/select.tsx +73 -0
- package/src/inspector/ui/table.tsx +90 -0
- package/src/inspector/ui/text.tsx +62 -0
- package/src/inspector/viewer/account-or-group-text.tsx +52 -0
- package/src/inspector/viewer/account-view.tsx +34 -0
- package/src/inspector/viewer/breadcrumbs.tsx +52 -0
- package/src/inspector/viewer/co-stream-view.tsx +374 -0
- package/src/inspector/viewer/grid-view.tsx +90 -0
- package/src/inspector/viewer/group-view.tsx +67 -0
- package/src/inspector/viewer/inpsector-button.tsx +89 -0
- package/src/inspector/viewer/new-app.tsx +171 -0
- package/src/inspector/viewer/page-stack.tsx +56 -0
- package/src/inspector/viewer/page.tsx +199 -0
- package/src/inspector/viewer/raw-data-card.tsx +53 -0
- package/src/inspector/viewer/role-display.tsx +28 -0
- package/src/inspector/viewer/table-viewer.tsx +184 -0
- package/src/inspector/viewer/type-icon.tsx +63 -0
- package/src/inspector/viewer/types.ts +11 -0
- package/src/inspector/viewer/use-page-path.ts +52 -0
- package/src/inspector/viewer/use-resolve-covalue.ts +214 -0
- package/src/inspector/viewer/value-renderer.tsx +266 -0
- package/src/prosemirror/index.ts +2 -0
- package/src/prosemirror/lib/converter.ts +50 -0
- package/src/prosemirror/lib/plugin.ts +120 -0
- package/src/prosemirror/lib/sync.ts +96 -0
- package/src/prosemirror/tests/plugin.test.ts +127 -0
- package/src/react/auth/Clerk.tsx +82 -0
- package/src/react/auth/DemoAuth.tsx +121 -0
- package/src/react/auth/PasskeyAuth.tsx +168 -0
- package/src/react/auth/PassphraseAuth.tsx +196 -0
- package/src/react/auth/auth.ts +9 -0
- package/src/react/hooks.tsx +53 -0
- package/src/react/index.ts +16 -0
- package/src/react/media.tsx +74 -0
- package/src/react/provider.tsx +114 -0
- package/src/react/scratch.tsx +50 -0
- package/src/react/ssr.ts +25 -0
- package/src/react/testing.tsx +1 -0
- package/src/react/tests/testUtils.tsx +54 -0
- package/src/react/tests/useAcceptInvite.test.ts +55 -0
- package/src/react-core/auth/DemoAuth.tsx +47 -0
- package/src/react-core/auth/PassphraseAuth.tsx +58 -0
- package/src/react-core/auth/index.ts +2 -0
- package/src/react-core/hooks.ts +310 -0
- package/src/react-core/index.ts +3 -0
- package/src/react-core/provider.tsx +11 -0
- package/src/react-core/testing.tsx +42 -0
- package/src/react-core/tests/testUtils.tsx +65 -0
- package/src/react-core/tests/useAccount.test.ts +238 -0
- package/src/react-core/tests/useCoState.test.ts +553 -0
- package/src/react-core/tests/useDemoAuth.test.tsx +84 -0
- package/src/react-core/tests/useInboxSender.test.ts +58 -0
- package/src/react-core/tests/useIsAuthenticated.test.ts +34 -0
- package/src/react-core/tests/usePassPhraseAuth.test.ts +180 -0
- package/src/react-core/utils.ts +28 -0
- package/src/react-native/crypto.ts +1 -0
- package/src/react-native/index.ts +5 -0
- package/src/react-native/provider.tsx +30 -0
- package/src/react-native/storage/mmkv-store-adapter.ts +24 -0
- package/src/react-native/storage/op-sqlite-adapter.ts +79 -0
- package/src/react-native/testing.ts +1 -0
- package/src/react-native-core/ReactNativeContextManager.ts +84 -0
- package/src/react-native-core/auth/DemoAuthUI.tsx +202 -0
- package/src/react-native-core/auth/auth.ts +14 -0
- package/src/react-native-core/crypto/RNQuickCrypto.ts +92 -0
- package/src/react-native-core/crypto/index.ts +1 -0
- package/src/react-native-core/hooks.tsx +64 -0
- package/src/react-native-core/index.ts +9 -0
- package/src/react-native-core/media.tsx +99 -0
- package/src/react-native-core/platform.ts +250 -0
- package/src/react-native-core/provider.tsx +115 -0
- package/src/react-native-core/storage/sqlite-react-native.ts +19 -0
- package/src/react-native-core/testing.tsx +1 -0
- package/src/react-native-media-images/index.ts +238 -0
- package/src/svelte/Provider.svelte +61 -0
- package/src/svelte/auth/PasskeyAuth.svelte.ts +42 -0
- package/src/svelte/auth/PasskeyAuthBasicUI.svelte +81 -0
- package/src/svelte/auth/PassphraseAuth.svelte.ts +49 -0
- package/src/svelte/auth/index.ts +3 -0
- package/src/svelte/auth/useIsAuthenticated.svelte.ts +28 -0
- package/src/svelte/index.ts +5 -0
- package/src/svelte/jazz.class.svelte.ts +172 -0
- package/src/svelte/jazz.svelte.ts +109 -0
- package/src/svelte/testing.ts +42 -0
- package/src/testing.ts +1 -312
- package/src/tiptap/index.ts +28 -0
- package/src/tools/auth/KvStoreContext.ts +39 -0
- package/src/tools/auth/clerk/getClerkUsername.ts +36 -0
- package/src/tools/auth/clerk/index.ts +174 -0
- package/src/tools/auth/clerk/tests/JazzClerkAuth.test.ts +284 -0
- package/src/tools/auth/clerk/tests/getClerkUsername.test.ts +81 -0
- package/src/tools/auth/clerk/tests/types.test.ts +49 -0
- package/src/tools/auth/clerk/types.ts +56 -0
- package/src/tools/coValues/coFeed.ts +943 -0
- package/src/tools/exports.ts +117 -0
- package/src/tools/index.ts +8 -0
- package/src/tools/testing.ts +301 -0
- package/src/tools/tests/coFeed.test.ts +771 -0
- package/src/tools/tests/fixtures.ts +2050 -0
- package/src/worker/index.ts +127 -0
- package/tsconfig.json +10 -3
- package/tsconfig.svelte.json +6 -0
- package/tsup.config.ts +143 -9
- package/dist/auth/AuthSecretStorage.d.ts.map +0 -1
- package/dist/auth/DemoAuth.d.ts.map +0 -1
- package/dist/auth/InMemoryKVStore.d.ts.map +0 -1
- package/dist/auth/KvStoreContext.d.ts.map +0 -1
- package/dist/auth/PassphraseAuth.d.ts.map +0 -1
- package/dist/chunk-G3QC4FAY.js +0 -4826
- package/dist/chunk-G3QC4FAY.js.map +0 -1
- package/dist/coValues/CoValueBase.d.ts.map +0 -1
- package/dist/coValues/account.d.ts.map +0 -1
- package/dist/coValues/coFeed.d.ts +0 -367
- package/dist/coValues/coFeed.d.ts.map +0 -1
- package/dist/coValues/coList.d.ts.map +0 -1
- package/dist/coValues/coMap.d.ts.map +0 -1
- package/dist/coValues/coPlainText.d.ts.map +0 -1
- package/dist/coValues/coRichText.d.ts.map +0 -1
- package/dist/coValues/deepLoading.d.ts.map +0 -1
- package/dist/coValues/extensions/imageDef.d.ts.map +0 -1
- package/dist/coValues/group.d.ts.map +0 -1
- package/dist/coValues/inbox.d.ts.map +0 -1
- package/dist/coValues/interfaces.d.ts.map +0 -1
- package/dist/coValues/profile.d.ts.map +0 -1
- package/dist/coValues/registeredSchemas.d.ts.map +0 -1
- package/dist/coValues/schemaUnion.d.ts.map +0 -1
- package/dist/exports.d.ts +0 -23
- package/dist/exports.d.ts.map +0 -1
- package/dist/implementation/ContextManager.d.ts.map +0 -1
- package/dist/implementation/activeAccountContext.d.ts.map +0 -1
- package/dist/implementation/anonymousJazzAgent.d.ts.map +0 -1
- package/dist/implementation/createContext.d.ts.map +0 -1
- package/dist/implementation/devtoolsFormatters.d.ts.map +0 -1
- package/dist/implementation/errors.d.ts.map +0 -1
- package/dist/implementation/inspect.d.ts.map +0 -1
- package/dist/implementation/invites.d.ts.map +0 -1
- package/dist/implementation/refs.d.ts.map +0 -1
- package/dist/implementation/schema.d.ts.map +0 -1
- package/dist/implementation/symbols.d.ts.map +0 -1
- package/dist/implementation/zodSchema/coExport.d.ts.map +0 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +0 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts.map +0 -1
- package/dist/implementation/zodSchema/unionUtils.d.ts.map +0 -1
- package/dist/implementation/zodSchema/zodCo.d.ts.map +0 -1
- package/dist/implementation/zodSchema/zodReExport.d.ts.map +0 -1
- package/dist/implementation/zodSchema/zodSchema.d.ts.map +0 -1
- package/dist/internal.d.ts.map +0 -1
- package/dist/lib/cache.d.ts.map +0 -1
- package/dist/lib/cache.test.d.ts.map +0 -1
- package/dist/lib/migration.d.ts.map +0 -1
- package/dist/subscribe/CoValueCoreSubscription.d.ts.map +0 -1
- package/dist/subscribe/JazzError.d.ts.map +0 -1
- package/dist/subscribe/SubscriptionScope.d.ts.map +0 -1
- package/dist/subscribe/index.d.ts.map +0 -1
- package/dist/subscribe/types.d.ts.map +0 -1
- package/dist/subscribe/utils.d.ts.map +0 -1
- package/dist/tests/AuthSecretStorage.test.d.ts.map +0 -1
- package/dist/tests/ContextManager.test.d.ts.map +0 -1
- package/dist/tests/DemoAuth.test.d.ts.map +0 -1
- package/dist/tests/PassphraseAuth.test.d.ts.map +0 -1
- package/dist/tests/account.test.d.ts.map +0 -1
- package/dist/tests/coFeed.test-d.d.ts.map +0 -1
- package/dist/tests/coFeed.test.d.ts.map +0 -1
- package/dist/tests/coList.test-d.d.ts.map +0 -1
- package/dist/tests/coList.test.d.ts.map +0 -1
- package/dist/tests/coMap.record.test-d.d.ts.map +0 -1
- package/dist/tests/coMap.record.test.d.ts.map +0 -1
- package/dist/tests/coMap.test-d.d.ts.map +0 -1
- package/dist/tests/coMap.test.d.ts.map +0 -1
- package/dist/tests/coPlainText.test.d.ts.map +0 -1
- package/dist/tests/createContext.test.d.ts.map +0 -1
- package/dist/tests/deepLoading.test.d.ts.map +0 -1
- package/dist/tests/fixtures.d.ts.map +0 -1
- package/dist/tests/groupsAndAccounts.test.d.ts.map +0 -1
- package/dist/tests/imageDef.test.d.ts.map +0 -1
- package/dist/tests/inbox.test.d.ts.map +0 -1
- package/dist/tests/interfaces.test.d.ts.map +0 -1
- package/dist/tests/invites.test.d.ts.map +0 -1
- package/dist/tests/load.test.d.ts.map +0 -1
- package/dist/tests/patterns/notifications.test.d.ts.map +0 -1
- package/dist/tests/patterns/requestToJoin.test.d.ts.map +0 -1
- package/dist/tests/schema.test.d.ts.map +0 -1
- package/dist/tests/schemaUnion.test.d.ts.map +0 -1
- package/dist/tests/subscribe.test.d.ts.map +0 -1
- package/dist/tests/testing.test.d.ts.map +0 -1
- package/dist/tests/utils.d.ts.map +0 -1
- package/dist/tests/zod.test.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/src/coValues/coFeed.ts +0 -938
- package/src/exports.ts +0 -108
- package/src/tests/coFeed.test.ts +0 -722
- /package/dist/{tests → react-core/tests}/fixtures.d.ts +0 -0
- /package/dist/{auth → tools/auth}/AuthSecretStorage.d.ts +0 -0
- /package/dist/{auth → tools/auth}/DemoAuth.d.ts +0 -0
- /package/dist/{auth → tools/auth}/InMemoryKVStore.d.ts +0 -0
- /package/dist/{auth → tools/auth}/KvStoreContext.d.ts +0 -0
- /package/dist/{auth → tools/auth}/PassphraseAuth.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/CoValueBase.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/account.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coList.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coMap.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coPlainText.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coRichText.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/deepLoading.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/extensions/imageDef.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/group.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/inbox.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/interfaces.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/profile.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/registeredSchemas.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/schemaUnion.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/ContextManager.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/activeAccountContext.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/anonymousJazzAgent.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/createContext.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/devtoolsFormatters.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/errors.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/inspect.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/invites.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/refs.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/schema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/symbols.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/coExport.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/AccountSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoFeedSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoListSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoMapSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoRecordSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/FileStreamSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/PlainTextSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/RichTextSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/unionUtils.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/zodCo.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/zodReExport.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/zodSchema.d.ts +0 -0
- /package/dist/{internal.d.ts → tools/internal.d.ts} +0 -0
- /package/dist/{lib → tools/lib}/cache.d.ts +0 -0
- /package/dist/{lib → tools/lib}/cache.test.d.ts +0 -0
- /package/dist/{lib → tools/lib}/migration.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/CoValueCoreSubscription.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/JazzError.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/SubscriptionScope.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/index.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/types.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/utils.d.ts +0 -0
- /package/dist/{tests → tools/tests}/AuthSecretStorage.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/ContextManager.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/DemoAuth.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/PassphraseAuth.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/account.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coFeed.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coFeed.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coList.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coList.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.record.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.record.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coPlainText.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/createContext.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/deepLoading.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/groupsAndAccounts.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/imageDef.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/inbox.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/interfaces.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/invites.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/load.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/patterns/notifications.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/patterns/requestToJoin.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/schema.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/schemaUnion.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/subscribe.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/testing.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/utils.d.ts +0 -0
- /package/dist/{tests → tools/tests}/zod.test.d.ts +0 -0
- /package/dist/{types.d.ts → tools/types.d.ts} +0 -0
- /package/src/{tests → react-core/tests}/fixtures.ts +0 -0
- /package/src/{auth/KvStoreContext.ts → react-native-core/storage/kv-store-context.ts} +0 -0
- /package/src/{auth → tools/auth}/AuthSecretStorage.ts +0 -0
- /package/src/{auth → tools/auth}/DemoAuth.ts +0 -0
- /package/src/{auth → tools/auth}/InMemoryKVStore.ts +0 -0
- /package/src/{auth → tools/auth}/PassphraseAuth.ts +0 -0
- /package/src/{coValues → tools/coValues}/CoValueBase.ts +0 -0
- /package/src/{coValues → tools/coValues}/account.ts +0 -0
- /package/src/{coValues → tools/coValues}/coList.ts +0 -0
- /package/src/{coValues → tools/coValues}/coMap.ts +0 -0
- /package/src/{coValues → tools/coValues}/coPlainText.ts +0 -0
- /package/src/{coValues → tools/coValues}/coRichText.ts +0 -0
- /package/src/{coValues → tools/coValues}/deepLoading.ts +0 -0
- /package/src/{coValues → tools/coValues}/extensions/imageDef.ts +0 -0
- /package/src/{coValues → tools/coValues}/group.ts +0 -0
- /package/src/{coValues → tools/coValues}/inbox.ts +0 -0
- /package/src/{coValues → tools/coValues}/interfaces.ts +0 -0
- /package/src/{coValues → tools/coValues}/profile.ts +0 -0
- /package/src/{coValues → tools/coValues}/registeredSchemas.ts +0 -0
- /package/src/{coValues → tools/coValues}/schemaUnion.ts +0 -0
- /package/src/{implementation → tools/implementation}/ContextManager.ts +0 -0
- /package/src/{implementation → tools/implementation}/activeAccountContext.ts +0 -0
- /package/src/{implementation → tools/implementation}/anonymousJazzAgent.ts +0 -0
- /package/src/{implementation → tools/implementation}/createContext.ts +0 -0
- /package/src/{implementation → tools/implementation}/devtoolsFormatters.ts +0 -0
- /package/src/{implementation → tools/implementation}/errors.ts +0 -0
- /package/src/{implementation → tools/implementation}/inspect.ts +0 -0
- /package/src/{implementation → tools/implementation}/invites.ts +0 -0
- /package/src/{implementation → tools/implementation}/refs.ts +0 -0
- /package/src/{implementation → tools/implementation}/schema.ts +0 -0
- /package/src/{implementation → tools/implementation}/symbols.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/coExport.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodFieldToCoFieldDef.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodSchemaToCoSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/AccountSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoFeedSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoListSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoMapSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoRecordSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/FileStreamSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/PlainTextSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/RichTextSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/unionUtils.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/zodCo.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/zodReExport.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/zodSchema.ts +0 -0
- /package/src/{internal.ts → tools/internal.ts} +0 -0
- /package/src/{lib → tools/lib}/cache.test.ts +0 -0
- /package/src/{lib → tools/lib}/cache.ts +0 -0
- /package/src/{lib → tools/lib}/migration.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/CoValueCoreSubscription.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/JazzError.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/SubscriptionScope.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/index.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/types.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/utils.ts +0 -0
- /package/src/{tests → tools/tests}/AuthSecretStorage.test.ts +0 -0
- /package/src/{tests → tools/tests}/ContextManager.test.ts +0 -0
- /package/src/{tests → tools/tests}/DemoAuth.test.ts +0 -0
- /package/src/{tests → tools/tests}/PassphraseAuth.test.ts +0 -0
- /package/src/{tests → tools/tests}/account.test.ts +0 -0
- /package/src/{tests → tools/tests}/coFeed.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coList.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coList.test.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.record.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.record.test.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.test.ts +0 -0
- /package/src/{tests → tools/tests}/coPlainText.test.ts +0 -0
- /package/src/{tests → tools/tests}/createContext.test.ts +0 -0
- /package/src/{tests → tools/tests}/deepLoading.test.ts +0 -0
- /package/src/{tests → tools/tests}/groupsAndAccounts.test.ts +0 -0
- /package/src/{tests → tools/tests}/imageDef.test.ts +0 -0
- /package/src/{tests → tools/tests}/inbox.test.ts +0 -0
- /package/src/{tests → tools/tests}/interfaces.test.ts +0 -0
- /package/src/{tests → tools/tests}/invites.test.ts +0 -0
- /package/src/{tests → tools/tests}/load.test.ts +0 -0
- /package/src/{tests → tools/tests}/patterns/notifications.test.ts +0 -0
- /package/src/{tests → tools/tests}/patterns/requestToJoin.test.ts +0 -0
- /package/src/{tests → tools/tests}/schema.test.ts +0 -0
- /package/src/{tests → tools/tests}/schemaUnion.test.ts +0 -0
- /package/src/{tests → tools/tests}/subscribe.test.ts +0 -0
- /package/src/{tests → tools/tests}/testing.test.ts +0 -0
- /package/src/{tests → tools/tests}/utils.ts +0 -0
- /package/src/{tests → tools/tests}/zod.test.ts +0 -0
- /package/src/{types.ts → tools/types.ts} +0 -0
@@ -0,0 +1,374 @@
|
|
1
|
+
import {
|
2
|
+
CoID,
|
3
|
+
LocalNode,
|
4
|
+
RawBinaryCoStream,
|
5
|
+
RawCoStream,
|
6
|
+
RawCoValue,
|
7
|
+
} from "cojson";
|
8
|
+
import { base64URLtoBytes } from "cojson";
|
9
|
+
import { BinaryStreamItem, BinaryStreamStart, CoStreamItem } from "cojson";
|
10
|
+
import type { JsonObject, JsonValue } from "cojson";
|
11
|
+
import { styled } from "goober";
|
12
|
+
import { useEffect, useState } from "react";
|
13
|
+
import { Badge } from "../ui/badge.js";
|
14
|
+
import { Button } from "../ui/button.js";
|
15
|
+
import { AccountOrGroupText } from "./account-or-group-text.js";
|
16
|
+
import { PageInfo } from "./types.js";
|
17
|
+
|
18
|
+
// typeguard for BinaryStreamStart
|
19
|
+
function isBinaryStreamStart(item: unknown): item is BinaryStreamStart {
|
20
|
+
return (
|
21
|
+
typeof item === "object" &&
|
22
|
+
item !== null &&
|
23
|
+
"type" in item &&
|
24
|
+
item.type === "start"
|
25
|
+
);
|
26
|
+
}
|
27
|
+
|
28
|
+
export function detectCoStreamType(value: RawCoStream | RawBinaryCoStream) {
|
29
|
+
const firstKey = Object.keys(value.items)[0];
|
30
|
+
if (!firstKey)
|
31
|
+
return {
|
32
|
+
type: "unknown",
|
33
|
+
};
|
34
|
+
|
35
|
+
const items = value.items[firstKey as never]?.map((v) => v.value);
|
36
|
+
|
37
|
+
if (!items)
|
38
|
+
return {
|
39
|
+
type: "unknown",
|
40
|
+
};
|
41
|
+
const firstItem = items[0];
|
42
|
+
if (!firstItem)
|
43
|
+
return {
|
44
|
+
type: "unknown",
|
45
|
+
};
|
46
|
+
// This is a binary stream
|
47
|
+
if (isBinaryStreamStart(firstItem)) {
|
48
|
+
return {
|
49
|
+
type: "binary",
|
50
|
+
items: items as BinaryStreamItem[],
|
51
|
+
};
|
52
|
+
} else {
|
53
|
+
return {
|
54
|
+
type: "coStream",
|
55
|
+
};
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
async function getBlobFromCoStream({
|
60
|
+
items,
|
61
|
+
onlyFirstChunk = false,
|
62
|
+
}: {
|
63
|
+
items: BinaryStreamItem[];
|
64
|
+
onlyFirstChunk?: boolean;
|
65
|
+
}) {
|
66
|
+
if (onlyFirstChunk && items.length > 1) {
|
67
|
+
items = items.slice(0, 2);
|
68
|
+
}
|
69
|
+
|
70
|
+
const chunks: Uint8Array[] = [];
|
71
|
+
|
72
|
+
const binary_U_prefixLength = 8;
|
73
|
+
|
74
|
+
let lastProgressUpdate = Date.now();
|
75
|
+
|
76
|
+
for (const item of items.slice(1)) {
|
77
|
+
if (item.type === "end") {
|
78
|
+
break;
|
79
|
+
}
|
80
|
+
|
81
|
+
if (item.type !== "chunk") {
|
82
|
+
console.error("Invalid binary stream chunk", item);
|
83
|
+
return undefined;
|
84
|
+
}
|
85
|
+
|
86
|
+
const chunk = base64URLtoBytes(item.chunk.slice(binary_U_prefixLength));
|
87
|
+
// totalLength += chunk.length;
|
88
|
+
chunks.push(chunk);
|
89
|
+
|
90
|
+
if (Date.now() - lastProgressUpdate > 100) {
|
91
|
+
lastProgressUpdate = Date.now();
|
92
|
+
}
|
93
|
+
}
|
94
|
+
const defaultMime =
|
95
|
+
items[0] && "mimeType" in items[0] ? items[0].mimeType : null;
|
96
|
+
|
97
|
+
const blob = new Blob(chunks, defaultMime ? { type: defaultMime } : {});
|
98
|
+
|
99
|
+
const mimeType =
|
100
|
+
defaultMime === "" ? await detectPDFMimeType(blob) : defaultMime;
|
101
|
+
|
102
|
+
return {
|
103
|
+
blob,
|
104
|
+
mimeType: mimeType as string,
|
105
|
+
unfinishedChunks: items.length > 1,
|
106
|
+
totalSize:
|
107
|
+
items[0] && "totalSizeBytes" in items[0]
|
108
|
+
? (items[0].totalSizeBytes as number)
|
109
|
+
: undefined,
|
110
|
+
};
|
111
|
+
}
|
112
|
+
|
113
|
+
const detectPDFMimeType = async (blob: Blob): Promise<string> => {
|
114
|
+
const arrayBuffer = await blob.slice(0, 4).arrayBuffer();
|
115
|
+
const uint8Array = new Uint8Array(arrayBuffer);
|
116
|
+
const header = uint8Array.reduce(
|
117
|
+
(acc, byte) => acc + String.fromCharCode(byte),
|
118
|
+
"",
|
119
|
+
);
|
120
|
+
|
121
|
+
if (header === "%PDF") {
|
122
|
+
return "application/pdf";
|
123
|
+
}
|
124
|
+
return "unknown";
|
125
|
+
};
|
126
|
+
|
127
|
+
const BinaryDownloadButton = ({
|
128
|
+
pdfBlob,
|
129
|
+
fileName = "document",
|
130
|
+
label,
|
131
|
+
mimeType,
|
132
|
+
}: {
|
133
|
+
pdfBlob: Blob;
|
134
|
+
mimeType?: string;
|
135
|
+
fileName?: string;
|
136
|
+
label: string;
|
137
|
+
}) => {
|
138
|
+
const downloadFile = () => {
|
139
|
+
const url = URL.createObjectURL(
|
140
|
+
new Blob([pdfBlob], mimeType ? { type: mimeType } : {}),
|
141
|
+
);
|
142
|
+
const link = document.createElement("a");
|
143
|
+
link.href = url;
|
144
|
+
link.download =
|
145
|
+
mimeType === "application/pdf" ? `${fileName}.pdf` : fileName;
|
146
|
+
document.body.appendChild(link);
|
147
|
+
link.click();
|
148
|
+
document.body.removeChild(link);
|
149
|
+
URL.revokeObjectURL(url);
|
150
|
+
};
|
151
|
+
|
152
|
+
return (
|
153
|
+
<Button variant="secondary" onClick={downloadFile}>
|
154
|
+
⬇️ {label}
|
155
|
+
{/* Download {mimeType === "application/pdf" ? "PDF" : "File"} */}
|
156
|
+
</Button>
|
157
|
+
);
|
158
|
+
};
|
159
|
+
|
160
|
+
const LabelContentPairContainer = styled("div")`
|
161
|
+
display: flex;
|
162
|
+
flex-direction: column;
|
163
|
+
gap: 0.375rem;
|
164
|
+
`;
|
165
|
+
|
166
|
+
const BinaryStreamGrid = styled("div")`
|
167
|
+
display: grid;
|
168
|
+
grid-template-columns: repeat(3, 1fr);
|
169
|
+
gap: 0.5rem;
|
170
|
+
max-width: 48rem;
|
171
|
+
`;
|
172
|
+
|
173
|
+
const ImagePreviewContainer = styled("div")`
|
174
|
+
background-color: rgb(249 250 251);
|
175
|
+
padding: 0.75rem;
|
176
|
+
border-radius: var(--j-radius-md);
|
177
|
+
@media (prefers-color-scheme: dark) {
|
178
|
+
background-color: rgb(28 25 23);
|
179
|
+
}
|
180
|
+
`;
|
181
|
+
|
182
|
+
const CoStreamGrid = styled("div")`
|
183
|
+
display: grid;
|
184
|
+
grid-template-columns: repeat(3, 1fr);
|
185
|
+
gap: 0.5rem;
|
186
|
+
`;
|
187
|
+
|
188
|
+
const CoStreamItemContainer = styled("div")`
|
189
|
+
padding: 0.75rem;
|
190
|
+
border-radius: var(--j-radius-lg);
|
191
|
+
overflow: hidden;
|
192
|
+
border: 1px solid rgb(229 231 235);
|
193
|
+
cursor: pointer;
|
194
|
+
box-shadow: var(--j-shadow-sm);
|
195
|
+
&:hover {
|
196
|
+
background-color: rgb(243 244 246 / 0.05);
|
197
|
+
}
|
198
|
+
`;
|
199
|
+
|
200
|
+
const LabelContentPair = ({
|
201
|
+
label,
|
202
|
+
content,
|
203
|
+
}: {
|
204
|
+
label: string;
|
205
|
+
content: React.ReactNode;
|
206
|
+
}) => {
|
207
|
+
return (
|
208
|
+
<LabelContentPairContainer>
|
209
|
+
<span>{label}</span>
|
210
|
+
<span>{content}</span>
|
211
|
+
</LabelContentPairContainer>
|
212
|
+
);
|
213
|
+
};
|
214
|
+
|
215
|
+
function RenderCoBinaryStream({
|
216
|
+
value,
|
217
|
+
items,
|
218
|
+
}: {
|
219
|
+
items: BinaryStreamItem[];
|
220
|
+
value: RawBinaryCoStream;
|
221
|
+
}) {
|
222
|
+
const [file, setFile] = useState<
|
223
|
+
| {
|
224
|
+
blob: Blob;
|
225
|
+
mimeType: string;
|
226
|
+
unfinishedChunks: boolean;
|
227
|
+
totalSize: number | undefined;
|
228
|
+
}
|
229
|
+
| undefined
|
230
|
+
| null
|
231
|
+
>(null);
|
232
|
+
const [isLoading, setIsLoading] = useState(true);
|
233
|
+
|
234
|
+
useEffect(() => {
|
235
|
+
// load only the first chunk to get the mime type and size
|
236
|
+
getBlobFromCoStream({
|
237
|
+
items,
|
238
|
+
onlyFirstChunk: true,
|
239
|
+
})
|
240
|
+
.then((v) => {
|
241
|
+
if (v) {
|
242
|
+
setFile(v);
|
243
|
+
if (v.mimeType.includes("image")) {
|
244
|
+
// If it's an image, load the full blob
|
245
|
+
getBlobFromCoStream({
|
246
|
+
items,
|
247
|
+
}).then((s) => {
|
248
|
+
if (s) setFile(s);
|
249
|
+
});
|
250
|
+
}
|
251
|
+
}
|
252
|
+
})
|
253
|
+
.finally(() => setIsLoading(false));
|
254
|
+
}, [items]);
|
255
|
+
|
256
|
+
if (!isLoading && !file) return <div>No blob</div>;
|
257
|
+
|
258
|
+
if (isLoading) return <div>Loading...</div>;
|
259
|
+
if (!file) return <div>No blob</div>;
|
260
|
+
|
261
|
+
const { blob, mimeType } = file;
|
262
|
+
|
263
|
+
const sizeInKB = (file.totalSize || 0) / 1024;
|
264
|
+
|
265
|
+
return (
|
266
|
+
<>
|
267
|
+
<BinaryStreamGrid>
|
268
|
+
<LabelContentPair
|
269
|
+
label="Mime Type"
|
270
|
+
content={<Badge>{mimeType || "No mime type"}</Badge>}
|
271
|
+
/>
|
272
|
+
<LabelContentPair
|
273
|
+
label="Size"
|
274
|
+
content={<span>{sizeInKB.toFixed(2)} KB</span>}
|
275
|
+
/>
|
276
|
+
<LabelContentPair
|
277
|
+
label="Download"
|
278
|
+
content={
|
279
|
+
<BinaryDownloadButton
|
280
|
+
fileName={value.id.toString()}
|
281
|
+
pdfBlob={blob}
|
282
|
+
mimeType={mimeType}
|
283
|
+
label={
|
284
|
+
mimeType === "application/pdf"
|
285
|
+
? "Download PDF"
|
286
|
+
: "Download file"
|
287
|
+
}
|
288
|
+
/>
|
289
|
+
}
|
290
|
+
/>
|
291
|
+
</BinaryStreamGrid>
|
292
|
+
{mimeType === "image/png" || mimeType === "image/jpeg" ? (
|
293
|
+
<LabelContentPair
|
294
|
+
label="Preview"
|
295
|
+
content={
|
296
|
+
<ImagePreviewContainer>
|
297
|
+
<RenderBlobImage blob={blob} />
|
298
|
+
</ImagePreviewContainer>
|
299
|
+
}
|
300
|
+
/>
|
301
|
+
) : null}
|
302
|
+
</>
|
303
|
+
);
|
304
|
+
}
|
305
|
+
|
306
|
+
function RenderCoStream({
|
307
|
+
value,
|
308
|
+
node,
|
309
|
+
}: {
|
310
|
+
value: RawCoStream;
|
311
|
+
node: LocalNode;
|
312
|
+
}) {
|
313
|
+
const streamPerUser = Object.keys(value.items);
|
314
|
+
const userCoIds = streamPerUser.map((stream) => stream.split("_session")[0]);
|
315
|
+
|
316
|
+
return (
|
317
|
+
<CoStreamGrid>
|
318
|
+
{userCoIds.map((id, idx) => (
|
319
|
+
<CoStreamItemContainer key={id}>
|
320
|
+
<AccountOrGroupText coId={id as CoID<RawCoValue>} node={node} />
|
321
|
+
{/* @ts-expect-error - TODO: fix types */}
|
322
|
+
{value.items[streamPerUser[idx]]?.map(
|
323
|
+
(item: CoStreamItem<JsonValue>) => (
|
324
|
+
<div>
|
325
|
+
{new Date(item.madeAt).toLocaleString()}{" "}
|
326
|
+
{JSON.stringify(item.value)}
|
327
|
+
</div>
|
328
|
+
),
|
329
|
+
)}
|
330
|
+
</CoStreamItemContainer>
|
331
|
+
))}
|
332
|
+
</CoStreamGrid>
|
333
|
+
);
|
334
|
+
}
|
335
|
+
|
336
|
+
export function CoStreamView({
|
337
|
+
value,
|
338
|
+
node,
|
339
|
+
}: {
|
340
|
+
data: JsonObject;
|
341
|
+
onNavigate: (pages: PageInfo[]) => void;
|
342
|
+
node: LocalNode;
|
343
|
+
value: RawCoStream;
|
344
|
+
}) {
|
345
|
+
// if (!value) return <div>No value</div>;
|
346
|
+
|
347
|
+
const streamType = detectCoStreamType(value);
|
348
|
+
|
349
|
+
if (streamType.type === "binary") {
|
350
|
+
if (streamType.items === undefined) {
|
351
|
+
return <div>No binary stream</div>;
|
352
|
+
}
|
353
|
+
|
354
|
+
return (
|
355
|
+
<RenderCoBinaryStream
|
356
|
+
value={value as RawBinaryCoStream}
|
357
|
+
items={streamType.items}
|
358
|
+
/>
|
359
|
+
);
|
360
|
+
}
|
361
|
+
|
362
|
+
if (streamType.type === "coStream") {
|
363
|
+
return <RenderCoStream value={value} node={node} />;
|
364
|
+
}
|
365
|
+
|
366
|
+
if (streamType.type === "unknown") return <div>Unknown stream type</div>;
|
367
|
+
|
368
|
+
return <div>Unknown stream type</div>;
|
369
|
+
}
|
370
|
+
|
371
|
+
function RenderBlobImage({ blob }: { blob: Blob }) {
|
372
|
+
const urlCreator = window.URL || window.webkitURL;
|
373
|
+
return <img src={urlCreator.createObjectURL(blob)} />;
|
374
|
+
}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import { CoID, LocalNode, RawCoValue } from "cojson";
|
2
|
+
import { JsonObject, JsonValue } from "cojson";
|
3
|
+
import { ResolveIcon } from "./type-icon.js";
|
4
|
+
import { PageInfo, isCoId } from "./types.js";
|
5
|
+
import { CoMapPreview, ValueRenderer } from "./value-renderer.js";
|
6
|
+
|
7
|
+
import { Badge } from "../ui/badge.js";
|
8
|
+
import { Card, CardBody, CardHeader } from "../ui/card.js";
|
9
|
+
import { Grid } from "../ui/grid.js";
|
10
|
+
import { Text } from "../ui/text.js";
|
11
|
+
|
12
|
+
function GridItem({
|
13
|
+
entry,
|
14
|
+
onNavigate,
|
15
|
+
node,
|
16
|
+
}: {
|
17
|
+
entry: [string, JsonValue | undefined];
|
18
|
+
onNavigate: (pages: PageInfo[]) => void;
|
19
|
+
node: LocalNode;
|
20
|
+
}) {
|
21
|
+
const [key, value] = entry;
|
22
|
+
const isCoValue = isCoId(value);
|
23
|
+
|
24
|
+
const props = isCoValue
|
25
|
+
? {
|
26
|
+
onClick: () =>
|
27
|
+
onNavigate([{ coId: value as CoID<RawCoValue>, name: key }]),
|
28
|
+
as: "button",
|
29
|
+
}
|
30
|
+
: {
|
31
|
+
style: {
|
32
|
+
backgroundColor: "var(--j-foreground)",
|
33
|
+
borderColor: "var(--j-foreground)",
|
34
|
+
},
|
35
|
+
};
|
36
|
+
|
37
|
+
return (
|
38
|
+
<Card {...props}>
|
39
|
+
<CardHeader>
|
40
|
+
{isCoValue ? (
|
41
|
+
<>
|
42
|
+
<Text strong>{key}</Text>
|
43
|
+
<Badge>
|
44
|
+
<ResolveIcon coId={value as CoID<RawCoValue>} node={node} />
|
45
|
+
</Badge>
|
46
|
+
</>
|
47
|
+
) : (
|
48
|
+
<Text strong>{key}</Text>
|
49
|
+
)}
|
50
|
+
</CardHeader>
|
51
|
+
<CardBody style={{ wordBreak: "break-word" }}>
|
52
|
+
{isCoValue ? (
|
53
|
+
<CoMapPreview coId={value as CoID<RawCoValue>} node={node} />
|
54
|
+
) : (
|
55
|
+
<ValueRenderer
|
56
|
+
json={value}
|
57
|
+
onCoIDClick={(coId) => {
|
58
|
+
onNavigate([{ coId, name: key }]);
|
59
|
+
}}
|
60
|
+
/>
|
61
|
+
)}
|
62
|
+
</CardBody>
|
63
|
+
</Card>
|
64
|
+
);
|
65
|
+
}
|
66
|
+
|
67
|
+
export function GridView({
|
68
|
+
data,
|
69
|
+
onNavigate,
|
70
|
+
node,
|
71
|
+
}: {
|
72
|
+
data: JsonObject;
|
73
|
+
onNavigate: (pages: PageInfo[]) => void;
|
74
|
+
node: LocalNode;
|
75
|
+
}) {
|
76
|
+
const entries = Object.entries(data);
|
77
|
+
|
78
|
+
return (
|
79
|
+
<Grid cols={entries.length === 1 ? 1 : 3}>
|
80
|
+
{entries.map((entry, childIndex) => (
|
81
|
+
<GridItem
|
82
|
+
entry={entry}
|
83
|
+
onNavigate={onNavigate}
|
84
|
+
node={node}
|
85
|
+
key={childIndex}
|
86
|
+
/>
|
87
|
+
))}
|
88
|
+
</Grid>
|
89
|
+
);
|
90
|
+
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { JsonObject, LocalNode, RawAccount } from "cojson";
|
2
|
+
import { CoID } from "cojson";
|
3
|
+
import {
|
4
|
+
Table,
|
5
|
+
TableBody,
|
6
|
+
TableCell,
|
7
|
+
TableHead,
|
8
|
+
TableHeader,
|
9
|
+
TableRow,
|
10
|
+
} from "../ui/table.js";
|
11
|
+
import { Text } from "../ui/text.js";
|
12
|
+
import { AccountOrGroupText } from "./account-or-group-text.js";
|
13
|
+
import { RawDataCard } from "./raw-data-card.js";
|
14
|
+
import { PageInfo, isCoId } from "./types.js";
|
15
|
+
|
16
|
+
export function GroupView({
|
17
|
+
data,
|
18
|
+
onNavigate,
|
19
|
+
node,
|
20
|
+
}: {
|
21
|
+
data: JsonObject;
|
22
|
+
onNavigate: (pages: PageInfo[]) => void;
|
23
|
+
node: LocalNode;
|
24
|
+
}) {
|
25
|
+
return (
|
26
|
+
<>
|
27
|
+
<Text strong>Members</Text>
|
28
|
+
|
29
|
+
<Table>
|
30
|
+
<TableHead>
|
31
|
+
<TableRow>
|
32
|
+
<TableHeader>Account</TableHeader>
|
33
|
+
<TableHeader>Permission</TableHeader>
|
34
|
+
</TableRow>
|
35
|
+
</TableHead>
|
36
|
+
<TableBody>
|
37
|
+
{"everyone" in data && typeof data.everyone === "string" ? (
|
38
|
+
<TableRow>
|
39
|
+
<TableCell>everyone</TableCell>
|
40
|
+
<TableCell>{data.everyone}</TableCell>
|
41
|
+
</TableRow>
|
42
|
+
) : null}
|
43
|
+
|
44
|
+
{Object.entries(data).map(([key, value]) =>
|
45
|
+
isCoId(key) ? (
|
46
|
+
<TableRow key={key}>
|
47
|
+
<TableCell>
|
48
|
+
<AccountOrGroupText
|
49
|
+
coId={key as CoID<RawAccount>}
|
50
|
+
node={node}
|
51
|
+
showId
|
52
|
+
onClick={() => {
|
53
|
+
onNavigate([{ coId: key, name: key }]);
|
54
|
+
}}
|
55
|
+
/>
|
56
|
+
</TableCell>
|
57
|
+
<TableCell>{value as string}</TableCell>
|
58
|
+
</TableRow>
|
59
|
+
) : null,
|
60
|
+
)}
|
61
|
+
</TableBody>
|
62
|
+
</Table>
|
63
|
+
|
64
|
+
<RawDataCard data={data} />
|
65
|
+
</>
|
66
|
+
);
|
67
|
+
}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import { styled } from "goober";
|
2
|
+
import React from "react";
|
3
|
+
|
4
|
+
export type Position =
|
5
|
+
| "bottom right"
|
6
|
+
| "bottom left"
|
7
|
+
| "top right"
|
8
|
+
| "top left"
|
9
|
+
| "right"
|
10
|
+
| "left";
|
11
|
+
|
12
|
+
const StyledInspectorButton = styled("button")<{ position: Position }>`
|
13
|
+
position: fixed;
|
14
|
+
width: 2.5rem;
|
15
|
+
height: 2.5rem;
|
16
|
+
background-color: white;
|
17
|
+
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
18
|
+
margin: 1rem;
|
19
|
+
padding: 0.5rem !important;
|
20
|
+
border: 1px solid #e5e3e4;
|
21
|
+
border-radius: 0.375rem;
|
22
|
+
z-index: 999;
|
23
|
+
|
24
|
+
${(props) => {
|
25
|
+
switch (props.position) {
|
26
|
+
case "bottom right":
|
27
|
+
return "bottom: 0; right: 0;";
|
28
|
+
case "bottom left":
|
29
|
+
return "bottom: 0; left: 0;";
|
30
|
+
case "top right":
|
31
|
+
return "top: 0; right: 0;";
|
32
|
+
case "top left":
|
33
|
+
return "top: 0; left: 0;";
|
34
|
+
case "right":
|
35
|
+
return "right: 0; top: 50%; transform: translateY(-50%);";
|
36
|
+
case "left":
|
37
|
+
return "left: 0; top: 50%; transform: translateY(-50%);";
|
38
|
+
default:
|
39
|
+
return "";
|
40
|
+
}
|
41
|
+
}}
|
42
|
+
`;
|
43
|
+
|
44
|
+
const JazzIcon = styled("svg")`
|
45
|
+
width: 100%;
|
46
|
+
height: auto;
|
47
|
+
position: relative;
|
48
|
+
left: -1px;
|
49
|
+
color: #146AFF;
|
50
|
+
`;
|
51
|
+
|
52
|
+
export function InspectorButton({
|
53
|
+
position = "right",
|
54
|
+
...buttonProps
|
55
|
+
}: React.ComponentPropsWithoutRef<"button"> & { position?: Position }) {
|
56
|
+
return (
|
57
|
+
<StyledInspectorButton position={position} {...buttonProps}>
|
58
|
+
<JazzIcon
|
59
|
+
xmlns="http://www.w3.org/2000/svg"
|
60
|
+
width="119"
|
61
|
+
height="115"
|
62
|
+
viewBox="0 0 119 115"
|
63
|
+
fill="none"
|
64
|
+
>
|
65
|
+
<path
|
66
|
+
fillRule="evenodd"
|
67
|
+
clipRule="evenodd"
|
68
|
+
d="M118.179 23.8277V0.167999C99.931 7.5527 79.9854 11.6192 59.0897 11.6192C47.1466 11.6192 35.5138 10.2908 24.331 7.7737V30.4076V60.1508C23.2955 59.4385 22.1568 58.8458 20.9405 58.3915C18.1732 57.358 15.128 57.0876 12.1902 57.6145C9.2524 58.1414 6.5539 59.4419 4.4358 61.3516C2.3178 63.2613 0.875401 65.6944 0.291001 68.3433C-0.293399 70.9921 0.00659978 73.7377 1.1528 76.2329C2.2991 78.728 4.2403 80.861 6.7308 82.361C9.2214 83.862 12.1495 84.662 15.1448 84.662C15.6054 84.662 15.8365 84.662 16.0314 84.659C26.5583 84.449 35.042 75.9656 35.2513 65.4386C35.2534 65.3306 35.2544 65.2116 35.2548 65.0486L35.2552 64.7149V64.5521V61.0762V32.1993C43.0533 33.2324 51.0092 33.7656 59.0897 33.7656C59.6696 33.7656 60.2489 33.7629 60.8276 33.7574V89.696C59.792 88.983 58.6533 88.391 57.437 87.936C54.6697 86.903 51.6246 86.632 48.6867 87.159C45.7489 87.686 43.0504 88.987 40.9323 90.896C38.8143 92.806 37.3719 95.239 36.7875 97.888C36.2032 100.537 36.5031 103.283 37.6494 105.778C38.7956 108.273 40.7368 110.405 43.2273 111.906C45.7179 113.406 48.646 114.207 51.6414 114.207C52.1024 114.207 52.3329 114.207 52.5279 114.203C63.0548 113.994 71.5385 105.51 71.7478 94.983C71.7517 94.788 71.7517 94.558 71.7517 94.097V90.621V33.3266C83.962 32.4768 95.837 30.4075 107.255 27.2397V59.9017C106.219 59.1894 105.081 58.5966 103.864 58.1424C101.097 57.1089 98.052 56.8384 95.114 57.3653C92.176 57.8922 89.478 59.1927 87.36 61.1025C85.242 63.0122 83.799 65.4453 83.215 68.0941C82.631 70.743 82.931 73.4886 84.077 75.9837C85.223 78.4789 87.164 80.612 89.655 82.112C92.145 83.612 95.073 84.413 98.069 84.413C98.53 84.413 98.76 84.413 98.955 84.409C109.482 84.2 117.966 75.7164 118.175 65.1895C118.179 64.9945 118.179 64.764 118.179 64.3029V60.8271V23.8277Z"
|
69
|
+
fill="currentColor"
|
70
|
+
/>
|
71
|
+
</JazzIcon>
|
72
|
+
<span
|
73
|
+
style={{
|
74
|
+
position: "absolute",
|
75
|
+
width: "1px",
|
76
|
+
height: "1px",
|
77
|
+
padding: "0",
|
78
|
+
margin: "-1px",
|
79
|
+
overflow: "hidden",
|
80
|
+
clip: "rect(0, 0, 0, 0)",
|
81
|
+
whiteSpace: "nowrap",
|
82
|
+
border: "0",
|
83
|
+
}}
|
84
|
+
>
|
85
|
+
Open Jazz Inspector
|
86
|
+
</span>
|
87
|
+
</StyledInspectorButton>
|
88
|
+
);
|
89
|
+
}
|