jazz-vue 0.9.23 → 0.10.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.
@@ -1,17 +1,17 @@
1
1
 
2
- > jazz-vue@0.9.23 build /home/runner/work/jazz/jazz/packages/jazz-vue
2
+ > jazz-vue@0.10.0 build /home/runner/_work/jazz/jazz/packages/jazz-vue
3
3
  > rm -rf ./dist && vite build
4
4
 
5
- vite v5.4.11 building for production...
5
+ vite v6.0.11 building for production...
6
6
  transforming...
7
- ✓ 9 modules transformed.
7
+ ✓ 12 modules transformed.
8
8
  rendering chunks...
9
9
 
10
10
  [vite:dts] Start generate declaration files...
11
11
  computing gzip size...
12
- dist/testing.js 0.79 kB │ gzip: 0.41 kB
13
- dist/provider-BZnz6FpX.js 1.62 kB │ gzip: 0.66 kB
14
- dist/index.js 9.10 kB │ gzip: 3.01 kB
15
- [vite:dts] Declaration files built in 21109ms.
12
+ dist/testing.js  1.19 kB │ gzip: 0.52 kB │ map: 1.70 kB
13
+ dist/provider-CkA-a4Og.js  2.32 kB │ gzip: 0.81 kB │ map: 4.44 kB
14
+ dist/index.js 13.80 kB │ gzip: 3.50 kB │ map: 22.13 kB
15
+ [vite:dts] Declaration files built in 6832ms.
16
16
 
17
- ✓ built in 21.44s
17
+ ✓ built in 6.98s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # jazz-react
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b426342: Return null when a coValue is not found
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [b426342]
12
+ - Updated dependencies [498954f]
13
+ - Updated dependencies [8217981]
14
+ - Updated dependencies [d42c2aa]
15
+ - Updated dependencies [dd03464]
16
+ - Updated dependencies [b426342]
17
+ - Updated dependencies [ac3d9fa]
18
+ - Updated dependencies [610543c]
19
+ - cojson@0.10.0
20
+ - jazz-browser@0.10.0
21
+ - jazz-tools@0.10.0
22
+
3
23
  ## 0.9.23
4
24
 
5
25
  ### Patch Changes
@@ -1,56 +1,6 @@
1
- import { AgentSecret } from 'cojson';
2
- import { BrowserDemoAuth } from 'jazz-browser';
3
- import { Account, ID } from 'jazz-tools';
4
- export type DemoAuthState = ({
5
- state: "uninitialized";
6
- } | {
7
- state: "loading";
8
- } | {
9
- state: "ready";
1
+ export declare function useDemoAuth(): import('vue').ComputedRef<{
2
+ state: string;
3
+ logIn(username: string): void;
4
+ signUp(username: string): void;
10
5
  existingUsers: string[];
11
- signUp: (username: string) => void;
12
- logInAs: (existingUser: string) => void;
13
- } | {
14
- state: "signedIn";
15
- logOut: () => void;
16
- }) & {
17
- errors: string[];
18
- };
19
- /** @category Auth Providers */
20
- export declare function useDemoAuth({ seedAccounts, }?: {
21
- seedAccounts?: {
22
- [name: string]: {
23
- accountID: ID<Account>;
24
- accountSecret: AgentSecret;
25
- };
26
- };
27
- }): {
28
- authMethod: import('vue').Ref<{
29
- driver: {
30
- onReady: (next: {
31
- signUp: (username: string) => Promise<void>;
32
- existingUsers: string[];
33
- logInAs: (existingUser: string) => Promise<void>;
34
- }) => void;
35
- onSignedIn: (next: {
36
- logOut: () => void;
37
- }) => void;
38
- onError: (error: string | Error) => void;
39
- };
40
- start: () => Promise<import('jazz-tools').AuthResult>;
41
- }, BrowserDemoAuth | {
42
- driver: {
43
- onReady: (next: {
44
- signUp: (username: string) => Promise<void>;
45
- existingUsers: string[];
46
- logInAs: (existingUser: string) => Promise<void>;
47
- }) => void;
48
- onSignedIn: (next: {
49
- logOut: () => void;
50
- }) => void;
51
- onError: (error: string | Error) => void;
52
- };
53
- start: () => Promise<import('jazz-tools').AuthResult>;
54
- }>;
55
- state: import('vue').Reactive<DemoAuthState>;
56
- };
6
+ }>;
@@ -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,18 @@
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: () => Promise<string>;
17
+ passphrase: string;
18
+ }>;
@@ -1,6 +1,8 @@
1
- import { Account, AnonymousJazzAgent, CoValue, CoValueClass, DeeplyLoaded, DepthsIn, ID } from 'jazz-tools';
1
+ import { Account, AnonymousJazzAgent, AuthSecretStorage, CoValue, CoValueClass, DeeplyLoaded, DepthsIn, ID, JazzContextType } from 'jazz-tools';
2
2
  import { ComputedRef, MaybeRef, Ref } from 'vue';
