rivet-design 0.21.6 → 0.21.7

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.
@@ -12,7 +12,7 @@ const PreviewEnvironment_1 = require("./PreviewEnvironment");
12
12
  const errorMessage_1 = require("../utils/errorMessage");
13
13
  const log = (0, logger_1.createLogger)('HistoryReplayService');
14
14
  const DEFAULT_IDLE_TTL_MS = 30 * 60 * 1000;
15
- const DEFAULT_MAX_ACTIVE_REPLAYS = 3;
15
+ const DEFAULT_MAX_ACTIVE_REPLAYS = 6;
16
16
  const REPLAY_PORT_SCAN_START = 3000;
17
17
  const PORT_PLACEHOLDER = '${PORT}';
18
18
  class HistoryReplayError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rivet-design",
3
- "version": "0.21.6",
3
+ "version": "0.21.7",
4
4
  "description": "Local visual web development tool with AI-powered code modification",
5
5
  "main": "dist/index.js",
6
6
  "workspaces": [
@@ -1,4 +1,4 @@
1
- var Be=s=>{throw TypeError(s)};var Ee=(s,t,r)=>t.has(s)||Be("Cannot "+r);var h=(s,t,r)=>(Ee(s,t,"read from private field"),r?r.call(s):t.get(s)),z=(s,t,r)=>t.has(s)?Be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,r),L=(s,t,r,i)=>(Ee(s,t,"write to private field"),i?i.call(s,r):t.set(s,r),r),A=(s,t,r)=>(Ee(s,t,"access private method"),r);import{S as lt,s as ct,h as Ve,g as Kt,n as fe,r as Qt,Q as dt,u as _e,a as Bt,b as Vt,c as d,e as Gt,d as Yt,f as Wt,i as ut,j as Ge,k as Jt,l as Xt,m as Zt,o as ce,p as me,q as es,t as e,B as J,v as Pe,P as ts,w as ss,x as rs,y as is,z as as,X as ht,D as mt,A as pt,C as xt,E as ft,F as bt,G as yt,H as gt,I as Ye,J as ns,K as os,L as ls,M as cs,N as ne,O as Se,R as ds,T as vt,U as ee,V as Y,W as x,Y as re,Z as H,_ as wt,$ as us,a0 as hs,a1 as ms,a2 as ps,a3 as xs,a4 as fs,a5 as bs,a6 as ys,a7 as B,a8 as gs,a9 as vs,aa as We,ab as ws,ac as js,ad as Ns,ae as ks,af as Ss,ag as jt,ah as _s,ai as Is,aj as Rs,ak as Cs,al as Es,am as Ps}from"./main-C9MzoKvC.js";var ie,ae,U,ye,se,pe,Te,nt,Ts=(nt=class extends lt{constructor(t,r){super();z(this,se);z(this,ie);z(this,ae);z(this,U);z(this,ye);L(this,ie,t),this.setOptions(r),this.bindMethods(),A(this,se,pe).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const r=this.options;this.options=h(this,ie).defaultMutationOptions(t),ct(this.options,r)||h(this,ie).getMutationCache().notify({type:"observerOptionsUpdated",mutation:h(this,U),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ve(r.mutationKey)!==Ve(this.options.mutationKey)?this.reset():((i=h(this,U))==null?void 0:i.state.status)==="pending"&&h(this,U).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&h(this,U)&&(h(this,U).addObserver(this),A(this,se,pe).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=h(this,U))==null||t.removeObserver(this)}onMutationUpdate(t){A(this,se,pe).call(this),A(this,se,Te).call(this,t)}getCurrentResult(){return h(this,ae)}reset(){var t;(t=h(this,U))==null||t.removeObserver(this),L(this,U,void 0),A(this,se,pe).call(this),A(this,se,Te).call(this)}mutate(t,r){var i;return L(this,ye,r),(i=h(this,U))==null||i.removeObserver(this),L(this,U,h(this,ie).getMutationCache().build(h(this,ie),this.options)),h(this,U).addObserver(this),h(this,U).execute(t)}},ie=new WeakMap,ae=new WeakMap,U=new WeakMap,ye=new WeakMap,se=new WeakSet,pe=function(){var r;const t=((r=h(this,U))==null?void 0:r.state)??Kt();L(this,ae,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Te=function(t){fe.batch(()=>{var i,n,o,a;const r=h(this,ye);if(r&&this.hasListeners()){const l=h(this,ae).variables,m=h(this,ae).context,f={client:h(this,ie),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(i=r.onSuccess)==null||i.call(r,t.data,l,m,f)}catch(b){Promise.reject(b)}try{(n=r.onSettled)==null||n.call(r,t.data,null,l,m,f)}catch(b){Promise.reject(b)}}else if((t==null?void 0:t.type)==="error"){try{(o=r.onError)==null||o.call(r,t.error,l,m,f)}catch(b){Promise.reject(b)}try{(a=r.onSettled)==null||a.call(r,void 0,t.error,l,m,f)}catch(b){Promise.reject(b)}}}this.listeners.forEach(l=>{l(h(this,ae))})})},nt);function Je(s,t){const r=new Set(t);return s.filter(i=>!r.has(i))}var ue,Q,he,oe,G,le,ge,ve,we,je,O,Le,Oe,Nt,Me,Ae,De,ot,Ls=(ot=class extends lt{constructor(t,r,i){super();z(this,O);z(this,ue);z(this,Q);z(this,he);z(this,oe);z(this,G);z(this,le);z(this,ge);z(this,ve);z(this,we);z(this,je,[]);L(this,ue,t),L(this,oe,i),L(this,he,[]),L(this,G,[]),L(this,Q,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&h(this,G).forEach(t=>{t.subscribe(r=>{A(this,O,Ae).call(this,t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,h(this,G).forEach(t=>{t.destroy()})}setQueries(t,r){L(this,he,t),L(this,oe,r),fe.batch(()=>{const i=h(this,G),n=A(this,O,Me).call(this,h(this,he));n.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const o=n.map(p=>p.observer),a=o.map(p=>p.getCurrentResult()),l=i.length!==o.length,m=o.some((p,j)=>p!==i[j]),f=l||m,b=f?!0:a.some((p,j)=>{const N=h(this,Q)[j];return!N||!ct(p,N)});!f&&!b||(f&&(L(this,je,n),L(this,G,o)),L(this,Q,a),this.hasListeners()&&(f&&(Je(i,o).forEach(p=>{p.destroy()}),Je(o,i).forEach(p=>{p.subscribe(j=>{A(this,O,Ae).call(this,p,j)})})),A(this,O,De).call(this)))})}getCurrentResult(){return h(this,Q)}getQueries(){return h(this,G).map(t=>t.getCurrentQuery())}getObservers(){return h(this,G)}getOptimisticResult(t,r){const i=A(this,O,Me).call(this,t),n=i.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),o=i.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>A(this,O,Oe).call(this,a??n,r,o),()=>A(this,O,Le).call(this,n,i)]}},ue=new WeakMap,Q=new WeakMap,he=new WeakMap,oe=new WeakMap,G=new WeakMap,le=new WeakMap,ge=new WeakMap,ve=new WeakMap,we=new WeakMap,je=new WeakMap,O=new WeakSet,Le=function(t,r){const i=new Set;return r.map((n,o)=>{const a=t[o];return n.defaultedQueryOptions.notifyOnChangeProps?a:n.observer.trackResult(a,l=>{i.has(l)||(i.add(l),r.forEach(m=>{m.observer.trackProp(l)}))})})},Oe=function(t,r,i){if(r){const n=h(this,we),o=i!==void 0&&n!==void 0&&(n.length!==i.length||i.some((a,l)=>a!==n[l]));return(h(this,Q)!==h(this,ve)||o||r!==h(this,ge))&&(L(this,ge,r),L(this,ve,h(this,Q)),i!==void 0&&L(this,we,i),L(this,le,Qt(h(this,le),r(t)))),h(this,le)}return t},Nt=function(){var t;return!((t=h(this,oe))!=null&&t.combine)||h(this,G).some((r,i)=>{var n;return r.options.suspense&&((n=h(this,Q)[i])==null?void 0:n.data)===void 0})},Me=function(t){const r=new Map;h(this,G).forEach(n=>{const o=n.options.queryHash;if(!o)return;const a=r.get(o);a?a.push(n):r.set(o,[n])});const i=[];return t.forEach(n=>{var l;const o=h(this,ue).defaultQueryOptions(n),a=((l=r.get(o.queryHash))==null?void 0:l.shift())??new dt(h(this,ue),o);i.push({defaultedQueryOptions:o,observer:a})}),i},Ae=function(t,r){const i=h(this,G).indexOf(t);i!==-1&&(L(this,Q,h(this,Q).slice()),h(this,Q)[i]=r,A(this,O,De).call(this))},De=function(){var t;if(this.hasListeners()){const r=A(this,O,Nt).call(this),i=h(this,le),n=r?i:A(this,O,Oe).call(this,A(this,O,Le).call(this,h(this,Q),h(this,je)),(t=h(this,oe))==null?void 0:t.combine);(r||i!==n)&&fe.batch(()=>{this.listeners.forEach(o=>{o(h(this,Q))})})}},ot);function Os({queries:s,...t},r){const i=_e(),n=Bt(),o=Vt(),a=t.subscribed!==!1,l=d.useMemo(()=>s.map(S=>{const y=i.defaultQueryOptions(S);return y._optimisticResults=n?"isRestoring":a?"optimistic":void 0,y}),[s,i,n,a]);l.forEach(S=>{Gt(S);const y=i.getQueryCache().get(S.queryHash);Yt(S,o,y)}),Wt(o);const[m]=d.useState(()=>new Ls(i,l,t)),[f,b,p]=m.getOptimisticResult(l,t.combine),j=!n&&a;d.useSyncExternalStore(d.useCallback(S=>j?m.subscribe(fe.batchCalls(S)):ut,[m,j]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),d.useEffect(()=>{m.setQueries(l,t)},[l,t,m]);const N=f.some((S,y)=>Ge(l[y],S))?f.flatMap((S,y)=>{const k=l[y];if(k&&Ge(k,S)){const $=new dt(i,k);return Jt(k,$,o)}return[]}):[];if(N.length>0)throw Promise.all(N);const R=f.find((S,y)=>{const k=l[y];return k&&Xt({result:S,errorResetBoundary:o,throwOnError:k.throwOnError,query:i.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(R)throw R.error;return b(p())}function xe(s,t){const r=_e(),[i]=d.useState(()=>new Ts(r,s));d.useEffect(()=>{i.setOptions(s)},[i,s]);const n=d.useSyncExternalStore(d.useCallback(a=>i.subscribe(fe.batchCalls(a)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=d.useCallback((...a)=>{i.mutate(a[0],a[1]).catch(ut)},[i]);if(n.error&&Zt(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:o,mutateAsync:n.mutate}}/**
1
+ var Be=s=>{throw TypeError(s)};var Ee=(s,t,r)=>t.has(s)||Be("Cannot "+r);var h=(s,t,r)=>(Ee(s,t,"read from private field"),r?r.call(s):t.get(s)),z=(s,t,r)=>t.has(s)?Be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,r),L=(s,t,r,i)=>(Ee(s,t,"write to private field"),i?i.call(s,r):t.set(s,r),r),A=(s,t,r)=>(Ee(s,t,"access private method"),r);import{S as lt,s as ct,h as Ve,g as Kt,n as fe,r as Qt,Q as dt,u as _e,a as Bt,b as Vt,c as d,e as Gt,d as Yt,f as Wt,i as ut,j as Ge,k as Jt,l as Xt,m as Zt,o as ce,p as me,q as es,t as e,B as J,v as Pe,P as ts,w as ss,x as rs,y as is,z as as,X as ht,D as mt,A as pt,C as xt,E as ft,F as bt,G as yt,H as gt,I as Ye,J as ns,K as os,L as ls,M as cs,N as ne,O as Se,R as ds,T as vt,U as ee,V as Y,W as x,Y as re,Z as H,_ as wt,$ as us,a0 as hs,a1 as ms,a2 as ps,a3 as xs,a4 as fs,a5 as bs,a6 as ys,a7 as B,a8 as gs,a9 as vs,aa as We,ab as ws,ac as js,ad as Ns,ae as ks,af as Ss,ag as jt,ah as _s,ai as Is,aj as Rs,ak as Cs,al as Es,am as Ps}from"./main-D2BhjJwI.js";var ie,ae,U,ye,se,pe,Te,nt,Ts=(nt=class extends lt{constructor(t,r){super();z(this,se);z(this,ie);z(this,ae);z(this,U);z(this,ye);L(this,ie,t),this.setOptions(r),this.bindMethods(),A(this,se,pe).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const r=this.options;this.options=h(this,ie).defaultMutationOptions(t),ct(this.options,r)||h(this,ie).getMutationCache().notify({type:"observerOptionsUpdated",mutation:h(this,U),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ve(r.mutationKey)!==Ve(this.options.mutationKey)?this.reset():((i=h(this,U))==null?void 0:i.state.status)==="pending"&&h(this,U).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&h(this,U)&&(h(this,U).addObserver(this),A(this,se,pe).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=h(this,U))==null||t.removeObserver(this)}onMutationUpdate(t){A(this,se,pe).call(this),A(this,se,Te).call(this,t)}getCurrentResult(){return h(this,ae)}reset(){var t;(t=h(this,U))==null||t.removeObserver(this),L(this,U,void 0),A(this,se,pe).call(this),A(this,se,Te).call(this)}mutate(t,r){var i;return L(this,ye,r),(i=h(this,U))==null||i.removeObserver(this),L(this,U,h(this,ie).getMutationCache().build(h(this,ie),this.options)),h(this,U).addObserver(this),h(this,U).execute(t)}},ie=new WeakMap,ae=new WeakMap,U=new WeakMap,ye=new WeakMap,se=new WeakSet,pe=function(){var r;const t=((r=h(this,U))==null?void 0:r.state)??Kt();L(this,ae,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Te=function(t){fe.batch(()=>{var i,n,o,a;const r=h(this,ye);if(r&&this.hasListeners()){const l=h(this,ae).variables,m=h(this,ae).context,f={client:h(this,ie),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(i=r.onSuccess)==null||i.call(r,t.data,l,m,f)}catch(b){Promise.reject(b)}try{(n=r.onSettled)==null||n.call(r,t.data,null,l,m,f)}catch(b){Promise.reject(b)}}else if((t==null?void 0:t.type)==="error"){try{(o=r.onError)==null||o.call(r,t.error,l,m,f)}catch(b){Promise.reject(b)}try{(a=r.onSettled)==null||a.call(r,void 0,t.error,l,m,f)}catch(b){Promise.reject(b)}}}this.listeners.forEach(l=>{l(h(this,ae))})})},nt);function Je(s,t){const r=new Set(t);return s.filter(i=>!r.has(i))}var ue,Q,he,oe,G,le,ge,ve,we,je,O,Le,Oe,Nt,Me,Ae,De,ot,Ls=(ot=class extends lt{constructor(t,r,i){super();z(this,O);z(this,ue);z(this,Q);z(this,he);z(this,oe);z(this,G);z(this,le);z(this,ge);z(this,ve);z(this,we);z(this,je,[]);L(this,ue,t),L(this,oe,i),L(this,he,[]),L(this,G,[]),L(this,Q,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&h(this,G).forEach(t=>{t.subscribe(r=>{A(this,O,Ae).call(this,t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,h(this,G).forEach(t=>{t.destroy()})}setQueries(t,r){L(this,he,t),L(this,oe,r),fe.batch(()=>{const i=h(this,G),n=A(this,O,Me).call(this,h(this,he));n.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const o=n.map(p=>p.observer),a=o.map(p=>p.getCurrentResult()),l=i.length!==o.length,m=o.some((p,j)=>p!==i[j]),f=l||m,b=f?!0:a.some((p,j)=>{const N=h(this,Q)[j];return!N||!ct(p,N)});!f&&!b||(f&&(L(this,je,n),L(this,G,o)),L(this,Q,a),this.hasListeners()&&(f&&(Je(i,o).forEach(p=>{p.destroy()}),Je(o,i).forEach(p=>{p.subscribe(j=>{A(this,O,Ae).call(this,p,j)})})),A(this,O,De).call(this)))})}getCurrentResult(){return h(this,Q)}getQueries(){return h(this,G).map(t=>t.getCurrentQuery())}getObservers(){return h(this,G)}getOptimisticResult(t,r){const i=A(this,O,Me).call(this,t),n=i.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),o=i.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>A(this,O,Oe).call(this,a??n,r,o),()=>A(this,O,Le).call(this,n,i)]}},ue=new WeakMap,Q=new WeakMap,he=new WeakMap,oe=new WeakMap,G=new WeakMap,le=new WeakMap,ge=new WeakMap,ve=new WeakMap,we=new WeakMap,je=new WeakMap,O=new WeakSet,Le=function(t,r){const i=new Set;return r.map((n,o)=>{const a=t[o];return n.defaultedQueryOptions.notifyOnChangeProps?a:n.observer.trackResult(a,l=>{i.has(l)||(i.add(l),r.forEach(m=>{m.observer.trackProp(l)}))})})},Oe=function(t,r,i){if(r){const n=h(this,we),o=i!==void 0&&n!==void 0&&(n.length!==i.length||i.some((a,l)=>a!==n[l]));return(h(this,Q)!==h(this,ve)||o||r!==h(this,ge))&&(L(this,ge,r),L(this,ve,h(this,Q)),i!==void 0&&L(this,we,i),L(this,le,Qt(h(this,le),r(t)))),h(this,le)}return t},Nt=function(){var t;return!((t=h(this,oe))!=null&&t.combine)||h(this,G).some((r,i)=>{var n;return r.options.suspense&&((n=h(this,Q)[i])==null?void 0:n.data)===void 0})},Me=function(t){const r=new Map;h(this,G).forEach(n=>{const o=n.options.queryHash;if(!o)return;const a=r.get(o);a?a.push(n):r.set(o,[n])});const i=[];return t.forEach(n=>{var l;const o=h(this,ue).defaultQueryOptions(n),a=((l=r.get(o.queryHash))==null?void 0:l.shift())??new dt(h(this,ue),o);i.push({defaultedQueryOptions:o,observer:a})}),i},Ae=function(t,r){const i=h(this,G).indexOf(t);i!==-1&&(L(this,Q,h(this,Q).slice()),h(this,Q)[i]=r,A(this,O,De).call(this))},De=function(){var t;if(this.hasListeners()){const r=A(this,O,Nt).call(this),i=h(this,le),n=r?i:A(this,O,Oe).call(this,A(this,O,Le).call(this,h(this,Q),h(this,je)),(t=h(this,oe))==null?void 0:t.combine);(r||i!==n)&&fe.batch(()=>{this.listeners.forEach(o=>{o(h(this,Q))})})}},ot);function Os({queries:s,...t},r){const i=_e(),n=Bt(),o=Vt(),a=t.subscribed!==!1,l=d.useMemo(()=>s.map(S=>{const y=i.defaultQueryOptions(S);return y._optimisticResults=n?"isRestoring":a?"optimistic":void 0,y}),[s,i,n,a]);l.forEach(S=>{Gt(S);const y=i.getQueryCache().get(S.queryHash);Yt(S,o,y)}),Wt(o);const[m]=d.useState(()=>new Ls(i,l,t)),[f,b,p]=m.getOptimisticResult(l,t.combine),j=!n&&a;d.useSyncExternalStore(d.useCallback(S=>j?m.subscribe(fe.batchCalls(S)):ut,[m,j]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),d.useEffect(()=>{m.setQueries(l,t)},[l,t,m]);const N=f.some((S,y)=>Ge(l[y],S))?f.flatMap((S,y)=>{const k=l[y];if(k&&Ge(k,S)){const $=new dt(i,k);return Jt(k,$,o)}return[]}):[];if(N.length>0)throw Promise.all(N);const R=f.find((S,y)=>{const k=l[y];return k&&Xt({result:S,errorResetBoundary:o,throwOnError:k.throwOnError,query:i.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(R)throw R.error;return b(p())}function xe(s,t){const r=_e(),[i]=d.useState(()=>new Ts(r,s));d.useEffect(()=>{i.setOptions(s)},[i,s]);const n=d.useSyncExternalStore(d.useCallback(a=>i.subscribe(fe.batchCalls(a)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=d.useCallback((...a)=>{i.mutate(a[0],a[1]).catch(ut)},[i]);if(n.error&&Zt(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:o,mutateAsync:n.mutate}}/**
2
2
  * @license lucide-react v1.57.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.