@eka-care/medassist-widget-embed 0.1.6 → 0.1.7-dev.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,gBAAgB,QAAO,iBAAiB,GAAG,IAahD,CAAC;AAEF,KAAK,iBAAiB,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;AAElE,QAAA,MAAM,cAAc,GAClB,OAAO,MAAM,GAAG,IAAI,KACnB,iBAAiB,GAAG,SAStB,CAAC;AAEF,QAAA,MAAM,yBAAyB,8DAC8B,CAAC;AAE9D,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,UAAU,kBAAmB,SAAQ,MAAM;IACzC,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;QAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;KACtB,CAAC;IACF,sBAAsB,CAAC,EAAE,mBAAmB,CAAC;CAC9C;AAED,QAAA,MAAM,qBAAqB,EAAE,mBAAwB,CAAC;AAEtD,QAAA,MAAM,gBAAgB,QAAO,WAAW,GAAG,IAK1C,CAAC;AA8BF,QAAA,MAAM,QAAQ,0BAAqB,CAAC;AACpC,QAAA,MAAM,aAAa,QASf,CAAC;AAEL,QAAA,MAAM,kBAAkB,QAmBpB,CAAC;AAEL,Q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,CAAC;IA0F9B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BpC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CA0ClC"}
package/dist/index.js CHANGED
@@ -107,12 +107,14 @@ class MedAssistWidgetLoader extends HTMLElement {
107
107
  this.initializeFullMode();
108
108
  }
109
109
  else {
110
+ console.log("calling rendering button");
110
111
  this.renderButton();
111
112
  }
112
113
  }
113
114
  attributeChangedCallback(name) {
114
115
  if (name === "icon-url") {
115
116
  if (this.displayMode === "widget") {
117
+ console.log("calling rendering button", this.displayMode);
116
118
  this.renderButton();
117
119
  }
118
120
  }
@@ -124,6 +126,7 @@ class MedAssistWidgetLoader extends HTMLElement {
124
126
  this.initializeFullMode();
125
127
  }
126
128
  else {
129
+ console.log("calling rendering button");
127
130
  this.renderButton();
128
131
  }
129
132
  }
@@ -134,6 +137,7 @@ class MedAssistWidgetLoader extends HTMLElement {
134
137
  this.initializeFullMode();
135
138
  }
136
139
  else {
140
+ console.log("calling rendering button");
137
141
  this.renderButton();
138
142
  }
139
143
  this.loadWidgetCss()
@@ -145,6 +149,7 @@ class MedAssistWidgetLoader extends HTMLElement {
145
149
  }
146
150
  renderButton() {
147
151
  var _a;
152
+ console.log("called renderButton");
148
153
  const iconUrl = this.getAttribute("icon-url") || this.defaultIconUrl;
149
154
  const shadowRoot = this.shadowRoot;
150
155
  if (!shadowRoot) {
@@ -253,8 +258,8 @@ class MedAssistWidgetLoader extends HTMLElement {
253
258
  const mergedContext = {
254
259
  ...(attributeContext || {}),
255
260
  ...(initConfig.context || {}),
256
- ...(initConfig.auth ? { auth: initConfig.auth } : {}),
257
261
  };
262
+ const auth = initConfig.auth || undefined;
258
263
  const resolvedAgentId = initConfig.agentId || agentId;
259
264
  const customOnClose = typeof window !== "undefined" ? (_b = window.EkaMedAssist) === null || _b === void 0 ? void 0 : _b.onClose : undefined;
260
265
  if (!resolvedAgentId) {
@@ -274,17 +279,18 @@ class MedAssistWidgetLoader extends HTMLElement {
274
279
  iconUrl: initConfig.iconUrl || iconUrl,
275
280
  environment,
276
281
  onClose: () => {
282
+ if (customOnClose && typeof customOnClose === "function") {
283
+ customOnClose();
284
+ }
277
285
  if (button) {
278
286
  button.classList.remove("hidden");
279
287
  }
280
288
  rootElement.classList.add("hidden");
281
- if (customOnClose && typeof customOnClose === "function") {
282
- customOnClose();
283
- }
284
289
  },
285
290
  baseUrl: initConfig.baseUrl || baseUrl,
286
291
  context: mergedContext,
287
- displayMode
292
+ displayMode,
293
+ auth
288
294
  };
289
295
  if (this.widgetLoaded) {
290
296
  (_c = window.renderMedAssist) === null || _c === void 0 ? void 0 : _c.call(window, rootElement, resolvedAgentId, widgetConfig);