@nocobase/app 2.1.0-beta.24 → 2.1.0-beta.25

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
- "use strict";(globalThis.webpackChunknocobase=globalThis.webpackChunknocobase||[]).push([["7531"],{80566(e,a,t){t.r(a),t.d(a,{default:()=>h});var n=t(74848),r=t(40532),l=t(96540),o=t(85100),i=t(36098),u=t(47767);t(2077);var c=t(92545);let s=e=>{let{children:a}=e,t=(0,r.useFlowEngine)(),o=(0,i.n)(),s=(0,u.useNavigate)(),h=(0,u.useLocation)(),d=(0,u.useParams)(),[m,p]=(0,l.useState)(!1),w=(0,l.useRef)(!1),f=t.context.routeRepository,g=(0,l.useMemo)(()=>"/admin"===(0,c.FY)(h.pathname,o.router.getBasename()),[o,h.pathname]);return((0,l.useEffect)(()=>{w.current=!1},[h.pathname,h.search,h.hash,d.name]),(0,l.useEffect)(()=>{let e=!0;return(async()=>{var a,t,n,r;if(p(!1),!g&&!d.name){e&&p(!0);return}if(!(null==f||null==(a=f.isAccessibleLoaded)?void 0:a.call(f)))try{await (null==f||null==(n=f.ensureAccessibleLoaded)?void 0:n.call(f))}catch(a){e&&p(!0);return}if(!e||w.current)return;if(d.name){let a=null==f||null==(r=f.getRouteBySchemaUid)?void 0:r.call(f,d.name);if((null==a?void 0:a.type)==="page"){let e=(0,c.Yj)({app:o,route:a,location:{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash},preserveLocationState:!0});if("document"===e.navigationMode&&e.runtimePath){w.current=!0,window.location.replace(e.runtimePath);return}}e&&p(!0);return}let l=(0,c.MM)((null==f||null==(t=f.listAccessible)?void 0:t.call(f))||[]);if(!l){e&&p(!0);return}let i=(0,c.Yj)({app:o,route:l});if(!i.runtimePath){e&&p(!0);return}(w.current=!0,"document"===i.navigationMode)?window.location.replace(i.runtimePath):s((0,c.FY)(i.runtimePath,o.router.getBasename()),{replace:!0})})(),()=>{e=!1}},[o,t,g,h.hash,h.pathname,h.search,s,d.name,f]),m)?(0,n.jsx)(n.Fragment,{children:a}):null},h=e=>{let a=(0,r.useFlowEngine)(),t=(0,o.t_Y)(a,{create:!0,props:e,use:o.pXX});if(!t)throw Error("[NocoBase] Failed to create admin-layout-model.");return(0,n.jsx)(s,{children:(0,n.jsx)(r.FlowModelRenderer,{model:t})})}}}]);
1
+ "use strict";(globalThis.webpackChunknocobase=globalThis.webpackChunknocobase||[]).push([["7531"],{80566(e,a,t){t.r(a),t.d(a,{default:()=>h});var n=t(74848),r=t(40532),l=t(96540),o=t(46578),i=t(36098),u=t(47767);t(2077);var c=t(92545);let s=e=>{let{children:a}=e,t=(0,r.useFlowEngine)(),o=(0,i.n)(),s=(0,u.useNavigate)(),h=(0,u.useLocation)(),d=(0,u.useParams)(),[m,p]=(0,l.useState)(!1),w=(0,l.useRef)(!1),f=t.context.routeRepository,g=(0,l.useMemo)(()=>"/admin"===(0,c.FY)(h.pathname,o.router.getBasename()),[o,h.pathname]);return((0,l.useEffect)(()=>{w.current=!1},[h.pathname,h.search,h.hash,d.name]),(0,l.useEffect)(()=>{let e=!0;return(async()=>{var a,t,n,r;if(p(!1),!g&&!d.name){e&&p(!0);return}if(!(null==f||null==(a=f.isAccessibleLoaded)?void 0:a.call(f)))try{await (null==f||null==(n=f.ensureAccessibleLoaded)?void 0:n.call(f))}catch(a){e&&p(!0);return}if(!e||w.current)return;if(d.name){let a=null==f||null==(r=f.getRouteBySchemaUid)?void 0:r.call(f,d.name);if((null==a?void 0:a.type)==="page"){let e=(0,c.Yj)({app:o,route:a,location:{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash},preserveLocationState:!0});if("document"===e.navigationMode&&e.runtimePath){w.current=!0,window.location.replace(e.runtimePath);return}}e&&p(!0);return}let l=(0,c.MM)((null==f||null==(t=f.listAccessible)?void 0:t.call(f))||[]);if(!l){e&&p(!0);return}let i=(0,c.Yj)({app:o,route:l});if(!i.runtimePath){e&&p(!0);return}(w.current=!0,"document"===i.navigationMode)?window.location.replace(i.runtimePath):s((0,c.FY)(i.runtimePath,o.router.getBasename()),{replace:!0})})(),()=>{e=!1}},[o,t,g,h.hash,h.pathname,h.search,s,d.name,f]),m)?(0,n.jsx)(n.Fragment,{children:a}):null},h=e=>{let a=(0,r.useFlowEngine)(),t=(0,o.t_Y)(a,{create:!0,props:e,use:o.pXX});if(!t)throw Error("[NocoBase] Failed to create admin-layout-model.");return(0,n.jsx)(s,{children:(0,n.jsx)(r.FlowModelRenderer,{model:t})})}}}]);