docxmlater 7.2.1 → 7.2.3

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,26 +18,26 @@ function normalizeXmlOutput(xml) {
18
18
  }
19
19
  class DocumentGenerator {
20
20
  generateContentTypes() {
21
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
23
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
24
- <Default Extension="xml" ContentType="application/xml"/>
25
- <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
26
- <Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
27
- <Override PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/>
28
- <Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/>
29
- <Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/>
30
- <Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
31
- <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
32
- <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
21
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
23
+ <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
24
+ <Default Extension="xml" ContentType="application/xml"/>
25
+ <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
26
+ <Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
27
+ <Override PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/>
28
+ <Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/>
29
+ <Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/>
30
+ <Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
31
+ <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
32
+ <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
33
33
  </Types>`;
34
34
  }
35
35
  generateRels() {
36
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
37
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
38
- <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
39
- <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
40
- <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
36
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
37
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
38
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
39
+ <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
40
+ <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
41
41
  </Relationships>`;
42
42
  }
43
43
  generateDocumentXml(bodyElements, section, namespaces) {
@@ -60,43 +60,43 @@ class DocumentGenerator {
60
60
  const formatDate = (date) => {
61
61
  return date.toISOString();
62
62
  };
63
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
64
- <cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
65
- xmlns:dc="http://purl.org/dc/elements/1.1/"
66
- xmlns:dcterms="http://purl.org/dc/terms/"
67
- xmlns:dcmitype="http://purl.org/dc/dcmitype/"
68
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
69
- <dc:title>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.title || "")}</dc:title>
70
- <dc:subject>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.subject || "")}</dc:subject>
71
- <dc:creator>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.creator || "DocXML")}</dc:creator>
72
- <cp:keywords>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.keywords || "")}</cp:keywords>
73
- <dc:description>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.description || "")}</dc:description>
74
- <cp:lastModifiedBy>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.lastModifiedBy || properties.creator || "DocXML")}</cp:lastModifiedBy>
63
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
64
+ <cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
65
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
66
+ xmlns:dcterms="http://purl.org/dc/terms/"
67
+ xmlns:dcmitype="http://purl.org/dc/dcmitype/"
68
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
69
+ <dc:title>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.title || "")}</dc:title>
70
+ <dc:subject>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.subject || "")}</dc:subject>
71
+ <dc:creator>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.creator || "DocXML")}</dc:creator>
72
+ <cp:keywords>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.keywords || "")}</cp:keywords>
73
+ <dc:description>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.description || "")}</dc:description>
74
+ <cp:lastModifiedBy>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.lastModifiedBy || properties.creator || "DocXML")}</cp:lastModifiedBy>
75
75
  <cp:revision>${properties.revision || 1}</cp:revision>${properties.category
76
76
  ? `\n <cp:category>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.category)}</cp:category>`
77
77
  : ""}${properties.contentStatus
78
78
  ? `\n <cp:contentStatus>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.contentStatus)}</cp:contentStatus>`
79
79
  : ""}${properties.language
80
80
  ? `\n <dc:language>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.language)}</dc:language>`
81
- : ""}
82
- <dcterms:created xsi:type="dcterms:W3CDTF">${formatDate(created)}</dcterms:created>
83
- <dcterms:modified xsi:type="dcterms:W3CDTF">${formatDate(modified)}</dcterms:modified>
81
+ : ""}
82
+ <dcterms:created xsi:type="dcterms:W3CDTF">${formatDate(created)}</dcterms:created>
83
+ <dcterms:modified xsi:type="dcterms:W3CDTF">${formatDate(modified)}</dcterms:modified>
84
84
  </cp:coreProperties>`;
85
85
  }
86
86
  generateAppProps(properties = {}) {
87
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
88
- <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
89
- xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
90
- <Application>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.application || "docxmlater")}</Application>
91
- <DocSecurity>0</DocSecurity>
92
- <ScaleCrop>false</ScaleCrop>
87
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
88
+ <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
89
+ xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
90
+ <Application>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.application || "docxmlater")}</Application>
91
+ <DocSecurity>0</DocSecurity>
92
+ <ScaleCrop>false</ScaleCrop>
93
93
  <Company>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.company || "")}</Company>${properties.manager
94
94
  ? `\n <Manager>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.manager)}</Manager>`
95
- : ""}
96
- <LinksUpToDate>false</LinksUpToDate>
97
- <SharedDoc>false</SharedDoc>
98
- <HyperlinksChanged>false</HyperlinksChanged>
99
- <AppVersion>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.appVersion || properties.version || "1.0.0")}</AppVersion>
95
+ : ""}
96
+ <LinksUpToDate>false</LinksUpToDate>
97
+ <SharedDoc>false</SharedDoc>
98
+ <HyperlinksChanged>false</HyperlinksChanged>
99
+ <AppVersion>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(properties.appVersion || properties.version || "1.0.0")}</AppVersion>
100
100
  </Properties>`;
