@levo-so/studio 0.3.1 → 0.3.3

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.
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { r as e } from "./dist-DanVCpXe.js";
2
+ import { r as e } from "./dist-Ckw19x6H.js";
3
3
  import { n as t } from "./AuthProvider-CFQqiIf1.js";
4
4
  import { t as n } from "./Spinner-HCqR1eGW.js";
5
5
  import { t as r } from "./card-Cb4m0p4i.js";
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { t as e } from "./Button-DUBI4k7m.js";
2
+ import { t as e } from "./Button-Ho7QJuCT.js";
3
3
  import { n as t } from "./AuthProvider-CFQqiIf1.js";
4
4
  import { t as n } from "./cn-BL52QQS4.js";
5
5
  import { n as r, t as i } from "./StripePaymentModal-Cw-AlxTS.js";
6
- import { BillingStep as a } from "./BillingStep-DNg2PTXV.js";
6
+ import { BillingStep as a } from "./BillingStep-DhK0Mkjr.js";
7
7
  import { errorHandler as o, useLevo as s } from "@levo-so/react";
8
8
  import { useEffect as c, useRef as l, useState as u } from "react";
9
9
  import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -2768,11 +2768,12 @@ var Ei = "_1vist8m0", Di = (e) => {
2768
2768
  }), e[0] = t) : t = e[0], t;
