@swarm.ing/pieui 2.0.33 → 2.1.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.
Files changed (78) hide show
  1. package/dist/agent/index.d.ts +12 -0
  2. package/dist/agent/index.d.ts.map +1 -0
  3. package/dist/agent/index.esm.js +2 -0
  4. package/dist/agent/index.js +2 -0
  5. package/dist/cli.js +358 -95
  6. package/dist/code/args.d.ts +1 -1
  7. package/dist/code/args.d.ts.map +1 -1
  8. package/dist/code/commands/createPieApp.d.ts.map +1 -1
  9. package/dist/code/commands/registry.d.ts +8 -0
  10. package/dist/code/commands/registry.d.ts.map +1 -0
  11. package/dist/code/types.d.ts +5 -0
  12. package/dist/code/types.d.ts.map +1 -1
  13. package/dist/components/Common/AutoRedirectCard/ui/AutoRedirectCard.d.ts +1 -1
  14. package/dist/components/Common/AutoRedirectCard/ui/AutoRedirectCard.d.ts.map +1 -1
  15. package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts +1 -1
  16. package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts.map +1 -1
  17. package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts +1 -1
  18. package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts.map +1 -1
  19. package/dist/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.d.ts +1 -1
  20. package/dist/components/Common/HTMLEmbedCard/ui/HTMLEmbedCard.d.ts.map +1 -1
  21. package/dist/components/Common/HiddenCard/ui/HiddenCard.d.ts +1 -1
  22. package/dist/components/Common/HiddenCard/ui/HiddenCard.d.ts.map +1 -1
  23. package/dist/components/Common/IOEventsCard/ui/IOEventsCard.d.ts +1 -1
  24. package/dist/components/Common/IOEventsCard/ui/IOEventsCard.d.ts.map +1 -1
  25. package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts +1 -1
  26. package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts.map +1 -1
  27. package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts +1 -1
  28. package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts.map +1 -1
  29. package/dist/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.d.ts +1 -1
  30. package/dist/components/Containers/AjaxGroupCard/ui/AjaxGroupCard.d.ts.map +1 -1
  31. package/dist/components/Containers/BoxCard/ui/BoxCard.d.ts +1 -1
  32. package/dist/components/Containers/BoxCard/ui/BoxCard.d.ts.map +1 -1
  33. package/dist/components/Containers/OneOfCard/ui/OneOfCard.d.ts +1 -1
  34. package/dist/components/Containers/OneOfCard/ui/OneOfCard.d.ts.map +1 -1
  35. package/dist/components/Containers/SequenceCard/ui/SequenceCard.d.ts +1 -1
  36. package/dist/components/Containers/SequenceCard/ui/SequenceCard.d.ts.map +1 -1
  37. package/dist/components/Containers/UnionCard/ui/UnionCard.d.ts +1 -1
  38. package/dist/components/Containers/UnionCard/ui/UnionCard.d.ts.map +1 -1
  39. package/dist/components/LazyBoundary/index.d.ts +43 -0
  40. package/dist/components/LazyBoundary/index.d.ts.map +1 -0
  41. package/dist/components/PieBaseRoot/index.d.ts +1 -1
  42. package/dist/components/PieBaseRoot/index.d.ts.map +1 -1
  43. package/dist/components/PieCard/index.d.ts +1 -1
  44. package/dist/components/PieCard/index.d.ts.map +1 -1
  45. package/dist/components/PieMaxRoot/index.d.ts.map +1 -1
  46. package/dist/components/PiePreviewRoot/index.d.ts +37 -0
  47. package/dist/components/PiePreviewRoot/index.d.ts.map +1 -0
  48. package/dist/components/PieRoot/index.d.ts +1 -1
  49. package/dist/components/PieRoot/index.d.ts.map +1 -1
  50. package/dist/components/PieRoot/types/index.d.ts +19 -3
  51. package/dist/components/PieRoot/types/index.d.ts.map +1 -1
  52. package/dist/components/PieTelegramRoot/index.d.ts.map +1 -1
  53. package/dist/components/UI/index.d.ts +1 -1
  54. package/dist/components/UI/index.d.ts.map +1 -1
  55. package/dist/components/UILoading/index.d.ts +1 -1
  56. package/dist/components/UILoading/index.d.ts.map +1 -1
  57. package/dist/components/index.esm.js +1 -1
  58. package/dist/components/index.js +1 -1
  59. package/dist/index.d.ts +4 -7
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.esm.js +2 -2
  62. package/dist/index.js +2 -2
  63. package/dist/max/index.d.ts +12 -0
  64. package/dist/max/index.d.ts.map +1 -0
  65. package/dist/max/index.esm.js +2 -0
  66. package/dist/max/index.js +2 -0
  67. package/dist/storybook/index.d.ts +3 -3
  68. package/dist/storybook/index.d.ts.map +1 -1
  69. package/dist/telegram/index.d.ts +12 -0
  70. package/dist/telegram/index.d.ts.map +1 -0
  71. package/dist/telegram/index.esm.js +2 -0
  72. package/dist/telegram/index.js +2 -0
  73. package/dist/util/lazy.d.ts.map +1 -1
  74. package/dist/util/lazyError.d.ts +9 -0
  75. package/dist/util/lazyError.d.ts.map +1 -0
  76. package/dist/util/registry.d.ts +28 -0
  77. package/dist/util/registry.d.ts.map +1 -1
  78. package/package.json +33 -11
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storybook/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEH,SAAS,EAKZ,MAAM,OAAO,CAAA;AAEd,OAAa,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAgBpC,QAAA,MAAM,oBAAoB;;;;;CAKzB,CAAA;AAcD,KAAK,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAIjD,eAAO,MAAM,sBAAsB,QAAO,SAQzC,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,QAAQ,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,oBAAoB,CAAC,CAAA;CACnD,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,mCAInC,0BAA0B,4CA6B5B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,SAAS,4CAKhE,CAAA;AAKD,eAAO,MAAM,aAAa,GACtB,SAAS,SAAS,EAClB,UAAU,MAAM,EAChB,YAAY,MAAM,EAClB,SAAS,OAAO,KACjB,IAEF,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,mCAK9B,qBAAqB,4CAoBvB,CAAA;AAED,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAC/E,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAgBrE,eAAO,MAAM,yBAAyB,YAyBrC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storybook/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEH,SAAS,EAKZ,MAAM,OAAO,CAAA;AAEd,OAAa,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAgBpC,QAAA,MAAM,oBAAoB;;;;;CAKzB,CAAA;AAcD,KAAK,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAIjD,eAAO,MAAM,sBAAsB,QAAO,SAQzC,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,QAAQ,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,oBAAoB,CAAC,CAAA;CACnD,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,mCAInC,0BAA0B,gCA6B5B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,SAAS,gCAKhE,CAAA;AAKD,eAAO,MAAM,aAAa,GACtB,SAAS,SAAS,EAClB,UAAU,MAAM,EAChB,YAAY,MAAM,EAClB,SAAS,OAAO,KACjB,IAEF,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,mCAK9B,qBAAqB,gCAoBvB,CAAA;AAED,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAC/E,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAgBrE,eAAO,MAAM,yBAAyB,YAyBrC,CAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Telegram Mini Apps integration entry.
3
+ *
4
+ * `PieTelegramRoot` and the Telegram `WebApp` hooks are intentionally split out
5
+ * of the main `@swarm.ing/pieui` barrel so that apps which do not target
6
+ * Telegram never reference this code from the main entry point. Import from
7
+ * `@swarm.ing/pieui/telegram` when building a Telegram Mini App.
8
+ */
9
+ export { default as PieTelegramRoot } from '../components/PieTelegramRoot';
10
+ export { useWebApp, useInitData } from '../util/useWebApp';
11
+ export type { WebApp, Telegram, InitData, InitDataUnsafe, WebAppUser, WebAppInitData, } from '../types';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/telegram/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE1D,YAAY,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,UAAU,EACV,cAAc,GACjB,MAAM,UAAU,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{useMemo as Q}from"react";import{QueryClient as sU,QueryClientProvider as iU,useQuery as aU}from"@tanstack/react-query";import VU from"mitt";import{createContext as ZU,useCallback as HL,useContext as JL}from"react";var k=null;function m(){if(!k)k=VU();return k}var BU=ZU(null);var d=BU;import{io as FU}from"socket.io-client";import{createContext as NU}from"react";var u=new Map,g=(U)=>{let L=u.get(U);if(L)return L;let $=FU(U,{autoConnect:!1,transports:["websocket"]});return u.set(U,$),$},XU=NU(null),K=XU;import{createContext as YU}from"react";import{Centrifuge as c}from"centrifuge";var l=new Map,h=(U,L)=>{if(!L)return null;let $=`${U}::${L}`,J=l.get($);if(J)return J;async function z(){let H=await fetch(U+"api/centrifuge/gen_token");if(!H.ok){if(H.status===403)throw new c.UnauthorizedError("Backend is not answering");throw Error(`Unexpected status code ${H.status}`)}return(await H.json()).token}let I=new c(L,{getToken:z});return l.set($,I),I},DU=YU(null),_=DU;import{useContext as _U,useEffect as WU}from"react";import{useEffect as GU,useState as OU}from"react";var W=new Map,R=new Map;function T(U,L){let $=`${U}::${L}`,J=U?W.get($):void 0,[z,I]=OU(J??null);return GU(()=>{if(!U)return;if(W.has($)){I(W.get($));return}let H=R.get($);if(!H)H=fetch(U+`api/support/${L}`,{method:"GET"}).then((V)=>V.json()).then((V)=>{return W.set($,V),R.delete($),V}).catch((V)=>{throw R.delete($),V}),R.set($,H);let B=!1;return H.then((V)=>{if(!B)I(V)}).catch(()=>{}),()=>{B=!0}},[U,L,$]),z}import{createContext as QU,useContext as qU}from"react";var P=QU(null),E=()=>{let U=qU(P);if(!U)throw Error("usePieConfig must be used within PieConfigProvider");return U},S=()=>{let{apiServer:U}=E();return U},M=S,o=()=>{let{centrifugeServer:U}=E();return U};var N=()=>{let{enableRenderingLog:U}=E();return U};var p=()=>{let{pageProcessor:U}=E();return U};var KU=null;function n(){KU?.()}var RU=({children:U})=>{let L=_U(K),$=M(),J=T($,"socketIO"),z=(I)=>{if(typeof window<"u")window.sid=I.sid,n(),console.log(`SocketIO initialized: ${window.sid}`)};return WU(()=>{if(!L)return;let I=()=>{console.log("SocketIO connected")},H=(B)=>{console.log(`SocketIO disconnected: ${B}`),L.connect()};if(J)L.on("pieinit",z),L.on("connect",I),L.on("disconnect",H),L.connect();return()=>{if(J)L.off("pieinit",z),L.off("connect",I),L.off("disconnect",H),L.disconnect()}},[L,J]),U},s=RU;import{useContext as TU,useEffect as EU}from"react";var MU=({children:U})=>{let L=TU(_),$=M(),J=T($,"centrifuge");return EU(()=>{if(!L)return;let z=()=>{console.log("Centrifuge connected")},I=(H)=>{console.log("Centrifuge disconnected:",H)};if(J)L.on("connected",z),L.on("disconnected",I),L.connect();return()=>{if(J)L.disconnect()}},[L,J]),U},i=MU;import{createContext as AU}from"react";import{jsx as kU,Fragment as fU}from"react/jsx-runtime";var jU=AU(kU(fU,{})),X=jU;import{createContext as PU}from"react";var SU=PU(void 0),Y=SU;var wU=new Map;var A=(U)=>{return wU.get(U)};import{useContext as a,memo as mU}from"react";import{Component as bU,Suspense as yU}from"react";import{jsx as vU}from"react/jsx-runtime";var xU=2,CU=400;class D extends bU{state={failed:!1,attempt:0};timer;static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(U){if(this.props.onError?.(U),this.state.attempt<xU){let L=CU*(this.state.attempt+1);this.timer=setTimeout(()=>{this.setState(($)=>({failed:!1,attempt:$.attempt+1}))},L)}}componentDidUpdate(U){if(U.name!==this.props.name&&this.state.attempt!==0)this.setState({failed:!1,attempt:0})}componentWillUnmount(){if(this.timer)clearTimeout(this.timer)}render(){if(this.state.failed)return this.props.fallback;return vU(yU,{fallback:this.props.fallback,children:this.props.children},`${this.props.name}:${this.state.attempt}`)}}import{jsx as w}from"react/jsx-runtime";function dU({uiConfig:U,setUiAjaxConfiguration:L}){let $=a(X),J=a(Y),z=N();if(z)console.log("[UI] Rendering component:",U.card),console.log("[UI] Component data:",U.data),console.log("[UI] Component content:",U.content),console.log("[UI] Has setUiAjaxConfiguration:",!!L);let I=A(U.card);if(!I?.component){if(z)console.warn(`[UI] Component not found in registry: ${U.card}`),console.log("[UI] Returning fallback component");return $}if(z)console.log("[UI] Found component in registry:",{name:I.name,isLazy:I.isLazy,hasMetadata:!!I.metadata});let H=I.component,B=w(H,{data:U.data,content:U.content,setUiAjaxConfiguration:L});if(I.isLazy){if(z)console.log("[UI] Rendering lazy component with Suspense:",I.name);return w(D,{name:I.name,fallback:I.fallback?w(I.fallback,{}):$,onError:J,children:B})}if(z)console.log("[UI] Rendering component directly:",I.name);return B}var b=mU(dU);import{createAxiosDateTransformer as tU}from"axios-date-transformer";import{useEffect as uU,useState as gU}from"react";var j=({onError:U}={})=>{let[L,$]=gU(null),J=p();return uU(()=>{if(typeof window>"u")return;let z=window.Telegram?.WebApp;if(!z)return;try{z.ready?.()}catch(I){U?.()}if(J==="telegram_expanded"&&(z.platform==="ios"||z.platform==="android"))z.expand();$(z)},[]),L},cU=()=>{let U=j();return[U?.initDataUnsafe,U?.initData]};import{createContext as lU}from"react";var hU=lU(void 0),t=hU;import{useContext as e}from"react";import{createContext as oU}from"react";var pU=oU(null),r=pU;import{jsx as f}from"react/jsx-runtime";function UU({uiConfig:U,setUiAjaxConfiguration:L}){let $=e(X),J=e(Y),z=N();if(z)console.log("[UILoading] Rendering fallback for:",U.card),console.log("[UILoading] Component data:",U.data),console.log("[UILoading] Component content:",U.content),console.log("[UILoading] Has setUiAjaxConfiguration:",!!L);let I=A(U.card);if(!I?.component){if(z)console.warn(`[UILoading] Component not found in registry: ${U.card}`),console.log("[UILoading] Returning fallback component");return $}if(z)console.log("[UILoading] Found component in registry:",{name:I.name,isLazy:I.isLazy,hasMetadata:!!I.metadata,hasFallback:!!I.fallback});if(I.fallback){if(z)console.log("[UILoading] Rendering fallback for:",I.name);let V=I.fallback;return f(V,{})}if(z)console.log("[UILoading] No fallback, rendering full component:",I.name);let H=I.component,B=f(r.Provider,{value:UU,children:f(H,{data:U.data,content:U.content,setUiAjaxConfiguration:L})});if(I.isLazy)return f(D,{name:I.name,fallback:$,onError:J,children:B});return B}var LU=UU;import{jsx as nU}from"react/jsx-runtime";function IU(U,L,$){if(!L)return $;let J=U.replace(/^\//,""),z=L[J];if(!z)return $;return nU(LU,{uiConfig:z})}import{jsx as Z,Fragment as UL}from"react/jsx-runtime";var rU=({location:U,fallback:L,piecache:$,onError:J,queryOptions:z,disableGlobalForm:I})=>{let H=S(),B=o(),V=N(),$U=Q(()=>tU({baseURL:H}),[H]),zU=Q(()=>m(),[]),HU=Q(()=>H?g(H):null,[H]),JU=Q(()=>H?h(H,B):null,[H,B]),q=j({onError:J}),{data:G,isLoading:y,error:F}=aU({queryKey:["uiConfig",U.pathname+U.search,q?.initData],enabled:!!q?.initData,queryFn:async()=>{let O=new URLSearchParams(U.search);if(O.set("__pieroot","telegram"),q?.initData)O.set("initData",q.initData);let C="/api/content"+U.pathname+"?"+O.toString();if(V)console.log("[PieRoot] Fetching UI configuration from:",C);let v=await $U.get(C,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(V)console.log("[PieRoot] Received UI configuration:",v.data);return v.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(O)=>Math.min(1000*2**O,30000),...z}),x=IU(U.pathname,$,L);if(!H)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(F&&V)return console.error("[PieRoot] Error fetching UI configuration:",F),console.error("[PieRoot] Error details:",{message:F.message,status:F.response?.status,data:F.response?.data}),J?.(F),x;if(y||!G){if(V)console.log("[PieRoot] Loading state:",{isLoading:y,hasUiConfiguration:!!G});return x}if(V)console.log("[PieRoot] UI configuration loaded successfully:",G),console.log("[PieRoot] Rendering UI with configuration");return Z(d.Provider,{value:zU,children:Z(K.Provider,{value:HU,children:Z(_.Provider,{value:JU,children:Z(X.Provider,{value:L??Z(UL,{}),children:Z(s,{children:Z(i,{children:I?Z(b,{uiConfig:G}):Z("form",{id:"piedata_global_form",action:H+"api/process"+U.pathname,method:"post",encType:"multipart/form-data",children:Z(b,{uiConfig:G})})})})})})})})},eU=(U)=>{let L=Q(()=>new sU,[]),$=U.queryClient??L;return Z(t.Provider,{value:U.onNavigate,children:Z(P.Provider,{value:U.config,children:Z(Y.Provider,{value:U.onError,children:Z(iU,{client:$,children:Z(rU,{...U})})})})})},LL=eU;export{j as useWebApp,cU as useInitData,LL as PieTelegramRoot};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ var bU=Object.create;var{getPrototypeOf:yU,defineProperty:K,getOwnPropertyNames:r,getOwnPropertyDescriptor:xU}=Object,e=Object.prototype.hasOwnProperty;var CU=(U,L,I)=>{I=U!=null?bU(yU(U)):{};let H=L||!U||!U.__esModule?K(I,"default",{value:U,enumerable:!0}):I;for(let z of r(U))if(!e.call(H,z))K(H,z,{get:()=>U[z],enumerable:!0});return H},t=new WeakMap,vU=(U)=>{var L=t.get(U),I;if(L)return L;if(L=K({},"__esModule",{value:!0}),U&&typeof U==="object"||typeof U==="function")r(U).map((H)=>!e.call(L,H)&&K(L,H,{get:()=>U[H],enumerable:!(I=xU(U,H))||I.enumerable}));return t.set(U,L),L};var mU=(U,L)=>{for(var I in L)K(U,I,{get:L[I],enumerable:!0,configurable:!0,set:(H)=>L[I]=()=>H})};var LL={};mU(LL,{useWebApp:()=>W,useInitData:()=>qU,PieTelegramRoot:()=>fU});module.exports=vU(LL);var G=require("react"),O=require("@tanstack/react-query");var UU=CU(require("mitt")),E=require("react"),g=null;function LU(){if(!g)g=UU.default();return g}var dU=E.createContext(null);var IU=dU;var zU=require("socket.io-client"),HU=require("react"),$U=new Map,JU=(U)=>{let L=$U.get(U);if(L)return L;let I=zU.io(U,{autoConnect:!1,transports:["websocket"]});return $U.set(U,I),I},uU=HU.createContext(null),M=uU;var ZU=require("react"),c=require("centrifuge"),VU=new Map,BU=(U,L)=>{if(!L)return null;let I=`${U}::${L}`,H=VU.get(I);if(H)return H;async function z(){let J=await fetch(U+"api/centrifuge/gen_token");if(!J.ok){if(J.status===403)throw new c.Centrifuge.UnauthorizedError("Backend is not answering");throw Error(`Unexpected status code ${J.status}`)}return(await J.json()).token}let $=new c.Centrifuge(L,{getToken:z});return VU.set(I,$),$},gU=ZU.createContext(null),A=gU;var y=require("react");var k=require("react"),j=new Map,f=new Map;function P(U,L){let I=`${U}::${L}`,H=U?j.get(I):void 0,[z,$]=k.useState(H??null);return k.useEffect(()=>{if(!U)return;if(j.has(I)){$(j.get(I));return}let J=f.get(I);if(!J)J=fetch(U+`api/support/${L}`,{method:"GET"}).then((Z)=>Z.json()).then((Z)=>{return j.set(I,Z),f.delete(I),Z}).catch((Z)=>{throw f.delete(I),Z}),f.set(I,J);let B=!1;return J.then((Z)=>{if(!B)$(Z)}).catch(()=>{}),()=>{B=!0}},[U,L,I]),z}var S=require("react"),l=S.createContext(null),w=()=>{let U=S.useContext(l);if(!U)throw Error("usePieConfig must be used within PieConfigProvider");return U},h=()=>{let{apiServer:U}=w();return U},b=h,FU=()=>{let{centrifugeServer:U}=w();return U};var N=()=>{let{enableRenderingLog:U}=w();return U};var NU=()=>{let{pageProcessor:U}=w();return U};var cU=null;function XU(){cU?.()}var lU=({children:U})=>{let L=y.useContext(M),I=b(),H=P(I,"socketIO"),z=($)=>{if(typeof window<"u")window.sid=$.sid,XU(),console.log(`SocketIO initialized: ${window.sid}`)};return y.useEffect(()=>{if(!L)return;let $=()=>{console.log("SocketIO connected")},J=(B)=>{console.log(`SocketIO disconnected: ${B}`),L.connect()};if(H)L.on("pieinit",z),L.on("connect",$),L.on("disconnect",J),L.connect();return()=>{if(H)L.off("pieinit",z),L.off("connect",$),L.off("disconnect",J),L.disconnect()}},[L,H]),U},YU=lU;var x=require("react");var hU=({children:U})=>{let L=x.useContext(A),I=b(),H=P(I,"centrifuge");return x.useEffect(()=>{if(!L)return;let z=()=>{console.log("Centrifuge connected")},$=(J)=>{console.log("Centrifuge disconnected:",J)};if(H)L.on("connected",z),L.on("disconnected",$),L.connect();return()=>{if(H)L.disconnect()}},[L,H]),U},DU=hU;var GU=require("react"),C=require("react/jsx-runtime"),oU=GU.createContext(C.jsx(C.Fragment,{})),X=oU;var OU=require("react"),pU=OU.createContext(void 0),Y=pU;var nU=new Map;var v=(U)=>{return nU.get(U)};var _=require("react");var m=require("react"),QU=require("react/jsx-runtime"),sU=2,iU=400;class D extends m.Component{state={failed:!1,attempt:0};timer;static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(U){if(this.props.onError?.(U),this.state.attempt<sU){let L=iU*(this.state.attempt+1);this.timer=setTimeout(()=>{this.setState((I)=>({failed:!1,attempt:I.attempt+1}))},L)}}componentDidUpdate(U){if(U.name!==this.props.name&&this.state.attempt!==0)this.setState({failed:!1,attempt:0})}componentWillUnmount(){if(this.timer)clearTimeout(this.timer)}render(){if(this.state.failed)return this.props.fallback;return QU.jsx(m.Suspense,{fallback:this.props.fallback,children:this.props.children},`${this.props.name}:${this.state.attempt}`)}}var d=require("react/jsx-runtime");function aU({uiConfig:U,setUiAjaxConfiguration:L}){let I=_.useContext(X),H=_.useContext(Y),z=N();if(z)console.log("[UI] Rendering component:",U.card),console.log("[UI] Component data:",U.data),console.log("[UI] Component content:",U.content),console.log("[UI] Has setUiAjaxConfiguration:",!!L);let $=v(U.card);if(!$?.component){if(z)console.warn(`[UI] Component not found in registry: ${U.card}`),console.log("[UI] Returning fallback component");return I}if(z)console.log("[UI] Found component in registry:",{name:$.name,isLazy:$.isLazy,hasMetadata:!!$.metadata});let J=$.component,B=d.jsx(J,{data:U.data,content:U.content,setUiAjaxConfiguration:L});if($.isLazy){if(z)console.log("[UI] Rendering lazy component with Suspense:",$.name);return d.jsx(D,{name:$.name,fallback:$.fallback?d.jsx($.fallback,{}):I,onError:H,children:B})}if(z)console.log("[UI] Rendering component directly:",$.name);return B}var o=_.memo(aU);var jU=require("axios-date-transformer");var u=require("react");var W=({onError:U}={})=>{let[L,I]=u.useState(null),H=NU();return u.useEffect(()=>{if(typeof window>"u")return;let z=window.Telegram?.WebApp;if(!z)return;try{z.ready?.()}catch($){U?.()}if(H==="telegram_expanded"&&(z.platform==="ios"||z.platform==="android"))z.expand();I(z)},[]),L},qU=()=>{let U=W();return[U?.initDataUnsafe,U?.initData]};var KU=require("react"),tU=KU.createContext(void 0),_U=tU;var p=require("react");var WU=require("react"),rU=WU.createContext(null),RU=rU;var R=require("react/jsx-runtime");function TU({uiConfig:U,setUiAjaxConfiguration:L}){let I=p.useContext(X),H=p.useContext(Y),z=N();if(z)console.log("[UILoading] Rendering fallback for:",U.card),console.log("[UILoading] Component data:",U.data),console.log("[UILoading] Component content:",U.content),console.log("[UILoading] Has setUiAjaxConfiguration:",!!L);let $=v(U.card);if(!$?.component){if(z)console.warn(`[UILoading] Component not found in registry: ${U.card}`),console.log("[UILoading] Returning fallback component");return I}if(z)console.log("[UILoading] Found component in registry:",{name:$.name,isLazy:$.isLazy,hasMetadata:!!$.metadata,hasFallback:!!$.fallback});if($.fallback){if(z)console.log("[UILoading] Rendering fallback for:",$.name);let Z=$.fallback;return R.jsx(Z,{})}if(z)console.log("[UILoading] No fallback, rendering full component:",$.name);let J=$.component,B=R.jsx(RU.Provider,{value:TU,children:R.jsx(J,{data:U.data,content:U.content,setUiAjaxConfiguration:L})});if($.isLazy)return R.jsx(D,{name:$.name,fallback:I,onError:H,children:B});return B}var EU=TU;var AU=require("react/jsx-runtime");function MU(U,L,I){if(!L)return I;let H=U.replace(/^\//,""),z=L[H];if(!z)return I;return AU.jsx(EU,{uiConfig:z})}var V=require("react/jsx-runtime"),eU=({location:U,fallback:L,piecache:I,onError:H,queryOptions:z,disableGlobalForm:$})=>{let J=h(),B=FU(),Z=N(),kU=G.useMemo(()=>jU.createAxiosDateTransformer({baseURL:J}),[J]),PU=G.useMemo(()=>LU(),[]),SU=G.useMemo(()=>J?JU(J):null,[J]),wU=G.useMemo(()=>J?BU(J,B):null,[J,B]),T=W({onError:H}),{data:Q,isLoading:n,error:F}=O.useQuery({queryKey:["uiConfig",U.pathname+U.search,T?.initData],enabled:!!T?.initData,queryFn:async()=>{let q=new URLSearchParams(U.search);if(q.set("__pieroot","telegram"),T?.initData)q.set("initData",T.initData);let i="/api/content"+U.pathname+"?"+q.toString();if(Z)console.log("[PieRoot] Fetching UI configuration from:",i);let a=await kU.get(i,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(Z)console.log("[PieRoot] Received UI configuration:",a.data);return a.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(q)=>Math.min(1000*2**q,30000),...z}),s=MU(U.pathname,I,L);if(!J)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(F&&Z)return console.error("[PieRoot] Error fetching UI configuration:",F),console.error("[PieRoot] Error details:",{message:F.message,status:F.response?.status,data:F.response?.data}),H?.(F),s;if(n||!Q){if(Z)console.log("[PieRoot] Loading state:",{isLoading:n,hasUiConfiguration:!!Q});return s}if(Z)console.log("[PieRoot] UI configuration loaded successfully:",Q),console.log("[PieRoot] Rendering UI with configuration");return V.jsx(IU.Provider,{value:PU,children:V.jsx(M.Provider,{value:SU,children:V.jsx(A.Provider,{value:wU,children:V.jsx(X.Provider,{value:L??V.jsx(V.Fragment,{}),children:V.jsx(YU,{children:V.jsx(DU,{children:$?V.jsx(o,{uiConfig:Q}):V.jsx("form",{id:"piedata_global_form",action:J+"api/process"+U.pathname,method:"post",encType:"multipart/form-data",children:V.jsx(o,{uiConfig:Q})})})})})})})})},UL=(U)=>{let L=G.useMemo(()=>new O.QueryClient,[]),I=U.queryClient??L;return V.jsx(_U.Provider,{value:U.onNavigate,children:V.jsx(l.Provider,{value:U.config,children:V.jsx(Y.Provider,{value:U.onError,children:V.jsx(O.QueryClientProvider,{client:I,children:V.jsx(eU,{...U})})})})})},fU=UL;
@@ -1 +1 @@
1
- {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/util/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAIhE;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EAClD,MAAM,EAAE,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,EACrC,IAAI,EAAE,MAAM,GACb,mBAAmB,CAAC,CAAC,CAAC,CASxB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GACzB,MAAM,MAAM,EACZ,SAAS,MAAM,OAAO,CAAC,GAAG,CAAC,iBAO9B,CAAA"}
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/util/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAwBhE;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EAClD,MAAM,EAAE,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,EACrC,IAAI,EAAE,MAAM,GACb,mBAAmB,CAAC,CAAC,CAAC,CAOxB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GACzB,MAAM,MAAM,EACZ,SAAS,MAAM,OAAO,CAAC,GAAG,CAAC,iBAK9B,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Optional callback invoked when a lazy card's chunk fails to load (after the
3
+ * boundary's own retries). Provided by a Pie*Root via its `onError` prop.
4
+ * Hosts typically use it to recover from a stale deploy (e.g. reload the page
5
+ * once so the fresh asset manifest is fetched). Default is `undefined` (no-op).
6
+ */
7
+ declare const LazyErrorContext: import("react").Context<((error: unknown) => void) | undefined>;
8
+ export default LazyErrorContext;
9
+ //# sourceMappingURL=lazyError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazyError.d.ts","sourceRoot":"","sources":["../../src/util/lazyError.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,mCAA0B,OAAO,KAAK,IAAI,cAE/D,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -58,4 +58,32 @@ export declare const getAllRegisteredComponents: () => string[];
58
58
  * Returns the number of components currently in the registry.
59
59
  */
60
60
  export declare const getRegistrySize: () => number;
61
+ /**
62
+ * Names of every registered code-split (lazy) component — those registered
63
+ * with a `loader`. Handy for driving a prefetch pass.
64
+ */
65
+ export declare const getLazyComponentNames: () => string[];
66
+ /**
67
+ * Warm a single lazy component's chunk by name, so a later render resolves
68
+ * synchronously (no Suspense fallback flash). No-op for unknown names or
69
+ * eager components. Shares the same module cache as the render-time
70
+ * `React.lazy`, so the import runs at most once.
71
+ *
72
+ * @returns The in-flight module promise, or `undefined` when there's nothing
73
+ * to preload.
74
+ */
75
+ export declare const preloadComponent: (name: string) => Promise<unknown> | undefined;
76
+ /**
77
+ * Background-warm every registered lazy chunk so the first navigation to each
78
+ * screen resolves its card from cache instead of waiting on the network.
79
+ * Idempotent (only the first call does anything). Browser-only and
80
+ * connection-aware: it yields to idle time, warms one chunk at a time so it
81
+ * never competes with what the user is waiting on, and skips entirely on
82
+ * metered / very slow connections. Errors are swallowed — a failed warm-up
83
+ * just means the chunk loads on demand later.
84
+ *
85
+ * Call this once after the first screen has settled (e.g. in an effect on the
86
+ * landing screen).
87
+ */
88
+ export declare const prefetchLazyComponents: () => void;
61
89
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/util/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,yCAAgD,CAAA;AAoCrE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EACvC,YAAY,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAC5C,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAInC;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACnC,YAAY,qBAAqB,CAAC,GAAG,CAAC,EAAE,SAG3C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,SAE/C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,YAExC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GACzB,MAAM,MAAM,KACb,iBAAiB,GAAG,SAEtB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GACzB,MAAM,MAAM,KACb,qBAAqB,CAAC,GAAG,CAAC,GAAG,SAE/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,QAAO,MAAM,EAEnD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,MAElC,CAAA"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/util/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,yCAAgD,CAAA;AAwCrE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EACvC,YAAY,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAC5C,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAInC;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACnC,YAAY,qBAAqB,CAAC,GAAG,CAAC,EAAE,SAG3C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,SAE/C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,YAExC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GACzB,MAAM,MAAM,KACb,iBAAiB,GAAG,SAEtB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GACzB,MAAM,MAAM,KACb,qBAAqB,CAAC,GAAG,CAAC,GAAG,SAE/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,QAAO,MAAM,EAEnD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,MAElC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAO,MAAM,EAGpB,CAAA;AAE3B;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC,GAAG,SAIlE,CAAA;AAID;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,QAAO,IAsCzC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarm.ing/pieui",
3
- "version": "2.0.33",
3
+ "version": "2.1.0",
4
4
  "description": "A React component library featuring PieCard component",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,6 +29,21 @@
29
29
  "require": "./dist/components/index.js",
30
30
  "types": "./dist/components/index.d.ts"
31
31
  },
32
+ "./agent": {
33
+ "import": "./dist/agent/index.esm.js",
34
+ "require": "./dist/agent/index.js",
35
+ "types": "./dist/agent/index.d.ts"
36
+ },
37
+ "./telegram": {
38
+ "import": "./dist/telegram/index.esm.js",
39
+ "require": "./dist/telegram/index.js",
40
+ "types": "./dist/telegram/index.d.ts"
41
+ },
42
+ "./max": {
43
+ "import": "./dist/max/index.esm.js",
44
+ "require": "./dist/max/index.js",
45
+ "types": "./dist/max/index.d.ts"
46
+ },
32
47
  "./storybook": {
33
48
  "import": "./dist/storybook/index.esm.js",
34
49
  "require": "./dist/storybook/index.js",
@@ -46,13 +61,19 @@
46
61
  }
47
62
  },
48
63
  "scripts": {
49
- "build": "rm -rf ./dist && rm -rf pieui-*.tgz && bun run build:clean && NODE_ENV=production bun run build:esm && NODE_ENV=production bun run build:cjs && NODE_ENV=production bun run build:components:esm && NODE_ENV=production bun run build:components:cjs && NODE_ENV=production bun run build:storybook:esm && NODE_ENV=production bun run build:storybook:cjs && NODE_ENV=production bun run build:storybook:addon:esm && NODE_ENV=production bun run build:storybook:addon:cjs && NODE_ENV=production bun run build:storybook:addon:preset && bun run build:banner && NODE_ENV=production bun run build:types && NODE_ENV=production bun run build:cli && bun src/cli.ts postbuild --src-dir src --out-dir dist && bun pm pack",
50
- "build:banner": "node -e \"const fs=require('fs');['dist/index.esm.js','dist/index.js','dist/components/index.esm.js','dist/components/index.js','dist/storybook/index.esm.js','dist/storybook/index.js','dist/storybook/addon/index.esm.js','dist/storybook/addon/index.js'].forEach(f=>{if(fs.existsSync(f)){fs.writeFileSync(f,'\\\"use client\\\";\\n'+fs.readFileSync(f,'utf8'))}})\"",
64
+ "build": "rm -rf ./dist && rm -rf pieui-*.tgz && bun run build:clean && NODE_ENV=production bun run build:esm && NODE_ENV=production bun run build:cjs && NODE_ENV=production bun run build:components:esm && NODE_ENV=production bun run build:components:cjs && NODE_ENV=production bun run build:agent:esm && NODE_ENV=production bun run build:agent:cjs && NODE_ENV=production bun run build:telegram:esm && NODE_ENV=production bun run build:telegram:cjs && NODE_ENV=production bun run build:max:esm && NODE_ENV=production bun run build:max:cjs && NODE_ENV=production bun run build:storybook:esm && NODE_ENV=production bun run build:storybook:cjs && NODE_ENV=production bun run build:storybook:addon:esm && NODE_ENV=production bun run build:storybook:addon:cjs && NODE_ENV=production bun run build:storybook:addon:preset && bun run build:banner && NODE_ENV=production bun run build:types && NODE_ENV=production bun run build:cli && bun src/cli.ts postbuild --src-dir src --out-dir dist && bun pm pack",
65
+ "build:banner": "node -e \"const fs=require('fs');['dist/index.esm.js','dist/index.js','dist/components/index.esm.js','dist/components/index.js','dist/agent/index.esm.js','dist/agent/index.js','dist/telegram/index.esm.js','dist/telegram/index.js','dist/max/index.esm.js','dist/max/index.js','dist/storybook/index.esm.js','dist/storybook/index.js','dist/storybook/addon/index.esm.js','dist/storybook/addon/index.js'].forEach(f=>{if(fs.existsSync(f)){fs.writeFileSync(f,'\\\"use client\\\";\\n'+fs.readFileSync(f,'utf8'))}})\"",
51
66
  "build:clean": "rm -rf dist",
52
67
  "build:esm": "bun build src/index.ts --outfile dist/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --minify --packages=external",
53
68
  "build:cjs": "bun build src/index.ts --outfile dist/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --minify --packages=external",
54
69
  "build:components:esm": "bun build src/components/index.ts --outfile dist/components/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --minify --packages=external",
55
70
  "build:components:cjs": "bun build src/components/index.ts --outfile dist/components/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --minify --packages=external",
71
+ "build:agent:esm": "bun build src/agent/index.ts --outfile dist/agent/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --minify --packages=external",
72
+ "build:agent:cjs": "bun build src/agent/index.ts --outfile dist/agent/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --minify --packages=external",
73
+ "build:telegram:esm": "bun build src/telegram/index.ts --outfile dist/telegram/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --minify --packages=external",
74
+ "build:telegram:cjs": "bun build src/telegram/index.ts --outfile dist/telegram/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --minify --packages=external",
75
+ "build:max:esm": "bun build src/max/index.ts --outfile dist/max/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --minify --packages=external",
76
+ "build:max:cjs": "bun build src/max/index.ts --outfile dist/max/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --minify --packages=external",
56
77
  "build:storybook:esm": "bun build src/storybook/index.tsx --outfile dist/storybook/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --minify --packages=external",
57
78
  "build:storybook:cjs": "bun build src/storybook/index.tsx --outfile dist/storybook/index.js --format cjs --target node --jsx=automatic --jsx-import-source=react --minify --packages=external",
58
79
  "build:storybook:addon:esm": "bun build src/storybook/addon/index.tsx --outfile dist/storybook/addon/index.esm.js --format esm --target browser --jsx=automatic --jsx-import-source=react --minify --packages=external",
@@ -102,9 +123,16 @@
102
123
  "license": "MIT",
103
124
  "peerDependencies": {
104
125
  "react": ">=19",
105
- "react-dom": ">=19"
126
+ "react-dom": ">=19",
127
+ "@openai/agents": "^0.4.5"
128
+ },
129
+ "peerDependenciesMeta": {
130
+ "@openai/agents": {
131
+ "optional": true
132
+ }
106
133
  },
107
134
  "devDependencies": {
135
+ "@openai/agents": "^0.4.5",
108
136
  "@testing-library/jest-dom": "^6.9.1",
109
137
  "@testing-library/react": "^16.3.2",
110
138
  "@types/bun": "latest",
@@ -124,22 +152,16 @@
124
152
  "typescript-json-schema": "^0.67.1"
125
153
  },
126
154
  "dependencies": {
127
- "@openai/agents": "^0.4.5",
128
155
  "@tanstack/react-query": "^5.90.20",
129
- "@telegram-apps/sdk": "^3.11.8",
130
- "annyang": "^2.6.1",
131
156
  "axios": "^1.15.0",
132
157
  "axios-date-transformer": "^1.2.1",
133
158
  "centrifuge": "^5.5.3",
134
159
  "clsx": "^2.1.1",
135
160
  "html-react-parser": "^5.2.16",
136
- "jszip": "^3.10.1",
137
161
  "mitt": "^3.0.1",
138
162
  "react-toastify": "^11.0.5",
139
163
  "socket.io-client": "^4.8.3",
140
164
  "tailwind-merge": "^3.4.0",
141
- "vm2": "^3.10.3",
142
- "zod": "^4.3.6",
143
- "zod-from-json-schema": "^0.5.2"
165
+ "vm2": "^3.10.3"
144
166
  }
145
167
  }