js.documents 1.86.1 → 1.87.1

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.
Files changed (60) hide show
  1. package/README.md +1 -1
  2. package/dist/edit/docx/content.cjs +2 -1
  3. package/dist/edit/docx/content.js +2 -1
  4. package/dist/edit/docx/editor.cjs +6 -4
  5. package/dist/edit/docx/editor.js +6 -4
  6. package/dist/edit/docx/paragraph.cjs +17 -1
  7. package/dist/edit/docx/paragraph.d.cts +3 -1
  8. package/dist/edit/docx/paragraph.d.ts +3 -1
  9. package/dist/edit/docx/paragraph.js +17 -1
  10. package/dist/edit/odg/page.d.cts +1 -1
  11. package/dist/edit/odg/page.d.ts +1 -1
  12. package/dist/edit/odp/shape.d.cts +1 -1
  13. package/dist/edit/odp/shape.d.ts +1 -1
  14. package/dist/edit/odp/slide.d.cts +2 -2
  15. package/dist/edit/odp/slide.d.ts +2 -2
  16. package/dist/edit/odt/content.cjs +1 -0
  17. package/dist/edit/odt/content.d.cts +2 -2
  18. package/dist/edit/odt/content.d.ts +2 -2
  19. package/dist/edit/odt/content.js +1 -0
  20. package/dist/edit/odt/editor.d.cts +3 -3
  21. package/dist/edit/odt/editor.d.ts +3 -3
  22. package/dist/edit/odt/list.d.cts +1 -1
  23. package/dist/edit/odt/list.d.ts +1 -1
  24. package/dist/edit/odt/paragraph.cjs +10 -0
  25. package/dist/edit/odt/paragraph.d.cts +1 -1
  26. package/dist/edit/odt/paragraph.d.ts +1 -1
  27. package/dist/edit/odt/paragraph.js +10 -0
  28. package/dist/edit/odt/table.d.cts +1 -1
  29. package/dist/edit/odt/table.d.ts +1 -1
  30. package/dist/edit/pptx/content.cjs +9 -8
  31. package/dist/edit/pptx/content.js +9 -8
  32. package/dist/edit/pptx/editor.cjs +1 -1
  33. package/dist/edit/pptx/editor.js +1 -1
  34. package/dist/edit/pptx/shape.cjs +1 -0
  35. package/dist/edit/pptx/shape.d.cts +1 -1
  36. package/dist/edit/pptx/shape.d.ts +1 -1
  37. package/dist/edit/pptx/shape.js +1 -0
  38. package/dist/edit/pptx/slide.cjs +9 -2
  39. package/dist/edit/pptx/slide.d.cts +3 -2
  40. package/dist/edit/pptx/slide.d.ts +3 -2
  41. package/dist/edit/pptx/slide.js +9 -2
  42. package/dist/edit/pptx/table.d.cts +1 -1
  43. package/dist/edit/pptx/table.d.ts +1 -1
  44. package/dist/index.d.cts +6 -6
  45. package/dist/index.d.ts +6 -6
  46. package/dist/{list-DA1hCBVI.d.ts → list-4lN_90Pt.d.ts} +1 -1
  47. package/dist/{list-CxoEJwNO.d.cts → list-fKlr6jWd.d.cts} +1 -1
  48. package/dist/opc/core-properties.cjs +1 -1
  49. package/dist/opc/core-properties.js +1 -1
  50. package/dist/{paragraph-DXIJfPMw.d.cts → paragraph-BlN-ErQS.d.cts} +1 -0
  51. package/dist/{paragraph-DV4_ZNGr.d.ts → paragraph-Bz20facN.d.ts} +1 -0
  52. package/dist/{shape-DU4GMETm.d.ts → shape-C3NECkae.d.ts} +1 -0
  53. package/dist/{shape-CIIpuHNp.d.cts → shape-CoiqTTA-.d.cts} +1 -0
  54. package/dist/{shape-DyviC6ZG.d.ts → shape-DFO5259y.d.ts} +2 -2
  55. package/dist/{shape-Dch9pDCf.d.cts → shape-lA-bEGqk.d.cts} +2 -2
  56. package/dist/{table-BxeHHD7r.d.ts → table-BRXbauz6.d.ts} +1 -1
  57. package/dist/{table-BtMtRYqc.d.cts → table-CNrk1jGM.d.cts} +1 -1
  58. package/dist/{table-C2dxbmvn.d.cts → table-CjUjLcsE.d.cts} +1 -1
  59. package/dist/{table-DOce3xA6.d.ts → table-DV-Glhx_.d.ts} +1 -1
  60. package/package.json +2 -2
