@lunora/svelte 1.0.0-alpha.234 → 1.0.0-alpha.236
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.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-NhXHxIB0.mjs";import{agentToolEvents as i}from"./packem_shared/agentToolEvents-DrfSVZV-.mjs";import{auth as g,authGate as s}from"./packem_shared/auth-Z0G_aZYz.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-CNm2-Rha.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-CGuLN2df.mjs";import{presence as k}from"./packem_shared/presence-
|
|
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-NhXHxIB0.mjs";import{agentToolEvents as i}from"./packem_shared/agentToolEvents-DrfSVZV-.mjs";import{auth as g,authGate as s}from"./packem_shared/auth-Z0G_aZYz.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-CNm2-Rha.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-CGuLN2df.mjs";import{presence as k}from"./packem_shared/presence-C4ZgfGfr.mjs";import{query as z}from"./packem_shared/query-CYEDU6HY.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-BRy_jj0y.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{onDestroy as C}from"svelte";import{writable as D,readable as E}from"svelte/store";import{i as h}from"./is-browser-BEdfLJHK.mjs";import{getLunoraClient as I}from"./getLunoraClient-DU7BmZy1.mjs";const S=()=>{if(typeof crypto<"u"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"){const e=crypto.getRandomValues(new Uint8Array(16));return Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}}throw new Error("randomSessionId: no Web Crypto available — a session id needs crypto.randomUUID or crypto.getRandomValues")},L=1e4,V=(e,t,n)=>{const{heartbeat:o,intervalMs:c=L,listPresent:m,shardKey:s}=n,d=n.sessionId??S();let f=n.data,u=!1;const i=()=>{const r={roomId:t,sessionId:d,...f===void 0?{}:{data:f}};e.mutation(o,r,{shardKey:s}).catch(()=>{})},U=r=>{f=r,u&&i()},p=()=>{typeof document<"u"&&document.visibilityState==="visible"&&i()};let l,v;h()&&(u=!0,i(),l=setInterval(i,c),typeof document<"u"&&document.addEventListener("visibilitychange",p),v=e.acquireConnectionContext({roomId:t,sessionId:d},{shardKey:s}));const y=D(),w=E(void 0,r=>{if(h())return e.subscribe(m,{roomId:t},a=>{r(a),y.set(void 0)},{onError:a=>{y.set(a),n.onError?.(a)},shardKey:s})});let b=!1;const g=()=>{b||(b=!0,u=!1,l!==void 0&&clearInterval(l),typeof document<"u"&&document.removeEventListener("visibilitychange",p),v?.())};try{C(g)}catch{}return{error:{subscribe:y.subscribe},present:w,sessionId:d,setData:U,teardown:g}};function P(e,t,n){const o=typeof e!="string",c=o?e:I();return V(c,o?t:e,o?n:t)}export{P as presence};
|
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.236",
|
|
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.
|
|
57
|
+
"@lunora/client": "1.0.0-alpha.197",
|
|
58
58
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
59
|
-
"@lunora/ratelimit": "1.0.0-alpha.
|
|
59
|
+
"@lunora/ratelimit": "1.0.0-alpha.124",
|
|
60
60
|
"@visulima/storage-client": "1.0.9"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{onDestroy as w}from"svelte";import{writable as C,readable as D}from"svelte/store";import{i as g}from"./is-browser-BEdfLJHK.mjs";import{getLunoraClient as E}from"./getLunoraClient-DU7BmZy1.mjs";const I=()=>{if(typeof crypto<"u"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"){const e=crypto.getRandomValues(new Uint8Array(16));return Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}}throw new Error("randomSessionId: no Web Crypto available — a session id needs crypto.randomUUID or crypto.getRandomValues")},S=1e4,L=(e,t,n)=>{const{heartbeat:o,intervalMs:c=S,listPresent:y,shardKey:i}=n,d=n.sessionId??I();let f=n.data;const s=()=>{const r={roomId:t,sessionId:d,...f===void 0?{}:{data:f}};e.mutation(o,r,{shardKey:i}).catch(()=>{})},h=r=>{f=r,s()},m=()=>{typeof document<"u"&&document.visibilityState==="visible"&&s()};let u,p;g()&&(s(),u=setInterval(s,c),typeof document<"u"&&document.addEventListener("visibilitychange",m),p=e.acquireConnectionContext({roomId:t,sessionId:d},{shardKey:i}));const l=C(),U=D(void 0,r=>{if(g())return e.subscribe(y,{roomId:t},a=>{r(a),l.set(void 0)},{onError:a=>{l.set(a),n.onError?.(a)},shardKey:i})});let v=!1;const b=()=>{v||(v=!0,u!==void 0&&clearInterval(u),typeof document<"u"&&document.removeEventListener("visibilitychange",m),p?.())};try{w(b)}catch{}return{error:{subscribe:l.subscribe},present:U,sessionId:d,setData:h,teardown:b}};function M(e,t,n){const o=typeof e!="string",c=o?e:E();return L(c,o?t:e,o?n:t)}export{M as presence};
|