@telia-ace/widget-core-flamingo 1.1.36 → 1.1.37-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/components/trigger.component.d.ts +1 -1
- package/index.js +4 -4
- package/index.mjs +5 -5
- package/models/application.d.ts +1 -0
- package/package.json +1 -1
@@ -9,7 +9,7 @@ export declare class Trigger extends LitElement {
|
|
9
9
|
icon: any;
|
10
10
|
containerRef: Ref<HTMLDivElement>;
|
11
11
|
connectedCallback(): Promise<void>;
|
12
|
-
|
12
|
+
toggleActive(): void;
|
13
13
|
_applyBranding(): void;
|
14
14
|
_renderSymbol(): Promise<typeof nothing | import("lit-html").TemplateResult<1>>;
|
15
15
|
render(): import("lit-html").TemplateResult<1>;
|
package/index.js
CHANGED
@@ -62,7 +62,7 @@
|
|
62
62
|
* @license
|
63
63
|
* Copyright 2020 Google LLC
|
64
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
65
|
-
*/const de=()=>new fi;class fi{}const ut=new WeakMap,ue=St(class extends he{render(r){return d}update(r,[t]){var i;const e=t!==this.G;return e&&this.G!==void 0&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=t,this.ct=(i=r.options)==null?void 0:i.host,this.ot(this.lt=r.element)),d}ot(r){if(typeof this.G=="function"){const t=this.ct??globalThis;let e=ut.get(t);e===void 0&&(e=new WeakMap,ut.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ct,void 0),e.set(this.G,r),r!==void 0&&this.G.call(this.ct,r)}else this.G.value=r}get rt(){var r,t;return typeof this.G=="function"?(r=ut.get(this.ct??globalThis))==null?void 0:r.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var gi=Object.defineProperty,mi=Object.getOwnPropertyDescriptor,rt=(r,t,e,i)=>{for(var s=i>1?void 0:i?mi(t,e):t,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&gi(t,e,s),s};class _ extends ${constructor(){super(...arguments),this.active=!1,this.loaded=!1,this.containerRef=de()}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}
|
65
|
+
*/const de=()=>new fi;class fi{}const ut=new WeakMap,ue=St(class extends he{render(r){return d}update(r,[t]){var i;const e=t!==this.G;return e&&this.G!==void 0&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=t,this.ct=(i=r.options)==null?void 0:i.host,this.ot(this.lt=r.element)),d}ot(r){if(typeof this.G=="function"){const t=this.ct??globalThis;let e=ut.get(t);e===void 0&&(e=new WeakMap,ut.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ct,void 0),e.set(this.G,r),r!==void 0&&this.G.call(this.ct,r)}else this.G.value=r}get rt(){var r,t;return typeof this.G=="function"?(r=ut.get(this.ct??globalThis))==null?void 0:r.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var gi=Object.defineProperty,mi=Object.getOwnPropertyDescriptor,rt=(r,t,e,i)=>{for(var s=i>1?void 0:i?mi(t,e):t,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&gi(t,e,s),s};class _ extends ${constructor(){super(...arguments),this.active=!1,this.loaded=!1,this.containerRef=de()}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}toggleActive(){var t;if(!((t=this.application)!=null&&t.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?this.application.appendToDOM():this.application.hide()}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&pe(this.application.settings.branding,this)}async _renderSymbol(){var a,c,l;const t=(a=this.application)==null?void 0:a.branding(),e=(c=t==null?void 0:t.graphics)==null?void 0:c.trigger;if(e)return T` <img src=${e} class="trigger-icon" alt="" /> `;const i=(l=this.application)==null?void 0:l.triggerIcon;if(!i)return d;const s=async h=>await Promise.resolve().then(()=>require("./index-6dd00f59.js")).then(u=>u[h]),{type:n,content:o}=i;switch(n){case"Telia":{const h=await s(o);return h?T`<telia-icon
|
66
66
|
class="trigger-icon"
|
67
67
|
svg=${h.svg}
|
68
68
|
size="lg"
|
@@ -70,7 +70,7 @@
|
|
70
70
|
${!this.active&&((s=(i=(e=(t=this.application)==null?void 0:t.settings)==null?void 0:e.branding)==null?void 0:i.other)!=null&&s.showButtonLabel)?T`
|
71
71
|
<button
|
72
72
|
class="trigger-label"
|
73
|
-
@click=${this.
|
73
|
+
@click=${this.toggleActive}
|
74
74
|
${di({keyframeOptions:{},in:ci,stabilizeOut:!0,skipInitial:!1})}
|
75
75
|
>
|
76
76
|
${this.application.settings.branding.other.buttonLabelText}
|
@@ -79,7 +79,7 @@
|
|
79
79
|
|
80
80
|
<button
|
81
81
|
class=${ui({trigger:!0,active:this.active,rendered:this.loaded})}
|
82
|
-
@click=${this.
|
82
|
+
@click=${this.toggleActive}
|
83
83
|
>
|
84
84
|
${this.icon}
|
85
85
|
<span class="trigger-close">
|
@@ -333,7 +333,7 @@
|
|
333
333
|
opacity: 0;
|
334
334
|
animation: slideDown 0.3s linear;
|
335
335
|
}
|
336
|
-
`;wi([m({attribute:!1})],st.prototype,"application",2);class Ai{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...l]=a;return{definitionId:c,overrides:l}}return{definitionId:a,overrides:[]}},s=(a,c,l,h)=>{l.forEach(p=>{const u=i(p),f=h[u.definitionId];if(!f){console.error(`No definition found for component type '${u.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=u.definitionId,g.application=e,f.properties&&g.writeProperties(f.properties),f.context&&g.writeContext(f.context),f.layout&&g.writeLayout(f.layout),c.addChild(g),f.children&&s(a,g,f.children,h))})},{entry:n,components:o}=t;return s(this,this.root,[n],o),this.root}createRoot(){return new st}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new xt;const s=new i;return s.type=e,s.name=t,s}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const ge=class{constructor(){this.components=new Map}getComponent(r){const t=this.components.get(r);return t||console.warn(`Unable to resolve component: ${r}. You most likely forgot to register the required plugin.`),t}registerComponent(r,t){this.components.set(r,t)}async loadComponents(){const r=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(r)}defineAsWebComponent(r,t){const e=ge.ResolveWebComponentName(r);customElements.get(e)||customElements.define(e,t)}};let me=ge;me.ResolveWebComponentName=r=>`ace-${r}`;class Si{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class ve{constructor(t,e,i,s){this.name=t,this.container=e,this.settings=i,this.options=s,this.platform=new Ai,this.texts=new Si,this.renderStrategy=y.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new me,this.components=[],this.renderStrategy=this.options.renderStrategy||y.Inline,this.triggerIcon=this.options.triggerIcon,typeof s.autoActivate=="boolean"&&(this.autoActivate=s.autoActivate),s.anchor&&(this.anchor=s.anchor),this.container.register("$settings",i),this.texts.loadTexts(i.texts||{})}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ee.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root))}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded"))}mute(){this.settings.branding.other.disableSound=!0}unmute(){this.settings.branding.other.disableSound=!1}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===y.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new it,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}render(){if(this.renderStrategy===y.Trigger){const t=new _;return t.application=this,t}return this.root}}const ye=class{async getSite(r){const e=await(await fetch(r)).json();return e?{id:e.id,apps:e.widgets.map(i=>{let s=y.Inline;return i.renderStrategy==="Trigger"&&(s=y.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:s,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(r){const e=await(await fetch(`${ye.endpoint}/widget/${r}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let Q=ye;Q.endpoint="https://widgets.ace.teliacompany.net/api";class be{constructor(){this.applications=[],this.container=new bt("environment",this),setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate()}async activate(){const t=this.applications.filter(e=>e.autoActivate);for await(const e of t)await e.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(s=>s.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}registerApp(t,e,i){const s=new bt(t,this),n=new ve(t,s,e,i);this.applications.push(n)}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class $e{constructor(t){this.configurations=[],this.httpClient=new Q,this.httpClient=new Q,typeof t=="string"?this.url=t:(t.httpClient&&(this.httpClient=t.httpClient),this.loadFromConfig(t))}async load(t){const e=await this.httpClient.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,anchor:e.anchor,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new be,this.addGlobal(this.environment);for await(const i of this.configurations){const s=await this.httpClient.getWidget(i.widgetId);s&&((e=this.environment)==null||e.registerApp(s.name,s.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),await this.environment.bootstrap()}addGlobal(t){globalThis.widgets=t}}var xi=Object.defineProperty,Ci=Object.getOwnPropertyDescriptor,Ct=(r,t,e,i)=>{for(var s=i>1?void 0:i?Ci(t,e):t,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&xi(t,e,s),s};class k extends ${constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return d;if(this.widget.renderStrategy===y.Trigger){const t=new _;return t.application=this.widget,t}return this.widget.render()}}k.styles=[U`
|
336
|
+
`;wi([m({attribute:!1})],st.prototype,"application",2);class Ai{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...l]=a;return{definitionId:c,overrides:l}}return{definitionId:a,overrides:[]}},s=(a,c,l,h)=>{l.forEach(p=>{const u=i(p),f=h[u.definitionId];if(!f){console.error(`No definition found for component type '${u.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=u.definitionId,g.application=e,f.properties&&g.writeProperties(f.properties),f.context&&g.writeContext(f.context),f.layout&&g.writeLayout(f.layout),c.addChild(g),f.children&&s(a,g,f.children,h))})},{entry:n,components:o}=t;return s(this,this.root,[n],o),this.root}createRoot(){return new st}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new xt;const s=new i;return s.type=e,s.name=t,s}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const ge=class{constructor(){this.components=new Map}getComponent(r){const t=this.components.get(r);return t||console.warn(`Unable to resolve component: ${r}. You most likely forgot to register the required plugin.`),t}registerComponent(r,t){this.components.set(r,t)}async loadComponents(){const r=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(r)}defineAsWebComponent(r,t){const e=ge.ResolveWebComponentName(r);customElements.get(e)||customElements.define(e,t)}};let me=ge;me.ResolveWebComponentName=r=>`ace-${r}`;class Si{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class ve{constructor(t,e,i,s){this.name=t,this.container=e,this.settings=i,this.options=s,this.platform=new Ai,this.texts=new Si,this.renderStrategy=y.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new me,this.components=[],this.trigger=null,this.renderStrategy=this.options.renderStrategy||y.Inline,this.triggerIcon=this.options.triggerIcon,typeof s.autoActivate=="boolean"&&(this.autoActivate=s.autoActivate),s.anchor&&(this.anchor=s.anchor),this.container.register("$settings",i),this.texts.loadTexts(i.texts||{})}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ee.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root))}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded"))}mute(){this.settings.branding.other.disableSound=!0}unmute(){this.settings.branding.other.disableSound=!1}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===y.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new it,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}render(){if(this.renderStrategy===y.Trigger){const t=new _;return t.application=this,this.trigger=t,t}return this.root}}const ye=class{async getSite(r){const e=await(await fetch(r)).json();return e?{id:e.id,apps:e.widgets.map(i=>{let s=y.Inline;return i.renderStrategy==="Trigger"&&(s=y.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:s,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(r){const e=await(await fetch(`${ye.endpoint}/widget/${r}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let Q=ye;Q.endpoint="https://widgets.ace.teliacompany.net/api";class be{constructor(){this.applications=[],this.container=new bt("environment",this),setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate()}async activate(){const t=this.applications.filter(e=>e.autoActivate);for await(const e of t)await e.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(s=>s.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}registerApp(t,e,i){const s=new bt(t,this),n=new ve(t,s,e,i);this.applications.push(n)}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class $e{constructor(t){this.configurations=[],this.httpClient=new Q,this.httpClient=new Q,typeof t=="string"?this.url=t:(t.httpClient&&(this.httpClient=t.httpClient),this.loadFromConfig(t))}async load(t){const e=await this.httpClient.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,anchor:e.anchor,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new be,this.addGlobal(this.environment);for await(const i of this.configurations){const s=await this.httpClient.getWidget(i.widgetId);s&&((e=this.environment)==null||e.registerApp(s.name,s.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),await this.environment.bootstrap()}addGlobal(t){globalThis.widgets=t}}var xi=Object.defineProperty,Ci=Object.getOwnPropertyDescriptor,Ct=(r,t,e,i)=>{for(var s=i>1?void 0:i?Ci(t,e):t,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&xi(t,e,s),s};class k extends ${constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return d;if(this.widget.renderStrategy===y.Trigger){const t=new _;return t.application=this.widget,t}return this.widget.render()}}k.styles=[U`
|
337
337
|
:host {
|
338
338
|
display: block;
|
339
339
|
}
|
package/index.mjs
CHANGED
@@ -1597,7 +1597,7 @@ class A extends $ {
|
|
1597
1597
|
async connectedCallback() {
|
1598
1598
|
super.connectedCallback(), this.icon = await this._renderSymbol(), this.loaded = !0, this._applyBranding();
|
1599
1599
|
}
|
1600
|
-
|
1600
|
+
toggleActive() {
|
1601
1601
|
var t;
|
1602
1602
|
if (!((t = this.application) != null && t.root)) {
|
1603
1603
|
console.warn(
|
@@ -1641,7 +1641,7 @@ class A extends $ {
|
|
1641
1641
|
${!this.active && ((s = (i = (e = (t = this.application) == null ? void 0 : t.settings) == null ? void 0 : e.branding) == null ? void 0 : i.other) != null && s.showButtonLabel) ? T`
|
1642
1642
|
<button
|
1643
1643
|
class="trigger-label"
|
1644
|
-
@click=${this.
|
1644
|
+
@click=${this.toggleActive}
|
1645
1645
|
${ci({
|
1646
1646
|
keyframeOptions: {},
|
1647
1647
|
in: si,
|
@@ -1659,7 +1659,7 @@ class A extends $ {
|
|
1659
1659
|
active: this.active,
|
1660
1660
|
rendered: this.loaded
|
1661
1661
|
})}
|
1662
|
-
@click=${this.
|
1662
|
+
@click=${this.toggleActive}
|
1663
1663
|
>
|
1664
1664
|
${this.icon}
|
1665
1665
|
<span class="trigger-close">
|
@@ -2131,7 +2131,7 @@ class _i {
|
|
2131
2131
|
}
|
2132
2132
|
class wi {
|
2133
2133
|
constructor(t, e, i, s) {
|
2134
|
-
this.name = t, this.container = e, this.settings = i, this.options = s, this.platform = new $i(), this.texts = new _i(), this.renderStrategy = y.Inline, this.anchor = "BottomRight", this.autoActivate = !1, this.plugins = [], this.componentResolver = new ge(), this.components = [], this.renderStrategy = this.options.renderStrategy || y.Inline, this.triggerIcon = this.options.triggerIcon, typeof s.autoActivate == "boolean" && (this.autoActivate = s.autoActivate), s.anchor && (this.anchor = s.anchor), this.container.register("$settings", i), this.texts.loadTexts(i.texts || {});
|
2134
|
+
this.name = t, this.container = e, this.settings = i, this.options = s, this.platform = new $i(), this.texts = new _i(), this.renderStrategy = y.Inline, this.anchor = "BottomRight", this.autoActivate = !1, this.plugins = [], this.componentResolver = new ge(), this.components = [], this.trigger = null, this.renderStrategy = this.options.renderStrategy || y.Inline, this.triggerIcon = this.options.triggerIcon, typeof s.autoActivate == "boolean" && (this.autoActivate = s.autoActivate), s.anchor && (this.anchor = s.anchor), this.container.register("$settings", i), this.texts.loadTexts(i.texts || {});
|
2135
2135
|
}
|
2136
2136
|
async activate() {
|
2137
2137
|
if (await this.loadPlugins(), await this.componentResolver.loadComponents(), this.root = this.platform.createComponentModel(this.settings, this), this.container.setState(ee.Ready), this.autoActivate) {
|
@@ -2190,7 +2190,7 @@ class wi {
|
|
2190
2190
|
render() {
|
2191
2191
|
if (this.renderStrategy === y.Trigger) {
|
2192
2192
|
const t = new A();
|
2193
|
-
return t.application = this, t;
|
2193
|
+
return t.application = this, this.trigger = t, t;
|
2194
2194
|
}
|
2195
2195
|
return this.root;
|
2196
2196
|
}
|
package/models/application.d.ts
CHANGED
@@ -20,6 +20,7 @@ export declare class Application {
|
|
20
20
|
private plugins;
|
21
21
|
private componentResolver;
|
22
22
|
private components;
|
23
|
+
trigger: Trigger | null;
|
23
24
|
constructor(name: string, container: Container, settings: WidgetConfig, options: ApplicationOptions);
|
24
25
|
activate(): Promise<void>;
|
25
26
|
private loadPlugins;
|