@lunora/svelte 1.0.0-alpha.117 → 1.0.0-alpha.118
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.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/auth-BrLyP-oa.mjs +1 -0
- package/dist/packem_shared/connectionStatus-DMx3BE5Q.mjs +1 -0
- package/package.json +4 -4
- package/dist/packem_shared/auth-Bew4W5n1.mjs +0 -1
- package/dist/packem_shared/connectionStatus-D9A79Eqw.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -530,6 +530,14 @@ interface AuthStore {
|
|
|
530
530
|
* reader and close when the last unsubscribes. Calling `setToken(jwt)` after
|
|
531
531
|
* sign-in refreshes both stores.
|
|
532
532
|
*
|
|
533
|
+
* Both subscribes are client-only, like every other subscribing primitive here:
|
|
534
|
+
* `$token` / `$user` in a template subscribe during `renderToString`. For the
|
|
535
|
+
* user store that is not just a stray listener — the identity store kicks off
|
|
536
|
+
* `getCurrentUser()` on its first subscriber, so an unguarded server render
|
|
537
|
+
* issues a round-trip against a client whose URL does not resolve there. Both
|
|
538
|
+
* stores still report the client's current values on the server; only the live
|
|
539
|
+
* updates are withheld, until hydration.
|
|
540
|
+
*
|
|
533
541
|
* Pass an explicit client to bypass the ambient context (useful in tests).
|
|
534
542
|
*/
|
|
535
543
|
declare const auth: (explicitClient?: ReturnType<typeof getLunoraClient>) => AuthStore;
|
|
@@ -571,6 +579,12 @@ type ConnectionStatusStore = Readable<ConnectionStatus>;
|
|
|
571
579
|
* `$`-read / `.subscribe()`) and is released by the returned stop function when
|
|
572
580
|
* the last subscriber goes away, so a store that's never read attaches nothing.
|
|
573
581
|
*
|
|
582
|
+
* Client-only, like every other subscribing primitive here: `$status` in a
|
|
583
|
+
* template subscribes during `renderToString`, so an unguarded start callback
|
|
584
|
+
* registers a listener per server render. The store still reports the client's
|
|
585
|
+
* current status on the server — that value is a plain read, and nothing
|
|
586
|
+
* transitions during a render.
|
|
587
|
+
*
|
|
574
588
|
* Pass `client` explicitly, or omit it to resolve the ambient client published
|
|
575
589
|
* by `setLunoraClient` (which must therefore be called during component init,
|
|
576
590
|
* before this runs).
|
package/dist/index.d.ts
CHANGED
|
@@ -530,6 +530,14 @@ interface AuthStore {
|
|
|
530
530
|
* reader and close when the last unsubscribes. Calling `setToken(jwt)` after
|
|
531
531
|
* sign-in refreshes both stores.
|
|
532
532
|
*
|
|
533
|
+
* Both subscribes are client-only, like every other subscribing primitive here:
|
|
534
|
+
* `$token` / `$user` in a template subscribe during `renderToString`. For the
|
|
535
|
+
* user store that is not just a stray listener — the identity store kicks off
|
|
536
|
+
* `getCurrentUser()` on its first subscriber, so an unguarded server render
|
|
537
|
+
* issues a round-trip against a client whose URL does not resolve there. Both
|
|
538
|
+
* stores still report the client's current values on the server; only the live
|
|
539
|
+
* updates are withheld, until hydration.
|
|
540
|
+
*
|
|
533
541
|
* Pass an explicit client to bypass the ambient context (useful in tests).
|
|
534
542
|
*/
|
|
535
543
|
declare const auth: (explicitClient?: ReturnType<typeof getLunoraClient>) => AuthStore;
|
|
@@ -571,6 +579,12 @@ type ConnectionStatusStore = Readable<ConnectionStatus>;
|
|
|
571
579
|
* `$`-read / `.subscribe()`) and is released by the returned stop function when
|
|
572
580
|
* the last subscriber goes away, so a store that's never read attaches nothing.
|
|
573
581
|
*
|
|
582
|
+
* Client-only, like every other subscribing primitive here: `$status` in a
|
|
583
|
+
* template subscribes during `renderToString`, so an unguarded start callback
|
|
584
|
+
* registers a listener per server render. The store still reports the client's
|
|
585
|
+
* current status on the server — that value is a plain read, and nothing
|
|
586
|
+
* transitions during a render.
|
|
587
|
+
*
|
|
574
588
|
* Pass `client` explicitly, or omit it to resolve the ambient client published
|
|
575
589
|
* by `setLunoraClient` (which must therefore be called during component init,
|
|
576
590
|
* before this runs).
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{action as t}from"./packem_shared/action-SjeZUGhX.mjs";import{agent as a}from"./packem_shared/agent-WMVWf1Ks.mjs";import{agentChat as f}from"./packem_shared/agentChat-CX6dTMoY.mjs";import{agentState as n}from"./packem_shared/agentState-CS3hHD6A.mjs";import{agentToolEvents as i}from"./packem_shared/agentToolEvents-DlVpngzv.mjs";import{auth as g,authGate as s}from"./packem_shared/auth-
|
|
1
|
+
import{action as t}from"./packem_shared/action-SjeZUGhX.mjs";import{agent as a}from"./packem_shared/agent-WMVWf1Ks.mjs";import{agentChat as f}from"./packem_shared/agentChat-CX6dTMoY.mjs";import{agentState as n}from"./packem_shared/agentState-CS3hHD6A.mjs";import{agentToolEvents as i}from"./packem_shared/agentToolEvents-DlVpngzv.mjs";import{auth as g,authGate as s}from"./packem_shared/auth-BrLyP-oa.mjs";import{connectionStatus as l}from"./packem_shared/connectionStatus-DMx3BE5Q.mjs";import{getLunoraClient as h,setLunoraClient as y}from"./packem_shared/getLunoraClient-DU7BmZy1.mjs";import{flag as L,flags as v}from"./packem_shared/flag-Csh9LBiO.mjs";import{hydratePreloaded as S}from"./packem_shared/hydratePreloaded-BiEJ5Jt2.mjs";import{mutation as q}from"./packem_shared/mutation-DLBr5Op1.mjs";import{mutator as E}from"./packem_shared/mutator-DECDuo94.mjs";import{infiniteQuery as P,paginatedQuery as T}from"./packem_shared/infiniteQuery-CSXXv5DY.mjs";import{presence as k}from"./packem_shared/presence-Ybhe8so-.mjs";import{query as z}from"./packem_shared/query-VzaOi1pv.mjs";import{rateLimit as D}from"./packem_shared/rateLimit-Cli38qWO.mjs";import{stream as H}from"./packem_shared/stream-Cxl8guzh.mjs";import{subscription as J}from"./packem_shared/subscription-NVRm3LD-.mjs";import{voiceAgent as M}from"./packem_shared/voiceAgent-KSChAXsW.mjs";export{t as action,a as agent,f as agentChat,n as agentState,i as agentToolEvents,g as auth,s as authGate,l as connectionStatus,L as flag,v as flags,h as getLunoraClient,S as hydratePreloaded,P as infiniteQuery,q as mutation,E as mutator,T as paginatedQuery,k as presence,z as query,D as rateLimit,y as setLunoraClient,H as stream,J as subscription,M as voiceAgent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getIdentityStore as g}from"@lunora/client/auth";import{readable as i,derived as c}from"svelte/store";import{i as a}from"./is-browser-BEdfLJHK.mjs";import{getLunoraClient as h}from"./getLunoraClient-DU7BmZy1.mjs";const k=o=>{const e=o??h(),n=g(e),s=i(e.getAuthToken(),t=>(t(e.getAuthToken()),a()?e.onAuthTokenChange(l=>{t(l)}):()=>{})),u=i(n.getUser(),t=>(t(n.getUser()),a()?n.subscribe(()=>{t(n.getUser())}):()=>{}));return{setToken:t=>{e.setAuthToken(t)},token:s,user:u}},T=o=>{const{token:e,user:n}=k(o),s=c([e,n],([r,t])=>r!==null&&t===null);return{isAuthenticated:c([e,n],([r,t])=>r!==null&&t!==null),isLoading:s}};export{k as auth,T as authGate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readable as e}from"svelte/store";import{i}from"./is-browser-BEdfLJHK.mjs";import{getLunoraClient as c}from"./getLunoraClient-DU7BmZy1.mjs";const m=n=>{const t=n??c();return e(t.connectionStatus(),o=>(o(t.connectionStatus()),i()?t.onConnectionStatus(r=>{o(r)}):()=>{}))};export{m as connectionStatus};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/svelte",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.118",
|
|
4
4
|
"description": "Svelte adapter for Lunora — live stores, optimistic mutations, and reactive loaders",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@lunora/client": "1.0.0-alpha.
|
|
58
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
59
|
-
"@lunora/ratelimit": "1.0.0-alpha.
|
|
57
|
+
"@lunora/client": "1.0.0-alpha.83",
|
|
58
|
+
"@lunora/errors": "1.0.0-alpha.34",
|
|
59
|
+
"@lunora/ratelimit": "1.0.0-alpha.42",
|
|
60
60
|
"@visulima/storage-client": "1.0.2"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getIdentityStore as a}from"@lunora/client/auth";import{readable as c,derived as i}from"svelte/store";import{getLunoraClient as g}from"./getLunoraClient-DU7BmZy1.mjs";const h=r=>{const e=r??g(),n=a(e),s=c(e.getAuthToken(),t=>(t(e.getAuthToken()),e.onAuthTokenChange(l=>{t(l)}))),u=c(n.getUser(),t=>(t(n.getUser()),n.subscribe(()=>{t(n.getUser())})));return{setToken:t=>{e.setAuthToken(t)},token:s,user:u}},A=r=>{const{token:e,user:n}=h(r),s=i([e,n],([o,t])=>o!==null&&t===null);return{isAuthenticated:i([e,n],([o,t])=>o!==null&&t!==null),isLoading:s}};export{h as auth,A as authGate};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{readable as r}from"svelte/store";import{getLunoraClient as c}from"./getLunoraClient-DU7BmZy1.mjs";const u=o=>{const t=o??c();return r(t.connectionStatus(),n=>(n(t.connectionStatus()),t.onConnectionStatus(e=>{n(e)})))};export{u as connectionStatus};
|