@bettercms-ai/types 1.53.0 → 1.57.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
@@ -3295,9 +3295,36 @@ interface MediaFieldValue {
3295
3295
  }
3296
3296
 
3297
3297
  /**
3298
- * Delivery API response shapes — the read surface consumed by framework
3299
- * SDKs (@bettercms-ai/sdk core client, @bettercms-ai/astro, @bettercms-ai/next).
3298
+ * What a delivered rich-text value carries for its references, beside its `html` (RT8): the
3299
+ * entries an author bio and related posts point at, resolved by the server (one query, at
3300
+ * html-cache build) so every renderer draws the same thing and none of them fetches.
3300
3301
  */
3302
+ /** A related post as a reader sees it. `url` is the final href (from the collection's route). */
3303
+ interface ResolvedPost {
3304
+ title: string;
3305
+ url: string;
3306
+ cover?: string;
3307
+ category?: string;
3308
+ }
3309
+ /** An author as a reader sees them. `bio` is plain text; `avatar` an image src. */
3310
+ interface ResolvedAuthor {
3311
+ name: string;
3312
+ avatar?: string;
3313
+ bio?: string;
3314
+ url?: string;
3315
+ }
3316
+ interface RichTextResolved {
3317
+ /** Entry id → the post: every hand-picked `posts[]._ref`, and every id the query chose. */
3318
+ posts?: Record<string, ResolvedPost>;
3319
+ /** Entry id → the author, for each author bio's `author._ref`. */
3320
+ authors?: Record<string, ResolvedAuthor>;
3321
+ /**
3322
+ * A related-posts block's `_key` → the entry ids the server chose for a `topic` or `newest`
3323
+ * block, in display order, at most its `count`, the current entry excluded. Not read for a
3324
+ * `manual` block, whose own `posts` are the list.
3325
+ */
3326
+ related?: Record<string, string[]>;
3327
+ }
3301
3328
 
3302
3329
  /** Which content lane to read from. */
3303
3330
  type Perspective = "published" | "drafts";
