@levo-so/site-runtime 0.3.9 → 0.3.11

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.
@@ -0,0 +1,159 @@
1
+ import { r as e } from "./ThemeProvider-DutrjSTF.js";
2
+ import { n as t } from "./LevoProvider-Bsjkcwc8.js";
3
+ import { i as n, r, t as i } from "./Dialog-dT7y641z.js";
4
+ import { t as a } from "./inlineCollectionTheme-CWcMCUti.js";
5
+ import { _ as o, a as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C } from "./react-Cj_U6VZQ.js";
6
+ import { n as w, t as T } from "./content.cssm-XdMsTGIB.js";
7
+ import { t as E } from "./inlineRteTheme-CRPtkNXy.js";
8
+ import { c as D, g as O, h as k, i as A, m as j, r as M, u as N } from "./usePopupRedirect-CAAdcpaW-Ddjyf4KK.js";
9
+ import { c as P } from "react/compiler-runtime";
10
+ import F from "clsx";
11
+ import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
12
+ import { Suspense as z, lazy as B, useMemo as V, useState as H } from "react";
13
+ import { IconCheck as U, IconCopy as W } from "@tabler/icons-react";
14
+ import { Link as G } from "@tiptap/extension-link";
15
+ import { Document as K } from "@tiptap/extension-document";
16
+ import { TextStyle as q } from "@tiptap/extension-text-style";
17
+ import { Subscript as J } from "@tiptap/extension-subscript";
18
+ import { Superscript as Y } from "@tiptap/extension-superscript";
19
+ import { Typography as X } from "@tiptap/extension-typography";
20
+ import { UniqueID as Z } from "@tiptap/extension-unique-id";
21
+ //#region ../../libraries/popups/dist/PopupBody-BI-MJqmd.js
22
+ var Q = [
23
+ K,
24
+ _,
25
+ p,
26
+ l,
27
+ d,
28
+ m,
29
+ s,
30
+ h,
31
+ f,
32
+ b,
33
+ c,
34
+ u,
35
+ y,
36
+ G.configure({ openOnClick: !1 }),
37
+ q,
38
+ o,
39
+ X,
40
+ Y,
41
+ J,
42
+ v,
43
+ S.configure({ multicolor: !0 }),
44
+ C,
45
+ w,
46
+ Z.configure({ types: [
47
+ "paragraph",
48
+ "heading",
49
+ "bulletList",
50
+ "orderedList"
51
+ ] })
52
+ ], $ = (e) => g(e, Q), ee = ({ content: e, className: t, ref: n, ...r }) => {
53
+ let i = V(() => e ? typeof e == "string" ? e ? $(e) : null : e.json && Object.keys(e.json).length > 0 ? e.json : e.html ? $(e.html) : null : null, [e]), a = V(() => i ? x({
54
+ content: i,
55
+ extensions: Q
56
+ }) : null, [i]);
57
+ return a ? /* @__PURE__ */ L("div", {
58
+ ref: n,
59
+ className: F(T, t),
60
+ ...r,
61
+ children: a
62
+ }) : null;
63
+ }, te = /* @__PURE__ */ O({ PopupBody: () => oe }), ne = B(() => import("./dist-BdNHqoWi.js").then((e) => e.t).then((e) => ({ default: e.CollectionFormBuilder }))), re = E({ baseSpacing: ".625rem" }), ie = { style: a({ form: { gap: "1rem" } }) }, ae = {
64
+ left: D,
65
+ center: M,
66
+ right: A
67
+ }, oe = (a) => {
68
+ let o = P(33), { disableInteraction: s } = a, { popup: c, callbacks: l, client: u, preview: d } = j(), f = l?.onAction, p = k(c), { content: m } = c, [h, g] = H(!1), _;
69
+ o[0] !== m.action || o[1] !== f || o[2] !== c ? (_ = () => {
70
+ if (m.action?.type !== "redirect" || !m.action.copyValue) return;
71
+ let e = m.action.copyValue;
72
+ navigator.clipboard.writeText(e).then(() => {
73
+ g(!0), setTimeout(() => g(!1), 2e3), f?.(c, {
74
+ action_type: "copy",
75
+ copy_value: e
76
+ });
77
+ });
78
+ }, o[0] = m.action, o[1] = f, o[2] = c, o[3] = _) : _ = o[3];
79
+ let v = _, y = m.align ?? "left", b = m.size ?? "medium", x;
80
+ o[4] === b ? x = o[5] : (x = N({ size: b }), o[4] = b, o[5] = x);
81
+ let S;
82
+ o[6] === s ? S = o[7] : (S = s ? { pointerEvents: "none" } : void 0, o[6] = s, o[7] = S);
83
+ let C;
84
+ o[8] !== y || o[9] !== m.description || o[10] !== m.heading ? (C = (m.heading || m.description) && /* @__PURE__ */ R(i, {
85
+ className: "zv6sjd4",
86
+ style: { textAlign: y },
87
+ children: [m.heading && /* @__PURE__ */ L(n, { children: m.heading }), m.description && /* @__PURE__ */ L(r, { children: m.description })]
88
+ }), o[8] = y, o[9] = m.description, o[10] = m.heading, o[11] = C) : C = o[11];
89
+ let w;
90
+ o[12] === m.body ? w = o[13] : (w = (m.body?.html || m.body?.json) && /* @__PURE__ */ L(ee, {
91
+ className: "zv6sjd5",
92
+ style: re,
93
+ content: m.body
94
+ }), o[12] = m.body, o[13] = w);
95
+ let T;
96
+ o[14] !== y || o[15] !== u || o[16] !== m.action || o[17] !== f || o[18] !== c || o[19] !== d ? (T = m.action?.type === "form" && u && /* @__PURE__ */ L("div", {
97
+ className: "zv6sjd7",
98
+ children: /* @__PURE__ */ L(z, { children: /* @__PURE__ */ L(t, {
99
+ client: u,
100
+ children: /* @__PURE__ */ L(ne, {
101
+ collection_id: m.action.collectionKey,
102
+ formVariant: m.action.formVariant,
103
+ theme: ie,
104
+ uiConfig: {
105
+ hideFormHeading: !0,
106
+ hideSectionHeadings: !0
107
+ },
108
+ successConfig: m.action.successRedirectUrl ? { action: {
109
+ type: "redirect",
110
+ value: m.action.successRedirectUrl
111
+ } } : void 0,
112
+ submitButtonConfig: {
113
+ show: !0,
114
+ text: m.action.label || "Submit",
115
+ styles: m.action.fullWidth && (m.action.formVariant ?? "default") === "default" ? "zv6sjdb" : ae[y]
116
+ },
117
+ workspace_id: u.workspace,
118
+ containerStyles: "zv6sjd6",
119
+ preview: d,
120
+ onSuccess: () => {
121
+ m.action?.type === "form" && f?.(c, {
122
+ action_type: "form_submit",
123
+ collection_key: m.action.collectionKey
124
+ });
125
+ }
126
+ })
127
+ }) })
128
+ }), o[14] = y, o[15] = u, o[16] = m.action, o[17] = f, o[18] = c, o[19] = d, o[20] = T) : T = o[20];
129
+ let E;
130
+ o[21] !== m.action || o[22] !== h || o[23] !== v || o[24] !== p ? (E = m.action?.type === "redirect" && /* @__PURE__ */ R(I, { children: [m.action.copyValue && /* @__PURE__ */ R("button", {
131
+ type: "button",
132
+ className: "zv6sjdd",
133
+ onClick: v,
134
+ children: [/* @__PURE__ */ L("span", {
135
+ className: "zv6sjde",
136
+ children: m.action.copyValue
137
+ }), L(h ? U : W, {
138
+ size: 18,
139
+ className: "zv6sjdf"
140
+ })]
141
+ }), /* @__PURE__ */ L(e, {
142
+ className: "zv6sjdc",
143
+ onClick: () => p?.(),
144
+ children: m.action.label || "Button"
145
+ })] }), o[21] = m.action, o[22] = h, o[23] = v, o[24] = p, o[25] = E) : E = o[25];
146
+ let D;
147
+ return o[26] !== x || o[27] !== S || o[28] !== C || o[29] !== w || o[30] !== T || o[31] !== E ? (D = /* @__PURE__ */ R("div", {
148
+ className: x,
149
+ style: S,
150
+ children: [
151
+ C,
152
+ w,
153
+ T,
154
+ E
155
+ ]
156
+ }), o[26] = x, o[27] = S, o[28] = C, o[29] = w, o[30] = T, o[31] = E, o[32] = D) : D = o[32], D;
157
+ };
158
+ //#endregion
159
+ export { te as n };
@@ -4,8 +4,8 @@ import { a as r, c as i, l as a, o, s, u as c } from "./Dialog-dT7y641z.js";
4
4
  import { t as l } from "./theme.cssm-DUzmx76l.js";