101
101
  }
102
102
  generateCustomProps(customProps) {
@@ -105,23 +105,23 @@ class DocumentGenerator {
105
105
  }
106
106
  const formatCustomValue = (key, value, pid) => {
107
107
  if (typeof value === "string") {
108
- return ` <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${pid}" name="${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(key)}">
109
- <vt:lpwstr>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(value)}</vt:lpwstr>
108
+ return ` <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${pid}" name="${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(key)}">
109
+ <vt:lpwstr>${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(value)}</vt:lpwstr>
110
110
  </property>`;
111
111
  }
112
112
  else if (typeof value === "number") {
113
- return ` <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${pid}" name="${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(key)}">
114
- <vt:r8>${value}</vt:r8>
113
+ return ` <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${pid}" name="${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(key)}">
114
+ <vt:r8>${value}</vt:r8>
115
115
  </property>`;
116
116
  }
117
117
  else if (typeof value === "boolean") {
118
- return ` <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${pid}" name="${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(key)}">
119
- <vt:bool>${value ? "true" : "false"}</vt:bool>
118
+ return ` <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${pid}" name="${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(key)}">
119
+ <vt:bool>${value ? "true" : "false"}</vt:bool>
120
120
  </property>`;
121
121
  }
122
122
  else if (value instanceof Date) {
123
- return ` <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${pid}" name="${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(key)}">
124
- <vt:filetime>${value.toISOString()}</vt:filetime>
123
+ return ` <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${pid}" name="${XMLBuilder_1.XMLBuilder.sanitizeXmlContent(key)}">
124
+ <vt:filetime>${value.toISOString()}</vt:filetime>
125
125
  </property>`;
126
126
  }
127
127
  return "";
@@ -130,10 +130,10 @@ class DocumentGenerator {
130
130
  .map(([key, value], index) => formatCustomValue(key, value, index + 2))
131
131
  .filter((prop) => prop !== "")
132
132
  .join("\n");
133
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
134
- <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
135
- xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
136
- ${properties}
133
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
134
+ <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
135
+ xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
136
+ ${properties}
137
137
  </Properties>`;
138
138
  }
139
139
  generateContentTypesWithImagesHeadersFootersAndComments(imageManager, headerFooterManager, commentManager, zipHandler, fontManager, hasCustomProperties = false, originalContentTypes) {
@@ -369,58 +369,58 @@ ${properties}
369
369
  hyperlink.setRelationshipId(relationship.getId());
370
370
  }
371
371
  generateFontTable() {
372
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
373
- <w:fonts xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
374
- xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
375
- <w:font w:name="Calibri">
376
- <w:panose1 w:val="020F0502020204030204"/>
377
- <w:charset w:val="00"/>
378
- <w:family w:val="swiss"/>
379
- <w:pitch w:val="variable"/>
380
- <w:sig w:usb0="E10002FF" w:usb1="4000ACFF" w:usb2="00000009" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
381
- </w:font>
382
- <w:font w:name="Times New Roman">
383
- <w:panose1 w:val="02020603050405020304"/>
384
- <w:charset w:val="00"/>
385
- <w:family w:val="roman"/>
386
- <w:pitch w:val="variable"/>
387
- <w:sig w:usb0="E0002AFF" w:usb1="C000785B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
388
- </w:font>
389
- <w:font w:name="Arial">
390
- <w:panose1 w:val="020B0604020202020204"/>
391
- <w:charset w:val="00"/>
392
- <w:family w:val="swiss"/>
393
- <w:pitch w:val="variable"/>
394
- <w:sig w:usb0="E0002AFF" w:usb1="C000247B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
395
- </w:font>
396
- <w:font w:name="Courier New">
397
- <w:panose1 w:val="02070309020205020404"/>
398
- <w:charset w:val="00"/>
399
- <w:family w:val="modern"/>
400
- <w:pitch w:val="fixed"/>
401
- <w:sig w:usb0="E0002AFF" w:usb1="C0007843" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
402
- </w:font>
403
- <w:font w:name="Calibri Light">
404
- <w:panose1 w:val="020F0302020204030204"/>
405
- <w:charset w:val="00"/>
406
- <w:family w:val="swiss"/>
407
- <w:pitch w:val="variable"/>
408
- <w:sig w:usb0="E10002FF" w:usb1="4000ACFF" w:usb2="00000009" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
409
- </w:font>
410
- <w:font w:name="Georgia">
411
- <w:panose1 w:val="02040502050204030303"/>
412
- <w:charset w:val="00"/>
413
- <w:family w:val="roman"/>
414
- <w:pitch w:val="variable"/>
415
- <w:sig w:usb0="E0002AFF" w:usb1="00000000" w:usb2="00000000" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
416
- </w:font>
372
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
373
+ <w:fonts xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
374
+ xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
375
+ <w:font w:name="Calibri">
376
+ <w:panose1 w:val="020F0502020204030204"/>
377
+ <w:charset w:val="00"/>
378
+ <w:family w:val="swiss"/>
379
+ <w:pitch w:val="variable"/>
380
+ <w:sig w:usb0="E10002FF" w:usb1="4000ACFF" w:usb2="00000009" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
381
+ </w:font>
382
+ <w:font w:name="Times New Roman">
383
+ <w:panose1 w:val="02020603050405020304"/>
384
+ <w:charset w:val="00"/>
385
+ <w:family w:val="roman"/>
386
+ <w:pitch w:val="variable"/>
387
+ <w:sig w:usb0="E0002AFF" w:usb1="C000785B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
388
+ </w:font>
389
+ <w:font w:name="Arial">
390
+ <w:panose1 w:val="020B0604020202020204"/>
391
+ <w:charset w:val="00"/>
392
+ <w:family w:val="swiss"/>
393
+ <w:pitch w:val="variable"/>
394
+ <w:sig w:usb0="E0002AFF" w:usb1="C000247B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
395
+ </w:font>
396
+ <w:font w:name="Courier New">
397
+ <w:panose1 w:val="02070309020205020404"/>
398
+ <w:charset w:val="00"/>
399
+ <w:family w:val="modern"/>
400
+ <w:pitch w:val="fixed"/>
401
+ <w:sig w:usb0="E0002AFF" w:usb1="C0007843" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
402
+ </w:font>
403
+ <w:font w:name="Calibri Light">
404
+ <w:panose1 w:val="020F0302020204030204"/>
405
+ <w:charset w:val="00"/>
406
+ <w:family w:val="swiss"/>
407
+ <w:pitch w:val="variable"/>
408
+ <w:sig w:usb0="E10002FF" w:usb1="4000ACFF" w:usb2="00000009" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
409
+ </w:font>
410
+ <w:font w:name="Georgia">
411
+ <w:panose1 w:val="02040502050204030303"/>
412
+ <w:charset w:val="00"/>
413
+ <w:family w:val="roman"/>
414
+ <w:pitch w:val="variable"/>
415
+ <w:sig w:usb0="E0002AFF" w:usb1="00000000" w:usb2="00000000" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
416
+ </w:font>
417
417
  </w:fonts>`;
418
418
  }
419
419
  generateSettings(trackChangesSettings) {
420
- let xml = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
421
- <w:settings xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
422
- xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
423
- <w:zoom w:percent="100"/>
420
+ let xml = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
421
+ <w:settings xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
422
+ xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
423
+ <w:zoom w:percent="100"/>
424
424
  <w:updateFields w:val="true"/>`;
425
425
  if (trackChangesSettings?.trackChangesEnabled) {
426
426
  xml += '\n <w:trackRevisions/>';
@@ -467,8 +467,8 @@ ${properties}
467
467
  }
468
468
  xml += '/>';
469
469
  }
470
- xml += `
471
- <w:defaultTabStop w:val="720"/>
470
+ xml += `
471
+ <w:defaultTabStop w:val="720"/>
472
472
  <w:characterSpacingControl w:val="doNotCompress"/>`;
473
473
  if (trackChangesSettings?.rsids && trackChangesSettings.rsids.length > 0) {
474
474
  xml += '\n <w:rsids>';
@@ -480,106 +480,106 @@ ${properties}
480
480
  }
481
481
  xml += '\n </w:rsids>';
482
482
  }
483
- xml += `
484
- <w:compat>
485
- <w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="15"/>
486
- <w:compatSetting w:name="overrideTableStyleFontSizeAndJustification" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
487
- <w:compatSetting w:name="enableOpenTypeFeatures" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
488
- <w:compatSetting w:name="doNotFlipMirrorIndents" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
489
- <w:compatSetting w:name="differentiateMultirowTableHeaders" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
490
- </w:compat>
491
- <w:themeFontLang w:val="en-US"/>
492
- <w:clrSchemeMapping w:bg1="light1" w:t1="dark1" w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2="accent2" w:accent3="accent3" w:accent4="accent4" w:accent5="accent5" w:accent6="accent6" w:hyperlink="hyperlink" w:followedHyperlink="followedHyperlink"/>
483
+ xml += `
484
+ <w:compat>
485
+ <w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="15"/>
486
+ <w:compatSetting w:name="overrideTableStyleFontSizeAndJustification" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
487
+ <w:compatSetting w:name="enableOpenTypeFeatures" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
488
+ <w:compatSetting w:name="doNotFlipMirrorIndents" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
489
+ <w:compatSetting w:name="differentiateMultirowTableHeaders" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
490
+ </w:compat>
491
+ <w:themeFontLang w:val="en-US"/>
492
+ <w:clrSchemeMapping w:bg1="light1" w:t1="dark1" w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2="accent2" w:accent3="accent3" w:accent4="accent4" w:accent5="accent5" w:accent6="accent6" w:hyperlink="hyperlink" w:followedHyperlink="followedHyperlink"/>
493
493
  </w:settings>`;
494
494
  return xml;
495
495
  }
496
496
  generateTheme() {
497
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
498
- <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">
499
- <a:themeElements>
500
- <a:clrScheme name="Office">
501
- <a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>
502
- <a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>
503
- <a:dk2><a:srgbClr val="44546A"/></a:dk2>
504
- <a:lt2><a:srgbClr val="E7E6E6"/></a:lt2>
505
- <a:accent1><a:srgbClr val="5B9BD5"/></a:accent1>
506
- <a:accent2><a:srgbClr val="ED7D31"/></a:accent2>
507
- <a:accent3><a:srgbClr val="A5A5A5"/></a:accent3>
508
- <a:accent4><a:srgbClr val="FFC000"/></a:accent4>
509
- <a:accent5><a:srgbClr val="4472C4"/></a:accent5>
510
- <a:accent6><a:srgbClr val="70AD47"/></a:accent6>
511
- <a:hlink><a:srgbClr val="0563C1"/></a:hlink>
512
- <a:folHlink><a:srgbClr val="954F72"/></a:folHlink>
513
- </a:clrScheme>
514
- <a:fontScheme name="Office">
515
- <a:majorFont>
516
- <a:latin typeface="Calibri Light" panose="020F0302020204030204"/>
517
- <a:ea typeface=""/>
518
- <a:cs typeface=""/>
519
- </a:majorFont>
520
- <a:minorFont>
521
- <a:latin typeface="Calibri" panose="020F0502020204030204"/>
522
- <a:ea typeface=""/>
523
- <a:cs typeface=""/>
524
- </a:minorFont>
525
- </a:fontScheme>
526
- <a:fmtScheme name="Office">
527
- <a:fillStyleLst>
528
- <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
529
- <a:gradFill rotWithShape="1">
530
- <a:gsLst>
531
- <a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs>
532
- <a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs>
533
- <a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs>
534
- </a:gsLst>
535
- <a:lin ang="5400000" scaled="0"/>
536
- </a:gradFill>
537
- <a:gradFill rotWithShape="1">
538
- <a:gsLst>
539
- <a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs>
540
- <a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs>
541
- <a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs>
542
- </a:gsLst>
543
- <a:lin ang="5400000" scaled="0"/>
544
- </a:gradFill>
545
- </a:fillStyleLst>
546
- <a:lnStyleLst>
547
- <a:ln w="6350" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln>
548
- <a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln>
549
- <a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln>
550
- </a:lnStyleLst>
551
- <a:effectStyleLst>
552
- <a:effectStyle><a:effectLst/></a:effectStyle>
553
- <a:effectStyle><a:effectLst/></a:effectStyle>
554
- <a:effectStyle>
555
- <a:effectLst>
556
- <a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0">
557
- <a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr>
558
- </a:outerShdw>
559
- </a:effectLst>
560
- </a:effectStyle>
561
- </a:effectStyleLst>
562
- <a:bgFillStyleLst>
563
- <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
564
- <a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill>
565
- <a:gradFill rotWithShape="1">
566
- <a:gsLst>
567
- <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs>
568
- <a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs>
569
- <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs>
570
- </a:gsLst>
571
- <a:lin ang="5400000" scaled="0"/>
572
- </a:gradFill>
573
- </a:bgFillStyleLst>
574
- </a:fmtScheme>
575
- </a:themeElements>
576
- <a:objectDefaults/>
577
- <a:extraClrSchemeLst/>
578
- <a:extLst>
579
- <a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}">
580
- <thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office Theme" id="{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}" vid="{4A3C46E8-61CC-4603-A589-7422A47A8E4A}"/>
581
- </a:ext>
582
- </a:extLst>
497
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
498
+ <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">
499
+ <a:themeElements>
500
+ <a:clrScheme name="Office">
501
+ <a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>
502
+ <a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>
503
+ <a:dk2><a:srgbClr val="44546A"/></a:dk2>
504
+ <a:lt2><a:srgbClr val="E7E6E6"/></a:lt2>
505
+ <a:accent1><a:srgbClr val="5B9BD5"/></a:accent1>
506
+ <a:accent2><a:srgbClr val="ED7D31"/></a:accent2>
507
+ <a:accent3><a:srgbClr val="A5A5A5"/></a:accent3>
508
+ <a:accent4><a:srgbClr val="FFC000"/></a:accent4>
509
+ <a:accent5><a:srgbClr val="4472C4"/></a:accent5>
510
+ <a:accent6><a:srgbClr val="70AD47"/></a:accent6>
511
+ <a:hlink><a:srgbClr val="0563C1"/></a:hlink>
512
+ <a:folHlink><a:srgbClr val="954F72"/></a:folHlink>
513
+ </a:clrScheme>
514
+ <a:fontScheme name="Office">
515
+ <a:majorFont>
516
+ <a:latin typeface="Calibri Light" panose="020F0302020204030204"/>
517
+ <a:ea typeface=""/>
518
+ <a:cs typeface=""/>
519
+ </a:majorFont>
520
+ <a:minorFont>
521
+ <a:latin typeface="Calibri" panose="020F0502020204030204"/>
522
+ <a:ea typeface=""/>
523
+ <a:cs typeface=""/>
524
+ </a:minorFont>
525
+ </a:fontScheme>
526
+ <a:fmtScheme name="Office">
527
+ <a:fillStyleLst>
528
+ <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
529
+ <a:gradFill rotWithShape="1">
530
+ <a:gsLst>
531
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs>
532
+ <a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs>
533
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs>
534
+ </a:gsLst>
535
+ <a:lin ang="5400000" scaled="0"/>
536
+ </a:gradFill>
537
+ <a:gradFill rotWithShape="1">
538
+ <a:gsLst>
539
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs>
540
+ <a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs>
541
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs>
542
+ </a:gsLst>
543
+ <a:lin ang="5400000" scaled="0"/>
544
+ </a:gradFill>
545
+ </a:fillStyleLst>
546
+ <a:lnStyleLst>
547
+ <a:ln w="6350" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln>
548
+ <a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln>
549
+ <a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln>
550
+ </a:lnStyleLst>
551
+ <a:effectStyleLst>
552
+ <a:effectStyle><a:effectLst/></a:effectStyle>
553
+ <a:effectStyle><a:effectLst/></a:effectStyle>
554
+ <a:effectStyle>
555
+ <a:effectLst>
556
+ <a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0">
557
+ <a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr>
558
+ </a:outerShdw>
559
+ </a:effectLst>
560
+ </a:effectStyle>
561
+ </a:effectStyleLst>
562
+ <a:bgFillStyleLst>
563
+ <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
564
+ <a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill>
565
+ <a:gradFill rotWithShape="1">
566
+ <a:gsLst>
567
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs>
568
+ <a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs>
569
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs>
570
+ </a:gsLst>
571
+ <a:lin ang="5400000" scaled="0"/>
572
+ </a:gradFill>
573
+ </a:bgFillStyleLst>
574
+ </a:fmtScheme>
575
+ </a:themeElements>
576
+ <a:objectDefaults/>
577
+ <a:extraClrSchemeLst/>
578
+ <a:extLst>
579
+ <a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}">
580
+ <thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office Theme" id="{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}" vid="{4A3C46E8-61CC-4603-A589-7422A47A8E4A}"/>
581
+ </a:ext>
582
+ </a:extLst>
583
583
  </a:theme>`;
584
584
  }
585
585
  }
