@veroxm/react-sdk 1.9.0 → 1.11.0

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,4 +1,33 @@
1
1
  import { type ReactNode } from 'react';
2
+ import { type EditorTranslator, type LabelMap } from './i18n.js';
3
+ interface FieldDef {
4
+ type: 'text' | 'richText' | 'media' | 'link' | 'number' | 'boolean' | 'select' | 'menu' | 'video' | 'slides' | 'map' | 'chart' | 'component' | 'list';
5
+ label?: string;
6
+ /** The site's label in each language, when it gave more than one. */
7
+ labels?: LabelMap;
8
+ required?: boolean;
9
+ max?: number;
10
+ options?: string[];
11
+ /** select: a display label per stored value, per language. */
12
+ optionLabels?: Record<string, LabelMap>;
13
+ /** list: the item field a collapsed item shows. */
14
+ titleField?: string;
15
+ /** menu: levels of sub-menus allowed (1 to 3). */
16
+ depth?: number;
17
+ /** component: the components the developer registered for this place, by name. */
18
+ components?: Record<string, {
19
+ label?: string;
20
+ labels?: LabelMap;
21
+ version: number;
22
+ fields: Record<string, FieldDef>;
23
+ }>;
24
+ /** list: each item's fields. */
25
+ fields?: Record<string, FieldDef>;
26
+ /** list: items may have a first and a last day they show on. */
27
+ schedule?: boolean;
28
+ /** menu: the icons an item may have. */
29
+ icons?: string[];
30
+ }
2
31
  /**
3
32
  * How the overlay reaches VeroXM. By default through this site's own
4
33
  * /api/veroxm route (which holds the editor token in an httpOnly cookie);
@@ -34,3 +63,9 @@ export declare function VeroxmEditorOverlay({ onChange, tools }: EditorOverlayPr
34
63
  * False when no editor overlay is on the page.
35
64
  */
36
65
  export declare function openEditorSlot(name: string, locale?: string): boolean;
66
+ /**
67
+ * A short name for a collapsed list item: the list's titleField, else its first required text field, else its first
68
+ * text field (a link's text counts), else "Item 3".
69
+ */
70
+ export declare function itemTitle(fields: Record<string, FieldDef>, item: Record<string, unknown>, i: number, titleField?: string, ui?: EditorTranslator): string;
71
+ export {};