@canofold/markdown 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Markdown-C7O01MRv.js → Markdown-CPG2lcO7.js} +222 -211
- package/dist/base.css +1 -1
- package/dist/client/chunks/{client-kVNIqHQd.js → client-CTpZrdpv.js} +2 -2
- package/dist/client/chunks/{image-BuMCsr5L.js → image-BsfZtDsx.js} +1 -1
- package/dist/client/chunks/{serialized-T1PzI4rG.js → serialized-Ck9NBdg7.js} +129 -118
- package/dist/client/chunks/{table-JOSJsHgy.js → table-jaJMPch3.js} +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiler/fenceMetadata.d.ts +7 -0
- package/dist/compiler/normalizeOptions.d.ts +2 -1
- package/dist/compiler/plugins/code.d.ts +1 -1
- package/dist/compiler/prepareMarkdown.d.ts +1 -1
- package/dist/compiler/types.d.ts +3 -0
- package/dist/components/blocks/MarkdownCodeBlock.d.ts +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{prepareMarkdown-D-bFl1_V.js → prepareMarkdown-DPMq7203.js} +344 -331
- package/dist/server.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as c, j as s, g as qn } from "./react-runtime-Dzgdzn6D.js";
|
|
2
|
-
import { c as re, u as Xn, t as Gn, g as
|
|
3
|
-
import { c as jn } from "./client-
|
|
2
|
+
import { c as re, u as Xn, t as Gn, g as kn, a as Jn, e as V, s as h, D, b as wn, m as G, d as Q, M as En, f as W, r as X, h as ne, i as we, j as Yn, I as Le, k as Zn, l as Ne } from "./provider-DNSHvvN7.js";
|
|
3
|
+
import { c as jn } from "./client-CTpZrdpv.js";
|
|
4
4
|
/**
|
|
5
5
|
* @license lucide-react v1.34.0 - ISC
|
|
6
6
|
*
|
|
@@ -106,21 +106,21 @@ function Re({
|
|
|
106
106
|
srcSet: f,
|
|
107
107
|
sizes: p,
|
|
108
108
|
zoomLabel: m,
|
|
109
|
-
closeLabel:
|
|
109
|
+
closeLabel: C,
|
|
110
110
|
inner: b = !1,
|
|
111
|
-
...
|
|
111
|
+
...N
|
|
112
112
|
}) {
|
|
113
|
-
const j =
|
|
113
|
+
const j = N, k = Xn(), g = t && k ? k(t, "src") : t, S = f && k ? Gn(f, k) : f, y = kn(Jn()), A = c.Children.toArray(e).find(
|
|
114
114
|
(Z) => c.isValidElement(Z) && V(Z) === "img"
|
|
115
115
|
), P = c.Children.toArray(e).find((Z) => {
|
|
116
116
|
if (!c.isValidElement(Z)) return !1;
|
|
117
117
|
const le = Z;
|
|
118
118
|
return V(le) === "figcaption" || le.props["data-cf-slot"] === "caption";
|
|
119
|
-
}), R = m || h(j, "data-cf-zoom-label", "dataCfZoomLabel") || D.zoomImage, I =
|
|
119
|
+
}), R = m || h(j, "data-cf-zoom-label", "dataCfZoomLabel") || D.zoomImage, I = C || h(j, "data-cf-close-label", "dataCfCloseLabel") || D.closeImagePreview, [L, B] = c.useState(!1), O = c.useRef(null), M = c.useRef(null), z = c.useRef(null), q = () => B(!1), E = wn({
|
|
120
120
|
open: L,
|
|
121
121
|
close: q,
|
|
122
122
|
dialogRef: z,
|
|
123
|
-
initialFocusRef:
|
|
123
|
+
initialFocusRef: M,
|
|
124
124
|
triggerRef: O
|
|
125
125
|
}), x = A ?? (g ? /* @__PURE__ */ s.jsx(
|
|
126
126
|
"img",
|
|
@@ -180,7 +180,7 @@ function Re({
|
|
|
180
180
|
/* @__PURE__ */ s.jsx(
|
|
181
181
|
"button",
|
|
182
182
|
{
|
|
183
|
-
ref:
|
|
183
|
+
ref: M,
|
|
184
184
|
className: "cf-icon-button cf-image-lightbox-close",
|
|
185
185
|
type: "button",
|
|
186
186
|
"data-cf-action": "close-image",
|
|
@@ -1358,7 +1358,7 @@ const vt = ie({
|
|
|
1358
1358
|
transform(e, n) {
|
|
1359
1359
|
return "xml:" + n.slice(3).toLowerCase();
|
|
1360
1360
|
}
|
|
1361
|
-
}),
|
|
1361
|
+
}), Ct = {
|
|
1362
1362
|
classId: "classID",
|
|
1363
1363
|
dataType: "datatype",
|
|
1364
1364
|
itemId: "itemID",
|
|
@@ -1376,7 +1376,7 @@ const vt = ie({
|
|
|
1376
1376
|
xLinkTitle: "xlinkTitle",
|
|
1377
1377
|
xLinkType: "xlinkType",
|
|
1378
1378
|
xmlnsXLink: "xmlnsXlink"
|
|
1379
|
-
},
|
|
1379
|
+
}, kt = /[A-Z]/g, cn = /-[a-z]/g, wt = /^data[-\w.:]+$/i;
|
|
1380
1380
|
function Et(e, n) {
|
|
1381
1381
|
const t = Ae(n);
|
|
1382
1382
|
let a = n, o = H;
|
|
@@ -1389,7 +1389,7 @@ function Et(e, n) {
|
|
|
1389
1389
|
} else {
|
|
1390
1390
|
const l = n.slice(4);
|
|
1391
1391
|
if (!cn.test(l)) {
|
|
1392
|
-
let r = l.replace(
|
|
1392
|
+
let r = l.replace(kt, jt);
|
|
1393
1393
|
r.charAt(0) !== "-" && (r = "-" + r), n = "data" + r;
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
@@ -1412,11 +1412,11 @@ function Mt() {
|
|
|
1412
1412
|
if (un) return je;
|
|
1413
1413
|
un = 1;
|
|
1414
1414
|
var e = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, n = /\n/g, t = /^\s*/, a = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, o = /^:\s*/, l = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, r = /^[;\s]*/, i = /^\s+|\s+$/g, u = `
|
|
1415
|
-
`, f = "/", p = "*", m = "",
|
|
1416
|
-
function
|
|
1417
|
-
if (typeof
|
|
1415
|
+
`, f = "/", p = "*", m = "", C = "comment", b = "declaration";
|
|
1416
|
+
function N(k, g) {
|
|
1417
|
+
if (typeof k != "string")
|
|
1418
1418
|
throw new TypeError("First argument must be a string");
|
|
1419
|
-
if (!
|
|
1419
|
+
if (!k) return [];
|
|
1420
1420
|
g = g || {};
|
|
1421
1421
|
var S = 1, y = 1;
|
|
1422
1422
|
function A(E) {
|
|
@@ -1434,18 +1434,18 @@ function Mt() {
|
|
|
1434
1434
|
function R(E) {
|
|
1435
1435
|
this.start = E, this.end = { line: S, column: y }, this.source = g.source;
|
|
1436
1436
|
}
|
|
1437
|
-
R.prototype.content =
|
|
1437
|
+
R.prototype.content = k;
|
|
1438
1438
|
function I(E) {
|
|
1439
1439
|
var x = new Error(
|
|
1440
1440
|
g.source + ":" + S + ":" + y + ": " + E
|
|
1441
1441
|
);
|
|
1442
|
-
if (x.reason = E, x.filename = g.source, x.line = S, x.column = y, x.source =
|
|
1442
|
+
if (x.reason = E, x.filename = g.source, x.line = S, x.column = y, x.source = k, !g.silent) throw x;
|
|
1443
1443
|
}
|
|
1444
1444
|
function L(E) {
|
|
1445
|
-
var x = E.exec(
|
|
1445
|
+
var x = E.exec(k);
|
|
1446
1446
|
if (x) {
|
|
1447
1447
|
var _ = x[0];
|
|
1448
|
-
return A(_),
|
|
1448
|
+
return A(_), k = k.slice(_.length), x;
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
1451
1451
|
function B() {
|
|
@@ -1453,20 +1453,20 @@ function Mt() {
|
|
|
1453
1453
|
}
|
|
1454
1454
|
function O(E) {
|
|
1455
1455
|
var x;
|
|
1456
|
-
for (E = E || []; x =
|
|
1456
|
+
for (E = E || []; x = M(); )
|
|
1457
1457
|
x !== !1 && E.push(x);
|
|
1458
1458
|
return E;
|
|
1459
1459
|
}
|
|
1460
|
-
function
|
|
1460
|
+
function M() {
|
|
1461
1461
|
var E = P();
|
|
1462
|
-
if (!(f !=
|
|
1463
|
-
for (var x = 2; m !=
|
|
1462
|
+
if (!(f != k.charAt(0) || p != k.charAt(1))) {
|
|
1463
|
+
for (var x = 2; m != k.charAt(x) && (p != k.charAt(x) || f != k.charAt(x + 1)); )
|
|
1464
1464
|
++x;
|
|
1465
|
-
if (x += 2, m ===
|
|
1465
|
+
if (x += 2, m === k.charAt(x - 1))
|
|
1466
1466
|
return I("End of comment missing");
|
|
1467
|
-
var _ =
|
|
1468
|
-
return y += 2, A(_),
|
|
1469
|
-
type:
|
|
1467
|
+
var _ = k.slice(2, x - 2);
|
|
1468
|
+
return y += 2, A(_), k = k.slice(x), y += 2, E({
|
|
1469
|
+
type: C,
|
|
1470
1470
|
comment: _
|
|
1471
1471
|
});
|
|
1472
1472
|
}
|
|
@@ -1474,7 +1474,7 @@ function Mt() {
|
|
|
1474
1474
|
function z() {
|
|
1475
1475
|
var E = P(), x = L(a);
|
|
1476
1476
|
if (x) {
|
|
1477
|
-
if (
|
|
1477
|
+
if (M(), !L(o)) return I("property missing ':'");
|
|
1478
1478
|
var _ = L(l), Y = E({
|
|
1479
1479
|
type: b,
|
|
1480
1480
|
property: j(x[0].replace(e, m)),
|
|
@@ -1492,10 +1492,10 @@ function Mt() {
|
|
|
1492
1492
|
}
|
|
1493
1493
|
return B(), q();
|
|
1494
1494
|
}
|
|
1495
|
-
function j(
|
|
1496
|
-
return
|
|
1495
|
+
function j(k) {
|
|
1496
|
+
return k ? k.replace(i, m) : m;
|
|
1497
1497
|
}
|
|
1498
|
-
return je =
|
|
1498
|
+
return je = N, je;
|
|
1499
1499
|
}
|
|
1500
1500
|
var dn;
|
|
1501
1501
|
function Tt() {
|
|
@@ -1871,7 +1871,7 @@ function Qt(e, n, t) {
|
|
|
1871
1871
|
return e.stylePropertyNameCase === "css" && (o = na(o)), ["style", o];
|
|
1872
1872
|
}
|
|
1873
1873
|
return [
|
|
1874
|
-
e.elementAttributeNameCase === "react" && a.space ?
|
|
1874
|
+
e.elementAttributeNameCase === "react" && a.space ? Ct[a.property] || a.property : a.attribute,
|
|
1875
1875
|
t
|
|
1876
1876
|
];
|
|
1877
1877
|
}
|
|
@@ -1952,7 +1952,7 @@ function aa(e) {
|
|
|
1952
1952
|
return "-" + e.toLowerCase();
|
|
1953
1953
|
}
|
|
1954
1954
|
const On = 1500;
|
|
1955
|
-
function
|
|
1955
|
+
function Ce({
|
|
1956
1956
|
value: e,
|
|
1957
1957
|
label: n,
|
|
1958
1958
|
action: t,
|
|
@@ -2210,24 +2210,35 @@ function _e({
|
|
|
2210
2210
|
source: n,
|
|
2211
2211
|
language: t,
|
|
2212
2212
|
filename: a,
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2213
|
+
overflow: o,
|
|
2214
|
+
copyLabel: l,
|
|
2215
|
+
copyFailureLabel: r,
|
|
2216
|
+
...i
|
|
2216
2217
|
}) {
|
|
2217
|
-
const
|
|
2218
|
-
return /* @__PURE__ */ s.jsxs(
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2218
|
+
const u = i, f = n ?? (h(u, "data-cf-source", "dataCfSource") || ua(e)), p = t ?? (h(u, "data-cf-language", "dataCfLanguage") || "text"), m = a ?? (h(u, "data-cf-filename", "dataCfFilename") || void 0), C = h(u, "data-cf-code-overflow", "dataCfCodeOverflow"), b = o ?? (C === "wrap" || C === "scroll" ? C : void 0), N = l ?? (h(u, "data-cf-copy-label", "dataCfCopyLabel") || D.copyCode), j = r ?? (h(u, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || D.copyFailed), k = G("cf-code", u.className), { className: g, ...S } = Q(u);
|
|
2219
|
+
return /* @__PURE__ */ s.jsxs(
|
|
2220
|
+
"figure",
|
|
2221
|
+
{
|
|
2222
|
+
...S,
|
|
2223
|
+
className: k,
|
|
2224
|
+
"data-cf-component": "code-block",
|
|
2225
|
+
"data-cf-slot": "root",
|
|
2226
|
+
"data-cf-code-overflow": b,
|
|
2227
|
+
children: [
|
|
2228
|
+
/* @__PURE__ */ s.jsx(
|
|
2229
|
+
da,
|
|
2230
|
+
{
|
|
2231
|
+
source: f,
|
|
2232
|
+
language: p,
|
|
2233
|
+
filename: m,
|
|
2234
|
+
copyLabel: N,
|
|
2235
|
+
copyFailureLabel: j
|
|
2236
|
+
}
|
|
2237
|
+
),
|
|
2238
|
+
e
|
|
2239
|
+
]
|
|
2240
|
+
}
|
|
2241
|
+
);
|
|
2231
2242
|
}
|
|
2232
2243
|
function da({
|
|
2233
2244
|
source: e,
|
|
@@ -2242,7 +2253,7 @@ function da({
|
|
|
2242
2253
|
] }) : /* @__PURE__ */ s.jsx("span", { className: "cf-code-lang", "data-cf-slot": "title", children: n }), r = /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2243
2254
|
l,
|
|
2244
2255
|
/* @__PURE__ */ s.jsx("div", { className: "cf-block-actions", "data-cf-slot": "actions", children: /* @__PURE__ */ s.jsx(
|
|
2245
|
-
|
|
2256
|
+
Ce,
|
|
2246
2257
|
{
|
|
2247
2258
|
value: e,
|
|
2248
2259
|
label: a,
|
|
@@ -2274,10 +2285,10 @@ function Oe({
|
|
|
2274
2285
|
inner: l = !1,
|
|
2275
2286
|
...r
|
|
2276
2287
|
}) {
|
|
2277
|
-
const i = n ?? (h(r, "data-cf-value", "dataCfValue") || X(e)), u = t || h(r, "data-cf-copy-label", "dataCfCopyLabel") || D.copySnippet, f = a || h(r, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || D.copyFailed, p = G("cf-copy-snippet", o), { className: m, ...
|
|
2288
|
+
const i = n ?? (h(r, "data-cf-value", "dataCfValue") || X(e)), u = t || h(r, "data-cf-copy-label", "dataCfCopyLabel") || D.copySnippet, f = a || h(r, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || D.copyFailed, p = G("cf-copy-snippet", o), { className: m, ...C } = Q(r), b = /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2278
2289
|
/* @__PURE__ */ s.jsx("code", { "data-cf-slot": "content", children: e ?? i }),
|
|
2279
2290
|
/* @__PURE__ */ s.jsx(
|
|
2280
|
-
|
|
2291
|
+
Ce,
|
|
2281
2292
|
{
|
|
2282
2293
|
value: i,
|
|
2283
2294
|
label: u,
|
|
@@ -2290,7 +2301,7 @@ function Oe({
|
|
|
2290
2301
|
return l ? b : /* @__PURE__ */ s.jsx(
|
|
2291
2302
|
"span",
|
|
2292
2303
|
{
|
|
2293
|
-
...
|
|
2304
|
+
...C,
|
|
2294
2305
|
className: p,
|
|
2295
2306
|
"data-cf-component": "copy-snippet",
|
|
2296
2307
|
"data-cf-slot": "root",
|
|
@@ -2334,9 +2345,9 @@ function ma(e) {
|
|
|
2334
2345
|
function ha(e, n, t, a) {
|
|
2335
2346
|
if (!e) return null;
|
|
2336
2347
|
const o = yn(e, "thead"), l = yn(e, "tbody"), r = ze(o), i = r[0] ? be(r[0]).map((p, m) => {
|
|
2337
|
-
const
|
|
2348
|
+
const C = n?.column === m, b = C ? n.direction : void 0;
|
|
2338
2349
|
return c.cloneElement(p, {
|
|
2339
|
-
"aria-sort":
|
|
2350
|
+
"aria-sort": C ? b === "asc" ? "ascending" : "descending" : void 0,
|
|
2340
2351
|
children: /* @__PURE__ */ s.jsxs(
|
|
2341
2352
|
"button",
|
|
2342
2353
|
{
|
|
@@ -2345,7 +2356,7 @@ function ha(e, n, t, a) {
|
|
|
2345
2356
|
"data-cf-action": "sort-table",
|
|
2346
2357
|
"data-column": String(m),
|
|
2347
2358
|
"data-sort": b,
|
|
2348
|
-
"aria-pressed":
|
|
2359
|
+
"aria-pressed": C ? "true" : "false",
|
|
2349
2360
|
"aria-label": t.replace("{column}", String(m + 1)),
|
|
2350
2361
|
title: t.replace("{column}", String(m + 1)),
|
|
2351
2362
|
onClick: () => a?.(m),
|
|
@@ -2358,11 +2369,11 @@ function ha(e, n, t, a) {
|
|
|
2358
2369
|
});
|
|
2359
2370
|
}) : [], u = l ? ze(l).slice().sort((p, m) => {
|
|
2360
2371
|
if (!n) return 0;
|
|
2361
|
-
const
|
|
2362
|
-
return n.direction === "asc" ?
|
|
2372
|
+
const C = X(be(p)[n.column]?.props.children), b = X(be(m)[n.column]?.props.children), N = C.localeCompare(b, void 0, { numeric: !0, sensitivity: "base" });
|
|
2373
|
+
return n.direction === "asc" ? N : -N;
|
|
2363
2374
|
}) : [], f = ne(e.props.children).map((p) => V(p) === "thead" && r[0] ? c.cloneElement(p, {
|
|
2364
2375
|
children: r.map(
|
|
2365
|
-
(m,
|
|
2376
|
+
(m, C) => C === 0 ? c.cloneElement(m, { children: i }) : m
|
|
2366
2377
|
)
|
|
2367
2378
|
}) : V(p) === "tbody" && l && n ? c.cloneElement(p, { children: u }) : p);
|
|
2368
2379
|
return c.cloneElement(e, { children: f });
|
|
@@ -2380,15 +2391,15 @@ function $e({
|
|
|
2380
2391
|
inner: f = !1,
|
|
2381
2392
|
...p
|
|
2382
2393
|
}) {
|
|
2383
|
-
const m = p,
|
|
2394
|
+
const m = p, C = fa(e), b = c.useMemo(() => ma(C), [C]), [N, j] = c.useState(null), [k, g] = c.useState(!1), S = c.useRef(null), y = c.useRef(null), A = c.useRef(null), P = n || h(m, "data-cf-table-title", "dataCfTableTitle") || D.tableTitle, R = t || h(m, "data-cf-copy-label", "dataCfCopyLabel") || D.copyTableCsv, I = a || h(m, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || D.copyFailed, L = o || h(m, "data-cf-download-label", "dataCfDownloadLabel") || D.downloadTableCsv, B = l || h(m, "data-cf-zoom-label", "dataCfZoomLabel") || D.zoomTable, O = r || h(m, "data-cf-close-label", "dataCfCloseLabel") || D.closeTablePreview, M = i || h(m, "data-cf-sort-label", "dataCfSortLabel") || D.sortTableColumn, z = u ?? h(m, "data-cf-table", "dataCfTable"), q = G("cf-table-window", m.className), { className: E, ...x } = Q(m), Y = ha(C, N, M, (le) => j(
|
|
2384
2395
|
(ln) => ln?.column === le ? ln.direction === "asc" ? { column: le, direction: "desc" } : null : { column: le, direction: "asc" }
|
|
2385
2396
|
)), he = () => g(!1), ge = wn({
|
|
2386
|
-
open:
|
|
2397
|
+
open: k,
|
|
2387
2398
|
close: he,
|
|
2388
2399
|
dialogRef: A,
|
|
2389
2400
|
initialFocusRef: A,
|
|
2390
2401
|
triggerRef: S
|
|
2391
|
-
}), ye =
|
|
2402
|
+
}), ye = k && Y ? /* @__PURE__ */ s.jsx(En, { children: /* @__PURE__ */ s.jsxs(
|
|
2392
2403
|
"div",
|
|
2393
2404
|
{
|
|
2394
2405
|
ref: A,
|
|
@@ -2438,7 +2449,7 @@ function $e({
|
|
|
2438
2449
|
] }),
|
|
2439
2450
|
/* @__PURE__ */ s.jsxs("div", { className: "cf-block-actions", "data-cf-slot": "actions", children: [
|
|
2440
2451
|
/* @__PURE__ */ s.jsx(
|
|
2441
|
-
|
|
2452
|
+
Ce,
|
|
2442
2453
|
{
|
|
2443
2454
|
value: b,
|
|
2444
2455
|
label: R,
|
|
@@ -2489,7 +2500,7 @@ function $e({
|
|
|
2489
2500
|
"data-cf-download-label": L,
|
|
2490
2501
|
"data-cf-zoom-label": B,
|
|
2491
2502
|
"data-cf-close-label": O,
|
|
2492
|
-
"data-cf-sort-label":
|
|
2503
|
+
"data-cf-sort-label": M,
|
|
2493
2504
|
"data-cf-table": z || void 0,
|
|
2494
2505
|
children: Z
|
|
2495
2506
|
}
|
|
@@ -2524,8 +2535,8 @@ function ve({
|
|
|
2524
2535
|
copyFailureLabel: l,
|
|
2525
2536
|
...r
|
|
2526
2537
|
}) {
|
|
2527
|
-
const i = r, u = t || h(i, "data-cf-title", "dataCfTitle") || D.terminalTitle, f = a ?? h(i, "data-cf-source", "dataCfSource"), p = o || h(i, "data-cf-copy-label", "dataCfCopyLabel") || D.copyTerminal, m = l || h(i, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || D.copyFailed,
|
|
2528
|
-
return /* @__PURE__ */ s.jsxs("div", { ...
|
|
2538
|
+
const i = r, u = t || h(i, "data-cf-title", "dataCfTitle") || D.terminalTitle, f = a ?? h(i, "data-cf-source", "dataCfSource"), p = o || h(i, "data-cf-copy-label", "dataCfCopyLabel") || D.copyTerminal, m = l || h(i, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || D.copyFailed, C = G("cf-terminal", i.className), { className: b, ...N } = Q(i);
|
|
2539
|
+
return /* @__PURE__ */ s.jsxs("div", { ...N, className: C, "data-cf-component": "terminal", "data-cf-slot": "root", children: [
|
|
2529
2540
|
/* @__PURE__ */ s.jsx(
|
|
2530
2541
|
ya,
|
|
2531
2542
|
{
|
|
@@ -2548,7 +2559,7 @@ function ya({
|
|
|
2548
2559
|
const l = /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2549
2560
|
/* @__PURE__ */ s.jsx("span", { children: e }),
|
|
2550
2561
|
/* @__PURE__ */ s.jsx(
|
|
2551
|
-
|
|
2562
|
+
Ce,
|
|
2552
2563
|
{
|
|
2553
2564
|
value: n,
|
|
2554
2565
|
label: t,
|
|
@@ -2601,12 +2612,12 @@ function xa(e, n, t = "smooth") {
|
|
|
2601
2612
|
const a = n.offsetLeft, o = a + n.offsetWidth;
|
|
2602
2613
|
a < e.scrollLeft ? e.scrollTo({ left: a, behavior: t }) : o > e.scrollLeft + e.clientWidth && e.scrollTo({ left: o - e.clientWidth, behavior: t });
|
|
2603
2614
|
}
|
|
2604
|
-
function
|
|
2615
|
+
function Ca(e, n, t, a, o, l) {
|
|
2605
2616
|
const r = c.Children.toArray(e), i = r.findIndex((g) => de(g) && g.props.role === "tablist");
|
|
2606
2617
|
if (i < 0) return e;
|
|
2607
2618
|
const u = r[i], f = Ue(u);
|
|
2608
2619
|
if (!f.length) return e;
|
|
2609
|
-
const p = f.map((g, S) => $n(g) || `tab-${S + 1}`), m = f.flatMap((g, S) => Be(g) ? [] : [S]),
|
|
2620
|
+
const p = f.map((g, S) => $n(g) || `tab-${S + 1}`), m = f.flatMap((g, S) => Be(g) ? [] : [S]), C = (g, S = !1) => {
|
|
2610
2621
|
g && (t(g), queueMicrotask(() => {
|
|
2611
2622
|
const y = a.current[g];
|
|
2612
2623
|
y && (xa(o.current ?? y.parentElement ?? y, y), S && y.focus());
|
|
@@ -2619,8 +2630,8 @@ function ka(e, n, t, a, o, l) {
|
|
|
2619
2630
|
const A = g.key === "Home" ? m[0] : g.key === "End" ? m.at(-1) : m[(y + (g.key === "ArrowRight" || g.key === "ArrowDown" ? 1 : -1) + m.length) % m.length];
|
|
2620
2631
|
if (A === void 0) return;
|
|
2621
2632
|
const P = p[A];
|
|
2622
|
-
P &&
|
|
2623
|
-
},
|
|
2633
|
+
P && C(P, !0);
|
|
2634
|
+
}, N = f.map((g, S) => {
|
|
2624
2635
|
const y = p[S] ?? `tab-${S + 1}`, A = y === n, P = g.props.onClick, R = g.props.onKeyDown, I = bn(g);
|
|
2625
2636
|
return c.cloneElement(g, {
|
|
2626
2637
|
id: `${l}-tab-${S + 1}`,
|
|
@@ -2631,20 +2642,20 @@ function ka(e, n, t, a, o, l) {
|
|
|
2631
2642
|
a.current[y] = L, typeof I == "function" ? I(L) : I && "current" in I && (I.current = L);
|
|
2632
2643
|
},
|
|
2633
2644
|
onClick: (L) => {
|
|
2634
|
-
P?.(L), !L.defaultPrevented && (L.stopPropagation(),
|
|
2645
|
+
P?.(L), !L.defaultPrevented && (L.stopPropagation(), C(y));
|
|
2635
2646
|
},
|
|
2636
2647
|
onKeyDown: (L) => {
|
|
2637
2648
|
R?.(L), L.defaultPrevented || b(L, S);
|
|
2638
2649
|
}
|
|
2639
2650
|
});
|
|
2640
|
-
}), j = bn(u),
|
|
2641
|
-
children:
|
|
2651
|
+
}), j = bn(u), k = c.cloneElement(u, {
|
|
2652
|
+
children: N,
|
|
2642
2653
|
ref: (g) => {
|
|
2643
2654
|
o.current = g, typeof j == "function" ? j(g) : j && "current" in j && (j.current = g);
|
|
2644
2655
|
}
|
|
2645
2656
|
});
|
|
2646
2657
|
return r.map((g, S) => {
|
|
2647
|
-
if (S === i) return
|
|
2658
|
+
if (S === i) return k;
|
|
2648
2659
|
if (!de(g) || g.props.role !== "tabpanel") return g;
|
|
2649
2660
|
const y = r.filter((P) => de(P) && P.props.role === "tabpanel").indexOf(g), A = ba(g) || p[y] || "";
|
|
2650
2661
|
return c.cloneElement(g, {
|
|
@@ -2661,28 +2672,28 @@ function fe({
|
|
|
2661
2672
|
...a
|
|
2662
2673
|
}) {
|
|
2663
2674
|
const l = c.Children.toArray(e).find(
|
|
2664
|
-
(
|
|
2665
|
-
), r = l ? Ue(l).map((
|
|
2666
|
-
(
|
|
2667
|
-
), f = i.findIndex((
|
|
2675
|
+
(M) => de(M) && M.props.role === "tablist"
|
|
2676
|
+
), r = l ? Ue(l).map((M, z) => $n(M) || `tab-${z + 1}`) : [], i = l ? Ue(l) : [], u = i.findIndex(
|
|
2677
|
+
(M) => va(M) && !Be(M)
|
|
2678
|
+
), f = i.findIndex((M) => !Be(M)), p = r[u >= 0 ? u : f] ?? "", [m, C] = c.useState(p), b = r.includes(m) ? m : p, N = c.useRef({}), j = c.useRef(null), [k, g] = c.useState(!1), [S, y] = c.useState(!1), A = c.useId().replace(/:/g, ""), R = String(tn(a, "data-cf-tabs-id", "dataCfTabsId") ?? "") || `cf-tabs-${A}`, I = Ca(e, b, C, N, j, R);
|
|
2668
2679
|
c.useEffect(() => {
|
|
2669
2680
|
if (n !== "code-group") return;
|
|
2670
|
-
const
|
|
2671
|
-
if (!
|
|
2681
|
+
const M = j.current;
|
|
2682
|
+
if (!M) return;
|
|
2672
2683
|
const z = () => {
|
|
2673
|
-
const E = Math.max(0,
|
|
2674
|
-
g(E > 1 &&
|
|
2684
|
+
const E = Math.max(0, M.scrollWidth - M.clientWidth);
|
|
2685
|
+
g(E > 1 && M.scrollLeft > 1), y(E > 1 && M.scrollLeft < E - 1);
|
|
2675
2686
|
};
|
|
2676
|
-
z(),
|
|
2687
|
+
z(), M.addEventListener("scroll", z, { passive: !0 });
|
|
2677
2688
|
const q = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(z);
|
|
2678
|
-
return q?.observe(
|
|
2679
|
-
|
|
2689
|
+
return q?.observe(M), () => {
|
|
2690
|
+
M.removeEventListener("scroll", z), q?.disconnect();
|
|
2680
2691
|
};
|
|
2681
2692
|
}, [e, n]);
|
|
2682
|
-
const L = (
|
|
2693
|
+
const L = (M) => {
|
|
2683
2694
|
const z = j.current;
|
|
2684
2695
|
!z || typeof z.scrollBy != "function" || z.scrollBy({
|
|
2685
|
-
left:
|
|
2696
|
+
left: M * Math.max(180, z.clientWidth * 0.72),
|
|
2686
2697
|
behavior: "smooth"
|
|
2687
2698
|
});
|
|
2688
2699
|
}, B = Q(a), O = G(
|
|
@@ -2719,7 +2730,7 @@ function fe({
|
|
|
2719
2730
|
"data-cf-action": "scroll-code-tabs",
|
|
2720
2731
|
"data-cf-direction": "-1",
|
|
2721
2732
|
"aria-label": "Previous code files",
|
|
2722
|
-
hidden: !
|
|
2733
|
+
hidden: !k,
|
|
2723
2734
|
onClick: () => L(-1),
|
|
2724
2735
|
children: /* @__PURE__ */ s.jsx(W, { name: "previous", size: 18 })
|
|
2725
2736
|
}
|
|
@@ -2758,7 +2769,7 @@ function Ve(e, n, t, a) {
|
|
|
2758
2769
|
(y) => c.isValidElement(y) && vn(y) === "ul"
|
|
2759
2770
|
) : -1, m = String(
|
|
2760
2771
|
o.props["data-cf-file-tree-path"] ?? o.props.dataCfFileTreePath ?? ""
|
|
2761
|
-
),
|
|
2772
|
+
), C = f >= 0 ? X(l[f].props.children) : "", b = m || `${n}:${C.trim().toLowerCase()}`, N = f >= 0 ? l[f].props["aria-expanded"] : void 0, j = i ? t[b] ?? (N !== !1 && N !== "false") : !0, k = l.map((y, A) => {
|
|
2762
2773
|
const P = `${n}.${A}`;
|
|
2763
2774
|
if (i && A === f && c.isValidElement(y)) {
|
|
2764
2775
|
const R = y, I = R.props.onClick, L = c.Children.toArray(R.props.children), B = L.some(
|
|
@@ -2797,8 +2808,8 @@ function Ve(e, n, t, a) {
|
|
|
2797
2808
|
(y) => c.isValidElement(y) && (y.props["data-cf-slot"] === "file-icon" || y.props.dataCfSlot === "file-icon")
|
|
2798
2809
|
), S = r && !g ? [
|
|
2799
2810
|
/* @__PURE__ */ s.jsx("span", { className: "cf-file-tree-file-icon", "data-cf-slot": "file-icon", children: /* @__PURE__ */ s.jsx(W, { name: "file" }) }, "file-icon"),
|
|
2800
|
-
...
|
|
2801
|
-
] :
|
|
2811
|
+
...k
|
|
2812
|
+
] : k;
|
|
2802
2813
|
return c.cloneElement(o, {
|
|
2803
2814
|
...r || i ? {
|
|
2804
2815
|
className: G(
|
|
@@ -2867,7 +2878,7 @@ function xe({ children: e, ...n }) {
|
|
|
2867
2878
|
function Ke({ children: e, ...n }) {
|
|
2868
2879
|
return c.createElement("ol", ae(n, "steps", "cf-steps"), e);
|
|
2869
2880
|
}
|
|
2870
|
-
function
|
|
2881
|
+
function ka(e) {
|
|
2871
2882
|
const n = c.Children.toArray(e), t = n.findIndex(
|
|
2872
2883
|
(a) => c.isValidElement(a) && V(a) === "summary"
|
|
2873
2884
|
);
|
|
@@ -2879,24 +2890,24 @@ function Ca(e) {
|
|
|
2879
2890
|
};
|
|
2880
2891
|
}
|
|
2881
2892
|
function We({ children: e, onToggle: n, ...t }) {
|
|
2882
|
-
const a = t.open === !0, [o, l] = c.useState(a), [r, i] = c.useState(!1), u = c.useRef(null), { summary: f, content: p } =
|
|
2883
|
-
const b = f,
|
|
2893
|
+
const a = t.open === !0, [o, l] = c.useState(a), [r, i] = c.useState(!1), u = c.useRef(null), { summary: f, content: p } = ka(e), m = c.isValidElement(f) ? (() => {
|
|
2894
|
+
const b = f, N = b.props.onClick;
|
|
2884
2895
|
return c.cloneElement(b, {
|
|
2885
2896
|
children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2886
2897
|
b.props.children,
|
|
2887
2898
|
/* @__PURE__ */ s.jsx(tt, { className: "cf-details-chevron", size: 17, strokeWidth: 2, "aria-hidden": "true" })
|
|
2888
2899
|
] }),
|
|
2889
2900
|
onClick: (j) => {
|
|
2890
|
-
if (
|
|
2891
|
-
const
|
|
2892
|
-
queueMicrotask(() => l(
|
|
2901
|
+
if (N?.(j), j.defaultPrevented) return;
|
|
2902
|
+
const k = j.currentTarget.closest("details");
|
|
2903
|
+
queueMicrotask(() => l(k?.open ?? !1));
|
|
2893
2904
|
}
|
|
2894
2905
|
});
|
|
2895
2906
|
})() : f;
|
|
2896
2907
|
c.useEffect(() => {
|
|
2897
2908
|
i(!0);
|
|
2898
2909
|
}, []);
|
|
2899
|
-
const
|
|
2910
|
+
const C = /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2900
2911
|
m,
|
|
2901
2912
|
/* @__PURE__ */ s.jsx(
|
|
2902
2913
|
"div",
|
|
@@ -2905,7 +2916,7 @@ function We({ children: e, onToggle: n, ...t }) {
|
|
|
2905
2916
|
className: "cf-details-content",
|
|
2906
2917
|
"data-cf-slot": "content",
|
|
2907
2918
|
inert: r && !o ? !0 : void 0,
|
|
2908
|
-
children: /* @__PURE__ */ s.jsx("div", { className: "cf-details-content-inner", children: p.map((b,
|
|
2919
|
+
children: /* @__PURE__ */ s.jsx("div", { className: "cf-details-content-inner", children: p.map((b, N) => /* @__PURE__ */ s.jsx(c.Fragment, { children: b }, c.isValidElement(b) && b.key !== null ? b.key : `details-${N}`)) })
|
|
2909
2920
|
}
|
|
2910
2921
|
)
|
|
2911
2922
|
] });
|
|
@@ -2918,7 +2929,7 @@ function We({ children: e, onToggle: n, ...t }) {
|
|
|
2918
2929
|
onToggle: (b) => {
|
|
2919
2930
|
l(b.currentTarget.open), n?.(b);
|
|
2920
2931
|
},
|
|
2921
|
-
children:
|
|
2932
|
+
children: C
|
|
2922
2933
|
}
|
|
2923
2934
|
);
|
|
2924
2935
|
}
|
|
@@ -2987,12 +2998,12 @@ function Ea({
|
|
|
2987
2998
|
className: i,
|
|
2988
2999
|
...u
|
|
2989
3000
|
}) {
|
|
2990
|
-
const f = n ?? `h${e}`, p = i?.split(/\s+/).filter(Boolean) ?? [], m = p.some((
|
|
2991
|
-
m && !p.includes("cf-sr-only") && p.push("cf-sr-only"),
|
|
3001
|
+
const f = n ?? `h${e}`, p = i?.split(/\s+/).filter(Boolean) ?? [], m = p.some((N) => N === "sr-only" || N === "cf-sr-only"), C = e > 1 && !!a && !m;
|
|
3002
|
+
m && !p.includes("cf-sr-only") && p.push("cf-sr-only"), C && p.push("cf-heading-with-anchor");
|
|
2992
3003
|
const b = p.join(" ");
|
|
2993
3004
|
return /* @__PURE__ */ s.jsxs(f, { ...u, id: t, className: b || void 0, children: [
|
|
2994
3005
|
r,
|
|
2995
|
-
|
|
3006
|
+
C && a ? /* @__PURE__ */ s.jsx(
|
|
2996
3007
|
"span",
|
|
2997
3008
|
{
|
|
2998
3009
|
className: "cf-anchor-island",
|
|
@@ -3108,12 +3119,12 @@ const an = {
|
|
|
3108
3119
|
aside: { className: "aside", override: "Aside" },
|
|
3109
3120
|
badge: { className: "badge", override: "Badge" }
|
|
3110
3121
|
};
|
|
3111
|
-
function
|
|
3122
|
+
function Cn(e) {
|
|
3112
3123
|
const n = typeof e == "string" ? e : "";
|
|
3113
3124
|
return Object.hasOwn(an, n) ? n : void 0;
|
|
3114
3125
|
}
|
|
3115
|
-
function
|
|
3116
|
-
return
|
|
3126
|
+
function ke(e) {
|
|
3127
|
+
return Cn(e["data-cf-component"]) ?? Cn(e.dataCfComponent);
|
|
3117
3128
|
}
|
|
3118
3129
|
function Sa(e, n) {
|
|
3119
3130
|
return n[an[e].className];
|
|
@@ -3154,14 +3165,14 @@ function w(e, n, t, a, o) {
|
|
|
3154
3165
|
function r({ children: i, node: u, ...f }) {
|
|
3155
3166
|
const p = J(a, e) ?? e, m = Ne(f, o);
|
|
3156
3167
|
if (n === "heading" && /^h[1-6]$/.test(e)) {
|
|
3157
|
-
const
|
|
3168
|
+
const C = f["data-cf-anchor"] ?? f.dataCfAnchor, b = f["data-cf-anchor-label"] ?? f.dataCfAnchorLabel, N = f["data-cf-copy-failure-label"] ?? f.dataCfCopyFailureLabel;
|
|
3158
3169
|
return c.createElement(Ea, {
|
|
3159
3170
|
...m,
|
|
3160
3171
|
as: p,
|
|
3161
3172
|
level: Number(e.slice(1)),
|
|
3162
|
-
anchor: typeof
|
|
3173
|
+
anchor: typeof C == "string" ? C : void 0,
|
|
3163
3174
|
anchorLabel: typeof b == "string" ? b : void 0,
|
|
3164
|
-
copyFailureLabel: typeof
|
|
3175
|
+
copyFailureLabel: typeof N == "string" ? N : void 0,
|
|
3165
3176
|
className: $(m.className, t[n]),
|
|
3166
3177
|
"data-cf-element": l,
|
|
3167
3178
|
children: i
|
|
@@ -3194,7 +3205,7 @@ function La(e, n) {
|
|
|
3194
3205
|
}
|
|
3195
3206
|
function Na(e, n) {
|
|
3196
3207
|
return function({ children: a, node: o, ...l }) {
|
|
3197
|
-
const r = l["data-cf-slot"] === "caption" ?
|
|
3208
|
+
const r = l["data-cf-slot"] === "caption" ? kn(e) : void 0;
|
|
3198
3209
|
return r ? c.createElement(r, {
|
|
3199
3210
|
children: a,
|
|
3200
3211
|
className: typeof l.className == "string" ? l.className : void 0,
|
|
@@ -3204,7 +3215,7 @@ function Na(e, n) {
|
|
|
3204
3215
|
}
|
|
3205
3216
|
function Ma(e, n, t) {
|
|
3206
3217
|
return function({ children: o, node: l, ...r }) {
|
|
3207
|
-
const i =
|
|
3218
|
+
const i = ke(r), u = i ? se(n, i) : void 0;
|
|
3208
3219
|
if (i === "callout") {
|
|
3209
3220
|
const p = u ?? xe;
|
|
3210
3221
|
return c.createElement(p, {
|
|
@@ -3234,10 +3245,10 @@ function Ma(e, n, t) {
|
|
|
3234
3245
|
}
|
|
3235
3246
|
function Se(e, n, t, a) {
|
|
3236
3247
|
return function({ children: l, node: r, ...i }) {
|
|
3237
|
-
const u =
|
|
3248
|
+
const u = ke(i), f = u ? se(t, u) : void 0;
|
|
3238
3249
|
if (u === "callout") {
|
|
3239
|
-
const
|
|
3240
|
-
return c.createElement(
|
|
3250
|
+
const C = f ?? xe;
|
|
3251
|
+
return c.createElement(C, {
|
|
3241
3252
|
...i,
|
|
3242
3253
|
className: $(i.className, n.callout),
|
|
3243
3254
|
children: l
|
|
@@ -3268,7 +3279,7 @@ function Se(e, n, t, a) {
|
|
|
3268
3279
|
}
|
|
3269
3280
|
function Ta(e, n, t) {
|
|
3270
3281
|
return function({ children: o, node: l, ...r }) {
|
|
3271
|
-
const i =
|
|
3282
|
+
const i = ke(r);
|
|
3272
3283
|
if (i && ["code-block", "table", "image", "terminal"].includes(i)) {
|
|
3273
3284
|
const f = e[i === "code-block" ? "codeBlock" : i], p = se(n, i);
|
|
3274
3285
|
if (p) {
|
|
@@ -3314,7 +3325,7 @@ function Ta(e, n, t) {
|
|
|
3314
3325
|
}
|
|
3315
3326
|
function Da(e, n) {
|
|
3316
3327
|
return function({ children: a, node: o, ...l }) {
|
|
3317
|
-
const r =
|
|
3328
|
+
const r = ke(l);
|
|
3318
3329
|
if (r === "steps") {
|
|
3319
3330
|
const i = se(n, r) ?? Ke;
|
|
3320
3331
|
return c.createElement(i, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as l, j as t } from "./react-runtime-Dzgdzn6D.js";
|
|
2
|
-
import { a as s, b as d } from "./serialized-
|
|
2
|
+
import { a as s, b as d } from "./serialized-Ck9NBdg7.js";
|
|
3
3
|
import { w as b } from "./provider-DNSHvvN7.js";
|
|
4
4
|
function f(a, e) {
|
|
5
5
|
return l.hydrateRoot(
|
package/dist/client/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MarkdownCodeOverflow } from './types';
|
|
2
|
+
export interface MarkdownFenceMetadata {
|
|
3
|
+
filename?: string;
|
|
4
|
+
overflow?: MarkdownCodeOverflow;
|
|
5
|
+
}
|
|
6
|
+
/** Parse the shared metadata understood by Markdown and MDX code fences. */
|
|
7
|
+
export declare function parseFenceMetadata(meta: string): MarkdownFenceMetadata;
|