@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.
Files changed (45) hide show
  1. package/{BillingStep-C3jJkLXQ.js → BillingStep-Brc1Mzo3.js} +1 -1
  2. package/{Button-CwN6jTXH.js → Button-XTKnNIl9.js} +11 -5
  3. package/{CollectionInput-BoNAc4sq.js → CollectionInput-cmJ0RXzG.js} +1 -1
  4. package/DateTimeWidget-B5lBr0_R.js +255 -0
  5. package/{EntryCard-xpo36vUc.js → EntryCard-CYdsSkIk.js} +3 -3
  6. package/{CollectionField-DnbpB0Z5.js → Input-Btdc1Dee.js} +115 -76
  7. package/{LoginCard-DG8NAN0B.js → LoginCard-5LaKaFCO.js} +3 -3
  8. package/{LoginModal-BPI5tOIZ.js → LoginModal-BdYM8INu.js} +3 -3
  9. package/{MessageCard-BYxgc9dl.js → MessageCard-ChDBqLVG.js} +2 -2
  10. package/{ModalManager-BaIL6HG-.js → ModalManager-SggxCIno.js} +1 -1
  11. package/{PendingApprovalCard-DID1FhwF.js → PendingApprovalCard-z2sdLyCa.js} +3 -3
  12. package/{PhoneWidget-CjhHfwuG.js → PhoneWidget-1ffYuESC.js} +11 -11
  13. package/{Popover-DHVZdJuv.js → Popover-BdKCElnb.js} +2 -1
  14. package/RichTextWidget-CjEoGecM.js +1136 -0
  15. package/Tooltip-BOq5vSOW.js +68 -0
  16. package/{VerifyButton-DFKzKYxC.js → VerifyButton-CdPQqtc2.js} +3 -2
  17. package/{bookingCard-Bw4tvDYh.js → bookingCard-D3ZSjq-P.js} +3 -3
  18. package/collection.d.ts +20 -7
  19. package/collection.js +7 -7
  20. package/dist-ir7pIkAm.js +3115 -0
  21. package/{getFieldValidations-qVzuq6mv.js → getFieldValidations-DZnDgNI0.js} +52 -88
  22. package/index.d.ts +94 -3
  23. package/index.js +3223 -1415
  24. package/{nodeAlignment-CG3qmAuQ.js → nodeAlignment-BZbdafVA.js} +41 -42
  25. package/package.json +8 -8
  26. package/studio.css +1 -1
  27. package/theme.cssm-2YTdd8Yh.js +15 -0
  28. package/{utils-F6eBcsyI.js → utils-CsfPGq4R.js} +1 -1
  29. package/widgets-DD4OjK2Y.js +302 -0
  30. package/DateTimeWidget-IRleQI-3.js +0 -255
  31. package/RichTextWidget-CgT1_zC3.js +0 -1135
  32. package/Tooltip-ByJRyayB.js +0 -78
  33. package/dist-B7TPxn7o.js +0 -3180
  34. package/theme.cssm-De_pl52g.js +0 -4
  35. package/widgets-Dvyv5_uj.js +0 -215
  36. /package/{Beams-Blr-zwvz.js → Beams-B0O3uyYF.js} +0 -0
  37. /package/{Dots-DeBKuibU.js → Dots-DjezbpLp.js} +0 -0
  38. /package/{Gradient-DGFxOjft.js → Gradient-B1K9Yi04.js} +0 -0
  39. /package/{Grid-A7HRCQ0T.js → Grid-C9aUfXM-.js} +0 -0
  40. /package/{LoginForm-CPMtCyMF.js → LoginForm-Ck-xFaDg.js} +0 -0
  41. /package/{MessageFooter-C6DivT4m.js → MessageFooter-AzAtJWMo.js} +0 -0
  42. /package/{StripePaymentModal-BcePXzmC.js → StripePaymentModal-BHIBBvRj.js} +0 -0
  43. /package/{Waves-CIT6Ngng.js → Waves-BkaAfGqA.js} +0 -0
  44. /package/{card-izMd2DvE.js → card-BQr9258p.js} +0 -0
  45. /package/{dialog-CCWrvmHd.js → dialog-Dw6n_36P.js} +0 -0
