@orangecheck/app-design 1.3.0 → 1.4.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/chrome.d.mts +8 -3
- package/dist/chrome.d.ts +8 -3
- package/dist/chrome.js +978 -949
- package/dist/chrome.js.map +1 -1
- package/dist/chrome.mjs +979 -951
- package/dist/chrome.mjs.map +1 -1
- package/dist/code.js +3 -1
- package/dist/code.js.map +1 -1
- package/dist/code.mjs +3 -1
- package/dist/code.mjs.map +1 -1
- package/dist/components.d.mts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/components.js +723 -661
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +723 -661
- package/dist/components.mjs.map +1 -1
- package/dist/{docs-Dxg4Tp_q.d.ts → docs-BB9gK4KF.d.ts} +18 -4
- package/dist/{docs-wJBfLS08.d.mts → docs-D-T-nHiu.d.mts} +18 -4
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1512 -1394
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1512 -1395
- package/dist/index.mjs.map +1 -1
- package/dist/mdx.d.mts +6 -2
- package/dist/mdx.d.ts +6 -2
- package/dist/mdx.js +168 -74
- package/dist/mdx.js.map +1 -1
- package/dist/mdx.mjs +169 -75
- package/dist/mdx.mjs.map +1 -1
- package/dist/session.d.mts +2 -2
- package/dist/session.d.ts +2 -2
- package/dist/session.js.map +1 -1
- package/dist/session.mjs.map +1 -1
- package/dist/styles/swagger.css +252 -0
- package/dist/styles/tokens.css +2 -0
- package/dist/{tool-shell-zncroOEQ.d.mts → tool-shell-D8Q8XX11.d.mts} +3 -2
- package/dist/{tool-shell-Be4Q0cNN.d.ts → tool-shell-gmlj47Ie.d.ts} +3 -2
- package/package.json +1 -1
package/dist/components.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
9
9
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
10
10
|
import 'sonner';
|
|
11
11
|
import Link from 'next/link';
|
|
12
|
+
import { useRouter } from 'next/compat/router';
|
|
12
13
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
13
14
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
14
15
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
@@ -1675,11 +1676,13 @@ function forClipboard(text, lang) {
|
|
|
1675
1676
|
if (!lines.some((l) => l.startsWith("$ "))) return text;
|
|
1676
1677
|
return lines.filter((l) => l.startsWith("$ ")).map((l) => l.slice(2)).join("\n");
|
|
1677
1678
|
}
|
|
1678
|
-
function linesFromDom(pre) {
|
|
1679
|
+
function linesFromDom(pre, newline) {
|
|
1679
1680
|
if (!pre) return null;
|
|
1680
1681
|
const lines = pre.querySelectorAll("[data-line]");
|
|
1681
1682
|
if (lines.length === 0) return pre.textContent ?? "";
|
|
1682
|
-
|
|
1683
|
+
const text = Array.from(lines).filter((l) => l.getAttribute("data-diff") !== "remove").map((l) => l.textContent ?? "").join("\n");
|
|
1684
|
+
return newline ? `${text}
|
|
1685
|
+
` : text;
|
|
1683
1686
|
}
|
|
1684
1687
|
function prepare(code, lang, marks, diff) {
|
|
1685
1688
|
const d = diff ? readDiff(code) : null;
|
|
@@ -1688,7 +1691,8 @@ function prepare(code, lang, marks, diff) {
|
|
|
1688
1691
|
const kept = d ? src.split("\n").filter((_, i) => d.diff.get(i + 1) !== "remove") : null;
|
|
1689
1692
|
return {
|
|
1690
1693
|
html: linesToHtml(lines, { highlight: parseLineRanges(marks), diff: d?.diff }),
|
|
1691
|
-
|
|
1694
|
+
// Byte for byte, the final newline too: a hash printed beside the code must match a copy of it.
|
|
1695
|
+
copy: kept ? kept.join("\n") + (/\n$/.test(code) ? "\n" : "") : code,
|
|
1692
1696
|
lines: lines.length,
|
|
1693
1697
|
diff: !!d
|
|
1694
1698
|
};
|
|
@@ -1753,6 +1757,7 @@ function CodeBlock({
|
|
|
1753
1757
|
code,
|
|
1754
1758
|
html,
|
|
1755
1759
|
children,
|
|
1760
|
+
trailingNewline = false,
|
|
1756
1761
|
lang,
|
|
1757
1762
|
caption,
|
|
1758
1763
|
copy = true,
|
|
@@ -1773,7 +1778,7 @@ function CodeBlock({
|
|
|
1773
1778
|
);
|
|
1774
1779
|
const markup = prepared?.html ?? html;
|
|
1775
1780
|
const lines = prepared?.lines ?? (html !== void 0 ? html.split("\n").length : code?.split("\n").length ?? 0);
|
|
1776
|
-
const read = () => forClipboard(prepared?.copy ?? linesFromDom(preRef.current) ?? code ?? "", lang);
|
|
1781
|
+
const read = () => forClipboard(prepared?.copy ?? linesFromDom(preRef.current, trailingNewline) ?? code ?? "", lang);
|
|
1777
1782
|
return /* @__PURE__ */ jsxs("figure", { className: cn(FRAME, className), children: [
|
|
1778
1783
|
/* @__PURE__ */ jsxs("figcaption", { className: "flex h-11 items-center justify-between gap-3 border-b border-[var(--oca-code-line)] pl-5 pr-2", children: [
|
|
1779
1784
|
/* @__PURE__ */ jsx("span", { className: "truncate text-[0.8125rem] text-oca-ink-subtle", children: caption ?? languageName(lang) ?? "Code" }),
|
|
@@ -2552,12 +2557,21 @@ function Faq({
|
|
|
2552
2557
|
return /* @__PURE__ */ jsx(Accordion, { single: true, className, children: items.map((it, i) => /* @__PURE__ */ jsx(AccordionItem, { id: it.id, title: it.q, children: it.a }, it.id ?? i)) });
|
|
2553
2558
|
}
|
|
2554
2559
|
var LINK = "text-foreground underline decoration-foreground/35 underline-offset-4 transition-colors hover:decoration-foreground";
|
|
2560
|
+
var SCHEME = /^[a-z][a-z\d+.-]*:/i;
|
|
2561
|
+
function useResolved(href) {
|
|
2562
|
+
const router = useRouter();
|
|
2563
|
+
if (!router || !href || href.startsWith("/") || href.startsWith("#") || href.startsWith("?") || SCHEME.test(href)) return href;
|
|
2564
|
+
const here = router.asPath.split(/[?#]/)[0] || "/";
|
|
2565
|
+
const url = new URL(href, `https://page.invalid${here}`);
|
|
2566
|
+
return url.pathname + url.search + url.hash;
|
|
2567
|
+
}
|
|
2555
2568
|
function TextLink({
|
|
2556
|
-
href,
|
|
2569
|
+
href: written,
|
|
2557
2570
|
children,
|
|
2558
2571
|
external,
|
|
2559
2572
|
className
|
|
2560
2573
|
}) {
|
|
2574
|
+
const href = useResolved(written);
|
|
2561
2575
|
const internal = href.startsWith("/") && !href.startsWith("/api/") && !href.startsWith("/.well-known/");
|
|
2562
2576
|
const offsite = external ?? /^https?:\/\//.test(href);
|
|
2563
2577
|
if (internal && !offsite) {
|
|
@@ -2793,6 +2807,10 @@ function protocolSite(slug) {
|
|
|
2793
2807
|
{ href: `${OCHK_IO}/trust`, label: "Trust" },
|
|
2794
2808
|
{ href: `${OCHK_IO}/about`, label: "About" }
|
|
2795
2809
|
];
|
|
2810
|
+
var InDocsContext = sharedContext("in-docs", false);
|
|
2811
|
+
function useInDocs() {
|
|
2812
|
+
return useContext(InDocsContext);
|
|
2813
|
+
}
|
|
2796
2814
|
var WORD = {
|
|
2797
2815
|
live: "Live",
|
|
2798
2816
|
testing: "In testing",
|
|
@@ -2822,6 +2840,7 @@ function ProtocolGrid({
|
|
|
2822
2840
|
link = "page",
|
|
2823
2841
|
className
|
|
2824
2842
|
}) {
|
|
2843
|
+
const inDocs = useInDocs();
|
|
2825
2844
|
return /* @__PURE__ */ jsx("ul", { className: cn("grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 md:gap-5", className), children: protocols.map((slug) => {
|
|
2826
2845
|
const p = protocolSite(slug);
|
|
2827
2846
|
const i = PROTOCOL_ORDER.indexOf(slug);
|
|
@@ -2834,7 +2853,7 @@ function ProtocolGrid({
|
|
|
2834
2853
|
] }),
|
|
2835
2854
|
p.status !== "live" ? /* @__PURE__ */ jsx(StatusBadge, { status: p.status }) : null
|
|
2836
2855
|
] }),
|
|
2837
|
-
/* @__PURE__ */ jsx("h3", { className: "oca-display-3", children: /* @__PURE__ */ jsx(
|
|
2856
|
+
/* @__PURE__ */ jsx("h3", { className: "oca-display-3", children: link === "docs" && inDocs ? /* @__PURE__ */ jsx(Link, { href: `/${p.slug}`, className: STRETCH, children: p.label }) : /* @__PURE__ */ jsx(
|
|
2838
2857
|
"a",
|
|
2839
2858
|
{
|
|
2840
2859
|
href: link === "tool" ? p.toolHref : link === "docs" ? `${DOCS_HREF}/${p.slug}` : p.pageHref,
|
|
@@ -3082,737 +3101,780 @@ forwardRef(function RadioGroupItem2({ className, ...props }, ref) {
|
|
|
3082
3101
|
}
|
|
3083
3102
|
);
|
|
3084
3103
|
});
|
|
3085
|
-
|
|
3086
|
-
|
|
3104
|
+
var isInternal = (href) => href.startsWith("/") || href.startsWith("#");
|
|
3105
|
+
function DocLink({ href, className, children, ...rest }) {
|
|
3106
|
+
return isInternal(href) ? /* @__PURE__ */ jsx(Link, { href, className, ...rest, children }) : /* @__PURE__ */ jsx("a", { href, className, ...rest, children });
|
|
3107
|
+
}
|
|
3108
|
+
function Breadcrumbs({ items, action, className }) {
|
|
3109
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex min-h-11 items-center justify-between gap-4 sm:min-h-0", className), children: [
|
|
3110
|
+
/* @__PURE__ */ jsx("nav", { "aria-label": "Breadcrumb", className: "min-w-0", children: /* @__PURE__ */ jsx("ol", { className: "flex min-w-0 items-center gap-1.5 text-[0.875rem] text-muted-foreground", children: items.map((c, i) => {
|
|
3111
|
+
const last = i === items.length - 1;
|
|
3112
|
+
return /* @__PURE__ */ jsxs("li", { className: cn("flex items-center gap-1.5", last ? "min-w-0" : "shrink-0"), children: [
|
|
3113
|
+
c.href && !last ? /* @__PURE__ */ jsx(DocLink, { href: c.href, className: "inline-flex min-h-11 items-center transition-colors hover:text-foreground sm:min-h-0", children: c.label }) : /* @__PURE__ */ jsx("span", { "aria-current": last ? "page" : void 0, className: cn("truncate", last && "text-foreground"), children: c.label }),
|
|
3114
|
+
!last ? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": true, className: "size-3.5 shrink-0 text-oca-subtle" }) : null
|
|
3115
|
+
] }, i);
|
|
3116
|
+
}) }) }),
|
|
3117
|
+
action ? /* @__PURE__ */ jsx("div", { className: "shrink-0 text-[0.875rem]", children: action }) : null
|
|
3118
|
+
] });
|
|
3119
|
+
}
|
|
3120
|
+
function DocsPager({ prev, next, className }) {
|
|
3121
|
+
if (!prev && !next) return null;
|
|
3122
|
+
const card = (l, dir) => /* @__PURE__ */ jsxs(
|
|
3123
|
+
DocLink,
|
|
3124
|
+
{
|
|
3125
|
+
href: l.href,
|
|
3126
|
+
className: cn(
|
|
3127
|
+
"group flex min-h-20 flex-col justify-center gap-1 rounded-2xl border border-border bg-card px-5 py-4 transition-colors hover:border-oca-hairline-strong",
|
|
3128
|
+
dir === "next" && "items-end text-right sm:col-start-2"
|
|
3129
|
+
),
|
|
3130
|
+
children: [
|
|
3131
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-[0.8125rem] text-muted-foreground", children: [
|
|
3132
|
+
dir === "prev" ? /* @__PURE__ */ jsx(ArrowLeft, { "aria-hidden": true, className: "size-3.5" }) : null,
|
|
3133
|
+
dir === "prev" ? "Previous" : "Next",
|
|
3134
|
+
l.section ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xB7" }) : null,
|
|
3135
|
+
l.section ? /* @__PURE__ */ jsx("span", { className: "truncate", children: l.section }) : null,
|
|
3136
|
+
dir === "next" ? /* @__PURE__ */ jsx(ArrowRight, { "aria-hidden": true, className: "size-3.5" }) : null
|
|
3137
|
+
] }),
|
|
3138
|
+
/* @__PURE__ */ jsx("span", { className: "text-[1rem] font-medium leading-snug text-foreground", children: l.label })
|
|
3139
|
+
]
|
|
3140
|
+
}
|
|
3141
|
+
);
|
|
3142
|
+
return /* @__PURE__ */ jsxs("nav", { "aria-label": "Previous and next page", className: cn("grid grid-cols-1 gap-3 border-t border-border pt-8 sm:grid-cols-2", className), children: [
|
|
3143
|
+
prev ? card(prev, "prev") : null,
|
|
3144
|
+
next ? card(next, "next") : null
|
|
3145
|
+
] });
|
|
3146
|
+
}
|
|
3147
|
+
function useHeadings(selector = "#docs-content", key) {
|
|
3148
|
+
const [items, setItems] = useState([]);
|
|
3149
|
+
useEffect(() => {
|
|
3150
|
+
const read = () => {
|
|
3151
|
+
const root = document.querySelector(selector);
|
|
3152
|
+
if (!root) return setItems([]);
|
|
3153
|
+
setItems(
|
|
3154
|
+
Array.from(root.querySelectorAll("h2[id], h3[id]")).map((h) => ({
|
|
3155
|
+
id: h.id,
|
|
3156
|
+
// The anchor link's "#" is not part of the name.
|
|
3157
|
+
label: (h.querySelector("[data-heading-text]") ?? h).textContent?.trim() ?? "",
|
|
3158
|
+
level: h.tagName === "H3" ? 3 : 2
|
|
3159
|
+
}))
|
|
3160
|
+
);
|
|
3161
|
+
};
|
|
3162
|
+
const raf = requestAnimationFrame(read);
|
|
3163
|
+
const t = setTimeout(read, 80);
|
|
3164
|
+
return () => {
|
|
3165
|
+
cancelAnimationFrame(raf);
|
|
3166
|
+
clearTimeout(t);
|
|
3167
|
+
};
|
|
3168
|
+
}, [selector, key]);
|
|
3169
|
+
const activeId = useActiveHeading(items.map((i) => i.id));
|
|
3170
|
+
return { items, activeId };
|
|
3171
|
+
}
|
|
3172
|
+
function OnThisPage({
|
|
3173
|
+
items,
|
|
3174
|
+
activeId,
|
|
3175
|
+
title = "On this page",
|
|
3176
|
+
onNavigate,
|
|
3177
|
+
className
|
|
3178
|
+
}) {
|
|
3179
|
+
const id = useId();
|
|
3180
|
+
if (items.length === 0) return null;
|
|
3181
|
+
return (
|
|
3182
|
+
// With no visible title (a folded list under its own summary) the name is still "On this page".
|
|
3183
|
+
/* @__PURE__ */ jsxs("nav", { "aria-labelledby": title ? id : void 0, "aria-label": title ? void 0 : "On this page", className, children: [
|
|
3184
|
+
title ? /* @__PURE__ */ jsx("p", { id, className: "mb-3 text-[0.875rem] font-medium", children: title }) : null,
|
|
3185
|
+
/* @__PURE__ */ jsx("ul", { children: items.map((t) => {
|
|
3186
|
+
const on = t.id === activeId;
|
|
3187
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
3188
|
+
"a",
|
|
3189
|
+
{
|
|
3190
|
+
href: `#${t.id}`,
|
|
3191
|
+
onClick: onNavigate,
|
|
3192
|
+
"aria-current": on ? "location" : void 0,
|
|
3193
|
+
className: cn(
|
|
3194
|
+
"block border-l py-1.5 text-[0.875rem] leading-snug transition-colors",
|
|
3195
|
+
t.level === 3 ? "pl-7" : "pl-4",
|
|
3196
|
+
on ? "border-foreground text-foreground" : "border-border text-muted-foreground hover:text-foreground"
|
|
3197
|
+
),
|
|
3198
|
+
children: t.label
|
|
3199
|
+
}
|
|
3200
|
+
) }, t.id);
|
|
3201
|
+
}) })
|
|
3202
|
+
] })
|
|
3203
|
+
);
|
|
3204
|
+
}
|
|
3205
|
+
var CALLOUT_TONE = { note: "neutral", warning: "brand", danger: "danger" };
|
|
3206
|
+
function Callout({
|
|
3207
|
+
tone = "note",
|
|
3087
3208
|
title,
|
|
3088
|
-
lead,
|
|
3089
|
-
actions,
|
|
3090
|
-
art,
|
|
3091
3209
|
children,
|
|
3092
3210
|
className
|
|
3093
3211
|
}) {
|
|
3094
|
-
const p = protocolSite(protocol2);
|
|
3095
3212
|
return /* @__PURE__ */ jsx(
|
|
3096
|
-
|
|
3213
|
+
Notice,
|
|
3097
3214
|
{
|
|
3098
|
-
|
|
3099
|
-
eyebrow: `Protocol \xB7 ${p.verb}`,
|
|
3215
|
+
tone: CALLOUT_TONE[tone],
|
|
3100
3216
|
title,
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
children: p.status !== "live" || children ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-4", children: [
|
|
3105
|
-
p.status !== "live" ? /* @__PURE__ */ jsx(StatusBadge, { status: p.status }) : null,
|
|
3106
|
-
children
|
|
3107
|
-
] }) : null
|
|
3217
|
+
role: "note",
|
|
3218
|
+
className: cn("my-6 [&_p]:my-0 [&_p]:text-[0.9375rem] [&_p]:leading-relaxed [&_p+p]:mt-3", className),
|
|
3219
|
+
children
|
|
3108
3220
|
}
|
|
3109
3221
|
);
|
|
3110
3222
|
}
|
|
3111
|
-
function
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
}) {
|
|
3116
|
-
return /* @__PURE__ */ jsx("nav", { "aria-label": "Protocols", className, children: /* @__PURE__ */ jsx(ScrollFade, { fade: "var(--background)", children: /* @__PURE__ */ jsx("ul", { className: "flex w-max min-w-full items-center gap-6 border-b border-border", children: PROTOCOLS.map((p) => {
|
|
3117
|
-
const on = p.slug === current;
|
|
3118
|
-
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
3119
|
-
"a",
|
|
3120
|
-
{
|
|
3121
|
-
href: link === "tool" ? p.toolHref : p.pageHref,
|
|
3122
|
-
"aria-current": on ? "page" : void 0,
|
|
3123
|
-
className: cn(
|
|
3124
|
-
"-mb-px inline-flex h-11 items-center border-b-2 text-[0.9375rem] transition-colors",
|
|
3125
|
-
on ? "border-foreground text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3126
|
-
),
|
|
3127
|
-
children: p.label
|
|
3128
|
-
}
|
|
3129
|
-
) }, p.slug);
|
|
3130
|
-
}) }) }) });
|
|
3131
|
-
}
|
|
3132
|
-
function SpecCard({
|
|
3133
|
-
protocol: protocol2,
|
|
3134
|
-
version,
|
|
3135
|
-
license,
|
|
3136
|
-
vectors,
|
|
3137
|
-
size = "md",
|
|
3138
|
-
className
|
|
3139
|
-
}) {
|
|
3140
|
-
const p = protocolSite(protocol2);
|
|
3141
|
-
const repo = `oc-${p.slug}-protocol`;
|
|
3142
|
-
const facts = [
|
|
3143
|
-
["Version", version],
|
|
3144
|
-
...license ? [["Licence", license]] : [],
|
|
3145
|
-
["Nostr kind", p.kinds],
|
|
3146
|
-
...vectors !== void 0 ? [["Test vectors", String(vectors)]] : []
|
|
3147
|
-
];
|
|
3148
|
-
if (size === "sm") {
|
|
3149
|
-
return /* @__PURE__ */ jsxs(
|
|
3150
|
-
"a",
|
|
3223
|
+
function Step({ title, id, children }) {
|
|
3224
|
+
return /* @__PURE__ */ jsxs("li", { className: "relative pb-8 pl-11 last:pb-0 [counter-increment:oca-step]", children: [
|
|
3225
|
+
/* @__PURE__ */ jsx(
|
|
3226
|
+
"span",
|
|
3151
3227
|
{
|
|
3152
|
-
|
|
3153
|
-
className:
|
|
3154
|
-
"group flex flex-wrap items-center gap-x-4 gap-y-1 rounded-2xl border border-border bg-card px-4 py-3 text-[0.875rem] transition-colors hover:border-oca-hairline-strong",
|
|
3155
|
-
className
|
|
3156
|
-
),
|
|
3157
|
-
children: [
|
|
3158
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono text-[0.8125rem] text-foreground", children: repo }),
|
|
3159
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: facts.map(([k, v]) => k === "Version" ? `v${v}` : k === "Nostr kind" ? `kind ${v}` : v).join(" \xB7 ") }),
|
|
3160
|
-
/* @__PURE__ */ jsxs("span", { className: "ml-auto flex items-center gap-1 text-muted-foreground group-hover:text-foreground", children: [
|
|
3161
|
-
"Read the spec ",
|
|
3162
|
-
/* @__PURE__ */ jsx(ArrowUpRight, { "aria-hidden": true, className: "size-4" })
|
|
3163
|
-
] })
|
|
3164
|
-
]
|
|
3228
|
+
"aria-hidden": true,
|
|
3229
|
+
className: "absolute left-0 top-0 flex size-7 items-center justify-center rounded-full border border-oca-hairline-strong bg-card text-[0.8125rem] oca-tabular text-foreground before:content-[counter(oca-step)]"
|
|
3165
3230
|
}
|
|
3166
|
-
)
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
/* @__PURE__ */
|
|
3170
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [
|
|
3171
|
-
/* @__PURE__ */ jsx("p", { className: "text-[0.875rem] text-muted-foreground", children: "The spec" }),
|
|
3172
|
-
/* @__PURE__ */ jsx("h3", { className: "oca-title break-all font-mono text-[1.0625rem] tracking-normal", children: repo })
|
|
3173
|
-
] }),
|
|
3174
|
-
p.status !== "live" ? /* @__PURE__ */ jsx(StatusBadge, { status: p.status }) : null
|
|
3175
|
-
] }),
|
|
3176
|
-
/* @__PURE__ */ jsx("dl", { className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-4", children: facts.map(([k, v]) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
3177
|
-
/* @__PURE__ */ jsx("dt", { className: "text-[0.8125rem] text-muted-foreground", children: k }),
|
|
3178
|
-
/* @__PURE__ */ jsx("dd", { className: "oca-tabular text-[1.0625rem]", children: v })
|
|
3179
|
-
] }, k)) }),
|
|
3180
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, { asChild: true, variant: "secondary", size: "sm", children: /* @__PURE__ */ jsxs("a", { href: p.specHref, children: [
|
|
3181
|
-
"Read the spec ",
|
|
3182
|
-
/* @__PURE__ */ jsx(ArrowUpRight, { "aria-hidden": true })
|
|
3183
|
-
] }) }) })
|
|
3231
|
+
),
|
|
3232
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute bottom-1 left-[0.8125rem] top-9 w-px bg-border" }),
|
|
3233
|
+
/* @__PURE__ */ jsx("h3", { id, className: "scroll-mt-28 pt-0.5 text-[1.0625rem] font-medium leading-snug tracking-[-0.008em] text-foreground", children: title }),
|
|
3234
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 text-muted-foreground [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", children })
|
|
3184
3235
|
] });
|
|
3185
3236
|
}
|
|
3186
|
-
function
|
|
3187
|
-
|
|
3188
|
-
|
|
3237
|
+
function Steps({ children, className }) {
|
|
3238
|
+
return /* @__PURE__ */ jsx("ol", { className: cn("not-prose my-8 flex flex-col [counter-reset:oca-step] [&>li:last-child>span:nth-child(2)]:hidden", className), children });
|
|
3239
|
+
}
|
|
3240
|
+
function LinkCard({
|
|
3241
|
+
href,
|
|
3189
3242
|
title,
|
|
3190
3243
|
description,
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
hint,
|
|
3194
|
-
submitLabel = "Verify",
|
|
3195
|
-
multiline = false,
|
|
3196
|
-
onVerify,
|
|
3244
|
+
icon,
|
|
3245
|
+
meta,
|
|
3197
3246
|
className
|
|
3198
3247
|
}) {
|
|
3199
|
-
const
|
|
3200
|
-
const submit = (e) => {
|
|
3201
|
-
if (!onVerify) return;
|
|
3202
|
-
e.preventDefault();
|
|
3203
|
-
if (value.trim()) onVerify(value.trim());
|
|
3204
|
-
};
|
|
3205
|
-
const button = /* @__PURE__ */ jsx(Button, { type: "submit", className: multiline ? void 0 : "w-full sm:w-auto", children: submitLabel });
|
|
3248
|
+
const Arrow = isInternal(href) ? ArrowRight : ArrowUpRight;
|
|
3206
3249
|
return /* @__PURE__ */ jsxs(
|
|
3207
|
-
|
|
3250
|
+
DocLink,
|
|
3208
3251
|
{
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3252
|
+
href,
|
|
3253
|
+
className: cn(
|
|
3254
|
+
"group flex h-full flex-col gap-3 rounded-[1.25rem] border border-border bg-card p-5 transition-colors hover:border-oca-hairline-strong",
|
|
3255
|
+
className
|
|
3256
|
+
),
|
|
3213
3257
|
children: [
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
required: true,
|
|
3224
|
-
value,
|
|
3225
|
-
onChange: (e) => setValue(e.target.value),
|
|
3226
|
-
placeholder,
|
|
3227
|
-
spellCheck: false,
|
|
3228
|
-
className: "min-h-32 font-mono text-base md:text-[0.8125rem]"
|
|
3229
|
-
}
|
|
3230
|
-
) }),
|
|
3231
|
-
/* @__PURE__ */ jsx("div", { children: button })
|
|
3232
|
-
] }) : /* @__PURE__ */ jsx(Field, { label, hint, action: button, children: /* @__PURE__ */ jsx(
|
|
3233
|
-
Input,
|
|
3234
|
-
{
|
|
3235
|
-
name: param,
|
|
3236
|
-
required: true,
|
|
3237
|
-
value,
|
|
3238
|
-
onChange: (e) => setValue(e.target.value),
|
|
3239
|
-
placeholder,
|
|
3240
|
-
spellCheck: false,
|
|
3241
|
-
autoComplete: "off",
|
|
3242
|
-
className: "font-mono text-base md:text-[0.875rem]"
|
|
3243
|
-
}
|
|
3244
|
-
) })
|
|
3258
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-start justify-between gap-3", children: [
|
|
3259
|
+
icon ? /* @__PURE__ */ jsx("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-xl bg-muted text-foreground [&_svg]:size-[1.125rem]", children: icon }) : /* @__PURE__ */ jsx("span", { className: "text-[1rem] font-medium leading-snug text-foreground", children: title }),
|
|
3260
|
+
/* @__PURE__ */ jsxs("span", { className: "flex shrink-0 items-center gap-2", children: [
|
|
3261
|
+
meta,
|
|
3262
|
+
/* @__PURE__ */ jsx(Arrow, { "aria-hidden": true, className: "size-4 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-foreground" })
|
|
3263
|
+
] })
|
|
3264
|
+
] }),
|
|
3265
|
+
icon ? /* @__PURE__ */ jsx("span", { className: "text-[1rem] font-medium leading-snug text-foreground", children: title }) : null,
|
|
3266
|
+
description ? /* @__PURE__ */ jsx("span", { className: "text-[0.9375rem] leading-relaxed text-muted-foreground", children: description }) : null
|
|
3245
3267
|
]
|
|
3246
3268
|
}
|
|
3247
3269
|
);
|
|
3248
3270
|
}
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3271
|
+
function CardGrid({ columns = 2, children, className }) {
|
|
3272
|
+
return /* @__PURE__ */ jsx("div", { className: cn("not-prose my-6 grid grid-cols-1 gap-3 sm:grid-cols-2", columns === 3 && "lg:grid-cols-3", className), children });
|
|
3273
|
+
}
|
|
3274
|
+
function MdxTable({ className, ...props }) {
|
|
3275
|
+
return /* @__PURE__ */ jsx("div", { className: "not-prose my-6 overflow-hidden rounded-2xl border border-border bg-card", children: /* @__PURE__ */ jsx(ScrollFade, { fade: "var(--card)", children: /* @__PURE__ */ jsx(
|
|
3276
|
+
"table",
|
|
3277
|
+
{
|
|
3278
|
+
className: cn(
|
|
3279
|
+
"w-full border-collapse text-left text-[0.875rem] leading-relaxed",
|
|
3280
|
+
"[&_th]:whitespace-nowrap [&_th]:border-b [&_th]:border-oca-hairline-strong [&_th]:bg-oca-table-head [&_th]:px-4 [&_th]:py-2.5 [&_th]:text-[0.8125rem] [&_th]:font-medium [&_th]:text-foreground",
|
|
3281
|
+
"[&_td]:border-t [&_td]:border-border [&_td]:px-4 [&_td]:py-2.5 [&_td]:align-top [&_td]:text-muted-foreground [&_tbody_tr:first-child_td]:border-t-0",
|
|
3282
|
+
"[&_td_code]:bg-transparent [&_td_code]:p-0 [&_td_code]:text-foreground [&_td:first-child]:text-foreground",
|
|
3283
|
+
"[&_[align=center]]:text-center [&_[align=right]]:text-right",
|
|
3284
|
+
// On a phone a cell keeps a readable width; the table scrolls instead of crushing it.
|
|
3285
|
+
"max-sm:[&_td]:min-w-[9rem]",
|
|
3286
|
+
className
|
|
3287
|
+
),
|
|
3288
|
+
...props
|
|
3289
|
+
}
|
|
3290
|
+
) }) });
|
|
3291
|
+
}
|
|
3292
|
+
var said = (n) => n !== void 0 && n !== null && n !== false && n !== "";
|
|
3293
|
+
function ApiTable({
|
|
3252
3294
|
rows,
|
|
3253
|
-
|
|
3254
|
-
|
|
3295
|
+
caption,
|
|
3296
|
+
nameHeader = "Name",
|
|
3255
3297
|
className
|
|
3256
3298
|
}) {
|
|
3257
|
-
const
|
|
3258
|
-
const
|
|
3259
|
-
const
|
|
3260
|
-
const
|
|
3261
|
-
|
|
3262
|
-
|
|
3299
|
+
const hasDefault = rows.some((r) => r.default !== void 0);
|
|
3300
|
+
const hasDescription = rows.some((r) => said(r.description));
|
|
3301
|
+
const hasSource = rows.some((r) => said(r.source));
|
|
3302
|
+
const cell = "px-4 py-3 max-sm:p-0";
|
|
3303
|
+
return /* @__PURE__ */ jsx("div", { className: cn("not-prose my-6 overflow-hidden rounded-2xl border border-border bg-card", className), children: /* @__PURE__ */ jsx(ScrollFade, { fade: "var(--card)", children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-left text-[0.875rem] max-sm:block", children: [
|
|
3304
|
+
caption ? /* @__PURE__ */ jsx("caption", { className: "sr-only", children: caption }) : null,
|
|
3305
|
+
/* @__PURE__ */ jsx("thead", { className: "max-sm:sr-only", children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-oca-hairline-strong bg-oca-table-head text-[0.8125rem]", children: [
|
|
3306
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "px-4 py-2.5 font-medium", children: nameHeader }),
|
|
3307
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "px-4 py-2.5 font-medium", children: "Type" }),
|
|
3308
|
+
hasDefault ? /* @__PURE__ */ jsx("th", { scope: "col", className: "px-4 py-2.5 font-medium", children: "Default" }) : null,
|
|
3309
|
+
hasDescription ? /* @__PURE__ */ jsx("th", { scope: "col", className: "px-4 py-2.5 font-medium", children: "Description" }) : null,
|
|
3310
|
+
hasSource ? /* @__PURE__ */ jsx("th", { scope: "col", className: "px-4 py-2.5 font-medium", children: "Defined in" }) : null
|
|
3311
|
+
] }) }),
|
|
3312
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-border max-sm:block", children: rows.map((r) => /* @__PURE__ */ jsxs(
|
|
3313
|
+
"tr",
|
|
3314
|
+
{
|
|
3315
|
+
id: r.id,
|
|
3316
|
+
className: "scroll-mt-28 align-top target:bg-muted max-sm:flex max-sm:flex-col max-sm:gap-1.5 max-sm:px-4 max-sm:py-3.5",
|
|
3317
|
+
children: [
|
|
3318
|
+
/* @__PURE__ */ jsx("th", { scope: "row", className: cn(cell, "text-left font-normal"), children: /* @__PURE__ */ jsxs("span", { className: "flex flex-col items-start gap-1 max-sm:flex-row max-sm:flex-wrap max-sm:items-baseline max-sm:gap-x-2", children: [
|
|
3319
|
+
/* @__PURE__ */ jsx("code", { className: cn("font-mono text-[0.8125rem] text-foreground max-sm:text-[0.875rem]", r.deprecated && "line-through decoration-oca-subtle"), children: r.name }),
|
|
3320
|
+
r.required ? /* @__PURE__ */ jsx("span", { className: "text-[0.75rem] text-oca-accent-ink", children: "Required" }) : null,
|
|
3321
|
+
r.deprecated ? /* @__PURE__ */ jsx(Badge, { tone: "muted", children: "Deprecated" }) : null,
|
|
3322
|
+
r.status ? /* @__PURE__ */ jsx(StatusBadge, { status: r.status }) : null
|
|
3323
|
+
] }) }),
|
|
3324
|
+
/* @__PURE__ */ jsx("td", { className: cn(cell, "font-mono text-[0.8125rem] text-muted-foreground max-sm:break-all", !said(r.type) && "max-sm:hidden"), children: r.type ?? "\u2014" }),
|
|
3325
|
+
hasDefault ? /* @__PURE__ */ jsxs("td", { className: cn(cell, "font-mono text-[0.8125rem] text-muted-foreground max-sm:order-last", r.default === void 0 && "max-sm:hidden"), children: [
|
|
3326
|
+
/* @__PURE__ */ jsx("span", { className: "font-sans sm:hidden", children: "Default " }),
|
|
3327
|
+
r.default ?? "\u2014"
|
|
3328
|
+
] }) : null,
|
|
3329
|
+
hasDescription ? /* @__PURE__ */ jsx("td", { className: cn(cell, "leading-relaxed text-muted-foreground", !said(r.description) && "max-sm:hidden"), children: r.description }) : null,
|
|
3330
|
+
hasSource ? /* @__PURE__ */ jsx("td", { className: cn(cell, "text-[0.8125rem] text-muted-foreground max-sm:order-last max-sm:break-all", !said(r.source) && "max-sm:hidden"), children: r.source }) : null
|
|
3331
|
+
]
|
|
3332
|
+
},
|
|
3333
|
+
r.id ?? r.name
|
|
3334
|
+
)) })
|
|
3335
|
+
] }) }) });
|
|
3336
|
+
}
|
|
3337
|
+
function useDarkMode() {
|
|
3338
|
+
const [dark, setDark] = useState(false);
|
|
3339
|
+
useEffect(() => {
|
|
3340
|
+
const root = document.documentElement;
|
|
3341
|
+
const read = () => setDark(root.classList.contains("dark"));
|
|
3342
|
+
read();
|
|
3343
|
+
const mo = new MutationObserver(read);
|
|
3344
|
+
mo.observe(root, { attributes: true, attributeFilter: ["class"] });
|
|
3345
|
+
return () => mo.disconnect();
|
|
3346
|
+
}, []);
|
|
3347
|
+
return dark;
|
|
3348
|
+
}
|
|
3349
|
+
function mermaidTheme(el) {
|
|
3350
|
+
const css = getComputedStyle(el);
|
|
3351
|
+
const v = (name) => css.getPropertyValue(name).trim();
|
|
3352
|
+
const card = v("--card");
|
|
3353
|
+
const muted = v("--muted");
|
|
3354
|
+
const text = v("--foreground");
|
|
3355
|
+
const subtle = v("--muted-foreground");
|
|
3356
|
+
const line = v("--input");
|
|
3357
|
+
const hair = v("--oca-hairline-strong");
|
|
3358
|
+
return {
|
|
3359
|
+
background: "transparent",
|
|
3360
|
+
fontFamily: css.fontFamily,
|
|
3361
|
+
fontSize: "14px",
|
|
3362
|
+
textColor: text,
|
|
3363
|
+
mainBkg: card,
|
|
3364
|
+
primaryColor: card,
|
|
3365
|
+
primaryTextColor: text,
|
|
3366
|
+
primaryBorderColor: hair,
|
|
3367
|
+
secondaryColor: muted,
|
|
3368
|
+
secondaryTextColor: text,
|
|
3369
|
+
secondaryBorderColor: hair,
|
|
3370
|
+
tertiaryColor: muted,
|
|
3371
|
+
tertiaryTextColor: text,
|
|
3372
|
+
tertiaryBorderColor: hair,
|
|
3373
|
+
nodeBorder: hair,
|
|
3374
|
+
lineColor: line,
|
|
3375
|
+
edgeLabelBackground: card,
|
|
3376
|
+
clusterBkg: muted,
|
|
3377
|
+
clusterBorder: hair,
|
|
3378
|
+
titleColor: text,
|
|
3379
|
+
noteBkgColor: muted,
|
|
3380
|
+
noteTextColor: text,
|
|
3381
|
+
noteBorderColor: hair,
|
|
3382
|
+
actorBkg: card,
|
|
3383
|
+
actorBorder: hair,
|
|
3384
|
+
actorTextColor: text,
|
|
3385
|
+
actorLineColor: line,
|
|
3386
|
+
signalColor: text,
|
|
3387
|
+
signalTextColor: text,
|
|
3388
|
+
labelBoxBkgColor: card,
|
|
3389
|
+
labelBoxBorderColor: hair,
|
|
3390
|
+
labelTextColor: text,
|
|
3391
|
+
loopTextColor: subtle,
|
|
3392
|
+
activationBkgColor: muted,
|
|
3393
|
+
activationBorderColor: hair,
|
|
3394
|
+
sequenceNumberColor: card
|
|
3263
3395
|
};
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3396
|
+
}
|
|
3397
|
+
var FIT = 4 / 3;
|
|
3398
|
+
function naturalSize(svg) {
|
|
3399
|
+
const w = svg.match(/viewBox="[\d.-]+ [\d.-]+ ([\d.]+) [\d.]+"/)?.[1];
|
|
3400
|
+
if (!w) return { svg, width: null };
|
|
3401
|
+
const width = Math.ceil(Number(w));
|
|
3402
|
+
return {
|
|
3403
|
+
svg: svg.replace(/<svg([^>]*?)\swidth="100%"/, `<svg$1 width="${width}"`).replace(/max-width:\s*[\d.]+px;?/, ""),
|
|
3404
|
+
width
|
|
3405
|
+
};
|
|
3406
|
+
}
|
|
3407
|
+
function useInnerWidth(ref, padding) {
|
|
3408
|
+
const [width, setWidth] = useState(null);
|
|
3409
|
+
useEffect(() => {
|
|
3410
|
+
const el = ref.current;
|
|
3411
|
+
if (!el) return;
|
|
3412
|
+
const ro = new ResizeObserver(() => setWidth(el.clientWidth - padding));
|
|
3413
|
+
ro.observe(el);
|
|
3414
|
+
return () => ro.disconnect();
|
|
3415
|
+
}, [ref, padding]);
|
|
3416
|
+
return width;
|
|
3417
|
+
}
|
|
3418
|
+
function Diagram({ chart, caption, load, className }) {
|
|
3419
|
+
const ref = useRef(null);
|
|
3420
|
+
const dark = useDarkMode();
|
|
3421
|
+
const raw = useId();
|
|
3422
|
+
const [drawn, setDrawn] = useState(null);
|
|
3423
|
+
const [failed, setFailed] = useState(false);
|
|
3424
|
+
const room = useInnerWidth(ref, 48);
|
|
3425
|
+
const fits = drawn?.width != null && room != null && drawn.width <= room * FIT;
|
|
3426
|
+
useEffect(() => {
|
|
3427
|
+
let live = true;
|
|
3428
|
+
const el = ref.current;
|
|
3429
|
+
if (!el) return;
|
|
3430
|
+
(async () => {
|
|
3431
|
+
try {
|
|
3432
|
+
const mod = await load();
|
|
3433
|
+
const mermaid = "default" in mod ? mod.default : mod;
|
|
3434
|
+
mermaid.initialize({ startOnLoad: false, securityLevel: "strict", theme: "base", themeVariables: mermaidTheme(el) });
|
|
3435
|
+
const { svg } = await mermaid.render(`oca-diagram-${raw.replace(/[^a-zA-Z0-9]/g, "")}-${dark ? "d" : "l"}`, chart);
|
|
3436
|
+
if (live) {
|
|
3437
|
+
setDrawn(naturalSize(svg));
|
|
3438
|
+
setFailed(false);
|
|
3439
|
+
}
|
|
3440
|
+
} catch {
|
|
3441
|
+
if (live) setFailed(true);
|
|
3442
|
+
}
|
|
3443
|
+
})();
|
|
3444
|
+
return () => {
|
|
3445
|
+
live = false;
|
|
3446
|
+
};
|
|
3447
|
+
}, [chart, dark, load, raw]);
|
|
3448
|
+
if (failed) return /* @__PURE__ */ jsx(CodeBlock, { code: chart, caption: "Diagram (shown as its source)", className: cn("my-6", className) });
|
|
3449
|
+
return /* @__PURE__ */ jsxs("figure", { ref, className: cn("not-prose my-6 overflow-hidden rounded-[1.25rem] border border-border bg-card", className), children: [
|
|
3450
|
+
drawn ? /* @__PURE__ */ jsx(ScrollFade, { fade: "var(--card)", children: /* @__PURE__ */ jsx(
|
|
3451
|
+
"div",
|
|
3268
3452
|
{
|
|
3269
|
-
"
|
|
3453
|
+
"data-fit": fits ? "" : void 0,
|
|
3270
3454
|
className: cn(
|
|
3271
|
-
"
|
|
3272
|
-
|
|
3273
|
-
grid
|
|
3455
|
+
"flex justify-center p-6 [&_svg]:h-auto",
|
|
3456
|
+
fits ? "w-full [&_svg]:max-w-full" : "w-max min-w-full [&_svg]:max-w-none"
|
|
3274
3457
|
),
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
]
|
|
3458
|
+
role: "img",
|
|
3459
|
+
"aria-label": typeof caption === "string" ? caption : "Diagram",
|
|
3460
|
+
dangerouslySetInnerHTML: { __html: drawn.svg }
|
|
3279
3461
|
}
|
|
3280
|
-
),
|
|
3281
|
-
|
|
3282
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
3283
|
-
/* @__PURE__ */ jsx("span", { className: "oca-title-sm", children: r.label }),
|
|
3284
|
-
r.note ? /* @__PURE__ */ jsx("span", { className: "text-[0.875rem] leading-snug text-muted-foreground", children: r.note }) : null
|
|
3285
|
-
] }),
|
|
3286
|
-
/* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-2 gap-1", desk === "lg" ? "lg:contents" : "md:contents"), children: columns.map((c) => {
|
|
3287
|
-
return /* @__PURE__ */ jsxs(
|
|
3288
|
-
"div",
|
|
3289
|
-
{
|
|
3290
|
-
style: { "--oca-order": ordered.indexOf(c) },
|
|
3291
|
-
className: cn(
|
|
3292
|
-
// Two rows of the pair's grid (name, answer), so answers line up
|
|
3293
|
-
// across a pair even when one name wraps.
|
|
3294
|
-
"order-[var(--oca-order)] row-span-2 grid min-w-0 grid-rows-subgrid gap-1 rounded-xl px-3 py-2.5",
|
|
3295
|
-
desk === "lg" ? "lg:order-none lg:row-span-1 lg:flex lg:flex-col" : "md:order-none md:row-span-1 md:flex md:flex-col",
|
|
3296
|
-
c.highlight ? cn(
|
|
3297
|
-
TINT,
|
|
3298
|
-
"col-span-2",
|
|
3299
|
-
desk === "lg" ? "lg:col-span-1 lg:-my-5 lg:self-stretch lg:rounded-none lg:px-4 lg:py-5" : "md:col-span-1 md:-my-5 md:self-stretch md:rounded-none md:px-4 md:py-5"
|
|
3300
|
-
) : desk === "lg" ? "lg:p-0" : "md:p-0"
|
|
3301
|
-
),
|
|
3302
|
-
children: [
|
|
3303
|
-
/* @__PURE__ */ jsx(
|
|
3304
|
-
"span",
|
|
3305
|
-
{
|
|
3306
|
-
className: cn(
|
|
3307
|
-
"text-[0.8125rem]",
|
|
3308
|
-
c.highlight ? "text-oca-accent-ink" : "text-muted-foreground",
|
|
3309
|
-
desk === "lg" ? "lg:sr-only" : "md:sr-only"
|
|
3310
|
-
),
|
|
3311
|
-
children: c.label
|
|
3312
|
-
}
|
|
3313
|
-
),
|
|
3314
|
-
/* @__PURE__ */ jsx("span", { className: cn("text-[0.9375rem]", c.highlight && "font-medium"), children: r.values[c.key] ?? "\u2014" })
|
|
3315
|
-
]
|
|
3316
|
-
},
|
|
3317
|
-
c.key
|
|
3318
|
-
);
|
|
3319
|
-
}) })
|
|
3320
|
-
] }, ri))
|
|
3462
|
+
) }) : /* @__PURE__ */ jsx("div", { role: "status", "aria-label": "Drawing the diagram", className: "p-6", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-40 w-full rounded-xl" }) }),
|
|
3463
|
+
caption ? /* @__PURE__ */ jsx("figcaption", { className: "border-t border-border px-5 py-3 text-[0.8125rem] text-muted-foreground", children: caption }) : null
|
|
3321
3464
|
] });
|
|
3322
3465
|
}
|
|
3323
|
-
var
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
skipped: { word: "Skipped", icon: /* @__PURE__ */ jsx(CircleMinus, {}), tone: "text-muted-foreground" },
|
|
3329
|
-
unchecked: { word: "Not checked", icon: /* @__PURE__ */ jsx(CircleDashed, {}), tone: "text-oca-subtle" }
|
|
3466
|
+
var HEADING = {
|
|
3467
|
+
h1: "oca-display-3 mb-4 text-foreground",
|
|
3468
|
+
h2: "mb-3 mt-12 text-[1.375rem] font-medium leading-tight tracking-[-0.015em] text-foreground md:text-[1.5rem]",
|
|
3469
|
+
h3: "mb-2 mt-9 text-[1.125rem] font-medium leading-snug tracking-[-0.01em] text-foreground",
|
|
3470
|
+
h4: "mb-2 mt-7 text-[1rem] font-medium leading-snug text-foreground"
|
|
3330
3471
|
};
|
|
3331
|
-
function
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
notChecked,
|
|
3338
|
-
actions,
|
|
3339
|
-
as: Heading = "h2",
|
|
3340
|
-
className
|
|
3472
|
+
function DocsHeading({
|
|
3473
|
+
as: Tag,
|
|
3474
|
+
id,
|
|
3475
|
+
children,
|
|
3476
|
+
className,
|
|
3477
|
+
...props
|
|
3341
3478
|
}) {
|
|
3342
|
-
return /* @__PURE__ */ jsxs(
|
|
3343
|
-
"
|
|
3344
|
-
|
|
3345
|
-
"
|
|
3346
|
-
className: cn("overflow-hidden rounded-[1.25rem] border border-border bg-card", className),
|
|
3347
|
-
children: [
|
|
3348
|
-
/* @__PURE__ */ jsxs("header", { className: "flex flex-col items-start gap-3 p-6 md:p-8", children: [
|
|
3349
|
-
/* @__PURE__ */ jsx(StatusBadge, { status: verdict }),
|
|
3350
|
-
/* @__PURE__ */ jsx(Heading, { className: "oca-display-3 [overflow-wrap:anywhere]", children: title }),
|
|
3351
|
-
summary ? /* @__PURE__ */ jsx("p", { className: "oca-body max-w-[40rem] [overflow-wrap:anywhere]", children: summary }) : null
|
|
3352
|
-
] }),
|
|
3353
|
-
/* @__PURE__ */ jsx("ul", { "aria-label": "Checks", className: "divide-y divide-border border-t border-border", children: checks.map((c, i) => {
|
|
3354
|
-
const k = CHECK[c.state];
|
|
3355
|
-
return /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-3 px-6 py-3.5 md:px-8", children: [
|
|
3356
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("mt-0.5 shrink-0 [&_svg]:size-[1.125rem]", k.tone), children: k.icon }),
|
|
3357
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5 sm:flex-row sm:items-baseline sm:justify-between sm:gap-6", children: [
|
|
3358
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
3359
|
-
/* @__PURE__ */ jsx("span", { className: "text-[0.9375rem]", children: c.label }),
|
|
3360
|
-
c.note ? /* @__PURE__ */ jsx("span", { className: "break-words text-[0.8125rem] leading-snug text-muted-foreground", children: c.note }) : null
|
|
3361
|
-
] }),
|
|
3362
|
-
/* @__PURE__ */ jsx(
|
|
3363
|
-
"span",
|
|
3364
|
-
{
|
|
3365
|
-
className: cn(
|
|
3366
|
-
"shrink-0 text-[0.8125rem]",
|
|
3367
|
-
c.state === "fail" ? "text-destructive" : "text-muted-foreground"
|
|
3368
|
-
),
|
|
3369
|
-
children: k.word
|
|
3370
|
-
}
|
|
3371
|
-
)
|
|
3372
|
-
] })
|
|
3373
|
-
] }, i);
|
|
3374
|
-
}) }),
|
|
3375
|
-
facts && facts.length > 0 ? /* @__PURE__ */ jsx(KeyValueList, { items: facts, className: "rounded-none border-x-0 border-b-0 bg-transparent [&>div]:px-6 md:[&>div]:px-8" }) : null,
|
|
3376
|
-
notChecked && notChecked.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 border-t border-border bg-muted/50 px-6 py-5 md:px-8", children: [
|
|
3377
|
-
/* @__PURE__ */ jsx("p", { className: "text-[0.875rem] font-medium", children: "What this did not check" }),
|
|
3378
|
-
/* @__PURE__ */ jsx("ul", { className: "flex list-disc flex-col gap-1 pl-5 text-[0.875rem] leading-relaxed text-muted-foreground", children: notChecked.map((n, i) => /* @__PURE__ */ jsx("li", { children: n }, i)) })
|
|
3379
|
-
] }) : null,
|
|
3380
|
-
actions ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3 border-t border-border px-6 py-5 md:px-8", children: actions }) : null
|
|
3381
|
-
]
|
|
3382
|
-
}
|
|
3383
|
-
);
|
|
3384
|
-
}
|
|
3385
|
-
function SignMessage({
|
|
3386
|
-
lead,
|
|
3387
|
-
address,
|
|
3388
|
-
message,
|
|
3389
|
-
wallets,
|
|
3390
|
-
busy = false,
|
|
3391
|
-
error,
|
|
3392
|
-
submitLabel = "Confirm",
|
|
3393
|
-
secondary,
|
|
3394
|
-
onSignature,
|
|
3395
|
-
className
|
|
3396
|
-
}) {
|
|
3397
|
-
const [pasted, setPasted] = useState("");
|
|
3398
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-5", className), children: [
|
|
3399
|
-
lead ? /* @__PURE__ */ jsx("p", { className: "text-[0.9375rem] leading-relaxed", children: lead }) : null,
|
|
3400
|
-
wallets ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3401
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: wallets }),
|
|
3402
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-[0.8125rem] text-muted-foreground", children: [
|
|
3403
|
-
/* @__PURE__ */ jsx("span", { className: "h-px flex-1 bg-border" }),
|
|
3404
|
-
"or sign it in any wallet",
|
|
3405
|
-
/* @__PURE__ */ jsx("span", { className: "h-px flex-1 bg-border" })
|
|
3406
|
-
] })
|
|
3407
|
-
] }) : null,
|
|
3408
|
-
/* @__PURE__ */ jsx(CodeBlock, { code: message, caption: "Message to sign" }),
|
|
3409
|
-
/* @__PURE__ */ jsxs(
|
|
3410
|
-
"form",
|
|
3479
|
+
return /* @__PURE__ */ jsxs(Tag, { id, className: cn("group scroll-mt-28", HEADING[Tag], className), ...props, children: [
|
|
3480
|
+
/* @__PURE__ */ jsx("span", { "data-heading-text": "", children }),
|
|
3481
|
+
id && Tag !== "h1" ? /* @__PURE__ */ jsxs(
|
|
3482
|
+
"a",
|
|
3411
3483
|
{
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
e.preventDefault();
|
|
3415
|
-
if (pasted.trim()) onSignature(pasted.trim());
|
|
3416
|
-
},
|
|
3484
|
+
href: `#${id}`,
|
|
3485
|
+
className: "ml-2 inline-block rounded-md px-1 align-baseline text-[0.85em] font-normal text-oca-subtle no-underline opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100",
|
|
3417
3486
|
children: [
|
|
3418
|
-
/* @__PURE__ */ jsx(
|
|
3419
|
-
|
|
3420
|
-
{
|
|
3421
|
-
label: "Signature",
|
|
3422
|
-
error,
|
|
3423
|
-
hint: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3424
|
-
"From your wallet\u2019s \u201Csign message\u201D (BIP-322), signed by",
|
|
3425
|
-
" ",
|
|
3426
|
-
/* @__PURE__ */ jsx("span", { className: "break-all font-mono", children: address }),
|
|
3427
|
-
"."
|
|
3428
|
-
] }),
|
|
3429
|
-
children: /* @__PURE__ */ jsx(
|
|
3430
|
-
Textarea,
|
|
3431
|
-
{
|
|
3432
|
-
value: pasted,
|
|
3433
|
-
onChange: (e) => setPasted(e.target.value),
|
|
3434
|
-
rows: 3,
|
|
3435
|
-
spellCheck: false,
|
|
3436
|
-
className: "min-h-24 font-mono text-base md:text-[0.8125rem]"
|
|
3437
|
-
}
|
|
3438
|
-
)
|
|
3439
|
-
}
|
|
3440
|
-
),
|
|
3441
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
3442
|
-
/* @__PURE__ */ jsx(Button, { type: "submit", loading: busy, disabled: !pasted.trim(), children: submitLabel }),
|
|
3443
|
-
secondary
|
|
3444
|
-
] })
|
|
3487
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "#" }),
|
|
3488
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Link to this section" })
|
|
3445
3489
|
]
|
|
3446
3490
|
}
|
|
3447
|
-
)
|
|
3448
|
-
] });
|
|
3449
|
-
}
|
|
3450
|
-
var isInternal = (href) => href.startsWith("/") || href.startsWith("#");
|
|
3451
|
-
function DocLink({ href, className, children, ...rest }) {
|
|
3452
|
-
return isInternal(href) ? /* @__PURE__ */ jsx(Link, { href, className, ...rest, children }) : /* @__PURE__ */ jsx("a", { href, className, ...rest, children });
|
|
3453
|
-
}
|
|
3454
|
-
function Breadcrumbs({ items, action, className }) {
|
|
3455
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("flex min-h-11 items-center justify-between gap-4 sm:min-h-0", className), children: [
|
|
3456
|
-
/* @__PURE__ */ jsx("nav", { "aria-label": "Breadcrumb", className: "min-w-0", children: /* @__PURE__ */ jsx("ol", { className: "flex min-w-0 items-center gap-1.5 text-[0.875rem] text-muted-foreground", children: items.map((c, i) => {
|
|
3457
|
-
const last = i === items.length - 1;
|
|
3458
|
-
return /* @__PURE__ */ jsxs("li", { className: cn("flex items-center gap-1.5", last ? "min-w-0" : "shrink-0"), children: [
|
|
3459
|
-
c.href && !last ? /* @__PURE__ */ jsx(DocLink, { href: c.href, className: "inline-flex min-h-11 items-center transition-colors hover:text-foreground sm:min-h-0", children: c.label }) : /* @__PURE__ */ jsx("span", { "aria-current": last ? "page" : void 0, className: cn("truncate", last && "text-foreground"), children: c.label }),
|
|
3460
|
-
!last ? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": true, className: "size-3.5 shrink-0 text-oca-subtle" }) : null
|
|
3461
|
-
] }, i);
|
|
3462
|
-
}) }) }),
|
|
3463
|
-
action ? /* @__PURE__ */ jsx("div", { className: "shrink-0 text-[0.875rem]", children: action }) : null
|
|
3464
|
-
] });
|
|
3465
|
-
}
|
|
3466
|
-
function DocsPager({ prev, next, className }) {
|
|
3467
|
-
if (!prev && !next) return null;
|
|
3468
|
-
const card = (l, dir) => /* @__PURE__ */ jsxs(
|
|
3469
|
-
DocLink,
|
|
3470
|
-
{
|
|
3471
|
-
href: l.href,
|
|
3472
|
-
className: cn(
|
|
3473
|
-
"group flex min-h-20 flex-col justify-center gap-1 rounded-2xl border border-border bg-card px-5 py-4 transition-colors hover:border-oca-hairline-strong",
|
|
3474
|
-
dir === "next" && "items-end text-right sm:col-start-2"
|
|
3475
|
-
),
|
|
3476
|
-
children: [
|
|
3477
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-[0.8125rem] text-muted-foreground", children: [
|
|
3478
|
-
dir === "prev" ? /* @__PURE__ */ jsx(ArrowLeft, { "aria-hidden": true, className: "size-3.5" }) : null,
|
|
3479
|
-
dir === "prev" ? "Previous" : "Next",
|
|
3480
|
-
l.section ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xB7" }) : null,
|
|
3481
|
-
l.section ? /* @__PURE__ */ jsx("span", { className: "truncate", children: l.section }) : null,
|
|
3482
|
-
dir === "next" ? /* @__PURE__ */ jsx(ArrowRight, { "aria-hidden": true, className: "size-3.5" }) : null
|
|
3483
|
-
] }),
|
|
3484
|
-
/* @__PURE__ */ jsx("span", { className: "text-[1rem] font-medium leading-snug text-foreground", children: l.label })
|
|
3485
|
-
]
|
|
3486
|
-
}
|
|
3487
|
-
);
|
|
3488
|
-
return /* @__PURE__ */ jsxs("nav", { "aria-label": "Previous and next page", className: cn("grid grid-cols-1 gap-3 border-t border-border pt-8 sm:grid-cols-2", className), children: [
|
|
3489
|
-
prev ? card(prev, "prev") : null,
|
|
3490
|
-
next ? card(next, "next") : null
|
|
3491
|
+
) : null
|
|
3491
3492
|
] });
|
|
3492
3493
|
}
|
|
3493
|
-
function
|
|
3494
|
-
|
|
3495
|
-
useEffect(() => {
|
|
3496
|
-
const read = () => {
|
|
3497
|
-
const root = document.querySelector(selector);
|
|
3498
|
-
if (!root) return setItems([]);
|
|
3499
|
-
setItems(
|
|
3500
|
-
Array.from(root.querySelectorAll("h2[id], h3[id]")).map((h) => ({
|
|
3501
|
-
id: h.id,
|
|
3502
|
-
// The anchor link's "#" is not part of the name.
|
|
3503
|
-
label: (h.querySelector("[data-heading-text]") ?? h).textContent?.trim() ?? "",
|
|
3504
|
-
level: h.tagName === "H3" ? 3 : 2
|
|
3505
|
-
}))
|
|
3506
|
-
);
|
|
3507
|
-
};
|
|
3508
|
-
const raf = requestAnimationFrame(read);
|
|
3509
|
-
const t = setTimeout(read, 80);
|
|
3510
|
-
return () => {
|
|
3511
|
-
cancelAnimationFrame(raf);
|
|
3512
|
-
clearTimeout(t);
|
|
3513
|
-
};
|
|
3514
|
-
}, [selector, key]);
|
|
3515
|
-
const activeId = useActiveHeading(items.map((i) => i.id));
|
|
3516
|
-
return { items, activeId };
|
|
3517
|
-
}
|
|
3518
|
-
function OnThisPage({
|
|
3519
|
-
items,
|
|
3520
|
-
activeId,
|
|
3521
|
-
title = "On this page",
|
|
3522
|
-
onNavigate,
|
|
3523
|
-
className
|
|
3524
|
-
}) {
|
|
3525
|
-
const id = useId();
|
|
3526
|
-
if (items.length === 0) return null;
|
|
3527
|
-
return (
|
|
3528
|
-
// With no visible title (a folded list under its own summary) the name is still "On this page".
|
|
3529
|
-
/* @__PURE__ */ jsxs("nav", { "aria-labelledby": title ? id : void 0, "aria-label": title ? void 0 : "On this page", className, children: [
|
|
3530
|
-
title ? /* @__PURE__ */ jsx("p", { id, className: "mb-3 text-[0.875rem] font-medium", children: title }) : null,
|
|
3531
|
-
/* @__PURE__ */ jsx("ul", { children: items.map((t) => {
|
|
3532
|
-
const on = t.id === activeId;
|
|
3533
|
-
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
3534
|
-
"a",
|
|
3535
|
-
{
|
|
3536
|
-
href: `#${t.id}`,
|
|
3537
|
-
onClick: onNavigate,
|
|
3538
|
-
"aria-current": on ? "location" : void 0,
|
|
3539
|
-
className: cn(
|
|
3540
|
-
"block border-l py-1.5 text-[0.875rem] leading-snug transition-colors",
|
|
3541
|
-
t.level === 3 ? "pl-7" : "pl-4",
|
|
3542
|
-
on ? "border-foreground text-foreground" : "border-border text-muted-foreground hover:text-foreground"
|
|
3543
|
-
),
|
|
3544
|
-
children: t.label
|
|
3545
|
-
}
|
|
3546
|
-
) }, t.id);
|
|
3547
|
-
}) })
|
|
3548
|
-
] })
|
|
3549
|
-
);
|
|
3550
|
-
}
|
|
3551
|
-
var CALLOUT_TONE = { note: "neutral", warning: "brand", danger: "danger" };
|
|
3552
|
-
function Callout({
|
|
3553
|
-
tone = "note",
|
|
3494
|
+
function ProtocolHero({
|
|
3495
|
+
protocol: protocol2,
|
|
3554
3496
|
title,
|
|
3497
|
+
lead,
|
|
3498
|
+
actions,
|
|
3499
|
+
art,
|
|
3555
3500
|
children,
|
|
3556
3501
|
className
|
|
3557
3502
|
}) {
|
|
3503
|
+
const p = protocolSite(protocol2);
|
|
3558
3504
|
return /* @__PURE__ */ jsx(
|
|
3559
|
-
|
|
3505
|
+
PageHero,
|
|
3560
3506
|
{
|
|
3561
|
-
|
|
3507
|
+
className,
|
|
3508
|
+
eyebrow: `Protocol \xB7 ${p.verb}`,
|
|
3562
3509
|
title,
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3510
|
+
lead,
|
|
3511
|
+
actions,
|
|
3512
|
+
art,
|
|
3513
|
+
children: p.status !== "live" || children ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-4", children: [
|
|
3514
|
+
p.status !== "live" ? /* @__PURE__ */ jsx(StatusBadge, { status: p.status }) : null,
|
|
3515
|
+
children
|
|
3516
|
+
] }) : null
|
|
3566
3517
|
}
|
|
3567
3518
|
);
|
|
3568
3519
|
}
|
|
3569
|
-
function
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
"span",
|
|
3573
|
-
{
|
|
3574
|
-
"aria-hidden": true,
|
|
3575
|
-
className: "absolute left-0 top-0 flex size-7 items-center justify-center rounded-full border border-oca-hairline-strong bg-card text-[0.8125rem] oca-tabular text-foreground before:content-[counter(oca-step)]"
|
|
3576
|
-
}
|
|
3577
|
-
),
|
|
3578
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute bottom-1 left-[0.8125rem] top-9 w-px bg-border" }),
|
|
3579
|
-
/* @__PURE__ */ jsx("h3", { id, className: "scroll-mt-28 pt-0.5 text-[1.0625rem] font-medium leading-snug tracking-[-0.008em] text-foreground", children: title }),
|
|
3580
|
-
/* @__PURE__ */ jsx("div", { className: "mt-2 text-muted-foreground [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", children })
|
|
3581
|
-
] });
|
|
3582
|
-
}
|
|
3583
|
-
function Steps({ children, className }) {
|
|
3584
|
-
return /* @__PURE__ */ jsx("ol", { className: cn("not-prose my-8 flex flex-col [counter-reset:oca-step] [&>li:last-child>span:nth-child(2)]:hidden", className), children });
|
|
3585
|
-
}
|
|
3586
|
-
function LinkCard({
|
|
3587
|
-
href,
|
|
3588
|
-
title,
|
|
3589
|
-
description,
|
|
3590
|
-
icon,
|
|
3591
|
-
meta,
|
|
3520
|
+
function ProtocolNav({
|
|
3521
|
+
current,
|
|
3522
|
+
link = "page",
|
|
3592
3523
|
className
|
|
3593
3524
|
}) {
|
|
3594
|
-
|
|
3525
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "Protocols", className, children: /* @__PURE__ */ jsx(ScrollFade, { fade: "var(--background)", children: /* @__PURE__ */ jsx("ul", { className: "flex w-max min-w-full items-center gap-6 border-b border-border", children: PROTOCOLS.map((p) => {
|
|
3526
|
+
const on = p.slug === current;
|
|
3527
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
3528
|
+
"a",
|
|
3529
|
+
{
|
|
3530
|
+
href: link === "tool" ? p.toolHref : p.pageHref,
|
|
3531
|
+
"aria-current": on ? "page" : void 0,
|
|
3532
|
+
className: cn(
|
|
3533
|
+
"-mb-px inline-flex h-11 items-center border-b-2 text-[0.9375rem] transition-colors",
|
|
3534
|
+
on ? "border-foreground text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3535
|
+
),
|
|
3536
|
+
children: p.label
|
|
3537
|
+
}
|
|
3538
|
+
) }, p.slug);
|
|
3539
|
+
}) }) }) });
|
|
3540
|
+
}
|
|
3541
|
+
var SPEC_FILE = {
|
|
3542
|
+
spec: {
|
|
3543
|
+
file: "SPEC.md",
|
|
3544
|
+
title: "Normative source",
|
|
3545
|
+
note: "This page is a human-readable summary. The authoritative copy lives in the spec repo. If the two ever drift, the repo wins."
|
|
3546
|
+
},
|
|
3547
|
+
security: {
|
|
3548
|
+
file: "SECURITY.md",
|
|
3549
|
+
title: "Normative threat model",
|
|
3550
|
+
note: "This page is the short form. The authoritative, numbered threat model lives in the spec repo."
|
|
3551
|
+
},
|
|
3552
|
+
rationale: {
|
|
3553
|
+
file: "WHY.md",
|
|
3554
|
+
title: "Design rationale",
|
|
3555
|
+
note: "This page is the short version. The full rationale and the rejected-design log live in the spec repo."
|
|
3556
|
+
}
|
|
3557
|
+
};
|
|
3558
|
+
function SpecCard(props) {
|
|
3559
|
+
return props.repo !== void 0 ? /* @__PURE__ */ jsx(SpecFileNote, { ...props }) : /* @__PURE__ */ jsx(ProtocolSpecCard, { ...props });
|
|
3560
|
+
}
|
|
3561
|
+
function SpecFileNote({ repo, file, kind = "spec", version, note, className }) {
|
|
3562
|
+
const d = SPEC_FILE[kind];
|
|
3563
|
+
const f = file ?? d.file;
|
|
3564
|
+
return /* @__PURE__ */ jsxs(Callout, { title: version ? `${d.title} \xB7 ${version}` : d.title, className, children: [
|
|
3565
|
+
/* @__PURE__ */ jsx("p", { children: note ?? d.note }),
|
|
3566
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx(TextLink, { href: `https://github.com/orangecheck/${repo}/blob/main/${f}`, className: "break-all font-mono text-[0.875rem]", children: `${repo}/${f}` }) })
|
|
3567
|
+
] });
|
|
3568
|
+
}
|
|
3569
|
+
function ProtocolSpecCard({ protocol: protocol2, version, license, vectors, size = "md", className }) {
|
|
3570
|
+
const p = protocolSite(protocol2);
|
|
3571
|
+
const repo = `oc-${p.slug}-protocol`;
|
|
3572
|
+
const facts = [
|
|
3573
|
+
["Version", version],
|
|
3574
|
+
...license ? [["Licence", license]] : [],
|
|
3575
|
+
["Nostr kind", p.kinds],
|
|
3576
|
+
...vectors !== void 0 ? [["Test vectors", String(vectors)]] : []
|
|
3577
|
+
];
|
|
3578
|
+
if (size === "sm") {
|
|
3579
|
+
return /* @__PURE__ */ jsxs(
|
|
3580
|
+
"a",
|
|
3581
|
+
{
|
|
3582
|
+
href: p.specHref,
|
|
3583
|
+
className: cn(
|
|
3584
|
+
"group flex flex-wrap items-center gap-x-4 gap-y-1 rounded-2xl border border-border bg-card px-4 py-3 text-[0.875rem] transition-colors hover:border-oca-hairline-strong",
|
|
3585
|
+
className
|
|
3586
|
+
),
|
|
3587
|
+
children: [
|
|
3588
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-[0.8125rem] text-foreground", children: repo }),
|
|
3589
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: facts.map(([k, v]) => k === "Version" ? `v${v}` : k === "Nostr kind" ? `kind ${v}` : v).join(" \xB7 ") }),
|
|
3590
|
+
/* @__PURE__ */ jsxs("span", { className: "ml-auto flex items-center gap-1 text-muted-foreground group-hover:text-foreground", children: [
|
|
3591
|
+
"Read the spec ",
|
|
3592
|
+
/* @__PURE__ */ jsx(ArrowUpRight, { "aria-hidden": true, className: "size-4" })
|
|
3593
|
+
] })
|
|
3594
|
+
]
|
|
3595
|
+
}
|
|
3596
|
+
);
|
|
3597
|
+
}
|
|
3598
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-6 rounded-[1.25rem] border border-border bg-card p-6 md:p-8", className), children: [
|
|
3599
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
3600
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [
|
|
3601
|
+
/* @__PURE__ */ jsx("p", { className: "text-[0.875rem] text-muted-foreground", children: "The spec" }),
|
|
3602
|
+
/* @__PURE__ */ jsx("h3", { className: "oca-title break-all font-mono text-[1.0625rem] tracking-normal", children: repo })
|
|
3603
|
+
] }),
|
|
3604
|
+
p.status !== "live" ? /* @__PURE__ */ jsx(StatusBadge, { status: p.status }) : null
|
|
3605
|
+
] }),
|
|
3606
|
+
/* @__PURE__ */ jsx("dl", { className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-4", children: facts.map(([k, v]) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
3607
|
+
/* @__PURE__ */ jsx("dt", { className: "text-[0.8125rem] text-muted-foreground", children: k }),
|
|
3608
|
+
/* @__PURE__ */ jsx("dd", { className: "oca-tabular text-[1.0625rem]", children: v })
|
|
3609
|
+
] }, k)) }),
|
|
3610
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, { asChild: true, variant: "secondary", size: "sm", children: /* @__PURE__ */ jsxs("a", { href: p.specHref, children: [
|
|
3611
|
+
"Read the spec ",
|
|
3612
|
+
/* @__PURE__ */ jsx(ArrowUpRight, { "aria-hidden": true })
|
|
3613
|
+
] }) }) })
|
|
3614
|
+
] });
|
|
3615
|
+
}
|
|
3616
|
+
function VerifyBox({
|
|
3617
|
+
action,
|
|
3618
|
+
param = "q",
|
|
3619
|
+
title,
|
|
3620
|
+
description,
|
|
3621
|
+
label = "Id, envelope or link",
|
|
3622
|
+
placeholder,
|
|
3623
|
+
hint,
|
|
3624
|
+
submitLabel = "Verify",
|
|
3625
|
+
multiline = false,
|
|
3626
|
+
onVerify,
|
|
3627
|
+
className
|
|
3628
|
+
}) {
|
|
3629
|
+
const [value, setValue] = useState("");
|
|
3630
|
+
const submit = (e) => {
|
|
3631
|
+
if (!onVerify) return;
|
|
3632
|
+
e.preventDefault();
|
|
3633
|
+
if (value.trim()) onVerify(value.trim());
|
|
3634
|
+
};
|
|
3635
|
+
const button = /* @__PURE__ */ jsx(Button, { type: "submit", className: multiline ? void 0 : "w-full sm:w-auto", children: submitLabel });
|
|
3595
3636
|
return /* @__PURE__ */ jsxs(
|
|
3596
|
-
|
|
3637
|
+
"form",
|
|
3597
3638
|
{
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
),
|
|
3639
|
+
action,
|
|
3640
|
+
method: "get",
|
|
3641
|
+
onSubmit: submit,
|
|
3642
|
+
className: cn("flex flex-col gap-5 rounded-[1.25rem] border border-border bg-card p-6 md:p-8", className),
|
|
3603
3643
|
children: [
|
|
3604
|
-
/* @__PURE__ */ jsxs("
|
|
3605
|
-
|
|
3606
|
-
/* @__PURE__ */
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3644
|
+
title || description ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
3645
|
+
title ? /* @__PURE__ */ jsx("h3", { className: "oca-title", children: title }) : null,
|
|
3646
|
+
description ? /* @__PURE__ */ jsx("p", { className: "oca-body text-[0.9375rem]", children: description }) : null
|
|
3647
|
+
] }) : null,
|
|
3648
|
+
multiline ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3649
|
+
/* @__PURE__ */ jsx(Field, { label, hint, children: /* @__PURE__ */ jsx(
|
|
3650
|
+
Textarea,
|
|
3651
|
+
{
|
|
3652
|
+
name: param,
|
|
3653
|
+
required: true,
|
|
3654
|
+
value,
|
|
3655
|
+
onChange: (e) => setValue(e.target.value),
|
|
3656
|
+
placeholder,
|
|
3657
|
+
spellCheck: false,
|
|
3658
|
+
className: "min-h-32 font-mono text-base md:text-[0.8125rem]"
|
|
3659
|
+
}
|
|
3660
|
+
) }),
|
|
3661
|
+
/* @__PURE__ */ jsx("div", { children: button })
|
|
3662
|
+
] }) : /* @__PURE__ */ jsx(Field, { label, hint, action: button, children: /* @__PURE__ */ jsx(
|
|
3663
|
+
Input,
|
|
3664
|
+
{
|
|
3665
|
+
name: param,
|
|
3666
|
+
required: true,
|
|
3667
|
+
value,
|
|
3668
|
+
onChange: (e) => setValue(e.target.value),
|
|
3669
|
+
placeholder,
|
|
3670
|
+
spellCheck: false,
|
|
3671
|
+
autoComplete: "off",
|
|
3672
|
+
className: "font-mono text-base md:text-[0.875rem]"
|
|
3673
|
+
}
|
|
3674
|
+
) })
|
|
3613
3675
|
]
|
|
3614
3676
|
}
|
|
3615
3677
|
);
|
|
3616
3678
|
}
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
function MdxTable({ className, ...props }) {
|
|
3621
|
-
return /* @__PURE__ */ jsx("div", { className: "not-prose my-6 overflow-hidden rounded-2xl border border-border bg-card", children: /* @__PURE__ */ jsx(ScrollFade, { fade: "var(--card)", children: /* @__PURE__ */ jsx(
|
|
3622
|
-
"table",
|
|
3623
|
-
{
|
|
3624
|
-
className: cn(
|
|
3625
|
-
"w-full border-collapse text-left text-[0.875rem] leading-relaxed",
|
|
3626
|
-
"[&_th]:whitespace-nowrap [&_th]:border-b [&_th]:border-oca-hairline-strong [&_th]:bg-oca-table-head [&_th]:px-4 [&_th]:py-2.5 [&_th]:text-[0.8125rem] [&_th]:font-medium [&_th]:text-foreground",
|
|
3627
|
-
"[&_td]:border-t [&_td]:border-border [&_td]:px-4 [&_td]:py-2.5 [&_td]:align-top [&_td]:text-muted-foreground [&_tbody_tr:first-child_td]:border-t-0",
|
|
3628
|
-
"[&_td_code]:bg-transparent [&_td_code]:p-0 [&_td_code]:text-foreground [&_td:first-child]:text-foreground",
|
|
3629
|
-
"[&_[align=center]]:text-center [&_[align=right]]:text-right",
|
|
3630
|
-
// On a phone a cell keeps a readable width; the table scrolls instead of crushing it.
|
|
3631
|
-
"max-sm:[&_td]:min-w-[9rem]",
|
|
3632
|
-
className
|
|
3633
|
-
),
|
|
3634
|
-
...props
|
|
3635
|
-
}
|
|
3636
|
-
) }) });
|
|
3637
|
-
}
|
|
3638
|
-
function ApiTable({
|
|
3679
|
+
var TINT = "bg-[color-mix(in_oklab,var(--oca-orange)_9%,var(--card))]";
|
|
3680
|
+
function ComparisonTable({
|
|
3681
|
+
columns,
|
|
3639
3682
|
rows,
|
|
3640
|
-
|
|
3641
|
-
|
|
3683
|
+
label,
|
|
3684
|
+
propertyHeading = "Property",
|
|
3642
3685
|
className
|
|
3643
3686
|
}) {
|
|
3644
|
-
const
|
|
3645
|
-
const
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("not-prose my-6", className), children: [
|
|
3651
|
-
/* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-2xl border border-border bg-card max-sm:hidden", children: /* @__PURE__ */ jsx(ScrollFade, { fade: "var(--card)", children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-left text-[0.875rem]", children: [
|
|
3652
|
-
caption ? /* @__PURE__ */ jsx("caption", { className: "sr-only", children: caption }) : null,
|
|
3653
|
-
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-oca-hairline-strong bg-oca-table-head text-[0.8125rem]", children: [
|
|
3654
|
-
/* @__PURE__ */ jsx("th", { scope: "col", className: "px-4 py-2.5 font-medium", children: nameHeader }),
|
|
3655
|
-
/* @__PURE__ */ jsx("th", { scope: "col", className: "px-4 py-2.5 font-medium", children: "Type" }),
|
|
3656
|
-
hasDefault ? /* @__PURE__ */ jsx("th", { scope: "col", className: "px-4 py-2.5 font-medium", children: "Default" }) : null,
|
|
3657
|
-
/* @__PURE__ */ jsx("th", { scope: "col", className: "px-4 py-2.5 font-medium", children: "Description" })
|
|
3658
|
-
] }) }),
|
|
3659
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-border", children: rows.map((r) => /* @__PURE__ */ jsxs("tr", { className: "align-top", children: [
|
|
3660
|
-
/* @__PURE__ */ jsx("th", { scope: "row", className: "px-4 py-3 text-left font-normal", children: /* @__PURE__ */ jsxs("span", { className: "flex flex-col items-start gap-1", children: [
|
|
3661
|
-
/* @__PURE__ */ jsx("code", { className: cn("font-mono text-[0.8125rem] text-foreground", r.deprecated && "line-through decoration-oca-subtle"), children: r.name }),
|
|
3662
|
-
marks(r)
|
|
3663
|
-
] }) }),
|
|
3664
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-3 font-mono text-[0.8125rem] text-muted-foreground", children: r.type ?? "\u2014" }),
|
|
3665
|
-
hasDefault ? /* @__PURE__ */ jsx("td", { className: "px-4 py-3 font-mono text-[0.8125rem] text-muted-foreground", children: r.default ?? "\u2014" }) : null,
|
|
3666
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-3 leading-relaxed text-muted-foreground", children: r.description })
|
|
3667
|
-
] }, r.name)) })
|
|
3668
|
-
] }) }) }),
|
|
3669
|
-
/* @__PURE__ */ jsx("ul", { "aria-label": caption, className: "divide-y divide-border rounded-2xl border border-border bg-card sm:hidden", children: rows.map((r) => /* @__PURE__ */ jsxs("li", { className: "flex flex-col gap-1.5 px-4 py-3.5", children: [
|
|
3670
|
-
/* @__PURE__ */ jsxs("span", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
|
|
3671
|
-
/* @__PURE__ */ jsx("code", { className: cn("font-mono text-[0.875rem] text-foreground", r.deprecated && "line-through decoration-oca-subtle"), children: r.name }),
|
|
3672
|
-
r.type ? /* @__PURE__ */ jsx("code", { className: "break-all font-mono text-[0.8125rem] text-muted-foreground", children: r.type }) : null
|
|
3673
|
-
] }),
|
|
3674
|
-
/* @__PURE__ */ jsx("span", { className: "flex flex-wrap items-center gap-2 empty:hidden", children: marks(r) }),
|
|
3675
|
-
r.description ? /* @__PURE__ */ jsx("span", { className: "text-[0.875rem] leading-relaxed text-muted-foreground", children: r.description }) : null,
|
|
3676
|
-
r.default !== void 0 ? /* @__PURE__ */ jsxs("span", { className: "text-[0.8125rem] text-muted-foreground", children: [
|
|
3677
|
-
"Default ",
|
|
3678
|
-
/* @__PURE__ */ jsx("code", { className: "font-mono text-foreground", children: r.default })
|
|
3679
|
-
] }) : null
|
|
3680
|
-
] }, r.name)) })
|
|
3681
|
-
] });
|
|
3682
|
-
}
|
|
3683
|
-
function useDarkMode() {
|
|
3684
|
-
const [dark, setDark] = useState(false);
|
|
3685
|
-
useEffect(() => {
|
|
3686
|
-
const root = document.documentElement;
|
|
3687
|
-
const read = () => setDark(root.classList.contains("dark"));
|
|
3688
|
-
read();
|
|
3689
|
-
const mo = new MutationObserver(read);
|
|
3690
|
-
mo.observe(root, { attributes: true, attributeFilter: ["class"] });
|
|
3691
|
-
return () => mo.disconnect();
|
|
3692
|
-
}, []);
|
|
3693
|
-
return dark;
|
|
3694
|
-
}
|
|
3695
|
-
function mermaidTheme(el) {
|
|
3696
|
-
const css = getComputedStyle(el);
|
|
3697
|
-
const v = (name) => css.getPropertyValue(name).trim();
|
|
3698
|
-
const card = v("--card");
|
|
3699
|
-
const muted = v("--muted");
|
|
3700
|
-
const text = v("--foreground");
|
|
3701
|
-
const subtle = v("--muted-foreground");
|
|
3702
|
-
const line = v("--input");
|
|
3703
|
-
const hair = v("--oca-hairline-strong");
|
|
3704
|
-
return {
|
|
3705
|
-
background: "transparent",
|
|
3706
|
-
fontFamily: css.fontFamily,
|
|
3707
|
-
fontSize: "14px",
|
|
3708
|
-
textColor: text,
|
|
3709
|
-
mainBkg: card,
|
|
3710
|
-
primaryColor: card,
|
|
3711
|
-
primaryTextColor: text,
|
|
3712
|
-
primaryBorderColor: hair,
|
|
3713
|
-
secondaryColor: muted,
|
|
3714
|
-
secondaryTextColor: text,
|
|
3715
|
-
secondaryBorderColor: hair,
|
|
3716
|
-
tertiaryColor: muted,
|
|
3717
|
-
tertiaryTextColor: text,
|
|
3718
|
-
tertiaryBorderColor: hair,
|
|
3719
|
-
nodeBorder: hair,
|
|
3720
|
-
lineColor: line,
|
|
3721
|
-
edgeLabelBackground: card,
|
|
3722
|
-
clusterBkg: muted,
|
|
3723
|
-
clusterBorder: hair,
|
|
3724
|
-
titleColor: text,
|
|
3725
|
-
noteBkgColor: muted,
|
|
3726
|
-
noteTextColor: text,
|
|
3727
|
-
noteBorderColor: hair,
|
|
3728
|
-
actorBkg: card,
|
|
3729
|
-
actorBorder: hair,
|
|
3730
|
-
actorTextColor: text,
|
|
3731
|
-
actorLineColor: line,
|
|
3732
|
-
signalColor: text,
|
|
3733
|
-
signalTextColor: text,
|
|
3734
|
-
labelBoxBkgColor: card,
|
|
3735
|
-
labelBoxBorderColor: hair,
|
|
3736
|
-
labelTextColor: text,
|
|
3737
|
-
loopTextColor: subtle,
|
|
3738
|
-
activationBkgColor: muted,
|
|
3739
|
-
activationBorderColor: hair,
|
|
3740
|
-
sequenceNumberColor: card
|
|
3687
|
+
const wide = columns.length > 3;
|
|
3688
|
+
const grid = wide ? "lg:grid lg:grid-cols-[var(--oca-compare)]" : "md:grid md:grid-cols-[var(--oca-compare)]";
|
|
3689
|
+
const desk = wide ? "lg" : "md";
|
|
3690
|
+
const style = {
|
|
3691
|
+
// The argued-for column gets a little more room: its answers carry the page.
|
|
3692
|
+
"--oca-compare": ["minmax(0, 1.4fr)", ...columns.map((c) => c.highlight ? "minmax(0, 1.3fr)" : "minmax(0, 1fr)")].join(" ")
|
|
3741
3693
|
};
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
return svg.replace(/<svg([^>]*?)\swidth="100%"/, `<svg$1 width="${Math.ceil(Number(w))}"`).replace(/max-width:\s*[\d.]+px;?/, "");
|
|
3747
|
-
}
|
|
3748
|
-
function Diagram({ chart, caption, load, className }) {
|
|
3749
|
-
const ref = useRef(null);
|
|
3750
|
-
const dark = useDarkMode();
|
|
3751
|
-
const raw = useId();
|
|
3752
|
-
const [svg, setSvg] = useState(null);
|
|
3753
|
-
const [failed, setFailed] = useState(false);
|
|
3754
|
-
useEffect(() => {
|
|
3755
|
-
let live = true;
|
|
3756
|
-
const el = ref.current;
|
|
3757
|
-
if (!el) return;
|
|
3758
|
-
(async () => {
|
|
3759
|
-
try {
|
|
3760
|
-
const mod = await load();
|
|
3761
|
-
const mermaid = "default" in mod ? mod.default : mod;
|
|
3762
|
-
mermaid.initialize({ startOnLoad: false, securityLevel: "strict", theme: "base", themeVariables: mermaidTheme(el) });
|
|
3763
|
-
const { svg: drawn } = await mermaid.render(`oca-diagram-${raw.replace(/[^a-zA-Z0-9]/g, "")}-${dark ? "d" : "l"}`, chart);
|
|
3764
|
-
if (live) {
|
|
3765
|
-
setSvg(naturalSize(drawn));
|
|
3766
|
-
setFailed(false);
|
|
3767
|
-
}
|
|
3768
|
-
} catch {
|
|
3769
|
-
if (live) setFailed(true);
|
|
3770
|
-
}
|
|
3771
|
-
})();
|
|
3772
|
-
return () => {
|
|
3773
|
-
live = false;
|
|
3774
|
-
};
|
|
3775
|
-
}, [chart, dark, load, raw]);
|
|
3776
|
-
if (failed) return /* @__PURE__ */ jsx(CodeBlock, { code: chart, caption: "Diagram (shown as its source)", className: cn("my-6", className) });
|
|
3777
|
-
return /* @__PURE__ */ jsxs("figure", { ref, className: cn("not-prose my-6 overflow-hidden rounded-[1.25rem] border border-border bg-card", className), children: [
|
|
3778
|
-
svg ? /* @__PURE__ */ jsx(ScrollFade, { fade: "var(--card)", children: /* @__PURE__ */ jsx(
|
|
3779
|
-
"div",
|
|
3694
|
+
const ordered = [...columns].sort((a, b) => Number(Boolean(b.highlight)) - Number(Boolean(a.highlight)));
|
|
3695
|
+
return /* @__PURE__ */ jsxs("ul", { "aria-label": label, style, className: cn("divide-y divide-border rounded-[1.25rem] border border-border bg-card", className), children: [
|
|
3696
|
+
/* @__PURE__ */ jsxs(
|
|
3697
|
+
"li",
|
|
3780
3698
|
{
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3699
|
+
"aria-hidden": true,
|
|
3700
|
+
className: cn(
|
|
3701
|
+
"hidden gap-5 px-5 py-4 text-[0.875rem] font-medium text-muted-foreground",
|
|
3702
|
+
wide ? "lg:grid lg:px-8" : "md:grid md:px-8",
|
|
3703
|
+
grid
|
|
3704
|
+
),
|
|
3705
|
+
children: [
|
|
3706
|
+
/* @__PURE__ */ jsx("span", { children: propertyHeading }),
|
|
3707
|
+
columns.map((c) => /* @__PURE__ */ jsx("span", { className: cn(c.highlight && cn(TINT, "-my-4 px-4 py-4 text-oca-accent-ink")), children: c.label }, c.key))
|
|
3708
|
+
]
|
|
3785
3709
|
}
|
|
3786
|
-
)
|
|
3787
|
-
|
|
3710
|
+
),
|
|
3711
|
+
rows.map((r, ri) => /* @__PURE__ */ jsxs("li", { className: cn("grid grid-cols-1 gap-3 px-5 py-5", wide ? "lg:items-start lg:gap-5 lg:px-8" : "md:items-start md:gap-5 md:px-8", grid), children: [
|
|
3712
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
3713
|
+
/* @__PURE__ */ jsx("span", { className: "oca-title-sm", children: r.label }),
|
|
3714
|
+
r.note ? /* @__PURE__ */ jsx("span", { className: "text-[0.875rem] leading-snug text-muted-foreground", children: r.note }) : null
|
|
3715
|
+
] }),
|
|
3716
|
+
/* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-2 gap-1", desk === "lg" ? "lg:contents" : "md:contents"), children: columns.map((c) => {
|
|
3717
|
+
return /* @__PURE__ */ jsxs(
|
|
3718
|
+
"div",
|
|
3719
|
+
{
|
|
3720
|
+
style: { "--oca-order": ordered.indexOf(c) },
|
|
3721
|
+
className: cn(
|
|
3722
|
+
// Two rows of the pair's grid (name, answer), so answers line up
|
|
3723
|
+
// across a pair even when one name wraps.
|
|
3724
|
+
"order-[var(--oca-order)] row-span-2 grid min-w-0 grid-rows-subgrid gap-1 rounded-xl px-3 py-2.5",
|
|
3725
|
+
desk === "lg" ? "lg:order-none lg:row-span-1 lg:flex lg:flex-col" : "md:order-none md:row-span-1 md:flex md:flex-col",
|
|
3726
|
+
c.highlight ? cn(
|
|
3727
|
+
TINT,
|
|
3728
|
+
"col-span-2",
|
|
3729
|
+
desk === "lg" ? "lg:col-span-1 lg:-my-5 lg:self-stretch lg:rounded-none lg:px-4 lg:py-5" : "md:col-span-1 md:-my-5 md:self-stretch md:rounded-none md:px-4 md:py-5"
|
|
3730
|
+
) : desk === "lg" ? "lg:p-0" : "md:p-0"
|
|
3731
|
+
),
|
|
3732
|
+
children: [
|
|
3733
|
+
/* @__PURE__ */ jsx(
|
|
3734
|
+
"span",
|
|
3735
|
+
{
|
|
3736
|
+
className: cn(
|
|
3737
|
+
"text-[0.8125rem]",
|
|
3738
|
+
c.highlight ? "text-oca-accent-ink" : "text-muted-foreground",
|
|
3739
|
+
desk === "lg" ? "lg:sr-only" : "md:sr-only"
|
|
3740
|
+
),
|
|
3741
|
+
children: c.label
|
|
3742
|
+
}
|
|
3743
|
+
),
|
|
3744
|
+
/* @__PURE__ */ jsx("span", { className: cn("text-[0.9375rem]", c.highlight && "font-medium"), children: r.values[c.key] ?? "\u2014" })
|
|
3745
|
+
]
|
|
3746
|
+
},
|
|
3747
|
+
c.key
|
|
3748
|
+
);
|
|
3749
|
+
}) })
|
|
3750
|
+
] }, ri))
|
|
3788
3751
|
] });
|
|
3789
3752
|
}
|
|
3790
|
-
var
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3753
|
+
var CHECK = {
|
|
3754
|
+
ok: { word: "Passed", icon: /* @__PURE__ */ jsx(CircleCheck, {}), tone: "text-success" },
|
|
3755
|
+
fail: { word: "Failed", icon: /* @__PURE__ */ jsx(CircleX, {}), tone: "text-destructive" },
|
|
3756
|
+
pending: { word: "Pending", icon: /* @__PURE__ */ jsx(Clock, {}), tone: "text-oca-accent-ink" },
|
|
3757
|
+
none: { word: "None", icon: /* @__PURE__ */ jsx(CircleSlash, {}), tone: "text-muted-foreground" },
|
|
3758
|
+
skipped: { word: "Skipped", icon: /* @__PURE__ */ jsx(CircleMinus, {}), tone: "text-muted-foreground" },
|
|
3759
|
+
unchecked: { word: "Not checked", icon: /* @__PURE__ */ jsx(CircleDashed, {}), tone: "text-oca-subtle" }
|
|
3795
3760
|
};
|
|
3796
|
-
function
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3761
|
+
function VerifyReport({
|
|
3762
|
+
verdict,
|
|
3763
|
+
title,
|
|
3764
|
+
summary,
|
|
3765
|
+
checks,
|
|
3766
|
+
facts,
|
|
3767
|
+
notChecked,
|
|
3768
|
+
actions,
|
|
3769
|
+
as: Heading = "h2",
|
|
3770
|
+
className
|
|
3802
3771
|
}) {
|
|
3803
|
-
return /* @__PURE__ */ jsxs(
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
"
|
|
3772
|
+
return /* @__PURE__ */ jsxs(
|
|
3773
|
+
"section",
|
|
3774
|
+
{
|
|
3775
|
+
"aria-label": "Verification result",
|
|
3776
|
+
className: cn("overflow-hidden rounded-[1.25rem] border border-border bg-card", className),
|
|
3777
|
+
children: [
|
|
3778
|
+
/* @__PURE__ */ jsxs("header", { className: "flex flex-col items-start gap-3 p-6 md:p-8", children: [
|
|
3779
|
+
/* @__PURE__ */ jsx(StatusBadge, { status: verdict }),
|
|
3780
|
+
/* @__PURE__ */ jsx(Heading, { className: "oca-display-3 [overflow-wrap:anywhere]", children: title }),
|
|
3781
|
+
summary ? /* @__PURE__ */ jsx("p", { className: "oca-body max-w-[40rem] [overflow-wrap:anywhere]", children: summary }) : null
|
|
3782
|
+
] }),
|
|
3783
|
+
/* @__PURE__ */ jsx("ul", { "aria-label": "Checks", className: "divide-y divide-border border-t border-border", children: checks.map((c, i) => {
|
|
3784
|
+
const k = CHECK[c.state];
|
|
3785
|
+
return /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-3 px-6 py-3.5 md:px-8", children: [
|
|
3786
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("mt-0.5 shrink-0 [&_svg]:size-[1.125rem]", k.tone), children: k.icon }),
|
|
3787
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5 sm:flex-row sm:items-baseline sm:justify-between sm:gap-6", children: [
|
|
3788
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
3789
|
+
/* @__PURE__ */ jsx("span", { className: "text-[0.9375rem]", children: c.label }),
|
|
3790
|
+
c.note ? /* @__PURE__ */ jsx("span", { className: "break-words text-[0.8125rem] leading-snug text-muted-foreground", children: c.note }) : null
|
|
3791
|
+
] }),
|
|
3792
|
+
/* @__PURE__ */ jsx(
|
|
3793
|
+
"span",
|
|
3794
|
+
{
|
|
3795
|
+
className: cn(
|
|
3796
|
+
"shrink-0 text-[0.8125rem]",
|
|
3797
|
+
c.state === "fail" ? "text-destructive" : "text-muted-foreground"
|
|
3798
|
+
),
|
|
3799
|
+
children: k.word
|
|
3800
|
+
}
|
|
3801
|
+
)
|
|
3802
|
+
] })
|
|
3803
|
+
] }, i);
|
|
3804
|
+
}) }),
|
|
3805
|
+
facts && facts.length > 0 ? /* @__PURE__ */ jsx(KeyValueList, { items: facts, className: "rounded-none border-x-0 border-b-0 bg-transparent [&>div]:px-6 md:[&>div]:px-8" }) : null,
|
|
3806
|
+
notChecked && notChecked.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 border-t border-border bg-muted/50 px-6 py-5 md:px-8", children: [
|
|
3807
|
+
/* @__PURE__ */ jsx("p", { className: "text-[0.875rem] font-medium", children: "What this did not check" }),
|
|
3808
|
+
/* @__PURE__ */ jsx("ul", { className: "flex list-disc flex-col gap-1 pl-5 text-[0.875rem] leading-relaxed text-muted-foreground", children: notChecked.map((n, i) => /* @__PURE__ */ jsx("li", { children: n }, i)) })
|
|
3809
|
+
] }) : null,
|
|
3810
|
+
actions ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3 border-t border-border px-6 py-5 md:px-8", children: actions }) : null
|
|
3811
|
+
]
|
|
3812
|
+
}
|
|
3813
|
+
);
|
|
3814
|
+
}
|
|
3815
|
+
function SignMessage({
|
|
3816
|
+
lead,
|
|
3817
|
+
address,
|
|
3818
|
+
message,
|
|
3819
|
+
wallets,
|
|
3820
|
+
busy = false,
|
|
3821
|
+
error,
|
|
3822
|
+
submitLabel = "Confirm",
|
|
3823
|
+
secondary,
|
|
3824
|
+
onSignature,
|
|
3825
|
+
className
|
|
3826
|
+
}) {
|
|
3827
|
+
const [pasted, setPasted] = useState("");
|
|
3828
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-5", className), children: [
|
|
3829
|
+
lead ? /* @__PURE__ */ jsx("p", { className: "text-[0.9375rem] leading-relaxed", children: lead }) : null,
|
|
3830
|
+
wallets ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3831
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: wallets }),
|
|
3832
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-[0.8125rem] text-muted-foreground", children: [
|
|
3833
|
+
/* @__PURE__ */ jsx("span", { className: "h-px flex-1 bg-border" }),
|
|
3834
|
+
"or sign it in any wallet",
|
|
3835
|
+
/* @__PURE__ */ jsx("span", { className: "h-px flex-1 bg-border" })
|
|
3836
|
+
] })
|
|
3837
|
+
] }) : null,
|
|
3838
|
+
/* @__PURE__ */ jsx(CodeBlock, { code: message, caption: "Message to sign" }),
|
|
3839
|
+
/* @__PURE__ */ jsxs(
|
|
3840
|
+
"form",
|
|
3807
3841
|
{
|
|
3808
|
-
|
|
3809
|
-
|
|
3842
|
+
className: "flex flex-col gap-4",
|
|
3843
|
+
onSubmit: (e) => {
|
|
3844
|
+
e.preventDefault();
|
|
3845
|
+
if (pasted.trim()) onSignature(pasted.trim());
|
|
3846
|
+
},
|
|
3810
3847
|
children: [
|
|
3811
|
-
/* @__PURE__ */ jsx(
|
|
3812
|
-
|
|
3848
|
+
/* @__PURE__ */ jsx(
|
|
3849
|
+
Field,
|
|
3850
|
+
{
|
|
3851
|
+
label: "Signature",
|
|
3852
|
+
error,
|
|
3853
|
+
hint: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3854
|
+
"From your wallet\u2019s \u201Csign message\u201D (BIP-322), signed by",
|
|
3855
|
+
" ",
|
|
3856
|
+
/* @__PURE__ */ jsx("span", { className: "break-all font-mono", children: address }),
|
|
3857
|
+
"."
|
|
3858
|
+
] }),
|
|
3859
|
+
children: /* @__PURE__ */ jsx(
|
|
3860
|
+
Textarea,
|
|
3861
|
+
{
|
|
3862
|
+
value: pasted,
|
|
3863
|
+
onChange: (e) => setPasted(e.target.value),
|
|
3864
|
+
rows: 3,
|
|
3865
|
+
spellCheck: false,
|
|
3866
|
+
className: "min-h-24 font-mono text-base md:text-[0.8125rem]"
|
|
3867
|
+
}
|
|
3868
|
+
)
|
|
3869
|
+
}
|
|
3870
|
+
),
|
|
3871
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
3872
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", loading: busy, disabled: !pasted.trim(), children: submitLabel }),
|
|
3873
|
+
secondary
|
|
3874
|
+
] })
|
|
3813
3875
|
]
|
|
3814
3876
|
}
|
|
3815
|
-
)
|
|
3877
|
+
)
|
|
3816
3878
|
] });
|
|
3817
3879
|
}
|
|
3818
3880
|
function useMacKeys() {
|