import { F as FieldDefinition, S as SdkCustomBlock } from './schema-Bpy9N5ZI.js';
import { B as BlockKind } from './blockKinds-B6MWzNWp.js';

/**
 * SDK Content Scaffolding Types
 *
 * These types define the schema for SDK content configuration that allows
 * SDK sites to define content types, pages, entries, and navigation in code.
 */

/**
 * Content type definition for SDK config.
 *
 * Defines the structure of a content type that SDK sites can declare.
 * When pushed, the dashboard will ensure this content type exists.
 *
 * @example
 * ```typescript
 * {
 *   key: 'testimonial',
 *   name: 'Testimonial',
 *   hasPages: false,
 *   fields: [
 *     { id: 'quote', type: 'richText', label: 'Quote', required: true },
 *     { id: 'author', type: 'text', label: 'Author', required: true },
 *   ],
 * }
 * ```
 */
interface ContentTypeConfig {
    /** Unique key for this content type (e.g., 'post', 'event'). Must be lowercase with hyphens. */
    key: string;
    /** Display name shown in dashboard UI */
    name: string;
    /** Optional description */
    description?: string;
    /** Whether entries of this type have routable pages */
    hasPages: boolean;
    /** Route pattern with {slug} placeholder. Required if hasPages=true. */
    routePattern?: string;
    /** Field definitions for this content type */
    fields: FieldDefinition[];
    /** Field ID to use as the entry title source */
    titleField?: string;
}
/**
 * Block content for page scaffolding.
 *
 * Represents initial block content that can be added to SDK-defined pages.
 */
interface BlockConfig {
    /** Block kind (e.g., 'block.hero', 'block.bodyText', 'custom.myBlock') */
    kind: BlockKind;
    /** Block content data matching the block's field definitions */
    content: Record<string, unknown>;
    /** Order index (optional, defaults to array position) */
    orderIndex?: number;
}
/**
 * Page definition for SDK config.
 *
 * Defines a page that should exist on the site.
 * When pushed, the dashboard will ensure this page exists.
 *
 * @example
 * ```typescript
 * {
 *   identifier: 'home',
 *   title: 'Home',
 *   path: '/',
 *   status: 'published',
 *   blocks: [
 *     { kind: 'block.hero', content: { heading: 'Welcome' } },
 *   ],
 * }
 * ```
 */
interface PageConfig {
    /** Unique identifier for this page. Required for SDK sync. */
    identifier: string;
    /** Page title */
    title: string;
    /** URL path (e.g., '/', '/about', '/contact'). Must start with /. */
    path: string;
    /** Page purpose (default: 'content') */
    purpose?: string;
    /** Initial block content (optional) */
    blocks?: BlockConfig[];
    /** Status: 'draft' or 'published' (default: 'draft') */
    status?: 'draft' | 'published';
    /** SEO meta title */
    metaTitle?: string;
    /** SEO meta description */
    metaDescription?: string;
}
/**
 * Content entry definition for SDK config.
 *
 * Defines a content entry that should exist.
 * When pushed, the dashboard will ensure this entry exists.
 *
 * @example
 * ```typescript
 * {
 *   identifier: 'testimonial-1',
 *   contentType: 'testimonial',
 *   title: 'First Testimonial',
 *   status: 'published',
 *   data: {
 *     quote: '<p>Great product!</p>',
 *     author: 'Jane Doe',
 *   },
 * }
 * ```
 */
interface EntryConfig {
    /** Unique identifier for this entry. Required for SDK sync. */
    identifier: string;
    /** Content type key this entry belongs to */
    contentType: string;
    /** Entry data matching the content type's field definitions */
    data: Record<string, unknown>;
    /** Status: 'draft' or 'published' (default: 'draft') */
    status?: 'draft' | 'published';
    /** Slug for routable entries. Defaults to identifier if content type hasPages. */
    slug?: string;
    /** Title for the entry (used in route metadata if routable) */
    title?: string;
    /** Summary/description */
    summary?: string;
    /** SEO meta title */
    metaTitle?: string;
    /** SEO meta description */
    metaDescription?: string;
}
/**
 * Navigation link types for menu items.
 */
