@levo-so/studio 0.1.102 → 0.1.104
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/{AuthProvider-56TywIOB.js → AuthProvider-C6bvedwF.js} +16 -16
- package/{BillingStep-BTRobf00.js → BillingStep-2cKT5Pir.js} +1 -1
- package/{Button-DTrN8kki.js → Button-DtPwDEN0.js} +240 -143
- package/Button-lUfKisu8.js +116 -0
- package/CollectionField-xa-jed3_.js +232 -0
- package/{CollectionInput-lHOvWWav.js → CollectionInput-CpNGIXJx.js} +32 -32
- package/DateTimeWidget-DPHIhkAi.js +256 -0
- package/Dialog-IrII0ugb.js +130 -0
- package/{EntryCard-CqZlbw1Z.js → EntryCard-j4uZb2cE.js} +6 -6
- package/{LoginCard-DWLnYJJU.js → LoginCard-asvOHIRg.js} +3 -3
- package/{LoginForm-CEUbBeE3.js → LoginForm-BdsPVHdO.js} +200 -200
- package/{LoginModal-AWNLO49X.js → LoginModal-CyvbEK26.js} +4 -4
- package/{MessageCard-C5ULcfuw.js → MessageCard-lrXKEsBP.js} +2 -2
- package/{MessageFooter-CATwNJJU.js → MessageFooter-D-dCrzJH.js} +2 -2
- package/{ModalManager-DQXhkmyC.js → ModalManager-BcPk4sbK.js} +1 -1
- package/{PendingApprovalCard-BowwZMBu.js → PendingApprovalCard-hYkupl9A.js} +3 -3
- package/PhoneWidget-BOFhs8Ra.js +100 -0
- package/{Popover-Du4iigVw.js → Popover-O1poOHk2.js} +19 -20
- package/PopupRenderer-C7OHYphU-IWM6d7gW.js +2668 -0
- package/{RichTextWidget-iYdVRBGB.js → RichTextWidget-18XLL8wW.js} +27 -25
- package/RteThemeProvider-Cfepkyer.js +20 -0
- package/{StripePaymentModal-DC-ySB_o.js → StripePaymentModal-DrLMN18M.js} +17 -17
- package/Toolbar-Y6JtgPFn.js +645 -0
- package/Tooltip-NEMQqPyr.js +67 -0
- package/VerifyButton-TNkt-SDu.js +177 -0
- package/bookingCard-BdV2YSkq.js +636 -0
- package/collection.js +8 -8
- package/{dialog-CCWrvmHd.js → dialog-C8-iHixJ.js} +32 -32
- package/dist-CsX9NP5P.js +3188 -0
- package/generateRadiusScale-BpcgkGtN.js +71 -0
- package/getFieldValidations-CSkSV2hW.js +90 -0
- package/index.d.ts +53 -2
- package/index.js +5867 -7655
- package/inlineRteTheme-Ajq9PNpQ.js +9 -0
- package/{nodeAlignment-DoVbjk29.js → nodeAlignment-DKCIjzlR.js} +3 -3
- package/package.json +60 -76
- package/rolldown-runtime-CAFD8bLK.js +11 -0
- package/studio.css +1 -1
- package/{useLogin-D2VCOHYI.js → useLogin-B2qE8710.js} +23 -23
- package/{utils-Bh9uGjo1.js → utils-CZLafTgN.js} +1 -1
- package/{widgets-CG5Z_dk7.js → widgets-eu5zXTf-.js} +38 -105
- package/CollectionField-7uXvhxYK.js +0 -274
- package/DateTimeWidget-BHCP5osb.js +0 -255
- package/PhoneWidget-C6uZmrk8.js +0 -100
- package/Toolbar-BHi_B-nE.js +0 -737
- package/Tooltip-K_gFzjOa.js +0 -68
- package/VerifyButton-D21AOIX3.js +0 -273
- package/bookingCard--NlgtcJs.js +0 -577
- package/dist-x5VFEnQl.js +0 -3185
- package/getFieldValidations-DZnDgNI0.js +0 -159
- package/inlineRteTheme-Cn_Vqgsm.js +0 -23
- /package/{Beams-DkcjMVZl.js → Beams-DEybrmUZ.js} +0 -0
- /package/{Dots-BrEPvoj3.js → Dots-CMyy77GM.js} +0 -0
- /package/{Gradient-B4Er9hym.js → Gradient-DBn_zXzI.js} +0 -0
- /package/{Grid-B4XWU9eL.js → Grid-kGCr-6by.js} +0 -0
- /package/{Waves-kW-EBDdJ.js → Waves-DjLcbiBu.js} +0 -0
- /package/{authentication-fXmNYss1.js → authentication-hnV1BI8s.js} +0 -0
- /package/{card-BwNr7kQS.js → card-5ooLmYSr.js} +0 -0
- /package/{theme.cssm-2YTdd8Yh.js → theme.cssm-BXDp-ojp.js} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//#region ../../libraries/levocn/dist/styles/theme/themeVars.cssm.js
|
|
2
|
+
var e = {
|
|
3
|
+
colors: {
|
|
4
|
+
background: "var(--_1i5egzy0)",
|
|
5
|
+
foreground: "var(--_1i5egzy1)",
|
|
6
|
+
text: "var(--_1i5egzy2)",
|
|
7
|
+
heading: "var(--_1i5egzy3)",
|
|
8
|
+
card: "var(--_1i5egzy4)",
|
|
9
|
+
cardForeground: "var(--_1i5egzy5)",
|
|
10
|
+
popover: "var(--_1i5egzy6)",
|
|
11
|
+
popoverForeground: "var(--_1i5egzy7)",
|
|
12
|
+
primary: "var(--_1i5egzy8)",
|
|
13
|
+
primaryForeground: "var(--_1i5egzy9)",
|
|
14
|
+
secondary: "var(--_1i5egzya)",
|
|
15
|
+
secondaryForeground: "var(--_1i5egzyb)",
|
|
16
|
+
muted: "var(--_1i5egzyc)",
|
|
17
|
+
mutedForeground: "var(--_1i5egzyd)",
|
|
18
|
+
accent: "var(--_1i5egzye)",
|
|
19
|
+
accentForeground: "var(--_1i5egzyf)",
|
|
20
|
+
destructive: "var(--_1i5egzyg)",
|
|
21
|
+
border: "var(--_1i5egzyh)",
|
|
22
|
+
input: "var(--_1i5egzyi)",
|
|
23
|
+
inputForeground: "var(--_1i5egzyj)",
|
|
24
|
+
ring: "var(--_1i5egzyk)"
|
|
25
|
+
},
|
|
26
|
+
radius: "var(--_1i5egzyl)",
|
|
27
|
+
radiusScale: {
|
|
28
|
+
sm: "var(--_1i5egzym)",
|
|
29
|
+
base: "var(--_1i5egzyn)",
|
|
30
|
+
md: "var(--_1i5egzyo)",
|
|
31
|
+
lg: "var(--_1i5egzyp)",
|
|
32
|
+
xl: "var(--_1i5egzyq)",
|
|
33
|
+
"2xl": "var(--_1i5egzyr)",
|
|
34
|
+
"3xl": "var(--_1i5egzys)",
|
|
35
|
+
"4xl": "var(--_1i5egzyt)",
|
|
36
|
+
"5xl": "var(--_1i5egzyu)",
|
|
37
|
+
"6xl": "var(--_1i5egzyv)",
|
|
38
|
+
"7xl": "var(--_1i5egzyw)",
|
|
39
|
+
"8xl": "var(--_1i5egzyx)",
|
|
40
|
+
full: "var(--_1i5egzyy)"
|
|
41
|
+
},
|
|
42
|
+
baseFontSize: "var(--_1i5egzyz)",
|
|
43
|
+
fonts: {
|
|
44
|
+
body: "var(--_1i5egzy10)",
|
|
45
|
+
heading: "var(--_1i5egzy11)"
|
|
46
|
+
},
|
|
47
|
+
shadow: {
|
|
48
|
+
xs: "var(--_1i5egzy12)",
|
|
49
|
+
sm: "var(--_1i5egzy13)",
|
|
50
|
+
md: "var(--_1i5egzy14)",
|
|
51
|
+
lg: "var(--_1i5egzy15)",
|
|
52
|
+
xl: "var(--_1i5egzy16)",
|
|
53
|
+
inner: "var(--_1i5egzy17)"
|
|
54
|
+
}
|
|
55
|
+
}, t = (e) => ({
|
|
56
|
+
sm: `calc(${e} * 0.5)`,
|
|
57
|
+
base: e,
|
|
58
|
+
md: `calc(${e} * 1.5)`,
|
|
59
|
+
lg: `calc(${e} * 2)`,
|
|
60
|
+
xl: `calc(${e} * 3)`,
|
|
61
|
+
"2xl": `calc(${e} * 4)`,
|
|
62
|
+
"3xl": `calc(${e} * 6)`,
|
|
63
|
+
"4xl": `calc(${e} * 8)`,
|
|
64
|
+
"5xl": `calc(${e} * 12)`,
|
|
65
|
+
"6xl": `calc(${e} * 16)`,
|
|
66
|
+
"7xl": `calc(${e} * 20)`,
|
|
67
|
+
"8xl": `calc(${e} * 24)`,
|
|
68
|
+
full: "100%"
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
export { e as n, t };
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
//#region ../../libraries/react-collection/dist/utils/getFieldValidations.js
|
|
5
|
+
var r = (r, i) => {
|
|
6
|
+
let a = (r?.label || r?.key || "")?.replace(/_/g, " ");
|
|
7
|
+
if (a?.endsWith("Id") && (a = a?.replace("Id", "")), a.includes(".")) {
|
|
8
|
+
let [e] = a.split(".");
|
|
9
|
+
e && (a = e);
|
|
10
|
+
}
|
|
11
|
+
let o = (e) => {
|
|
12
|
+
let t = e;
|
|
13
|
+
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;
|
|
14
|
+
}, s;
|
|
15
|
+
switch (r.field_interface) {
|
|
16
|
+
case e.NumberWidget:
|
|
17
|
+
s = o(n.number());
|
|
18
|
+
break;
|
|
19
|
+
case e.ArrayWidget:
|
|
20
|
+
s = o(n.array().typeError("The field must be an array"));
|
|
21
|
+
break;
|
|
22
|
+
case e.RecordWidget:
|
|
23
|
+
s = n.object();
|
|
24
|
+
break;
|
|
25
|
+
case e.EmailWidget:
|
|
26
|
+
s = o(n.string().email("The email address is not valid"));
|
|
27
|
+
break;
|
|
28
|
+
case e.PhoneWidget:
|
|
29
|
+
s = o(n.string().test("phone", "The phone number has incorrect format", (e) => {
|
|
30
|
+
if (e) try {
|
|
31
|
+
return t(e);
|
|
32
|
+
} catch {
|
|
33
|
+
return !1;
|
|
34
|
+
}
|
|
35
|
+
return !0;
|
|
36
|
+
}));
|
|
37
|
+
break;
|
|
38
|
+
case e.URLWidget:
|
|
39
|
+
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"));
|
|
40
|
+
break;
|
|
41
|
+
case e.ImageUploadWidget:
|
|
42
|
+
case e.FileUploadWidget:
|
|
43
|
+
case e.GeocoderWidget:
|
|
44
|
+
s = n.object();
|
|
45
|
+
break;
|
|
46
|
+
case e.MultiImageUploadWidget:
|
|
47
|
+
case e.MultiFileUploadWidget:
|
|
48
|
+
case e.MultiGeocoderWidget:
|
|
49
|
+
s = n.array().of(n.object());
|
|
50
|
+
break;
|
|
51
|
+
case e.JSONWidget:
|
|
52
|
+
case e.DropdownWidget:
|
|
53
|
+
s = n.string();
|
|
54
|
+
break;
|
|
55
|
+
case e.MultiTextWidget:
|
|
56
|
+
case e.MultiDropdownWidget:
|
|
57
|
+
case e.CheckboxWidget:
|
|
58
|
+
s = n.array().of(n.string());
|
|
59
|
+
break;
|
|
60
|
+
case e.ToggleCheckboxWidget:
|
|
61
|
+
s = n.boolean();
|
|
62
|
+
break;
|
|
63
|
+
case e.CollectionWidget:
|
|
64
|
+
s = r.options.current_have_many_connected ? n.array() : n.object();
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
s = o(n.string());
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
if (r.options?.validationsPresets && Array.isArray(r.options.validationsPresets)) {
|
|
71
|
+
let t = r.options.validationsPresets;
|
|
72
|
+
(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")));
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
required: {
|
|
76
|
+
value: !!r?.required,
|
|
77
|
+
message: `The ${a} field is required`
|
|
78
|
+
},
|
|
79
|
+
validate: (e) => {
|
|
80
|
+
if (r?.options?.disableValidation || e === "" || e == null) return !0;
|
|
81
|
+
try {
|
|
82
|
+
return s.validateSync(e), i ? i(e) : !0;
|
|
83
|
+
} catch (e) {
|
|
84
|
+
return e instanceof n.ValidationError ? e.message : !0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
export { r as t };
|
package/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { IMeta } from '@levo-so/core';
|
|
|
23
23
|
import { IResponseMultiple } from '@levo-so/core';
|
|
24
24
|
import { IResponseSingle } from '@levo-so/core';
|
|
25
25
|
import { IWorkspace } from '@levo-so/core';
|
|
26
|
+
import { JSONContent } from '@tiptap/core';
|
|
26
27
|
import { JSX } from 'react/jsx-runtime';
|
|
27
28
|
import { LazyExoticComponent } from 'react';
|
|
28
29
|
import { LevoError } from '@levo-so/core';
|
|
@@ -512,6 +513,8 @@ export declare type ContentHint = {
|
|
|
512
513
|
|
|
513
514
|
export declare type ContentUsecase = "main_title" | "sub_title" | "description" | "label" | "button" | "person_name" | "designation" | "testimonial" | "cta_button" | "price" | "currency" | "interval" | "feature" | "title" | "stat_number" | "stat_label" | "question" | "answer" | "category" | "date" | "reading_time" | "author" | "address" | "phone" | "email" | "link_url" | "link_text";
|
|
514
515
|
|
|
516
|
+
export declare const convertHtmlToJSON: (html: string) => JSONContent;
|
|
517
|
+
|
|
515
518
|
export declare const convertKeysToPascalCase: (key: string) => string;
|
|
516
519
|
|
|
517
520
|
export declare const CreateForumPost: default_2.FC<ICreateForumPostProps>;
|
|
@@ -687,6 +690,17 @@ export declare const generateAccentColor: (oklch: OKLCHColor) => {
|
|
|
687
690
|
hex: string;
|
|
688
691
|
};
|
|
689
692
|
|
|
693
|
+
/**
|
|
694
|
+
* Concatenates site-level and page-level `body_code` settings.
|
|
695
|
+
* Rendered at the end of the page body — typically used for tracking pixels,
|
|
696
|
+
* chat widgets, or any third-party script that must load after content.
|
|
697
|
+
*/
|
|
698
|
+
export declare const generateBodyContent: (pageData: {
|
|
699
|
+
settings?: {
|
|
700
|
+
body_code?: string;
|
|
701
|
+
};
|
|
702
|
+
} | null | undefined, site: ISite | null | undefined) => string;
|
|
703
|
+
|
|
690
704
|
export declare const generateDefaultContent: (contentSchema: any[]) => any;
|
|
691
705
|
|
|
692
706
|
export declare const generateSchemaFromJSX: (jsx: string) => IBlock["content_schema"];
|
|
@@ -1179,7 +1193,8 @@ export declare interface IFieldConfig {
|
|
|
1179
1193
|
selected_fields?: string[];
|
|
1180
1194
|
};
|
|
1181
1195
|
action?: {
|
|
1182
|
-
type: "page" | "external_link" | "email" | "phone" | "login" | "none";
|
|
1196
|
+
type: "page" | "external_link" | "email" | "phone" | "login" | "popup" | "none";
|
|
1197
|
+
/** For type "popup", holds the popup id to open. */
|
|
1183
1198
|
value: string;
|
|
1184
1199
|
alt?: string;
|
|
1185
1200
|
options: {
|
|
@@ -1404,7 +1419,7 @@ declare interface ILevoFormContext {
|
|
|
1404
1419
|
preview?: boolean;
|
|
1405
1420
|
}
|
|
1406
1421
|
|
|
1407
|
-
export declare type ILevoPageData = Pick<IPageExpanded, "id" | "workspace_id" | "blocks" | "source" | "title" | "description" | "access" | "style_config">;
|
|
1422
|
+
export declare type ILevoPageData = Pick<IPageExpanded, "id" | "workspace_id" | "blocks" | "source" | "title" | "description" | "access" | "style_config" | "settings">;
|
|
1408
1423
|
|
|
1409
1424
|
export declare interface ILevoPageProps {
|
|
1410
1425
|
pageData: ILevoPageData;
|
|
@@ -1415,6 +1430,7 @@ export declare interface ILevoPageProps {
|
|
|
1415
1430
|
workspace: IWorkspace;
|
|
1416
1431
|
site: ISite;
|
|
1417
1432
|
authOverride?: IAuthOverride | null;
|
|
1433
|
+
disableBranding?: boolean;
|
|
1418
1434
|
}
|
|
1419
1435
|
|
|
1420
1436
|
export declare interface ILocalizedPage {
|
|
@@ -1426,6 +1442,10 @@ export declare interface ILocalizedPage {
|
|
|
1426
1442
|
url?: string;
|
|
1427
1443
|
}
|
|
1428
1444
|
|
|
1445
|
+
declare interface IMadeWithLevoProps {
|
|
1446
|
+
site: ISite;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1429
1449
|
declare const Image_2: WithBlockPropsComponent<Omit<BaseImageProps, "ref"> & RefAttributes<HTMLImageElement>>;
|
|
1430
1450
|
export { Image_2 as Image }
|
|
1431
1451
|
|
|
@@ -1628,6 +1648,8 @@ export declare interface IPageMeta {
|
|
|
1628
1648
|
|
|
1629
1649
|
export declare interface IPageSettings {
|
|
1630
1650
|
structured_data_json?: string;
|
|
1651
|
+
head_code?: string;
|
|
1652
|
+
body_code?: string;
|
|
1631
1653
|
[key: string]: any;
|
|
1632
1654
|
}
|
|
1633
1655
|
|
|
@@ -1649,6 +1671,17 @@ declare interface IPendingRequestStateProps {
|
|
|
1649
1671
|
className?: string;
|
|
1650
1672
|
}
|
|
1651
1673
|
|
|
1674
|
+
declare interface IPopupLoaderProps {
|
|
1675
|
+
siteId?: string;
|
|
1676
|
+
/**
|
|
1677
|
+
* Id of the page definition currently being rendered. Levo-hosted sites
|
|
1678
|
+
* know this at render time and should pass it through so page-bound
|
|
1679
|
+
* targeting rules (e.g. "show on all blog posts") can match.
|
|
1680
|
+
* External-site SDK consumers leave this undefined.
|
|
1681
|
+
*/
|
|
1682
|
+
pageId?: string;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1652
1685
|
export declare interface IPostActionsLoadingState {
|
|
1653
1686
|
engagements?: boolean;
|
|
1654
1687
|
comments?: boolean;
|
|
@@ -1738,6 +1771,7 @@ export declare interface ISite {
|
|
|
1738
1771
|
theme: ITheme;
|
|
1739
1772
|
settings: {
|
|
1740
1773
|
head_code?: string;
|
|
1774
|
+
body_code?: string;
|
|
1741
1775
|
studio_preview_url?: string;
|
|
1742
1776
|
staging_preview_url?: string;
|
|
1743
1777
|
contact_info?: IContactInfo;
|
|
@@ -2159,6 +2193,13 @@ export declare const LevoPage: default_2.FC<ILevoPageProps>;
|
|
|
2159
2193
|
|
|
2160
2194
|
export declare const Link: WithBlockPropsComponent<BaseLinkProps & RefAttributes<HTMLAnchorElement>>;
|
|
2161
2195
|
|
|
2196
|
+
/**
|
|
2197
|
+
* "Made with Levo" badge fixed to the bottom-right of a rendered page,
|
|
2198
|
+
* with a click-through promotional popup. Gated by `workspace.feature_flag.branding`
|
|
2199
|
+
* at the call site (LevoPage).
|
|
2200
|
+
*/
|
|
2201
|
+
export declare const MadeWithLevo: React.FC<IMadeWithLevoProps>;
|
|
2202
|
+
|
|
2162
2203
|
export declare const Media: WithBlockPropsComponent<(Omit<BaseMediaProps & HTMLImageProps_2 & {
|
|
2163
2204
|
isVideo?: false;
|
|
2164
2205
|
}, "ref"> | Omit<BaseMediaProps & HTMLVideoProps & {
|
|
@@ -2318,6 +2359,15 @@ export declare const PopoverRoot: React_2.FC<Popover.PopoverProps>;
|
|
|
2318
2359
|
|
|
2319
2360
|
export declare const PopoverTrigger: WithBlockPropsComponent<BasePopoverTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
2320
2361
|
|
|
2362
|
+
/**
|
|
2363
|
+
* Plug-and-play popup integration for React apps.
|
|
2364
|
+
* Waits for identity context (session hydrated + identity resolved), then
|
|
2365
|
+
* fetches active popups and lazy-loads the renderer only when popups exist.
|
|
2366
|
+
* Works without insights network — gates on local readiness, not /welcome.
|
|
2367
|
+
* Must be placed inside a `<LevoProvider>`.
|
|
2368
|
+
*/
|
|
2369
|
+
export declare const PopupLoader: React.FC<IPopupLoaderProps>;
|
|
2370
|
+
|
|
2321
2371
|
export declare const PostActions: default_2.FC<{
|
|
2322
2372
|
post: IForumPost;
|
|
2323
2373
|
postDetailPageURLPattern?: string | null;
|
|
@@ -2418,6 +2468,7 @@ declare interface PreviewHighlighterProps {
|
|
|
2418
2468
|
isGenerationCancelled?: boolean;
|
|
2419
2469
|
totalBlocksCount?: number;
|
|
2420
2470
|
blocksGenerationInfo?: IBlockGenerationInfo[];
|
|
2471
|
+
contrastColor?: "black" | "white";
|
|
2421
2472
|
}
|
|
2422
2473
|
|
|
2423
2474
|
/**
|