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 CHANGED
@@ -1900,7 +1900,7 @@ function ReportSpanGraph() {
1900
1900
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { id: "es-span-graph-heading", className: "text-base font-semibold text-foreground", children: "Architecture, as it ran" }),
1901
1901
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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." }),
1902
1902
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DocMermaid, { entry: { kind: "mermaid", phase: "static", code } }),
1903
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("table", { className: "mt-2 w-full text-left text-sm", children: [
1903
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("table", { className: "mt-2 w-full border-collapse text-left text-sm", children: [
1904
1904
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("caption", { className: "sr-only", children: "Each component and the scenarios that exercised it" }),
1905
1905
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("tr", { className: "text-xs text-muted-foreground", children: [
1906
1906
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("th", { scope: "col", className: "py-1 pr-4 font-medium", children: "Component" }),
@@ -1913,7 +1913,7 @@ function ReportSpanGraph() {
1913
1913
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MarkBadge, { node })
1914
1914
  ] }),
1915
1915
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("td", { className: "py-1.5 pr-4 text-xs text-muted-foreground", children: LANE_LABEL[node.kind] }),
1916
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("td", { className: "py-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: "flex flex-col gap-0.5", children: node.scenarioIds.map((id) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("a", { href: `#${id}`, className: "text-xs underline underline-offset-2", children: titleById.get(id) ?? id }) }, id)) }) })
1916
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("td", { className: "py-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: "flex flex-col gap-0.5", children: node.scenarioIds.map((id) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("a", { href: `#${id}`, className: "text-xs text-link underline underline-offset-2 hover:text-foreground", children: titleById.get(id) ?? id }) }, id)) }) })
1917
1917
  ] }, node.id)) })
1918
1918
  ] })
1919
1919
  ] });
@@ -1922,7 +1922,7 @@ function ReportSpanGraph() {
1922
1922
  // src/components/Report.tsx
1923
1923
  var import_jsx_runtime39 = require("react/jsx-runtime");
1924
1924
  function Report(props) {
1925
- const { report, customRenderers, renderers, className, title, dataTheme } = props;
1925
+ const { report, customRenderers, renderers, className, title, dataTheme, architecture = false } = props;
1926
1926
  const result = unwrapReport(report);
1927
1927
  if (!result.ok) {
1928
1928
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportErrorShell, { error: result.error, className, title, dataTheme });
@@ -1931,7 +1931,7 @@ function Report(props) {
1931
1931
  const hasContent = data.features.length > 0;
1932
1932
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportRoot, { report: data, customRenderers, renderers, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("main", { className: cn("es-report", className), "aria-label": title ?? "Test report", "data-theme": dataTheme, children: [
1933
1933
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("header", { className: "es-report-header", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportTitleBlock, { title }) }),
1934
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportSpanGraph, {}),
1934
+ architecture ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportSpanGraph, {}) : null,
1935
1935
  hasContent ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportFeatureList, {}) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportEmpty, {})
1936
1936
  ] }) });
1937
1937
  }
@@ -1966,7 +1966,10 @@ function MermaidView({ entry, load }) {
1966
1966
  mermaid.initialize({
1967
1967
  startOnLoad: false,
1968
1968
  securityLevel: "strict",
1969
- theme: prefersDark(ref.current) ? "dark" : "default"
1969
+ // "neutral" in light: the same theme the static, no-JS render uses
1970
+ // in ssr-entry, so a diagram keeps its colours when the island takes
1971
+ // over.
1972
+ theme: prefersDark(ref.current) ? "dark" : "neutral"
1970
1973
  });
1971
1974
  await mermaid.parse(entry.code);
1972
1975
  const id = `es-mermaid-${Math.random().toString(36).slice(2)}`;