type NavigationLinkType = {
    kind: 'page';
    identifier: string;
} | {
    kind: 'entry';
    identifier: string;
} | {
    kind: 'external';
    href: string;
} | {
    kind: 'dropdown';
};
/**
 * Navigation item definition.
 *
 * @example
 * ```typescript
 * {
 *   label: 'Products',
 *   link: { kind: 'dropdown' },
 *   children: [
 *     { label: 'Product 1', link: { kind: 'page', identifier: 'product-1' } },
 *   ],
 * }
 * ```
 */
interface NavigationItemConfig {
    /** Display label */
    label: string;
    /** Link configuration */
    link: NavigationLinkType;
    /** Is this a CTA button? */
    isCta?: boolean;
    /** Child items (for dropdown menus, max 1 level) */
    children?: NavigationItemConfig[];
}
/**
 * Navigation menu definition.
 *
 * @example
 * ```typescript
 * {
 *   identifier: 'main',
 *   name: 'Main Navigation',
 *   isPrimary: true,
 *   items: [
 *     { label: 'Home', link: { kind: 'page', identifier: 'home' } },
 *     { label: 'About', link: { kind: 'page', identifier: 'about' } },
 *   ],
 * }
 * ```
 */
interface NavigationMenuConfig {
    /** Unique identifier for this menu */
    identifier: string;
    /** Menu display name */
    name: string;
    /** Is this the primary/main menu? */
    isPrimary?: boolean;
    /** Menu items */
    items: NavigationItemConfig[];
}
/**
 * Site settings for SDK config.
 */
interface SiteSettingsConfig {
    /** Homepage path (default: '/') */
    homepagePath?: string;
    /** Site title (for SEO/metadata) */
    siteTitle?: string;
    /** Site description (for SEO/metadata) */
    siteDescription?: string;
    /** Default template ID per content type key */
    defaultTemplates?: Record<string, string>;
}
/**
 * Complete content configuration for SDK sites.
 *
 * This is imported into riverbank.config.ts via the `content` field.
 *
 * @example
 * ```typescript
 * // content.config.ts
 * import { defineContentConfig } from '@riverbankcms/sdk/config';
 *
 * export const contentConfig = defineContentConfig({
 *   contentTypes: [...],
 *   pages: [...],
 *   entries: [...],
 *   navigationMenus: [...],
 *   settings: {...},
 * });
 * ```
 */
interface ContentConfig {
    /** Content type definitions */
    contentTypes?: ContentTypeConfig[];
    /** Content entries */
    entries?: EntryConfig[];
    /** Page definitions */
    pages?: PageConfig[];
    /** Navigation menus */
    navigationMenus?: NavigationMenuConfig[];
    /** Site settings */
    settings?: SiteSettingsConfig;
}

/**
 * SDK Site Configuration Types
 *
 * These types define the schema for SDK site configuration that can be
 * declared in code and exposed to the dashboard via /.builder/config.
 */

/**
 * SDK-defined theme palette.
 *
 * SDK sites define their own color palette with semantic token names.
 * These tokens can then be referenced in style configurations.
 *
 * @example
 * ```typescript
 * palette: {
 *   primary: '#6d28d9',
 *   secondary: '#4c1d95',
 *   accent: '#FF007F',
 *   highlight: '#facc15',
 * }
 * ```
 */
type SdkThemePalette = Record<string, string>;
/**
 * SDK-defined theme configuration.
 *
 * This allows SDK sites to define their own theme that's used for
 * token resolution in the editor and at render time.
 */
interface SdkThemeConfig {
    /**
     * Color palette mapping token names to CSS color values.
     * Token names are arbitrary and defined by the SDK site.
     */
    palette: SdkThemePalette;
}
/**
 * Allowed spacing values in section styles.
 */
type SectionSpacing = 'compact' | 'default' | 'spacious';
/**
 * Allowed container max-width values.
 */
type ContainerMaxWidth = 'narrow' | 'default' | 'wide' | 'full';
/**
 * Allowed container alignment values.
 */
type ContainerAlignment = 'left' | 'center' | 'right';
/**
 * A curated background color option for section styles.
 *
 * @example
 * ```typescript
 * sectionBackgrounds: [
 *   { id: 'primary', label: 'Purple', token: 'primary' },
 *   { id: 'accent', label: 'Pink', token: 'accent' },
 * ]
 * ```
 */
interface SectionBackground {
    /** Unique identifier for this background option */
    id: string;
    /** Display name shown in the editor UI */
    label: string;
    /** Reference to a token in the theme palette */
    token: string;
}
/**
 * Configuration for which section style options are available.
 *
 * Each option can be:
 * - `false`: Hide the option entirely from the editor
 * - `true`: Show all supported values for that option
 * - Array: Show only the specified values (for options that support arrays)
 */
