webim-adapter 2.7.5 → 2.7.6
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 +65 -56
- package/build/webim-embed.js +26 -26
- package/build/webim-ssr.js +1658 -1649
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -3320,16 +3320,17 @@ var Lr = (e, t) => {
|
|
|
3320
3320
|
color: "inherit",
|
|
3321
3321
|
textDecoration: "none"
|
|
3322
3322
|
});
|
|
3323
|
-
function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField: r = "", orderField: i = "", langField: a = "", root: u = "group", groupField: f = "", groupValue: p = "", rootEntry: _ = "", depth: v = 0, expand: y = "current", toggleOnClick: b = !0, indent: x = 16, lines: S = "none", lineColor: C = "", iconField: w = "", branchIcon: T = "", leafIcon: E = "", toggleIcon: D = "caret", toggleSize: O = 16, dividers: k = "none", dividerColor: A = "", dividerWidth: j = 1,
|
|
3324
|
-
let { tenant:
|
|
3323
|
+
function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField: r = "", orderField: i = "", langField: a = "", root: u = "group", groupField: f = "", groupValue: p = "", rootEntry: _ = "", depth: v = 0, expand: y = "current", toggleOnClick: b = !0, indent: x = 16, lines: S = "none", lineColor: C = "", iconField: w = "", branchIcon: T = "", leafIcon: E = "", toggleIcon: D = "caret", toggleSize: O = 16, dividers: k = "none", dividerColor: A = "", dividerWidth: j = 1, linkColor: M = "", hoverBg: N = "", hoverColor: P = "", currentBg: F = "", currentColor: I = "", placeholder: L = "", style: R, nodeRef: z }) {
|
|
3324
|
+
let { tenant: B, apiUrl: V, locale: H } = o(X), U = o(Jt)?.[e], W = Number(x) || 0, K = (S === "solid" || S === "dotted") && W >= 8, ee = K ? `1px ${S} ${C || "currentColor"}` : "", q = C ? 1 : .5, J = (e) => 16 + (e - 2) * W + 6, te = `wb-mt-${c().replace(/[^a-zA-Z0-9_-]/g, "")}`, ne = [
|
|
3325
3325
|
"solid",
|
|
3326
3326
|
"dashed",
|
|
3327
3327
|
"dotted"
|
|
3328
|
-
].includes(k) ? `${Math.min(Math.max(Number(j) || 1, 1), 8)}px ${k} ${A || "rgba(148, 163, 184, 0.35)"}` : "",
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
(
|
|
3332
|
-
|
|
3328
|
+
].includes(k) ? `${Math.min(Math.max(Number(j) || 1, 1), 8)}px ${k} ${A || "rgba(148, 163, 184, 0.35)"}` : "", re = [
|
|
3329
|
+
ne && `.${te} [data-wb-part~="link"]{border-top:${ne};}.${te} > [data-wb-part~="item"]:first-of-type > [data-wb-part~="link"]{border-top:0;}`,
|
|
3330
|
+
M && `.${te} a{color:${M} !important;}`,
|
|
3331
|
+
(N || P) && `.${te} a:hover{${N ? `background-color:${N} !important;` : ""}${P ? `color:${P} !important;` : ""}}`,
|
|
3332
|
+
(F || I) && `.${te} a[aria-current="page"]{${F ? `background-color:${F} !important;` : ""}${I ? `color:${I} !important;` : ""}}`
|
|
3333
|
+
].filter(Boolean).join(""), ie = (e) => {
|
|
3333
3334
|
let t = e.icon || (e.children.length > 0 ? T : E);
|
|
3334
3335
|
return t ? /^(https?:)?\/\/|^\//.test(t) ? /* @__PURE__ */ h("img", {
|
|
3335
3336
|
...Z("icon"),
|
|
@@ -3358,32 +3359,32 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3358
3359
|
},
|
|
3359
3360
|
children: /* @__PURE__ */ h("path", { d: Ar[t] })
|
|
3360
3361
|
}) : null : null;
|
|
3361
|
-
},
|
|
3362
|
+
}, ae = Math.min(Math.max(Number(O) || 16, 8), 40), oe = (e) => D === "plus" ? /* @__PURE__ */ h("path", { d: e ? Ar.minus : Ar.plus }) : D === "chevron" ? /* @__PURE__ */ h("path", { d: Ar["chevron-right"] }) : null, [se, ce] = d(null), [le, ue] = d(""), [de, fe] = d({});
|
|
3362
3363
|
s(() => {
|
|
3363
|
-
|
|
3364
|
+
ue(window.location.pathname);
|
|
3364
3365
|
}, []), s(() => {
|
|
3365
|
-
if (!e ||
|
|
3366
|
+
if (!e || U) return;
|
|
3366
3367
|
let t = !0, n = new URLSearchParams({ all: "1" });
|
|
3367
|
-
return
|
|
3368
|
+
return H && n.set("locale", H), fetch(`${V}/dynamic/${encodeURIComponent(e)}?${n}`, { headers: B ? { "x-tenant": B } : {} }).then((e) => e.json()).then((e) => {
|
|
3368
3369
|
let n = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
|
|
3369
|
-
t &&
|
|
3370
|
-
}).catch(() => t &&
|
|
3370
|
+
t && ce(n);
|
|
3371
|
+
}).catch(() => t && ce([])), () => {
|
|
3371
3372
|
t = !1;
|
|
3372
3373
|
};
|
|
3373
3374
|
}, [
|
|
3374
3375
|
e,
|
|
3375
|
-
z,
|
|
3376
3376
|
B,
|
|
3377
3377
|
V,
|
|
3378
|
-
H
|
|
3378
|
+
H,
|
|
3379
|
+
U
|
|
3379
3380
|
]);
|
|
3380
|
-
let
|
|
3381
|
+
let pe = l(() => Ir(U ?? se ?? [], {
|
|
3381
3382
|
labelField: t,
|
|
3382
3383
|
hrefField: n,
|
|
3383
3384
|
parentField: r,
|
|
3384
3385
|
orderField: i,
|
|
3385
3386
|
langField: a,
|
|
3386
|
-
language:
|
|
3387
|
+
language: H,
|
|
3387
3388
|
root: u,
|
|
3388
3389
|
groupField: f,
|
|
3389
3390
|
groupValue: p,
|
|
@@ -3391,38 +3392,38 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3391
3392
|
depth: v,
|
|
3392
3393
|
iconField: w
|
|
3393
3394
|
}), [
|
|
3394
|
-
|
|
3395
|
-
|
|
3395
|
+
U,
|
|
3396
|
+
se,
|
|
3396
3397
|
t,
|
|
3397
3398
|
n,
|
|
3398
3399
|
r,
|
|
3399
3400
|
i,
|
|
3400
3401
|
a,
|
|
3401
|
-
|
|
3402
|
+
H,
|
|
3402
3403
|
u,
|
|
3403
3404
|
f,
|
|
3404
3405
|
p,
|
|
3405
3406
|
_,
|
|
3406
3407
|
v,
|
|
3407
3408
|
w
|
|
3408
|
-
]),
|
|
3409
|
-
let e = /* @__PURE__ */ new Set(), t = (n, r) => n.some((n) => Lr(n.href,
|
|
3410
|
-
return t(
|
|
3411
|
-
}, [
|
|
3409
|
+
]), me = l(() => {
|
|
3410
|
+
let e = /* @__PURE__ */ new Set(), t = (n, r) => n.some((n) => Lr(n.href, le) ? ([...r, n.key].forEach((t) => e.add(t)), !0) : t(n.children, [...r, n.key]));
|
|
3411
|
+
return t(pe, []), e;
|
|
3412
|
+
}, [pe, le]), he = (e) => e.key in de ? de[e.key] : y === "all" || y === "current" && me.has(e.key), ge = (e) => fe((t) => ({
|
|
3412
3413
|
...t,
|
|
3413
|
-
[e.key]: !
|
|
3414
|
-
})),
|
|
3414
|
+
[e.key]: !he(e)
|
|
3415
|
+
})), _e = (e, t) => ({
|
|
3415
3416
|
position: "absolute",
|
|
3416
|
-
left:
|
|
3417
|
+
left: J(e),
|
|
3417
3418
|
pointerEvents: "none",
|
|
3418
|
-
opacity:
|
|
3419
|
-
borderLeft:
|
|
3419
|
+
opacity: q,
|
|
3420
|
+
borderLeft: ee,
|
|
3420
3421
|
...t
|
|
3421
|
-
}),
|
|
3422
|
+
}), ve = (e, t, n) => !K || e < 2 ? null : /* @__PURE__ */ g(m, { children: [
|
|
3422
3423
|
t.map((e, t) => e ? /* @__PURE__ */ h("span", {
|
|
3423
3424
|
...Z("line"),
|
|
3424
3425
|
"aria-hidden": !0,
|
|
3425
|
-
style:
|
|
3426
|
+
style: _e(t + 2, {
|
|
3426
3427
|
top: 0,
|
|
3427
3428
|
bottom: 0
|
|
3428
3429
|
})
|
|
@@ -3430,7 +3431,7 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3430
3431
|
/* @__PURE__ */ h("span", {
|
|
3431
3432
|
...Z("line"),
|
|
3432
3433
|
"aria-hidden": !0,
|
|
3433
|
-
style:
|
|
3434
|
+
style: _e(e, n ? {
|
|
3434
3435
|
top: 0,
|
|
3435
3436
|
height: "50%"
|
|
3436
3437
|
} : {
|
|
@@ -3443,16 +3444,16 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3443
3444
|
"aria-hidden": !0,
|
|
3444
3445
|
style: {
|
|
3445
3446
|
position: "absolute",
|
|
3446
|
-
left:
|
|
3447
|
+
left: J(e),
|
|
3447
3448
|
top: "50%",
|
|
3448
|
-
width: Math.max(4,
|
|
3449
|
+
width: Math.max(4, W - 8),
|
|
3449
3450
|
pointerEvents: "none",
|
|
3450
|
-
opacity:
|
|
3451
|
-
borderTop:
|
|
3451
|
+
opacity: q,
|
|
3452
|
+
borderTop: ee
|
|
3452
3453
|
}
|
|
3453
3454
|
})
|
|
3454
|
-
] }),
|
|
3455
|
-
let a = r.children.length > 0, o = a &&
|
|
3455
|
+
] }), ye = (e, t, n = []) => e.map((r, i) => {
|
|
3456
|
+
let a = r.children.length > 0, o = a && he(r), s = Lr(r.href, le), c = K && t > 1, l = i === e.length - 1;
|
|
3456
3457
|
return /* @__PURE__ */ g("div", {
|
|
3457
3458
|
...Z("item", o && "item-open"),
|
|
3458
3459
|
children: [/* @__PURE__ */ g("a", {
|
|
@@ -3461,16 +3462,16 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3461
3462
|
"aria-current": s ? "page" : void 0,
|
|
3462
3463
|
"aria-expanded": a ? o : void 0,
|
|
3463
3464
|
onClick: a && (b || !r.href) ? (e) => {
|
|
3464
|
-
e.preventDefault(),
|
|
3465
|
+
e.preventDefault(), ge(r);
|
|
3465
3466
|
} : void 0,
|
|
3466
3467
|
style: {
|
|
3467
3468
|
...Rr,
|
|
3468
|
-
paddingLeft: 16 + (t - 1) *
|
|
3469
|
+
paddingLeft: 16 + (t - 1) * W,
|
|
3469
3470
|
fontWeight: s ? 600 : void 0,
|
|
3470
3471
|
...c ? { position: "relative" } : null
|
|
3471
3472
|
},
|
|
3472
3473
|
children: [
|
|
3473
|
-
|
|
3474
|
+
ve(t, n, l),
|
|
3474
3475
|
/* @__PURE__ */ g("span", {
|
|
3475
3476
|
style: {
|
|
3476
3477
|
display: "flex",
|
|
@@ -3478,7 +3479,7 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3478
3479
|
gap: 8,
|
|
3479
3480
|
minWidth: 0
|
|
3480
3481
|
},
|
|
3481
|
-
children: [
|
|
3482
|
+
children: [ie(r), /* @__PURE__ */ h("span", {
|
|
3482
3483
|
...Z("label"),
|
|
3483
3484
|
children: r.label
|
|
3484
3485
|
})]
|
|
@@ -3488,7 +3489,7 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3488
3489
|
tabIndex: -1,
|
|
3489
3490
|
"aria-label": o ? "Collapse" : "Expand",
|
|
3490
3491
|
onClick: (e) => {
|
|
3491
|
-
e.preventDefault(), e.stopPropagation(),
|
|
3492
|
+
e.preventDefault(), e.stopPropagation(), ge(r);
|
|
3492
3493
|
},
|
|
3493
3494
|
style: {
|
|
3494
3495
|
flexShrink: 0,
|
|
@@ -3502,8 +3503,8 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3502
3503
|
children: D === "plus" || D === "chevron" ? /* @__PURE__ */ h("svg", {
|
|
3503
3504
|
...Z("toggle"),
|
|
3504
3505
|
viewBox: "0 0 24 24",
|
|
3505
|
-
width:
|
|
3506
|
-
height:
|
|
3506
|
+
width: ae + 2,
|
|
3507
|
+
height: ae + 2,
|
|
3507
3508
|
fill: "none",
|
|
3508
3509
|
stroke: "currentColor",
|
|
3509
3510
|
strokeWidth: "2",
|
|
@@ -3514,12 +3515,12 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3514
3515
|
transition: "transform .2s",
|
|
3515
3516
|
transform: D === "chevron" && o ? "rotate(90deg)" : "none"
|
|
3516
3517
|
},
|
|
3517
|
-
children:
|
|
3518
|
+
children: oe(o)
|
|
3518
3519
|
}) : /* @__PURE__ */ h("svg", {
|
|
3519
3520
|
...Z("toggle"),
|
|
3520
3521
|
viewBox: "0 0 24 24",
|
|
3521
|
-
width:
|
|
3522
|
-
height:
|
|
3522
|
+
width: ae,
|
|
3523
|
+
height: ae,
|
|
3523
3524
|
"aria-hidden": !0,
|
|
3524
3525
|
style: {
|
|
3525
3526
|
transition: "transform .2s",
|
|
@@ -3534,23 +3535,23 @@ function zr({ source: e = "", labelField: t = "", hrefField: n = "", parentField
|
|
|
3534
3535
|
]
|
|
3535
3536
|
}), o ? /* @__PURE__ */ h("div", {
|
|
3536
3537
|
...Z("children"),
|
|
3537
|
-
children:
|
|
3538
|
+
children: ye(r.children, t + 1, t > 1 ? [...n, !l] : n)
|
|
3538
3539
|
}) : null]
|
|
3539
3540
|
}, r.key);
|
|
3540
3541
|
});
|
|
3541
3542
|
return /* @__PURE__ */ g("nav", {
|
|
3542
|
-
ref:
|
|
3543
|
+
ref: z,
|
|
3543
3544
|
"aria-label": "Menu",
|
|
3544
|
-
className:
|
|
3545
|
-
style: { ...G(
|
|
3546
|
-
children: [
|
|
3545
|
+
className: re ? te : void 0,
|
|
3546
|
+
style: { ...G(R) },
|
|
3547
|
+
children: [re ? /* @__PURE__ */ h("style", { children: re }) : null, pe.length ? ye(pe, 1) : L ? /* @__PURE__ */ h("div", {
|
|
3547
3548
|
...Z("empty"),
|
|
3548
3549
|
style: {
|
|
3549
3550
|
padding: "10px 16px",
|
|
3550
3551
|
opacity: .6,
|
|
3551
3552
|
fontSize: 14
|
|
3552
3553
|
},
|
|
3553
|
-
children:
|
|
3554
|
+
children: L
|
|
3554
3555
|
}) : null]
|
|
3555
3556
|
});
|
|
3556
3557
|
}
|
|
@@ -7293,7 +7294,10 @@ function Ca({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
|
|
|
7293
7294
|
zIndex: 6,
|
|
7294
7295
|
overflowY: "auto",
|
|
7295
7296
|
boxSizing: "border-box",
|
|
7296
|
-
|
|
7297
|
+
marginTop: 0,
|
|
7298
|
+
marginRight: 0,
|
|
7299
|
+
marginBottom: 0,
|
|
7300
|
+
marginLeft: 0,
|
|
7297
7301
|
maxWidth: "none",
|
|
7298
7302
|
maxHeight: "none",
|
|
7299
7303
|
boxShadow: "0 0 40px rgba(15, 23, 42, .28)"
|
|
@@ -7357,10 +7361,15 @@ function Ca({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
|
|
|
7357
7361
|
style: {
|
|
7358
7362
|
outline: "none",
|
|
7359
7363
|
...W ? {
|
|
7360
|
-
|
|
7364
|
+
backgroundColor: "var(--page-surface, #ffffff)",
|
|
7361
7365
|
color: "var(--page-text, #111827)",
|
|
7362
7366
|
boxShadow: "0 0 0 1px var(--page-border, rgba(148, 163, 184, .4))"
|
|
7363
7367
|
} : null,
|
|
7368
|
+
...!W && !z ? {
|
|
7369
|
+
width: L,
|
|
7370
|
+
maxWidth: "100%",
|
|
7371
|
+
boxSizing: "border-box"
|
|
7372
|
+
} : null,
|
|
7364
7373
|
...G(T),
|
|
7365
7374
|
...W ? ee : null
|
|
7366
7375
|
},
|