@action-state-group/capsule-viewer 0.21.0 → 0.22.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/contract-report-wording.js +11 -1
- package/dist/contract-report-wording.js.map +1 -1
- package/dist/contract-report.d.ts +2 -1
- package/dist/contract-report.js +3 -3
- package/dist/contract-report.js.map +1 -1
- package/dist/emitter.js +2 -0
- package/dist/emitter.js.map +1 -1
- package/dist/evidence-graph-view.d.ts +13 -0
- package/dist/evidence-graph-view.js +78 -6
- package/dist/evidence-graph-view.js.map +1 -1
- package/dist/evidence-graph.iife.js +183 -32
- package/dist/generic-report-styles.d.ts +1 -0
- package/dist/generic-report-styles.js +36 -0
- package/dist/generic-report-styles.js.map +1 -0
- package/dist/generic-report-view.d.ts +15 -1
- package/dist/generic-report-view.js +90 -37
- package/dist/generic-report-view.js.map +1 -1
- package/dist/viewer-build.js +1 -1
- package/dist/wording/contract-report-generic.en.json +8 -1
- package/package.json +1 -1
|
@@ -17865,13 +17865,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
|
|
|
17865
17865
|
}
|
|
17866
17866
|
function builtCommit() {
|
|
17867
17867
|
if (false) return void 0;
|
|
17868
|
-
return commitPrefix("
|
|
17868
|
+
return commitPrefix("6662e2bf0fb9f7305b45e3ccf5ee0cb2ac868b43");
|
|
17869
17869
|
}
|
|
17870
17870
|
var commit = builtCommit();
|
|
17871
17871
|
var unreleased = false;
|
|
17872
17872
|
var VIEWER_BUILD = {
|
|
17873
17873
|
viewer: "@action-state-group/capsule-viewer",
|
|
17874
|
-
viewerVersion: "0.
|
|
17874
|
+
viewerVersion: "0.22.0",
|
|
17875
17875
|
verifier: "@action-state-group/agent-action-capsule",
|
|
17876
17876
|
verifierVersion: "0.16.0",
|
|
17877
17877
|
cllVersion: "0.4.0",
|
|
@@ -19730,7 +19730,14 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
|
|
|
19730
19730
|
"generic.claim.unrecognized": "unrecognized claim type {type}",
|
|
19731
19731
|
"generic.claim.contract": "Contract",
|
|
19732
19732
|
"generic.claim.requirement": "Requirement",
|
|
19733
|
-
"generic.claim.failure": "Why it failed verification"
|
|
19733
|
+
"generic.claim.failure": "Why it failed verification",
|
|
19734
|
+
"generic.receipt.open": "Open receipt",
|
|
19735
|
+
"generic.receipt.close": "Close receipt",
|
|
19736
|
+
"generic.receipt.not_carried": "Receipt not carried with this page.",
|
|
19737
|
+
"generic.receipt.no_module": "This page has no viewer for this kind of receipt, so it is not shown.",
|
|
19738
|
+
"generic.receipt.withheld": "The holder's disclosure policy keeps this receipt off this page.",
|
|
19739
|
+
"generic.receipt.unreadable": "This receipt could not be read, so it is not shown. The rest of the report is unchanged.",
|
|
19740
|
+
"generic.receipt.unverified": "This receipt did not pass its checks, so it is not shown. The rest of the report is unchanged."
|
|
19734
19741
|
}
|
|
19735
19742
|
};
|
|
19736
19743
|
|
|
@@ -20204,6 +20211,16 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
|
|
|
20204
20211
|
"generic.producer.note",
|
|
20205
20212
|
"generic.later.note",
|
|
20206
20213
|
"generic.claim.failure",
|
|
20214
|
+
// The deal receipt line under a claim (capsule-viewer#228): a pack cannot
|
|
20215
|
+
// make a receipt that is not carried read as "no record", or hide that a
|
|
20216
|
+
// carried receipt could not be read or did not pass its checks.
|
|
20217
|
+
"generic.receipt.open",
|
|
20218
|
+
"generic.receipt.close",
|
|
20219
|
+
"generic.receipt.not_carried",
|
|
20220
|
+
"generic.receipt.no_module",
|
|
20221
|
+
"generic.receipt.withheld",
|
|
20222
|
+
"generic.receipt.unreadable",
|
|
20223
|
+
"generic.receipt.unverified",
|
|
20207
20224
|
// The shared front (report-front.ts): the mock-judge line, what the
|
|
20208
20225
|
// aggregate's unknown count is, what the page and the bundle carry, and
|
|
20209
20226
|
// the producer's findings label.
|
|
@@ -20798,7 +20815,7 @@ ${key}`);
|
|
|
20798
20815
|
var DEFAULT_PACK_SHA256 = Object.freeze({
|
|
20799
20816
|
lines: "4a03428e884337321754bd6657df0ebb6d5441821378a3b1ff17f2a625021cc5",
|
|
20800
20817
|
groups: "81aeee3abd2d336824d81e24c7f5fad87227ffb4ff8f247cad96c4c855912b9f",
|
|
20801
|
-
generic: "
|
|
20818
|
+
generic: "d97bae75af3f8493e4473d3af3220cda1bff1e51577d7e06f03648cc26ad819b"
|
|
20802
20819
|
});
|
|
20803
20820
|
function fill(key, text2, vars) {
|
|
20804
20821
|
return text2.replace(PLACEHOLDER, (whole, name) => {
|
|
@@ -24486,12 +24503,8 @@ ${key}`);
|
|
|
24486
24503
|
renderReportProofs2(levels.L2, model, bundle, verified, w);
|
|
24487
24504
|
}
|
|
24488
24505
|
|
|
24489
|
-
// src/generic-report-
|
|
24490
|
-
var
|
|
24491
|
-
tag: "div",
|
|
24492
|
-
className: "gr",
|
|
24493
|
-
page: "contract-report",
|
|
24494
|
-
css: `
|
|
24506
|
+
// src/generic-report-styles.ts
|
|
24507
|
+
var GENERIC_REPORT_CSS = `
|
|
24495
24508
|
.gr{${COMPLIANCE_FRAME_VARS}
|
|
24496
24509
|
font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;display:block;max-width:1080px;margin:26px auto;padding:0 28px}
|
|
24497
24510
|
.gr *{box-sizing:border-box}
|
|
@@ -24509,7 +24522,18 @@ ${key}`);
|
|
|
24509
24522
|
.gr .rreason{margin:4px 0 6px 22px}
|
|
24510
24523
|
.gr .rreason[data-tone="warn"],.gr .rflag[data-tone="warn"]{background:var(--bad-l);color:var(--bad);font-weight:700}
|
|
24511
24524
|
.gr .tier-note{font-size:12.5px;color:var(--slate)}
|
|
24512
|
-
|
|
24525
|
+
.gr .rcpt{margin:6px 0 6px 22px;font-size:13px}
|
|
24526
|
+
.gr .rcpt button{font:inherit;color:var(--navy);background:#fff;border:1px solid var(--navy);border-radius:6px;padding:2px 10px;cursor:pointer}
|
|
24527
|
+
.gr .rcpt-note{color:var(--slate);margin:0}
|
|
24528
|
+
.gr .rcpt-panel{margin-top:8px;border-top:1px solid #D9DDE3;padding-top:8px}
|
|
24529
|
+
` + levelCss("gr") + frontCss(".gr");
|
|
24530
|
+
|
|
24531
|
+
// src/generic-report-view.ts
|
|
24532
|
+
var GENERIC_FRAME = {
|
|
24533
|
+
tag: "div",
|
|
24534
|
+
className: "gr",
|
|
24535
|
+
page: "contract-report",
|
|
24536
|
+
css: GENERIC_REPORT_CSS
|
|
24513
24537
|
};
|
|
24514
24538
|
var VERDICT_TONE = {
|
|
24515
24539
|
met: "ok",
|
|
@@ -24628,7 +24652,76 @@ ${key}`);
|
|
|
24628
24652
|
);
|
|
24629
24653
|
return [line];
|
|
24630
24654
|
}
|
|
24631
|
-
function
|
|
24655
|
+
function dealIdOf(claimId) {
|
|
24656
|
+
const at = claimId.indexOf("::");
|
|
24657
|
+
return at > 0 ? claimId.slice(0, at) : void 0;
|
|
24658
|
+
}
|
|
24659
|
+
function receiptLine(claim, w, receipts3) {
|
|
24660
|
+
const deal = dealIdOf(claim.id);
|
|
24661
|
+
if (deal === void 0) return [];
|
|
24662
|
+
const line = el10("div", "rcpt");
|
|
24663
|
+
line.dataset.receiptDeal = deal;
|
|
24664
|
+
const text2 = Object.prototype.hasOwnProperty.call(receipts3.texts, deal) ? receipts3.texts[deal] : void 0;
|
|
24665
|
+
if (text2 === void 0 || text2 === null) {
|
|
24666
|
+
const note = el10(
|
|
24667
|
+
"p",
|
|
24668
|
+
"rcpt-note",
|
|
24669
|
+
w.t(
|
|
24670
|
+
text2 === null ? "generic.receipt.withheld" : "generic.receipt.not_carried"
|
|
24671
|
+
)
|
|
24672
|
+
);
|
|
24673
|
+
note.dataset.receipt = text2 === null ? "withheld" : "not-carried";
|
|
24674
|
+
line.append(note);
|
|
24675
|
+
return [line];
|
|
24676
|
+
}
|
|
24677
|
+
const button = el10(
|
|
24678
|
+
"button",
|
|
24679
|
+
"",
|
|
24680
|
+
w.t("generic.receipt.open")
|
|
24681
|
+
);
|
|
24682
|
+
button.setAttribute("type", "button");
|
|
24683
|
+
button.setAttribute("aria-expanded", "false");
|
|
24684
|
+
button.dataset.receipt = "open";
|
|
24685
|
+
const panel = el10("div", "rcpt-panel");
|
|
24686
|
+
panel.hidden = true;
|
|
24687
|
+
let state = "closed";
|
|
24688
|
+
button.addEventListener("click", () => {
|
|
24689
|
+
if (state === "shown") {
|
|
24690
|
+
panel.hidden = true;
|
|
24691
|
+
state = "hidden";
|
|
24692
|
+
button.setAttribute("aria-expanded", "false");
|
|
24693
|
+
button.textContent = w.t("generic.receipt.open");
|
|
24694
|
+
return;
|
|
24695
|
+
}
|
|
24696
|
+
panel.hidden = false;
|
|
24697
|
+
button.setAttribute("aria-expanded", "true");
|
|
24698
|
+
button.textContent = w.t("generic.receipt.close");
|
|
24699
|
+
if (state === "hidden") {
|
|
24700
|
+
state = "shown";
|
|
24701
|
+
return;
|
|
24702
|
+
}
|
|
24703
|
+
state = "shown";
|
|
24704
|
+
button.disabled = true;
|
|
24705
|
+
const showOutcome = (outcome) => {
|
|
24706
|
+
button.disabled = false;
|
|
24707
|
+
panel.dataset.receiptState = outcome;
|
|
24708
|
+
if (outcome === "opened") return;
|
|
24709
|
+
panel.replaceChildren(
|
|
24710
|
+
el10(
|
|
24711
|
+
"p",
|
|
24712
|
+
"rcpt-note",
|
|
24713
|
+
w.t(
|
|
24714
|
+
outcome === "no-module" ? "generic.receipt.no_module" : outcome === "unverified" ? "generic.receipt.unverified" : "generic.receipt.unreadable"
|
|
24715
|
+
)
|
|
24716
|
+
)
|
|
24717
|
+
);
|
|
24718
|
+
};
|
|
24719
|
+
receipts3.open(text2, panel).then(showOutcome, () => showOutcome("unreadable"));
|
|
24720
|
+
});
|
|
24721
|
+
line.append(button, panel);
|
|
24722
|
+
return [line];
|
|
24723
|
+
}
|
|
24724
|
+
function claimItem(claim, w, reasons, receipts3) {
|
|
24632
24725
|
const item = el10("li", "");
|
|
24633
24726
|
item.dataset.claimRef = claim.id;
|
|
24634
24727
|
const head2 = el10("span", "");
|
|
@@ -24636,11 +24729,12 @@ ${key}`);
|
|
|
24636
24729
|
head2.append(id, " ", verdictPill(shownVerdict(claim), w));
|
|
24637
24730
|
item.append(
|
|
24638
24731
|
levelToggle(2, head2, () => claimProofs(claim, w), { className: "claim" }),
|
|
24639
|
-
...reasonLines(claim, w, reasons)
|
|
24732
|
+
...reasonLines(claim, w, reasons),
|
|
24733
|
+
...receipts3 === void 0 ? [] : receiptLine(claim, w, receipts3)
|
|
24640
24734
|
);
|
|
24641
24735
|
return item;
|
|
24642
24736
|
}
|
|
24643
|
-
function rowItem(row2, w, later, tierOf, reasons) {
|
|
24737
|
+
function rowItem(row2, w, later, tierOf, reasons, receipts3) {
|
|
24644
24738
|
const label = w.row(row2.requirementRef, "label");
|
|
24645
24739
|
const name = el10("span", "rname");
|
|
24646
24740
|
if (label !== void 0)
|
|
@@ -24683,7 +24777,8 @@ ${key}`);
|
|
|
24683
24777
|
))
|
|
24684
24778
|
body.append(el10("p", "rnote", w.t("generic.later.note", { date })));
|
|
24685
24779
|
const list2 = el10("ul", "claims");
|
|
24686
|
-
for (const claim of row2.claims)
|
|
24780
|
+
for (const claim of row2.claims)
|
|
24781
|
+
list2.append(claimItem(claim, w, reasons, receipts3));
|
|
24687
24782
|
body.append(el10("h3", "", w.t("generic.claims.h")), list2);
|
|
24688
24783
|
return body;
|
|
24689
24784
|
},
|
|
@@ -24693,7 +24788,7 @@ ${key}`);
|
|
|
24693
24788
|
toggle.dataset.contract = row2.contractRef;
|
|
24694
24789
|
return toggle;
|
|
24695
24790
|
}
|
|
24696
|
-
function groupedRows(rows, w, later, tierOf, reasons) {
|
|
24791
|
+
function groupedRows(rows, w, later, tierOf, reasons, receipts3) {
|
|
24697
24792
|
const box = el10("div", "groups");
|
|
24698
24793
|
const order = [];
|
|
24699
24794
|
const byGroup = /* @__PURE__ */ new Map();
|
|
@@ -24718,7 +24813,7 @@ ${key}`);
|
|
|
24718
24813
|
part.append(heading);
|
|
24719
24814
|
}
|
|
24720
24815
|
for (const row2 of byGroup.get(group))
|
|
24721
|
-
part.append(rowItem(row2, w, later, tierOf, reasons));
|
|
24816
|
+
part.append(rowItem(row2, w, later, tierOf, reasons, receipts3));
|
|
24722
24817
|
box.append(part);
|
|
24723
24818
|
}
|
|
24724
24819
|
return box;
|
|
@@ -24728,10 +24823,10 @@ ${key}`);
|
|
|
24728
24823
|
heading.append(" ", tagSource(el10("code", "", contract), "producer"));
|
|
24729
24824
|
return heading;
|
|
24730
24825
|
}
|
|
24731
|
-
function byContract(rows, w, later, tierOf, reasons) {
|
|
24826
|
+
function byContract(rows, w, later, tierOf, reasons, receipts3) {
|
|
24732
24827
|
const contracts = [...new Set(rows.map((row2) => row2.contractRef))];
|
|
24733
24828
|
if (contracts.length <= 1)
|
|
24734
|
-
return groupedRows(rows, w, later, tierOf, reasons);
|
|
24829
|
+
return groupedRows(rows, w, later, tierOf, reasons, receipts3);
|
|
24735
24830
|
const box = el10("div", "contracts");
|
|
24736
24831
|
for (const contract of contracts) {
|
|
24737
24832
|
const part = el10("div", "contract");
|
|
@@ -24743,14 +24838,15 @@ ${key}`);
|
|
|
24743
24838
|
w,
|
|
24744
24839
|
later,
|
|
24745
24840
|
tierOf,
|
|
24746
|
-
reasons
|
|
24841
|
+
reasons,
|
|
24842
|
+
receipts3
|
|
24747
24843
|
)
|
|
24748
24844
|
);
|
|
24749
24845
|
box.append(part);
|
|
24750
24846
|
}
|
|
24751
24847
|
return box;
|
|
24752
24848
|
}
|
|
24753
|
-
async function drawGeneric(levels, result3, bundle, verified, w, tierOf, reasons) {
|
|
24849
|
+
async function drawGeneric(levels, result3, bundle, verified, w, tierOf, reasons, receipts3) {
|
|
24754
24850
|
const tierFor = (claim) => tierOf === void 0 ? "unstated" : tierOf(claim.contractRef, claim.requirementRef);
|
|
24755
24851
|
const inForce = result3.claims.filter((claim) => !claim.later);
|
|
24756
24852
|
const later = result3.claims.filter((claim) => claim.later);
|
|
@@ -24776,7 +24872,7 @@ ${key}`);
|
|
|
24776
24872
|
section.dataset.section = "rows";
|
|
24777
24873
|
const rows = rowsOf(inForce);
|
|
24778
24874
|
if (tierOf === void 0)
|
|
24779
|
-
section.append(byContract(rows, w, false, void 0, reasons));
|
|
24875
|
+
section.append(byContract(rows, w, false, void 0, reasons, receipts3));
|
|
24780
24876
|
else
|
|
24781
24877
|
for (const tier of ROW_TIERS) {
|
|
24782
24878
|
const inTier = rows.filter(
|
|
@@ -24794,7 +24890,7 @@ ${key}`);
|
|
|
24794
24890
|
})
|
|
24795
24891
|
),
|
|
24796
24892
|
el10("p", "rnote", w.t(`generic.rtier.${tier}.note`)),
|
|
24797
|
-
byContract(inTier, w, false, tierOf, reasons)
|
|
24893
|
+
byContract(inTier, w, false, tierOf, reasons, receipts3)
|
|
24798
24894
|
);
|
|
24799
24895
|
section.append(part);
|
|
24800
24896
|
}
|
|
@@ -24808,7 +24904,7 @@ ${key}`);
|
|
|
24808
24904
|
"",
|
|
24809
24905
|
w.t("generic.later.title", { n: later.length.toLocaleString() })
|
|
24810
24906
|
),
|
|
24811
|
-
byContract(laterRows, w, true, tierOf, reasons)
|
|
24907
|
+
byContract(laterRows, w, true, tierOf, reasons, receipts3)
|
|
24812
24908
|
);
|
|
24813
24909
|
section.append(part);
|
|
24814
24910
|
}
|
|
@@ -24863,7 +24959,7 @@ ${key}`);
|
|
|
24863
24959
|
function citesOneContract(result3) {
|
|
24864
24960
|
return new Set(result3.claims.map((claim) => claim.contractRef)).size <= 1;
|
|
24865
24961
|
}
|
|
24866
|
-
async function renderContractReport(result3, input, bundle, verified, host, wording, contract) {
|
|
24962
|
+
async function renderContractReport(result3, input, bundle, verified, host, wording, contract, receipts3) {
|
|
24867
24963
|
const tierOf = tierReader(result3, contract);
|
|
24868
24964
|
const w = await contractReportWords(input.grouping, wording, {
|
|
24869
24965
|
singleContract: citesOneContract(result3)
|
|
@@ -24951,7 +25047,8 @@ ${key}`);
|
|
|
24951
25047
|
tierOf,
|
|
24952
25048
|
// The pack's `row.<ref>.reason.<code>` words apply only to a Result
|
|
24953
25049
|
// citing one contract (the Words gate); the reason itself shows always.
|
|
24954
|
-
input.reasons
|
|
25050
|
+
input.reasons,
|
|
25051
|
+
receipts3
|
|
24955
25052
|
);
|
|
24956
25053
|
regions.L0.append(levels.L0);
|
|
24957
25054
|
regions.L1.append(levels.L1);
|
|
@@ -26728,9 +26825,10 @@ ${pad.repeat(depth)}`;
|
|
|
26728
26825
|
}
|
|
26729
26826
|
const link = element6("a", CHECKED_SECTION_TITLE);
|
|
26730
26827
|
link.className = "cv-shell-link";
|
|
26731
|
-
|
|
26828
|
+
const checkedId = checkedSectionId(root);
|
|
26829
|
+
link.setAttribute("href", `#${checkedId}`);
|
|
26732
26830
|
link.addEventListener("click", () => {
|
|
26733
|
-
const section = root.ownerDocument.getElementById(
|
|
26831
|
+
const section = root.ownerDocument.getElementById(checkedId);
|
|
26734
26832
|
if (section instanceof root.ownerDocument.defaultView.HTMLDetailsElement)
|
|
26735
26833
|
section.open = true;
|
|
26736
26834
|
});
|
|
@@ -26847,6 +26945,24 @@ ${pad.repeat(depth)}`;
|
|
|
26847
26945
|
]);
|
|
26848
26946
|
var CHECKED_SECTION_TITLE = "How this page was checked";
|
|
26849
26947
|
var CHECKED_SECTION_ID = "cv-checked";
|
|
26948
|
+
var checkedIds = /* @__PURE__ */ new WeakMap();
|
|
26949
|
+
var renderRoots = /* @__PURE__ */ new WeakSet();
|
|
26950
|
+
var nestedRenders = 0;
|
|
26951
|
+
function checkedSectionId(root) {
|
|
26952
|
+
const known = checkedIds.get(root);
|
|
26953
|
+
if (known !== void 0) return known;
|
|
26954
|
+
let nested = false;
|
|
26955
|
+
for (let a = root.parentElement; a !== null; a = a.parentElement)
|
|
26956
|
+
if (renderRoots.has(a)) {
|
|
26957
|
+
nested = true;
|
|
26958
|
+
break;
|
|
26959
|
+
}
|
|
26960
|
+
renderRoots.add(root);
|
|
26961
|
+
nestedRenders += 1;
|
|
26962
|
+
const id = nested ? `${CHECKED_SECTION_ID}-${nestedRenders}` : CHECKED_SECTION_ID;
|
|
26963
|
+
checkedIds.set(root, id);
|
|
26964
|
+
return id;
|
|
26965
|
+
}
|
|
26850
26966
|
function renderPresentationHeader(root, bundle) {
|
|
26851
26967
|
const presentation = readPresentationBlock(bundle);
|
|
26852
26968
|
if (presentation === void 0) return;
|
|
@@ -27269,7 +27385,7 @@ ${pad.repeat(depth)}`;
|
|
|
27269
27385
|
scope.dataset.checks = "scope";
|
|
27270
27386
|
host.append(scope);
|
|
27271
27387
|
}
|
|
27272
|
-
async function renderVerificationPage(root, context, styled, applied, refused, citedSigners, verifierHint, depth, stamps, charts, contract, l3) {
|
|
27388
|
+
async function renderVerificationPage(root, context, styled, applied, refused, citedSigners, verifierHint, depth, stamps, charts, contract, l3, checkedId) {
|
|
27273
27389
|
const { bundle, verification: verified } = context;
|
|
27274
27390
|
const section = element6("section");
|
|
27275
27391
|
section.dataset.page = "verification";
|
|
@@ -27379,7 +27495,7 @@ ${pad.repeat(depth)}`;
|
|
|
27379
27495
|
page.append(element6("p", model.verifyIndependentlyLine));
|
|
27380
27496
|
const folded = document.createElement("details");
|
|
27381
27497
|
folded.className = "cv-checked";
|
|
27382
|
-
folded.id =
|
|
27498
|
+
folded.id = checkedId;
|
|
27383
27499
|
folded.dataset.checked = "";
|
|
27384
27500
|
folded.open = !bundleVerified(verified) || depth === "L2";
|
|
27385
27501
|
const line = checkedSummaryLine(bundleVerified(verified), model);
|
|
@@ -28271,7 +28387,8 @@ ${pad.repeat(depth)}`;
|
|
|
28271
28387
|
model.verification,
|
|
28272
28388
|
{ L0: host.L0, L1: host.L1, L2: host.L2, depth: host.depth },
|
|
28273
28389
|
host.wording,
|
|
28274
|
-
host.contract
|
|
28390
|
+
host.contract,
|
|
28391
|
+
host.receipts
|
|
28275
28392
|
);
|
|
28276
28393
|
}
|
|
28277
28394
|
};
|
|
@@ -28679,6 +28796,33 @@ ${pad.repeat(depth)}`;
|
|
|
28679
28796
|
}
|
|
28680
28797
|
var SETTLE_MS = 100;
|
|
28681
28798
|
var checkingRenders = /* @__PURE__ */ new WeakMap();
|
|
28799
|
+
var RECEIPT_MODULE_IDS = /* @__PURE__ */ new Set([
|
|
28800
|
+
"capsulectl.deal-view/v0",
|
|
28801
|
+
"capsulectl.deal-view-composed/v0"
|
|
28802
|
+
]);
|
|
28803
|
+
async function openReceipt(text2, panel, options) {
|
|
28804
|
+
let bundle;
|
|
28805
|
+
try {
|
|
28806
|
+
bundle = JSON.parse(text2);
|
|
28807
|
+
} catch {
|
|
28808
|
+
return "unreadable";
|
|
28809
|
+
}
|
|
28810
|
+
const context = await buildVerifiedBundleContext(bundle);
|
|
28811
|
+
const registry = options.registry ?? defaultRegistry;
|
|
28812
|
+
const resolution = await registry.resolve(
|
|
28813
|
+
context,
|
|
28814
|
+
DEFAULT_AUDIENCE,
|
|
28815
|
+
DEFAULT_FORMAT
|
|
28816
|
+
);
|
|
28817
|
+
if (resolution.kind !== "module" || !RECEIPT_MODULE_IDS.has(resolution.module.manifest.id))
|
|
28818
|
+
return bundleVerified(context.verification) ? "no-module" : "unverified";
|
|
28819
|
+
await renderEvidenceGraph(context, panel, void 0, {
|
|
28820
|
+
audience: DEFAULT_AUDIENCE,
|
|
28821
|
+
format: DEFAULT_FORMAT,
|
|
28822
|
+
...options.registry === void 0 ? {} : { registry: options.registry }
|
|
28823
|
+
});
|
|
28824
|
+
return "opened";
|
|
28825
|
+
}
|
|
28682
28826
|
async function renderVerifiedContext(context, root, options) {
|
|
28683
28827
|
const { bundle, verification } = context;
|
|
28684
28828
|
const verified = bundleVerified(verification);
|
|
@@ -28965,6 +29109,12 @@ ${pad.repeat(depth)}`;
|
|
|
28965
29109
|
depth,
|
|
28966
29110
|
...options.wording === void 0 ? {} : { wording: options.wording },
|
|
28967
29111
|
...contract.checked === void 0 ? {} : { contract: contract.checked },
|
|
29112
|
+
...options.receipts === void 0 ? {} : {
|
|
29113
|
+
receipts: {
|
|
29114
|
+
texts: options.receipts,
|
|
29115
|
+
open: (text2, panel) => openReceipt(text2, panel, options)
|
|
29116
|
+
}
|
|
29117
|
+
},
|
|
28968
29118
|
setChromeClass(name) {
|
|
28969
29119
|
if (name !== OUTCOME_CHROME && name !== COMPLIANCE_CHROME)
|
|
28970
29120
|
throw new Error(`unknown chrome class ${JSON.stringify(name)}`);
|
|
@@ -29063,7 +29213,8 @@ ${pad.repeat(depth)}`;
|
|
|
29063
29213
|
options.wording
|
|
29064
29214
|
),
|
|
29065
29215
|
voice: options.voice ?? "shared"
|
|
29066
|
-
} : void 0
|
|
29216
|
+
} : void 0,
|
|
29217
|
+
checkedSectionId(root)
|
|
29067
29218
|
);
|
|
29068
29219
|
const summary = root.querySelector("[data-verify-summary]");
|
|
29069
29220
|
if (summary !== null) summary.textContent = checkedLine;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GENERIC_REPORT_CSS: string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
/**
|
|
3
|
+
* The generic contract-report view's own stylesheet, scoped under `.gr`. It is
|
|
4
|
+
* its own module, as the other cards' are, so the emitter can list its hash in
|
|
5
|
+
* the page's CSP (CORE_RUNTIME_STYLES): the view inserts it as a `<style>`
|
|
6
|
+
* element at render time.
|
|
7
|
+
*/
|
|
8
|
+
import { COMPLIANCE_FRAME_VARS } from "./frame-tokens.generated.js";
|
|
9
|
+
import { levelCss } from "./report-levels.js";
|
|
10
|
+
import { frontCss } from "./report-front-styles.js";
|
|
11
|
+
export const GENERIC_REPORT_CSS = `
|
|
12
|
+
.gr{${COMPLIANCE_FRAME_VARS}
|
|
13
|
+
font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;display:block;max-width:1080px;margin:26px auto;padding:0 28px}
|
|
14
|
+
.gr *{box-sizing:border-box}
|
|
15
|
+
.gr h1,.gr h2,.gr h3{font-family:Georgia,"Iowan Old Style",Cambria,serif;color:var(--navy);margin:0}
|
|
16
|
+
.gr h1{font-size:28px;margin:6px 0 4px}
|
|
17
|
+
.gr h2{font-size:21px;margin:0 0 6px}
|
|
18
|
+
.gr h3{font-size:17px;margin:18px 0 6px}
|
|
19
|
+
.gr .rsum,.gr .counts{color:var(--slate);margin:0 0 8px}
|
|
20
|
+
.gr .rnote{font-size:12.5px;color:var(--slate);margin:2px 0 8px}
|
|
21
|
+
.gr .tally{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:13px;margin:4px 0}
|
|
22
|
+
.gr .rname{font-weight:600;color:var(--navy)}
|
|
23
|
+
.gr .rname code,.gr .cid{font-family:ui-monospace,Menlo,monospace;font-size:12.5px;word-break:break-all}
|
|
24
|
+
.gr ul.claims{list-style:none;margin:6px 0 0;padding:0}
|
|
25
|
+
.gr .rreason,.gr .rflag{font-size:12.5px;border-radius:6px;padding:2px 8px;background:#EEF0F3;color:var(--slate)}
|
|
26
|
+
.gr .rreason{margin:4px 0 6px 22px}
|
|
27
|
+
.gr .rreason[data-tone="warn"],.gr .rflag[data-tone="warn"]{background:var(--bad-l);color:var(--bad);font-weight:700}
|
|
28
|
+
.gr .tier-note{font-size:12.5px;color:var(--slate)}
|
|
29
|
+
.gr .rcpt{margin:6px 0 6px 22px;font-size:13px}
|
|
30
|
+
.gr .rcpt button{font:inherit;color:var(--navy);background:#fff;border:1px solid var(--navy);border-radius:6px;padding:2px 10px;cursor:pointer}
|
|
31
|
+
.gr .rcpt-note{color:var(--slate);margin:0}
|
|
32
|
+
.gr .rcpt-panel{margin-top:8px;border-top:1px solid #D9DDE3;padding-top:8px}
|
|
33
|
+
` +
|
|
34
|
+
levelCss("gr") +
|
|
35
|
+
frontCss(".gr");
|
|
36
|
+
//# sourceMappingURL=generic-report-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-report-styles.js","sourceRoot":"","sources":["../src/generic-report-styles.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC;;;;;GAKG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAC7B;MACI,qBAAqB;;;;;;;;;;;;;;;;;;;;;CAqB1B;IACC,QAAQ,CAAC,IAAI,CAAC;IACd,QAAQ,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -28,6 +28,20 @@ export declare const GENERIC_FRAME: {
|
|
|
28
28
|
};
|
|
29
29
|
/** The reasons the Result's producer gives for claims, by claim id (claim-reasons.ts). */
|
|
30
30
|
type ReasonsOf = ReadonlyMap<string, ClaimReason>;
|
|
31
|
+
/** What opening a carried receipt came to: drawn, no module for it, not readable, or read but not passing its checks. */
|
|
32
|
+
export type ReceiptOpen = "opened" | "no-module" | "unreadable" | "unverified";
|
|
33
|
+
/**
|
|
34
|
+
* The deal receipts a report page carries (the page's `receipts` option):
|
|
35
|
+
* each deal's receipt bundle as the JSON text the node served, by deal id, and
|
|
36
|
+
* the runtime's way to draw one into a panel. The page never reads a
|
|
37
|
+
* receipt's content itself; the receipt module the page also carries draws it.
|
|
38
|
+
*/
|
|
39
|
+
export interface ReceiptsInput {
|
|
40
|
+
readonly texts: Readonly<Record<string, string | null>>;
|
|
41
|
+
readonly open: (text: string, panel: HTMLElement) => Promise<ReceiptOpen>;
|
|
42
|
+
}
|
|
43
|
+
/** The deal a claim belongs to: its id before the first `::`, as the inference-deals Result writes it, or none. */
|
|
44
|
+
export declare function dealIdOf(claimId: string): string | undefined;
|
|
31
45
|
/**
|
|
32
46
|
* Draw the `generic` grouping into the three region wrappers
|
|
33
47
|
* (contract-report.ts made them and put the stylesheet in L0).
|
|
@@ -36,5 +50,5 @@ export declare function drawGeneric(levels: {
|
|
|
36
50
|
readonly L0: HTMLElement;
|
|
37
51
|
readonly L1: HTMLElement;
|
|
38
52
|
readonly L2: HTMLElement;
|
|
39
|
-
}, result: ResultRoot, bundle: unknown, verified: BundleVerificationResult, w: Words, tierOf?: TierOf, reasons?: ReasonsOf): Promise<void>;
|
|
53
|
+
}, result: ResultRoot, bundle: unknown, verified: BundleVerificationResult, w: Words, tierOf?: TierOf, reasons?: ReasonsOf, receipts?: ReceiptsInput): Promise<void>;
|
|
40
54
|
export {};
|