@levo-so/studio 0.1.57 → 0.1.59

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 (85) hide show
  1. package/dist/{Beams-CjOdmyD4.js → Beams-0Cg_3upg.js} +1 -1
  2. package/dist/{Dots-BlGBjcwD.js → Dots-turX9wMO.js} +1 -1
  3. package/dist/{Gradient-YhY9Pvdr.js → Gradient-Be4Kqh_1.js} +1 -1
  4. package/dist/{Grid-BO_h2CxQ.js → Grid-B0vqOT42.js} +1 -1
  5. package/dist/MessageCard-CCngWCHS.js +53 -0
  6. package/dist/{Waves-SaFLO-Gq.js → Waves-DL4kuojY.js} +1 -1
  7. package/dist/bridge/Highlighter.d.ts +9 -1
  8. package/dist/bridge/PreviewHighlighter.d.ts +8 -1
  9. package/dist/bridge/StudioPagePreview.d.ts +4 -0
  10. package/dist/bridge/constants.d.ts +2 -0
  11. package/dist/bridge/types.d.ts +27 -0
  12. package/dist/bridge/utils.d.ts +9 -1
  13. package/dist/components/LoginForm/AuthMethodRenderer.d.ts +12 -0
  14. package/dist/components/LoginForm/GoogleOAuth.d.ts +1 -0
  15. package/dist/components/LoginForm/MagicLinkAuthForm.d.ts +6 -0
  16. package/dist/components/LoginForm/OAuthSection.d.ts +11 -0
  17. package/dist/components/LoginForm/OtpAuthForm.d.ts +2 -0
  18. package/dist/components/LoginForm/WhatsAppAuthForm.d.ts +2 -0
  19. package/dist/components/LoginForm/index.d.ts +5 -0
  20. package/dist/components/accessCard/EntryCard/index.d.ts +2 -2
  21. package/dist/components/accessCard/LoginCard/index.d.ts +2 -0
  22. package/dist/components/accessCard/MessageCard.d.ts +10 -0
  23. package/dist/components/index.d.ts +2 -0
  24. package/dist/components/integrationFilters/FieldRenderer.d.ts +7 -0
  25. package/dist/components/integrationFilters/IntegrationFilters.d.ts +11 -0
  26. package/dist/components/integrationFilters/fields/DropdownField.d.ts +8 -0
  27. package/dist/components/integrationFilters/fields/TextField.d.ts +7 -0
  28. package/dist/components/shared/EmailInput/index.d.ts +1 -1
  29. package/dist/components/shared/MagicLinkSuccess/index.d.ts +7 -0
  30. package/dist/components/shared/PhoneInput/index.d.ts +10 -0
  31. package/dist/components/ui/Calendar.d.ts +5 -0
  32. package/dist/components/ui/FlippingText.d.ts +6 -0
  33. package/dist/components/ui/base/index.d.ts +2 -0
  34. package/dist/components/ui/base/input.d.ts +4 -0
  35. package/dist/components/ui/form/FormInput.d.ts +17 -0
  36. package/dist/components/ui/form/FormSelect.d.ts +17 -0
  37. package/dist/components/ui/form/utils/FieldError.d.ts +5 -0
  38. package/dist/components/ui/form/utils/FieldWrapper.d.ts +19 -0
  39. package/dist/components/ui/form/utils/FormHelperText.d.ts +7 -0
  40. package/dist/components/ui/form/utils/FormLabel.d.ts +8 -0
  41. package/dist/components/ui/index.d.ts +2 -0
  42. package/dist/constants/authentication.d.ts +41 -0
  43. package/dist/contentEngine/content.d.ts +21 -14
  44. package/dist/contentEngine/getPage.d.ts +2 -1
  45. package/dist/contentEngine/sourceFetcher.d.ts +4 -2
  46. package/dist/contentEngine/themeUtils.d.ts +57 -1
  47. package/dist/contentEngine/types.d.ts +3 -1
  48. package/dist/contentEngine/urlBuilder.d.ts +1 -1
  49. package/dist/core/AccessManager/index.d.ts +2 -0
  50. package/dist/core/LevoPage.d.ts +2 -0
  51. package/dist/elements/EditForm.d.ts +11 -0
  52. package/dist/elements/Form.d.ts +1 -0
  53. package/dist/elements/Section.d.ts +1 -0
  54. package/dist/elements/Tabs.d.ts +21 -0
  55. package/dist/elements/accordion/index.d.ts +4 -4
  56. package/dist/elements/index.d.ts +2 -0
  57. package/dist/hooks/useLogin.d.ts +18 -25
  58. package/dist/index-BdswdesP.js +36 -0
  59. package/dist/index-CPJI9a7D.js +13503 -0
  60. package/dist/index-CmNhuPZp.js +34 -0
  61. package/dist/index-kVKDoWCh.js +57 -0
  62. package/dist/index.d.ts +3 -0
  63. package/dist/index.js +112 -92
  64. package/dist/interfaces/contentSchema.d.ts +5 -2
  65. package/dist/interfaces/form.d.ts +33 -0
  66. package/dist/interfaces/levoBlock.d.ts +18 -6
  67. package/dist/interfaces/site.d.ts +21 -5
  68. package/dist/interfaces/sites.d.ts +8 -2
  69. package/dist/pixel/constants/colorOptions.d.ts +5 -0
  70. package/dist/pixel/index.d.ts +2 -1
  71. package/dist/pixel/optionsMap.d.ts +0 -1
  72. package/dist/providers/AuthProvider.d.ts +5 -0
  73. package/dist/schemas/authSchemas.d.ts +46 -0
  74. package/dist/studio.css +1 -1
  75. package/dist/utils/colorUtils.d.ts +5 -0
  76. package/dist/utils/findFieldSchema.d.ts +6 -0
  77. package/dist/utils/index.d.ts +3 -0
  78. package/package.json +9 -4
  79. package/dist/components/accessCard/MessageCard/index.d.ts +0 -8
  80. package/dist/contentEngine/config.d.ts +0 -7
  81. package/dist/index-BFUEWnWU.js +0 -49
  82. package/dist/index-BP4Q9Ed6.js +0 -23
  83. package/dist/index-C5YVd5mP.js +0 -54
  84. package/dist/index-ChfbB6-A.js +0 -10565
  85. package/dist/index-DurprJto.js +0 -30
