@levo-so/studio 0.3.7 → 0.3.9

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.
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "./Button-B1Qi1fm7.js";
2
+ import { t as e } from "./Button-Dza3e6Mv.js";
3
3
  import { useState as t } from "react";
4
4
  import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  //#region src/components/bookingCard/BillingStep.tsx
@@ -20,7 +20,7 @@ import oe from "isomorphic-dompurify";
20
20
  var O = async (e, t) => {
21
21
  let n = {};
22
22
  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 ?? [];
23
- }, k = _(() => import("./PopupRenderer-BjW1jg70-DTDWpyNa.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), A = (e) => {
23
+ }, k = _(() => import("./PopupRenderer-D66Gx63H-GHfJebm6.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), A = (e) => {
24
24
  let t = u(9), { siteId: n, pageId: r } = e, { fetch: a, logger: o } = f(), [s, c] = S(null), l = x(!1), p, h;
25
25
  if (t[0] !== a || t[1] !== o || t[2] !== n ? (p = () => {
26
26
  if (l.current) return;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { r as e } from "./dist-DLSqcZ3k.js";
2
+ import { r as e } from "./dist-D5mTOitS.js";
3
3
  import { n as t } from "./AuthProvider-B5NfFwbG.js";
4
4
  import { t as n } from "./card-5ooLmYSr.js";
5
5
  import { t as r } from "./MessageFooter-K4Zd_eFO.js";
@@ -372,10 +372,10 @@ var H = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
372
372
  })
373
373
  ]
374
374
  });
375
- }, Ie = () => null, Le = "max-w-none text-sm text-zinc-900 leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_a:hover]:text-sky-700 [&_a]:break-words [&_a]:font-medium [&_a]:text-sky-600 [&_a]:underline [&_a]:underline-offset-2 [&_li]:text-sm [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p]:my-2 [&_p]:text-sm [&_strong]:font-semibold [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5", Re = "group pr-4 pb-6", ze = "mt-2 flex items-center gap-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100", Be = "text-xs text-zinc-500/60", Ve = "rounded p-1.5 text-zinc-500 transition-colors hover:text-zinc-900", He = ({ tools: e = Ie, Parts: t, thinkingIndicator: n = /* @__PURE__ */ E(Fe, {}), rootClassName: r = Re, contentClassName: i = Le, metaClassName: a = ze, wrapContent: o, metaSlot: s, copyIdleClassName: c, copyCopiedClassName: l, reloadClassName: u = Ve, timeClassName: d = Be, timeFormatOptions: f, readOnly: p = !1, belowContent: m }) => {
376
- let g = V((e) => e.message), _ = t ?? R.Content, v = g.status?.type === "running", y = /* @__PURE__ */ E("div", {
375
+ }, Ie = () => null, Le = "max-w-none text-sm text-zinc-900 leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_a:hover]:text-sky-700 [&_a]:break-words [&_a]:font-medium [&_a]:text-sky-600 [&_a]:underline [&_a]:underline-offset-2 [&_li]:text-sm [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p]:my-2 [&_p]:text-sm [&_strong]:font-semibold [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5", Re = "group pr-4 pb-6", ze = "mt-2 flex items-center gap-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100", Be = "text-xs text-zinc-500/60", Ve = "rounded p-1.5 text-zinc-500 transition-colors hover:text-zinc-900", He = ({ tools: e = Ie, Parts: t, thinkingIndicator: n = /* @__PURE__ */ E(Fe, {}), rootClassName: r = Re, contentClassName: i = Le, metaClassName: a = ze, wrapContent: o, metaSlot: s, copyIdleClassName: c, copyCopiedClassName: l, reloadClassName: u = Ve, timeClassName: d = Be, timeFormatOptions: f, readOnly: p = !1, belowContent: m, footerSlot: g }) => {
376
+ let _ = V((e) => e.message), v = t ?? R.Content, y = _.status?.type === "running", b = /* @__PURE__ */ E("div", {
377
377
  className: i,
378
- children: /* @__PURE__ */ E(_, { components: {
378
+ children: /* @__PURE__ */ E(v, { components: {
379
379
  Text: Me,
380
380
  tools: { Fallback: e }
381
381
  } })
@@ -385,21 +385,21 @@ var H = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
385
385
  children: /* @__PURE__ */ D("div", {
386
386
  className: "flex min-w-0 flex-col",
387
387
  children: [
388
- o ? o(y) : y,
389
- v && /* @__PURE__ */ E("div", {
388
+ o ? o(b) : b,
389
+ y && /* @__PURE__ */ E("div", {
390
390
  className: "mt-1",
391
391
  children: n
392
392
  }),
393
- !v && m && /* @__PURE__ */ E("div", {
393
+ !y && m && /* @__PURE__ */ E("div", {
394
394
  className: "mt-2",
395
395
  children: m
396
396
  }),
397
- !v && /* @__PURE__ */ D("div", {
397
+ !y && /* @__PURE__ */ D("div", {
398
398
  className: a,
399
399
  children: [
400
400
  /* @__PURE__ */ E("span", {
401
401
  className: d,
402
- children: h(g.createdAt, f)
402
+ children: h(_.createdAt, f)
403
403
  }),
404
404
  s,
405
405
  /* @__PURE__ */ D(F.Root, {
@@ -413,7 +413,8 @@ var H = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
413
413
  })]
414
414
  })
415
415
  ]
416
- })
416
+ }),
417
+ !y && g
417
418
  ]
418
419
  })
419
420
  });
@@ -8,7 +8,7 @@ var s = {
8
8
  title: "_title_s7k8g_7",
9
9
  subtitle: "_subtitle_s7k8g_14",
10
10
  formWrapper: "_formWrapper_s7k8g_20"
11
- }, c = r(() => import("./PendingApprovalCard-R_AHT42r.js")), l = ({ logo: r, siteName: l, page: u }) => {
11
+ }, c = r(() => import("./PendingApprovalCard-DbYp0nSk.js")), l = ({ logo: r, siteName: l, page: u }) => {
12
12
  let [d, f] = i(!1), [p, m] = i(!1), h = u.access?.find((e) => e.kind === "gating" && e.enabled)?.options;
13
13
  return p ? /* @__PURE__ */ a(n, {
14
14
  fallback: /* @__PURE__ */ a("div", {}),
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { r as e } from "./dist-DLSqcZ3k.js";
2
+ import { r as e } from "./dist-D5mTOitS.js";
3
3
  import { t } from "./card-5ooLmYSr.js";
4
4
  import { t as n } from "./MessageFooter-K4Zd_eFO.js";
5
5
  import { useState as r } from "react";
@@ -3,9 +3,9 @@ import { n as t, t as n } from "./fontSize-B-ba6pvx.js";
3
3
  import { n as r, r as i, t as a } from "./inlineRteTheme-BOAno9MG.js";
4
4
  import { i as o, r as s, t as c } from "./Dialog-CPE8yUqK.js";
5
5
  import { t as l } from "./inlineCollectionTheme-uhBXoF1F.js";
6
- import { _ as u, a as d, d as f, g as p, i as m, l as h, r as g } from "./usePopupRedirect-BThP_YPW-jXtfhYu6.js";
6
+ import { c as u, g as d, h as f, i as p, m, r as h, u as g } from "./usePopupRedirect-CAAdcpaW-DdME0F7f.js";
7
7
  import { c as _ } from "react/compiler-runtime";
8
- import { useLevo as v } from "@levo-so/react";
8
+ import { LevoProvider as v } from "@levo-so/react";
9
9
  import { Suspense as y, lazy as b, useMemo as x, useState as S } from "react";
10
10
  import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
11
11
  import E from "clsx";
@@ -33,7 +33,7 @@ import { Underline as J } from "@tiptap/extension-underline";
33
33
  import { UniqueID as Y } from "@tiptap/extension-unique-id";
34
34
  import { generateJSON as X } from "@tiptap/html";
35
35
  import { renderToReactElement as Z } from "@tiptap/static-renderer/pm/react";
36
- //#region ../../libraries/popups/dist/PopupBody-DZVwDLkg.js
36
+ //#region ../../libraries/popups/dist/PopupBody-BI-MJqmd.js
37
37
  var Q = [
38
38
  O,
39
39
  H,
@@ -75,26 +75,26 @@ var Q = [
75
75
  ...i,
76
76
  children: o
77
77
  }) : null;
78
- }, te = /* @__PURE__ */ u({ PopupBody: () => oe }), ne = b(() => import("./dist-DLSqcZ3k.js").then((e) => e.t).then((e) => ({ default: e.CollectionFormBuilder }))), re = a({ baseSpacing: ".625rem" }), ie = { style: l({ form: { gap: "1rem" } }) }, ae = {
79
- left: h,
80
- center: g,
81
- right: m
78
+ }, te = /* @__PURE__ */ d({ PopupBody: () => oe }), ne = b(() => import("./dist-D5mTOitS.js").then((e) => e.t).then((e) => ({ default: e.CollectionFormBuilder }))), re = a({ baseSpacing: ".625rem" }), ie = { style: l({ form: { gap: "1rem" } }) }, ae = {
79
+ left: u,
80
+ center: h,
81
+ right: p
82
82
  }, oe = (t) => {
83
- let n = _(33), { popup: r, disableInteraction: i } = t, a = d(), l = a?.callbacks?.onAction, u = p(r), m = !a, { content: h } = r, { workspace: g } = v(), [b, x] = S(!1), E;
84
- n[0] !== h.action || n[1] !== l || n[2] !== r ? (E = () => {
83
+ let n = _(33), { disableInteraction: r } = t, { popup: i, callbacks: a, client: l, preview: u } = m(), d = a?.onAction, p = f(i), { content: h } = i, [b, x] = S(!1), E;
84
+ n[0] !== h.action || n[1] !== d || n[2] !== i ? (E = () => {
85
85
  if (h.action?.type !== "redirect" || !h.action.copyValue) return;
86
86
  let e = h.action.copyValue;
87
87
  navigator.clipboard.writeText(e).then(() => {
88
- x(!0), setTimeout(() => x(!1), 2e3), l?.(r, {
88
+ x(!0), setTimeout(() => x(!1), 2e3), d?.(i, {
89
89
  action_type: "copy",
90
90
  copy_value: e
91
91
  });
92
92
  });
93
- }, n[0] = h.action, n[1] = l, n[2] = r, n[3] = E) : E = n[3];
93
+ }, n[0] = h.action, n[1] = d, n[2] = i, n[3] = E) : E = n[3];
94
94
  let D = E, O = h.align ?? "left", k = h.size ?? "medium", M;
95
- n[4] === k ? M = n[5] : (M = f({ size: k }), n[4] = k, n[5] = M);
95
+ n[4] === k ? M = n[5] : (M = g({ size: k }), n[4] = k, n[5] = M);
96
96
  let N;
97
- n[6] === i ? N = n[7] : (N = i ? { pointerEvents: "none" } : void 0, n[6] = i, n[7] = N);
97
+ n[6] === r ? N = n[7] : (N = r ? { pointerEvents: "none" } : void 0, n[6] = r, n[7] = N);
98
98
  let P;
99
99
  n[8] !== O || n[9] !== h.description || n[10] !== h.heading ? (P = (h.heading || h.description) && /* @__PURE__ */ T(c, {
100
100
  className: "zv6sjd4",
@@ -108,38 +108,41 @@ var Q = [
108
108
  content: h.body
109
109
  }), n[12] = h.body, n[13] = F);
110
110
  let I;
111
- n[14] !== O || n[15] !== h.action || n[16] !== m || n[17] !== l || n[18] !== r || n[19] !== g ? (I = h.action?.type === "form" && /* @__PURE__ */ w("div", {
111
+ n[14] !== O || n[15] !== l || n[16] !== h.action || n[17] !== d || n[18] !== i || n[19] !== u ? (I = h.action?.type === "form" && l && /* @__PURE__ */ w("div", {
112
112
  className: "zv6sjd7",
113
- children: /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(ne, {
114
- collection_id: h.action.collectionKey,
115
- formVariant: h.action.formVariant,
116
- theme: ie,
117
- uiConfig: {
118
- hideFormHeading: !0,
119
- hideSectionHeadings: !0
120
- },
121
- successConfig: h.action.successRedirectUrl ? { action: {
122
- type: "redirect",
123
- value: h.action.successRedirectUrl
124
- } } : void 0,
125
- submitButtonConfig: {
126
- show: !0,
127
- text: h.action.label || "Submit",
128
- styles: h.action.fullWidth && (h.action.formVariant ?? "default") === "default" ? "zv6sjdb" : ae[O]
129
- },
130
- workspace_id: g,
131
- containerStyles: "zv6sjd6",
132
- preview: m,
133
- onSuccess: () => {
134
- h.action?.type === "form" && l?.(r, {
135
- action_type: "form_submit",
136
- collection_key: h.action.collectionKey
137
- });
138
- }
113
+ children: /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(v, {
114
+ client: l,
115
+ children: /* @__PURE__ */ w(ne, {
116
+ collection_id: h.action.collectionKey,
117
+ formVariant: h.action.formVariant,
118
+ theme: ie,
119
+ uiConfig: {
120
+ hideFormHeading: !0,
121
+ hideSectionHeadings: !0
122
+ },
123
+ successConfig: h.action.successRedirectUrl ? { action: {
124
+ type: "redirect",
125
+ value: h.action.successRedirectUrl
126
+ } } : void 0,
127
+ submitButtonConfig: {
128
+ show: !0,
129
+ text: h.action.label || "Submit",
130
+ styles: h.action.fullWidth && (h.action.formVariant ?? "default") === "default" ? "zv6sjdb" : ae[O]
131
+ },
132
+ workspace_id: l.workspace,
133
+ containerStyles: "zv6sjd6",
134
+ preview: u,
135
+ onSuccess: () => {
136
+ h.action?.type === "form" && d?.(i, {
137
+ action_type: "form_submit",
138
+ collection_key: h.action.collectionKey
139
+ });
140
+ }
141
+ })
139
142
  }) })
140
- }), n[14] = O, n[15] = h.action, n[16] = m, n[17] = l, n[18] = r, n[19] = g, n[20] = I) : I = n[20];
143
+ }), n[14] = O, n[15] = l, n[16] = h.action, n[17] = d, n[18] = i, n[19] = u, n[20] = I) : I = n[20];
141
144
  let L;
142
- n[21] !== h.action || n[22] !== b || n[23] !== D || n[24] !== u ? (L = h.action?.type === "redirect" && /* @__PURE__ */ T(C, { children: [h.action.copyValue && /* @__PURE__ */ T("button", {
145
+ n[21] !== h.action || n[22] !== b || n[23] !== D || n[24] !== p ? (L = h.action?.type === "redirect" && /* @__PURE__ */ T(C, { children: [h.action.copyValue && /* @__PURE__ */ T("button", {
143
146
  type: "button",
144
147
  className: "zv6sjdd",
145
148
  onClick: D,
@@ -152,9 +155,9 @@ var Q = [
152
155
  })]
153
156
  }), /* @__PURE__ */ w(e, {
154
157
  className: "zv6sjdc",
155
- onClick: () => u?.(),
158
+ onClick: () => p?.(),
156
159
  children: h.action.label || "Button"
157
- })] }), n[21] = h.action, n[22] = b, n[23] = D, n[24] = u, n[25] = L) : L = n[25];
160
+ })] }), n[21] = h.action, n[22] = b, n[23] = D, n[24] = p, n[25] = L) : L = n[25];
158
161
  let R;
159
162
  return n[26] !== M || n[27] !== N || n[28] !== P || n[29] !== F || n[30] !== I || n[31] !== L ? (R = /* @__PURE__ */ T("div", {
160
163
  className: M,