executable-stories-react 0.16.0 → 0.17.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/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 +43 -15
- package/dist/interactive.cjs.map +1 -1
- package/dist/interactive.d.cts +6 -0
- package/dist/interactive.d.ts +6 -0
- package/dist/interactive.js +43 -15
- package/dist/interactive.js.map +1 -1
- package/dist/report-island.global.js +9 -9
- 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 +2 -2
package/dist/ssr.cjs
CHANGED
|
@@ -1824,7 +1824,7 @@ function ReportSpanGraph() {
|
|
|
1824
1824
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { id: "es-span-graph-heading", className: "text-base font-semibold text-foreground", children: "Architecture, as it ran" }),
|
|
1825
1825
|
/* @__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." }),
|
|
1826
1826
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DocMermaid, { entry: { kind: "mermaid", phase: "static", code } }),
|
|
1827
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("table", { className: "mt-2 w-full text-left text-sm", children: [
|
|
1827
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("table", { className: "mt-2 w-full border-collapse text-left text-sm", children: [
|
|
1828
1828
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("caption", { className: "sr-only", children: "Each component and the scenarios that exercised it" }),
|
|
1829
1829
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("tr", { className: "text-xs text-muted-foreground", children: [
|
|
1830
1830
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("th", { scope: "col", className: "py-1 pr-4 font-medium", children: "Component" }),
|
|
@@ -1837,7 +1837,7 @@ function ReportSpanGraph() {
|
|
|
1837
1837
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MarkBadge, { node })
|
|
1838
1838
|
] }),
|
|
1839
1839
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("td", { className: "py-1.5 pr-4 text-xs text-muted-foreground", children: LANE_LABEL[node.kind] }),
|
|
1840
|
-
/* @__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)) }) })
|
|
1840
|
+
/* @__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)) }) })
|
|
1841
1841
|
] }, node.id)) })
|
|
1842
1842
|
] })
|
|
1843
1843
|
] });
|
|
@@ -1846,7 +1846,7 @@ function ReportSpanGraph() {
|
|
|
1846
1846
|
// src/components/Report.tsx
|
|
1847
1847
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1848
1848
|
function Report(props) {
|
|
1849
|
-
const { report, customRenderers, renderers, className, title, dataTheme } = props;
|
|
1849
|
+
const { report, customRenderers, renderers, className, title, dataTheme, architecture = false } = props;
|
|
1850
1850
|
const result = unwrapReport(report);
|
|
1851
1851
|
if (!result.ok) {
|
|
1852
1852
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportErrorShell, { error: result.error, className, title, dataTheme });
|
|
@@ -1855,7 +1855,7 @@ function Report(props) {
|
|
|
1855
1855
|
const hasContent = data.features.length > 0;
|
|
1856
1856
|
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: [
|
|
1857
1857
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("header", { className: "es-report-header", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportTitleBlock, { title }) }),
|
|
1858
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportSpanGraph, {}),
|
|
1858
|
+
architecture ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportSpanGraph, {}) : null,
|
|
1859
1859
|
hasContent ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportFeatureList, {}) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReportEmpty, {})
|
|
1860
1860
|
] }) });
|
|
1861
1861
|
}
|
|
@@ -1871,7 +1871,7 @@ function escapeJsonForScript(json) {
|
|
|
1871
1871
|
var HLJS_URL = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/es/highlight.min.js";
|
|
1872
1872
|
var HLJS_CSS_LIGHT = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css";
|
|
1873
1873
|
var HLJS_CSS_DARK = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css";
|
|
1874
|
-
var MERMAID_URL = "https://cdn.jsdelivr.net/npm/mermaid@
|
|
1874
|
+
var MERMAID_URL = "https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs";
|
|
1875
1875
|
function cdnAssets(syntaxHighlighting, mermaid) {
|
|
1876
1876
|
const headParts = [];
|
|
1877
1877
|
const imports = [];
|
|
@@ -1917,10 +1917,11 @@ function renderReportToHtml(report, options = {}) {
|
|
|
1917
1917
|
staleAfterDays = 7,
|
|
1918
1918
|
scenarioHistory,
|
|
1919
1919
|
share = false,
|
|
1920
|
-
shareCommand = ""
|
|
1920
|
+
shareCommand = "",
|
|
1921
|
+
architecture = false
|
|
1921
1922
|
} = options;
|
|
1922
1923
|
const markup = (0, import_server.renderToStaticMarkup)(
|
|
1923
|
-
(0, import_react12.createElement)(Report, { report, title })
|
|
1924
|
+
(0, import_react12.createElement)(Report, { report, title, architecture })
|
|
1924
1925
|
);
|
|
1925
1926
|
const cdn = cdnAssets(syntaxHighlighting, mermaid);
|
|
1926
1927
|
const parsed = unwrapReport(report);
|
|
@@ -1930,8 +1931,9 @@ function renderReportToHtml(report, options = {}) {
|
|
|
1930
1931
|
const historyScript = interactive && scenarioHistory && Object.keys(scenarioHistory).length > 0 ? `<script type="application/json" id="${HISTORY_ID}">${escapeJsonForScript(JSON.stringify(scenarioHistory))}</script>` : "";
|
|
1931
1932
|
const islandTag = interactive ? `<script>${islandScript}</script>` : "";
|
|
1932
1933
|
const cdnBody = interactive ? "" : cdn.body;
|
|
1934
|
+
const architectureAttr = architecture ? ` data-es-architecture="true"` : "";
|
|
1933
1935
|
const shareAttrs = share ? ` data-es-share="true"${shareCommand ? ` data-es-share-cmd="${escapeHtml(shareCommand)}"` : ""}` : "";
|
|
1934
|
-
const islandConfigAttrs = interactive ? ` data-es-syntax="${syntaxHighlighting ? "true" : "false"}" data-es-mermaid="${mermaid ? "true" : "false"}" data-es-stale-days="${Number.isFinite(staleAfterDays) && staleAfterDays >= 0 ? staleAfterDays : 7}"${shareAttrs}` : "";
|
|
1936
|
+
const islandConfigAttrs = interactive ? ` data-es-syntax="${syntaxHighlighting ? "true" : "false"}" data-es-mermaid="${mermaid ? "true" : "false"}" data-es-stale-days="${Number.isFinite(staleAfterDays) && staleAfterDays >= 0 ? staleAfterDays : 7}"${shareAttrs}${architectureAttr}` : "";
|
|
1935
1937
|
const rootAttrs = interactive ? ` id="${ROOT_ID}" data-title="${escapeHtml(title)}"${islandConfigAttrs}` : "";
|
|
1936
1938
|
return `<!DOCTYPE html>
|
|
1937
1939
|
<html lang="${escapeHtml(lang)}" data-theme="${theme === "dark" ? "dark" : "light"}">
|