@equinor/fusion-framework-cli 7.0.5 → 7.0.7
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.0.7](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@7.0.6...@equinor/fusion-framework-cli@7.0.7) (2023-05-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @equinor/fusion-framework-cli
|
|
9
|
+
|
|
10
|
+
## 7.0.6 (2023-05-22)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @equinor/fusion-framework-cli
|
|
13
|
+
|
|
6
14
|
## [7.0.5](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@7.0.4...@equinor/fusion-framework-cli@7.0.5) (2023-05-12)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @equinor/fusion-framework-cli
|
|
@@ -442,7 +442,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
442
442
|
* LICENSE.md file in the root directory of this source tree.
|
|
443
443
|
*
|
|
444
444
|
* @license MIT
|
|
445
|
-
*/function GX(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}const KX=typeof Object.is=="function"?Object.is:GX,{useState:YX,useEffect:XX,useLayoutEffect:QX,useDebugValue:JX}=Fa;function ZX(t,e,r){const n=e(),[{inst:i},o]=YX({inst:{value:n,getSnapshot:e}});return QX(()=>{i.value=n,i.getSnapshot=e,m3(i)&&o({inst:i})},[t,n,e]),XX(()=>(m3(i)&&o({inst:i}),t(()=>{m3(i)&&o({inst:i})})),[t]),JX(n),n}function m3(t){const e=t.getSnapshot,r=t.value;try{const n=e();return!KX(r,n)}catch{return!0}}function eQ(t,e,r){return e()}const tQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rQ=!tQ,nQ=rQ?eQ:ZX,iQ="useSyncExternalStore"in Fa?(t=>t.useSyncExternalStore)(Fa):nQ,Z7=y.createContext(null),ey=y.createContext(null),MI=y.createContext(null),b5=y.createContext(null),Qd=y.createContext({outlet:null,matches:[]}),$I=y.createContext(null);function h8(){return h8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h8.apply(this,arguments)}function ty(){return y.useContext(b5)!=null}function oQ(){return ty()||Ei(!1),y.useContext(b5).location}const aQ=y.createContext(null);function sQ(t){let e=y.useContext(Qd).outlet;return e&&y.createElement(aQ.Provider,{value:t},e)}function cQ(){let{matches:t}=y.useContext(Qd),e=t[t.length-1];return e?e.params:{}}function lQ(t,e){ty()||Ei(!1);let{navigator:r}=y.useContext(MI),n=y.useContext(ey),{matches:i}=y.useContext(Qd),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let c=oQ(),l;if(e){var d;let p=typeof e=="string"?J7(e):e;s==="/"||(d=p.pathname)!=null&&d.startsWith(s)||Ei(!1),l=p}else l=c;let h=l.pathname||"/",u=s==="/"?h:h.slice(s.length)||"/",f=$X(t,{pathname:u}),v=fQ(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},a,p.params),pathname:Dl([s,r.encodeLocation?r.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?s:Dl([s,r.encodeLocation?r.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),i,n||void 0);return e&&v?y.createElement(b5.Provider,{value:{location:h8({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:Gp.Pop}},v):v}function dQ(){let t=gQ(),e=WX(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},e),r?y.createElement("pre",{style:i},r):null,o)}class hQ extends y.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location?{error:e.error,location:e.location}:{error:e.error||r.error,location:r.location}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error?y.createElement(Qd.Provider,{value:this.props.routeContext},y.createElement($I.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function uQ(t){let{routeContext:e,match:r,children:n}=t,i=y.useContext(Z7);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),y.createElement(Qd.Provider,{value:e},n)}function fQ(t,e,r){if(e===void 0&&(e=[]),t==null)if(r!=null&&r.errors)t=r.matches;else return null;let n=t,i=r==null?void 0:r.errors;if(i!=null){let o=n.findIndex(a=>a.route.id&&(i==null?void 0:i[a.route.id]));o>=0||Ei(!1),n=n.slice(0,Math.min(n.length,o+1))}return n.reduceRight((o,a,s)=>{let c=a.route.id?i==null?void 0:i[a.route.id]:null,l=null;r&&(a.route.ErrorBoundary?l=y.createElement(a.route.ErrorBoundary,null):a.route.errorElement?l=a.route.errorElement:l=y.createElement(dQ,null));let d=e.concat(n.slice(0,s+1)),h=()=>{let u=o;return c?u=l:a.route.Component?u=y.createElement(a.route.Component,null):a.route.element&&(u=a.route.element),y.createElement(uQ,{match:a,routeContext:{outlet:o,matches:d},children:u})};return r&&(a.route.ErrorBoundary||a.route.errorElement||s===0)?y.createElement(hQ,{location:r.location,component:l,error:c,children:h(),routeContext:{outlet:null,matches:d}}):h()},null)}var tz;(function(t){t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator"})(tz||(tz={}));var Kp;(function(t){t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator"})(Kp||(Kp={}));function pQ(t){let e=y.useContext(ey);return e||Ei(!1),e}function vQ(t){let e=y.useContext(Qd);return e||Ei(!1),e}function mQ(t){let e=vQ(),r=e.matches[e.matches.length-1];return r.route.id||Ei(!1),r.route.id}function gQ(){var t;let e=y.useContext($I),r=pQ(Kp.UseRouteError),n=mQ(Kp.UseRouteError);return e||((t=r.errors)==null?void 0:t[n])}function yQ(t){let{fallbackElement:e,router:r}=t,n=y.useCallback(()=>r.state,[r]),i=iQ(r.subscribe,n,n),o=y.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:c=>r.navigate(c),push:(c,l,d)=>r.navigate(c,{state:l,preventScrollReset:d==null?void 0:d.preventScrollReset}),replace:(c,l,d)=>r.navigate(c,{replace:!0,state:l,preventScrollReset:d==null?void 0:d.preventScrollReset})}),[r]),a=r.basename||"/",s=y.useMemo(()=>({router:r,navigator:o,static:!1,basename:a}),[r,o,a]);return y.createElement(y.Fragment,null,y.createElement(Z7.Provider,{value:s},y.createElement(ey.Provider,{value:i},y.createElement(wQ,{basename:r.basename,location:r.state.location,navigationType:r.state.historyAction,navigator:o},r.state.initialized?y.createElement(xQ,null):e))),null)}function _Q(t){return sQ(t.context)}function bQ(t){Ei(!1)}function wQ(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Gp.Pop,navigator:o,static:a=!1}=t;ty()&&Ei(!1);let s=e.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:s,navigator:o,static:a}),[s,o,a]);typeof n=="string"&&(n=J7(n));let{pathname:l="/",search:d="",hash:h="",state:u=null,key:f="default"}=n,v=y.useMemo(()=>{let p=AI(l,s);return p==null?null:{location:{pathname:p,search:d,hash:h,state:u,key:f},navigationType:i}},[s,l,d,h,u,f,i]);return v==null?null:y.createElement(MI.Provider,{value:c},y.createElement(b5.Provider,{children:r,value:v}))}function xQ(t){let{children:e,location:r}=t,n=y.useContext(Z7),i=n&&!e?n.router.routes:u8(e);return lQ(i,r)}var rz;(function(t){t[t.pending=0]="pending",t[t.success=1]="success",t[t.error=2]="error"})(rz||(rz={}));new Promise(()=>{});function u8(t,e){e===void 0&&(e=[]);let r=[];return y.Children.forEach(t,(n,i)=>{if(!y.isValidElement(n))return;let o=[...e,i];if(n.type===y.Fragment){r.push.apply(r,u8(n.props.children,o));return}n.type!==bQ&&Ei(!1),!n.props.index||!n.props.children||Ei(!1);let a={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=u8(n.props.children,o)),r.push(a)}),r}const zQ=(t,e,r)=>{y.useEffect(()=>{const n=t.subscribe(e);return n.add(r),()=>n.unsubscribe()},[t,e])},CQ=(t,e,r)=>{y.useLayoutEffect(()=>{const n=t.subscribe(e);return n.add(r),()=>n.unsubscribe()},[t,e])};function xu(t,e){const[r]=y.useState(e==null?void 0:e.initial),[n,i]=y.useState(r),[o,a]=y.useState(null),[s,c]=y.useState(!1),l=y.useCallback(()=>{a(null),i(r),c(!1)},[i,a,c,r]);y.useLayoutEffect(()=>{const h=t.value;return h&&i(h),l},[i,l,t]);const d=y.useMemo(()=>({next:i,error:a,complete:()=>c(!0)}),[i,a,c]);return CQ(t,d,e==null?void 0:e.teardown),{value:n,error:o,complete:s}}const f8=({error:t})=>pe(Fn,{children:[pe("div",{style:{marginTop:20,border:"1px solid"},children:[z("h4",{style:{backgroundColor:"rgb(153, 0, 37)",color:"white",padding:10,margin:0},children:t.message}),z("section",{style:{padding:10},children:t.stack&&z("pre",{children:t.stack})})]}),t.cause&&z(f8,{error:t.cause})]}),kQ=t=>{const{appKey:e}=t,r=jn(),n=y.useRef(null),[i,o]=y.useState(!1),[a,s]=y.useState(),{value:c}=xu(y.useMemo(()=>r.modules.app.current$,[r.modules.app]));return y.useEffect(()=>{r.modules.app.setCurrentApp(e)},[e,r]),y.useEffect(()=>{o(!0),s(void 0);const l=new Un;return l.add(c==null?void 0:c.initialize().subscribe({next:({manifest:d,script:h,config:u})=>{const[f]=window.location.pathname.match(/\/?apps\/[a-z|-]+(\/)?/g)??[""],v=document.createElement("div");if(v.style.height="100%",!n.current)throw Error("Missing application mounting point");n.current.appendChild(v),n.current.style.height="100%";const p=h.renderApp??h.default;l.add(p(v,{fusion:r,env:{basename:f,config:u,manifest:d}})),l.add(()=>v.remove())},complete:()=>{o(!1)},error:d=>{s(d)}})),()=>l.unsubscribe()},[r,c,n]),a?a.cause instanceof Os?pe("div",{children:[z("h2",{children:"🔥 Failed to load application manifest 🤬"}),z("h3",{children:a.cause.type}),z(f8,{error:a}),";"]}):pe("div",{children:[z("h2",{children:"🔥 Failed to load application 🤬"}),z(f8,{error:a}),";"]}):z("section",{ref:n,children:i&&z(sI,{text:"Loading Application"})})},EQ=()=>{const t=jn().modules.app;if(!t)throw Error("Current framework does not have AppModule configured");const e=y.useMemo(()=>t.current$,[t]),{value:r}=xu(e);return{currentApp:r,setCurrentApp:y.useMemo(()=>t.setCurrentApp.bind(t),[t]),clearCurrentApp:y.useMemo(()=>t.clearCurrentApp.bind(t),[t])}};class w5 extends CustomEvent{constructor(e){super(w5.eventName,e)}}w5.eventName="select";class cd extends CustomEvent{constructor(e){super(cd.eventName,e)}}cd.eventName="fwc-searchabledropdown-controller-connect";var ch;class PI extends On{constructor(){super(...arguments),this.resolverCallbacks=[],ch.set(this,void 0)}createRenderRoot(){return this}connectResolver(e){Y1(this,ch,e,"f"),this.resolverCallbacks.forEach(r=>{r(e)})}removeResolver(){this.resolverCallbacks.forEach(e=>{e()})}connectedCallback(){super.connectedCallback(),this.addEventListener(cd.eventName,this.handleElementConnect)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(cd.eventName,this.handleElementConnect)}handleElementConnect(e){const{disconnectedCallback:r,updateResolver:n}=e.detail;r(()=>{this.resolverCallbacks.filter(i=>i!==n)}),et(this,ch,"f")&&n(et(this,ch,"f")),this.resolverCallbacks.push(n),e.preventDefault(),e.stopPropagation()}}ch=new WeakMap;/**
|
|
445
|
+
*/function GX(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}const KX=typeof Object.is=="function"?Object.is:GX,{useState:YX,useEffect:XX,useLayoutEffect:QX,useDebugValue:JX}=Fa;function ZX(t,e,r){const n=e(),[{inst:i},o]=YX({inst:{value:n,getSnapshot:e}});return QX(()=>{i.value=n,i.getSnapshot=e,m3(i)&&o({inst:i})},[t,n,e]),XX(()=>(m3(i)&&o({inst:i}),t(()=>{m3(i)&&o({inst:i})})),[t]),JX(n),n}function m3(t){const e=t.getSnapshot,r=t.value;try{const n=e();return!KX(r,n)}catch{return!0}}function eQ(t,e,r){return e()}const tQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rQ=!tQ,nQ=rQ?eQ:ZX,iQ="useSyncExternalStore"in Fa?(t=>t.useSyncExternalStore)(Fa):nQ,Z7=y.createContext(null),ey=y.createContext(null),MI=y.createContext(null),b5=y.createContext(null),Qd=y.createContext({outlet:null,matches:[]}),$I=y.createContext(null);function h8(){return h8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h8.apply(this,arguments)}function ty(){return y.useContext(b5)!=null}function oQ(){return ty()||Ei(!1),y.useContext(b5).location}const aQ=y.createContext(null);function sQ(t){let e=y.useContext(Qd).outlet;return e&&y.createElement(aQ.Provider,{value:t},e)}function cQ(){let{matches:t}=y.useContext(Qd),e=t[t.length-1];return e?e.params:{}}function lQ(t,e){ty()||Ei(!1);let{navigator:r}=y.useContext(MI),n=y.useContext(ey),{matches:i}=y.useContext(Qd),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let c=oQ(),l;if(e){var d;let p=typeof e=="string"?J7(e):e;s==="/"||(d=p.pathname)!=null&&d.startsWith(s)||Ei(!1),l=p}else l=c;let h=l.pathname||"/",u=s==="/"?h:h.slice(s.length)||"/",f=$X(t,{pathname:u}),v=fQ(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},a,p.params),pathname:Dl([s,r.encodeLocation?r.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?s:Dl([s,r.encodeLocation?r.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),i,n||void 0);return e&&v?y.createElement(b5.Provider,{value:{location:h8({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:Gp.Pop}},v):v}function dQ(){let t=gQ(),e=WX(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},e),r?y.createElement("pre",{style:i},r):null,o)}class hQ extends y.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location?{error:e.error,location:e.location}:{error:e.error||r.error,location:r.location}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error?y.createElement(Qd.Provider,{value:this.props.routeContext},y.createElement($I.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function uQ(t){let{routeContext:e,match:r,children:n}=t,i=y.useContext(Z7);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),y.createElement(Qd.Provider,{value:e},n)}function fQ(t,e,r){if(e===void 0&&(e=[]),t==null)if(r!=null&&r.errors)t=r.matches;else return null;let n=t,i=r==null?void 0:r.errors;if(i!=null){let o=n.findIndex(a=>a.route.id&&(i==null?void 0:i[a.route.id]));o>=0||Ei(!1),n=n.slice(0,Math.min(n.length,o+1))}return n.reduceRight((o,a,s)=>{let c=a.route.id?i==null?void 0:i[a.route.id]:null,l=null;r&&(a.route.ErrorBoundary?l=y.createElement(a.route.ErrorBoundary,null):a.route.errorElement?l=a.route.errorElement:l=y.createElement(dQ,null));let d=e.concat(n.slice(0,s+1)),h=()=>{let u=o;return c?u=l:a.route.Component?u=y.createElement(a.route.Component,null):a.route.element&&(u=a.route.element),y.createElement(uQ,{match:a,routeContext:{outlet:o,matches:d},children:u})};return r&&(a.route.ErrorBoundary||a.route.errorElement||s===0)?y.createElement(hQ,{location:r.location,component:l,error:c,children:h(),routeContext:{outlet:null,matches:d}}):h()},null)}var tz;(function(t){t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator"})(tz||(tz={}));var Kp;(function(t){t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator"})(Kp||(Kp={}));function pQ(t){let e=y.useContext(ey);return e||Ei(!1),e}function vQ(t){let e=y.useContext(Qd);return e||Ei(!1),e}function mQ(t){let e=vQ(),r=e.matches[e.matches.length-1];return r.route.id||Ei(!1),r.route.id}function gQ(){var t;let e=y.useContext($I),r=pQ(Kp.UseRouteError),n=mQ(Kp.UseRouteError);return e||((t=r.errors)==null?void 0:t[n])}function yQ(t){let{fallbackElement:e,router:r}=t,n=y.useCallback(()=>r.state,[r]),i=iQ(r.subscribe,n,n),o=y.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:c=>r.navigate(c),push:(c,l,d)=>r.navigate(c,{state:l,preventScrollReset:d==null?void 0:d.preventScrollReset}),replace:(c,l,d)=>r.navigate(c,{replace:!0,state:l,preventScrollReset:d==null?void 0:d.preventScrollReset})}),[r]),a=r.basename||"/",s=y.useMemo(()=>({router:r,navigator:o,static:!1,basename:a}),[r,o,a]);return y.createElement(y.Fragment,null,y.createElement(Z7.Provider,{value:s},y.createElement(ey.Provider,{value:i},y.createElement(wQ,{basename:r.basename,location:r.state.location,navigationType:r.state.historyAction,navigator:o},r.state.initialized?y.createElement(xQ,null):e))),null)}function _Q(t){return sQ(t.context)}function bQ(t){Ei(!1)}function wQ(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Gp.Pop,navigator:o,static:a=!1}=t;ty()&&Ei(!1);let s=e.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:s,navigator:o,static:a}),[s,o,a]);typeof n=="string"&&(n=J7(n));let{pathname:l="/",search:d="",hash:h="",state:u=null,key:f="default"}=n,v=y.useMemo(()=>{let p=AI(l,s);return p==null?null:{location:{pathname:p,search:d,hash:h,state:u,key:f},navigationType:i}},[s,l,d,h,u,f,i]);return v==null?null:y.createElement(MI.Provider,{value:c},y.createElement(b5.Provider,{children:r,value:v}))}function xQ(t){let{children:e,location:r}=t,n=y.useContext(Z7),i=n&&!e?n.router.routes:u8(e);return lQ(i,r)}var rz;(function(t){t[t.pending=0]="pending",t[t.success=1]="success",t[t.error=2]="error"})(rz||(rz={}));new Promise(()=>{});function u8(t,e){e===void 0&&(e=[]);let r=[];return y.Children.forEach(t,(n,i)=>{if(!y.isValidElement(n))return;let o=[...e,i];if(n.type===y.Fragment){r.push.apply(r,u8(n.props.children,o));return}n.type!==bQ&&Ei(!1),!n.props.index||!n.props.children||Ei(!1);let a={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=u8(n.props.children,o)),r.push(a)}),r}const zQ=(t,e,r)=>{y.useEffect(()=>{const n=t.subscribe(e);return n.add(r),()=>n.unsubscribe()},[t,e])},CQ=(t,e,r)=>{y.useLayoutEffect(()=>{const n=t.subscribe(e);return n.add(r),()=>n.unsubscribe()},[t,e])};function xu(t,e){const[r]=y.useState(e==null?void 0:e.initial),[n,i]=y.useState(r),[o,a]=y.useState(null),[s,c]=y.useState(!1),l=y.useCallback(()=>{a(null),i(r),c(!1)},[i,a,c,r]);y.useLayoutEffect(()=>{const h=t.value;return h&&i(h),l},[i,l,t]);const d=y.useMemo(()=>({next:i,error:a,complete:()=>c(!0)}),[i,a,c]);return CQ(t,d,e==null?void 0:e.teardown),{value:n,error:o,complete:s}}const f8=({error:t})=>pe(Fn,{children:[pe("div",{style:{marginTop:20,border:"1px solid"},children:[z("h4",{style:{backgroundColor:"rgb(153, 0, 37)",color:"white",padding:10,margin:0},children:t.message}),z("section",{style:{padding:10},children:t.stack&&z("pre",{children:t.stack})})]}),t.cause&&z(f8,{error:t.cause})]}),kQ=t=>{const{appKey:e}=t,r=jn(),n=y.useRef(null),[i,o]=y.useState(!1),[a,s]=y.useState(),{value:c}=xu(y.useMemo(()=>r.modules.app.current$,[r.modules.app]));return y.useEffect(()=>{r.modules.app.setCurrentApp(e)},[e,r]),y.useEffect(()=>{o(!0),s(void 0);const l=new Un;return l.add(c==null?void 0:c.initialize().subscribe({next:({manifest:d,script:h,config:u})=>{const[f]=window.location.pathname.match(/\/?apps\/[a-z|-]+(\/)?/g)??[""],v=document.createElement("div");if(v.style.height="100%",!n.current)throw Error("Missing application mounting point");n.current.appendChild(v),n.current.style.height="100%";const p=h.renderApp??h.default;l.add(p(v,{fusion:r,env:{basename:f,config:u,manifest:d}})),l.add(()=>v.remove())},complete:()=>{o(!1)},error:d=>{s(d)}})),()=>l.unsubscribe()},[r,c,n]),a?a.cause instanceof Os?pe("div",{children:[z("h2",{children:"🔥 Failed to load application manifest 🤬"}),z("h3",{children:a.cause.type}),z(f8,{error:a}),";"]}):pe("div",{children:[z("h2",{children:"🔥 Failed to load application 🤬"}),z(f8,{error:a}),";"]}):z("section",{ref:n,children:i&&z(sI,{text:"Loading Application"})})},EQ=()=>{const t=jn().modules.app;if(!t)throw Error("Current framework does not have AppModule configured");const e=y.useMemo(()=>t.current$,[t]),{value:r,error:n}=xu(e);return{currentApp:r,setCurrentApp:y.useMemo(()=>t.setCurrentApp.bind(t),[t]),clearCurrentApp:y.useMemo(()=>t.clearCurrentApp.bind(t),[t]),error:n}};class w5 extends CustomEvent{constructor(e){super(w5.eventName,e)}}w5.eventName="select";class cd extends CustomEvent{constructor(e){super(cd.eventName,e)}}cd.eventName="fwc-searchabledropdown-controller-connect";var ch;class PI extends On{constructor(){super(...arguments),this.resolverCallbacks=[],ch.set(this,void 0)}createRenderRoot(){return this}connectResolver(e){Y1(this,ch,e,"f"),this.resolverCallbacks.forEach(r=>{r(e)})}removeResolver(){this.resolverCallbacks.forEach(e=>{e()})}connectedCallback(){super.connectedCallback(),this.addEventListener(cd.eventName,this.handleElementConnect)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(cd.eventName,this.handleElementConnect)}handleElementConnect(e){const{disconnectedCallback:r,updateResolver:n}=e.detail;r(()=>{this.resolverCallbacks.filter(i=>i!==n)}),et(this,ch,"f")&&n(et(this,ch,"f")),this.resolverCallbacks.push(n),e.preventDefault(),e.stopPropagation()}}ch=new WeakMap;/**
|
|
446
446
|
* @license
|
|
447
447
|
* Copyright 2017 Google LLC
|
|
448
448
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
};
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-976dd3f3.js"></script>
|
|
24
24
|
|
|
25
25
|
<body style="height: 100vh;">
|
|
26
26
|
<div id="root" style="height: 100%;"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-cli",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.7",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Fusion",
|
|
6
6
|
"Fusion Framework",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@equinor/eds-core-react": "^0.30.0",
|
|
28
28
|
"@equinor/eds-icons": "^0.19.1",
|
|
29
29
|
"@equinor/eds-tokens": "^0.9.0",
|
|
30
|
-
"@equinor/fusion-framework-app": "^7.0.
|
|
30
|
+
"@equinor/fusion-framework-app": "^7.0.12",
|
|
31
31
|
"@equinor/fusion-observable": "^8.0.0",
|
|
32
32
|
"@vitejs/plugin-react": "^3.1.0",
|
|
33
33
|
"commander": "^10.0.0",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"@equinor/fusion-framework-app": "^7.0.4",
|
|
50
50
|
"@equinor/fusion-framework-module-bookmark": "^1.0.4",
|
|
51
51
|
"@equinor/fusion-framework-module-context": "^4.0.5",
|
|
52
|
-
"@equinor/fusion-framework-react": "^5.
|
|
53
|
-
"@equinor/fusion-framework-react-components-bookmark": "^0.1.
|
|
54
|
-
"@equinor/fusion-framework-react-module-bookmark": "^2.0.
|
|
52
|
+
"@equinor/fusion-framework-react": "^5.1.1",
|
|
53
|
+
"@equinor/fusion-framework-react-components-bookmark": "^0.1.8",
|
|
54
|
+
"@equinor/fusion-framework-react-module-bookmark": "^2.0.7",
|
|
55
55
|
"@equinor/fusion-query": "^3.0.1",
|
|
56
56
|
"@equinor/fusion-react-button": "^0.8.1",
|
|
57
57
|
"@equinor/fusion-react-context-selector": "^0.4.3",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"styled-components": "^5.3.9",
|
|
72
72
|
"typescript": "^4.9.3"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "9eb632687eee5c14aff28a4470eb25ec2f9fe312"
|
|
75
75
|
}
|