@levo-so/studio 0.1.98 → 0.1.100
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/{BillingStep-C3jJkLXQ.js → BillingStep-Brc1Mzo3.js} +1 -1
- package/{Button-CwN6jTXH.js → Button-XTKnNIl9.js} +11 -5
- package/{CollectionInput-BoNAc4sq.js → CollectionInput-cmJ0RXzG.js} +1 -1
- package/DateTimeWidget-B5lBr0_R.js +255 -0
- package/{EntryCard-xpo36vUc.js → EntryCard-CYdsSkIk.js} +3 -3
- package/{CollectionField-DnbpB0Z5.js → Input-Btdc1Dee.js} +115 -76
- package/{LoginCard-DG8NAN0B.js → LoginCard-5LaKaFCO.js} +3 -3
- package/{LoginModal-BPI5tOIZ.js → LoginModal-BdYM8INu.js} +3 -3
- package/{MessageCard-BYxgc9dl.js → MessageCard-ChDBqLVG.js} +2 -2
- package/{ModalManager-BaIL6HG-.js → ModalManager-SggxCIno.js} +1 -1
- package/{PendingApprovalCard-DID1FhwF.js → PendingApprovalCard-z2sdLyCa.js} +3 -3
- package/{PhoneWidget-CjhHfwuG.js → PhoneWidget-1ffYuESC.js} +11 -11
- package/{Popover-DHVZdJuv.js → Popover-BdKCElnb.js} +2 -1
- package/RichTextWidget-CjEoGecM.js +1136 -0
- package/Tooltip-BOq5vSOW.js +68 -0
- package/{VerifyButton-DFKzKYxC.js → VerifyButton-CdPQqtc2.js} +3 -2
- package/{bookingCard-Bw4tvDYh.js → bookingCard-D3ZSjq-P.js} +3 -3
- package/collection.d.ts +20 -7
- package/collection.js +7 -7
- package/dist-ir7pIkAm.js +3115 -0
- package/{getFieldValidations-qVzuq6mv.js → getFieldValidations-DZnDgNI0.js} +52 -88
- package/index.d.ts +94 -3
- package/index.js +3223 -1415
- package/{nodeAlignment-CG3qmAuQ.js → nodeAlignment-BZbdafVA.js} +41 -42
- package/package.json +8 -8
- package/studio.css +1 -1
- package/theme.cssm-2YTdd8Yh.js +15 -0
- package/{utils-F6eBcsyI.js → utils-CsfPGq4R.js} +1 -1
- package/widgets-DD4OjK2Y.js +302 -0
- package/DateTimeWidget-IRleQI-3.js +0 -255
- package/RichTextWidget-CgT1_zC3.js +0 -1135
- package/Tooltip-ByJRyayB.js +0 -78
- package/dist-B7TPxn7o.js +0 -3180
- package/theme.cssm-De_pl52g.js +0 -4
- package/widgets-Dvyv5_uj.js +0 -215
- /package/{Beams-Blr-zwvz.js → Beams-B0O3uyYF.js} +0 -0
- /package/{Dots-DeBKuibU.js → Dots-DjezbpLp.js} +0 -0
- /package/{Gradient-DGFxOjft.js → Gradient-B1K9Yi04.js} +0 -0
- /package/{Grid-A7HRCQ0T.js → Grid-C9aUfXM-.js} +0 -0
- /package/{LoginForm-CPMtCyMF.js → LoginForm-Ck-xFaDg.js} +0 -0
- /package/{MessageFooter-C6DivT4m.js → MessageFooter-AzAtJWMo.js} +0 -0
- /package/{StripePaymentModal-BcePXzmC.js → StripePaymentModal-BHIBBvRj.js} +0 -0
- /package/{Waves-CIT6Ngng.js → Waves-BkaAfGqA.js} +0 -0
- /package/{card-izMd2DvE.js → card-BQr9258p.js} +0 -0
- /package/{dialog-CCWrvmHd.js → dialog-Dw6n_36P.js} +0 -0
|
@@ -3,111 +3,75 @@ import { jsx as a } from "react/jsx-runtime";
|
|
|
3
3
|
import { FieldInterfaces as o } from "@levo-so/core";
|
|
4
4
|
import { c as s } from "react/compiler-runtime";
|
|
5
5
|
import c from "clsx";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import * as d from "yup";
|
|
6
|
+
import { isValidPhoneNumber as l } from "react-phone-number-input";
|
|
7
|
+
import * as u from "yup";
|
|
9
8
|
//#region ../../libraries/levocn/dist/styles/reset.cssm.js
|
|
10
|
-
var
|
|
11
|
-
let e = s(1), n = t(
|
|
9
|
+
var d = "_1er5g5a0", f = /* @__PURE__ */ new Set(), p = {}, m = e(null), h = () => {
|
|
10
|
+
let e = s(1), n = t(m);
|
|
12
11
|
if (!n) {
|
|
13
12
|
let t;
|
|
14
13
|
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {
|
|
15
14
|
portalRef: { current: null },
|
|
16
|
-
classes:
|
|
17
|
-
overrides:
|
|
15
|
+
classes: f,
|
|
16
|
+
overrides: p
|
|
18
17
|
}, e[0] = t) : t = e[0], t;
|
|
19
18
|
}
|
|
20
19
|
return n;
|
|
21
|
-
},
|
|
22
|
-
let
|
|
23
|
-
let e = s ? s.split(/\s+/).filter(Boolean) : [], t = new Set(
|
|
20
|
+
}, g = ({ children: e, cssReset: o, className: s, style: l, portalToThemeRoot: u, ...h }) => {
|
|
21
|
+
let g = t(m), _ = i(null), v = !g && o !== !1 ? d : "", y = g?.classes ?? f, b = g?.overrides ?? p, x = r(() => {
|
|
22
|
+
let e = s ? s.split(/\s+/).filter(Boolean) : [], t = new Set(y);
|
|
24
23
|
for (let n of e) t.add(n);
|
|
25
24
|
return {
|
|
26
|
-
portalRef:
|
|
25
|
+
portalRef: _,
|
|
27
26
|
classes: t,
|
|
28
27
|
overrides: {
|
|
29
|
-
...
|
|
28
|
+
...b,
|
|
30
29
|
...l
|
|
31
30
|
}
|
|
32
31
|
};
|
|
33
32
|
}, [
|
|
34
|
-
v,
|
|
35
|
-
s,
|
|
36
33
|
y,
|
|
34
|
+
s,
|
|
35
|
+
b,
|
|
37
36
|
l
|
|
38
37
|
]);
|
|
39
38
|
n(() => {
|
|
39
|
+
if (u) return;
|
|
40
40
|
let e = document.createElement("div");
|
|
41
|
-
return document.body.appendChild(e),
|
|
42
|
-
document.body.removeChild(e),
|
|
41
|
+
return document.body.appendChild(e), _.current = e, () => {
|
|
42
|
+
document.body.removeChild(e), _.current = null;
|
|
43
43
|
};
|
|
44
|
-
}, []), n(() => {
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
}, [u]), n(() => {
|
|
45
|
+
if (u) return;
|
|
46
|
+
let e = _.current;
|
|
47
|
+
if (!e) return;
|
|
48
|
+
e.className = c(v, ...x.classes), e.style.cssText = "";
|
|
49
|
+
let t = {
|
|
47
50
|
display: "contents",
|
|
48
|
-
...
|
|
49
|
-
}
|
|
51
|
+
...x.overrides
|
|
52
|
+
};
|
|
53
|
+
for (let [n, r] of Object.entries(t)) r != null && e.style.setProperty(n, String(r));
|
|
50
54
|
}, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
x.classes,
|
|
56
|
+
x.overrides,
|
|
57
|
+
v,
|
|
58
|
+
u
|
|
54
59
|
]);
|
|
55
|
-
let
|
|
56
|
-
return /* @__PURE__ */ a(
|
|
57
|
-
value:
|
|
60
|
+
let S = c(v, ...s ? s.split(/\s+/).filter((e) => e && !y.has(e)) : []);
|
|
61
|
+
return /* @__PURE__ */ a(m.Provider, {
|
|
62
|
+
value: x,
|
|
58
63
|
children: /* @__PURE__ */ a("div", {
|
|
59
|
-
|
|
64
|
+
...u ? { ref: _ } : {},
|
|
65
|
+
...S ? { className: S } : {},
|
|
60
66
|
style: {
|
|
61
67
|
display: "contents",
|
|
62
68
|
...l
|
|
63
69
|
},
|
|
64
|
-
...
|
|
70
|
+
...h,
|
|
65
71
|
children: e
|
|
66
72
|
})
|
|
67
73
|
});
|
|
68
|
-
},
|
|
69
|
-
defaultClassName: "_1a7d0ek1 _1a7d0ek0",
|
|
70
|
-
variantClassNames: {
|
|
71
|
-
variant: {
|
|
72
|
-
default: "_1a7d0ek2",
|
|
73
|
-
outline: "_1a7d0ek3",
|
|
74
|
-
secondary: "_1a7d0ek4",
|
|
75
|
-
ghost: "_1a7d0ek5",
|
|
76
|
-
destructive: "_1a7d0ek6",
|
|
77
|
-
link: "_1a7d0ek7"
|
|
78
|
-
},
|
|
79
|
-
size: {
|
|
80
|
-
default: "_1a7d0ek8",
|
|
81
|
-
xs: "_1a7d0ek9",
|
|
82
|
-
sm: "_1a7d0eka",
|
|
83
|
-
lg: "_1a7d0ekb",
|
|
84
|
-
icon: "_1a7d0ekc",
|
|
85
|
-
"icon-xs": "_1a7d0ekd",
|
|
86
|
-
"icon-sm": "_1a7d0eke",
|
|
87
|
-
"icon-lg": "_1a7d0ekf"
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
defaultVariants: {
|
|
91
|
-
variant: "default",
|
|
92
|
-
size: "default"
|
|
93
|
-
},
|
|
94
|
-
compoundVariants: []
|
|
95
|
-
}), y = (e) => {
|
|
96
|
-
let t = s(14), n, r, i, o, l;
|
|
97
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3], o = t[4], l = t[5]) : ({className: n, variant: l, size: i, type: o, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = o, t[5] = l);
|
|
98
|
-
let u = o === void 0 ? "button" : o, d;
|
|
99
|
-
t[6] !== n || t[7] !== i || t[8] !== l ? (d = c(v({
|
|
100
|
-
variant: l,
|
|
101
|
-
size: i
|
|
102
|
-
}), n), t[6] = n, t[7] = i, t[8] = l, t[9] = d) : d = t[9];
|
|
103
|
-
let f;
|
|
104
|
-
return t[10] !== r || t[11] !== d || t[12] !== u ? (f = /* @__PURE__ */ a("button", {
|
|
105
|
-
"data-slot": "button",
|
|
106
|
-
type: u,
|
|
107
|
-
className: d,
|
|
108
|
-
...r
|
|
109
|
-
}), t[10] = r, t[11] = d, t[12] = u, t[13] = f) : f = t[13], f;
|
|
110
|
-
}, b = (e, t) => {
|
|
74
|
+
}, _ = (e, t) => {
|
|
111
75
|
let n = (e?.label || e?.key || "")?.replace(/_/g, " ");
|
|
112
76
|
if (n?.endsWith("Id") && (n = n?.replace("Id", "")), n.includes(".")) {
|
|
113
77
|
let [e] = n.split(".");
|
|
@@ -119,21 +83,21 @@ var f = "_1er5g5a0", p = /* @__PURE__ */ new Set(), m = {}, h = e(null), g = ()
|
|
|
119
83
|
}, i;
|
|
120
84
|
switch (e.field_interface) {
|
|
121
85
|
case o.NumberWidget:
|
|
122
|
-
i = r(
|
|
86
|
+
i = r(u.number());
|
|
123
87
|
break;
|
|
124
88
|
case o.ArrayWidget:
|
|
125
|
-
i = r(
|
|
89
|
+
i = r(u.array().typeError("The field must be an array"));
|
|
126
90
|
break;
|
|
127
91
|
case o.RecordWidget:
|
|
128
|
-
i =
|
|
92
|
+
i = u.object();
|
|
129
93
|
break;
|
|
130
94
|
case o.EmailWidget:
|
|
131
|
-
i = r(
|
|
95
|
+
i = r(u.string().email("The email address is not valid"));
|
|
132
96
|
break;
|
|
133
97
|
case o.PhoneWidget:
|
|
134
|
-
i = r(
|
|
98
|
+
i = r(u.string().test("phone", "The phone number has incorrect format", (e) => {
|
|
135
99
|
if (e) try {
|
|
136
|
-
return
|
|
100
|
+
return l(e);
|
|
137
101
|
} catch {
|
|
138
102
|
return !1;
|
|
139
103
|
}
|
|
@@ -141,35 +105,35 @@ var f = "_1er5g5a0", p = /* @__PURE__ */ new Set(), m = {}, h = e(null), g = ()
|
|
|
141
105
|
}));
|
|
142
106
|
break;
|
|
143
107
|
case o.URLWidget:
|
|
144
|
-
i = r(
|
|
108
|
+
i = r(u.string().matches(/^(?:https?:\/\/)?(?:[a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+(?:\.[a-zA-Z]{2,})+(?:\/[^\s?#]*)?(?:\?[^\s]*)?$/, "The URL is not valid"));
|
|
145
109
|
break;
|
|
146
110
|
case o.ImageUploadWidget:
|
|
147
111
|
case o.FileUploadWidget:
|
|
148
112
|
case o.GeocoderWidget:
|
|
149
|
-
i =
|
|
113
|
+
i = u.object();
|
|
150
114
|
break;
|
|
151
115
|
case o.MultiImageUploadWidget:
|
|
152
116
|
case o.MultiFileUploadWidget:
|
|
153
117
|
case o.MultiGeocoderWidget:
|
|
154
|
-
i =
|
|
118
|
+
i = u.array().of(u.object());
|
|
155
119
|
break;
|
|
156
120
|
case o.JSONWidget:
|
|
157
121
|
case o.DropdownWidget:
|
|
158
|
-
i =
|
|
122
|
+
i = u.string();
|
|
159
123
|
break;
|
|
160
124
|
case o.MultiTextWidget:
|
|
161
125
|
case o.MultiDropdownWidget:
|
|
162
126
|
case o.CheckboxWidget:
|
|
163
|
-
i =
|
|
127
|
+
i = u.array().of(u.string());
|
|
164
128
|
break;
|
|
165
129
|
case o.ToggleCheckboxWidget:
|
|
166
|
-
i =
|
|
130
|
+
i = u.boolean();
|
|
167
131
|
break;
|
|
168
132
|
case o.CollectionWidget:
|
|
169
|
-
i = e.options.current_have_many_connected ?
|
|
133
|
+
i = e.options.current_have_many_connected ? u.array() : u.object();
|
|
170
134
|
break;
|
|
171
135
|
default:
|
|
172
|
-
i = r(
|
|
136
|
+
i = r(u.string());
|
|
173
137
|
break;
|
|
174
138
|
}
|
|
175
139
|
if (e.options?.validationsPresets && Array.isArray(e.options.validationsPresets)) {
|
|
@@ -186,10 +150,10 @@ var f = "_1er5g5a0", p = /* @__PURE__ */ new Set(), m = {}, h = e(null), g = ()
|
|
|
186
150
|
try {
|
|
187
151
|
return i.validateSync(n), t ? t(n) : !0;
|
|
188
152
|
} catch (e) {
|
|
189
|
-
return e instanceof
|
|
153
|
+
return e instanceof u.ValidationError ? e.message : !0;
|
|
190
154
|
}
|
|
191
155
|
}
|
|
192
156
|
};
|
|
193
157
|
};
|
|
194
158
|
//#endregion
|
|
195
|
-
export {
|
|
159
|
+
export { h as n, g as r, _ as t };
|
package/index.d.ts
CHANGED
|
@@ -161,7 +161,7 @@ declare interface BaseAccordionTriggerProps extends BaseElementProps, Omit<React
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
export declare const BaseBlogContent: {
|
|
164
|
-
({ className, content, config, styles, elementKey, generatedClassName, ref, ...rest }: BaseBlogContentProps): JSX.Element
|
|
164
|
+
({ className, content, config, styles, elementKey, generatedClassName, ref, ...rest }: BaseBlogContentProps): JSX.Element;
|
|
165
165
|
displayName: string;
|
|
166
166
|
};
|
|
167
167
|
|
|
@@ -260,8 +260,7 @@ export declare type BlockComponent = ComponentType<ILevoBlockBaseProps<any>> | L
|
|
|
260
260
|
/** Full context value exposed via useBlockContext — includes derived fields */
|
|
261
261
|
declare type BlockContextType = BlockProviderInput & {
|
|
262
262
|
setParsedBlockData?: React.Dispatch<React.SetStateAction<IBlockInstance | undefined>>;
|
|
263
|
-
|
|
264
|
-
isBuilder: boolean;
|
|
263
|
+
isStudio: boolean;
|
|
265
264
|
};
|
|
266
265
|
|
|
267
266
|
export declare const BlockProvider: React.FC<{
|
|
@@ -541,6 +540,10 @@ declare type DeepConfig<T> = T extends Array<infer U> ? IFieldConfig & {
|
|
|
541
540
|
[x: string]: IFieldConfig;
|
|
542
541
|
} : IFieldConfig;
|
|
543
542
|
|
|
543
|
+
declare type DeepPartial<T> = {
|
|
544
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
545
|
+
};
|
|
546
|
+
|
|
544
547
|
declare type DeepStyles<T> = T extends Array<infer U> ? IStyles & {
|
|
545
548
|
[index: number]: DeepStyles<U>;
|
|
546
549
|
} : T extends object ? {
|
|
@@ -1056,6 +1059,29 @@ export declare interface ICategoryFilterProps {
|
|
|
1056
1059
|
className?: string;
|
|
1057
1060
|
}
|
|
1058
1061
|
|
|
1062
|
+
declare interface ICollectionTheme {
|
|
1063
|
+
form: {
|
|
1064
|
+
maxWidth: string;
|
|
1065
|
+
gap: string;
|
|
1066
|
+
borderRadius: string;
|
|
1067
|
+
labelFontSize: string;
|
|
1068
|
+
helpFontSize: string;
|
|
1069
|
+
};
|
|
1070
|
+
input: {
|
|
1071
|
+
fontSize: string;
|
|
1072
|
+
height: string;
|
|
1073
|
+
borderRadius: string;
|
|
1074
|
+
};
|
|
1075
|
+
checkbox: {
|
|
1076
|
+
labelFontSize: string;
|
|
1077
|
+
};
|
|
1078
|
+
button: {
|
|
1079
|
+
fontSize: string;
|
|
1080
|
+
padding: string;
|
|
1081
|
+
borderRadius: string;
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1059
1085
|
declare interface ICommentsRestrictionOverlayProps {
|
|
1060
1086
|
communityName?: string;
|
|
1061
1087
|
className?: string;
|
|
@@ -1201,6 +1227,8 @@ export declare interface IFieldConfig {
|
|
|
1201
1227
|
after?: string;
|
|
1202
1228
|
};
|
|
1203
1229
|
custom_fields?: Record<string, unknown>;
|
|
1230
|
+
/** Theme overrides passed to self-themed child libraries (RTE, Collection Forms, etc.). */
|
|
1231
|
+
theme?: DeepPartial<ITheme_2 & IRteTheme & ICollectionTheme>;
|
|
1204
1232
|
}
|
|
1205
1233
|
|
|
1206
1234
|
/**
|
|
@@ -1626,6 +1654,14 @@ declare type IPreviewDevice = "desktop" | "tablet" | "mobile";
|
|
|
1626
1654
|
*/
|
|
1627
1655
|
export declare type IRenderMode = "live" | "studio.page" | "studio.block";
|
|
1628
1656
|
|
|
1657
|
+
declare interface IRteTheme {
|
|
1658
|
+
baseSpacing: string;
|
|
1659
|
+
/** Background color for text selection and highlighted nodes. */
|
|
1660
|
+
highlight: string;
|
|
1661
|
+
/** Foreground (text) color for selected/highlighted content. */
|
|
1662
|
+
highlightForeground: string;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1629
1665
|
/**
|
|
1630
1666
|
* Type guard to check if a method is alternate (OAuth)
|
|
1631
1667
|
*/
|
|
@@ -1910,6 +1946,61 @@ export declare interface ITheme {
|
|
|
1910
1946
|
[x: string]: unknown;
|
|
1911
1947
|
}
|
|
1912
1948
|
|
|
1949
|
+
declare interface ITheme_2 {
|
|
1950
|
+
colors: {
|
|
1951
|
+
text: string;
|
|
1952
|
+
heading: string;
|
|
1953
|
+
primary: string;
|
|
1954
|
+
primaryForeground: string;
|
|
1955
|
+
accent: string;
|
|
1956
|
+
accentForeground: string;
|
|
1957
|
+
border: string;
|
|
1958
|
+
background: string;
|
|
1959
|
+
foreground: string;
|
|
1960
|
+
card: string;
|
|
1961
|
+
cardForeground: string;
|
|
1962
|
+
popover: string;
|
|
1963
|
+
popoverForeground: string;
|
|
1964
|
+
secondary: string;
|
|
1965
|
+
secondaryForeground: string;
|
|
1966
|
+
muted: string;
|
|
1967
|
+
mutedForeground: string;
|
|
1968
|
+
destructive: string;
|
|
1969
|
+
input: string;
|
|
1970
|
+
inputForeground: string;
|
|
1971
|
+
ring: string;
|
|
1972
|
+
};
|
|
1973
|
+
radius: string;
|
|
1974
|
+
radiusScale: {
|
|
1975
|
+
sm: string;
|
|
1976
|
+
base: string;
|
|
1977
|
+
md: string;
|
|
1978
|
+
lg: string;
|
|
1979
|
+
xl: string;
|
|
1980
|
+
"2xl": string;
|
|
1981
|
+
"3xl": string;
|
|
1982
|
+
"4xl": string;
|
|
1983
|
+
"5xl": string;
|
|
1984
|
+
"6xl": string;
|
|
1985
|
+
"7xl": string;
|
|
1986
|
+
"8xl": string;
|
|
1987
|
+
full: string;
|
|
1988
|
+
};
|
|
1989
|
+
baseFontSize: string;
|
|
1990
|
+
fonts: {
|
|
1991
|
+
body: string;
|
|
1992
|
+
heading: string;
|
|
1993
|
+
};
|
|
1994
|
+
shadow: {
|
|
1995
|
+
xs: string;
|
|
1996
|
+
sm: string;
|
|
1997
|
+
md: string;
|
|
1998
|
+
lg: string;
|
|
1999
|
+
xl: string;
|
|
2000
|
+
inner: string;
|
|
2001
|
+
};
|
|
2002
|
+
}
|
|
2003
|
+
|
|
1913
2004
|
/**
|
|
1914
2005
|
* Container for all component themes in the system
|
|
1915
2006
|
*
|