easy-template-x 3.1.0 → 3.2.0

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.
@@ -2361,9 +2361,16 @@ class LinkPlugin extends TemplatePlugin {
2361
2361
  generateMarkup(content, relId, wordRunNode) {
2362
2362
  // http://officeopenxml.com/WPhyperlink.php
2363
2363
 
2364
+ let tooltip = '';
2365
+ if (content.tooltip) {
2366
+ tooltip += `w:tooltip="${content.tooltip}" `;
2367
+ }
2364
2368
  const markupText = `
2365
- <w:hyperlink r:id="${relId}" w:history="1">
2369
+ <w:hyperlink r:id="${relId}" ${tooltip}w:history="1">
2366
2370
  <w:r>
2371
+ <w:rPr>
2372
+ <w:rStyle w:val="Hyperlink"/>
2373
+ </w:rPr>
2367
2374
  <w:t>${content.text || content.target}</w:t>
2368
2375
  </w:r>
2369
2376
  </w:hyperlink>
@@ -2999,7 +3006,7 @@ class TemplateHandler {
2999
3006
  /**
3000
3007
  * Version number of the `easy-template-x` library.
3001
3008
  */
3002
- _defineProperty(this, "version", "3.1.0" );
3009
+ _defineProperty(this, "version", "3.2.0" );
3003
3010
  _defineProperty(this, "xmlParser", new XmlParser());
3004
3011
  _defineProperty(this, "docxParser", void 0);
3005
3012
  _defineProperty(this, "compiler", void 0);
@@ -2334,9 +2334,16 @@ class LinkPlugin extends TemplatePlugin {
2334
2334
  generateMarkup(content, relId, wordRunNode) {
2335
2335
  // http://officeopenxml.com/WPhyperlink.php
2336
2336
 
2337
+ let tooltip = '';
2338
+ if (content.tooltip) {
2339
+ tooltip += `w:tooltip="${content.tooltip}" `;
2340
+ }
2337
2341
  const markupText = `
2338
- <w:hyperlink r:id="${relId}" w:history="1">
2342
+ <w:hyperlink r:id="${relId}" ${tooltip}w:history="1">
2339
2343
  <w:r>
2344
+ <w:rPr>
2345
+ <w:rStyle w:val="Hyperlink"/>
2346
+ </w:rPr>
2340
2347
  <w:t>${content.text || content.target}</w:t>
2341
2348
  </w:r>
2342
2349
  </w:hyperlink>
@@ -2972,7 +2979,7 @@ class TemplateHandler {
2972
2979
  /**
2973
2980
  * Version number of the `easy-template-x` library.
2974
2981
  */
2975
- _defineProperty(this, "version", "3.1.0" );
2982
+ _defineProperty(this, "version", "3.2.0" );
2976
2983
  _defineProperty(this, "xmlParser", new XmlParser());
2977
2984
  _defineProperty(this, "docxParser", void 0);
2978
2985
  _defineProperty(this, "compiler", void 0);
@@ -3,4 +3,5 @@ export interface LinkContent extends PluginContent {
3
3
  _type: 'link';
4
4
  text?: string;
5
5
  target: string;
6
+ tooltip?: string;
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-template-x",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Generate docx documents from templates, in Node or in the browser.",
5
5
  "keywords": [
6
6
  "docx",
@@ -7,4 +7,5 @@ export interface LinkContent extends PluginContent {
7
7
  */
8
8
  text?: string;
9
9
  target: string;
10
+ tooltip?: string;
10
11
  }
@@ -35,9 +35,17 @@ export class LinkPlugin extends TemplatePlugin {
35
35
 
36
36
  // http://officeopenxml.com/WPhyperlink.php
37
37
 
38
+ let tooltip = '';
39
+ if (content.tooltip) {
40
+ tooltip += `w:tooltip="${content.tooltip}" `;
41
+ }
42
+
38
43
  const markupText = `
39
- <w:hyperlink r:id="${relId}" w:history="1">
44
+ <w:hyperlink r:id="${relId}" ${tooltip}w:history="1">
40
45
  <w:r>
46
+ <w:rPr>
47
+ <w:rStyle w:val="Hyperlink"/>
48
+ </w:rPr>
41
49
  <w:t>${content.text || content.target}</w:t>
42
50
  </w:r>
43
51
  </w:hyperlink>