3
3
  export declare const logoutHandler: Ref<(() => void) | undefined, (() => void) | undefined>;
4
+ export declare function useJazzContext(): Ref<JazzContextType<Account>, JazzContextType<Account>>;
5
+ export declare function useAuthSecretStorage(): AuthSecretStorage;
4
6
  export declare function createUseAccountComposables<Acc extends Account>(): {
5
7
  useAccount: {
6
8
  (): {
@@ -8,7 +10,7 @@ export declare function createUseAccountComposables<Acc extends Account>(): {
8
10
  logOut: () => void;
9
11
  };
10
12
  <D extends DepthsIn<Acc>>(depth: D): {
11
- me: ComputedRef<DeeplyLoaded<Acc, D> | undefined>;
13
+ me: ComputedRef<DeeplyLoaded<Acc, D> | undefined | null>;
12
14
  logOut: () => void;
13
15
  };
14
16
  };
@@ -17,7 +19,7 @@ export declare function createUseAccountComposables<Acc extends Account>(): {
17
19
  me: ComputedRef<Acc | AnonymousJazzAgent>;
18
20
  };
19
21
  <D extends DepthsIn<Acc>>(depth: D): {
20
- me: ComputedRef<DeeplyLoaded<Acc, D> | undefined | AnonymousJazzAgent>;
22
+ me: ComputedRef<DeeplyLoaded<Acc, D> | undefined | null | AnonymousJazzAgent>;
21
23
  };
22
24
  };
23
25
  };
@@ -5475,7 +5477,7 @@ declare const useAccount: {
5475
5477
  _type: "CoPlainText";
5476
5478
  }] ? {
5477
5479
  _type: "CoPlainText";
5478
- } & CoValue & import('jazz-tools/src/internal.js').UnCo<NonNullable<Account[Key]>> : never) | (undefined extends Account[Key] ? Account[Key] & undefined : never) : never : never; } & Account) | undefined>;
5480
+ } & CoValue & import('jazz-tools/src/internal.js').UnCo<NonNullable<Account[Key]>> : never) | (undefined extends Account[Key] ? Account[Key] & undefined : never) : never : never; } & Account) | null | undefined>;
5479
5481
  logOut: () => void;
5480
5482
  };
5481
5483
  }, useAccountOrGuest: {
@@ -10931,11 +10933,11 @@ declare const useAccount: {
10931
10933
  _type: "CoPlainText";
10932
10934
  }] ? {
10933
10935
  _type: "CoPlainText";
10934
- } & CoValue & import('jazz-tools/src/internal.js').UnCo<NonNullable<Account[Key]>> : never) | (undefined extends Account[Key] ? Account[Key] & undefined : never) : never : never; } & Account) | undefined>;
10936
+ } & CoValue & import('jazz-tools/src/internal.js').UnCo<NonNullable<Account[Key]>> : never) | (undefined extends Account[Key] ? Account[Key] & undefined : never) : never : never; } & Account) | null | undefined>;
10935
10937
  };
10936
10938
  };
10937
10939
  export { useAccount, useAccountOrGuest };
10938
- export declare function useCoState<V extends CoValue, D>(Schema: CoValueClass<V>, id: MaybeRef<ID<V> | undefined>, depth?: D & DepthsIn<V>): Ref<DeeplyLoaded<V, D> | undefined>;
10940
+ export declare function useCoState<V extends CoValue, D>(Schema: CoValueClass<V>, id: MaybeRef<ID<V> | undefined>, depth?: D & DepthsIn<V>): Ref<DeeplyLoaded<V, D> | undefined | null>;
10939
10941
  export declare function useAcceptInvite<V extends CoValue>({ invitedObjectSchema, onAccept, forValueHint, }: {
10940
10942
  invitedObjectSchema: CoValueClass<V>;
10941
10943
  onAccept: (projectID: ID<V>) => void;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './composables.js';
2
2
  export { JazzProvider } from './provider.js';
3
3
  export * from './auth/useDemoAuth.js';
4
+ export * from './auth/usePassphraseAuth.js';
5
+ export * from './auth/usePasskeyAuth.js';
4
6
  export { default as DemoAuthBasicUI } from './auth/DemoAuthBasicUI.vue';
5
7
  export { default as ProgressiveImg } from './ProgressiveImg.vue';
6
8
  export { createInviteLink, parseInviteLink } from 'jazz-browser';