executable-stories-react 0.16.0 → 0.17.1
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/dist/index.cjs +8 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/interactive.cjs +38 -16
- package/dist/interactive.cjs.map +1 -1
- package/dist/interactive.d.cts +5 -0
- package/dist/interactive.d.ts +5 -0
- package/dist/interactive.js +38 -16
- package/dist/interactive.js.map +1 -1
- package/dist/report-island.global.js +14 -14
- package/dist/ssr.cjs +10 -8
- package/dist/ssr.cjs.map +1 -1
- package/dist/ssr.d.cts +2 -0
- package/dist/ssr.d.ts +2 -0
- package/dist/ssr.js +10 -8
- package/dist/ssr.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -63,6 +63,12 @@ interface ReportProps {
|
|
|
63
63
|
title?: string;
|
|
64
64
|
/** Optional theme attribute scope. Use to force "light" or "dark". */
|
|
65
65
|
dataTheme?: "light" | "dark";
|
|
66
|
+
/**
|
|
67
|
+
* Draw the "Architecture, as it ran" section above the features. Off by
|
|
68
|
+
* default: only an instrumented run has anything to draw. `--html-architecture`
|
|
69
|
+
* turns it on.
|
|
70
|
+
*/
|
|
71
|
+
architecture?: boolean;
|
|
66
72
|
}
|
|
67
73
|
declare function Report(props: ReportProps): react.JSX.Element;
|
|
68
74
|
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,12 @@ interface ReportProps {
|
|
|
63
63
|
title?: string;
|
|
64
64
|
/** Optional theme attribute scope. Use to force "light" or "dark". */
|
|
65
65
|
dataTheme?: "light" | "dark";
|
|
66
|
+
/**
|
|
67
|
+
* Draw the "Architecture, as it ran" section above the features. Off by
|
|
68
|
+
* default: only an instrumented run has anything to draw. `--html-architecture`
|
|
69
|
+
* turns it on.
|
|
70
|
+
*/
|
|
71
|
+
architecture?: boolean;
|
|
66
72
|
}
|
|
67
73
|
declare function Report(props: ReportProps): react.JSX.Element;
|
|
68
74
|
|
package/dist/index.js
CHANGED
|
@@ -1811,7 +1811,7 @@ function ReportSpanGraph() {
|
|
|
1811
1811
|
/* @__PURE__ */ jsx37("h2", { id: "es-span-graph-heading", className: "text-base font-semibold text-foreground", children: "Architecture, as it ran" }),
|
|
1812
1812
|
/* @__PURE__ */ jsx37("p", { className: "mt-1 text-sm text-muted-foreground", children: "Derived from this run\u2019s traces. Every component was named by a span while a scenario ran, so nothing here is inferred from the code. Instrumented, exercised paths only: a component no scenario reaches does not appear." }),
|
|
1813
1813
|
/* @__PURE__ */ jsx37(DocMermaid, { entry: { kind: "mermaid", phase: "static", code } }),
|
|
1814
|
-
/* @__PURE__ */ jsxs25("table", { className: "mt-2 w-full text-left text-sm", children: [
|
|
1814
|
+
/* @__PURE__ */ jsxs25("table", { className: "mt-2 w-full border-collapse text-left text-sm", children: [
|
|
1815
1815
|
/* @__PURE__ */ jsx37("caption", { className: "sr-only", children: "Each component and the scenarios that exercised it" }),
|
|
1816
1816
|
/* @__PURE__ */ jsx37("thead", { children: /* @__PURE__ */ jsxs25("tr", { className: "text-xs text-muted-foreground", children: [
|
|
1817
1817
|
/* @__PURE__ */ jsx37("th", { scope: "col", className: "py-1 pr-4 font-medium", children: "Component" }),
|
|
@@ -1824,7 +1824,7 @@ function ReportSpanGraph() {
|
|
|
1824
1824
|
/* @__PURE__ */ jsx37(MarkBadge, { node })
|
|
1825
1825
|
] }),
|
|
1826
1826
|
/* @__PURE__ */ jsx37("td", { className: "py-1.5 pr-4 text-xs text-muted-foreground", children: LANE_LABEL[node.kind] }),
|
|
1827
|
-
/* @__PURE__ */ jsx37("td", { className: "py-1.5", children: /* @__PURE__ */ jsx37("ul", { className: "flex flex-col gap-0.5", children: node.scenarioIds.map((id) => /* @__PURE__ */ jsx37("li", { children: /* @__PURE__ */ jsx37("a", { href: `#${id}`, className: "text-xs underline underline-offset-2", children: titleById.get(id) ?? id }) }, id)) }) })
|
|
1827
|
+
/* @__PURE__ */ jsx37("td", { className: "py-1.5", children: /* @__PURE__ */ jsx37("ul", { className: "flex flex-col gap-0.5", children: node.scenarioIds.map((id) => /* @__PURE__ */ jsx37("li", { children: /* @__PURE__ */ jsx37("a", { href: `#${id}`, className: "text-xs text-link underline underline-offset-2 hover:text-foreground", children: titleById.get(id) ?? id }) }, id)) }) })
|
|
1828
1828
|
] }, node.id)) })
|
|
1829
1829
|
] })
|
|
1830
1830
|
] });
|
|
@@ -1833,7 +1833,7 @@ function ReportSpanGraph() {
|
|
|
1833
1833
|
// src/components/Report.tsx
|
|
1834
1834
|
import { jsx as jsx38, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1835
1835
|
function Report(props) {
|
|
1836
|
-
const { report, customRenderers, renderers, className, title, dataTheme } = props;
|
|
1836
|
+
const { report, customRenderers, renderers, className, title, dataTheme, architecture = false } = props;
|
|
1837
1837
|
const result = unwrapReport(report);
|
|
1838
1838
|
if (!result.ok) {
|
|
1839
1839
|
return /* @__PURE__ */ jsx38(ReportErrorShell, { error: result.error, className, title, dataTheme });
|
|
@@ -1842,7 +1842,7 @@ function Report(props) {
|
|
|
1842
1842
|
const hasContent = data.features.length > 0;
|
|
1843
1843
|
return /* @__PURE__ */ jsx38(ReportRoot, { report: data, customRenderers, renderers, children: /* @__PURE__ */ jsxs26("main", { className: cn("es-report", className), "aria-label": title ?? "Test report", "data-theme": dataTheme, children: [
|
|
1844
1844
|
/* @__PURE__ */ jsx38("header", { className: "es-report-header", children: /* @__PURE__ */ jsx38(ReportTitleBlock, { title }) }),
|
|
1845
|
-
/* @__PURE__ */ jsx38(ReportSpanGraph, {}),
|
|
1845
|
+
architecture ? /* @__PURE__ */ jsx38(ReportSpanGraph, {}) : null,
|
|
1846
1846
|
hasContent ? /* @__PURE__ */ jsx38(ReportFeatureList, {}) : /* @__PURE__ */ jsx38(ReportEmpty, {})
|
|
1847
1847
|
] }) });
|
|
1848
1848
|
}
|
|
@@ -1877,7 +1877,10 @@ function MermaidView({ entry, load }) {
|
|
|
1877
1877
|
mermaid.initialize({
|
|
1878
1878
|
startOnLoad: false,
|
|
1879
1879
|
securityLevel: "strict",
|
|
1880
|
-
|
|
1880
|
+
// "neutral" in light: the same theme the static, no-JS render uses
|
|
1881
|
+
// in ssr-entry, so a diagram keeps its colours when the island takes
|
|
1882
|
+
// over.
|
|
1883
|
+
theme: prefersDark(ref.current) ? "dark" : "neutral"
|
|
1881
1884
|
});
|
|
1882
1885
|
await mermaid.parse(entry.code);
|
|
1883
1886
|
const id = `es-mermaid-${Math.random().toString(36).slice(2)}`;
|