webim-adapter 0.26.0 → 0.28.0
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 +634 -364
- package/build/webim-embed.js +3 -3
- package/build/webim-ssr.js +386 -116
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -1993,7 +1993,7 @@ function mt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1993
1993
|
display: A === "success" ? "none" : "flex"
|
|
1994
1994
|
},
|
|
1995
1995
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
1996
|
-
P && /* @__PURE__ */ d(
|
|
1996
|
+
P && /* @__PURE__ */ d(Vt, {
|
|
1997
1997
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1998
1998
|
active: F + 1,
|
|
1999
1999
|
style: { marginBottom: 8 }
|
|
@@ -2736,12 +2736,12 @@ var At = "webim.page_mode", jt = () => {
|
|
|
2736
2736
|
rx: "2"
|
|
2737
2737
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
2738
2738
|
});
|
|
2739
|
-
},
|
|
2739
|
+
}, Nt = {
|
|
2740
2740
|
light: "Light theme",
|
|
2741
2741
|
dark: "Dark theme",
|
|
2742
2742
|
auto: "Follow the device theme"
|
|
2743
2743
|
};
|
|
2744
|
-
function
|
|
2744
|
+
function Pt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
2745
2745
|
let [o, s] = l(i ? "auto" : jt), u = c(null), f = (e) => {
|
|
2746
2746
|
u.current = e, typeof r == "function" && r(e);
|
|
2747
2747
|
};
|
|
@@ -2785,8 +2785,8 @@ function Nt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2785
2785
|
},
|
|
2786
2786
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
2787
2787
|
type: "button",
|
|
2788
|
-
title:
|
|
2789
|
-
"aria-label":
|
|
2788
|
+
title: Nt[e],
|
|
2789
|
+
"aria-label": Nt[e],
|
|
2790
2790
|
"aria-pressed": e === m,
|
|
2791
2791
|
onClick: i ? void 0 : () => s(e),
|
|
2792
2792
|
style: {
|
|
@@ -2804,8 +2804,8 @@ function Nt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2804
2804
|
return /* @__PURE__ */ d("button", {
|
|
2805
2805
|
ref: f,
|
|
2806
2806
|
type: "button",
|
|
2807
|
-
title:
|
|
2808
|
-
"aria-label": `Theme: ${
|
|
2807
|
+
title: Nt[m],
|
|
2808
|
+
"aria-label": `Theme: ${Nt[m]} — switch to ${Nt[g]}`,
|
|
2809
2809
|
onClick: i ? void 0 : () => s(g),
|
|
2810
2810
|
style: {
|
|
2811
2811
|
...h,
|
|
@@ -2817,7 +2817,122 @@ function Nt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2817
2817
|
children: Mt(m)
|
|
2818
2818
|
});
|
|
2819
2819
|
}
|
|
2820
|
-
|
|
2820
|
+
function Ft(e) {
|
|
2821
|
+
let t = e?.parentElement;
|
|
2822
|
+
for (; t && t !== document.body;) {
|
|
2823
|
+
let e = getComputedStyle(t).overflowY;
|
|
2824
|
+
if ((e === "auto" || e === "scroll") && t.scrollHeight > t.clientHeight) return t;
|
|
2825
|
+
t = t.parentElement;
|
|
2826
|
+
}
|
|
2827
|
+
return window;
|
|
2828
|
+
}
|
|
2829
|
+
var It = (e) => e === window ? window.scrollY : e.scrollTop, Lt = {
|
|
2830
|
+
"bottom-right": (e) => ({
|
|
2831
|
+
right: e,
|
|
2832
|
+
bottom: e
|
|
2833
|
+
}),
|
|
2834
|
+
"bottom-left": (e) => ({
|
|
2835
|
+
left: e,
|
|
2836
|
+
bottom: e
|
|
2837
|
+
}),
|
|
2838
|
+
"bottom-center": (e) => ({
|
|
2839
|
+
left: "50%",
|
|
2840
|
+
bottom: e,
|
|
2841
|
+
transform: "translateX(-50%)"
|
|
2842
|
+
})
|
|
2843
|
+
};
|
|
2844
|
+
function Rt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: o, bg: s, fg: c, style: u, nodeRef: p, inert: m, frame: h }) {
|
|
2845
|
+
let [g, _] = l(!!m), [v, y] = l(null), b = (e) => {
|
|
2846
|
+
y(e), typeof p == "function" && p(e);
|
|
2847
|
+
};
|
|
2848
|
+
a(() => {
|
|
2849
|
+
if (m) {
|
|
2850
|
+
_(!0);
|
|
2851
|
+
return;
|
|
2852
|
+
}
|
|
2853
|
+
if (!v) return;
|
|
2854
|
+
let e = Ft(v), t = Number(i) >= 0 ? Number(i) : 300, n = () => _(It(e) > t);
|
|
2855
|
+
return n(), e.addEventListener("scroll", n, { passive: !0 }), () => e.removeEventListener("scroll", n);
|
|
2856
|
+
}, [
|
|
2857
|
+
m,
|
|
2858
|
+
v,
|
|
2859
|
+
i
|
|
2860
|
+
]);
|
|
2861
|
+
let x = () => {
|
|
2862
|
+
if (m) return;
|
|
2863
|
+
let e = Ft(v), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
2864
|
+
e === window ? window.scrollTo({
|
|
2865
|
+
top: 0,
|
|
2866
|
+
behavior: n
|
|
2867
|
+
}) : e.scrollTo({
|
|
2868
|
+
top: 0,
|
|
2869
|
+
behavior: n
|
|
2870
|
+
});
|
|
2871
|
+
}, S = Number(r) >= 0 ? Number(r) : 24, C = e === "pill", w = t || "Top", T = Lt[n] ? n : "bottom-right", E = h ? {
|
|
2872
|
+
position: "fixed",
|
|
2873
|
+
zIndex: 5,
|
|
2874
|
+
bottom: (h.bottom ?? 0) + S,
|
|
2875
|
+
...T === "bottom-left" ? { left: (h.left ?? 0) + S } : null,
|
|
2876
|
+
...T === "bottom-right" ? { right: (h.right ?? 0) + S } : null,
|
|
2877
|
+
...T === "bottom-center" ? {
|
|
2878
|
+
left: (h.left ?? 0) + (h.width ?? 0) / 2,
|
|
2879
|
+
transform: "translateX(-50%)"
|
|
2880
|
+
} : null
|
|
2881
|
+
} : {
|
|
2882
|
+
position: "fixed",
|
|
2883
|
+
zIndex: 2147482e3,
|
|
2884
|
+
...Lt[T](S)
|
|
2885
|
+
};
|
|
2886
|
+
return /* @__PURE__ */ f("button", {
|
|
2887
|
+
ref: b,
|
|
2888
|
+
type: "button",
|
|
2889
|
+
title: w,
|
|
2890
|
+
"aria-label": w,
|
|
2891
|
+
"aria-hidden": !g,
|
|
2892
|
+
tabIndex: g ? 0 : -1,
|
|
2893
|
+
onClick: x,
|
|
2894
|
+
style: {
|
|
2895
|
+
display: "inline-flex",
|
|
2896
|
+
alignItems: "center",
|
|
2897
|
+
justifyContent: "center",
|
|
2898
|
+
gap: C ? 8 : 0,
|
|
2899
|
+
appearance: "none",
|
|
2900
|
+
font: "inherit",
|
|
2901
|
+
fontSize: 14,
|
|
2902
|
+
fontWeight: 600,
|
|
2903
|
+
width: C ? "auto" : 44,
|
|
2904
|
+
height: 44,
|
|
2905
|
+
padding: C ? "0 18px" : 0,
|
|
2906
|
+
borderRadius: 999,
|
|
2907
|
+
border: "1px solid transparent",
|
|
2908
|
+
background: s || "var(--page-accent, #111827)",
|
|
2909
|
+
color: c || "var(--page-accent-text, #ffffff)",
|
|
2910
|
+
boxShadow: "0 6px 20px rgba(15, 23, 42, 0.25)",
|
|
2911
|
+
cursor: m ? "default" : "pointer",
|
|
2912
|
+
opacity: +!!g,
|
|
2913
|
+
pointerEvents: g ? "auto" : "none",
|
|
2914
|
+
transition: "opacity 160ms ease, transform 160ms ease",
|
|
2915
|
+
...E,
|
|
2916
|
+
...D(u),
|
|
2917
|
+
...E.transform ? { transform: E.transform } : null
|
|
2918
|
+
},
|
|
2919
|
+
children: [/* @__PURE__ */ d("svg", {
|
|
2920
|
+
width: "18",
|
|
2921
|
+
height: "18",
|
|
2922
|
+
viewBox: "0 0 24 24",
|
|
2923
|
+
fill: "none",
|
|
2924
|
+
"aria-hidden": "true",
|
|
2925
|
+
children: /* @__PURE__ */ d("path", {
|
|
2926
|
+
d: "M12 19V5M12 5l-7 7M12 5l7 7",
|
|
2927
|
+
stroke: "currentColor",
|
|
2928
|
+
strokeWidth: "2",
|
|
2929
|
+
strokeLinecap: "round",
|
|
2930
|
+
strokeLinejoin: "round"
|
|
2931
|
+
})
|
|
2932
|
+
}), C ? /* @__PURE__ */ d("span", { children: w }) : null]
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
var zt = {
|
|
2821
2936
|
facebook: {
|
|
2822
2937
|
label: "Facebook",
|
|
2823
2938
|
color: "#1877f2",
|
|
@@ -2884,8 +2999,8 @@ var Pt = {
|
|
|
2884
2999
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
|
|
2885
3000
|
}
|
|
2886
3001
|
};
|
|
2887
|
-
function
|
|
2888
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3002
|
+
function Bt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3003
|
+
let l = Array.isArray(e) ? e.filter((e) => e && zt[e.network]) : [];
|
|
2889
3004
|
if (!l.length) return null;
|
|
2890
3005
|
let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
|
|
2891
3006
|
return /* @__PURE__ */ d("div", {
|
|
@@ -2898,7 +3013,7 @@ function Ft({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
2898
3013
|
...D(o)
|
|
2899
3014
|
},
|
|
2900
3015
|
children: l.map((e, r) => {
|
|
2901
|
-
let i =
|
|
3016
|
+
let i = zt[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
|
|
2902
3017
|
return /* @__PURE__ */ d("a", {
|
|
2903
3018
|
href: e.url || "#",
|
|
2904
3019
|
onClick: h,
|
|
@@ -2932,7 +3047,7 @@ function Ft({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
2932
3047
|
})
|
|
2933
3048
|
});
|
|
2934
3049
|
}
|
|
2935
|
-
function
|
|
3050
|
+
function Vt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2936
3051
|
if (!e.length) return null;
|
|
2937
3052
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
2938
3053
|
width: 32,
|
|
@@ -3010,7 +3125,7 @@ function It({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3010
3125
|
})
|
|
3011
3126
|
});
|
|
3012
3127
|
}
|
|
3013
|
-
var
|
|
3128
|
+
var Ht = {
|
|
3014
3129
|
small: {
|
|
3015
3130
|
w: 132,
|
|
3016
3131
|
h: 46,
|
|
@@ -3032,10 +3147,10 @@ var Lt = {
|
|
|
3032
3147
|
title: 12.5,
|
|
3033
3148
|
avatar: 46
|
|
3034
3149
|
}
|
|
3035
|
-
},
|
|
3036
|
-
|
|
3037
|
-
function
|
|
3038
|
-
let r =
|
|
3150
|
+
}, Ut = (e) => Ht[e] ?? Ht.medium;
|
|
3151
|
+
Ht.medium.w, Ht.medium.h;
|
|
3152
|
+
function Wt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
3153
|
+
let r = Ut(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
|
|
3039
3154
|
for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
|
|
3040
3155
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
3041
3156
|
if (t.has(e.id)) return 0;
|
|
@@ -3087,18 +3202,18 @@ function zt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
3087
3202
|
horizontal: n
|
|
3088
3203
|
};
|
|
3089
3204
|
}
|
|
3090
|
-
var
|
|
3205
|
+
var Gt = (e, t) => {
|
|
3091
3206
|
let n = String(e ?? "");
|
|
3092
3207
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3093
|
-
},
|
|
3208
|
+
}, Kt = (e) => {
|
|
3094
3209
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3095
3210
|
if (!t) return "#ffffff";
|
|
3096
3211
|
let n = t[1];
|
|
3097
3212
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3098
3213
|
let r = parseInt(n, 16);
|
|
3099
3214
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3100
|
-
},
|
|
3101
|
-
function
|
|
3215
|
+
}, qt = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3216
|
+
function Jt(e, t = {}) {
|
|
3102
3217
|
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
|
|
3103
3218
|
return n.map((e) => {
|
|
3104
3219
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -3113,11 +3228,11 @@ function Ut(e, t = {}) {
|
|
|
3113
3228
|
};
|
|
3114
3229
|
});
|
|
3115
3230
|
}
|
|
3116
|
-
var
|
|
3231
|
+
var Yt = {
|
|
3117
3232
|
size: 36,
|
|
3118
3233
|
pad: 10
|
|
3119
3234
|
};
|
|
3120
|
-
function
|
|
3235
|
+
function Xt({ node: e, onClose: t }) {
|
|
3121
3236
|
return a(() => {
|
|
3122
3237
|
let e = (e) => e.key === "Escape" && t();
|
|
3123
3238
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -3238,7 +3353,7 @@ function Gt({ node: e, onClose: t }) {
|
|
|
3238
3353
|
})
|
|
3239
3354
|
});
|
|
3240
3355
|
}
|
|
3241
|
-
function
|
|
3356
|
+
function Zt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
3242
3357
|
let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(V), T = i(H)?.[t], [E, O] = l(null);
|
|
3243
3358
|
a(() => {
|
|
3244
3359
|
if (!t || T) return;
|
|
@@ -3255,14 +3370,14 @@ function Kt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3255
3370
|
w,
|
|
3256
3371
|
T
|
|
3257
3372
|
]);
|
|
3258
|
-
let k = t ?
|
|
3373
|
+
let k = t ? Jt(T ?? E ?? [], {
|
|
3259
3374
|
nameField: n,
|
|
3260
3375
|
titleField: r,
|
|
3261
3376
|
photoField: s,
|
|
3262
3377
|
parentField: c,
|
|
3263
3378
|
cvField: p,
|
|
3264
3379
|
hrefField: m
|
|
3265
|
-
}) : e, A =
|
|
3380
|
+
}) : e, A = Ut(h), { boxes: j, links: M, width: N, height: P } = Wt(k, {
|
|
3266
3381
|
size: h,
|
|
3267
3382
|
horizontal: g
|
|
3268
3383
|
});
|
|
@@ -3308,7 +3423,7 @@ function Kt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3308
3423
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
3309
3424
|
strokeWidth: "1.5"
|
|
3310
3425
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
3311
|
-
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
3426
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Kt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Kt(e.color2) : s, l = y && (qt(e) || e.href), p = () => qt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Yt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
3312
3427
|
return /* @__PURE__ */ f("g", {
|
|
3313
3428
|
onClick: l ? p : void 0,
|
|
3314
3429
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -3372,13 +3487,13 @@ function Kt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3372
3487
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
3373
3488
|
id: `${b}-${e.id}`,
|
|
3374
3489
|
children: /* @__PURE__ */ d("circle", {
|
|
3375
|
-
cx: t +
|
|
3490
|
+
cx: t + Yt.pad + A.avatar / 2,
|
|
3376
3491
|
cy: n + A.h / 2,
|
|
3377
3492
|
r: A.avatar / 2
|
|
3378
3493
|
})
|
|
3379
3494
|
}), /* @__PURE__ */ d("image", {
|
|
3380
3495
|
href: e.photo,
|
|
3381
|
-
x: t +
|
|
3496
|
+
x: t + Yt.pad,
|
|
3382
3497
|
y: n + (A.h - A.avatar) / 2,
|
|
3383
3498
|
width: A.avatar,
|
|
3384
3499
|
height: A.avatar,
|
|
@@ -3392,7 +3507,7 @@ function Kt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3392
3507
|
fontSize: A.title,
|
|
3393
3508
|
fontWeight: "600",
|
|
3394
3509
|
fill: s,
|
|
3395
|
-
children:
|
|
3510
|
+
children: Gt(e.title, g + 4)
|
|
3396
3511
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
3397
3512
|
x: m,
|
|
3398
3513
|
y: n + _ + _ / 2 + A.name * .35,
|
|
@@ -3400,7 +3515,7 @@ function Kt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3400
3515
|
fontSize: A.name,
|
|
3401
3516
|
fontWeight: "600",
|
|
3402
3517
|
fill: c,
|
|
3403
|
-
children:
|
|
3518
|
+
children: Gt(e.name, g)
|
|
3404
3519
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
3405
3520
|
x: m,
|
|
3406
3521
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
@@ -3408,7 +3523,7 @@ function Kt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3408
3523
|
fontSize: A.name,
|
|
3409
3524
|
fontWeight: "600",
|
|
3410
3525
|
fill: s,
|
|
3411
|
-
children:
|
|
3526
|
+
children: Gt(v[0], g)
|
|
3412
3527
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
3413
3528
|
x: m,
|
|
3414
3529
|
y: n + A.h * .73,
|
|
@@ -3416,18 +3531,18 @@ function Kt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3416
3531
|
fontSize: A.title,
|
|
3417
3532
|
opacity: "0.7",
|
|
3418
3533
|
fill: s,
|
|
3419
|
-
children:
|
|
3534
|
+
children: Gt(v[1], g + 4)
|
|
3420
3535
|
})] })
|
|
3421
3536
|
]
|
|
3422
3537
|
}, e.id);
|
|
3423
3538
|
})]
|
|
3424
|
-
}), x && /* @__PURE__ */ d(
|
|
3539
|
+
}), x && /* @__PURE__ */ d(Xt, {
|
|
3425
3540
|
node: x,
|
|
3426
3541
|
onClose: () => S(null)
|
|
3427
3542
|
})]
|
|
3428
3543
|
});
|
|
3429
3544
|
}
|
|
3430
|
-
function
|
|
3545
|
+
function Qt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, paged: u, emptyText: p, style: m, nodeRef: h }) {
|
|
3431
3546
|
let { tenant: g, apiUrl: _ } = i(V), v = i(H), y = v?.[n], b = u ? U(v) : 1, [x, S] = l(null);
|
|
3432
3547
|
if (a(() => {
|
|
3433
3548
|
if (!n || y) return;
|
|
@@ -3493,7 +3608,7 @@ function qt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
3493
3608
|
})
|
|
3494
3609
|
});
|
|
3495
3610
|
}
|
|
3496
|
-
var
|
|
3611
|
+
var $t = {
|
|
3497
3612
|
PageRoot: Se,
|
|
3498
3613
|
Section: Ce,
|
|
3499
3614
|
Container: we,
|
|
@@ -3511,11 +3626,12 @@ var Jt = {
|
|
|
3511
3626
|
CollectionSearch: Dt,
|
|
3512
3627
|
BreadcrumbsBlock: Ot,
|
|
3513
3628
|
PaginationBlock: kt,
|
|
3514
|
-
StepperBlock:
|
|
3515
|
-
SocialLinksBlock:
|
|
3516
|
-
ThemeModeBlock:
|
|
3517
|
-
|
|
3518
|
-
|
|
3629
|
+
StepperBlock: Vt,
|
|
3630
|
+
SocialLinksBlock: Bt,
|
|
3631
|
+
ThemeModeBlock: Pt,
|
|
3632
|
+
ScrollTopBlock: Rt,
|
|
3633
|
+
OrgChartBlock: Zt,
|
|
3634
|
+
TableBlock: Qt,
|
|
3519
3635
|
MasonryBlock: tt,
|
|
3520
3636
|
AccordionBlock: ot,
|
|
3521
3637
|
NavbarBlock: it,
|
|
@@ -3545,26 +3661,26 @@ var Jt = {
|
|
|
3545
3661
|
FormFile: Ct,
|
|
3546
3662
|
FormRecaptcha: _t,
|
|
3547
3663
|
FormSubmit: wt
|
|
3548
|
-
},
|
|
3664
|
+
}, en = {
|
|
3549
3665
|
id: "auth",
|
|
3550
3666
|
label: "Accounts",
|
|
3551
3667
|
category: "Apps",
|
|
3552
3668
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
3553
3669
|
ssr: "shell",
|
|
3554
3670
|
settings: ["site.authRedirect"]
|
|
3555
|
-
},
|
|
3671
|
+
}, tn = n({
|
|
3556
3672
|
user: null,
|
|
3557
3673
|
status: "idle",
|
|
3558
3674
|
ensure: () => {},
|
|
3559
3675
|
refresh: () => {},
|
|
3560
3676
|
signOut: () => {}
|
|
3561
|
-
}),
|
|
3562
|
-
let e = i(
|
|
3677
|
+
}), nn = () => {
|
|
3678
|
+
let e = i(tn);
|
|
3563
3679
|
return a(() => {
|
|
3564
3680
|
e.ensure();
|
|
3565
3681
|
}, [e]), e;
|
|
3566
3682
|
};
|
|
3567
|
-
function
|
|
3683
|
+
function rn({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
|
|
3568
3684
|
let u = i(V), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
|
|
3569
3685
|
...t,
|
|
3570
3686
|
credentials: "include",
|
|
@@ -3597,18 +3713,18 @@ function Qt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o })
|
|
|
3597
3713
|
b,
|
|
3598
3714
|
x
|
|
3599
3715
|
]);
|
|
3600
|
-
return /* @__PURE__ */ d(
|
|
3716
|
+
return /* @__PURE__ */ d(tn.Provider, {
|
|
3601
3717
|
value: C,
|
|
3602
3718
|
children: e
|
|
3603
3719
|
});
|
|
3604
3720
|
}
|
|
3605
|
-
function
|
|
3606
|
-
let { status: n } =
|
|
3721
|
+
function an({ when: e, children: t }) {
|
|
3722
|
+
let { status: n } = nn();
|
|
3607
3723
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
3608
3724
|
}
|
|
3609
3725
|
//#endregion
|
|
3610
3726
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
3611
|
-
function
|
|
3727
|
+
function on({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
|
|
3612
3728
|
let { tenant: h, apiUrl: g, settings: _ } = i(V), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
3613
3729
|
if (e.preventDefault(), u) return;
|
|
3614
3730
|
let n = new FormData(e.currentTarget);
|
|
@@ -3732,8 +3848,8 @@ function en({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3732
3848
|
]
|
|
3733
3849
|
});
|
|
3734
3850
|
}
|
|
3735
|
-
function
|
|
3736
|
-
let { user: c, status: l, signOut: u } =
|
|
3851
|
+
function sn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
3852
|
+
let { user: c, status: l, signOut: u } = nn(), p = a ? s || "user" : l, m = a ? {
|
|
3737
3853
|
name: "Ada Lovelace",
|
|
3738
3854
|
email: "ada@example.com"
|
|
3739
3855
|
} : c;
|
|
@@ -3797,8 +3913,157 @@ function tn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3797
3913
|
});
|
|
3798
3914
|
}
|
|
3799
3915
|
//#endregion
|
|
3916
|
+
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
3917
|
+
var cn = {
|
|
3918
|
+
id: "consent",
|
|
3919
|
+
label: "Cookie consent",
|
|
3920
|
+
category: "Apps",
|
|
3921
|
+
keys: ["CookieConsent"],
|
|
3922
|
+
ssr: "shell",
|
|
3923
|
+
settings: []
|
|
3924
|
+
}, ln = "webim.cookie_consent";
|
|
3925
|
+
function un() {
|
|
3926
|
+
try {
|
|
3927
|
+
let e = window.localStorage.getItem(ln), t = e ? JSON.parse(e) : null;
|
|
3928
|
+
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
3929
|
+
} catch {
|
|
3930
|
+
return "";
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
function dn(e) {
|
|
3934
|
+
try {
|
|
3935
|
+
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
3936
|
+
} catch {}
|
|
3937
|
+
}
|
|
3938
|
+
function fn(e) {
|
|
3939
|
+
try {
|
|
3940
|
+
window.localStorage.setItem(ln, JSON.stringify({
|
|
3941
|
+
choice: e,
|
|
3942
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3943
|
+
}));
|
|
3944
|
+
} catch {}
|
|
3945
|
+
dn(e);
|
|
3946
|
+
try {
|
|
3947
|
+
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
3948
|
+
} catch {}
|
|
3949
|
+
}
|
|
3950
|
+
var pn = {
|
|
3951
|
+
bottom: {
|
|
3952
|
+
left: 0,
|
|
3953
|
+
right: 0,
|
|
3954
|
+
bottom: 0
|
|
3955
|
+
},
|
|
3956
|
+
top: {
|
|
3957
|
+
left: 0,
|
|
3958
|
+
right: 0,
|
|
3959
|
+
top: 0
|
|
3960
|
+
},
|
|
3961
|
+
"bottom-left": {
|
|
3962
|
+
left: 16,
|
|
3963
|
+
bottom: 16,
|
|
3964
|
+
maxWidth: 400
|
|
3965
|
+
},
|
|
3966
|
+
"bottom-right": {
|
|
3967
|
+
right: 16,
|
|
3968
|
+
bottom: 16,
|
|
3969
|
+
maxWidth: 400
|
|
3970
|
+
}
|
|
3971
|
+
};
|
|
3972
|
+
function mn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
|
|
3973
|
+
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
3974
|
+
y(e), typeof m == "function" && m(e);
|
|
3975
|
+
};
|
|
3976
|
+
if (a(() => {
|
|
3977
|
+
if (h) return;
|
|
3978
|
+
let e = un();
|
|
3979
|
+
if (e) {
|
|
3980
|
+
let t = v?.closest?.(".webim-page");
|
|
3981
|
+
t && t.setAttribute("data-webim-consent", e);
|
|
3982
|
+
} else _(!0);
|
|
3983
|
+
}, [h, v]), !g) return null;
|
|
3984
|
+
let x = (e) => () => {
|
|
3985
|
+
h || (fn(e, v), _(!1));
|
|
3986
|
+
}, S = pn[s] ?? pn.bottom, C = {
|
|
3987
|
+
appearance: "none",
|
|
3988
|
+
font: "inherit",
|
|
3989
|
+
fontSize: 14,
|
|
3990
|
+
fontWeight: 600,
|
|
3991
|
+
padding: "8px 16px",
|
|
3992
|
+
borderRadius: 8,
|
|
3993
|
+
cursor: h ? "default" : "pointer",
|
|
3994
|
+
whiteSpace: "nowrap"
|
|
3995
|
+
};
|
|
3996
|
+
return /* @__PURE__ */ f("div", {
|
|
3997
|
+
ref: b,
|
|
3998
|
+
role: "region",
|
|
3999
|
+
"aria-label": "Cookie consent",
|
|
4000
|
+
style: {
|
|
4001
|
+
...h ? { position: "relative" } : {
|
|
4002
|
+
position: "fixed",
|
|
4003
|
+
zIndex: 2147483e3,
|
|
4004
|
+
...S
|
|
4005
|
+
},
|
|
4006
|
+
display: "flex",
|
|
4007
|
+
flexWrap: "wrap",
|
|
4008
|
+
alignItems: "center",
|
|
4009
|
+
gap: 12,
|
|
4010
|
+
padding: 16,
|
|
4011
|
+
background: "var(--page-surface, #f2f2f2)",
|
|
4012
|
+
color: "var(--page-text, #111827)",
|
|
4013
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.4))",
|
|
4014
|
+
borderRadius: s === "bottom" || s === "top" ? 0 : 12,
|
|
4015
|
+
boxShadow: "0 8px 30px rgba(15, 23, 42, 0.18)",
|
|
4016
|
+
fontSize: 14,
|
|
4017
|
+
lineHeight: 1.5,
|
|
4018
|
+
...D(p)
|
|
4019
|
+
},
|
|
4020
|
+
children: [/* @__PURE__ */ f("div", {
|
|
4021
|
+
style: {
|
|
4022
|
+
flex: "1 1 260px",
|
|
4023
|
+
minWidth: 0
|
|
4024
|
+
},
|
|
4025
|
+
children: [c?.content ?? (e || "We use cookies to run this site and to understand how it is used."), i && o ? /* @__PURE__ */ f(u, { children: [" ", /* @__PURE__ */ d("a", {
|
|
4026
|
+
href: o,
|
|
4027
|
+
onClick: h ? (e) => e.preventDefault() : void 0,
|
|
4028
|
+
style: {
|
|
4029
|
+
color: "var(--page-accent, inherit)",
|
|
4030
|
+
textDecoration: "underline"
|
|
4031
|
+
},
|
|
4032
|
+
children: i
|
|
4033
|
+
})] }) : null]
|
|
4034
|
+
}), /* @__PURE__ */ f("div", {
|
|
4035
|
+
style: {
|
|
4036
|
+
display: "flex",
|
|
4037
|
+
gap: 8,
|
|
4038
|
+
flexShrink: 0
|
|
4039
|
+
},
|
|
4040
|
+
children: [r === !1 ? null : /* @__PURE__ */ d("button", {
|
|
4041
|
+
type: "button",
|
|
4042
|
+
onClick: x("declined"),
|
|
4043
|
+
style: {
|
|
4044
|
+
...C,
|
|
4045
|
+
background: "transparent",
|
|
4046
|
+
color: "inherit",
|
|
4047
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.6))"
|
|
4048
|
+
},
|
|
4049
|
+
children: n || "Decline"
|
|
4050
|
+
}), /* @__PURE__ */ d("button", {
|
|
4051
|
+
type: "button",
|
|
4052
|
+
onClick: x("accepted"),
|
|
4053
|
+
style: {
|
|
4054
|
+
...C,
|
|
4055
|
+
background: "var(--page-accent, #111827)",
|
|
4056
|
+
color: "var(--page-accent-text, #ffffff)",
|
|
4057
|
+
border: "1px solid transparent"
|
|
4058
|
+
},
|
|
4059
|
+
children: t || "Accept"
|
|
4060
|
+
})]
|
|
4061
|
+
})]
|
|
4062
|
+
});
|
|
4063
|
+
}
|
|
4064
|
+
//#endregion
|
|
3800
4065
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
3801
|
-
var
|
|
4066
|
+
var hn = {
|
|
3802
4067
|
id: "language",
|
|
3803
4068
|
label: "Language",
|
|
3804
4069
|
category: "Apps",
|
|
@@ -3808,21 +4073,21 @@ var nn = {
|
|
|
3808
4073
|
};
|
|
3809
4074
|
//#endregion
|
|
3810
4075
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
3811
|
-
function
|
|
4076
|
+
function gn(e) {
|
|
3812
4077
|
let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
|
|
3813
4078
|
return [...new Set(n.map((e) => e.trim()))];
|
|
3814
4079
|
}
|
|
3815
|
-
var
|
|
3816
|
-
function
|
|
4080
|
+
var _n = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
4081
|
+
function vn(e, t) {
|
|
3817
4082
|
let n = String(e ?? "").toUpperCase();
|
|
3818
4083
|
if (t === "code") return n;
|
|
3819
4084
|
let r = "";
|
|
3820
4085
|
try {
|
|
3821
|
-
r =
|
|
4086
|
+
r = _n(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
3822
4087
|
} catch {}
|
|
3823
4088
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
3824
4089
|
}
|
|
3825
|
-
function
|
|
4090
|
+
function yn(e, t) {
|
|
3826
4091
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
3827
4092
|
if (typeof window > "u") return n || "?";
|
|
3828
4093
|
try {
|
|
@@ -3832,8 +4097,8 @@ function sn(e, t) {
|
|
|
3832
4097
|
return n || "/";
|
|
3833
4098
|
}
|
|
3834
4099
|
}
|
|
3835
|
-
function
|
|
3836
|
-
let c = i(V), l =
|
|
4100
|
+
function bn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
4101
|
+
let c = i(V), l = gn(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
|
|
3837
4102
|
display: "inline-flex",
|
|
3838
4103
|
alignItems: "center",
|
|
3839
4104
|
gap: 8,
|
|
@@ -3868,7 +4133,7 @@ function cn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
3868
4133
|
style: { opacity: .4 },
|
|
3869
4134
|
children: n ?? "·"
|
|
3870
4135
|
}), /* @__PURE__ */ d("a", {
|
|
3871
|
-
href:
|
|
4136
|
+
href: yn(e, e === u),
|
|
3872
4137
|
hrefLang: e,
|
|
3873
4138
|
"aria-current": e === p ? "true" : void 0,
|
|
3874
4139
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -3878,7 +4143,7 @@ function cn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
3878
4143
|
textDecoration: "none",
|
|
3879
4144
|
cursor: s ? "default" : "pointer"
|
|
3880
4145
|
},
|
|
3881
|
-
children:
|
|
4146
|
+
children: vn(e, t)
|
|
3882
4147
|
})]
|
|
3883
4148
|
}, e))]
|
|
3884
4149
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -3889,7 +4154,7 @@ function cn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
3889
4154
|
value: p,
|
|
3890
4155
|
onChange: s ? void 0 : (e) => {
|
|
3891
4156
|
let t = e.target.value;
|
|
3892
|
-
window.location.assign(
|
|
4157
|
+
window.location.assign(yn(t, t === u));
|
|
3893
4158
|
},
|
|
3894
4159
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
3895
4160
|
style: {
|
|
@@ -3903,50 +4168,55 @@ function cn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
3903
4168
|
},
|
|
3904
4169
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
3905
4170
|
value: e,
|
|
3906
|
-
children:
|
|
4171
|
+
children: vn(e, t)
|
|
3907
4172
|
}, e))
|
|
3908
4173
|
})]
|
|
3909
4174
|
});
|
|
3910
4175
|
}
|
|
3911
4176
|
//#endregion
|
|
3912
4177
|
//#region ../ui/src/components/builder/apps/index.js
|
|
3913
|
-
var
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
4178
|
+
var xn = [
|
|
4179
|
+
en,
|
|
4180
|
+
hn,
|
|
4181
|
+
cn
|
|
4182
|
+
], Sn = {
|
|
4183
|
+
SiteLoginForm: on,
|
|
4184
|
+
SiteAccountMenu: sn,
|
|
4185
|
+
SiteLanguagePicker: bn,
|
|
4186
|
+
CookieConsent: mn
|
|
3917
4187
|
};
|
|
3918
|
-
new Set(
|
|
4188
|
+
new Set(xn.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
3919
4189
|
//#endregion
|
|
3920
4190
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
3921
|
-
var
|
|
3922
|
-
function
|
|
3923
|
-
if (
|
|
4191
|
+
var Cn = /* @__PURE__ */ new Map();
|
|
4192
|
+
function wn(e) {
|
|
4193
|
+
if (Cn.has(e)) return Cn.get(e);
|
|
3924
4194
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
3925
4195
|
/* @vite-ignore */
|
|
3926
4196
|
/* webpackIgnore: true */
|
|
3927
4197
|
t
|
|
3928
4198
|
).finally(() => URL.revokeObjectURL(t));
|
|
3929
|
-
return
|
|
4199
|
+
return Cn.set(e, n), n;
|
|
3930
4200
|
}
|
|
3931
|
-
function
|
|
4201
|
+
function Tn(e) {
|
|
3932
4202
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
3933
4203
|
return n && typeof n == "object" ? n : {};
|
|
3934
4204
|
}
|
|
3935
4205
|
//#endregion
|
|
3936
4206
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
3937
|
-
async function
|
|
3938
|
-
let n = await
|
|
4207
|
+
async function En(e, t) {
|
|
4208
|
+
let n = await wn(e);
|
|
3939
4209
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
3940
4210
|
}
|
|
3941
|
-
var
|
|
4211
|
+
var Dn = {
|
|
3942
4212
|
padding: "10px 12px",
|
|
3943
4213
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
3944
4214
|
borderRadius: 8,
|
|
3945
4215
|
fontSize: 12,
|
|
3946
4216
|
opacity: .6
|
|
3947
4217
|
};
|
|
3948
|
-
function
|
|
3949
|
-
let s = i(V), l =
|
|
4218
|
+
function On({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
4219
|
+
let s = i(V), l = Tn(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
3950
4220
|
tenant: s?.tenant ?? "",
|
|
3951
4221
|
apiUrl: s?.apiUrl ?? "/api",
|
|
3952
4222
|
locale: s?.locale ?? "",
|
|
@@ -3958,7 +4228,7 @@ function gn({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
3958
4228
|
let e = u.current;
|
|
3959
4229
|
if (!l?.code || !e) return;
|
|
3960
4230
|
let n = !0;
|
|
3961
|
-
return
|
|
4231
|
+
return En(l.code, t).then((e) => {
|
|
3962
4232
|
if (!(!n || !e || !u.current)) {
|
|
3963
4233
|
p.current = e;
|
|
3964
4234
|
try {
|
|
@@ -3988,7 +4258,7 @@ function gn({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
3988
4258
|
}) : /* @__PURE__ */ f("div", {
|
|
3989
4259
|
ref: o,
|
|
3990
4260
|
style: {
|
|
3991
|
-
...
|
|
4261
|
+
...Dn,
|
|
3992
4262
|
...D(r)
|
|
3993
4263
|
},
|
|
3994
4264
|
children: [
|
|
@@ -4000,12 +4270,12 @@ function gn({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
4000
4270
|
}
|
|
4001
4271
|
//#endregion
|
|
4002
4272
|
//#region ../ui/src/components/builder/render.jsx
|
|
4003
|
-
var
|
|
4004
|
-
|
|
4005
|
-
...
|
|
4006
|
-
PluginBlock:
|
|
4273
|
+
var kn = {
|
|
4274
|
+
...$t,
|
|
4275
|
+
...Sn,
|
|
4276
|
+
PluginBlock: On
|
|
4007
4277
|
};
|
|
4008
|
-
function
|
|
4278
|
+
function An(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
4009
4279
|
let o = n[e];
|
|
4010
4280
|
if (!o || o.hidden) return null;
|
|
4011
4281
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -4013,11 +4283,11 @@ function vn(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
4013
4283
|
let n = o.props?.componentId, s = r?.[n];
|
|
4014
4284
|
if (!s?.template || i.has(n)) return null;
|
|
4015
4285
|
let c = new Set(i).add(n);
|
|
4016
|
-
return /* @__PURE__ */ d(t, { children:
|
|
4286
|
+
return /* @__PURE__ */ d(t, { children: An(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
4017
4287
|
}
|
|
4018
|
-
let l =
|
|
4288
|
+
let l = kn[s];
|
|
4019
4289
|
if (!l) return null;
|
|
4020
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
4290
|
+
let u = (o.nodes ?? []).map((e) => An(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, An(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
4021
4291
|
...c,
|
|
4022
4292
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
4023
4293
|
linked: p,
|
|
@@ -4026,16 +4296,16 @@ function vn(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
4026
4296
|
},
|
|
4027
4297
|
children: u.length ? u : void 0
|
|
4028
4298
|
}, e);
|
|
4029
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
4299
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(an, {
|
|
4030
4300
|
when: c.when,
|
|
4031
4301
|
children: m
|
|
4032
4302
|
}, e) : m;
|
|
4033
4303
|
}
|
|
4034
4304
|
//#endregion
|
|
4035
4305
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
4036
|
-
var
|
|
4306
|
+
var jn = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Mn = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(B(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
4037
4307
|
.webim-page[data-webim-mode="dark"] { ${Object.entries(B(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
4038
|
-
function
|
|
4308
|
+
function Nn({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: _ }) {
|
|
4039
4309
|
let v = o?.js?.trim();
|
|
4040
4310
|
if (a(() => {
|
|
4041
4311
|
if (!v) return;
|
|
@@ -4049,11 +4319,11 @@ function xn({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
4049
4319
|
minHeight: "100%",
|
|
4050
4320
|
display: "flex",
|
|
4051
4321
|
flexDirection: "column"
|
|
4052
|
-
}, w =
|
|
4322
|
+
}, w = An("ROOT", e, n), T = s(() => ({ render: (t, r) => An(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = re(e, n), D = ne(e, n), O = o?.css?.trim(), k = z(t), A = [k.font, k.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !R[e]), j = [.../* @__PURE__ */ new Set([...C(e, n), ...A])].map((e) => /* @__PURE__ */ d("link", {
|
|
4053
4323
|
rel: "stylesheet",
|
|
4054
4324
|
precedence: "default",
|
|
4055
4325
|
href: b(e)
|
|
4056
|
-
}, e)), M =
|
|
4326
|
+
}, e)), M = Mn(k);
|
|
4057
4327
|
return r === "auto" ? /* @__PURE__ */ d(V.Provider, {
|
|
4058
4328
|
value: {
|
|
4059
4329
|
tenant: c || "",
|
|
@@ -4061,7 +4331,7 @@ function xn({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
4061
4331
|
locale: p || "",
|
|
4062
4332
|
settings: g ?? null
|
|
4063
4333
|
},
|
|
4064
|
-
children: /* @__PURE__ */ d(
|
|
4334
|
+
children: /* @__PURE__ */ d(rn, {
|
|
4065
4335
|
initialUser: _,
|
|
4066
4336
|
children: /* @__PURE__ */ d(H.Provider, {
|
|
4067
4337
|
value: u ?? null,
|
|
@@ -4076,8 +4346,8 @@ function xn({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
4076
4346
|
...i
|
|
4077
4347
|
},
|
|
4078
4348
|
children: [
|
|
4079
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
4080
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
4349
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${jn(B(k.light))} }
|
|
4350
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${jn(B(k.dark))} } }` }),
|
|
4081
4351
|
/* @__PURE__ */ d("style", { children: M }),
|
|
4082
4352
|
j,
|
|
4083
4353
|
/* @__PURE__ */ d("style", { children: x }),
|
|
@@ -4097,7 +4367,7 @@ function xn({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
4097
4367
|
locale: p || "",
|
|
4098
4368
|
settings: g ?? null
|
|
4099
4369
|
},
|
|
4100
|
-
children: /* @__PURE__ */ d(
|
|
4370
|
+
children: /* @__PURE__ */ d(rn, {
|
|
4101
4371
|
initialUser: _,
|
|
4102
4372
|
children: /* @__PURE__ */ d(H.Provider, {
|
|
4103
4373
|
value: u ?? null,
|
|
@@ -4128,8 +4398,8 @@ function xn({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
4128
4398
|
}
|
|
4129
4399
|
//#endregion
|
|
4130
4400
|
//#region src/WebimContent.jsx
|
|
4131
|
-
function
|
|
4132
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
4401
|
+
function Pn({ bundle: e, mode: t = "auto", style: n }) {
|
|
4402
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(Nn, {
|
|
4133
4403
|
blocks: e.blocks,
|
|
4134
4404
|
theme: e.theme,
|
|
4135
4405
|
components: e.components,
|
|
@@ -4146,7 +4416,7 @@ function Sn({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
4146
4416
|
}
|
|
4147
4417
|
//#endregion
|
|
4148
4418
|
//#region src/bundle.js
|
|
4149
|
-
function
|
|
4419
|
+
function Fn({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
4150
4420
|
let a = {
|
|
4151
4421
|
...t?.global ?? {},
|
|
4152
4422
|
...t?.tenant ?? {}
|
|
@@ -4171,18 +4441,18 @@ function Cn({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
4171
4441
|
}
|
|
4172
4442
|
//#endregion
|
|
4173
4443
|
//#region src/fetchPage.js
|
|
4174
|
-
var
|
|
4444
|
+
var In = async (e) => {
|
|
4175
4445
|
let t = await e.json().catch(() => null);
|
|
4176
4446
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
4177
4447
|
return t?.payload ?? t;
|
|
4178
4448
|
};
|
|
4179
|
-
async function
|
|
4449
|
+
async function Ln({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
4180
4450
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
4181
4451
|
if (!n) throw Error("fetchPage: slug is required");
|
|
4182
4452
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
4183
4453
|
...t ? { "x-tenant": t } : {},
|
|
4184
4454
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
4185
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
4455
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(In), c(`${l}/settings/public`, { headers: u }).then(In)]), p = Fn({
|
|
4186
4456
|
page: d,
|
|
4187
4457
|
settings: f,
|
|
4188
4458
|
tenant: t,
|
|
@@ -4190,7 +4460,7 @@ async function Tn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
4190
4460
|
locale: r
|
|
4191
4461
|
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
|
|
4192
4462
|
if (m.length) {
|
|
4193
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
4463
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(In).then((e) => {
|
|
4194
4464
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
4195
4465
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
4196
4466
|
}).catch(() => [[t, []]])));
|
|
@@ -4204,40 +4474,40 @@ async function Tn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
4204
4474
|
}
|
|
4205
4475
|
//#endregion
|
|
4206
4476
|
//#region src/ssr.jsx
|
|
4207
|
-
var
|
|
4477
|
+
var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
4208
4478
|
"&": "&",
|
|
4209
4479
|
"<": "<",
|
|
4210
4480
|
">": ">",
|
|
4211
4481
|
"\"": """
|
|
4212
4482
|
})[e]);
|
|
4213
|
-
function
|
|
4214
|
-
return e(/* @__PURE__ */ d(
|
|
4483
|
+
function Rn(t, { mode: n = "auto", style: r } = {}) {
|
|
4484
|
+
return e(/* @__PURE__ */ d(Pn, {
|
|
4215
4485
|
bundle: t,
|
|
4216
4486
|
mode: n,
|
|
4217
4487
|
style: r
|
|
4218
4488
|
}));
|
|
4219
4489
|
}
|
|
4220
|
-
function
|
|
4490
|
+
function zn(e, { mode: t = "auto", lang: n } = {}) {
|
|
4221
4491
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
4222
4492
|
"<meta charset=\"utf-8\"/>",
|
|
4223
4493
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
4224
|
-
`<title>${
|
|
4225
|
-
r.description && `<meta name="description" content="${
|
|
4226
|
-
`<meta property="og:title" content="${
|
|
4227
|
-
r.image && `<meta property="og:image" content="${
|
|
4494
|
+
`<title>${$(o)}</title>`,
|
|
4495
|
+
r.description && `<meta name="description" content="${$(r.description)}"/>`,
|
|
4496
|
+
`<meta property="og:title" content="${$(o)}"/>`,
|
|
4497
|
+
r.image && `<meta property="og:image" content="${$(r.image)}"/>`,
|
|
4228
4498
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
4229
4499
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
4230
4500
|
].filter(Boolean).join("\n");
|
|
4231
4501
|
return `<!doctype html>
|
|
4232
|
-
<html lang="${
|
|
4502
|
+
<html lang="${$(i)}"${a ? ` dir="${a}"` : ""}>
|
|
4233
4503
|
<head>
|
|
4234
4504
|
${c}
|
|
4235
4505
|
</head>
|
|
4236
4506
|
<body>
|
|
4237
|
-
${
|
|
4507
|
+
${Rn(e, { mode: t })}
|
|
4238
4508
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
4239
4509
|
</body>
|
|
4240
4510
|
</html>`;
|
|
4241
4511
|
}
|
|
4242
4512
|
//#endregion
|
|
4243
|
-
export {
|
|
4513
|
+
export { Fn as assembleBundle, Ln as fetchPage, Rn as renderBundleHtml, zn as renderPageDocument };
|