@@ -3336,6 +3363,13 @@ interface DeliveryEntry<T = Record<string, unknown>> {
3336
3363
  seo?: DeliveryEntrySeo;
3337
3364
  /** Hydrated reference fields, present when `depth >= 1`. */
3338
3365
  _hydration?: Record<string, DeliveryEntry | DeliveryEntry[]>;
3366
+ /**
3367
+ * What this response resolved the entry's related posts and author bios to (RT8), merged over all
3368
+ * of its rich-text values: from the PUBLISHED entries, never stored. An envelope value also carries
3369
+ * its own (`value.resolved`); a Body stored as a bare block array has nowhere to, and reads this.
3370
+ * The SDK's `resolved(value, entry)` picks the right one. Absent when nothing needed resolving.
3371
+ */
3372
+ resolved?: RichTextResolved;
3339
3373
  _meta?: {
3340
3374
  modelSlug: string;
3341
3375
  depth: number;
@@ -4180,8 +4214,11 @@ declare function schemaHashInput(table: SchemaHashTable, def: Readonly<Record<st
4180
4214
 
4181
4215
  /** The always-on inline marks, Lexical-era names kept as written (richtext ALWAYS_ON_FEATURES). */
4182
4216
  declare const RICHTEXT_MARK_FEATURES: readonly ["bold", "italic", "underline", "strikethrough", "code", "highlight"];
4183
- /** The toggleable capabilities stored configs already name, in their order (richtext TOGGLEABLE_FEATURES). */
4184
- declare const RICHTEXT_TOGGLE_FEATURES: readonly ["headings", "blockquote", "horizontalRule", "orderedList", "unorderedList", "checklist", "link", "internalLink", "inlineImage", "videoEmbed", "codeBlock", "table", "columns"];
4217
+ /**
4218
+ * The toggleable capabilities stored configs already name, in their order (richtext
4219
+ * TOGGLEABLE_FEATURES), minus `headings`: that one is an alias for the six levels, not a feature.
4220
+ */
4221
+ declare const RICHTEXT_TOGGLE_FEATURES: readonly ["blockquote", "horizontalRule", "orderedList", "unorderedList", "checklist", "link", "internalLink", "inlineImage", "videoEmbed", "codeBlock", "table", "columns"];
4185
4222
  /** One feature per heading level, so a field can allow h2 and h3 without h1. */
4186
4223
  declare const RICHTEXT_HEADING_FEATURES: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
4187
4224
  /**
@@ -4190,8 +4227,11 @@ declare const RICHTEXT_HEADING_FEATURES: readonly ["h1", "h2", "h3", "h4", "h5",
4190
4227
  * `videoEmbed` stays the video, so a field can take a video without taking an X post.
4191
4228
  */
4192
4229
  declare const RICHTEXT_BLOCK_FEATURES: readonly ["gallery", "embed", "tableOfContents", "relatedPosts", "authorBio", "footnotes", "button"];
4193
- /** Every name a stored config may carry, in vocabulary order. */
4194
- declare const RICHTEXT_FEATURES: readonly ["bold", "italic", "underline", "strikethrough", "code", "highlight", "headings", "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"];
4230
+ /**
4231
+ * The canonical features, in vocabulary order: what a normalised config holds and the full set
4232
+ * a field can be given. An alias (`headings`) is a name a config may carry but never a feature.
4233
+ */
4234
+ 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"];
4195
4235
  type RichTextFeature = (typeof RICHTEXT_FEATURES)[number];
4196
4236
  /**
4197
4237
  * Legacy names → the canonical features they mean. A read expands them, and a write stores the
@@ -4200,10 +4240,10 @@ type RichTextFeature = (typeof RICHTEXT_FEATURES)[number];
4200
4240
  */
4201
4241
  declare const RICHTEXT_FEATURE_ALIASES: Record<string, readonly RichTextFeature[]>;
4202
4242
  /**
4203
- * A stored or submitted feature list in canonical form: aliases expanded (and never returned),
4204
- * duplicates dropped, VOCABULARY order, so two lists that mean the same thing are equal arrays.
4205
- * `unknown` keeps each name the vocabulary does not hold, as written and once, so a reader can
4206
- * log it and a writer can refuse it by name (`richtext.feature_unknown:<name>`).
4243
+ * A stored or submitted feature list in canonical form: aliases expanded, duplicates dropped,
4244
+ * VOCABULARY order, so two lists that mean the same thing are equal arrays (and RICHTEXT_FEATURES
4245
+ * is its own normal form). `unknown` keeps each name that is neither a feature nor an alias, as
4246
+ * written and once, so a reader can log it and a writer can refuse it (`richtext.feature_unknown:<name>`).
4207
4247
  */
4208
4248
  declare function normaliseRichTextFeatures(names: readonly string[]): {
4209
4249
  features: RichTextFeature[];
@@ -4225,4 +4265,34 @@ type RichTextRefusalCode = "block_not_accepted" | "derived_field" | "feature_unk
4225
4265
  */
4226
4266
  declare const richTextRefusal: (code: RichTextRefusalCode, detail: string) => UiRefusal;
4227
4267
 
4228
- 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 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 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, spaceTokenCss, splitButtonStyle, tableCellText, tablePathString, tableRefCells, tableSearchText, tableToMarkdown, tableValueProblems, topFieldKeyOf, uiRefusalId, usesHideOn, videoUrlOf, videoValueProblem, visibleBlocks, visibleDeliveredLayout, visibleLayoutStructure, windowState, withButtonLookProps, withExample };
4268
+ /**
4269
+ * What a delivered rich-text value carries for its embeds, beside its `html`: the one shape the
4270
+ * server writes (at html-cache build), the SDK surfaces and every renderer reads.
4271
+ */
4272
+ /**
4273
+ * An X post's card, from the oEmbed fetch the server makes: plain strings, escaped by the
4274
+ * renderer, never X's markup. `date` is as X shows it ("Oct 24, 2026").
4275
+ */
4276
+ interface EmbedCard {
4277
+ text: string;
4278
+ authorName: string;
4279
+ authorUrl?: string;
4280
+ date?: string;
4281
+ }
4282
+ /**
4283
+ * `cards` is keyed by the CANONICAL embed url (@bettercms-ai/richtext `canonicalEmbedUrl`), so a
4284
+ * post pasted two ways finds the same card. The site's opt-in to X's script is not here: it is a
4285
+ * page setting, so turning it on or off re-bakes no value's html.
4286
+ */
4287
+ interface RichTextEmbeds {
4288
+ cards: Record<string, EmbedCard>;
4289
+ }
4290
+
4291
+ /**
4292
+ * The id a heading's words make, V2's `slugify` byte for byte, so V2's stored links keep working.
4293
+ * The one spelling: @bettercms-ai/richtext stamps it on every rendered h2/h3 and re-exports it,
4294
+ * and the kit's table of contents reads it from here without the Portable Text stack.
4295
+ */
4296
+ declare const slugify: (s: string) => string;
4297
+
4298
+ 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 ResolvedAuthor, type ResolvedLayoutNode, type ResolvedPost, type RichTextBlock, type RichTextElementName, type RichTextEmbeds, type RichTextFeature, type RichTextProps, type RichTextRefusalCode, type RichTextResolved, 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
@@ -4723,7 +4723,6 @@ function schemaHashInput(table, def) {
4723
4723
  // src/richtext-features.ts
4724
4724
  var RICHTEXT_MARK_FEATURES = ["bold", "italic", "underline", "strikethrough", "code", "highlight"];
4725
4725
  var RICHTEXT_TOGGLE_FEATURES = [
4726
- "headings",
4727
4726
  "blockquote",
4728
4727
  "horizontalRule",
4729
4728
  "orderedList",
@@ -4757,16 +4756,15 @@ var RICHTEXT_FEATURE_ALIASES = {
4757
4756
  headings: RICHTEXT_HEADING_FEATURES
4758
4757
  };
4759
4758
  var KNOWN = new Set(RICHTEXT_FEATURES);
4760
- var isAlias = (name) => Object.hasOwn(RICHTEXT_FEATURE_ALIASES, name);
4761
4759
  function normaliseRichTextFeatures(names) {
4762
4760
  const want = /* @__PURE__ */ new Set();
4763
4761
  const unknown = [];
4764
4762
  for (const name of names) {
4765
- if (isAlias(name)) for (const f of RICHTEXT_FEATURE_ALIASES[name]) want.add(f);
4763
+ if (Object.hasOwn(RICHTEXT_FEATURE_ALIASES, name)) for (const f of RICHTEXT_FEATURE_ALIASES[name]) want.add(f);
4766
4764
  else if (KNOWN.has(name)) want.add(name);
4767
4765
  else if (!unknown.includes(name)) unknown.push(name);
4768
4766
  }
4769
- return { features: RICHTEXT_FEATURES.filter((f) => want.has(f) && !isAlias(f)), unknown };
4767
+ return { features: RICHTEXT_FEATURES.filter((f) => want.has(f)), unknown };
4770
4768
  }
4771
4769
  var RICHTEXT_CORE_ELEMENTS = [
4772
4770
  "p",
@@ -4803,6 +4801,9 @@ var richTextRefusal = (code, detail) => ({
4803
4801
  detail,
4804
4802
  message: `richtext.${code}:${detail}`
4805
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";
4806
4807
  export {
4807
4808
  BLOCK_BINDINGS,
4808
4809
  BLOCK_FIELD_TYPES,
@@ -4975,6 +4976,7 @@ export {
4975
4976
  slotItems,
4976
4977
  slotPathString,
4977
4978
  slotShapeProblems,
4979
+ slugify,
4978
4980
  spaceTokenCss,
4979
4981
  splitButtonStyle,
4980
4982
  tableCellText,