@salesforcedevs/dx-components 0.47.0 → 0.49.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "0.47.0",
3
+ "version": "0.49.0",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -28,5 +28,5 @@
28
28
  "@types/lodash.get": "^4.4.6",
29
29
  "@types/vimeo__player": "^2.16.2"
30
30
  },
31
- "gitHead": "0e7e9e87424e9623e9201e77b35b28d602e4ca33"
31
+ "gitHead": "fc6cdc27b2f412e63ae629805efae2caed925c0c"
32
32
  }
@@ -101,10 +101,10 @@ export default class CodeBlock extends LightningElement {
101
101
  this.markupLangs.includes(this.selectedLanguage.id || "")
102
102
  ) {
103
103
  // eslint-disable-next-line
104
- templateEl.innerHTML = `<pre class='codeblock'><!-- ${this.codeBlock.replace(
104
+ templateEl.innerHTML = `<pre class='codeblock'><!--${this.codeBlock.replace(
105
105
  /<!--(.*?)-->/gs,
106
106
  "@@$1##"
107
- )} --></pre>`;
107
+ )}--></pre>`;
108
108
  } else {
109
109
  // eslint-disable-next-line
110
110
  const innerHtml = this.isEncoded
@@ -123,7 +123,7 @@
123
123
  <div class="content-container content-container_bottom">
124
124
  <div class="terms">
125
125
  <span>
126
- &copy; Copyright {currentYear} Salesforce.com, inc.&nbsp;
126
+ &copy; Copyright {currentYear} Salesforce, Inc.&nbsp;
127
127
  <a href={intellectualHref}>All rights reserved.</a>
128
128
  &nbsp;Various trademarks held by their respective owners.
129
129
  </span>
@@ -38,6 +38,7 @@
38
38
  target={primaryLink.target}
39
39
  variant="primary"
40
40
  size="large"
41
+ onclick={trackClick}
41
42
  >
42
43
  {primaryLink.label}
43
44
  </dx-button>
@@ -47,6 +48,7 @@
47
48
  target={secondaryLink.target}
48
49
  variant="secondary"
49
50
  size="large"
51
+ onclick={trackClick}
50
52
  >
51
53
  {secondaryLink.label}
52
54
  </dx-button>
@@ -57,6 +59,7 @@
57
59
  variant="tertiary"
58
60
  size="large"
59
61
  icon-symbol="chevronright"
62
+ onclick={trackClick}
60
63
  >
61
64
  {tertiaryLink.label}
62
65
  </dx-button>
@@ -3,6 +3,7 @@ import cx from "classnames";
3
3
  import { LightningSlotElement, Link } from "typings/custom";
4
4
  import { isSlotEmpty } from "utils/slot";
5
5
  import { toJson } from "utils/normalizers";
6
+ import { track } from "dx/instrumentation";
6
7
 
7
8
  type OptionalLink = Link | null;
8
9
 
@@ -19,6 +20,12 @@ const subtitleClasses = {
19
20
  [MEDIUM]: "dx-text-heading-7"
20
21
  };
21
22
 
23
+ const ANALYTICS_INFO = {
24
+ elementType: "button",
25
+ destinationType: "internal",
26
+ ctaClick: true
27
+ };
28
+
22
29
  export default class GroupText extends LightningElement {
23
30
  @api title!: string;
24
31
  @api body?: string;
@@ -90,4 +97,15 @@ export default class GroupText extends LightningElement {
90
97
  private onSlotChange(e: LightningSlotElement): void {
91
98
  this.isSlotEmpty = isSlotEmpty(e);
92
99
  }
100
+
101
+ private trackClick(event: Event) {
102
+ const payload = {
103
+ ...ANALYTICS_INFO,
104
+ clickText: event.currentTarget.innerText,
105
+ itemTitle: event.currentTarget.innerText,
106
+ clickUrl: event.currentTarget.href
107
+ };
108
+
109
+ track(event.target!, "custEv_ctaButtonClick", payload);
110
+ }
93
111
  }