@levo-so/site-runtime 0.3.1 → 0.3.8

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.
Files changed (45) hide show
  1. package/CollectionField-C-6a1ud4.js +270 -0
  2. package/{CollectionInput-B1qV4QEH.js → CollectionInput-BJ__qcbk.js} +40 -40
  3. package/DateTimeWidget-hFjcn3o6.js +255 -0
  4. package/Dialog-dT7y641z.js +130 -0
  5. package/KBChatWidget-ClHFDgJ5.js +1026 -0
  6. package/LevoProvider-Bsjkcwc8.js +20 -0
  7. package/PhoneWidget-BmBO-kvA.js +99 -0
  8. package/{Popover-q5dL7y0W.js → Popover-3N88sRp4.js} +20 -20
  9. package/{PopupRenderer-Bncp54gB-DuCULkBK.js → PopupBody-DZVwDLkg-Cfy3lWGs.js} +201 -910
  10. package/PopupRenderer-BjW1jg70-W2y-PEPH.js +387 -0
  11. package/{RichTextWidget-D-mGlES0.js → RichTextWidget-DkKHEq4j.js} +142 -141
  12. package/ThemeProvider-DutrjSTF.js +116 -0
  13. package/{Tooltip-BIgrpetu.js → Tooltip-CQB0LyxK.js} +20 -20
  14. package/VerifyButton-BUT70lgz.js +192 -0
  15. package/{theme.cssm-2YTdd8Yh.js → createThemeExtension-4AUn51iJ.js} +2 -2
  16. package/dist-CRDgdAkQ.js +3631 -0
  17. package/dist-DPmVG7VB.js +79 -0
  18. package/index.d.ts +575 -3
  19. package/index.js +1217 -722
  20. package/inlineBaseTheme-BB9e6h5f.js +9 -0
  21. package/inlineCollectionTheme-CWcMCUti.js +19 -0
  22. package/{kbChat-AUJxjURc.js → kbChat-C00LVlxP.js} +53 -48
  23. package/{nodeAlignment-Cn6xNtOP.js → nodeAlignment-BnJljFlw.js} +13 -13
  24. package/package.json +9 -9
  25. package/pillChrome-BAu5AfCT.js +30 -0
  26. package/popupState-JmpeKzgM-qhNTV79U.js +229 -0
  27. package/popups.js +1 -1
  28. package/react-CV3jf2mc.js +74 -0
  29. package/rteTheme.cssm-xg0gJ28J.js +4 -0
  30. package/styles.css +1 -1
  31. package/theme.cssm-DUzmx76l.js +4 -0
  32. package/{inlineCollectionTheme-D2w17LHX.js → themeVars.cssm-ByhhC2Jm.js} +18 -33
  33. package/usePopupRedirect-BThP_YPW-COUseDik.js +80 -0
  34. package/CollectionField-CzS-34zx.js +0 -270
  35. package/DateTimeWidget-C1jHOtz7.js +0 -255
  36. package/Dialog-CzVhHLEY.js +0 -145
  37. package/KBChatWidget-D7F9LRwI.js +0 -1078
  38. package/PhoneWidget-_nw97rkI.js +0 -99
  39. package/ThemeProvider-BQmIB5tr.js +0 -116
  40. package/VerifyButton-BkP98H17.js +0 -191
  41. package/dist-CJknSbJK.js +0 -80
  42. package/dist-DBbiX2ST.js +0 -3556
  43. package/inlineBaseTheme-DS-AfUHi.js +0 -9
  44. package/pillChrome-AhXOWXIb.js +0 -20
  45. /package/{es-iCqKQf1c.js → es-CztjLuNy.js} +0 -0
@@ -0,0 +1,79 @@
1
+ import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
+ import { t } from "./LevoProvider-Bsjkcwc8.js";
3
+ import { a as n, c as r, i, l as a, o, t as s, u as c } from "./popupState-JmpeKzgM-qhNTV79U.js";
4
+ import { t as l } from "./react-CV3jf2mc.js";
5
+ import { c as u } from "react/compiler-runtime";
6
+ import { jsx as d } from "react/jsx-runtime";
7
+ import { Suspense as f, lazy as p, useEffect as m, useRef as h, useState as g } from "react";
8
+ import { $isIdentityContextReady as _ } from "@levo-so/insights/stores";
9
+ //#region ../../libraries/popups/dist/index.js
10
+ var v = /* @__PURE__ */ e({
11
+ PopupLoader: () => x,
12
+ fetchActivePopups: () => y,
13
+ usePopup: () => C
14
+ }), y = async (e, t) => {
15
+ let n = {};
16
+ return t?.site_id && (n.site_id = t.site_id), t?.locale && (n.locale = t.locale), t?.country && (n.country = t.country), (await e.url("/v1/studio/popup/list-active").query(n).get().json())?.content?.data ?? [];
17
+ }, b = p(() => import("./PopupRenderer-BjW1jg70-W2y-PEPH.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), x = (e) => {
18
+ let n = u(9), { siteId: r, pageId: i } = e, { fetch: a, logger: s } = t(), [c, l] = g(null), p = h(!1), v, x;
19
+ if (n[0] !== a || n[1] !== s || n[2] !== r ? (v = () => {
20
+ if (p.current) return;
21
+ let e = () => {
22
+ p.current || (p.current = !0, y(a, r ? { site_id: r } : void 0).then((e) => {
23
+ o(e), l(e);
24
+ }).catch((e) => {
25
+ s?.error("Failed to fetch popups", { exception: e }), o([]), l([]);
26
+ }).finally(S));
27
+ };
28
+ if (_.get()) {
29
+ e();
30
+ return;
31
+ }
32
+ let t = _.listen((n) => {
33
+ n && (t(), e());
34
+ });
35
+ return () => t();
36
+ }, x = [
37
+ a,
38
+ s,
39
+ r
40
+ ], n[0] = a, n[1] = s, n[2] = r, n[3] = v, n[4] = x) : (v = n[3], x = n[4]), m(v, x), !c || c.length === 0) return null;
41
+ let C;
42
+ n[5] === Symbol.for("react.memo_cache_sentinel") ? (C = {
43
+ position: "relative",
44
+ zIndex: 99999
45
+ }, n[5] = C) : C = n[5];
46
+ let w;
47
+ return n[6] !== i || n[7] !== c ? (w = /* @__PURE__ */ d("div", {
48
+ style: C,
49
+ children: /* @__PURE__ */ d(f, { children: /* @__PURE__ */ d(b, {
50
+ popups: c,
51
+ pageId: i
52
+ }) })
53
+ }), n[6] = i, n[7] = c, n[8] = w) : w = n[8], w;
54
+ };
55
+ function S() {
56
+ return a(!1);
57
+ }
58
+ var C = () => {
59
+ let e = u(3), t = l(n), r = l(c), i = w, a = T, o;
60
+ return e[0] !== r || e[1] !== t ? (o = {
61
+ popups: t,
62
+ isLoading: r,
63
+ openPopup: i,
64
+ closePopup: a
65
+ }, e[0] = r, e[1] = t, e[2] = o) : o = e[2], o;
66
+ };
67
+ function w(e) {
68
+ let t = n.get().find((t) => t.id === e);
69
+ t && s(t, {
70
+ force: !0,
71
+ trigger_type: "manual"
72
+ });
73
+ }
74
+ function T() {
75
+ let e = i.get().active_popup_id;
76
+ e && r(e);
77
+ }
78
+ //#endregion
79
+ export { v as n, C as t };