@levo-so/studio 0.3.1 → 0.3.2

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-H07AsyeH.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-D3OVeo3H.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
@@ -330,6 +330,13 @@ declare type BlockProviderInput = {
330
330
  workspace_id: string;
331
331
  pageSource: IPage["source"];
332
332
  languageVariants?: IPage["language_variants"];
333
+ /**
334
+ * The page's resolved locale (e.g. "fr-FR"). Client-side re-fetches
335
+ * (pagination, search, filter changes) forward it as `?_language=` so a
336
+ * localized page keeps rendering its own locale after the first interaction.
337
+ * Without it, page 2 of a French grid comes back in the default locale.
338
+ */
339
+ language?: string;
333
340
  };
334
341
 
335
342
  export declare const BlockSourceModuleList: readonly ["collection", "event", "blog", "community", "context", "form", "blog_author", "blog_category", "blog_tag"];
@@ -1597,7 +1604,7 @@ declare interface ILevoFormContext {
1597
1604
  preview?: boolean;
1598
1605
  }
1599
1606
 
1600
- export declare type ILevoPageData = Pick<IPageExpanded, "id" | "workspace_id" | "blocks" | "source" | "title" | "description" | "access" | "style_config" | "settings" | "language_variants">;
1607
+ export declare type ILevoPageData = Pick<IPageExpanded, "id" | "workspace_id" | "blocks" | "source" | "title" | "description" | "access" | "style_config" | "settings" | "language_variants" | "language">;
1601
1608
 
1602
1609
  export declare interface ILevoPageProps {
1603
1610
  pageData: ILevoPageData;
@@ -2456,7 +2463,7 @@ export declare const LanguageSwitcher: WithBlockPropsComponent<BaseLanguageSwitc
2456
2463
  */
2457
2464
  export declare const LazyMotionProvider: React.FC<ILazyMotionProviderProps>;
2458
2465
 
2459
- export declare const LevoBlock: default_2.MemoExoticComponent<({ html_id, renderMode, blocks, parsedBlockData, blockData, pageContext, pageMeta, blockContext, workspace_id, pageSource, languageVariants, }: LevoBlockProps) => JSX.Element>;
2466
+ 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
2467
 
2461
2468
  declare interface LevoBlockProps {
2462
2469
  html_id?: string;
@@ -2470,6 +2477,8 @@ declare interface LevoBlockProps {
2470
2477
  blockContext?: IPageDataContext["blocks"][number];
2471
2478
  pageSource?: IPage["source"];
2472
2479
  languageVariants?: IPage["language_variants"];
2480
+ /** Page's resolved locale — forwarded so client-side re-fetches stay in it. */
2481
+ language?: string;
2473
2482
  }
2474
2483
 
2475
2484
  export declare const LevoPage: default_2.FC<ILevoPageProps>;