@appshell/react-shell 1.0.0-alpha.8 → 1.0.0-alpha.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -26
- package/dist/144.js +1 -1
- package/dist/466.js +2 -0
- package/dist/466.js.LICENSE.txt +9 -0
- package/dist/58.js +1 -0
- package/dist/630.js +1 -0
- package/dist/677.js +1 -0
- package/dist/85.js +2 -0
- package/dist/85.js.LICENSE.txt +9 -0
- package/dist/941.js +1 -0
- package/dist/dev/favicon.ico +0 -0
- package/dist/dev/logo192.png +0 -0
- package/dist/dev/logo512.png +0 -0
- package/dist/dev/main.js +8160 -0
- package/dist/dev/main.js.map +1 -0
- package/dist/dev/manifest.json +25 -0
- package/dist/dev/mf-manifest.json +130 -0
- package/dist/dev/mf-stats.json +150 -0
- package/dist/dev/react_src_index_ts.js +554 -0
- package/dist/dev/react_src_index_ts.js.map +1 -0
- package/dist/dev/runtime_src_index_ts.js +231 -0
- package/dist/dev/runtime_src_index_ts.js.map +1 -0
- package/dist/dev/src_bootstrap_tsx.js +768 -0
- package/dist/dev/src_bootstrap_tsx.js.map +1 -0
- package/dist/dev/vendors-node_modules_react-dom_index_js.js +30577 -0
- package/dist/dev/vendors-node_modules_react-dom_index_js.js.map +1 -0
- package/dist/dev/vendors-node_modules_react_index_js.js +2771 -0
- package/dist/dev/vendors-node_modules_react_index_js.js.map +1 -0
- package/dist/dev/vendors-node_modules_react_jsx-runtime_js.js +1345 -0
- package/dist/dev/vendors-node_modules_react_jsx-runtime_js.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/mf-manifest.json +132 -0
- package/dist/mf-stats.json +152 -0
- package/package.json +16 -8
- package/dist/190.js +0 -1
- package/dist/320.js +0 -1
- package/dist/48.js +0 -1
- package/dist/939.js +0 -1
package/dist/466.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 466.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[85,466],{335(e,r,l){var o=l(488),t=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,_=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n={key:!0,ref:!0,__self:!0,__source:!0};function p(e,r,l){var o,a={},p=null,f=null;for(o in void 0!==l&&(p=""+l),void 0!==r.key&&(p=""+r.key),void 0!==r.ref&&(f=r.ref),r)s.call(r,o)&&!n.hasOwnProperty(o)&&(a[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===a[o]&&(a[o]=r[o]);return{$$typeof:t,type:e,key:p,ref:f,props:a,_owner:_.current}}r.Fragment=a,r.jsx=p,r.jsxs=p},85(e,r,l){e.exports=l(335)}}]);
|
package/dist/58.js
ADDED
|
@@ -0,0 +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(133),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
ADDED
|
@@ -0,0 +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,"&").replace(/</g,"<"),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
ADDED
|
@@ -0,0 +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(133),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/85.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 85.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[85,466],{335(e,r,l){var o=l(488),t=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,_=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n={key:!0,ref:!0,__self:!0,__source:!0};function p(e,r,l){var o,a={},p=null,f=null;for(o in void 0!==l&&(p=""+l),void 0!==r.key&&(p=""+r.key),void 0!==r.ref&&(f=r.ref),r)s.call(r,o)&&!n.hasOwnProperty(o)&&(a[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===a[o]&&(a[o]=r[o]);return{$$typeof:t,type:e,key:p,ref:f,props:a,_owner:_.current}}r.Fragment=a,r.jsx=p,r.jsxs=p},85(e,r,l){e.exports=l(335)}}]);
|
package/dist/941.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
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()}}}]);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|