interface SectionOptionsConfig {
    /** Enable/disable background color selection */
    backgroundColor?: boolean;
    /** Enable/disable background image selection */
    backgroundImage?: boolean;
    /** Enable/disable background gradient selection */
    backgroundGradient?: boolean;
    /** Control available spacing values, or disable entirely */
    spacing?: SectionSpacing[] | boolean;
    /** Enable/disable text color selection */
    textColor?: boolean;
}
/**
 * Configuration for which container style options are available.
 *
 * Each option can be:
 * - `false`: Hide the option entirely from the editor
 * - `true`: Show all supported values for that option
 * - Array: Show only the specified values
 */
interface ContainerOptionsConfig {
    /** Control available max-width values, or disable entirely */
    maxWidth?: ContainerMaxWidth[] | boolean;
    /** Control available alignment values, or disable entirely */
    alignment?: ContainerAlignment[] | boolean;
}
/**
 * Site-level style configuration for SDK sites.
 *
 * This allows SDK sites to curate which styling options are available
 * to editors in the section styles panel.
 */
interface SiteStyleConfig {
    /**
     * Curated list of background colors available in section styles.
     * If not specified, falls back to theme colors (current behavior).
     */
    sectionBackgrounds?: SectionBackground[];
    /**
     * Which section style options are enabled.
     * Options not listed or set to false are hidden from editors.
     */
    sectionOptions?: SectionOptionsConfig;
    /**
     * Container style constraints.
     */
    containerOptions?: ContainerOptionsConfig;
}
/**
 * A select option for SDK-provided field options.
 */
interface FieldSelectOption {
    /** The value stored when this option is selected */
    value: string;
    /** Display label shown in the dropdown */
    label: string;
}
/**
 * Configuration for a specific field within a block.
 *
 * Currently supports overriding select options, but designed
 * for future extensions (defaultValue, required, etc.).
 */
interface BlockFieldConfig {
    /** Override select options for this field */
    options?: FieldSelectOption[];
}
/**
 * Per-block field configurations.
 *
 * Maps block IDs to field configurations, where each field config
 * is keyed by field ID.
 *
 * @example
 * ```typescript
 * {
 *   'block.embed': {
 *     layout: {
 *       options: [
 *         { value: 'showcase', label: 'Showcase Grid' },
 *         { value: 'list', label: 'Simple List' },
 *       ]
 *     }
 *   }
 * }
 * ```
 */
type BlockFieldOptionsMap = Record<string, Record<string, BlockFieldConfig>>;
/**
 * Configuration for extending a built-in block with additional fields.
 *
 * @example
 * ```typescript
 * {
 *   fields: [
 *     {
 *       id: 'layout',
 *       type: 'select',
 *       label: 'Layout',
 *       options: [
 *         { value: 'default', label: 'Default' },
 *         { value: 'wide', label: 'Wide' },
 *       ],
 *       defaultValue: 'default',
 *     },
 *   ],
 * }
 * ```
 */
interface BlockFieldExtension {
    /**
     * Additional fields to append to the block's form.
     * Uses the same field definition format as block manifests.
     * All field types are supported.
     *
     * Note: If a field is marked as `required: true`, it MUST have a `defaultValue`.
     * This ensures existing blocks without this field can still be edited.
     */
    fields: FieldDefinition[];
}
/**
 * Map of block IDs to their field extensions.
 * Block IDs must be system blocks (e.g., 'block.bodyText', 'block.hero').
 *
 * @example
 * ```typescript
 * {
 *   'block.bodyText': {
 *     fields: [
 *       { id: 'layout', type: 'select', label: 'Layout', ... },
 *     ],
 *   },
 *   'block.hero': {
 *     fields: [
 *       { id: 'videoBackground', type: 'media', label: 'Video Background', ... },
 *     ],
 *   },
 * }
 * ```
 */
