@levo-so/site-runtime 0.3.19 → 0.3.20
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/CollectionField-DCAXOmBN.js +270 -0
- package/DateTimeWidget-I0LvR-tO.js +255 -0
- package/{Dialog-dT7y641z.js → Dialog-D-vRkU9N.js} +1 -1
- package/{KBChatWidget-GRi6sLpp.js → KBChatWidget-BMuZ-VI3.js} +222 -222
- package/{LevoProvider-Bsjkcwc8.js → LevoProvider-BkbKrvrI.js} +8 -8
- package/PhoneWidget-DPECohGT.js +99 -0
- package/{Popover-C29yJ7rz.js → Popover-Cr0-X_ch.js} +1 -1
- package/{PopupBody-BI-MJqmd-DgTQEzda.js → PopupBody-BI-MJqmd-a-l3CaKZ.js} +23 -23
- package/{PopupRenderer-D66Gx63H-Cd9xJv33.js → PopupRenderer-D66Gx63H-DpcNpbtU.js} +47 -47
- package/{RichTextWidget-DfakML79.js → RichTextWidget-C1QECDcg.js} +127 -127
- package/{RteThemeProvider-BQmfSXSl.js → RteThemeProvider-CMbSaFRQ.js} +1 -1
- package/{ThemeProvider-DutrjSTF.js → ThemeProvider-DlFehjh1.js} +30 -30
- package/{Tooltip-CQB0LyxK.js → Tooltip-BKQ5rIDh.js} +1 -1
- package/{VerifyButton-BUT70lgz.js → VerifyButton-D0cj9Z5Q.js} +38 -38
- package/blog-content.js +67 -67
- package/{dist-CEdznbFW.js → dist-IxiGbP-3.js} +1254 -1139
- package/{dist-6AIgW_iB.js → dist-_lwl0kZw.js} +10 -10
- package/index.d.ts +21 -11
- package/index.js +1698 -1385
- package/{kbChat-a2dXSeRc.js → kbChat-DtZ4vuCZ.js} +26 -26
- package/package.json +3 -3
- package/popups.js +1 -1
- package/script.esm-wR2d7rrv.js +62 -0
- package/{usePopupRedirect-CAAdcpaW-Ddjyf4KK.js → usePopupRedirect-CAAdcpaW-BDa44PXN.js} +14 -14
- package/CollectionField-C-6a1ud4.js +0 -270
- package/DateTimeWidget-U3lD0q1q.js +0 -255
- package/PhoneWidget-DQQa4bL6.js +0 -99
- /package/{es-ByBbirnH.js → es-CGQflL9T.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { C as e, a as t, c as n, f as r, g as i, h as a, l as o, m as s, n as c, o as l, p as u, r as d, t as f, u as p } from "./pillChrome-CEpWGNZB.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useEffect as m, useRef as h, useState as g } from "react";
|
|
4
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
5
5
|
import { ArrowUp as y, Sparkles as b } from "lucide-react";
|
|
6
6
|
//#region ../../libraries/ai-chat/src/useActiveAgent.ts
|
|
7
7
|
var x = (t) => e("active_agent", t), S = (e) => {
|
|
@@ -21,16 +21,16 @@ var x = (t) => e("active_agent", t), S = (e) => {
|
|
|
21
21
|
t === null ? window.sessionStorage.removeItem(n) : window.sessionStorage.setItem(n, JSON.stringify(t));
|
|
22
22
|
} catch {}
|
|
23
23
|
}, w = ({ url: e, workspaceId: t, headers: n, path: r }) => {
|
|
24
|
-
let [i, a] =
|
|
25
|
-
|
|
24
|
+
let [i, a] = g({ status: "loading" });
|
|
25
|
+
m(() => {
|
|
26
26
|
let e = S(t);
|
|
27
27
|
a(e ? {
|
|
28
28
|
status: "ready",
|
|
29
29
|
agent: e
|
|
30
30
|
} : (e) => e.status === "ready" ? { status: "loading" } : e);
|
|
31
31
|
}, [t]);
|
|
32
|
-
let o =
|
|
33
|
-
return o.current = n,
|
|
32
|
+
let o = h(n);
|
|
33
|
+
return o.current = n, m(() => {
|
|
34
34
|
if (!t || !e) return;
|
|
35
35
|
let n = r ? `${e}${e.includes("?") ? "&" : "?"}path=${encodeURIComponent(r)}` : e, i = new AbortController();
|
|
36
36
|
return (async () => {
|
|
@@ -64,13 +64,13 @@ var x = (t) => e("active_agent", t), S = (e) => {
|
|
|
64
64
|
e,
|
|
65
65
|
r
|
|
66
66
|
]), i;
|
|
67
|
-
}, T = (...e) => e.filter(Boolean).join(" "), E = () => import("./KBChatWidget-
|
|
68
|
-
let [t, n] =
|
|
69
|
-
return t ? /* @__PURE__ */
|
|
67
|
+
}, T = (...e) => e.filter(Boolean).join(" "), E = () => import("./KBChatWidget-BMuZ-VI3.js"), D = (e) => {
|
|
68
|
+
let [t, n] = g(null), [r, i] = g(!1), [a, o] = g("");
|
|
69
|
+
return t ? /* @__PURE__ */ _(t, {
|
|
70
70
|
initialOpen: !0,
|
|
71
71
|
initialDraft: a,
|
|
72
72
|
...e
|
|
73
|
-
}) : /* @__PURE__ */
|
|
73
|
+
}) : /* @__PURE__ */ _(k, {
|
|
74
74
|
siteName: e.siteName,
|
|
75
75
|
draft: a,
|
|
76
76
|
loading: r,
|
|
@@ -84,31 +84,31 @@ var x = (t) => e("active_agent", t), S = (e) => {
|
|
|
84
84
|
E().catch(() => {});
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
|
-
}, O = () => /* @__PURE__ */
|
|
87
|
+
}, O = () => /* @__PURE__ */ _("span", {
|
|
88
88
|
"aria-hidden": !0,
|
|
89
89
|
className: "h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
90
|
-
}), k = ({ siteName: e, draft: i, loading:
|
|
91
|
-
let w =
|
|
92
|
-
return /* @__PURE__ */
|
|
90
|
+
}), k = ({ siteName: e, draft: i, loading: m, onDraftChange: x, onActivate: S, onPrefetch: C }) => {
|
|
91
|
+
let w = h(null), E = h(null), D = a(e), [k, A] = g(!1);
|
|
92
|
+
return /* @__PURE__ */ _("div", {
|
|
93
93
|
onPointerEnter: C,
|
|
94
94
|
className: T("ai-chat-launcher fixed bottom-8 left-1/2 z-[60] -translate-x-1/2", u),
|
|
95
|
-
children: /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ _("div", {
|
|
96
96
|
className: T(c, n, "ai-chat-intro-morph"),
|
|
97
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ v("div", {
|
|
98
98
|
ref: E,
|
|
99
99
|
className: T(p, k && "ai-chat-pill-surface--stacked"),
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ _("button", {
|
|
102
102
|
type: "button",
|
|
103
103
|
onClick: S,
|
|
104
104
|
onFocus: C,
|
|
105
105
|
"aria-label": "Open AI chat",
|
|
106
106
|
className: o,
|
|
107
|
-
children:
|
|
107
|
+
children: m ? /* @__PURE__ */ _(O, {}) : /* @__PURE__ */ _(b, { className: "h-5 w-5" })
|
|
108
108
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ v("div", {
|
|
110
110
|
className: d,
|
|
111
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ _("textarea", {
|
|
112
112
|
ref: w,
|
|
113
113
|
rows: 1,
|
|
114
114
|
autoComplete: "off",
|
|
@@ -123,21 +123,21 @@ var x = (t) => e("active_agent", t), S = (e) => {
|
|
|
123
123
|
x(t.value), E.current && A(s(E.current, t));
|
|
124
124
|
},
|
|
125
125
|
className: r
|
|
126
|
-
}), !i && /* @__PURE__ */
|
|
126
|
+
}), !i && /* @__PURE__ */ _("span", {
|
|
127
127
|
className: T("ai-chat-pill-label pointer-events-none absolute inset-y-0 left-0 flex max-w-full items-center truncate bg-clip-text font-semibold text-[15px] text-transparent", "ai-chat-intro-label"),
|
|
128
128
|
"aria-hidden": !0,
|
|
129
129
|
children: D
|
|
130
130
|
})]
|
|
131
131
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ _("div", {
|
|
133
133
|
className: f,
|
|
134
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ _("button", {
|
|
135
135
|
type: "button",
|
|
136
136
|
onClick: S,
|
|
137
137
|
"aria-label": "Open AI chat",
|
|
138
138
|
className: t,
|
|
139
139
|
style: l,
|
|
140
|
-
children:
|
|
140
|
+
children: m ? /* @__PURE__ */ _(O, {}) : /* @__PURE__ */ _(y, { className: "h-5 w-5 stroke-[2.5px]" })
|
|
141
141
|
})
|
|
142
142
|
})
|
|
143
143
|
]
|
|
@@ -154,9 +154,9 @@ var x = (t) => e("active_agent", t), S = (e) => {
|
|
|
154
154
|
} : i(o),
|
|
155
155
|
path: l
|
|
156
156
|
});
|
|
157
|
-
return u.status === "ready" ? /* @__PURE__ */
|
|
157
|
+
return u.status === "ready" ? /* @__PURE__ */ _("div", {
|
|
158
158
|
"data-ai-chat-root": !0,
|
|
159
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ _(D, {
|
|
160
160
|
workspaceId: e,
|
|
161
161
|
siteName: t,
|
|
162
162
|
siteLogo: n,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levo-so/site-runtime",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"description": "Runtime for Levo Studio v3 sites — the editor preview inspector, page head metadata, and the Levo data client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"@assistant-ui/store": "0.3.13",
|
|
83
83
|
"@assistant-ui/tap": "0.9.17",
|
|
84
84
|
"remark-gfm": "4.0.1",
|
|
85
|
-
"@levo-so/core": "0.3.
|
|
86
|
-
"@levo-so/insights": "0.3.
|
|
85
|
+
"@levo-so/core": "0.3.20",
|
|
86
|
+
"@levo-so/insights": "0.3.20",
|
|
87
87
|
"@stripe/react-stripe-js": "3.1.1",
|
|
88
88
|
"@stripe/stripe-js": "5.5.0",
|
|
89
89
|
"react-razorpay": "3.0.1"
|
package/popups.js
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@cashfreepayments+cashfree-js@1.0.7/node_modules/@cashfreepayments/cashfree-js/dist/script.esm.js
|
|
2
|
+
var e = "https://sdk.cashfree.com/js/v3/cashfree.js", t = /^https:\/\/sdk\.cashfree\.com\/js\/v3\/.*$/, n = "load was called but an existing Cashfree.js script already exists in the document; existing script parameters will be used", r = function() {
|
|
3
|
+
for (var n = document.querySelectorAll(`script[src^="${e}"]`), r = 0; r < n.length; r++) {
|
|
4
|
+
var i = n[r];
|
|
5
|
+
if (t.test(i.src)) return i;
|
|
6
|
+
}
|
|
7
|
+
return null;
|
|
8
|
+
}, i = function(t) {
|
|
9
|
+
var n = "", r = document.createElement("script");
|
|
10
|
+
r.src = `${e}${n}`;
|
|
11
|
+
var i = document.head || document.body;
|
|
12
|
+
if (!i) throw Error("Expected document.body not to be null. Cashfree.js requires a <body> element.");
|
|
13
|
+
return i.appendChild(r), r;
|
|
14
|
+
}, a = null, o = function(e) {
|
|
15
|
+
return a === null && (a = new Promise(function(t, o) {
|
|
16
|
+
if (typeof window > "u" || typeof document > "u") {
|
|
17
|
+
t(null);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (window.Cashfree && e && console.warn(n), window.Cashfree) {
|
|
21
|
+
t(window.Cashfree);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
var s = 3, c = 0, l = !1;
|
|
25
|
+
function u(n) {
|
|
26
|
+
n.addEventListener("load", function() {
|
|
27
|
+
window.Cashfree ? t(window.Cashfree) : o(/* @__PURE__ */ Error("Cashfree.js not available"));
|
|
28
|
+
}), n.addEventListener("error", function() {
|
|
29
|
+
l || (c < s ? (l = !0, c++, n.parentNode && n.parentNode.removeChild(n), setTimeout(function() {
|
|
30
|
+
l = !1;
|
|
31
|
+
try {
|
|
32
|
+
u(r() || i(e));
|
|
33
|
+
} catch (e) {
|
|
34
|
+
o(e);
|
|
35
|
+
}
|
|
36
|
+
}, 100)) : (a = null, o(/* @__PURE__ */ Error("Failed to load Cashfree.js"))));
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
var d = r();
|
|
41
|
+
d && e ? console.warn(n) : d ||= i(e), u(d);
|
|
42
|
+
} catch (e) {
|
|
43
|
+
o(e);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
})), a;
|
|
47
|
+
}, s = function(e, t, n) {
|
|
48
|
+
return e === null ? null : e.apply(void 0, t);
|
|
49
|
+
}, c = Promise.resolve().then(function() {
|
|
50
|
+
return o(null);
|
|
51
|
+
}), l = !1;
|
|
52
|
+
c.catch(function(e) {
|
|
53
|
+
l || console.warn(e);
|
|
54
|
+
});
|
|
55
|
+
var u = async function() {
|
|
56
|
+
var e = [...arguments];
|
|
57
|
+
l = !0;
|
|
58
|
+
var t = Date.now();
|
|
59
|
+
return s(await c, e, t);
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { u as load };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as e, f as t, r as n, s as r } from "./popupState-JmpeKzgM-D_77LiAa.js";
|
|
2
2
|
import { c as i } from "react/compiler-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { createContext as a, useContext as o } from "react";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
5
|
+
import { createRuntimeFn as c } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
6
6
|
//#region ../../libraries/popups/dist/rolldown-runtime-CAFD8bLK.js
|
|
7
7
|
var l = Object.defineProperty, u = (e, t) => {
|
|
8
8
|
let n = {};
|
|
@@ -11,7 +11,7 @@ var l = Object.defineProperty, u = (e, t) => {
|
|
|
11
11
|
enumerable: !0
|
|
12
12
|
});
|
|
13
13
|
return t || l(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
14
|
-
}, d =
|
|
14
|
+
}, d = c({
|
|
15
15
|
defaultClassName: "_1gklknd4",
|
|
16
16
|
variantClassNames: {
|
|
17
17
|
placement: {
|
|
@@ -27,7 +27,7 @@ var l = Object.defineProperty, u = (e, t) => {
|
|
|
27
27
|
},
|
|
28
28
|
defaultVariants: { placement: "popup" },
|
|
29
29
|
compoundVariants: []
|
|
30
|
-
}), f = "_1gklkndb", p = "_1gklkndc", m =
|
|
30
|
+
}), f = "_1gklkndb", p = "_1gklkndc", m = c({
|
|
31
31
|
defaultClassName: "_1gklknde",
|
|
32
32
|
variantClassNames: { size: {
|
|
33
33
|
small: "_1gklkndf",
|
|
@@ -37,24 +37,24 @@ var l = Object.defineProperty, u = (e, t) => {
|
|
|
37
37
|
} },
|
|
38
38
|
defaultVariants: { size: "medium" },
|
|
39
39
|
compoundVariants: []
|
|
40
|
-
}), h = "_1gklkndn", g =
|
|
41
|
-
let t = i(8), { popup: n, callbacks: r, client:
|
|
42
|
-
t[0] !== r || t[1] !==
|
|
40
|
+
}), h = "_1gklkndn", g = a(null), _ = (e) => {
|
|
41
|
+
let t = i(8), { popup: n, callbacks: r, client: a, preview: o, children: c } = e, l;
|
|
42
|
+
t[0] !== r || t[1] !== a || t[2] !== n || t[3] !== o ? (l = {
|
|
43
43
|
popup: n,
|
|
44
44
|
callbacks: r,
|
|
45
|
-
client:
|
|
46
|
-
preview:
|
|
47
|
-
}, t[0] = r, t[1] =
|
|
45
|
+
client: a,
|
|
46
|
+
preview: o
|
|
47
|
+
}, t[0] = r, t[1] = a, t[2] = n, t[3] = o, t[4] = l) : l = t[4];
|
|
48
48
|
let u;
|
|
49
|
-
return t[5] !== c || t[6] !== l ? (u = /* @__PURE__ */
|
|
49
|
+
return t[5] !== c || t[6] !== l ? (u = /* @__PURE__ */ s(g.Provider, {
|
|
50
50
|
value: l,
|
|
51
51
|
children: c
|
|
52
52
|
}), t[5] = c, t[6] = l, t[7] = u) : u = t[7], u;
|
|
53
53
|
}, v = () => {
|
|
54
|
-
let e =
|
|
54
|
+
let e = o(g);
|
|
55
55
|
if (!e) throw Error("usePopupContext must be used within a PopupProvider");
|
|
56
56
|
return e;
|
|
57
|
-
}, y = () =>
|
|
57
|
+
}, y = () => o(g), b = () => {
|
|
58
58
|
let a = i(2), o = y(), s;
|
|
59
59
|
return a[0] === o ? s = a[1] : (s = (i) => {
|
|
60
60
|
let a = i === void 0 ? "programmatic" : i;
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { FieldInterfaces as e } from "@levo-so/core";
|
|
2
|
-
import { isValidPhoneNumber as t } from "react-phone-number-input";
|
|
3
|
-
import * as n from "yup";
|
|
4
|
-
import { c as r } from "react/compiler-runtime";
|
|
5
|
-
import i, { clsx as a } from "clsx";
|
|
6
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
import { createRuntimeFn as c } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
8
|
-
import { Separator as l } from "@base-ui/react/separator";
|
|
9
|
-
//#region ../../libraries/react-collection/dist/components/collectionField/CollectionField.cssm.js
|
|
10
|
-
var u = "_1ompjs11", d = "_1d7f2b80", f = (e) => {
|
|
11
|
-
let t = r(8), n, a;
|
|
12
|
-
t[0] === e ? (n = t[1], a = t[2]) : ({className: n, ...a} = e, t[0] = e, t[1] = n, t[2] = a);
|
|
13
|
-
let s;
|
|
14
|
-
t[3] === n ? s = t[4] : (s = i(d, n), t[3] = n, t[4] = s);
|
|
15
|
-
let c;
|
|
16
|
-
return t[5] !== a || t[6] !== s ? (c = /* @__PURE__ */ o("label", {
|
|
17
|
-
"data-slot": "label",
|
|
18
|
-
className: s,
|
|
19
|
-
...a
|
|
20
|
-
}), t[5] = a, t[6] = s, t[7] = c) : c = t[7], c;
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region ../../libraries/react-collection/dist/components/collectionLabel/CollectionLabel.js
|
|
24
|
-
function p(e) {
|
|
25
|
-
let t = r(6), { label: n, isRequired: i, htmlFor: a } = e;
|
|
26
|
-
if (!n) return null;
|
|
27
|
-
let c;
|
|
28
|
-
t[0] === i ? c = t[1] : (c = i && /* @__PURE__ */ o("span", {
|
|
29
|
-
className: "_1ompjs10",
|
|
30
|
-
children: "*"
|
|
31
|
-
}), t[0] = i, t[1] = c);
|
|
32
|
-
let l;
|
|
33
|
-
return t[2] !== a || t[3] !== n || t[4] !== c ? (l = /* @__PURE__ */ s(f, {
|
|
34
|
-
htmlFor: a,
|
|
35
|
-
className: u,
|
|
36
|
-
children: [n, c]
|
|
37
|
-
}), t[2] = a, t[3] = n, t[4] = c, t[5] = l) : l = t[5], l;
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region ../../libraries/react-collection/dist/utils/getFieldValidations.js
|
|
41
|
-
var m = (r, i) => {
|
|
42
|
-
let a = (r?.label || r?.key || "")?.replace(/_/g, " ");
|
|
43
|
-
if (a?.endsWith("Id") && (a = a?.replace("Id", "")), a.includes(".")) {
|
|
44
|
-
let [e] = a.split(".");
|
|
45
|
-
e && (a = e);
|
|
46
|
-
}
|
|
47
|
-
let o = (e) => {
|
|
48
|
-
let t = e;
|
|
49
|
-
return r.max !== void 0 && r.max !== null && r.max !== "" && (t = t.max(Number(r.max), `The ${a} value is too large (max ${r.max})`)), r.min !== void 0 && r.min !== null && r.min !== "" && (t = t.min(Number(r.min), `The ${a} value is too small (min ${r.min})`)), t;
|
|
50
|
-
}, s;
|
|
51
|
-
switch (r.field_interface) {
|
|
52
|
-
case e.NumberWidget:
|
|
53
|
-
s = o(n.number());
|
|
54
|
-
break;
|
|
55
|
-
case e.ArrayWidget:
|
|
56
|
-
s = o(n.array().typeError("The field must be an array"));
|
|
57
|
-
break;
|
|
58
|
-
case e.RecordWidget:
|
|
59
|
-
s = n.object();
|
|
60
|
-
break;
|
|
61
|
-
case e.EmailWidget:
|
|
62
|
-
s = o(n.string().email("The email address is not valid"));
|
|
63
|
-
break;
|
|
64
|
-
case e.PhoneWidget:
|
|
65
|
-
s = o(n.string().test("phone", "The phone number has incorrect format", (e) => {
|
|
66
|
-
if (e) try {
|
|
67
|
-
return t(e);
|
|
68
|
-
} catch {
|
|
69
|
-
return !1;
|
|
70
|
-
}
|
|
71
|
-
return !0;
|
|
72
|
-
}));
|
|
73
|
-
break;
|
|
74
|
-
case e.URLWidget:
|
|
75
|
-
s = o(n.string().matches(/^(?:https?:\/\/)?(?:[a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+(?:\.[a-zA-Z]{2,})+(?:\/[^\s?#]*)?(?:\?[^\s]*)?$/, "The URL is not valid"));
|
|
76
|
-
break;
|
|
77
|
-
case e.ImageUploadWidget:
|
|
78
|
-
case e.FileUploadWidget:
|
|
79
|
-
case e.GeocoderWidget:
|
|
80
|
-
s = n.object();
|
|
81
|
-
break;
|
|
82
|
-
case e.MultiImageUploadWidget:
|
|
83
|
-
case e.MultiFileUploadWidget:
|
|
84
|
-
case e.MultiGeocoderWidget:
|
|
85
|
-
s = n.array().of(n.object());
|
|
86
|
-
break;
|
|
87
|
-
case e.JSONWidget:
|
|
88
|
-
case e.DropdownWidget:
|
|
89
|
-
s = n.string();
|
|
90
|
-
break;
|
|
91
|
-
case e.MultiTextWidget:
|
|
92
|
-
case e.MultiDropdownWidget:
|
|
93
|
-
case e.CheckboxWidget:
|
|
94
|
-
s = n.array().of(n.string());
|
|
95
|
-
break;
|
|
96
|
-
case e.ToggleCheckboxWidget:
|
|
97
|
-
s = n.boolean();
|
|
98
|
-
break;
|
|
99
|
-
case e.CollectionWidget:
|
|
100
|
-
s = r.options.current_have_many_connected ? n.array() : n.object();
|
|
101
|
-
break;
|
|
102
|
-
default:
|
|
103
|
-
s = o(n.string());
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
if (r.options?.validationsPresets && Array.isArray(r.options.validationsPresets)) {
|
|
107
|
-
let t = r.options.validationsPresets;
|
|
108
|
-
(r.field_interface === e.TextWidget || r.field_interface === e.TextareaWidget) && (t.includes("exclude_special_chars") && (s = s.matches(/^[a-zA-Z0-9\s]*$/, "Special characters are not allowed")), t.includes("exclude_numbers") && (s = s.matches(/^[^0-9]*$/, "Numbers are not allowed")));
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
required: {
|
|
112
|
-
value: !!r?.required,
|
|
113
|
-
message: `The ${a} field is required`
|
|
114
|
-
},
|
|
115
|
-
validate: (e) => {
|
|
116
|
-
if (r?.options?.disableValidation || e === "" || e == null) return !0;
|
|
117
|
-
try {
|
|
118
|
-
return s.validateSync(e), i ? i(e) : !0;
|
|
119
|
-
} catch (e) {
|
|
120
|
-
return e instanceof n.ValidationError ? e.message : !0;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}, h = c({
|
|
125
|
-
defaultClassName: "_11sljvf3",
|
|
126
|
-
variantClassNames: { orientation: {
|
|
127
|
-
vertical: "_11sljvf4",
|
|
128
|
-
horizontal: "_11sljvf5"
|
|
129
|
-
} },
|
|
130
|
-
defaultVariants: { orientation: "vertical" },
|
|
131
|
-
compoundVariants: []
|
|
132
|
-
}), g = "_11sljvf9", _ = "_11sljvfc", v = "_11sljvfd", y = c({
|
|
133
|
-
defaultClassName: "d292um0",
|
|
134
|
-
variantClassNames: { orientation: {
|
|
135
|
-
horizontal: "d292um1",
|
|
136
|
-
vertical: "d292um2"
|
|
137
|
-
} },
|
|
138
|
-
defaultVariants: {},
|
|
139
|
-
compoundVariants: []
|
|
140
|
-
});
|
|
141
|
-
//#endregion
|
|
142
|
-
//#region ../../libraries/levocn/dist/ui/separator/Separator.js
|
|
143
|
-
function b(e) {
|
|
144
|
-
let t = r(11), n, a, s;
|
|
145
|
-
t[0] === e ? (n = t[1], a = t[2], s = t[3]) : ({className: n, orientation: s, ...a} = e, t[0] = e, t[1] = n, t[2] = a, t[3] = s);
|
|
146
|
-
let c = s === void 0 ? "horizontal" : s, u;
|
|
147
|
-
t[4] !== n || t[5] !== c ? (u = i(y({ orientation: c }), n), t[4] = n, t[5] = c, t[6] = u) : u = t[6];
|
|
148
|
-
let d;
|
|
149
|
-
return t[7] !== c || t[8] !== a || t[9] !== u ? (d = /* @__PURE__ */ o(l, {
|
|
150
|
-
"data-slot": "separator",
|
|
151
|
-
orientation: c,
|
|
152
|
-
className: u,
|
|
153
|
-
...a
|
|
154
|
-
}), t[7] = c, t[8] = a, t[9] = u, t[10] = d) : d = t[10], d;
|
|
155
|
-
}
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region ../../libraries/levocn/dist/ui/field/Field.js
|
|
158
|
-
function x(e) {
|
|
159
|
-
let t = r(11), n, i, s;
|
|
160
|
-
t[0] === e ? (n = t[1], i = t[2], s = t[3]) : ({className: n, orientation: s, ...i} = e, t[0] = e, t[1] = n, t[2] = i, t[3] = s);
|
|
161
|
-
let c = s === void 0 ? "vertical" : s, l;
|
|
162
|
-
t[4] !== n || t[5] !== c ? (l = a(h({ orientation: c }), n), t[4] = n, t[5] = c, t[6] = l) : l = t[6];
|
|
163
|
-
let u;
|
|
164
|
-
return t[7] !== c || t[8] !== i || t[9] !== l ? (u = /* @__PURE__ */ o("div", {
|
|
165
|
-
role: "group",
|
|
166
|
-
"data-slot": "field",
|
|
167
|
-
"data-orientation": c,
|
|
168
|
-
className: l,
|
|
169
|
-
...i
|
|
170
|
-
}), t[7] = c, t[8] = i, t[9] = l, t[10] = u) : u = t[10], u;
|
|
171
|
-
}
|
|
172
|
-
function S(e) {
|
|
173
|
-
let t = r(8), n, i;
|
|
174
|
-
t[0] === e ? (n = t[1], i = t[2]) : ({className: n, ...i} = e, t[0] = e, t[1] = n, t[2] = i);
|
|
175
|
-
let s;
|
|
176
|
-
t[3] === n ? s = t[4] : (s = a(g, n), t[3] = n, t[4] = s);
|
|
177
|
-
let c;
|
|
178
|
-
return t[5] !== i || t[6] !== s ? (c = /* @__PURE__ */ o("p", {
|
|
179
|
-
"data-slot": "field-description",
|
|
180
|
-
className: s,
|
|
181
|
-
...i
|
|
182
|
-
}), t[5] = i, t[6] = s, t[7] = c) : c = t[7], c;
|
|
183
|
-
}
|
|
184
|
-
function C(e) {
|
|
185
|
-
let t = r(15), n, i, s, c;
|
|
186
|
-
t[0] === e ? (n = t[1], i = t[2], s = t[3], c = t[4]) : ({className: i, children: n, errors: s, ...c} = e, t[0] = e, t[1] = n, t[2] = i, t[3] = s, t[4] = c);
|
|
187
|
-
let l;
|
|
188
|
-
bb0: {
|
|
189
|
-
if (n) {
|
|
190
|
-
l = n;
|
|
191
|
-
break bb0;
|
|
192
|
-
}
|
|
193
|
-
if (!s?.length) {
|
|
194
|
-
l = null;
|
|
195
|
-
break bb0;
|
|
196
|
-
}
|
|
197
|
-
let e;
|
|
198
|
-
t[5] === s ? e = t[6] : (e = [...new Map(s.map(T)).values()], t[5] = s, t[6] = e);
|
|
199
|
-
let r = e;
|
|
200
|
-
if (r.length === 1) {
|
|
201
|
-
l = r[0]?.message;
|
|
202
|
-
break bb0;
|
|
203
|
-
}
|
|
204
|
-
let i;
|
|
205
|
-
t[7] === r ? i = t[8] : (i = /* @__PURE__ */ o("ul", {
|
|
206
|
-
className: v,
|
|
207
|
-
children: r.map(w)
|
|
208
|
-
}), t[7] = r, t[8] = i), l = i;
|
|
209
|
-
}
|
|
210
|
-
let u = l;
|
|
211
|
-
if (!u) return null;
|
|
212
|
-
let d;
|
|
213
|
-
t[9] === i ? d = t[10] : (d = a(_, i), t[9] = i, t[10] = d);
|
|
214
|
-
let f;
|
|
215
|
-
return t[11] !== u || t[12] !== c || t[13] !== d ? (f = /* @__PURE__ */ o("div", {
|
|
216
|
-
role: "alert",
|
|
217
|
-
"data-slot": "field-error",
|
|
218
|
-
className: d,
|
|
219
|
-
...c,
|
|
220
|
-
children: u
|
|
221
|
-
}), t[11] = u, t[12] = c, t[13] = d, t[14] = f) : f = t[14], f;
|
|
222
|
-
}
|
|
223
|
-
function w(e, t) {
|
|
224
|
-
return e?.message && /* @__PURE__ */ o("li", { children: e.message }, t);
|
|
225
|
-
}
|
|
226
|
-
function T(e) {
|
|
227
|
-
return [e?.message, e];
|
|
228
|
-
}
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region ../../libraries/react-collection/dist/components/collectionField/CollectionField.js
|
|
231
|
-
function E(e) {
|
|
232
|
-
let t = r(21), { label: n, error: a, helperText: c, topHelperText: l, isRequired: u, readOnly: d, htmlFor: f, className: m, children: h, ref: g } = e, _ = d && "_1ompjs14", v;
|
|
233
|
-
t[0] !== m || t[1] !== _ ? (v = i(_, m), t[0] = m, t[1] = _, t[2] = v) : v = t[2];
|
|
234
|
-
let y;
|
|
235
|
-
t[3] !== f || t[4] !== u || t[5] !== n ? (y = /* @__PURE__ */ o(p, {
|
|
236
|
-
label: n,
|
|
237
|
-
isRequired: u,
|
|
238
|
-
htmlFor: f
|
|
239
|
-
}), t[3] = f, t[4] = u, t[5] = n, t[6] = y) : y = t[6];
|
|
240
|
-
let b;
|
|
241
|
-
t[7] === l ? b = t[8] : (b = !!l && /* @__PURE__ */ o(S, {
|
|
242
|
-
className: "_1ompjs12",
|
|
243
|
-
children: l
|
|
244
|
-
}), t[7] = l, t[8] = b);
|
|
245
|
-
let w;
|
|
246
|
-
t[9] === a ? w = t[10] : (w = !!a && /* @__PURE__ */ o(C, {
|
|
247
|
-
className: "_1ompjs13",
|
|
248
|
-
children: a
|
|
249
|
-
}), t[9] = a, t[10] = w);
|
|
250
|
-
let T;
|
|
251
|
-
t[11] === c ? T = t[12] : (T = !!c && /* @__PURE__ */ o(S, {
|
|
252
|
-
className: "_1ompjs12",
|
|
253
|
-
children: c
|
|
254
|
-
}), t[11] = c, t[12] = T);
|
|
255
|
-
let E;
|
|
256
|
-
return t[13] !== h || t[14] !== g || t[15] !== v || t[16] !== y || t[17] !== b || t[18] !== w || t[19] !== T ? (E = /* @__PURE__ */ s(x, {
|
|
257
|
-
ref: g,
|
|
258
|
-
orientation: "vertical",
|
|
259
|
-
className: v,
|
|
260
|
-
children: [
|
|
261
|
-
y,
|
|
262
|
-
b,
|
|
263
|
-
h,
|
|
264
|
-
w,
|
|
265
|
-
T
|
|
266
|
-
]
|
|
267
|
-
}), t[13] = h, t[14] = g, t[15] = v, t[16] = y, t[17] = b, t[18] = w, t[19] = T, t[20] = E) : E = t[20], E;
|
|
268
|
-
}
|
|
269
|
-
//#endregion
|
|
270
|
-
export { f as a, p as i, b as n, m as r, E as t };
|