@levo-so/studio 0.1.109 → 0.1.110

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 (47) hide show
  1. package/{BillingStep-DZeqbtfs.js → BillingStep-CY2MHQ-L.js} +1 -1
  2. package/{Button-BMUB23Y7.js → Button-DjphTnCg.js} +160 -148
  3. package/CollectionField-DrJuHNsg.js +318 -0
  4. package/{DateTimeWidget-DWbn_kXp.js → DateTimeWidget-BVHZh4EV.js} +13 -14
  5. package/{EntryCard-BNZ-0_Kv.js → EntryCard-BYONyIm5.js} +3 -3
  6. package/{LoginCard-B1XlZfEU.js → LoginCard-CrtSHdaR.js} +3 -3
  7. package/{LoginForm-NmDPe72V.js → LoginForm-DeYsk4kd.js} +2 -2
  8. package/{LoginModal-CVd08mNx.js → LoginModal-BbDfB4S9.js} +3 -3
  9. package/{MessageCard-C2fU_Bo_.js → MessageCard-x6jPClGi.js} +2 -2
  10. package/{MessageFooter-4qIEK91O.js → MessageFooter-CHuPnL_D.js} +1 -1
  11. package/{ModalManager-Dqq7D60M.js → ModalManager-DQVNPEuG.js} +1 -1
  12. package/{PendingApprovalCard-CXOEpAbg.js → PendingApprovalCard-CsnyrSsa.js} +3 -3
  13. package/{PhoneWidget-CtNIit2w.js → PhoneWidget-BaDSMSW5.js} +5 -6
  14. package/{PopupRenderer-SSn97BLs-DQfvcymq.js → PopupRenderer-Dd9zoNIY-Cx663DmW.js} +258 -223
  15. package/{ProfileCard-CzL5uB2z.js → ProfileCard-Dg5TY1Mw.js} +3 -3
  16. package/{RichTextWidget-DkRrKQqN.js → RichTextWidget-yaDCZwIo.js} +10 -11
  17. package/{RteThemeProvider-Cfepkyer.js → RteThemeProvider-LFGzAYi1.js} +2 -2
  18. package/{Toolbar-C3WDkSnO.js → Toolbar-D3PnF7Ud.js} +3 -3
  19. package/{VerifyButton-TNkt-SDu.js → VerifyButton-6BIXAEGp.js} +1 -1
  20. package/{bookingCard-61Yx6JO-.js → bookingCard-D40dbgvH.js} +3 -3
  21. package/collection.js +6 -8
  22. package/dist-bHoi1bCB.js +3795 -0
  23. package/index.d.ts +77 -2
  24. package/index.js +2391 -2197
  25. package/{inlineCollectionTheme-WpCvMKrW.js → inlineCollectionTheme-D2w17LHX.js} +1 -1
  26. package/{inlineRteTheme-Ajq9PNpQ.js → inlineRteTheme-abXxag3B.js} +1 -1
  27. package/package.json +2 -2
  28. package/studio.css +1 -1
  29. package/{utils-BJLmuC5w.js → utils-C_tr8kXV.js} +1 -1
  30. package/CollectionField-xa-jed3_.js +0 -232
  31. package/dist-Cfv-YjpI.js +0 -3469
  32. package/getFieldValidations-CSkSV2hW.js +0 -90
  33. package/widgets-K6ECnoJJ.js +0 -335
  34. /package/{Beams-WJN38XSv.js → Beams-DboMUgCv.js} +0 -0
  35. /package/{CollectionInput-CpNGIXJx.js → CollectionInput-CG-Pu_51.js} +0 -0
  36. /package/{Dots-DggLz5I7.js → Dots-a8xSboDv.js} +0 -0
  37. /package/{Gradient-BSWJAu0a.js → Gradient-NacpoDCM.js} +0 -0
  38. /package/{Grid-BFKl0MUt.js → Grid-BJQvxnks.js} +0 -0
  39. /package/{Popover-O1poOHk2.js → Popover-DnZY1k6o.js} +0 -0
  40. /package/{StripePaymentModal-Do1xHctU.js → StripePaymentModal-BsYNQ4MB.js} +0 -0
  41. /package/{Tooltip-NEMQqPyr.js → Tooltip-DreKXbTO.js} +0 -0
  42. /package/{Waves-BPEgTYoO.js → Waves-DUuT_IFr.js} +0 -0
  43. /package/{authentication-hnV1BI8s.js → authentication-TdyaDNTn.js} +0 -0
  44. /package/{card-5ooLmYSr.js → card-D5fPArfa.js} +0 -0
  45. /package/{dialog-DoxC50i0.js → dialog-LRLdr3kq.js} +0 -0
  46. /package/{theme.cssm-BXDp-ojp.js → theme.cssm-2YTdd8Yh.js} +0 -0
  47. /package/{useLogin-D4A5iRey.js → useLogin-B2HHZxTi.js} +0 -0
