@bettercms-ai/types 1.55.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +37 -3
  2. package/package.json +1 -1
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;
@@ -4261,4 +4295,4 @@ interface RichTextEmbeds {
4261
4295
  */
4262
4296
  declare const slugify: (s: string) => string;
4263
4297
 
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 };
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bettercms-ai/types",
3
- "version": "1.55.0",
3
+ "version": "1.57.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",