package/README.md CHANGED
@@ -590,7 +590,7 @@ Dependency direction among this package's own local modules is downward and chec
590
590
  ```sh
591
591
  pnpm build # tsdown -> dist/ (ESM + CJS + .d.ts)
592
592
  pnpm typecheck # tsc --noEmit
593
- pnpm lint # eslint . --max-warnings 0
593
+ pnpm lint # eslint . --fix --cache --max-warnings 0
594
594
  pnpm test # vitest run --project unit
595
595
  pnpm test:watch # vitest --project unit
596
596
  pnpm test:smoke # rebuilds dist/, then verifies ESM/CJS parity, a real docxToPdf/pdfToDocx round trip, real odtToPdf/odpToPdf/odsToPdf/odgToPdf conversions (odgToPdf's own fixture carries a real curved path, proving writePath reaches the built dist/ bundle), a real createOdp/odpToPdf/pdfToOdp round trip, a real odsToPdf/pdfToOds round trip plus a separate createOds/printSettings/buildOdsPackage exercise, a real createOdg/odgToPdf/pdfToOdg round trip (a curved path, a filled rect, and text, built entirely through the odg live-view editor, converted to PDF and reconstructed back to odg via reconstructDrawing), a real odfToPdf conversion (a fraction, rendered via the embedded STIX Two Math font -- checked by confirming the built PDF contains a real /Type0/Identity-H/CIDFontType0C font resource, proving the base64-embedded font asset itself survived the tsdown build), a real odsToPdf conversion of a sheet carrying a cell-anchored formula (the same font-resource check, plus asserting convertSpreadsheetToLayout's own reported position lands at the anchor cell rather than the sheet's origin), a real markdownToPdf/pdfToMarkdown round trip plus a markdownToDocx bridge exercise, and real font resolution in docxToPdf (a Calibri run producing a genuine /Type0/Identity-H/CIDFontType2/FontFile2 Carlito font program, alongside an Arial control run that embeds nothing at all), from the built CJS bundle
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_model_metadata = require("../../model/metadata.cjs");
3
3
  const require_ports_clock = require("../../ports/clock.cjs");
4
- const require_model_units = require("../../model/units.cjs");
5
4
  const require_opc_rels = require("../../opc/rels.cjs");
5
+ const require_model_units = require("../../model/units.cjs");
6
6
  const require_opc_content_types = require("../../opc/content-types.cjs");
7
7
  const require_edit_docx_scaffold = require("./scaffold.cjs");
8
8
  const require_edit_docx_editor = require("./editor.cjs");
@@ -141,6 +141,7 @@ function populateParagraph(paragraph, block) {
141
141
  if (run.fontFamily !== void 0) docxRun.fontFamily = run.fontFamily;
142
142
  if (run.sizePt !== void 0) docxRun.sizePt = run.sizePt;
143
143
  if (run.color !== void 0) docxRun.color = run.color;
144
+ if (run.hyperlink !== void 0) paragraph.wrapLastRunInHyperlink(run.hyperlink);
144
145
  }
145
146
  }
146
147
  function populateCellBlocks(cell, blocks) {
@@ -1,7 +1,7 @@
1
1
  import { resolveMetadataTimestamps } from "../../model/metadata.js";
2
2
  import { systemClock } from "../../ports/clock.js";
3
- import { ptToTwips } from "../../model/units.js";
4
3
  import { addRelationship } from "../../opc/rels.js";
4
+ import { ptToTwips } from "../../model/units.js";
5
5
  import { ensureContentTypeOverride } from "../../opc/content-types.js";
6
6
  import { createEmptyDocxPackage } from "./scaffold.js";
7
7
  import { DocxEditor } from "./editor.js";
@@ -140,6 +140,7 @@ function populateParagraph(paragraph, block) {
140
140
  if (run.fontFamily !== void 0) docxRun.fontFamily = run.fontFamily;
141
141
  if (run.sizePt !== void 0) docxRun.sizePt = run.sizePt;
142
142
  if (run.color !== void 0) docxRun.color = run.color;
143
+ if (run.hyperlink !== void 0) paragraph.wrapLastRunInHyperlink(run.hyperlink);
143
144
  }
144
145
  }
145
146
  function populateCellBlocks(cell, blocks) {
@@ -32,21 +32,23 @@ function bodyElementIndicesByTag(body, tag) {
32
32
  var DocxBodyImpl = class {
33
33
  body;
34
34
  imageContext;
35
- constructor(body, imageContext) {
35
+ pkg;
36
+ constructor(body, imageContext, pkg) {
36
37
  this.body = body;
37
38
  this.imageContext = imageContext;
39
+ this.pkg = pkg;
38
40
  }
39
41
  appendParagraph(init) {
40
42
  const paragraphElement = require_edit_docx_paragraph.buildParagraph(init);
41
43
  this.body.children.splice(bodyInsertionPoint(this.body), 0, paragraphElement);
42
- return new require_edit_docx_paragraph.DocxParagraph(this.body.children, paragraphElement, this.imageContext);
44
+ return new require_edit_docx_paragraph.DocxParagraph(this.body.children, paragraphElement, this.imageContext, this.pkg);
43
45
  }
44
46
  insertParagraphAt(index, init) {
45
47
  const paragraphElement = require_edit_docx_paragraph.buildParagraph(init);
46
48
  const indices = bodyElementIndicesByTag(this.body, "w:p");
47
49
  const insertAt = index < indices.length ? indices[index] ?? bodyInsertionPoint(this.body) : bodyInsertionPoint(this.body);
48
50
  this.body.children.splice(insertAt, 0, paragraphElement);
49
- return new require_edit_docx_paragraph.DocxParagraph(this.body.children, paragraphElement, this.imageContext);
51
+ return new require_edit_docx_paragraph.DocxParagraph(this.body.children, paragraphElement, this.imageContext, this.pkg);
50
52
  }
51
53
  appendTable(init) {
52
54
  const tableElement = require_edit_docx_table.buildTable(init);
@@ -75,7 +77,7 @@ var DocxEditor = class {
75
77
  mediaDir: MEDIA_DIR
76
78
  }
77
79
  };
78
- this.body = new DocxBodyImpl(body, imageContext);
80
+ this.body = new DocxBodyImpl(body, imageContext, this.pkg);
79
81
  }
80
82
  paragraphs() {
81
83
  const documentRoot = findDocumentRoot(this.pkg);
@@ -31,21 +31,23 @@ function bodyElementIndicesByTag(body, tag) {
31
31
  var DocxBodyImpl = class {
32
32
  body;
33
33
  imageContext;
34
- constructor(body, imageContext) {
34
+ pkg;
35
+ constructor(body, imageContext, pkg) {
35
36
  this.body = body;
36
37
  this.imageContext = imageContext;
38
+ this.pkg = pkg;
37
39
  }
38
40
  appendParagraph(init) {
39
41
  const paragraphElement = buildParagraph(init);
40
42
  this.body.children.splice(bodyInsertionPoint(this.body), 0, paragraphElement);
41
- return new DocxParagraph(this.body.children, paragraphElement, this.imageContext);
43
+ return new DocxParagraph(this.body.children, paragraphElement, this.imageContext, this.pkg);
42
44
  }
43
45
  insertParagraphAt(index, init) {
44
46
  const paragraphElement = buildParagraph(init);
45
47
  const indices = bodyElementIndicesByTag(this.body, "w:p");
46
48
  const insertAt = index < indices.length ? indices[index] ?? bodyInsertionPoint(this.body) : bodyInsertionPoint(this.body);
47
49
  this.body.children.splice(insertAt, 0, paragraphElement);
48
- return new DocxParagraph(this.body.children, paragraphElement, this.imageContext);
50
+ return new DocxParagraph(this.body.children, paragraphElement, this.imageContext, this.pkg);
49
51
  }
50
52
  appendTable(init) {
51
53
  const tableElement = buildTable(init);
@@ -74,7 +76,7 @@ var DocxEditor = class {
74
76
  mediaDir: MEDIA_DIR
75
77
  }
76
78
  };
77
- this.body = new DocxBodyImpl(body, imageContext);
79
+ this.body = new DocxBodyImpl(body, imageContext, this.pkg);
78
80
  }
79
81
  paragraphs() {
80
82
  const documentRoot = findDocumentRoot(this.pkg);
@@ -1,5 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_xml_fragment = require("../../xml/fragment.cjs");
3
+ const require_opc_rels = require("../../opc/rels.cjs");
3
4
  const require_omml_write = require("../../omml/write.cjs");
4
5
  const require_model_units = require("../../model/units.cjs");
5
6
  const require_xml_edit = require("../../xml/edit.cjs");
@@ -16,11 +17,13 @@ var DocxParagraph = class {
16
17
  container;
17
18
  node;
18
19
  imageContext;
20
+ pkg;
19
21
  removed = false;
20
- constructor(container, node, imageContext) {
22
+ constructor(container, node, imageContext, pkg) {
21
23
  this.container = container;
22
24
  this.node = node;
23
25
  this.imageContext = imageContext;
26
+ this.pkg = pkg;
24
27
  }
25
28
  live() {
26
29
  if (this.removed) throw new Error("this DocxParagraph has been removed from its body and can no longer be used");
@@ -232,6 +235,19 @@ var DocxParagraph = class {
232
235
  const run = require_xml_fragment.el("w:r", {}, [drawing]);
233
236
  node.children.push(run);
234
237
  }
238
+ wrapLastRunInHyperlink(url) {
239
+ if (this.pkg === void 0) return;
240
+ const node = this.live();
241
+ const lastChildIndex = node.children.length - 1;
242
+ const lastChild = node.children[lastChildIndex];
243
+ if (lastChild?.type !== "element" || lastChild?.tag !== "w:r") return;
244
+ const rId = require_opc_rels.addRelationship(this.pkg, "word/document.xml", {
245
+ type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
246
+ target: url,
247
+ targetMode: "External"
248
+ });
249
+ node.children[lastChildIndex] = require_xml_fragment.el("w:hyperlink", { "r:id": rId }, [lastChild]);
250
+ }
235
251
  remove() {
236
252
  require_xml_edit.removeChild(this.container, this.live());
237
253
  this.removed = true;
@@ -19,8 +19,9 @@ declare class DocxParagraph {
19
19
  private readonly container;
20
20
  private readonly node;
21
21
  private readonly imageContext;
22
+ private readonly pkg;
22
23
  private removed;
23
- constructor(container: XmlNode[], node: XmlElement, imageContext?: ImageMediaContext);
24
+ constructor(container: XmlNode[], node: XmlElement, imageContext?: ImageMediaContext, pkg?: Package);
24
25
  private live;
25
26
  private pPr;
26
27
  get text(): string;
@@ -51,6 +52,7 @@ declare class DocxParagraph {
51
52
  };
52
53
  appendVectorAnchors(vectors: readonly ContentVector[]): void;
53
54
  insertImageAfter(image: ImageInit): void;
55
+ wrapLastRunInHyperlink(url: string): void;
54
56
  remove(): void;
55
57
  }
56
58
  declare function buildParagraph(init?: ParagraphInit): XmlElement;
@@ -19,8 +19,9 @@ declare class DocxParagraph {
19
19
  private readonly container;
20
20
  private readonly node;
21
21
  private readonly imageContext;
22
+ private readonly pkg;
22
23
  private removed;
23
- constructor(container: XmlNode[], node: XmlElement, imageContext?: ImageMediaContext);
24
+ constructor(container: XmlNode[], node: XmlElement, imageContext?: ImageMediaContext, pkg?: Package);
24
25
  private live;
25
26
  private pPr;
26
27
  get text(): string;
@@ -51,6 +52,7 @@ declare class DocxParagraph {
51
52
  };
52
53
  appendVectorAnchors(vectors: readonly ContentVector[]): void;
53
54
  insertImageAfter(image: ImageInit): void;
55
+ wrapLastRunInHyperlink(url: string): void;
54
56
  remove(): void;
55
57
  }
56
58
  declare function buildParagraph(init?: ParagraphInit): XmlElement;
@@ -1,4 +1,5 @@
1
1
  import { el } from "../../xml/fragment.js";
2
+ import { addRelationship } from "../../opc/rels.js";
2
3
  import { buildOfficeMathParagraph } from "../../omml/write.js";
3
4
  import { ptToTwips, twipsToPt } from "../../model/units.js";
4
5
  import { getOrCreateChildElement, removeAttr, removeChild, setAttr } from "../../xml/edit.js";
@@ -15,11 +16,13 @@ var DocxParagraph = class {
15
16
  container;
16
17
  node;
17
18
  imageContext;
19
+ pkg;
18
20
  removed = false;
19
- constructor(container, node, imageContext) {
21
+ constructor(container, node, imageContext, pkg) {
20
22
  this.container = container;
21
23
  this.node = node;
22
24
  this.imageContext = imageContext;
25
+ this.pkg = pkg;
23
26
  }
24
27
  live() {
25
28
  if (this.removed) throw new Error("this DocxParagraph has been removed from its body and can no longer be used");
@@ -231,6 +234,19 @@ var DocxParagraph = class {
231
234
  const run = el("w:r", {}, [drawing]);
232
235
  node.children.push(run);
233
236
  }
237
+ wrapLastRunInHyperlink(url) {
238
+ if (this.pkg === void 0) return;
239
+ const node = this.live();
240
+ const lastChildIndex = node.children.length - 1;
241
+ const lastChild = node.children[lastChildIndex];
242
+ if (lastChild?.type !== "element" || lastChild?.tag !== "w:r") return;
243
+ const rId = addRelationship(this.pkg, "word/document.xml", {
244
+ type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
245
+ target: url,
246
+ targetMode: "External"
247
+ });
248
+ node.children[lastChildIndex] = el("w:hyperlink", { "r:id": rId }, [lastChild]);
249
+ }
234
250
  remove() {
235
251
  removeChild(this.container, this.live());
236
252
  this.removed = true;
@@ -1,5 +1,5 @@
1
1
  import { t as ImageInit } from "../../image-M5SezZVI.cjs";
2
- import { t as OdpShape } from "../../shape-Dch9pDCf.cjs";
2
+ import { t as OdpShape } from "../../shape-lA-bEGqk.cjs";
3
3
  import { a as OdgLineVector, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "../../vector-D03KX8Ux.cjs";
4
4
  import { Box, ContentVector } from "document-schema.js";
5
5
  import { Package, XmlElement, XmlNode } from "odf.js";
@@ -1,5 +1,5 @@
1
1
  import { t as ImageInit } from "../../image-DHcA9kaK.js";
2
- import { t as OdpShape } from "../../shape-DyviC6ZG.js";
2
+ import { t as OdpShape } from "../../shape-DFO5259y.js";
3
3
  import { a as OdgLineVector, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "../../vector-D03KX8Ux.js";
4
4
  import { Box, ContentVector } from "document-schema.js";
5
5
  import { Package, XmlElement, XmlNode } from "odf.js";
@@ -1,2 +1,2 @@
1
- import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-Dch9pDCf.cjs";
1
+ import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-lA-bEGqk.cjs";
2
2
  export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
@@ -1,2 +1,2 @@
1
- import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-DyviC6ZG.js";
1
+ import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-DFO5259y.js";
2
2
  export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
@@ -1,8 +1,8 @@
1
1
  import { t as Box$1 } from "../../geometry-DaJr8yQW.cjs";
2
2
  import { t as ImageInit } from "../../image-M5SezZVI.cjs";
3
- import { t as OdpShape } from "../../shape-Dch9pDCf.cjs";
3
+ import { t as OdpShape } from "../../shape-lA-bEGqk.cjs";
4
4
  import { s as OdgVector } from "../../vector-D03KX8Ux.cjs";
5
- import { a as TableInit, n as OdtTable } from "../../table-BtMtRYqc.cjs";
5
+ import { a as TableInit, n as OdtTable } from "../../table-CNrk1jGM.cjs";
6
6
  import { ContentVector } from "document-schema.js";
7
7
  import { Package, XmlElement, XmlNode } from "odf.js";
8
8
  //#region src/edit/odp/slide.d.ts
@@ -1,8 +1,8 @@
1
1
  import { t as Box$1 } from "../../geometry-DaJr8yQW.js";
2
2
  import { t as ImageInit } from "../../image-DHcA9kaK.js";
3
- import { t as OdpShape } from "../../shape-DyviC6ZG.js";
3
+ import { t as OdpShape } from "../../shape-DFO5259y.js";
4
4
  import { s as OdgVector } from "../../vector-D03KX8Ux.js";
5
- import { a as TableInit, n as OdtTable } from "../../table-BxeHHD7r.js";
5
+ import { a as TableInit, n as OdtTable } from "../../table-BRXbauz6.js";
6
6
  import { ContentVector } from "document-schema.js";
7
7
  import { Package, XmlElement, XmlNode } from "odf.js";
8
8
  //#region src/edit/odp/slide.d.ts
@@ -108,6 +108,7 @@ function populateParagraph(paragraph, block) {
108
108
  if (run.fontFamily !== void 0) odtRun.fontFamily = run.fontFamily;
109
109
  if (run.sizePt !== void 0) odtRun.sizePt = run.sizePt;
110
110
  if (run.color !== void 0) odtRun.color = run.color;
111
+ if (run.hyperlink !== void 0) paragraph.wrapLastRunInHyperlink(run.hyperlink);
111
112
  }
112
113
  }
113
114
  function populateCellBlocks(cell, blocks) {
@@ -1,6 +1,6 @@
1
1
  import { ClockPort } from "../../ports/clock.cjs";
2
- import { t as OdtParagraph } from "../../paragraph-DXIJfPMw.cjs";
3
- import { n as OdtTable } from "../../table-BtMtRYqc.cjs";
2
+ import { t as OdtParagraph } from "../../paragraph-BlN-ErQS.cjs";
3
+ import { n as OdtTable } from "../../table-CNrk1jGM.cjs";
4
4
  import { ContentDocument, ContentParagraph, ContentTable } from "document-schema.js";
5
5
  import { Package } from "odf.js";
6
6
  //#region src/edit/odt/content.d.ts
@@ -1,6 +1,6 @@
1
1
  import { ClockPort } from "../../ports/clock.js";
2
- import { t as OdtParagraph } from "../../paragraph-DV4_ZNGr.js";
3
- import { n as OdtTable } from "../../table-BxeHHD7r.js";
2
+ import { t as OdtParagraph } from "../../paragraph-Bz20facN.js";
3
+ import { n as OdtTable } from "../../table-BRXbauz6.js";
4
4
  import { ContentDocument, ContentParagraph, ContentTable } from "document-schema.js";
5
5
  import { Package } from "odf.js";
6
6
  //#region src/edit/odt/content.d.ts
@@ -107,6 +107,7 @@ function populateParagraph(paragraph, block) {
107
107
  if (run.fontFamily !== void 0) odtRun.fontFamily = run.fontFamily;
108
108
  if (run.sizePt !== void 0) odtRun.sizePt = run.sizePt;
109
109
  if (run.color !== void 0) odtRun.color = run.color;
110
+ if (run.hyperlink !== void 0) paragraph.wrapLastRunInHyperlink(run.hyperlink);
110
111
  }
111
112
  }
112
113
  function populateCellBlocks(cell, blocks) {
@@ -1,8 +1,8 @@
1
1
  import { ClockPort } from "../../ports/clock.cjs";
2
2
  import { t as Box$1 } from "../../geometry-DaJr8yQW.cjs";
3
- import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-DXIJfPMw.cjs";
4
- import { t as OdtList } from "../../list-CxoEJwNO.cjs";
5
- import { a as TableInit, n as OdtTable } from "../../table-BtMtRYqc.cjs";
3
+ import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-BlN-ErQS.cjs";
4
+ import { t as OdtList } from "../../list-fKlr6jWd.cjs";
5
+ import { a as TableInit, n as OdtTable } from "../../table-CNrk1jGM.cjs";
6
6
  import { ContentFormula, ContentVector } from "document-schema.js";
7
7
  import { Package } from "odf.js";
8
8
  //#region src/edit/odt/editor.d.ts
@@ -1,8 +1,8 @@
1
1
  import { ClockPort } from "../../ports/clock.js";
2
2
  import { t as Box$1 } from "../../geometry-DaJr8yQW.js";
3
- import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-DV4_ZNGr.js";
4
- import { t as OdtList } from "../../list-DA1hCBVI.js";
5
- import { a as TableInit, n as OdtTable } from "../../table-BxeHHD7r.js";
3
+ import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-Bz20facN.js";
4
+ import { t as OdtList } from "../../list-4lN_90Pt.js";
5
+ import { a as TableInit, n as OdtTable } from "../../table-BRXbauz6.js";
6
6
  import { ContentFormula, ContentVector } from "document-schema.js";
7
7
  import { Package } from "odf.js";
8
8
  //#region src/edit/odt/editor.d.ts
@@ -1,2 +1,2 @@
1
- import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-CxoEJwNO.cjs";
1
+ import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-fKlr6jWd.cjs";
2
2
  export { OdtList, OdtListItem, buildList };
@@ -1,2 +1,2 @@
1
- import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-DA1hCBVI.js";
1
+ import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-4lN_90Pt.js";
2
2
  export { OdtList, OdtListItem, buildList };
@@ -36,6 +36,16 @@ var OdtParagraph = class {
36
36
  node.children.push(span);
37
37
  return new require_edit_odt_run.OdtRun(node.children, span, this.pkg);
38
38
  }
39
+ wrapLastRunInHyperlink(url) {
40
+ const node = this.live();
41
+ const lastChildIndex = node.children.length - 1;
42
+ const lastChild = node.children[lastChildIndex];
43
+ if (lastChild?.type !== "element" || lastChild?.tag !== "text:span") return;
44
+ node.children[lastChildIndex] = require_xml_fragment.el("text:a", {
45
+ "xlink:href": url,
46
+ "xlink:type": "simple"
47
+ }, [lastChild]);
48
+ }
39
49
  appendTab() {
40
50
  this.live().children.push(require_xml_fragment.el("text:tab"));
41
51
  }
@@ -1,2 +1,2 @@
1
- import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-DXIJfPMw.cjs";
1
+ import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-BlN-ErQS.cjs";
2
2
  export { OdtParagraph, ParagraphInit, buildParagraph };
@@ -1,2 +1,2 @@
1
- import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-DV4_ZNGr.js";
1
+ import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-Bz20facN.js";
2
2
  export { OdtParagraph, ParagraphInit, buildParagraph };
@@ -35,6 +35,16 @@ var OdtParagraph = class {
35
35
  node.children.push(span);
36
36
  return new OdtRun(node.children, span, this.pkg);
37
37
  }
38
+ wrapLastRunInHyperlink(url) {
39
+ const node = this.live();
40
+ const lastChildIndex = node.children.length - 1;
41
+ const lastChild = node.children[lastChildIndex];
42
+ if (lastChild?.type !== "element" || lastChild?.tag !== "text:span") return;
43
+ node.children[lastChildIndex] = el("text:a", {
44
+ "xlink:href": url,
45
+ "xlink:type": "simple"
46
+ }, [lastChild]);
47
+ }
38
48
  appendTab() {
39
49
  this.live().children.push(el("text:tab"));
40
50
  }
@@ -1,2 +1,2 @@
1
- import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-BtMtRYqc.cjs";
1
+ import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-CNrk1jGM.cjs";
2
2
  export { CellDecoration, OdtTable, OdtTableCell, OdtTableRow, TableInit, buildCellStyle, buildTable, readCellDecoration };
@@ -1,2 +1,2 @@
1
- import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-BxeHHD7r.js";
1
+ import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-BRXbauz6.js";
2
2
  export { CellDecoration, OdtTable, OdtTableCell, OdtTableRow, TableInit, buildCellStyle, buildTable, readCellDecoration };
@@ -46,13 +46,13 @@ function appendShape(slide, shape) {
46
46
  columns: onlyBlock.columnWidthsPt.length,
47
47
  columnWidthsPt: onlyBlock.columnWidthsPt
48
48
  }
49
- }), onlyBlock);
49
+ }), onlyBlock, (url) => slide.registerHyperlink(url));
50
50
  return;
51
51
  }
52
52
  const paragraphs = [];
53
53
  for (const block of shape.blocks) {
54
54
  if (block.kind !== "paragraph") continue;
55
- paragraphs.push(paragraphInitFromBlock(block));
55
+ paragraphs.push(paragraphInitFromBlock(block, (url) => slide.registerHyperlink(url)));
56
56
  }
57
57
  const textBox = slide.addTextBox({
58
58
  frame: shape.frame,
@@ -66,7 +66,7 @@ function appendShape(slide, shape) {
66
66
  textBox.insetBottomPt = shape.insetBottomPt;
67
67
  textBox.setParagraphs(paragraphs);
68
68
  }
69
- function paragraphInitFromBlock(block) {
69
+ function paragraphInitFromBlock(block, resolveHyperlinkRId) {
70
70
  return {
71
71
  alignment: block.alignment,
72
72
  spacingBeforePt: block.spacingBeforePt,
@@ -82,19 +82,20 @@ function paragraphInitFromBlock(block) {
82
82
  strike: run.strike,
83
83
  fontFamily: run.fontFamily,
84
84
  sizePt: run.sizePt,
85
- color: run.color
85
+ color: run.color,
86
+ hyperlinkRId: run.hyperlink !== void 0 && resolveHyperlinkRId !== void 0 ? resolveHyperlinkRId(run.hyperlink) : void 0
86
87
  }))
87
88
  };
88
89
  }
89
- function populateCellParagraphs(cell, blocks) {
90
+ function populateCellParagraphs(cell, blocks, resolveHyperlinkRId) {
90
91
  const paragraphs = [];
91
92
  for (const block of blocks) {
92
93
  if (block.kind !== "paragraph") continue;
93
- paragraphs.push(paragraphInitFromBlock(block));
94
+ paragraphs.push(paragraphInitFromBlock(block, resolveHyperlinkRId));
94
95
  }
95
96
  cell.setParagraphs(paragraphs);
96
97
  }
97
- function populatePptxTable(table, block) {
98
+ function populatePptxTable(table, block, resolveHyperlinkRId) {
98
99
  const verticalMerges = /* @__PURE__ */ new Map();
99
100
  block.rows.forEach((row, rowIndex) => {
100
101
  let horizontalCoverRemaining = 0;
@@ -125,7 +126,7 @@ function populatePptxTable(table, block) {
125
126
  }
126
127
  if (cell.background !== void 0) tableCell.background = cell.background;
127
128
  if (cell.borders !== void 0) tableCell.borders = cell.borders;
128
- populateCellParagraphs(tableCell, cell.blocks);
129
+ populateCellParagraphs(tableCell, cell.blocks, resolveHyperlinkRId);
129
130
  });
130
131
  });
131
132
  }
@@ -45,13 +45,13 @@ function appendShape(slide, shape) {
45
45
  columns: onlyBlock.columnWidthsPt.length,
46
46
  columnWidthsPt: onlyBlock.columnWidthsPt
47
47
  }
48
- }), onlyBlock);
48
+ }), onlyBlock, (url) => slide.registerHyperlink(url));
49
49
  return;
50
50
  }
51
51
  const paragraphs = [];
52
52
  for (const block of shape.blocks) {
53
53
  if (block.kind !== "paragraph") continue;
54
- paragraphs.push(paragraphInitFromBlock(block));
54
+ paragraphs.push(paragraphInitFromBlock(block, (url) => slide.registerHyperlink(url)));
55
55
  }
56
56
  const textBox = slide.addTextBox({
57
57
  frame: shape.frame,
@@ -65,7 +65,7 @@ function appendShape(slide, shape) {
65
65
  textBox.insetBottomPt = shape.insetBottomPt;
66
66
  textBox.setParagraphs(paragraphs);
67
67
  }
68
- function paragraphInitFromBlock(block) {
68
+ function paragraphInitFromBlock(block, resolveHyperlinkRId) {
69
69
  return {
70
70
  alignment: block.alignment,
71
71
  spacingBeforePt: block.spacingBeforePt,
@@ -81,19 +81,20 @@ function paragraphInitFromBlock(block) {
81
81
  strike: run.strike,
82
82
  fontFamily: run.fontFamily,
83
83
  sizePt: run.sizePt,
84
- color: run.color
84
+ color: run.color,
85
+ hyperlinkRId: run.hyperlink !== void 0 && resolveHyperlinkRId !== void 0 ? resolveHyperlinkRId(run.hyperlink) : void 0
85
86
  }))
86
87
  };
87
88
  }
88
- function populateCellParagraphs(cell, blocks) {
89
+ function populateCellParagraphs(cell, blocks, resolveHyperlinkRId) {
89
90
  const paragraphs = [];
90
91
  for (const block of blocks) {
91
92
  if (block.kind !== "paragraph") continue;
92
- paragraphs.push(paragraphInitFromBlock(block));
93
+ paragraphs.push(paragraphInitFromBlock(block, resolveHyperlinkRId));
93
94
  }
94
95
  cell.setParagraphs(paragraphs);
95
96
  }
96
- function populatePptxTable(table, block) {
97
+ function populatePptxTable(table, block, resolveHyperlinkRId) {
97
98
  const verticalMerges = /* @__PURE__ */ new Map();
98
99
  block.rows.forEach((row, rowIndex) => {
99
100
  let horizontalCoverRemaining = 0;
@@ -124,7 +125,7 @@ function populatePptxTable(table, block) {
124
125
  }
125
126
  if (cell.background !== void 0) tableCell.background = cell.background;
126
127
  if (cell.borders !== void 0) tableCell.borders = cell.borders;
127
- populateCellParagraphs(tableCell, cell.blocks);
128
+ populateCellParagraphs(tableCell, cell.blocks, resolveHyperlinkRId);
128
129
  });
129
130
  });
130
131
  }
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_model_metadata = require("../../model/metadata.cjs");
3
3
  const require_ports_clock = require("../../ports/clock.cjs");
4
4
  const require_xml_fragment = require("../../xml/fragment.cjs");
5
- const require_model_units = require("../../model/units.cjs");
6
5
  const require_opc_paths = require("../../opc/paths.cjs");
7
6
  const require_opc_rels = require("../../opc/rels.cjs");
7
+ const require_model_units = require("../../model/units.cjs");
8
8
  const require_opc_content_types = require("../../opc/content-types.cjs");
9
9
  const require_edit_pptx_scaffold = require("./scaffold.cjs");
10
10
  const require_edit_pptx_slide = require("./slide.cjs");
@@ -1,9 +1,9 @@
1
1
  import { resolveMetadataTimestamps } from "../../model/metadata.js";
2
2
  import { systemClock } from "../../ports/clock.js";
3
3
  import { el } from "../../xml/fragment.js";
4
- import { emuToPt, ptToEmu } from "../../model/units.js";
5
4
  import { buildRelativeTarget } from "../../opc/paths.js";
6
5
  import { addRelationship } from "../../opc/rels.js";
6
+ import { emuToPt, ptToEmu } from "../../model/units.js";
7
7
  import { ensureContentTypeOverride } from "../../opc/content-types.js";
8
8
  import { DML_NS, PML_NS, R_NS, SLIDE_LAYOUT_PART_PATH, SLIDE_LAYOUT_REL_TYPE, buildEmptyGroupSpTree, createEmptyPptxPackage } from "./scaffold.js";
9
9
  import { PptxSlide } from "./slide.js";
@@ -218,6 +218,7 @@ function buildDrawingRun(init) {
218
218
  const rPrChildren = [];
219
219
  if (init.color !== void 0) rPrChildren.push(require_xml_fragment.el("a:solidFill", {}, [require_xml_fragment.el("a:srgbClr", { val: require_edit_drawingml_vector.drawingMlColorHex(init.color) })]));
220
220
  if (init.fontFamily !== void 0) rPrChildren.push(require_xml_fragment.el("a:latin", { typeface: init.fontFamily }));
221
+ if (init.hyperlinkRId !== void 0) rPrChildren.push(require_xml_fragment.el("a:hlinkClick", { "r:id": init.hyperlinkRId }));
221
222
  const rPr = Object.keys(rPrAttrs).length > 0 || rPrChildren.length > 0 ? [require_xml_fragment.el("a:rPr", rPrAttrs, rPrChildren)] : [];
222
223
  const tAttrs = require_xml_entities.needsSpacePreserve(init.text) ? { "xml:space": "preserve" } : {};
223
224
  return require_xml_fragment.el("a:r", {}, [...rPr, require_xml_fragment.el("a:t", tAttrs, [require_xml_fragment.txt(require_xml_entities.encodeXmlText(init.text))])]);
@@ -1,2 +1,2 @@
1
- import { a as buildDrawingParagraph, i as ROTATION_UNITS_PER_DEGREE, n as DrawingRunInit, o as buildPictureShape, r as PptxShape, s as buildTextBoxShape, t as DrawingParagraphInit } from "../../shape-CIIpuHNp.cjs";
1
+ import { a as buildDrawingParagraph, i as ROTATION_UNITS_PER_DEGREE, n as DrawingRunInit, o as buildPictureShape, r as PptxShape, s as buildTextBoxShape, t as DrawingParagraphInit } from "../../shape-CoiqTTA-.cjs";
2
2
  export { DrawingParagraphInit, DrawingRunInit, PptxShape, ROTATION_UNITS_PER_DEGREE, buildDrawingParagraph, buildPictureShape, buildTextBoxShape };
@@ -1,2 +1,2 @@
1
- import { a as buildDrawingParagraph, i as ROTATION_UNITS_PER_DEGREE, n as DrawingRunInit, o as buildPictureShape, r as PptxShape, s as buildTextBoxShape, t as DrawingParagraphInit } from "../../shape-DU4GMETm.js";
1
+ import { a as buildDrawingParagraph, i as ROTATION_UNITS_PER_DEGREE, n as DrawingRunInit, o as buildPictureShape, r as PptxShape, s as buildTextBoxShape, t as DrawingParagraphInit } from "../../shape-C3NECkae.js";
2
2
  export { DrawingParagraphInit, DrawingRunInit, PptxShape, ROTATION_UNITS_PER_DEGREE, buildDrawingParagraph, buildPictureShape, buildTextBoxShape };
@@ -217,6 +217,7 @@ function buildDrawingRun(init) {
217
217
  const rPrChildren = [];
218
218
  if (init.color !== void 0) rPrChildren.push(el("a:solidFill", {}, [el("a:srgbClr", { val: drawingMlColorHex(init.color) })]));
219
219
  if (init.fontFamily !== void 0) rPrChildren.push(el("a:latin", { typeface: init.fontFamily }));
220
+ if (init.hyperlinkRId !== void 0) rPrChildren.push(el("a:hlinkClick", { "r:id": init.hyperlinkRId }));
220
221
  const rPr = Object.keys(rPrAttrs).length > 0 || rPrChildren.length > 0 ? [el("a:rPr", rPrAttrs, rPrChildren)] : [];
221
222
  const tAttrs = needsSpacePreserve(init.text) ? { "xml:space": "preserve" } : {};
222
223
  return el("a:r", {}, [...rPr, el("a:t", tAttrs, [txt(encodeXmlText(init.text))])]);
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_xml_fragment = require("../../xml/fragment.cjs");
3
- const require_xml_entities = require("../../xml/entities.cjs");
4
- const require_xml_edit = require("../../xml/edit.cjs");
5
3
  const require_opc_paths = require("../../opc/paths.cjs");
6
4
  const require_opc_rels = require("../../opc/rels.cjs");
5
+ const require_xml_entities = require("../../xml/entities.cjs");
6
+ const require_xml_edit = require("../../xml/edit.cjs");
7
7
  const require_opc_content_types = require("../../opc/content-types.cjs");
8
8
  const require_edit_pptx_scaffold = require("./scaffold.cjs");
9
9
  const require_edit_pptx_shape = require("./shape.cjs");
@@ -163,6 +163,13 @@ var PptxSlide = class {
163
163
  nodes: [buildMinimalNotesSlide(value)]
164
164
  };
165
165
  }
166
+ registerHyperlink(url) {
167
+ return require_opc_rels.addRelationship(this.context.pkg, this.context.slidePartPath, {
168
+ type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
169
+ target: url,
170
+ targetMode: "External"
171
+ });
172
+ }
166
173
  remove() {
167
174
  require_xml_edit.removeChild(this.container, this.live());
168
175
  this.removed = true;
@@ -1,7 +1,7 @@
1
1
  import { t as Box$1 } from "../../geometry-DaJr8yQW.cjs";
2
2
  import { t as ImageInit } from "../../image-7snmKIxn.cjs";
3
- import { r as PptxShape } from "../../shape-CIIpuHNp.cjs";
4
- import { r as PptxTableInit, t as PptxTable } from "../../table-C2dxbmvn.cjs";
3
+ import { r as PptxShape } from "../../shape-CoiqTTA-.cjs";
4
+ import { r as PptxTableInit, t as PptxTable } from "../../table-CjUjLcsE.cjs";
5
5
  import { ContentVector } from "document-schema.js";
6
6
  import { Package, XmlElement, XmlNode } from "ooxml.js";
7
7
  //#region src/edit/pptx/slide.d.ts
@@ -37,6 +37,7 @@ declare class PptxSlide {
37
37
  addTable(init: SlideTableInit): PptxTable;
38
38
  get notes(): string;
39
39
  set notes(value: string);
40
+ registerHyperlink(url: string): string;
40
41
  remove(): void;
41
42
  }
42
43
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { t as Box$1 } from "../../geometry-DaJr8yQW.js";
2
2
  import { t as ImageInit } from "../../image-Cs8xF753.js";
3
- import { r as PptxShape } from "../../shape-DU4GMETm.js";
4
- import { r as PptxTableInit, t as PptxTable } from "../../table-DOce3xA6.js";
3
+ import { r as PptxShape } from "../../shape-C3NECkae.js";
4
+ import { r as PptxTableInit, t as PptxTable } from "../../table-DV-Glhx_.js";
5
5
  import { Package, XmlElement, XmlNode } from "ooxml.js";
6
6
  import { ContentVector } from "document-schema.js";
7
7
  //#region src/edit/pptx/slide.d.ts
@@ -37,6 +37,7 @@ declare class PptxSlide {
37
37
  addTable(init: SlideTableInit): PptxTable;
38
38
  get notes(): string;
39
39
  set notes(value: string);
40
+ registerHyperlink(url: string): string;
40
41
  remove(): void;
41
42
  }
42
43
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { el, txt } from "../../xml/fragment.js";
2
- import { encodeXmlText } from "../../xml/entities.js";
3
- import { removeChild } from "../../xml/edit.js";
4
2
  import { buildRelativeTarget } from "../../opc/paths.js";
5
3
  import { addRelationship } from "../../opc/rels.js";
4
+ import { encodeXmlText } from "../../xml/entities.js";
5
+ import { removeChild } from "../../xml/edit.js";
6
6
  import { ensureContentTypeOverride } from "../../opc/content-types.js";
7
7
  import { DML_NS, NOTES_MASTER_REL_TYPE, PML_NS, buildEmptyGroupSpTree, ensureNotesMaster } from "./scaffold.js";
8
8
  import { PptxShape, buildTextBoxShape } from "./shape.js";
@@ -162,6 +162,13 @@ var PptxSlide = class {
162
162
  nodes: [buildMinimalNotesSlide(value)]
163
163
  };
164
164
  }
165
+ registerHyperlink(url) {
166
+ return addRelationship(this.context.pkg, this.context.slidePartPath, {
167
+ type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
168
+ target: url,
169
+ targetMode: "External"
170
+ });
171
+ }
165
172
  remove() {
166
173
  removeChild(this.container, this.live());
167
174
  this.removed = true;
@@ -1,2 +1,2 @@
1
- import { a as buildDrawingTable, i as PptxTableRow, n as PptxTableCell, o as buildTableGraphicFrame, r as PptxTableInit, s as findGraphicFrameTable, t as PptxTable } from "../../table-C2dxbmvn.cjs";
1
+ import { a as buildDrawingTable, i as PptxTableRow, n as PptxTableCell, o as buildTableGraphicFrame, r as PptxTableInit, s as findGraphicFrameTable, t as PptxTable } from "../../table-CjUjLcsE.cjs";
2
2
  export { PptxTable, PptxTableCell, PptxTableInit, PptxTableRow, buildDrawingTable, buildTableGraphicFrame, findGraphicFrameTable };
@@ -1,2 +1,2 @@
1
- import { a as buildDrawingTable, i as PptxTableRow, n as PptxTableCell, o as buildTableGraphicFrame, r as PptxTableInit, s as findGraphicFrameTable, t as PptxTable } from "../../table-DOce3xA6.js";
1
+ import { a as buildDrawingTable, i as PptxTableRow, n as PptxTableCell, o as buildTableGraphicFrame, r as PptxTableInit, s as findGraphicFrameTable, t as PptxTable } from "../../table-DV-Glhx_.js";
2
2
  export { PptxTable, PptxTableCell, PptxTableInit, PptxTableRow, buildDrawingTable, buildTableGraphicFrame, findGraphicFrameTable };
package/dist/index.d.cts CHANGED
@@ -27,15 +27,15 @@ import { CreateMarkdownEditorOptions, MarkdownBody, MarkdownEditor, createMarkdo
27
27
  import { BuildOdgPackageOptions, buildOdgPackage } from "./edit/odg/content.cjs";
28
28
  import { i as LayoutFont, r as DEFAULT_LAYOUT_FONT, t as Alignment } from "./style-DkamR3aY.cjs";
29
29
  import { n as RunInit$1, t as OdtRun } from "./run-DQtEGilU.cjs";
30
- import { n as ParagraphInit$1, t as OdtParagraph } from "./paragraph-DXIJfPMw.cjs";
31
- import { n as OdtListItem, t as OdtList } from "./list-CxoEJwNO.cjs";
32
- import { t as OdpShape } from "./shape-Dch9pDCf.cjs";
30
+ import { n as ParagraphInit$1, t as OdtParagraph } from "./paragraph-BlN-ErQS.cjs";
31
+ import { n as OdtListItem, t as OdtList } from "./list-fKlr6jWd.cjs";
32
+ import { t as OdpShape } from "./shape-lA-bEGqk.cjs";
33
33
  import { a as OdgLineVector, c as OdgVectorKind, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "./vector-D03KX8Ux.cjs";
34
34
  import { OdgPage, PageImageInit, TextBoxInit } from "./edit/odg/page.cjs";
35
35
  import { CreateOdgOptions, OdgEditor, createOdg, openOdg } from "./edit/odg/editor.cjs";
36
36
  import { CreateEmptyOdgPackageOptions } from "./edit/odg/scaffold.cjs";
37
37
  import { BuildOdpPackageOptions, buildOdpPackage } from "./edit/odp/content.cjs";
38
- import { a as TableInit$1, i as OdtTableRow, n as OdtTable, r as OdtTableCell } from "./table-BtMtRYqc.cjs";
38
+ import { a as TableInit$1, i as OdtTableRow, n as OdtTable, r as OdtTableCell } from "./table-CNrk1jGM.cjs";
39
39
  import { OdpSlide, SlideImageInit, SlideTableInit, TextBoxInit as TextBoxInit$1 } from "./edit/odp/slide.cjs";
40
40
  import { CreateOdpOptions, OdpEditor, createOdp, openOdp } from "./edit/odp/editor.cjs";
41
41
  import { CreateEmptyOdpPackageOptions } from "./edit/odp/scaffold.cjs";
@@ -51,8 +51,8 @@ import { a as PdfItem, c as PdfLinkInit, d as PdfPathItem, f as PdfRectInit, h a
51
51
  import { PageInit, PdfPage } from "./edit/pdf/page.cjs";
52
52
  import { CreatePdfOptions, PdfEditor, createPdf, openPdf } from "./edit/pdf/editor.cjs";
53
53
  import { BuildPptxPackageOptions, buildPptxPackage } from "./edit/pptx/content.cjs";
54
- import { n as DrawingRunInit, r as PptxShape, t as DrawingParagraphInit } from "./shape-CIIpuHNp.cjs";
55
- import { i as PptxTableRow, n as PptxTableCell, r as PptxTableInit, t as PptxTable } from "./table-C2dxbmvn.cjs";
54
+ import { n as DrawingRunInit, r as PptxShape, t as DrawingParagraphInit } from "./shape-CoiqTTA-.cjs";
55
+ import { i as PptxTableRow, n as PptxTableCell, r as PptxTableInit, t as PptxTable } from "./table-CjUjLcsE.cjs";
56
56
  import { PptxSlide, SlideImageInit as SlideImageInit$1, SlideTableInit as SlideTableInit$1, TextBoxInit as TextBoxInit$2 } from "./edit/pptx/slide.cjs";
57
57
  import { CreatePptxOptions, PptxEditor, createPptx, openPptx } from "./edit/pptx/editor.cjs";
58
58
  import { CreateEmptyPptxPackageOptions } from "./edit/pptx/scaffold.cjs";
package/dist/index.d.ts CHANGED
@@ -27,15 +27,15 @@ import { CreateMarkdownEditorOptions, MarkdownBody, MarkdownEditor, createMarkdo
27
27
  import { BuildOdgPackageOptions, buildOdgPackage } from "./edit/odg/content.js";
28
28
  import { i as LayoutFont, r as DEFAULT_LAYOUT_FONT, t as Alignment } from "./style-DkamR3aY.js";
29
29
  import { n as RunInit$1, t as OdtRun } from "./run-SLSPO-4y.js";
30
- import { n as ParagraphInit$1, t as OdtParagraph } from "./paragraph-DV4_ZNGr.js";
31
- import { n as OdtListItem, t as OdtList } from "./list-DA1hCBVI.js";
32
- import { t as OdpShape } from "./shape-DyviC6ZG.js";
30
+ import { n as ParagraphInit$1, t as OdtParagraph } from "./paragraph-Bz20facN.js";
31
+ import { n as OdtListItem, t as OdtList } from "./list-4lN_90Pt.js";
32
+ import { t as OdpShape } from "./shape-DFO5259y.js";
33
33
  import { a as OdgLineVector, c as OdgVectorKind, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "./vector-D03KX8Ux.js";
34
34
  import { OdgPage, PageImageInit, TextBoxInit } from "./edit/odg/page.js";
35
35
  import { CreateOdgOptions, OdgEditor, createOdg, openOdg } from "./edit/odg/editor.js";
36
36
  import { CreateEmptyOdgPackageOptions } from "./edit/odg/scaffold.js";
37
37
  import { BuildOdpPackageOptions, buildOdpPackage } from "./edit/odp/content.js";
38
- import { a as TableInit$1, i as OdtTableRow, n as OdtTable, r as OdtTableCell } from "./table-BxeHHD7r.js";
38
+ import { a as TableInit$1, i as OdtTableRow, n as OdtTable, r as OdtTableCell } from "./table-BRXbauz6.js";
39
39
  import { OdpSlide, SlideImageInit, SlideTableInit, TextBoxInit as TextBoxInit$1 } from "./edit/odp/slide.js";
40
40
  import { CreateOdpOptions, OdpEditor, createOdp, openOdp } from "./edit/odp/editor.js";
41
41
  import { CreateEmptyOdpPackageOptions } from "./edit/odp/scaffold.js";
@@ -51,8 +51,8 @@ import { a as PdfItem, c as PdfLinkInit, d as PdfPathItem, f as PdfRectInit, h a
51
51
  import { PageInit, PdfPage } from "./edit/pdf/page.js";
52
52
  import { CreatePdfOptions, PdfEditor, createPdf, openPdf } from "./edit/pdf/editor.js";
53
53
  import { BuildPptxPackageOptions, buildPptxPackage } from "./edit/pptx/content.js";
54
- import { n as DrawingRunInit, r as PptxShape, t as DrawingParagraphInit } from "./shape-DU4GMETm.js";
55
- import { i as PptxTableRow, n as PptxTableCell, r as PptxTableInit, t as PptxTable } from "./table-DOce3xA6.js";
54
+ import { n as DrawingRunInit, r as PptxShape, t as DrawingParagraphInit } from "./shape-C3NECkae.js";
55
+ import { i as PptxTableRow, n as PptxTableCell, r as PptxTableInit, t as PptxTable } from "./table-DV-Glhx_.js";
56
56
  import { PptxSlide, SlideImageInit as SlideImageInit$1, SlideTableInit as SlideTableInit$1, TextBoxInit as TextBoxInit$2 } from "./edit/pptx/slide.js";
57
57
  import { CreatePptxOptions, PptxEditor, createPptx, openPptx } from "./edit/pptx/editor.js";
58
58
  import { CreateEmptyPptxPackageOptions } from "./edit/pptx/scaffold.js";
@@ -1,4 +1,4 @@
1
- import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DV4_ZNGr.js";
1
+ import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-Bz20facN.js";
2
2
  import { Package, XmlElement, XmlNode } from "odf.js";
3
3
  //#region src/edit/odt/list.d.ts
4
4
  declare class OdtListItem {
@@ -1,4 +1,4 @@
1
- import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DXIJfPMw.cjs";
1
+ import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-BlN-ErQS.cjs";
2
2
  import { Package, XmlElement, XmlNode } from "odf.js";
3
3
  //#region src/edit/odt/list.d.ts
4
4
  declare class OdtListItem {
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_xml_fragment = require("../xml/fragment.cjs");
3
- const require_xml_entities = require("../xml/entities.cjs");
4
3
  const require_opc_rels = require("./rels.cjs");
4
+ const require_xml_entities = require("../xml/entities.cjs");
5
5
  const require_opc_content_types = require("./content-types.cjs");
6
6
  //#region src/opc/core-properties.ts
7
7
  const CORE_PROPERTIES_PART_PATH = "docProps/core.xml";
@@ -1,6 +1,6 @@
1
1
  import { el, txt } from "../xml/fragment.js";
2
- import { encodeXmlText } from "../xml/entities.js";
3
2
  import { addRootRelationship } from "./rels.js";
3
+ import { encodeXmlText } from "../xml/entities.js";
4
4
  import { ensureContentTypeOverride } from "./content-types.js";
5
5
  //#region src/opc/core-properties.ts
6
6
  const CORE_PROPERTIES_PART_PATH = "docProps/core.xml";
@@ -18,6 +18,7 @@ declare class OdtParagraph {
18
18
  get text(): string;
19
19
  runs(): OdtRun[];
20
20
  appendRun(init?: RunInit): OdtRun;
21
+ wrapLastRunInHyperlink(url: string): void;
21
22
  appendTab(): void;
22
23
  insertRunAt(index: number, init?: RunInit): OdtRun;
23
24
  get styleId(): string | undefined;
@@ -18,6 +18,7 @@ declare class OdtParagraph {
18
18
  get text(): string;
19
19
  runs(): OdtRun[];
20
20
  appendRun(init?: RunInit): OdtRun;
21
+ wrapLastRunInHyperlink(url: string): void;
21
22
  appendTab(): void;
22
23
  insertRunAt(index: number, init?: RunInit): OdtRun;
23
24
  get styleId(): string | undefined;
@@ -43,6 +43,7 @@ interface DrawingRunInit {
43
43
  readonly fontFamily?: string;
44
44
  readonly sizePt?: number;
45
45
  readonly color?: LayoutColor;
46
+ readonly hyperlinkRId?: string;
46
47
  }
47
48
  interface DrawingParagraphInit {
48
49
  readonly runs: readonly DrawingRunInit[];
@@ -43,6 +43,7 @@ interface DrawingRunInit {
43
43
  readonly fontFamily?: string;
44
44
  readonly sizePt?: number;
45
45
  readonly color?: LayoutColor;
46
+ readonly hyperlinkRId?: string;
46
47
  }
47
48
  interface DrawingParagraphInit {
48
49
  readonly runs: readonly DrawingRunInit[];
@@ -1,6 +1,6 @@
1
1
  import { t as Box } from "./geometry-DaJr8yQW.js";
2
- import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DV4_ZNGr.js";
3
- import { t as OdtList } from "./list-DA1hCBVI.js";
2
+ import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-Bz20facN.js";
3
+ import { t as OdtList } from "./list-4lN_90Pt.js";
4
4
  import { Package, XmlElement, XmlNode } from "odf.js";
5
5
  //#region src/edit/odp/shape.d.ts
6
6
  declare class OdpShape {
@@ -1,6 +1,6 @@
1
1
  import { t as Box } from "./geometry-DaJr8yQW.cjs";
2
- import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DXIJfPMw.cjs";
3
- import { t as OdtList } from "./list-CxoEJwNO.cjs";
2
+ import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-BlN-ErQS.cjs";
3
+ import { t as OdtList } from "./list-fKlr6jWd.cjs";
4
4
  import { Package, XmlElement, XmlNode } from "odf.js";
5
5
  //#region src/edit/odp/shape.d.ts
6
6
  declare class OdpShape {
@@ -1,4 +1,4 @@
1
- import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DV4_ZNGr.js";
1
+ import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-Bz20facN.js";
2
2
  import { Color, ContentCellBorders } from "document-schema.js";
3
3
  import { Package, XmlElement, XmlNode } from "odf.js";
4
4
  //#region src/edit/odt/table.d.ts
@@ -1,4 +1,4 @@
1
- import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DXIJfPMw.cjs";
1
+ import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-BlN-ErQS.cjs";
2
2
  import { Color, ContentCellBorders } from "document-schema.js";
3
3
  import { Package, XmlElement, XmlNode } from "odf.js";
4
4
  //#region src/edit/odt/table.d.ts
@@ -1,5 +1,5 @@
1
1
  import { t as Box$1 } from "./geometry-DaJr8yQW.cjs";
2
- import { t as DrawingParagraphInit } from "./shape-CIIpuHNp.cjs";
2
+ import { t as DrawingParagraphInit } from "./shape-CoiqTTA-.cjs";
3
3
  import { Color, ContentCellBorders } from "document-schema.js";
4
4
  import { XmlElement } from "ooxml.js";
5
5
  //#region src/edit/pptx/table.d.ts
@@ -1,5 +1,5 @@
1
1
  import { t as Box$1 } from "./geometry-DaJr8yQW.js";
2
- import { t as DrawingParagraphInit } from "./shape-DU4GMETm.js";
2
+ import { t as DrawingParagraphInit } from "./shape-C3NECkae.js";
3
3
  import { XmlElement } from "ooxml.js";
4
4
  import { Color, ContentCellBorders } from "document-schema.js";
5
5
  //#region src/edit/pptx/table.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js.documents",
3
- "version": "1.86.1",
3
+ "version": "1.87.1",
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": {
@@ -88,7 +88,7 @@
88
88
  },
89
89
  "scripts": {
90
90
  "build": "tsdown",
91
- "lint": "eslint . --max-warnings 0",
91
+ "lint": "eslint . --fix --cache --max-warnings 0",
92
92
  "typecheck": "tsc --noEmit",
93
93
  "test": "vitest run --project unit",
94
94
  "test:watch": "vitest --project unit",