@bettercms-ai/types 1.64.0 → 1.67.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
@@ -91,7 +91,7 @@ type V2Shape = (typeof V2_SHAPES)[number];
91
91
  declare const V2_PLACEMENTS: readonly ["inline", "section", "page"];
92
92
  /** Where a block may be placed. */
93
93
  type V2Placement = (typeof V2_PLACEMENTS)[number];
94
- /** The kit catalogue's categories, verbatim (dashboard src/kit/library/catalog.ts CATEGORY_ORDER). */
94
+ /** The kit catalogue's categories, verbatim (packages/kit/src/library/catalog.ts CATEGORY_ORDER). */
95
95
  declare const KIT_CATEGORIES: readonly ["Navigation & chrome", "Heroes", "Features & storytelling", "Social proof", "Media & galleries", "Commerce", "Pricing & plans", "Conversion & forms", "Listings & feeds", "Long-form & docs", "Company & people", "Events & places", "Data & interactive", "Advanced patterns"];
96
96
  type KitCategory = (typeof KIT_CATEGORIES)[number];
97
97
  /** The catalogue's order, by the name the facet table bounds `category` with. */
@@ -1157,9 +1157,12 @@ type AlignToken = "left" | "center" | "right";
1157
1157
  type FontSizeToken = "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl";
1158
1158
  type WeightToken = "normal" | "medium" | "semibold" | "bold";
1159
1159
  type RadiusToken = "none" | "sm" | "md" | "lg" | "full";
1160
- type ThemeToken = "inherit" | "light" | "dark";
1161
- type BgToken = "none" | "surface" | "muted" | "accent" | "dark" | "custom";
1162
- type ContentWidthToken = "narrow" | "default" | "wide" | "full";
1160
+ declare const THEME_TOKENS: readonly ["inherit", "light", "dark"];
1161
+ type ThemeToken = (typeof THEME_TOKENS)[number];
1162
+ declare const BG_TOKENS: readonly ["none", "surface", "muted", "accent", "dark", "custom"];
1163
+ type BgToken = (typeof BG_TOKENS)[number];
1164
+ declare const CONTENT_WIDTH_TOKENS: readonly ["narrow", "default", "wide", "full"];
1165
+ type ContentWidthToken = (typeof CONTENT_WIDTH_TOKENS)[number];
1163
1166
  type CornerToken = "0" | "s" | "m" | "l" | "xl" | "2xl";
1164
1167
  type ShadowToken = "0" | "s" | "m" | "l" | "xl";
