@bettercms-ai/types 1.51.0 → 1.52.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
@@ -4001,4 +4001,125 @@ type SectionPlanItem<B> = {
4001
4001
  */
4002
4002
  declare function planSections<B>(slots: readonly string[], blocks: readonly B[] | null | undefined): SectionPlanItem<B>[];
4003
4003
 
4004
- 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, 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 ComponentVariantGroup, type Content, type ContentBlock, type ContentEntry, type ContentModel, type ContentModelField, type ContentModelFieldType, type ContentModelFieldUi, type ContentPageResult, type ContentResponse, type ContentWidthToken, type ControlKind, type CornerToken, DIALOG_SELECTOR, DOCK_BUDGET, DOCK_ICON_NAMES, DOCK_ICON_NAME_SET, type DeepReadonly, 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_MAX, type HeadingBlock, type HeadingProps, IMAGE_ASPECTS, IMAGE_FRAME_RADIUS, type ImageAspect, type ImageBlock, type ImageProps, 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, SIDE_SPACE_MIN_PX, SIDE_SPACE_TOKENS, SLOT_CHILD_KEYS, SLOT_ITEMS_CAP, SLOT_MAX_ITEMS, SPACE_BOTTOM_TOKENS, SPACE_STEP_TOKENS, type ScaleUnit, 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 SpaceStepToken, type SpaceToken, type SpacerBlock, type SpacerProps, TABLE_COLUMN_TYPES, TABLE_JSONLD_TYPES, TABLE_LIMITS, TABLE_RESPONSIVE, 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, type UiBefore, type UiOrigin, VIDEO_TRANSCRIPT_MAX, VIDEO_VALUE_KEYS, 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, 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, keyWords, landmarkRegions, linkAnchorOf, linkHref, linkRefOf, linkValueProblem, locatorFor, locatorPath, 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, usesHideOn, videoUrlOf, videoValueProblem, visibleBlocks, visibleDeliveredLayout, visibleLayoutStructure, windowState, withButtonLookProps, withExample };
4004
+ /**
4005
+ * The V2 kit's storage contract, shared by V2 authoring (the dashboard kit) and prod validation.
4006
+ * One home per constant: a bound the two sides kept separately is how a value got refused on one
4007
+ * side and stored on the other (kit-facet-table.v3.md, "Carriers" and "Corpus floor").
4008
+ */
4009
+
4010
+ /** Tabs on one screen: a model's `fieldsets kind:"tab"` and a component's prop tabs alike. */
4011
+ declare const TAB_MAX = 8;
4012
+ /** `ui.control:"segmented"`: the option count it stores. V2's 3 is a render-fit rule, not this. */
4013
+ declare const SEGMENTED_MIN = 2;
4014
+ declare const SEGMENTED_MAX = 8;
4015
+ /** Field / prop nesting depth. */
4016
+ declare const DEPTH_MAX = 10;
4017
+ /** Help and description caps by where the text sits. */
4018
+ declare const HELP_CAPS: {
4019
+ readonly field: 500;
4020
+ readonly prop: 200;
4021
+ readonly placeholder: 120;
4022
+ readonly helpMore: 2000;
4023
+ readonly option: 140;
4024
+ readonly fieldset: 500;
4025
+ readonly propGroup: 200;
4026
+ };
4027
+ /** `config.settings` on a slot prop or a slot / modular field: at most this many setting defs. */
4028
+ declare const SLOT_SETTINGS_MAX = 12;
4029
+ /**
4030
+ * The types a slot setting may be: one value on one block. A select's options are written inline
4031
+ * on the setting; no reference type, since a setting never points at another record.
4032
+ */
4033
+ declare const SLOT_SETTINGS_TYPES: readonly ["text", "slug", "select", "multiselect", "number", "rating", "date", "datetime", "boolean", "color", "icon", "link"];
4034
+ /**
4035
+ * The field types a `kind:'block'` model may hold: the TARGET set. The kit corpus uses every one
4036
+ * of them, so this is the bound; anything outside it is refused as out of domain.
4037
+ */
4038
+ declare const BLOCK_FIELD_TYPES: readonly ["text", "longtext", "richtext", "image", "link", "slug", "email", "phone", "color", "select", "number", "rating", "date", "datetime", "boolean", "video", "object", "array", "reference", "file", "tags"];
4039
+ /**
4040
+ * The staged part of BLOCK_FIELD_TYPES a block primitive renders TODAY
4041
+ * (src/lib/sections/block-model-mapping.ts FIELD_PRIMITIVE). A type in the target set but not
4042
+ * here is refused with `schema.block_field_unrenderable` only until its renderer ships, and then
4043
+ * joins this list. When this equals BLOCK_FIELD_TYPES (G7), the staging is over.
4044
+ */
4045
+ declare const BLOCK_FIELD_TYPES_RENDERABLE_NOW: readonly ["text", "longtext", "richtext", "image", "link", "slug", "email", "phone", "color", "select", "number", "rating", "date", "datetime", "boolean"];
4046
+ declare const V2_SHAPES: readonly ["block", "page", "entry", "global", "object"];
4047
+ /** What a definition IS in V2. On a model, `block` ⇔ `content_models.kind = 'block'`. */
4048
+ type V2Shape = (typeof V2_SHAPES)[number];
4049
+ declare const V2_PLACEMENTS: readonly ["inline", "section", "page"];
4050
+ /** Where a block may be placed. */
4051
+ type V2Placement = (typeof V2_PLACEMENTS)[number];
4052
+ /** The kit catalogue's categories, verbatim (dashboard src/kit/library/catalog.ts CATEGORY_ORDER). */
4053
+ 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"];
4054
+ type KitCategory = (typeof KIT_CATEGORIES)[number];
4055
+ /** A variant's chrome. Its slug, name and members are native; only these two are not. */
4056
+ interface V2VariantMeta {
4057
+ icon?: DockIconName;
4058
+ description?: string;
4059
+ }
4060
+ /** `components.v2` / `published_v2`. Category and icon are native columns. */
4061
+ interface ComponentV2 {
4062
+ shape?: V2Shape;
4063
+ placement?: V2Placement;
4064
+ }
4065
+ /** `content_models.v2`. Icon and preview are native (`icon`, `list_preview`). */
4066
+ interface ContentModelV2 {
4067
+ shape?: V2Shape;
4068
+ placement?: V2Placement;
4069
+ category?: KitCategory;
4070
+ /** By variant slug; the slugs themselves are the options of the model's `_variant` select. */
4071
+ variants?: Record<string, V2VariantMeta>;
4072
+ }
4073
+ /** `component_variant_groups.v2` / `published_v2`. ORDER is the array index, like field order. */
4074
+ interface VariantGroupV2 {
4075
+ variants?: Array<V2VariantMeta & {
4076
+ componentId: string;
4077
+ }>;
4078
+ }
4079
+ /** The keys each table's block may hold; validators build strict schemas from these. */
4080
+ declare const V2_KEYS: {
4081
+ readonly components: readonly ["shape", "placement"];
4082
+ readonly content_models: readonly ["shape", "placement", "category", "variants"];
4083
+ readonly component_variant_groups: readonly ["variants"];
4084
+ };
4085
+ /** Who last wrote a facet, weakest first: the generator, the site's own code, an agent, a person. */
4086
+ declare const SOURCE_RANK: {
4087
+ readonly auto: 0;
4088
+ readonly site: 1;
4089
+ readonly agent: 2;
4090
+ readonly human: 3;
4091
+ };
4092
+ type SchemaSource = keyof typeof SOURCE_RANK;
4093
+ /** The facets a per-def `sources` map tracks. */
4094
+ type SourcedFacet = "ui" | "input" | "ai";
4095
+ /** A field's or prop's `sources`: server-owned, stamped on write, never taken from a client. */
4096
+ type DefSources = Partial<Record<SourcedFacet, SchemaSource>>;
4097
+ /**
4098
+ * May `incoming` overwrite a facet `stored` last wrote? Never a weaker source over a stronger
4099
+ * one, so a re-derive cannot undo a person's edit. Equal rank may: an agent revises its own work.
4100
+ * An absent source is `auto`.
4101
+ */
4102
+ declare const mayOverwrite: (stored: SchemaSource | undefined, incoming: SchemaSource) => boolean;
4103
+ 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"];
4105
+ readonly build: readonly ["peer_missing", "kit_major_unsupported", "compile_error", "nondeterministic", "size_exceeded"];
4106
+ readonly protocol: readonly ["unsupported", "handshake_timeout", "origin_mismatch", "write_denied"];
4107
+ readonly runtime: readonly ["crashed", "blank", "csp_violation"];
4108
+ readonly policy: readonly ["confirmation_required", "flag_off"];
4109
+ };
4110
+ type UiRefusalFamily = keyof typeof UI_REFUSAL_CODES;
4111
+ type UiRefusal = {
4112
+ [F in UiRefusalFamily]: {
4113
+ family: F;
4114
+ code: (typeof UI_REFUSAL_CODES)[F][number];
4115
+ message: string;
4116
+ /** What it is about: a facet name, a field type, a path. */
4117
+ detail?: string;
4118
+ };
4119
+ }[UiRefusalFamily];
4120
+ /** `schema.depth_exceeded` */
4121
+ declare const uiRefusalId: (r: UiRefusal) => string;
4122
+ declare const isUiRefusal: (v: unknown) => v is UiRefusal;
4123
+ declare function canonicalJson(value: unknown): string;
4124
+
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 };
package/dist/index.js CHANGED
@@ -4550,8 +4550,152 @@ function planSections(slots, blocks) {
4550
4550
  });
