ooxml.js 6.3.4 → 6.3.5

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/index.cjs CHANGED
@@ -15,7 +15,7 @@ const require_typed_util = require("./typed/util.cjs");
15
15
  const require_typed_shared_color = require("./typed/shared/color.cjs");
16
16
  const require_typed_shared_metadata = require("./typed/shared/metadata.cjs");
17
17
  const require_image_sniff = require("./image/sniff.cjs");
18
- const require_read = require("./read-CXksZHJW.cjs");
18
+ const require_read = require("./read-6whiWc5N.cjs");
19
19
  const require_typed_xlsx_content = require("./typed/xlsx/content.cjs");
20
20
  const require_typed_docx_numbering = require("./typed/docx/numbering.cjs");
21
21
  const require_typed_xlsx_build = require("./typed/xlsx/build.cjs");
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { attr, childrenWithTag, decodeEntities, elementsWithTag, resolveRelation
14
14
  import { applyColorTransforms } from "./typed/shared/color.js";
15
15
  import { DocumentMetadataSchema } from "./typed/shared/metadata.js";
16
16
  import { sniffImageFormat } from "./image/sniff.js";
17
- import { a as SectionHeaderFooterReferencesSchema, i as HeaderFooterPartSchema, l as PptxDocumentSchema, n as DocxDocumentSchema, o as readDocxContent, r as FootnoteSchema, t as CommentSchema, u as readPptxContent } from "./read-BZ_jycSX.js";
17
+ import { a as SectionHeaderFooterReferencesSchema, i as HeaderFooterPartSchema, l as PptxDocumentSchema, n as DocxDocumentSchema, o as readDocxContent, r as FootnoteSchema, t as CommentSchema, u as readPptxContent } from "./read-BrAuHnvH.js";
18
18
  import { readXlsxContent } from "./typed/xlsx/content.js";
19
19
  import { NumberingDefinitionSchema, NumberingLevelSchema, readNumberingDefinitions } from "./typed/docx/numbering.js";
20
20
  import { buildXlsxPackageFromContent } from "./typed/xlsx/build.js";
@@ -255,13 +255,18 @@ function readBlipImage(parent, slideRels, pkg, frame) {
255
255
  const mediaPart = rel === void 0 ? void 0 : pkg.parts[rel.target];
256
256
  if (mediaPart?.kind !== "binary") return;
257
257
  const format = require_image_sniff.sniffImageFormat(require_util_base64.base64ToBytes(mediaPart.base64));
258
- return format === void 0 ? void 0 : {
258
+ if (format === void 0) return;
259
+ const image = {
259
260
  kind: "image",
260
261
  format,
261
262
  base64: mediaPart.base64,
262
263
  widthPt: frame.widthPt,
263
264
  heightPt: frame.heightPt
264
265
  };
266
+ const cNvPr = require_typed_util.elementsWithTag([parent], "p:cNvPr")[0];
267
+ const altText = cNvPr === void 0 ? void 0 : require_typed_util.attr(cNvPr, "descr") ?? require_typed_util.attr(cNvPr, "title");
268
+ if (altText !== void 0) image.altText = require_typed_util.decodeEntities(altText);
269
+ return image;
265
270
  }
266
271
  function readPicShape(pic, context, slideRels, pkg, parentTransform) {
267
272
  const resolved = resolveShapeFrame(pic, context, parentTransform);
@@ -255,13 +255,18 @@ function readBlipImage(parent, slideRels, pkg, frame) {
255
255
  const mediaPart = rel === void 0 ? void 0 : pkg.parts[rel.target];
256
256
  if (mediaPart?.kind !== "binary") return;
257
257
  const format = sniffImageFormat(base64ToBytes(mediaPart.base64));
258
- return format === void 0 ? void 0 : {
258
+ if (format === void 0) return;
259
+ const image = {
259
260
  kind: "image",
260
261
  format,
261
262
  base64: mediaPart.base64,
262
263
  widthPt: frame.widthPt,
263
264
  heightPt: frame.heightPt
264
265
  };
266
+ const cNvPr = elementsWithTag([parent], "p:cNvPr")[0];
267
+ const altText = cNvPr === void 0 ? void 0 : attr(cNvPr, "descr") ?? attr(cNvPr, "title");
268
+ if (altText !== void 0) image.altText = decodeEntities(altText);
269
+ return image;
265
270
  }
266
271
  function readPicShape(pic, context, slideRels, pkg, parentTransform) {
267
272
  const resolved = resolveShapeFrame(pic, context, parentTransform);
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_read = require("../read-CXksZHJW.cjs");
2
+ const require_read = require("../read-6whiWc5N.cjs");
3
3
  const require_typed_xlsx_content = require("./xlsx/content.cjs");
4
4
  const require_typed_xlsx_build = require("./xlsx/build.cjs");
5
5
  const require_typed_docx_write = require("./docx/write.cjs");
@@ -1,4 +1,4 @@
1
- import { o as readDocxContent, u as readPptxContent } from "../read-BZ_jycSX.js";
1
+ import { o as readDocxContent, u as readPptxContent } from "../read-BrAuHnvH.js";
2
2
  import { readXlsxContent } from "./xlsx/content.js";
3
3
  import { buildXlsxPackageFromContent } from "./xlsx/build.js";
4
4
  import { buildDocxPackageFromContent } from "./docx/write.js";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_read = require("../../read-CXksZHJW.cjs");
2
+ const require_read = require("../../read-6whiWc5N.cjs");
3
3
  exports.CommentSchema = require_read.CommentSchema;
4
4
  exports.DocxDocumentSchema = require_read.DocxDocumentSchema;
5
5
  exports.FootnoteSchema = require_read.FootnoteSchema;
@@ -1,2 +1,2 @@
1
- import { a as SectionHeaderFooterReferencesSchema, i as HeaderFooterPartSchema, n as DocxDocumentSchema, o as readDocxContent, r as FootnoteSchema, t as CommentSchema } from "../../read-BZ_jycSX.js";
1
+ import { a as SectionHeaderFooterReferencesSchema, i as HeaderFooterPartSchema, n as DocxDocumentSchema, o as readDocxContent, r as FootnoteSchema, t as CommentSchema } from "../../read-BrAuHnvH.js";
2
2
  export { CommentSchema, DocxDocumentSchema, FootnoteSchema, HeaderFooterPartSchema, SectionHeaderFooterReferencesSchema, readDocxContent };
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_read = require("../read-CXksZHJW.cjs");
2
+ const require_read = require("../read-6whiWc5N.cjs");
3
3
  exports.readEmbeddedOoxmlPayload = require_read.readEmbeddedOoxmlPayload;
4
4
  exports.readEmbeddedPayloadPart = require_read.readEmbeddedPayloadPart;
@@ -1,2 +1,2 @@
1
- import { c as readEmbeddedPayloadPart, s as readEmbeddedOoxmlPayload } from "../read-BZ_jycSX.js";
1
+ import { c as readEmbeddedPayloadPart, s as readEmbeddedOoxmlPayload } from "../read-BrAuHnvH.js";
2
2
  export { readEmbeddedOoxmlPayload, readEmbeddedPayloadPart };
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_read = require("../../read-CXksZHJW.cjs");
2
+ const require_read = require("../../read-6whiWc5N.cjs");
3
3
  exports.PptxDocumentSchema = require_read.PptxDocumentSchema;
4
4
  exports.readPptxContent = require_read.readPptxContent;
@@ -1,2 +1,2 @@
1
- import { l as PptxDocumentSchema, u as readPptxContent } from "../../read-BZ_jycSX.js";
1
+ import { l as PptxDocumentSchema, u as readPptxContent } from "../../read-BrAuHnvH.js";
2
2
  export { PptxDocumentSchema, readPptxContent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ooxml.js",
3
- "version": "6.3.4",
3
+ "version": "6.3.5",
4
4
  "description": "Type-safe, lossless round-trip conversion between OOXML packages (docx, pptx, xlsx) and JSON, built on Zod 4 codecs.",
5
5
  "type": "module",
6
6
  "repository": {