docxmlater 8.6.9 → 8.7.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/core/DocumentParser.d.ts.map +1 -1
- package/dist/core/DocumentParser.js +116 -6
- package/dist/core/DocumentParser.js.map +1 -1
- package/dist/elements/Field.d.ts +6 -0
- package/dist/elements/Field.d.ts.map +1 -1
- package/dist/elements/Field.js +21 -0
- package/dist/elements/Field.js.map +1 -1
- package/dist/elements/Revision.d.ts.map +1 -1
- package/dist/elements/Revision.js +13 -5
- package/dist/elements/Revision.js.map +1 -1
- package/dist/elements/Run.d.ts +1 -0
- package/dist/elements/Run.d.ts.map +1 -1
- package/dist/elements/Run.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentParser.d.ts","sourceRoot":"","sources":["../../src/core/DocumentParser.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAM9C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,SAAS,EAAyC,MAAM,uBAAuB,CAAC;AAGzF,OAAO,EAEL,OAAO,EAGR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,KAAK,EAA8B,MAAM,qBAAqB,CAAC;AAexE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,kBAA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ructionRevisions = [];
|
|
1500
1501
|
let fieldState = null;
|
|
1501
1502
|
for (let i = 0; i < content.length; i++) {
|
|
1502
1503
|
const item = content[i];
|
|
@@ -1517,6 +1518,43 @@ class DocumentParser {
|
|
|
1517
1518
|
case "end":
|
|
1518
1519
|
fieldState = "end";
|
|
1519
1520
|
if (fieldState === "end" && fieldRuns.length > 0) {
|
|
1521
|
+
if (instructionRevisions.length > 0) {
|
|
1522
|
+
let hasSep = false;
|
|
1523
|
+
for (const run of fieldRuns) {
|
|
1524
|
+
const runContent = run.getContent();
|
|
1525
|
+
const fieldCharToken = runContent.find((c) => c.type === "fieldChar");
|
|
1526
|
+
if (fieldCharToken?.fieldCharType === "begin") {
|
|
1527
|
+
groupedContent.push(run);
|
|
1528
|
+
for (const rev of instructionRevisions) {
|
|
1529
|
+
groupedContent.push(rev);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
else if (fieldCharToken?.fieldCharType === "separate") {
|
|
1533
|
+
groupedContent.push(run);
|
|
1534
|
+
hasSep = true;
|
|
1535
|
+
for (const rev of fieldRevisions) {
|
|
1536
|
+
groupedContent.push(rev);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
else if (fieldCharToken?.fieldCharType === "end") {
|
|
1540
|
+
if (!hasSep) {
|
|
1541
|
+
for (const rev of fieldRevisions) {
|
|
1542
|
+
groupedContent.push(rev);
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
groupedContent.push(run);
|
|
1546
|
+
}
|
|
1547
|
+
else {
|
|
1548
|
+
groupedContent.push(run);
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
logger_1.defaultLogger.debug(`Preserved raw structure for field with ${instructionRevisions.length} instruction revisions`);
|
|
1552
|
+
fieldRuns = [];
|
|
1553
|
+
instructionRevisions = [];
|
|
1554
|
+
fieldRevisions = [];
|
|
1555
|
+
fieldState = null;
|
|
1556
|
+
break;
|
|
1557
|
+
}
|
|
1520
1558
|
let instruction = "";
|
|
1521
1559
|
let resultText = "";
|
|
1522
1560
|
let resultFormatting;
|
|
@@ -1559,15 +1597,19 @@ class DocumentParser {
|
|
|
1559
1597
|
else {
|
|
1560
1598
|
const complexField = this.createComplexFieldFromRuns(fieldRuns);
|
|
1561
1599
|
if (complexField) {
|
|
1600
|
+
if (fieldRevisions.length > 0) {
|
|
1601
|
+
complexField.setResultRevisions(fieldRevisions);
|
|
1602
|
+
}
|
|
1562
1603
|
groupedContent.push(complexField);
|
|
1563
1604
|
}
|
|
1564
1605
|
else {
|
|
1565
1606
|
fieldRuns.forEach((run) => groupedContent.push(run));
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1607
|
+
for (const revision of fieldRevisions) {
|
|
1608
|
+
groupedContent.push(revision);
|
|
1609
|
+
}
|
|
1569
1610
|
}
|
|
1570
1611
|
fieldRuns = [];
|
|
1612
|
+
instructionRevisions = [];
|
|
1571
1613
|
fieldRevisions = [];
|
|
1572
1614
|
fieldState = null;
|
|
1573
1615
|
break;
|
|
@@ -1581,6 +1623,7 @@ class DocumentParser {
|
|
|
1581
1623
|
}
|
|
1582
1624
|
logger_1.defaultLogger.debug(`Converted single-paragraph HYPERLINK field to Hyperlink element`);
|
|
1583
1625
|
fieldRuns = [];
|
|
1626
|
+
instructionRevisions = [];
|
|
1584
1627
|
fieldRevisions = [];
|
|
1585
1628
|
fieldState = null;
|
|
1586
1629
|
break;
|
|
@@ -1588,10 +1631,10 @@ class DocumentParser {
|
|
|
1588
1631
|
}
|
|
1589
1632
|
const complexField = this.createComplexFieldFromRuns(fieldRuns);
|
|
1590
1633
|
if (complexField) {
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
groupedContent.push(revision);
|
|
1634
|
+
if (fieldRevisions.length > 0) {
|
|
1635
|
+
complexField.setResultRevisions(fieldRevisions);
|
|
1594
1636
|
}
|
|
1637
|
+
groupedContent.push(complexField);
|
|
1595
1638
|
}
|
|
1596
1639
|
else {
|
|
1597
1640
|
fieldRuns.forEach((run) => groupedContent.push(run));
|
|
@@ -1600,6 +1643,7 @@ class DocumentParser {
|
|
|
1600
1643
|
}
|
|
1601
1644
|
}
|
|
1602
1645
|
fieldRuns = [];
|
|
1646
|
+
instructionRevisions = [];
|
|
1603
1647
|
fieldRevisions = [];
|
|
1604
1648
|
fieldState = null;
|
|
1605
1649
|
}
|
|
@@ -1622,10 +1666,14 @@ class DocumentParser {
|
|
|
1622
1666
|
}
|
|
1623
1667
|
else if (fieldRuns.length > 0) {
|
|
1624
1668
|
fieldRuns.forEach((run) => groupedContent.push(run));
|
|
1669
|
+
for (const revision of instructionRevisions) {
|
|
1670
|
+
groupedContent.push(revision);
|
|
1671
|
+
}
|
|
1625
1672
|
for (const revision of fieldRevisions) {
|
|
1626
1673
|
groupedContent.push(revision);
|
|
1627
1674
|
}
|
|
1628
1675
|
fieldRuns = [];
|
|
1676
|
+
instructionRevisions = [];
|
|
1629
1677
|
fieldRevisions = [];
|
|
1630
1678
|
fieldState = null;
|
|
1631
1679
|
groupedContent.push(item);
|
|
@@ -1641,12 +1689,21 @@ class DocumentParser {
|
|
|
1641
1689
|
fieldState = "result";
|
|
1642
1690
|
logger_1.defaultLogger.debug(`Found revision inside complex field result: type=${item.getType()}, id=${item.getId()}`);
|
|
1643
1691
|
}
|
|
1692
|
+
else if (fieldState === "begin" || fieldState === "instruction") {
|
|
1693
|
+
instructionRevisions.push(item);
|
|
1694
|
+
fieldState = "instruction";
|
|
1695
|
+
logger_1.defaultLogger.debug(`Found revision inside complex field instruction: type=${item.getType()}, id=${item.getId()}`);
|
|
1696
|
+
}
|
|
1644
1697
|
else if (fieldRuns.length > 0) {
|
|
1645
1698
|
fieldRuns.forEach((run) => groupedContent.push(run));
|
|
1699
|
+
for (const revision of instructionRevisions) {
|
|
1700
|
+
groupedContent.push(revision);
|
|
1701
|
+
}
|
|
1646
1702
|
for (const revision of fieldRevisions) {
|
|
1647
1703
|
groupedContent.push(revision);
|
|
1648
1704
|
}
|
|
1649
1705
|
fieldRuns = [];
|
|
1706
|
+
instructionRevisions = [];
|
|
1650
1707
|
fieldRevisions = [];
|
|
1651
1708
|
fieldState = null;
|
|
1652
1709
|
groupedContent.push(item);
|
|
@@ -1658,10 +1715,14 @@ class DocumentParser {
|
|
|
1658
1715
|
else {
|
|
1659
1716
|
if (fieldRuns.length > 0) {
|
|
1660
1717
|
fieldRuns.forEach((run) => groupedContent.push(run));
|
|
1718
|
+
for (const revision of instructionRevisions) {
|
|
1719
|
+
groupedContent.push(revision);
|
|
1720
|
+
}
|
|
1661
1721
|
for (const revision of fieldRevisions) {
|
|
1662
1722
|
groupedContent.push(revision);
|
|
1663
1723
|
}
|
|
1664
1724
|
fieldRuns = [];
|
|
1725
|
+
instructionRevisions = [];
|
|
1665
1726
|
fieldRevisions = [];
|
|
1666
1727
|
fieldState = null;
|
|
1667
1728
|
}
|
|
@@ -1670,6 +1731,9 @@ class DocumentParser {
|
|
|
1670
1731
|
}
|
|
1671
1732
|
if (fieldRuns.length > 0) {
|
|
1672
1733
|
fieldRuns.forEach((run) => groupedContent.push(run));
|
|
1734
|
+
for (const revision of instructionRevisions) {
|
|
1735
|
+
groupedContent.push(revision);
|
|
1736
|
+
}
|
|
1673
1737
|
for (const revision of fieldRevisions) {
|
|
1674
1738
|
groupedContent.push(revision);
|
|
1675
1739
|
}
|
|
@@ -2073,6 +2137,34 @@ class DocumentParser {
|
|
|
2073
2137
|
}
|
|
2074
2138
|
break;
|
|
2075
2139
|
}
|
|
2140
|
+
case "w:delText": {
|
|
2141
|
+
const delTextElements = toArray(runObj["w:delText"]);
|
|
2142
|
+
if (elementIndex >= delTextElements.length) {
|
|
2143
|
+
logger_1.defaultLogger.debug("[DocumentParser] Invalid _orderedChildren index for w:delText", { index: elementIndex, arrayLength: delTextElements.length });
|
|
2144
|
+
break;
|
|
2145
|
+
}
|
|
2146
|
+
const te = delTextElements[elementIndex];
|
|
2147
|
+
if (te !== undefined && te !== null) {
|
|
2148
|
+
const text = extractTextValue(te);
|
|
2149
|
+
if (text) {
|
|
2150
|
+
content.push({ type: "text", value: text, isDeleted: true });
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
break;
|
|
2154
|
+
}
|
|
2155
|
+
case "w:delInstrText": {
|
|
2156
|
+
const delInstrElements = toArray(runObj["w:delInstrText"]);
|
|
2157
|
+
if (elementIndex >= delInstrElements.length) {
|
|
2158
|
+
logger_1.defaultLogger.debug("[DocumentParser] Invalid _orderedChildren index for w:delInstrText", { index: elementIndex, arrayLength: delInstrElements.length });
|
|
2159
|
+
break;
|
|
2160
|
+
}
|
|
2161
|
+
const instr = delInstrElements[elementIndex];
|
|
2162
|
+
if (instr !== undefined && instr !== null) {
|
|
2163
|
+
const text = extractTextValue(instr);
|
|
2164
|
+
content.push({ type: "instructionText", value: text, isDeleted: true });
|
|
2165
|
+
}
|
|
2166
|
+
break;
|
|
2167
|
+
}
|
|
2076
2168
|
case "w:fldChar": {
|
|
2077
2169
|
const fldChars = toArray(runObj["w:fldChar"]);
|
|
2078
2170
|
if (elementIndex >= fldChars.length) {
|
|
@@ -2138,6 +2230,24 @@ class DocumentParser {
|
|
|
2138
2230
|
content.push({ type: "instructionText", value: text });
|
|
2139
2231
|
}
|
|
2140
2232
|
}
|
|
2233
|
+
const delTextElement = runObj["w:delText"];
|
|
2234
|
+
if (delTextElement !== undefined && delTextElement !== null) {
|
|
2235
|
+
const delTextElements = toArray(delTextElement);
|
|
2236
|
+
for (const te of delTextElements) {
|
|
2237
|
+
const text = extractTextValue(te);
|
|
2238
|
+
if (text) {
|
|
2239
|
+
content.push({ type: "text", value: text, isDeleted: true });
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
const delInstrTextElement = runObj["w:delInstrText"];
|
|
2244
|
+
if (delInstrTextElement !== undefined && delInstrTextElement !== null) {
|
|
2245
|
+
const delInstrElements = toArray(delInstrTextElement);
|
|
2246
|
+
for (const instr of delInstrElements) {
|
|
2247
|
+
const text = extractTextValue(instr);
|
|
2248
|
+
content.push({ type: "instructionText", value: text, isDeleted: true });
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2141
2251
|
const fldCharElement = runObj["w:fldChar"];
|
|
2142
2252
|
if (fldCharElement !== undefined && fldCharElement !== null) {
|
|
2143
2253
|
const fldChars = toArray(fldCharElement);
|