export interface ContentModelField { display_name: string; uid: string; data_type: string; mandatory?: boolean; multiple?: boolean; display_type?: string; enum?: { advanced?: boolean; choices: Array<{ value: string; key?: string; [k: string]: unknown }>; }; schema?: ContentModelField[]; field_metadata?: Record; [key: string]: unknown; } export interface ContentModel { title: string; uid: string; schema: ContentModelField[]; inbuilt_class?: boolean; [key: string]: unknown; } export interface ComponentMetadata { tags?: boolean; id: string; name: string; category: string; description: string; component: string; contentModel: ContentModel; } export interface StackablesTheme { primary?: string; primaryHover?: string; primaryForeground?: string; containerWidth?: string; fontFamily?: string; fontSizeBtn?: string; fontWeightBtn?: string; fontWeightOutline?: string; btnPaddingY?: string; btnPaddingX?: string; btnBorderRadius?: string; btnFocusRing?: string; linkBtnLineHeight?: string; linkBtnArrowSize?: string; linkBtnArrowSpacing?: string; /** Project typography (see `stackable-components/contract` typography). Applied by ThemeProvider. */ typography?: import('./theme/typography').TypographySettings; } /** * A single field's Contentstack Live Preview / Visual Builder edit tag, as produced by * `addEditableTags()` from `@contentstack/utils`. Spread onto the element that renders the * field's value, e.g. `

{heading}

`. Undefined `$` (no live entry data, * e.g. this prototype's mock/demo mode) spreads to nothing and changes no behavior. */ export type CslpTag = { 'data-cslp'?: string }; /** * The `$` that `addEditableTags()` attaches to ONE object — an entry, a group, a * repeated-group item, a modular-block item, a link field, a referenced entry. It holds * a tag per DIRECT field of that object only: * * - `$.heading` — a field of this object (primitive, file, object or list alike); * - `$.faqs__0`, `$.faqs__1` — the items of the list field `faqs`, by index; * - nothing deeper. A nested object carries its own `$`: `cta_button.$.text`, * `faqs[i].$.question`, `columns[c].links[l].$.label`. * * So a component reads `$?.heading` for its own fields, `item.$?.question` inside a * list (or `faqs?.[i]?.$?.question`), `group?.$?.field` for a group, and * `$?.[`features__${i}`]` for an item of a list of plain values. Never * `$?.faqs?.[i]?.question` or `$?.cta_button?.text`: those paths do not exist and * silently render no tag. * * A repeatable field also needs its LIST tags, so the Visual Builder can add, * move and delete items: `{...$?.faqs}` on the element that contains the items * and `{...$?.[`faqs__${i}`]}` on each item's root element (original index). The * runtime renderer does this for page-level lists (modular blocks, repeatable * groups / components / references) with its `sk-list` / `sk-list-item` wrappers; * a component does it on its own list markup. */ export type EditTags = { [field: string]: CslpTag | undefined }; /** Contentstack color extension value: `{ hex: "#RRGGBB" }` or a plain CSS string. */ export type StackableColorValue = | string | { hex?: unknown; color?: unknown; value?: unknown; background?: unknown; backgroundColor?: unknown } | null | undefined; /** * A link as a component receives it. Contentstack's native Link field arrives * as `{ title, href }` from the Delivery API; the Stackables app's controls and the * catalog defaults write `{ title, url }`; and fields that were plain text URLs * before they became Link fields still hold a bare string in older entries. * Read it with `linkHref` / `linkTitle` from `../utils`, never directly. */ export type StackableLinkValue = | string | { title?: string | null; href?: string | null; url?: string | null; $?: EditTags } | null | undefined;