documents.js 1.81.8 → 1.82.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.
@@ -15,6 +15,20 @@ function collectBodyParagraphs(nodes, out) {
15
15
  }
16
16
  }
17
17
  }
18
+ function collectBodyTables(nodes, out) {
19
+ for (const node of nodes) {
20
+ if (node.type !== "element") continue;
21
+ if (node.tag === "w:tbl") out.push(node);
22
+ else if (node.tag === "w:sdt") {
23
+ const content = (0, ooxml_js.childrenWithTag)(node, "w:sdtContent")[0];
24
+ if (content !== void 0) collectBodyTables(content.children, out);
25
+ } else if (node.tag === "w:ins") collectBodyTables(node.children, out);
26
+ else if (node.tag === "mc:AlternateContent") {
27
+ const target = (0, ooxml_js.childrenWithTag)(node, "mc:Fallback")[0] ?? (0, ooxml_js.childrenWithTag)(node, "mc:Choice")[0];
28
+ if (target !== void 0) collectBodyTables(target.children, out);
29
+ }
30
+ }
31
+ }
18
32
  const PARAGRAPH_NON_CONTENT_TAGS = /* @__PURE__ */ new Set([
19
33
  "w:pPr",
20
34
  "w:bookmarkStart",
@@ -51,4 +65,5 @@ function equationFrame(equation) {
51
65
  //#endregion
52
66
  exports.PARAGRAPH_NON_CONTENT_TAGS = PARAGRAPH_NON_CONTENT_TAGS;
53
67
  exports.collectBodyParagraphs = collectBodyParagraphs;
68
+ exports.collectBodyTables = collectBodyTables;
54
69
  exports.equationFrame = equationFrame;
@@ -1,2 +1,2 @@
1
- import { i as equationFrame, n as PARAGRAPH_NON_CONTENT_TAGS, r as collectBodyParagraphs, t as OmmlDiagnosticSink } from "../../formula-DFc2Ofsk.cjs";
2
- export { OmmlDiagnosticSink, PARAGRAPH_NON_CONTENT_TAGS, collectBodyParagraphs, equationFrame };
1
+ import { a as equationFrame, i as collectBodyTables, n as PARAGRAPH_NON_CONTENT_TAGS, r as collectBodyParagraphs, t as OmmlDiagnosticSink } from "../../formula-_8feXQH7.cjs";
2
+ export { OmmlDiagnosticSink, PARAGRAPH_NON_CONTENT_TAGS, collectBodyParagraphs, collectBodyTables, equationFrame };
@@ -1,2 +1,2 @@
1
- import { i as equationFrame, n as PARAGRAPH_NON_CONTENT_TAGS, r as collectBodyParagraphs, t as OmmlDiagnosticSink } from "../../formula-B_4mdCuK.js";
2
- export { OmmlDiagnosticSink, PARAGRAPH_NON_CONTENT_TAGS, collectBodyParagraphs, equationFrame };
1
+ import { a as equationFrame, i as collectBodyTables, n as PARAGRAPH_NON_CONTENT_TAGS, r as collectBodyParagraphs, t as OmmlDiagnosticSink } from "../../formula-DDSYieJg.js";
2
+ export { OmmlDiagnosticSink, PARAGRAPH_NON_CONTENT_TAGS, collectBodyParagraphs, collectBodyTables, equationFrame };
@@ -14,6 +14,20 @@ function collectBodyParagraphs(nodes, out) {
14
14
  }
15
15
  }
16
16
  }
17
+ function collectBodyTables(nodes, out) {
18
+ for (const node of nodes) {
19
+ if (node.type !== "element") continue;
20
+ if (node.tag === "w:tbl") out.push(node);
21
+ else if (node.tag === "w:sdt") {
22
+ const content = childrenWithTag(node, "w:sdtContent")[0];
23
+ if (content !== void 0) collectBodyTables(content.children, out);
24
+ } else if (node.tag === "w:ins") collectBodyTables(node.children, out);
25
+ else if (node.tag === "mc:AlternateContent") {
26
+ const target = childrenWithTag(node, "mc:Fallback")[0] ?? childrenWithTag(node, "mc:Choice")[0];
27
+ if (target !== void 0) collectBodyTables(target.children, out);
28
+ }
29
+ }
30
+ }
17
31
  const PARAGRAPH_NON_CONTENT_TAGS = /* @__PURE__ */ new Set([
18
32
  "w:pPr",
19
33
  "w:bookmarkStart",
@@ -48,4 +62,4 @@ function equationFrame(equation) {
48
62
  };
49
63
  }
50
64
  //#endregion
51
- export { PARAGRAPH_NON_CONTENT_TAGS, collectBodyParagraphs, equationFrame };
65
+ export { PARAGRAPH_NON_CONTENT_TAGS, collectBodyParagraphs, collectBodyTables, equationFrame };
@@ -1,4 +1,4 @@
1
- import { t as OmmlDiagnosticSink } from "../../formula-DFc2Ofsk.cjs";
1
+ import { t as OmmlDiagnosticSink } from "../../formula-_8feXQH7.cjs";
2
2
  import { ContentDocument } from "document-schema.js";
3
3
  import { Package } from "ooxml.js";
4
4
  //#region src/ooxml/docx/read.d.ts
@@ -1,4 +1,4 @@
1
- import { t as OmmlDiagnosticSink } from "../../formula-B_4mdCuK.js";
1
+ import { t as OmmlDiagnosticSink } from "../../formula-DDSYieJg.js";
2
2
  import { Package } from "ooxml.js";
3
3
  import { ContentDocument } from "document-schema.js";
4
4
  //#region src/ooxml/docx/read.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "documents.js",
3
- "version": "1.81.8",
3
+ "version": "1.82.0",
4
4
  "description": "Bidirectional docx/pptx <-> PDF conversion and a read+write editable OOXML document model, built on ooxml.js and Zod 4 codecs.",
5
5
  "type": "module",
6
6
  "repository": {