@oxide/react-asciidoc 1.0.4 → 1.0.5--canary.e50ecd3.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/react-asciidoc.js +35 -35
- package/dist/react-asciidoc.umd.cjs +5 -5
- package/package.json +1 -1
package/dist/react-asciidoc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ee, { Fragment as qr, createElement as G, createContext as Ve, useContext as te } from "react";
|
|
2
|
-
import
|
|
2
|
+
import k from "html-react-parser";
|
|
3
3
|
import { default as _t } from "html-react-parser";
|
|
4
4
|
var Kr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
5
5
|
function Be(r) {
|
|
@@ -262,18 +262,18 @@ function $e() {
|
|
|
262
262
|
if (L && g && typeof L.stack == "string") {
|
|
263
263
|
for (var h = L.stack.split(`
|
|
264
264
|
`), T = g.stack.split(`
|
|
265
|
-
`), A = h.length - 1,
|
|
266
|
-
|
|
267
|
-
for (; A >= 1 &&
|
|
268
|
-
if (h[A] !== T[
|
|
269
|
-
if (A !== 1 ||
|
|
265
|
+
`), A = h.length - 1, D = T.length - 1; A >= 1 && D >= 0 && h[A] !== T[D]; )
|
|
266
|
+
D--;
|
|
267
|
+
for (; A >= 1 && D >= 0; A--, D--)
|
|
268
|
+
if (h[A] !== T[D]) {
|
|
269
|
+
if (A !== 1 || D !== 1)
|
|
270
270
|
do
|
|
271
|
-
if (A--,
|
|
271
|
+
if (A--, D--, D < 0 || h[A] !== T[D]) {
|
|
272
272
|
var _ = `
|
|
273
273
|
` + h[A].replace(" at new ", " at ");
|
|
274
274
|
return t.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", t.displayName)), typeof t == "function" && sr.set(t, _), _;
|
|
275
275
|
}
|
|
276
|
-
while (A >= 1 &&
|
|
276
|
+
while (A >= 1 && D >= 0);
|
|
277
277
|
break;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
@@ -462,8 +462,8 @@ function $e() {
|
|
|
462
462
|
v[q] === void 0 && (v[q] = A[q]);
|
|
463
463
|
}
|
|
464
464
|
if (h || T) {
|
|
465
|
-
var
|
|
466
|
-
h && Ae(v,
|
|
465
|
+
var D = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
466
|
+
h && Ae(v, D), T && ke(v, D);
|
|
467
467
|
}
|
|
468
468
|
return De(t, h, T, x, g, K.current, v);
|
|
469
469
|
}
|
|
@@ -590,9 +590,9 @@ Check the top-level render call using <` + p + ">.");
|
|
|
590
590
|
var A;
|
|
591
591
|
t === null ? A = "null" : gr(t) ? A = "array" : t !== void 0 && t.$$typeof === a ? (A = "<" + (U(t.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : A = typeof t, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", A, h);
|
|
592
592
|
}
|
|
593
|
-
var
|
|
594
|
-
if (
|
|
595
|
-
return
|
|
593
|
+
var D = Se(t, l, p, x, q);
|
|
594
|
+
if (D == null)
|
|
595
|
+
return D;
|
|
596
596
|
if (v) {
|
|
597
597
|
var _ = l.children;
|
|
598
598
|
if (_ !== void 0)
|
|
@@ -620,7 +620,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
620
620
|
<%s key={someKey} {...props} />`, xr, B, Pe, B), Jr[B + xr] = !0;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
return t === o ? Le(
|
|
623
|
+
return t === o ? Le(D) : Ce(D), D;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
function Oe(t, l, p) {
|
|
@@ -635,7 +635,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
635
635
|
}
|
|
636
636
|
process.env.NODE_ENV === "production" ? jr.exports = He() : jr.exports = $e();
|
|
637
637
|
var e = jr.exports;
|
|
638
|
-
const S = ({ text: r }) => r ? /* @__PURE__ */ e.jsx("div", { className: "title", children:
|
|
638
|
+
const S = ({ text: r }) => r ? /* @__PURE__ */ e.jsx("div", { className: "title", children: k(r) }) : null, ze = ({ node: r }) => {
|
|
639
639
|
const { document: a } = I(), s = a.attributes || {}, o = r.attributes, n = () => s.icons === "font" && !o.icon ? /* @__PURE__ */ e.jsx("i", { className: `fa icon-${o.name}`, title: `${o.textlabel}` }) : /* @__PURE__ */ e.jsx("img", { src: r.iconUri, alt: `${o.textlabel}` });
|
|
640
640
|
return /* @__PURE__ */ e.jsx(
|
|
641
641
|
"div",
|
|
@@ -646,7 +646,7 @@ const S = ({ text: r }) => r ? /* @__PURE__ */ e.jsx("div", { className: "title"
|
|
|
646
646
|
/* @__PURE__ */ e.jsx("td", { className: "icon", children: s.icons ? n() : /* @__PURE__ */ e.jsx("div", { className: "title", children: o.textlabel }) }),
|
|
647
647
|
/* @__PURE__ */ e.jsxs("td", { className: "content", children: [
|
|
648
648
|
/* @__PURE__ */ e.jsx(S, { text: r.title }),
|
|
649
|
-
r.content &&
|
|
649
|
+
r.content && k(r.content),
|
|
650
650
|
/* @__PURE__ */ e.jsx(R, { blocks: r.blocks })
|
|
651
651
|
] })
|
|
652
652
|
] }) }) })
|
|
@@ -682,7 +682,7 @@ const S = ({ text: r }) => r ? /* @__PURE__ */ e.jsx("div", { className: "title"
|
|
|
682
682
|
/* @__PURE__ */ e.jsx("b", { children: s + 1 })
|
|
683
683
|
] }),
|
|
684
684
|
/* @__PURE__ */ e.jsxs("td", { children: [
|
|
685
|
-
a.text &&
|
|
685
|
+
a.text && k(a.text),
|
|
686
686
|
/* @__PURE__ */ e.jsx(R, { blocks: a.blocks })
|
|
687
687
|
] })
|
|
688
688
|
] }, s)) }) })
|
|
@@ -997,7 +997,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
997
997
|
}, s = (o) => {
|
|
998
998
|
if (o)
|
|
999
999
|
return /* @__PURE__ */ e.jsxs("dd", { children: [
|
|
1000
|
-
o.text && /* @__PURE__ */ e.jsx("p", { children:
|
|
1000
|
+
o.text && /* @__PURE__ */ e.jsx("p", { children: k(o.text) }),
|
|
1001
1001
|
/* @__PURE__ */ e.jsx(R, { blocks: o.blocks })
|
|
1002
1002
|
] });
|
|
1003
1003
|
};
|
|
@@ -1013,7 +1013,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1013
1013
|
const { terms: u, dd: m } = a(o);
|
|
1014
1014
|
if (u)
|
|
1015
1015
|
return /* @__PURE__ */ e.jsxs("li", { children: [
|
|
1016
|
-
u.map((i, c) => /* @__PURE__ */ e.jsx("p", { children: /* @__PURE__ */ e.jsx("em", { children:
|
|
1016
|
+
u.map((i, c) => /* @__PURE__ */ e.jsx("p", { children: /* @__PURE__ */ e.jsx("em", { children: k(i.text) }) }, c)),
|
|
1017
1017
|
s(m)
|
|
1018
1018
|
] }, n);
|
|
1019
1019
|
}) })
|
|
@@ -1057,12 +1057,12 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1057
1057
|
),
|
|
1058
1058
|
children: i.map((j, y) => /* @__PURE__ */ e.jsxs(qr, { children: [
|
|
1059
1059
|
y !== 0 && /* @__PURE__ */ e.jsx("br", {}),
|
|
1060
|
-
|
|
1060
|
+
k(j.text)
|
|
1061
1061
|
] }, y))
|
|
1062
1062
|
}
|
|
1063
1063
|
),
|
|
1064
1064
|
c && /* @__PURE__ */ e.jsxs("td", { className: "hdlist2", children: [
|
|
1065
|
-
c.text && /* @__PURE__ */ e.jsx("p", { children:
|
|
1065
|
+
c.text && /* @__PURE__ */ e.jsx("p", { children: k(c.text) }),
|
|
1066
1066
|
/* @__PURE__ */ e.jsx(R, { blocks: c.blocks })
|
|
1067
1067
|
] })
|
|
1068
1068
|
] }, m);
|
|
@@ -1076,7 +1076,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1076
1076
|
const { terms: u, dd: m } = a(o);
|
|
1077
1077
|
if (u)
|
|
1078
1078
|
return /* @__PURE__ */ e.jsxs(qr, { children: [
|
|
1079
|
-
u.map((i, c) => /* @__PURE__ */ e.jsx("dt", { className: "hdlist1", children:
|
|
1079
|
+
u.map((i, c) => /* @__PURE__ */ e.jsx("dt", { className: "hdlist1", children: k(i.text) }, c)),
|
|
1080
1080
|
s(m)
|
|
1081
1081
|
] }, n);
|
|
1082
1082
|
}) })
|
|
@@ -1094,7 +1094,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1094
1094
|
const y = c.level;
|
|
1095
1095
|
let b = c.title;
|
|
1096
1096
|
return y <= m && (b = `${j} ${c.title}`), /* @__PURE__ */ e.jsxs("li", { children: [
|
|
1097
|
-
/* @__PURE__ */ e.jsx("a", { href: `#${c.id}`, children:
|
|
1097
|
+
/* @__PURE__ */ e.jsx("a", { href: `#${c.id}`, children: k(b) }),
|
|
1098
1098
|
y < i && /* @__PURE__ */ e.jsx(
|
|
1099
1099
|
ur,
|
|
1100
1100
|
{
|
|
@@ -1140,7 +1140,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1140
1140
|
/* @__PURE__ */ e.jsx("a", { href: `#_footnoteref_${n.index}`, children: n.index }),
|
|
1141
1141
|
".",
|
|
1142
1142
|
" ",
|
|
1143
|
-
|
|
1143
|
+
k(n.text || "")
|
|
1144
1144
|
]
|
|
1145
1145
|
},
|
|
1146
1146
|
n.index
|
|
@@ -1148,11 +1148,11 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1148
1148
|
] }) : null, o = () => r.authors.length > 0 || P(r.attributes, "revnumber") || P(r.attributes, "revdate") || P(r.attributes, "revremark") ? /* @__PURE__ */ e.jsxs("div", { className: "details", children: [
|
|
1149
1149
|
r.authors.map((n, u) => /* @__PURE__ */ e.jsxs(qr, { children: [
|
|
1150
1150
|
n.name && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1151
|
-
/* @__PURE__ */ e.jsx("span", { id: `author${u + 1 > 1 ? u + 1 : ""}`, className: "author", children:
|
|
1151
|
+
/* @__PURE__ */ e.jsx("span", { id: `author${u + 1 > 1 ? u + 1 : ""}`, className: "author", children: k(n.name) }),
|
|
1152
1152
|
/* @__PURE__ */ e.jsx("br", {})
|
|
1153
1153
|
] }),
|
|
1154
1154
|
n.email && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1155
|
-
/* @__PURE__ */ e.jsx("span", { id: `email${u + 1 > 1 ? u + 1 : ""}`, className: "email", children:
|
|
1155
|
+
/* @__PURE__ */ e.jsx("span", { id: `email${u + 1 > 1 ? u + 1 : ""}`, className: "email", children: k(n.email) }),
|
|
1156
1156
|
/* @__PURE__ */ e.jsx("br", {})
|
|
1157
1157
|
] })
|
|
1158
1158
|
] }, u)),
|
|
@@ -1179,7 +1179,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1179
1179
|
...r.lineNumber ? { "data-lineno": r.lineNumber } : {},
|
|
1180
1180
|
...r.id ? { id: r.id } : {},
|
|
1181
1181
|
children: [
|
|
1182
|
-
/* @__PURE__ */ e.jsx("summary", { className: "title", children:
|
|
1182
|
+
/* @__PURE__ */ e.jsx("summary", { className: "title", children: k(s) }),
|
|
1183
1183
|
/* @__PURE__ */ e.jsx("div", { className: "content", children: /* @__PURE__ */ e.jsx(R, { blocks: r.blocks }) })
|
|
1184
1184
|
]
|
|
1185
1185
|
}
|
|
@@ -1209,7 +1209,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1209
1209
|
G(
|
|
1210
1210
|
`h${r.level + 1}`,
|
|
1211
1211
|
{ className: N(r.role, r.style) },
|
|
1212
|
-
|
|
1212
|
+
k(r.title || "")
|
|
1213
1213
|
)
|
|
1214
1214
|
] }), ct = ({ node: r }) => {
|
|
1215
1215
|
let a = /* @__PURE__ */ e.jsx(
|
|
@@ -1307,7 +1307,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1307
1307
|
reversed: er(r.attributes, "reversed"),
|
|
1308
1308
|
...r.attributes.start ? { start: parseInt(`${r.attributes.start}`) } : {},
|
|
1309
1309
|
children: r.items.map((a, s) => /* @__PURE__ */ e.jsxs("li", { className: r.role ? r.role : "", children: [
|
|
1310
|
-
/* @__PURE__ */ e.jsx("p", { children:
|
|
1310
|
+
/* @__PURE__ */ e.jsx("p", { children: k(a.text || "") }),
|
|
1311
1311
|
/* @__PURE__ */ e.jsx(R, { blocks: a.blocks })
|
|
1312
1312
|
] }, s))
|
|
1313
1313
|
}
|
|
@@ -1348,7 +1348,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1348
1348
|
r.content && /* @__PURE__ */ e.jsx("p", { dangerouslySetInnerHTML: { __html: r.content } })
|
|
1349
1349
|
]
|
|
1350
1350
|
}
|
|
1351
|
-
), ht = ({ node: r }) => /* @__PURE__ */ e.jsx(e.Fragment, { children:
|
|
1351
|
+
), ht = ({ node: r }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: k(r.content || "") }), bt = ({ node: r }) => {
|
|
1352
1352
|
const { document: a } = I(), s = a.attributes || {}, o = s["toc-placement"] === "preamble" && a.sections && a.sections.length > 0 && s.toc !== void 0;
|
|
1353
1353
|
return /* @__PURE__ */ e.jsx("div", { id: "preamble", ...r.lineNumber ? { "data-lineno": r.lineNumber } : {}, children: /* @__PURE__ */ e.jsxs("div", { className: "sectionbody", children: [
|
|
1354
1354
|
/* @__PURE__ */ e.jsx(R, { blocks: r.blocks }),
|
|
@@ -1358,7 +1358,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1358
1358
|
id: "toc",
|
|
1359
1359
|
className: r.attributes["toc-class"] ? `${r.attributes["toc-class"]}` : "toc",
|
|
1360
1360
|
children: [
|
|
1361
|
-
/* @__PURE__ */ e.jsx("div", { id: "toctitle", children:
|
|
1361
|
+
/* @__PURE__ */ e.jsx("div", { id: "toctitle", children: k(`${s["toc-title"]}`) }),
|
|
1362
1362
|
a.sections && /* @__PURE__ */ e.jsx(ur, { sections: a.sections })
|
|
1363
1363
|
]
|
|
1364
1364
|
}
|
|
@@ -1378,7 +1378,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1378
1378
|
/* @__PURE__ */ e.jsx(R, { blocks: r.blocks }),
|
|
1379
1379
|
a && /* @__PURE__ */ e.jsxs("div", { className: "attribution", children: [
|
|
1380
1380
|
"— ",
|
|
1381
|
-
a,
|
|
1381
|
+
k(a.toString()),
|
|
1382
1382
|
s && /* @__PURE__ */ e.jsx("cite", { children: s })
|
|
1383
1383
|
] })
|
|
1384
1384
|
]
|
|
@@ -1503,7 +1503,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1503
1503
|
));
|
|
1504
1504
|
{
|
|
1505
1505
|
let tr = E;
|
|
1506
|
-
return /* @__PURE__ */ G("td", { ...H, key: C }, tr.length === 0 ? "" :
|
|
1506
|
+
return /* @__PURE__ */ G("td", { ...H, key: C }, tr.length === 0 ? "" : k(
|
|
1507
1507
|
`<p class="tableblock">${tr.join(
|
|
1508
1508
|
`</p>
|
|
1509
1509
|
<p class="tableblock">`
|
|
@@ -1520,7 +1520,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1520
1520
|
let n = r.id || "toc";
|
|
1521
1521
|
const u = r.title ? r.title : s["toc-title"], m = s["toc-placement"], i = s.toc !== void 0, c = r.attributes.levels ? parseInt(`${r.attributes.levels}`) : void 0;
|
|
1522
1522
|
return m === "macro" && o && i ? /* @__PURE__ */ e.jsxs("div", { id: n, className: N("toc", r.role), children: [
|
|
1523
|
-
/* @__PURE__ */ e.jsx("div", { id: `${n}title`, className: "title", children:
|
|
1523
|
+
/* @__PURE__ */ e.jsx("div", { id: `${n}title`, className: "title", children: k(`${u}` || "") }),
|
|
1524
1524
|
a.sections && /* @__PURE__ */ e.jsx(ur, { sections: a.sections, opts: { tocLevels: c } })
|
|
1525
1525
|
] }) : null;
|
|
1526
1526
|
}, Et = () => /* @__PURE__ */ e.jsx("hr", {}), Nt = ({ node: r }) => {
|
|
@@ -1544,7 +1544,7 @@ const er = (r, a) => r[`${a}-option`] !== void 0, or = (r, a, s = void 0, o, n)
|
|
|
1544
1544
|
}
|
|
1545
1545
|
),
|
|
1546
1546
|
" ",
|
|
1547
|
-
|
|
1547
|
+
k(s.text || "")
|
|
1548
1548
|
] }) }, o) : /* @__PURE__ */ e.jsxs("li", { id: s.id, className: r.role, children: [
|
|
1549
1549
|
/* @__PURE__ */ e.jsx("p", { dangerouslySetInnerHTML: { __html: s.text || "" } }),
|
|
1550
1550
|
/* @__PURE__ */ e.jsx(R, { blocks: s.blocks })
|