oasis-editor 0.0.365 → 0.0.367
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/{OasisEditorApp-CiqNOkgf.js → OasisEditorApp-BCqvLzdx.js} +1 -1
- package/dist/assets/{importDocxWorker-Du4p-56X.js → importDocxWorker-DmlXA3cz.js} +178 -99
- package/dist/{defaultToolbar-BIYzw3tS.js → defaultToolbar-BdHm7GcP.js} +1 -1
- package/dist/import/docx/runs.d.ts +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -10283,56 +10283,56 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10283
10283
|
...void 0 !== p ? { displacedByCustomXml: p } : {}
|
|
10284
10284
|
};
|
|
10285
10285
|
}
|
|
10286
|
-
async function mn(e, t, r, n, o) {
|
|
10287
|
-
const
|
|
10288
|
-
let
|
|
10289
|
-
const
|
|
10290
|
-
|
|
10291
|
-
},
|
|
10292
|
-
for (let
|
|
10293
|
-
const e =
|
|
10286
|
+
async function mn(e, t, r, n, o, i) {
|
|
10287
|
+
const a = [];
|
|
10288
|
+
let s, l, c, u = 0;
|
|
10289
|
+
const d = [], p = [], f = (e) => {
|
|
10290
|
+
a.push(e), u += e.length;
|
|
10291
|
+
}, h = i ?? e.childNodes;
|
|
10292
|
+
for (let m = 0; m < h.length; m += 1) {
|
|
10293
|
+
const e = h[m];
|
|
10294
10294
|
if (e?.nodeType !== e.ELEMENT_NODE) continue;
|
|
10295
10295
|
const i = e;
|
|
10296
|
-
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === i.namespaceURI) if ("t" === i.localName || "delText" === i.localName)
|
|
10297
|
-
else if ("tab" === i.localName)
|
|
10298
|
-
else if ("noBreakHyphen" === i.localName)
|
|
10299
|
-
else if ("softHyphen" === i.localName)
|
|
10296
|
+
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === i.namespaceURI) if ("t" === i.localName || "delText" === i.localName) f(i.textContent ?? "");
|
|
10297
|
+
else if ("tab" === i.localName) f(" ");
|
|
10298
|
+
else if ("noBreakHyphen" === i.localName) f("‑");
|
|
10299
|
+
else if ("softHyphen" === i.localName) f("");
|
|
10300
10300
|
else if ("br" === i.localName) {
|
|
10301
10301
|
const e = Fe(i, "type");
|
|
10302
|
-
|
|
10302
|
+
f("page" === e ? "\f" : "column" === e ? "\v" : "\n");
|
|
10303
10303
|
} else {
|
|
10304
10304
|
if ("lastRenderedPageBreak" === i.localName) continue;
|
|
10305
10305
|
if ("bookmarkStart" === i.localName || "bookmarkEnd" === i.localName) {
|
|
10306
10306
|
const e = un(i);
|
|
10307
|
-
e &&
|
|
10308
|
-
offset:
|
|
10307
|
+
e && d.push({
|
|
10308
|
+
offset: u,
|
|
10309
10309
|
marker: e
|
|
10310
10310
|
});
|
|
10311
10311
|
continue;
|
|
10312
10312
|
}
|
|
10313
10313
|
if ("commentRangeStart" === i.localName || "commentRangeEnd" === i.localName) {
|
|
10314
10314
|
const e = dn(i);
|
|
10315
|
-
e &&
|
|
10316
|
-
offset:
|
|
10315
|
+
e && p.push({
|
|
10316
|
+
offset: u,
|
|
10317
10317
|
marker: e
|
|
10318
10318
|
});
|
|
10319
10319
|
continue;
|
|
10320
10320
|
}
|
|
10321
10321
|
if ("proofErr" === i.localName || "commentReference" === i.localName || "permStart" === i.localName || "permEnd" === i.localName) continue;
|
|
10322
|
-
if ("cr" === i.localName)
|
|
10322
|
+
if ("cr" === i.localName) f("\n");
|
|
10323
10323
|
else if ("drawing" === i.localName) {
|
|
10324
10324
|
const e = await nn(i, t, r, n);
|
|
10325
|
-
if (e.image)
|
|
10325
|
+
if (e.image) f(e.text), s = e.image;
|
|
10326
10326
|
else {
|
|
10327
10327
|
const e = await sn(i, o);
|
|
10328
|
-
e && (
|
|
10328
|
+
e && (f(""), l = e);
|
|
10329
10329
|
}
|
|
10330
10330
|
} else if ("pict" === i.localName) {
|
|
10331
10331
|
const e = await an(i, t, r, n);
|
|
10332
|
-
e && (
|
|
10332
|
+
e && (f(""), s = e);
|
|
10333
10333
|
} else if ("sym" === i.localName) {
|
|
10334
10334
|
const e = Fe(i, "font") ?? "", t = Fe(i, "char") ?? "", r = parseInt(t, 16);
|
|
10335
|
-
|
|
10335
|
+
f(Number.isFinite(r) && r > 0 ? String.fromCodePoint(r) : "?"), c = {
|
|
10336
10336
|
font: e,
|
|
10337
10337
|
char: t
|
|
10338
10338
|
};
|
|
@@ -10342,17 +10342,17 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10342
10342
|
const e = ln(i);
|
|
10343
10343
|
if (e) {
|
|
10344
10344
|
const t = await sn(e, o);
|
|
10345
|
-
t && (
|
|
10345
|
+
t && (f(""), l = t);
|
|
10346
10346
|
}
|
|
10347
10347
|
}
|
|
10348
10348
|
}
|
|
10349
10349
|
return {
|
|
10350
|
-
text:
|
|
10351
|
-
image:
|
|
10352
|
-
...
|
|
10353
|
-
...
|
|
10354
|
-
...
|
|
10355
|
-
...
|
|
10350
|
+
text: a.join(""),
|
|
10351
|
+
image: s,
|
|
10352
|
+
...l ? { textBox: l } : {},
|
|
10353
|
+
...d.length > 0 ? { innerBookmarks: d } : {},
|
|
10354
|
+
...p.length > 0 ? { innerComments: p } : {},
|
|
10355
|
+
...c ? { sym: c } : {}
|
|
10356
10356
|
};
|
|
10357
10357
|
}
|
|
10358
10358
|
async function gn(e, t, r, n, o, i, a, s) {
|
|
@@ -10387,7 +10387,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10387
10387
|
const t = /\bNUMPAGES\b/i.test(e.instruction) ? "NUMPAGES" : /\bPAGE\b/i.test(e.instruction) ? "PAGE" : /\bDATE\b/i.test(e.instruction) ? "DATE" : /\bREF\b/i.test(e.instruction) ? "REF" : /\bPAGEREF\b/i.test(e.instruction) ? "PAGEREF" : null;
|
|
10388
10388
|
if (!t) return;
|
|
10389
10389
|
const r = Cr(/\*\s*([A-Za-z]+)/.exec(e.instruction)?.[1]), n = "DATE" === t ? /@\s*"([^"]*)"/.exec(e.instruction)?.[1] : void 0, o = "REF" === t || "PAGEREF" === t ? cn(e.instruction) : void 0, i = l.slice(e.beginIndex);
|
|
10390
|
-
if (i.some((e) => e.bookmark)) return;
|
|
10390
|
+
if (i.some((e) => Boolean(e.bookmark || e.comment || e.opaque || e.image || e.textBox || e.math || e.sym || e.footnoteReference || e.endnoteReference || e.revision || e.sdtWrappers?.length))) return;
|
|
10391
10391
|
const a = i.filter((e) => !e.fieldChar && void 0 === e.fieldInstruction), s = a.map((e) => e.text).join("") || "1", c = a.find((e) => e.styles)?.styles ?? e.beginStyles;
|
|
10392
10392
|
l.length = e.beginIndex;
|
|
10393
10393
|
const u = "DATE" === t ? n ? {
|
|
@@ -10418,19 +10418,19 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10418
10418
|
n && (n.instruction += r);
|
|
10419
10419
|
};
|
|
10420
10420
|
for (let p = 0; p < e.childNodes.length; p += 1) {
|
|
10421
|
-
const
|
|
10422
|
-
if (
|
|
10423
|
-
const
|
|
10424
|
-
if ("http://schemas.openxmlformats.org/officeDocument/2006/math" ===
|
|
10421
|
+
const f = e.childNodes[p];
|
|
10422
|
+
if (f?.nodeType !== f.ELEMENT_NODE) continue;
|
|
10423
|
+
const h = f;
|
|
10424
|
+
if ("http://schemas.openxmlformats.org/officeDocument/2006/math" === h.namespaceURI && ("oMath" === h.localName || "oMathPara" === h.localName)) {
|
|
10425
10425
|
l.push({
|
|
10426
10426
|
text: "",
|
|
10427
|
-
math: Or(
|
|
10427
|
+
math: Or(h)
|
|
10428
10428
|
});
|
|
10429
10429
|
continue;
|
|
10430
10430
|
}
|
|
10431
|
-
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" !==
|
|
10432
|
-
if ("bookmarkStart" ===
|
|
10433
|
-
const e = un(
|
|
10431
|
+
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== h.namespaceURI) continue;
|
|
10432
|
+
if ("bookmarkStart" === h.localName || "bookmarkEnd" === h.localName) {
|
|
10433
|
+
const e = un(h);
|
|
10434
10434
|
if (!e) continue;
|
|
10435
10435
|
l.push({
|
|
10436
10436
|
text: "",
|
|
@@ -10438,8 +10438,8 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10438
10438
|
});
|
|
10439
10439
|
continue;
|
|
10440
10440
|
}
|
|
10441
|
-
if ("commentRangeStart" ===
|
|
10442
|
-
const e = dn(
|
|
10441
|
+
if ("commentRangeStart" === h.localName || "commentRangeEnd" === h.localName) {
|
|
10442
|
+
const e = dn(h);
|
|
10443
10443
|
if (!e) continue;
|
|
10444
10444
|
l.push({
|
|
10445
10445
|
text: "",
|
|
@@ -10447,27 +10447,27 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10447
10447
|
});
|
|
10448
10448
|
continue;
|
|
10449
10449
|
}
|
|
10450
|
-
const
|
|
10451
|
-
if (
|
|
10450
|
+
const m = hn(h);
|
|
10451
|
+
if (m) {
|
|
10452
10452
|
l.push({
|
|
10453
10453
|
text: "",
|
|
10454
|
-
revisionRangeMarker:
|
|
10454
|
+
revisionRangeMarker: m
|
|
10455
10455
|
});
|
|
10456
10456
|
continue;
|
|
10457
10457
|
}
|
|
10458
|
-
const
|
|
10459
|
-
if (
|
|
10460
|
-
const e = await gn(
|
|
10458
|
+
const g = fn(h);
|
|
10459
|
+
if (g) {
|
|
10460
|
+
const e = await gn(h, t, r, n, o, i, a, s);
|
|
10461
10461
|
for (const t of e) l.push({
|
|
10462
10462
|
...t,
|
|
10463
|
-
revision: t.revision ??
|
|
10463
|
+
revision: t.revision ?? g
|
|
10464
10464
|
});
|
|
10465
10465
|
continue;
|
|
10466
10466
|
}
|
|
10467
|
-
if ("sdt" ===
|
|
10468
|
-
const e = De(
|
|
10467
|
+
if ("sdt" === h.localName) {
|
|
10468
|
+
const e = De(h, Ne, "sdtContent");
|
|
10469
10469
|
if (!e) continue;
|
|
10470
|
-
const c = De(
|
|
10470
|
+
const c = De(h, Ne, "sdtPr"), u = De(h, Ne, "sdtEndPr"), d = {
|
|
10471
10471
|
groupId: v("sdt"),
|
|
10472
10472
|
sdtPr: Ur(c),
|
|
10473
10473
|
...u ? { sdtEndPrXml: new b.XMLSerializer().serializeToString(u) } : {}
|
|
@@ -10478,33 +10478,112 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10478
10478
|
});
|
|
10479
10479
|
continue;
|
|
10480
10480
|
}
|
|
10481
|
-
if ("r" ===
|
|
10482
|
-
const e = Ct(De(
|
|
10483
|
-
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
|
|
10481
|
+
if ("r" === h.localName) {
|
|
10482
|
+
const e = Ct(De(h, Ne, "rPr"), i), t = Array.from(h.childNodes).filter((e) => 1 === e.nodeType && !("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "rPr" === e.localName)), p = t.map((e) => ({
|
|
10483
|
+
child: e,
|
|
10484
|
+
opaque: Tr(e)
|
|
10485
|
+
})), f = (e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && [
|
|
10486
|
+
"t",
|
|
10487
|
+
"delText",
|
|
10488
|
+
"tab",
|
|
10489
|
+
"noBreakHyphen",
|
|
10490
|
+
"softHyphen",
|
|
10491
|
+
"br",
|
|
10492
|
+
"cr",
|
|
10493
|
+
"lastRenderedPageBreak"
|
|
10494
|
+
].includes(e.localName ?? ""), m = (e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && [
|
|
10495
|
+
"drawing",
|
|
10496
|
+
"pict",
|
|
10497
|
+
"sym",
|
|
10498
|
+
"bookmarkStart",
|
|
10499
|
+
"bookmarkEnd",
|
|
10500
|
+
"commentRangeStart",
|
|
10501
|
+
"commentRangeEnd"
|
|
10502
|
+
].includes(e.localName ?? "") || "http://schemas.openxmlformats.org/markup-compatibility/2006" === e.namespaceURI && "AlternateContent" === e.localName;
|
|
10503
|
+
if (p.some((e) => e.opaque) && (1 === t.length || !c.length && p.every((e) => e.opaque || f(e.child) || m(e.child)))) {
|
|
10504
|
+
let t = "";
|
|
10505
|
+
const i = a ? {
|
|
10506
|
+
...e,
|
|
10507
|
+
link: a
|
|
10508
|
+
} : e, c = () => {
|
|
10509
|
+
t.length && (l.push({
|
|
10510
|
+
text: t,
|
|
10511
|
+
...i ? { styles: { ...i } } : {}
|
|
10512
|
+
}), t = "");
|
|
10513
|
+
};
|
|
10514
|
+
for (const { child: e, opaque: a } of p) if (a) c(), l.push({
|
|
10515
|
+
text: "",
|
|
10516
|
+
opaque: a,
|
|
10517
|
+
...i ? { styles: { ...i } } : {}
|
|
10518
|
+
});
|
|
10519
|
+
else {
|
|
10520
|
+
if (m(e)) {
|
|
10521
|
+
c();
|
|
10522
|
+
const t = await mn(h, r, n, o, s, [e]);
|
|
10523
|
+
for (const e of t.innerBookmarks ?? []) l.push({
|
|
10524
|
+
text: "",
|
|
10525
|
+
bookmark: e.marker
|
|
10526
|
+
});
|
|
10527
|
+
for (const e of t.innerComments ?? []) l.push({
|
|
10528
|
+
text: "",
|
|
10529
|
+
comment: e.marker
|
|
10530
|
+
});
|
|
10531
|
+
if (t.text.length || t.image || t.textBox) {
|
|
10532
|
+
const e = t.sym && !i?.fontFamily ? {
|
|
10533
|
+
...i,
|
|
10534
|
+
fontFamily: t.sym.font
|
|
10535
|
+
} : i;
|
|
10536
|
+
l.push({
|
|
10537
|
+
text: t.text,
|
|
10538
|
+
...t.image ? { image: t.image } : {},
|
|
10539
|
+
...t.textBox ? { textBox: t.textBox } : {},
|
|
10540
|
+
...t.sym ? { sym: t.sym } : {},
|
|
10541
|
+
...e ? { styles: { ...e } } : {}
|
|
10542
|
+
});
|
|
10543
|
+
}
|
|
10544
|
+
continue;
|
|
10545
|
+
}
|
|
10546
|
+
switch (e.localName) {
|
|
10547
|
+
case "t":
|
|
10548
|
+
case "delText":
|
|
10549
|
+
t += e.textContent ?? "";
|
|
10550
|
+
break;
|
|
10551
|
+
case "tab":
|
|
10552
|
+
t += " ";
|
|
10553
|
+
break;
|
|
10554
|
+
case "noBreakHyphen":
|
|
10555
|
+
t += "‑";
|
|
10556
|
+
break;
|
|
10557
|
+
case "softHyphen":
|
|
10558
|
+
t += "";
|
|
10559
|
+
break;
|
|
10560
|
+
case "cr":
|
|
10561
|
+
t += "\n";
|
|
10562
|
+
break;
|
|
10563
|
+
case "br": {
|
|
10564
|
+
const r = Fe(e, "type");
|
|
10565
|
+
t += "page" === r ? "\f" : "column" === r ? "\v" : "\n";
|
|
10566
|
+
break;
|
|
10567
|
+
}
|
|
10568
|
+
}
|
|
10492
10569
|
}
|
|
10570
|
+
c();
|
|
10571
|
+
continue;
|
|
10493
10572
|
}
|
|
10494
|
-
if (Ae(
|
|
10495
|
-
for (let t = 0; t <
|
|
10496
|
-
const r =
|
|
10573
|
+
if (Ae(h, "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "fldChar").length > 0 || Ae(h, "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "instrText").length > 0 || Ae(h, "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "delInstrText").length > 0) {
|
|
10574
|
+
for (let t = 0; t < h.childNodes.length; t += 1) {
|
|
10575
|
+
const r = h.childNodes[t];
|
|
10497
10576
|
if (r?.nodeType !== r.ELEMENT_NODE) continue;
|
|
10498
10577
|
const n = r;
|
|
10499
10578
|
"http://schemas.openxmlformats.org/wordprocessingml/2006/main" === n.namespaceURI && ("fldChar" === n.localName ? u(n, e) : "instrText" !== n.localName && "delInstrText" !== n.localName || d(n, e));
|
|
10500
10579
|
}
|
|
10501
10580
|
continue;
|
|
10502
10581
|
}
|
|
10503
|
-
const
|
|
10504
|
-
if (
|
|
10505
|
-
const t = Fe(
|
|
10582
|
+
const g = De(h, Ne, "footnoteReference");
|
|
10583
|
+
if (g) {
|
|
10584
|
+
const t = Fe(g, "id");
|
|
10506
10585
|
if (!t) continue;
|
|
10507
|
-
const r = Fe(
|
|
10586
|
+
const r = Fe(g, "customMarkFollows");
|
|
10508
10587
|
let n = e;
|
|
10509
10588
|
(n ??= {}).styleId ??= "footnoteReference", void 0 === n.superscript && (n.superscript = !0), l.push({
|
|
10510
10589
|
text: "?",
|
|
@@ -10516,11 +10595,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10516
10595
|
});
|
|
10517
10596
|
continue;
|
|
10518
10597
|
}
|
|
10519
|
-
const
|
|
10520
|
-
if (
|
|
10521
|
-
const t = Fe(
|
|
10598
|
+
const w = De(h, Ne, "endnoteReference");
|
|
10599
|
+
if (w) {
|
|
10600
|
+
const t = Fe(w, "id");
|
|
10522
10601
|
if (!t) continue;
|
|
10523
|
-
const r = Fe(
|
|
10602
|
+
const r = Fe(w, "customMarkFollows");
|
|
10524
10603
|
let n = e;
|
|
10525
10604
|
(n ??= {}).styleId ??= "endnoteReference", void 0 === n.superscript && (n.superscript = !0), l.push({
|
|
10526
10605
|
text: "?",
|
|
@@ -10532,61 +10611,61 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10532
10611
|
});
|
|
10533
10612
|
continue;
|
|
10534
10613
|
}
|
|
10535
|
-
const { text:
|
|
10536
|
-
let
|
|
10537
|
-
|
|
10538
|
-
const
|
|
10614
|
+
const { text: b, image: v, textBox: y, innerBookmarks: x, innerComments: E, sym: S } = await mn(h, r, n, o, s);
|
|
10615
|
+
let N = e;
|
|
10616
|
+
S && !N?.fontFamily && ((N ??= {}).fontFamily = S.font), a && ((N ??= {}).link = a);
|
|
10617
|
+
const k = [...(x ?? []).map((e) => ({
|
|
10539
10618
|
offset: e.offset,
|
|
10540
10619
|
run: {
|
|
10541
10620
|
text: "",
|
|
10542
10621
|
bookmark: e.marker
|
|
10543
10622
|
}
|
|
10544
|
-
})), ...(
|
|
10623
|
+
})), ...(E ?? []).map((e) => ({
|
|
10545
10624
|
offset: e.offset,
|
|
10546
10625
|
run: {
|
|
10547
10626
|
text: "",
|
|
10548
10627
|
comment: e.marker
|
|
10549
10628
|
}
|
|
10550
10629
|
}))];
|
|
10551
|
-
if (
|
|
10552
|
-
|
|
10630
|
+
if (k.length > 0 && !v && !y) {
|
|
10631
|
+
k.sort((e, t) => e.offset - t.offset);
|
|
10553
10632
|
let e = 0;
|
|
10554
|
-
for (const r of
|
|
10555
|
-
const t =
|
|
10633
|
+
for (const r of k) {
|
|
10634
|
+
const t = b.slice(e, r.offset);
|
|
10556
10635
|
t.length > 0 && l.push({
|
|
10557
10636
|
text: t,
|
|
10558
|
-
...
|
|
10637
|
+
...N ? { styles: N } : {}
|
|
10559
10638
|
}), l.push(r.run), e = r.offset;
|
|
10560
10639
|
}
|
|
10561
|
-
const t =
|
|
10640
|
+
const t = b.slice(e);
|
|
10562
10641
|
t.length > 0 && l.push({
|
|
10563
10642
|
text: t,
|
|
10564
|
-
...
|
|
10643
|
+
...N ? { styles: N } : {}
|
|
10565
10644
|
});
|
|
10566
10645
|
continue;
|
|
10567
10646
|
}
|
|
10568
|
-
if (0 ===
|
|
10647
|
+
if (0 === b.length && !v && !y) continue;
|
|
10569
10648
|
if (l.push({
|
|
10570
|
-
text:
|
|
10571
|
-
...
|
|
10572
|
-
...
|
|
10573
|
-
...
|
|
10574
|
-
...
|
|
10575
|
-
}),
|
|
10649
|
+
text: b,
|
|
10650
|
+
...v ? { image: v } : {},
|
|
10651
|
+
...y ? { textBox: y } : {},
|
|
10652
|
+
...S ? { sym: S } : {},
|
|
10653
|
+
...N ? { styles: N } : {}
|
|
10654
|
+
}), x) for (const r of x) l.push({
|
|
10576
10655
|
text: "",
|
|
10577
10656
|
bookmark: r.marker
|
|
10578
10657
|
});
|
|
10579
10658
|
continue;
|
|
10580
10659
|
}
|
|
10581
|
-
if ("fldSimple" ===
|
|
10582
|
-
const e =
|
|
10660
|
+
if ("fldSimple" === h.localName) {
|
|
10661
|
+
const e = h.getAttribute("w:instr") ?? h.getAttributeNS("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "instr") ?? h.getAttribute("instr") ?? "", c = /\bNUMPAGES\b/i.test(e) ? "NUMPAGES" : /\bPAGE\b/i.test(e) ? "PAGE" : /\bDATE\b/i.test(e) ? "DATE" : /\bREF\b/i.test(e) ? "REF" : /\bPAGEREF\b/i.test(e) ? "PAGEREF" : null, u = /\*\s*([A-Za-z]+)/.exec(e)?.[1], d = Cr(u), p = "DATE" === c ? /@\s*"([^"]*)"/.exec(e)?.[1] : void 0, f = "REF" === c || "PAGEREF" === c ? cn(e) : void 0, m = await gn(h, t, r, n, o, i, a, s);
|
|
10583
10662
|
if (c) {
|
|
10584
10663
|
const e = m.map((e) => e.text).join("") || "1", t = m.find((e) => e.styles)?.styles, r = "DATE" === c ? p ? {
|
|
10585
10664
|
type: "DATE",
|
|
10586
10665
|
dateFormat: p
|
|
10587
10666
|
} : { type: "DATE" } : "REF" === c || "PAGEREF" === c ? {
|
|
10588
10667
|
type: c,
|
|
10589
|
-
bookmark:
|
|
10668
|
+
bookmark: f
|
|
10590
10669
|
} : d ? {
|
|
10591
10670
|
type: c,
|
|
10592
10671
|
format: d
|
|
@@ -10611,13 +10690,13 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10611
10690
|
});
|
|
10612
10691
|
continue;
|
|
10613
10692
|
}
|
|
10614
|
-
if ("hyperlink" ===
|
|
10615
|
-
let e = n.get(
|
|
10693
|
+
if ("hyperlink" === h.localName) {
|
|
10694
|
+
let e = n.get(h.getAttribute("r:id") ?? h.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id") ?? "") ?? null;
|
|
10616
10695
|
if (!e) {
|
|
10617
|
-
const t = Fe(
|
|
10696
|
+
const t = Fe(h, "anchor");
|
|
10618
10697
|
t && (e = `#${t}`);
|
|
10619
10698
|
}
|
|
10620
|
-
l.push(...await gn(
|
|
10699
|
+
l.push(...await gn(h, t, r, n, o, i, e, s));
|
|
10621
10700
|
}
|
|
10622
10701
|
}
|
|
10623
10702
|
return l;
|
|
@@ -10773,7 +10852,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10773
10852
|
}
|
|
10774
10853
|
};
|
|
10775
10854
|
return n(e), r;
|
|
10776
|
-
}(e, n), c = l.length
|
|
10855
|
+
}(e, n), c = r.some((e) => e.opaque) || l.length !== r.length ? void 0 : l;
|
|
10777
10856
|
if (a || o || s || c) return {
|
|
10778
10857
|
...a ? { xml: a } : {},
|
|
10779
10858
|
...o ? { attributes: o } : {},
|