strapi-admin-portal 0.1.2 → 0.1.3

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/dist/index.js CHANGED
@@ -57,4 +57,4 @@ Example:
57
57
  Perhaps you're looking to import 'styled-components/native'?
58
58
  Read more about this at https://www.styled-components.com/docs/basics#react-native`);var ht="__sc-".concat(Q,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[ht]||(window[ht]=0),window[ht]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
59
59
 
60
- See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info.`),window[ht]+=1);var as=Cr(ns()),Ot=require("react/jsx-runtime"),eh=({children:e,store:t,configurations:r,targetId:n})=>{let o=(0,z.useSyncExternalStore)(t.subscribe,t.getState),i=o.admin_app.theme.currentTheme||"light",a=o.admin_app.language.locale||"en",c=r.translations||{},[u,d]=(0,z.useState)(void 0),[l,h]=(0,z.useState)(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=(0,z.useMemo)(()=>(0,as.default)(c[a],c.en),[a,c]),S=(0,z.useMemo)(()=>r.themes[i==="system"?l:i],[i,l,r.themes]);return(0,z.useEffect)(()=>{let y=matchMedia("(prefers-color-scheme: dark)"),w=I=>{h(I.matches?"dark":"light")};return y.addEventListener("change",w),()=>y.removeEventListener("change",w)},[]),(0,z.useLayoutEffect)(()=>{let y=document.createElement("style");return y.setAttribute("data-mfe-id",n),document.head.appendChild(y),d(y),()=>{y?.parentNode?.removeChild(y)}},[n]),u?(0,Ot.jsx)(Xt,{target:u,children:(0,Ot.jsx)(is.DesignSystemProvider,{theme:S,locale:a,children:(0,Ot.jsx)(os.IntlProvider,{locale:a,messages:_,children:e})})}):null},ss=eh;var vr=require("react/jsx-runtime"),us=async(e,t,r)=>{let n=t.domInjections;if(!n){console.warn("Injection system not initialised. Please call initialiseInjections(app) before registering injection routes.");return}document.querySelector(`#${r.id}`)||n.removeRoot(r.id);let i=br(r.route,e.location.pathname);if(!i)return;let a=r.Component(),c=await ps(r.selector);if(!c||!br(r.route,window.location.pathname))return;if(!n.getRoot(r.id)){let h=document.getElementById(r.id);h||(h=document.createElement("div"),h.id=r.id,c.after(h)),n.setRoot(r.id,(0,cs.createRoot)(h))}let d=(await a).default,l=n.getRoot(r.id);l&&l.render((0,vr.jsx)(ss,{store:t.store,configurations:t.configurations,targetId:r.id,children:(0,vr.jsx)(d,{...i})}))};var fs=async e=>{let t=e.router,r=0;for(;!t?.router?.state?.location&&r<100;)await new Promise(n=>setTimeout(n,10)),r++;if(!t?.router?.state?.location){console.warn("Strapi router not ready after 5s, skipping injection initialization.");return}t.router.subscribe(n=>ls(n,e)),ls(t.router.state,e)},ls=(e,t)=>{let r=t.domInjections?.routes||[];Promise.all(r.map(n=>us(e,t,n)))},ps=(e,t=5e3)=>new Promise(r=>{let n=document.querySelector(e);if(n)return r(n);let o=new MutationObserver(()=>{let i=document.querySelector(e);i&&(o.disconnect(),r(i))});o.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{o.disconnect(),r(null)},t)}),ds=(e,t)=>{if(!t.domInjections?.routes){console.warn("Injection system not initialised. Please call initialiseInjections(app) before registering injection routes.");return}let{id:r,...n}=e;if(r&&t.domInjections.routes.some(i=>i.id===r)){console.warn(`Injection route with id ${r} already exists. Skipping registration.`);return}let o=r||`injection-${Math.random().toString(36).substring(2,9)}`;t.domInjections.routes.push({id:o,...n})},hs=(e,t)=>{if(!t.domInjections?.routes){console.warn("Injection system not initialised. Please call initialiseInjections(app) before unregistering injection routes.");return}let r=t.domInjections.routes.findIndex(n=>n.id===e);if(r===-1){console.warn(`Injection route with id ${e} does not exist. Skipping unregistration.`);return}t.domInjections.routes.splice(r,1),t.domInjections.removeRoot(e)},br=(e,t)=>{let r=e.split("/").filter(Boolean),n=t.split("/").filter(Boolean);if(r.length!==n.length)return null;let o={};for(let i=0;i<r.length;i++)if(r[i].startsWith(":"))o[r[i].replace(/^:/,"")]=n[i];else if(r[i]!==n[i])return null;return o};var th=e=>{let t=e.domInjections;if(t)return t;fs(e);let r={routes:[],roots:{},registerRoute:n=>ds(n,e),unregisterRoute:n=>hs(n,e),getRoot:n=>e.domInjections?.roots[n],setRoot:(n,o)=>{e.domInjections&&(e.domInjections.roots[n]=o)},removeRoot:n=>{if(!e.domInjections)return;let o=e.domInjections.roots[n];o&&(setTimeout(()=>o.unmount(),0),delete e.domInjections.roots[n])}};return e.domInjections=r,r};0&&(module.exports={initialiseInjections});
60
+ See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info.`),window[ht]+=1);var as=Cr(ns()),Ot=require("react/jsx-runtime"),eh=({children:e,store:t,configurations:r,targetId:n})=>{let o=(0,z.useSyncExternalStore)(t.subscribe,t.getState),i=o.admin_app.theme.currentTheme||"light",a=o.admin_app.language.locale||"en",c=r.translations||{},[u,d]=(0,z.useState)(void 0),[l,h]=(0,z.useState)(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=(0,z.useMemo)(()=>(0,as.default)(c[a],c.en),[a,c]),S=(0,z.useMemo)(()=>r.themes[i==="system"?l:i],[i,l,r.themes]);return(0,z.useEffect)(()=>{let y=matchMedia("(prefers-color-scheme: dark)"),w=I=>{h(I.matches?"dark":"light")};return y.addEventListener("change",w),()=>y.removeEventListener("change",w)},[]),(0,z.useLayoutEffect)(()=>{let y=document.createElement("style");return y.setAttribute("data-mfe-id",n),document.head.appendChild(y),d(y),()=>{y?.parentNode?.removeChild(y)}},[n]),u?(0,Ot.jsx)(is.DesignSystemProvider,{theme:S,locale:a,children:(0,Ot.jsx)(Xt,{target:u,children:(0,Ot.jsx)(os.IntlProvider,{locale:a,messages:_,children:e})})}):null},ss=eh;var vr=require("react/jsx-runtime"),us=async(e,t,r)=>{let n=t.domInjections;if(!n){console.warn("Injection system not initialised. Please call initialiseInjections(app) before registering injection routes.");return}document.querySelector(`#${r.id}`)||n.removeRoot(r.id);let i=br(r.route,e.location.pathname);if(!i)return;let a=r.Component(),c=await ps(r.selector);if(!c||!br(r.route,window.location.pathname))return;if(!n.getRoot(r.id)){let h=document.getElementById(r.id);h||(h=document.createElement("div"),h.id=r.id,c.after(h)),n.setRoot(r.id,(0,cs.createRoot)(h))}let d=(await a).default,l=n.getRoot(r.id);l&&l.render((0,vr.jsx)(ss,{store:t.store,configurations:t.configurations,targetId:r.id,children:(0,vr.jsx)(d,{...i})}))};var fs=async e=>{let t=e.router,r=0;for(;!t?.router?.state?.location&&r<100;)await new Promise(n=>setTimeout(n,10)),r++;if(!t?.router?.state?.location){console.warn("Strapi router not ready after 5s, skipping injection initialization.");return}t.router.subscribe(n=>ls(n,e)),ls(t.router.state,e)},ls=(e,t)=>{let r=t.domInjections?.routes||[];Promise.all(r.map(n=>us(e,t,n)))},ps=(e,t=5e3)=>new Promise(r=>{let n=document.querySelector(e);if(n)return r(n);let o=new MutationObserver(()=>{let i=document.querySelector(e);i&&(o.disconnect(),r(i))});o.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{o.disconnect(),r(null)},t)}),ds=(e,t)=>{if(!t.domInjections?.routes){console.warn("Injection system not initialised. Please call initialiseInjections(app) before registering injection routes.");return}let{id:r,...n}=e;if(r&&t.domInjections.routes.some(i=>i.id===r)){console.warn(`Injection route with id ${r} already exists. Skipping registration.`);return}let o=r||`injection-${Math.random().toString(36).substring(2,9)}`;t.domInjections.routes.push({id:o,...n})},hs=(e,t)=>{if(!t.domInjections?.routes){console.warn("Injection system not initialised. Please call initialiseInjections(app) before unregistering injection routes.");return}let r=t.domInjections.routes.findIndex(n=>n.id===e);if(r===-1){console.warn(`Injection route with id ${e} does not exist. Skipping unregistration.`);return}t.domInjections.routes.splice(r,1),t.domInjections.removeRoot(e)},br=(e,t)=>{let r=e.split("/").filter(Boolean),n=t.split("/").filter(Boolean);if(r.length!==n.length)return null;let o={};for(let i=0;i<r.length;i++)if(r[i].startsWith(":"))o[r[i].replace(/^:/,"")]=n[i];else if(r[i]!==n[i])return null;return o};var th=e=>{let t=e.domInjections;if(t)return t;fs(e);let r={routes:[],roots:{},registerRoute:n=>ds(n,e),unregisterRoute:n=>hs(n,e),getRoot:n=>e.domInjections?.roots[n],setRoot:(n,o)=>{e.domInjections&&(e.domInjections.roots[n]=o)},removeRoot:n=>{if(!e.domInjections)return;let o=e.domInjections.roots[n];o&&(setTimeout(()=>o.unmount(),0),delete e.domInjections.roots[n])}};return e.domInjections=r,r};0&&(module.exports={initialiseInjections});
package/dist/index.mjs CHANGED
@@ -57,4 +57,4 @@ Example:
57
57
  Perhaps you're looking to import 'styled-components/native'?
