@akinon/ui-shell-dev 1.5.1 → 1.5.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as n,c as u}from"./index-
|
|
1
|
+
import{u as n,c as u}from"./index-DHg_jhdM.js";n(function(e,t){t._reactRoot||(t._reactRoot=u.createRoot(t));var o=t._reactRoot;return o.render(e),function(){return new Promise(function(r){setTimeout(function(){o.unmount(),r()},0)})}});
|
|
@@ -386,7 +386,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
386
386
|
background-color: ${ap(n).lighten(.4).whiten(.4).hsl().toString()};
|
|
387
387
|
border-color: ${ap(n).lighten(.2).whiten(.2).hsl().toString()};
|
|
388
388
|
}`}
|
|
389
|
-
`})),sG=({children:e,status:t,className:n,color:r,...a})=>{const{getPrefixCls:l,theme:s}=d.useContext(wn.ConfigContext),{token:u,hashId:f}=Wr(),v=u.Tag,h=R1(s),g=`.${l()}-tag`,p=pr({token:u,path:["Tag"]},()=>({[`:where(.${f})${g}`]:{borderRadius:v.borderRadius,fontSize:v.fontSize,fontWeight:h.typography.fontWeightMedium,paddingLeft:v.paddingLeft,paddingRight:v.paddingRight},[g]:{svg:{fontSize:v.fontSizeClose}},[`${g}-borderless`]:{border:h.border.borderNone},[`${g}-${Yl.Success}`]:{color:v.defaultColorSuccess,borderColor:v.defaultBorderColorSuccess,backgroundColor:v.defaultBgSuccess,svg:{color:v.defaultColorSuccess}},[`${g}-${Yl.Info1}`]:{color:v.defaultColorWaiting1,borderColor:v.defaultBorderColorWaiting1,backgroundColor:v.defaultBgWaiting1,svg:{color:v.defaultColorWaiting1}},[`${g}-${Yl.Info2}`]:{color:v.defaultColorWaiting2,borderColor:v.defaultBorderColorWaiting2,backgroundColor:v.defaultBgWaiting2,svg:{color:v.defaultColorWaiting2}},[`${g}-${Yl.Info3}`]:{color:v.defaultColorWaiting3,borderColor:v.defaultBorderColorWaiting3,backgroundColor:v.defaultBgWaiting3,svg:{color:v.defaultColorWaiting3}},[`${g}-${Yl.Error}`]:{color:v.defaultColorFailed,borderColor:v.defaultBorderColorFailed,backgroundColor:v.defaultBgFailed,svg:{color:v.defaultColorFailed}},[`${g}-${Yl.Empty}`]:{color:v.defaultColorEmpty,borderColor:v.defaultBorderColorEmpty,backgroundColor:v.defaultBgEmpty}})),{styles:y}=lG({prefixClsWithoutHash:g,status:t,color:r});return p(he.jsx(rx,{className:gW(t&&`${l()}-tag-${t}`,y.dynamicStyles,n),...a,children:e}))};A8.Dragger;(async()=>{try{"createRoot"in await wv(()=>Promise.resolve().then(()=>Dp),void 0)&&await wv(()=>import("./index-
|
|
389
|
+
`})),sG=({children:e,status:t,className:n,color:r,...a})=>{const{getPrefixCls:l,theme:s}=d.useContext(wn.ConfigContext),{token:u,hashId:f}=Wr(),v=u.Tag,h=R1(s),g=`.${l()}-tag`,p=pr({token:u,path:["Tag"]},()=>({[`:where(.${f})${g}`]:{borderRadius:v.borderRadius,fontSize:v.fontSize,fontWeight:h.typography.fontWeightMedium,paddingLeft:v.paddingLeft,paddingRight:v.paddingRight},[g]:{svg:{fontSize:v.fontSizeClose}},[`${g}-borderless`]:{border:h.border.borderNone},[`${g}-${Yl.Success}`]:{color:v.defaultColorSuccess,borderColor:v.defaultBorderColorSuccess,backgroundColor:v.defaultBgSuccess,svg:{color:v.defaultColorSuccess}},[`${g}-${Yl.Info1}`]:{color:v.defaultColorWaiting1,borderColor:v.defaultBorderColorWaiting1,backgroundColor:v.defaultBgWaiting1,svg:{color:v.defaultColorWaiting1}},[`${g}-${Yl.Info2}`]:{color:v.defaultColorWaiting2,borderColor:v.defaultBorderColorWaiting2,backgroundColor:v.defaultBgWaiting2,svg:{color:v.defaultColorWaiting2}},[`${g}-${Yl.Info3}`]:{color:v.defaultColorWaiting3,borderColor:v.defaultBorderColorWaiting3,backgroundColor:v.defaultBgWaiting3,svg:{color:v.defaultColorWaiting3}},[`${g}-${Yl.Error}`]:{color:v.defaultColorFailed,borderColor:v.defaultBorderColorFailed,backgroundColor:v.defaultBgFailed,svg:{color:v.defaultColorFailed}},[`${g}-${Yl.Empty}`]:{color:v.defaultColorEmpty,borderColor:v.defaultBorderColorEmpty,backgroundColor:v.defaultBgEmpty}})),{styles:y}=lG({prefixClsWithoutHash:g,status:t,color:r});return p(he.jsx(rx,{className:gW(t&&`${l()}-tag-${t}`,y.dynamicStyles,n),...a,children:e}))};A8.Dragger;(async()=>{try{"createRoot"in await wv(()=>Promise.resolve().then(()=>Dp),void 0)&&await wv(()=>import("./index-CvDS9pd5.js"),[])}catch{}})();/**
|
|
390
390
|
* @remix-run/router v1.23.0
|
|
391
391
|
*
|
|
392
392
|
* Copyright (c) Remix Software Inc.
|
|
@@ -413,7 +413,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
413
413
|
* LICENSE.md file in the root directory of this source tree.
|
|
414
414
|
*
|
|
415
415
|
* @license MIT
|
|
416
|
-
*/function wd(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function tX(e,t){let n=wd(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}const nX="6";try{window.__reactRouterVersion=nX}catch{}const rX="startTransition",up=Zi[rX];function aX(e){let{basename:t,children:n,future:r,window:a}=e,l=d.useRef();l.current==null&&(l.current=cG({window:a,v5Compat:!0}));let s=l.current,[u,f]=d.useState({action:s.action,location:s.location}),{v7_startTransition:v}=r||{},h=d.useCallback(g=>{v&&up?up(()=>f(g)):f(g)},[f,v]);return d.useLayoutEffect(()=>s.listen(h),[s,h]),d.useEffect(()=>ZG(r),[r]),d.createElement(JG,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:s,future:r})}var dp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(dp||(dp={}));var fp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(fp||(fp={}));function oX(e){let t=d.useRef(wd(e)),n=d.useRef(!1),r=kc(),a=d.useMemo(()=>tX(r.search,n.current?null:t.current),[r.search]),l=Xu(),s=d.useCallback((u,f)=>{const v=wd(typeof u=="function"?u(a):u);n.current=!0,l("?"+v,f)},[l,a]);return[a,s]}const iX=()=>"1.5.1",lX=({onToggleLeftSider:e,onToggleRightSider:t})=>he.jsxs(he.Fragment,{children:[he.jsx("div",{className:"flex items-center",children:he.jsx(Ig,{type:"text",icon:"outdent",iconSize:16,onClick:e,className:"mr-2"})}),he.jsx("div",{children:he.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[he.jsx("span",{style:{width:"10px",height:"10px",backgroundColor:"green",borderRadius:"50%"}}),he.jsxs("span",{style:{fontSize:"14px",color:"#999"},children:["Akinon UI Shell (v",iX(),")"]})]})}),he.jsx("div",{className:"flex items-center",children:he.jsx(Ig,{type:"text",icon:"siralama",iconSize:16,onClick:t,className:"mr-2"})})]}),sX="c",gr={SET_APP_ID:"SET_APP_ID",SET_CONFIG:"SET_CONFIG",SET_DATA:"SET_DATA",SET_MODAL_CONTEXT:"SET_MODAL_CONTEXT",SET_HEIGHT:"SET_HEIGHT",SET_PARAMS:"SET_PARAMS",INVOKE_ACTION:"INVOKE_ACTION",INVOKE_DEFAULT_ACTION:"INVOKE_DEFAULT_ACTION",NAVIGATE:"NAVIGATE",NAVIGATE_CHILD:"NAVIGATE_CHILD",ACTION_CONFIRMED:"ACTION_CONFIRMED",ACTION_CANCELED:"ACTION_CANCELED",LOCALE_CHANGED:"LOCALE_CHANGED"},As={showConfirmationDialog:"showConfirmationDialog",showModalDialog:"showModalDialog",showToast:"showToast",showErrorMessage:"showErrorMessage",showRichModal:"showRichModal"},cX=async e=>{const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(e))),n=[],r=new DataView(t);for(let a=0;a<r.byteLength;a+=4)n.push(("00000000"+r.getUint32(a).toString(16)).slice(-8));return n.join("")},vp=async e=>(await cX(e)).slice(0,7),uX=({basePath:e,channel:t})=>`${e||"/"}${t?`-${t}`:""}`;var ki={},Vi={},mp;function dX(){if(mp)return Vi;mp=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.detach=Vi.attach=void 0;var e=so(),t=!1;function n(){t||typeof window>"u"||(t=!0,window.addEventListener("message",e.onMessage,!1))}Vi.attach=n;function r(){t=!1,window.removeEventListener("message",e.onMessage,!1)}return Vi.detach=r,Vi}var Bs={},hp;function fX(){if(hp)return Bs;hp=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.broadcastToChildWindows=void 0;var e=so();function t(n,r,a){for(var l=e.childWindows.length-1;l>=0;l--){var s=e.childWindows[l];s.closed?e.childWindows.splice(l,1):a!==s&&(0,e.broadcast)(n,{origin:r,frame:s.top})}}return Bs.broadcastToChildWindows=t,Bs}var Ds={},gp;function vX(){if(gp)return Ds;gp=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.broadcast=void 0;var e=so();function t(n,r){var a=0,l,s=r.origin,u=r.frame;try{for(u.postMessage(n,s),(0,e.hasOpener)(u)&&u.opener.top!==window.top&&t(n,{origin:s,frame:u.opener.top});l=u.frames[a];)t(n,{origin:s,frame:l}),a++}catch{}}return Ds.broadcast=t,Ds}var wo={},pp;function mX(){return pp||(pp=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.subscribers=wo.childWindows=wo.prefix=void 0,wo.prefix="/*framebus*/",wo.childWindows=[],wo.subscribers={}),wo}var Ls={},bp;function hX(){if(bp)return Ls;bp=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.dispatch=void 0;var e=so();function t(n,r,a,l,s){if(e.subscribers[n]&&e.subscribers[n][r]){var u=[];a&&u.push(a),l&&u.push(l);for(var f=0;f<e.subscribers[n][r].length;f++)e.subscribers[n][r][f].apply(s,u)}}return Ls.dispatch=t,Ls}var Hs={},yp;function gX(){if(yp)return Hs;yp=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.hasOpener=void 0;function e(t){return!(t.top!==t||t.opener==null||t.opener===t||t.opener.closed===!0)}return Hs.hasOpener=e,Hs}var Fs={},Sp;function pX(){if(Sp)return Fs;Sp=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.isntString=void 0;function e(t){return typeof t!="string"}return Fs.isntString=e,Fs}var ks={},Cp;function bX(){if(Cp)return ks;Cp=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.onMessage=void 0;var e=so();function t(n){if(!(0,e.isntString)(n.data)){var r=(0,e.unpackPayload)(n);if(r){var a=r.eventData,l=r.reply;(0,e.dispatch)("*",r.event,a,l,n),(0,e.dispatch)(n.origin,r.event,a,l,n),(0,e.broadcastToChildWindows)(n.data,r.origin,n.source)}}}return ks.onMessage=t,ks}var Vs={},xp;function yX(){if(xp)return Vs;xp=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.packagePayload=void 0;var e=so();function t(n,r,a,l){var s,u={event:n,origin:r};typeof l=="function"&&(u.reply=(0,e.subscribeReplier)(l,r)),u.eventData=a;try{s=e.prefix+JSON.stringify(u)}catch(f){throw new Error("Could not stringify event: ".concat(f.message))}return s}return Vs.packagePayload=t,Vs}var Us={},$p;function SX(){if($p)return Us;$p=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.sendMessage=void 0;function e(t,n,r){try{t.postMessage(n,r)}catch{}}return Us.sendMessage=e,Us}var Ui={},Ws={},Mp;function kx(){if(Mp)return Ws;Mp=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.Framebus=void 0;var e=so(),t=typeof window<"u"&&window.Promise,n=(function(){function r(a){a===void 0&&(a={}),this.origin=a.origin||"*",this.channel=a.channel||"",this.verifyDomain=a.verifyDomain,this.targetFrames=a.targetFrames||[],this.limitBroadcastToFramesArray=!!a.targetFrames,this.isDestroyed=!1,this.listeners=[],this.hasAdditionalChecksForOnListeners=!!(this.verifyDomain||this.limitBroadcastToFramesArray)}return r.setPromise=function(a){r.Promise=a},r.target=function(a){return new r(a)},r.prototype.addTargetFrame=function(a){this.limitBroadcastToFramesArray&&this.targetFrames.push(a)},r.prototype.include=function(a){return a==null||a.Window==null||a.constructor!==a.Window?!1:(e.childWindows.push(a),!0)},r.prototype.target=function(a){return r.target(a)},r.prototype.emit=function(a,l,s){if(this.isDestroyed)return!1;var u=this.origin;if(a=this.namespaceEvent(a),(0,e.isntString)(a)||(0,e.isntString)(u))return!1;typeof l=="function"&&(s=l,l=void 0);var f=(0,e.packagePayload)(a,u,l,s);return f?(this.limitBroadcastToFramesArray?this.targetFramesAsWindows().forEach(function(v){(0,e.sendMessage)(v,f,u)}):(0,e.broadcast)(f,{origin:u,frame:window.top||window.self}),!0):!1},r.prototype.emitAsPromise=function(a,l){var s=this;return new r.Promise(function(u,f){var v=s.emit(a,l,function(h){u(h)});v||f(new Error('Listener not added for "'.concat(a,'"')))})},r.prototype.on=function(a,l){if(this.isDestroyed)return!1;var s=this,u=this.origin,f=l;return a=this.namespaceEvent(a),(0,e.subscriptionArgsInvalid)(a,f,u)?!1:(this.hasAdditionalChecksForOnListeners&&(f=function(){for(var v=[],h=0;h<arguments.length;h++)v[h]=arguments[h];s.passesVerifyDomainCheck(this&&this.origin)&&s.hasMatchingTargetFrame(this&&this.source)&&l.apply(void 0,v)}),this.listeners.push({eventName:a,handler:f,originalHandler:l}),e.subscribers[u]=e.subscribers[u]||{},e.subscribers[u][a]=e.subscribers[u][a]||[],e.subscribers[u][a].push(f),!0)},r.prototype.off=function(a,l){var s=l;if(this.isDestroyed)return!1;if(this.hasAdditionalChecksForOnListeners)for(var u=0;u<this.listeners.length;u++){var f=this.listeners[u];f.originalHandler===l&&(s=f.handler)}a=this.namespaceEvent(a);var v=this.origin;if((0,e.subscriptionArgsInvalid)(a,s,v))return!1;var h=e.subscribers[v]&&e.subscribers[v][a];if(!h)return!1;for(var u=0;u<h.length;u++)if(h[u]===s)return h.splice(u,1),!0;return!1},r.prototype.teardown=function(){if(!this.isDestroyed){this.isDestroyed=!0;for(var a=0;a<this.listeners.length;a++){var l=this.listeners[a];this.off(l.eventName,l.handler)}this.listeners.length=0}},r.prototype.passesVerifyDomainCheck=function(a){return this.verifyDomain?this.checkOrigin(a):!0},r.prototype.targetFramesAsWindows=function(){return this.limitBroadcastToFramesArray?this.targetFrames.map(function(a){return a instanceof HTMLIFrameElement?a.contentWindow:a}).filter(function(a){return a}):[]},r.prototype.hasMatchingTargetFrame=function(a){if(!this.limitBroadcastToFramesArray)return!0;var l=this.targetFramesAsWindows().find(function(s){return s===a});return!!l},r.prototype.checkOrigin=function(a){var l,s=document.createElement("a");s.href=location.href,s.protocol==="https:"?l=s.host.replace(/:443$/,""):s.protocol==="http:"?l=s.host.replace(/:80$/,""):l=s.host;var u=s.protocol+"//"+l;return u===a?!0:this.verifyDomain?this.verifyDomain(a):!0},r.prototype.namespaceEvent=function(a){return this.channel?"".concat(this.channel,":").concat(a):a},r.Promise=t,r})();return Ws.Framebus=n,Ws}var s5,wp;function CX(){if(wp)return s5;wp=1;function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=Math.random()*16|0,r=t==="x"?n:n&3|8;return r.toString(16)})}return s5=e,s5}var Ep;function xX(){if(Ep)return Ui;Ep=1;var e=Ui&&Ui.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.subscribeReplier=void 0;var t=kx(),n=e(CX());function r(a,l){var s=(0,n.default)();function u(f,v){a(f,v),t.Framebus.target({origin:l}).off(s,u)}return t.Framebus.target({origin:l}).on(s,u),s}return Ui.subscribeReplier=r,Ui}var qs={},zp;function $X(){if(zp)return qs;zp=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.subscriptionArgsInvalid=void 0;var e=so();function t(n,r,a){return(0,e.isntString)(n)||typeof r!="function"?!0:(0,e.isntString)(a)}return qs.subscriptionArgsInvalid=t,qs}var c5={},Op;function MX(){return Op||(Op=1,Object.defineProperty(c5,"__esModule",{value:!0})),c5}var Gs={},Ip;function wX(){if(Ip)return Gs;Ip=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.unpackPayload=void 0;var e=so();function t(n){var r;if(n.data.slice(0,e.prefix.length)!==e.prefix)return!1;try{r=JSON.parse(n.data.slice(e.prefix.length))}catch{return!1}if(r.reply){var a=n.origin,l=n.source,s=r.reply;r.reply=function(f){if(l){var v=(0,e.packagePayload)(s,a,f);v&&l.postMessage(v,a)}}}return r}return Gs.unpackPayload=t,Gs}var Rp;function so(){return Rp||(Rp=1,(function(e){var t=ki&&ki.__createBinding||(Object.create?(function(r,a,l,s){s===void 0&&(s=l);var u=Object.getOwnPropertyDescriptor(a,l);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[l]}}),Object.defineProperty(r,s,u)}):(function(r,a,l,s){s===void 0&&(s=l),r[s]=a[l]})),n=ki&&ki.__exportStar||function(r,a){for(var l in r)l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&t(a,r,l)};Object.defineProperty(e,"__esModule",{value:!0}),n(dX(),e),n(fX(),e),n(vX(),e),n(mX(),e),n(hX(),e),n(gX(),e),n(pX(),e),n(bX(),e),n(yX(),e),n(SX(),e),n(xX(),e),n($X(),e),n(MX(),e),n(wX(),e)})(ki)),ki}var u5,Tp;function EX(){if(Tp)return u5;Tp=1;var e=so(),t=kx();return(0,e.attach)(),u5=t.Framebus,u5}var zX=EX();const Pp=ol(zX),d5=(e,t,n)=>{const r=document.createElement("iframe");return r.id=e,r.src=`${t}${n??""}`,r.style.display="none",document.body.appendChild(r),r},Vx={apps:[],configs:new Map,navigate:()=>{},instances:new Map},Ux=d.createContext(Vx),_1=()=>d.useContext(Ux),OX=({children:e,apps:t,actions:n,data:r,navigation:a})=>{const[l,s]=d.useState({...Vx}),u=new Pp,f=d.useRef(new Map),v=d.useRef(new Map),h=(C,x,S,M,w,z)=>{const I=new URL(x).searchParams.get(sX)??void 0,E=new Pp({origin:x,targetFrames:[S],channel:uX({basePath:z,channel:I})});E.on(gr.SET_CONFIG,O=>{const{config:R}=O;s(N=>({...N,configs:new Map(N.configs.set(C,R)),instances:new Map(N.instances).set(C,{id:C,basePath:z||"",config:R,iframe:S,bus:E})})),E.emit(gr.SET_DATA,r),E.emit(gr.SET_APP_ID,{appId:C}),typeof w<"u"&&E.emit(gr.SET_MODAL_CONTEXT,w)}),E.on(gr.SET_HEIGHT,O=>{const{height:R,id:N}=O,_=document.getElementById(N);_&&(_.style.height=`${R}px`)}),E.on(gr.INVOKE_ACTION,(O,R)=>{const{actionKey:N,args:_}=O;if(n&&n.actions[N])try{Promise.resolve(n.actions[N](..._)).then(j=>R({success:!0,result:j})).catch(j=>{const H=j instanceof Error?j.message:"An error occurred";R({success:!1,error:H})})}catch(j){const H=j instanceof Error?j.message:"An error occurred";R({success:!1,error:H})}else R({success:!1,error:"Action not found"})}),E.on(gr.INVOKE_DEFAULT_ACTION,(O,R)=>{if(!n)return;const{actionKey:N,args:_}=O,{showConfirmationDialog:j,showErrorMessage:H,showModalDialog:U,showToast:D,showRichModal:W}=n;if(N===As.showConfirmationDialog){try{const[X,A]=[..._],k=j?.(X,A,K=>E.emit(gr.ACTION_CONFIRMED,{data:K}),()=>E.emit(gr.ACTION_CANCELED));R?.({success:!0,result:k})}catch(X){const A=X instanceof Error?X.message:"An error occurred";R?.({success:!1,error:A})}return}if(N===As.showErrorMessage){const[X,A]=[..._];try{const k=H?.(X,A);R?.({success:!0,result:k})}catch(k){const K=k instanceof Error?k.message:"An error occurred";R?.({success:!1,error:K})}return}if(N===As.showModalDialog){const[X,A]=[..._];try{const k=U?.(X,A);R?.({success:!0,result:k})}catch(k){const K=k instanceof Error?k.message:"An error occurred";R?.({success:!1,error:K})}return}if(N===As.showToast){const[X,A]=[..._];try{const k=D?.(X,A);R?.({success:!0,result:k})}catch(k){const K=k instanceof Error?k.message:"An error occurred";R?.({success:!1,error:K})}return}if(N===As.showRichModal){const[X,A,k,K]=[..._],V=window.crypto.randomUUID();try{const P=W?.(V,X,A,k,K);R?.({success:!0,result:P});const F=`app-shell-iframe-modal-${V}`,L=d5(F,x);f.current.set(V,L),h(V,x,L,C,A,z),s(T=>({...T,frames:f,modals:T.modals?T.modals.set(V,C):new Map([[V,C]]),modalContext:T.modalContext?T.modalContext.set(V,A):new Map([[V,A]])}))}catch(P){const F=P instanceof Error?P.message:"An error occurred";R?.({success:!1,error:F})}return}}),E.on(gr.NAVIGATE,O=>{const{navigate:R}=a,{path:N,external:_}=O;if(R){M&&n?.closeRichModal?.(C);const j=z&&!_&&!N.startsWith(z)?`${z}${N}`:N;R({id:M||C,path:j,external:_})}}),v.current.set(C,E),s(O=>({...O,buses:v,confirmAction:R=>{E.emit(gr.ACTION_CONFIRMED,{data:R})},cancelAction:()=>{E.emit(gr.ACTION_CANCELED)}}))};d.useEffect(()=>(t.filter(S=>S.type==="full_page").forEach(S=>{const M=`app-shell-iframe-fullpage-${S.id}`,w=d5(M,S.url),z=S.subSlug??new URL(S.url).pathname;f.current.set(S.id,w),s(I=>({...I,frames:f})),h(S.id,S.url,w,void 0,void 0,z)}),t.filter(S=>S.type==="plugin").forEach(S=>{const M=`app-shell-iframe-plugin-${S.id}`,w=d5(M,S.url,S.subSlug),z=S.subSlug??new URL(S.url).pathname;f.current.set(S.id,w),s(I=>({...I,frames:f})),h(S.id,S.url,w,void 0,void 0,z)}),()=>{v.current.forEach(S=>S.teardown()),f.current.forEach(S=>S.remove()),s(S=>({...S,instances:new Map}))}),[t?.length]),d.useEffect(()=>{s(C=>({...C,data:r})),r&&v.current&&v.current.forEach(C=>{C.emit(gr.SET_DATA,r)})},[r]);const y={...l,apps:t,navigate:({path:C,id:x})=>{x?v.current.get(x)?.emit(gr.NAVIGATE_CHILD,{path:C}):u.emit(gr.NAVIGATE_CHILD,{path:C})},updateLocale:C=>{v.current.forEach(x=>{x.emit(gr.LOCALE_CHANGED,{locale:C})})}};return he.jsx(Ux.Provider,{value:y,children:e})},IX=({id:e,path:t})=>{const n=`app-shell-fullpage-container-${e}`,{frames:r,navigate:a}=_1();return d.useEffect(()=>{if(r?.current.has(e)){const l=r.current.get(e),s=document.getElementById(n),u=new URL(l.src).origin;t?l.src=`${u}${t}`:l.src=u;const f={display:"block",width:"100%",height:"100%",border:"none"};Object.assign(l.style,f),s&&(s.innerHTML="",s.appendChild(l))}},[e,r?.current.has(e)]),d.useEffect(()=>{t&&a({path:t,id:e})},[t]),he.jsx("div",{id:n,className:"app-shell-fullpage-container"})},RX=({placeholderId:e,params:t})=>{const{apps:n,configs:r,frames:a,buses:l}=_1(),s=Math.random().toString(16).slice(2),u=Array.from(r.keys()).filter(y=>{const C=r.get(y);return typeof C.placeholderId=="string"?C?.placeholderId===e:C?.placeholderId?.includes(e)}),f=n.filter(y=>u.includes(y.id)),v=f[0];if(!v)return null;f.length>1&&console.warn(`PluginRenderer: Found multiple plugins with placeholderId: ${e}`);const h=`app-shell-plugin-container-${s}`,g=`app-shell-plugin-iframe-${s}`,p=l?.current.get(v.id);return d.useEffect(()=>{(async()=>{const C=a?.current.get(v.id);if(C){const x=document.getElementById(h),S=document.createElement("iframe");if(S.id=g,S.name=g,t){const w=await vp(t);S.src=`${C.src}?c=${w}`}else S.src=C.src;const M={background:"transparent",display:"block",width:"100%",border:"none"};Object.assign(S.style,M),x&&x.appendChild(S),S.onload=async()=>{if(p?.addTargetFrame(S),t){const w=await vp(t);p?.target({channel:w}).emit(gr.SET_PARAMS,t)}}}})()},[e,a]),d.useEffect(()=>{(async()=>{if(t){const x=document.querySelector(`#${h} iframe`)?.src.split("?")[1]?.split("=")[1];p?.target({channel:x}).emit(gr.SET_PARAMS,t)}})()},[t]),he.jsx("div",{id:h,className:"app-shell-plugin-container"})},TX=[{key:"/",label:"Welcome",icon:"dashboard"},{key:"/products-and-catalogs",label:"Products & Catalogs",icon:"fiyatlistesi",disabled:!0},{key:"/orders",label:"Orders",icon:"siparis",disabled:!0}],PX=[{key:"/placeholder-2",label:"Help & Support",icon:"bilgilendirme_servis",disabled:!0},{key:"/placeholder-1",label:"Settings",icon:"ayarlar",disabled:!0}],NX=[{key:"/plugin-test",label:"Plugin Test",icon:"box"}],_X=()=>TX,jX=()=>PX,AX=(e,t)=>e.filter(n=>n.type==="full_page").map(n=>({key:`/external/${n.slug}`,label:n.name,icon:"stoklistesi",children:t.get(n.id)?.menu?.map(r=>{const{child:a,path:l,label:s}=r;return a?!1:{key:`/external/${n.slug}${l}`,label:s,icon:"eksi"}}).filter(Boolean)})),BX=e=>e.some(n=>n.type==="plugin")?NX:[],DX=()=>{const{apps:e,configs:t}=_1(),n=kc(),r=Xu(),[a,l]=d.useState("/"),[s,u]=d.useState([]),f=_X(),v=jX(),h=AX(e,t),g=BX(e),p=d.useMemo(()=>[...f,...h,...g,...v],[f,h,g,v]),{allItemKeys:y,childToParentKey:C}=d.useMemo(()=>{function w(E){if(!E)return[];const O=[];return E.forEach(R=>{"key"in R&&R.key&&O.push(R.key),"children"in R&&R.children&&R.children.forEach(N=>{"key"in N&&N.key&&O.push(N.key)})}),O}const z=w(p),I=new Map;return h.forEach(E=>{"children"in E&&E.children&&E.children.forEach(O=>{"key"in O&&O.key&&"key"in E&&E.key&&I.set(O.key,E.key)})}),{allItemKeys:z,childToParentKey:I}},[p,h]),x=d.useMemo(()=>{const w=new Set;return h.forEach(z=>{"key"in z&&z.key&&"children"in z&&Array.isArray(z.children)&&z.children.length>0&&w.add(z.key)}),w},[h]);d.useEffect(()=>{const w=n.pathname,z=y.filter(E=>typeof E=="string"&&w.startsWith(E)).sort((E,O)=>O.length-E.length)[0];z&&l(z);const I=z?C.get(z):void 0;I?u([I]):h.some(E=>{const O="key"in E&&E.key===z,R="children"in E&&Array.isArray(E.children)&&E.children.length>0;return O&&R})&&u([z])},[n,y,C,h]);const S=w=>{const z=w.key;if(x.has(z)){u(E=>E.includes(z)?[]:[z]),l(z);return}const I=C.get(z);I&&u([I]),z.includes("external")||u([]),r(z)},M=w=>{if(w.length===0){u([]);return}u([w[w.length-1]])};return he.jsx("div",{children:he.jsx(SW,{mode:"inline",selectedKeys:[a],items:p,onClick:S,triggerSubMenuAction:"click",theme:"dark",openKeys:s,onOpenChange:M})})},LX=({children:e})=>{const[t,n]=d.useState(!1),[r,a]=d.useState(!0),l=()=>n(!t),s=()=>a(!r);return he.jsxs(Kl,{children:[he.jsx(Kl.Sider,{collapsed:t,brandImageUrl:"/logo.png",iconUrl:"/symbol.png",children:he.jsx(DX,{})}),he.jsxs(Kl,{children:[he.jsx(Kl.Header,{children:he.jsx(lX,{onToggleLeftSider:l,onToggleRightSider:s})}),he.jsx(Kl.Content,{children:e})]}),he.jsx(Kl.Sider,{collapsed:r,collapsedWidth:0,position:"right",children:he.jsxs(yd,{className:"log-messages",children:[he.jsxs("div",{className:"log-messages-item",children:[he.jsx(l0,{type:"success",children:"Development server running"}),he.jsx(l0,{children:new Date().toLocaleTimeString()})]}),he.jsxs("div",{className:"log-messages-item",children:[he.jsx(l0,{children:"Shell environment active"}),he.jsx(l0,{children:"Ready for testing"})]})]})})]})},HX=({config:e,children:t})=>{const[n,r]=P8.useNotification(),[a]=oX(),l=Xu(),s=e.apps.map((p,y)=>({id:y+1,url:p.url,slug:p.name.toLowerCase().replace(/\s+/g,"-"),path:"",type:p.type,name:p.navTitle||p.name})),u={navigate:({id:p,path:y,external:C})=>{const x=s.find(M=>M.id===p);if(!x)return;const S=C?y:`/external/${x.slug}${y||""}`;l(S)}},f={lng:"en",username:"Developer",searchParams:Object.fromEntries([...a]),...e.data||{}},g={...{showModalDialog:()=>{},showToast:(p,y)=>{y==="loading"||y==="destroy"||n[y]({message:p,placement:"top"})},showErrorMessage:(p,y)=>{n.error({message:p,description:y,placement:"top"})},showRichModal:()=>{}},actions:{...{reloadPage:()=>window.location.reload(),logMessage:p=>{try{const y=JSON.parse(localStorage.getItem("logMessages")||"[]");localStorage.setItem("logMessages",JSON.stringify([...y,p]))}catch{console.error("Failed to log message")}}}}};return he.jsxs(OX,{apps:s,navigation:u,data:f,actions:g,children:[t,r]})},Wx=({children:e})=>he.jsx("div",{className:"px-8 py-8",children:e}),FX=({title:e,description:t,actions:n,className:r})=>he.jsxs(dW,{justify:"space-between",align:"flex-start",className:r,style:{padding:"18px 30px",borderBlockEnd:"solid 1px var(--color-gray-900)"},children:[he.jsxs(yd,{direction:"vertical",size:4,children:[he.jsx(hW,{level:4,style:{margin:0},children:e}),t&&he.jsx(mW,{type:"secondary",children:t})]}),n&&he.jsx(yd,{children:n})]}),kX=({data:e})=>{const t={...e};return delete t.lng,delete t.username,delete t.searchParams,he.jsx("pre",{style:{backgroundColor:"#1e1e1e",color:"#d4d4d4",padding:"16px",borderRadius:"6px",border:"1px solid #424b6b",fontSize:"13px",fontFamily:'"SF Mono", "Monaco", "Inconsolata", "Roboto Mono", "Source Code Pro", monospace',lineHeight:"1.5",overflow:"auto",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:Object.keys(t).length>0?JSON.stringify(t,null,2):`// No custom data configured in shell.config.js
|
|
416
|
+
*/function wd(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function tX(e,t){let n=wd(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}const nX="6";try{window.__reactRouterVersion=nX}catch{}const rX="startTransition",up=Zi[rX];function aX(e){let{basename:t,children:n,future:r,window:a}=e,l=d.useRef();l.current==null&&(l.current=cG({window:a,v5Compat:!0}));let s=l.current,[u,f]=d.useState({action:s.action,location:s.location}),{v7_startTransition:v}=r||{},h=d.useCallback(g=>{v&&up?up(()=>f(g)):f(g)},[f,v]);return d.useLayoutEffect(()=>s.listen(h),[s,h]),d.useEffect(()=>ZG(r),[r]),d.createElement(JG,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:s,future:r})}var dp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(dp||(dp={}));var fp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(fp||(fp={}));function oX(e){let t=d.useRef(wd(e)),n=d.useRef(!1),r=kc(),a=d.useMemo(()=>tX(r.search,n.current?null:t.current),[r.search]),l=Xu(),s=d.useCallback((u,f)=>{const v=wd(typeof u=="function"?u(a):u);n.current=!0,l("?"+v,f)},[l,a]);return[a,s]}const iX=()=>"1.5.2",lX=({onToggleLeftSider:e,onToggleRightSider:t})=>he.jsxs(he.Fragment,{children:[he.jsx("div",{className:"flex items-center",children:he.jsx(Ig,{type:"text",icon:"outdent",iconSize:16,onClick:e,className:"mr-2"})}),he.jsx("div",{children:he.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[he.jsx("span",{style:{width:"10px",height:"10px",backgroundColor:"green",borderRadius:"50%"}}),he.jsxs("span",{style:{fontSize:"14px",color:"#999"},children:["Akinon UI Shell (v",iX(),")"]})]})}),he.jsx("div",{className:"flex items-center",children:he.jsx(Ig,{type:"text",icon:"siralama",iconSize:16,onClick:t,className:"mr-2"})})]}),sX="c",gr={SET_APP_ID:"SET_APP_ID",SET_CONFIG:"SET_CONFIG",SET_DATA:"SET_DATA",SET_MODAL_CONTEXT:"SET_MODAL_CONTEXT",SET_HEIGHT:"SET_HEIGHT",SET_PARAMS:"SET_PARAMS",INVOKE_ACTION:"INVOKE_ACTION",INVOKE_DEFAULT_ACTION:"INVOKE_DEFAULT_ACTION",NAVIGATE:"NAVIGATE",NAVIGATE_CHILD:"NAVIGATE_CHILD",ACTION_CONFIRMED:"ACTION_CONFIRMED",ACTION_CANCELED:"ACTION_CANCELED",LOCALE_CHANGED:"LOCALE_CHANGED"},As={showConfirmationDialog:"showConfirmationDialog",showModalDialog:"showModalDialog",showToast:"showToast",showErrorMessage:"showErrorMessage",showRichModal:"showRichModal"},cX=async e=>{const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(e))),n=[],r=new DataView(t);for(let a=0;a<r.byteLength;a+=4)n.push(("00000000"+r.getUint32(a).toString(16)).slice(-8));return n.join("")},vp=async e=>(await cX(e)).slice(0,7),uX=({basePath:e,channel:t})=>`${e||"/"}${t?`-${t}`:""}`;var ki={},Vi={},mp;function dX(){if(mp)return Vi;mp=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.detach=Vi.attach=void 0;var e=so(),t=!1;function n(){t||typeof window>"u"||(t=!0,window.addEventListener("message",e.onMessage,!1))}Vi.attach=n;function r(){t=!1,window.removeEventListener("message",e.onMessage,!1)}return Vi.detach=r,Vi}var Bs={},hp;function fX(){if(hp)return Bs;hp=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.broadcastToChildWindows=void 0;var e=so();function t(n,r,a){for(var l=e.childWindows.length-1;l>=0;l--){var s=e.childWindows[l];s.closed?e.childWindows.splice(l,1):a!==s&&(0,e.broadcast)(n,{origin:r,frame:s.top})}}return Bs.broadcastToChildWindows=t,Bs}var Ds={},gp;function vX(){if(gp)return Ds;gp=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.broadcast=void 0;var e=so();function t(n,r){var a=0,l,s=r.origin,u=r.frame;try{for(u.postMessage(n,s),(0,e.hasOpener)(u)&&u.opener.top!==window.top&&t(n,{origin:s,frame:u.opener.top});l=u.frames[a];)t(n,{origin:s,frame:l}),a++}catch{}}return Ds.broadcast=t,Ds}var wo={},pp;function mX(){return pp||(pp=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.subscribers=wo.childWindows=wo.prefix=void 0,wo.prefix="/*framebus*/",wo.childWindows=[],wo.subscribers={}),wo}var Ls={},bp;function hX(){if(bp)return Ls;bp=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.dispatch=void 0;var e=so();function t(n,r,a,l,s){if(e.subscribers[n]&&e.subscribers[n][r]){var u=[];a&&u.push(a),l&&u.push(l);for(var f=0;f<e.subscribers[n][r].length;f++)e.subscribers[n][r][f].apply(s,u)}}return Ls.dispatch=t,Ls}var Hs={},yp;function gX(){if(yp)return Hs;yp=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.hasOpener=void 0;function e(t){return!(t.top!==t||t.opener==null||t.opener===t||t.opener.closed===!0)}return Hs.hasOpener=e,Hs}var Fs={},Sp;function pX(){if(Sp)return Fs;Sp=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.isntString=void 0;function e(t){return typeof t!="string"}return Fs.isntString=e,Fs}var ks={},Cp;function bX(){if(Cp)return ks;Cp=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.onMessage=void 0;var e=so();function t(n){if(!(0,e.isntString)(n.data)){var r=(0,e.unpackPayload)(n);if(r){var a=r.eventData,l=r.reply;(0,e.dispatch)("*",r.event,a,l,n),(0,e.dispatch)(n.origin,r.event,a,l,n),(0,e.broadcastToChildWindows)(n.data,r.origin,n.source)}}}return ks.onMessage=t,ks}var Vs={},xp;function yX(){if(xp)return Vs;xp=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.packagePayload=void 0;var e=so();function t(n,r,a,l){var s,u={event:n,origin:r};typeof l=="function"&&(u.reply=(0,e.subscribeReplier)(l,r)),u.eventData=a;try{s=e.prefix+JSON.stringify(u)}catch(f){throw new Error("Could not stringify event: ".concat(f.message))}return s}return Vs.packagePayload=t,Vs}var Us={},$p;function SX(){if($p)return Us;$p=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.sendMessage=void 0;function e(t,n,r){try{t.postMessage(n,r)}catch{}}return Us.sendMessage=e,Us}var Ui={},Ws={},Mp;function kx(){if(Mp)return Ws;Mp=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.Framebus=void 0;var e=so(),t=typeof window<"u"&&window.Promise,n=(function(){function r(a){a===void 0&&(a={}),this.origin=a.origin||"*",this.channel=a.channel||"",this.verifyDomain=a.verifyDomain,this.targetFrames=a.targetFrames||[],this.limitBroadcastToFramesArray=!!a.targetFrames,this.isDestroyed=!1,this.listeners=[],this.hasAdditionalChecksForOnListeners=!!(this.verifyDomain||this.limitBroadcastToFramesArray)}return r.setPromise=function(a){r.Promise=a},r.target=function(a){return new r(a)},r.prototype.addTargetFrame=function(a){this.limitBroadcastToFramesArray&&this.targetFrames.push(a)},r.prototype.include=function(a){return a==null||a.Window==null||a.constructor!==a.Window?!1:(e.childWindows.push(a),!0)},r.prototype.target=function(a){return r.target(a)},r.prototype.emit=function(a,l,s){if(this.isDestroyed)return!1;var u=this.origin;if(a=this.namespaceEvent(a),(0,e.isntString)(a)||(0,e.isntString)(u))return!1;typeof l=="function"&&(s=l,l=void 0);var f=(0,e.packagePayload)(a,u,l,s);return f?(this.limitBroadcastToFramesArray?this.targetFramesAsWindows().forEach(function(v){(0,e.sendMessage)(v,f,u)}):(0,e.broadcast)(f,{origin:u,frame:window.top||window.self}),!0):!1},r.prototype.emitAsPromise=function(a,l){var s=this;return new r.Promise(function(u,f){var v=s.emit(a,l,function(h){u(h)});v||f(new Error('Listener not added for "'.concat(a,'"')))})},r.prototype.on=function(a,l){if(this.isDestroyed)return!1;var s=this,u=this.origin,f=l;return a=this.namespaceEvent(a),(0,e.subscriptionArgsInvalid)(a,f,u)?!1:(this.hasAdditionalChecksForOnListeners&&(f=function(){for(var v=[],h=0;h<arguments.length;h++)v[h]=arguments[h];s.passesVerifyDomainCheck(this&&this.origin)&&s.hasMatchingTargetFrame(this&&this.source)&&l.apply(void 0,v)}),this.listeners.push({eventName:a,handler:f,originalHandler:l}),e.subscribers[u]=e.subscribers[u]||{},e.subscribers[u][a]=e.subscribers[u][a]||[],e.subscribers[u][a].push(f),!0)},r.prototype.off=function(a,l){var s=l;if(this.isDestroyed)return!1;if(this.hasAdditionalChecksForOnListeners)for(var u=0;u<this.listeners.length;u++){var f=this.listeners[u];f.originalHandler===l&&(s=f.handler)}a=this.namespaceEvent(a);var v=this.origin;if((0,e.subscriptionArgsInvalid)(a,s,v))return!1;var h=e.subscribers[v]&&e.subscribers[v][a];if(!h)return!1;for(var u=0;u<h.length;u++)if(h[u]===s)return h.splice(u,1),!0;return!1},r.prototype.teardown=function(){if(!this.isDestroyed){this.isDestroyed=!0;for(var a=0;a<this.listeners.length;a++){var l=this.listeners[a];this.off(l.eventName,l.handler)}this.listeners.length=0}},r.prototype.passesVerifyDomainCheck=function(a){return this.verifyDomain?this.checkOrigin(a):!0},r.prototype.targetFramesAsWindows=function(){return this.limitBroadcastToFramesArray?this.targetFrames.map(function(a){return a instanceof HTMLIFrameElement?a.contentWindow:a}).filter(function(a){return a}):[]},r.prototype.hasMatchingTargetFrame=function(a){if(!this.limitBroadcastToFramesArray)return!0;var l=this.targetFramesAsWindows().find(function(s){return s===a});return!!l},r.prototype.checkOrigin=function(a){var l,s=document.createElement("a");s.href=location.href,s.protocol==="https:"?l=s.host.replace(/:443$/,""):s.protocol==="http:"?l=s.host.replace(/:80$/,""):l=s.host;var u=s.protocol+"//"+l;return u===a?!0:this.verifyDomain?this.verifyDomain(a):!0},r.prototype.namespaceEvent=function(a){return this.channel?"".concat(this.channel,":").concat(a):a},r.Promise=t,r})();return Ws.Framebus=n,Ws}var s5,wp;function CX(){if(wp)return s5;wp=1;function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=Math.random()*16|0,r=t==="x"?n:n&3|8;return r.toString(16)})}return s5=e,s5}var Ep;function xX(){if(Ep)return Ui;Ep=1;var e=Ui&&Ui.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.subscribeReplier=void 0;var t=kx(),n=e(CX());function r(a,l){var s=(0,n.default)();function u(f,v){a(f,v),t.Framebus.target({origin:l}).off(s,u)}return t.Framebus.target({origin:l}).on(s,u),s}return Ui.subscribeReplier=r,Ui}var qs={},zp;function $X(){if(zp)return qs;zp=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.subscriptionArgsInvalid=void 0;var e=so();function t(n,r,a){return(0,e.isntString)(n)||typeof r!="function"?!0:(0,e.isntString)(a)}return qs.subscriptionArgsInvalid=t,qs}var c5={},Op;function MX(){return Op||(Op=1,Object.defineProperty(c5,"__esModule",{value:!0})),c5}var Gs={},Ip;function wX(){if(Ip)return Gs;Ip=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.unpackPayload=void 0;var e=so();function t(n){var r;if(n.data.slice(0,e.prefix.length)!==e.prefix)return!1;try{r=JSON.parse(n.data.slice(e.prefix.length))}catch{return!1}if(r.reply){var a=n.origin,l=n.source,s=r.reply;r.reply=function(f){if(l){var v=(0,e.packagePayload)(s,a,f);v&&l.postMessage(v,a)}}}return r}return Gs.unpackPayload=t,Gs}var Rp;function so(){return Rp||(Rp=1,(function(e){var t=ki&&ki.__createBinding||(Object.create?(function(r,a,l,s){s===void 0&&(s=l);var u=Object.getOwnPropertyDescriptor(a,l);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[l]}}),Object.defineProperty(r,s,u)}):(function(r,a,l,s){s===void 0&&(s=l),r[s]=a[l]})),n=ki&&ki.__exportStar||function(r,a){for(var l in r)l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&t(a,r,l)};Object.defineProperty(e,"__esModule",{value:!0}),n(dX(),e),n(fX(),e),n(vX(),e),n(mX(),e),n(hX(),e),n(gX(),e),n(pX(),e),n(bX(),e),n(yX(),e),n(SX(),e),n(xX(),e),n($X(),e),n(MX(),e),n(wX(),e)})(ki)),ki}var u5,Tp;function EX(){if(Tp)return u5;Tp=1;var e=so(),t=kx();return(0,e.attach)(),u5=t.Framebus,u5}var zX=EX();const Pp=ol(zX),d5=(e,t,n)=>{const r=document.createElement("iframe");return r.id=e,r.src=`${t}${n??""}`,r.style.display="none",document.body.appendChild(r),r},Vx={apps:[],configs:new Map,navigate:()=>{},instances:new Map},Ux=d.createContext(Vx),_1=()=>d.useContext(Ux),OX=({children:e,apps:t,actions:n,data:r,navigation:a})=>{const[l,s]=d.useState({...Vx}),u=new Pp,f=d.useRef(new Map),v=d.useRef(new Map),h=(C,x,S,M,w,z)=>{const I=new URL(x).searchParams.get(sX)??void 0,E=new Pp({origin:x,targetFrames:[S],channel:uX({basePath:z,channel:I})});E.on(gr.SET_CONFIG,O=>{const{config:R}=O;s(N=>({...N,configs:new Map(N.configs.set(C,R)),instances:new Map(N.instances).set(C,{id:C,basePath:z||"",config:R,iframe:S,bus:E})})),E.emit(gr.SET_DATA,r),E.emit(gr.SET_APP_ID,{appId:C}),typeof w<"u"&&E.emit(gr.SET_MODAL_CONTEXT,w)}),E.on(gr.SET_HEIGHT,O=>{const{height:R,id:N}=O,_=document.getElementById(N);_&&(_.style.height=`${R}px`)}),E.on(gr.INVOKE_ACTION,(O,R)=>{const{actionKey:N,args:_}=O;if(n&&n.actions[N])try{Promise.resolve(n.actions[N](..._)).then(j=>R({success:!0,result:j})).catch(j=>{const H=j instanceof Error?j.message:"An error occurred";R({success:!1,error:H})})}catch(j){const H=j instanceof Error?j.message:"An error occurred";R({success:!1,error:H})}else R({success:!1,error:"Action not found"})}),E.on(gr.INVOKE_DEFAULT_ACTION,(O,R)=>{if(!n)return;const{actionKey:N,args:_}=O,{showConfirmationDialog:j,showErrorMessage:H,showModalDialog:U,showToast:D,showRichModal:W}=n;if(N===As.showConfirmationDialog){try{const[X,A]=[..._],k=j?.(X,A,K=>E.emit(gr.ACTION_CONFIRMED,{data:K}),()=>E.emit(gr.ACTION_CANCELED));R?.({success:!0,result:k})}catch(X){const A=X instanceof Error?X.message:"An error occurred";R?.({success:!1,error:A})}return}if(N===As.showErrorMessage){const[X,A]=[..._];try{const k=H?.(X,A);R?.({success:!0,result:k})}catch(k){const K=k instanceof Error?k.message:"An error occurred";R?.({success:!1,error:K})}return}if(N===As.showModalDialog){const[X,A]=[..._];try{const k=U?.(X,A);R?.({success:!0,result:k})}catch(k){const K=k instanceof Error?k.message:"An error occurred";R?.({success:!1,error:K})}return}if(N===As.showToast){const[X,A]=[..._];try{const k=D?.(X,A);R?.({success:!0,result:k})}catch(k){const K=k instanceof Error?k.message:"An error occurred";R?.({success:!1,error:K})}return}if(N===As.showRichModal){const[X,A,k,K]=[..._],V=window.crypto.randomUUID();try{const P=W?.(V,X,A,k,K);R?.({success:!0,result:P});const F=`app-shell-iframe-modal-${V}`,L=d5(F,x);f.current.set(V,L),h(V,x,L,C,A,z),s(T=>({...T,frames:f,modals:T.modals?T.modals.set(V,C):new Map([[V,C]]),modalContext:T.modalContext?T.modalContext.set(V,A):new Map([[V,A]])}))}catch(P){const F=P instanceof Error?P.message:"An error occurred";R?.({success:!1,error:F})}return}}),E.on(gr.NAVIGATE,O=>{const{navigate:R}=a,{path:N,external:_}=O;if(R){M&&n?.closeRichModal?.(C);const j=z&&!_&&!N.startsWith(z)?`${z}${N}`:N;R({id:M||C,path:j,external:_})}}),v.current.set(C,E),s(O=>({...O,buses:v,confirmAction:R=>{E.emit(gr.ACTION_CONFIRMED,{data:R})},cancelAction:()=>{E.emit(gr.ACTION_CANCELED)}}))};d.useEffect(()=>(t.filter(S=>S.type==="full_page").forEach(S=>{const M=`app-shell-iframe-fullpage-${S.id}`,w=d5(M,S.url),z=S.subSlug??new URL(S.url).pathname;f.current.set(S.id,w),s(I=>({...I,frames:f})),h(S.id,S.url,w,void 0,void 0,z)}),t.filter(S=>S.type==="plugin").forEach(S=>{const M=`app-shell-iframe-plugin-${S.id}`,w=d5(M,S.url,S.subSlug),z=S.subSlug??new URL(S.url).pathname;f.current.set(S.id,w),s(I=>({...I,frames:f})),h(S.id,S.url,w,void 0,void 0,z)}),()=>{v.current.forEach(S=>S.teardown()),f.current.forEach(S=>S.remove()),s(S=>({...S,instances:new Map}))}),[t?.length]),d.useEffect(()=>{s(C=>({...C,data:r})),r&&v.current&&v.current.forEach(C=>{C.emit(gr.SET_DATA,r)})},[r]);const y={...l,apps:t,navigate:({path:C,id:x})=>{x?v.current.get(x)?.emit(gr.NAVIGATE_CHILD,{path:C}):u.emit(gr.NAVIGATE_CHILD,{path:C})},updateLocale:C=>{v.current.forEach(x=>{x.emit(gr.LOCALE_CHANGED,{locale:C})})}};return he.jsx(Ux.Provider,{value:y,children:e})},IX=({id:e,path:t})=>{const n=`app-shell-fullpage-container-${e}`,{frames:r,navigate:a}=_1();return d.useEffect(()=>{if(r?.current.has(e)){const l=r.current.get(e),s=document.getElementById(n),u=new URL(l.src).origin;t?l.src=`${u}${t}`:l.src=u;const f={display:"block",width:"100%",height:"100%",border:"none"};Object.assign(l.style,f),s&&(s.innerHTML="",s.appendChild(l))}},[e,r?.current.has(e)]),d.useEffect(()=>{t&&a({path:t,id:e})},[t]),he.jsx("div",{id:n,className:"app-shell-fullpage-container"})},RX=({placeholderId:e,params:t})=>{const{apps:n,configs:r,frames:a,buses:l}=_1(),s=Math.random().toString(16).slice(2),u=Array.from(r.keys()).filter(y=>{const C=r.get(y);return typeof C.placeholderId=="string"?C?.placeholderId===e:C?.placeholderId?.includes(e)}),f=n.filter(y=>u.includes(y.id)),v=f[0];if(!v)return null;f.length>1&&console.warn(`PluginRenderer: Found multiple plugins with placeholderId: ${e}`);const h=`app-shell-plugin-container-${s}`,g=`app-shell-plugin-iframe-${s}`,p=l?.current.get(v.id);return d.useEffect(()=>{(async()=>{const C=a?.current.get(v.id);if(C){const x=document.getElementById(h),S=document.createElement("iframe");if(S.id=g,S.name=g,t){const w=await vp(t);S.src=`${C.src}?c=${w}`}else S.src=C.src;const M={background:"transparent",display:"block",width:"100%",border:"none"};Object.assign(S.style,M),x&&x.appendChild(S),S.onload=async()=>{if(p?.addTargetFrame(S),t){const w=await vp(t);p?.target({channel:w}).emit(gr.SET_PARAMS,t)}}}})()},[e,a]),d.useEffect(()=>{(async()=>{if(t){const x=document.querySelector(`#${h} iframe`)?.src.split("?")[1]?.split("=")[1];p?.target({channel:x}).emit(gr.SET_PARAMS,t)}})()},[t]),he.jsx("div",{id:h,className:"app-shell-plugin-container"})},TX=[{key:"/",label:"Welcome",icon:"dashboard"},{key:"/products-and-catalogs",label:"Products & Catalogs",icon:"fiyatlistesi",disabled:!0},{key:"/orders",label:"Orders",icon:"siparis",disabled:!0}],PX=[{key:"/placeholder-2",label:"Help & Support",icon:"bilgilendirme_servis",disabled:!0},{key:"/placeholder-1",label:"Settings",icon:"ayarlar",disabled:!0}],NX=[{key:"/plugin-test",label:"Plugin Test",icon:"box"}],_X=()=>TX,jX=()=>PX,AX=(e,t)=>e.filter(n=>n.type==="full_page").map(n=>({key:`/external/${n.slug}`,label:n.name,icon:"stoklistesi",children:t.get(n.id)?.menu?.map(r=>{const{child:a,path:l,label:s}=r;return a?!1:{key:`/external/${n.slug}${l}`,label:s,icon:"eksi"}}).filter(Boolean)})),BX=e=>e.some(n=>n.type==="plugin")?NX:[],DX=()=>{const{apps:e,configs:t}=_1(),n=kc(),r=Xu(),[a,l]=d.useState("/"),[s,u]=d.useState([]),f=_X(),v=jX(),h=AX(e,t),g=BX(e),p=d.useMemo(()=>[...f,...h,...g,...v],[f,h,g,v]),{allItemKeys:y,childToParentKey:C}=d.useMemo(()=>{function w(E){if(!E)return[];const O=[];return E.forEach(R=>{"key"in R&&R.key&&O.push(R.key),"children"in R&&R.children&&R.children.forEach(N=>{"key"in N&&N.key&&O.push(N.key)})}),O}const z=w(p),I=new Map;return h.forEach(E=>{"children"in E&&E.children&&E.children.forEach(O=>{"key"in O&&O.key&&"key"in E&&E.key&&I.set(O.key,E.key)})}),{allItemKeys:z,childToParentKey:I}},[p,h]),x=d.useMemo(()=>{const w=new Set;return h.forEach(z=>{"key"in z&&z.key&&"children"in z&&Array.isArray(z.children)&&z.children.length>0&&w.add(z.key)}),w},[h]);d.useEffect(()=>{const w=n.pathname,z=y.filter(E=>typeof E=="string"&&w.startsWith(E)).sort((E,O)=>O.length-E.length)[0];z&&l(z);const I=z?C.get(z):void 0;I?u([I]):h.some(E=>{const O="key"in E&&E.key===z,R="children"in E&&Array.isArray(E.children)&&E.children.length>0;return O&&R})&&u([z])},[n,y,C,h]);const S=w=>{const z=w.key;if(x.has(z)){u(E=>E.includes(z)?[]:[z]),l(z);return}const I=C.get(z);I&&u([I]),z.includes("external")||u([]),r(z)},M=w=>{if(w.length===0){u([]);return}u([w[w.length-1]])};return he.jsx("div",{children:he.jsx(SW,{mode:"inline",selectedKeys:[a],items:p,onClick:S,triggerSubMenuAction:"click",theme:"dark",openKeys:s,onOpenChange:M})})},LX=({children:e})=>{const[t,n]=d.useState(!1),[r,a]=d.useState(!0),l=()=>n(!t),s=()=>a(!r);return he.jsxs(Kl,{children:[he.jsx(Kl.Sider,{collapsed:t,brandImageUrl:"/logo.png",iconUrl:"/symbol.png",children:he.jsx(DX,{})}),he.jsxs(Kl,{children:[he.jsx(Kl.Header,{children:he.jsx(lX,{onToggleLeftSider:l,onToggleRightSider:s})}),he.jsx(Kl.Content,{children:e})]}),he.jsx(Kl.Sider,{collapsed:r,collapsedWidth:0,position:"right",children:he.jsxs(yd,{className:"log-messages",children:[he.jsxs("div",{className:"log-messages-item",children:[he.jsx(l0,{type:"success",children:"Development server running"}),he.jsx(l0,{children:new Date().toLocaleTimeString()})]}),he.jsxs("div",{className:"log-messages-item",children:[he.jsx(l0,{children:"Shell environment active"}),he.jsx(l0,{children:"Ready for testing"})]})]})})]})},HX=({config:e,children:t})=>{const[n,r]=P8.useNotification(),[a]=oX(),l=Xu(),s=e.apps.map((p,y)=>({id:y+1,url:p.url,slug:p.name.toLowerCase().replace(/\s+/g,"-"),path:"",type:p.type,name:p.navTitle||p.name})),u={navigate:({id:p,path:y,external:C})=>{const x=s.find(M=>M.id===p);if(!x)return;const S=C?y:`/external/${x.slug}${y||""}`;l(S)}},f={lng:"en",username:"Developer",searchParams:Object.fromEntries([...a]),...e.data||{}},g={...{showModalDialog:()=>{},showToast:(p,y)=>{y==="loading"||y==="destroy"||n[y]({message:p,placement:"top"})},showErrorMessage:(p,y)=>{n.error({message:p,description:y,placement:"top"})},showRichModal:()=>{}},actions:{...{reloadPage:()=>window.location.reload(),logMessage:p=>{try{const y=JSON.parse(localStorage.getItem("logMessages")||"[]");localStorage.setItem("logMessages",JSON.stringify([...y,p]))}catch{console.error("Failed to log message")}}}}};return he.jsxs(OX,{apps:s,navigation:u,data:f,actions:g,children:[t,r]})},Wx=({children:e})=>he.jsx("div",{className:"px-8 py-8",children:e}),FX=({title:e,description:t,actions:n,className:r})=>he.jsxs(dW,{justify:"space-between",align:"flex-start",className:r,style:{padding:"18px 30px",borderBlockEnd:"solid 1px var(--color-gray-900)"},children:[he.jsxs(yd,{direction:"vertical",size:4,children:[he.jsx(hW,{level:4,style:{margin:0},children:e}),t&&he.jsx(mW,{type:"secondary",children:t})]}),n&&he.jsx(yd,{children:n})]}),kX=({data:e})=>{const t={...e};return delete t.lng,delete t.username,delete t.searchParams,he.jsx("pre",{style:{backgroundColor:"#1e1e1e",color:"#d4d4d4",padding:"16px",borderRadius:"6px",border:"1px solid #424b6b",fontSize:"13px",fontFamily:'"SF Mono", "Monaco", "Inconsolata", "Roboto Mono", "Source Code Pro", monospace',lineHeight:"1.5",overflow:"auto",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:Object.keys(t).length>0?JSON.stringify(t,null,2):`// No custom data configured in shell.config.js
|
|
417
417
|
// Add data to the "data" field to share it with your application`})},VX=()=>{const{apps:e}=_1(),t=window.__SHELL_CONFIG__||{},n=t.data;return he.jsxs("div",{children:[he.jsx(i0,{title:"Applications Configuration",className:"mb-8",children:e.length===0?he.jsx("p",{style:{color:"#999"},children:"No applications configured"}):he.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[e.map((r,a)=>he.jsxs("div",{style:{borderBottom:a<e.length-1?"1px solid #e0e0e0":"none",paddingBottom:a<e.length-1?"20px":"0"},children:[he.jsxs("h4",{style:{margin:"0 0 16px 0"},children:[r.name," ",e.length>1&&`(App ${a+1})`]}),he.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[he.jsxs("div",{children:[he.jsx("strong",{children:"Application Type:"}),he.jsx("p",{style:{margin:"12px 0 4px 0"},children:he.jsx(sG,{color:r.type==="full_page"?"blue":"green",children:r.type==="full_page"?"Full Page":"Plugin"})})]}),he.jsxs("div",{children:[he.jsx("strong",{children:"Development URL:"}),he.jsx("p",{style:{margin:"12px 0 4px 0",color:"#999",fontFamily:"monospace",fontSize:"13px"},children:r.url})]})]})]},r.id)),he.jsxs("div",{style:{marginTop:"10px"},children:[he.jsx("strong",{children:"Shell Theme:"}),he.jsx("p",{style:{margin:"12px 0 4px 0",color:"#999"},children:t?.shell?.theme})]})]})}),he.jsx(i0,{title:"Shared Data",className:"mb-8",children:n&&he.jsx(kX,{data:n})}),he.jsx(i0,{title:"Development Instructions",className:"mb-8",children:he.jsxs("div",{style:{lineHeight:"1.6"},children:[he.jsx("h4",{style:{margin:"0 0 8px 0"},children:"Getting Started:"}),he.jsxs("ol",{style:{paddingLeft:"20px"},children:[he.jsxs("li",{children:["Make sure your application",e.length>1?"s are":" is"," ","running at"," ",he.jsx("code",{children:e.length>0?e[0].url:"http://localhost:4001"}),e.length>1&&he.jsxs(he.Fragment,{children:[" and ",e.slice(1).map((r,a)=>he.jsxs("span",{children:[a>0&&", ",he.jsx("code",{children:r.url})]},r.id))]})]}),he.jsx("li",{children:'Click "Launch Application" to load your app in the shell environment'}),e.some(r=>r.type==="plugin")&&he.jsx("li",{children:'Use "Test Plugin Integration" to test your plugin in different placeholder configurations'}),he.jsx("li",{children:"The shell provides a realistic integration environment for testing"})]}),he.jsx(tW,{}),he.jsxs("h4",{style:{margin:"16px 0 8px 0"},children:["Application Types:"," ",e.map((r,a)=>he.jsxs("span",{children:[a>0&&", ",r.type==="full_page"?"Full Page":"Plugin"]},r.id))]}),e.some(r=>r.type==="full_page")&&he.jsx("p",{style:{margin:0,color:"#666"},children:"Full page applications render as complete pages within the shell environment, providing full control over the content area and routing."}),e.some(r=>r.type==="plugin")&&he.jsx("p",{style:{margin:"8px 0 0 0",color:"#666"},children:"Plugin applications render within designated placeholders in the host application, providing component-level integration capabilities."})]})}),he.jsx(i0,{title:"Component Usage",children:he.jsxs("div",{style:{lineHeight:"1.6"},children:[he.jsx("h4",{style:{margin:"0 0 8px 0"},children:"@akinon/ui-* Components:"}),he.jsx("p",{style:{margin:"0 0 16px 0",color:"#999"},children:"This shell environment includes all Akinon UI components. You can use them in your application by importing from the respective packages."}),he.jsx("pre",{style:{backgroundColor:"#1e1e1e",color:"#d4d4d4",padding:"16px",borderRadius:"6px",border:"1px solid #424b6b",fontSize:"13px",fontFamily:'"SF Mono", "Monaco", "Inconsolata", "Roboto Mono", "Source Code Pro", monospace',lineHeight:"1.5",overflow:"auto",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:`// Import components from @akinon/ui-react (main package)
|
|
418
418
|
import { Button, Card, Input, Modal } from '@akinon/ui-react';
|
|
419
419
|
|
package/dist/index.html
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
box-sizing: border-box;
|
|
25
25
|
}
|
|
26
26
|
</style>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-DHg_jhdM.js"></script>
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/assets/index-CX4XmW02.css">
|
|
29
29
|
</head>
|
|
30
30
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/ui-shell-dev",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Development shell application for Akinon UI Protocol plugins",
|
|
6
6
|
"type": "module",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"react-dom": "*",
|
|
22
22
|
"react-router-dom": "^6.28.0",
|
|
23
23
|
"vite": "*",
|
|
24
|
+
"@akinon/app-shell": "1.4.1",
|
|
25
|
+
"@akinon/fonts-jost-variable": "2.1.0",
|
|
24
26
|
"@akinon/icons": "1.1.0",
|
|
25
27
|
"@akinon/ui-react": "1.3.1",
|
|
26
|
-
"@akinon/ui-utils": "1.1.0"
|
|
27
|
-
"@akinon/fonts-jost-variable": "2.1.0",
|
|
28
|
-
"@akinon/app-shell": "1.4.0"
|
|
28
|
+
"@akinon/ui-utils": "1.1.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/cors": "^2.8.17",
|