@bettercms-ai/types 1.52.0 → 1.55.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.
package/dist/index.d.ts CHANGED
@@ -4007,8 +4007,14 @@ declare function planSections<B>(slots: readonly string[], blocks: readonly B[]
4007
4007
  * side and stored on the other (kit-facet-table.v3.md, "Carriers" and "Corpus floor").
4008
4008
  */
4009
4009
 
4010
- /** Tabs on one screen: a model's `fieldsets kind:"tab"` and a component's prop tabs alike. */
4010
+ /** Tabs on one screen, the V2 target: a model's `fieldsets kind:"tab"` and a component's prop tabs alike. */
4011
4011
  declare const TAB_MAX = 8;
4012
+ /**
4013
+ * The model tab bound prod accepts TODAY (src/lib/content/dock-vocabulary.ts TAB_MAX): the
4014
+ * dashboard renders 3 tabs on a model screen. It rises to TAB_MAX when the dashboard renders 8
4015
+ * (facet table row 7, F12). Component prop tabs are at TAB_MAX already.
4016
+ */
4017
+ declare const TAB_MAX_RENDERABLE_NOW = 3;
4012
4018
  /** `ui.control:"segmented"`: the option count it stores. V2's 3 is a render-fit rule, not this. */
4013
4019
  declare const SEGMENTED_MIN = 2;
4014
4020
  declare const SEGMENTED_MAX = 8;
@@ -4101,7 +4107,7 @@ type DefSources = Partial<Record<SourcedFacet, SchemaSource>>;
4101
4107
  */
4102
4108
  declare const mayOverwrite: (stored: SchemaSource | undefined, incoming: SchemaSource) => boolean;
4103
4109
  declare const UI_REFUSAL_CODES: {
4104
- readonly schema: readonly ["facet_unclassified", "excluded_facet", "depth_exceeded", "validation_failed", "hash_mismatch", "shape_kind_mismatch", "block_field_unrenderable"];
4110
+ readonly schema: readonly ["facet_unclassified", "excluded_facet", "depth_exceeded", "validation_failed", "hash_mismatch", "non_finite_number", "shape_kind_mismatch", "block_field_unrenderable", "block_not_accepted", "derived_field", "feature_unknown"];
4105
4111
  readonly build: readonly ["peer_missing", "kit_major_unsupported", "compile_error", "nondeterministic", "size_exceeded"];
4106
4112
  readonly protocol: readonly ["unsupported", "handshake_timeout", "origin_mismatch", "write_denied"];
4107
4113
  readonly runtime: readonly ["crashed", "blank", "csp_violation"];
@@ -4120,6 +4126,139 @@ type UiRefusal = {
4120
4126
  /** `schema.depth_exceeded` */
4121
4127
  declare const uiRefusalId: (r: UiRefusal) => string;
4122
4128
  declare const isUiRefusal: (v: unknown) => v is UiRefusal;
4129
+ /** KEY_RESERVED, the API contract: `derived` (the Layout id prefix), `layout` and `page` (address prefixes). */
4130
+ declare const KEY_RESERVED: ReadonlySet<string>;
4131
+ /** The derive lane's minted-key bound: KEY_RESERVED and `id` (key-rules.ts RESERVED_KEYS). */
4132
+ declare const DERIVE_MINTED_RESERVED: ReadonlySet<string>;
4133
+ /** Keys that reach an object's prototype (safe-keys.ts FORBIDDEN_KEYS): also refused as KEY_RESERVED. */
4134
+ declare const KEY_FORBIDDEN: ReadonlySet<string>;
4135
+ /** A key with this lead is the platform's too (`_type`, `_key`, `_variant`): KEY_RESERVED. */
4136
+ declare const KEY_RESERVED_PREFIX = "_";
4137
+ /** KEY_FORMAT: a stored field key is a letter, then letters, digits, `-` and `_` (key-rules.ts API_KEY). */
4138
+ declare const KEY_FORMAT: RegExp;
4139
+ /** Whether the API refuses a key as KEY_RESERVED (content.ts keyRuleProblem). */
4140
+ declare const isReservedKey: (key: string) => boolean;
4141
+ /** Whether the derive lane may not mint a key (key-rules.ts isReservedKey): the API's words and `id`. */
4142
+ declare const isDeriveReservedKey: (key: string) => boolean;
4143
+ /**
4144
+ * A primitive `array` (`config.itemType`): the item types it may list, the only config keys it may
4145
+ * hold, and the item types an array with `zones` may not name (a list of values holds no rows).
4146
+ * `minItems ≤ maxItems`, and both bound the primitive list only (beside `itemType`).
4147
+ * src/lib/validation/schemas/content.ts ARRAY_ITEM_TYPES / PRIMITIVE_ARRAY_CONFIG_KEYS, in their order.
4148
+ */
4149
+ declare const PRIMITIVE_ARRAY_RULE: {
4150
+ readonly itemTypes: readonly ["text", "number", "date", "image", "link", "richtext"];
4151
+ readonly configKeys: readonly ["itemType", "minItems", "maxItems", "aliases"];
4152
+ readonly notWithZones: readonly ["image", "link", "richtext"];
4153
+ };
4123
4154
  declare function canonicalJson(value: unknown): string;
4155
+ /**
4156
+ * The definition a table's `schema_hash` is taken over: what a dock UI is built against. Names,
4157
+ * slugs and list chrome are not in it. Migration 0503's schema_hash_clear_when_stale triggers clear
4158
+ * the hash when exactly these change.
4159
+ */
4160
+ declare const SCHEMA_HASH_INPUTS: {
4161
+ readonly components: readonly ["props", "tabs", "v2"];
4162
+ readonly content_models: readonly ["fields", "fieldsets", "v2"];
4163
+ readonly component_variant_groups: readonly ["canonicalInputs", "v2"];
4164
+ };
4165
+ type SchemaHashTable = keyof typeof SCHEMA_HASH_INPUTS;
4166
+ /**
4167
+ * What `canonicalJson` hashes for one definition: exactly its table's inputs, so an unset key and a
4168
+ * cleared one hash alike. `schema_hash` = "v1:" + sha256 hex of `canonicalJson(schemaHashInput(…))`.
4169
+ */
4170
+ declare function schemaHashInput(table: SchemaHashTable, def: Readonly<Record<string, unknown>>): Record<string, unknown>;
4171
+
4172
+ /**
4173
+ * The rich-text features vocabulary: every name a field's `config.features` may carry.
4174
+ *
4175
+ * It is the ONE gate. What a field accepts (the sanitiser's elements, the Portable Text schema)
4176
+ * is derived from it by @bettercms-ai/richtext `acceptFor`, never stored beside it. Pure and
4177
+ * dependency-free, so richtext, the kit and the backend validation read the same list and the
4178
+ * same alias rule, and none of them keeps a copy.
4179
+ */
4180
+
4181
+ /** The always-on inline marks, Lexical-era names kept as written (richtext ALWAYS_ON_FEATURES). */
4182
+ declare const RICHTEXT_MARK_FEATURES: readonly ["bold", "italic", "underline", "strikethrough", "code", "highlight"];
4183
+ /**
4184
+ * The toggleable capabilities stored configs already name, in their order (richtext
4185
+ * TOGGLEABLE_FEATURES), minus `headings`: that one is an alias for the six levels, not a feature.
4186
+ */
4187
+ declare const RICHTEXT_TOGGLE_FEATURES: readonly ["blockquote", "horizontalRule", "orderedList", "unorderedList", "checklist", "link", "internalLink", "inlineImage", "videoEmbed", "codeBlock", "table", "columns"];
4188
+ /** One feature per heading level, so a field can allow h2 and h3 without h1. */
4189
+ declare const RICHTEXT_HEADING_FEATURES: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
4190
+ /**
4191
+ * The V2 blocks the RT steps build. With `checklist` and `columns` above, these are the nine.
4192
+ * `embed` is the third-party providers (X, CodePen, Figma, Maps, Spotify, Podcasts, audio, Shape);
4193
+ * `videoEmbed` stays the video, so a field can take a video without taking an X post.
4194
+ */
4195
+ declare const RICHTEXT_BLOCK_FEATURES: readonly ["gallery", "embed", "tableOfContents", "relatedPosts", "authorBio", "footnotes", "button"];
4196
+ /**
4197
+ * The canonical features, in vocabulary order: what a normalised config holds and the full set
4198
+ * a field can be given. An alias (`headings`) is a name a config may carry but never a feature.
4199
+ */
4200
+ declare const RICHTEXT_FEATURES: readonly ["bold", "italic", "underline", "strikethrough", "code", "highlight", "blockquote", "horizontalRule", "orderedList", "unorderedList", "checklist", "link", "internalLink", "inlineImage", "videoEmbed", "codeBlock", "table", "columns", "h1", "h2", "h3", "h4", "h5", "h6", "gallery", "embed", "tableOfContents", "relatedPosts", "authorBio", "footnotes", "button"];
4201
+ type RichTextFeature = (typeof RICHTEXT_FEATURES)[number];
4202
+ /**
4203
+ * Legacy names → the canonical features they mean. A read expands them, and a write stores the
4204
+ * expansion, so an alias never outlives the next save. `headings` was one Lexical switch for every
4205
+ * level; the audit (src, MCP, dashboard writers, 2026-10-24) found no other legacy name.
4206
+ */
4207
+ declare const RICHTEXT_FEATURE_ALIASES: Record<string, readonly RichTextFeature[]>;
4208
+ /**
4209
+ * A stored or submitted feature list in canonical form: aliases expanded, duplicates dropped,
4210
+ * VOCABULARY order, so two lists that mean the same thing are equal arrays (and RICHTEXT_FEATURES
4211
+ * is its own normal form). `unknown` keeps each name that is neither a feature nor an alias, as
4212
+ * written and once, so a reader can log it and a writer can refuse it (`richtext.feature_unknown:<name>`).
4213
+ */
4214
+ declare function normaliseRichTextFeatures(names: readonly string[]): {
4215
+ features: RichTextFeature[];
4216
+ unknown: string[];
4217
+ };
4218
+ /** The elements Prismic exposes (richtext CORE_ELEMENTS, in its order). */
4219
+ declare const RICHTEXT_CORE_ELEMENTS: readonly ["p", "pre", "h1", "h2", "h3", "h4", "h5", "h6", "b", "i", "link", "image", "code", "ul", "ol", "rtl"];
4220
+ /** What the platform does beyond Prismic (richtext ADVANCED_ELEMENTS, in its order). `embed` is the video. */
4221
+ declare const RICHTEXT_ADVANCED_ELEMENTS: readonly ["u", "mark", "s", "checklist", "table", "columns", "embed", "internalLink"];
4222
+ /** One element per new V2 block feature. `providerEmbed` is the `embed` feature's (the name `embed` is the video's). */
4223
+ declare const RICHTEXT_BLOCK_ELEMENTS: readonly ["gallery", "providerEmbed", "tableOfContents", "relatedPosts", "authorBio", "footnotes", "button"];
4224
+ declare const RICHTEXT_ELEMENTS: readonly ["p", "pre", "h1", "h2", "h3", "h4", "h5", "h6", "b", "i", "link", "image", "code", "ul", "ol", "rtl", "u", "mark", "s", "checklist", "table", "columns", "embed", "internalLink", "gallery", "providerEmbed", "tableOfContents", "relatedPosts", "authorBio", "footnotes", "button"];
4225
+ type RichTextElementName = (typeof RICHTEXT_ELEMENTS)[number];
4226
+ /** The rich-text refusals of the UiRefusal `schema` family. */
4227
+ type RichTextRefusalCode = "block_not_accepted" | "derived_field" | "feature_unknown";
4228
+ /**
4229
+ * One rich-text refusal, named the same way everywhere: `message` is `richtext.<code>:<detail>`
4230
+ * (a block's `_type`, a derived key, an unknown feature name), so a caller can show or match it.
4231
+ */
4232
+ declare const richTextRefusal: (code: RichTextRefusalCode, detail: string) => UiRefusal;
4233
+
4234
+ /**
4235
+ * What a delivered rich-text value carries for its embeds, beside its `html`: the one shape the
4236
+ * server writes (at html-cache build), the SDK surfaces and every renderer reads.
4237
+ */
4238
+ /**
4239
+ * An X post's card, from the oEmbed fetch the server makes: plain strings, escaped by the
4240
+ * renderer, never X's markup. `date` is as X shows it ("Oct 24, 2026").
4241
+ */
4242
+ interface EmbedCard {
4243
+ text: string;
4244
+ authorName: string;
4245
+ authorUrl?: string;
4246
+ date?: string;
4247
+ }
4248
+ /**
4249
+ * `cards` is keyed by the CANONICAL embed url (@bettercms-ai/richtext `canonicalEmbedUrl`), so a
4250
+ * post pasted two ways finds the same card. The site's opt-in to X's script is not here: it is a
4251
+ * page setting, so turning it on or off re-bakes no value's html.
4252
+ */
4253
+ interface RichTextEmbeds {
4254
+ cards: Record<string, EmbedCard>;
4255
+ }
4256
+
4257
+ /**
4258
+ * The id a heading's words make, V2's `slugify` byte for byte, so V2's stored links keep working.
4259
+ * The one spelling: @bettercms-ai/richtext stamps it on every rendered h2/h3 and re-exports it,
4260
+ * and the kit's table of contents reads it from here without the Portable Text stack.
4261
+ */
4262
+ declare const slugify: (s: string) => string;
4124
4263
 
4125
- export { type AlignToken, type AllowRule, type ApiError, type ApiKey, type ApiKeyPermission, type ApiKeyTokenType, type ArrayZoneConfig, type AssertEqual, type AuthResponse, type AuthSession, type AuthUser, BLOCK_BINDINGS, BLOCK_FIELD_TYPES, BLOCK_FIELD_TYPES_RENDERABLE_NOW, BODY_SCHEMA_ORIGINS, BREAKPOINTS, BUTTON_ACTIONS, BUTTON_FULL_WIDTH_INVALID, BUTTON_ICONS, BUTTON_ICON_NAMES, BUTTON_LOOK_KEYS, BUTTON_PLACEMENT_KEYS, BUTTON_SIZES, BUTTON_VARIANTS, type BetterCMSErrorCode, type BgToken, type BindingKind, type BlockBinding, type BlockHoverStyle, type BlockStyle, type BlockType, type BodySchema, type BodySchemaOrigin, type ButtonAction, type ButtonBlock, type ButtonIcon, type ButtonLinkCandidate, type ButtonLookKey, type ButtonProps, type ButtonSiteLook, type ButtonSizeName, type ButtonValue, type ButtonVariant, CANVAS_GESTURE_NAMES, CODE_SLOT_PREFIX, COMPONENT_PROP_TYPES, CONTROL_HELP, type CanonicalInputDefinition, type CanvasGesture, type ChoiceOption, type CollectionBlock, type CollectionFilter, type CollectionProps, type ColorToken, type ColumnsBlock, type ColumnsProps, type Component, type ComponentBlock, type ComponentCategory, type ComponentFormPropRef, type ComponentPreview, type ComponentPropDef, type ComponentPropType, type ComponentPropUi, type ComponentProps, type ComponentSubField, type ComponentTab, type ComponentV2, type ComponentVariantGroup, type Content, type ContentBlock, type ContentEntry, type ContentModel, type ContentModelField, type ContentModelFieldType, type ContentModelFieldUi, type ContentModelV2, type ContentPageResult, type ContentResponse, type ContentWidthToken, type ControlKind, type CornerToken, DEPTH_MAX, DIALOG_SELECTOR, DOCK_BUDGET, DOCK_ICON_NAMES, DOCK_ICON_NAME_SET, type DeepReadonly, type DefSources, type DeliveredLayout, type DeliveryComponent, type DeliveryEntry, type DeliveryEntrySeo, type DeliveryList, type DeliveryPage, type DerivedLocator, type DockBudget, type DockFieldLike, type DockFieldsetLike, type DockIconName, type DockInputRef, type DockLane, type DockNode, type DockPropGroupLike, type DockScreen, type ElementLike, type ExpandedBinding, FIELD_SIZE_ZOOM, FIELD_STYLE_KEYS, FOOTER_SECTION_ID, type FieldConfig, type FieldSize, type FieldStyle, type FieldStyleKey, type FieldStyles, type Fieldset, type FieldsetKind, type FieldsetUiBefore, type FontSizeToken, type FooterBlock, type FooterColumn, type FooterProps, type Form, type FormBlock, type FormField, type FormProps, type FormSubmission, HELP_CAPS, HELP_MAX, type HeadingBlock, type HeadingProps, IMAGE_ASPECTS, IMAGE_FRAME_RADIUS, type ImageAspect, type ImageBlock, type ImageProps, KIT_CATEGORIES, type KitCategory, LANDMARK_SELECTOR, LAYOUT_SECTION_ICONS, LAYOUT_SECTION_ICON_SET, LINK_RELS, LINK_VALUE_TYPES, LIST_ITEMS_CAP, LOCATOR_PATH, type LandmarkChainElement, type LandmarkElement, type LayoutComponentItem, type LayoutDataDocument, type LayoutFieldDefinition, type LayoutFieldItem, type LayoutFieldType, type LayoutScalarFieldType, type LayoutSection, type LayoutSectionIcon, type LayoutSectionItem, type LayoutStructureDocument, type LayoutZone, type LinkPairSibling, type LinkRel, type LinkValue, type LinkValueType, type LocatorGrammar, MAIN_SELECTOR, type ManagementLayoutCommand, type MediaAsset, type MediaCaptionTrack, type MediaFieldValue, NAVIGATION_SECTION_ID, type NavLink, type NavbarBlock, type NavbarProps, type NumberFieldFormat, type NumberScale, OPTION_DESCRIPTION_MAX, type OpenMode, PAGE_CONTENT_ANCHOR_ID, type Page, type PageLayoutOverrideDataDocument, type PageLayoutOverrideDocument, type PageLayoutOverrideState, type PageLayoutOverrideStructureDocument, type PageLayoutSectionOverride, type PageLayoutSectionStructureOverride, type PageMetaJson, type PageOnlyLayoutSection, type PageSectionPlacement, type PaginatedResult, type Perspective, type PortableTextDocument, type PortableTextNode, type PropGroup, type PropTab, RESPONSIVE_CSS, ROLE_HELP, ROLE_KEYS, type RadiusToken, type ReadButtonValue, type Redirect, type ReservedLayoutSection, type ResolvedLayoutNode, type RichTextBlock, type RichTextProps, SECTION_DOCTRINE, SECTION_SPACE_TOKENS, SEGMENTED_MAX, SEGMENTED_MIN, SIDE_SPACE_MIN_PX, SIDE_SPACE_TOKENS, SLOT_CHILD_KEYS, SLOT_ITEMS_CAP, SLOT_MAX_ITEMS, SLOT_SETTINGS_MAX, SLOT_SETTINGS_TYPES, SOURCE_RANK, SPACE_BOTTOM_TOKENS, SPACE_STEP_TOKENS, type ScaleUnit, type SchemaSource, type SectionBlock, type SectionPlanItem, type SectionProps, type SectionSpaceToken, type ShadowToken, type ShowIf, type ShowIfRule, type SignInInput, type SignUpInput, type SiteSeoDefaults, type SlideItem, type SliderBlock, type SliderProps, type SlotChild, type SlotItem, type SlotShapeOptions, type SlotShapeProblem, type SlotValue, type SourcedFacet, type SpaceStepToken, type SpaceToken, type SpacerBlock, type SpacerProps, TABLE_COLUMN_TYPES, TABLE_JSONLD_TYPES, TABLE_LIMITS, TABLE_RESPONSIVE, TAB_MAX, TAG_HEADS, type TabItem, type TableCell, type TableCellObject, type TableCellValue, type TableCheckOptions, type TableColumn, type TableColumnType, type TableFieldOptions, type TableFootnote, type TableGroup, type TableLink, type TableProblem, type TableRef, type TableRefResolved, type TableRow, type TableValue, type TabsBlock, type TabsProps, type TextBlock, type TextProps, type ThemeToken, UI_REFUSAL_CODES, type UiBefore, type UiOrigin, type UiRefusal, type UiRefusalFamily, type V2Placement, type V2Shape, type V2VariantMeta, V2_KEYS, V2_PLACEMENTS, V2_SHAPES, VIDEO_TRANSCRIPT_MAX, VIDEO_VALUE_KEYS, type VariantGroupV2, type VariantInputMapping, type VideoBlock, type VideoProps, type VideoValue, type VisibilityWindow, type WeightToken, type WindowState, type Workspace, type ZoneField, allowRuleOf, anchorTargetRel, blockStyleToColumnCss, blockStyleToCss, blockStyleToInnerCss, bodySchemaOf, buttonBlockProps, buttonFullWidthProblem, buttonIconOf, buttonIconSvg, buttonLinkPairs, buttonLookValue, buttonSiteLookOf, buttonValueOfInstance, buttonValueProblem, buttonVariantOf, candidateRole, canonicalJson, componentInstanceAddresses, componentPropTargetKey, derivedPairs, dockBudget, dockScreens, exampleFor, expandBlockBindings, fieldGroupOf, fieldStyleCssText, fieldStyleToCss, formatNumber, formatPropsAttribute, getBlockType, headingPaintCss, hiddenEverywhere, hideOnAttr, imageFrameCss, inWindow, isBlock, isButtonLookValue, isChromeLandmark, isCodeButton, isLinkObject, isRoleKey, isRulePaired, isScriptHref, isSlotChild, isTableValue, isUiRefusal, keyWords, landmarkRegions, linkAnchorOf, linkHref, linkRefOf, linkValueProblem, locatorFor, locatorPath, mayOverwrite, normalizeLinkValue, normalizeTableValue, normalizeWindow, parseNumberText, parsePropsAttribute, pickFieldStyle, placementBindOf, planSections, readButtonValue, readNumberFormat, readPath, regionOf, renderTableHtml, rulePartnerOf, safeCssUrl, sideFloorApplies, sideSpaceCss, slotBindOf, slotChildValues, slotItems, slotPathString, slotShapeProblems, spaceTokenCss, splitButtonStyle, tableCellText, tablePathString, tableRefCells, tableSearchText, tableToMarkdown, tableValueProblems, topFieldKeyOf, uiRefusalId, usesHideOn, videoUrlOf, videoValueProblem, visibleBlocks, visibleDeliveredLayout, visibleLayoutStructure, windowState, withButtonLookProps, withExample };
4264
+ export { type AlignToken, type AllowRule, type ApiError, type ApiKey, type ApiKeyPermission, type ApiKeyTokenType, type ArrayZoneConfig, type AssertEqual, type AuthResponse, type AuthSession, type AuthUser, BLOCK_BINDINGS, BLOCK_FIELD_TYPES, BLOCK_FIELD_TYPES_RENDERABLE_NOW, BODY_SCHEMA_ORIGINS, BREAKPOINTS, BUTTON_ACTIONS, BUTTON_FULL_WIDTH_INVALID, BUTTON_ICONS, BUTTON_ICON_NAMES, BUTTON_LOOK_KEYS, BUTTON_PLACEMENT_KEYS, BUTTON_SIZES, BUTTON_VARIANTS, type BetterCMSErrorCode, type BgToken, type BindingKind, type BlockBinding, type BlockHoverStyle, type BlockStyle, type BlockType, type BodySchema, type BodySchemaOrigin, type ButtonAction, type ButtonBlock, type ButtonIcon, type ButtonLinkCandidate, type ButtonLookKey, type ButtonProps, type ButtonSiteLook, type ButtonSizeName, type ButtonValue, type ButtonVariant, CANVAS_GESTURE_NAMES, CODE_SLOT_PREFIX, COMPONENT_PROP_TYPES, CONTROL_HELP, type CanonicalInputDefinition, type CanvasGesture, type ChoiceOption, type CollectionBlock, type CollectionFilter, type CollectionProps, type ColorToken, type ColumnsBlock, type ColumnsProps, type Component, type ComponentBlock, type ComponentCategory, type ComponentFormPropRef, type ComponentPreview, type ComponentPropDef, type ComponentPropType, type ComponentPropUi, type ComponentProps, type ComponentSubField, type ComponentTab, type ComponentV2, type ComponentVariantGroup, type Content, type ContentBlock, type ContentEntry, type ContentModel, type ContentModelField, type ContentModelFieldType, type ContentModelFieldUi, type ContentModelV2, type ContentPageResult, type ContentResponse, type ContentWidthToken, type ControlKind, type CornerToken, DEPTH_MAX, DERIVE_MINTED_RESERVED, DIALOG_SELECTOR, DOCK_BUDGET, DOCK_ICON_NAMES, DOCK_ICON_NAME_SET, type DeepReadonly, type DefSources, type DeliveredLayout, type DeliveryComponent, type DeliveryEntry, type DeliveryEntrySeo, type DeliveryList, type DeliveryPage, type DerivedLocator, type DockBudget, type DockFieldLike, type DockFieldsetLike, type DockIconName, type DockInputRef, type DockLane, type DockNode, type DockPropGroupLike, type DockScreen, type ElementLike, type EmbedCard, type ExpandedBinding, FIELD_SIZE_ZOOM, FIELD_STYLE_KEYS, FOOTER_SECTION_ID, type FieldConfig, type FieldSize, type FieldStyle, type FieldStyleKey, type FieldStyles, type Fieldset, type FieldsetKind, type FieldsetUiBefore, type FontSizeToken, type FooterBlock, type FooterColumn, type FooterProps, type Form, type FormBlock, type FormField, type FormProps, type FormSubmission, HELP_CAPS, HELP_MAX, type HeadingBlock, type HeadingProps, IMAGE_ASPECTS, IMAGE_FRAME_RADIUS, type ImageAspect, type ImageBlock, type ImageProps, KEY_FORBIDDEN, KEY_FORMAT, KEY_RESERVED, KEY_RESERVED_PREFIX, KIT_CATEGORIES, type KitCategory, LANDMARK_SELECTOR, LAYOUT_SECTION_ICONS, LAYOUT_SECTION_ICON_SET, LINK_RELS, LINK_VALUE_TYPES, LIST_ITEMS_CAP, LOCATOR_PATH, type LandmarkChainElement, type LandmarkElement, type LayoutComponentItem, type LayoutDataDocument, type LayoutFieldDefinition, type LayoutFieldItem, type LayoutFieldType, type LayoutScalarFieldType, type LayoutSection, type LayoutSectionIcon, type LayoutSectionItem, type LayoutStructureDocument, type LayoutZone, type LinkPairSibling, type LinkRel, type LinkValue, type LinkValueType, type LocatorGrammar, MAIN_SELECTOR, type ManagementLayoutCommand, type MediaAsset, type MediaCaptionTrack, type MediaFieldValue, NAVIGATION_SECTION_ID, type NavLink, type NavbarBlock, type NavbarProps, type NumberFieldFormat, type NumberScale, OPTION_DESCRIPTION_MAX, type OpenMode, PAGE_CONTENT_ANCHOR_ID, PRIMITIVE_ARRAY_RULE, type Page, type PageLayoutOverrideDataDocument, type PageLayoutOverrideDocument, type PageLayoutOverrideState, type PageLayoutOverrideStructureDocument, type PageLayoutSectionOverride, type PageLayoutSectionStructureOverride, type PageMetaJson, type PageOnlyLayoutSection, type PageSectionPlacement, type PaginatedResult, type Perspective, type PortableTextDocument, type PortableTextNode, type PropGroup, type PropTab, RESPONSIVE_CSS, RICHTEXT_ADVANCED_ELEMENTS, RICHTEXT_BLOCK_ELEMENTS, RICHTEXT_BLOCK_FEATURES, RICHTEXT_CORE_ELEMENTS, RICHTEXT_ELEMENTS, RICHTEXT_FEATURES, RICHTEXT_FEATURE_ALIASES, RICHTEXT_HEADING_FEATURES, RICHTEXT_MARK_FEATURES, RICHTEXT_TOGGLE_FEATURES, ROLE_HELP, ROLE_KEYS, type RadiusToken, type ReadButtonValue, type Redirect, type ReservedLayoutSection, type ResolvedLayoutNode, type RichTextBlock, type RichTextElementName, type RichTextEmbeds, type RichTextFeature, type RichTextProps, type RichTextRefusalCode, SCHEMA_HASH_INPUTS, SECTION_DOCTRINE, SECTION_SPACE_TOKENS, SEGMENTED_MAX, SEGMENTED_MIN, SIDE_SPACE_MIN_PX, SIDE_SPACE_TOKENS, SLOT_CHILD_KEYS, SLOT_ITEMS_CAP, SLOT_MAX_ITEMS, SLOT_SETTINGS_MAX, SLOT_SETTINGS_TYPES, SOURCE_RANK, SPACE_BOTTOM_TOKENS, SPACE_STEP_TOKENS, type ScaleUnit, type SchemaHashTable, type SchemaSource, type SectionBlock, type SectionPlanItem, type SectionProps, type SectionSpaceToken, type ShadowToken, type ShowIf, type ShowIfRule, type SignInInput, type SignUpInput, type SiteSeoDefaults, type SlideItem, type SliderBlock, type SliderProps, type SlotChild, type SlotItem, type SlotShapeOptions, type SlotShapeProblem, type SlotValue, type SourcedFacet, type SpaceStepToken, type SpaceToken, type SpacerBlock, type SpacerProps, TABLE_COLUMN_TYPES, TABLE_JSONLD_TYPES, TABLE_LIMITS, TABLE_RESPONSIVE, TAB_MAX, TAB_MAX_RENDERABLE_NOW, TAG_HEADS, type TabItem, type TableCell, type TableCellObject, type TableCellValue, type TableCheckOptions, type TableColumn, type TableColumnType, type TableFieldOptions, type TableFootnote, type TableGroup, type TableLink, type TableProblem, type TableRef, type TableRefResolved, type TableRow, type TableValue, type TabsBlock, type TabsProps, type TextBlock, type TextProps, type ThemeToken, UI_REFUSAL_CODES, type UiBefore, type UiOrigin, type UiRefusal, type UiRefusalFamily, type V2Placement, type V2Shape, type V2VariantMeta, V2_KEYS, V2_PLACEMENTS, V2_SHAPES, VIDEO_TRANSCRIPT_MAX, VIDEO_VALUE_KEYS, type VariantGroupV2, type VariantInputMapping, type VideoBlock, type VideoProps, type VideoValue, type VisibilityWindow, type WeightToken, type WindowState, type Workspace, type ZoneField, allowRuleOf, anchorTargetRel, blockStyleToColumnCss, blockStyleToCss, blockStyleToInnerCss, bodySchemaOf, buttonBlockProps, buttonFullWidthProblem, buttonIconOf, buttonIconSvg, buttonLinkPairs, buttonLookValue, buttonSiteLookOf, buttonValueOfInstance, buttonValueProblem, buttonVariantOf, candidateRole, canonicalJson, componentInstanceAddresses, componentPropTargetKey, derivedPairs, dockBudget, dockScreens, exampleFor, expandBlockBindings, fieldGroupOf, fieldStyleCssText, fieldStyleToCss, formatNumber, formatPropsAttribute, getBlockType, headingPaintCss, hiddenEverywhere, hideOnAttr, imageFrameCss, inWindow, isBlock, isButtonLookValue, isChromeLandmark, isCodeButton, isDeriveReservedKey, isLinkObject, isReservedKey, isRoleKey, isRulePaired, isScriptHref, isSlotChild, isTableValue, isUiRefusal, keyWords, landmarkRegions, linkAnchorOf, linkHref, linkRefOf, linkValueProblem, locatorFor, locatorPath, mayOverwrite, normaliseRichTextFeatures, normalizeLinkValue, normalizeTableValue, normalizeWindow, parseNumberText, parsePropsAttribute, pickFieldStyle, placementBindOf, planSections, readButtonValue, readNumberFormat, readPath, regionOf, renderTableHtml, richTextRefusal, rulePartnerOf, safeCssUrl, schemaHashInput, sideFloorApplies, sideSpaceCss, slotBindOf, slotChildValues, slotItems, slotPathString, slotShapeProblems, slugify, spaceTokenCss, splitButtonStyle, tableCellText, tablePathString, tableRefCells, tableSearchText, tableToMarkdown, tableValueProblems, topFieldKeyOf, uiRefusalId, usesHideOn, videoUrlOf, videoValueProblem, visibleBlocks, visibleDeliveredLayout, visibleLayoutStructure, windowState, withButtonLookProps, withExample };
package/dist/index.js CHANGED
@@ -4553,6 +4553,7 @@ function planSections(slots, blocks) {
4553
4553
 
4554
4554
  // src/kit-v2.ts
4555
4555
  var TAB_MAX = 8;
4556
+ var TAB_MAX_RENDERABLE_NOW = 3;
4556
4557
  var SEGMENTED_MIN = 2;
4557
4558
  var SEGMENTED_MAX = 8;
4558
4559
  var DEPTH_MAX = 10;
@@ -4652,8 +4653,13 @@ var UI_REFUSAL_CODES = {
4652
4653
  "depth_exceeded",
4653
4654
  "validation_failed",
4654
4655
  "hash_mismatch",
4656
+ "non_finite_number",
4655
4657
  "shape_kind_mismatch",
4656
- "block_field_unrenderable"
4658
+ "block_field_unrenderable",
4659
+ // rich text (richtext-features.ts richTextRefusal): `richtext.<code>:<detail>`
4660
+ "block_not_accepted",
4661
+ "derived_field",
4662
+ "feature_unknown"
4657
4663
  ],
4658
4664
  build: ["peer_missing", "kit_major_unsupported", "compile_error", "nondeterministic", "size_exceeded"],
4659
4665
  protocol: ["unsupported", "handshake_timeout", "origin_mismatch", "write_denied"],
@@ -4666,6 +4672,18 @@ var isUiRefusal = (v) => {
4666
4672
  const { family, code, message } = v;
4667
4673
  return typeof family === "string" && Object.hasOwn(UI_REFUSAL_CODES, family) && UI_REFUSAL_CODES[family].includes(code) && typeof message === "string";
4668
4674
  };
4675
+ var KEY_RESERVED = /* @__PURE__ */ new Set(["derived", "layout", "page"]);
4676
+ var DERIVE_MINTED_RESERVED = /* @__PURE__ */ new Set([...KEY_RESERVED, "id"]);
4677
+ var KEY_FORBIDDEN = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
4678
+ var KEY_RESERVED_PREFIX = "_";
4679
+ var KEY_FORMAT = /^[A-Za-z][A-Za-z0-9_-]*$/;
4680
+ var isReservedKey = (key) => KEY_FORBIDDEN.has(key) || KEY_RESERVED.has(key) || key.startsWith(KEY_RESERVED_PREFIX);
4681
+ var isDeriveReservedKey = (key) => isReservedKey(key) || DERIVE_MINTED_RESERVED.has(key);
4682
+ var PRIMITIVE_ARRAY_RULE = {
4683
+ itemTypes: ["text", "number", "date", "image", "link", "richtext"],
4684
+ configKeys: ["itemType", "minItems", "maxItems", "aliases"],
4685
+ notWithZones: ["image", "link", "richtext"]
4686
+ };
4669
4687
  function canonicalNumber(value) {
4670
4688
  if (!Number.isFinite(value)) throw new TypeError("Canonical JSON only supports finite numbers");
4671
4689
  if (Object.is(value, -0)) return "0";
@@ -4692,6 +4710,100 @@ function canonicalJson(value) {
4692
4710
  }
4693
4711
  throw new TypeError(`Unsupported canonical JSON value: ${typeof value}`);
4694
4712
  }
4713
+ var SCHEMA_HASH_INPUTS = {
4714
+ components: ["props", "tabs", "v2"],
4715
+ content_models: ["fields", "fieldsets", "v2"],
4716
+ component_variant_groups: ["canonicalInputs", "v2"]
4717
+ };
4718
+ var LIST_INPUTS = /* @__PURE__ */ new Set(["props", "fields", "canonicalInputs"]);
4719
+ function schemaHashInput(table, def) {
4720
+ return Object.fromEntries(SCHEMA_HASH_INPUTS[table].map((k) => [k, def[k] ?? (LIST_INPUTS.has(k) ? [] : null)]));
4721
+ }
4722
+
4723
+ // src/richtext-features.ts
4724
+ var RICHTEXT_MARK_FEATURES = ["bold", "italic", "underline", "strikethrough", "code", "highlight"];
4725
+ var RICHTEXT_TOGGLE_FEATURES = [
4726
+ "blockquote",
4727
+ "horizontalRule",
4728
+ "orderedList",
4729
+ "unorderedList",
4730
+ "checklist",
4731
+ "link",
4732
+ "internalLink",
4733
+ "inlineImage",
4734
+ "videoEmbed",
4735
+ "codeBlock",
4736
+ "table",
4737
+ "columns"
4738
+ ];
4739
+ var RICHTEXT_HEADING_FEATURES = ["h1", "h2", "h3", "h4", "h5", "h6"];
4740
+ var RICHTEXT_BLOCK_FEATURES = [
4741
+ "gallery",
4742
+ "embed",
4743
+ "tableOfContents",
4744
+ "relatedPosts",
4745
+ "authorBio",
4746
+ "footnotes",
4747
+ "button"
4748
+ ];
4749
+ var RICHTEXT_FEATURES = [
4750
+ ...RICHTEXT_MARK_FEATURES,
4751
+ ...RICHTEXT_TOGGLE_FEATURES,
4752
+ ...RICHTEXT_HEADING_FEATURES,
4753
+ ...RICHTEXT_BLOCK_FEATURES
4754
+ ];
4755
+ var RICHTEXT_FEATURE_ALIASES = {
4756
+ headings: RICHTEXT_HEADING_FEATURES
4757
+ };
4758
+ var KNOWN = new Set(RICHTEXT_FEATURES);
4759
+ function normaliseRichTextFeatures(names) {
4760
+ const want = /* @__PURE__ */ new Set();
4761
+ const unknown = [];
4762
+ for (const name of names) {
4763
+ if (Object.hasOwn(RICHTEXT_FEATURE_ALIASES, name)) for (const f of RICHTEXT_FEATURE_ALIASES[name]) want.add(f);
4764
+ else if (KNOWN.has(name)) want.add(name);
4765
+ else if (!unknown.includes(name)) unknown.push(name);
4766
+ }
4767
+ return { features: RICHTEXT_FEATURES.filter((f) => want.has(f)), unknown };
4768
+ }
4769
+ var RICHTEXT_CORE_ELEMENTS = [
4770
+ "p",
4771
+ "pre",
4772
+ "h1",
4773
+ "h2",
4774
+ "h3",
4775
+ "h4",
4776
+ "h5",
4777
+ "h6",
4778
+ "b",
4779
+ "i",
4780
+ "link",
4781
+ "image",
4782
+ "code",
4783
+ "ul",
4784
+ "ol",
4785
+ "rtl"
4786
+ ];
4787
+ var RICHTEXT_ADVANCED_ELEMENTS = ["u", "mark", "s", "checklist", "table", "columns", "embed", "internalLink"];
4788
+ var RICHTEXT_BLOCK_ELEMENTS = [
4789
+ "gallery",
4790
+ "providerEmbed",
4791
+ "tableOfContents",
4792
+ "relatedPosts",
4793
+ "authorBio",
4794
+ "footnotes",
4795
+ "button"
4796
+ ];
4797
+ var RICHTEXT_ELEMENTS = [...RICHTEXT_CORE_ELEMENTS, ...RICHTEXT_ADVANCED_ELEMENTS, ...RICHTEXT_BLOCK_ELEMENTS];
4798
+ var richTextRefusal = (code, detail) => ({
4799
+ family: "schema",
4800
+ code,
4801
+ detail,
4802
+ message: `richtext.${code}:${detail}`
4803
+ });
4804
+
4805
+ // src/heading-id.ts
4806
+ var slugify = (s) => s.toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || "section";
4695
4807
  export {
4696
4808
  BLOCK_BINDINGS,
4697
4809
  BLOCK_FIELD_TYPES,
@@ -4711,6 +4823,7 @@ export {
4711
4823
  COMPONENT_PROP_TYPES,
4712
4824
  CONTROL_HELP,
4713
4825
  DEPTH_MAX,
4826
+ DERIVE_MINTED_RESERVED,
4714
4827
  DIALOG_SELECTOR,
4715
4828
  DOCK_BUDGET,
4716
4829
  DOCK_ICON_NAMES,
@@ -4722,6 +4835,10 @@ export {
4722
4835
  HELP_MAX,
4723
4836
  IMAGE_ASPECTS,
4724
4837
  IMAGE_FRAME_RADIUS,
4838
+ KEY_FORBIDDEN,
4839
+ KEY_FORMAT,
4840
+ KEY_RESERVED,
4841
+ KEY_RESERVED_PREFIX,
4725
4842
  KIT_CATEGORIES,
4726
4843
  LANDMARK_SELECTOR,
4727
4844
  LAYOUT_SECTION_ICONS,
@@ -4734,9 +4851,21 @@ export {
4734
4851
  NAVIGATION_SECTION_ID,
4735
4852
  OPTION_DESCRIPTION_MAX,
4736
4853
  PAGE_CONTENT_ANCHOR_ID,
4854
+ PRIMITIVE_ARRAY_RULE,
4737
4855
  RESPONSIVE_CSS,
4856
+ RICHTEXT_ADVANCED_ELEMENTS,
4857
+ RICHTEXT_BLOCK_ELEMENTS,
4858
+ RICHTEXT_BLOCK_FEATURES,
4859
+ RICHTEXT_CORE_ELEMENTS,
4860
+ RICHTEXT_ELEMENTS,
4861
+ RICHTEXT_FEATURES,
4862
+ RICHTEXT_FEATURE_ALIASES,
4863
+ RICHTEXT_HEADING_FEATURES,
4864
+ RICHTEXT_MARK_FEATURES,
4865
+ RICHTEXT_TOGGLE_FEATURES,
4738
4866
  ROLE_HELP,
4739
4867
  ROLE_KEYS,
4868
+ SCHEMA_HASH_INPUTS,
4740
4869
  SECTION_DOCTRINE,
4741
4870
  SECTION_SPACE_TOKENS,
4742
4871
  SEGMENTED_MAX,
@@ -4756,6 +4885,7 @@ export {
4756
4885
  TABLE_LIMITS,
4757
4886
  TABLE_RESPONSIVE,
4758
4887
  TAB_MAX,
4888
+ TAB_MAX_RENDERABLE_NOW,
4759
4889
  TAG_HEADS,
4760
4890
  UI_REFUSAL_CODES,
4761
4891
  V2_KEYS,
@@ -4803,7 +4933,9 @@ export {
4803
4933
  isButtonLookValue,
4804
4934
  isChromeLandmark,
4805
4935
  isCodeButton,
4936
+ isDeriveReservedKey,
4806
4937
  isLinkObject,
4938
+ isReservedKey,
4807
4939
  isRoleKey,
4808
4940
  isRulePaired,
4809
4941
  isScriptHref,
@@ -4819,6 +4951,7 @@ export {
4819
4951
  locatorFor,
4820
4952
  locatorPath,
4821
4953
  mayOverwrite,
4954
+ normaliseRichTextFeatures,
4822
4955
  normalizeLinkValue,
4823
4956
  normalizeTableValue,
4824
4957
  normalizeWindow,
@@ -4832,8 +4965,10 @@ export {
4832
4965
  readPath,
4833
4966
  regionOf,
4834
4967
  renderTableHtml,
4968
+ richTextRefusal,
4835
4969
  rulePartnerOf,
4836
4970
  safeCssUrl,
4971
+ schemaHashInput,
4837
4972
  sideFloorApplies,
4838
4973
  sideSpaceCss,
4839
4974
  slotBindOf,
@@ -4841,6 +4976,7 @@ export {
4841
4976
  slotItems,
4842
4977
  slotPathString,
4843
4978
  slotShapeProblems,
4979
+ slugify,
4844
4980
  spaceTokenCss,
4845
4981
  splitButtonStyle,
4846
4982
  tableCellText,