modelence 0.23.1-rc.1 → 0.24.0-dev.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/chunk-63RBLFRJ.js +4 -0
- package/dist/chunk-63RBLFRJ.js.map +1 -0
- package/dist/chunk-E3L5INVU.js +41 -0
- package/dist/chunk-E3L5INVU.js.map +1 -0
- package/dist/chunk-FBYHAMXI.js +2 -0
- package/dist/chunk-FBYHAMXI.js.map +1 -0
- package/dist/{chunk-UJ2WYHH7.js → chunk-NPBIRXLC.js} +2 -2
- package/dist/{chunk-UJ2WYHH7.js.map → chunk-NPBIRXLC.js.map} +1 -1
- package/dist/chunk-RZ5A2YM2.js +3 -0
- package/dist/chunk-RZ5A2YM2.js.map +1 -0
- package/dist/chunk-ZI6PQXEB.js +3 -0
- package/dist/{chunk-WDY7BYXR.js.map → chunk-ZI6PQXEB.js.map} +1 -1
- package/dist/chunk-ZVA536ET.js +2 -0
- package/dist/chunk-ZVA536ET.js.map +1 -0
- package/dist/client.d.ts +124 -2
- package/dist/client.js +1 -1
- package/dist/{package-CVM4IWJK.js → package-43UFIFMI.js} +2 -2
- package/dist/{package-CVM4IWJK.js.map → package-43UFIFMI.js.map} +1 -1
- package/dist/{render-OM7ZJWZA.js → render-5AGW5SQM.js} +2 -2
- package/dist/{render-OM7ZJWZA.js.map → render-5AGW5SQM.js.map} +1 -1
- package/dist/renderApp-3C3JFOHW.js +2 -0
- package/dist/{renderApp-MD5O44UP.js.map → renderApp-3C3JFOHW.js.map} +1 -1
- package/dist/server-TU6GA634.js +2 -0
- package/dist/{server-UEELUISV.js.map → server-TU6GA634.js.map} +1 -1
- package/dist/server.d.ts +81 -2
- package/dist/server.js +1 -1
- package/dist/transport-FTLINZKK.js +2 -0
- package/dist/{transport-VKGH6BY6.js.map → transport-FTLINZKK.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-4I4BI7KD.js +0 -2
- package/dist/chunk-4I4BI7KD.js.map +0 -1
- package/dist/chunk-5MQVN3TR.js +0 -41
- package/dist/chunk-5MQVN3TR.js.map +0 -1
- package/dist/chunk-KDOTVIEY.js +0 -4
- package/dist/chunk-KDOTVIEY.js.map +0 -1
- package/dist/chunk-KOJCIWDR.js +0 -3
- package/dist/chunk-KOJCIWDR.js.map +0 -1
- package/dist/chunk-W4RFIS5E.js +0 -2
- package/dist/chunk-W4RFIS5E.js.map +0 -1
- package/dist/chunk-WDY7BYXR.js +0 -3
- package/dist/renderApp-MD5O44UP.js +0 -2
- package/dist/server-UEELUISV.js +0 -2
- package/dist/transport-VKGH6BY6.js +0 -2
package/dist/chunk-WDY7BYXR.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import {l,f as f$1,D,C,I,i,h as h$1,j as j$1,e}from'./chunk-W4RFIS5E.js';import {c}from'./chunk-5M6FUMUK.js';import {useState,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';import J from'socket.io-client';import {hashKey,QueryClient,QueryClientProvider,HydrationBoundary}from'@tanstack/react-query';var a={page:{minHeight:"100vh",backgroundColor:"#f3f4f6",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 16px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",color:"#111827"},container:{maxWidth:"576px",width:"100%"},logoWrap:{display:"flex",justifyContent:"center",marginBottom:"32px"},title:{fontSize:"30px",lineHeight:"36px",fontWeight:700,textAlign:"center",margin:0},subtitle:{marginTop:"16px",color:"#4b5563",textAlign:"center"},steps:{marginTop:"32px",listStyle:"none",padding:0,display:"flex",flexDirection:"column",gap:"16px"},step:{display:"flex",gap:"16px",alignItems:"flex-start",backgroundColor:"#ffffff",borderRadius:"8px",border:"1px solid #e5e7eb",padding:"16px"},stepNumber:{flex:"none",width:"28px",height:"28px",borderRadius:"9999px",backgroundColor:"#111827",color:"#ffffff",fontSize:"14px",fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center"},stepText:{color:"#374151",lineHeight:"28px"},code:{fontSize:"14px",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace",backgroundColor:"#e5e7eb",borderRadius:"4px",padding:"2px 4px"},footer:{marginTop:"32px",fontSize:"14px",color:"#6b7280",textAlign:"center"}};function Q(){return jsx("div",{style:a.page,children:jsxs("div",{style:a.container,children:[jsx("div",{style:a.logoWrap,children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80",height:"80",viewBox:"0 0 48 48",fill:"none","aria-label":"Modelence Logo",children:jsx("path",{fill:"#5509D9",d:"M45 22.788V12L24 0l-9.437 5.392L45 22.788ZM25.152 35.24l10.589 6.052 8.107-4.632-10.589-6.052-8.107 4.632Zm9.26-15.872v9.264L45 34.684V25.42l-10.589-6.052ZM3 25.212V36l21 12 9.441-5.392L3 25.212ZM22.848 12.76 12.26 6.708 4.152 11.34l10.589 6.052 8.107-4.632Zm-9.26 15.872v-9.264L3 13.316v9.264l10.589 6.052Z"})})}),jsx("h1",{style:a.title,children:"Connect this project to Modelence Cloud"}),jsx("p",{style:a.subtitle,children:"One quick step before you can use this app locally."}),jsxs("ol",{style:a.steps,children:[jsxs(T,{number:1,children:["Run ",jsx("code",{style:a.code,children:"npx modelence setup"})," in the project folder."]}),jsx(T,{number:2,children:"Your browser opens \u2014 log in and choose your environment."}),jsxs(T,{number:3,children:["Restart the dev server (",jsx("code",{style:a.code,children:"npm run dev"}),")."]})]}),jsx("p",{style:a.footer,children:"This page refreshes automatically once the project is connected."})]})})}function T({number:e,children:t}){return jsxs("li",{style:a.step,children:[jsx("span",{style:a.stepNumber,children:e}),jsx("span",{style:a.stepText,children:t})]})}var V="__MODELENCE_STATE__",z=3e3,U=false;function Y(){return typeof document<"u"&&document.getElementById(V)!==null}function xe({children:e,loadingElement:t,setupElement:n}){let r=typeof window>"u",[i$1,l$1]=useState(()=>!r&&!l()&&!Y()),[d,s]=useState(()=>!r&&l()&&f$1());return useEffect(()=>{async function c(){if(!U){if(U=true,l()){i()&&await h$1(),s(f$1());return}await j$1(),s(f$1()),l$1(false);}}c();},[]),useEffect(()=>{if(!d)return;let c=false,o;async function p(){try{let{setupRequired:$}=await I("_system.setupStatus",{},{errorHandler:()=>{}});if(!$){window.location.reload();return}}catch{}c||(o=setTimeout(p,z));}return o=setTimeout(p,z),()=>{c=true,clearTimeout(o);}},[d]),i$1?t??jsx("div",{children:"Loading..."}):d&&n!==null?n??jsx(Q,{}):e}var v=null,m=new Map;function h(){if(!v)throw new Error("WebSocket not initialized. Call startWebsockets() first.");return v}function G(){let e=C(),t=D();for(let n of m.values())v?.emit("subscribeLiveQuery",{subscriptionId:n.subscriptionId,method:n.method,args:n.args,authToken:e,clientInfo:t});}function X(e$1){let t=e()?.baseUrl??"/";v=J(t,{transports:["websocket"],auth:{token:C()}}),v.on("connect",()=>{m.size>0&&(console.log(`[Modelence] WebSocket reconnected, re-subscribing to ${m.size} live queries`),G());}),e$1.channels?.forEach(n=>n.init());}function ee({category:e,listener:t}){h().on(e,t);}function te({category:e,listener:t}){h().once(e,t);}function ne({category:e,listener:t}){h().off(e,t);}function R({eventName:e,category:t,id:n}){h().emit(e,`${t}:${n}`);}function re({category:e,id:t}){R({eventName:"joinChannel",category:e,id:t});}function oe({category:e,id:t}){R({eventName:"leaveChannel",category:e,id:t});}var ie=0;function M(e,t,n,r){let i=`sub-${++ie}-${Date.now()}`,l=({subscriptionId:c$1,data:o,typeMap:p})=>{c$1===i&&n(c(o,p));},d=({subscriptionId:c,error:o})=>{c===i&&(console.error(`[Modelence] Live query error for ${e}:`,o),r?.(o));},s=h();return s.on("liveQueryData",l),s.on("liveQueryError",d),m.set(i,{subscriptionId:i,method:e,args:t}),s.connected&&s.emit("subscribeLiveQuery",{subscriptionId:i,method:e,args:t,authToken:C(),clientInfo:D()}),()=>{m.delete(i),s.emit("unsubscribeLiveQuery",{subscriptionId:i}),s.off("liveQueryData",l),s.off("liveQueryError",d);}}var se={init:X,on:ee,once:te,off:ne,emit:R,joinChannel:re,leaveChannel:oe},O=se;var E=null;function F(e){E=e;}function Le(){return E}function j(e){if(E){console.warn("WebSocket already initialized. Skipping initialization.");return}let t=e?.provider||O;F(t);try{t.init({channels:e?.channels});}catch(n){throw F(null),n}}var y=null,w=null,P=false,f=new Map;function L(e){y!==e&&(y&&ce(),y=e,w=e.getQueryCache().subscribe(t=>{if(t.type==="removed"){let n=hashKey(t.query.queryKey),r=f.get(n);if(r){if(r.resolvers.size>0){let i=new Error("Query was removed from cache");r.resolvers.forEach(l=>l.reject(i)),r.resolvers.clear();}r.unsubscribe(),f.delete(n);}}}));}function De(){return y!==null}function ce(){w&&(w(),w=null),f.forEach(e=>e.unsubscribe()),f.clear(),y=null,P=false;}var B=class{connect(t){L(t);}};function qe(e,t={}){return {queryKey:[e,t],queryFn:()=>I(e,t)}}function ze(e,t={}){let n=["live",e,t],r=hashKey(n);return {queryKey:n,queryFn:()=>new Promise((i,l)=>{if(typeof window>"u")return;if(!y){let s=new Error("Modelence: connect a QueryClient before using modelenceLiveQuery(). Mount <ModelenceQueryProvider> or call connectModelenceQueryClient().");console.error("[Modelence]",s.message),l(s);return}P||(j(),P=true);let d=f.get(r);d||(d={unsubscribe:M(e,t,c=>{let o=f.get(r);o?.resolvers.size&&(o.resolvers.forEach(p=>p.resolve(c)),o.resolvers.clear()),y&&y.setQueryData(n,c);},c=>{let o=f.get(r);o&&(o.resolvers.size&&(o.resolvers.forEach(p=>p.reject(new Error(c))),o.resolvers.clear()),o.unsubscribe(),f.delete(r));}),resolvers:new Set},f.set(r,d)),d.resolvers.add({resolve:i,reject:l});}),staleTime:1/0,refetchOnWindowFocus:false,refetchOnMount:false,refetchOnReconnect:false,gcTime:0}}function Ue(e,t={}){return {mutationFn:(n={})=>I(e,{...t,...n})}}function Ke(e,t={}){return [e,t]}var fe="__MODELENCE_QUERY_STATE__";function pe(){if(typeof document>"u")return;let e=document.getElementById(fe);if(!(!e||!e.textContent))try{return JSON.parse(e.textContent)}catch(t){console.error("Modelence: failed to parse SSR query state",t);return}}function He({children:e,client:t,dehydratedState:n}){let[r]=useState(()=>{let l=t??new QueryClient({defaultOptions:{queries:{staleTime:6e4}}});return typeof window<"u"&&L(l),l}),i=n??pe();return jsx(QueryClientProvider,{client:r,children:jsx(HydrationBoundary,{state:i,children:e})})}
|
|
2
|
-
export{xe as a,M as b,F as c,Le as d,j as e,L as f,De as g,ce as h,B as i,qe as j,ze as k,Ue as l,Ke as m,He as n};//# sourceMappingURL=chunk-WDY7BYXR.js.map
|
|
3
|
-
//# sourceMappingURL=chunk-WDY7BYXR.js.map
|
package/dist/server-UEELUISV.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export{g as getCallContext,f as startServer}from'./chunk-5MQVN3TR.js';import'./chunk-KOJCIWDR.js';import'./chunk-KDOTVIEY.js';import'./chunk-VYR7VQMQ.js';import'./chunk-UW37F3GV.js';import'./chunk-5M6FUMUK.js';import'./chunk-DO5TZLF5.js';//# sourceMappingURL=server-UEELUISV.js.map
|
|
2
|
-
//# sourceMappingURL=server-UEELUISV.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {c,a}from'./chunk-UJ2WYHH7.js';import'./chunk-KDOTVIEY.js';import'./chunk-UW37F3GV.js';import {H,G}from'./chunk-W4RFIS5E.js';import'./chunk-5M6FUMUK.js';import'./chunk-DO5TZLF5.js';function d(){return H(async(t,r)=>{let o=c();return o?a(t,r,o.callContext):G(t,r)})}export{d as installSsrCallMethodTransport};//# sourceMappingURL=transport-VKGH6BY6.js.map
|
|
2
|
-
//# sourceMappingURL=transport-VKGH6BY6.js.map
|