webim-adapter 2.6.1 → 2.6.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/build/webim-adapter.js +34 -28
- package/build/webim-embed.js +23 -23
- package/build/webim-ssr.js +38 -31
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -12456,24 +12456,28 @@ function Hs(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
12456
12456
|
var Us = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ws = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(q(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
12457
12457
|
.webim-page[data-webim-mode="dark"] { ${Object.entries(q(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
12458
12458
|
function Gs({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: c, apiUrl: u, datasets: d, locale: f, direction: p, settings: g, siteUser: _, param: v }) {
|
|
12459
|
-
let y = a?.js?.trim();
|
|
12459
|
+
let y = a?.js?.trim(), x = g && g["site.code"] && typeof g["site.code"] == "object" ? g["site.code"] : null, S = typeof x?.js == "string" ? x.js.trim() : "", w = typeof x?.css == "string" ? x.css.trim() : "";
|
|
12460
12460
|
if (s(() => {
|
|
12461
|
+
if (!S) return;
|
|
12462
|
+
let e = document.createElement("script");
|
|
12463
|
+
return e.text = S, document.body.appendChild(e), () => e.remove();
|
|
12464
|
+
}, [S]), s(() => {
|
|
12461
12465
|
if (!y) return;
|
|
12462
12466
|
let e = document.createElement("script");
|
|
12463
12467
|
return e.text = y, document.body.appendChild(e), () => e.remove();
|
|
12464
12468
|
}, [y]), !e?.ROOT) return null;
|
|
12465
|
-
let
|
|
12469
|
+
let T = {
|
|
12466
12470
|
lang: f || void 0,
|
|
12467
12471
|
dir: Fe(p, f)
|
|
12468
|
-
},
|
|
12472
|
+
}, E = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }\n" + pe, D = {
|
|
12469
12473
|
minHeight: "100%",
|
|
12470
12474
|
display: "flex",
|
|
12471
12475
|
flexDirection: "column"
|
|
12472
|
-
},
|
|
12476
|
+
}, O = Hs("ROOT", e, n), k = l(() => ({ render: (t, r) => Hs(t, e, n, void 0, { mapProps: r }) }), [e, n]), j = fe(e, n), M = de(e, n), N = a?.css?.trim(), P = A(o), F = Ce(t), I = [F.font, F.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !be[e]), L = [.../* @__PURE__ */ new Set([...C(e, n), ...I])].map((e) => /* @__PURE__ */ m("link", {
|
|
12473
12477
|
rel: "stylesheet",
|
|
12474
12478
|
precedence: "default",
|
|
12475
12479
|
href: b(e)
|
|
12476
|
-
}, e)),
|
|
12480
|
+
}, e)), R = Ws(F);
|
|
12477
12481
|
return r === "auto" ? /* @__PURE__ */ m(Y.Provider, {
|
|
12478
12482
|
value: {
|
|
12479
12483
|
tenant: c || "",
|
|
@@ -12487,25 +12491,26 @@ function Gs({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
12487
12491
|
children: /* @__PURE__ */ m(gt.Provider, {
|
|
12488
12492
|
value: d ?? null,
|
|
12489
12493
|
children: /* @__PURE__ */ m(bt.Provider, {
|
|
12490
|
-
value:
|
|
12494
|
+
value: k,
|
|
12491
12495
|
children: /* @__PURE__ */ h("div", {
|
|
12492
|
-
...
|
|
12496
|
+
...T,
|
|
12493
12497
|
className: "webim-page",
|
|
12494
12498
|
style: {
|
|
12495
|
-
...
|
|
12499
|
+
...D,
|
|
12496
12500
|
...J(t),
|
|
12497
12501
|
...i
|
|
12498
12502
|
},
|
|
12499
12503
|
children: [
|
|
12500
|
-
/* @__PURE__ */ m("style", { children: `.webim-page { ${Us(q(
|
|
12501
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${Us(q(
|
|
12502
|
-
/* @__PURE__ */ m("style", { children:
|
|
12503
|
-
|
|
12504
|
-
/* @__PURE__ */ m("style", { children:
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
|
|
12504
|
+
/* @__PURE__ */ m("style", { children: `.webim-page { ${Us(q(F.light))} }
|
|
12505
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Us(q(F.dark))} } }` }),
|
|
12506
|
+
/* @__PURE__ */ m("style", { children: R }),
|
|
12507
|
+
L,
|
|
12508
|
+
/* @__PURE__ */ m("style", { children: E }),
|
|
12509
|
+
j && /* @__PURE__ */ m("style", { children: j }),
|
|
12510
|
+
M && /* @__PURE__ */ m("style", { children: M }),
|
|
12511
|
+
w && /* @__PURE__ */ m("style", { children: w }),
|
|
12512
|
+
N && /* @__PURE__ */ m("style", { children: N }),
|
|
12513
|
+
O
|
|
12509
12514
|
]
|
|
12510
12515
|
})
|
|
12511
12516
|
})
|
|
@@ -12524,25 +12529,26 @@ function Gs({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
12524
12529
|
children: /* @__PURE__ */ m(gt.Provider, {
|
|
12525
12530
|
value: d ?? null,
|
|
12526
12531
|
children: /* @__PURE__ */ m(bt.Provider, {
|
|
12527
|
-
value:
|
|
12532
|
+
value: k,
|
|
12528
12533
|
children: /* @__PURE__ */ h("div", {
|
|
12529
|
-
...
|
|
12534
|
+
...T,
|
|
12530
12535
|
className: "webim-page",
|
|
12531
12536
|
style: {
|
|
12532
|
-
...
|
|
12537
|
+
...D,
|
|
12533
12538
|
...Ee(t, r),
|
|
12534
12539
|
...i
|
|
12535
12540
|
},
|
|
12536
12541
|
children: [
|
|
12537
|
-
|
|
12538
|
-
/* @__PURE__ */ m("style", { children:
|
|
12539
|
-
/* @__PURE__ */ m("style", { children:
|
|
12540
|
-
D && /* @__PURE__ */ m("style", { children: D }),
|
|
12541
|
-
O && /* @__PURE__ */ m("style", { children: O }),
|
|
12542
|
-
j && /* @__PURE__ */ m("style", { children: j }),
|
|
12542
|
+
L,
|
|
12543
|
+
/* @__PURE__ */ m("style", { children: R }),
|
|
12544
|
+
/* @__PURE__ */ m("style", { children: E }),
|
|
12543
12545
|
j && /* @__PURE__ */ m("style", { children: j }),
|
|
12544
|
-
|
|
12545
|
-
|
|
12546
|
+
M && /* @__PURE__ */ m("style", { children: M }),
|
|
12547
|
+
P && /* @__PURE__ */ m("style", { children: P }),
|
|
12548
|
+
P && /* @__PURE__ */ m("style", { children: P }),
|
|
12549
|
+
w && /* @__PURE__ */ m("style", { children: w }),
|
|
12550
|
+
N && /* @__PURE__ */ m("style", { children: N }),
|
|
12551
|
+
O
|
|
12546
12552
|
]
|
|
12547
12553
|
})
|
|
12548
12554
|
})
|