@enegelai/bot-widget 1.12.1 → 1.12.3
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/enegelaibot.umd.js +9 -6
- package/dist/index.es.js +15 -11
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -339,7 +339,7 @@ const Ke = /* @__PURE__ */ aa(Ua), Wa = X`
|
|
|
339
339
|
color: var(--sl-color-neutral-600);
|
|
340
340
|
width: 420px;
|
|
341
341
|
overflow: hidden;
|
|
342
|
-
display:
|
|
342
|
+
display: none;
|
|
343
343
|
flex-direction: column;
|
|
344
344
|
justify-content: space-between;
|
|
345
345
|
align-items: center;
|
|
@@ -352,7 +352,6 @@ const Ke = /* @__PURE__ */ aa(Ua), Wa = X`
|
|
|
352
352
|
right: 25px;
|
|
353
353
|
bottom: 100px;
|
|
354
354
|
background: rgb(255, 255, 255);
|
|
355
|
-
overflow: hidden;
|
|
356
355
|
|
|
357
356
|
box-shadow: rgba(148, 149, 150, 0.2) 20px 20px 40px 20px;
|
|
358
357
|
|
|
@@ -371,6 +370,10 @@ const Ke = /* @__PURE__ */ aa(Ua), Wa = X`
|
|
|
371
370
|
//animation: fadeIn 0.1s ease-in-out;
|
|
372
371
|
}
|
|
373
372
|
|
|
373
|
+
.cb-wrapper.cb-open {
|
|
374
|
+
display: flex;
|
|
375
|
+
}
|
|
376
|
+
|
|
374
377
|
.cb-alert-box {
|
|
375
378
|
width: 100%;
|
|
376
379
|
box-sizing: border-box;
|
|
@@ -869,7 +872,8 @@ class L extends kt {
|
|
|
869
872
|
}
|
|
870
873
|
initConversation() {
|
|
871
874
|
const e = Date.now(), a = this.setting.newConversationTimeoutInSec * 1e3;
|
|
872
|
-
|
|
875
|
+
let n = this.lastConversationUpdate;
|
|
876
|
+
if (typeof n == "string" && (n = isNaN(n) ? 0 : parseInt(n, 10)), n > 0 && e - n > a) {
|
|
873
877
|
this.clearConversation();
|
|
874
878
|
return;
|
|
875
879
|
}
|
|
@@ -893,12 +897,12 @@ class L extends kt {
|
|
|
893
897
|
}
|
|
894
898
|
// Set data in the context of the conversation
|
|
895
899
|
async setContext(e) {
|
|
896
|
-
if (!
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
900
|
+
if (!e || typeof e != "object")
|
|
901
|
+
return;
|
|
902
|
+
const a = this.context ? this.context : {};
|
|
903
|
+
for (const [n, s] of Object.entries(e))
|
|
904
|
+
a[n] = s;
|
|
905
|
+
this.context = a, this.wsClient && await this.sendContext();
|
|
902
906
|
}
|
|
903
907
|
async sendContext() {
|
|
904
908
|
if (!this.context)
|
|
@@ -1474,7 +1478,7 @@ O([
|
|
|
1474
1478
|
], L.prototype, "setting");
|
|
1475
1479
|
O([
|
|
1476
1480
|
oe({ prefix: ee }),
|
|
1477
|
-
q({ type: Object, value:
|
|
1481
|
+
q({ type: Object, value: {} })
|
|
1478
1482
|
], L.prototype, "context");
|
|
1479
1483
|
O([
|
|
1480
1484
|
q({ type: String, value: "top-end" })
|
|
@@ -6567,7 +6571,7 @@ let j = class extends te {
|
|
|
6567
6571
|
}
|
|
6568
6572
|
render() {
|
|
6569
6573
|
return p.disabled && !this.alwaysOpen ? (Me.info("Bot is disabled until settings are loaded"), null) : g`
|
|
6570
|
-
<div class="cb-wrapper
|
|
6574
|
+
<div class="cb-wrapper${p.open ? " cb-open" : ""}" part="wrapper${p.open ? " open" : ""}" exportparts="wrapper${p.open ? " open" : ""}">
|
|
6571
6575
|
<cb-header title="${this.name}" exportparts="header, header-logo, header-title, header-close"></cb-header>
|
|
6572
6576
|
<cb-message-list
|
|
6573
6577
|
.messages=${p.messages}
|