UNPKG

@activecollab/components

Version:

ActiveCollab Components

108 lines 3.68 kB
import { ElementType, ReactElement } from "react"; type StageState = "done" | "progress" | "failed" | "todo"; interface Stage { name: string; state: StageState; details: string[]; } interface HistoryEvent { icon: ElementType; title: string; detail?: string; /** Actor, when the event has one (build / deploy events don't). */ author?: string; /** Minutes since the event — rendered via the Ago formatter; also drives the newest-first ordering of the stream. */ minutesAgo: number; tone?: "success" | "danger" | "progress" | "neutral"; } /** A VCS issue. Weakly referenced by any number of branches / PRs. */ interface IssueEntry { ref: string; title: string; repo: string; repoFull: string; state: "open" | "closed"; updatedLabel: string; /** Minutes since last update — used for chronological ordering. */ updatedMinsAgo: number; } type CodeStatus = "open" | "merged" | "closed" | "deleted"; /** A branch or pull request read from the VCS. */ interface CodeEntry { kind: "pr" | "branch"; title: string; repo: string; repoFull: string; status: CodeStatus; /** PR head → base branches, shown under the name in the history dialog. */ sourceBranch?: string; targetBranch?: string; /** True when this PR carries a closing keyword that will complete the task on merge. */ closing?: boolean; /** Head SHA of the source branch (full); first 8 chars are shown. */ headSha: string; contributors: { initials: string; bg: string; }[]; commits: { value: number; tip: string; }; diff?: { add: number; del: number; tip: string; }; comments?: { value: number; tip: string; }; noPrLabel?: string; updatedLabel: string; updatedMinsAgo: number; /** Issues this branch / PR references — weak, and possibly many. */ references: string[]; stages: Stage[]; pipelineSupported: boolean; history: HistoryEvent[]; } declare const Spine: ({ items, onClick, }: { items: Stage[]; onClick: () => void; }) => ReactElement; declare const HistoryDialog: ({ entry, onClose, }: { entry: CodeEntry | null; onClose: () => void; }) => ReactElement; declare const IssueRow: ({ issue }: { issue: IssueEntry; }) => ReactElement; declare const CodeRow: ({ entry, onOpenHistory, }: { entry: CodeEntry; onOpenHistory: () => void; }) => ReactElement; declare const CompletedHeader: ({ expanded, count, onToggle, }: { expanded: boolean; count: number; onToggle: () => void; }) => ReactElement; type SectionVariant = "mix" | "open" | "completed"; declare const SourceCodeSection: ({ variant, issues, code, showHeader, showLink, flush, }: { variant?: SectionVariant; /** Optional per-task data. Defaults to the built-in demo mix so the existing Task Source stories are unchanged. The Tasks List column passes a task's own linked elements so the dialog matches the row. */ issues?: IssueEntry[]; code?: CodeEntry[]; /** The dialog gives its own "Source Code" title, so it hides this header. */ showHeader?: boolean; /** The read-only Source Code dialog hides the "Link" action. */ showLink?: boolean; /** Remove the section's outer spacing and bottom rule (used in the dialog). */ flush?: boolean; }) => ReactElement; export type { StageState, Stage, HistoryEvent, IssueEntry, CodeStatus, CodeEntry, SectionVariant, }; export { Spine, HistoryDialog, IssueRow, CodeRow, CompletedHeader, SourceCodeSection, }; //# sourceMappingURL=SourceCodeSection.d.ts.map