@@ -1,4 +1,35 @@
1
1
  import { IBlockInstance, ITheme } from '../interfaces';
2
+ import { IPreviewDevice } from '../pixel';
3
+ /**
4
+ * Theme Processing and CSS Generation System
5
+ *
6
+ * This module handles the complete transformation of theme configuration into
7
+ * CSS that powers the visual styling of studio elements. It combines multiple
8
+ * sources of styling information into a cohesive CSS output.
9
+ *
10
+ * CSS Generation Sources:
11
+ * 1. Theme Variables - CSS custom properties from primitive theme values
12
+ * 2. Default Styles - Component default styles and theme variant styles
13
+ * 3. Block Styles - Instance-specific styles from block configurations
14
+ * 4. Font Loading - Google Fonts integration for theme fonts
15
+ *
16
+ * The generated CSS follows a specific hierarchy and naming convention that
17
+ * integrates with the withBlockProps HOC and ThemeVariantSelector system.
18
+ */
19
+ /**
20
+ * Font Processing and Google Fonts Integration
21
+ *
22
+ * Extracts font families from theme configuration and generates Google Fonts
23
+ * URLs for loading. Handles deduplication and URL encoding.
24
+ *
25
+ * @param theme - Theme configuration containing font selections
26
+ * @returns Object with font list and Google Fonts URL
27
+ */
28
+ export declare const processFonts: (theme: ITheme) => {
29
+ fonts: string[];
30
+ fontUrl: string;
31
+ fontTags: string;
32
+ };
2
33
  /**
3
34
  * CSS Custom Properties Generation
4
35
  *
@@ -36,6 +67,30 @@ export declare const generateThemeVariables: (theme: ITheme) => {
36
67
  "--base-font-size": string;
37
68
  "--default-shadow": string;
38
69
  };
70
+ /**
71
+ * Component Theme and Variant Style Generation
72
+ *
73
+ * This is the core function that transforms the component theme system into CSS.
74
+ * It generates styles for both default component styling and theme variants.
75
+ *
76
+ * CSS Selectors Generated:
77
+ * 1. [data-levo_element_type='ComponentName'] - Component default styles
78
+ * 2. .levo-variant-{groupId}-{variantId} - Theme variant styles
79
+ *
80
+ * Style Hierarchy:
81
+ * - Component defaults apply to all instances of that component type
82
+ * - Variant classes override defaults when selected via ThemeVariantSelector
83
+ * - Block-specific styles (from generateBlockStyles) have highest specificity
84
+ *
85
+ * Integration Points:
86
+ * - withBlockProps HOC generates the variant classes on elements
87
+ * - ThemeVariantSelector allows users to select variants in widget config
88
+ * - VariantGroupManager provides the theme editor interface
89
+ *
90
+ * @param theme - Complete theme configuration with component definitions
91
+ * @returns CSS string with component and variant selectors
92
+ */
93
+ export declare const generateThemeStyles: (theme?: ITheme, device?: IPreviewDevice) => string;
39
94
  /**
40
95
  * Complete Theme Processing and CSS Generation
41
96
  *
@@ -63,10 +118,11 @@ export declare const generateThemeVariables: (theme: ITheme) => {
63
118
  * @param pageID - Unique identifier for CSS scoping
64
119
  * @returns Object with processed theme data and HTML for injection
65
120
  */
