js.documents 14.4.11 → 14.4.12

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.
@@ -18,11 +18,8 @@ function isVectorOnlyRun(run, vectors) {
18
18
  return vectors.some((detected) => detected.drawingElement === elementChildren[0]);
19
19
  }
20
20
  function objectFrame(object) {
21
- const dxaOrig = (0, ooxml_js.attr)(object, "w:dxaOrig");
22
- const dyaOrig = (0, ooxml_js.attr)(object, "w:dyaOrig");
23
- if (dxaOrig === void 0 || dyaOrig === void 0) return;
24
- const widthPt = require_model_units.twipsToPt(Number(dxaOrig));
25
- const heightPt = require_model_units.twipsToPt(Number(dyaOrig));
21
+ const widthPt = require_model_units.twipsToPt(Number((0, ooxml_js.attr)(object, "w:dxaOrig")));
22
+ const heightPt = require_model_units.twipsToPt(Number((0, ooxml_js.attr)(object, "w:dyaOrig")));
26
23
  return Number.isFinite(widthPt) && Number.isFinite(heightPt) ? {
27
24
  widthPt,
28
25
  heightPt
@@ -66,7 +63,6 @@ function isOleObjectOnlyRun(run, oleObjects) {
66
63
  return oleObjects.some((detected) => detected.objectElement === elementChildren[0]);
67
64
  }
68
65
  function isEmbeddedObjectOnlyParagraph(paragraph, equations, vectors, oleObjects) {
69
- if (equations.length === 0 && vectors.length === 0 && oleObjects.length === 0) return false;
70
66
  for (const child of paragraph.children) {
71
67
  if (child.type === "text") {
72
68
  if (child.value.trim().length > 0) return false;
@@ -85,10 +81,6 @@ function paragraphEmbeddings(block, paragraph, blockIndex, rels, pkg, onMathDiag
85
81
  const equations = require_omml_read.collectOfficeMathElements(paragraph.children);
86
82
  const vectors = require_ooxml_docx_vector.collectParagraphVectors(paragraph);
87
83
  const oleObjects = collectParagraphOleObjects(paragraph, rels, pkg);
88
- if (equations.length === 0 && vectors.length === 0 && oleObjects.length === 0) return {
89
- placements: [],
90
- consume: false
91
- };
92
84
  const converted = equations.map((equation) => ({
93
85
  equation,
94
86
  ...require_omml_read.readOfficeMath(equation)
@@ -17,11 +17,8 @@ function isVectorOnlyRun(run, vectors) {
17
17
  return vectors.some((detected) => detected.drawingElement === elementChildren[0]);
18
18
  }
19
19
  function objectFrame(object) {
20
- const dxaOrig = attr(object, "w:dxaOrig");
21
- const dyaOrig = attr(object, "w:dyaOrig");
22
- if (dxaOrig === void 0 || dyaOrig === void 0) return;
23
- const widthPt = twipsToPt(Number(dxaOrig));
24
- const heightPt = twipsToPt(Number(dyaOrig));
20
+ const widthPt = twipsToPt(Number(attr(object, "w:dxaOrig")));
21
+ const heightPt = twipsToPt(Number(attr(object, "w:dyaOrig")));
25
22
  return Number.isFinite(widthPt) && Number.isFinite(heightPt) ? {
26
23
  widthPt,
27
24
  heightPt
@@ -65,7 +62,6 @@ function isOleObjectOnlyRun(run, oleObjects) {
65
62
  return oleObjects.some((detected) => detected.objectElement === elementChildren[0]);
66
63
  }
67
64
  function isEmbeddedObjectOnlyParagraph(paragraph, equations, vectors, oleObjects) {
68
- if (equations.length === 0 && vectors.length === 0 && oleObjects.length === 0) return false;
69
65
  for (const child of paragraph.children) {
70
66
  if (child.type === "text") {
71
67
  if (child.value.trim().length > 0) return false;
@@ -84,10 +80,6 @@ function paragraphEmbeddings(block, paragraph, blockIndex, rels, pkg, onMathDiag
84
80
  const equations = collectOfficeMathElements(paragraph.children);
85
81
  const vectors = collectParagraphVectors(paragraph);
86
82
  const oleObjects = collectParagraphOleObjects(paragraph, rels, pkg);
87
- if (equations.length === 0 && vectors.length === 0 && oleObjects.length === 0) return {
88
- placements: [],
89
- consume: false
90
- };
91
83
  const converted = equations.map((equation) => ({
92
84
  equation,
93
85
  ...readOfficeMath(equation)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js.documents",
3
- "version": "14.4.11",
3
+ "version": "14.4.12",
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": {
@@ -86,7 +86,7 @@
86
86
  "markdown-codec": "11.1.3",
87
87
  "odf.js": "11.1.3",
88
88
  "ooxml.js": "12.2.8",
89
- "pdf-codec": "5.2.18",
89
+ "pdf-codec": "5.2.19",
90
90
  "ppt-codec": "2.2.3",
91
91
  "rtf-codec": "8.1.3",
92
92
  "temml": "0.13.4",