@pega/constellationjs 1.0.4 → 1.0.5
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/bootstrap-shell.js +1 -1
- package/dist/bootstrap-shell.js.br +0 -0
- package/dist/bootstrap-shell.js.gz +0 -0
- package/dist/constellation-core.d669.js +2 -0
- package/dist/constellation-core.d669.js.LICENSE.txt +1 -0
- package/dist/constellation-core.d669.js.br +0 -0
- package/dist/constellation-core.d669.js.gz +0 -0
- package/dist/lib_asset.json +1 -1
- package/package.json +1 -1
- package/dist/constellation-core.ea5e.js +0 -2
- package/dist/constellation-core.ea5e.js.LICENSE.txt +0 -1
- package/dist/constellation-core.ea5e.js.br +0 -0
- package/dist/constellation-core.ea5e.js.gz +0 -0
package/dist/bootstrap-shell.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const setC11nCookie860=(e,o,t)=>{o&&0!==o.length||console.error("bootstrap-shell.setC11nCookie860() missing or zero length token");const n=e.lastIndexOf("/",e.length-2),i=`${e.substring(0,n)}/v860/${t}/setc11ncookie`;let a=new XMLHttpRequest;a.open("POST",i,!0),a.withCredentials=!0,a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.onload=()=>{},a.send("token="+o)},rootContainerWithHybrid={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary",contextName:"app"},children:[]}]},buildSemanticUrl=(e,o,t,n)=>{let i=!1;"true"===o&&(i=!0);let a=null,r=null;if(e){e.startsWith("/")&&(e=e.substring(1));const o=e.split("/");o.length>0&&o[0]&&(a=o[0]),o.length>1&&o[1]&&(r=o[1])}else i=!1;let s=t;return a&&(s=s+"/"+a),r&&(s=s+"/"+r),i&&(s+="?noPortal=true",r&&n&&(s=s+"&view="+n)),s};let containerCount=0;const loadView=(e,o,t=[],n,i,a,r)=>{const s=r||"mashup"+ ++containerCount,l={type:"RootContainer",config:{renderingMode:"portal",viewConfig:"@P .viewConfig",name:s}};window.PCore.getRuntimeParamsAPI().setRuntimeParams(n),constellationCore.loadRootComponent(e,l,t,i,a).then((()=>constellationCore.updateStoreWithUiRoot(o,s)))},loadPortal=(e,o,t=[],n)=>{const i=n||"portal"+ ++containerCount,a={type:"RootContainer",config:{viewConfig:"@P .viewConfig",renderingMode:"portal",skeleton:"LoadingComponent",name:i}};t.push(a.config.skeleton),constellationCore.loadRootComponent(e,a,t).then((()=>constellationCore.loadPortalView(o,i)))},loadComponent=(e,o,t)=>constellationCore.loadComponent(o,e,t),loadViewByName=(e,o,t,n,i,a,r,s)=>{const l=s||"mashup"+ ++containerCount,C={type:"RootContainer",config:{viewConfig:"@P .viewConfig",renderingMode:"view",name:l}};constellationCore.loadRootComponent(e,C,i,a,r).then((()=>constellationCore.loadViewByName(o,t,n,l)))},loadMashup=(e,o=!0)=>{if(o){const o=document.getElementsByTagName(e)[0]&&document.getElementsByTagName(e)[0].parentNode;o&&(o.innerHTML+="\n <style id='portal-less-styles'>\n app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }\n </style>\n ")}constellationCore.loadRootComponent(e,{type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},["View","ViewContainer"]),window.parent!==window&&import(constellationCore.PCoreInstance.getAssetLoader().getStaticServerUrl()+"constellation-mashup-bridge.js").then((e=>{e.mashup.init({resizing:"stretch"})}))},loadCase=(e,o,t=[],n,i)=>{t.push("HybridViewContainer","View"),constellationCore.loadRootComponent(e,rootContainerWithHybrid,t,n,i).then((()=>constellationCore.getCaseApi().openCase(o,"app","primary")))},createCase=(e,o,t=[],n,i)=>{t.push("HybridViewContainer","View"),constellationCore.loadRootComponent(e,rootContainerWithHybrid,t,n,i).then((()=>constellationCore.getCaseApi().createCase(o,"app","primary")))},loadAssignment=(e,o,t=[],n,i)=>{t.push("HybridViewContainer","View"),constellationCore.loadRootComponent(e,rootContainerWithHybrid,t,n,i).then((()=>constellationCore.getCaseApi().openAssignment(o,"app","primary")))},initCoreConfig=e=>{const{routingInfo:o,actionModel:t,serviceConfig:n,additionalHeaders:i,tokens:a,semanticUrl:r,noPortal:s,timezone:l,noHistory:C,viewName:c,theme:p,restServerConfig:d,dynamicLoadComponents:m=!0,dynamicSemanticUrl:g=!0,dynamicSetCookie:h=!0,enableRouting:w=!0,locale:u,environmentInfo:y,remoteCaseMapping:f={}}=e,{appAlias:v,googleMapKey:P,staticContentServer:S,contextPath:R}=n;let b=location.origin,A={};if(void 0!==d&&(b=d),R&&(b=`${b}${R}`),v&&(b=`${b}/${v}`),!0===g){const e=buildSemanticUrl(r,s,b,c);!C&&e&&history.pushState({},"home",e)}else{let e=window.location.href;e.indexOf("?")>0&&(e=e.substring(0,e.indexOf("?")),history.pushState({},"home",e)),A.dynamicSemanticUrl=!1}!0!==m&&(A.dynamicLoadComponents=!1);let H=null;if(v){const e=v.indexOf("/app/");H=e>=0?v.substring(e+1):v}!0===h&&setC11nCookie860(S,a.C11NB2S,H),constellationCore.enableAppRouting(w),Object.keys(A).length>0&&PCore.setBehaviorOverrides(A),constellationCore.initStore(),p&&PCore.getEnvironmentInfo().setTheme(p),constellationCore.setFetchDefaultHeaders(i);const I={...o,domain:`${window.location.protocol}//${window.location.host}`,searchParams:window.location.search};constellationCore.initAppShell(I,t,{server:b}),constellationCore.setAppAlias(H),constellationCore.setGoogleMapsAPIKey(P),constellationCore.setStaticServerUrl(S,a.C11NB2S),constellationCore.PCoreInstance.getLocaleUtils().setTimezone(l),PCore.getEnvironmentInfo().setLocale(u),PCore.getRemoteCaseUtils().setRemoteCaseMapping(f),window.PCore.getEnvironmentInfo().setEnvironmentInfo(y)},importConstellationCore=async(e,o)=>{const t=o.prerequisite;if(t&&t.length>0){const o=t[0],n=e.endsWith("/")?`${e}prerequisite/${o}`:`${e}/prerequisite/${o}`;return import(n).then((o=>{window.constellationCore=o,constellationCore.setStaticServerUrl(e),void 0!==window.constellationCore.PCoreInstance&&(window.PCore=window.constellationCore.PCoreInstance);for(let o=1;o<t.length;o++)import(`${e}prerequisite/${t[o]}`).then((e=>{console.log(e)}))}))}return null},importExternals=async e=>{await constellationCore.PCoreInstance.getAssetLoader().loadAssets(e.externals),await constellationCore.PCoreInstance.getAssetLoader().loadAssets(e.entry)},importAssetsJson=async e=>{let o=(new Date).getTime();return fetch(`${e}lib_asset.json?v=${o}`).then((e=>e.json()))},bootstrap=async e=>{const{staticContentServer:o}=e.serviceConfig,t=await importAssetsJson(o);await importConstellationCore(o,t),initCoreConfig(e),await importExternals(t)},getBootstrapConfig=async(e,o)=>fetch(e+"/api/application/v2/data_views/D_pxBootstrapConfig",{method:"GET",headers:new Headers({Authorization:o})}).then((e=>e.json())),loadRootContainer=(e,o=[])=>(o.push("HybridViewContainer","View"),constellationCore.loadRootComponent(e,rootContainerWithHybrid,o)),bootstrapWithAuthHeader=async(e,o)=>{const{restServerUrl:
|
|
1
|
+
const setC11nCookie860=(e,o,t)=>{o&&0!==o.length||console.error("bootstrap-shell.setC11nCookie860() missing or zero length token");const n=e.lastIndexOf("/",e.length-2),i=`${e.substring(0,n)}/v860/${t}/setc11ncookie`;let a=new XMLHttpRequest;a.open("POST",i,!0),a.withCredentials=!0,a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.onload=()=>{},a.send("token="+o)},rootContainerWithHybrid={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary",contextName:"app"},children:[]}]},buildSemanticUrl=(e,o,t,n)=>{let i=!1;"true"===o&&(i=!0);let a=null,r=null;if(e){e.startsWith("/")&&(e=e.substring(1));const o=e.split("/");o.length>0&&o[0]&&(a=o[0]),o.length>1&&o[1]&&(r=o[1])}else i=!1;let s=t;return a&&(s=s+"/"+a),r&&(s=s+"/"+r),i&&(s+="?noPortal=true",r&&n&&(s=s+"&view="+n)),s};let containerCount=0;const loadView=(e,o,t=[],n,i,a,r)=>{const s=r||"mashup"+ ++containerCount,l={type:"RootContainer",config:{renderingMode:"portal",viewConfig:"@P .viewConfig",name:s}};window.PCore.getRuntimeParamsAPI().setRuntimeParams(n),constellationCore.loadRootComponent(e,l,t,i,a).then((()=>constellationCore.updateStoreWithUiRoot(o,s)))},loadPortal=(e,o,t=[],n)=>{const i=n||"portal"+ ++containerCount,a={type:"RootContainer",config:{viewConfig:"@P .viewConfig",renderingMode:"portal",skeleton:"LoadingComponent",name:i}};t.push(a.config.skeleton),constellationCore.loadRootComponent(e,a,t).then((()=>constellationCore.loadPortalView(o,i)))},loadComponent=(e,o,t)=>constellationCore.loadComponent(o,e,t),loadViewByName=(e,o,t,n,i,a,r,s)=>{const l=s||"mashup"+ ++containerCount,C={type:"RootContainer",config:{viewConfig:"@P .viewConfig",renderingMode:"view",name:l}};constellationCore.loadRootComponent(e,C,i,a,r).then((()=>constellationCore.loadViewByName(o,t,n,l)))},loadMashup=(e,o=!0)=>{if(o){const o=document.getElementsByTagName(e)[0]&&document.getElementsByTagName(e)[0].parentNode;o&&(o.innerHTML+="\n <style id='portal-less-styles'>\n app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }\n </style>\n ")}constellationCore.loadRootComponent(e,{type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},["View","ViewContainer"]),window.parent!==window&&import(constellationCore.PCoreInstance.getAssetLoader().getStaticServerUrl()+"constellation-mashup-bridge.js").then((e=>{e.mashup.init({resizing:"stretch"})}))},loadCase=(e,o,t=[],n,i)=>{t.push("HybridViewContainer","View"),constellationCore.loadRootComponent(e,rootContainerWithHybrid,t,n,i).then((()=>constellationCore.getCaseApi().openCase(o,"app","primary")))},createCase=(e,o,t=[],n,i)=>{t.push("HybridViewContainer","View"),constellationCore.loadRootComponent(e,rootContainerWithHybrid,t,n,i).then((()=>constellationCore.getCaseApi().createCase(o,"app","primary")))},loadAssignment=(e,o,t=[],n,i)=>{t.push("HybridViewContainer","View"),constellationCore.loadRootComponent(e,rootContainerWithHybrid,t,n,i).then((()=>constellationCore.getCaseApi().openAssignment(o,"app","primary")))},initCoreConfig=e=>{const{routingInfo:o,actionModel:t,serviceConfig:n,additionalHeaders:i,tokens:a,semanticUrl:r,noPortal:s,timezone:l,noHistory:C,viewName:c,theme:p,restServerConfig:d,dynamicLoadComponents:m=!0,dynamicSemanticUrl:g=!0,dynamicSetCookie:h=!0,enableRouting:w=!0,locale:u,environmentInfo:y,remoteCaseMapping:f={}}=e,{appAlias:v,googleMapKey:P,staticContentServer:S,contextPath:R}=n;let b=location.origin,A={};if(void 0!==d&&(b=d),R&&(b=`${b}${R}`),v&&(b=`${b}/${v}`),!0===g){const e=buildSemanticUrl(r,s,b,c);!C&&e&&history.pushState({},"home",e)}else{let e=window.location.href;e.indexOf("?")>0&&(e=e.substring(0,e.indexOf("?")),history.pushState({},"home",e)),A.dynamicSemanticUrl=!1}!0!==m&&(A.dynamicLoadComponents=!1);let H=null;if(v){const e=v.indexOf("/app/");H=e>=0?v.substring(e+1):v}!0===h&&setC11nCookie860(S,a.C11NB2S,H),constellationCore.enableAppRouting(w),Object.keys(A).length>0&&PCore.setBehaviorOverrides(A),constellationCore.initStore(),p&&PCore.getEnvironmentInfo().setTheme(p),constellationCore.setFetchDefaultHeaders(i);const I={...o,domain:`${window.location.protocol}//${window.location.host}`,searchParams:window.location.search};constellationCore.initAppShell(I,t,{server:b}),constellationCore.setAppAlias(H),constellationCore.setGoogleMapsAPIKey(P),constellationCore.setStaticServerUrl(S,a.C11NB2S),constellationCore.PCoreInstance.getLocaleUtils().setTimezone(l),PCore.getEnvironmentInfo().setLocale(u),PCore.getRemoteCaseUtils().setRemoteCaseMapping(f),window.PCore.getEnvironmentInfo().setEnvironmentInfo(y)},importConstellationCore=async(e,o)=>{const t=o.prerequisite;if(t&&t.length>0){const o=t[0],n=e.endsWith("/")?`${e}prerequisite/${o}`:`${e}/prerequisite/${o}`;return import(n).then((o=>{window.constellationCore=o,constellationCore.setStaticServerUrl(e),void 0!==window.constellationCore.PCoreInstance&&(window.PCore=window.constellationCore.PCoreInstance);for(let o=1;o<t.length;o++)import(`${e}prerequisite/${t[o]}`).then((e=>{console.log(e)}))}))}return null},importExternals=async e=>{await constellationCore.PCoreInstance.getAssetLoader().loadAssets(e.externals),await constellationCore.PCoreInstance.getAssetLoader().loadAssets(e.entry)},importAssetsJson=async e=>{let o=(new Date).getTime();return fetch(`${e}lib_asset.json?v=${o}`).then((e=>e.json()))},bootstrap=async e=>{const{staticContentServer:o}=e.serviceConfig,t=await importAssetsJson(o);await importConstellationCore(o,t),initCoreConfig(e),await importExternals(t)},getBootstrapConfig=async(e,o)=>fetch(e+"/api/application/v2/data_views/D_pxBootstrapConfig",{method:"GET",headers:new Headers({Authorization:o})}).then((e=>e.json())),loadRootContainer=(e,o=[],t,n)=>(o.push("HybridViewContainer","View"),constellationCore.loadRootComponent(e,rootContainerWithHybrid,o,t,n)),bootstrapWithAuthHeader=async(e,o,t=[],n,i)=>{const{restServerUrl:a,authorizationHeader:r,appAlias:s,customRendering:l=!1,onPCoreReadyCallback:C,staticContentServerUrl:c}=e;let p;p=s?await getBootstrapConfig(`${a}/${s}`,r):await getBootstrapConfig(""+a,r);const d=JSON.parse(p.pyConfigJSON);d.restServerConfig=a,d.dynamicSemanticUrl=!1,d.dynamicSetCookie=!1,d.enableRouting=!1,d.serviceConfig.contextPath="",d.serviceConfig.appAlias=s,d.additionalHeaders={Authorization:r},d.dynamicLoadComponents=!l,d.dynamicSemanticUrl=!l,d.noHistory=!0;const m=c||d.serviceConfig.staticContentServer;d.serviceConfig.staticContentServer=m;const g=await importAssetsJson(m);await importConstellationCore(m,g),initCoreConfig(d),C&&window.PCore.onPCoreReady(C),l||(await importExternals(g),await loadRootContainer(o,t,n,i))};export{bootstrap,loadView,loadPortal,loadComponent,loadMashup,loadViewByName,loadCase,createCase,loadAssignment,bootstrapWithAuthHeader};
|
|
Binary file
|
|
Binary file
|