@appshell/react-shell 1.0.0-alpha.14 → 1.0.0-alpha.15

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/428.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[428],{428(e,t,n){var o=n(373),r=n(650);let a=!1;const s=new Set,i=async(e,t,n,o="default")=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${t}, shareScope: ${o} }`),a||(a=!0,(0,r.getInstance)()||(0,r.init)({name:"Appshell",remotes:[]})),s.has(e)||(s.add(e),(0,r.registerRemotes)([{name:e,entry:n}]));const i=t.replace(/^\.\//,""),c=await(0,r.loadRemote)(`${e}/${i}`);if(!c)throw new Error(`Failed to find module container ${e}`);return console.debug(`Appshell component loaded: { scope: ${e}, module: ${t}, shareScope: ${o} }`),c.default};(Object.getOwnPropertyDescriptor(i,"name")||{}).writable||Object.defineProperty(i,"name",{value:"default",configurable:!0});const c=(e={})=>{const t=e.composition??("undefined"==typeof window?void 0:window.__appshell_config__),n=e.resolver??((...e)=>async t=>{for(const n of e){const e=await n(t);if(e)return e}})((e=>async t=>{const n=e?.remotes[t];if(e&&n)return{remote:n,vars:e.vars[n.scope]??{}}})(t),((e,t="")=>async n=>{if(!e)return;const o=`${t}/v1/applications/${e.applicationId}/remotes/${n}`,r=await fetch(o,{credentials:"include"});if(!r.ok)return;const a=await r.json();return{remote:a,vars:e.vars[a.scope]??{}}})(t));return async e=>{const t=t=>new Error(`Failed to load component '${e}'. ${t?.toString()}`);let r;try{r=await n(e)}catch(e){throw t(e)}if(!r)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:a,vars:s}=r;try{return(0,o.setVars)(a.scope,s),[await i(a.scope,a.module,a.remoteEntryUrl,a.shareScope),a]}catch(e){throw t(e)}}};(Object.getOwnPropertyDescriptor(c,"name")||{}).writable||Object.defineProperty(c,"name",{value:"default",configurable:!0});const l=c;var d=n(107),p=n.n(d);const u=(0,d.createContext)(void 0),m=({remote:e,children:t})=>p().createElement(u.Provider,{value:e},t);m.defaultProps={remote:void 0},u.Consumer;const f=({remote:e,reason:t})=>p().createElement("div",{style:{border:"3px solid red"}},p().createElement("h5",null,`Error loading Appshell component '${e}.'`),p().createElement("span",{style:{fontSize:"1rem"}},t)),h=({remote:e,fallback:t,...n})=>{const[o,r]=(0,d.useState)();return(0,d.useEffect)((()=>{let t=!1;const o=l();return r(void 0),async function(){try{const[a,s]=await o(e);if(t||!a)return;r(p().createElement(m,{remote:s},p().createElement(a,n)))}catch(n){t||r(p().createElement(f,{remote:e,reason:`${n}`}))}}(),()=>{t=!0}}),[e,...Object.values(n)]),console.debug(`rendering RemoteSlot[${e}], loading=${!o}`),p().createElement(p().Fragment,null,o||t)};h.defaultProps={fallback:void 0};const v=h,g=()=>(void 0).useContext(void 0);(Object.getOwnPropertyDescriptor(g,"name")||{}).writable||Object.defineProperty(g,"name",{value:"default",configurable:!0});var y=n(873);const b="appshell-overlay-badge",w=["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(";"),x=e=>{const t=e?.overlay;if(!t||document.getElementById(b))return;const n=document.createElement("div");n.id=b,n.innerHTML=((e,t="prod")=>{const n=["dev"===t&&"development shell",e.length&&`${e.length} remote${1===e.length?"":"s"} redirected`].filter(Boolean),o=e.map((e=>{return`<li>${t=e,t.replace(/&/g,"&amp;").replace(/</g,"&lt;")}</li>`;var t})).join("");return[`<details style="${w}" open>`,`<summary style="cursor:pointer;font-weight:600;list-style:none">⚠ Development overlay — ${n.join(", ")}</summary>`,o?`<ul style="margin:6px 0 0;padding-left:16px">${o}</ul>`:"","</details>"].join("")})(t.remotes??[],t.shellFlavor),document.body.appendChild(n)};(Object.getOwnPropertyDescriptor(x,"name")||{}).writable||Object.defineProperty(x,"name",{value:"default",configurable:!0});var E=n(591),$=n.n(E),j=n(740),O=n.n(j),P=n(128),S=n.n(P),T=n(855),A=n.n(T),C=n(51),_=n.n(C),k=n(656),M=n.n(k),I=n(97),R={};function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},F.apply(null,arguments)}R.styleTagTransform=M(),R.setAttributes=A(),R.insert=S().bind(null,"head"),R.domAPI=O(),R.insertStyleElement=_(),$()(I.A,R),I.A&&I.A.locals&&I.A.locals;const D=(0,y.H)(document.getElementById("root")),H=window.__appshell_config__;if(x(H),!H?.root)throw new Error("No root remote to mount. The registry supplies one in the composition.");const N=H.root,z=H.rootProps;D.render(p().createElement(p().StrictMode,null,p().createElement(v,F({remote:N},z))))},97(e,t,n){n.d(t,{A:()=>i});var o=n(758),r=n.n(o),a=n(935),s=n.n(a)()(r());s.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 i=s},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 s={};if(o)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);o&&s[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={},s=[],i=0;i<e.length;i++){var c=e[i],l=o.base?c[0]+o.base:c[0],d=a[l]||0,p="".concat(l," ").concat(d);a[l]=d+1;var u=n(p),m={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)t[u].references++,t[u].updater(m);else{var f=r(m,o);o.byIndex=i,t.splice(i,0,{identifier:p,updater:f,references:1})}s.push(p)}return s}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 s=0;s<a.length;s++){var i=n(a[s]);t[i].references--}for(var c=o(e,r),l=0;l<a.length;l++){var d=n(a[l]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}a=c}}},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/877.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[877],{877(e,r,s){s.r(r),s.d(r,{MissingVarsError:()=>a,VarsConflictError:()=>t,hasVars:()=>h,readVars:()=>c,resetVars:()=>i,setVars:()=>n});class a 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 t 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}}const o=new Map,n=(e,r)=>{const s=o.get(e);var a,n;if(s){if(a=s,n=r,![...new Set([...Object.keys(a),...Object.keys(n)])].every((e=>a[e]===n[e])))throw new t(e)}else o.set(e,Object.freeze({...r}))},c=e=>{const r=o.get(e);if(!r)throw new a(e,[...o.keys()]);return r},h=e=>o.has(e),i=()=>{o.clear()}}}]);
package/dist/dev/main.js CHANGED
@@ -52,7 +52,7 @@ __webpack_require__.r(__webpack_exports__);
52
52
 
53
53
  // Must run before `bootstrap` evaluates `react-dom`; see ./devtools.
54
54
  (0,_devtools__WEBPACK_IMPORTED_MODULE_0__["default"])();
55
- Promise.all(/*! import() */[__webpack_require__.e("vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_sour-63708e"), __webpack_require__.e("webpack_sharing_consume_default_react_react"), __webpack_require__.e("src_bootstrap_tsx-webpack_sharing_consume_default_react-dom_react-dom")]).then(__webpack_require__.bind(__webpack_require__, /*! ./bootstrap */ "./src/bootstrap.tsx"));
55
+ Promise.all(/*! import() */[__webpack_require__.e("webpack_sharing_consume_default_react_react"), __webpack_require__.e("src_bootstrap_tsx")]).then(__webpack_require__.bind(__webpack_require__, /*! ./bootstrap */ "./src/bootstrap.tsx"));
56
56
 
57
57
  /***/ },
58
58
 
@@ -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.14" : 0;
3553
+ return true ? "Appshell:1.0.0-alpha.15" : 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.14" : 0;
5485
+ return true ? "Appshell:1.0.0-alpha.15" : 0;
5486
5486
  }
5487
5487
  function getGlobalFederationInstance(name, version) {
5488
5488
  const buildId = getBuilderId();
@@ -7874,6 +7874,7 @@ function updateRemoteOptions(options) {
7874
7874
  /******/ var promises = [];
7875
7875
  /******/ switch(name) {
7876
7876
  /******/ case "default": {
7877
+ /******/ register("@appshell/runtime", "1.0.0-alpha.15", () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! ../runtime/src/index.ts */ "../runtime/src/index.ts"))))));
7877
7878
  /******/ 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"))))));
7878
7879
  /******/ 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"))))));
7879
7880
  /******/ }
@@ -7886,7 +7887,11 @@ function updateRemoteOptions(options) {
7886
7887
  /******/
7887
7888
  /******/ /* webpack/runtime/sharing */
7888
7889
  /******/ (() => {
7889
- /******/ __webpack_require__.federation.initOptions.shared = { "react-dom": [{ version: "18.2.0",
7890
+ /******/ __webpack_require__.federation.initOptions.shared = { "@appshell/runtime": [{ version: "1.0.0-alpha.15",
7891
+ /******/ get: () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! ../runtime/src/index.ts */ "../runtime/src/index.ts"))))),
7892
+ /******/ scope: ["default"],
7893
+ /******/ shareConfig: {"eager":false,"singleton":true,"layer":null},
7894
+ /******/ },], "react-dom": [{ version: "18.2.0",
7890
7895
  /******/ get: () => (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"))))),
7891
7896
  /******/ scope: ["default"],
7892
7897
  /******/ shareConfig: {"eager":false,"requiredVersion":"18.2.0","singleton":true,"layer":null},
@@ -7946,6 +7951,17 @@ function updateRemoteOptions(options) {
7946
7951
  /******/ shareKey: "react",
7947
7952
  /******/
7948
7953
  /******/ },
7954
+ /******/ "webpack/sharing/consume/default/@appshell/runtime/@appshell/runtime": {
7955
+ /******/ fallback: () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! @appshell/runtime */ "../runtime/src/index.ts"))))),
7956
+ /******/ shareScope: ["default"],
7957
+ /******/ singleton: true,
7958
+ /******/ requiredVersion: "^1.0.0-alpha.15",
7959
+ /******/ strictVersion: false,
7960
+ /******/ eager: false,
7961
+ /******/ layer: undefined,
7962
+ /******/ shareKey: "@appshell/runtime",
7963
+ /******/
7964
+ /******/ },
7949
7965
  /******/ "webpack/sharing/consume/default/react-dom/react-dom": {
7950
7966
  /******/ fallback: () => (__webpack_require__.e("vendors-node_modules_react-dom_index_js").then(() => (() => (__webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js"))))),
7951
7967
  /******/ shareScope: ["default"],
@@ -7964,7 +7980,8 @@ function updateRemoteOptions(options) {
7964
7980
  /******/ "webpack_sharing_consume_default_react_react": [
7965
7981
  /******/ "webpack/sharing/consume/default/react/react"
7966
7982
  /******/ ],
7967
- /******/ "src_bootstrap_tsx-webpack_sharing_consume_default_react-dom_react-dom": [
7983
+ /******/ "src_bootstrap_tsx": [
7984
+ /******/ "webpack/sharing/consume/default/@appshell/runtime/@appshell/runtime",
7968
7985
  /******/ "webpack/sharing/consume/default/react-dom/react-dom"
7969
7986
  /******/ ]
7970
7987
  /******/ };