5
5
  import { d as u, f as d, l as f, n as p, o as m } from "./popupState-JmpeKzgM-D_77LiAa.js";
6
6
  import { n as h, r as g, t as _ } from "./react-B9yvlbH0.js";
7
- import { a as v, d as y, f as b, g as x, h as S, l as C, m as w, n as T, o as E, p as D, s as ee, t as te, u as O } from "./usePopupRedirect-CAAdcpaW-D9XoiVhG.js";
8
- import { t as k } from "./rteTheme.cssm-CaRzrwtu.js";
7
+ import { t as v } from "./rteTheme.cssm-W4gTOijw.js";
8
+ import { a as y, d as b, f as x, g as S, h as C, l as w, m as T, n as E, o as D, p as O, s as ee, t as te, u as k } from "./usePopupRedirect-CAAdcpaW-Ddjyf4KK.js";
9
9
  import { c as A } from "react/compiler-runtime";
10
10
  import j from "clsx";
11
11
  import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
@@ -49,7 +49,7 @@ function oe(e) {
49
49
  var se = (e) => (e ?? "16:9").replace(":", " / "), ce = (e) => {
50
50
  if (e.content.coverImage?.srcset) return Object.entries(e.content.coverImage.srcset).filter(([e]) => e !== "path").map(([e, t]) => `${t} ${e}`).join(", ");
51
51
  }, le = (e) => {
52
- let t = A(18), { popup: n, disableInteraction: r, children: i } = e, { content: a } = n, o = S(n), s = !!o && !r, c;
52
+ let t = A(18), { popup: n, disableInteraction: r, children: i } = e, { content: a } = n, o = C(n), s = !!o && !r, c;
53
53
  t[0] !== a.coverImage || t[1] !== a.coverImageFocus || t[2] !== n ? (c = a.coverImage && /* @__PURE__ */ N("img", {
54
54
  src: a.coverImage.location,
55
55
  srcSet: ce(n),
@@ -76,7 +76,7 @@ var se = (e) => (e ?? "16:9").replace(":", " / "), ce = (e) => {
76
76
  })), t[8] = a.action, t[9] = a.coverImage, t[10] = s, t[11] = l, t[12] = f, t[13] = o, t[14] = p) : p = t[14];
77
77
  let m;
78
78
  return t[15] !== i || t[16] !== p ? (m = /* @__PURE__ */ P("div", {
79
- className: y,
79
+ className: b,
80
80
  children: [p, i]
81
81
  }), t[15] = i, t[16] = p, t[17] = m) : m = t[17], m;
82
82
  }, ue = (t) => {
@@ -87,7 +87,7 @@ var se = (e) => (e ?? "16:9").replace(":", " / "), ce = (e) => {
87
87
  let u = c;
88
88
  J(u?.fonts?.heading, u?.fonts?.body);
89
89
  let d;
90
- n[9] === Symbol.for("react.memo_cache_sentinel") ? (d = j(l, k), n[9] = d) : d = n[9];
90
+ n[9] === Symbol.for("react.memo_cache_sentinel") ? (d = j(l, v), n[9] = d) : d = n[9];
91
91
  let f;
92
92
  n[10] === u ? f = n[11] : (f = h(u), n[10] = u, n[11] = f);
93
93
  let p;
@@ -103,11 +103,11 @@ var se = (e) => (e ?? "16:9").replace(":", " / "), ce = (e) => {
103
103
  ...a,
104
104
  children: r
105
105
  }), n[15] = r, n[16] = a, n[17] = p, n[18] = m) : m = n[18], m;
106
- }, de = I(() => import("./PopupBody-BI-MJqmd-C0qNyN7V.js").then((e) => e.n).then((e) => ({ default: e.PopupBody }))), fe = (e) => {
106
+ }, de = I(() => import("./PopupBody-BI-MJqmd-DW3qWKam.js").then((e) => e.n).then((e) => ({ default: e.PopupBody }))), fe = (e) => {
107
107
  let t = A(7), { size: n } = e, r = n ?? "medium", i;
108
- t[0] === r ? i = t[1] : (i = O({ size: r }), t[0] = r, t[1] = i);
108
+ t[0] === r ? i = t[1] : (i = k({ size: r }), t[0] = r, t[1] = i);
109
109
  let a, o, s;
110
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ N("div", { className: D }), o = /* @__PURE__ */ N("div", { className: v }), s = /* @__PURE__ */ N("div", { className: T }), t[2] = a, t[3] = o, t[4] = s) : (a = t[2], o = t[3], s = t[4]);
110
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ N("div", { className: O }), o = /* @__PURE__ */ N("div", { className: y }), s = /* @__PURE__ */ N("div", { className: E }), t[2] = a, t[3] = o, t[4] = s) : (a = t[2], o = t[3], s = t[4]);
111
111
  let c;
