@appshell/react-shell 1.0.0-alpha.20 → 1.0.0-alpha.22

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/510.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunkappshell_react_shell=globalThis.webpackChunkappshell_react_shell||[]).push([[510],{510(e,t,n){var r=n(53),o=n(650);let a=!1;const s=new Set,i=async(e,t,n,r="default")=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${t}, shareScope: ${r} }`),a||(a=!0,(0,o.getInstance)()||(0,o.init)({name:"Appshell",remotes:[]})),s.has(e)||(s.add(e),(0,o.registerRemotes)([{name:e,entry:n}]));const i=t.replace(/^\.\//,""),c=await(0,o.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: ${r} }`),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 r=`${t}/v1/applications/${e.applicationId}/remotes/${n}`,o=await fetch(r,{credentials:"include"});if(!o.ok)return;const a=await o.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 o;try{o=await n(e)}catch(e){throw t(e)}if(!o)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:a,vars:s}=o;try{return(0,r.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(488),u=n.n(d);const p=(0,d.createContext)(void 0),m=({remote:e,children:t})=>u().createElement(p.Provider,{value:e},t);m.defaultProps={remote:void 0},p.Consumer;const f=({remote:e,reason:t})=>u().createElement("div",{style:{border:"3px solid red"}},u().createElement("h5",null,`Error loading Appshell component '${e}.'`),u().createElement("span",{style:{fontSize:"1rem"}},t)),h=({remote:e,fallback:t,...n})=>{const[r,o]=(0,d.useState)();return(0,d.useEffect)((()=>{let t=!1;const r=l();return o(void 0),async function(){try{const[a,s]=await r(e);if(t||!a)return;o(u().createElement(m,{remote:s},u().createElement(a,n)))}catch(n){t||o(u().createElement(f,{remote:e,reason:`${n}`}))}}(),()=>{t=!0}}),[e,...Object.values(n)]),console.debug(`rendering RemoteSlot[${e}], loading=${!r}`),u().createElement(u().Fragment,null,r||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 b=n(873);const y="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(y))return;const n=document.createElement("div");n.id=y,n.innerHTML=((e,t="prod")=>{const n=["dev"===t&&"development shell",e.length&&`${e.length} remote${1===e.length?"":"s"} redirected`].filter(Boolean),r=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>`,r?`<ul style="margin:6px 0 0;padding-left:16px">${r}</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),O=n(740),j=n.n(O),P=n(128),T=n.n(P),C=n(855),S=n.n(C),A=n(51),_=n.n(A),k=n(656),M=n.n(k),I=n(97),R={};R.styleTagTransform=M(),R.setAttributes=S(),R.insert=T().bind(null,"head"),R.domAPI=j(),R.insertStyleElement=_(),$()(I.A,R),I.A&&I.A.locals&&I.A.locals;const D=e=>e.parentNode?.removeChild(e),F=e=>{const t=document.getElementById("appshell-splash");if(!t)return()=>{};if(e.firstElementChild)return D(t),()=>{};const n=new MutationObserver((()=>{e.firstElementChild&&(n.disconnect(),D(t))}));n.observe(e,{childList:!0});const r=setTimeout((()=>{n.disconnect(),D(t)}),3e4);return()=>{n.disconnect(),clearTimeout(r)}};function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N.apply(null,arguments)}(Object.getOwnPropertyDescriptor(F,"name")||{}).writable||Object.defineProperty(F,"name",{value:"default",configurable:!0});const H=document.getElementById("root"),L=(0,b.H)(H),z=window.__appshell_config__;if(x(z),!z?.root)throw new Error("No root remote to mount. The registry supplies one in the composition.");const B=z.root,U=z.rootProps;F(H),L.render(u().createElement(u().StrictMode,null,u().createElement(v,N({remote:B},U))))},97(e,t,n){n.d(t,{A:()=>i});var r=n(758),o=n.n(r),a=n(935),s=n.n(a)()(o());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="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)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]);r&&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),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},758(e){e.exports=function(e){return e[1]}},873(e,t,n){var r=n(536);t.H=r.createRoot,r.hydrateRoot},591(e){var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var a={},s=[],i=0;i<e.length;i++){var c=e[i],l=r.base?c[0]+r.base:c[0],d=a[l]||0,u="".concat(l," ").concat(d);a[l]=d+1;var p=n(u),m={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(m);else{var f=o(m,r);r.byIndex=i,t.splice(i,0,{identifier:u,updater:f,references:1})}s.push(u)}return s}function o(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,o){var a=r(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<a.length;s++){var i=n(a[s]);t[i].references--}for(var c=r(e,o),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 r=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(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.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 r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,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/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.20" : 0;
3553
+ return true ? "Appshell:1.0.0-alpha.22" : 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.20" : 0;
5485
+ return true ? "Appshell:1.0.0-alpha.22" : 0;
5486
5486
  }
5487
5487
  function getGlobalFederationInstance(name, version) {
5488
5488
  const buildId = getBuilderId();
@@ -7874,7 +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.20", () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! ../runtime/src/index.ts */ "../runtime/src/index.ts"))))));
7877
+ /******/ register("@appshell/runtime", "1.0.0-alpha.22", () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! ../runtime/src/index.ts */ "../runtime/src/index.ts"))))));
7878
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"))))));
7879
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"))))));
7880
7880
  /******/ }
@@ -7887,7 +7887,7 @@ function updateRemoteOptions(options) {
7887
7887
  /******/
7888
7888
  /******/ /* webpack/runtime/sharing */
7889
7889
  /******/ (() => {
7890
- /******/ __webpack_require__.federation.initOptions.shared = { "@appshell/runtime": [{ version: "1.0.0-alpha.20",
7890
+ /******/ __webpack_require__.federation.initOptions.shared = { "@appshell/runtime": [{ version: "1.0.0-alpha.22",
7891
7891
  /******/ get: () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! ../runtime/src/index.ts */ "../runtime/src/index.ts"))))),
7892
7892
  /******/ scope: ["default"],
7893
7893
  /******/ shareConfig: {"eager":false,"singleton":true,"layer":null},
@@ -7955,7 +7955,7 @@ function updateRemoteOptions(options) {
7955
7955
  /******/ fallback: () => (__webpack_require__.e("runtime_src_index_ts").then(() => (() => (__webpack_require__(/*! @appshell/runtime */ "../runtime/src/index.ts"))))),
7956
7956
  /******/ shareScope: ["default"],
7957
7957
  /******/ singleton: true,
7958
- /******/ requiredVersion: "^1.0.0-alpha.20",
7958
+ /******/ requiredVersion: "^1.0.0-alpha.22",
7959
7959
  /******/ strictVersion: false,
7960
7960
  /******/ eager: false,
7961
7961
  /******/ layer: undefined,