/** * Highlighted Config Utility * * Creates a Puck config wrapper that adds visual diff highlighting to components. * * All visual styling uses inline React styles. BEM class names are retained * as secondary identifiers for DOM querying and test assertions. */ import type { BadgeColor } from '@pantheon-systems/pds-toolkit-react'; import type { ComponentDiffWithPosition } from '../../core/types.js'; /** * Puck Config structure (flexible to accept Puck's Config type) */ export type PuckConfig = Record; export declare const BADGE_TOP_OVERHANG = 11; export type CherryPickDecisionStatus = 'undecided' | 'live' | 'workstream' | 'combined'; export declare const CHERRY_PICK_BADGE_LABEL: Record; export declare const CHERRY_PICK_BADGE_COLOR: Record; /** * Creates a map of component IDs to their diff types. */ export declare function createDiffMap(diffs: ComponentDiffWithPosition[]): Map; /** * Whether a component would get a diff badge if rendered through * {@link createHighlightedConfig} for the given side. Exposed so callers * that need to know this ahead of the actual render — e.g. to decide * whether to reserve badge overhang space for the topmost block — reuse the * same rule instead of re-deriving it. * * @param diffMap - Map of component IDs to their diff types * @param id - The component ID to check, if known * @param side - Which side of the comparison ('before' shows removed/modified, 'after' shows added/modified) */ export declare function hasDiffBadge(diffMap: Map, id: string | undefined, side: 'before' | 'after'): boolean; /** * Wraps a Puck config to add diff highlighting to rendered components. * * @param config - The original Puck config * @param diffMap - Map of component IDs to their diff types * @param side - Which side of the comparison ('before' shows removed/modified, 'after' shows added/modified) * @returns A new config with wrapped render functions that add visual highlighting */ export declare function createHighlightedConfig(config: PuckConfig, diffMap: Map, side: 'before' | 'after'): PuckConfig; /** * Wraps a Puck config so each component with a cherry-pick decision shows a * dashed "Decide" box (undecided) or a solid resolved box labeled with the * chosen side ("Live"/"Workstream"). Components with no entry in * `decisionMap` (auto-merged, no choice needed) render unmodified. * * @param config - The original Puck config * @param decisionMap - Map of component IDs to their cherry-pick decision status * @param selectedId - Component whose rail card was just clicked, if any — an * undecided box gets a focus border; a resolved box keeps its side's border * and gets a matching tint. */ export declare function createCherryPickConfig(config: PuckConfig, decisionMap: Map, selectedId?: string | null): PuckConfig; /** * Creates a highlighted config for viewing historical versions. * Shows what has changed between the historical version and the current version. * * When viewing an old version: * - Removed components (in old but not current) are shown with red highlight * - Modified components are shown with yellow highlight * - Added components (in current but not old) are not shown (they don't exist in old version) * * @param config - The original Puck config * @param diffs - Array of component diffs * @returns A new config with diff highlighting for the 'before' side */ export declare function createHistoricalVersionConfig(config: PuckConfig, diffs: ComponentDiffWithPosition[]): PuckConfig;