1165
1168
  interface BlockStyle {
@@ -2627,7 +2630,8 @@ interface ComponentPropDef {
2627
2630
  * date → `YYYY-MM-DD`
2628
2631
  * color → a hex colour (`#RGB`, `#RRGGBB`, `#RRGGBBAA`)
2629
2632
  * file → `{ url, name?, size? }`, or a bare URL string
2630
- * icon → a BetterCMS icon name (`DOCK_ICON_NAMES`), or an uploaded icon as an image value
2633
+ * icon → a BetterCMS icon name (`DOCK_ICON_NAMES`), an uploaded icon as an image value, or a D65 icon object
2634
+ * (`{ source: pack | library | upload, …, label? }`, icon-value.ts); `config.icons` says which sources a field offers
2631
2635
  * multiselect → a `string[]`, each one of `config.options`
2632
2636
  * object → ONE `{ [childKey]: value }` keyed by `config.fields` (the V2 model-field `object`)
2633
2637
  * datetime · slug · email · phone · json · location → what the same-named model FIELD stores
@@ -3540,6 +3544,16 @@ declare function tableRefCells(value: unknown): Array<{
3540
3544
  }>;
3541
3545
  /** The words a cell says (Markdown, search, screen readers). Booleans say their words, never a tick. */
3542
3546
  declare function tableCellText(col: TableColumn, row: TableRow | undefined, c: unknown): string;
3547
+ /**
3548
+ * The few rules every rendered table needs wherever it lands (a hosted page, a prop's `props.html`,
3549
+ * a code site): screen-reader-only words, the scroll region, cell padding. Scoped to `.bt-table`
3550
+ * and carried in the figure, so a page without a table ships none of it.
3551
+ *
3552
+ * GAP-124: the scroll region is `position:relative`, so it is the containing block of every
3553
+ * absolutely placed `.bt-sr` inside it. Without that a hidden "Included" in a column scrolled out of
3554
+ * view laid out against the page, not the region, and pushed a 375px page 152px sideways.
3555
+ */
3556
+ declare const TABLE_CSS: string;
3543
3557
  /**
3544
3558
  * The table as semantic HTML (published form: no editing marks): `<figure class="bt-table">` ›
3545
3559
  * `<table>` with caption, column-group headers, `<thead>`, one `<tbody>` per row group, `<tfoot>`,
@@ -3624,10 +3638,13 @@ interface MediaFieldValue {
3624
3638
  * entries an author bio and related posts point at, resolved by the server (one query, at
3625
3639
  * html-cache build) so every renderer draws the same thing and none of them fetches.
3626
3640
  */
3627
- /** A related post as a reader sees it. `url` is the final href (from the collection's route). */
3641
+ /**
3642
+ * A related post as a reader sees it. `url` is the final href (from the collection's route); absent when the
3643
+ * post has no public page (a collection with no detail route), and the card is drawn without a link.
3644
+ */
3628
3645
  interface ResolvedPost {
3629
3646
  title: string;
3630
- url: string;
3647
+ url?: string;
3631
3648
  cover?: string;
3632
3649
  category?: string;
3633
3650
  }
@@ -3862,7 +3879,7 @@ type FormStatus = "draft" | "published";
3862
3879
  interface FormField {
3863
3880
  key: string;
3864
3881
  label: string;
3865
- type: "text" | "email" | "textarea" | "select" | "checkbox" | "checkboxes" | "radio" | "number" | "phone" | "date" | "url" | "consent" | "hidden" | "step";
3882
+ type: "text" | "email" | "textarea" | "select" | "checkbox" | "checkboxes" | "radio" | "number" | "phone" | "date" | "url" | "consent" | "hidden" | "file" | "step";
3866
3883
  placeholder?: string;
3867
3884
  helpText?: string;
3868
3885
  required?: boolean;
@@ -3894,6 +3911,12 @@ type FormFieldValidation = {
3894
3911
  phoneFormat?: "any" | "e164";
3895
3912
  /** `text` | `textarea` | `url` — anchored regex, compiled and length-capped at save time. */
3896
3913
  pattern?: string;
3914
+ /** `file` — accepted extensions, lowercase, no dot. Unset = FORM_UPLOAD_DEFAULT_ACCEPT. */
3915
+ accept?: string[];
3916
+ /** `file` — files per field. Unset = 1. Capped by the site's plan when it applies. */
3917
+ maxFiles?: number;
3918
+ /** `file` — per-file cap in MB. Only a plan that may configure upload limits can set it. */
3919
+ maxSizeMb?: number;
3897
3920
  };
3898
3921
  /**
3899
3922
  * Per-field PRESENTATION options. Currently only the phone field's country picker.
@@ -3935,6 +3958,78 @@ interface FormSubmission {
3935
3958
  userAgent?: string;
3936
3959
  }
3937
3960
 
3961
+ /**
3962
+ * The `file` form field's platform limits and type vocabulary: one statement of them, read by
3963
+ * the save route, the upload route, the submit check and every renderer.
3964
+ *
3965
+ * A field's own `validation.maxSizeMb` / `maxFiles` are a REQUEST. What applies is computed by
3966
+ * the server from the site's current plan each time (`formUploadLimits`), so a stored number
3967
+ * never outlives the plan that allowed it.
3968
+ */
3969
+ declare const FORM_UPLOAD: {
3970
+ /** Per-file cap on every plan, in MB. */
3971
+ readonly maxSizeMb: 10;
3972
+ /** The most a site whose plan may configure the cap can raise it to, in MB. */
3973
+ readonly maxSizeMbCeiling: 25;
3974
+ /** Files per field on every plan. */
3975
+ readonly maxFiles: 5;
3976
+ /** Files per field where the plan may configure limits. */
3977
+ readonly maxFilesCeiling: 10;
3978
+ };
3979
+ /** Named groups of extensions the builder offers. A field stores extensions, never a preset name. */
3980
+ declare const FORM_UPLOAD_PRESETS: {
3981
+ readonly images: readonly ["jpg", "jpeg", "png", "gif", "webp", "heic"];
3982
+ readonly pdf: readonly ["pdf"];
3983
+ readonly documents: readonly ["doc", "docx", "odt", "rtf", "txt"];
3984
+ readonly spreadsheets: readonly ["xls", "xlsx", "ods", "csv"];
3985
+ readonly archives: readonly ["zip"];
3986
+ };
3987
+ /** What a file field accepts when its owner names nothing: every preset except archives. */
3988
+ declare const FORM_UPLOAD_DEFAULT_ACCEPT: readonly string[];
3989
+ /**
3990
+ * Extensions no file field accepts, whatever its `accept` says: programs, installers, scripts,
3991
+ * shortcuts, disk images, macro-carrying documents and pages a browser would run.
3992
+ */
3993
+ declare const FORM_UPLOAD_REFUSED_EXTENSIONS: readonly string[];
3994
+ /** Is this extension one no field may accept? */
3995
+ declare function isRefusedUploadExtension(ext: string): boolean;
3996
+ /** A file name's extension: lowercase, no dot, "" when it has none. */
3997
+ declare function fileExtension(name: string): string;
3998
+ /**
3999
+ * The extensions a field accepts: its own list, lowercased, without dots and without anything
4000
+ * refused, or the default when nothing is left. Renderers build their `accept` attribute from it.
4001
+ */
4002
+ declare function formUploadAccept(accept: readonly string[] | undefined): string[];
4003
+ /**
4004
+ * The limits that APPLY to a file field. `configurable` is whether the site's plan may set its
4005
+ * own limits; without it the field's `maxSizeMb` is ignored and `maxFiles` stops at the base cap.
4006
+ */
4007
+ declare function formUploadLimits(rules: {
4008
+ maxFiles?: number;
4009
+ maxSizeMb?: number;
4010
+ } | undefined, configurable: boolean): {
4011
+ maxFiles: number;
4012
+ maxSizeMb: number;
4013
+ };
4014
+ /**
4015
+ * What a renderer checks a chosen file against BEFORE uploading it: the field as delivered, with
4016
+ * the platform's defaults and ceilings. A courtesy, never the rule. A site's plan may hold the
4017
+ * field to less (the upload route then refuses with the limit that applies, and that refusal is
4018
+ * what the visitor is shown); this must never be MORE strict than the server, or a file the
4019
+ * site's plan allows would be blocked in the browser.
4020
+ */
4021
+ declare function fileFieldLimits(field: {
4022
+ validation?: {
4023
+ accept?: string[];
4024
+ maxFiles?: number;
4025
+ maxSizeMb?: number;
4026
+ };
4027
+ }): {
4028
+ accept: string[];
4029
+ maxFiles: number;
4030
+ maxSizeMb: number;
4031
+ };
4032
+
3938
4033
  /**
3939
4034
  * Redirect — a server-side redirect managed in the CMS.
3940
4035
  */
@@ -4788,4 +4883,99 @@ declare function isVariantVisible(prop: PropLike, values: Record<string, unknown
4788
4883
  */
4789
4884
  declare const slugify: (s: string) => string;
4790
4885
 
4791
- export { type AlignToken, type AllowRule, type ApiError, type ApiKey, type ApiKeyPermission, type ApiKeyTokenType, type ApproveDockUiInput, type ApproveDockUiOutput, 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 BodiesState, type BodyDeclaration, 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, CATEGORY_ID_MAX, CATEGORY_ORDER, CODE_SLOT_PREFIX, COMPONENT_GATE_CODES, 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 ComponentCategoryId, type ComponentEmbedNode, type ComponentFormPropRef, type ComponentGateCode, 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, DEFAULT_VARIANT, DEPTH_MAX, DERIVE_MINTED_RESERVED, DIALOG_SELECTOR, DOCK_BUDGET, DOCK_ICON_NAMES, DOCK_ICON_NAME_SET, DOCK_UI_IMPORTS, DOCK_UI_LIMITS, DOCK_UI_NAME, type DeclaredSlot, 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 DockUiBuildReceipt, type DockUiKind, type DockUiOrigin, type DockUiScope, type DockUiSource, type DockUiStatus, type DockUiVersion, EMBED_LEDGER_OUTCOMES, EMBED_REASONS, type ElementLike, type EmbedCapability, type EmbedCard, type EmbedLedgerOutcome, type EmbedMarker, type EmbedMarkerMatch, type EmbedNotRenderedWarning, type EmbedReason, type ExpandedBinding, FIELD_SIZE_ZOOM, FIELD_STYLE_KEYS, FOOTER_SECTION_ID, FRAME_REFUSALS, 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_LINE_MAX, HELP_MAX, HELP_WRITE_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, LIST_PREVIEW_SLOTS, LOCATOR_PATH, type LandmarkChainElement, type LandmarkElement, type LayoutComponentItem, type LayoutDataDocument, type LayoutFieldDefinition, type LayoutFieldItem, type LayoutFieldType, type LayoutScalarFieldType, type LayoutSection, type LayoutSectionDesign, type LayoutSectionIcon, type LayoutSectionItem, type LayoutStructureDocument, type LayoutZone, type LinkPairSibling, type LinkRel, type LinkValue, type LinkValueType, type ListDockUiInput, type ListDockUiOutput, 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, OPEN_MODES, OPEN_MODE_TYPES, 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, type PublishDockUiInput, type PublishDockUiOutput, REFERENCE_CREATE_REFUSAL_CODES, 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_KEYS, type RadiusToken, type ReadButtonValue, type Redirect, type ReferenceCreateCapability, type ReferenceCreateRefusal, type ReferenceCreateRefusalCode, type ReferenceCreateResult, type ReferenceCreatedOption, 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, SHOW_IF_SCOPES, 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_PROTOCOLS, UI_REFUSAL_CODES, UI_REFUSAL_IDS, type UiBefore, type UiManifestEntry, type UiManifestV2, type UiOrigin, type UiProtocol, type UiRefusal, type UiRefusalFamily, type UiRefusalId, type V2Placement, type V2Shape, type V2VariantMeta, V2_KEYS, V2_PLACEMENTS, V2_SHAPES, VARIANT_PROP_KEY, VIDEO_TRANSCRIPT_MAX, VIDEO_VALUE_KEYS, type ValidateDockUiInput, type ValidateDockUiOutput, type VariantGroupV2, type VariantInputMapping, type VideoBlock, type VideoProps, type VideoValue, type VisibilityWindow, WIDTH_FIT_FAIL_KINDS, type WeightToken, type WidthFitFailKind, type WidthFitResult, type WindowState, type Workspace, type WriteDockUiInput, type WriteDockUiOutput, 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, dockUiMerkleKey, embedAddress, embedMarkerHtml, embedVisible, evaluateShowIf, exampleFor, expandBlockBindings, fieldGroupOf, fieldStyleCssText, fieldStyleToCss, formatNumber, formatPropsAttribute, getBlockType, headingPaintCss, hiddenEverywhere, hideOnAttr, imageFrameCss, inWindow, isBlock, isButtonLookValue, isChromeLandmark, isCodeButton, isComponentGateCode, isDeriveReservedKey, isDockUiImportAllowed, isEmbedReason, isLinkObject, isReservedKey, isRoleKey, isRulePaired, isScriptHref, isSlotChild, isTableValue, isUiRefusal, isVariantVisible, keyWords, landmarkRegions, linkAnchorOf, linkHref, linkRefOf, linkValueProblem, locatorFor, locatorPath, mayOverwrite, normaliseRichTextFeatures, normalizeLinkValue, normalizeTableValue, normalizeWindow, parseEmbedMarkers, parseNumberText, parsePropsAttribute, pickFieldStyle, placementBindOf, planSections, readButtonValue, readNumberFormat, readPath, referenceCreateRefusal, 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, variantOptionsFromUnion, variantOptionsOf, variantPropOf, videoUrlOf, videoValueProblem, visibleBlocks, visibleDeliveredLayout, visibleLayoutStructure, windowState, withButtonLookProps, withExample };
4886
+ /**
4887
+ * ICON (V2 D65): an `icon` field's options and its stored value. Pure: no React, no I/O.
4888
+ *
4889
+ * Where an icon may come from is the field's choice (`config.icons`, V2 `FieldSchema.icons`):
4890
+ * pack a name from the BetterCMS icon set (DOCK_ICON_NAMES)
4891
+ * library an SVG from the project's icon library (brand kit), sanitised on upload
4892
+ * upload an image from the media library
4893
+ * With no `icons`, a field offers the pack and an upload: what the icon field always offered.
4894
+ *
4895
+ * Stored values, every one of them read:
4896
+ * "arrow-right" pack (the short form)
4897
+ * "https://…/logo.svg" · { url, alt? } upload, as stored before D65
4898
+ * { source: "pack", name, label? }
4899
+ * { source: "library", id, url, followsText?, label? }
4900
+ * { source: "upload", url, assetId?, label? }
4901
+ * A library or upload value carries its resolved `url`, so a site draws it with no lookup. `label` is the
4902
+ * accessible name; none = decorative. A write keeps the oldest form that says the same thing (compactIcon), so a
4903
+ * field that never opts in stores exactly what it did before.
4904
+ */
4905
+ type IconSource = "pack" | "library" | "upload";
4906
+ interface IconFieldOptions {
4907
+ /** Where an icon may come from, in tab order. Default ["pack", "upload"]. */
4908
+ sources?: IconSource[];
4909
+ /** Library sets (ids) the Library tab offers. Default: the whole library. */
4910
+ sets?: string[];
4911
+ /** false = only icons that follow the text colour (no multicolour SVG, no images). Default true. */
4912
+ allowColor?: boolean;
4913
+ /** "always" (default) = decorative, aria-hidden. "ask" = a "Describe this icon" input under the picker. */
4914
+ decorative?: "always" | "ask";
4915
+ }
4916
+ interface PackIconValue {
4917
+ source: "pack";
4918
+ name: string;
4919
+ label?: string;
4920
+ }
4921
+ interface LibraryIconValue {
4922
+ source: "library";
4923
+ id: string;
4924
+ url: string;
4925
+ /** a single-colour SVG drawn in the text colour (a CSS mask), not as an image */
4926
+ followsText?: boolean;
4927
+ label?: string;
4928
+ }
4929
+ interface UploadIconValue {
4930
+ source: "upload";
4931
+ url: string;
4932
+ assetId?: string;
4933
+ label?: string;
4934
+ }
4935
+ type IconObjectValue = PackIconValue | LibraryIconValue | UploadIconValue;
4936
+ /** What an icon field stores. */
4937
+ type IconValue = string | IconObjectValue | {
4938
+ url: string;
4939
+ alt?: string;
4940
+ };
4941
+ declare const ICON_SOURCES: readonly IconSource[];
4942
+ declare const DEFAULT_ICON_SOURCES: readonly IconSource[];
4943
+ /** An icon's accessible name, at most this long (the platform's help line). */
4944
+ declare const ICON_LABEL_MAX = 80;
4945
+ interface ResolvedIconOptions {
4946
+ sources: IconSource[];
4947
+ sets?: string[];
4948
+ allowColor: boolean;
4949
+ decorative: "always" | "ask";
4950
+ }
4951
+ declare function resolveIconOptions(o?: IconFieldOptions): ResolvedIconOptions;
4952
+ /** Any stored value (string, object, junk) → the object form, or null when there is no icon. */
4953
+ declare function normalizeIcon(v: unknown): IconObjectValue | null;
4954
+ /** The oldest form that means the same thing: a pack name or an upload URL with nothing else stays a bare string. */
4955
+ declare function compactIcon(v: IconObjectValue | null): IconValue | "";
4956
+ /** Whether a value needs an object form (D65's labels, library or a media asset id). */
4957
+ declare const isIconObjectForm: (v: unknown) => boolean;
4958
+ /** The icon itself, ignoring its label: "pack:flame", "library:ic_1", "upload:https://…". "" for none. */
4959
+ declare function iconIdentity(v: unknown): string;
4960
+ /** Same icon, new accessible name. "" removes the label (decorative). */
4961
+ declare function withIconLabel(v: unknown, label: string): IconValue | "";
4962
+ /** What a renderer draws: a set name, or a URL (masked in the text colour when it follows the text). */
4963
+ type IconSrc = {
4964
+ name: string;
4965
+ label?: string;
4966
+ } | {
4967
+ url: string;
4968
+ followsText: boolean;
4969
+ label?: string;
4970
+ };
4971
+ declare function iconSrc(v: unknown): IconSrc | null;
4972
+ /** Why a stored icon value is refused, or null. `knownName` is the icon-set check; `isUrl` the fetchable-URL check. */
4973
+ declare function iconValueProblem(v: unknown, knownName: (name: string) => boolean, isUrl: (url: string) => boolean): string | null;
4974
+ /**
4975
+ * An icon value as HTML (the string renderers: the Astro SDK's <BcmsIcon>): a set name as the shipped <svg>, a library
4976
+ * icon that follows the text as a span masked in currentColor, any other url as an <img>. A label names it; without one
4977
+ * it is decorative. "" when there is no icon, or a name the set does not have.
4978
+ */
4979
+ declare function iconHtml(v: unknown, className?: string): string;
4980
+
4981
+ export { type AlignToken, type AllowRule, type ApiError, type ApiKey, type ApiKeyPermission, type ApiKeyTokenType, type ApproveDockUiInput, type ApproveDockUiOutput, type ArrayZoneConfig, type AssertEqual, type AuthResponse, type AuthSession, type AuthUser, BG_TOKENS, 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 BodiesState, type BodyDeclaration, 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, CATEGORY_ID_MAX, CATEGORY_ORDER, CODE_SLOT_PREFIX, COMPONENT_GATE_CODES, COMPONENT_PROP_TYPES, CONTENT_WIDTH_TOKENS, 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 ComponentCategoryId, type ComponentEmbedNode, type ComponentFormPropRef, type ComponentGateCode, 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, DEFAULT_ICON_SOURCES, DEFAULT_VARIANT, DEPTH_MAX, DERIVE_MINTED_RESERVED, DIALOG_SELECTOR, DOCK_BUDGET, DOCK_ICON_NAMES, DOCK_ICON_NAME_SET, DOCK_UI_IMPORTS, DOCK_UI_LIMITS, DOCK_UI_NAME, type DeclaredSlot, 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 DockUiBuildReceipt, type DockUiKind, type DockUiOrigin, type DockUiScope, type DockUiSource, type DockUiStatus, type DockUiVersion, EMBED_LEDGER_OUTCOMES, EMBED_REASONS, type ElementLike, type EmbedCapability, type EmbedCard, type EmbedLedgerOutcome, type EmbedMarker, type EmbedMarkerMatch, type EmbedNotRenderedWarning, type EmbedReason, type ExpandedBinding, FIELD_SIZE_ZOOM, FIELD_STYLE_KEYS, FOOTER_SECTION_ID, FORM_UPLOAD, FORM_UPLOAD_DEFAULT_ACCEPT, FORM_UPLOAD_PRESETS, FORM_UPLOAD_REFUSED_EXTENSIONS, FRAME_REFUSALS, 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_LINE_MAX, HELP_MAX, HELP_WRITE_MAX, type HeadingBlock, type HeadingProps, ICON_LABEL_MAX, ICON_SOURCES, IMAGE_ASPECTS, IMAGE_FRAME_RADIUS, type IconFieldOptions, type IconObjectValue, type IconSource, type IconSrc, type IconValue, 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, LIST_PREVIEW_SLOTS, LOCATOR_PATH, type LandmarkChainElement, type LandmarkElement, type LayoutComponentItem, type LayoutDataDocument, type LayoutFieldDefinition, type LayoutFieldItem, type LayoutFieldType, type LayoutScalarFieldType, type LayoutSection, type LayoutSectionDesign, type LayoutSectionIcon, type LayoutSectionItem, type LayoutStructureDocument, type LayoutZone, type LibraryIconValue, type LinkPairSibling, type LinkRel, type LinkValue, type LinkValueType, type ListDockUiInput, type ListDockUiOutput, 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, OPEN_MODES, OPEN_MODE_TYPES, OPTION_DESCRIPTION_MAX, type OpenMode, PAGE_CONTENT_ANCHOR_ID, PRIMITIVE_ARRAY_RULE, type PackIconValue, 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, type PublishDockUiInput, type PublishDockUiOutput, REFERENCE_CREATE_REFUSAL_CODES, 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_KEYS, type RadiusToken, type ReadButtonValue, type Redirect, type ReferenceCreateCapability, type ReferenceCreateRefusal, type ReferenceCreateRefusalCode, type ReferenceCreateResult, type ReferenceCreatedOption, type ReservedLayoutSection, type ResolvedAuthor, type ResolvedIconOptions, 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, SHOW_IF_SCOPES, 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_CSS, TABLE_JSONLD_TYPES, TABLE_LIMITS, TABLE_RESPONSIVE, TAB_MAX, TAB_MAX_RENDERABLE_NOW, TAG_HEADS, THEME_TOKENS, 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_PROTOCOLS, UI_REFUSAL_CODES, UI_REFUSAL_IDS, type UiBefore, type UiManifestEntry, type UiManifestV2, type UiOrigin, type UiProtocol, type UiRefusal, type UiRefusalFamily, type UiRefusalId, type UploadIconValue, type V2Placement, type V2Shape, type V2VariantMeta, V2_KEYS, V2_PLACEMENTS, V2_SHAPES, VARIANT_PROP_KEY, VIDEO_TRANSCRIPT_MAX, VIDEO_VALUE_KEYS, type ValidateDockUiInput, type ValidateDockUiOutput, type VariantGroupV2, type VariantInputMapping, type VideoBlock, type VideoProps, type VideoValue, type VisibilityWindow, WIDTH_FIT_FAIL_KINDS, type WeightToken, type WidthFitFailKind, type WidthFitResult, type WindowState, type Workspace, type WriteDockUiInput, type WriteDockUiOutput, type ZoneField, allowRuleOf, anchorTargetRel, blockStyleToColumnCss, blockStyleToCss, blockStyleToInnerCss, bodySchemaOf, buttonBlockProps, buttonFullWidthProblem, buttonIconOf, buttonIconSvg, buttonLinkPairs, buttonLookValue, buttonSiteLookOf, buttonValueOfInstance, buttonValueProblem, buttonVariantOf, candidateRole, canonicalJson, compactIcon, componentInstanceAddresses, componentPropTargetKey, derivedPairs, dockBudget, dockScreens, dockUiMerkleKey, embedAddress, embedMarkerHtml, embedVisible, evaluateShowIf, exampleFor, expandBlockBindings, fieldGroupOf, fieldStyleCssText, fieldStyleToCss, fileExtension, fileFieldLimits, formUploadAccept, formUploadLimits, formatNumber, formatPropsAttribute, getBlockType, headingPaintCss, hiddenEverywhere, hideOnAttr, iconHtml, iconIdentity, iconSrc, iconValueProblem, imageFrameCss, inWindow, isBlock, isButtonLookValue, isChromeLandmark, isCodeButton, isComponentGateCode, isDeriveReservedKey, isDockUiImportAllowed, isEmbedReason, isIconObjectForm, isLinkObject, isRefusedUploadExtension, isReservedKey, isRoleKey, isRulePaired, isScriptHref, isSlotChild, isTableValue, isUiRefusal, isVariantVisible, keyWords, landmarkRegions, linkAnchorOf, linkHref, linkRefOf, linkValueProblem, locatorFor, locatorPath, mayOverwrite, normaliseRichTextFeatures, normalizeIcon, normalizeLinkValue, normalizeTableValue, normalizeWindow, parseEmbedMarkers, parseNumberText, parsePropsAttribute, pickFieldStyle, placementBindOf, planSections, readButtonValue, readNumberFormat, readPath, referenceCreateRefusal, regionOf, renderTableHtml, resolveIconOptions, richTextRefusal, rulePartnerOf, safeCssUrl, schemaHashInput, sideFloorApplies, sideSpaceCss, slotBindOf, slotChildValues, slotItems, slotPathString, slotShapeProblems, slugify, spaceTokenCss, splitButtonStyle, tableCellText, tablePathString, tableRefCells, tableSearchText, tableToMarkdown, tableValueProblems, topFieldKeyOf, uiRefusalId, usesHideOn, variantOptionsFromUnion, variantOptionsOf, variantPropOf, videoUrlOf, videoValueProblem, visibleBlocks, visibleDeliveredLayout, visibleLayoutStructure, windowState, withButtonLookProps, withExample, withIconLabel };