package/index.d.ts CHANGED
@@ -217,6 +217,28 @@ declare interface BaseIframeProps extends BaseElementProps, Omit<default_2.HTMLA
217
217
 
218
218
  declare type BaseImageProps = ImageProps & HTMLImageProps;
219
219
 
220
+ /**
221
+ * Published-site language switcher, modeled as a studio element (like `UserMenu`).
222
+ *
223
+ * Reads the page's sibling language variants from context (via `useLocalizedPages`)
224
+ * — no data wiring needed — and navigates to the selected language's localized URL
225
+ * on a full reload. Dynamic-page placeholder slugs are resolved from the current
226
+ * path before navigating.
227
+ *
228
+ * Renders nothing when the page has at most one language. Hide it deliberately by
229
+ * setting `config.enabled = false` on its element — `withBlockProps` gates on that.
230
+ */
231
+ export declare const BaseLanguageSwitcher: React_2.FC<BaseLanguageSwitcherProps>;
232
+
233
+ export declare interface BaseLanguageSwitcherProps extends Omit<BaseElementProps, "content"> {
234
+ /** Class applied to the wrapper. */
235
+ className?: string;
236
+ /** Class applied to the dropdown menu content. */
237
+ contentClassName?: string;
238
+ /** Menu alignment relative to the trigger. Defaults to "end". */
239
+ align?: "start" | "center" | "end";
240
+ }
241
+
220
242
  declare interface BaseLinkProps extends BaseElementProps, Omit<React.HTMLAttributes<HTMLAnchorElement>, "content"> {
221
243
  }
222
244
 
@@ -284,6 +306,8 @@ declare type BlockProviderInput = {
284
306
  renderMode: IRenderMode;
285
307
  workspace_id: string;
286
308
  pageSource: IPage["source"];
309
+ localizedPages?: IPage["localized_pages"];
310
+ language?: IPage["language"];
287
311
  };
288
312
 
289
313
  export declare const BlockSourceModuleList: readonly ["collection", "event", "blog", "community", "context", "form", "blog_author", "blog_category", "blog_tag"];
@@ -361,6 +385,26 @@ export declare const BookingSummary: default_2.FC<IBookingSummaryProps>;
361
385
 
362
386
  export declare const Box: WithBlockPropsComponent<BaseBoxProps & default_2.RefAttributes<HTMLDivElement>>;
363
387
 
388
+ /**
389
+ * Builds the navigation target for switching to a sibling language.
390
+ *
391
+ * Static pages: the sibling's `live_url` is already concrete — return it as-is.
392
+ *
393
+ * Dynamic pages: `live_url` carries `{placeholder}` slugs (e.g.
394
+ * `https://x.com/fr-FR/industry/{industries}`). The current entry's `live_url`
395
+ * is the same template for the page being served, so aligning it segment-by-segment
396
+ * against the actual `currentPathname` recovers each slug's real value, which is
397
+ * then substituted into the target template.
398
+ *
399
+ * Falls back to the raw target `live_url` whenever alignment is not possible
400
+ * (no current template, unparseable URL, or mismatched segment counts).
401
+ */
402
+ export declare const buildLocalizedHref: ({ current, target, currentPathname, }: {
403
+ current?: ILocalizedPage;
404
+ target: ILocalizedPage;
405
+ currentPathname: string;
406
+ }) => string;
407
+
364
408
  /**
365
409
  * Built-in background effect presets organized by category
366
410
  */
@@ -1498,7 +1542,7 @@ declare interface ILevoFormContext {
1498
1542
  preview?: boolean;
1499
1543
  }
1500
1544
 
1501
- export declare type ILevoPageData = Pick<IPageExpanded, "id" | "workspace_id" | "blocks" | "source" | "title" | "description" | "access" | "style_config" | "settings">;
1545
+ export declare type ILevoPageData = Pick<IPageExpanded, "id" | "workspace_id" | "blocks" | "source" | "title" | "description" | "access" | "style_config" | "settings" | "language" | "localized_pages">;
1502
1546
 