4551
4551
  return out;
4552
4552
  }
4553
+
4554
+ // src/kit-v2.ts
4555
+ var TAB_MAX = 8;
4556
+ var SEGMENTED_MIN = 2;
4557
+ var SEGMENTED_MAX = 8;
4558
+ var DEPTH_MAX = 10;
4559
+ var HELP_CAPS = {
4560
+ field: 500,
4561
+ prop: 200,
4562
+ placeholder: 120,
4563
+ helpMore: 2e3,
4564
+ option: OPTION_DESCRIPTION_MAX,
4565
+ fieldset: 500,
4566
+ propGroup: 200
4567
+ };
4568
+ var SLOT_SETTINGS_MAX = 12;
4569
+ var SLOT_SETTINGS_TYPES = [
4570
+ "text",
4571
+ "slug",
4572
+ "select",
4573
+ "multiselect",
4574
+ "number",
4575
+ "rating",
4576
+ "date",
4577
+ "datetime",
4578
+ "boolean",
4579
+ "color",
4580
+ "icon",
4581
+ "link"
4582
+ ];
4583
+ var BLOCK_FIELD_TYPES = [
4584
+ "text",
4585
+ "longtext",
4586
+ "richtext",
4587
+ "image",
4588
+ "link",
4589
+ "slug",
4590
+ "email",
4591
+ "phone",
4592
+ "color",
4593
+ "select",
4594
+ "number",
4595
+ "rating",
4596
+ "date",
4597
+ "datetime",
4598
+ "boolean",
4599
+ "video",
4600
+ "object",
4601
+ "array",
4602
+ "reference",
4603
+ "file",
4604
+ "tags"
4605
+ ];
4606
+ var BLOCK_FIELD_TYPES_RENDERABLE_NOW = [
4607
+ "text",
4608
+ "longtext",
4609
+ "richtext",
4610
+ "image",
4611
+ "link",
4612
+ "slug",
4613
+ "email",
4614
+ "phone",
4615
+ "color",
4616
+ "select",
4617
+ "number",
4618
+ "rating",
4619
+ "date",
4620
+ "datetime",
4621
+ "boolean"
4622
+ ];
4623
+ var V2_SHAPES = ["block", "page", "entry", "global", "object"];
4624
+ var V2_PLACEMENTS = ["inline", "section", "page"];
4625
+ var KIT_CATEGORIES = [
4626
+ "Navigation & chrome",
4627
+ "Heroes",
4628
+ "Features & storytelling",
4629
+ "Social proof",
4630
+ "Media & galleries",
4631
+ "Commerce",
4632
+ "Pricing & plans",
4633
+ "Conversion & forms",
4634
+ "Listings & feeds",
4635
+ "Long-form & docs",
4636
+ "Company & people",
4637
+ "Events & places",
4638
+ "Data & interactive",
4639
+ "Advanced patterns"
4640
+ ];
4641
+ var V2_KEYS = {
4642
+ components: ["shape", "placement"],
4643
+ content_models: ["shape", "placement", "category", "variants"],
4644
+ component_variant_groups: ["variants"]
4645
+ };
4646
+ var SOURCE_RANK = { auto: 0, site: 1, agent: 2, human: 3 };
4647
+ var mayOverwrite = (stored, incoming) => SOURCE_RANK[incoming] >= SOURCE_RANK[stored ?? "auto"];
4648
+ var UI_REFUSAL_CODES = {
4649
+ schema: [
4650
+ "facet_unclassified",
4651
+ "excluded_facet",
4652
+ "depth_exceeded",
4653
+ "validation_failed",
4654
+ "hash_mismatch",
4655
+ "shape_kind_mismatch",
4656
+ "block_field_unrenderable"
4657
+ ],
4658
+ build: ["peer_missing", "kit_major_unsupported", "compile_error", "nondeterministic", "size_exceeded"],
4659
+ protocol: ["unsupported", "handshake_timeout", "origin_mismatch", "write_denied"],
4660
+ runtime: ["crashed", "blank", "csp_violation"],
4661
+ policy: ["confirmation_required", "flag_off"]
4662
+ };
4663
+ var uiRefusalId = (r) => `${r.family}.${r.code}`;
4664
+ var isUiRefusal = (v) => {
4665
+ if (typeof v !== "object" || v === null) return false;
4666
+ const { family, code, message } = v;
4667
+ return typeof family === "string" && Object.hasOwn(UI_REFUSAL_CODES, family) && UI_REFUSAL_CODES[family].includes(code) && typeof message === "string";
4668
+ };
4669
+ function canonicalNumber(value) {
4670
+ if (!Number.isFinite(value)) throw new TypeError("Canonical JSON only supports finite numbers");
4671
+ if (Object.is(value, -0)) return "0";
4672
+ const encoded = JSON.stringify(value);
4673
+ const scientific = /^(-?)(\d+)(?:\.(\d+))?[eE]([+-]?\d+)$/.exec(encoded);
4674
+ if (!scientific) return encoded;
4675
+ const [, sign, integer, fraction = "", exponentText] = scientific;
4676
+ const digits = `${integer}${fraction}`;
4677
+ const decimalPoint = integer.length + Number(exponentText);
4678
+ if (decimalPoint <= 0) return `${sign}0.${"0".repeat(-decimalPoint)}${digits}`;
4679
+ if (decimalPoint >= digits.length) return `${sign}${digits}${"0".repeat(decimalPoint - digits.length)}`;
4680
+ return `${sign}${digits.slice(0, decimalPoint)}.${digits.slice(decimalPoint)}`;
4681
+ }
4682
+ var skipped = (v) => v === void 0 || typeof v === "function" || typeof v === "symbol";
4683
+ function canonicalJson(value) {
4684
+ if (value === null) return "null";
4685
+ if (typeof value === "number") return canonicalNumber(value);
4686
+ if (typeof value === "string" || typeof value === "boolean") return JSON.stringify(value);
4687
+ if (Array.isArray(value)) return `[${value.map((child) => skipped(child) ? "null" : canonicalJson(child)).join(",")}]`;
4688
+ if (typeof value === "object") {
4689
+ const record = value;
4690
+ const keys = Object.keys(record).filter((key) => !skipped(record[key])).sort();
4691
+ return `{${keys.map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(",")}}`;
4692
+ }
4693
+ throw new TypeError(`Unsupported canonical JSON value: ${typeof value}`);
4694
+ }
4553
4695
  export {
4554
4696
  BLOCK_BINDINGS,
4697
+ BLOCK_FIELD_TYPES,
4698
+ BLOCK_FIELD_TYPES_RENDERABLE_NOW,
4555
4699
  BODY_SCHEMA_ORIGINS,
4556
4700
  BREAKPOINTS,
4557
4701
  BUTTON_ACTIONS,
@@ -4566,6 +4710,7 @@ export {
4566
4710
  CODE_SLOT_PREFIX,
4567
4711
  COMPONENT_PROP_TYPES,
4568
4712
  CONTROL_HELP,
4713
+ DEPTH_MAX,
4569
4714
  DIALOG_SELECTOR,
4570
4715
  DOCK_BUDGET,
4571
4716
  DOCK_ICON_NAMES,
@@ -4573,9 +4718,11 @@ export {
4573
4718
  FIELD_SIZE_ZOOM,
4574
4719
  FIELD_STYLE_KEYS,
4575
4720
  FOOTER_SECTION_ID,
4721
+ HELP_CAPS,
4576
4722
  HELP_MAX,
4577
4723
  IMAGE_ASPECTS,
4578
4724
  IMAGE_FRAME_RADIUS,
4725
+ KIT_CATEGORIES,
4579
4726
  LANDMARK_SELECTOR,
4580
4727
  LAYOUT_SECTION_ICONS,
4581
4728
  LAYOUT_SECTION_ICON_SET,
@@ -4592,18 +4739,28 @@ export {
4592
4739
  ROLE_KEYS,
4593
4740
  SECTION_DOCTRINE,
4594
4741
  SECTION_SPACE_TOKENS,
4742
+ SEGMENTED_MAX,
4743
+ SEGMENTED_MIN,
4595
4744
  SIDE_SPACE_MIN_PX,
4596
4745
  SIDE_SPACE_TOKENS,
4597
4746
  SLOT_CHILD_KEYS,
4598
4747
  SLOT_ITEMS_CAP,
4599
4748
  SLOT_MAX_ITEMS,
4749
+ SLOT_SETTINGS_MAX,
4750
+ SLOT_SETTINGS_TYPES,
4751
+ SOURCE_RANK,
4600
4752
  SPACE_BOTTOM_TOKENS,
4601
4753
  SPACE_STEP_TOKENS,
4602
4754
  TABLE_COLUMN_TYPES,
4603
4755
  TABLE_JSONLD_TYPES,
4604
4756
  TABLE_LIMITS,
4605
4757
  TABLE_RESPONSIVE,
4758
+ TAB_MAX,
4606
4759
  TAG_HEADS,
4760
+ UI_REFUSAL_CODES,
4761
+ V2_KEYS,
4762
+ V2_PLACEMENTS,
4763
+ V2_SHAPES,
4607
4764
  VIDEO_TRANSCRIPT_MAX,
4608
4765
  VIDEO_VALUE_KEYS,
4609
4766
  allowRuleOf,
@@ -4623,6 +4780,7 @@ export {
4623
4780
  buttonValueProblem,
4624
4781
  buttonVariantOf,
4625
4782
  candidateRole,
4783
+ canonicalJson,
4626
4784
  componentInstanceAddresses,
4627
4785
  componentPropTargetKey,
4628
4786
  derivedPairs,
@@ -4651,6 +4809,7 @@ export {
4651
4809
  isScriptHref,
4652
4810
  isSlotChild,
4653
4811
  isTableValue,
4812
+ isUiRefusal,
4654
4813
  keyWords,
4655
4814
  landmarkRegions,
4656
4815
  linkAnchorOf,
@@ -4659,6 +4818,7 @@ export {
4659
4818
  linkValueProblem,
4660
4819
  locatorFor,
4661
4820
  locatorPath,
4821
+ mayOverwrite,
4662
4822
  normalizeLinkValue,
4663
4823
  normalizeTableValue,
4664
4824
  normalizeWindow,
@@ -4690,6 +4850,7 @@ export {
4690
4850
  tableToMarkdown,
4691
4851
  tableValueProblems,
4692
4852
  topFieldKeyOf,
4853
+ uiRefusalId,
4693
4854
  usesHideOn,
4694
4855
  videoUrlOf,
4695
4856
  videoValueProblem,