community-jazz-vue 0.15.4

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.
Files changed (56) hide show
  1. package/.turbo/turbo-build.log +21 -0
  2. package/CHANGELOG.md +2201 -0
  3. package/LICENSE.txt +19 -0
  4. package/README.md +26 -0
  5. package/dist/Image.vue.d.ts +26 -0
  6. package/dist/auth/JazzVueProviderWithClerk.d.ts +83 -0
  7. package/dist/auth/PasskeyAuthBasicUI.vue.d.ts +21 -0
  8. package/dist/auth/useClerkAuth.d.ts +2 -0
  9. package/dist/auth/useIsAuthenticated.d.ts +1 -0
  10. package/dist/auth/usePasskeyAuth.d.ts +18 -0
  11. package/dist/auth/usePassphraseAuth.d.ts +20 -0
  12. package/dist/composables.d.ts +22 -0
  13. package/dist/index.d.ts +11 -0
  14. package/dist/index.js +667 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/provider-CCZVJj45.js +143 -0
  17. package/dist/provider-CCZVJj45.js.map +1 -0
  18. package/dist/provider.d.ts +172 -0
  19. package/dist/testing.d.ts +30 -0
  20. package/dist/testing.js +41 -0
  21. package/dist/testing.js.map +1 -0
  22. package/dist/tests/fixtures.d.ts +1 -0
  23. package/dist/tests/proxyBehavior.test.d.ts +1 -0
  24. package/dist/tests/testUtils.d.ts +9 -0
  25. package/dist/tests/useAcceptInvite.test.d.ts +1 -0
  26. package/dist/tests/useAccount.test.d.ts +1 -0
  27. package/dist/tests/useCoState.test.d.ts +1 -0
  28. package/dist/tests/useInboxSender.test.d.ts +1 -0
  29. package/dist/tests/useIsAuthenticated.test.d.ts +1 -0
  30. package/dist/tests/usePassphraseAuth.test.d.ts +1 -0
  31. package/dist/utils/contextManager.d.ts +3 -0
  32. package/package.json +53 -0
  33. package/src/Image.vue +151 -0
  34. package/src/auth/JazzVueProviderWithClerk.ts +123 -0
  35. package/src/auth/PasskeyAuthBasicUI.vue +153 -0
  36. package/src/auth/useClerkAuth.ts +35 -0
  37. package/src/auth/useIsAuthenticated.ts +21 -0
  38. package/src/auth/usePasskeyAuth.ts +48 -0
  39. package/src/auth/usePassphraseAuth.ts +57 -0
  40. package/src/composables.ts +323 -0
  41. package/src/index.ts +14 -0
  42. package/src/provider.ts +192 -0
  43. package/src/testing.ts +45 -0
  44. package/src/tests/fixtures.ts +2050 -0
  45. package/src/tests/proxyBehavior.test.ts +267 -0
  46. package/src/tests/testUtils.ts +75 -0
  47. package/src/tests/useAcceptInvite.test.ts +55 -0
  48. package/src/tests/useAccount.test.ts +59 -0
  49. package/src/tests/useCoState.test.ts +175 -0
  50. package/src/tests/useInboxSender.test.ts +58 -0
  51. package/src/tests/useIsAuthenticated.test.ts +35 -0
  52. package/src/tests/usePassphraseAuth.test.ts +95 -0
  53. package/src/utils/contextManager.ts +31 -0
  54. package/src/vite-env.d.ts +7 -0
  55. package/tsconfig.json +20 -0
  56. package/vite.config.ts +31 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2025, Garden Computing, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # `community-jazz-vue`