58
58
  Read more about this at https://www.styled-components.com/docs/basics#react-native`);var ft="__sc-".concat(J,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[ft]||(window[ft]=0),window[ft]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
59
59
 
60
- See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info.`),window[ft]+=1);var rs=bs(Qa());import{jsx as mr}from"react/jsx-runtime";var nh=({children:e,store:t,configurations:r,targetId:n})=>{let o=Jd(t.subscribe,t.getState),i=o.admin_app.theme.currentTheme||"light",a=o.admin_app.language.locale||"en",c=r.translations||{},[u,d]=es(void 0),[l,h]=es(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=ts(()=>(0,rs.default)(c[a],c.en),[a,c]),S=ts(()=>r.themes[i==="system"?l:i],[i,l,r.themes]);return Qd(()=>{let y=matchMedia("(prefers-color-scheme: dark)"),w=I=>{h(I.matches?"dark":"light")};return y.addEventListener("change",w),()=>y.removeEventListener("change",w)},[]),eh(()=>{let y=document.createElement("style");return y.setAttribute("data-mfe-id",n),document.head.appendChild(y),d(y),()=>{y?.parentNode?.removeChild(y)}},[n]),u?mr(Wt,{target:u,children:mr(rh,{theme:S,locale:a,children:mr(th,{locale:a,messages:_,children:e})})}):null},ns=nh;import{jsx as os}from"react/jsx-runtime";var is=async(e,t,r)=>{let n=t.domInjections;if(!n){console.warn("Injection system not initialised. Please call initialiseInjections(app) before registering injection routes.");return}document.querySelector(`#${r.id}`)||n.removeRoot(r.id);let i=yr(r.route,e.location.pathname);if(!i)return;let a=r.Component(),c=await as(r.selector);if(!c||!yr(r.route,window.location.pathname))return;if(!n.getRoot(r.id)){let h=document.getElementById(r.id);h||(h=document.createElement("div"),h.id=r.id,c.after(h)),n.setRoot(r.id,oh(h))}let d=(await a).default,l=n.getRoot(r.id);l&&l.render(os(ns,{store:t.store,configurations:t.configurations,targetId:r.id,children:os(d,{...i})}))};var cs=async e=>{let t=e.router,r=0;for(;!t?.router?.state?.location&&r<100;)await new Promise(n=>setTimeout(n,10)),r++;if(!t?.router?.state?.location){console.warn("Strapi router not ready after 5s, skipping injection initialization.");return}t.router.subscribe(n=>ss(n,e)),ss(t.router.state,e)},ss=(e,t)=>{let r=t.domInjections?.routes||[];Promise.all(r.map(n=>is(e,t,n)))},as=(e,t=5e3)=>new Promise(r=>{let n=document.querySelector(e);if(n)return r(n);let o=new MutationObserver(()=>{let i=document.querySelector(e);i&&(o.disconnect(),r(i))});o.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{o.disconnect(),r(null)},t)}),us=(e,t)=>{if(!t.domInjections?.routes){console.warn("Injection system not initialised. Please call initialiseInjections(app) before registering injection routes.");return}let{id:r,...n}=e;if(r&&t.domInjections.routes.some(i=>i.id===r)){console.warn(`Injection route with id ${r} already exists. Skipping registration.`);return}let o=r||`injection-${Math.random().toString(36).substring(2,9)}`;t.domInjections.routes.push({id:o,...n})},ps=(e,t)=>{if(!t.domInjections?.routes){console.warn("Injection system not initialised. Please call initialiseInjections(app) before unregistering injection routes.");return}let r=t.domInjections.routes.findIndex(n=>n.id===e);if(r===-1){console.warn(`Injection route with id ${e} does not exist. Skipping unregistration.`);return}t.domInjections.routes.splice(r,1),t.domInjections.removeRoot(e)},yr=(e,t)=>{let r=e.split("/").filter(Boolean),n=t.split("/").filter(Boolean);if(r.length!==n.length)return null;let o={};for(let i=0;i<r.length;i++)if(r[i].startsWith(":"))o[r[i].replace(/^:/,"")]=n[i];else if(r[i]!==n[i])return null;return o};var By=e=>{let t=e.domInjections;if(t)return t;cs(e);let r={routes:[],roots:{},registerRoute:n=>us(n,e),unregisterRoute:n=>ps(n,e),getRoot:n=>e.domInjections?.roots[n],setRoot:(n,o)=>{e.domInjections&&(e.domInjections.roots[n]=o)},removeRoot:n=>{if(!e.domInjections)return;let o=e.domInjections.roots[n];o&&(setTimeout(()=>o.unmount(),0),delete e.domInjections.roots[n])}};return e.domInjections=r,r};export{By as initialiseInjections};
60
+ See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info.`),window[ft]+=1);var rs=bs(Qa());import{jsx as mr}from"react/jsx-runtime";var nh=({children:e,store:t,configurations:r,targetId:n})=>{let o=Jd(t.subscribe,t.getState),i=o.admin_app.theme.currentTheme||"light",a=o.admin_app.language.locale||"en",c=r.translations||{},[u,d]=es(void 0),[l,h]=es(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=ts(()=>(0,rs.default)(c[a],c.en),[a,c]),S=ts(()=>r.themes[i==="system"?l:i],[i,l,r.themes]);return Qd(()=>{let y=matchMedia("(prefers-color-scheme: dark)"),w=I=>{h(I.matches?"dark":"light")};return y.addEventListener("change",w),()=>y.removeEventListener("change",w)},[]),eh(()=>{let y=document.createElement("style");return y.setAttribute("data-mfe-id",n),document.head.appendChild(y),d(y),()=>{y?.parentNode?.removeChild(y)}},[n]),u?mr(rh,{theme:S,locale:a,children:mr(Wt,{target:u,children:mr(th,{locale:a,messages:_,children:e})})}):null},ns=nh;import{jsx as os}from"react/jsx-runtime";var is=async(e,t,r)=>{let n=t.domInjections;if(!n){console.warn("Injection system not initialised. Please call initialiseInjections(app) before registering injection routes.");return}document.querySelector(`#${r.id}`)||n.removeRoot(r.id);let i=yr(r.route,e.location.pathname);if(!i)return;let a=r.Component(),c=await as(r.selector);if(!c||!yr(r.route,window.location.pathname))return;if(!n.getRoot(r.id)){let h=document.getElementById(r.id);h||(h=document.createElement("div"),h.id=r.id,c.after(h)),n.setRoot(r.id,oh(h))}let d=(await a).default,l=n.getRoot(r.id);l&&l.render(os(ns,{store:t.store,configurations:t.configurations,targetId:r.id,children:os(d,{...i})}))};var cs=async e=>{let t=e.router,r=0;for(;!t?.router?.state?.location&&r<100;)await new Promise(n=>setTimeout(n,10)),r++;if(!t?.router?.state?.location){console.warn("Strapi router not ready after 5s, skipping injection initialization.");return}t.router.subscribe(n=>ss(n,e)),ss(t.router.state,e)},ss=(e,t)=>{let r=t.domInjections?.routes||[];Promise.all(r.map(n=>is(e,t,n)))},as=(e,t=5e3)=>new Promise(r=>{let n=document.querySelector(e);if(n)return r(n);let o=new MutationObserver(()=>{let i=document.querySelector(e);i&&(o.disconnect(),r(i))});o.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{o.disconnect(),r(null)},t)}),us=(e,t)=>{if(!t.domInjections?.routes){console.warn("Injection system not initialised. Please call initialiseInjections(app) before registering injection routes.");return}let{id:r,...n}=e;if(r&&t.domInjections.routes.some(i=>i.id===r)){console.warn(`Injection route with id ${r} already exists. Skipping registration.`);return}let o=r||`injection-${Math.random().toString(36).substring(2,9)}`;t.domInjections.routes.push({id:o,...n})},ps=(e,t)=>{if(!t.domInjections?.routes){console.warn("Injection system not initialised. Please call initialiseInjections(app) before unregistering injection routes.");return}let r=t.domInjections.routes.findIndex(n=>n.id===e);if(r===-1){console.warn(`Injection route with id ${e} does not exist. Skipping unregistration.`);return}t.domInjections.routes.splice(r,1),t.domInjections.removeRoot(e)},yr=(e,t)=>{let r=e.split("/").filter(Boolean),n=t.split("/").filter(Boolean);if(r.length!==n.length)return null;let o={};for(let i=0;i<r.length;i++)if(r[i].startsWith(":"))o[r[i].replace(/^:/,"")]=n[i];else if(r[i]!==n[i])return null;return o};var By=e=>{let t=e.domInjections;if(t)return t;cs(e);let r={routes:[],roots:{},registerRoute:n=>us(n,e),unregisterRoute:n=>ps(n,e),getRoot:n=>e.domInjections?.roots[n],setRoot:(n,o)=>{e.domInjections&&(e.domInjections.roots[n]=o)},removeRoot:n=>{if(!e.domInjections)return;let o=e.domInjections.roots[n];o&&(setTimeout(()=>o.unmount(),0),delete e.domInjections.roots[n])}};return e.domInjections=r,r};export{By as initialiseInjections};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-admin-portal",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "The Portal Gun for Strapi Admin. Seamlessly mount React components into specific DOM selectors across any admin route.",
5
5
  "keywords": [
6
6
  "strapi",