js.documents 14.4.122 → 14.4.124

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.
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_xml_fragment = require("../../xml/fragment.cjs");
3
3
  const require_xml_edit = require("../../xml/edit.cjs");
4
4
  const require_odf_package_formula = require("../../odf-package/formula.cjs");
5
+ const require_xml_odf_text = require("../../xml/odf-text.cjs");
5
6
  const require_odf_package_media = require("../../odf-package/media.cjs");
6
7
  const require_edit_odf_repeated_runs = require("../odf-repeated-runs.cjs");
7
8
  const require_edit_ods_address = require("./address.cjs");
@@ -63,20 +64,21 @@ function cumulativeRowOffsetPt(pkg, tableElement, anchorRow) {
63
64
  if (cursor < anchorRow) offsetPt += (anchorRow - cursor) * DEFAULT_ROW_HEIGHT_PT;
64
65
  return offsetPt;
65
66
  }
66
- function buildAbsoluteFrame(xPt, yPt, widthPt, heightPt, content) {
67
+ function buildAbsoluteFrame(xPt, yPt, widthPt, heightPt, content, altText) {
68
+ const children = altText === void 0 ? [content] : [require_xml_fragment.el("svg:title", {}, require_xml_odf_text.encodeOdfText(altText)), content];
67
69
  return require_xml_fragment.el("draw:frame", {
68
70
  "svg:x": (0, odf_js.formatOdfLength)(xPt),
69
71
  "svg:y": (0, odf_js.formatOdfLength)(yPt),
70
72
  "svg:width": (0, odf_js.formatOdfLength)(widthPt),
71
73
  "svg:height": (0, odf_js.formatOdfLength)(heightPt)
72
- }, [content]);
74
+ }, children);
73
75
  }
74
76
  function insertSheetImage(pkg, tableElement, image) {
75
77
  const { partPath } = require_odf_package_media.addImageMedia(pkg, (0, odf_js.base64ToBytes)(image.base64), image.format);
76
78
  const xPt = cumulativeColumnOffsetPt(pkg, tableElement, image.anchorColumn) + image.offsetXPt;
77
79
  const yPt = cumulativeRowOffsetPt(pkg, tableElement, image.anchorRow) + image.offsetYPt;
78
80
  const imageElement = require_xml_fragment.el("draw:image", { "xlink:href": partPath });
79
- const frame = buildAbsoluteFrame(xPt, yPt, image.widthPt, image.heightPt, imageElement);
81
+ const frame = buildAbsoluteFrame(xPt, yPt, image.widthPt, image.heightPt, imageElement, image.altText);
80
82
  ensureTableShapes(tableElement).children.push(frame);
81
83
  }
82
84
  function insertSheetEmbeddedObject(pkg, tableElement, object, nextObjectName) {
@@ -1,6 +1,7 @@
1
1
  import { el } from "../../xml/fragment.js";
2
2
  import { directChildElement } from "../../xml/edit.js";
3
3
  import { addFormulaObject } from "../../odf-package/formula.js";
4
+ import { encodeOdfText } from "../../xml/odf-text.js";
4
5
  import { addImageMedia } from "../../odf-package/media.js";
5
6
  import { COLUMN_REPEAT_ATTR, ROW_REPEAT_ATTR, ROW_TAG, collectRunMembers, isElementWithTag, readRunRepeatCount } from "../odf-repeated-runs.js";
6
7
  import { COLUMN_TAG, HEADER_COLUMNS_TAG, HEADER_ROWS_TAG } from "./address.js";
@@ -62,20 +63,21 @@ function cumulativeRowOffsetPt(pkg, tableElement, anchorRow) {
62
63
  if (cursor < anchorRow) offsetPt += (anchorRow - cursor) * DEFAULT_ROW_HEIGHT_PT;
63
64
  return offsetPt;
64
65
  }
65
- function buildAbsoluteFrame(xPt, yPt, widthPt, heightPt, content) {
66
+ function buildAbsoluteFrame(xPt, yPt, widthPt, heightPt, content, altText) {
67
+ const children = altText === void 0 ? [content] : [el("svg:title", {}, encodeOdfText(altText)), content];
66
68
  return el("draw:frame", {
67
69
  "svg:x": formatOdfLength(xPt),
68
70
  "svg:y": formatOdfLength(yPt),
69
71
  "svg:width": formatOdfLength(widthPt),
70
72
  "svg:height": formatOdfLength(heightPt)
71
- }, [content]);
73
+ }, children);
72
74
  }
73
75
  function insertSheetImage(pkg, tableElement, image) {
74
76
  const { partPath } = addImageMedia(pkg, base64ToBytes$1(image.base64), image.format);
75
77
  const xPt = cumulativeColumnOffsetPt(pkg, tableElement, image.anchorColumn) + image.offsetXPt;
76
78
  const yPt = cumulativeRowOffsetPt(pkg, tableElement, image.anchorRow) + image.offsetYPt;
77
79
  const imageElement = el("draw:image", { "xlink:href": partPath });
78
- const frame = buildAbsoluteFrame(xPt, yPt, image.widthPt, image.heightPt, imageElement);
80
+ const frame = buildAbsoluteFrame(xPt, yPt, image.widthPt, image.heightPt, imageElement, image.altText);
79
81
  ensureTableShapes(tableElement).children.push(frame);
80
82
  }
81
83
  function insertSheetEmbeddedObject(pkg, tableElement, object, nextObjectName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js.documents",
3
- "version": "14.4.122",
3
+ "version": "14.4.124",
4
4
  "description": "Converts between docx, pptx, odt, odp, ods, odg, xlsx, csv, svg, markdown, rtf, doc, xls, ppt and PDF through one shared, Zod-typed content schema (wpd read-only), plus read+write editors for OOXML and OpenDocument. Worker-isomorphic.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -77,21 +77,21 @@
77
77
  ],
78
78
  "license": "MIT",
79
79
  "dependencies": {
80
- "archive-codec": "1.11.25",
80
+ "archive-codec": "1.11.26",
81
81
  "byte-codec": "2.0.2",
82
- "doc-codec": "6.1.22",
83
- "document-schema.js": "7.16.0",
84
- "epub-codec": "5.1.15",
82
+ "doc-codec": "6.1.23",
83
+ "document-schema.js": "7.16.1",
84
+ "epub-codec": "5.1.16",
85
85
  "fflate": "0.8.3",
86
- "markdown-codec": "11.1.15",
87
- "odf.js": "11.2.1",
88
- "ooxml.js": "12.2.30",
89
- "pdf-codec": "5.3.30",
90
- "ppt-codec": "2.2.22",
91
- "rtf-codec": "8.1.23",
86
+ "markdown-codec": "11.1.16",
87
+ "odf.js": "11.2.2",
88
+ "ooxml.js": "12.2.32",
89
+ "pdf-codec": "5.3.32",
90
+ "ppt-codec": "2.2.23",
91
+ "rtf-codec": "8.1.24",
92
92
  "temml": "0.13.4",
93
- "wpd-codec": "5.1.21",
94
- "xls-codec": "4.16.4",
93
+ "wpd-codec": "5.1.22",
94
+ "xls-codec": "4.16.5",
95
95
  "zod": "4.4.3"
96
96
  },
97
97
  "devDependencies": {