2769
2769
  }, zi = ({ onDismiss: e }) => {
2770
2770
  let { successConfig: t, schema: n } = ei(), r = n?.settings?.success_message, [i, a] = V(Fi), o = (e) => !e || e.replace(/<[^>]*>/g, "").trim() === "", c = t?.title || r?.title || Ii, l = t?.message || r?.message, u = o(l) ? Li : l, d = t?.action || r?.action, f = d?.type ?? "none", p = f === "redirect" ? d?.value : void 0, m = (() => {
2771
- if (p) {
2772
- if (p.startsWith("/")) return p;
2771
+ let e = p?.trim();
2772
+ if (e && !e.startsWith("//")) {
2773
+ if (e.startsWith("/")) return e;
2773
2774
  try {
2774
- let e = new URL(p);
2775
- if (e.protocol === "http:" || e.protocol === "https:") return p;
2775
+ let t = new URL(e);
2776
+ if (t.protocol === "http:" || t.protocol === "https:") return e;
2776
2777
  } catch {}
2777
2778
  }
2778
2779
  })();
package/index.d.ts CHANGED
@@ -49,28 +49,6 @@ collapsible?: boolean;
49
49
 
50
50
  export declare const AccordionTrigger: WithBlockPropsComponent<BaseAccordionTriggerProps>;
51
51
 
52
- /**
53
- * Optional attendee fields. Each is hidden unless its `key` is listed in the
54
- * `additionalFields` prop, so every event can collect exactly what it needs.
55
- * Rendered in this order regardless of the order keys are passed in.
56
- */
57
- declare const ADDITIONAL_FIELDS: readonly [{
58
- readonly key: "designation";
59
- readonly label: "Designation";
60
- readonly placeholder: "Product Manager";
61
- readonly type: "text";
62
- }, {
63
- readonly key: "mobile";
64
- readonly label: "Phone Number";
65
- readonly placeholder: "+91 98765 43210";
66
- readonly type: "tel";
67
- }, {
68
- readonly key: "organization";
69
- readonly label: "Company Name";
70
- readonly placeholder: "Acme Corporation";
71
- readonly type: "text";
72
- }];
73
-
74
52
  /**
75
53
  * Alternate method values for quick checking
76
54
  */
@@ -330,6 +308,13 @@ declare type BlockProviderInput = {
330
308
  workspace_id: string;
331
309
  pageSource: IPage["source"];
332
310
  languageVariants?: IPage["language_variants"];
311
+ /**
312
+ * The page's resolved locale (e.g. "fr-FR"). Client-side re-fetches
313
+ * (pagination, search, filter changes) forward it as `?_language=` so a
314
+ * localized page keeps rendering its own locale after the first interaction.
315
+ * Without it, page 2 of a French grid comes back in the default locale.
316
+ */
317
+ language?: string;
333
318
  };
334
319
 
335
320
  export declare const BlockSourceModuleList: readonly ["collection", "event", "blog", "community", "context", "form", "blog_author", "blog_category", "blog_tag"];
@@ -1004,7 +989,7 @@ declare type HTMLImageProps_2 = Omit<React.DetailedHTMLProps<React.ImgHTMLAttrib
1004
989
  declare type HTMLVideoProps = Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "src" | keyof BaseElementProps>;
1005
990
 
1006
991
  /** Keys accepted by the `additionalFields` prop. */
1007
- declare type IAdditionalFieldKey = (typeof ADDITIONAL_FIELDS)[number]["key"];
992
+ declare type IAdditionalFieldKey = "designation" | "mobile" | "organization";
1008
993
 
1009
994
  declare interface IAuthActions {
1010
995
  setAuthState: (updates: Partial<IAuthState>) => void;
@@ -1597,7 +1582,7 @@ declare interface ILevoFormContext {
1597
1582
  preview?: boolean;
1598
1583
  }
1599
1584
 
1600
- export declare type ILevoPageData = Pick<IPageExpanded, "id" | "workspace_id" | "blocks" | "source" | "title" | "description" | "access" | "style_config" | "settings" | "language_variants">;
1585
+ export declare type ILevoPageData = Pick<IPageExpanded, "id" | "workspace_id" | "blocks" | "source" | "title" | "description" | "access" | "style_config" | "settings" | "language_variants" | "language">;
1601
1586
 
1602
1587
  export declare interface ILevoPageProps {
1603
1588
  pageData: ILevoPageData;
@@ -2456,7 +2441,7 @@ export declare const LanguageSwitcher: WithBlockPropsComponent<BaseLanguageSwitc
2456
2441
  */
2457
2442
  export declare const LazyMotionProvider: React.FC<ILazyMotionProviderProps>;
2458
2443
 
2459
- export declare const LevoBlock: default_2.MemoExoticComponent<({ html_id, renderMode, blocks, parsedBlockData, blockData, pageContext, pageMeta, blockContext, workspace_id, pageSource, languageVariants, }: LevoBlockProps) => JSX.Element>;
2444
+ export declare const LevoBlock: default_2.MemoExoticComponent<({ html_id, renderMode, blocks, parsedBlockData, blockData, pageContext, pageMeta, blockContext, workspace_id, pageSource, languageVariants, language, }: LevoBlockProps) => JSX.Element>;
2460
2445
 
2461
2446
  declare interface LevoBlockProps {
2462
2447
  html_id?: string;
@@ -2470,6 +2455,8 @@ declare interface LevoBlockProps {
2470
2455
  blockContext?: IPageDataContext["blocks"][number];
2471
2456
  pageSource?: IPage["source"];
2472
2457
  languageVariants?: IPage["language_variants"];
2458
+ /** Page's resolved locale — forwarded so client-side re-fetches stay in it. */
2459
+ language?: string;
2473
2460
  }
2474
2461
 
2475
2462
  export declare const LevoPage: default_2.FC<ILevoPageProps>;
@@ -2840,13 +2827,18 @@ export declare const processTheme: ({ pageTheme, blocks, pageID, device, }: {
2840
2827
  html: string;
2841
2828
  };
2842
2829
 
2843
- export declare const RegisterModal: ({ eventID, title, external, buttonText, additionalFields, }: {
2830
+ export declare const RegisterModal: ({ eventID, title, external, buttonText, additionalFields, startsAt, endsAt, eventUrl, }: {
2844
2831
  eventID: string;
2845
2832
  title?: string;
2846
2833
  external?: string;
2847
2834
  buttonText?: string;
2848
2835
  /** Optional attendee fields to collect ("designation" | "mobile" | "organization"). Hidden unless listed. */
2849
2836
  additionalFields?: IAdditionalFieldKey[];
2837
+ /** Event start/end, rendered in the viewer's own timezone and used for the calendar entry. */
2838
+ startsAt?: string | Date | null;
2839
+ endsAt?: string | Date | null;
2840
+ /** Joining link, attached to the calendar entry so it is one tap away at start time. */
2841
+ eventUrl?: string | null;
2850
2842
  }) => JSX.Element;
2851
2843
 
2852
2844
  /**