@levo-so/studio 0.1.100 → 0.1.102
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/Beams-DkcjMVZl.js +102 -0
- package/{BillingStep-Brc1Mzo3.js → BillingStep-BTRobf00.js} +1 -1
- package/{Button-XTKnNIl9.js → Button-DTrN8kki.js} +32 -18
- package/{Input-Btdc1Dee.js → CollectionField-7uXvhxYK.js} +57 -76
- package/CollectionInput-lHOvWWav.js +147 -0
- package/{DateTimeWidget-B5lBr0_R.js → DateTimeWidget-BHCP5osb.js} +9 -9
- package/Dots-BrEPvoj3.js +100 -0
- package/{EntryCard-CYdsSkIk.js → EntryCard-CqZlbw1Z.js} +6 -6
- package/Grid-B4XWU9eL.js +99 -0
- package/{LoginCard-5LaKaFCO.js → LoginCard-DWLnYJJU.js} +3 -3
- package/{LoginForm-Ck-xFaDg.js → LoginForm-CEUbBeE3.js} +23 -22
- package/{LoginModal-BdYM8INu.js → LoginModal-AWNLO49X.js} +3 -3
- package/{MessageCard-ChDBqLVG.js → MessageCard-C5ULcfuw.js} +2 -2
- package/{MessageFooter-AzAtJWMo.js → MessageFooter-CATwNJJU.js} +1 -1
- package/{ModalManager-SggxCIno.js → ModalManager-DQXhkmyC.js} +1 -1
- package/{PendingApprovalCard-z2sdLyCa.js → PendingApprovalCard-BowwZMBu.js} +3 -3
- package/{PhoneWidget-1ffYuESC.js → PhoneWidget-C6uZmrk8.js} +3 -3
- package/{Popover-BdKCElnb.js → Popover-Du4iigVw.js} +1 -1
- package/RichTextWidget-iYdVRBGB.js +112 -0
- package/Toolbar-BHi_B-nE.js +737 -0
- package/{Tooltip-BOq5vSOW.js → Tooltip-K_gFzjOa.js} +1 -1
- package/{VerifyButton-CdPQqtc2.js → VerifyButton-D21AOIX3.js} +92 -103
- package/authentication-fXmNYss1.js +36 -0
- package/{bookingCard-D3ZSjq-P.js → bookingCard--NlgtcJs.js} +3 -3
- package/collection.d.ts +83 -0
- package/collection.js +9 -8
- package/{dist-ir7pIkAm.js → dist-x5VFEnQl.js} +1167 -1097
- package/index.d.ts +43 -12
- package/index.js +1517 -1441
- package/inlineRteTheme-Cn_Vqgsm.js +23 -0
- package/{nodeAlignment-BZbdafVA.js → nodeAlignment-DoVbjk29.js} +39 -60
- package/package.json +2 -2
- package/studio.css +1 -1
- package/useLogin-D2VCOHYI.js +127 -0
- package/{utils-CsfPGq4R.js → utils-Bh9uGjo1.js} +1 -1
- package/{widgets-DD4OjK2Y.js → widgets-CG5Z_dk7.js} +49 -54
- package/Beams-B0O3uyYF.js +0 -118
- package/CollectionInput-cmJ0RXzG.js +0 -132
- package/Dots-DjezbpLp.js +0 -137
- package/Grid-C9aUfXM-.js +0 -145
- package/RichTextWidget-CjEoGecM.js +0 -1136
- /package/{Gradient-B1K9Yi04.js → Gradient-B4Er9hym.js} +0 -0
- /package/{StripePaymentModal-BHIBBvRj.js → StripePaymentModal-DC-ySB_o.js} +0 -0
- /package/{Waves-BkaAfGqA.js → Waves-kW-EBDdJ.js} +0 -0
- /package/{card-BQr9258p.js → card-BwNr7kQS.js} +0 -0
- /package/{dialog-Dw6n_36P.js → dialog-CCWrvmHd.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e } from "./getFieldValidations-DZnDgNI0.js";
|
|
2
|
-
import {
|
|
2
|
+
import { d as t } from "./CollectionField-7uXvhxYK.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
import { c as i } from "react/compiler-runtime";
|
|
5
5
|
import a from "clsx";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { n as e } from "./getFieldValidations-DZnDgNI0.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as n } from "./CollectionInput-
|
|
3
|
+
import { u as t } from "./CollectionField-7uXvhxYK.js";
|
|
4
|
+
import { t as n } from "./CollectionInput-lHOvWWav.js";
|
|
5
5
|
import { useEffect as r, useState as i } from "react";
|
|
6
6
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
import { errorToast as c, successToast as l, useLevo as u } from "@levo-so/react";
|
|
@@ -22,7 +22,7 @@ var _ = "_1k4xirc1", v = (e) => {
|
|
|
22
22
|
className: i,
|
|
23
23
|
...r
|
|
24
24
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
25
|
-
}, y = "
|
|
25
|
+
}, y = "_6o7s4x0", b = "qkytrb0", x = "qkytrb1", S = "qkytrb2", C = "qkytrb3", w = "qkytrb4", T = "qkytrb5", E = "qkytrb6", D = "ch8h0x0", O = "ch8h0x1", k = "ch8h0x2", A = "ch8h0x3", j = "ch8h0x5", M = (e) => {
|
|
26
26
|
let t = d(4), n;
|
|
27
27
|
t[0] === e ? n = t[1] : ({...n} = e, t[0] = e, t[1] = n);
|
|
28
28
|
let r;
|
|
@@ -30,7 +30,7 @@ var _ = "_1k4xirc1", v = (e) => {
|
|
|
30
30
|
"data-slot": "dialog",
|
|
31
31
|
...n
|
|
32
32
|
}), t[2] = n, t[3] = r), r;
|
|
33
|
-
},
|
|
33
|
+
}, N = (t) => {
|
|
34
34
|
let n = d(5), r;
|
|
35
35
|
n[0] === t ? r = n[1] : ({...r} = t, n[0] = t, n[1] = r);
|
|
36
36
|
let { portalRef: i } = e(), a;
|
|
@@ -38,36 +38,22 @@ var _ = "_1k4xirc1", v = (e) => {
|
|
|
38
38
|
container: i,
|
|
39
39
|
...r
|
|
40
40
|
}), n[2] = i, n[3] = r, n[4] = a) : a = n[4], a;
|
|
41
|
-
},
|
|
41
|
+
}, P = (e) => {
|
|
42
42
|
let t = d(8), n, r;
|
|
43
43
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
44
44
|
let i;
|
|
45
|
-
t[3] === n ? i = t[4] : (i = f(
|
|
45
|
+
t[3] === n ? i = t[4] : (i = f(O, n), t[3] = n, t[4] = i);
|
|
46
46
|
let a;
|
|
47
47
|
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ o(g.Viewport, {
|
|
48
48
|
"data-slot": "dialog-viewport",
|
|
49
49
|
className: i,
|
|
50
50
|
...r
|
|
51
51
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
52
|
-
}, P = (e) => {
|
|
53
|
-
let n = d(10), r, i, a;
|
|
54
|
-
n[0] === e ? (r = n[1], i = n[2], a = n[3]) : ({variant: a, size: i, ...r} = e, n[0] = e, n[1] = r, n[2] = i, n[3] = a);
|
|
55
|
-
let s;
|
|
56
|
-
n[4] !== i || n[5] !== a ? (s = /* @__PURE__ */ o(t, {
|
|
57
|
-
variant: a,
|
|
58
|
-
size: i
|
|
59
|
-
}), n[4] = i, n[5] = a, n[6] = s) : s = n[6];
|
|
60
|
-
let c;
|
|
61
|
-
return n[7] !== r || n[8] !== s ? (c = /* @__PURE__ */ o(g.Close, {
|
|
62
|
-
"data-slot": "dialog-close",
|
|
63
|
-
render: s,
|
|
64
|
-
...r
|
|
65
|
-
}), n[7] = r, n[8] = s, n[9] = c) : c = n[9], c;
|
|
66
52
|
}, F = (e) => {
|
|
67
53
|
let t = d(8), n, r;
|
|
68
54
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
69
55
|
let i;
|
|
70
|
-
t[3] === n ? i = t[4] : (i = f(
|
|
56
|
+
t[3] === n ? i = t[4] : (i = f(D, n), t[3] = n, t[4] = i);
|
|
71
57
|
let a;
|
|
72
58
|
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ o(g.Backdrop, {
|
|
73
59
|
"data-slot": "dialog-backdrop",
|
|
@@ -78,7 +64,7 @@ var _ = "_1k4xirc1", v = (e) => {
|
|
|
78
64
|
let n = d(14), r, i, a, c;
|
|
79
65
|
n[0] === e ? (r = n[1], i = n[2], a = n[3], c = n[4]) : ({className: i, children: r, showCloseButton: c, ...a} = e, n[0] = e, n[1] = r, n[2] = i, n[3] = a, n[4] = c);
|
|
80
66
|
let l = c === void 0 ? !0 : c, u;
|
|
81
|
-
n[5] === i ? u = n[6] : (u = f(
|
|
67
|
+
n[5] === i ? u = n[6] : (u = f(k, i), n[5] = i, n[6] = u);
|
|
82
68
|
let p;
|
|
83
69
|
n[7] === l ? p = n[8] : (p = l && /* @__PURE__ */ o(g.Close, {
|
|
84
70
|
"data-slot": "dialog-close",
|
|
@@ -101,7 +87,7 @@ var _ = "_1k4xirc1", v = (e) => {
|
|
|
101
87
|
let t = d(8), n, r;
|
|
102
88
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
103
89
|
let i;
|
|
104
|
-
t[3] === n ? i = t[4] : (i = f(
|
|
90
|
+
t[3] === n ? i = t[4] : (i = f(A, n), t[3] = n, t[4] = i);
|
|
105
91
|
let a;
|
|
106
92
|
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ o("div", {
|
|
107
93
|
"data-slot": "dialog-header",
|
|
@@ -112,7 +98,7 @@ var _ = "_1k4xirc1", v = (e) => {
|
|
|
112
98
|
let t = d(8), n, r;
|
|
113
99
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
114
100
|
let i;
|
|
115
|
-
t[3] === n ? i = t[4] : (i = f(
|
|
101
|
+
t[3] === n ? i = t[4] : (i = f(j, n), t[3] = n, t[4] = i);
|
|
116
102
|
let a;
|
|
117
103
|
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ o(g.Title, {
|
|
118
104
|
"data-slot": "dialog-title",
|
|
@@ -125,108 +111,111 @@ var _ = "_1k4xirc1", v = (e) => {
|
|
|
125
111
|
let c = a === void 0 ? !0 : a, l;
|
|
126
112
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ o(F, {}), t[5] = l) : l = t[5];
|
|
127
113
|
let u;
|
|
128
|
-
return t[6] !== n || t[7] !== r || t[8] !== i || t[9] !== c ? (u = /* @__PURE__ */ s(
|
|
114
|
+
return t[6] !== n || t[7] !== r || t[8] !== i || t[9] !== c ? (u = /* @__PURE__ */ s(N, { children: [l, /* @__PURE__ */ o(P, { children: /* @__PURE__ */ o(I, {
|
|
129
115
|
className: r,
|
|
130
116
|
showCloseButton: c,
|
|
131
117
|
...i,
|
|
132
118
|
children: n
|
|
133
119
|
}) })] }), t[6] = n, t[7] = r, t[8] = i, t[9] = c, t[10] = u) : u = t[10], u;
|
|
134
120
|
}, B = ({ isOpen: e, onClose: a, value: d, type: f = "email", onVerifySuccess: p }) => {
|
|
135
|
-
let { membership: m } = u(), [h, g] = i(""), [_, v] = i(!1), [
|
|
121
|
+
let { membership: m } = u(), [h, g] = i(""), [_, v] = i(!1), [D, O] = i(!1), [k, A] = i(30);
|
|
136
122
|
return r(() => {
|
|
137
123
|
let t;
|
|
138
|
-
return e &&
|
|
139
|
-
|
|
124
|
+
return e && k > 0 && (t = setInterval(() => {
|
|
125
|
+
A((e) => e - 1);
|
|
140
126
|
}, 1e3)), () => clearInterval(t);
|
|
141
|
-
}, [e,
|
|
142
|
-
e && (g(""),
|
|
143
|
-
}, [e]), /* @__PURE__ */ o(
|
|
127
|
+
}, [e, k]), r(() => {
|
|
128
|
+
e && (g(""), A(30), v(!1), O(!1));
|
|
129
|
+
}, [e]), /* @__PURE__ */ o(M, {
|
|
144
130
|
open: e,
|
|
145
131
|
onOpenChange: (e) => {
|
|
146
132
|
e || a();
|
|
147
133
|
},
|
|
148
|
-
children: /* @__PURE__ */ s(z, {
|
|
134
|
+
children: /* @__PURE__ */ s(z, {
|
|
149
135
|
className: y,
|
|
150
|
-
children: [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
136
|
+
children: [/* @__PURE__ */ o(L, { children: /* @__PURE__ */ o(R, { children: `Verify ${f === "email" ? "Email" : "Phone"}` }) }), /* @__PURE__ */ s("div", {
|
|
137
|
+
className: b,
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ s("div", {
|
|
140
|
+
className: x,
|
|
141
|
+
children: [
|
|
142
|
+
"Enter the 4-digit code sent to ",
|
|
143
|
+
/* @__PURE__ */ o("strong", { children: d }),
|
|
144
|
+
".",
|
|
145
|
+
" ",
|
|
146
|
+
/* @__PURE__ */ o("button", {
|
|
147
|
+
onClick: () => a(),
|
|
148
|
+
className: S,
|
|
149
|
+
children: "Change?"
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ o("div", {
|
|
154
|
+
className: C,
|
|
155
|
+
children: /* @__PURE__ */ o(n, {
|
|
156
|
+
value: h,
|
|
157
|
+
onChange: (e) => {
|
|
158
|
+
g(e.target.value.replace(/\D/g, "").slice(0, 4));
|
|
159
|
+
},
|
|
160
|
+
placeholder: "0000",
|
|
161
|
+
maxLength: 4,
|
|
162
|
+
className: T
|
|
162
163
|
})
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
children: /* @__PURE__ */ o(n, {
|
|
168
|
-
value: h,
|
|
169
|
-
onChange: (e) => {
|
|
170
|
-
g(e.target.value.replace(/\D/g, "").slice(0, 4));
|
|
171
|
-
},
|
|
172
|
-
placeholder: "0000",
|
|
173
|
-
maxLength: 4,
|
|
174
|
-
className: w
|
|
175
|
-
})
|
|
176
|
-
}),
|
|
177
|
-
/* @__PURE__ */ s("div", {
|
|
178
|
-
className: C,
|
|
179
|
-
children: [/* @__PURE__ */ o(t, {
|
|
180
|
-
onClick: async () => {
|
|
181
|
-
if (!(!h || h.length !== 4)) {
|
|
182
|
-
v(!0);
|
|
183
|
-
try {
|
|
184
|
-
await m?.signInWithOtp({
|
|
185
|
-
content: d,
|
|
186
|
-
code: h
|
|
187
|
-
}), l("Verification successful"), p(d), a();
|
|
188
|
-
} catch (e) {
|
|
189
|
-
let t = e;
|
|
190
|
-
c(t?.message || "Invalid OTP", t?.title || "Verification Failed");
|
|
191
|
-
} finally {
|
|
192
|
-
v(!1);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
disabled: h.length !== 4 || _,
|
|
197
|
-
className: "w-full",
|
|
198
|
-
children: _ ? "Verifying..." : "Verify"
|
|
199
|
-
}), /* @__PURE__ */ o("div", {
|
|
200
|
-
className: T,
|
|
201
|
-
children: O > 0 ? /* @__PURE__ */ s("span", { children: [
|
|
202
|
-
"Resend code in ",
|
|
203
|
-
O,
|
|
204
|
-
"s"
|
|
205
|
-
] }) : /* @__PURE__ */ o("button", {
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ s("div", {
|
|
166
|
+
className: w,
|
|
167
|
+
children: [/* @__PURE__ */ o(t, {
|
|
206
168
|
onClick: async () => {
|
|
207
|
-
if (!(
|
|
208
|
-
|
|
169
|
+
if (!(!h || h.length !== 4)) {
|
|
170
|
+
v(!0);
|
|
209
171
|
try {
|
|
210
|
-
await m?.
|
|
172
|
+
await m?.signInWithOtp({
|
|
211
173
|
content: d,
|
|
212
|
-
|
|
213
|
-
}), l("
|
|
174
|
+
code: h
|
|
175
|
+
}), l("Verification successful"), p(d), a();
|
|
214
176
|
} catch (e) {
|
|
215
177
|
let t = e;
|
|
216
|
-
c(t?.message || "
|
|
178
|
+
c(t?.message || "Invalid OTP", t?.title || "Verification Failed");
|
|
217
179
|
} finally {
|
|
218
|
-
|
|
180
|
+
v(!1);
|
|
219
181
|
}
|
|
220
182
|
}
|
|
221
183
|
},
|
|
222
|
-
disabled:
|
|
223
|
-
className:
|
|
224
|
-
children:
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
184
|
+
disabled: h.length !== 4 || _,
|
|
185
|
+
className: "w-full",
|
|
186
|
+
children: _ ? "Verifying..." : "Verify"
|
|
187
|
+
}), /* @__PURE__ */ o("div", {
|
|
188
|
+
className: E,
|
|
189
|
+
children: k > 0 ? /* @__PURE__ */ s("span", { children: [
|
|
190
|
+
"Resend code in ",
|
|
191
|
+
k,
|
|
192
|
+
"s"
|
|
193
|
+
] }) : /* @__PURE__ */ o("button", {
|
|
194
|
+
onClick: async () => {
|
|
195
|
+
if (!(k > 0)) {
|
|
196
|
+
O(!0);
|
|
197
|
+
try {
|
|
198
|
+
await m?.requestOtp({
|
|
199
|
+
content: d,
|
|
200
|
+
medium: f === "phone" ? "whatsapp" : "email"
|
|
201
|
+
}), l("OTP resent successfully"), A(30);
|
|
202
|
+
} catch (e) {
|
|
203
|
+
let t = e;
|
|
204
|
+
c(t?.message || "Failed to resend OTP", t?.title || "Error");
|
|
205
|
+
} finally {
|
|
206
|
+
O(!1);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
disabled: D,
|
|
211
|
+
className: S,
|
|
212
|
+
children: D ? "Resending..." : "Resend Code"
|
|
213
|
+
})
|
|
214
|
+
})]
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
})]
|
|
218
|
+
})
|
|
230
219
|
});
|
|
231
220
|
}, V = "jfrbe10", H = "jfrbe11", U = "jfrbe12", W = ({ value: e, type: n, isVerified: r, onVerifySuccess: l, onStateChange: d }) => {
|
|
232
221
|
let { membership: f } = u(), [m, h] = i(!1), [g, _] = i(!1), y = (e) => {
|
|
@@ -281,4 +270,4 @@ var _ = "_1k4xirc1", v = (e) => {
|
|
|
281
270
|
})] });
|
|
282
271
|
};
|
|
283
272
|
//#endregion
|
|
284
|
-
export {
|
|
273
|
+
export { M as a, R as i, L as n, y as o, z as r, v as s, W as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/constants/authentication.ts
|
|
2
|
+
var e = [
|
|
3
|
+
{
|
|
4
|
+
value: "otp",
|
|
5
|
+
label: "Email OTP",
|
|
6
|
+
category: "primary"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
value: "magiclink",
|
|
10
|
+
label: "Magic Link",
|
|
11
|
+
category: "primary"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: "whatsapp",
|
|
15
|
+
label: "WhatsApp",
|
|
16
|
+
category: "primary"
|
|
17
|
+
}
|
|
18
|
+
], t = [
|
|
19
|
+
{
|
|
20
|
+
value: "google",
|
|
21
|
+
label: "Google",
|
|
22
|
+
category: "alternate"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "microsoft",
|
|
26
|
+
label: "Microsoft",
|
|
27
|
+
category: "alternate"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "linkedin",
|
|
31
|
+
label: "LinkedIn",
|
|
32
|
+
category: "alternate"
|
|
33
|
+
}
|
|
34
|
+
], n = [...e, ...t], r = e.map((e) => e.value), i = t.map((e) => e.value), a = (e) => r.includes(e), o = (e) => i.includes(e), s = "membership.account.ACCOUNT_PENDING_APPROVAL", c = (e) => e ? e === "membership.account.ACCOUNT_PENDING_APPROVAL" || e.includes("ACCOUNT_PENDING_APPROVAL") : !1;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { e as a, c, s as i, a as l, t as n, r as o, n as r, o as s, i as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { n as e } from "./AuthProvider-56TywIOB.js";
|
|
3
|
-
import { t } from "./Button-
|
|
4
|
-
import { n, t as r } from "./StripePaymentModal-
|
|
5
|
-
import { BillingStep as ee } from "./BillingStep-
|
|
3
|
+
import { t } from "./Button-DTrN8kki.js";
|
|
4
|
+
import { n, t as r } from "./StripePaymentModal-DC-ySB_o.js";
|
|
5
|
+
import { BillingStep as ee } from "./BillingStep-BTRobf00.js";
|
|
6
6
|
import { useRef as i, useState as a } from "react";
|
|
7
7
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
import { cn as te, errorHandler as l, useLevo as u } from "@levo-so/react";
|
package/collection.d.ts
CHANGED
|
@@ -2,20 +2,31 @@ import { AsyncPaginateProps } from 'react-select-async-paginate';
|
|
|
2
2
|
import { CommonFieldInterfacesList } from '@levo-so/core';
|
|
3
3
|
import { CSSProperties } from 'react';
|
|
4
4
|
import { default as default_2 } from 'react';
|
|
5
|
+
import { Extension } from '@tiptap/core';
|
|
5
6
|
import { FieldInterfacesList } from '@levo-so/core';
|
|
6
7
|
import { FieldKindList } from '@levo-so/core';
|
|
7
8
|
import { FieldValues } from 'react-hook-form';
|
|
9
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
10
|
+
import { Icon } from '@tabler/icons-react';
|
|
8
11
|
import { IFieldError } from '@levo-so/core';
|
|
9
12
|
import { ILemaCollection } from '@levo-so/core';
|
|
10
13
|
import { ILemaField } from '@levo-so/core';
|
|
11
14
|
import { ILemaFieldOptions } from '@levo-so/core';
|
|
12
15
|
import { ILevoMembership } from '@levo-so/core';
|
|
13
16
|
import { JSX } from 'react/jsx-runtime';
|
|
17
|
+
import { Mark } from '@tiptap/core';
|
|
14
18
|
import { MediaKindList } from '@levo-so/core';
|
|
19
|
+
import { PlaceholderOptions } from '@tiptap/extensions';
|
|
15
20
|
import { ReactElement } from 'react';
|
|
16
21
|
import { RecipeVariants } from '@vanilla-extract/recipes';
|
|
22
|
+
import { RefAttributes } from 'react';
|
|
17
23
|
import { RegisterOptions } from 'react-hook-form';
|
|
18
24
|
import { RuntimeFn } from '@vanilla-extract/recipes';
|
|
25
|
+
import { SelectionOptions } from '@tiptap/extensions';
|
|
26
|
+
import { StarterKitOptions } from '@tiptap/starter-kit';
|
|
27
|
+
import { SuperscriptExtensionOptions } from '@tiptap/extension-superscript';
|
|
28
|
+
import { TypographyOptions } from '@tiptap/extension-typography';
|
|
29
|
+
import { UniqueIDOptions } from '@tiptap/extension-unique-id';
|
|
19
30
|
import { UseFormReturn } from 'react-hook-form';
|
|
20
31
|
import { UseFormSetError } from 'react-hook-form';
|
|
21
32
|
|
|
@@ -23,6 +34,15 @@ export declare const areAllFieldsHidden: (fields: ILemaField[]) => boolean;
|
|
|
23
34
|
|
|
24
35
|
export declare const AsyncSelectPaginate: default_2.FC<AsyncPaginateProps<any, any, any, any>>;
|
|
25
36
|
|
|
37
|
+
/**
|
|
38
|
+
* `children` are rendered as an extra trailing group, separated from the
|
|
39
|
+
* built-in clusters by a vertical divider. Lets host apps (e.g. dashboard)
|
|
40
|
+
* append AI / variables / custom buttons without re-implementing the rest.
|
|
41
|
+
*/
|
|
42
|
+
export declare const CollectionEditorToolbar: React.FC<{
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
}>;
|
|
45
|
+
|
|
26
46
|
/**
|
|
27
47
|
* Collection-scoped field wrapper.
|
|
28
48
|
* Composes levocn Field primitives with collection theme overrides.
|
|
@@ -67,6 +87,9 @@ export declare function CollectionLabel({ label, isRequired, htmlFor, }: {
|
|
|
67
87
|
|
|
68
88
|
export declare const createWidget: (component: WidgetComponent) => WidgetComponent;
|
|
69
89
|
|
|
90
|
+
/** Curated list of currency symbols available to schema authors. */
|
|
91
|
+
export declare const CURRENCY_SYMBOLS: ICurrencySymbolOption[];
|
|
92
|
+
|
|
70
93
|
export declare const DEFAULT_WIDGET_REGISTRY: IWidgetRegistry;
|
|
71
94
|
|
|
72
95
|
export declare const errorsToParam: (data: Record<string, string[]>) => ParamError[];
|
|
@@ -141,6 +164,18 @@ export declare const FormVariantOptions: readonly [{
|
|
|
141
164
|
|
|
142
165
|
export declare type FormVariantType = (typeof FormVariantOptions)[number]["value"];
|
|
143
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Extensions for the collection form rich text editor.
|
|
169
|
+
*
|
|
170
|
+
* Mirrors the legacy editor-package kit: StarterKit minus blockquote,
|
|
171
|
+
* codeBlock and horizontalRule (collection forms never used these), with
|
|
172
|
+
* super/subscript marks, unique IDs for diffable nodes, typography
|
|
173
|
+
* shortcuts, selection decoration, and node-level alignment.
|
|
174
|
+
*/
|
|
175
|
+
export declare const getCollectionEditorExtensions: (options?: {
|
|
176
|
+
placeholder?: string;
|
|
177
|
+
}) => (Extension<StarterKitOptions, any> | Extension<PlaceholderOptions, any> | Extension<TypographyOptions, any> | Extension<SelectionOptions, any> | Mark<SuperscriptExtensionOptions, any> | Extension<NodeAlignmentOptions, any> | Extension<UniqueIDOptions, any>)[];
|
|
178
|
+
|
|
144
179
|
export declare const getDefaultFieldValues: (fields: ILemaField[]) => Record<string, unknown>;
|
|
145
180
|
|
|
146
181
|
export declare const getDefaultValuesByKind: (schema: ILemaCollection | null) => Record<string, unknown>;
|
|
@@ -207,6 +242,12 @@ declare interface ICommonRendererProps {
|
|
|
207
242
|
};
|
|
208
243
|
}
|
|
209
244
|
|
|
245
|
+
export declare interface ICurrencySymbolOption {
|
|
246
|
+
label: string;
|
|
247
|
+
value: string;
|
|
248
|
+
code: string;
|
|
249
|
+
}
|
|
250
|
+
|
|
210
251
|
export declare interface IFieldControlProps {
|
|
211
252
|
error?: any;
|
|
212
253
|
touched?: any;
|
|
@@ -310,6 +351,9 @@ export declare interface ILevoFormThemeContext {
|
|
|
310
351
|
cssReset?: boolean;
|
|
311
352
|
}
|
|
312
353
|
|
|
354
|
+
/** Symbol used to switch thousands grouping to the Indian (lakh/crore) system. */
|
|
355
|
+
export declare const INR_CURRENCY_SYMBOL = "\u20B9";
|
|
356
|
+
|
|
313
357
|
export declare const isPhoneValid: (phone: string) => boolean;
|
|
314
358
|
|
|
315
359
|
declare interface IThemeProviderProps extends Omit<default_2.ComponentPropsWithoutRef<"div">, "className"> {
|
|
@@ -331,12 +375,44 @@ declare interface IThemeWrapperProps extends IThemeProviderProps {
|
|
|
331
375
|
variant?: FormVariantType;
|
|
332
376
|
}
|
|
333
377
|
|
|
378
|
+
declare interface IToolbarButtonProps extends React.ComponentPropsWithoutRef<"button"> {
|
|
379
|
+
label: string;
|
|
380
|
+
Icon: Icon;
|
|
381
|
+
isActive?: boolean;
|
|
382
|
+
iconSize?: number;
|
|
383
|
+
/** Render extra content (e.g. caret) after the icon. */
|
|
384
|
+
trailing?: React.ReactNode;
|
|
385
|
+
}
|
|
386
|
+
|
|
334
387
|
export declare type IWidgetRegistry = Record<(typeof CommonFieldInterfacesList)[number], WidgetComponent>;
|
|
335
388
|
|
|
336
389
|
declare const Label: React.FC<React.ComponentProps<"label">>;
|
|
337
390
|
|
|
338
391
|
export declare const LevoFormProvider: default_2.FC<IFormRendererProps>;
|
|
339
392
|
|
|
393
|
+
declare interface NodeAlignmentOptions {
|
|
394
|
+
/**
|
|
395
|
+
* Node types that should support alignment
|
|
396
|
+
* @default ["paragraph", "heading", "blockquote", "tableCell", "tableHeader"]
|
|
397
|
+
*/
|
|
398
|
+
types: string[];
|
|
399
|
+
/**
|
|
400
|
+
* Use inline style instead of data attribute
|
|
401
|
+
* @default true
|
|
402
|
+
*/
|
|
403
|
+
useStyle?: boolean;
|
|
404
|
+
/**
|
|
405
|
+
* Valid text alignment values
|
|
406
|
+
* @default ["left", "center", "right", "justify"]
|
|
407
|
+
*/
|
|
408
|
+
textAlignValues: string[];
|
|
409
|
+
/**
|
|
410
|
+
* Valid vertical alignment values
|
|
411
|
+
* @default ["top", "middle", "bottom"]
|
|
412
|
+
*/
|
|
413
|
+
verticalAlignValues: string[];
|
|
414
|
+
}
|
|
415
|
+
|
|
340
416
|
declare type ParamError = {
|
|
341
417
|
message: string;
|
|
342
418
|
name: string;
|
|
@@ -348,6 +424,13 @@ export declare const submitDataParser: (data: Record<string, unknown>, schema: I
|
|
|
348
424
|
|
|
349
425
|
export declare const ThemeWrapper: default_2.FC<IThemeWrapperProps>;
|
|
350
426
|
|
|
427
|
+
/**
|
|
428
|
+
* Stateless toolbar button — caller wires `isActive` / `disabled` from
|
|
429
|
+
* tiptap's `useEditorState`. Wraps levocn's `Button` (variant=ghost, size=sm)
|
|
430
|
+
* for pixel parity with other levocn-styled controls in the app.
|
|
431
|
+
*/
|
|
432
|
+
export declare const ToolbarButton: ForwardRefExoticComponent<IToolbarButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
433
|
+
|
|
351
434
|
export declare const updateFieldWInterface: (tempField: ILemaField, field_interface: (typeof FieldInterfacesList)[number]) => {
|
|
352
435
|
field: {
|
|
353
436
|
id: string;
|
package/collection.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { n as e, r as t, t as n } from "./Toolbar-BHi_B-nE.js";
|
|
2
|
+
import { t as r } from "./getFieldValidations-DZnDgNI0.js";
|
|
3
|
+
import { a as i, c as a, d as o, f as s, i as c, l, n as u, o as d, r as f, s as p, t as m, u as h } from "./widgets-CG5Z_dk7.js";
|
|
4
|
+
import { a as g, c as _, d as v, f as y, h as b, i as x, l as S, m as C, n as w, o as T, p as E, r as D, s as O, u as k } from "./dist-x5VFEnQl.js";
|
|
5
|
+
import { t as A } from "./utils-Bh9uGjo1.js";
|
|
6
|
+
import { a as j, c as M, f as N, i as P, n as F, o as I, r as L, s as R, t as z } from "./CollectionField-7uXvhxYK.js";
|
|
7
|
+
import { t as B } from "./CollectionInput-lHOvWWav.js";
|
|
7
8
|
//#region ../../libraries/react-collection/dist/types/formVariant.js
|
|
8
|
-
var
|
|
9
|
+
var V = [
|
|
9
10
|
{
|
|
10
11
|
value: "default",
|
|
11
12
|
label: "Classic",
|
|
@@ -28,4 +29,4 @@ var I = [
|
|
|
28
29
|
}
|
|
29
30
|
];
|
|
30
31
|
//#endregion
|
|
31
|
-
export {
|
|
32
|
+
export { b as AsyncSelectPaginate, C as CURRENCY_SYMBOLS, n as CollectionEditorToolbar, z as CollectionFieldWrapper, z as FieldWrapper, _ as CollectionForm, D as CollectionFormBuilder, w as CollectionFormRenderer, B as CollectionInput, B as Input, N as CollectionLabel, y as DEFAULT_WIDGET_REGISTRY, j as Field, R as FieldContent, I as FieldDescription, F as FieldError, M as FieldGroup, L as FieldLabel, v as FieldRenderer, P as FieldSet, x as FormBuilder, V as FormVariantOptions, E as INR_CURRENCY_SYMBOL, T as LevoFormProvider, k as ThemeWrapper, e as ToolbarButton, s as areAllFieldsHidden, m as createWidget, c as errorsToParam, t as getCollectionEditorExtensions, d as getDefaultFieldValues, o as getDefaultValuesByKind, r as getFieldValidations, a as getInitialValues, A as getKindFromMimetype, h as getValueIfNotUndefined, l as isPhoneValid, u as setFormErrors, f as submitDataParser, p as updateFieldWInterface, g as useLevoForm, O as useLevoFormContext, S as useLevoFormTheme, i as validateForm };
|