@@ -1,4 +0,0 @@
1
- //#region ../../libraries/levocn/dist/styles/theme/theme.cssm.js
2
- var e = "_1bi3v3x0";
3
- //#endregion
4
- export { e as t };
@@ -1,215 +0,0 @@
1
- import e from "react";
2
- import { FieldInterfaces as t, FieldInterfacesList as n, defaultByKinds as r, formatsByInterface as i, interfaceKinds as a } from "@levo-so/core";
3
- import { Snowflake as o } from "@theinternetfolks/snowflake";
4
- import { isPossiblePhoneNumber as s } from "react-phone-number-input";
5
- import * as c from "yup";
6
- //#region ../../libraries/react-collection/dist/constants/fileUploadPresets.js
7
- var l = [
8
- "pdf",
9
- "xls",
10
- "xlsx",
11
- "doc",
12
- "docx",
13
- "csv"
14
- ], u = [
15
- "svg",
16
- "png",
17
- "jpg",
18
- "jpeg",
19
- "webp",
20
- "gif",
21
- "avif"
22
- ], d = ["mpeg", "mp4"], f = [
23
- "mp3",
24
- "ogg",
25
- "oga"
26
- ], p = {
27
- "application/pdf": [".pdf"],
28
- "application/msword": [".doc"],
29
- "application/vnd.ms-excel": [".xls"],
30
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
31
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
32
- "text/csv": [".csv"]
33
- }, m = {
34
- "image/jpeg": [".jpeg", ".jpg"],
35
- "image/png": [".png"],
36
- "image/gif": [".gif"],
37
- "image/svg+xml": [".svg"],
38
- "image/webp": [".webp"],
39
- "image/avif": [".avif"]
40
- }, h = {
41
- "video/mp4": [".mp4"],
42
- "video/mpeg": [".mpeg"]
43
- }, g = {
44
- audio: {
45
- "audio/mpeg": [".mp3"],
46
- "audio/ogg": [".oga"]
47
- },
48
- document: p,
49
- image: m,
50
- video: h
51
- }, _ = {
52
- audio: f,
53
- document: l,
54
- image: u,
55
- video: d
56
- };
57
- [
58
- ..._.audio,
59
- ..._.document,
60
- ..._.image,
61
- ..._.video
62
- ], {
63
- ...g.audio,
64
- ...g.document,
65
- ...g.image,
66
- ...g.video
67
- };
68
- //#endregion
69
- //#region ../../libraries/react-collection/dist/utils/formHelpers.js
70
- var v = (e) => {
71
- let t = [];
72
- for (let n of Object.keys(e)) for (let r of e?.[n] || []) t.push({
73
- message: r,
74
- name: n
75
- });
76
- return t;
77
- }, y = (e) => e ? s(e) : !1, b = (e, t) => {
78
- let n = [];
79
- for (let [r, i] of Object.entries(t)) {
80
- let t = e?.[r], a = c.string();
81
- for (let e of i) if (typeof e == "string") switch (e) {
82
- case "required":
83
- a = a.required(`The ${r} field is required`);
84
- break;
85
- case "email":
86
- a = a.email("The email address is not valid");
87
- break;
88
- case "phone_number":
89
- a = a.test("phone", "The phone number has incorrect format", (e) => e ? y(e) : !0);
90
- break;
91
- case "url":
92
- a = a.url("The URL is not valid");
93
- break;
94
- case "data_uri":
95
- a = a.test("data_uri", "The field does not have a valid file", (e) => typeof e == "string" ? e.startsWith("data:") && e.includes(",") : !1);
96
- break;
97
- }
98
- else if (typeof e == "object" && e) {
99
- let t = e;
100
- "max" in e && t.max?.[0] && (a = a.max(Number(t.max[0]))), "min" in e && t.min?.[0] && (a = a.min(Number(t.min[0])));
101
- }
102
- try {
103
- a.validateSync(t);
104
- } catch (e) {
105
- e instanceof c.ValidationError && n.push({
106
- message: e.message,
107
- name: r
108
- });
109
- }
110
- }
111
- return n.length > 0 ? {
112
- status: !1,
113
- errors: n
114
- } : { status: !0 };
115
- }, x = (e, n) => {
116
- let r = {};
117
- for (let n of e.sections) for (let e of n.fields) {
118
- let n = [];
119
- switch (e.required && n.push("required"), e.max !== void 0 && e.max !== null && n.push({ max: [e.max] }), e.min !== void 0 && e.min !== null && n.push({ min: [e.min] }), e.field_interface) {
120
- case t.EmailWidget:
121
- n.push("email");
122
- break;
123
- case t.PhoneWidget:
124
- n.push("phone_number");
125
- break;
126
- case t.URLWidget:
127
- n.push("url");
128
- break;
129
- default: break;
130
- }
131
- r[e.key] = n;
132
- }
133
- let { errors: i } = b(n, r), a = {};
134
- return i && i.map((e) => {
135
- a[e.name] = e.message;
136
- }), a;
137
- }, S = (e) => {
138
- let n = {};
139
- for (let i of e) {
140
- if (i.kind === "collection") {
141
- let e = i.options?.current_have_many_connected, t = i.options?.connected_have_many_current;
142
- e && t ? n[i.key] = r.collection.m2m : n[i.key] = r.collection.m2o;
143
- } else n[i.key] = r?.[i?.kind];
144
- i?.field_interface === t.RecordWidget && i?.fields?.length && (n[i.key] = S(i.fields));
145
- }
146
- return n;
147
- }, C = (e) => {
148
- if (!e?.sections) return {};
149
- let t = {};
150
- for (let n of e.sections) n?.fields && n?.fields?.length > 0 && (t = {
151
- ...t,
152
- ...S(n.fields)
153
- });
154
- return t;
155
- }, w = (e) => e === void 0 ? null : e, T = (e, t) => {
156
- if (!e?.sections) return {};
157
- let n = {};
158
- for (let r of e.sections) {
159
- let e = S(r.fields ?? []);
160
- for (let i of r.fields) {
161
- let r = w(t?.[i?.key]);
162
- Array.isArray(r) && r?.length > 0 && Array.isArray(i?.values) && i?.values?.length > 0 && !i?.options?.custom_input && (r = r?.filter((e) => i?.values?.includes(e))), n[i.key] = r ?? w(i?.default_value) ?? e[i.key];
163
- }
164
- }
165
- return n;
166
- }, E = (e, s) => {
167
- let c = { ...e }, l = null;
168
- if ((c.field_interface === t.ArrayWidget && s !== t.ArrayWidget || c.field_interface === t.RecordWidget && s !== t.RecordWidget) && (c.fields = []), (s !== t.MultiDropdownWidget || s !== t.DropdownWidget || s !== t.RadioWidget || s !== t.CheckboxWidget) && c.field_interface !== t.MultiDropdownWidget && c.field_interface !== t.DropdownWidget && c.field_interface !== t.RadioWidget && c.field_interface !== t.CheckboxWidget && c.values?.length !== 0 && (c.values = []), (s === t.MultiDropdownWidget && c.field_interface !== t.MultiDropdownWidget || s === t.DropdownWidget && c.field_interface !== t.DropdownWidget || s === t.RadioWidget && c.field_interface !== t.RadioWidget || s === t.CheckboxWidget && c.field_interface !== t.CheckboxWidget) && (c.values = [""], l = `${c.id}-option-0`), [t.RecordWidget, t.ArrayWidget].includes(s) && (l = `field-${o.generate()}`, c.kind = s === t.RecordWidget ? "record" : "group", c.fields = [...c?.fields || [], {
169
- id: l,
170
- key: "title",
171
- label: "Title",
172
- helper_text: "",
173
- kind: "string",
174
- field_interface: t.TextWidget,
175
- default_value: "",
176
- options: {},
177
- fields: [],
178
- hidden: !1,
179
- readonly: !1,
180
- required: !1,
181
- unique: !1,
182
- min: null,
183
- max: null,
184
- formats: i[s] || [],
185
- values: [],
186
- editable: !0
187
- }]), c.kind = a[s] || "string", !c.default_value) if (c.kind === "collection") {
188
- let e = c.options?.current_have_many_connected, t = c.options?.connected_have_many_current;
189
- e && t ? c.default_value = r.collection.m2m : c.default_value = r.collection.m2o;
190
- } else c.default_value = r[c.kind] || null;
191
- return s !== t.CollectionWidget && n.includes(s) && (c.field_interface = s), {
192
- field: c,
193
- fieldFocused: l
194
- };
195
- }, D = (e, t) => {
196
- let n = {};
197
- if (t) for (let r of t?.sections ?? []) for (let t of r?.fields) if (t.field_interface === "CollectionWidget") {
198
- let r = e?.[t?.key];
199
- r && typeof r == "object" && (Array.isArray(r) ? n[t?.key] = r?.filter((e) => e) : n[t?.key] = r._id);
200
- } else n[t?.key] = e?.[t?.key];
201
- return n;
202
- }, O = (e) => e.every((e) => {
203
- let { field_interface: t = "", key: n = "", hidden: r } = e;
204
- return !t || !n || r;
205
- }), k = (e, t) => {
206
- if (Array.isArray(e) && e.length > 0) {
207
- let n = 0;
208
- for (let r of e) n += 1, r?.param && t && t(r?.param, {
209
- type: "server_error",
210
- message: r?.message
211
- }, { shouldFocus: n === 0 });
212
- }
213
- }, A = (t) => e.memo(t);
214
- //#endregion
215
- export { x as a, T as c, C as d, O as f, v as i, y as l, g as m, k as n, S as o, _ as p, D as r, E as s, A as t, w as u };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes