@levo-so/studio 0.1.105 → 0.1.107

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-2cKT5Pir.js → BillingStep-CJqmdIz2.js} +1 -1
  2. package/{Button-DtPwDEN0.js → Button-DujHjtOV.js} +29 -29
  3. package/CollectionField-BPl8E9MW.js +318 -0
  4. package/CollectionFormBuilder-BvFtiZeH.js +3668 -0
  5. package/{DateTimeWidget-DPHIhkAi.js → DateTimeWidget-CbpvxQ9s.js} +3 -4
  6. package/{EntryCard-j4uZb2cE.js → EntryCard-Drnobf4s.js} +3 -3
  7. package/{LoginCard-asvOHIRg.js → LoginCard-B9HKjZEk.js} +3 -3
  8. package/{LoginForm-BdsPVHdO.js → LoginForm-DpgxFh89.js} +2 -2
  9. package/{LoginModal-CyvbEK26.js → LoginModal-CaqsScly.js} +3 -3
  10. package/{MessageCard-lrXKEsBP.js → MessageCard-DojQRKnf.js} +2 -2
  11. package/{MessageFooter-D-dCrzJH.js → MessageFooter-C4qC8cem.js} +1 -1
  12. package/{ModalManager-BcPk4sbK.js → ModalManager-CaBZKQR2.js} +1 -1
  13. package/{PendingApprovalCard-hYkupl9A.js → PendingApprovalCard-CrdOrMRu.js} +3 -3
  14. package/{PhoneWidget-BOFhs8Ra.js → PhoneWidget-BxW2gL28.js} +3 -4
  15. package/{PopupRenderer-C7OHYphU-IWM6d7gW.js → PopupRenderer-CV5HY1dP-hICGc5AG.js} +281 -280
  16. package/{RichTextWidget-18XLL8wW.js → RichTextWidget-DCzgJ9EA.js} +3 -4
  17. package/{Toolbar-Y6JtgPFn.js → Toolbar-B5UZer_x.js} +3 -3
  18. package/{VerifyButton-TNkt-SDu.js → VerifyButton-DFAg6STD.js} +1 -1
  19. package/{bookingCard-BdV2YSkq.js → bookingCard-BgApvrcj.js} +3 -3
  20. package/collection.d.ts +5 -4
  21. package/collection.js +7 -8
  22. package/dist-DZbXWctg.js +97 -0
  23. package/index.d.ts +10 -0
  24. package/index.js +1392 -1391
  25. package/{generateRadiusScale-BpcgkGtN.js → inlineCollectionTheme-WpCvMKrW.js} +19 -4
  26. package/package.json +1 -1
  27. package/studio.css +1 -1
  28. package/{utils-CZLafTgN.js → utils-CUqS5dMC.js} +1 -1
  29. package/CollectionField-xa-jed3_.js +0 -232
  30. package/dist-CsX9NP5P.js +0 -3188
  31. package/getFieldValidations-CSkSV2hW.js +0 -90
  32. package/widgets-eu5zXTf-.js +0 -230
  33. /package/{Beams-DEybrmUZ.js → Beams-DboMUgCv.js} +0 -0
  34. /package/{CollectionInput-CpNGIXJx.js → CollectionInput-DcNJT5Pg.js} +0 -0
  35. /package/{Dots-CMyy77GM.js → Dots-a8xSboDv.js} +0 -0
  36. /package/{Gradient-DBn_zXzI.js → Gradient-NacpoDCM.js} +0 -0
  37. /package/{Grid-kGCr-6by.js → Grid-BJQvxnks.js} +0 -0
  38. /package/{Popover-O1poOHk2.js → Popover-DOvRAGzc.js} +0 -0
  39. /package/{StripePaymentModal-DrLMN18M.js → StripePaymentModal-Do1xHctU.js} +0 -0
  40. /package/{Tooltip-NEMQqPyr.js → Tooltip-CJINDx93.js} +0 -0
  41. /package/{Waves-DjLcbiBu.js → Waves-DUuT_IFr.js} +0 -0
  42. /package/{authentication-hnV1BI8s.js → authentication-ClOFcry8.js} +0 -0
  43. /package/{card-5ooLmYSr.js → card-E2LKF9nT.js} +0 -0
  44. /package/{dialog-C8-iHixJ.js → dialog-DoxC50i0.js} +0 -0
  45. /package/{useLogin-B2qE8710.js → useLogin-D4A5iRey.js} +0 -0
@@ -1,10 +1,9 @@
1
1
  "use client";
2
2
  import { r as e, t } from "./inlineRteTheme-Ajq9PNpQ.js";
3
3
  import { t as ee } from "./RteThemeProvider-Cfepkyer.js";
4
- import { t as te } from "./getFieldValidations-CSkSV2hW.js";
5
- import { l as ne, t as re } from "./CollectionField-xa-jed3_.js";
6
- import { i as n } from "./Tooltip-NEMQqPyr.js";
7
- import { r, t as ie } from "./Toolbar-Y6JtgPFn.js";
4
+ import { f as te, l as ne, t as re } from "./CollectionField-BPl8E9MW.js";
5
+ import { i as n } from "./Tooltip-CJINDx93.js";
6
+ import { r, t as ie } from "./Toolbar-B5UZer_x.js";
8
7
  import { c as ae } from "react/compiler-runtime";
9
8
  import { useEffect as i, useState as oe } from "react";
10
9
  import { jsx as a, jsxs as se } from "react/jsx-runtime";
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./Button-lUfKisu8.js";
2
2
  import { t } from "./nodeAlignment-DKCIjzlR.js";
3
- import { l as n } from "./CollectionField-xa-jed3_.js";
4
- import { n as r, r as i, t as a } from "./Tooltip-NEMQqPyr.js";
5
- import { a as o, i as s, n as c, o as l, r as u } from "./Popover-O1poOHk2.js";
3
+ import { l as n } from "./CollectionField-BPl8E9MW.js";
4
+ import { n as r, r as i, t as a } from "./Tooltip-CJINDx93.js";
5
+ import { a as o, i as s, n as c, o as l, r as u } from "./Popover-DOvRAGzc.js";
6
6
  import { c as d } from "react/compiler-runtime";
7
7
  import { forwardRef as f, useEffect as p, useState as m } from "react";
8
8
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { i as e, n as t, o as n, t as r } from "./Dialog-IrII0ugb.js";
3
3
  import { t as i } from "./Button-lUfKisu8.js";
4
- import { t as a } from "./CollectionInput-CpNGIXJx.js";
4
+ import { t as a } from "./CollectionInput-DcNJT5Pg.js";
5
5
  import { c as o } from "react/compiler-runtime";
6
6
  import { errorToast as s, successToast as c, useLevo as l } from "@levo-so/react";
7
7
  import { useEffect as u, useState as d } from "react";
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { t as e } from "./Button-DtPwDEN0.js";
2
+ import { t as e } from "./Button-DujHjtOV.js";
3
3
  import { n as t } from "./AuthProvider-C6bvedwF.js";
4
- import { n, t as r } from "./StripePaymentModal-DrLMN18M.js";
5
- import { BillingStep as i } from "./BillingStep-2cKT5Pir.js";
4
+ import { n, t as r } from "./StripePaymentModal-Do1xHctU.js";
5
+ import { BillingStep as i } from "./BillingStep-CJqmdIz2.js";
6
6
  import { cn as a, errorHandler as o, useLevo as s } from "@levo-so/react";
7
7
  import { useEffect as c, useRef as l, useState as u } from "react";
8
8
  import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
package/collection.d.ts CHANGED
@@ -13,6 +13,7 @@ import { ILemaCollection } from '@levo-so/core';
13
13
  import { ILemaField } from '@levo-so/core';
14
14
  import { ILemaFieldOptions } from '@levo-so/core';
15
15
  import { ILevoMembership } from '@levo-so/core';
16
+ import { ILogicRule } from '@levo-so/core';
16
17
  import { JSX } from 'react/jsx-runtime';
17
18
  import { Mark } from '@tiptap/core';
18
19
  import { MediaKindList } from '@levo-so/core';
@@ -456,15 +457,14 @@ export declare const updateFieldWInterface: (tempField: ILemaField, field_interf
456
457
  options: ILemaFieldOptions;
457
458
  allow_public_view?: boolean;
458
459
  allow_public_submit?: boolean;
460
+ logic?: ILogicRule[];
459
461
  };
460
462
  fieldFocused: string | null;
461
463
  };
462
464
 
463
- export declare const useLevoForm: ({ schema: schemaProp, originalSchema: originalSchemaProp, saveToRemote, onSubmit, onSubmitSuccess, onSubmitError, setFormErrorAfterSubmit, }: {
465
+ export declare const useLevoForm: ({ schema: schemaProp, originalSchema: originalSchemaProp, onSubmitSuccess, onSubmitError, setFormErrorAfterSubmit, }: {
464
466
  schema: ILemaCollection | null;
465
467
  originalSchema?: ILemaCollection | null;
466
- saveToRemote?: boolean;
467
- onSubmit?: (v: any) => void;
468
468
  onSubmitSuccess?: () => void;
469
469
  onSubmitError?: (e: IFieldError[]) => void;
470
470
  setFormErrorAfterSubmit?: boolean;
@@ -475,7 +475,8 @@ export declare const useLevoForm: ({ schema: schemaProp, originalSchema: origina
475
475
  contentId: string | null;
476
476
  allFormValues: any;
477
477
  handleContentId: (id: string) => void;
478
- handleSubmit: (e?: React.BaseSyntheticEvent) => Promise<void>;
478
+ appendFormValues: (data: any) => void;
479
+ submitToRemote: (data: any) => Promise<void>;
479
480
  showSuccessOverlay: boolean;
480
481
  dismissSuccessOverlay: () => void;
481
482
  };
package/collection.js CHANGED
@@ -1,10 +1,9 @@
1
- import { a as e, c as t, d as n, f as r, h as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, s as f, u as p } from "./dist-CsX9NP5P.js";
2
- import { a as m, c as h, d as g, f as _, i as v, l as y, n as b, o as x, r as S, s as C, t as w, u as T } from "./widgets-eu5zXTf-.js";
3
- import { t as E } from "./getFieldValidations-CSkSV2hW.js";
4
- import { t as D } from "./utils-CZLafTgN.js";
5
- import { a as O, c as k, i as A, n as j, o as M, r as N, s as P, t as F, u as I } from "./CollectionField-xa-jed3_.js";
6
- import { t as L } from "./CollectionInput-CpNGIXJx.js";
7
- import { n as R, r as z, t as B } from "./Toolbar-Y6JtgPFn.js";
1
+ import { C as e, S as t, T as n, _ as r, a as i, b as a, c as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, o as m, p as h, r as g, s as _, t as v, u as y, v as b, w as x, x as S, y as C } from "./CollectionFormBuilder-BvFtiZeH.js";
2
+ import { a as w, c as T, f as E, i as D, n as O, o as k, r as A, s as j, t as M, u as N } from "./CollectionField-BPl8E9MW.js";
3
+ import { t as P } from "./utils-CUqS5dMC.js";
4
+ import { t as F } from "./CollectionInput-DcNJT5Pg.js";
5
+ import { n as I, r as L } from "./dist-DZbXWctg.js";
6
+ import { n as R, r as z, t as B } from "./Toolbar-B5UZer_x.js";
8
7
  //#region ../../libraries/react-collection/dist/types/formVariant.js
9
8
  var V = [
10
9
  {
@@ -29,4 +28,4 @@ var V = [
29
28
  }
30
29
  ];
31
30
  //#endregion
32
- export { i as AsyncSelectPaginate, s as CURRENCY_SYMBOLS, B as CollectionEditorToolbar, F as CollectionFieldWrapper, F as FieldWrapper, t as CollectionForm, d as CollectionFormBuilder, c as CollectionFormRenderer, L as CollectionInput, L as Input, I as CollectionLabel, r as DEFAULT_WIDGET_REGISTRY, O as Field, P as FieldContent, M as FieldDescription, j as FieldError, k as FieldGroup, N as FieldLabel, n as FieldRenderer, A as FieldSet, a as FormBuilder, V as FormVariantOptions, u as INR_CURRENCY_SYMBOL, l as LevoFormProvider, p as ThemeWrapper, R as ToolbarButton, _ as areAllFieldsHidden, w as createWidget, v as errorsToParam, z as getCollectionEditorExtensions, x as getDefaultFieldValues, g as getDefaultValuesByKind, E as getFieldValidations, h as getInitialValues, D as getKindFromMimetype, T as getValueIfNotUndefined, y as isPhoneValid, b as setFormErrors, S as submitDataParser, C as updateFieldWInterface, e as useLevoForm, f as useLevoFormContext, o as useLevoFormTheme, m as validateForm };
31
+ export { h as AsyncSelectPaginate, c as CURRENCY_SYMBOLS, B as CollectionEditorToolbar, M as CollectionFieldWrapper, M as FieldWrapper, L as CollectionForm, v as CollectionFormBuilder, I as CollectionFormRenderer, F as CollectionInput, F as Input, N as CollectionLabel, y as DEFAULT_WIDGET_REGISTRY, w as Field, j as FieldContent, k as FieldDescription, O as FieldError, T as FieldGroup, A as FieldLabel, f as FieldRenderer, D as FieldSet, g as FormBuilder, V as FormVariantOptions, s as INR_CURRENCY_SYMBOL, i as LevoFormProvider, o as ThemeWrapper, R as ToolbarButton, n as areAllFieldsHidden, p as createWidget, r as errorsToParam, z as getCollectionEditorExtensions, C as getDefaultFieldValues, x as getDefaultValuesByKind, E as getFieldValidations, S as getInitialValues, P as getKindFromMimetype, e as getValueIfNotUndefined, t as isPhoneValid, u as setFormErrors, l as submitDataParser, a as updateFieldWInterface, d as useLevoForm, m as useLevoFormContext, _ as useLevoFormTheme, b as validateForm };
@@ -0,0 +1,97 @@
1
+ "use client";
2
+ import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
3
+ import { t } from "./Button-lUfKisu8.js";
4
+ import { T as n, a as r, c as i, i as a, l as o, n as s, o as c, r as l, t as u, w as d } from "./CollectionFormBuilder-BvFtiZeH.js";
5
+ import { useEffect as f, useMemo as p } from "react";
6
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
7
+ import g from "clsx";
8
+ import { FormProvider as _, useForm as v } from "react-hook-form";
9
+ //#region ../../libraries/react-collection/dist/lib/CollectionForm/CollectionForm.cssm.js
10
+ var y = "_1dzarb20", b = "_1dzarb21", x = "_1dzarb23", S = "_1dzarb24", C = "_1dzarb25", w = "_1dzarb26", T = ({ hiddenFields: e, isLoading: r, initialValues: a, onSubmit: s, schema: c, uiConfig: l, submitButtonConfig: u, containerStyles: T, isDisabled: E, theme: D, enableVerification: O = !0 }) => {
11
+ let k = p(() => {
12
+ if (c) {
13
+ let t = { ...c };
14
+ return t.sections = t?.sections?.map((t) => (t.fields = t?.fields?.map((t) => ((e?.includes(t?.key) || e?.includes(t?.id)) && (t.hidden = !0), t)), t)), t;
15
+ }
16
+ return null;
17
+ }, [c]), A = v({
18
+ mode: "onTouched",
19
+ disabled: E,
20
+ defaultValues: {},
21
+ resetOptions: { keepErrors: !0 }
22
+ }), { formState: { isSubmitting: j } } = A, M = (e) => {
23
+ s && s(e);
24
+ };
25
+ f(() => {
26
+ if (k) {
27
+ let e = {
28
+ ...d(c),
29
+ ...a
30
+ };
31
+ A.reset(e);
32
+ }
33
+ }, [k]);
34
+ let N = r || j;
35
+ return k ? /* @__PURE__ */ m(_, {
36
+ ...A,
37
+ children: /* @__PURE__ */ m(i, {
38
+ ...D || {},
39
+ children: /* @__PURE__ */ h("div", {
40
+ className: y,
41
+ children: [l?.hideFormHeading ? null : /* @__PURE__ */ m("h1", {
42
+ className: g(b),
43
+ children: "Create new"
44
+ }), /* @__PURE__ */ m("div", {
45
+ className: g(x, T),
46
+ children: /* @__PURE__ */ h("form", {
47
+ className: g(S, r && "_1dzarb27"),
48
+ id: "collection-form",
49
+ onSubmit: A.handleSubmit(M),
50
+ children: [c?.sections?.map((e) => n(e?.fields || []) ? null : /* @__PURE__ */ h("div", {
51
+ className: C,
52
+ children: [!l?.hideSectionHeadings && /* @__PURE__ */ m("p", {
53
+ className: "_1dzarb28",
54
+ children: e?.label
55
+ }), /* @__PURE__ */ m("div", {
56
+ className: w,
57
+ children: e?.fields?.map((e) => /* @__PURE__ */ m(o, {
58
+ field: e,
59
+ schema: c,
60
+ settings: { enableVerification: O }
61
+ }, e?.key))
62
+ })]
63
+ }, e.id)), u?.show && /* @__PURE__ */ m("div", {
64
+ className: "_1dzarb29",
65
+ children: /* @__PURE__ */ m(t, {
66
+ className: u?.styles,
67
+ disabled: E || N,
68
+ type: "submit",
69
+ children: N ? "Saving" : u?.text || "Save"
70
+ })
71
+ })]
72
+ })
73
+ })]
74
+ })
75
+ })
76
+ }) : null;
77
+ }, E = ({ hiddenFields: e, fetchedSchema: t, isLoading: n, enableVerification: r = !0, ...i }) => {
78
+ let a = p(() => {
79
+ let n = { ...t }, r = (t) => t?.map((t) => ((e?.includes(t.key) || e?.includes(t.id)) && (t.hidden = !0), t.fields = r(t.fields), t));
80
+ return n.sections = n?.sections?.map((e) => (e.fields = r(e?.fields), e)), n;
81
+ }, [t]);
82
+ return n ? /* @__PURE__ */ m(s, {}) : a ? /* @__PURE__ */ m(l, {
83
+ schema: a,
84
+ enableVerification: r,
85
+ ...i
86
+ }) : null;
87
+ }, D = /* @__PURE__ */ e({
88
+ CollectionForm: () => T,
89
+ CollectionFormBuilder: () => u,
90
+ CollectionFormRenderer: () => E,
91
+ FormBuilder: () => l,
92
+ LevoFormProvider: () => r,
93
+ useLevoForm: () => a,
94
+ useLevoFormContext: () => c
95
+ });
96
+ //#endregion
97
+ export { E as n, T as r, D as t };
package/index.d.ts CHANGED
@@ -402,6 +402,8 @@ declare interface CarouselProps extends BaseElementProps {
402
402
  */
403
403
  export declare const CategoryFilter: React.FC<ICategoryFilterProps>;
404
404
 
405
+ export declare const CollectionFormBuilder: default_2.FC<ICollectionFormBuilderProps>;
406
+
405
407
  export declare const colorOptions: {
406
408
  readonly brand: {
407
409
  readonly label: "Brand";
@@ -1082,6 +1084,14 @@ export declare interface ICategoryFilterProps {
1082
1084
  className?: string;
1083
1085
  }
1084
1086
 
1087
+ declare interface ICollectionFormBuilderProps extends Omit<ILevoFormContext, "schema"> {
1088
+ formVariant?: FormVariantType;
1089
+ collection_id: string;
1090
+ hiddenFields?: string[];
1091
+ workspace_id?: string;
1092
+ account?: ILevoMembership.Account;
1093
+ }
1094
+
1085
1095
  declare interface ICollectionTheme {
1086
1096
  form: {
1087
1097
  maxWidth: string;