1503
1547
  export declare interface ILevoPageProps {
1504
1548
  pageData: ILevoPageData;
@@ -1512,9 +1556,31 @@ export declare interface ILevoPageProps {
1512
1556
  disableBranding?: boolean;
1513
1557
  }
1514
1558
 
1559
+ /**
1560
+ * A sibling language variant of a page.
1561
+ *
1562
+ * Two backends populate this shape:
1563
+ * - The studio runtime (`get-page-from-path`) sets `language_label`, `live_url`,
1564
+ * and `is_current` — used by the published-site language switcher.
1565
+ * - The dashboard editor's page-data response sets `title`, `status`, `countries`,
1566
+ * `url` — used by the locale/country pickers.
1567
+ *
1568
+ * Only `id` and `language` are guaranteed on both; the rest are source-specific.
1569
+ */
1515
1570
  export declare interface ILocalizedPage {
1516
1571
  id: string;
1517
1572
  language: string;
1573
+ /** Human-readable language label, e.g. "French (France)". Runtime response only. */
1574
+ language_label?: string;
1575
+ /**
1576
+ * Fully-localized URL for this sibling. Default language is unprefixed, others
1577
+ * are language-prefixed. Dynamic pages keep `{placeholder}` slugs to substitute
1578
+ * client-side. Runtime response only.
1579
+ */
1580
+ live_url?: string;
1581
+ /** True for the page currently being served; always the first entry. Runtime response only. */
1582
+ is_current?: boolean;
1583
+ /** Editor response only — guaranteed there; absent on runtime entries (not read by the runtime). */
1518
1584
  title: string;
1519
1585
  status?: "published" | "draft";
1520
1586
  countries?: string[];
@@ -2324,6 +2390,8 @@ export declare function KbdGroup({ className, ...props }: React.ComponentProps<"
2324
2390
 
2325
2391
  export declare const KindList: readonly ["element", "group"];
2326
2392
 
2393
+ export declare const LanguageSwitcher: WithBlockPropsComponent<BaseLanguageSwitcherProps>;
2394
+
2327
2395
  /**
2328
2396
  * Provides LazyMotion context with domAnimation features for reduced bundle size.
2329
2397
  *
@@ -2332,7 +2400,7 @@ export declare const KindList: readonly ["element", "group"];
2332
2400
  */
2333
2401
  export declare const LazyMotionProvider: React.FC<ILazyMotionProviderProps>;
2334
2402
 
2335
- export declare const LevoBlock: default_2.MemoExoticComponent<({ html_id, renderMode, blocks, parsedBlockData, blockData, pageContext, pageMeta, blockContext, workspace_id, pageSource, }: LevoBlockProps) => JSX.Element>;
2403
+ export declare const LevoBlock: default_2.MemoExoticComponent<({ html_id, renderMode, blocks, parsedBlockData, blockData, pageContext, pageMeta, blockContext, workspace_id, pageSource, localizedPages, language, }: LevoBlockProps) => JSX.Element>;
2336
2404
 
2337
2405
  declare interface LevoBlockProps {
2338
2406
  html_id?: string;
@@ -2345,6 +2413,8 @@ declare interface LevoBlockProps {
2345
2413
  pageMeta?: TPageMeta;
2346
2414
  blockContext?: IPageDataContext["blocks"][number];
2347
2415
  pageSource?: IPage["source"];
2416
+ localizedPages?: IPage["localized_pages"];
2417
+ language?: IPage["language"];
2348
2418
  }
2349
2419
 
2350
2420
  export declare const LevoPage: default_2.FC<ILevoPageProps>;
@@ -3050,6 +3120,11 @@ export declare const useForumContext: () => IForumContext;
3050
3120
  */
3051
3121
  export declare const useGeneratedClassName: (elementKey: string, blockId: string, configValue: IFieldConfig | undefined) => string;
3052
3122
 
3123
+ export declare const useLocalizedPages: () => {
3124
+ localizedPages: ILocalizedPage[];
3125
+ currentLanguage: string | undefined;
3126
+ };
3127
+
3053
3128
  /**
3054
3129
  * Pure API operations hook for authentication
3055
3130
  * All form state management moved to components with Formik