executable-stories-react 0.18.0 → 0.20.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 +83 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +97 -34
- package/dist/index.js.map +1 -1
- package/dist/interactive.cjs +71 -20
- package/dist/interactive.cjs.map +1 -1
- package/dist/interactive.js +96 -45
- package/dist/interactive.js.map +1 -1
- package/dist/parse.cjs +12 -0
- package/dist/parse.cjs.map +1 -1
- package/dist/parse.js +12 -0
- package/dist/parse.js.map +1 -1
- package/dist/report-island.global.js +62 -58
- package/dist/ssr.cjs +71 -20
- package/dist/ssr.cjs.map +1 -1
- package/dist/ssr.js +83 -32
- package/dist/ssr.js.map +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +20 -20
package/dist/interactive.js
CHANGED
|
@@ -520,7 +520,7 @@ function ReportDocEntries({ entries }) {
|
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
// src/components/ReportSteps.tsx
|
|
523
|
-
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
523
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
524
524
|
var STEP_GLYPH = {
|
|
525
525
|
passed: "\u2713",
|
|
526
526
|
failed: "\u2717",
|
|
@@ -597,6 +597,23 @@ function ReportStepItem({
|
|
|
597
597
|
children: step.errorMessage
|
|
598
598
|
}
|
|
599
599
|
) : null,
|
|
600
|
+
step.expected !== void 0 || step.actual !== void 0 ? /* @__PURE__ */ jsxs10(
|
|
601
|
+
"dl",
|
|
602
|
+
{
|
|
603
|
+
"data-slot": "step-comparison",
|
|
604
|
+
className: "mt-1.5 ml-6 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-xs",
|
|
605
|
+
children: [
|
|
606
|
+
step.expected !== void 0 ? /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
607
|
+
/* @__PURE__ */ jsx19("dt", { className: "text-muted-foreground", children: "Expected" }),
|
|
608
|
+
/* @__PURE__ */ jsx19("dd", { className: "overflow-x-auto whitespace-pre-wrap text-pass", children: step.expected })
|
|
609
|
+
] }) : null,
|
|
610
|
+
step.actual !== void 0 ? /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
611
|
+
/* @__PURE__ */ jsx19("dt", { className: "text-muted-foreground", children: "Actual" }),
|
|
612
|
+
/* @__PURE__ */ jsx19("dd", { className: "overflow-x-auto whitespace-pre-wrap text-fail", children: step.actual })
|
|
613
|
+
] }) : null
|
|
614
|
+
]
|
|
615
|
+
}
|
|
616
|
+
) : null,
|
|
600
617
|
step.docEntries.length > 0 ? /* @__PURE__ */ jsx19("div", { "data-es-docs": true, className: "mt-2 ml-6", children: /* @__PURE__ */ jsx19(ReportDocEntries, { entries: step.docEntries }) }) : null
|
|
601
618
|
]
|
|
602
619
|
}
|
|
@@ -720,43 +737,77 @@ function StateCardView({ card }) {
|
|
|
720
737
|
}
|
|
721
738
|
|
|
722
739
|
// src/components/ReportAttachments.tsx
|
|
723
|
-
import { Fragment as
|
|
740
|
+
import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
741
|
+
function attachmentText(att) {
|
|
742
|
+
if (att.contentEncoding !== "BASE64") return att.body;
|
|
743
|
+
try {
|
|
744
|
+
return new TextDecoder().decode(Uint8Array.from(atob(att.body), (c) => c.charCodeAt(0)));
|
|
745
|
+
} catch {
|
|
746
|
+
return void 0;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
function preview(att) {
|
|
750
|
+
const type = att.mediaType.split(";")[0].trim().toLowerCase();
|
|
751
|
+
const text = attachmentText(att);
|
|
752
|
+
if (text === void 0) return null;
|
|
753
|
+
if (type === "text/plain") {
|
|
754
|
+
return /* @__PURE__ */ jsx21("pre", { className: "max-h-96 overflow-auto rounded-md border border-border bg-muted/40 p-3 text-xs whitespace-pre-wrap", children: text });
|
|
755
|
+
}
|
|
756
|
+
if (type === "text/markdown") {
|
|
757
|
+
return /* @__PURE__ */ jsx21(
|
|
758
|
+
"div",
|
|
759
|
+
{
|
|
760
|
+
className: "es-doc-prose prose prose-sm max-w-none rounded-md border border-border p-3",
|
|
761
|
+
dangerouslySetInnerHTML: { __html: safeMarkdownHtml(text) }
|
|
762
|
+
}
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
if (type === "text/html") {
|
|
766
|
+
return /* @__PURE__ */ jsx21(DocHtml, { entry: { kind: "html", content: text, title: att.name, phase: "runtime" } });
|
|
767
|
+
}
|
|
768
|
+
return null;
|
|
769
|
+
}
|
|
724
770
|
function ReportAttachments({ attachments }) {
|
|
725
771
|
if (attachments.length === 0) return null;
|
|
726
772
|
return (
|
|
727
773
|
// role="group" (not a labelled <section>) so multiple scenarios' attachment
|
|
728
774
|
// blocks don't create duplicate "Attachments" region landmarks.
|
|
729
775
|
/* @__PURE__ */ jsx21("div", { role: "group", "aria-label": "Attachments", className: "mt-3 flex flex-col gap-2", children: attachments.map((att, i) => {
|
|
730
|
-
const dataUri = att.contentEncoding === "BASE64" ? `data:${att.mediaType};base64,${att.body}` : `data:${att.mediaType},${encodeURIComponent(att.body)}`;
|
|
731
|
-
const
|
|
732
|
-
|
|
776
|
+
const dataUri = att.external ? void 0 : att.contentEncoding === "BASE64" ? `data:${att.mediaType};base64,${att.body}` : `data:${att.mediaType},${encodeURIComponent(att.body)}`;
|
|
777
|
+
const href = dataUri ?? safeUrl(att.body);
|
|
778
|
+
const imageSrc = dataUri ?? safeImageUrl(att.body);
|
|
779
|
+
const isImage = att.mediaType.startsWith("image/") && imageSrc !== void 0;
|
|
780
|
+
return /* @__PURE__ */ jsx21("figure", { className: "m-0", children: isImage ? /* @__PURE__ */ jsxs12(Fragment7, { children: [
|
|
733
781
|
/* @__PURE__ */ jsx21(
|
|
734
782
|
"img",
|
|
735
783
|
{
|
|
736
|
-
src:
|
|
784
|
+
src: imageSrc,
|
|
737
785
|
alt: att.name,
|
|
738
786
|
loading: "lazy",
|
|
739
787
|
className: "max-w-full rounded-md border border-border"
|
|
740
788
|
}
|
|
741
789
|
),
|
|
742
790
|
/* @__PURE__ */ jsx21("figcaption", { className: "mt-1 text-xs text-muted-foreground", children: att.name })
|
|
743
|
-
] }) : /* @__PURE__ */ jsxs12(
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
"
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
791
|
+
] }) : /* @__PURE__ */ jsxs12(Fragment7, { children: [
|
|
792
|
+
att.external ? null : preview(att),
|
|
793
|
+
/* @__PURE__ */ jsxs12(
|
|
794
|
+
"a",
|
|
795
|
+
{
|
|
796
|
+
href,
|
|
797
|
+
download: att.name,
|
|
798
|
+
className: "text-xs text-link underline underline-offset-2",
|
|
799
|
+
children: [
|
|
800
|
+
att.name,
|
|
801
|
+
" ",
|
|
802
|
+
/* @__PURE__ */ jsxs12("span", { className: "text-muted-foreground", children: [
|
|
803
|
+
"(",
|
|
804
|
+
att.mediaType,
|
|
805
|
+
")"
|
|
806
|
+
] })
|
|
807
|
+
]
|
|
808
|
+
}
|
|
809
|
+
)
|
|
810
|
+
] }) }, `${att.name}-${i}`);
|
|
760
811
|
}) })
|
|
761
812
|
);
|
|
762
813
|
}
|
|
@@ -950,7 +1001,7 @@ function diffSinceLastRun(history, scenarios) {
|
|
|
950
1001
|
}
|
|
951
1002
|
|
|
952
1003
|
// src/components/ScenarioRunHistory.tsx
|
|
953
|
-
import { Fragment as
|
|
1004
|
+
import { Fragment as Fragment8, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
954
1005
|
var MAX_DOTS = 10;
|
|
955
1006
|
var DOT_COLOR = {
|
|
956
1007
|
passed: "bg-pass",
|
|
@@ -970,7 +1021,7 @@ function ScenarioRunHistory({ scenarioId }) {
|
|
|
970
1021
|
const recent = entries.slice(-MAX_DOTS);
|
|
971
1022
|
const flaky = flakinessOf(recent) === "flaky";
|
|
972
1023
|
const summary = flaky ? `${describeRunHistory(recent)} \xB7 Flaky` : describeRunHistory(recent);
|
|
973
|
-
return /* @__PURE__ */ jsxs14(
|
|
1024
|
+
return /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
974
1025
|
flaky ? /* @__PURE__ */ jsx23(Badge, { variant: "pending", "aria-label": "Flaky: status flips between recent runs", title: summary, children: "Flaky" }) : null,
|
|
975
1026
|
/* @__PURE__ */ jsx23(
|
|
976
1027
|
"span",
|
|
@@ -1392,9 +1443,9 @@ function ReportScenario({ scenario, hideTitle = false }) {
|
|
|
1392
1443
|
}
|
|
1393
1444
|
|
|
1394
1445
|
// src/components/ReportScenarioList.tsx
|
|
1395
|
-
import { Fragment as
|
|
1446
|
+
import { Fragment as Fragment9, jsx as jsx27 } from "react/jsx-runtime";
|
|
1396
1447
|
function ReportScenarioList({ feature }) {
|
|
1397
|
-
return /* @__PURE__ */ jsx27(
|
|
1448
|
+
return /* @__PURE__ */ jsx27(Fragment9, { children: feature.scenarios.map((scenario) => /* @__PURE__ */ jsx27(ReportScenario, { scenario }, scenario.id)) });
|
|
1398
1449
|
}
|
|
1399
1450
|
|
|
1400
1451
|
// src/components/ReportFeatureIntro.tsx
|
|
@@ -1432,7 +1483,7 @@ function featureKindLabel(kind) {
|
|
|
1432
1483
|
}
|
|
1433
1484
|
|
|
1434
1485
|
// src/components/ReportFeature.tsx
|
|
1435
|
-
import { Fragment as
|
|
1486
|
+
import { Fragment as Fragment10, jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1436
1487
|
function ReportFeature({ feature }) {
|
|
1437
1488
|
const titleId = `${feature.id}-title`;
|
|
1438
1489
|
const bodyId = `${feature.id}-body`;
|
|
@@ -1492,14 +1543,14 @@ function ReportFeature({ feature }) {
|
|
|
1492
1543
|
s.failed,
|
|
1493
1544
|
" failed"
|
|
1494
1545
|
] }),
|
|
1495
|
-
s.skipped > 0 ? /* @__PURE__ */ jsxs19(
|
|
1546
|
+
s.skipped > 0 ? /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
1496
1547
|
/* @__PURE__ */ jsx29("span", { "aria-hidden": true, children: "\xB7" }),
|
|
1497
1548
|
/* @__PURE__ */ jsxs19("span", { children: [
|
|
1498
1549
|
s.skipped,
|
|
1499
1550
|
" skipped"
|
|
1500
1551
|
] })
|
|
1501
1552
|
] }) : null,
|
|
1502
|
-
s.pending > 0 ? /* @__PURE__ */ jsxs19(
|
|
1553
|
+
s.pending > 0 ? /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
1503
1554
|
/* @__PURE__ */ jsx29("span", { "aria-hidden": true, children: "\xB7" }),
|
|
1504
1555
|
/* @__PURE__ */ jsxs19("span", { children: [
|
|
1505
1556
|
s.pending,
|
|
@@ -1686,7 +1737,7 @@ function ReportSchemaError({ error }) {
|
|
|
1686
1737
|
}
|
|
1687
1738
|
|
|
1688
1739
|
// src/components/ReportShell.tsx
|
|
1689
|
-
import { Fragment as
|
|
1740
|
+
import { Fragment as Fragment11, jsx as jsx34, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1690
1741
|
function ReportErrorShell({
|
|
1691
1742
|
error,
|
|
1692
1743
|
className,
|
|
@@ -2224,7 +2275,7 @@ function listFailures(report) {
|
|
|
2224
2275
|
|
|
2225
2276
|
// src/interactive/ReportAgentFilterNotice.tsx
|
|
2226
2277
|
import { Bot, X } from "lucide-react";
|
|
2227
|
-
import { Fragment as
|
|
2278
|
+
import { Fragment as Fragment12, jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2228
2279
|
function ReportAgentFilterNotice({
|
|
2229
2280
|
applied,
|
|
2230
2281
|
onReset,
|
|
@@ -2244,7 +2295,7 @@ function ReportAgentFilterNotice({
|
|
|
2244
2295
|
/* @__PURE__ */ jsx40(Bot, { "aria-hidden": true, className: "size-4 shrink-0 text-primary" }),
|
|
2245
2296
|
/* @__PURE__ */ jsxs26("span", { className: "min-w-0 flex-1", children: [
|
|
2246
2297
|
"An agent filtered this report",
|
|
2247
|
-
terms.length > 0 ? /* @__PURE__ */ jsxs26(
|
|
2298
|
+
terms.length > 0 ? /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
|
2248
2299
|
" to ",
|
|
2249
2300
|
terms.join(" \xB7 ")
|
|
2250
2301
|
] }) : null,
|
|
@@ -2413,7 +2464,7 @@ function ReportFilters({
|
|
|
2413
2464
|
|
|
2414
2465
|
// src/interactive/ReportFreshness.tsx
|
|
2415
2466
|
import { useEffect as useEffect3, useState as useState5 } from "react";
|
|
2416
|
-
import { Fragment as
|
|
2467
|
+
import { Fragment as Fragment13, jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2417
2468
|
function ReportFreshness({ lastRunMs, ciUrl, staleAfterDays, nowMs }) {
|
|
2418
2469
|
const [now, setNow] = useState5(nowMs);
|
|
2419
2470
|
useEffect3(() => {
|
|
@@ -2447,7 +2498,7 @@ function ReportFreshness({ lastRunMs, ciUrl, staleAfterDays, nowMs }) {
|
|
|
2447
2498
|
return /* @__PURE__ */ jsxs29("p", { className: "es-freshness", "aria-label": "Report freshness", children: [
|
|
2448
2499
|
"Verified ",
|
|
2449
2500
|
age,
|
|
2450
|
-
runLink ? /* @__PURE__ */ jsxs29(
|
|
2501
|
+
runLink ? /* @__PURE__ */ jsxs29(Fragment13, { children: [
|
|
2451
2502
|
" \xB7 ",
|
|
2452
2503
|
runLink
|
|
2453
2504
|
] }) : null
|
|
@@ -2455,10 +2506,10 @@ function ReportFreshness({ lastRunMs, ciUrl, staleAfterDays, nowMs }) {
|
|
|
2455
2506
|
}
|
|
2456
2507
|
|
|
2457
2508
|
// src/interactive/ReportLastRunDelta.tsx
|
|
2458
|
-
import { Fragment as
|
|
2509
|
+
import { Fragment as Fragment14, jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2459
2510
|
var MAX_LINKS = 5;
|
|
2460
2511
|
function ScenarioLinks({ scenarios, tone }) {
|
|
2461
|
-
return /* @__PURE__ */ jsxs30(
|
|
2512
|
+
return /* @__PURE__ */ jsxs30(Fragment14, { children: [
|
|
2462
2513
|
scenarios.slice(0, MAX_LINKS).map((s, i) => /* @__PURE__ */ jsxs30("span", { children: [
|
|
2463
2514
|
i > 0 ? ", " : "",
|
|
2464
2515
|
/* @__PURE__ */ jsx44("a", { href: `#${s.id}`, className: cn("underline underline-offset-2 hover:no-underline", tone), children: s.title })
|
|
@@ -2655,7 +2706,7 @@ function Button({
|
|
|
2655
2706
|
}
|
|
2656
2707
|
|
|
2657
2708
|
// src/interactive/ReportShare.tsx
|
|
2658
|
-
import { Fragment as
|
|
2709
|
+
import { Fragment as Fragment15, jsx as jsx47, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2659
2710
|
var DEFAULT_SHARE_COMMAND = "npx executable-stories share reports/";
|
|
2660
2711
|
function ReportShare({
|
|
2661
2712
|
command = DEFAULT_SHARE_COMMAND,
|
|
@@ -2669,7 +2720,7 @@ function ReportShare({
|
|
|
2669
2720
|
if (open && !dialog.open) dialog.showModal();
|
|
2670
2721
|
else if (!open && dialog.open) dialog.close();
|
|
2671
2722
|
}, [open]);
|
|
2672
|
-
return /* @__PURE__ */ jsxs32(
|
|
2723
|
+
return /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
2673
2724
|
/* @__PURE__ */ jsxs32(
|
|
2674
2725
|
Button,
|
|
2675
2726
|
{
|
|
@@ -2764,7 +2815,7 @@ function diffSinceVisit(previous, report) {
|
|
|
2764
2815
|
}
|
|
2765
2816
|
|
|
2766
2817
|
// src/interactive/ReportSinceLastVisit.tsx
|
|
2767
|
-
import { Fragment as
|
|
2818
|
+
import { Fragment as Fragment16, jsx as jsx48, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2768
2819
|
var KEY = "es-last-visit";
|
|
2769
2820
|
var MAX_LINKS2 = 5;
|
|
2770
2821
|
function readVisit() {
|
|
@@ -2789,7 +2840,7 @@ function writeVisit(snapshot) {
|
|
|
2789
2840
|
}
|
|
2790
2841
|
}
|
|
2791
2842
|
function ScenarioLinks2({ scenarios, tone }) {
|
|
2792
|
-
return /* @__PURE__ */ jsxs33(
|
|
2843
|
+
return /* @__PURE__ */ jsxs33(Fragment16, { children: [
|
|
2793
2844
|
scenarios.slice(0, MAX_LINKS2).map((s, i) => /* @__PURE__ */ jsxs33("span", { children: [
|
|
2794
2845
|
i > 0 ? ", " : "",
|
|
2795
2846
|
/* @__PURE__ */ jsx48("a", { href: `#${s.id}`, className: cn("underline underline-offset-2 hover:no-underline", tone), children: s.title })
|
|
@@ -3413,7 +3464,7 @@ function reportTools(deps) {
|
|
|
3413
3464
|
}
|
|
3414
3465
|
|
|
3415
3466
|
// src/interactive/ReportInteractive.tsx
|
|
3416
|
-
import { Fragment as
|
|
3467
|
+
import { Fragment as Fragment17, jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3417
3468
|
function ReportInteractive(props) {
|
|
3418
3469
|
const { report, className, title, dataTheme } = props;
|
|
3419
3470
|
const result = unwrapReport(report);
|
|
@@ -3682,7 +3733,7 @@ function ReportInteractiveView({
|
|
|
3682
3733
|
]
|
|
3683
3734
|
}
|
|
3684
3735
|
),
|
|
3685
|
-
hideHeader ? null : /* @__PURE__ */ jsxs37(
|
|
3736
|
+
hideHeader ? null : /* @__PURE__ */ jsxs37(Fragment17, { children: [
|
|
3686
3737
|
/* @__PURE__ */ jsx52(ReportSummary, {}),
|
|
3687
3738
|
/* @__PURE__ */ jsx52(ReportMeta, {})
|
|
3688
3739
|
] }),
|
|
@@ -3814,7 +3865,7 @@ import { createElement, useEffect as useEffect13, useState as useState14 } from
|
|
|
3814
3865
|
|
|
3815
3866
|
// src/components/doc/MermaidView.tsx
|
|
3816
3867
|
import { useEffect as useEffect12, useRef as useRef8, useState as useState13 } from "react";
|
|
3817
|
-
import { Fragment as
|
|
3868
|
+
import { Fragment as Fragment18, jsx as jsx53, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3818
3869
|
function prefersDark(el) {
|
|
3819
3870
|
const themed = el?.closest("[data-theme]");
|
|
3820
3871
|
if (themed?.dataset.theme === "dark") return true;
|
|
@@ -3884,7 +3935,7 @@ function MermaidView({ entry, load }) {
|
|
|
3884
3935
|
)
|
|
3885
3936
|
] });
|
|
3886
3937
|
}
|
|
3887
|
-
return /* @__PURE__ */ jsxs38(
|
|
3938
|
+
return /* @__PURE__ */ jsxs38(Fragment18, { children: [
|
|
3888
3939
|
error ? /* @__PURE__ */ jsxs38(
|
|
3889
3940
|
"p",
|
|
3890
3941
|
{
|