@swarm.ing/pieui 2.1.2 → 2.1.4
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/README.md +52 -0
- package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts +15 -0
- package/dist/components/Common/DeviceStorageCard/ui/DeviceStorageCard.d.ts.map +1 -1
- package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts +15 -0
- package/dist/components/Common/SessionStorageCard/ui/SessionStorageCard.d.ts.map +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/dist/max/index.esm.js +1 -1
- package/dist/max/index.js +1 -1
- package/dist/pieui.components.json +62 -62
- package/dist/storybook/addon/manager.esm.js +2 -0
- package/dist/storybook/addon/manager.js +2 -0
- package/dist/telegram/components/CloudStorageCard/index.d.ts.map +1 -0
- package/dist/telegram/components/CloudStorageCard/types/index.d.ts.map +1 -0
- package/dist/telegram/components/CloudStorageCard/ui/CloudStorageCard.d.ts +15 -0
- package/dist/telegram/components/CloudStorageCard/ui/CloudStorageCard.d.ts.map +1 -0
- package/dist/telegram/components/SecureStorageCard/index.d.ts.map +1 -0
- package/dist/telegram/components/SecureStorageCard/types/index.d.ts.map +1 -0
- package/dist/telegram/components/SecureStorageCard/ui/SecureStorageCard.d.ts +15 -0
- package/dist/telegram/components/SecureStorageCard/ui/SecureStorageCard.d.ts.map +1 -0
- package/dist/telegram/index.d.ts +4 -0
- package/dist/telegram/index.d.ts.map +1 -1
- package/dist/telegram/index.esm.js +1 -1
- package/dist/telegram/index.js +1 -1
- package/dist/util/ajaxCommonUtils.d.ts +60 -13
- package/dist/util/ajaxCommonUtils.d.ts.map +1 -1
- package/dist/util/centrifuge.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/components/Common/CloudStorageCard/index.d.ts.map +0 -1
- package/dist/components/Common/CloudStorageCard/types/index.d.ts.map +0 -1
- package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts +0 -4
- package/dist/components/Common/CloudStorageCard/ui/CloudStorageCard.d.ts.map +0 -1
- package/dist/components/Common/SecureStorageCard/index.d.ts.map +0 -1
- package/dist/components/Common/SecureStorageCard/types/index.d.ts.map +0 -1
- package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts +0 -4
- package/dist/components/Common/SecureStorageCard/ui/SecureStorageCard.d.ts.map +0 -1
- /package/dist/{components/Common → telegram/components}/CloudStorageCard/index.d.ts +0 -0
- /package/dist/{components/Common → telegram/components}/CloudStorageCard/types/index.d.ts +0 -0
- /package/dist/{components/Common → telegram/components}/SecureStorageCard/index.d.ts +0 -0
- /package/dist/{components/Common → telegram/components}/SecureStorageCard/types/index.d.ts +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useMemo as R}from"react";import{QueryClient as iU,QueryClientProvider as rU,useQuery as aU}from"@tanstack/react-query";import VU from"mitt";import{createContext as ZU,useCallback as NL,useContext as VL}from"react";var P=globalThis,N=(U,L)=>{let I=Symbol.for(U);if(!(I in P))P[I]=L();return P[I]};function v(){return N("@swarm.ing/pieui:mitt-emitter",()=>VU())}var BU=N("@swarm.ing/pieui:context:mitt",()=>ZU(null));var u=BU;import{io as FU}from"socket.io-client";import{createContext as XU}from"react";var c=N("@swarm.ing/pieui:socket-cache",()=>new Map),o=(U)=>{let L=c.get(U);if(L)return L;let I=FU(U,{autoConnect:!1,transports:["websocket"]});return c.set(U,I),I},YU=N("@swarm.ing/pieui:context:socket",()=>XU(null)),_=YU;import{createContext as DU}from"react";import{Centrifuge as h}from"centrifuge";var g=N("@swarm.ing/pieui:centrifuge-cache",()=>new Map),l=(U,L)=>{if(!L)return null;let I=`${U}::${L}`,J=g.get(I);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 h.UnauthorizedError("Backend is not answering");throw Error(`Unexpected status code ${H.status}`)}return(await H.json()).token}let $=new h(L,{getToken:z});return g.set(I,$),$},GU=N("@swarm.ing/pieui:context:centrifuge",()=>DU(null)),q=GU;import{useContext as qU,useEffect as KU}from"react";import{useEffect as OU,useState as QU}from"react";var K=new Map,W=new Map;function E(U,L){let I=`${U}::${L}`,J=U?K.get(I):void 0,[z,$]=QU(J??null);return OU(()=>{if(!U)return;if(K.has(I)){$(K.get(I));return}let H=W.get(I);if(!H)H=fetch(U+`api/support/${L}`,{method:"GET"}).then((V)=>V.json()).then((V)=>{return K.set(I,V),W.delete(I),V}).catch((V)=>{throw W.delete(I),V}),W.set(I,H);let B=!1;return H.then((V)=>{if(!B)$(V)}).catch(()=>{}),()=>{B=!0}},[U,L,I]),z}import{createContext as RU,useContext as TU}from"react";var w=N("@swarm.ing/pieui:context:pieConfig",()=>RU(null)),M=()=>{let U=TU(w);if(!U)throw Error("usePieConfig must be used within PieConfigProvider");return U},y=()=>{let{apiServer:U}=M();return U},f=y,p=()=>{let{centrifugeServer:U}=M();return U};var X=()=>{let{enableRenderingLog:U}=M();return U};var n=()=>{let{pageProcessor:U}=M();return U};var _U=N("@swarm.ing/pieui:sid-state",()=>({promise:null,resolve:null}));function s(){_U.resolve?.()}var WU=({children:U})=>{let L=qU(_),I=f(),J=E(I,"socketIO"),z=($)=>{if(typeof window<"u")window.sid=$.sid,s(),console.log(`SocketIO initialized: ${window.sid}`)};return KU(()=>{if(!L)return;let $=()=>{console.log("SocketIO connected")},H=(B)=>{console.log(`SocketIO disconnected: ${B}`),L.connect()};if(J)L.on("pieinit",z),L.on("connect",$),L.on("disconnect",H),L.connect();return()=>{if(J)L.off("pieinit",z),L.off("connect",$),L.off("disconnect",H),L.disconnect()}},[L,J]),U},i=WU;import{useContext as EU,useEffect as MU}from"react";var fU=({children:U})=>{let L=EU(q),I=f(),J=E(I,"centrifuge");return MU(()=>{if(!L)return;let z=()=>{console.log("Centrifuge connected")},$=(H)=>{console.log("Centrifuge disconnected:",H)};if(J)L.on("connected",z),L.on("disconnected",$),L.connect();return()=>{if(J)L.disconnect()}},[L,J]),U},r=fU;import{createContext as AU}from"react";import{jsx as PU,Fragment as kU}from"react/jsx-runtime";var jU=N("@swarm.ing/pieui:context:fallback",()=>AU(PU(kU,{}))),Y=jU;import{createContext as wU}from"react";var yU=N("@swarm.ing/pieui:context:lazyError",()=>wU(void 0)),D=yU;var mU=N("@swarm.ing/pieui:component-registry",()=>new Map);var A=(U)=>{return mU.get(U)};import{useContext as a,memo as vU}from"react";import{Component as CU,Suspense as xU}from"react";import{jsx as SU}from"react/jsx-runtime";var bU=2,dU=400;class G extends CU{state={failed:!1,attempt:0};timer;static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(U){if(this.props.onError?.(U),this.state.attempt<bU){let L=dU*(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 SU(xU,{fallback:this.props.fallback,children:this.props.children},`${this.props.name}:${this.state.attempt}`)}}import{jsx as m}from"react/jsx-runtime";function uU({uiConfig:U,setUiAjaxConfiguration:L}){let I=a(Y),J=a(D),z=X();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 $=A(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 H=$.component,B=m(H,{data:U.data,content:U.content,setUiAjaxConfiguration:L});if($.isLazy){if(z)console.log("[UI] Rendering lazy component with Suspense:",$.name);return m(G,{name:$.name,fallback:$.fallback?m($.fallback,{}):I,onError:J,children:B})}if(z)console.log("[UI] Rendering component directly:",$.name);return B}var C=vU(uU);import{createAxiosDateTransformer as tU}from"axios-date-transformer";import{useEffect as cU,useState as oU}from"react";var j=({onError:U}={})=>{let[L,I]=oU(null),J=n();return cU(()=>{if(typeof window>"u")return;let z=window.Telegram?.WebApp;if(!z)return;try{z.ready?.()}catch($){U?.()}if(J==="telegram_expanded"&&(z.platform==="ios"||z.platform==="android"))z.expand();I(z)},[]),L},hU=()=>{let U=j();return[U?.initDataUnsafe,U?.initData]};import{createContext as gU}from"react";var lU=N("@swarm.ing/pieui:context:navigate",()=>gU(void 0)),t=lU;import{useContext as UU}from"react";import{createContext as pU}from"react";var nU=N("@swarm.ing/pieui:context:uiRenderer",()=>pU(null)),e=nU;import{jsx as k}from"react/jsx-runtime";function LU({uiConfig:U,setUiAjaxConfiguration:L}){let I=UU(Y),J=UU(D),z=X();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 $=A(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 V=$.fallback;return k(V,{})}if(z)console.log("[UILoading] No fallback, rendering full component:",$.name);let H=$.component,B=k(e.Provider,{value:LU,children:k(H,{data:U.data,content:U.content,setUiAjaxConfiguration:L})});if($.isLazy)return k(G,{name:$.name,fallback:I,onError:J,children:B});return B}var IU=LU;import{jsx as sU}from"react/jsx-runtime";function $U(U,L,I){if(!L)return I;let J=U.replace(/^\//,""),z=L[J];if(!z)return I;return sU(IU,{uiConfig:z})}import{jsx as Z,Fragment as LL}from"react/jsx-runtime";var eU=({location:U,fallback:L,piecache:I,onError:J,queryOptions:z,disableGlobalForm:$})=>{let H=y(),B=p(),V=X(),zU=R(()=>tU({baseURL:H}),[H]),HU=R(()=>v(),[]),JU=R(()=>H?o(H):null,[H]),NU=R(()=>H?l(H,B):null,[H,B]),T=j({onError:J}),{data:O,isLoading:x,error:F}=aU({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 d="/api/content"+U.pathname+"?"+Q.toString();if(V)console.log("[PieRoot] Fetching UI configuration from:",d);let S=await zU.get(d,{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:",S.data);return S.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(Q)=>Math.min(1000*2**Q,30000),...z}),b=$U(U.pathname,I,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),b;if(x||!O){if(V)console.log("[PieRoot] Loading state:",{isLoading:x,hasUiConfiguration:!!O});return b}if(V)console.log("[PieRoot] UI configuration loaded successfully:",O),console.log("[PieRoot] Rendering UI with configuration");return Z(u.Provider,{value:HU,children:Z(_.Provider,{value:JU,children:Z(q.Provider,{value:NU,children:Z(Y.Provider,{value:L??Z(LL,{}),children:Z(i,{children:Z(r,{children:$?Z(C,{uiConfig:O}):Z("form",{id:"piedata_global_form",action:H+"api/process"+U.pathname,method:"post",encType:"multipart/form-data",children:Z(C,{uiConfig:O})})})})})})})})},UL=(U)=>{let L=R(()=>new iU,[]),I=U.queryClient??L;return Z(t.Provider,{value:U.onNavigate,children:Z(w.Provider,{value:U.config,children:Z(D.Provider,{value:U.onError,children:Z(rU,{client:I,children:Z(eU,{...U})})})})})},IL=UL;export{j as useWebApp,hU as useInitData,IL as PieTelegramRoot};
|
|
2
|
+
import{useMemo as w}from"react";import{QueryClient as F$,QueryClientProvider as G$,useQuery as Q$}from"@tanstack/react-query";import RU from"mitt";import{createContext as MU,useCallback as b$,useContext as v$}from"react";var h=globalThis,F=(U,$)=>{let H=Symbol.for(U);if(!(H in h))h[H]=$();return h[H]};function i(){return F("@swarm.ing/pieui:mitt-emitter",()=>RU())}var AU=F("@swarm.ing/pieui:context:mitt",()=>MU(null));var k=AU;import{io as EU}from"socket.io-client";import{createContext as NU}from"react";var r=F("@swarm.ing/pieui:socket-cache",()=>new Map),a=(U)=>{let $=r.get(U);if($)return $;let H=EU(U,{autoConnect:!1,transports:["websocket"]});return r.set(U,H),H},PU=F("@swarm.ing/pieui:context:socket",()=>NU(null)),M=PU;import{createContext as jU}from"react";import{Centrifuge as t}from"centrifuge";var e=F("@swarm.ing/pieui:centrifuge-cache",()=>new Map),UU=(U,$)=>{if(!$)return null;let H=`${U}::${$}`,B=e.get(H);if(B)return B;async function J(){let Z=await fetch(U+"api/centrifuge/gen_token",{credentials:"include"});if(!Z.ok){if(Z.status===401||Z.status===403)throw new t.UnauthorizedError("Backend is not answering");throw Error(`Unexpected status code ${Z.status}`)}return(await Z.json()).token}let I=new t($,{getToken:J});return e.set(H,I),I},wU=F("@swarm.ing/pieui:context:centrifuge",()=>jU(null)),A=wU;import{useContext as vU,useEffect as CU}from"react";import{useEffect as kU,useState as xU}from"react";var x=new Map,f=new Map;function y(U,$){let H=`${U}::${$}`,B=U?x.get(H):void 0,[J,I]=xU(B??null);return kU(()=>{if(!U)return;if(x.has(H)){I(x.get(H));return}let Z=f.get(H);if(!Z)Z=fetch(U+`api/support/${$}`,{method:"GET"}).then((Y)=>Y.json()).then((Y)=>{return x.set(H,Y),f.delete(H),Y}).catch((Y)=>{throw f.delete(H),Y}),f.set(H,Z);let D=!1;return Z.then((Y)=>{if(!D)I(Y)}).catch(()=>{}),()=>{D=!0}},[U,$,H]),J}import{createContext as fU,useContext as yU}from"react";var l=F("@swarm.ing/pieui:context:pieConfig",()=>fU(null)),b=()=>{let U=yU(l);if(!U)throw Error("usePieConfig must be used within PieConfigProvider");return U},p=()=>{let{apiServer:U}=b();return U},v=p,$U=()=>{let{centrifugeServer:U}=b();return U};var R=()=>{let{enableRenderingLog:U}=b();return U},HU=R,IU=()=>{let{pageProcessor:U}=b();return U};var bU=F("@swarm.ing/pieui:sid-state",()=>({promise:null,resolve:null}));function JU(){bU.resolve?.()}var SU=({children:U})=>{let $=vU(M),H=v(),B=y(H,"socketIO"),J=(I)=>{if(typeof window<"u")window.sid=I.sid,JU(),console.log(`SocketIO initialized: ${window.sid}`)};return CU(()=>{if(!$)return;let I=()=>{console.log("SocketIO connected")},Z=(D)=>{console.log(`SocketIO disconnected: ${D}`),$.connect()};if(B)$.on("pieinit",J),$.on("connect",I),$.on("disconnect",Z),$.connect();return()=>{if(B)$.off("pieinit",J),$.off("connect",I),$.off("disconnect",Z),$.disconnect()}},[$,B]),U},ZU=SU;import{useContext as mU,useEffect as gU}from"react";var cU=({children:U})=>{let $=mU(A),H=v(),B=y(H,"centrifuge");return gU(()=>{if(!$)return;let J=()=>{console.log("Centrifuge connected")},I=(Z)=>{console.log("Centrifuge disconnected:",Z)};if(B)$.on("connected",J),$.on("disconnected",I),$.connect();return()=>{if(B)$.disconnect()}},[$,B]),U},BU=cU;import{createContext as hU}from"react";import{jsx as dU,Fragment as pU}from"react/jsx-runtime";var lU=F("@swarm.ing/pieui:context:fallback",()=>hU(dU(pU,{}))),E=lU;import{createContext as uU}from"react";var oU=F("@swarm.ing/pieui:context:lazyError",()=>uU(void 0)),N=oU;import{lazy as nU}from"react";var j=new Map;function sU(U,$){return $.catch(()=>{if(j.get(U)===$)j.delete(U)}),j.set(U,$),$}function XU(U,$){return nU(()=>{if(j.has($))return j.get($);return sU($,U().then((H)=>H))})}var YU=F("@swarm.ing/pieui:component-registry",()=>new Map),iU=(U)=>{if(!U.name)throw Error("Component registration requires a name");if(!U.component&&!U.loader)throw Error(`Component "${U.name}" requires component or loader`);let $={name:U.name,component:U.component,loader:U.loader,metadata:U.metadata,fallback:U.fallback,isLazy:!1};if(!$.component&&$.loader)$.component=XU($.loader,U.name),$.isLazy=!0;return $};function C(U){let $=iU(U);return YU.set($.name,$),$.component}var S=(U)=>{return YU.get(U)};import{useContext as zU,memo as $$}from"react";import{Component as rU,Suspense as aU}from"react";import{jsx as U$}from"react/jsx-runtime";var tU=2,eU=400;class P extends rU{state={failed:!1,attempt:0};timer;static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(U){if(this.props.onError?.(U),this.state.attempt<tU){let $=eU*(this.state.attempt+1);this.timer=setTimeout(()=>{this.setState((H)=>({failed:!1,attempt:H.attempt+1}))},$)}}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 U$(aU,{fallback:this.props.fallback,children:this.props.children},`${this.props.name}:${this.state.attempt}`)}}import{jsx as d}from"react/jsx-runtime";function H$({uiConfig:U,setUiAjaxConfiguration:$}){let H=zU(E),B=zU(N),J=R();if(J)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:",!!$);let I=S(U.card);if(!I?.component){if(J)console.warn(`[UI] Component not found in registry: ${U.card}`),console.log("[UI] Returning fallback component");return H}if(J)console.log("[UI] Found component in registry:",{name:I.name,isLazy:I.isLazy,hasMetadata:!!I.metadata});let Z=I.component,D=d(Z,{data:U.data,content:U.content,setUiAjaxConfiguration:$});if(I.isLazy){if(J)console.log("[UI] Rendering lazy component with Suspense:",I.name);return d(P,{name:I.name,fallback:I.fallback?d(I.fallback,{}):H,onError:B,children:D})}if(J)console.log("[UI] Rendering component directly:",I.name);return D}var u=$$(H$);import{createAxiosDateTransformer as T$}from"axios-date-transformer";import{useEffect as I$,useState as J$}from"react";var m=({onError:U}={})=>{let[$,H]=J$(null),B=IU();return I$(()=>{if(typeof window>"u")return;let J=window.Telegram?.WebApp;if(!J)return;try{J.ready?.()}catch(I){U?.()}if(B==="telegram_expanded"&&(J.platform==="ios"||J.platform==="android"))J.expand();H(J)},[]),$},Z$=()=>{let U=m();return[U?.initDataUnsafe,U?.initData]};import{createContext as B$}from"react";var X$=F("@swarm.ing/pieui:context:navigate",()=>B$(void 0)),DU=X$;import{useContext as GU}from"react";import{createContext as Y$}from"react";var z$=F("@swarm.ing/pieui:context:uiRenderer",()=>Y$(null)),FU=z$;import{jsx as g}from"react/jsx-runtime";function QU({uiConfig:U,setUiAjaxConfiguration:$}){let H=GU(E),B=GU(N),J=R();if(J)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:",!!$);let I=S(U.card);if(!I?.component){if(J)console.warn(`[UILoading] Component not found in registry: ${U.card}`),console.log("[UILoading] Returning fallback component");return H}if(J)console.log("[UILoading] Found component in registry:",{name:I.name,isLazy:I.isLazy,hasMetadata:!!I.metadata,hasFallback:!!I.fallback});if(I.fallback){if(J)console.log("[UILoading] Rendering fallback for:",I.name);let Y=I.fallback;return g(Y,{})}if(J)console.log("[UILoading] No fallback, rendering full component:",I.name);let Z=I.component,D=g(FU.Provider,{value:QU,children:g(Z,{data:U.data,content:U.content,setUiAjaxConfiguration:$})});if(I.isLazy)return g(P,{name:I.name,fallback:H,onError:B,children:D});return D}var TU=QU;import{jsx as D$}from"react/jsx-runtime";function qU(U,$,H){if(!$)return H;let B=U.replace(/^\//,""),J=$[B];if(!J)return H;return D$(TU,{uiConfig:J})}import{jsx as q,Fragment as K$}from"react/jsx-runtime";var q$=({location:U,fallback:$,piecache:H,onError:B,queryOptions:J,disableGlobalForm:I})=>{let Z=p(),D=$U(),Y=R(),G=w(()=>T$({baseURL:Z}),[Z]),X=w(()=>i(),[]),W=w(()=>Z?a(Z):null,[Z]),V=w(()=>Z?UU(Z,D):null,[Z,D]),L=m({onError:B}),{data:K,isLoading:O,error:z}=Q$({queryKey:["uiConfig",U.pathname+U.search,L?.initData],enabled:!!L?.initData,queryFn:async()=>{let T=new URLSearchParams(U.search);if(T.set("__pieroot","telegram"),L?.initData)T.set("initData",L.initData);let _="/api/content"+U.pathname+"?"+T.toString();if(Y)console.log("[PieRoot] Fetching UI configuration from:",_);let s=await G.get(_,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(Y)console.log("[PieRoot] Received UI configuration:",s.data);return s.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(T)=>Math.min(1000*2**T,30000),...J}),Q=qU(U.pathname,H,$);if(!Z)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(z&&Y)return console.error("[PieRoot] Error fetching UI configuration:",z),console.error("[PieRoot] Error details:",{message:z.message,status:z.response?.status,data:z.response?.data}),B?.(z),Q;if(O||!K){if(Y)console.log("[PieRoot] Loading state:",{isLoading:O,hasUiConfiguration:!!K});return Q}if(Y)console.log("[PieRoot] UI configuration loaded successfully:",K),console.log("[PieRoot] Rendering UI with configuration");return q(k.Provider,{value:X,children:q(M.Provider,{value:W,children:q(A.Provider,{value:V,children:q(E.Provider,{value:$??q(K$,{}),children:q(ZU,{children:q(BU,{children:I?q(u,{uiConfig:K}):q("form",{id:"piedata_global_form",action:Z+"api/process"+U.pathname,method:"post",encType:"multipart/form-data",children:q(u,{uiConfig:K})})})})})})})})},L$=(U)=>{let $=w(()=>new F$,[]),H=U.queryClient??$;return q(DU.Provider,{value:U.onNavigate,children:q(l.Provider,{value:U.config,children:q(N.Provider,{value:U.onError,children:q(G$,{client:H,children:q(q$,{...U})})})})})},O$=L$;import{useEffect as LU,useState as A$}from"react";import{useContext as o,useEffect as n,useRef as _$}from"react";import{jsx as R$,jsxs as M$,Fragment as V$}from"react/jsx-runtime";var W$=({card:U,data:$,children:H,useSocketioSupport:B=!1,useCentrifugeSupport:J=!1,useMittSupport:I=!1,centrifugeChannel:Z=void 0,methods:D=void 0,stored:Y=void 0})=>{let G=HU(),X=_$(D);if(X.current=D,G)console.log("[PieCard] Rendering card:",U),console.log("[PieCard] Card data:",$),console.log("[PieCard] Component name:",$?.name),console.log("[PieCard] Real-time support:",{socketio:B,centrifuge:J,mitt:I,centrifugeChannel:Z}),console.log("[PieCard] Methods:",D?Object.keys(D):"none"),console.log("[PieCard] Has children:",!!H);let W=o(M),V=o(A),L=o(k);if(n(()=>{if(!W||!B||!X.current||!$.name){if(G&&B)console.log("[PieCard] Socket.IO setup skipped:",{hasSocket:!!W,useSocketioSupport:B,hasMethods:!!X.current,hasDataName:!!$?.name});return}let O=Object.keys(X.current??{}).map((z)=>{let Q=`pie${z}_${$.name}`;if(G)console.log(`[PieCard] Socket.IO registering event: ${Q}`);let T=(_)=>{X.current?.[z]?.(_)};return W.on(Q,T),[Q,T]});return()=>{O.forEach(([z,Q])=>{if(G)console.log(`[PieCard] Socket.IO unregistering event: ${z}`);W.off(z,Q)})}},[W,$.name,B]),n(()=>{if(!V||!J||!Z||!$.name){if(G&&J)console.log("[PieCard] Centrifuge setup skipped:",{hasCentrifuge:!!V,useCentrifugeSupport:J,hasCentrifugeChannel:!!Z,hasMethods:!!X.current,hasDataName:!!$?.name});return}let O=Object.keys(X.current??{}).map((z)=>{let Q=`pie${z}_${$.name}_${Z}`;if(G)console.log(`[PieCard] Centrifuge subscribing to channel: ${Q}`);let T=V.newSubscription(Q);return T.on("publication",(_)=>{if(G)console.log(`[PieCard] Centrifuge received data on ${Q}:`,_.data);X.current?.[z]?.(_.data)}),T.subscribe(),T});return()=>{O.forEach((z)=>{if(G)console.log("[PieCard] Centrifuge unsubscribing from channel");z.unsubscribe(),V.removeSubscription(z)})}},[V,Z,$.name,J]),n(()=>{if(!L||!I||!$.name){if(G&&I)console.log("[PieCard] Mitt setup skipped:",{hasMitt:!!L,useMittSupport:I,hasMethods:!!X.current,hasDataName:!!$?.name});return}let K=Object.keys(X.current??{}),O={};return K.forEach((z)=>{let Q=`pie${z}_${$.name}`,T=(_)=>{if(G)console.log(`[PieCard] Mitt registering event: ${Q}`);X.current?.[z]?.(_)};O[Q]=T,L.on(Q,T)}),()=>{Object.entries(O).forEach(([z,Q])=>{if(G)console.log(`[PieCard] Mitt unregistering event: ${z}`);L.off(z,Q)})}},[L,$.name,I]),G)console.log("[PieCard] Rendering complete, returning children");if(Y!==void 0)return M$(V$,{children:[R$("input",{type:"hidden",name:$.name,value:JSON.stringify(Y)}),H]});return H},c=W$;import{jsx as KU}from"react/jsx-runtime";var E$=({data:U})=>{let{name:$,key:H,value:B,useSocketioSupport:J,useCentrifugeSupport:I,useMittSupport:Z,centrifugeChannel:D}=U,[Y,G]=A$(B);return LU(()=>{G(B)},[B]),LU(()=>{if(typeof window>"u")return;let X=window.Telegram?.WebApp?.CloudStorage;if(!X)return;X.setItem(H,Y)},[H,Y]),KU(c,{card:"CloudStorageCard",data:U,useSocketioSupport:J,useCentrifugeSupport:I,useMittSupport:Z,centrifugeChannel:D,methods:{update:({value:X})=>{G(X)},remove:()=>{let X=window.Telegram?.WebApp?.CloudStorage;if(X)X.removeItem(H);G("")}},children:KU("input",{type:"hidden",id:$,name:$,value:Y})})},OU=E$;var N$=C({name:"CloudStorageCard",component:OU,metadata:{author:"PieData"}});import{useEffect as _U,useState as P$}from"react";import{jsx as WU}from"react/jsx-runtime";var j$=({data:U})=>{let{name:$,key:H,value:B,useSocketioSupport:J,useCentrifugeSupport:I,useMittSupport:Z,centrifugeChannel:D}=U,[Y,G]=P$(B);return _U(()=>{G(B)},[B]),_U(()=>{if(typeof window>"u")return;let X=window.Telegram?.WebApp?.SecureStorage;if(!X)return;X.setItem(H,Y)},[H,Y]),WU(c,{card:"SecureStorageCard",data:U,useSocketioSupport:J,useCentrifugeSupport:I,useMittSupport:Z,centrifugeChannel:D,methods:{update:({value:X})=>{G(X)},remove:()=>{let X=window.Telegram?.WebApp?.SecureStorage;if(X)X.removeItem(H);G("")}},children:WU("input",{type:"hidden",id:$,name:$,value:Y})})},VU=j$;var w$=C({name:"SecureStorageCard",component:VU,metadata:{author:"PieData"}});export{m as useWebApp,Z$ as useInitData,w$ as SecureStorageCard,O$ as PieTelegramRoot,N$ as CloudStorageCard};
|
package/dist/telegram/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var CU=Object.create;var{getPrototypeOf:xU,defineProperty:_,getOwnPropertyNames:e,getOwnPropertyDescriptor:bU}=Object,UU=Object.prototype.hasOwnProperty;var dU=(U,L,I)=>{I=U!=null?CU(xU(U)):{};let H=L||!U||!U.__esModule?_(I,"default",{value:U,enumerable:!0}):I;for(let z of e(U))if(!UU.call(H,z))_(H,z,{get:()=>U[z],enumerable:!0});return H},t=new WeakMap,SU=(U)=>{var L=t.get(U),I;if(L)return L;if(L=_({},"__esModule",{value:!0}),U&&typeof U==="object"||typeof U==="function")e(U).map((H)=>!UU.call(L,H)&&_(L,H,{get:()=>U[H],enumerable:!(I=bU(U,H))||I.enumerable}));return t.set(U,L),L};var vU=(U,L)=>{for(var I in L)_(U,I,{get:L[I],enumerable:!0,configurable:!0,set:(H)=>L[I]=()=>H})};var IL={};vU(IL,{useWebApp:()=>K,useInitData:()=>TU,PieTelegramRoot:()=>kU});module.exports=SU(IL);var O=require("react"),Q=require("@tanstack/react-query");var LU=dU(require("mitt")),M=require("react");var o=globalThis,N=(U,L)=>{let I=Symbol.for(U);if(!(I in o))o[I]=L();return o[I]};function IU(){return N("@swarm.ing/pieui:mitt-emitter",()=>LU.default())}var uU=N("@swarm.ing/pieui:context:mitt",()=>M.createContext(null));var $U=uU;var HU=require("socket.io-client"),JU=require("react");var zU=N("@swarm.ing/pieui:socket-cache",()=>new Map),NU=(U)=>{let L=zU.get(U);if(L)return L;let I=HU.io(U,{autoConnect:!1,transports:["websocket"]});return zU.set(U,I),I},cU=N("@swarm.ing/pieui:context:socket",()=>JU.createContext(null)),f=cU;var ZU=require("react"),h=require("centrifuge");var VU=N("@swarm.ing/pieui:centrifuge-cache",()=>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 h.Centrifuge.UnauthorizedError("Backend is not answering");throw Error(`Unexpected status code ${J.status}`)}return(await J.json()).token}let $=new h.Centrifuge(L,{getToken:z});return VU.set(I,$),$},oU=N("@swarm.ing/pieui:context:centrifuge",()=>ZU.createContext(null)),A=oU;var x=require("react");var P=require("react"),j=new Map,k=new Map;function w(U,L){let I=`${U}::${L}`,H=U?j.get(I):void 0,[z,$]=P.useState(H??null);return P.useEffect(()=>{if(!U)return;if(j.has(I)){$(j.get(I));return}let J=k.get(I);if(!J)J=fetch(U+`api/support/${L}`,{method:"GET"}).then((Z)=>Z.json()).then((Z)=>{return j.set(I,Z),k.delete(I),Z}).catch((Z)=>{throw k.delete(I),Z}),k.set(I,J);let B=!1;return J.then((Z)=>{if(!B)$(Z)}).catch(()=>{}),()=>{B=!0}},[U,L,I]),z}var y=require("react");var g=N("@swarm.ing/pieui:context:pieConfig",()=>y.createContext(null)),m=()=>{let U=y.useContext(g);if(!U)throw Error("usePieConfig must be used within PieConfigProvider");return U},l=()=>{let{apiServer:U}=m();return U},C=l,FU=()=>{let{centrifugeServer:U}=m();return U};var X=()=>{let{enableRenderingLog:U}=m();return U};var XU=()=>{let{pageProcessor:U}=m();return U};var hU=N("@swarm.ing/pieui:sid-state",()=>({promise:null,resolve:null}));function YU(){hU.resolve?.()}var gU=({children:U})=>{let L=x.useContext(f),I=C(),H=w(I,"socketIO"),z=($)=>{if(typeof window<"u")window.sid=$.sid,YU(),console.log(`SocketIO initialized: ${window.sid}`)};return x.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},DU=gU;var b=require("react");var lU=({children:U})=>{let L=b.useContext(A),I=C(),H=w(I,"centrifuge");return b.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},GU=lU;var OU=require("react");var d=require("react/jsx-runtime"),pU=N("@swarm.ing/pieui:context:fallback",()=>OU.createContext(d.jsx(d.Fragment,{}))),Y=pU;var QU=require("react");var nU=N("@swarm.ing/pieui:context:lazyError",()=>QU.createContext(void 0)),D=nU;var sU=N("@swarm.ing/pieui:component-registry",()=>new Map);var S=(U)=>{return sU.get(U)};var q=require("react");var v=require("react"),RU=require("react/jsx-runtime"),iU=2,rU=400;class G extends v.Component{state={failed:!1,attempt:0};timer;static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(U){if(this.props.onError?.(U),this.state.attempt<iU){let L=rU*(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 RU.jsx(v.Suspense,{fallback:this.props.fallback,children:this.props.children},`${this.props.name}:${this.state.attempt}`)}}var u=require("react/jsx-runtime");function aU({uiConfig:U,setUiAjaxConfiguration:L}){let I=q.useContext(Y),H=q.useContext(D),z=X();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 $=S(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=u.jsx(J,{data:U.data,content:U.content,setUiAjaxConfiguration:L});if($.isLazy){if(z)console.log("[UI] Rendering lazy component with Suspense:",$.name);return u.jsx(G,{name:$.name,fallback:$.fallback?u.jsx($.fallback,{}):I,onError:H,children:B})}if(z)console.log("[UI] Rendering component directly:",$.name);return B}var p=q.memo(aU);var jU=require("axios-date-transformer");var c=require("react");var K=({onError:U}={})=>{let[L,I]=c.useState(null),H=XU();return c.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},TU=()=>{let U=K();return[U?.initDataUnsafe,U?.initData]};var _U=require("react");var tU=N("@swarm.ing/pieui:context:navigate",()=>_U.createContext(void 0)),qU=tU;var n=require("react");var KU=require("react");var eU=N("@swarm.ing/pieui:context:uiRenderer",()=>KU.createContext(null)),WU=eU;var W=require("react/jsx-runtime");function EU({uiConfig:U,setUiAjaxConfiguration:L}){let I=n.useContext(Y),H=n.useContext(D),z=X();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 $=S(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 W.jsx(Z,{})}if(z)console.log("[UILoading] No fallback, rendering full component:",$.name);let J=$.component,B=W.jsx(WU.Provider,{value:EU,children:W.jsx(J,{data:U.data,content:U.content,setUiAjaxConfiguration:L})});if($.isLazy)return W.jsx(G,{name:$.name,fallback:I,onError:H,children:B});return B}var MU=EU;var AU=require("react/jsx-runtime");function fU(U,L,I){if(!L)return I;let H=U.replace(/^\//,""),z=L[H];if(!z)return I;return AU.jsx(MU,{uiConfig:z})}var V=require("react/jsx-runtime"),UL=({location:U,fallback:L,piecache:I,onError:H,queryOptions:z,disableGlobalForm:$})=>{let J=l(),B=FU(),Z=X(),PU=O.useMemo(()=>jU.createAxiosDateTransformer({baseURL:J}),[J]),wU=O.useMemo(()=>IU(),[]),yU=O.useMemo(()=>J?NU(J):null,[J]),mU=O.useMemo(()=>J?BU(J,B):null,[J,B]),E=K({onError:H}),{data:R,isLoading:s,error:F}=Q.useQuery({queryKey:["uiConfig",U.pathname+U.search,E?.initData],enabled:!!E?.initData,queryFn:async()=>{let T=new URLSearchParams(U.search);if(T.set("__pieroot","telegram"),E?.initData)T.set("initData",E.initData);let r="/api/content"+U.pathname+"?"+T.toString();if(Z)console.log("[PieRoot] Fetching UI configuration from:",r);let a=await PU.get(r,{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:(T)=>Math.min(1000*2**T,30000),...z}),i=fU(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),i;if(s||!R){if(Z)console.log("[PieRoot] Loading state:",{isLoading:s,hasUiConfiguration:!!R});return i}if(Z)console.log("[PieRoot] UI configuration loaded successfully:",R),console.log("[PieRoot] Rendering UI with configuration");return V.jsx($U.Provider,{value:wU,children:V.jsx(f.Provider,{value:yU,children:V.jsx(A.Provider,{value:mU,children:V.jsx(Y.Provider,{value:L??V.jsx(V.Fragment,{}),children:V.jsx(DU,{children:V.jsx(GU,{children:$?V.jsx(p,{uiConfig:R}):V.jsx("form",{id:"piedata_global_form",action:J+"api/process"+U.pathname,method:"post",encType:"multipart/form-data",children:V.jsx(p,{uiConfig:R})})})})})})})})},LL=(U)=>{let L=O.useMemo(()=>new Q.QueryClient,[]),I=U.queryClient??L;return V.jsx(qU.Provider,{value:U.onNavigate,children:V.jsx(g.Provider,{value:U.config,children:V.jsx(D.Provider,{value:U.onError,children:V.jsx(Q.QueryClientProvider,{client:I,children:V.jsx(UL,{...U})})})})})},kU=LL;
|
|
2
|
+
var aU=Object.create;var{getPrototypeOf:tU,defineProperty:f,getOwnPropertyNames:QU,getOwnPropertyDescriptor:eU}=Object,TU=Object.prototype.hasOwnProperty;var U$=(U,$,H)=>{H=U!=null?aU(tU(U)):{};let J=$||!U||!U.__esModule?f(H,"default",{value:U,enumerable:!0}):H;for(let Z of QU(U))if(!TU.call(J,Z))f(J,Z,{get:()=>U[Z],enumerable:!0});return J},GU=new WeakMap,$$=(U)=>{var $=GU.get(U),H;if($)return $;if($=f({},"__esModule",{value:!0}),U&&typeof U==="object"||typeof U==="function")QU(U).map((J)=>!TU.call($,J)&&f($,J,{get:()=>U[J],enumerable:!(H=eU(U,J))||H.enumerable}));return GU.set(U,$),$};var H$=(U,$)=>{for(var H in $)f(U,H,{get:$[H],enumerable:!0,configurable:!0,set:(J)=>$[H]=()=>J})};var M$={};H$(M$,{useWebApp:()=>v,useInitData:()=>CU,SecureStorageCard:()=>rU,PieTelegramRoot:()=>oU,CloudStorageCard:()=>sU});module.exports=$$(M$);var w=require("react"),k=require("@tanstack/react-query");var qU=U$(require("mitt")),g=require("react");var IU=globalThis,F=(U,$)=>{let H=Symbol.for(U);if(!(H in IU))IU[H]=$();return IU[H]};function LU(){return F("@swarm.ing/pieui:mitt-emitter",()=>qU.default())}var I$=F("@swarm.ing/pieui:context:mitt",()=>g.createContext(null));var c=I$;var OU=require("socket.io-client"),_U=require("react");var KU=F("@swarm.ing/pieui:socket-cache",()=>new Map),WU=(U)=>{let $=KU.get(U);if($)return $;let H=OU.io(U,{autoConnect:!1,transports:["websocket"]});return KU.set(U,H),H},J$=F("@swarm.ing/pieui:context:socket",()=>_U.createContext(null)),A=J$;var RU=require("react"),JU=require("centrifuge");var VU=F("@swarm.ing/pieui:centrifuge-cache",()=>new Map),MU=(U,$)=>{if(!$)return null;let H=`${U}::${$}`,J=VU.get(H);if(J)return J;async function Z(){let B=await fetch(U+"api/centrifuge/gen_token",{credentials:"include"});if(!B.ok){if(B.status===401||B.status===403)throw new JU.Centrifuge.UnauthorizedError("Backend is not answering");throw Error(`Unexpected status code ${B.status}`)}return(await B.json()).token}let I=new JU.Centrifuge($,{getToken:Z});return VU.set(H,I),I},Z$=F("@swarm.ing/pieui:context:centrifuge",()=>RU.createContext(null)),E=Z$;var s=require("react");var p=require("react"),h=new Map,l=new Map;function d(U,$){let H=`${U}::${$}`,J=U?h.get(H):void 0,[Z,I]=p.useState(J??null);return p.useEffect(()=>{if(!U)return;if(h.has(H)){I(h.get(H));return}let B=l.get(H);if(!B)B=fetch(U+`api/support/${$}`,{method:"GET"}).then((Y)=>Y.json()).then((Y)=>{return h.set(H,Y),l.delete(H),Y}).catch((Y)=>{throw l.delete(H),Y}),l.set(H,B);let D=!1;return B.then((Y)=>{if(!D)I(Y)}).catch(()=>{}),()=>{D=!0}},[U,$,H]),Z}var u=require("react");var ZU=F("@swarm.ing/pieui:context:pieConfig",()=>u.createContext(null)),o=()=>{let U=u.useContext(ZU);if(!U)throw Error("usePieConfig must be used within PieConfigProvider");return U},BU=()=>{let{apiServer:U}=o();return U},n=BU,AU=()=>{let{centrifugeServer:U}=o();return U};var M=()=>{let{enableRenderingLog:U}=o();return U},EU=M,NU=()=>{let{pageProcessor:U}=o();return U};var B$=F("@swarm.ing/pieui:sid-state",()=>({promise:null,resolve:null}));function PU(){B$.resolve?.()}var X$=({children:U})=>{let $=s.useContext(A),H=n(),J=d(H,"socketIO"),Z=(I)=>{if(typeof window<"u")window.sid=I.sid,PU(),console.log(`SocketIO initialized: ${window.sid}`)};return s.useEffect(()=>{if(!$)return;let I=()=>{console.log("SocketIO connected")},B=(D)=>{console.log(`SocketIO disconnected: ${D}`),$.connect()};if(J)$.on("pieinit",Z),$.on("connect",I),$.on("disconnect",B),$.connect();return()=>{if(J)$.off("pieinit",Z),$.off("connect",I),$.off("disconnect",B),$.disconnect()}},[$,J]),U},jU=X$;var i=require("react");var Y$=({children:U})=>{let $=i.useContext(E),H=n(),J=d(H,"centrifuge");return i.useEffect(()=>{if(!$)return;let Z=()=>{console.log("Centrifuge connected")},I=(B)=>{console.log("Centrifuge disconnected:",B)};if(J)$.on("connected",Z),$.on("disconnected",I),$.connect();return()=>{if(J)$.disconnect()}},[$,J]),U},wU=Y$;var kU=require("react");var r=require("react/jsx-runtime"),z$=F("@swarm.ing/pieui:context:fallback",()=>kU.createContext(r.jsx(r.Fragment,{}))),N=z$;var xU=require("react");var D$=F("@swarm.ing/pieui:context:lazyError",()=>xU.createContext(void 0)),P=D$;var fU=require("react"),y=new Map;function F$(U,$){return $.catch(()=>{if(y.get(U)===$)y.delete(U)}),y.set(U,$),$}function yU(U,$){return fU.lazy(()=>{if(y.has($))return y.get($);return F$($,U().then((H)=>H))})}var bU=F("@swarm.ing/pieui:component-registry",()=>new Map),G$=(U)=>{if(!U.name)throw Error("Component registration requires a name");if(!U.component&&!U.loader)throw Error(`Component "${U.name}" requires component or loader`);let $={name:U.name,component:U.component,loader:U.loader,metadata:U.metadata,fallback:U.fallback,isLazy:!1};if(!$.component&&$.loader)$.component=yU($.loader,U.name),$.isLazy=!0;return $};function a(U){let $=G$(U);return bU.set($.name,$),$.component}var t=(U)=>{return bU.get(U)};var b=require("react");var e=require("react"),vU=require("react/jsx-runtime"),Q$=2,T$=400;class j extends e.Component{state={failed:!1,attempt:0};timer;static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(U){if(this.props.onError?.(U),this.state.attempt<Q$){let $=T$*(this.state.attempt+1);this.timer=setTimeout(()=>{this.setState((H)=>({failed:!1,attempt:H.attempt+1}))},$)}}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.jsx(e.Suspense,{fallback:this.props.fallback,children:this.props.children},`${this.props.name}:${this.state.attempt}`)}}var UU=require("react/jsx-runtime");function q$({uiConfig:U,setUiAjaxConfiguration:$}){let H=b.useContext(N),J=b.useContext(P),Z=M();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:",!!$);let I=t(U.card);if(!I?.component){if(Z)console.warn(`[UI] Component not found in registry: ${U.card}`),console.log("[UI] Returning fallback component");return H}if(Z)console.log("[UI] Found component in registry:",{name:I.name,isLazy:I.isLazy,hasMetadata:!!I.metadata});let B=I.component,D=UU.jsx(B,{data:U.data,content:U.content,setUiAjaxConfiguration:$});if(I.isLazy){if(Z)console.log("[UI] Rendering lazy component with Suspense:",I.name);return UU.jsx(j,{name:I.name,fallback:I.fallback?UU.jsx(I.fallback,{}):H,onError:J,children:D})}if(Z)console.log("[UI] Rendering component directly:",I.name);return D}var XU=b.memo(q$);var uU=require("axios-date-transformer");var $U=require("react");var v=({onError:U}={})=>{let[$,H]=$U.useState(null),J=NU();return $U.useEffect(()=>{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();H(Z)},[]),$},CU=()=>{let U=v();return[U?.initDataUnsafe,U?.initData]};var SU=require("react");var L$=F("@swarm.ing/pieui:context:navigate",()=>SU.createContext(void 0)),mU=L$;var YU=require("react");var gU=require("react");var K$=F("@swarm.ing/pieui:context:uiRenderer",()=>gU.createContext(null)),cU=K$;var C=require("react/jsx-runtime");function hU({uiConfig:U,setUiAjaxConfiguration:$}){let H=YU.useContext(N),J=YU.useContext(P),Z=M();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:",!!$);let I=t(U.card);if(!I?.component){if(Z)console.warn(`[UILoading] Component not found in registry: ${U.card}`),console.log("[UILoading] Returning fallback component");return H}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 Y=I.fallback;return C.jsx(Y,{})}if(Z)console.log("[UILoading] No fallback, rendering full component:",I.name);let B=I.component,D=C.jsx(cU.Provider,{value:hU,children:C.jsx(B,{data:U.data,content:U.content,setUiAjaxConfiguration:$})});if(I.isLazy)return C.jsx(j,{name:I.name,fallback:H,onError:J,children:D});return D}var lU=hU;var dU=require("react/jsx-runtime");function pU(U,$,H){if(!$)return H;let J=U.replace(/^\//,""),Z=$[J];if(!Z)return H;return dU.jsx(lU,{uiConfig:Z})}var T=require("react/jsx-runtime"),O$=({location:U,fallback:$,piecache:H,onError:J,queryOptions:Z,disableGlobalForm:I})=>{let B=BU(),D=AU(),Y=M(),G=w.useMemo(()=>uU.createAxiosDateTransformer({baseURL:B}),[B]),X=w.useMemo(()=>LU(),[]),V=w.useMemo(()=>B?WU(B):null,[B]),R=w.useMemo(()=>B?MU(B,D):null,[B,D]),L=v({onError:J}),{data:O,isLoading:_,error:z}=k.useQuery({queryKey:["uiConfig",U.pathname+U.search,L?.initData],enabled:!!L?.initData,queryFn:async()=>{let q=new URLSearchParams(U.search);if(q.set("__pieroot","telegram"),L?.initData)q.set("initData",L.initData);let W="/api/content"+U.pathname+"?"+q.toString();if(Y)console.log("[PieRoot] Fetching UI configuration from:",W);let FU=await G.get(W,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET,PUT,POST,DELETE,PATCH,OPTIONS","Content-type":"application/json"},withCredentials:!0});if(Y)console.log("[PieRoot] Received UI configuration:",FU.data);return FU.data},staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!0,retryDelay:(q)=>Math.min(1000*2**q,30000),...Z}),Q=pU(U.pathname,H,$);if(!B)throw Error("Set PIE_API_SERVER and PIE_CENTRIFUGE_SERVER");if(z&&Y)return console.error("[PieRoot] Error fetching UI configuration:",z),console.error("[PieRoot] Error details:",{message:z.message,status:z.response?.status,data:z.response?.data}),J?.(z),Q;if(_||!O){if(Y)console.log("[PieRoot] Loading state:",{isLoading:_,hasUiConfiguration:!!O});return Q}if(Y)console.log("[PieRoot] UI configuration loaded successfully:",O),console.log("[PieRoot] Rendering UI with configuration");return T.jsx(c.Provider,{value:X,children:T.jsx(A.Provider,{value:V,children:T.jsx(E.Provider,{value:R,children:T.jsx(N.Provider,{value:$??T.jsx(T.Fragment,{}),children:T.jsx(jU,{children:T.jsx(wU,{children:I?T.jsx(XU,{uiConfig:O}):T.jsx("form",{id:"piedata_global_form",action:B+"api/process"+U.pathname,method:"post",encType:"multipart/form-data",children:T.jsx(XU,{uiConfig:O})})})})})})})})},_$=(U)=>{let $=w.useMemo(()=>new k.QueryClient,[]),H=U.queryClient??$;return T.jsx(mU.Provider,{value:U.onNavigate,children:T.jsx(ZU.Provider,{value:U.config,children:T.jsx(P.Provider,{value:U.onError,children:T.jsx(k.QueryClientProvider,{client:H,children:T.jsx(O$,{...U})})})})})},oU=_$;var S=require("react");var K=require("react");var x=require("react/jsx-runtime"),W$=({card:U,data:$,children:H,useSocketioSupport:J=!1,useCentrifugeSupport:Z=!1,useMittSupport:I=!1,centrifugeChannel:B=void 0,methods:D=void 0,stored:Y=void 0})=>{let G=EU(),X=K.useRef(D);if(X.current=D,G)console.log("[PieCard] Rendering card:",U),console.log("[PieCard] Card data:",$),console.log("[PieCard] Component name:",$?.name),console.log("[PieCard] Real-time support:",{socketio:J,centrifuge:Z,mitt:I,centrifugeChannel:B}),console.log("[PieCard] Methods:",D?Object.keys(D):"none"),console.log("[PieCard] Has children:",!!H);let V=K.useContext(A),R=K.useContext(E),L=K.useContext(c);if(K.useEffect(()=>{if(!V||!J||!X.current||!$.name){if(G&&J)console.log("[PieCard] Socket.IO setup skipped:",{hasSocket:!!V,useSocketioSupport:J,hasMethods:!!X.current,hasDataName:!!$?.name});return}let _=Object.keys(X.current??{}).map((z)=>{let Q=`pie${z}_${$.name}`;if(G)console.log(`[PieCard] Socket.IO registering event: ${Q}`);let q=(W)=>{X.current?.[z]?.(W)};return V.on(Q,q),[Q,q]});return()=>{_.forEach(([z,Q])=>{if(G)console.log(`[PieCard] Socket.IO unregistering event: ${z}`);V.off(z,Q)})}},[V,$.name,J]),K.useEffect(()=>{if(!R||!Z||!B||!$.name){if(G&&Z)console.log("[PieCard] Centrifuge setup skipped:",{hasCentrifuge:!!R,useCentrifugeSupport:Z,hasCentrifugeChannel:!!B,hasMethods:!!X.current,hasDataName:!!$?.name});return}let _=Object.keys(X.current??{}).map((z)=>{let Q=`pie${z}_${$.name}_${B}`;if(G)console.log(`[PieCard] Centrifuge subscribing to channel: ${Q}`);let q=R.newSubscription(Q);return q.on("publication",(W)=>{if(G)console.log(`[PieCard] Centrifuge received data on ${Q}:`,W.data);X.current?.[z]?.(W.data)}),q.subscribe(),q});return()=>{_.forEach((z)=>{if(G)console.log("[PieCard] Centrifuge unsubscribing from channel");z.unsubscribe(),R.removeSubscription(z)})}},[R,B,$.name,Z]),K.useEffect(()=>{if(!L||!I||!$.name){if(G&&I)console.log("[PieCard] Mitt setup skipped:",{hasMitt:!!L,useMittSupport:I,hasMethods:!!X.current,hasDataName:!!$?.name});return}let O=Object.keys(X.current??{}),_={};return O.forEach((z)=>{let Q=`pie${z}_${$.name}`,q=(W)=>{if(G)console.log(`[PieCard] Mitt registering event: ${Q}`);X.current?.[z]?.(W)};_[Q]=q,L.on(Q,q)}),()=>{Object.entries(_).forEach(([z,Q])=>{if(G)console.log(`[PieCard] Mitt unregistering event: ${z}`);L.off(z,Q)})}},[L,$.name,I]),G)console.log("[PieCard] Rendering complete, returning children");if(Y!==void 0)return x.jsxs(x.Fragment,{children:[x.jsx("input",{type:"hidden",name:$.name,value:JSON.stringify(Y)}),H]});return H},HU=W$;var zU=require("react/jsx-runtime"),V$=({data:U})=>{let{name:$,key:H,value:J,useSocketioSupport:Z,useCentrifugeSupport:I,useMittSupport:B,centrifugeChannel:D}=U,[Y,G]=S.useState(J);return S.useEffect(()=>{G(J)},[J]),S.useEffect(()=>{if(typeof window>"u")return;let X=window.Telegram?.WebApp?.CloudStorage;if(!X)return;X.setItem(H,Y)},[H,Y]),zU.jsx(HU,{card:"CloudStorageCard",data:U,useSocketioSupport:Z,useCentrifugeSupport:I,useMittSupport:B,centrifugeChannel:D,methods:{update:({value:X})=>{G(X)},remove:()=>{let X=window.Telegram?.WebApp?.CloudStorage;if(X)X.removeItem(H);G("")}},children:zU.jsx("input",{type:"hidden",id:$,name:$,value:Y})})},nU=V$;var sU=a({name:"CloudStorageCard",component:nU,metadata:{author:"PieData"}});var m=require("react");var DU=require("react/jsx-runtime"),R$=({data:U})=>{let{name:$,key:H,value:J,useSocketioSupport:Z,useCentrifugeSupport:I,useMittSupport:B,centrifugeChannel:D}=U,[Y,G]=m.useState(J);return m.useEffect(()=>{G(J)},[J]),m.useEffect(()=>{if(typeof window>"u")return;let X=window.Telegram?.WebApp?.SecureStorage;if(!X)return;X.setItem(H,Y)},[H,Y]),DU.jsx(HU,{card:"SecureStorageCard",data:U,useSocketioSupport:Z,useCentrifugeSupport:I,useMittSupport:B,centrifugeChannel:D,methods:{update:({value:X})=>{G(X)},remove:()=>{let X=window.Telegram?.WebApp?.SecureStorage;if(X)X.removeItem(H);G("")}},children:DU.jsx("input",{type:"hidden",id:$,name:$,value:Y})})},iU=R$;var rU=a({name:"SecureStorageCard",component:iU,metadata:{author:"PieData"}});
|
|
@@ -27,23 +27,64 @@ export type GetAjaxSubmitOptions = {
|
|
|
27
27
|
retryPolicy?: RetryPolicy;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
30
|
+
* The origin a dep value is read from. `dom` is the default for any name
|
|
31
|
+
* without a recognized prefix.
|
|
32
|
+
*/
|
|
33
|
+
export type DepSource = 'dom' | 'sid' | 'localStorage' | 'sessionStorage' | 'cookie' | 'url' | 'telegram:cloud' | 'telegram:secure';
|
|
34
|
+
/**
|
|
35
|
+
* Splits a dep name into its source and bare key, following the magic-name
|
|
36
|
+
* convention used by Ajax cards.
|
|
37
|
+
*
|
|
38
|
+
* - `'sid'` → `{ source: 'sid', key: 'sid' }` (SocketIO session id).
|
|
39
|
+
* - `'localStorage:token'` → `{ source: 'localStorage', key: 'token' }`; the
|
|
40
|
+
* same for `sessionStorage:`, `cookie:`, `url:`, `telegram:cloud:` and
|
|
41
|
+
* `telegram:secure:` prefixes.
|
|
42
|
+
* - Anything else (including a name that contains a colon but no recognized
|
|
43
|
+
* prefix) → `{ source: 'dom', key: <name> }`.
|
|
33
44
|
*
|
|
45
|
+
* The returned `key` is what gets sent to the backend as the field name, so a
|
|
46
|
+
* prefixed dep is submitted under its bare key (`localStorage:token` → `token`).
|
|
47
|
+
*/
|
|
48
|
+
export declare const parseDepName: (depName: string) => {
|
|
49
|
+
source: DepSource;
|
|
50
|
+
key: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Reads the value(s) for a single dep name, following the same convention used
|
|
54
|
+
* by Ajax cards. Returns an array because file inputs (and cookies / repeated
|
|
55
|
+
* URL params) can contribute multiple values for the same key.
|
|
56
|
+
*
|
|
57
|
+
* The source is determined by {@link parseDepName}:
|
|
34
58
|
* - `'sid'` resolves to `window.sid`. The caller must ensure SocketIO is
|
|
35
59
|
* ready (e.g. via {@link waitForSidAvailable}) before calling this.
|
|
36
|
-
* -
|
|
37
|
-
*
|
|
38
|
-
* -
|
|
39
|
-
*
|
|
40
|
-
* -
|
|
60
|
+
* - `localStorage:` / `sessionStorage:` read `getItem(key)` (try/caught, since
|
|
61
|
+
* storage access can throw in private mode); missing/blocked → `[]`.
|
|
62
|
+
* - `cookie:` reads and `decodeURIComponent`s the matching cookie; missing →
|
|
63
|
+
* `[]`.
|
|
64
|
+
* - `url:` reads `URLSearchParams(location.search).getAll(key)` (repeated
|
|
65
|
+
* params supported); missing → `[]`.
|
|
66
|
+
* - `telegram:cloud:` / `telegram:secure:` are asynchronous and cannot be
|
|
67
|
+
* served here — they return `[]`. Use {@link readAjaxKeyAsync} instead (the
|
|
68
|
+
* Ajax submit flow already does).
|
|
69
|
+
* - DOM names are looked up via `document.getElementsByName`; only the first
|
|
70
|
+
* match is read. `<input type="file">` returns every selected `File`; other
|
|
71
|
+
* `<input>` / `<textarea>` returns the current `.value`.
|
|
72
|
+
* - Missing values return `[]` (and emit a warning when `renderingLogEnabled`).
|
|
41
73
|
*
|
|
42
74
|
* Must run in a browser environment — relies on `document` and `window`.
|
|
43
75
|
*
|
|
44
|
-
* @throws if
|
|
76
|
+
* @throws if the resolved source is `sid` and `window.sid` is not initialized.
|
|
45
77
|
*/
|
|
46
78
|
export declare const readAjaxKey: (depName: string, renderingLogEnabled?: boolean) => Array<string | File>;
|
|
79
|
+
/**
|
|
80
|
+
* Asynchronous counterpart to {@link readAjaxKey}. Behaves identically for all
|
|
81
|
+
* synchronous sources (it delegates to `readAjaxKey`) but additionally resolves
|
|
82
|
+
* the asynchronous Telegram sources (`telegram:cloud:` / `telegram:secure:`).
|
|
83
|
+
*
|
|
84
|
+
* This is what the Ajax submit flow uses so that every supported source — sync
|
|
85
|
+
* or async — can contribute values to the request.
|
|
86
|
+
*/
|
|
87
|
+
export declare const readAjaxKeyAsync: (depName: string, renderingLogEnabled?: boolean) => Promise<Array<string | File>>;
|
|
47
88
|
/**
|
|
48
89
|
* Builds an async "submit" function that issues an AJAX request to
|
|
49
90
|
* `api/ajax_content{pathname}` and streams (or JSON-decodes) the response
|
|
@@ -52,8 +93,11 @@ export declare const readAjaxKey: (depName: string, renderingLogEnabled?: boolea
|
|
|
52
93
|
* The returned function collects form data from:
|
|
53
94
|
* 1. the static `kwargs` object,
|
|
54
95
|
* 2. any `extraKwargs` passed at call time,
|
|
55
|
-
* 3.
|
|
56
|
-
*
|
|
96
|
+
* 3. the dep names in `depsNames`, each resolved by {@link readAjaxKeyAsync}
|
|
97
|
+
* from its source: DOM inputs by default, `sid` (resolved via
|
|
98
|
+
* {@link waitForSidAvailable}), or the `localStorage:`, `sessionStorage:`,
|
|
99
|
+
* `cookie:`, `url:`, `telegram:cloud:` and `telegram:secure:` prefixes —
|
|
100
|
+
* submitted under the bare key, and
|
|
57
101
|
* 4. file inputs (multiple files supported).
|
|
58
102
|
*
|
|
59
103
|
* If the server streams NDJSON, each line is parsed as a `UIEventType` and
|
|
@@ -65,8 +109,11 @@ export declare const readAjaxKey: (depName: string, renderingLogEnabled?: boolea
|
|
|
65
109
|
*
|
|
66
110
|
* @param setUiAjaxConfiguration Setter provided by the enclosing Ajax card.
|
|
67
111
|
* @param kwargs Static key/value pairs appended to the request.
|
|
68
|
-
* @param depsNames
|
|
69
|
-
*
|
|
112
|
+
* @param depsNames Dep names whose current values should also be
|
|
113
|
+
* sent. Plain names read DOM inputs; the
|
|
114
|
+
* `localStorage:`, `sessionStorage:`, `cookie:`,
|
|
115
|
+
* `url:`, `telegram:cloud:` and `telegram:secure:`
|
|
116
|
+
* prefixes read those client sources.
|
|
70
117
|
* @param pathname Path segment appended to `api/ajax_content`.
|
|
71
118
|
* @param options See {@link GetAjaxSubmitOptions}.
|
|
72
119
|
* @returns An `async (extraKwargs?) => Promise<any>` submit function.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ajaxCommonUtils.d.ts","sourceRoot":"","sources":["../../src/util/ajaxCommonUtils.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,CAAA;AACjB,OAAO,EAAE,0BAA0B,EAAe,MAAM,UAAU,CAAA;AAKlE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kJAAkJ;IAClJ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,WAAW,CAAA;CAC5B,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"ajaxCommonUtils.d.ts","sourceRoot":"","sources":["../../src/util/ajaxCommonUtils.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,CAAA;AACjB,OAAO,EAAE,0BAA0B,EAAe,MAAM,UAAU,CAAA;AAKlE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kJAAkJ;IAClJ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,WAAW,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GACf,KAAK,GACL,KAAK,GACL,cAAc,GACd,gBAAgB,GAChB,QAAQ,GACR,KAAK,GACL,gBAAgB,GAChB,iBAAiB,CAAA;AAmBvB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,GACrB,SAAS,MAAM,KAChB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAWlC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,WAAW,GACpB,SAAS,MAAM,EACf,sBAAqB,OAAe,KACrC,KAAK,CAAC,MAAM,GAAG,IAAI,CA6ErB,CAAA;AA6ED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GACzB,SAAS,MAAM,EACf,sBAAqB,OAAe,KACrC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAM9B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,aAAa,GACtB,yBAAyB,0BAA0B,EACnD,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAChC,YAAW,KAAK,CAAC,MAAM,CAAM,EAC7B,WAAW,MAAM,EACjB,UAAU,oBAAoB,MAahB,cAAa,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,iBA2KtD,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,GACtB,yBAAyB,0BAA0B,EACnD,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAChC,YAAW,KAAK,CAAC,MAAM,CAAM,EAC7B,WAAW,MAAM,EACjB,UAAU;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE,oBAjM9B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,iBA6NjD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"centrifuge.d.ts","sourceRoot":"","sources":["../../src/util/centrifuge.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAQvC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GACtB,WAAW,MAAM,EACjB,mBAAmB,MAAM,KAC1B,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"centrifuge.d.ts","sourceRoot":"","sources":["../../src/util/centrifuge.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAQvC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GACtB,WAAW,MAAM,EACjB,mBAAmB,MAAM,KAC1B,UAAU,GAAG,IAgCf,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,4CAGxB,CAAA;AACD,eAAe,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swarm.ing/pieui",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "A React component library featuring PieCard component",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
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",
|
|
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:manager:esm && NODE_ENV=production bun run build:storybook:addon:manager: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
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'))}})\"",
|
|
66
66
|
"build:clean": "rm -rf dist",
|
|
67
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",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Common/CloudStorageCard/index.ts"],"names":[],"mappings":";AAGA,wBAIE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/CloudStorageCard/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IAEb,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB,CAAC,oBAAoB,CAAC;CAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CloudStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/CloudStorageCard/ui/CloudStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGhD,QAAA,MAAM,gBAAgB,GAAI,UAAU,qBAAqB,gCA6CxD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Common/SecureStorageCard/index.ts"],"names":[],"mappings":";AAGA,wBAIE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/SecureStorageCard/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IAEb,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB,CAAC,qBAAqB,CAAC;CAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SecureStorageCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Common/SecureStorageCard/ui/SecureStorageCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAGjD,QAAA,MAAM,iBAAiB,GAAI,UAAU,sBAAsB,gCA6C1D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|