66
- export declare const processTheme: ({ pageTheme, blocks, pageID, }: {
121
+ export declare const processTheme: ({ pageTheme, blocks, pageID, device, }: {
67
122
  pageTheme: ITheme;
68
123
  blocks?: IBlockInstance[];
69
124
  pageID?: string;
125
+ device?: IPreviewDevice;
70
126
  }) => {
71
127
  theme: ITheme;
72
128
  fonts: string[];
@@ -10,6 +10,8 @@ export interface SourceFetchOptions {
10
10
  source: IStudioSource;
11
11
  slugs?: Record<string, string>;
12
12
  params?: Record<string, unknown>;
13
+ cookies?: string;
14
+ draft?: boolean;
13
15
  }
14
16
  export interface BlockTemplateOptions {
15
17
  contentSkeleton: any;
@@ -18,7 +20,7 @@ export interface BlockTemplateOptions {
18
20
  pageContext?: Record<string, any>;
19
21
  }
20
22
  export type IPageContext = Record<string, unknown>;
21
- export type IBlockContext = Record<string, IResponseMultiple["content"]>;
23
+ export type IBlockContext = Record<string, IResponseMultiple>;
22
24
  export interface IPageDataContext {
23
25
  page?: IPageContext;
24
26
  blocks: Record<string, IBlockContext>;
@@ -4,6 +4,6 @@ export declare const createSourceUrl: ({ levoClient, source, slug, query, }: {
4
4
  levoClient: ILevoClient;
5
5
  source: IStudioSource;
6
6
  slug?: string;
7
- query?: Record<string, unknown>;
7
+ query: Record<string, unknown>;
8
8
  }) => string;
9
9
  //# sourceMappingURL=urlBuilder.d.ts.map
@@ -1,9 +1,11 @@
1
1
  import { ISite } from '../../interfaces';
2
+ import { IAuthOverride } from '../../providers/AuthProvider';
2
3
  import { ILevoPageData } from '../../contentEngine';
3
4
  declare const AccessManager: React.FC<{
4
5
  page: ILevoPageData;
5
6
  site: ISite;
6
7
  children: React.ReactNode;
8
+ authOverride?: IAuthOverride | null;
7
9
  }>;
8
10
  export default AccessManager;
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { IWorkspace } from '@levo-so/core';
3
3
  import { ISite, BlockComponent } from '../interfaces';
4
4
  import { ILevoPageData, IPageDataContext } from '../contentEngine';
5
+ import { IAuthOverride } from '../providers';
5
6
  export interface ILevoPageProps {
6
7
  pageData: ILevoPageData;
7
8
  parsedPageData: ILevoPageData;
@@ -10,6 +11,7 @@ export interface ILevoPageProps {
10
11
  blocks: Record<string, BlockComponent>;
11
12
  workspace: IWorkspace;
12
13
  site: ISite;
14
+ authOverride?: IAuthOverride | null;
13
15
  }
14
16
  export declare const LevoPage: React.FC<ILevoPageProps>;
15
17
  //# sourceMappingURL=LevoPage.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { ILevoFormContext } from '@levo-so/react-collection';
2
+ import { BaseElementProps } from '../components/withBlockProps';
3
+ export declare const EditForm: import('../components/withBlockProps').WithBlockPropsComponent<BaseElementProps & {
4
+ className?: string;
5
+ initialValues?: Record<string, any>;
6
+ theme?: ILevoFormContext["theme"];
7
+ onSubmit?: (values: any) => void;
8
+ isLoading?: boolean;
9
+ }>;
10
+ export default EditForm;
11
+ //# sourceMappingURL=EditForm.d.ts.map
@@ -2,6 +2,7 @@ import { ILevoFormContext } from '@levo-so/react-collection';
2
2
  import { BaseElementProps } from '../components/withBlockProps';
3
3
  export declare const Form: import('../components/withBlockProps').WithBlockPropsComponent<BaseElementProps & {
4
4
  className?: string;
5
+ initialValues?: Record<string, any>;
5
6
  theme?: ILevoFormContext["theme"];
6
7
  }>;
7
8
  export default Form;
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { BaseElementProps } from '../components/withBlockProps';
3
3
  interface BaseSectionProps extends BaseElementProps, Omit<React.HTMLAttributes<HTMLElement>, "content"> {
4
4
  }
5
+ export declare const BaseSection: React.ForwardRefExoticComponent<BaseSectionProps & React.RefAttributes<HTMLElement>>;
5
6
  export declare const Section: import('../components/withBlockProps').WithBlockPropsComponent<BaseSectionProps & React.RefAttributes<HTMLElement>>;
6
7
  export default Section;
7
8
  //# sourceMappingURL=Section.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { Tabs as TabsPrimitive } from 'radix-ui';
2
+ import { BaseElementProps } from '../components/withBlockProps';
3
+ import * as React from "react";
4
+ declare const TabsRoot: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
5
+ type TypeTabsListComponentProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>;
6
+ interface BaseTabsListProps extends BaseElementProps, Omit<TypeTabsListComponentProps, "content"> {
7
+ ref?: React.Ref<React.ElementRef<typeof TabsPrimitive.List>>;
8
+ }
9
+ type TypeTabsTriggerComponentProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>;
10
+ interface BaseTabsTriggerProps extends BaseElementProps, Omit<TypeTabsTriggerComponentProps, "content"> {
11
+ ref?: React.Ref<React.ElementRef<typeof TabsPrimitive.Trigger>>;
12
+ }
13
+ type TypeTabsContentComponentProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>;
14
+ interface BaseTabsContentProps extends BaseElementProps, Omit<TypeTabsContentComponentProps, "content"> {
15
+ ref?: React.Ref<React.ElementRef<typeof TabsPrimitive.Content>>;
16
+ }
17
+ declare const TabsList: import('../components/withBlockProps').WithBlockPropsComponent<BaseTabsListProps>;
18
+ declare const TabsTrigger: import('../components/withBlockProps').WithBlockPropsComponent<BaseTabsTriggerProps>;
19
+ declare const TabsContent: import('../components/withBlockProps').WithBlockPropsComponent<BaseTabsContentProps>;
20
+ export { TabsRoot, TabsList, TabsTrigger, TabsContent };
21
+ //# sourceMappingURL=Tabs.d.ts.map
@@ -12,9 +12,9 @@ interface BaseAccordionContentProps extends BaseElementProps, Omit<React.Compone
12
12
  }
13
13
  declare const AccordionRoot: import('../../components/withBlockProps').WithBlockPropsComponent<BaseAccordionRootProps & {
14
14
  collapsible?: boolean;
15
- } & React.RefAttributes<HTMLDivElement>>;
16
- declare const AccordionItem: import('../../components/withBlockProps').WithBlockPropsComponent<BaseAccordionItemProps & React.RefAttributes<HTMLDivElement>>;
17
- declare const AccordionTrigger: import('../../components/withBlockProps').WithBlockPropsComponent<BaseAccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
18
- declare const AccordionContent: import('../../components/withBlockProps').WithBlockPropsComponent<BaseAccordionContentProps & React.RefAttributes<HTMLDivElement>>;
15
+ }>;
16
+ declare const AccordionItem: import('../../components/withBlockProps').WithBlockPropsComponent<BaseAccordionItemProps>;
17
+ declare const AccordionTrigger: import('../../components/withBlockProps').WithBlockPropsComponent<BaseAccordionTriggerProps>;
18
+ declare const AccordionContent: import('../../components/withBlockProps').WithBlockPropsComponent<BaseAccordionContentProps>;
19
19
  export { AccordionRoot, AccordionItem, AccordionTrigger, AccordionContent };
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -13,5 +13,7 @@ export * from './accordion';
13
13
  export * from './popover';
14
14
  export * from './Link';
15
15
  export * from './Form';
16
+ export * from './EditForm';
16
17
  export * from './UserMenu';
18
+ export * from './Tabs';
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1,29 +1,22 @@
1
- import { ILevoMembership, LevoError } from '@levo-so/core';
2
- export declare const useLogin: () => {
3
- isLoading: boolean;
4
- isSendingOtp: boolean;
5
- resendOTP: (onResentSuccess?: () => void, onResentError?: (error: LevoError) => void) => void;
6
- isVerifying: boolean;
7
- isResendingOtp: boolean;
8
- otpSent: boolean;
9
- setOtpSent: import('react').Dispatch<import('react').SetStateAction<boolean>>;
10
- otpResent: boolean;
11
- setOtpResent: import('react').Dispatch<import('react').SetStateAction<boolean>>;
12
- email: string;
13
- setEmail: import('react').Dispatch<import('react').SetStateAction<string>>;
14
- otp: string;
15
- setOtp: import('react').Dispatch<import('react').SetStateAction<string>>;
16
- isLoggedIn: boolean;
17
- sendOTP: (onOTPSentSuccess?: () => void, onOTPSentError?: (error: LevoError) => void) => void;
18
- verifyOTP: (config?: {
19
- onLoginSuccess?: (account: ILevoMembership.Account | null) => void;
20
- onLoginError?: (error: LevoError) => void;
21
- }) => void;
22
- handleReset: (skipEmailReset?: boolean) => void;
1
+ import { LevoError, ILevoMembership } from '@levo-so/core';
2
+ export interface ISendOTPParams {
3
+ email?: string;
4
+ phone?: string;
5
+ medium?: "email" | "whatsapp";
6
+ }
7
+ export interface IUseLoginReturn {
8
+ sendOTP: (params: ISendOTPParams) => Promise<void>;
9
+ verifyOTP: (content: string, code: string) => Promise<ILevoMembership.Account | null>;
10
+ resendOTP: (params: ISendOTPParams) => Promise<void>;
11
+ sendMagicLink: (email: string) => Promise<void>;
23
12
  refetchLoginStatus: (onRefetchSuccess?: (user: ILevoMembership.Account) => void) => void;
24
13
  signOut: (onSignOutSuccess?: () => void, onSignOutError?: (error: LevoError) => void) => void;
25
- lastError: LevoError | null;
14
+ isLoggedIn: boolean;
26
15
  isAuthLoading: boolean;
27
- clearError: () => void;
28
- };
16
+ }
17
+ /**
18
+ * Pure API operations hook for authentication
19
+ * All form state management moved to components with Formik
20
+ */
21
+ export declare const useLogin: () => IUseLoginReturn;
29
22
  //# sourceMappingURL=useLogin.d.ts.map
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsxs as r, jsx as s } from "react/jsx-runtime";
3
+ import { useState as c } from "react";
4
+ import { L as l } from "./index-CPJI9a7D.js";
5
+ import { A as m } from "./index-DHHPZcEh.js";
6
+ const d = "_header_s7k8g_1", p = "_title_s7k8g_7", h = "_subtitle_s7k8g_14", g = "_formWrapper_s7k8g_20", e = {
7
+ header: d,
8
+ title: p,
9
+ subtitle: h,
10
+ formWrapper: g
11
+ }, L = ({ logo: o, siteName: t, page: n }) => {
12
+ const [i, a] = c(!1);
13
+ return /* @__PURE__ */ r(m, { logo: o, siteName: t, maxWidth: "sm", children: [
14
+ !i && /* @__PURE__ */ r("div", { className: e.header, children: [
15
+ /* @__PURE__ */ s("h1", { className: e.title, children: "Sign in to continue" }),
16
+ t && /* @__PURE__ */ r("p", { className: e.subtitle, children: [
17
+ "You need to sign in to access this page on",
18
+ " ",
19
+ /* @__PURE__ */ s("strong", { children: t })
20
+ ] })
21
+ ] }),
22
+ /* @__PURE__ */ s("div", { className: e.formWrapper, children: /* @__PURE__ */ s(
23
+ l,
24
+ {
25
+ className: e.form,
26
+ oAuthTitle: t || "Studio",
27
+ page: n,
28
+ magicLinkSent: i,
29
+ setMagicLinkSent: a
30
+ }
31
+ ) })
32
+ ] });
33
+ };
34
+ export {
35
+ L as default
36
+ };