webim-adapter 0.19.0 → 0.20.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 +364 -125
- package/build/webim-embed.js +3 -2
- package/build/webim-ssr.js +336 -97
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -1941,7 +1941,7 @@ function st({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1941
1941
|
display: A === "success" ? "none" : "flex"
|
|
1942
1942
|
},
|
|
1943
1943
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
1944
|
-
P && /* @__PURE__ */ d(
|
|
1944
|
+
P && /* @__PURE__ */ d(Ot, {
|
|
1945
1945
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1946
1946
|
active: F + 1,
|
|
1947
1947
|
style: { marginBottom: 8 }
|
|
@@ -2526,7 +2526,243 @@ function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2526
2526
|
]
|
|
2527
2527
|
});
|
|
2528
2528
|
}
|
|
2529
|
-
|
|
2529
|
+
var St = "webim.page_mode", Ct = () => {
|
|
2530
|
+
if (typeof window > "u") return "auto";
|
|
2531
|
+
try {
|
|
2532
|
+
let e = window.localStorage.getItem(St);
|
|
2533
|
+
return e === "light" || e === "dark" ? e : "auto";
|
|
2534
|
+
} catch {
|
|
2535
|
+
return "auto";
|
|
2536
|
+
}
|
|
2537
|
+
}, wt = (e) => {
|
|
2538
|
+
let t = {
|
|
2539
|
+
width: 16,
|
|
2540
|
+
height: 16,
|
|
2541
|
+
viewBox: "0 0 24 24",
|
|
2542
|
+
fill: "none",
|
|
2543
|
+
stroke: "currentColor",
|
|
2544
|
+
strokeWidth: 2,
|
|
2545
|
+
strokeLinecap: "round",
|
|
2546
|
+
strokeLinejoin: "round",
|
|
2547
|
+
"aria-hidden": !0
|
|
2548
|
+
};
|
|
2549
|
+
return e === "light" ? /* @__PURE__ */ f("svg", {
|
|
2550
|
+
...t,
|
|
2551
|
+
children: [/* @__PURE__ */ d("circle", {
|
|
2552
|
+
cx: "12",
|
|
2553
|
+
cy: "12",
|
|
2554
|
+
r: "4"
|
|
2555
|
+
}), /* @__PURE__ */ d("path", { d: "M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" })]
|
|
2556
|
+
}) : e === "dark" ? /* @__PURE__ */ d("svg", {
|
|
2557
|
+
...t,
|
|
2558
|
+
children: /* @__PURE__ */ d("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
|
|
2559
|
+
}) : /* @__PURE__ */ f("svg", {
|
|
2560
|
+
...t,
|
|
2561
|
+
children: [/* @__PURE__ */ d("rect", {
|
|
2562
|
+
x: "2",
|
|
2563
|
+
y: "3",
|
|
2564
|
+
width: "20",
|
|
2565
|
+
height: "14",
|
|
2566
|
+
rx: "2"
|
|
2567
|
+
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
2568
|
+
});
|
|
2569
|
+
}, $ = {
|
|
2570
|
+
light: "Light theme",
|
|
2571
|
+
dark: "Dark theme",
|
|
2572
|
+
auto: "Follow the device theme"
|
|
2573
|
+
};
|
|
2574
|
+
function Tt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
2575
|
+
let [o, s] = l(i ? "auto" : Ct), u = c(null), f = (e) => {
|
|
2576
|
+
u.current = e, typeof r == "function" && r(e);
|
|
2577
|
+
};
|
|
2578
|
+
a(() => {
|
|
2579
|
+
if (i) return;
|
|
2580
|
+
let e = u.current?.closest?.(".webim-page");
|
|
2581
|
+
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
2582
|
+
try {
|
|
2583
|
+
o === "auto" ? window.localStorage.removeItem(St) : window.localStorage.setItem(St, o);
|
|
2584
|
+
} catch {}
|
|
2585
|
+
}, [o, i]);
|
|
2586
|
+
let p = t === !1 ? ["light", "dark"] : [
|
|
2587
|
+
"light",
|
|
2588
|
+
"dark",
|
|
2589
|
+
"auto"
|
|
2590
|
+
], m = p.includes(o) ? o : p[0], h = {
|
|
2591
|
+
appearance: "none",
|
|
2592
|
+
border: 0,
|
|
2593
|
+
margin: 0,
|
|
2594
|
+
display: "inline-flex",
|
|
2595
|
+
alignItems: "center",
|
|
2596
|
+
justifyContent: "center",
|
|
2597
|
+
background: "transparent",
|
|
2598
|
+
color: "inherit",
|
|
2599
|
+
font: "inherit",
|
|
2600
|
+
cursor: i ? "default" : "pointer",
|
|
2601
|
+
borderRadius: 999
|
|
2602
|
+
};
|
|
2603
|
+
if (e === "buttons") return /* @__PURE__ */ d("div", {
|
|
2604
|
+
ref: f,
|
|
2605
|
+
role: "group",
|
|
2606
|
+
"aria-label": "Theme",
|
|
2607
|
+
style: {
|
|
2608
|
+
display: "inline-flex",
|
|
2609
|
+
alignItems: "center",
|
|
2610
|
+
gap: 2,
|
|
2611
|
+
padding: 3,
|
|
2612
|
+
borderRadius: 999,
|
|
2613
|
+
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2614
|
+
...C(n)
|
|
2615
|
+
},
|
|
2616
|
+
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
2617
|
+
type: "button",
|
|
2618
|
+
title: $[e],
|
|
2619
|
+
"aria-label": $[e],
|
|
2620
|
+
"aria-pressed": e === m,
|
|
2621
|
+
onClick: i ? void 0 : () => s(e),
|
|
2622
|
+
style: {
|
|
2623
|
+
...h,
|
|
2624
|
+
width: 28,
|
|
2625
|
+
height: 28,
|
|
2626
|
+
color: e === m ? "var(--page-accent-text, #ffffff)" : "inherit",
|
|
2627
|
+
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
2628
|
+
opacity: e === m ? 1 : .7
|
|
2629
|
+
},
|
|
2630
|
+
children: wt(e)
|
|
2631
|
+
}, e))
|
|
2632
|
+
});
|
|
2633
|
+
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
2634
|
+
return /* @__PURE__ */ d("button", {
|
|
2635
|
+
ref: f,
|
|
2636
|
+
type: "button",
|
|
2637
|
+
title: $[m],
|
|
2638
|
+
"aria-label": `Theme: ${$[m]} — switch to ${$[g]}`,
|
|
2639
|
+
onClick: i ? void 0 : () => s(g),
|
|
2640
|
+
style: {
|
|
2641
|
+
...h,
|
|
2642
|
+
width: 36,
|
|
2643
|
+
height: 36,
|
|
2644
|
+
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2645
|
+
...C(n)
|
|
2646
|
+
},
|
|
2647
|
+
children: wt(m)
|
|
2648
|
+
});
|
|
2649
|
+
}
|
|
2650
|
+
var Et = {
|
|
2651
|
+
facebook: {
|
|
2652
|
+
label: "Facebook",
|
|
2653
|
+
color: "#1877f2",
|
|
2654
|
+
d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
|
|
2655
|
+
},
|
|
2656
|
+
instagram: {
|
|
2657
|
+
label: "Instagram",
|
|
2658
|
+
color: "#e4405f",
|
|
2659
|
+
d: "M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06zm0 5.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"
|
|
2660
|
+
},
|
|
2661
|
+
x: {
|
|
2662
|
+
label: "X (Twitter)",
|
|
2663
|
+
color: "#000000",
|
|
2664
|
+
d: "M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"
|
|
2665
|
+
},
|
|
2666
|
+
linkedin: {
|
|
2667
|
+
label: "LinkedIn",
|
|
2668
|
+
color: "#0a66c2",
|
|
2669
|
+
d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"
|
|
2670
|
+
},
|
|
2671
|
+
youtube: {
|
|
2672
|
+
label: "YouTube",
|
|
2673
|
+
color: "#ff0000",
|
|
2674
|
+
d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
|
|
2675
|
+
},
|
|
2676
|
+
tiktok: {
|
|
2677
|
+
label: "TikTok",
|
|
2678
|
+
color: "#000000",
|
|
2679
|
+
d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"
|
|
2680
|
+
},
|
|
2681
|
+
whatsapp: {
|
|
2682
|
+
label: "WhatsApp",
|
|
2683
|
+
color: "#25d366",
|
|
2684
|
+
d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"
|
|
2685
|
+
},
|
|
2686
|
+
telegram: {
|
|
2687
|
+
label: "Telegram",
|
|
2688
|
+
color: "#26a5e4",
|
|
2689
|
+
d: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"
|
|
2690
|
+
},
|
|
2691
|
+
pinterest: {
|
|
2692
|
+
label: "Pinterest",
|
|
2693
|
+
color: "#bd081c",
|
|
2694
|
+
d: "M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.03-.655 2.569-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z"
|
|
2695
|
+
},
|
|
2696
|
+
github: {
|
|
2697
|
+
label: "GitHub",
|
|
2698
|
+
color: "#181717",
|
|
2699
|
+
d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
|
|
2700
|
+
},
|
|
2701
|
+
discord: {
|
|
2702
|
+
label: "Discord",
|
|
2703
|
+
color: "#5865f2",
|
|
2704
|
+
d: "M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.058a.082.082 0 00.031.056 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.873-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.009c.12.099.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"
|
|
2705
|
+
},
|
|
2706
|
+
email: {
|
|
2707
|
+
label: "E-mail",
|
|
2708
|
+
color: "#64748b",
|
|
2709
|
+
d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"
|
|
2710
|
+
},
|
|
2711
|
+
website: {
|
|
2712
|
+
label: "Website",
|
|
2713
|
+
color: "#64748b",
|
|
2714
|
+
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"
|
|
2715
|
+
}
|
|
2716
|
+
};
|
|
2717
|
+
function Dt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
2718
|
+
let l = Array.isArray(e) ? e.filter((e) => e && Et[e.network]) : [];
|
|
2719
|
+
if (!l.length) return null;
|
|
2720
|
+
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;
|
|
2721
|
+
return /* @__PURE__ */ d("div", {
|
|
2722
|
+
ref: s,
|
|
2723
|
+
style: {
|
|
2724
|
+
display: "flex",
|
|
2725
|
+
flexWrap: "wrap",
|
|
2726
|
+
alignItems: "center",
|
|
2727
|
+
gap: p,
|
|
2728
|
+
...C(o)
|
|
2729
|
+
},
|
|
2730
|
+
children: l.map((e, r) => {
|
|
2731
|
+
let i = Et[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);
|
|
2732
|
+
return /* @__PURE__ */ d("a", {
|
|
2733
|
+
href: e.url || "#",
|
|
2734
|
+
onClick: h,
|
|
2735
|
+
"aria-label": e.label || i.label,
|
|
2736
|
+
title: e.label || i.label,
|
|
2737
|
+
...a !== !1 && !c ? {
|
|
2738
|
+
target: "_blank",
|
|
2739
|
+
rel: "noopener noreferrer"
|
|
2740
|
+
} : {},
|
|
2741
|
+
style: {
|
|
2742
|
+
display: "inline-flex",
|
|
2743
|
+
alignItems: "center",
|
|
2744
|
+
justifyContent: "center",
|
|
2745
|
+
width: t === "plain" ? u : f,
|
|
2746
|
+
height: t === "plain" ? u : f,
|
|
2747
|
+
borderRadius: "50%",
|
|
2748
|
+
background: o ? m(i) : "transparent",
|
|
2749
|
+
border: t === "outline" ? `1px solid ${m(i)}` : "none",
|
|
2750
|
+
color: "inherit",
|
|
2751
|
+
textDecoration: "none"
|
|
2752
|
+
},
|
|
2753
|
+
children: /* @__PURE__ */ d("svg", {
|
|
2754
|
+
width: u,
|
|
2755
|
+
height: u,
|
|
2756
|
+
viewBox: "0 0 24 24",
|
|
2757
|
+
fill: s,
|
|
2758
|
+
"aria-hidden": !0,
|
|
2759
|
+
children: /* @__PURE__ */ d("path", { d: i.d })
|
|
2760
|
+
})
|
|
2761
|
+
}, `${e.network}-${r}`);
|
|
2762
|
+
})
|
|
2763
|
+
});
|
|
2764
|
+
}
|
|
2765
|
+
function Ot({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2530
2766
|
if (!e.length) return null;
|
|
2531
2767
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
2532
2768
|
width: 32,
|
|
@@ -2604,7 +2840,7 @@ function St({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2604
2840
|
})
|
|
2605
2841
|
});
|
|
2606
2842
|
}
|
|
2607
|
-
var
|
|
2843
|
+
var kt = {
|
|
2608
2844
|
small: {
|
|
2609
2845
|
w: 132,
|
|
2610
2846
|
h: 46,
|
|
@@ -2626,10 +2862,10 @@ var Ct = {
|
|
|
2626
2862
|
title: 12.5,
|
|
2627
2863
|
avatar: 46
|
|
2628
2864
|
}
|
|
2629
|
-
},
|
|
2630
|
-
|
|
2631
|
-
function
|
|
2632
|
-
let r =
|
|
2865
|
+
}, At = (e) => kt[e] ?? kt.medium;
|
|
2866
|
+
kt.medium.w, kt.medium.h;
|
|
2867
|
+
function jt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
2868
|
+
let r = At(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 = [];
|
|
2633
2869
|
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);
|
|
2634
2870
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
2635
2871
|
if (t.has(e.id)) return 0;
|
|
@@ -2681,18 +2917,18 @@ function Tt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
2681
2917
|
horizontal: n
|
|
2682
2918
|
};
|
|
2683
2919
|
}
|
|
2684
|
-
var
|
|
2920
|
+
var Mt = (e, t) => {
|
|
2685
2921
|
let n = String(e ?? "");
|
|
2686
2922
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
2687
|
-
},
|
|
2923
|
+
}, Nt = (e) => {
|
|
2688
2924
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
2689
2925
|
if (!t) return "#ffffff";
|
|
2690
2926
|
let n = t[1];
|
|
2691
2927
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
2692
2928
|
let r = parseInt(n, 16);
|
|
2693
2929
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2694
|
-
},
|
|
2695
|
-
function
|
|
2930
|
+
}, Pt = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2931
|
+
function Ft(e, t = {}) {
|
|
2696
2932
|
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);
|
|
2697
2933
|
return n.map((e) => {
|
|
2698
2934
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -2707,11 +2943,11 @@ function kt(e, t = {}) {
|
|
|
2707
2943
|
};
|
|
2708
2944
|
});
|
|
2709
2945
|
}
|
|
2710
|
-
var
|
|
2946
|
+
var It = {
|
|
2711
2947
|
size: 36,
|
|
2712
2948
|
pad: 10
|
|
2713
2949
|
};
|
|
2714
|
-
function
|
|
2950
|
+
function Lt({ node: e, onClose: t }) {
|
|
2715
2951
|
return a(() => {
|
|
2716
2952
|
let e = (e) => e.key === "Escape" && t();
|
|
2717
2953
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -2829,7 +3065,7 @@ function jt({ node: e, onClose: t }) {
|
|
|
2829
3065
|
})
|
|
2830
3066
|
});
|
|
2831
3067
|
}
|
|
2832
|
-
function
|
|
3068
|
+
function Rt({ 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 }) {
|
|
2833
3069
|
let b = o(), [x, S] = l(null), { tenant: w, apiUrl: T } = i(H), E = i(U)?.[t], [D, O] = l(null);
|
|
2834
3070
|
a(() => {
|
|
2835
3071
|
if (!t || E) return;
|
|
@@ -2846,14 +3082,14 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2846
3082
|
T,
|
|
2847
3083
|
E
|
|
2848
3084
|
]);
|
|
2849
|
-
let k = t ?
|
|
3085
|
+
let k = t ? Ft(E ?? D ?? [], {
|
|
2850
3086
|
nameField: n,
|
|
2851
3087
|
titleField: r,
|
|
2852
3088
|
photoField: s,
|
|
2853
3089
|
parentField: c,
|
|
2854
3090
|
cvField: p,
|
|
2855
3091
|
hrefField: m
|
|
2856
|
-
}) : e, A =
|
|
3092
|
+
}) : e, A = At(h), { boxes: j, links: M, width: N, height: P } = jt(k, {
|
|
2857
3093
|
size: h,
|
|
2858
3094
|
horizontal: g
|
|
2859
3095
|
});
|
|
@@ -2899,7 +3135,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2899
3135
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
2900
3136
|
strokeWidth: "1.5"
|
|
2901
3137
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
2902
|
-
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 ?
|
|
3138
|
+
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 ? Nt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Nt(e.color2) : s, l = y && (Pt(e) || e.href), p = () => Pt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + It.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);
|
|
2903
3139
|
return /* @__PURE__ */ f("g", {
|
|
2904
3140
|
onClick: l ? p : void 0,
|
|
2905
3141
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -2963,13 +3199,13 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2963
3199
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
2964
3200
|
id: `${b}-${e.id}`,
|
|
2965
3201
|
children: /* @__PURE__ */ d("circle", {
|
|
2966
|
-
cx: t +
|
|
3202
|
+
cx: t + It.pad + A.avatar / 2,
|
|
2967
3203
|
cy: n + A.h / 2,
|
|
2968
3204
|
r: A.avatar / 2
|
|
2969
3205
|
})
|
|
2970
3206
|
}), /* @__PURE__ */ d("image", {
|
|
2971
3207
|
href: e.photo,
|
|
2972
|
-
x: t +
|
|
3208
|
+
x: t + It.pad,
|
|
2973
3209
|
y: n + (A.h - A.avatar) / 2,
|
|
2974
3210
|
width: A.avatar,
|
|
2975
3211
|
height: A.avatar,
|
|
@@ -2983,7 +3219,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2983
3219
|
fontSize: A.title,
|
|
2984
3220
|
fontWeight: "600",
|
|
2985
3221
|
fill: s,
|
|
2986
|
-
children:
|
|
3222
|
+
children: Mt(e.title, g + 4)
|
|
2987
3223
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
2988
3224
|
x: m,
|
|
2989
3225
|
y: n + _ + _ / 2 + A.name * .35,
|
|
@@ -2991,7 +3227,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2991
3227
|
fontSize: A.name,
|
|
2992
3228
|
fontWeight: "600",
|
|
2993
3229
|
fill: c,
|
|
2994
|
-
children:
|
|
3230
|
+
children: Mt(e.name, g)
|
|
2995
3231
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
2996
3232
|
x: m,
|
|
2997
3233
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
@@ -2999,7 +3235,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2999
3235
|
fontSize: A.name,
|
|
3000
3236
|
fontWeight: "600",
|
|
3001
3237
|
fill: s,
|
|
3002
|
-
children:
|
|
3238
|
+
children: Mt(v[0], g)
|
|
3003
3239
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
3004
3240
|
x: m,
|
|
3005
3241
|
y: n + A.h * .73,
|
|
@@ -3007,18 +3243,18 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3007
3243
|
fontSize: A.title,
|
|
3008
3244
|
opacity: "0.7",
|
|
3009
3245
|
fill: s,
|
|
3010
|
-
children:
|
|
3246
|
+
children: Mt(v[1], g + 4)
|
|
3011
3247
|
})] })
|
|
3012
3248
|
]
|
|
3013
3249
|
}, e.id);
|
|
3014
3250
|
})]
|
|
3015
|
-
}), x && /* @__PURE__ */ d(
|
|
3251
|
+
}), x && /* @__PURE__ */ d(Lt, {
|
|
3016
3252
|
node: x,
|
|
3017
3253
|
onClose: () => S(null)
|
|
3018
3254
|
})]
|
|
3019
3255
|
});
|
|
3020
3256
|
}
|
|
3021
|
-
function
|
|
3257
|
+
function zt({ 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 }) {
|
|
3022
3258
|
let { tenant: g, apiUrl: _ } = i(H), v = i(U), y = v?.[n], b = u ? W(v) : 1, [x, S] = l(null);
|
|
3023
3259
|
if (a(() => {
|
|
3024
3260
|
if (!n || y) return;
|
|
@@ -3084,7 +3320,7 @@ function Nt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
3084
3320
|
})
|
|
3085
3321
|
});
|
|
3086
3322
|
}
|
|
3087
|
-
var
|
|
3323
|
+
var Bt = {
|
|
3088
3324
|
PageRoot: he,
|
|
3089
3325
|
Section: ge,
|
|
3090
3326
|
Container: _e,
|
|
@@ -3101,9 +3337,11 @@ var Pt = {
|
|
|
3101
3337
|
CollectionList: yt,
|
|
3102
3338
|
BreadcrumbsBlock: bt,
|
|
3103
3339
|
PaginationBlock: xt,
|
|
3104
|
-
StepperBlock:
|
|
3105
|
-
|
|
3106
|
-
|
|
3340
|
+
StepperBlock: Ot,
|
|
3341
|
+
SocialLinksBlock: Dt,
|
|
3342
|
+
ThemeModeBlock: Tt,
|
|
3343
|
+
OrgChartBlock: Rt,
|
|
3344
|
+
TableBlock: zt,
|
|
3107
3345
|
MasonryBlock: Je,
|
|
3108
3346
|
AccordionBlock: $e,
|
|
3109
3347
|
NavbarBlock: Ze,
|
|
@@ -3133,26 +3371,26 @@ var Pt = {
|
|
|
3133
3371
|
FormFile: gt,
|
|
3134
3372
|
FormRecaptcha: ut,
|
|
3135
3373
|
FormSubmit: _t
|
|
3136
|
-
},
|
|
3374
|
+
}, Vt = {
|
|
3137
3375
|
id: "auth",
|
|
3138
3376
|
label: "Accounts",
|
|
3139
3377
|
category: "Apps",
|
|
3140
3378
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
3141
3379
|
ssr: "shell",
|
|
3142
3380
|
settings: ["site.authRedirect"]
|
|
3143
|
-
},
|
|
3381
|
+
}, Ht = n({
|
|
3144
3382
|
user: null,
|
|
3145
3383
|
status: "idle",
|
|
3146
3384
|
ensure: () => {},
|
|
3147
3385
|
refresh: () => {},
|
|
3148
3386
|
signOut: () => {}
|
|
3149
|
-
}),
|
|
3150
|
-
let e = i(
|
|
3387
|
+
}), Ut = () => {
|
|
3388
|
+
let e = i(Ht);
|
|
3151
3389
|
return a(() => {
|
|
3152
3390
|
e.ensure();
|
|
3153
3391
|
}, [e]), e;
|
|
3154
3392
|
};
|
|
3155
|
-
function
|
|
3393
|
+
function Wt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
|
|
3156
3394
|
let u = i(H), 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}`, {
|
|
3157
3395
|
...t,
|
|
3158
3396
|
credentials: "include",
|
|
@@ -3185,18 +3423,18 @@ function Rt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o })
|
|
|
3185
3423
|
b,
|
|
3186
3424
|
x
|
|
3187
3425
|
]);
|
|
3188
|
-
return /* @__PURE__ */ d(
|
|
3426
|
+
return /* @__PURE__ */ d(Ht.Provider, {
|
|
3189
3427
|
value: C,
|
|
3190
3428
|
children: e
|
|
3191
3429
|
});
|
|
3192
3430
|
}
|
|
3193
|
-
function
|
|
3194
|
-
let { status: n } =
|
|
3431
|
+
function Gt({ when: e, children: t }) {
|
|
3432
|
+
let { status: n } = Ut();
|
|
3195
3433
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
3196
3434
|
}
|
|
3197
3435
|
//#endregion
|
|
3198
3436
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
3199
|
-
function
|
|
3437
|
+
function Kt({ 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 }) {
|
|
3200
3438
|
let { tenant: h, apiUrl: g, settings: _ } = i(H), [v, y] = l("form"), [b, x] = l(""), [S, w] = l(!1), T = e === "register", E = u ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
3201
3439
|
if (e.preventDefault(), u) return;
|
|
3202
3440
|
let n = new FormData(e.currentTarget);
|
|
@@ -3320,8 +3558,8 @@ function Bt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3320
3558
|
]
|
|
3321
3559
|
});
|
|
3322
3560
|
}
|
|
3323
|
-
function
|
|
3324
|
-
let { user: c, status: l, signOut: u } =
|
|
3561
|
+
function qt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
3562
|
+
let { user: c, status: l, signOut: u } = Ut(), p = a ? s || "user" : l, m = a ? {
|
|
3325
3563
|
name: "Ada Lovelace",
|
|
3326
3564
|
email: "ada@example.com"
|
|
3327
3565
|
} : c;
|
|
@@ -3386,42 +3624,42 @@ function Vt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3386
3624
|
}
|
|
3387
3625
|
//#endregion
|
|
3388
3626
|
//#region ../ui/src/components/builder/apps/index.js
|
|
3389
|
-
var
|
|
3390
|
-
SiteLoginForm:
|
|
3391
|
-
SiteAccountMenu:
|
|
3627
|
+
var Jt = [Vt], Yt = {
|
|
3628
|
+
SiteLoginForm: Kt,
|
|
3629
|
+
SiteAccountMenu: qt
|
|
3392
3630
|
};
|
|
3393
|
-
new Set(
|
|
3631
|
+
new Set(Jt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
3394
3632
|
//#endregion
|
|
3395
3633
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
3396
|
-
var
|
|
3397
|
-
function
|
|
3398
|
-
if (
|
|
3634
|
+
var Xt = /* @__PURE__ */ new Map();
|
|
3635
|
+
function Zt(e) {
|
|
3636
|
+
if (Xt.has(e)) return Xt.get(e);
|
|
3399
3637
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
3400
3638
|
/* @vite-ignore */
|
|
3401
3639
|
/* webpackIgnore: true */
|
|
3402
3640
|
t
|
|
3403
3641
|
).finally(() => URL.revokeObjectURL(t));
|
|
3404
|
-
return
|
|
3642
|
+
return Xt.set(e, n), n;
|
|
3405
3643
|
}
|
|
3406
|
-
function
|
|
3644
|
+
function Qt(e) {
|
|
3407
3645
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
3408
3646
|
return n && typeof n == "object" ? n : {};
|
|
3409
3647
|
}
|
|
3410
3648
|
//#endregion
|
|
3411
3649
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
3412
|
-
async function
|
|
3413
|
-
let n = await
|
|
3650
|
+
async function $t(e, t) {
|
|
3651
|
+
let n = await Zt(e);
|
|
3414
3652
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
3415
3653
|
}
|
|
3416
|
-
var
|
|
3654
|
+
var en = {
|
|
3417
3655
|
padding: "10px 12px",
|
|
3418
3656
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
3419
3657
|
borderRadius: 8,
|
|
3420
3658
|
fontSize: 12,
|
|
3421
3659
|
opacity: .6
|
|
3422
3660
|
};
|
|
3423
|
-
function
|
|
3424
|
-
let s = i(H), l =
|
|
3661
|
+
function tn({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
3662
|
+
let s = i(H), l = Qt(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
3425
3663
|
tenant: s?.tenant ?? "",
|
|
3426
3664
|
apiUrl: s?.apiUrl ?? "/api",
|
|
3427
3665
|
locale: s?.locale ?? "",
|
|
@@ -3433,7 +3671,7 @@ function Yt({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
3433
3671
|
let e = u.current;
|
|
3434
3672
|
if (!l?.code || !e) return;
|
|
3435
3673
|
let n = !0;
|
|
3436
|
-
return
|
|
3674
|
+
return $t(l.code, t).then((e) => {
|
|
3437
3675
|
if (!(!n || !e || !u.current)) {
|
|
3438
3676
|
p.current = e;
|
|
3439
3677
|
try {
|
|
@@ -3463,7 +3701,7 @@ function Yt({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
3463
3701
|
}) : /* @__PURE__ */ f("div", {
|
|
3464
3702
|
ref: o,
|
|
3465
3703
|
style: {
|
|
3466
|
-
...
|
|
3704
|
+
...en,
|
|
3467
3705
|
...C(r)
|
|
3468
3706
|
},
|
|
3469
3707
|
children: [
|
|
@@ -3475,12 +3713,12 @@ function Yt({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
3475
3713
|
}
|
|
3476
3714
|
//#endregion
|
|
3477
3715
|
//#region ../ui/src/components/builder/render.jsx
|
|
3478
|
-
var
|
|
3479
|
-
...
|
|
3480
|
-
...
|
|
3481
|
-
PluginBlock:
|
|
3716
|
+
var nn = {
|
|
3717
|
+
...Bt,
|
|
3718
|
+
...Yt,
|
|
3719
|
+
PluginBlock: tn
|
|
3482
3720
|
};
|
|
3483
|
-
function
|
|
3721
|
+
function rn(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
3484
3722
|
let o = n[e];
|
|
3485
3723
|
if (!o || o.hidden) return null;
|
|
3486
3724
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -3488,11 +3726,11 @@ function $(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3488
3726
|
let n = o.props?.componentId, s = r?.[n];
|
|
3489
3727
|
if (!s?.template || i.has(n)) return null;
|
|
3490
3728
|
let c = new Set(i).add(n);
|
|
3491
|
-
return /* @__PURE__ */ d(t, { children:
|
|
3729
|
+
return /* @__PURE__ */ d(t, { children: rn(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
3492
3730
|
}
|
|
3493
|
-
let l =
|
|
3731
|
+
let l = nn[s];
|
|
3494
3732
|
if (!l) return null;
|
|
3495
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
3733
|
+
let u = (o.nodes ?? []).map((e) => rn(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, rn(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
3496
3734
|
...c,
|
|
3497
3735
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
3498
3736
|
linked: p,
|
|
@@ -3501,15 +3739,16 @@ function $(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3501
3739
|
},
|
|
3502
3740
|
children: u.length ? u : void 0
|
|
3503
3741
|
}, e);
|
|
3504
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
3742
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(Gt, {
|
|
3505
3743
|
when: c.when,
|
|
3506
3744
|
children: m
|
|
3507
3745
|
}, e) : m;
|
|
3508
3746
|
}
|
|
3509
3747
|
//#endregion
|
|
3510
3748
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
3511
|
-
var
|
|
3512
|
-
|
|
3749
|
+
var an = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), on = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(V(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
3750
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(V(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
3751
|
+
function sn({ 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: v }) {
|
|
3513
3752
|
let b = o?.js?.trim();
|
|
3514
3753
|
if (a(() => {
|
|
3515
3754
|
if (!b) return;
|
|
@@ -3523,19 +3762,19 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3523
3762
|
minHeight: "100%",
|
|
3524
3763
|
display: "flex",
|
|
3525
3764
|
flexDirection: "column"
|
|
3526
|
-
}, w =
|
|
3765
|
+
}, w = rn("ROOT", e, n), T = s(() => ({ render: (t, r) => rn(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = F(e, n), D = P(e, n), O = o?.css?.trim(), k = y(e, n).map((e) => /* @__PURE__ */ d("link", {
|
|
3527
3766
|
rel: "stylesheet",
|
|
3528
3767
|
precedence: "default",
|
|
3529
3768
|
href: _(e)
|
|
3530
|
-
}, e));
|
|
3531
|
-
|
|
3769
|
+
}, e)), A = B(t), j = on(A);
|
|
3770
|
+
return r === "auto" ? /* @__PURE__ */ d(H.Provider, {
|
|
3532
3771
|
value: {
|
|
3533
3772
|
tenant: c || "",
|
|
3534
3773
|
apiUrl: l || "/api",
|
|
3535
3774
|
locale: p || "",
|
|
3536
3775
|
settings: g ?? null
|
|
3537
3776
|
},
|
|
3538
|
-
children: /* @__PURE__ */ d(
|
|
3777
|
+
children: /* @__PURE__ */ d(Wt, {
|
|
3539
3778
|
initialUser: v,
|
|
3540
3779
|
children: /* @__PURE__ */ d(U.Provider, {
|
|
3541
3780
|
value: u ?? null,
|
|
@@ -3546,10 +3785,13 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3546
3785
|
className: "webim-page",
|
|
3547
3786
|
style: {
|
|
3548
3787
|
...C,
|
|
3549
|
-
...
|
|
3788
|
+
...ne(t),
|
|
3550
3789
|
...i
|
|
3551
3790
|
},
|
|
3552
3791
|
children: [
|
|
3792
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${an(V(A.light))} }
|
|
3793
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${an(V(A.dark))} } }` }),
|
|
3794
|
+
/* @__PURE__ */ d("style", { children: j }),
|
|
3553
3795
|
k,
|
|
3554
3796
|
/* @__PURE__ */ d("style", { children: S }),
|
|
3555
3797
|
E && /* @__PURE__ */ d("style", { children: E }),
|
|
@@ -3561,16 +3803,14 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3561
3803
|
})
|
|
3562
3804
|
})
|
|
3563
3805
|
})
|
|
3564
|
-
})
|
|
3565
|
-
let A = B(t);
|
|
3566
|
-
return /* @__PURE__ */ d(H.Provider, {
|
|
3806
|
+
}) : /* @__PURE__ */ d(H.Provider, {
|
|
3567
3807
|
value: {
|
|
3568
3808
|
tenant: c || "",
|
|
3569
3809
|
apiUrl: l || "/api",
|
|
3570
3810
|
locale: p || "",
|
|
3571
3811
|
settings: g ?? null
|
|
3572
3812
|
},
|
|
3573
|
-
children: /* @__PURE__ */ d(
|
|
3813
|
+
children: /* @__PURE__ */ d(Wt, {
|
|
3574
3814
|
initialUser: v,
|
|
3575
3815
|
children: /* @__PURE__ */ d(U.Provider, {
|
|
3576
3816
|
value: u ?? null,
|
|
@@ -3581,13 +3821,12 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3581
3821
|
className: "webim-page",
|
|
3582
3822
|
style: {
|
|
3583
3823
|
...C,
|
|
3584
|
-
...
|
|
3824
|
+
...re(t, r),
|
|
3585
3825
|
...i
|
|
3586
3826
|
},
|
|
3587
3827
|
children: [
|
|
3588
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${Zt(V(A.light))} }
|
|
3589
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${Zt(V(A.dark))} } }` }),
|
|
3590
3828
|
k,
|
|
3829
|
+
/* @__PURE__ */ d("style", { children: j }),
|
|
3591
3830
|
/* @__PURE__ */ d("style", { children: S }),
|
|
3592
3831
|
E && /* @__PURE__ */ d("style", { children: E }),
|
|
3593
3832
|
D && /* @__PURE__ */ d("style", { children: D }),
|
|
@@ -3602,8 +3841,8 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3602
3841
|
}
|
|
3603
3842
|
//#endregion
|
|
3604
3843
|
//#region src/WebimContent.jsx
|
|
3605
|
-
function
|
|
3606
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
3844
|
+
function cn({ bundle: e, mode: t = "auto", style: n }) {
|
|
3845
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(sn, {
|
|
3607
3846
|
blocks: e.blocks,
|
|
3608
3847
|
theme: e.theme,
|
|
3609
3848
|
components: e.components,
|
|
@@ -3620,7 +3859,7 @@ function $t({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
3620
3859
|
}
|
|
3621
3860
|
//#endregion
|
|
3622
3861
|
//#region src/bundle.js
|
|
3623
|
-
function
|
|
3862
|
+
function ln({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
3624
3863
|
let a = {
|
|
3625
3864
|
...t?.global ?? {},
|
|
3626
3865
|
...t?.tenant ?? {}
|
|
@@ -3644,18 +3883,18 @@ function en({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
3644
3883
|
}
|
|
3645
3884
|
//#endregion
|
|
3646
3885
|
//#region src/fetchPage.js
|
|
3647
|
-
var
|
|
3886
|
+
var un = async (e) => {
|
|
3648
3887
|
let t = await e.json().catch(() => null);
|
|
3649
3888
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
3650
3889
|
return t?.payload ?? t;
|
|
3651
3890
|
};
|
|
3652
|
-
async function
|
|
3891
|
+
async function dn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
3653
3892
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
3654
3893
|
if (!n) throw Error("fetchPage: slug is required");
|
|
3655
3894
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
3656
3895
|
...t ? { "x-tenant": t } : {},
|
|
3657
3896
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
3658
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
3897
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(un), c(`${l}/settings/public`, { headers: u }).then(un)]), p = ln({
|
|
3659
3898
|
page: d,
|
|
3660
3899
|
settings: f,
|
|
3661
3900
|
tenant: t,
|
|
@@ -3663,7 +3902,7 @@ async function nn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
3663
3902
|
locale: r
|
|
3664
3903
|
}), 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))];
|
|
3665
3904
|
if (m.length) {
|
|
3666
|
-
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(
|
|
3905
|
+
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(un).then((e) => {
|
|
3667
3906
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
3668
3907
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
3669
3908
|
}).catch(() => [[t, []]])));
|
|
@@ -3677,40 +3916,40 @@ async function nn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
3677
3916
|
}
|
|
3678
3917
|
//#endregion
|
|
3679
3918
|
//#region src/ssr.jsx
|
|
3680
|
-
var
|
|
3919
|
+
var fn = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
3681
3920
|
"&": "&",
|
|
3682
3921
|
"<": "<",
|
|
3683
3922
|
">": ">",
|
|
3684
3923
|
"\"": """
|
|
3685
3924
|
})[e]);
|
|
3686
|
-
function
|
|
3687
|
-
return e(/* @__PURE__ */ d(
|
|
3925
|
+
function pn(t, { mode: n = "auto", style: r } = {}) {
|
|
3926
|
+
return e(/* @__PURE__ */ d(cn, {
|
|
3688
3927
|
bundle: t,
|
|
3689
3928
|
mode: n,
|
|
3690
3929
|
style: r
|
|
3691
3930
|
}));
|
|
3692
3931
|
}
|
|
3693
|
-
function
|
|
3932
|
+
function mn(e, { mode: t = "auto", lang: n } = {}) {
|
|
3694
3933
|
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 = [
|
|
3695
3934
|
"<meta charset=\"utf-8\"/>",
|
|
3696
3935
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
3697
|
-
`<title>${
|
|
3698
|
-
r.description && `<meta name="description" content="${
|
|
3699
|
-
`<meta property="og:title" content="${
|
|
3700
|
-
r.image && `<meta property="og:image" content="${
|
|
3936
|
+
`<title>${fn(o)}</title>`,
|
|
3937
|
+
r.description && `<meta name="description" content="${fn(r.description)}"/>`,
|
|
3938
|
+
`<meta property="og:title" content="${fn(o)}"/>`,
|
|
3939
|
+
r.image && `<meta property="og:image" content="${fn(r.image)}"/>`,
|
|
3701
3940
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
3702
3941
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
3703
3942
|
].filter(Boolean).join("\n");
|
|
3704
3943
|
return `<!doctype html>
|
|
3705
|
-
<html lang="${
|
|
3944
|
+
<html lang="${fn(i)}"${a ? ` dir="${a}"` : ""}>
|
|
3706
3945
|
<head>
|
|
3707
3946
|
${c}
|
|
3708
3947
|
</head>
|
|
3709
3948
|
<body>
|
|
3710
|
-
${
|
|
3949
|
+
${pn(e, { mode: t })}
|
|
3711
3950
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
3712
3951
|
</body>
|
|
3713
3952
|
</html>`;
|
|
3714
3953
|
}
|
|
3715
3954
|
//#endregion
|
|
3716
|
-
export {
|
|
3955
|
+
export { ln as assembleBundle, dn as fetchPage, pn as renderBundleHtml, mn as renderPageDocument };
|