import { z } from 'zod'; import { type EmbedSizing } from '../content/embeds.js'; import type { FieldRow, FieldType } from '../db/schema.js'; /** * Field types a repeater row may contain. * * Everything that describes *a value*, and nothing that composes a page. `block` is excluded * because blocks are how a page is assembled and a repeater is how one field holds several of * something — nesting the first inside the second confuses two different jobs. `repeater` is * excluded because a table of tables is a data model, not a field, and the person reaching for it * wants a content type with a relation. * * Stated as an allowlist so a field type added later is excluded until somebody decides otherwise, * rather than silently becoming nestable. */ export declare const REPEATER_SUB_FIELD_TYPES: readonly ["text", "richtext", "number", "boolean", "date", "select", "media", "taxonomy", "relation", "link", "embed", "snippet"]; export type RepeaterSubFieldType = (typeof REPEATER_SUB_FIELD_TYPES)[number]; /** * One sub-field definition. * * Shaped like the parts of `FieldRow` that describe a field rather than locate it — no id, no * position, no content type. `repeaterRowFields` turns these into rows on demand so the same * `FieldControl` and the same validation serve them as serve a top-level field. */ export declare const repeaterSubField: z.ZodObject<{ api_id: z.ZodString; label: z.ZodString; type: z.ZodEnum<{ number: "number"; boolean: "boolean"; text: "text"; richtext: "richtext"; date: "date"; select: "select"; media: "media"; taxonomy: "taxonomy"; relation: "relation"; link: "link"; snippet: "snippet"; embed: "embed"; }>; required: z.ZodDefault; help_text: z.ZodOptional>; config: z.ZodDefault>; visible_when: z.ZodOptional; value: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strip>; export type RepeaterSubField = z.infer; /** * What one link points at. * * Three kinds rather than one `href`, because the three are stored differently and only one of them * is a URL. An item or a file is a **reference** — an id, resolved through the delivery response's * `references` and `media` maps exactly as `relation` and `media` fields are — so a page that moves * keeps every link aimed at it and nobody edits content to fix a URL. That is the same rule menu * items follow, and the reason rich text stores `taproot:item:{id}` instead of a path. * * Storing the `taproot:` marker here instead was the near miss. It would have made the editor * control almost free, since `LinkDialog` already speaks that vocabulary — but it puts a string a * consumer has to parse where an id and a lookup belong, and every consumer that forgot would ship * `taproot:item:…` to a visitor. Rich text accepts that trade because `set:html` cannot perform a * lookup; a structured field has no such excuse. */ /** * What the *editor* chooses on one placement of a query field. * * The counterpart to `fieldConfigSchemas.query`: config says what may be asked, this is what was * asked. Every key has a default, so a block placed and never touched still resolves — the * alternative is a freshly added "Events" block rendering an error until somebody opens it. * * `termIds` is a list rather than one id for the reason `ItemFilters.termIds` is: an item carrying * any of them matches, and a term filter always means the whole branch, which `resolveItemQueries` * expands through `termIdsForBranch`. An **empty list means no term filter**, which is the opposite * of `ItemFilters`' own convention — deliberately, and the reason is which mistake is recoverable. * There, an empty array arrives from a caller that asked for a term with no members and matching * everything would silently widen a filter. Here it arrives from an editor who has not picked a * term yet, and matching nothing would make a newly placed block render as broken. */ declare const queryValueSchema: z.ZodObject<{ termIds: z.ZodDefault>; sort: z.ZodDefault>; limit: z.ZodDefault; dateFilter: z.ZodDefault>; }, z.core.$strict>; export type QueryValue = z.infer; export declare const LINK_KINDS: readonly ["item", "media", "url"]; export type LinkKind = (typeof LINK_KINDS)[number]; export declare function linkValueSchema(allowedKinds?: LinkKind[]): z.ZodType; /** * One embed's stored value: an address and the frame's accessible name. Never markup. * * `title` is not decoration. An `