executable-stories-react 0.1.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/README.md +238 -0
- package/dist/index.cjs +1021 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +202 -0
- package/dist/index.d.ts +202 -0
- package/dist/index.js +964 -0
- package/dist/index.js.map +1 -0
- package/dist/interactive.cjs +846 -0
- package/dist/interactive.cjs.map +1 -0
- package/dist/interactive.d.cts +116 -0
- package/dist/interactive.d.ts +116 -0
- package/dist/interactive.js +820 -0
- package/dist/interactive.js.map +1 -0
- package/dist/parse.cjs +495 -0
- package/dist/parse.cjs.map +1 -0
- package/dist/parse.d.cts +51 -0
- package/dist/parse.d.ts +51 -0
- package/dist/parse.js +464 -0
- package/dist/parse.js.map +1 -0
- package/dist/styles.css +244 -0
- package/package.json +84 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/context/ReportRoot.tsx","../src/context/ReportContext.ts","../src/hooks/useReport.ts","../src/components/ReportSummary.tsx","../src/components/doc/DocNote.tsx","../src/components/doc/DocTag.tsx","../src/components/doc/DocKv.tsx","../src/hooks/useRenderers.ts","../src/components/doc/DocCode.tsx","../src/components/doc/DocTable.tsx","../src/components/doc/DocLink.tsx","../src/components/doc/DocSection.tsx","../src/components/doc/DocMermaid.tsx","../src/components/doc/DocScreenshot.tsx","../src/components/doc/DocCustom.tsx","../src/components/doc/DocEntry.tsx","../src/components/ReportDocEntries.tsx","../src/components/ReportSteps.tsx","../src/components/ReportScenario.tsx","../src/components/ReportScenarioList.tsx","../src/components/ReportFeature.tsx","../src/components/ReportFeatureList.tsx","../src/components/ReportEmpty.tsx","../src/components/ReportSchemaError.tsx","../src/components/Report.tsx","../src/result.ts","../src/schema/story-report.schema.ts","../../executable-stories-formatters/schemas/story-report-v1.json","../src/schema/parse.ts"],"sourcesContent":["/**\n * executable-stories-react — public exports.\n *\n * Drop-in React renderer for StoryReport v1 JSON. Semantic, SSR-safe,\n * themeable via CSS variables. Import the stylesheet once in your root:\n *\n * import \"executable-stories-react/styles.css\";\n */\n\nexport { Report } from \"./components/Report\";\nexport type { ReportProps } from \"./components/Report\";\n\nexport { ReportRoot } from \"./context/ReportRoot\";\nexport type { ReportRootProps } from \"./context/ReportRoot\";\n\nexport { ReportSummary, ReportSummaryView } from \"./components/ReportSummary\";\nexport type { ReportSummaryProps, ReportSummaryViewProps } from \"./components/ReportSummary\";\n\nexport { ReportFeatureList } from \"./components/ReportFeatureList\";\nexport { ReportFeature } from \"./components/ReportFeature\";\nexport type { ReportFeatureProps } from \"./components/ReportFeature\";\n\nexport { ReportScenarioList } from \"./components/ReportScenarioList\";\nexport type { ReportScenarioListProps } from \"./components/ReportScenarioList\";\n\nexport { ReportScenario } from \"./components/ReportScenario\";\nexport type { ReportScenarioProps } from \"./components/ReportScenario\";\n\nexport { ReportSteps, ReportStepItem } from \"./components/ReportSteps\";\nexport type { ReportStepsProps } from \"./components/ReportSteps\";\n\nexport { ReportDocEntries } from \"./components/ReportDocEntries\";\nexport type { ReportDocEntriesProps } from \"./components/ReportDocEntries\";\n\nexport { DocEntry } from \"./components/doc/DocEntry\";\nexport { DocNote } from \"./components/doc/DocNote\";\nexport { DocTag } from \"./components/doc/DocTag\";\nexport { DocKv } from \"./components/doc/DocKv\";\nexport { DocCode } from \"./components/doc/DocCode\";\nexport { DocTable } from \"./components/doc/DocTable\";\nexport { DocLink } from \"./components/doc/DocLink\";\nexport { DocSection } from \"./components/doc/DocSection\";\nexport { DocMermaid } from \"./components/doc/DocMermaid\";\nexport { DocScreenshot } from \"./components/doc/DocScreenshot\";\nexport { DocCustom } from \"./components/doc/DocCustom\";\n\nexport { useCustomRenderers, useBuiltinRenderers } from \"./hooks/useRenderers\";\n\n// Interactive layer (client-only) lives under the dedicated entry point:\n// import { ReportInteractive } from \"executable-stories-react/interactive\";\n// That bundle ships with a top-of-file \"use client\" directive so Next.js\n// App Router recognizes it as a client component.\n\nexport type {\n CustomRenderer,\n CustomRenderers,\n BuiltinRenderers,\n} from \"./renderers\";\n\nexport { ReportEmpty } from \"./components/ReportEmpty\";\nexport type { ReportEmptyProps } from \"./components/ReportEmpty\";\n\nexport { ReportSchemaError } from \"./components/ReportSchemaError\";\nexport type { ReportSchemaErrorProps } from \"./components/ReportSchemaError\";\n\nexport { useReport } from \"./hooks/useReport\";\n\nexport { parseStoryReport } from \"./schema/parse\";\nexport { storyReportSchema, STORY_REPORT_SCHEMA_MAJOR } from \"./schema/story-report.schema\";\n\nexport type { Result, ReportParseError, ReportParseErrorCode } from \"./result\";\nexport { ok, err } from \"./result\";\n\nexport type {\n StoryReport,\n ReportFeature as StoryReportFeature,\n ReportScenario as StoryReportScenario,\n ReportStep as StoryReportStep,\n ReportDocEntry as StoryReportDocEntry,\n ReportSummary as StoryReportSummary,\n} from \"executable-stories-formatters\";\n","import { useMemo, type ReactNode } from \"react\";\nimport type { StoryReport } from \"executable-stories-formatters\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\nimport { ReportContext, type ReportContextValue } from \"./ReportContext\";\n\nexport interface ReportRootProps {\n report: StoryReport;\n customRenderers?: CustomRenderers;\n renderers?: BuiltinRenderers;\n children: ReactNode;\n}\n\nconst EMPTY_CUSTOM: CustomRenderers = {};\nconst EMPTY_RENDERERS: BuiltinRenderers = {};\n\nexport function ReportRoot({\n report,\n customRenderers,\n renderers,\n children,\n}: ReportRootProps) {\n const value = useMemo<ReportContextValue>(\n () => ({\n report,\n customRenderers: customRenderers ?? EMPTY_CUSTOM,\n renderers: renderers ?? EMPTY_RENDERERS,\n }),\n [report, customRenderers, renderers],\n );\n return <ReportContext.Provider value={value}>{children}</ReportContext.Provider>;\n}\n","import { createContext } from \"react\";\nimport type { StoryReport } from \"executable-stories-formatters\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\n\nexport interface ReportContextValue {\n report: StoryReport;\n customRenderers: CustomRenderers;\n renderers: BuiltinRenderers;\n}\n\nexport const ReportContext = createContext<ReportContextValue | null>(null);\n","import { useContext } from \"react\";\nimport { ReportContext } from \"../context/ReportContext\";\n\nexport function useReport() {\n const ctx = useContext(ReportContext);\n if (!ctx) {\n throw new Error(\n \"useReport must be used inside <ReportRoot> or <Report>. Wrap your tree with one of those.\",\n );\n }\n return ctx.report;\n}\n","import type { ReportSummary as ReportSummaryT } from \"executable-stories-formatters\";\nimport { useReport } from \"../hooks/useReport\";\n\nexport interface ReportSummaryProps {\n className?: string;\n}\n\nexport function ReportSummary({ className }: ReportSummaryProps) {\n const report = useReport();\n return (\n <ReportSummaryView\n summary={report.summary}\n {...(className !== undefined && { className })}\n ariaLabel=\"Run summary\"\n />\n );\n}\n\nexport interface ReportSummaryViewProps {\n summary: ReportSummaryT;\n className?: string;\n ariaLabel?: string;\n}\n\nexport function ReportSummaryView({ summary, className, ariaLabel }: ReportSummaryViewProps) {\n return (\n <p\n className={[\"es-report-summary\", className].filter(Boolean).join(\" \")}\n aria-label={ariaLabel}\n >\n <span>\n <strong>{summary.total}</strong> scenario{summary.total === 1 ? \"\" : \"s\"}\n </span>\n {\" · \"}\n <span data-status=\"passed\">{summary.passed} passed</span>\n {\" · \"}\n <span data-status=\"failed\">{summary.failed} failed</span>\n {summary.skipped > 0 ? (\n <>\n {\" · \"}\n <span data-status=\"skipped\">{summary.skipped} skipped</span>\n </>\n ) : null}\n {summary.pending > 0 ? (\n <>\n {\" · \"}\n <span data-status=\"pending\">{summary.pending} pending</span>\n </>\n ) : null}\n </p>\n );\n}\n","import type { ReportDocNote } from \"executable-stories-formatters\";\n\nexport function DocNote({ entry }: { entry: ReportDocNote }) {\n return <p className=\"es-doc es-doc-note\">{entry.text}</p>;\n}\n","import type { ReportDocTag } from \"executable-stories-formatters\";\n\nexport function DocTag({ entry }: { entry: ReportDocTag }) {\n return (\n <ul className=\"es-doc es-tags\" aria-label=\"Tags\">\n {entry.names.map((n) => (\n <li key={n}>{n}</li>\n ))}\n </ul>\n );\n}\n","import type { ReportDocKv } from \"executable-stories-formatters\";\n\nfunction formatValue(value: unknown): string {\n if (value === null) return \"null\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\nexport function DocKv({ entry }: { entry: ReportDocKv }) {\n return (\n <dl className=\"es-doc es-doc-kv\">\n <dt>{entry.label}</dt>\n <dd>{formatValue(entry.value)}</dd>\n </dl>\n );\n}\n","import { useContext } from \"react\";\nimport { ReportContext } from \"../context/ReportContext\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\n\nconst EMPTY_CUSTOM: CustomRenderers = {};\nconst EMPTY_RENDERERS: BuiltinRenderers = {};\n\nexport function useCustomRenderers(): CustomRenderers {\n const ctx = useContext(ReportContext);\n return ctx?.customRenderers ?? EMPTY_CUSTOM;\n}\n\nexport function useBuiltinRenderers(): BuiltinRenderers {\n const ctx = useContext(ReportContext);\n return ctx?.renderers ?? EMPTY_RENDERERS;\n}\n","import type { ReportDocCode } from \"executable-stories-formatters\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\n\nexport function DocCode({ entry }: { entry: ReportDocCode }) {\n const renderers = useBuiltinRenderers();\n if (renderers.code) {\n return <>{renderers.code(entry)}</>;\n }\n return (\n <figure className=\"es-doc es-doc-code\">\n <figcaption>{entry.label}</figcaption>\n <pre>\n <code className={entry.lang ? `language-${entry.lang}` : undefined}>\n {entry.content}\n </code>\n </pre>\n </figure>\n );\n}\n","import type { ReportDocTable } from \"executable-stories-formatters\";\n\nexport function DocTable({ entry }: { entry: ReportDocTable }) {\n return (\n <figure className=\"es-doc es-doc-table\">\n <figcaption>{entry.label}</figcaption>\n <table>\n <thead>\n <tr>\n {entry.columns.map((c) => (\n <th key={c} scope=\"col\">{c}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {entry.rows.map((row, i) => (\n <tr key={i}>\n {row.map((cell, j) => (\n <td key={j}>{cell}</td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </figure>\n );\n}\n","import type { ReportDocLink } from \"executable-stories-formatters\";\n\nexport function DocLink({ entry }: { entry: ReportDocLink }) {\n return (\n <a\n className=\"es-doc es-doc-link\"\n href={entry.url}\n rel=\"noreferrer noopener\"\n target=\"_blank\"\n >\n {entry.label}\n </a>\n );\n}\n","import { marked } from \"marked\";\nimport type { ReportDocSection } from \"executable-stories-formatters\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\n\n/**\n * Strips the most common dangerous patterns from marked-generated HTML:\n * - <script>...</script> blocks\n * - <style>...</style> blocks\n * - on* event-handler attributes\n * - javascript: URLs on href / src\n *\n * Not a substitute for a full HTML sanitizer (DOMPurify, sanitize-html).\n * For high-untrust input, supply `renderers.section` with your own sanitizer.\n */\nfunction safeMarkdownHtml(markdown: string): string {\n const raw = marked.parse(markdown, { async: false }) as string;\n return raw\n .replace(/<script\\b[^>]*>[\\s\\S]*?<\\/script>/gi, \"\")\n .replace(/<style\\b[^>]*>[\\s\\S]*?<\\/style>/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*\"[^\"]*\"/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*'[^']*'/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*[^\\s>]+/gi, \"\")\n .replace(/(href|src)\\s*=\\s*\"\\s*javascript:[^\"]*\"/gi, '$1=\"#\"')\n .replace(/(href|src)\\s*=\\s*'\\s*javascript:[^']*'/gi, \"$1='#'\");\n}\n\nexport function DocSection({ entry }: { entry: ReportDocSection }) {\n const renderers = useBuiltinRenderers();\n if (renderers.section) {\n return <>{renderers.section(entry)}</>;\n }\n const html = safeMarkdownHtml(entry.markdown);\n return (\n <section className=\"es-doc es-doc-section\" aria-label={entry.title}>\n {entry.title ? <h4 className=\"es-doc-section-title\">{entry.title}</h4> : null}\n <div\n className=\"es-doc-section-content\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </section>\n );\n}\n","import type { ReportDocMermaid } from \"executable-stories-formatters\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\n\n/**\n * Renders mermaid source as a semantic <pre data-mermaid> by default.\n *\n * AI agents and screen readers get the raw source. To render the diagram\n * visually, supply a `renderers.mermaid` prop with a client-only component\n * (e.g., one that dynamically imports the mermaid library on mount).\n */\nexport function DocMermaid({ entry }: { entry: ReportDocMermaid }) {\n const renderers = useBuiltinRenderers();\n if (renderers.mermaid) {\n return <>{renderers.mermaid(entry)}</>;\n }\n return (\n <figure\n className=\"es-doc es-doc-mermaid\"\n aria-label={entry.title ?? \"Diagram\"}\n >\n {entry.title ? <figcaption>{entry.title}</figcaption> : null}\n <pre data-mermaid>{entry.code}</pre>\n </figure>\n );\n}\n","import type { ReportDocScreenshot } from \"executable-stories-formatters\";\n\nexport function DocScreenshot({ entry }: { entry: ReportDocScreenshot }) {\n return (\n <figure className=\"es-doc es-doc-screenshot\">\n <img src={entry.path} alt={entry.alt ?? \"\"} loading=\"lazy\" />\n {entry.alt ? <figcaption>{entry.alt}</figcaption> : null}\n </figure>\n );\n}\n","import type { ReportDocCustom } from \"executable-stories-formatters\";\nimport { useCustomRenderers } from \"../../hooks/useRenderers\";\n\nexport function DocCustom({ entry }: { entry: ReportDocCustom }) {\n const renderers = useCustomRenderers();\n const renderer = renderers[entry.type];\n if (renderer) {\n return <>{renderer(entry)}</>;\n }\n return (\n <div className=\"es-doc es-doc-custom\" data-type={entry.type}>\n <p className=\"es-doc-custom-type\">{entry.type}</p>\n <pre>{safeStringify(entry.data)}</pre>\n </div>\n );\n}\n\nfunction safeStringify(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n","import type { ReportDocEntry } from \"executable-stories-formatters\";\nimport { DocNote } from \"./DocNote\";\nimport { DocTag } from \"./DocTag\";\nimport { DocKv } from \"./DocKv\";\nimport { DocCode } from \"./DocCode\";\nimport { DocTable } from \"./DocTable\";\nimport { DocLink } from \"./DocLink\";\nimport { DocSection } from \"./DocSection\";\nimport { DocMermaid } from \"./DocMermaid\";\nimport { DocScreenshot } from \"./DocScreenshot\";\nimport { DocCustom } from \"./DocCustom\";\n\nexport function DocEntry({ entry }: { entry: ReportDocEntry }) {\n switch (entry.kind) {\n case \"note\":\n return <DocNote entry={entry} />;\n case \"tag\":\n return <DocTag entry={entry} />;\n case \"kv\":\n return <DocKv entry={entry} />;\n case \"code\":\n return <DocCode entry={entry} />;\n case \"table\":\n return <DocTable entry={entry} />;\n case \"link\":\n return <DocLink entry={entry} />;\n case \"section\":\n return <DocSection entry={entry} />;\n case \"mermaid\":\n return <DocMermaid entry={entry} />;\n case \"screenshot\":\n return <DocScreenshot entry={entry} />;\n case \"custom\":\n return <DocCustom entry={entry} />;\n }\n}\n","import type { ReportDocEntry } from \"executable-stories-formatters\";\nimport { DocEntry } from \"./doc/DocEntry\";\n\nexport interface ReportDocEntriesProps {\n entries: readonly ReportDocEntry[];\n}\n\nexport function ReportDocEntries({ entries }: ReportDocEntriesProps) {\n if (entries.length === 0) return null;\n return (\n <>\n {entries.map((entry, i) => (\n <DocEntry key={i} entry={entry} />\n ))}\n </>\n );\n}\n","import type { ReportStep, ReportScenario } from \"executable-stories-formatters\";\nimport { ReportDocEntries } from \"./ReportDocEntries\";\n\nexport interface ReportStepsProps {\n scenario: ReportScenario;\n}\n\nexport function ReportSteps({ scenario }: ReportStepsProps) {\n if (scenario.steps.length === 0) return null;\n return (\n <ol className=\"es-steps\">\n {scenario.steps.map((step) => (\n <ReportStepItem key={step.id} step={step} />\n ))}\n </ol>\n );\n}\n\nexport function ReportStepItem({ step }: { step: ReportStep }) {\n return (\n <li\n id={step.id}\n className={`es-step es-step-${step.status}`}\n data-status={step.status}\n >\n <span className=\"es-step-keyword\">{step.keyword}</span>\n <span className=\"es-step-text\">{step.text}</span>\n {step.errorMessage ? (\n <pre className=\"es-scenario-error\" role=\"alert\">{step.errorMessage}</pre>\n ) : null}\n {step.docEntries.length > 0 ? (\n <div className=\"es-step-docs\">\n <ReportDocEntries entries={step.docEntries} />\n </div>\n ) : null}\n </li>\n );\n}\n","import type { ReportScenario as ReportScenarioT } from \"executable-stories-formatters\";\nimport { ReportSteps } from \"./ReportSteps\";\nimport { ReportDocEntries } from \"./ReportDocEntries\";\n\nexport interface ReportScenarioProps {\n scenario: ReportScenarioT;\n}\n\nconst STATUS_LABEL: Record<ReportScenarioT[\"status\"], string> = {\n passed: \"Passed\",\n failed: \"Failed\",\n skipped: \"Skipped\",\n pending: \"Pending\",\n};\n\nexport function ReportScenario({ scenario }: ReportScenarioProps) {\n const titleId = `${scenario.id}-title`;\n return (\n <article\n id={scenario.id}\n className={`es-scenario es-status-${scenario.status}`}\n aria-labelledby={titleId}\n data-status={scenario.status}\n >\n <h3 id={titleId} className=\"es-scenario-title\">\n <span>{scenario.title}</span>\n <span className=\"es-scenario-status\" aria-label={`Status: ${STATUS_LABEL[scenario.status]}`}>\n {STATUS_LABEL[scenario.status]}\n </span>\n </h3>\n {scenario.tags.length > 0 ? (\n <ul className=\"es-tags\" aria-label=\"Tags\">\n {scenario.tags.map((t) => (\n <li key={t}>{t}</li>\n ))}\n </ul>\n ) : null}\n {scenario.errorMessage ? (\n <pre className=\"es-scenario-error\" role=\"alert\">{scenario.errorMessage}</pre>\n ) : null}\n {scenario.docEntries.length > 0 ? (\n <div className=\"es-scenario-docs\">\n <ReportDocEntries entries={scenario.docEntries} />\n </div>\n ) : null}\n <ReportSteps scenario={scenario} />\n </article>\n );\n}\n","import type { ReportFeature } from \"executable-stories-formatters\";\nimport { ReportScenario } from \"./ReportScenario\";\n\nexport interface ReportScenarioListProps {\n feature: ReportFeature;\n}\n\nexport function ReportScenarioList({ feature }: ReportScenarioListProps) {\n return (\n <>\n {feature.scenarios.map((scenario) => (\n <ReportScenario key={scenario.id} scenario={scenario} />\n ))}\n </>\n );\n}\n","import type { ReportFeature as ReportFeatureT } from \"executable-stories-formatters\";\nimport { ReportScenarioList } from \"./ReportScenarioList\";\nimport { ReportSummaryView } from \"./ReportSummary\";\n\nexport interface ReportFeatureProps {\n feature: ReportFeatureT;\n}\n\nexport function ReportFeature({ feature }: ReportFeatureProps) {\n const titleId = `${feature.id}-title`;\n return (\n <section\n id={feature.id}\n className=\"es-feature\"\n aria-labelledby={titleId}\n >\n <h2 id={titleId} className=\"es-feature-title\">{feature.title}</h2>\n <p className=\"es-feature-source\">{feature.sourceFile}</p>\n <ReportSummaryView summary={feature.summary} className=\"es-feature-summary\" />\n <ReportScenarioList feature={feature} />\n </section>\n );\n}\n","import { useReport } from \"../hooks/useReport\";\nimport { ReportFeature } from \"./ReportFeature\";\n\nexport function ReportFeatureList() {\n const report = useReport();\n return (\n <>\n {report.features.map((feature) => (\n <ReportFeature key={feature.id} feature={feature} />\n ))}\n </>\n );\n}\n","export interface ReportEmptyProps {\n message?: string;\n}\n\nexport function ReportEmpty({ message }: ReportEmptyProps) {\n return (\n <section className=\"es-empty\" aria-live=\"polite\">\n <p>{message ?? \"No scenarios in this report.\"}</p>\n </section>\n );\n}\n","import type { ReportParseError } from \"../result\";\n\nexport interface ReportSchemaErrorProps {\n error: ReportParseError;\n}\n\nexport function ReportSchemaError({ error }: ReportSchemaErrorProps) {\n return (\n <section className=\"es-schema-error\" role=\"alert\" aria-live=\"assertive\">\n <p>\n <strong>Report could not be displayed.</strong>\n </p>\n <p>{error.message}</p>\n {error.code === \"SCHEMA_VERSION_MISMATCH\" ? (\n <p>\n The report bundle is newer than this version of <code>executable-stories-react</code>.\n Upgrade the package, or regenerate the report with an older formatters CLI.\n </p>\n ) : null}\n {error.issues && error.issues.length > 0 ? (\n <details>\n <summary>{error.issues.length} validation issue{error.issues.length === 1 ? \"\" : \"s\"}</summary>\n <pre>\n {error.issues\n .slice(0, 20)\n .map((i) => `${i.path}: ${i.message}`)\n .join(\"\\n\")}\n </pre>\n </details>\n ) : null}\n </section>\n );\n}\n","import type { StoryReport } from \"executable-stories-formatters\";\nimport type { Result } from \"../result\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\nimport { ReportRoot } from \"../context/ReportRoot\";\nimport { ReportSummary } from \"./ReportSummary\";\nimport { ReportFeatureList } from \"./ReportFeatureList\";\nimport { ReportEmpty } from \"./ReportEmpty\";\nimport { ReportSchemaError } from \"./ReportSchemaError\";\n\nexport interface ReportProps {\n /** A StoryReport, or a Result-wrapped one (e.g., from parseStoryReport). */\n report: StoryReport | Result<StoryReport>;\n /** Renderers keyed by `story.custom({ type })` strings. */\n customRenderers?: CustomRenderers;\n /** Optional overrides for the heavy built-ins (mermaid, code, section). */\n renderers?: BuiltinRenderers;\n /** Optional class on the <main> landmark for layout positioning. */\n className?: string;\n /** Optional override title. */\n title?: string;\n /** Optional theme attribute scope. Use to force \"light\" or \"dark\". */\n dataTheme?: \"light\" | \"dark\";\n}\n\nfunction isResult(value: ReportProps[\"report\"]): value is Result<StoryReport> {\n return typeof value === \"object\"\n && value !== null\n && \"ok\" in (value as object)\n && typeof (value as { ok: unknown }).ok === \"boolean\";\n}\n\nexport function Report(props: ReportProps) {\n const { report, customRenderers, renderers, className, title, dataTheme } = props;\n if (isResult(report)) {\n if (!report.ok) {\n return (\n <main\n className={[\"es-report\", className].filter(Boolean).join(\" \")}\n aria-label={title ?? \"Test report\"}\n data-theme={dataTheme}\n >\n <ReportSchemaError error={report.error} />\n </main>\n );\n }\n return (\n <ReportView\n report={report.data}\n customRenderers={customRenderers}\n renderers={renderers}\n className={className}\n title={title}\n dataTheme={dataTheme}\n />\n );\n }\n return (\n <ReportView\n report={report}\n customRenderers={customRenderers}\n renderers={renderers}\n className={className}\n title={title}\n dataTheme={dataTheme}\n />\n );\n}\n\ninterface ReportViewProps {\n report: StoryReport;\n customRenderers?: CustomRenderers;\n renderers?: BuiltinRenderers;\n className?: string;\n title?: string;\n dataTheme?: \"light\" | \"dark\";\n}\n\nfunction ReportView({\n report,\n customRenderers,\n renderers,\n className,\n title,\n dataTheme,\n}: ReportViewProps) {\n const hasContent = report.features.length > 0;\n return (\n <ReportRoot report={report} customRenderers={customRenderers} renderers={renderers}>\n <main\n className={[\"es-report\", className].filter(Boolean).join(\" \")}\n aria-label={title ?? \"Test report\"}\n data-theme={dataTheme}\n >\n <header className=\"es-report-header\">\n <h1>{title ?? \"Story Report\"}</h1>\n <ReportSummary />\n </header>\n {hasContent ? <ReportFeatureList /> : <ReportEmpty />}\n </main>\n </ReportRoot>\n );\n}\n","/**\n * Result<T> — explicit success/error type matching the cookbook convention.\n *\n * Used at the boundary where a StoryReport is parsed: the consumer hands us\n * an unknown value (file contents, fetch body, prop) and we return a Result.\n */\n\nexport type Result<T, E = ReportParseError> =\n | { ok: true; data: T }\n | { ok: false; error: E };\n\nexport interface ReportParseError {\n message: string;\n code: ReportParseErrorCode;\n issues?: readonly { path: string; message: string }[];\n}\n\nexport type ReportParseErrorCode =\n | \"INVALID_INPUT\"\n | \"SCHEMA_VERSION_MISMATCH\"\n | \"VALIDATION_FAILED\";\n\nexport const ok = <T>(data: T): Result<T> => ({ ok: true, data });\nexport const err = (error: ReportParseError): Result<never> => ({ ok: false, error });\n","/**\n * StoryReport runtime Zod schema, derived from the canonical JSON Schema\n * at executable-stories-formatters/schemas/story-report-v1.json.\n *\n * Uses z.fromJSONSchema (experimental in Zod 4.x). If the API changes upstream,\n * only this file needs updating — the rest of the package consumes\n * `storyReportSchema` and `StoryReportSchemaShape` via parse.ts.\n *\n * The JSON Schema is bundled at build time by tsup (resolveJsonModule).\n */\n\nimport { z } from \"zod\";\nimport schemaJson from \"../../../executable-stories-formatters/schemas/story-report-v1.json\" with { type: \"json\" };\n\nconst compiled = z.fromJSONSchema(schemaJson as Parameters<typeof z.fromJSONSchema>[0]);\n\nexport const storyReportSchema = compiled;\nexport type StoryReportSchemaShape = z.infer<typeof compiled>;\n\nexport const STORY_REPORT_SCHEMA_MAJOR = 1 as const;\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://executable-stories.dev/schemas/story-report-v1.schema.json\",\n \"title\": \"StoryReport\",\n \"description\": \"Pre-grouped, denormalized report shape consumed by UI renderers (React, Svelte, Vue, etc.). Stable public contract — additive-only within a major. Distinct from internal TestRunResult.\",\n \"type\": \"object\",\n \"$ref\": \"#/$defs/StoryReport\",\n \"$defs\": {\n \"StoryReport\": {\n \"type\": \"object\",\n \"description\": \"Top-level report containing all features, runtime metadata, and a pre-computed summary.\",\n \"properties\": {\n \"schemaVersion\": {\n \"type\": \"string\",\n \"pattern\": \"^1\\\\.[0-9]+$\",\n \"description\": \"Schema version as 'major.minor'. Major bumps are breaking; minors are additive-only. UI packages must accept any 1.x.\"\n },\n \"runId\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Unique deterministic identifier for this run.\"\n },\n \"startedAtMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Run start time as Unix epoch milliseconds.\"\n },\n \"finishedAtMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Run finish time as Unix epoch milliseconds.\"\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Total run duration in milliseconds.\"\n },\n \"projectRoot\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Absolute path to the project root (for context only; relative paths in features.sourceFile are preferred).\"\n },\n \"packageVersion\": {\n \"type\": \"string\",\n \"description\": \"Version of the package under test, if known.\"\n },\n \"gitSha\": {\n \"type\": \"string\",\n \"description\": \"Git commit SHA at the time of the run.\"\n },\n \"ci\": {\n \"$ref\": \"#/$defs/CIInfo\"\n },\n \"coverage\": {\n \"$ref\": \"#/$defs/CoverageSummary\"\n },\n \"summary\": {\n \"$ref\": \"#/$defs/Summary\",\n \"description\": \"Pre-computed counts across all features and scenarios.\"\n },\n \"features\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Feature\" },\n \"description\": \"Features grouped by sourceFile, sorted by title.\"\n }\n },\n \"required\": [\"schemaVersion\", \"runId\", \"startedAtMs\", \"finishedAtMs\", \"durationMs\", \"projectRoot\", \"summary\", \"features\"],\n \"additionalProperties\": false\n },\n \"Summary\": {\n \"type\": \"object\",\n \"description\": \"Counts by status. Sums equal 'total'.\",\n \"properties\": {\n \"total\": { \"type\": \"integer\", \"minimum\": 0 },\n \"passed\": { \"type\": \"integer\", \"minimum\": 0 },\n \"failed\": { \"type\": \"integer\", \"minimum\": 0 },\n \"skipped\": { \"type\": \"integer\", \"minimum\": 0 },\n \"pending\": { \"type\": \"integer\", \"minimum\": 0 },\n \"durationMs\": { \"type\": \"number\", \"minimum\": 0 }\n },\n \"required\": [\"total\", \"passed\", \"failed\", \"skipped\", \"pending\", \"durationMs\"],\n \"additionalProperties\": false\n },\n \"Feature\": {\n \"type\": \"object\",\n \"description\": \"A group of scenarios from the same source file.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Stable slug derived from the relative source path. Suitable for use as a deep-link anchor.\"\n },\n \"title\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Display title. Derived from describe block when present, otherwise the file basename.\"\n },\n \"sourceFile\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Source path, relative to projectRoot when possible.\"\n },\n \"summary\": { \"$ref\": \"#/$defs/Summary\" },\n \"scenarios\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Scenario\" },\n \"description\": \"Scenarios in this feature, in declaration order.\"\n }\n },\n \"required\": [\"id\", \"title\", \"sourceFile\", \"summary\", \"scenarios\"],\n \"additionalProperties\": false\n },\n \"Scenario\": {\n \"type\": \"object\",\n \"description\": \"A single scenario with its steps, story-level doc entries, and attachments.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Stable identifier: '<feature.id>--<slug-of-title>'. Suitable for use as a deep-link anchor.\"\n },\n \"title\": { \"type\": \"string\", \"minLength\": 1 },\n \"status\": { \"$ref\": \"#/$defs/TestStatus\" },\n \"durationMs\": { \"type\": \"number\", \"minimum\": 0 },\n \"tags\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Normalized tags, deduplicated, lowercased.\"\n },\n \"tickets\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Ticket\" }\n },\n \"sourceLine\": { \"type\": \"integer\", \"minimum\": 1 },\n \"errorMessage\": { \"type\": \"string\" },\n \"errorStack\": { \"type\": \"string\" },\n \"retry\": { \"type\": \"integer\", \"minimum\": 0 },\n \"retries\": { \"type\": \"integer\", \"minimum\": 0 },\n \"docEntries\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" },\n \"description\": \"Story-level doc entries (rendered before steps).\"\n },\n \"steps\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Step\" }\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/Attachment\" }\n }\n },\n \"required\": [\"id\", \"title\", \"status\", \"durationMs\", \"tags\", \"retry\", \"retries\", \"docEntries\", \"steps\", \"attachments\"],\n \"additionalProperties\": false\n },\n \"Step\": {\n \"type\": \"object\",\n \"description\": \"A single BDD step.\",\n \"properties\": {\n \"id\": { \"type\": \"string\", \"minLength\": 1 },\n \"index\": { \"type\": \"integer\", \"minimum\": 0 },\n \"keyword\": { \"$ref\": \"#/$defs/StepKeyword\" },\n \"text\": { \"type\": \"string\" },\n \"status\": { \"$ref\": \"#/$defs/TestStatus\" },\n \"durationMs\": { \"type\": \"number\", \"minimum\": 0 },\n \"errorMessage\": { \"type\": \"string\" },\n \"mode\": { \"$ref\": \"#/$defs/StepMode\" },\n \"docEntries\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" },\n \"description\": \"Doc entries attached to this step.\"\n }\n },\n \"required\": [\"id\", \"index\", \"keyword\", \"text\", \"status\", \"durationMs\", \"docEntries\"],\n \"additionalProperties\": false\n },\n \"StepKeyword\": {\n \"type\": \"string\",\n \"enum\": [\"Given\", \"When\", \"Then\", \"And\", \"But\"]\n },\n \"StepMode\": {\n \"type\": \"string\",\n \"enum\": [\"normal\", \"skip\", \"only\", \"todo\", \"fails\", \"concurrent\"]\n },\n \"TestStatus\": {\n \"type\": \"string\",\n \"enum\": [\"passed\", \"failed\", \"skipped\", \"pending\"]\n },\n \"Ticket\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\", \"minLength\": 1 },\n \"url\": { \"type\": \"string\" }\n },\n \"required\": [\"id\"],\n \"additionalProperties\": false\n },\n \"Attachment\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"mediaType\": { \"type\": \"string\", \"minLength\": 1 },\n \"body\": { \"type\": \"string\" },\n \"contentEncoding\": {\n \"type\": \"string\",\n \"enum\": [\"BASE64\", \"IDENTITY\"]\n }\n },\n \"required\": [\"name\", \"mediaType\", \"body\", \"contentEncoding\"],\n \"additionalProperties\": false\n },\n \"CIInfo\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\" },\n \"buildNumber\": { \"type\": \"string\" },\n \"branch\": { \"type\": \"string\" },\n \"commitSha\": { \"type\": \"string\" },\n \"prNumber\": { \"type\": \"string\" }\n },\n \"required\": [\"name\"],\n \"additionalProperties\": false\n },\n \"CoverageSummary\": {\n \"type\": \"object\",\n \"properties\": {\n \"linesPct\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 100 },\n \"branchesPct\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 100 },\n \"functionsPct\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 100 },\n \"statementsPct\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 100 }\n },\n \"additionalProperties\": false\n },\n \"DocPhase\": {\n \"type\": \"string\",\n \"enum\": [\"static\", \"runtime\"]\n },\n \"DocEntry\": {\n \"oneOf\": [\n { \"$ref\": \"#/$defs/DocNote\" },\n { \"$ref\": \"#/$defs/DocTag\" },\n { \"$ref\": \"#/$defs/DocKv\" },\n { \"$ref\": \"#/$defs/DocCode\" },\n { \"$ref\": \"#/$defs/DocTable\" },\n { \"$ref\": \"#/$defs/DocLink\" },\n { \"$ref\": \"#/$defs/DocSection\" },\n { \"$ref\": \"#/$defs/DocMermaid\" },\n { \"$ref\": \"#/$defs/DocScreenshot\" },\n { \"$ref\": \"#/$defs/DocCustom\" }\n ]\n },\n \"DocNote\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"note\" },\n \"text\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"text\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocTag\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"tag\" },\n \"names\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"names\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocKv\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"kv\" },\n \"label\": { \"type\": \"string\" },\n \"value\": {},\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"label\", \"value\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocCode\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"code\" },\n \"label\": { \"type\": \"string\" },\n \"content\": { \"type\": \"string\" },\n \"lang\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"label\", \"content\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocTable\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"table\" },\n \"label\": { \"type\": \"string\" },\n \"columns\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"rows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"label\", \"columns\", \"rows\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocLink\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"link\" },\n \"label\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"label\", \"url\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocSection\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"section\" },\n \"title\": { \"type\": \"string\" },\n \"markdown\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"title\", \"markdown\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocMermaid\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"mermaid\" },\n \"code\": { \"type\": \"string\" },\n \"title\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"code\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocScreenshot\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"screenshot\" },\n \"path\": { \"type\": \"string\" },\n \"alt\": { \"type\": \"string\" },\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"path\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocCustom\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": { \"const\": \"custom\" },\n \"type\": { \"type\": \"string\", \"minLength\": 1 },\n \"data\": {},\n \"phase\": { \"$ref\": \"#/$defs/DocPhase\" },\n \"children\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/DocEntry\" }\n }\n },\n \"required\": [\"kind\", \"type\", \"data\", \"phase\"],\n \"additionalProperties\": false\n }\n }\n}\n","/**\n * parseStoryReport — boundary validator. Accepts unknown input (file contents,\n * fetch body, prop) and returns a Result-typed StoryReport.\n */\n\nimport type { StoryReport } from \"executable-stories-formatters\";\nimport type { Result } from \"../result\";\nimport { ok, err } from \"../result\";\nimport { storyReportSchema, STORY_REPORT_SCHEMA_MAJOR } from \"./story-report.schema\";\n\nexport function parseStoryReport(input: unknown): Result<StoryReport> {\n if (input === null || typeof input !== \"object\") {\n return err({\n message: \"Expected a StoryReport object.\",\n code: \"INVALID_INPUT\",\n });\n }\n\n const versionRaw = (input as { schemaVersion?: unknown }).schemaVersion;\n if (typeof versionRaw === \"string\") {\n const major = versionRaw.split(\".\")[0];\n if (major !== String(STORY_REPORT_SCHEMA_MAJOR)) {\n return err({\n message: `Schema major ${major} is not supported by this version of executable-stories-react (expected ${STORY_REPORT_SCHEMA_MAJOR}.x). Upgrade the package.`,\n code: \"SCHEMA_VERSION_MISMATCH\",\n });\n }\n }\n\n const parsed = storyReportSchema.safeParse(input);\n if (parsed.success) {\n return ok(parsed.data as StoryReport);\n }\n\n const issues = parsed.error.issues.map((i) => ({\n path: i.path.join(\".\") || \"/\",\n message: i.message,\n }));\n\n return err({\n message: `StoryReport failed validation (${issues.length} issue${issues.length === 1 ? \"\" : \"s\"}).`,\n code: \"VALIDATION_FAILED\",\n issues,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAwC;;;ACAxC,mBAA8B;AAUvB,IAAM,oBAAgB,4BAAyC,IAAI;;;ADmBjE;AAjBT,IAAM,eAAgC,CAAC;AACvC,IAAM,kBAAoC,CAAC;AAEpC,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoB;AAClB,QAAM,YAAQ;AAAA,IACZ,OAAO;AAAA,MACL;AAAA,MACA,iBAAiB,mBAAmB;AAAA,MACpC,WAAW,aAAa;AAAA,IAC1B;AAAA,IACA,CAAC,QAAQ,iBAAiB,SAAS;AAAA,EACrC;AACA,SAAO,4CAAC,cAAc,UAAd,EAAuB,OAAe,UAAS;AACzD;;;AE9BA,IAAAC,gBAA2B;AAGpB,SAAS,YAAY;AAC1B,QAAM,UAAM,0BAAW,aAAa;AACpC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO,IAAI;AACb;;;ACDI,IAAAC,sBAAA;AAHG,SAAS,cAAc,EAAE,UAAU,GAAuB;AAC/D,QAAM,SAAS,UAAU;AACzB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,OAAO;AAAA,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AG,OAAO,IAAmB;AAAA,EACtC;AAEA,QAAM,SAAS,OAAO,MAAM,OAAO,IAAI,CAAC,OAAO;AAAA,IAC7C,MAAM,EAAE,KAAK,KAAK,GAAG,KAAK;AAAA,IAC1B,SAAS,EAAE;AAAA,EACb,EAAE;AAEF,SAAO,IAAI;AAAA,IACT,SAAS,kCAAkC,OAAO,MAAM,SAAS,OAAO,WAAW,IAAI,KAAK,GAAG;AAAA,IAC/F,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AACH;","names":["import_react","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","EMPTY_CUSTOM","EMPTY_RENDERERS","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as executable_stories_formatters from 'executable-stories-formatters';
|
|
3
|
+
import { ReportDocMermaid, ReportDocCode, ReportDocSection, ReportDocCustom, StoryReport, ReportSummary as ReportSummary$1, ReportFeature as ReportFeature$1, ReportScenario as ReportScenario$1, ReportStep, ReportDocEntry, ReportDocNote, ReportDocTag, ReportDocKv, ReportDocTable, ReportDocLink, ReportDocScreenshot } from 'executable-stories-formatters';
|
|
4
|
+
export { StoryReport, ReportDocEntry as StoryReportDocEntry, ReportFeature as StoryReportFeature, ReportScenario as StoryReportScenario, ReportStep as StoryReportStep, ReportSummary as StoryReportSummary } from 'executable-stories-formatters';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Result<T> — explicit success/error type matching the cookbook convention.
|
|
10
|
+
*
|
|
11
|
+
* Used at the boundary where a StoryReport is parsed: the consumer hands us
|
|
12
|
+
* an unknown value (file contents, fetch body, prop) and we return a Result.
|
|
13
|
+
*/
|
|
14
|
+
type Result<T, E = ReportParseError> = {
|
|
15
|
+
ok: true;
|
|
16
|
+
data: T;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
error: E;
|
|
20
|
+
};
|
|
21
|
+
interface ReportParseError {
|
|
22
|
+
message: string;
|
|
23
|
+
code: ReportParseErrorCode;
|
|
24
|
+
issues?: readonly {
|
|
25
|
+
path: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}[];
|
|
28
|
+
}
|
|
29
|
+
type ReportParseErrorCode = "INVALID_INPUT" | "SCHEMA_VERSION_MISMATCH" | "VALIDATION_FAILED";
|
|
30
|
+
declare const ok: <T>(data: T) => Result<T>;
|
|
31
|
+
declare const err: (error: ReportParseError) => Result<never>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Renderer registries — extension points for custom rendering of doc entries.
|
|
35
|
+
*
|
|
36
|
+
* - customRenderers: keyed by user-defined `story.custom({ type })` strings.
|
|
37
|
+
* - renderers: optional overrides for the three heavy built-ins
|
|
38
|
+
* (mermaid, code, section). Other doc kinds are not overridable — drop
|
|
39
|
+
* to primitives if you need a fully custom layout.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
type CustomRenderer = (entry: ReportDocCustom) => ReactNode;
|
|
43
|
+
type CustomRenderers = Record<string, CustomRenderer>;
|
|
44
|
+
interface BuiltinRenderers {
|
|
45
|
+
mermaid?: (entry: ReportDocMermaid) => ReactNode;
|
|
46
|
+
code?: (entry: ReportDocCode) => ReactNode;
|
|
47
|
+
section?: (entry: ReportDocSection) => ReactNode;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface ReportProps {
|
|
51
|
+
/** A StoryReport, or a Result-wrapped one (e.g., from parseStoryReport). */
|
|
52
|
+
report: StoryReport | Result<StoryReport>;
|
|
53
|
+
/** Renderers keyed by `story.custom({ type })` strings. */
|
|
54
|
+
customRenderers?: CustomRenderers;
|
|
55
|
+
/** Optional overrides for the heavy built-ins (mermaid, code, section). */
|
|
56
|
+
renderers?: BuiltinRenderers;
|
|
57
|
+
/** Optional class on the <main> landmark for layout positioning. */
|
|
58
|
+
className?: string;
|
|
59
|
+
/** Optional override title. */
|
|
60
|
+
title?: string;
|
|
61
|
+
/** Optional theme attribute scope. Use to force "light" or "dark". */
|
|
62
|
+
dataTheme?: "light" | "dark";
|
|
63
|
+
}
|
|
64
|
+
declare function Report(props: ReportProps): react_jsx_runtime.JSX.Element;
|
|
65
|
+
|
|
66
|
+
interface ReportRootProps {
|
|
67
|
+
report: StoryReport;
|
|
68
|
+
customRenderers?: CustomRenderers;
|
|
69
|
+
renderers?: BuiltinRenderers;
|
|
70
|
+
children: ReactNode;
|
|
71
|
+
}
|
|
72
|
+
declare function ReportRoot({ report, customRenderers, renderers, children, }: ReportRootProps): react_jsx_runtime.JSX.Element;
|
|
73
|
+
|
|
74
|
+
interface ReportSummaryProps {
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
declare function ReportSummary({ className }: ReportSummaryProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
interface ReportSummaryViewProps {
|
|
79
|
+
summary: ReportSummary$1;
|
|
80
|
+
className?: string;
|
|
81
|
+
ariaLabel?: string;
|
|
82
|
+
}
|
|
83
|
+
declare function ReportSummaryView({ summary, className, ariaLabel }: ReportSummaryViewProps): react_jsx_runtime.JSX.Element;
|
|
84
|
+
|
|
85
|
+
declare function ReportFeatureList(): react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
interface ReportFeatureProps {
|
|
88
|
+
feature: ReportFeature$1;
|
|
89
|
+
}
|
|
90
|
+
declare function ReportFeature({ feature }: ReportFeatureProps): react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
interface ReportScenarioListProps {
|
|
93
|
+
feature: ReportFeature$1;
|
|
94
|
+
}
|
|
95
|
+
declare function ReportScenarioList({ feature }: ReportScenarioListProps): react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
interface ReportScenarioProps {
|
|
98
|
+
scenario: ReportScenario$1;
|
|
99
|
+
}
|
|
100
|
+
declare function ReportScenario({ scenario }: ReportScenarioProps): react_jsx_runtime.JSX.Element;
|
|
101
|
+
|
|
102
|
+
interface ReportStepsProps {
|
|
103
|
+
scenario: ReportScenario$1;
|
|
104
|
+
}
|
|
105
|
+
declare function ReportSteps({ scenario }: ReportStepsProps): react_jsx_runtime.JSX.Element | null;
|
|
106
|
+
declare function ReportStepItem({ step }: {
|
|
107
|
+
step: ReportStep;
|
|
108
|
+
}): react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
110
|
+
interface ReportDocEntriesProps {
|
|
111
|
+
entries: readonly ReportDocEntry[];
|
|
112
|
+
}
|
|
113
|
+
declare function ReportDocEntries({ entries }: ReportDocEntriesProps): react_jsx_runtime.JSX.Element | null;
|
|
114
|
+
|
|
115
|
+
declare function DocEntry({ entry }: {
|
|
116
|
+
entry: ReportDocEntry;
|
|
117
|
+
}): react_jsx_runtime.JSX.Element;
|
|
118
|
+
|
|
119
|
+
declare function DocNote({ entry }: {
|
|
120
|
+
entry: ReportDocNote;
|
|
121
|
+
}): react_jsx_runtime.JSX.Element;
|
|
122
|
+
|
|
123
|
+
declare function DocTag({ entry }: {
|
|
124
|
+
entry: ReportDocTag;
|
|
125
|
+
}): react_jsx_runtime.JSX.Element;
|
|
126
|
+
|
|
127
|
+
declare function DocKv({ entry }: {
|
|
128
|
+
entry: ReportDocKv;
|
|
129
|
+
}): react_jsx_runtime.JSX.Element;
|
|
130
|
+
|
|
131
|
+
declare function DocCode({ entry }: {
|
|
132
|
+
entry: ReportDocCode;
|
|
133
|
+
}): react_jsx_runtime.JSX.Element;
|
|
134
|
+
|
|
135
|
+
declare function DocTable({ entry }: {
|
|
136
|
+
entry: ReportDocTable;
|
|
137
|
+
}): react_jsx_runtime.JSX.Element;
|
|
138
|
+
|
|
139
|
+
declare function DocLink({ entry }: {
|
|
140
|
+
entry: ReportDocLink;
|
|
141
|
+
}): react_jsx_runtime.JSX.Element;
|
|
142
|
+
|
|
143
|
+
declare function DocSection({ entry }: {
|
|
144
|
+
entry: ReportDocSection;
|
|
145
|
+
}): react_jsx_runtime.JSX.Element;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Renders mermaid source as a semantic <pre data-mermaid> by default.
|
|
149
|
+
*
|
|
150
|
+
* AI agents and screen readers get the raw source. To render the diagram
|
|
151
|
+
* visually, supply a `renderers.mermaid` prop with a client-only component
|
|
152
|
+
* (e.g., one that dynamically imports the mermaid library on mount).
|
|
153
|
+
*/
|
|
154
|
+
declare function DocMermaid({ entry }: {
|
|
155
|
+
entry: ReportDocMermaid;
|
|
156
|
+
}): react_jsx_runtime.JSX.Element;
|
|
157
|
+
|
|
158
|
+
declare function DocScreenshot({ entry }: {
|
|
159
|
+
entry: ReportDocScreenshot;
|
|
160
|
+
}): react_jsx_runtime.JSX.Element;
|
|
161
|
+
|
|
162
|
+
declare function DocCustom({ entry }: {
|
|
163
|
+
entry: ReportDocCustom;
|
|
164
|
+
}): react_jsx_runtime.JSX.Element;
|
|
165
|
+
|
|
166
|
+
declare function useCustomRenderers(): CustomRenderers;
|
|
167
|
+
declare function useBuiltinRenderers(): BuiltinRenderers;
|
|
168
|
+
|
|
169
|
+
interface ReportEmptyProps {
|
|
170
|
+
message?: string;
|
|
171
|
+
}
|
|
172
|
+
declare function ReportEmpty({ message }: ReportEmptyProps): react_jsx_runtime.JSX.Element;
|
|
173
|
+
|
|
174
|
+
interface ReportSchemaErrorProps {
|
|
175
|
+
error: ReportParseError;
|
|
176
|
+
}
|
|
177
|
+
declare function ReportSchemaError({ error }: ReportSchemaErrorProps): react_jsx_runtime.JSX.Element;
|
|
178
|
+
|
|
179
|
+
declare function useReport(): executable_stories_formatters.StoryReport;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* parseStoryReport — boundary validator. Accepts unknown input (file contents,
|
|
183
|
+
* fetch body, prop) and returns a Result-typed StoryReport.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
declare function parseStoryReport(input: unknown): Result<StoryReport>;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* StoryReport runtime Zod schema, derived from the canonical JSON Schema
|
|
190
|
+
* at executable-stories-formatters/schemas/story-report-v1.json.
|
|
191
|
+
*
|
|
192
|
+
* Uses z.fromJSONSchema (experimental in Zod 4.x). If the API changes upstream,
|
|
193
|
+
* only this file needs updating — the rest of the package consumes
|
|
194
|
+
* `storyReportSchema` and `StoryReportSchemaShape` via parse.ts.
|
|
195
|
+
*
|
|
196
|
+
* The JSON Schema is bundled at build time by tsup (resolveJsonModule).
|
|
197
|
+
*/
|
|
198
|
+
|
|
199
|
+
declare const storyReportSchema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
200
|
+
declare const STORY_REPORT_SCHEMA_MAJOR: 1;
|
|
201
|
+
|
|
202
|
+
export { type BuiltinRenderers, type CustomRenderer, type CustomRenderers, DocCode, DocCustom, DocEntry, DocKv, DocLink, DocMermaid, DocNote, DocScreenshot, DocSection, DocTable, DocTag, Report, ReportDocEntries, type ReportDocEntriesProps, ReportEmpty, type ReportEmptyProps, ReportFeature, ReportFeatureList, type ReportFeatureProps, type ReportParseError, type ReportParseErrorCode, type ReportProps, ReportRoot, type ReportRootProps, ReportScenario, ReportScenarioList, type ReportScenarioListProps, type ReportScenarioProps, ReportSchemaError, type ReportSchemaErrorProps, ReportStepItem, ReportSteps, type ReportStepsProps, ReportSummary, type ReportSummaryProps, ReportSummaryView, type ReportSummaryViewProps, type Result, STORY_REPORT_SCHEMA_MAJOR, err, ok, parseStoryReport, storyReportSchema, useBuiltinRenderers, useCustomRenderers, useReport };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as executable_stories_formatters from 'executable-stories-formatters';
|
|
3
|
+
import { ReportDocMermaid, ReportDocCode, ReportDocSection, ReportDocCustom, StoryReport, ReportSummary as ReportSummary$1, ReportFeature as ReportFeature$1, ReportScenario as ReportScenario$1, ReportStep, ReportDocEntry, ReportDocNote, ReportDocTag, ReportDocKv, ReportDocTable, ReportDocLink, ReportDocScreenshot } from 'executable-stories-formatters';
|
|
4
|
+
export { StoryReport, ReportDocEntry as StoryReportDocEntry, ReportFeature as StoryReportFeature, ReportScenario as StoryReportScenario, ReportStep as StoryReportStep, ReportSummary as StoryReportSummary } from 'executable-stories-formatters';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Result<T> — explicit success/error type matching the cookbook convention.
|
|
10
|
+
*
|
|
11
|
+
* Used at the boundary where a StoryReport is parsed: the consumer hands us
|
|
12
|
+
* an unknown value (file contents, fetch body, prop) and we return a Result.
|
|
13
|
+
*/
|
|
14
|
+
type Result<T, E = ReportParseError> = {
|
|
15
|
+
ok: true;
|
|
16
|
+
data: T;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
error: E;
|
|
20
|
+
};
|
|
21
|
+
interface ReportParseError {
|
|
22
|
+
message: string;
|
|
23
|
+
code: ReportParseErrorCode;
|
|
24
|
+
issues?: readonly {
|
|
25
|
+
path: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}[];
|
|
28
|
+
}
|
|
29
|
+
type ReportParseErrorCode = "INVALID_INPUT" | "SCHEMA_VERSION_MISMATCH" | "VALIDATION_FAILED";
|
|
30
|
+
declare const ok: <T>(data: T) => Result<T>;
|
|
31
|
+
declare const err: (error: ReportParseError) => Result<never>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Renderer registries — extension points for custom rendering of doc entries.
|
|
35
|
+
*
|
|
36
|
+
* - customRenderers: keyed by user-defined `story.custom({ type })` strings.
|
|
37
|
+
* - renderers: optional overrides for the three heavy built-ins
|
|
38
|
+
* (mermaid, code, section). Other doc kinds are not overridable — drop
|
|
39
|
+
* to primitives if you need a fully custom layout.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
type CustomRenderer = (entry: ReportDocCustom) => ReactNode;
|
|
43
|
+
type CustomRenderers = Record<string, CustomRenderer>;
|
|
44
|
+
interface BuiltinRenderers {
|
|
45
|
+
mermaid?: (entry: ReportDocMermaid) => ReactNode;
|
|
46
|
+
code?: (entry: ReportDocCode) => ReactNode;
|
|
47
|
+
section?: (entry: ReportDocSection) => ReactNode;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface ReportProps {
|
|
51
|
+
/** A StoryReport, or a Result-wrapped one (e.g., from parseStoryReport). */
|
|
52
|
+
report: StoryReport | Result<StoryReport>;
|
|
53
|
+
/** Renderers keyed by `story.custom({ type })` strings. */
|
|
54
|
+
customRenderers?: CustomRenderers;
|
|
55
|
+
/** Optional overrides for the heavy built-ins (mermaid, code, section). */
|
|
56
|
+
renderers?: BuiltinRenderers;
|
|
57
|
+
/** Optional class on the <main> landmark for layout positioning. */
|
|
58
|
+
className?: string;
|
|
59
|
+
/** Optional override title. */
|
|
60
|
+
title?: string;
|
|
61
|
+
/** Optional theme attribute scope. Use to force "light" or "dark". */
|
|
62
|
+
dataTheme?: "light" | "dark";
|
|
63
|
+
}
|
|
64
|
+
declare function Report(props: ReportProps): react_jsx_runtime.JSX.Element;
|
|
65
|
+
|
|
66
|
+
interface ReportRootProps {
|
|
67
|
+
report: StoryReport;
|
|
68
|
+
customRenderers?: CustomRenderers;
|
|
69
|
+
renderers?: BuiltinRenderers;
|
|
70
|
+
children: ReactNode;
|
|
71
|
+
}
|
|
72
|
+
declare function ReportRoot({ report, customRenderers, renderers, children, }: ReportRootProps): react_jsx_runtime.JSX.Element;
|
|
73
|
+
|
|
74
|
+
interface ReportSummaryProps {
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
declare function ReportSummary({ className }: ReportSummaryProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
interface ReportSummaryViewProps {
|
|
79
|
+
summary: ReportSummary$1;
|
|
80
|
+
className?: string;
|
|
81
|
+
ariaLabel?: string;
|
|
82
|
+
}
|
|
83
|
+
declare function ReportSummaryView({ summary, className, ariaLabel }: ReportSummaryViewProps): react_jsx_runtime.JSX.Element;
|
|
84
|
+
|
|
85
|
+
declare function ReportFeatureList(): react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
interface ReportFeatureProps {
|
|
88
|
+
feature: ReportFeature$1;
|
|
89
|
+
}
|
|
90
|
+
declare function ReportFeature({ feature }: ReportFeatureProps): react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
interface ReportScenarioListProps {
|
|
93
|
+
feature: ReportFeature$1;
|
|
94
|
+
}
|
|
95
|
+
declare function ReportScenarioList({ feature }: ReportScenarioListProps): react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
interface ReportScenarioProps {
|
|
98
|
+
scenario: ReportScenario$1;
|
|
99
|
+
}
|
|
100
|
+
declare function ReportScenario({ scenario }: ReportScenarioProps): react_jsx_runtime.JSX.Element;
|
|
101
|
+
|
|
102
|
+
interface ReportStepsProps {
|
|
103
|
+
scenario: ReportScenario$1;
|
|
104
|
+
}
|
|
105
|
+
declare function ReportSteps({ scenario }: ReportStepsProps): react_jsx_runtime.JSX.Element | null;
|
|
106
|
+
declare function ReportStepItem({ step }: {
|
|
107
|
+
step: ReportStep;
|
|
108
|
+
}): react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
110
|
+
interface ReportDocEntriesProps {
|
|
111
|
+
entries: readonly ReportDocEntry[];
|
|
112
|
+
}
|
|
113
|
+
declare function ReportDocEntries({ entries }: ReportDocEntriesProps): react_jsx_runtime.JSX.Element | null;
|
|
114
|
+
|
|
115
|
+
declare function DocEntry({ entry }: {
|
|
116
|
+
entry: ReportDocEntry;
|
|
117
|
+
}): react_jsx_runtime.JSX.Element;
|
|
118
|
+
|
|
119
|
+
declare function DocNote({ entry }: {
|
|
120
|
+
entry: ReportDocNote;
|
|
121
|
+
}): react_jsx_runtime.JSX.Element;
|
|
122
|
+
|
|
123
|
+
declare function DocTag({ entry }: {
|
|
124
|
+
entry: ReportDocTag;
|
|
125
|
+
}): react_jsx_runtime.JSX.Element;
|
|
126
|
+
|
|
127
|
+
declare function DocKv({ entry }: {
|
|
128
|
+
entry: ReportDocKv;
|
|
129
|
+
}): react_jsx_runtime.JSX.Element;
|
|
130
|
+
|
|
131
|
+
declare function DocCode({ entry }: {
|
|
132
|
+
entry: ReportDocCode;
|
|
133
|
+
}): react_jsx_runtime.JSX.Element;
|
|
134
|
+
|
|
135
|
+
declare function DocTable({ entry }: {
|
|
136
|
+
entry: ReportDocTable;
|
|
137
|
+
}): react_jsx_runtime.JSX.Element;
|
|
138
|
+
|
|
139
|
+
declare function DocLink({ entry }: {
|
|
140
|
+
entry: ReportDocLink;
|
|
141
|
+
}): react_jsx_runtime.JSX.Element;
|
|
142
|
+
|
|
143
|
+
declare function DocSection({ entry }: {
|
|
144
|
+
entry: ReportDocSection;
|
|
145
|
+
}): react_jsx_runtime.JSX.Element;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Renders mermaid source as a semantic <pre data-mermaid> by default.
|
|
149
|
+
*
|
|
150
|
+
* AI agents and screen readers get the raw source. To render the diagram
|
|
151
|
+
* visually, supply a `renderers.mermaid` prop with a client-only component
|
|
152
|
+
* (e.g., one that dynamically imports the mermaid library on mount).
|
|
153
|
+
*/
|
|
154
|
+
declare function DocMermaid({ entry }: {
|
|
155
|
+
entry: ReportDocMermaid;
|
|
156
|
+
}): react_jsx_runtime.JSX.Element;
|
|
157
|
+
|
|
158
|
+
declare function DocScreenshot({ entry }: {
|
|
159
|
+
entry: ReportDocScreenshot;
|
|
160
|
+
}): react_jsx_runtime.JSX.Element;
|
|
161
|
+
|
|
162
|
+
declare function DocCustom({ entry }: {
|
|
163
|
+
entry: ReportDocCustom;
|
|
164
|
+
}): react_jsx_runtime.JSX.Element;
|
|
165
|
+
|
|
166
|
+
declare function useCustomRenderers(): CustomRenderers;
|
|
167
|
+
declare function useBuiltinRenderers(): BuiltinRenderers;
|
|
168
|
+
|
|
169
|
+
interface ReportEmptyProps {
|
|
170
|
+
message?: string;
|
|
171
|
+
}
|
|
172
|
+
declare function ReportEmpty({ message }: ReportEmptyProps): react_jsx_runtime.JSX.Element;
|
|
173
|
+
|
|
174
|
+
interface ReportSchemaErrorProps {
|
|
175
|
+
error: ReportParseError;
|
|
176
|
+
}
|
|
177
|
+
declare function ReportSchemaError({ error }: ReportSchemaErrorProps): react_jsx_runtime.JSX.Element;
|
|
178
|
+
|
|
179
|
+
declare function useReport(): executable_stories_formatters.StoryReport;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* parseStoryReport — boundary validator. Accepts unknown input (file contents,
|
|
183
|
+
* fetch body, prop) and returns a Result-typed StoryReport.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
declare function parseStoryReport(input: unknown): Result<StoryReport>;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* StoryReport runtime Zod schema, derived from the canonical JSON Schema
|
|
190
|
+
* at executable-stories-formatters/schemas/story-report-v1.json.
|
|
191
|
+
*
|
|
192
|
+
* Uses z.fromJSONSchema (experimental in Zod 4.x). If the API changes upstream,
|
|
193
|
+
* only this file needs updating — the rest of the package consumes
|
|
194
|
+
* `storyReportSchema` and `StoryReportSchemaShape` via parse.ts.
|
|
195
|
+
*
|
|
196
|
+
* The JSON Schema is bundled at build time by tsup (resolveJsonModule).
|
|
197
|
+
*/
|
|
198
|
+
|
|
199
|
+
declare const storyReportSchema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
200
|
+
declare const STORY_REPORT_SCHEMA_MAJOR: 1;
|
|
201
|
+
|
|
202
|
+
export { type BuiltinRenderers, type CustomRenderer, type CustomRenderers, DocCode, DocCustom, DocEntry, DocKv, DocLink, DocMermaid, DocNote, DocScreenshot, DocSection, DocTable, DocTag, Report, ReportDocEntries, type ReportDocEntriesProps, ReportEmpty, type ReportEmptyProps, ReportFeature, ReportFeatureList, type ReportFeatureProps, type ReportParseError, type ReportParseErrorCode, type ReportProps, ReportRoot, type ReportRootProps, ReportScenario, ReportScenarioList, type ReportScenarioListProps, type ReportScenarioProps, ReportSchemaError, type ReportSchemaErrorProps, ReportStepItem, ReportSteps, type ReportStepsProps, ReportSummary, type ReportSummaryProps, ReportSummaryView, type ReportSummaryViewProps, type Result, STORY_REPORT_SCHEMA_MAJOR, err, ok, parseStoryReport, storyReportSchema, useBuiltinRenderers, useCustomRenderers, useReport };
|