@appshell/react-shell 1.0.0-alpha.83 → 1.0.0-alpha.84

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/58.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[58,677],{58(e,r,t){t.r(r),t.d(r,{RemoteProvider:()=>h,RemoteSlot:()=>g,jsonResource:()=>$,useRemote:()=>y});var o=t(220),n=t(650);let s=!1;const a=new Set,c=async e=>{const{loader:r}=e;if("ModuleFederation"!==r.kind)throw new Error(`No loader for kind '${r.kind}'.`);return(async(e,r,t,o="default")=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${r}, shareScope: ${o} }`),s||(s=!0,(0,n.getInstance)()||(0,n.init)({name:"Appshell",remotes:[]})),a.has(e)||(a.add(e),(0,n.registerRemotes)([{name:e,entry:t}]));const c=r.replace(/^\.\//,""),l=await(0,n.loadRemote)(`${e}/${c}`);if(!l)throw new Error(`Failed to find module container ${e}`);return console.debug(`Appshell component loaded: { scope: ${e}, module: ${r}, shareScope: ${o} }`),l.default})(r.scope,r.module,e.remoteEntryUrl,r.shareScope)},l=(e={})=>{const r=e.composition??("undefined"==typeof window?void 0:window.__appshell_config__),t=e.resolver??((...e)=>async r=>{for(const t of e){const e=await t(r);if(e)return e}})((e=>async r=>{const t=e?.remotes[r];if(e&&t)return{remote:t,vars:e.vars[t.loader.scope]??{}}})(r),((e,r="")=>async t=>{if(!e)return;const o=`${r}/v1/applications/${e.applicationId}/remotes/${t}`,n=await fetch(o,{credentials:"include"});if(!n.ok)return;const s=await n.json();return{remote:s,vars:e.vars[s.loader.scope]??{}}})(r));return async e=>{const r=r=>new Error(`Failed to load component '${e}'. ${r?.toString()}`);let n;try{n=await t(e)}catch(e){throw r(e)}if(!n)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:s,vars:a}=n;try{return(0,o.setVars)(s.loader.scope,a),[await c(s),s]}catch(e){throw r(e)}}};(Object.getOwnPropertyDescriptor(l,"name")||{}).writable||Object.defineProperty(l,"name",{value:"default",configurable:!0});const i=l;var d=t(488),p=t.n(d),u=t(986);const f=(0,d.createContext)(void 0),h=({remote:e,children:r})=>(0,u.jsx)(f.Provider,{value:e,children:r});h.defaultProps={remote:void 0},f.Consumer;const m=f,w=({remote:e,reason:r})=>(0,u.jsxs)("div",{style:{border:"3px solid red"},children:[(0,u.jsx)("h5",{children:`Error loading Appshell component '${e}.'`}),(0,u.jsx)("span",{style:{fontSize:"1rem"},children:r})]}),b=({remote:e,fallback:r,...t})=>{const[o,n]=(0,d.useState)();return(0,d.useEffect)((()=>{let r=!1;const o=i();return n(void 0),async function(){try{const[s,a]=await o(e);if(r||!s)return;n((0,u.jsx)(h,{remote:a,children:(0,u.jsx)(s,{...t})}))}catch(t){r||n((0,u.jsx)(w,{remote:e,reason:`${t}`}))}}(),()=>{r=!0}}),[e,...Object.values(t)]),console.debug(`rendering RemoteSlot[${e}], loading=${!o}`),(0,u.jsx)(u.Fragment,{children:o||r})};b.defaultProps={fallback:void 0};const g=b,y=()=>p().useContext(m);(Object.getOwnPropertyDescriptor(y,"name")||{}).writable||Object.defineProperty(y,"name",{value:"default",configurable:!0});const $=e=>{let r,t="pending";const o=fetch(e,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>{t="success",r=e}));t="error",r=new Error(`${e.status} ${e.statusText} ${e.url}`)}));return{read(){if("pending"===t)throw o;if("error"===t)throw r;if("success"===t)return r}}};(Object.getOwnPropertyDescriptor($,"name")||{}).writable||Object.defineProperty($,"name",{value:"default",configurable:!0})}}]);
1
+ "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[58,677],{58(e,r,t){t.r(r),t.d(r,{RemoteProvider:()=>h,RemoteSlot:()=>g,jsonResource:()=>$,useRemote:()=>y});var o=t(153),n=t(650);let s=!1;const a=new Set,c=async e=>{const{loader:r}=e;if("ModuleFederation"!==r.kind)throw new Error(`No loader for kind '${r.kind}'.`);return(async(e,r,t,o="default")=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${r}, shareScope: ${o} }`),s||(s=!0,(0,n.getInstance)()||(0,n.init)({name:"Appshell",remotes:[]})),a.has(e)||(a.add(e),(0,n.registerRemotes)([{name:e,entry:t}]));const c=r.replace(/^\.\//,""),l=await(0,n.loadRemote)(`${e}/${c}`);if(!l)throw new Error(`Failed to find module container ${e}`);return console.debug(`Appshell component loaded: { scope: ${e}, module: ${r}, shareScope: ${o} }`),l.default})(r.scope,r.module,e.remoteEntryUrl,r.shareScope)},l=(e={})=>{const r=e.composition??("undefined"==typeof window?void 0:window.__appshell_config__),t=e.resolver??((...e)=>async r=>{for(const t of e){const e=await t(r);if(e)return e}})((e=>async r=>{const t=e?.remotes[r];if(e&&t)return{remote:t,vars:e.vars[t.loader.scope]??{}}})(r),((e,r="")=>async t=>{if(!e)return;const o=`${r}/v1/applications/${e.applicationId}/remotes/${t}`,n=await fetch(o,{credentials:"include"});if(!n.ok)return;const s=await n.json();return{remote:s,vars:e.vars[s.loader.scope]??{}}})(r));return async e=>{const r=r=>new Error(`Failed to load component '${e}'. ${r?.toString()}`);let n;try{n=await t(e)}catch(e){throw r(e)}if(!n)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:s,vars:a}=n;try{return(0,o.setVars)(s.loader.scope,a),[await c(s),s]}catch(e){throw r(e)}}};(Object.getOwnPropertyDescriptor(l,"name")||{}).writable||Object.defineProperty(l,"name",{value:"default",configurable:!0});const i=l;var d=t(488),p=t.n(d),u=t(605);const f=(0,d.createContext)(void 0),h=({remote:e,children:r})=>(0,u.jsx)(f.Provider,{value:e,children:r});h.defaultProps={remote:void 0},f.Consumer;const m=f,w=({remote:e,reason:r})=>(0,u.jsxs)("div",{style:{border:"3px solid red"},children:[(0,u.jsx)("h5",{children:`Error loading Appshell component '${e}.'`}),(0,u.jsx)("span",{style:{fontSize:"1rem"},children:r})]}),b=({remote:e,fallback:r,...t})=>{const[o,n]=(0,d.useState)();return(0,d.useEffect)((()=>{let r=!1;const o=i();return n(void 0),async function(){try{const[s,a]=await o(e);if(r||!s)return;n((0,u.jsx)(h,{remote:a,children:(0,u.jsx)(s,{...t})}))}catch(t){r||n((0,u.jsx)(w,{remote:e,reason:`${t}`}))}}(),()=>{r=!0}}),[e,...Object.values(t)]),console.debug(`rendering RemoteSlot[${e}], loading=${!o}`),(0,u.jsx)(u.Fragment,{children:o||r})};b.defaultProps={fallback:void 0};const g=b,y=()=>p().useContext(m);(Object.getOwnPropertyDescriptor(y,"name")||{}).writable||Object.defineProperty(y,"name",{value:"default",configurable:!0});const $=e=>{let r,t="pending";const o=fetch(e,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>{t="success",r=e}));t="error",r=new Error(`${e.status} ${e.statusText} ${e.url}`)}));return{read(){if("pending"===t)throw o;if("error"===t)throw r;if("success"===t)return r}}};(Object.getOwnPropertyDescriptor($,"name")||{}).writable||Object.defineProperty($,"name",{value:"default",configurable:!0})}}]);
package/dist/630.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[630],{630(e,t,n){var o=n(53),r=n(488),a=n.n(r),i=n(873);const s="appshell-overlay-badge",l=["position:fixed","bottom:12px","left:12px","z-index:2147483647","max-width:min(420px, calc(100vw - 24px))","padding:8px 12px","border-radius:6px","border:1px solid #f0b429","background:#3d3016","color:#f7e3a1","font:12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace","box-shadow:0 2px 8px rgba(0,0,0,.35)"].join(";"),c=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;"),d=e=>{const t=e?.overlay;if(!t||document.getElementById(s))return;const n=document.createElement("div");n.id=s,n.innerHTML=(e=>{const{remotes:t=[],added:n=[],shellFlavor:o="prod",theme:r}=e,a=new Set(n),i=t.filter((e=>!a.has(e))),s=["dev"===o&&"development shell",i.length&&`${i.length} remote${1===i.length?"":"s"} redirected`,n.length&&`${n.length} not published`,r&&`theme ${c(r)}`].filter(Boolean),d=t.map((e=>`<li>${c(e)}${a.has(e)?' <em style="font-style:normal;opacity:.8">— not published</em>':""}</li>`)).join("");return[`<details style="${l}" open>`,`<summary style="cursor:pointer;font-weight:600;list-style:none">⚠ Development overlay — ${s.join(", ")}</summary>`,d?`<ul style="margin:6px 0 0;padding-left:16px">${d}</ul>`:"","</details>"].join("")})(t),document.body.appendChild(n)};(Object.getOwnPropertyDescriptor(d,"name")||{}).writable||Object.defineProperty(d,"name",{value:"default",configurable:!0});var p=n(591),u=n.n(p),h=n(740),f=n.n(h),m=n(128),v=n.n(m),g=n(855),b=n.n(g),y=n(51),x=n.n(y),w=n(656),T=n.n(w),C=n(97),E={};E.styleTagTransform=T(),E.setAttributes=b(),E.insert=v().bind(null,"head"),E.domAPI=f(),E.insertStyleElement=x(),u()(C.A,E),C.A&&C.A.locals&&C.A.locals;const j=e=>e.parentNode?.removeChild(e),M=e=>{const t=document.getElementById("appshell-splash");if(!t)return()=>{};if(e.firstElementChild)return j(t),()=>{};const n=new MutationObserver((()=>{e.firstElementChild&&(n.disconnect(),j(t))}));n.observe(e,{childList:!0});const o=setTimeout((()=>{n.disconnect(),j(t)}),3e4);return()=>{n.disconnect(),clearTimeout(o)}};(Object.getOwnPropertyDescriptor(M,"name")||{}).writable||Object.defineProperty(M,"name",{value:"default",configurable:!0});var S=n(986);const k=document.getElementById("root"),A=(0,i.H)(k),I=window.__appshell_config__;if(d(I),!I?.root)throw new Error("No root remote to mount. The registry supplies one in the composition.");const P=I.root,$=I.rootProps;M(k),A.render((0,S.jsx)(a().StrictMode,{children:(0,S.jsx)(o.RemoteSlot,{remote:P,...$})}))},97(e,t,n){n.d(t,{A:()=>s});var o=n(758),r=n.n(o),a=n(935),i=n.n(a)()(r());i.push([e.id,"/*\n * The one reset on the page.\n *\n * Packages must not ship their own — several global resets (Tailwind's Preflight, for\n * one) fight each other and the shell. This is structural only: it holds no view on how\n * an application looks, which is the packages' and the theme's business, but it does own\n * the handful of browser defaults that must be settled exactly once.\n */\nhtml,\nbody {\n margin: 0;\n padding: 0;\n}\n\nbody {\n min-height: 100vh;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n#root {\n min-height: 100vh;\n}\n",""]);const s=i},935(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);o&&i[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},758(e){e.exports=function(e){return e[1]}},873(e,t,n){var o=n(536);t.H=o.createRoot,o.hydrateRoot},591(e){var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var a={},i=[],s=0;s<e.length;s++){var l=e[s],c=o.base?l[0]+o.base:l[0],d=a[c]||0,p="".concat(c," ").concat(d);a[c]=d+1;var u=n(p),h={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(h);else{var f=r(h,o);o.byIndex=s,t.splice(s,0,{identifier:p,updater:f,references:1})}i.push(p)}return i}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var a=o(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<a.length;i++){var s=n(a[i]);t[s].references--}for(var l=o(e,r),c=0;c<a.length;c++){var d=n(a[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}a=l}}},128(e){var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},51(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},740(e){e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},656(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}}]);
1
+ "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[630],{630(e,t,n){var o=n(53),r=n(488),a=n.n(r),i=n(873);const s="appshell-overlay-badge",l=["position:fixed","bottom:12px","left:12px","z-index:2147483647","max-width:min(420px, calc(100vw - 24px))","padding:8px 12px","border-radius:6px","border:1px solid #f0b429","background:#3d3016","color:#f7e3a1","font:12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace","box-shadow:0 2px 8px rgba(0,0,0,.35)"].join(";"),c=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;"),d=e=>{const t=e?.overlay;if(!t||document.getElementById(s))return;const n=document.createElement("div");n.id=s,n.innerHTML=(e=>{const{remotes:t=[],added:n=[],shellFlavor:o="prod",theme:r}=e,a=new Set(n),i=t.filter((e=>!a.has(e))),s=["dev"===o&&"development shell",i.length&&`${i.length} remote${1===i.length?"":"s"} redirected`,n.length&&`${n.length} not published`,r&&`theme ${c(r)}`].filter(Boolean),d=t.map((e=>`<li>${c(e)}${a.has(e)?' <em style="font-style:normal;opacity:.8">— not published</em>':""}</li>`)).join("");return[`<details style="${l}" open>`,`<summary style="cursor:pointer;font-weight:600;list-style:none">⚠ Development overlay — ${s.join(", ")}</summary>`,d?`<ul style="margin:6px 0 0;padding-left:16px">${d}</ul>`:"","</details>"].join("")})(t),document.body.appendChild(n)};(Object.getOwnPropertyDescriptor(d,"name")||{}).writable||Object.defineProperty(d,"name",{value:"default",configurable:!0});var p=n(591),u=n.n(p),h=n(740),f=n.n(h),m=n(128),v=n.n(m),g=n(855),b=n.n(g),y=n(51),x=n.n(y),w=n(656),T=n.n(w),C=n(97),E={};E.styleTagTransform=T(),E.setAttributes=b(),E.insert=v().bind(null,"head"),E.domAPI=f(),E.insertStyleElement=x(),u()(C.A,E),C.A&&C.A.locals&&C.A.locals;const j=e=>e.parentNode?.removeChild(e),M=e=>{const t=document.getElementById("appshell-splash");if(!t)return()=>{};if(e.firstElementChild)return j(t),()=>{};const n=new MutationObserver((()=>{e.firstElementChild&&(n.disconnect(),j(t))}));n.observe(e,{childList:!0});const o=setTimeout((()=>{n.disconnect(),j(t)}),3e4);return()=>{n.disconnect(),clearTimeout(o)}};(Object.getOwnPropertyDescriptor(M,"name")||{}).writable||Object.defineProperty(M,"name",{value:"default",configurable:!0});var S=n(605);const k=document.getElementById("root"),A=(0,i.H)(k),I=window.__appshell_config__;if(d(I),!I?.root)throw new Error("No root remote to mount. The registry supplies one in the composition.");const P=I.root,$=I.rootProps;M(k),A.render((0,S.jsx)(a().StrictMode,{children:(0,S.jsx)(o.RemoteSlot,{remote:P,...$})}))},97(e,t,n){n.d(t,{A:()=>s});var o=n(758),r=n.n(o),a=n(935),i=n.n(a)()(r());i.push([e.id,"/*\n * The one reset on the page.\n *\n * Packages must not ship their own — several global resets (Tailwind's Preflight, for\n * one) fight each other and the shell. This is structural only: it holds no view on how\n * an application looks, which is the packages' and the theme's business, but it does own\n * the handful of browser defaults that must be settled exactly once.\n */\nhtml,\nbody {\n margin: 0;\n padding: 0;\n}\n\nbody {\n min-height: 100vh;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n#root {\n min-height: 100vh;\n}\n",""]);const s=i},935(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);o&&i[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},758(e){e.exports=function(e){return e[1]}},873(e,t,n){var o=n(536);t.H=o.createRoot,o.hydrateRoot},591(e){var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var a={},i=[],s=0;s<e.length;s++){var l=e[s],c=o.base?l[0]+o.base:l[0],d=a[c]||0,p="".concat(c," ").concat(d);a[c]=d+1;var u=n(p),h={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(h);else{var f=r(h,o);o.byIndex=s,t.splice(s,0,{identifier:p,updater:f,references:1})}i.push(p)}return i}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var a=o(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<a.length;i++){var s=n(a[i]);t[s].references--}for(var l=o(e,r),c=0;c<a.length;c++){var d=n(a[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}a=l}}},128(e){var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},51(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},740(e){e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},656(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}}]);
package/dist/677.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[58,677],{58(e,r,t){t.r(r),t.d(r,{RemoteProvider:()=>h,RemoteSlot:()=>g,jsonResource:()=>$,useRemote:()=>y});var o=t(220),n=t(650);let s=!1;const a=new Set,c=async e=>{const{loader:r}=e;if("ModuleFederation"!==r.kind)throw new Error(`No loader for kind '${r.kind}'.`);return(async(e,r,t,o="default")=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${r}, shareScope: ${o} }`),s||(s=!0,(0,n.getInstance)()||(0,n.init)({name:"Appshell",remotes:[]})),a.has(e)||(a.add(e),(0,n.registerRemotes)([{name:e,entry:t}]));const c=r.replace(/^\.\//,""),l=await(0,n.loadRemote)(`${e}/${c}`);if(!l)throw new Error(`Failed to find module container ${e}`);return console.debug(`Appshell component loaded: { scope: ${e}, module: ${r}, shareScope: ${o} }`),l.default})(r.scope,r.module,e.remoteEntryUrl,r.shareScope)},l=(e={})=>{const r=e.composition??("undefined"==typeof window?void 0:window.__appshell_config__),t=e.resolver??((...e)=>async r=>{for(const t of e){const e=await t(r);if(e)return e}})((e=>async r=>{const t=e?.remotes[r];if(e&&t)return{remote:t,vars:e.vars[t.loader.scope]??{}}})(r),((e,r="")=>async t=>{if(!e)return;const o=`${r}/v1/applications/${e.applicationId}/remotes/${t}`,n=await fetch(o,{credentials:"include"});if(!n.ok)return;const s=await n.json();return{remote:s,vars:e.vars[s.loader.scope]??{}}})(r));return async e=>{const r=r=>new Error(`Failed to load component '${e}'. ${r?.toString()}`);let n;try{n=await t(e)}catch(e){throw r(e)}if(!n)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:s,vars:a}=n;try{return(0,o.setVars)(s.loader.scope,a),[await c(s),s]}catch(e){throw r(e)}}};(Object.getOwnPropertyDescriptor(l,"name")||{}).writable||Object.defineProperty(l,"name",{value:"default",configurable:!0});const i=l;var d=t(488),p=t.n(d),u=t(986);const f=(0,d.createContext)(void 0),h=({remote:e,children:r})=>(0,u.jsx)(f.Provider,{value:e,children:r});h.defaultProps={remote:void 0},f.Consumer;const m=f,w=({remote:e,reason:r})=>(0,u.jsxs)("div",{style:{border:"3px solid red"},children:[(0,u.jsx)("h5",{children:`Error loading Appshell component '${e}.'`}),(0,u.jsx)("span",{style:{fontSize:"1rem"},children:r})]}),b=({remote:e,fallback:r,...t})=>{const[o,n]=(0,d.useState)();return(0,d.useEffect)((()=>{let r=!1;const o=i();return n(void 0),async function(){try{const[s,a]=await o(e);if(r||!s)return;n((0,u.jsx)(h,{remote:a,children:(0,u.jsx)(s,{...t})}))}catch(t){r||n((0,u.jsx)(w,{remote:e,reason:`${t}`}))}}(),()=>{r=!0}}),[e,...Object.values(t)]),console.debug(`rendering RemoteSlot[${e}], loading=${!o}`),(0,u.jsx)(u.Fragment,{children:o||r})};b.defaultProps={fallback:void 0};const g=b,y=()=>p().useContext(m);(Object.getOwnPropertyDescriptor(y,"name")||{}).writable||Object.defineProperty(y,"name",{value:"default",configurable:!0});const $=e=>{let r,t="pending";const o=fetch(e,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>{t="success",r=e}));t="error",r=new Error(`${e.status} ${e.statusText} ${e.url}`)}));return{read(){if("pending"===t)throw o;if("error"===t)throw r;if("success"===t)return r}}};(Object.getOwnPropertyDescriptor($,"name")||{}).writable||Object.defineProperty($,"name",{value:"default",configurable:!0})}}]);
1
+ "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[58,677],{58(e,r,t){t.r(r),t.d(r,{RemoteProvider:()=>h,RemoteSlot:()=>g,jsonResource:()=>$,useRemote:()=>y});var o=t(153),n=t(650);let s=!1;const a=new Set,c=async e=>{const{loader:r}=e;if("ModuleFederation"!==r.kind)throw new Error(`No loader for kind '${r.kind}'.`);return(async(e,r,t,o="default")=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${r}, shareScope: ${o} }`),s||(s=!0,(0,n.getInstance)()||(0,n.init)({name:"Appshell",remotes:[]})),a.has(e)||(a.add(e),(0,n.registerRemotes)([{name:e,entry:t}]));const c=r.replace(/^\.\//,""),l=await(0,n.loadRemote)(`${e}/${c}`);if(!l)throw new Error(`Failed to find module container ${e}`);return console.debug(`Appshell component loaded: { scope: ${e}, module: ${r}, shareScope: ${o} }`),l.default})(r.scope,r.module,e.remoteEntryUrl,r.shareScope)},l=(e={})=>{const r=e.composition??("undefined"==typeof window?void 0:window.__appshell_config__),t=e.resolver??((...e)=>async r=>{for(const t of e){const e=await t(r);if(e)return e}})((e=>async r=>{const t=e?.remotes[r];if(e&&t)return{remote:t,vars:e.vars[t.loader.scope]??{}}})(r),((e,r="")=>async t=>{if(!e)return;const o=`${r}/v1/applications/${e.applicationId}/remotes/${t}`,n=await fetch(o,{credentials:"include"});if(!n.ok)return;const s=await n.json();return{remote:s,vars:e.vars[s.loader.scope]??{}}})(r));return async e=>{const r=r=>new Error(`Failed to load component '${e}'. ${r?.toString()}`);let n;try{n=await t(e)}catch(e){throw r(e)}if(!n)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:s,vars:a}=n;try{return(0,o.setVars)(s.loader.scope,a),[await c(s),s]}catch(e){throw r(e)}}};(Object.getOwnPropertyDescriptor(l,"name")||{}).writable||Object.defineProperty(l,"name",{value:"default",configurable:!0});const i=l;var d=t(488),p=t.n(d),u=t(605);const f=(0,d.createContext)(void 0),h=({remote:e,children:r})=>(0,u.jsx)(f.Provider,{value:e,children:r});h.defaultProps={remote:void 0},f.Consumer;const m=f,w=({remote:e,reason:r})=>(0,u.jsxs)("div",{style:{border:"3px solid red"},children:[(0,u.jsx)("h5",{children:`Error loading Appshell component '${e}.'`}),(0,u.jsx)("span",{style:{fontSize:"1rem"},children:r})]}),b=({remote:e,fallback:r,...t})=>{const[o,n]=(0,d.useState)();return(0,d.useEffect)((()=>{let r=!1;const o=i();return n(void 0),async function(){try{const[s,a]=await o(e);if(r||!s)return;n((0,u.jsx)(h,{remote:a,children:(0,u.jsx)(s,{...t})}))}catch(t){r||n((0,u.jsx)(w,{remote:e,reason:`${t}`}))}}(),()=>{r=!0}}),[e,...Object.values(t)]),console.debug(`rendering RemoteSlot[${e}], loading=${!o}`),(0,u.jsx)(u.Fragment,{children:o||r})};b.defaultProps={fallback:void 0};const g=b,y=()=>p().useContext(m);(Object.getOwnPropertyDescriptor(y,"name")||{}).writable||Object.defineProperty(y,"name",{value:"default",configurable:!0});const $=e=>{let r,t="pending";const o=fetch(e,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>{t="success",r=e}));t="error",r=new Error(`${e.status} ${e.statusText} ${e.url}`)}));return{read(){if("pending"===t)throw o;if("error"===t)throw r;if("success"===t)return r}}};(Object.getOwnPropertyDescriptor($,"name")||{}).writable||Object.defineProperty($,"name",{value:"default",configurable:!0})}}]);
package/dist/941.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[941],{322(e,r,s){s.r(r),s.d(r,{ANONYMOUS:()=>i,MissingScopeError:()=>n,MissingVarsError:()=>t,VarsConflictError:()=>a,getIdentity:()=>o,hasVars:()=>p,readVars:()=>l,resetVars:()=>d,setVars:()=>h});class t extends Error{constructor(e,r){super(`No vars were delivered for '${e}'. ${r.length?`Vars are present for ${r.map((e=>`'${e}'`)).join(", ")} — check that '${e}' matches the module federation name the registry knows this package by.`:"Nothing has delivered vars on this page — check that the host and this package both declare '@appshell/runtime' as a shared singleton."}`),this.name="MissingVarsError",this.scope=e}}class a extends Error{constructor(e){super(`Vars for '${e}' were already delivered and cannot be replaced. A scope receives its vars once per page load.`),this.name="VarsConflictError",this.scope=e}}class n extends Error{constructor(){super("Cannot tell which package this is. '@appshell/runtime/vars' needs the scope that AppshellPlugin injects at build time — add it to this package's webpack plugins, or read the store directly with readVars(scope) from '@appshell/runtime'."),this.name="MissingScopeError"}}const i={authenticated:!1},o=()=>{if("undefined"==typeof window)return i;const e=window.__appshell_identity__;return(e=>{if("object"!=typeof e||null===e)return!1;const r=e;return!1===r.authenticated||!0===r.authenticated&&"string"==typeof r.subject&&"string"==typeof r.username&&Array.isArray(r.roles)})(e)?e:i},c=new Map,h=(e,r)=>{const s=c.get(e);var t,n;if(s){if(t=s,n=r,![...new Set([...Object.keys(t),...Object.keys(n)])].every((e=>t[e]===n[e])))throw new a(e)}else c.set(e,Object.freeze({...r}))},l=e=>{const r=c.get(e);if(!r)throw new t(e,[...c.keys()]);return r},p=e=>c.has(e),d=()=>{c.clear()}}}]);
1
+ "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[941],{941(e,r,s){s.r(r),s.d(r,{ANONYMOUS:()=>i,MissingScopeError:()=>n,MissingVarsError:()=>t,VarsConflictError:()=>a,getIdentity:()=>o,hasVars:()=>p,readVars:()=>l,resetVars:()=>d,setVars:()=>h});class t extends Error{constructor(e,r){super(`No vars were delivered for '${e}'. ${r.length?`Vars are present for ${r.map((e=>`'${e}'`)).join(", ")} — check that '${e}' matches the module federation name the registry knows this package by.`:"Nothing has delivered vars on this page — check that the host and this package both declare '@appshell/runtime' as a shared singleton."}`),this.name="MissingVarsError",this.scope=e}}class a extends Error{constructor(e){super(`Vars for '${e}' were already delivered and cannot be replaced. A scope receives its vars once per page load.`),this.name="VarsConflictError",this.scope=e}}class n extends Error{constructor(){super("Cannot tell which package this is. '@appshell/runtime/vars' needs the scope that AppshellPlugin injects at build time — add it to this package's webpack plugins, or read the store directly with readVars(scope) from '@appshell/runtime'."),this.name="MissingScopeError"}}const i={authenticated:!1},o=()=>{if("undefined"==typeof window)return i;const e=window.__appshell_identity__;return(e=>{if("object"!=typeof e||null===e)return!1;const r=e;return!1===r.authenticated||!0===r.authenticated&&"string"==typeof r.subject&&"string"==typeof r.username&&Array.isArray(r.roles)})(e)?e:i},c=new Map,h=(e,r)=>{const s=c.get(e);var t,n;if(s){if(t=s,n=r,![...new Set([...Object.keys(t),...Object.keys(n)])].every((e=>t[e]===n[e])))throw new a(e)}else c.set(e,Object.freeze({...r}))},l=e=>{const r=c.get(e);if(!r)throw new t(e,[...c.keys()]);return r},p=e=>c.has(e),d=()=>{c.clear()}}}]);
package/dist/dev/main.js CHANGED
@@ -3550,7 +3550,7 @@ __webpack_require__.r(__webpack_exports__);
3550
3550
 
3551
3551
  //#region src/utils/env.ts
3552
3552
  function getBuilderId() {
3553
- return true ? "Appshell:1.0.0-alpha.83" : 0;
3553
+ return true ? "Appshell:1.0.0-alpha.84" : 0;
3554
3554
  }
3555
3555
 
3556
3556
  //#endregion
@@ -5482,7 +5482,7 @@ __webpack_require__.r(__webpack_exports__);
5482
5482
 
5483
5483
  //#region src/utils.ts
5484
5484
  function getBuilderId() {
5485
- return true ? "Appshell:1.0.0-alpha.83" : 0;
5485
+ return true ? "Appshell:1.0.0-alpha.84" : 0;
5486
5486
  }
5487
5487
  function getGlobalFederationInstance(name, version) {
5488
5488
  const buildId = getBuilderId();
@@ -7874,8 +7874,8 @@ function updateRemoteOptions(options) {
7874
7874
  /******/ var promises = [];
7875
7875
  /******/ switch(name) {
7876
7876
  /******/ case "default": {
7877
- /******/ register("@appshell/react", "1.0.0-alpha.83", () => (Promise.all([__webpack_require__.e("webpack_sharing_consume_default_react_react"), __webpack_require__.e("react_src_index_ts"), __webpack_require__.e("webpack_sharing_consume_default_react_jsx-runtime_react_jsx-runtime")]).then(() => (() => (__webpack_require__(/*! ../react/src/index.ts */ "../react/src/index.ts"))))));
7878
- /******/ register("@appshell/runtime", "1.0.0-alpha.83", () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! ../runtime/src/index.ts */ "../runtime/src/index.ts"))))));
7877
+ /******/ register("@appshell/react", "1.0.0-alpha.84", () => (Promise.all([__webpack_require__.e("webpack_sharing_consume_default_react_react"), __webpack_require__.e("react_src_index_ts"), __webpack_require__.e("webpack_sharing_consume_default_react_jsx-runtime_react_jsx-runtime")]).then(() => (() => (__webpack_require__(/*! ../react/src/index.ts */ "../react/src/index.ts"))))));
7878
+ /******/ register("@appshell/runtime", "1.0.0-alpha.84", () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! ../runtime/src/index.ts */ "../runtime/src/index.ts"))))));
7879
7879
  /******/ register("react-dom", "18.2.0", () => (Promise.all([__webpack_require__.e("vendors-node_modules_react-dom_index_js"), __webpack_require__.e("webpack_sharing_consume_default_react_react")]).then(() => (() => (__webpack_require__(/*! ../../node_modules/react-dom/index.js */ "../../node_modules/react-dom/index.js"))))));
7880
7880
  /******/ register("react/jsx-runtime", "18.2.0", () => (Promise.all([__webpack_require__.e("vendors-node_modules_react_jsx-runtime_js"), __webpack_require__.e("webpack_sharing_consume_default_react_react")]).then(() => (() => (__webpack_require__(/*! ../../node_modules/react/jsx-runtime.js */ "../../node_modules/react/jsx-runtime.js"))))));
7881
7881
  /******/ register("react", "18.2.0", () => (__webpack_require__.e("vendors-node_modules_react_index_js").then(() => (() => (__webpack_require__(/*! ../../node_modules/react/index.js */ "../../node_modules/react/index.js"))))));
@@ -7889,11 +7889,11 @@ function updateRemoteOptions(options) {
7889
7889
  /******/
7890
7890
  /******/ /* webpack/runtime/sharing */
7891
7891
  /******/ (() => {
7892
- /******/ __webpack_require__.federation.initOptions.shared = { "@appshell/react": [{ version: "1.0.0-alpha.83",
7892
+ /******/ __webpack_require__.federation.initOptions.shared = { "@appshell/react": [{ version: "1.0.0-alpha.84",
7893
7893
  /******/ get: () => (Promise.all([__webpack_require__.e("webpack_sharing_consume_default_react_react"), __webpack_require__.e("react_src_index_ts"), __webpack_require__.e("webpack_sharing_consume_default_react_jsx-runtime_react_jsx-runtime")]).then(() => (() => (__webpack_require__(/*! ../react/src/index.ts */ "../react/src/index.ts"))))),
7894
7894
  /******/ scope: ["default"],
7895
7895
  /******/ shareConfig: {"eager":false,"singleton":true,"layer":null},
7896
- /******/ },], "@appshell/runtime": [{ version: "1.0.0-alpha.83",
7896
+ /******/ },], "@appshell/runtime": [{ version: "1.0.0-alpha.84",
7897
7897
  /******/ get: () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! ../runtime/src/index.ts */ "../runtime/src/index.ts"))))),
7898
7898
  /******/ scope: ["default"],
7899
7899
  /******/ shareConfig: {"eager":false,"singleton":true,"layer":null},
@@ -7998,7 +7998,7 @@ function updateRemoteOptions(options) {
7998
7998
  /******/ fallback: () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! @appshell/runtime */ "../runtime/src/index.ts"))))),
7999
7999
  /******/ shareScope: ["default"],
8000
8000
  /******/ singleton: true,
8001
- /******/ requiredVersion: "^1.0.0-alpha.83",
8001
+ /******/ requiredVersion: "^1.0.0-alpha.84",
8002
8002
  /******/ strictVersion: false,
8003
8003
  /******/ eager: false,
8004
8004
  /******/ layer: undefined,