@openfin/core-web 0.38.50 → 0.39.1
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/out/api-client.d.ts +2 -1
- package/out/api-client.js +1 -1
- package/out/docs/@openfin/core-web/type-aliases/InheritModeConnectConfig.md +2 -1
- package/out/{main-8b123dea.js → main-e207373b.js} +1 -1
- package/out/{main-65876140.js → main-ed43d092.js} +1 -1
- package/out/shared-worker.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
"use strict";var t=require("./main-8b123dea.js"),e=require("uuid"),o=require("golden-layout");require("buffer/"),require("events"),require("lodash");var i={},r={};Object.defineProperty(r,"__esModule",{value:!0}),r.mapValuesAsync=r.mapEntriesAsync=void 0;const a=(t,[e,o])=>({...t,[e]:o});async function n(t,e){return(await Promise.all(e.map((async([e,o])=>[e,await t(o,e)])))).reduce(a,{})}r.mapEntriesAsync=n,r.mapValuesAsync=async function(t,e){let o;return o=e instanceof Map?[...e.entries()]:Object.entries(e),n(t,o)};var s,c,l,u,d=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldSet||function(t,e,o,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,o):r?r.value=o:e.set(t,o),o},h=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldGet||function(t,e,o,i){if("a"===o&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?i:"a"===o?i.call(t):i?i.value:e.get(t)};Object.defineProperty(i,"__esModule",{value:!0});var m=i.DefaultLayoutManager=void 0;const y=r;class f{constructor(t){c.set(this,void 0),l.set(this,new Map),d(this,c,t,"f")}size(){return h(this,l,"f").size}async applyLayoutSnapshot({layouts:t}){if(Object.keys(t).length>1)throw new Error("[LayoutManager] Tried to call applyLayoutSnapshot with more than 1 layout. When implementing multiple layouts via overridden LayoutManager class, you must override and fully implement the applyLayoutSnapshot method without calling super.applyLayoutSnapshot().");const[[e,o]]=Object.entries(t);await f.createLayout(this,{layoutName:e,layout:o})}async showLayout({layoutName:t}){}async getLayoutSnapshot(){return{layouts:await(0,y.mapValuesAsync)((t=>t.getFrameSnapshot()),h(this,l,"f"))}}async removeLayout({layoutName:t}){}getLayoutIdentityForView(t){const e=[...h(this,l,"f").values()].find((e=>e.getCurrentViews().some((e=>e.name===t.name&&e.uuid===t.uuid))));return e?.identity??void 0}isLayoutVisible({layoutName:t}){return h(f,s,"m",u).call(f,this,t).isVisible()}resolveLayoutIdentity(t){if(t&&"layoutName"in t)return t;const e=[...h(this,l,"f").values()];if(1===e.length)return e[0].identity;const o=e.find((t=>t.isVisible()));return o?.identity??void 0}static async resolveLayout(t,e){const o=t.resolveLayoutIdentity(e);if(void 0===o||!("layoutName"in o))throw new Error("[layout-manager] resolveLayout: Could not resolve the layout identity. Make sure you include 'layoutName' in the identity object.");return h(f,s,"m",u).call(f,t,o.layoutName)}static async handleSharedView(t,e,o){await(0,y.mapValuesAsync)((async t=>{if(t.identity.layoutName!==e.layoutName){const e=t.getCurrentViews().find((t=>t.name===o.name));e&&await t.onViewDetached({viewIdentity:e,target:null}).catch(console.error)}}),h(t,l,"f"))}static async handleLastViewRemoved(t,e){await t.removeLayout(e),await h(t,c,"f").handleLastViewRemoved(t)}static async destroyLayout(t,{layoutName:e}){await h(f,s,"m",u).call(f,t,e).destroy(),h(t,l,"f").delete(e)}static async createLayout(t,e){const{layoutName:o}=e;if(h(t,l,"f").has(o))throw new Error(`Layout name ${o} already exists`);await h(t,c,"f").createLayout(e,t)}static registerLayout(t,e,o){h(t,l,"f").set(e,o)}static getAllLayouts(t){return[...h(t,l,"f").values()]}static setInitialSnapshot(t,e){h(t,c,"f").setInitialSnapshot(e)}static createClosedConstructor(...t){return class extends f{constructor(){super(...t)}}}}m=i.DefaultLayoutManager=f,s=f,c=new WeakMap,l=new WeakMap,u=function(t,e){const o=h(t,l,"f").get(e);if(!o)throw new Error(`[layout-manager] getLayoutByName: Could not locate layout with name '${e}'`);return o};var p={};Object.defineProperty(p,"__esModule",{value:!0});var w=p.BaseLayout=void 0;w=p.BaseLayout=class{};var v={};Object.defineProperty(v,"__esModule",{value:!0});var b=v.DOMEmitter=void 0;b=v.DOMEmitter=class{constructor(t){this.container=t}dispatchLocalEvent(t,e){const o={...e,type:t,tabSelector:`tab-${e.name}`,containerSelector:`container-${e.name}`,topic:"openfin-DOM-event"};this.container.dispatchEvent(new CustomEvent(t,{detail:o}))}};var g={};Object.defineProperty(g,"__esModule",{value:!0});var L=g.isVisible=void 0;L=g.isVisible=t=>(0!==t.offsetWidth||0!==t.offsetHeight)&&"hidden"!==window.getComputedStyle(t).visibility&&t.offsetTop>=0&&t.offsetLeft>=0&&t.offsetTop<=window.innerHeight&&t.offsetLeft<=window.innerWidth;const E={show:"top",popout:!1,maximise:!1,close:!1},_={headerHeight:31},C={hasHeaders:!0},M={reorderEnabled:!1,popoutWholeStack:!1,constrainDragToContainer:!1,constrainDragToHeaders:!1,preventDragout:!1,showMaximiseIcon:!1,showPopoutIcon:!1,showCloseIcon:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,selectionEnabled:!1};function A(t=[],e){for(const o of t)"component"===o.type?Object.keys(e).forEach((t=>o[t]=e[t])):A(o.content,e)}const P=e=>class extends e{connectedCallback(){if(!this.name||!this.uuid)throw new Error("<of-view> Name or uuid attribute missing");if(!this.src)throw new Error("<of-view> missing 'src' attribute.");this.#t||(this.#t=document.createElement("iframe"),this.#t.src=this.src,this.#t.style.height="100%",this.#t.style.width="100%",this.#t.style.border="none",this.forceFrameName?this.#t.setAttribute("name",this.forceFrameName):this.#t.setAttribute("name",t.encodeOptions({brokerUrl:this.brokerUrl,name:this.name,uuid:this.uuid,providerId:this.providerId,contextGroup:this.contextGroup},"of-frame")),this.#t.setAttribute("id",this.name),this.appendChild(this.#t))}#t;get brokerUrl(){return this.getAttribute("of-broker")}set brokerUrl(t){t&&this.setAttribute("of-broker",t)}get name(){return this.getAttribute("of-name")}set name(t){t&&this.setAttribute("of-name",t)}get forceFrameName(){return this.getAttribute("forceFrameName")}set forceFrameName(t){t&&this.setAttribute("forceFrameName",t)}get uuid(){return this.getAttribute("of-uuid")}set uuid(t){t&&this.setAttribute("of-uuid",t)}get src(){return this.getAttribute("src")}set src(t){t&&this.setAttribute("src",t)}get providerId(){return this.getAttribute("of-provider-id")}set providerId(t){t&&this.setAttribute("of-provider-id",t)}get contextGroup(){return this.getAttribute("of-context-group")}set contextGroup(t){t&&this.setAttribute("of-context-group",t)}static get observedAttributes(){return["name"]}};class N{static create(t){const e=document.createElement("of-view");return Object.entries(t).forEach((([t,o])=>{e.setAttribute(t,o)})),e}}customElements.define("of-view",P(HTMLElement));class S{constructor(t,o,i,{brokerUrl:r,interopConfig:a}){this.container=t;const{url:n,web:s,name:c=e.v4(),interop:l}=o||{};if(this.container.element.setAttribute("of-name",c),this.container.element.id=`container-${c}`,void 0===n)return void this.handleUrlMissing();const u=this.updateTitleIfNotSet(n),d={"of-broker":r,"of-uuid":i,"of-name":c,src:n};s?.frameName&&(d.forceFrameName=s.frameName);const h=l?.currentContextGroup??a?.currentContextGroup;h&&(d["of-context-group"]=h),a?.providerId&&(d["of-provider-id"]=a?.providerId);const m=N.create(d);m.title=u??`Iframe: ${n}`,this.container.element.appendChild(m)}updateTitleIfNotSet(t){return"view"===this.container.parent.title&&this.container.parent.setTitle(t),this.container.parent.title}handleUrlMissing(){const t=document.createElement("div");t.setAttribute("style","padding: 20px");t.innerText="No URL provided",this.container.element.appendChild(t)}}class F extends w{static overrideConfig(t){return A(t.content,{isClosable:!1}),{dimensions:_,...t,settings:{...C,...t.settings,...M},header:{...E,show:!1!==t.settings?.hasHeaders&&E.show}}}constructor(t,e,i,{options:r}){super(),this.identity=t,this.container=e,this.domEmitter=new b(e),this.layout=new o.GoldenLayout(this.container),this.layout.resizeWithContainerAutomatically=!0,this.layout.registerComponent("view",((e,o)=>new S(e,o,t.uuid,r))),this.setupListeners(),this.layout.loadLayout(F.overrideConfig(i))}addView(t){throw new Error("Method not implemented.")}replaceView({viewToReplace:t,newView:e}){throw new Error("Method not implemented.")}replaceLayout(t){throw new Error("Method not implemented.")}closeView(t){throw new Error("Method not implemented.")}applyPreset(t){throw new Error("Method not implemented.")}getCurrentViews(){throw new Error("Method not implemented.")}async getFrameSnapshot(){return function(t){if(t.root){t.root.content&&A(t.root.content,{componentName:"view"});const e=t.root;t.content=[e],delete t.root}return t}(o.LayoutConfig.fromResolved(this.layout.toConfig()))}isVisible(){return L(this.container)}async onViewDetached(){throw new Error("Method not implemented.")}async destroy(){this.layout.destroy()}setupListeners(){this.layout.on("tabCreated",(t=>{const o=t.componentItem.container.element.getAttribute("of-name")??e.v4(),i={name:o,uuid:o};t.element.id=`tab-${o}`,this.domEmitter.dispatchLocalEvent("tab-created",i)})),this.layout.on("itemCreated",(({target:t})=>{const o=t;if(!o.isComponent)return;const i=o.element.querySelector("[of-name]")?.getAttribute("of-name")??e.v4(),r={name:i,uuid:i};this.domEmitter.dispatchLocalEvent("container-created",r),setTimeout((()=>{document.querySelectorAll(".lm_splitter").forEach((t=>{t.style.pointerEvents="none"}))}),1)}))}}class k{constructor(t,e,o){this.windowIdentity=t,this.connectConfig=e,this.fallbackContainer=o}async createLayout(t,e){if(!("container"in t)&&!this.fallbackContainer)throw new Error("Container property is not optional in web");const{layout:o,layoutName:i}=t,r=t.container??this.fallbackContainer,a={...this.windowIdentity,layoutName:i},n=new F(a,r,o,this.connectConfig);m.registerLayout(e,i,n),this.fallbackContainer=null}async getLayoutSnapshot(t){return t.getLayoutSnapshot()}async handleLastViewRemoved(t){throw new Error("Method not implemented.")}}var V,G,I,j,x;const T=t=>t;class O{constructor(o){V.add(this),G.set(this,void 0),I.set(this,void 0),j.set(this,void 0),this.init=async({container:e,layoutManagerOverride:o})=>{const i=o??T,r=new k(t.__classPrivateFieldGet(this,j,"f"),t.__classPrivateFieldGet(this,G,"f"),e);t.__classPrivateFieldSet(this,I,new(i(m.createClosedConstructor(r))),"f"),await t.__classPrivateFieldGet(this,I,"f").applyLayoutSnapshot(t.__classPrivateFieldGet(this,G,"f").platform.layoutSnapshot)},this.getCurrentLayoutManagerSync=()=>(t.__classPrivateFieldGet(this,V,"m",x).call(this),t.__classPrivateFieldGet(this,I,"f")),this.create=async e=>(t.__classPrivateFieldGet(this,V,"m",x).call(this),m.createLayout(t.__classPrivateFieldGet(this,I,"f"),e)),this.destroy=async e=>(t.__classPrivateFieldGet(this,V,"m",x).call(this),m.destroyLayout(t.__classPrivateFieldGet(this,I,"f"),e)),t.__classPrivateFieldSet(this,G,o,"f");const i=e.v4();t.__classPrivateFieldSet(this,j,{name:i,uuid:i},"f")}}G=new WeakMap,I=new WeakMap,j=new WeakMap,V=new WeakSet,x=function(){if(!t.__classPrivateFieldGet(this,I,"f"))throw new Error("You must call init before using this API")};exports.createWebLayoutModule=t=>new O(t);
|
1
|
+
"use strict";var t=require("./main-e207373b.js"),e=require("golden-layout"),o=require("uuid");require("buffer/"),require("events"),require("lodash");var i={},r={};Object.defineProperty(r,"__esModule",{value:!0}),r.mapValuesAsync=r.mapEntriesAsync=void 0;const a=(t,[e,o])=>({...t,[e]:o});async function n(t,e){return(await Promise.all(e.map((async([e,o])=>[e,await t(o,e)])))).reduce(a,{})}r.mapEntriesAsync=n,r.mapValuesAsync=async function(t,e){let o;return o=e instanceof Map?[...e.entries()]:Object.entries(e),n(t,o)};var s,c,l,u,d=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldSet||function(t,e,o,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,o):r?r.value=o:e.set(t,o),o},h=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldGet||function(t,e,o,i){if("a"===o&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?i:"a"===o?i.call(t):i?i.value:e.get(t)};Object.defineProperty(i,"__esModule",{value:!0});var m=i.DefaultLayoutManager=void 0;const y=r;class f{constructor(t){c.set(this,void 0),l.set(this,new Map),d(this,c,t,"f")}size(){return h(this,l,"f").size}async applyLayoutSnapshot({layouts:t}){if(Object.keys(t).length>1)throw new Error("[LayoutManager] Tried to call applyLayoutSnapshot with more than 1 layout. When implementing multiple layouts via overridden LayoutManager class, you must override and fully implement the applyLayoutSnapshot method without calling super.applyLayoutSnapshot().");const[[e,o]]=Object.entries(t);await f.createLayout(this,{layoutName:e,layout:o})}async showLayout({layoutName:t}){}async getLayoutSnapshot(){return{layouts:await(0,y.mapValuesAsync)((t=>t.getFrameSnapshot()),h(this,l,"f"))}}async removeLayout({layoutName:t}){}getLayoutIdentityForView(t){const e=[...h(this,l,"f").values()].find((e=>e.getCurrentViews().some((e=>e.name===t.name&&e.uuid===t.uuid))));return e?.identity??void 0}isLayoutVisible({layoutName:t}){return h(f,s,"m",u).call(f,this,t).isVisible()}resolveLayoutIdentity(t){if(t&&"layoutName"in t)return t;const e=[...h(this,l,"f").values()];if(1===e.length)return e[0].identity;const o=e.find((t=>t.isVisible()));return o?.identity??void 0}static async resolveLayout(t,e){const o=t.resolveLayoutIdentity(e);if(void 0===o||!("layoutName"in o))throw new Error("[layout-manager] resolveLayout: Could not resolve the layout identity. Make sure you include 'layoutName' in the identity object.");return h(f,s,"m",u).call(f,t,o.layoutName)}static async handleSharedView(t,e,o){await(0,y.mapValuesAsync)((async t=>{if(t.identity.layoutName!==e.layoutName){const e=t.getCurrentViews().find((t=>t.name===o.name));e&&await t.onViewDetached({viewIdentity:e,target:null}).catch(console.error)}}),h(t,l,"f"))}static async handleLastViewRemoved(t,e){await t.removeLayout(e),await h(t,c,"f").handleLastViewRemoved(t)}static async destroyLayout(t,{layoutName:e}){await h(f,s,"m",u).call(f,t,e).destroy(),h(t,l,"f").delete(e)}static async createLayout(t,e){const{layoutName:o}=e;if(h(t,l,"f").has(o))throw new Error(`Layout name ${o} already exists`);await h(t,c,"f").createLayout(e,t)}static registerLayout(t,e,o){h(t,l,"f").set(e,o)}static getAllLayouts(t){return[...h(t,l,"f").values()]}static setInitialSnapshot(t,e){h(t,c,"f").setInitialSnapshot(e)}static createClosedConstructor(...t){return class extends f{constructor(){super(...t)}}}}m=i.DefaultLayoutManager=f,s=f,c=new WeakMap,l=new WeakMap,u=function(t,e){const o=h(t,l,"f").get(e);if(!o)throw new Error(`[layout-manager] getLayoutByName: Could not locate layout with name '${e}'`);return o};var p={};Object.defineProperty(p,"__esModule",{value:!0});var w=p.BaseLayout=void 0;w=p.BaseLayout=class{};var v={};Object.defineProperty(v,"__esModule",{value:!0});var b=v.DOMEmitter=void 0;b=v.DOMEmitter=class{constructor(t){this.container=t}dispatchLocalEvent(t,e){const o={...e,type:t,tabSelector:`tab-${e.name}`,containerSelector:`container-${e.name}`,topic:"openfin-DOM-event"};this.container.dispatchEvent(new CustomEvent(t,{detail:o}))}};var g={};Object.defineProperty(g,"__esModule",{value:!0});var L=g.isVisible=void 0;L=g.isVisible=t=>(0!==t.offsetWidth||0!==t.offsetHeight)&&"hidden"!==window.getComputedStyle(t).visibility&&t.offsetTop>=0&&t.offsetLeft>=0&&t.offsetTop<=window.innerHeight&&t.offsetLeft<=window.innerWidth;const E={show:"top",popout:!1,maximise:!1,close:!1},_={headerHeight:31},C={hasHeaders:!0},M={reorderEnabled:!1,popoutWholeStack:!1,constrainDragToContainer:!1,constrainDragToHeaders:!1,preventDragout:!1,showMaximiseIcon:!1,showPopoutIcon:!1,showCloseIcon:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,selectionEnabled:!1};function A(t=[],e){for(const o of t)"component"===o.type?Object.keys(e).forEach((t=>o[t]=e[t])):A(o.content,e)}const P=e=>class extends e{connectedCallback(){if(!this.name||!this.uuid)throw new Error("<of-view> Name or uuid attribute missing");if(!this.src)throw new Error("<of-view> missing 'src' attribute.");this.#t||(this.#t=document.createElement("iframe"),this.#t.src=this.src,this.#t.style.height="100%",this.#t.style.width="100%",this.#t.style.border="none",this.forceFrameName?this.#t.setAttribute("name",this.forceFrameName):this.#t.setAttribute("name",t.encodeOptions({brokerUrl:this.brokerUrl,name:this.name,uuid:this.uuid,providerId:this.providerId,contextGroup:this.contextGroup},"of-frame")),this.#t.setAttribute("id",this.name),this.appendChild(this.#t))}#t;get brokerUrl(){return this.getAttribute("of-broker")}set brokerUrl(t){t&&this.setAttribute("of-broker",t)}get name(){return this.getAttribute("of-name")}set name(t){t&&this.setAttribute("of-name",t)}get forceFrameName(){return this.getAttribute("forceFrameName")}set forceFrameName(t){t&&this.setAttribute("forceFrameName",t)}get uuid(){return this.getAttribute("of-uuid")}set uuid(t){t&&this.setAttribute("of-uuid",t)}get src(){return this.getAttribute("src")}set src(t){t&&this.setAttribute("src",t)}get providerId(){return this.getAttribute("of-provider-id")}set providerId(t){t&&this.setAttribute("of-provider-id",t)}get contextGroup(){return this.getAttribute("of-context-group")}set contextGroup(t){t&&this.setAttribute("of-context-group",t)}static get observedAttributes(){return["name"]}};class N{static create(t){const e=document.createElement("of-view");return Object.entries(t).forEach((([t,o])=>{e.setAttribute(t,o)})),e}}customElements.define("of-view",P(HTMLElement));class S{constructor(t,e,i,{brokerUrl:r,interopConfig:a}){this.container=t;const{url:n,web:s,interop:c}=e||{},l=`internal-generated-view-${o.v4()}`;if(this.container.element.setAttribute("of-name",l),this.container.element.id=`container-${l}`,void 0===n)return void this.handleUrlMissing();const u=this.updateTitleIfNotSet(n),d={"of-broker":r,"of-uuid":i,"of-name":l,src:n};s?.frameName&&(d.forceFrameName=s.frameName);const h=c?.currentContextGroup??a?.currentContextGroup;h&&(d["of-context-group"]=h),a?.providerId&&(d["of-provider-id"]=a?.providerId);const m=N.create(d);m.title=u??`Iframe: ${n}`,this.container.element.appendChild(m)}updateTitleIfNotSet(t){return"view"===this.container.parent.title&&this.container.parent.setTitle(t),this.container.parent.title}handleUrlMissing(){const t=document.createElement("div");t.setAttribute("style","padding: 20px");t.innerText="No URL provided",this.container.element.appendChild(t)}}class F extends w{static overrideConfig(t){return A(t.content,{isClosable:!1}),{dimensions:_,...t,settings:{...C,...t.settings,...M},header:{...E,show:!1!==t.settings?.hasHeaders&&E.show}}}constructor(t,o,i,{options:r}){super(),this.identity=t,this.container=o,this.domEmitter=new b(o),this.layout=new e.GoldenLayout(this.container),this.layout.resizeWithContainerAutomatically=!0,this.layout.registerComponent("view",((e,o)=>new S(e,o,t.uuid,r))),this.setupListeners(),this.layout.loadLayout(F.overrideConfig(i))}addView(t){throw new Error("Method not implemented.")}replaceView({viewToReplace:t,newView:e}){throw new Error("Method not implemented.")}replaceLayout(t){throw new Error("Method not implemented.")}closeView(t){throw new Error("Method not implemented.")}applyPreset(t){throw new Error("Method not implemented.")}getCurrentViews(){throw new Error("Method not implemented.")}async getFrameSnapshot(){return function(t){if(t.root){t.root.content&&A(t.root.content,{componentName:"view"});const e=t.root;t.content=[e],delete t.root}return t}(e.LayoutConfig.fromResolved(this.layout.toConfig()))}isVisible(){return L(this.container)}async onViewDetached(){throw new Error("Method not implemented.")}async destroy(){this.layout.destroy()}setupListeners(){this.layout.on("tabCreated",(t=>{const e=t.componentItem.container.element.getAttribute("of-name")??o.v4(),i={name:e,uuid:e};t.element.id=`tab-${e}`,this.domEmitter.dispatchLocalEvent("tab-created",i)})),this.layout.on("itemCreated",(({target:t})=>{const e=t;if(!e.isComponent)return;const i=e.element.querySelector("[of-name]")?.getAttribute("of-name")??o.v4(),r={name:i,uuid:i};this.domEmitter.dispatchLocalEvent("container-created",r),setTimeout((()=>{document.querySelectorAll(".lm_splitter").forEach((t=>{t.style.pointerEvents="none"}))}),1)}))}}class k{constructor(t,e,o){this.windowIdentity=t,this.connectConfig=e,this.fallbackContainer=o}async createLayout(t,e){if(!("container"in t)&&!this.fallbackContainer)throw new Error("Container property is not optional in web");const{layout:o,layoutName:i}=t,r=t.container??this.fallbackContainer,a={...this.windowIdentity,layoutName:i},n=new F(a,r,o,this.connectConfig);m.registerLayout(e,i,n),this.fallbackContainer=null}async getLayoutSnapshot(t){return t.getLayoutSnapshot()}async handleLastViewRemoved(t){throw new Error("Method not implemented.")}}var V,G,I,j,x;const T=t=>t;class O{constructor(e,o){V.add(this),G.set(this,void 0),I.set(this,void 0),j.set(this,void 0),this.init=async({container:e,layoutManagerOverride:o})=>{const i=o??T,r=new k(t.__classPrivateFieldGet(this,j,"f"),t.__classPrivateFieldGet(this,G,"f"),e);t.__classPrivateFieldSet(this,I,new(i(m.createClosedConstructor(r))),"f"),await t.__classPrivateFieldGet(this,I,"f").applyLayoutSnapshot(t.__classPrivateFieldGet(this,G,"f").platform.layoutSnapshot)},this.getCurrentLayoutManagerSync=()=>(t.__classPrivateFieldGet(this,V,"m",x).call(this),t.__classPrivateFieldGet(this,I,"f")),this.create=async e=>(t.__classPrivateFieldGet(this,V,"m",x).call(this),m.createLayout(t.__classPrivateFieldGet(this,I,"f"),e)),this.destroy=async e=>(t.__classPrivateFieldGet(this,V,"m",x).call(this),m.destroyLayout(t.__classPrivateFieldGet(this,I,"f"),e)),t.__classPrivateFieldSet(this,G,e,"f"),t.__classPrivateFieldSet(this,j,o,"f")}}G=new WeakMap,I=new WeakMap,j=new WeakMap,V=new WeakSet,x=function(){if(!t.__classPrivateFieldGet(this,I,"f"))throw new Error("You must call init before using this API")};exports.createWebLayoutModule=(t,e)=>new O(t,e);
|