2
+
3
+ Vue bindings for Jazz (see [jazz.tools](https://jazz.tools)), a framework for distributed state.
4
+
5
+ ## Quick Start
6
+
7
+ ### 1. Install
8
+ ```bash
9
+ npm install community-jazz-vue
10
+ ```
11
+
12
+ ### 2. Use Jazz Inspector
13
+ ```vue
14
+ <template>
15
+ <JazzInspector position="bottom-right" />
16
+ </template>
17
+
18
+ <script setup>
19
+ import { JazzInspector } from 'community-jazz-vue/inspector'
20
+ </script>
21
+ ```
22
+
23
+ ## Documentation
24
+
25
+ - [Inspector Documentation](./src/inspector/README.md)
26
+ - [Canonical Vue Implementation](./src/inspector/CANONICAL_VUE_IMPLEMENTATION.md)
@@ -0,0 +1,26 @@
1
+ export interface ImageProps {
2
+ /** The ID of the ImageDefinition to display */
3
+ imageId: string;
4
+ /**
5
+ * The desired width of the image. Can be a number in pixels or "original" to use the image's original width.
6
+ * When set to a number, the component will select the best available resolution and maintain aspect ratio.
7
+ */
8
+ width?: number | "original";
9
+ /**
10
+ * The desired height of the image. Can be a number in pixels or "original" to use the image's original height.
11
+ * When set to a number, the component will select the best available resolution and maintain aspect ratio.
12
+ */
13
+ height?: number | "original";
14
+ /** Alt text for the image */
15
+ alt?: string;
16
+ /** CSS classes to apply to the image */
17
+ classNames?: string;
18
+ /** CSS styles to apply to the image */
19
+ style?: string | Record<string, string>;
20
+ /** Loading strategy for the image */
21
+ loading?: "lazy" | "eager";
22
+ }
23
+ declare const _default: import('vue').DefineComponent<ImageProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ImageProps> & Readonly<{}>, {
24
+ loading: "lazy" | "eager";
25
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLImageElement>;
26
+ export default _default;
@@ -0,0 +1,83 @@
1
+ import { Account, AccountClass, AnyAccountSchema, CoValueFromRaw, SyncConfig, MinimalClerkClient } from 'jazz-tools';
2
+ import { PropType } from 'vue';
3
+ export declare const JazzVueProviderWithClerk: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ clerk: {
5
+ type: PropType<MinimalClerkClient>;
6
+ required: true;
7
+ };
8
+ AccountSchema: {
9
+ type: PropType<(AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema>;
10
+ required: false;
11
+ };
12
+ guestMode: {
13
+ type: BooleanConstructor;
14
+ default: boolean;
15
+ };
16
+ sync: {
17
+ type: PropType<SyncConfig>;
18
+ required: true;
19
+ };
20
+ storage: {
21
+ type: PropType<"indexedDB">;
22
+ default: undefined;
23
+ };
24
+ defaultProfileName: {
25
+ type: StringConstructor;
26
+ required: false;
27
+ };
28
+ onLogOut: {
29
+ type: PropType<() => void>;
30
+ required: false;
31
+ };
32
+ onAnonymousAccountDiscarded: {
33
+ type: PropType<(anonymousAccount: any) => Promise<void>>;
34
+ required: false;
35
+ };
36
+ enableSSR: {
37
+ type: BooleanConstructor;
38
+ default: boolean;
39
+ };
40
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
41
+ [key: string]: any;
42
+ }> | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
43
+ clerk: {
44
+ type: PropType<MinimalClerkClient>;
45
+ required: true;
46
+ };
47
+ AccountSchema: {
48
+ type: PropType<(AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema>;
49
+ required: false;
50
+ };
51
+ guestMode: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
55
+ sync: {
56
+ type: PropType<SyncConfig>;
57
+ required: true;
58
+ };
59
+ storage: {
60
+ type: PropType<"indexedDB">;
61
+ default: undefined;
62
+ };
63
+ defaultProfileName: {
64
+ type: StringConstructor;
65
+ required: false;
66
+ };
67
+ onLogOut: {
68
+ type: PropType<() => void>;
69
+ required: false;
70
+ };
71
+ onAnonymousAccountDiscarded: {
72
+ type: PropType<(anonymousAccount: any) => Promise<void>>;
73
+ required: false;
74
+ };
75
+ enableSSR: {
76
+ type: BooleanConstructor;
77
+ default: boolean;
78
+ };
79
+ }>> & Readonly<{}>, {
80
+ guestMode: boolean;
81
+ storage: "indexedDB";
82
+ enableSSR: boolean;
83
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,21 @@
1
+ interface Props {
2
+ appName: string;
3
+ appHostname?: string;
4
+ }
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ default?(_: {}): any;
9
+ };
10
+ refs: {};
11
+ rootEl: any;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
16
+ export default _default;
17
+ type __VLS_WithTemplateSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,2 @@
1
+ import { JazzClerkAuth, MinimalClerkClient } from 'jazz-tools';
2
+ export declare function useClerkAuth(clerk: MinimalClerkClient): import('vue').Raw<JazzClerkAuth>;
@@ -0,0 +1 @@
1
+ export declare function useIsAuthenticated(): import('vue').Ref<boolean, boolean>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `usePasskeyAuth` composable provides a `JazzAuth` object for passkey authentication.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const auth = usePasskeyAuth({ appName, appHostname });
7
+ * ```
8
+ *
9
+ * @category Auth Providers
10
+ */
11
+ export declare function usePasskeyAuth({ appName, appHostname, }: {
12
+ appName: string;
13
+ appHostname?: string;
14
+ }): import('vue').ComputedRef<{
15
+ state: string;
16
+ logIn: () => Promise<void>;
17
+ signUp: (username: string) => Promise<void>;
18
+ }>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `usePassphraseAuth` composable provides a `JazzAuth` object for passphrase authentication.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const auth = usePassphraseAuth({ wordlist });
7
+ * ```
8
+ *
9
+ * @category Auth Providers
10
+ */
11
+ export declare function usePassphraseAuth({ wordlist }: {
12
+ wordlist: string[];
13
+ }): import('vue').ComputedRef<{
14
+ state: string;
15
+ logIn: (passphrase: string) => Promise<void>;
16
+ signUp: (name?: string) => Promise<string>;
17
+ registerNewAccount: (passphrase: string, name: string) => Promise<string>;
18
+ generateRandomPassphrase: () => string;
19
+ passphrase: string;
20
+ }>;
@@ -0,0 +1,22 @@
1
+ import { Account, AccountClass, AnonymousJazzAgent, AnyAccountSchema, AuthSecretStorage, CoValue, CoValueClassOrSchema, JazzContextManager, JazzContextType, Loaded, RefsToResolve, ResolveQuery, ResolveQueryStrict } from 'jazz-tools';
2
+ import { ComputedRef, Ref } from 'vue';
3
+ export declare const logoutHandler: Ref<(() => void) | undefined, (() => void) | undefined>;
4
+ export declare function useJazzContext<Acc extends Account>(): Ref<JazzContextType<Acc>, JazzContextType<Acc>>;
5
+ export declare function useJazzContextManager<Acc extends Account>(): Ref<JazzContextManager<Acc, {}>, JazzContextManager<Acc, {}>>;
6
+ export declare function useAuthSecretStorage(): AuthSecretStorage;
7
+ export declare function useAccount<A extends AccountClass<Account> | AnyAccountSchema = typeof Account, R extends ResolveQuery<A> = true>(AccountSchema?: A, options?: {
8
+ resolve?: ResolveQueryStrict<A, R>;
9
+ }): {
10
+ me: ComputedRef<Loaded<A, R> | undefined | null>;
11
+ agent: AnonymousJazzAgent | Loaded<A, true>;
12
+ logOut: () => void;
13
+ };
14
+ export declare function useCoState<S extends CoValueClassOrSchema, const R extends RefsToResolve<S> = true>(Schema: S, id: string | undefined, options?: {
15
+ resolve?: ResolveQueryStrict<S, R>;
16
+ }): Ref<Loaded<S, R> | undefined | null>;
17
+ export declare function useAcceptInvite<S extends CoValueClassOrSchema>({ invitedObjectSchema, onAccept, forValueHint, }: {
18
+ invitedObjectSchema: S;
19
+ onAccept: (projectID: string) => void;
20
+ forValueHint?: string;
21
+ }): void;
22
+ export declare function experimental_useInboxSender<I extends CoValue, O extends CoValue | undefined>(inboxOwnerID: string | undefined): (message: I) => Promise<O extends CoValue ? string : undefined>;
@@ -0,0 +1,11 @@
1
+ export * from './composables.js';
2
+ export { JazzProvider, JazzVueProvider } from './provider.js';
3
+ export * from './auth/usePassphraseAuth.js';
4
+ export * from './auth/useIsAuthenticated.js';
5
+ export * from './auth/usePasskeyAuth.js';
6
+ export * from './auth/useClerkAuth.js';
7
+ export { JazzVueProviderWithClerk } from './auth/JazzVueProviderWithClerk.js';
8
+ export { default as PasskeyAuthBasicUI } from './auth/PasskeyAuthBasicUI.vue';
9
+ export { default as Image } from './Image.vue';
10
+ export { createInviteLink, parseInviteLink } from 'jazz-tools/browser';
11
+ export { createImage } from 'jazz-tools/media';