@@ -129,8 +129,8 @@ class CommentManager {
129
129
  generateCommentsXml() {
130
130
  const comments = this.getAllCommentsWithReplies();
131
131
  if (comments.length === 0) {
132
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
133
- <w:comments xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
132
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
133
+ <w:comments xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
134
134
  </w:comments>`;
135
135
  }
136
136
  let xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
@@ -17,8 +17,11 @@ export declare class Hyperlink {
17
17
  private relationshipId?;
18
18
  private formatting;
19
19
  private trackingContext?;
20
+ private _parentParagraph?;
20
21
  constructor(properties: HyperlinkProperties);
21
22
  _setTrackingContext(context: import('../tracking/TrackingContext').TrackingContext): void;
23
+ _setParentParagraph(paragraph: import('./Paragraph').Paragraph): void;
24
+ _getParentParagraph(): import('./Paragraph').Paragraph | undefined;
22
25
  getUrl(): string | undefined;
23
26
  getFullUrl(): string | undefined;
24
27
  getAnchor(): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Hyperlink.d.ts","sourceRoot":"","sources":["../../src/elements/Hyperlink.ts"],"names":[],"mappings":"AAkDA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAO3C,MAAM,WAAW,mBAAmB;IAElC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,CAAC,EAAE,aAAa,CAAC;IAE3B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAKD,qBAAa,SAAS;IACpB,OAAO,CAAC,GAAG,CAAC,CAAS;IACrB,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,UAAU,CAAgB;IAElC,OAAO,CAAC,eAAe,CAAC,CAAwD;gBAUpE,UAAU,EAAE,mBAAmB;IAkD3C,mBAAmB,CAAC,OAAO,EAAE,OAAO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Z,MAAM,CAAC,aAAa,CAClB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,aAAa,GACzB,SAAS;IAcZ,MAAM,CAAC,WAAW,CAChB,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,aAAa,GACzB,SAAS;IAYZ,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,mBAAmB,GAAG,SAAS;CAG1D"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Hyperlink = void 0;
4
4
  const Run_1 = require("./Run");
5
+ const Revision_1 = require("./Revision");
5
6
  const validation_1 = require("../utils/validation");
6
7
  const logger_1 = require("../utils/logger");
7
8
  class Hyperlink {
@@ -13,6 +14,7 @@ class Hyperlink {
13
14
  relationshipId;
14
15
  formatting;
15
16
  trackingContext;
17
+ _parentParagraph;
16
18
  constructor(properties) {
17
19
  this.url = properties.url;
18
20
  this.anchor = properties.anchor;
@@ -44,6 +46,12 @@ class Hyperlink {
44
46
  _setTrackingContext(context) {
45
47
  this.trackingContext = context;
46
48
  }
49
+ _setParentParagraph(paragraph) {
50
+ this._parentParagraph = paragraph;
51
+ }
52
+ _getParentParagraph() {
53
+ return this._parentParagraph;
54
+ }
47
55
  getUrl() {
48
56
  return this.url;
49
57
  }
@@ -107,6 +115,21 @@ class Hyperlink {
107
115
  if (oldUrl === url) {
108
116
  return this;
109
117
  }
118
+ if (this.trackingContext?.isEnabled() && this._parentParagraph) {
119
+ const author = this.trackingContext.getAuthor();
120
+ const oldHyperlink = this.clone();
121
+ this.url = url;
122
+ this.relationshipId = undefined;
123
+ if (this.run.getText() === oldUrl) {
124
+ this.text = url || this.anchor || "Link";
125
+ this.run.setText(this.text);
126
+ }
127
+ const deletion = Revision_1.Revision.createDeletion(author, [oldHyperlink]);
128
+ const insertion = Revision_1.Revision.createInsertion(author, [this]);
129
+ this._parentParagraph.replaceContent(this, [deletion, insertion]);
130
+ this._parentParagraph = undefined;
131
+ return this;
132
+ }
110
133
  this.url = url;
111
134
  this.relationshipId = undefined;
112
135
  if (this.run.getText() === oldUrl) {
@@ -125,6 +148,26 @@ class Hyperlink {
125
148
  if (oldAnchor === anchor) {
126
149
  return this;
127
150
  }
151
+ if (this.trackingContext?.isEnabled() && this._parentParagraph) {
152
+ const author = this.trackingContext.getAuthor();
153
+ const oldHyperlink = this.clone();
154
+ this.anchor = anchor;
155
+ if (anchor && this.url) {
156
+ logger_1.defaultLogger.warn(`DocXML Warning: Setting anchor "${anchor}" on hyperlink that has URL "${this.url}". ` +
157
+ `Clearing URL to make this an internal link. Use separate hyperlinks for external and internal links.`);
158
+ this.url = undefined;
159
+ this.relationshipId = undefined;
160
+ }
161
+ if (this.run.getText() === oldAnchor) {
162
+ this.text = anchor || this.url || "Link";
163
+ this.run.setText(this.text);
164
+ }
165
+ const deletion = Revision_1.Revision.createDeletion(author, [oldHyperlink]);
166
+ const insertion = Revision_1.Revision.createInsertion(author, [this]);
167
+ this._parentParagraph.replaceContent(this, [deletion, insertion]);
168
+ this._parentParagraph = undefined;
169
+ return this;
170
+ }
128
171
  this.anchor = anchor;
129
172
  if (anchor && this.url) {
130
173
  logger_1.defaultLogger.warn(`DocXML Warning: Setting anchor "${anchor}" on hyperlink that has URL "${this.url}". ` +