import type { OptionItem } from '#blokkli/editor/helpers/options'; import type { BlokkliApp } from '#blokkli/editor/types/app'; import type { BlockOptionsMap } from './schemas.js'; import type { FieldValueType } from '#blokkli/editor/providers/fieldValue'; /** * Extract a simple key→label map from the various radios/checkboxes option formats. * Handles plain strings, icon objects, color objects, grid objects, etc. */ export declare function extractOptionLabels(option: Record): Record | undefined; /** * Build a block options map from available options and mutated state. */ export declare function buildBlockOptionsMap(availableOptions: OptionItem[], mutatedOptions: Record>, uuid: string): BlockOptionsMap; /** * Build a block options map from option definitions, using defaults as current values. */ export declare function buildBlockOptionsMapFromDefinitions(options: Record>): BlockOptionsMap; /** * Validate a single option value against its definition. * Returns an error string or undefined if valid. */ export declare function validateOptionValue(key: string, value: string | boolean | number | string[], optionDef: OptionItem): string | undefined; /** * Get all child fields and their paragraphs for a given entity UUID. * Walks mutatedFields to find fields belonging to the entity. */ export declare function getParagraphChildren(app: BlokkliApp, uuid: string): { fieldName: string; paragraphs: { uuid: string; bundle: string; }[]; }[]; /** * Apply completed search/replace operations to an original value. * For each operation, tries exact match first, then whitespace-normalized. * When `selector` is true, uses CSS selector matching on parsed HTML. */ export declare function applyOperations(originalValue: string, operations: Array<{ search: string; replace: string; selector?: boolean; }>): string; /** * Apply a CSS-selector-based replacement on an HTML string. * Parses the HTML, finds the element matching `selector`, replaces its innerHTML, * and serializes back. */ export declare function applySelectorOperation(html: string, selector: string, replacement: string): string; /** * Resolve a `position` string to the `afterUuid` value expected by adapter methods. * * Returns `{ afterUuid: string | null }` on success, or `{ error: string }` if * the referenced UUID is not found in the target field. */ export declare function resolvePosition(app: BlokkliApp, parentUuid: string, fieldName: string, position?: string): { afterUuid: string | null; } | { error: string; }; /** * The host entity of a UUID: the page entity itself when `uuid` is the root * entity (`isRoot: true`), otherwise the block with that UUID. Returns null * when the UUID is neither. The shape carries `entityType` + `bundle` (callers * needing an `EntityContext` map `type ← entityType`). */ export declare function resolveHost(app: BlokkliApp, uuid: string): { entityType: string; bundle: string; uuid: string; isRoot: boolean; } | null; /** * Resolve the available options for a block definition. Wraps * `getBlockDefinition` + `getAvailableOptions` and localizes the global-options * cast to this one place. Returns null when the definition is unknown. */ export declare function getResolvedOptions(app: BlokkliApp, bundleOrBlock: Parameters[0], fieldListType: Parameters[1], parentBundle: Parameters[2]): OptionItem[] | null; /** * Read every editable content field of a block (or entity), skipping `table` * fields (no text payload). Iterates the declared `editableFieldConfig` rather * than the runtime `v-blokkli-editable` directive registry — the former is the * canonical declaration (it sees fields exposed via `propsFieldMapping` even * when no directive is present in the template), while the latter only sees * fields whose template marks them with the directive. `fieldValue.readValue` * already knows how to resolve a value through `propsFieldMapping`, so this * one swap surfaces all editable fields to every caller. */ export declare function readBlockContentFields(app: BlokkliApp, uuid: string, entityType: string, bundle: string): Array<{ fieldName: string; fieldType: FieldValueType; value: string; }>;