jazz-vue 0.9.22 → 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.
package/dist/index.js CHANGED
@@ -1,316 +1,440 @@
1
- import { consumeInviteLinkFromWindowLocation as E, BrowserDemoAuth as M } from "jazz-browser";
2
- import { createInviteLink as de, parseInviteLink as ve } from "jazz-browser";
3
- import { subscribeToCoValue as _ } from "jazz-tools";
4
- import { ref as y, shallowRef as B, watch as S, unref as w, toRaw as p, onUnmounted as k, computed as l, onMounted as G, inject as T, reactive as V, defineComponent as D, openBlock as v, createElementBlock as m, normalizeStyle as g, Fragment as A, createElementVNode as b, toDisplayString as I, renderList as L, withModifiers as $, withDirectives as j, vModelText as H, createCommentVNode as J, toRef as N, renderSlot as F } from "vue";
5
- import { J as W, l as O } from "./provider-BZnz6FpX.js";
6
- import { a as fe } from "./provider-BZnz6FpX.js";
7
- const oe = y();
8
- function x() {
9
- const u = T(
10
- W
11
- );
12
- if (!u)
1
+ import { consumeInviteLinkFromWindowLocation, BrowserPasskeyAuth } from "jazz-browser";
2
+ import { createInviteLink, parseInviteLink } from "jazz-browser";
3
+ import { subscribeToCoValue, DemoAuth, PassphraseAuth } from "jazz-tools";
4
+ import { ref, inject, shallowRef, watch, unref, toRaw, onUnmounted, computed, onMounted, watchEffect, defineComponent, renderSlot, openBlock, createElementBlock, createElementVNode, normalizeStyle, toDisplayString, withDirectives, vModelText, Fragment, renderList, createCommentVNode, toRef } from "vue";
5
+ import { J as JazzContextSymbol, a as JazzAuthContextSymbol } from "./provider-CkA-a4Og.js";
6
+ import { b } from "./provider-CkA-a4Og.js";
7
+ const logoutHandler = ref();
8
+ function useJazzContext() {
9
+ const context = inject(JazzContextSymbol);
10
+ if (!(context == null ? void 0 : context.value)) {
13
11
  throw new Error("useJazzContext must be used within a JazzProvider");
14
- return u;
12
+ }
13
+ return context;
14
+ }
15
+ function useAuthSecretStorage() {
16
+ const context = inject(JazzAuthContextSymbol);
17
+ if (!context) {
18
+ throw new Error("useAuthSecretStorage must be used within a JazzProvider");
19
+ }
20
+ return context;
15
21
  }
16
- function q() {
17
- function u(r) {
18
- const e = x();
19
- if (!e.value)
22
+ function createUseAccountComposables() {
23
+ function useAccount2(depth) {
24
+ const context = useJazzContext();
25
+ if (!context.value) {
20
26
  throw new Error("useAccount must be used within a JazzProvider");
21
- if (!("me" in e.value))
27
+ }
28
+ if (!("me" in context.value)) {
22
29
  throw new Error(
23
30
  "useAccount can't be used in a JazzProvider with auth === 'guest' - consider using useAccountOrGuest()"
24
31
  );
25
- const o = e.value.me, n = P(
26
- o.constructor,
27
- o.id,
28
- r
32
+ }
33
+ const contextMe = context.value.me;
34
+ const me = useCoState(
35
+ contextMe.constructor,
36
+ contextMe.id,
37
+ depth
29
38
  );
30
39
  return {
31
- me: l(() => {
32
- const s = r === void 0 ? n.value || p(e.value.me) : n.value;
33
- return s && p(s);
40
+ me: computed(() => {
41
+ const value = depth === void 0 ? me.value || toRaw(context.value.me) : me.value;
42
+ return value ? toRaw(value) : value;
34
43
  }),
35
- logOut: e.value.logOut
44
+ logOut: context.value.logOut
36
45
  };
37
46
  }
38
- function t(r) {
39
- var s, a;
40
- const e = x();
41
- if (!e.value)
47
+ function useAccountOrGuest2(depth) {
48
+ var _a, _b;
49
+ const context = useJazzContext();
50
+ if (!context.value) {
42
51
  throw new Error("useAccountOrGuest must be used within a JazzProvider");
43
- const o = l(
44
- () => "me" in e.value ? e.value.me : void 0
45
- ), n = P(
46
- (s = o.value) == null ? void 0 : s.constructor,
47
- (a = o.value) == null ? void 0 : a.id,
48
- r
52
+ }
53
+ const contextMe = computed(
54
+ () => "me" in context.value ? context.value.me : void 0
49
55
  );
50
- return "me" in e.value ? {
51
- me: l(
52
- () => r === void 0 ? n.value || p(e.value.me) : n.value
53
- )
54
- } : {
55
- me: l(() => p(e.value.guest))
56
- };
56
+ const me = useCoState(
57
+ (_a = contextMe.value) == null ? void 0 : _a.constructor,
58
+ (_b = contextMe.value) == null ? void 0 : _b.id,
59
+ depth
60
+ );
61
+ if ("me" in context.value) {
62
+ return {
63
+ me: computed(
64
+ () => depth === void 0 ? me.value || toRaw(context.value.me) : me.value
65
+ )
66
+ };
67
+ } else {
68
+ return {
69
+ me: computed(() => toRaw(context.value.guest))
70
+ };
71
+ }
57
72
  }
58
73
  return {
59
- useAccount: u,
60
- useAccountOrGuest: t
74
+ useAccount: useAccount2,
75
+ useAccountOrGuest: useAccountOrGuest2
61
76
  };
62
77
  }
63
- const { useAccount: ne, useAccountOrGuest: re } = q();
64
- function P(u, t, r = []) {
65
- const e = B(void 0), o = x();
66
- if (!o.value)
78
+ const { useAccount, useAccountOrGuest } = createUseAccountComposables();
79
+ function useCoState(Schema, id, depth = []) {
80
+ const state = shallowRef(void 0);
81
+ const context = useJazzContext();
82
+ if (!context.value) {
67
83
  throw new Error("useCoState must be used within a JazzProvider");
68
- let n;
69
- return S(
70
- [() => w(t), () => o, () => u, () => r],
84
+ }
85
+ let unsubscribe;
86
+ watch(
87
+ [() => unref(id), () => context, () => Schema, () => depth],
71
88
  () => {
72
- n && n();
73
- const a = w(t);
74
- a && (n = _(
75
- u,
76
- a,
77
- "me" in o.value ? p(o.value.me) : p(o.value.guest),
78
- r,
79
- (h) => {
80
- e.value = h;
89
+ if (unsubscribe) unsubscribe();
90
+ const idValue = unref(id);
91
+ if (!idValue) return;
92
+ unsubscribe = subscribeToCoValue(
93
+ Schema,
94
+ idValue,
95
+ "me" in context.value ? toRaw(context.value.me) : toRaw(context.value.guest),
96
+ depth,
97
+ (value) => {
98
+ state.value = value;
99
+ },
100
+ () => {
101
+ state.value = null;
81
102
  },
82
- void 0,
83
- !0
84
- ));
103
+ true
104
+ );
85
105
  },
86
- { deep: !0, immediate: !0 }
87
- ), k(() => {
88
- n && n();
89
- }), l(() => e.value);
106
+ { deep: true, immediate: true }
107
+ );
108
+ onUnmounted(() => {
109
+ if (unsubscribe) unsubscribe();
110
+ });
111
+ const computedState = computed(() => state.value);
112
+ return computedState;
90
113
  }
91
- function se({
92
- invitedObjectSchema: u,
93
- onAccept: t,
94
- forValueHint: r
114
+ function useAcceptInvite({
115
+ invitedObjectSchema,
116
+ onAccept,
117
+ forValueHint
95
118
  }) {
96
- const e = x();
97
- if (!e.value)
119
+ const context = useJazzContext();
120
+ if (!context.value) {
98
121
  throw new Error("useAcceptInvite must be used within a JazzProvider");
99
- if (!("me" in e.value))
122
+ }
123
+ if (!("me" in context.value)) {
100
124
  throw new Error(
101
125
  "useAcceptInvite can't be used in a JazzProvider with auth === 'guest'."
102
126
  );
103
- const o = () => {
104
- E({
105
- as: p(e.value.me),
106
- invitedObjectSchema: u,
107
- forValueHint: r
108
- }).then((s) => s && t(s.valueID)).catch((s) => {
109
- console.error("Failed to accept invite", s);
127
+ }
128
+ const runInviteAcceptance = () => {
129
+ const result = consumeInviteLinkFromWindowLocation({
130
+ as: toRaw(context.value.me),
131
+ invitedObjectSchema,
132
+ forValueHint
133
+ });
134
+ result.then((res) => res && onAccept(res.valueID)).catch((e) => {
135
+ console.error("Failed to accept invite", e);
110
136
  });
111
137
  };
112
- G(() => {
113
- o();
114
- }), S(
115
- () => t,
116
- (n, s) => {
117
- n !== s && o();
138
+ onMounted(() => {
139
+ runInviteAcceptance();
140
+ });
141
+ watch(
142
+ () => onAccept,
143
+ (newOnAccept, oldOnAccept) => {
144
+ if (newOnAccept !== oldOnAccept) {
145
+ runInviteAcceptance();
146
+ }
118
147
  }
119
148
  );
120
149
  }
121
- function ue({
122
- seedAccounts: u
123
- } = {}) {
124
- const t = V({
125
- state: "loading",
126
- errors: []
127
- }), r = y(
128
- new M(
129
- {
130
- onReady: ({ signUp: e, existingUsers: o, logInAs: n }) => {
131
- t.state = "ready", t.signUp = e, t.existingUsers = o, t.logInAs = n, t.errors = [];
132
- },
133
- onSignedIn: ({ logOut: e }) => {
134
- t.state = "signedIn", t.logOut = () => {
135
- e(), t.state = "ready", t.errors = [];
136
- }, t.errors = [], O.value = t.logOut;
137
- },
138
- onError: (e) => {
139
- t.errors.push(e.toString());
140
- }
141
- },
142
- u
143
- )
150
+ function useIsAuthenticated() {
151
+ const authSecretStorage = useAuthSecretStorage();
152
+ const isAuthenticated = ref(authSecretStorage.isAuthenticated);
153
+ const handleUpdate = () => {
154
+ isAuthenticated.value = authSecretStorage.isAuthenticated;
155
+ };
156
+ onMounted(() => {
157
+ const cleanup = authSecretStorage.onUpdate(handleUpdate);
158
+ onUnmounted(cleanup);
159
+ });
160
+ return isAuthenticated;
161
+ }
162
+ function useDemoAuth() {
163
+ const context = useJazzContext();
164
+ const authSecretStorage = useAuthSecretStorage();
165
+ if ("guest" in context.value) {
166
+ throw new Error("Demo auth is not supported in guest mode");
167
+ }
168
+ const authMethod = computed(
169
+ () => new DemoAuth(context.value.authenticate, authSecretStorage)
144
170
  );
145
- return k(() => {
146
- t.state === "signedIn" && (O.value = void 0);
147
- }), { authMethod: r, state: t };
171
+ const existingUsers = ref([]);
172
+ const isAuthenticated = useIsAuthenticated();
173
+ watch(authMethod, () => {
174
+ authMethod.value.getExistingUsers().then((users) => {
175
+ existingUsers.value = users;
176
+ });
177
+ });
178
+ return computed(() => ({
179
+ state: isAuthenticated.value ? "signedIn" : "anonymous",
180
+ logIn(username) {
181
+ authMethod.value.logIn(username);
182
+ },
183
+ signUp(username) {
184
+ authMethod.value.signUp(username);
185
+ },
186
+ existingUsers: existingUsers.value
187
+ }));
188
+ }
189
+ function usePassphraseAuth({
190
+ wordlist
191
+ }) {
192
+ const context = useJazzContext();
193
+ const authSecretStorage = useAuthSecretStorage();
194
+ const isAuthenticated = useIsAuthenticated();
195
+ if ("guest" in context.value) {
196
+ throw new Error("Passphrase auth is not supported in guest mode");
197
+ }
198
+ const authMethod = computed(() => {
199
+ return new PassphraseAuth(
200
+ context.value.node.crypto,
201
+ context.value.authenticate,
202
+ authSecretStorage,
203
+ wordlist
204
+ );
205
+ });
206
+ const passphrase = ref(authMethod.value.passphrase);
207
+ watchEffect((onCleanup) => {
208
+ authMethod.value.loadCurrentAccountPassphrase();
209
+ const unsubscribe = authMethod.value.subscribe(() => {
210
+ passphrase.value = authMethod.value.passphrase;
211
+ });
212
+ onCleanup(unsubscribe);
213
+ });
214
+ return computed(() => ({
215
+ state: isAuthenticated.value ? "signedIn" : "anonymous",
216
+ logIn: authMethod.value.logIn,
217
+ signUp: authMethod.value.signUp,
218
+ passphrase: passphrase.value
219
+ }));
220
+ }
221
+ function usePasskeyAuth({
222
+ appName,
223
+ appHostname
224
+ }) {
225
+ const context = useJazzContext();
226
+ const authSecretStorage = useAuthSecretStorage();
227
+ const isAuthenticated = useIsAuthenticated();
228
+ if ("guest" in context.value) {
229
+ throw new Error("Passkey auth is not supported in guest mode");
230
+ }
231
+ const authMethod = computed(() => {
232
+ return new BrowserPasskeyAuth(
233
+ context.value.node.crypto,
234
+ context.value.authenticate,
235
+ authSecretStorage,
236
+ appName,
237
+ appHostname
238
+ );
239
+ });
240
+ return computed(() => ({
241
+ state: isAuthenticated.value ? "signedIn" : "anonymous",
242
+ logIn: authMethod.value.logIn,
243
+ signUp: authMethod.value.signUp
244
+ }));
148
245
  }
149
- const K = { key: 0 }, Q = {
246
+ const _hoisted_1 = {
247
+ key: 1,
248
+ style: {
249
+ minHeight: "100%",
250
+ display: "flex",
251
+ flexDirection: "column",
252
+ justifyContent: "center",
253
+ width: "18rem",
254
+ maxWidth: "calc(100vw - 2rem)",
255
+ gap: "2rem",
256
+ margin: "0 auto"
257
+ }
258
+ };
259
+ const _hoisted_2 = {
150
260
  key: 0,
151
- style: { display: "flex", "flex-direction": "column", gap: "0.5rem" }
152
- }, X = ["onClick", "aria-label"], ie = /* @__PURE__ */ D({
261
+ style: {
262
+ display: "flex",
263
+ flexDirection: "column",
264
+ gap: "0.5rem"
265
+ }
266
+ };
267
+ const _hoisted_3 = ["onClick", "aria-label"];
268
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
153
269
  __name: "DemoAuthBasicUI",
154
270
  props: {
155
- appName: {},
156
- state: {}
271
+ appName: {}
157
272
  },
158
- setup(u) {
159
- const t = u, r = y(""), e = l(
160
- () => window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches
161
- ), o = l(() => ({
162
- minHeight: "100vh",
163
- display: "flex",
164
- flexDirection: "column",
165
- justifyContent: "center",
166
- alignItems: "center",
167
- width: "100%",
168
- padding: "1rem",
169
- maxWidth: "100vw",
170
- gap: "2rem",
171
- margin: "0",
172
- ...e.value ? { background: "#000" } : {}
173
- })), n = l(() => ({
174
- border: e.value ? "2px solid #444" : "2px solid #ddd",
175
- padding: "11px 8px",
176
- borderRadius: "6px",
177
- background: e.value ? "#000" : "#fff",
178
- color: e.value ? "#fff" : "#000"
179
- })), s = l(() => ({
180
- padding: "13px 5px",
181
- border: "none",
182
- borderRadius: "6px",
183
- cursor: "pointer",
184
- background: e.value ? "#444" : "#ddd",
185
- color: e.value ? "#fff" : "#000"
186
- })), a = l(() => ({
187
- background: e.value ? "#0d0d0d" : "#eee",
188
- color: e.value ? "#fff" : "#000",
189
- padding: "0.5rem",
190
- border: "none",
191
- borderRadius: "6px"
192
- })), h = () => {
193
- t.state.signUp(r.value), r.value = "";
194
- }, f = (c) => {
195
- t.state.logInAs(c);
273
+ setup(__props) {
274
+ const auth = useDemoAuth();
275
+ const username = ref("");
276
+ const darkMode = typeof window !== "undefined" ? window.matchMedia("(prefers-color-scheme: dark)").matches : false;
277
+ const handleSubmit = (e) => {
278
+ e.preventDefault();
279
+ auth.value.signUp(username.value);
196
280
  };
197
- return (c, d) => (v(), m("div", {
198
- style: g(o.value)
199
- }, [
200
- c.state.state === "loading" ? (v(), m("div", K, "Loading...")) : c.state.state === "ready" ? (v(), m(A, { key: 1 }, [
201
- b("h1", {
202
- style: g({ color: e.value ? "#fff" : "#000", textAlign: "center" })
203
- }, I(c.appName), 5),
204
- (v(!0), m(A, null, L(c.state.errors, (i) => (v(), m("div", {
205
- key: i,
206
- style: { color: "red" }
207
- }, I(i), 1))), 128)),
208
- b("form", {
209
- onSubmit: $(h, ["prevent"]),
210
- style: { display: "flex", "flex-direction": "column", gap: "0.5rem" }
281
+ return (_ctx, _cache) => {
282
+ return unref(auth).state === "signedIn" ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock("div", _hoisted_1, [
283
+ createElementVNode("h1", {
284
+ style: normalizeStyle({
285
+ color: unref(darkMode) ? "#fff" : "#000",
286
+ textAlign: "center",
287
+ fontSize: "1.5rem",
288
+ fontWeight: "bold"
289
+ })
290
+ }, toDisplayString(_ctx.appName), 5),
291
+ createElementVNode("form", {
292
+ style: {
293
+ display: "flex",
294
+ flexDirection: "column",
295
+ gap: "0.5rem"
296
+ },
297
+ onSubmit: handleSubmit
211
298
  }, [
212
- j(b("input", {
213
- "onUpdate:modelValue": d[0] || (d[0] = (i) => r.value = i),
299
+ withDirectives(createElementVNode("input", {
300
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => username.value = $event),
214
301
  placeholder: "Display name",
215
- autoComplete: "webauthn",
216
- style: g(n.value)
302
+ autocomplete: "webauthn",
303
+ style: normalizeStyle({
304
+ border: unref(darkMode) ? "1px solid #444" : "1px solid #ddd",
305
+ padding: "11px 8px",
306
+ borderRadius: "6px",
307
+ background: unref(darkMode) ? "#000" : "#fff",
308
+ color: unref(darkMode) ? "#fff" : "#000"
309
+ })
217
310
  }, null, 4), [
218
- [H, r.value]
311
+ [vModelText, username.value]
219
312
  ]),
220
- b("input", {
313
+ createElementVNode("input", {
221
314
  type: "submit",
222
315
  value: "Sign up",
223
- style: g(s.value)
316
+ style: normalizeStyle({
317
+ padding: "13px 5px",
318
+ border: "none",
319
+ borderRadius: "6px",
320
+ cursor: "pointer",
321
+ background: unref(darkMode) ? "#444" : "#ddd",
322
+ color: unref(darkMode) ? "#fff" : "#000"
323
+ })
224
324
  }, null, 4)
225
325
  ], 32),
226
- c.state.existingUsers.length > 0 ? (v(), m("div", Q, [
227
- b("p", {
228
- style: g({
229
- color: e.value ? "#e2e2e2" : "#000",
326
+ unref(auth).existingUsers.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2, [
327
+ createElementVNode("p", {
328
+ style: normalizeStyle({
329
+ color: unref(darkMode) ? "#e2e2e2" : "#000",
230
330
  textAlign: "center",
231
331
  paddingTop: "0.5rem",
232
332
  borderTop: "1px solid",
233
- borderColor: e.value ? "#111" : "#e2e2e2"
333
+ borderColor: unref(darkMode) ? "#111" : "#e2e2e2"
234
334
  })
235
335
  }, " Log in as ", 4),
236
- (v(!0), m(A, null, L(c.state.existingUsers, (i) => (v(), m("button", {
237
- key: i,
238
- onClick: (z) => f(i),
239
- type: "button",
240
- "aria-label": `Log in as ${i}`,
241
- style: g(a.value)
242
- }, I(i), 13, X))), 128))
243
- ])) : J("", !0)
244
- ], 64)) : J("", !0)
245
- ], 4));
336
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(auth).existingUsers, (user) => {
337
+ return openBlock(), createElementBlock("button", {
338
+ key: user,
339
+ onClick: ($event) => unref(auth).logIn(user),
340
+ type: "button",
341
+ "aria-label": `Log in as ${user}`,
342
+ style: normalizeStyle({
343
+ background: unref(darkMode) ? "#0d0d0d" : "#eee",
344
+ color: unref(darkMode) ? "#fff" : "#000",
345
+ padding: "0.5rem",
346
+ border: "none",
347
+ borderRadius: "6px"
348
+ })
349
+ }, toDisplayString(user), 13, _hoisted_3);
350
+ }), 128))
351
+ ])) : createCommentVNode("", true)
352
+ ]));
353
+ };
246
354
  }
247
- }), ae = /* @__PURE__ */ D({
355
+ });
356
+ const _sfc_main = /* @__PURE__ */ defineComponent({
248
357
  __name: "ProgressiveImg",
249
358
  props: {
250
359
  image: {},
251
360
  maxWidth: {}
252
361
  },
253
- setup(u) {
254
- function t(o, n) {
255
- const s = y({});
256
- let a;
257
- const h = S(
362
+ setup(__props) {
363
+ function useProgressiveImg(image, maxWidth) {
364
+ const current2 = ref({});
365
+ let cleanup;
366
+ const unsubscribe = watch(
258
367
  () => {
259
- var f;
260
- return [(f = o.value) == null ? void 0 : f.id, n];
368
+ var _a;
369
+ return [(_a = image.value) == null ? void 0 : _a.id, maxWidth];
261
370
  },
262
371
  () => {
263
- let f;
264
- return o.value ? o.value.subscribe({}, (d) => {
265
- var z, U;
266
- const i = d == null ? void 0 : d.highestResAvailable({ maxWidth: n });
267
- if (i) {
268
- if (i.res !== f) {
269
- f = i.res;
270
- const R = i.stream.toBlob();
271
- if (R) {
272
- const C = URL.createObjectURL(R);
273
- s.value = {
274
- src: C,
275
- res: i.res,
276
- originalSize: (z = o.value) == null ? void 0 : z.originalSize
277
- }, a && a(), a = () => {
278
- setTimeout(() => URL.revokeObjectURL(C), 200);
372
+ let lastHighestRes;
373
+ if (!image.value) return;
374
+ const unsub = image.value.subscribe({}, (update) => {
375
+ var _a, _b;
376
+ const highestRes = update == null ? void 0 : update.highestResAvailable({ maxWidth });
377
+ if (highestRes) {
378
+ if (highestRes.res !== lastHighestRes) {
379
+ lastHighestRes = highestRes.res;
380
+ const blob = highestRes.stream.toBlob();
381
+ if (blob) {
382
+ const blobURI = URL.createObjectURL(blob);
383
+ current2.value = {
384
+ src: blobURI,
385
+ res: highestRes.res,
386
+ originalSize: (_a = image.value) == null ? void 0 : _a.originalSize
387
+ };
388
+ if (cleanup) cleanup();
389
+ cleanup = () => {
390
+ setTimeout(() => URL.revokeObjectURL(blobURI), 200);
279
391
  };
280
392
  }
281
393
  }
282
- } else
283
- s.value = {
284
- src: d == null ? void 0 : d.placeholderDataURL,
394
+ } else {
395
+ current2.value = {
396
+ src: update == null ? void 0 : update.placeholderDataURL,
285
397
  res: "placeholder",
286
- originalSize: (U = o.value) == null ? void 0 : U.originalSize
398
+ originalSize: (_b = image.value) == null ? void 0 : _b.originalSize
287
399
  };
288
- }) : void 0;
400
+ }
401
+ });
402
+ return unsub;
289
403
  }
290
404
  );
291
- return k(() => {
292
- h(), a && a();
293
- }), s;
405
+ onUnmounted(() => {
406
+ unsubscribe();
407
+ if (cleanup) cleanup();
408
+ });
409
+ return current2;
294
410
  }
295
- const r = u, e = t(N(r, "image"), r.maxWidth);
296
- return (o, n) => F(o.$slots, "default", {
297
- src: w(e).src,
298
- res: w(e).res,
299
- originalSize: w(e).originalSize
300
- });
411
+ const props = __props;
412
+ const current = useProgressiveImg(toRef(props, "image"), props.maxWidth);
413
+ return (_ctx, _cache) => {
414
+ return renderSlot(_ctx.$slots, "default", {
415
+ src: unref(current).src,
416
+ res: unref(current).res,
417
+ originalSize: unref(current).originalSize
418
+ });
419
+ };
301
420
  }
302
421
  });
303
422
  export {
304
- ie as DemoAuthBasicUI,
305
- fe as JazzProvider,
306
- ae as ProgressiveImg,
307
- de as createInviteLink,
308
- q as createUseAccountComposables,
309
- oe as logoutHandler,
310
- ve as parseInviteLink,
311
- se as useAcceptInvite,
312
- ne as useAccount,
313
- re as useAccountOrGuest,
314
- P as useCoState,
315
- ue as useDemoAuth
423
+ _sfc_main$1 as DemoAuthBasicUI,
424
+ b as JazzProvider,
425
+ _sfc_main as ProgressiveImg,
426
+ createInviteLink,
427
+ createUseAccountComposables,
428
+ logoutHandler,
429
+ parseInviteLink,
430
+ useAcceptInvite,
431
+ useAccount,
432
+ useAccountOrGuest,
433
+ useAuthSecretStorage,
434
+ useCoState,
435
+ useDemoAuth,
436
+ useJazzContext,
437
+ usePasskeyAuth,
438
+ usePassphraseAuth
316
439
  };
440
+ //# sourceMappingURL=index.js.map