type BlockFieldExtensionsMap = Record<string, BlockFieldExtension>;
/**
 * Top-level SDK site configuration.
 *
 * This is the complete configuration that SDK sites define in their
 * `riverbank.config.ts` file and expose via the `/.builder/config` endpoint.
 *
 * @example
 * ```typescript
 * // riverbank.config.ts
 * import { defineConfig } from '@riverbankcms/sdk/config';
 *
 * export default defineConfig({
 *   siteId: '123e4567-e89b-12d3-a456-426614174000',
 *   theme: {
 *     palette: {
 *       primary: '#6d28d9',
 *       secondary: '#4c1d95',
 *       accent: '#FF007F',
 *       highlight: '#facc15',
 *     },
 *   },
 *   styles: {
 *     sectionBackgrounds: [
 *       { id: 'primary', label: 'Purple', token: 'primary' },
 *       { id: 'accent', label: 'Pink', token: 'accent' },
 *     ],
 *     sectionOptions: {
 *       backgroundColor: true,
 *       backgroundImage: false,
 *       spacing: ['compact', 'default', 'spacious'],
 *     },
 *   },
 *   blockFieldOptions: {
 *     'block.embed': {
 *       layout: {
 *         options: [
 *           { value: 'showcase', label: 'Showcase Grid' },
 *           { value: 'list', label: 'Simple List' },
 *         ]
 *       }
 *     }
 *   },
 * });
 * ```
 */
interface RiverbankSiteConfig {
    /** Site UUID from the dashboard - identifies which site this config belongs to */
    siteId: string;
    /** SDK-defined theme with color palette for token resolution */
    theme?: SdkThemeConfig;
    /** Style configuration for curating editor options */
    styles?: SiteStyleConfig;
    /**
     * Custom blocks defined by the SDK site.
     * These blocks appear in the block picker and are edited via CMS forms.
     * SDK sites MUST provide blockOverrides for rendering.
     */
    customBlocks?: SdkCustomBlock[];
    /**
     * Per-block field options.
     *
     * Allows SDK sites to define which options are available for specific
     * fields in specific blocks. Widgets with `ui.widget: 'sdkSelect'`
     * will use these options when available, falling back to field defaults.
     *
     * @example
     * ```typescript
     * blockFieldOptions: {
     *   'block.embed': {
     *     layout: {
     *       options: [
     *         { value: 'showcase', label: 'Showcase Grid' },
     *         { value: 'list', label: 'Simple List' },
     *       ]
     *     }
     *   }
     * }
     * ```
     */
    blockFieldOptions?: BlockFieldOptionsMap;
    /**
     * Per-block field extensions.
     *
     * Allows SDK sites to add custom fields to built-in block types.
     * Extended fields appear at the end of the block's editing form
     * and their values are accessible in `blockOverrides` via the `content` prop.
     *
     * Note: Extended field IDs must not conflict with existing block fields.
     * Required fields must have a `defaultValue` to support existing blocks.
     *
     * @example
     * ```typescript
     * blockFieldExtensions: {
     *   'block.bodyText': {
     *     fields: [
     *       {
     *         id: 'layout',
     *         type: 'select',
     *         label: 'Layout',
     *         options: [
     *           { value: 'default', label: 'Default' },
     *           { value: 'wide', label: 'Wide' },
     *         ],
     *         defaultValue: 'default',
     *       },
     *     ],
     *   },
     * }
     * ```
     */
    blockFieldExtensions?: BlockFieldExtensionsMap;
    /**
     * Content scaffolding configuration.
     *
     * Defines content types, pages, entries, and navigation menus that
     * should exist on the site. When SDK config is pushed, the dashboard
     * will ensure these items exist.
     *
     * @example
     * ```typescript
     * content: {
     *   contentTypes: [...],
     *   pages: [...],
     *   entries: [...],
     *   navigationMenus: [...],
     *   settings: { homepagePath: '/' },
     * }
     * ```
     */
    content?: ContentConfig;
}

export type { BlockFieldConfig as B, ContentConfig as C, EntryConfig as E, FieldSelectOption as F, NavigationMenuConfig as N, PageConfig as P, RiverbankSiteConfig as R, SiteStyleConfig as S, SectionBackground as a, SectionOptionsConfig as b, ContainerOptionsConfig as c, SectionSpacing as d, ContainerMaxWidth as e, ContainerAlignment as f, SdkThemeConfig as g, SdkThemePalette as h, BlockFieldOptionsMap as i, BlockFieldExtension as j, BlockFieldExtensionsMap as k, ContentTypeConfig as l, BlockConfig as m, NavigationItemConfig as n, NavigationLinkType as o, SiteSettingsConfig as p };