112
112
  return t[5] === i ? c = t[6] : (c = /* @__PURE__ */ P("div", {
113
113
  className: i,
@@ -118,7 +118,7 @@ var se = (e) => (e ?? "16:9").replace(":", " / "), ce = (e) => {
118
118
  ]
119
119
  }), t[5] = i, t[6] = c), c;
120
120
  }, X = () => {
121
- let e = A(8), { popup: t } = w(), n;
121
+ let e = A(8), { popup: t } = T(), n;
122
122
  e[0] === t.content.size ? n = e[1] : (n = /* @__PURE__ */ N(fe, { size: t.content.size }), e[0] = t.content.size, e[1] = n);
123
123
  let r;
124
124
  e[2] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ N(de, {}), e[2] = r) : r = e[2];
@@ -140,7 +140,7 @@ var se = (e) => (e ?? "16:9").replace(":", " / "), ce = (e) => {
140
140
  default: return "programmatic";
141
141
  }
142
142
  }, he = () => {
143
- let e = A(32), { popup: t, callbacks: n } = w(), { placement: l, id: f } = t, p = _(u).active_popup_id === f, m = R(!1), h, g;
143
+ let e = A(32), { popup: t, callbacks: n } = T(), { placement: l, id: f } = t, p = _(u).active_popup_id === f, m = R(!1), h, g;
144
144
  e[0] !== n || e[1] !== p || e[2] !== t ? (h = () => {
145
145
  p && !m.current && (m.current = !0, n?.onPopupOpen?.(t, { trigger_type: d() })), p || (m.current = !1);
146
146
  }, g = [
@@ -148,45 +148,45 @@ var se = (e) => (e ?? "16:9").replace(":", " / "), ce = (e) => {
148
148
  t,
149
149
  n
150
150
  ], e[0] = n, e[1] = p, e[2] = t, e[3] = h, e[4] = g) : (h = e[3], g = e[4]), L(h, g);
151
- let v = te(), y, x, S, T, E, D, O, k;
151
+ let v = te(), y, b, S, C, E, D, O, k;
152
152
  if (e[5] !== v || e[6] !== p || e[7] !== l || e[8] !== t) {
153
153
  let n = pe(t), u = l === "popup", d = l === "slide_in";
154
- x = o, E = p, e[17] === v ? D = e[18] : (D = (e, t) => !e && v(me(t?.reason)), e[17] = v, e[18] = D), O = u, k = !u, y = i, e[19] === u ? S = e[20] : (S = u && /* @__PURE__ */ N(a, {}), e[19] = u, e[20] = S), T = u ? /* @__PURE__ */ N(c, {
154
+ b = o, E = p, e[17] === v ? D = e[18] : (D = (e, t) => !e && v(me(t?.reason)), e[17] = v, e[18] = D), O = u, k = !u, y = i, e[19] === u ? S = e[20] : (S = u && /* @__PURE__ */ N(a, {}), e[19] = u, e[20] = S), C = u ? /* @__PURE__ */ N(c, {
155
155
  className: ee,
156
156
  children: /* @__PURE__ */ P(s.Popup, {
157
- className: C({ placement: l }),
157
+ className: w({ placement: l }),
158
158
  children: [/* @__PURE__ */ N(r, {
159
159
  variant: "ghost",
160
160
  size: "icon-xs",
161
- className: b,
161
+ className: x,
162
162
  "aria-label": "Close popup",
163
163
  children: /* @__PURE__ */ N(z, { size: 16 })
164
164
  }), /* @__PURE__ */ N(X, {})]
165
165
  })
166
166
  }) : /* @__PURE__ */ P(s.Popup, {
167
- className: j(C({
167
+ className: j(w({
168
168
  placement: l,
169
169
  position: n
170
170
  }), d && "_1gklkndd"),
171
171
  children: [/* @__PURE__ */ N(r, {
172
172
  variant: "ghost",
173
173
  size: "icon-xs",
174
- className: b,
174
+ className: x,
175
175
  "aria-label": "Close popup",
176
176
  children: /* @__PURE__ */ N(z, { size: 16 })
177
177
  }), /* @__PURE__ */ N(X, {})]
178
- }), e[5] = v, e[6] = p, e[7] = l, e[8] = t, e[9] = y, e[10] = x, e[11] = S, e[12] = T, e[13] = E, e[14] = D, e[15] = O, e[16] = k;
179
- } else y = e[9], x = e[10], S = e[11], T = e[12], E = e[13], D = e[14], O = e[15], k = e[16];
178
+ }), e[5] = v, e[6] = p, e[7] = l, e[8] = t, e[9] = y, e[10] = b, e[11] = S, e[12] = C, e[13] = E, e[14] = D, e[15] = O, e[16] = k;
179
+ } else y = e[9], b = e[10], S = e[11], C = e[12], E = e[13], D = e[14], O = e[15], k = e[16];
180
180
  let M;
181
- e[21] !== y || e[22] !== S || e[23] !== T ? (M = /* @__PURE__ */ P(y, { children: [S, T] }), e[21] = y, e[22] = S, e[23] = T, e[24] = M) : M = e[24];
181
+ e[21] !== y || e[22] !== S || e[23] !== C ? (M = /* @__PURE__ */ P(y, { children: [S, C] }), e[21] = y, e[22] = S, e[23] = C, e[24] = M) : M = e[24];
182
182
  let F;
183
- return e[25] !== x || e[26] !== E || e[27] !== D || e[28] !== O || e[29] !== k || e[30] !== M ? (F = /* @__PURE__ */ N(x, {
183
+ return e[25] !== b || e[26] !== E || e[27] !== D || e[28] !== O || e[29] !== k || e[30] !== M ? (F = /* @__PURE__ */ N(b, {
184
184
  open: E,
185
185
  onOpenChange: D,
186
186
  modal: O,
187
187
  disablePointerDismissal: k,
188
188
  children: M
189
- }), e[25] = x, e[26] = E, e[27] = D, e[28] = O, e[29] = k, e[30] = M, e[31] = F) : F = e[31], F;
189
+ }), e[25] = b, e[26] = E, e[27] = D, e[28] = O, e[29] = k, e[30] = M, e[31] = F) : F = e[31], F;
190
190
  }, ge = 3e4, _e = 5e3, ve = 5e3, ye = 100, be = .5, xe = 5, Se = (e) => {
191
191
  if (typeof document > "u") return () => {};
192
192
  let t = !1, n = Date.now(), r = [], i = 0, a = null, o = () => Date.now() - n >= ge, s = () => {
@@ -289,7 +289,7 @@ var Q = (e, t) => {
289
289
  let o = e.referrer?.exclude ?? [];
290
290
  return !(o.length > 0 && n && o.some((e) => $(e, n)));
291
291
  }, Oe = (e) => {
292
- let t = A(4), { pageId: n } = e, { popup: r } = w(), i;
292
+ let t = A(4), { pageId: n } = e, { popup: r } = T(), i;
293
293
  bb0: {
294
294
  if (!r.target) {
295
295
  i = !0;
@@ -363,7 +363,7 @@ var Q = (e, t) => {
363
363
  r[12] !== g || r[13] !== s || r[14] !== a ? (e = (e) => /* @__PURE__ */ N(ue, {
364
364
  popupTheme: e.theme,
365
365
  siteTheme: e.site?.theme,
366
- children: /* @__PURE__ */ N(E, {
366
+ children: /* @__PURE__ */ N(D, {
367
367
  popup: e,
368
368
  callbacks: g,
369
369
  client: s,
@@ -383,6 +383,6 @@ function je(e) {
383
383
  popup_action_kind: e.content.action?.type || "none"
384
384
  };
385
385
  }
386
- var Me = /* @__PURE__ */ x({ PopupRenderer: () => Ae });
386
+ var Me = /* @__PURE__ */ S({ PopupRenderer: () => Ae });
387
387
  //#endregion
388
388
  export { Me as t };