executable-stories-react 0.10.1 → 0.12.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.
@@ -2,6 +2,37 @@ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { ReportDocCustom, ReportDocMermaid, ReportDocCode, ReportDocSection, StoryReport } from 'executable-stories-core';
4
4
 
5
+ type ScenarioRunStatus = "passed" | "failed" | "skipped" | "pending";
6
+ /** One historical run of a scenario, oldest → newest in a history array. */
7
+ interface ScenarioRunEvent {
8
+ /** Epoch ms the run started. */
9
+ timestamp: number;
10
+ status: ScenarioRunStatus;
11
+ runId?: string;
12
+ durationMs?: number;
13
+ commitSha?: string;
14
+ branch?: string;
15
+ }
16
+ /** Recent run events keyed by ReportScenario.id. */
17
+ type ScenarioHistoryMap = Record<string, ScenarioRunEvent[]>;
18
+
19
+ /**
20
+ * Renderer registries — extension points for custom rendering of doc entries.
21
+ *
22
+ * - customRenderers: keyed by user-defined `story.custom({ type })` strings.
23
+ * - renderers: optional overrides for the three heavy built-ins
24
+ * (mermaid, code, section). Other doc kinds are not overridable — drop
25
+ * to primitives if you need a fully custom layout.
26
+ */
27
+
28
+ type CustomRenderer = (entry: ReportDocCustom) => ReactNode;
29
+ type CustomRenderers = Record<string, CustomRenderer>;
30
+ interface BuiltinRenderers {
31
+ mermaid?: (entry: ReportDocMermaid) => ReactNode;
32
+ code?: (entry: ReportDocCode) => ReactNode;
33
+ section?: (entry: ReportDocSection) => ReactNode;
34
+ }
35
+
5
36
  /**
6
37
  * Result<T> — explicit success/error type matching the cookbook convention.
7
38
  *
@@ -26,37 +57,6 @@ interface ReportParseError {
26
57
  }
27
58
  type ReportParseErrorCode = "INVALID_INPUT" | "SCHEMA_VERSION_MISMATCH" | "VALIDATION_FAILED";
28
59
 
29
- /**
30
- * Renderer registries — extension points for custom rendering of doc entries.
31
- *
32
- * - customRenderers: keyed by user-defined `story.custom({ type })` strings.
33
- * - renderers: optional overrides for the three heavy built-ins
34
- * (mermaid, code, section). Other doc kinds are not overridable — drop
35
- * to primitives if you need a fully custom layout.
36
- */
37
-
38
- type CustomRenderer = (entry: ReportDocCustom) => ReactNode;
39
- type CustomRenderers = Record<string, CustomRenderer>;
40
- interface BuiltinRenderers {
41
- mermaid?: (entry: ReportDocMermaid) => ReactNode;
42
- code?: (entry: ReportDocCode) => ReactNode;
43
- section?: (entry: ReportDocSection) => ReactNode;
44
- }
45
-
46
- type ScenarioRunStatus = "passed" | "failed" | "skipped" | "pending";
47
- /** One historical run of a scenario, oldest → newest in a history array. */
48
- interface ScenarioRunEvent {
49
- /** Epoch ms the run started. */
50
- timestamp: number;
51
- status: ScenarioRunStatus;
52
- runId?: string;
53
- durationMs?: number;
54
- commitSha?: string;
55
- branch?: string;
56
- }
57
- /** Recent run events keyed by ReportScenario.id. */
58
- type ScenarioHistoryMap = Record<string, ScenarioRunEvent[]>;
59
-
60
60
  interface ReportInteractiveProps {
61
61
  /** A StoryReport, or a Result-wrapped one (e.g., from parseStoryReport). */
62
62
  report: StoryReport | Result<StoryReport>;
@@ -66,7 +66,7 @@ interface ReportInteractiveProps {
66
66
  renderers?: BuiltinRenderers;
67
67
  className?: string;
68
68
  title?: string;
69
- dataTheme?: "light" | "dark";
69
+ dataTheme?: 'light' | 'dark';
70
70
  /**
71
71
  * Drop the report's own title block (`<h1>` + summary + meta) while keeping
72
72
  * the search and filter controls. Use when the surrounding page already shows
@@ -2,6 +2,37 @@ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { ReportDocCustom, ReportDocMermaid, ReportDocCode, ReportDocSection, StoryReport } from 'executable-stories-core';
4
4
 
5
+ type ScenarioRunStatus = "passed" | "failed" | "skipped" | "pending";
6
+ /** One historical run of a scenario, oldest → newest in a history array. */
7
+ interface ScenarioRunEvent {
8
+ /** Epoch ms the run started. */
9
+ timestamp: number;
10
+ status: ScenarioRunStatus;
11
+ runId?: string;
12
+ durationMs?: number;
13
+ commitSha?: string;
14
+ branch?: string;
15
+ }
16
+ /** Recent run events keyed by ReportScenario.id. */
17
+ type ScenarioHistoryMap = Record<string, ScenarioRunEvent[]>;
18
+
19
+ /**
20
+ * Renderer registries — extension points for custom rendering of doc entries.
21
+ *
22
+ * - customRenderers: keyed by user-defined `story.custom({ type })` strings.
23
+ * - renderers: optional overrides for the three heavy built-ins
24
+ * (mermaid, code, section). Other doc kinds are not overridable — drop
25
+ * to primitives if you need a fully custom layout.
26
+ */
27
+
28
+ type CustomRenderer = (entry: ReportDocCustom) => ReactNode;
29
+ type CustomRenderers = Record<string, CustomRenderer>;
30
+ interface BuiltinRenderers {
31
+ mermaid?: (entry: ReportDocMermaid) => ReactNode;
32
+ code?: (entry: ReportDocCode) => ReactNode;
33
+ section?: (entry: ReportDocSection) => ReactNode;
34
+ }
35
+
5
36
  /**
6
37
  * Result<T> — explicit success/error type matching the cookbook convention.
7
38
  *
@@ -26,37 +57,6 @@ interface ReportParseError {
26
57
  }
27
58
  type ReportParseErrorCode = "INVALID_INPUT" | "SCHEMA_VERSION_MISMATCH" | "VALIDATION_FAILED";
28
59
 
29
- /**
30
- * Renderer registries — extension points for custom rendering of doc entries.
31
- *
32
- * - customRenderers: keyed by user-defined `story.custom({ type })` strings.
33
- * - renderers: optional overrides for the three heavy built-ins
34
- * (mermaid, code, section). Other doc kinds are not overridable — drop
35
- * to primitives if you need a fully custom layout.
36
- */
37
-
38
- type CustomRenderer = (entry: ReportDocCustom) => ReactNode;
39
- type CustomRenderers = Record<string, CustomRenderer>;
40
- interface BuiltinRenderers {
41
- mermaid?: (entry: ReportDocMermaid) => ReactNode;
42
- code?: (entry: ReportDocCode) => ReactNode;
43
- section?: (entry: ReportDocSection) => ReactNode;
44
- }
45
-
46
- type ScenarioRunStatus = "passed" | "failed" | "skipped" | "pending";
47
- /** One historical run of a scenario, oldest → newest in a history array. */
48
- interface ScenarioRunEvent {
49
- /** Epoch ms the run started. */
50
- timestamp: number;
51
- status: ScenarioRunStatus;
52
- runId?: string;
53
- durationMs?: number;
54
- commitSha?: string;
55
- branch?: string;
56
- }
57
- /** Recent run events keyed by ReportScenario.id. */
58
- type ScenarioHistoryMap = Record<string, ScenarioRunEvent[]>;
59
-
60
60
  interface ReportInteractiveProps {
61
61
  /** A StoryReport, or a Result-wrapped one (e.g., from parseStoryReport). */
62
62
  report: StoryReport | Result<StoryReport>;
@@ -66,7 +66,7 @@ interface ReportInteractiveProps {
66
66
  renderers?: BuiltinRenderers;
67
67
  className?: string;
68
68
  title?: string;
69
- dataTheme?: "light" | "dark";
69
+ dataTheme?: 'light' | 'dark';
70
70
  /**
71
71
  * Drop the report's own title block (`<h1>` + summary + meta) while keeping
72
72
  * the search and filter controls. Use when the surrounding page already shows