@salesforcedevs/dx-components 1.3.145 → 1.3.147

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": "1.3.145",
3
+ "version": "1.3.147",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -40,5 +40,5 @@
40
40
  "eventsourcemock": "^2.0.0",
41
41
  "luxon": "^3.1.0"
42
42
  },
43
- "gitHead": "acbb843c07604405a11ac39c1eba9331901e248f"
43
+ "gitHead": "c046874452685c28208a52392b494ad791c3f305"
44
44
  }
@@ -23,7 +23,7 @@ export default class CardBlogPost extends LightningElement {
23
23
  private onLinkClick(event: Event) {
24
24
  const payload = {
25
25
  click_text: this.title,
26
- click_url: this.href,
26
+ click_url: `${window.location.origin}${this.href}`,
27
27
  element_title: this.title,
28
28
  element_type: "card",
29
29
  content_category: "link"
@@ -32,7 +32,7 @@ export default class CardCallout extends LightningElement {
32
32
  private sendGtm(e: PointerEvent) {
33
33
  track(e.currentTarget!, "custEv_ctaLinkClick", {
34
34
  click_text: this.title,
35
- click_url: this.href,
35
+ click_url: `${window.location.origin}${this.href}`,
36
36
  element_title: this.title,
37
37
  element_type: "link",
38
38
  content_category: "cta"
@@ -39,13 +39,13 @@ export default class CardDocs extends LightningElement {
39
39
  ...payloadInnerButton,
40
40
  element_title: this.title,
41
41
  click_text: slotElement.innerText,
42
- click_url: slotElement.href
42
+ click_url: `${window.location.origin}${slotElement.href}`
43
43
  });
44
44
  track(event.currentTarget!, "custEv_linkClick", {
45
45
  ...payloadInnerButton,
46
46
  element_title: this.title,
47
47
  click_text: slotElement.innerText,
48
- click_url: slotElement.href
48
+ click_url: `${window.location.origin}${slotElement.href}`
49
49
  });
50
50
  });
51
51
  });
@@ -56,7 +56,7 @@ export default class CardDocs extends LightningElement {
56
56
  const payloadCardInfo = {
57
57
  click_text: this.title,
58
58
  element_title: this.title,
59
- click_url: this.href,
59
+ click_url: `${window.location.origin}${this.href}`,
60
60
  element_type: "link",
61
61
  content_category: "cta"
62
62
  };
@@ -68,7 +68,7 @@ export default class CardDocs extends LightningElement {
68
68
  const payloadCardTextInfo = {
69
69
  click_text: this.body,
70
70
  element_title: this.title,
71
- click_url: this.href,
71
+ click_url: `${window.location.origin}${this.href}`,
72
72
  element_type: "tile",
73
73
  content_category: "cta"
74
74
  };
@@ -67,7 +67,9 @@ export default class CardNews extends LightningElement {
67
67
  private trackClick(e: Event) {
68
68
  const payload = {
69
69
  click_text: this.buttonText,
70
- click_url: this.href,
70
+ click_url: this.href.includes("http")
71
+ ? this.href
72
+ : `${window.location.origin}${this.href}`,
71
73
  element_title: this.title,
72
74
  element_type: "link",
73
75
  content_category: "cta"
@@ -119,7 +119,7 @@ export default class CardTrial extends LightningElement {
119
119
  click_text: this.label,
120
120
  element_title: "dx-button",
121
121
  element_type: "card",
122
- click_url: this.href,
122
+ click_url: `${window.location.origin}${this.href}`,
123
123
  content_category: "cta"
124
124
  };
125
125
  track(e.currentTarget!, "custEv_signupStart", payload);
@@ -74,7 +74,7 @@ export default class CardTrial extends LightningElement {
74
74
  click_text: this.buttonCta,
75
75
  element_title: this.title,
76
76
  element_type: "card",
77
- click_url: this.href,
77
+ click_url: `${window.location.origin}${this.href}`,
78
78
  content_category: "cta"
79
79
  };
80
80
  track(e.currentTarget!, "custEv_signupStart", payload);
@@ -16,10 +16,6 @@ details summary > * {
16
16
  display: inline;
17
17
  }
18
18
 
19
- details[open] summary ~ * {
20
- animation: sweep 0.5s ease-in-out;
21
- }
22
-
23
19
  /* hide '-' when collapsed & '+' when expanded */
24
20
  details > summary > .expanded,
25
21
  details[open] > summary > .collapsed {
@@ -52,15 +48,3 @@ details:not(:first-of-type) {
52
48
  .faq-body {
53
49
  margin: var(--dx-g-spacing-lg) 0;
54
50
  }
55
-
56
- @keyframes sweep {
57
- 0% {
58
- opacity: 0;
59
- transform: translateX(-10px);
60
- }
61
-
62
- 100% {
63
- opacity: 1;
64
- transform: translateX(0);
65
- }
66
- }
@@ -42,7 +42,7 @@ export default class FeaturesListHeader extends LightningElement {
42
42
  if (e.currentTarget) {
43
43
  track(e.currentTarget, "custEv_ctaButtonClick", {
44
44
  click_text: this.ctaLabel,
45
- click_url: this.ctaHref,
45
+ click_url: `${window.location.origin}${this.ctaHref}`,
46
46
  element_type: "button",
47
47
  element_title: this.title,
48
48
  content_category: "cta"
@@ -50,7 +50,7 @@ export default class FeaturesListHeader extends LightningElement {
50
50
  track(e.currentTarget!, "custEv_linkClick", {
51
51
  click_text: this.ctaLabel,
52
52
  element_title: this.title,
53
- click_url: this.ctaHref,
53
+ click_url: `${window.location.origin}${this.ctaHref}`,
54
54
  element_type: "link",
55
55
  content_category: "cta"
56
56
  });
@@ -61,7 +61,7 @@ export default class FeaturesListHeader extends LightningElement {
61
61
  if (e.currentTarget) {
62
62
  track(e.currentTarget, "custEv_ctaButtonClick", {
63
63
  click_text: this.ctaLabelSecondary,
64
- click_url: this.ctaHrefSecondary,
64
+ click_url: `${window.location.origin}${this.ctaHrefSecondary}`,
65
65
  element_type: "button",
66
66
  element_title: this.title,
67
67
  content_category: "cta"
@@ -69,7 +69,7 @@ export default class FeaturesListHeader extends LightningElement {
69
69
  track(e.currentTarget!, "custEv_linkClick", {
70
70
  click_text: this.ctaLabelSecondary,
71
71
  element_title: this.title,
72
- click_url: this.ctaHrefSecondary,
72
+ click_url: `${window.location.origin}${this.ctaHrefSecondary}`,
73
73
  element_type: "link",
74
74
  content_category: "cta"
75
75
  });
@@ -7,8 +7,10 @@
7
7
  <div class="graphic graphic-trees" alt=""></div>
8
8
  <div class="graphic graphic-mountains" alt=""></div>
9
9
  <div class="graphic graphic-mountains-mobile" alt=""></div>
10
- <span class="subheading">Sign up for developer updates</span>
11
- <dx-button href="/newsletter">SIGN UP</dx-button>
10
+ <span class="subheading">{signupLabel}</span>
11
+ <dx-button onclick={handleSignup} href={signupPath}>
12
+ SIGN UP
13
+ </dx-button>
12
14
  <div class="graphic graphic-trees-small" alt=""></div>
13
15
  </div>
14
16
  <div
@@ -18,11 +20,15 @@
18
20
  <div class="graphic graphic-large" alt=""></div>
19
21
  <div class="subscription">
20
22
  <h2 class="dx-text-display-4">
21
- Get timely developer updates
22
- <br />
23
- delivered to your inbox.
23
+ <dx-formatted-rich-text
24
+ value={signupLabel}
25
+ ></dx-formatted-rich-text>
24
26
  </h2>
25
- <dx-button href="/newsletter" size="large">
27
+ <dx-button
28
+ onclick={handleSignup}
29
+ href={signupPath}
30
+ size="large"
31
+ >
26
32
  Sign up now
27
33
  </dx-button>
28
34
  </div>
@@ -8,6 +8,7 @@ import {
8
8
  socialLinks,
9
9
  intellectualHref
10
10
  } from "./links";
11
+ import { track } from "dxUtils/analytics";
11
12
 
12
13
  export default class Footer extends LightningElement {
13
14
  @api locale: string | null = null;
@@ -35,6 +36,7 @@ export default class Footer extends LightningElement {
35
36
  private intellectualHref = intellectualHref;
36
37
  private socialLinks = socialLinks;
37
38
  private termsLinks = termsLinks;
39
+ private signupPath = "/newsletter";
38
40
 
39
41
  @api
40
42
  set variant(value: FooterVariant) {
@@ -80,6 +82,12 @@ export default class Footer extends LightningElement {
80
82
  return date.getFullYear();
81
83
  }
82
84
 
85
+ get signupLabel(): string {
86
+ return this.showLargeSignup
87
+ ? "Get timely developer updates<br />delivered to your inbox."
88
+ : "Sign up for developer updates";
89
+ }
90
+
83
91
  get className() {
84
92
  return cx(`signup-variant-${this.variant}`);
85
93
  }
@@ -98,4 +106,16 @@ export default class Footer extends LightningElement {
98
106
  "terms-only"
99
107
  ].includes(value);
100
108
  }
109
+
110
+ private handleSignup(e: Event) {
111
+ track(e.currentTarget, "custEv_ctaButtonClick", {
112
+ click_text: this.signupLabel,
113
+ click_url: `${window.location.origin}${this.signupPath}`,
114
+ element_type: "button",
115
+ element_title: this.showSmallSignup
116
+ ? "Get Developer Updates"
117
+ : "get the latest developer updates.",
118
+ content_category: "cta"
119
+ });
120
+ }
101
121
  }
@@ -11,7 +11,10 @@ export default class FooterOption extends LightningElement {
11
11
  sendGtm(e: PointerEvent) {
12
12
  track(e.currentTarget, "custEv_bottomNavLinkClick", {
13
13
  click_text: this.label || undefined,
14
- click_url: this.href || undefined,
14
+ click_url:
15
+ (this.href && this.href.includes("http")
16
+ ? this.href
17
+ : `${window.location.origin}${this.href}`) || undefined,
15
18
  nav_item: this.label || undefined,
16
19
  nav_level: "1",
17
20
  element_type: "link",
@@ -20,7 +23,10 @@ export default class FooterOption extends LightningElement {
20
23
  track(e.currentTarget!, "custEv_linkClick", {
21
24
  click_text: this.label,
22
25
  element_title: this.generalLabel,
23
- click_url: this.href,
26
+ click_url:
27
+ (this.href && this.href.includes("http")
28
+ ? this.href
29
+ : `${window.location.origin}${this.href}`) || undefined,
24
30
  element_type: "link",
25
31
  content_category: "cta"
26
32
  });
@@ -87,7 +87,11 @@ export default class GroupText extends LightningElement {
87
87
  track(event.target!, "custEv_ctaButtonClick", {
88
88
  click_text: event.currentTarget.innerText,
89
89
  item_title: event.currentTarget.innerText,
90
- click_url: event.currentTarget.href,
90
+ click_url: `${
91
+ event.currentTarget.href.includes("http")
92
+ ? event.currentTarget.href
93
+ : window.location.origin + event.currentTarget.href
94
+ }`,
91
95
  element_type: "button",
92
96
  element_title: this.title,
93
97
  content_category: "cta"
@@ -39,7 +39,9 @@ export default class MainContentHeader extends LightningElement {
39
39
  if (e.currentTarget) {
40
40
  track(e.currentTarget, "custEv_ctaButtonClick", {
41
41
  click_text: this.ctaLabel,
42
- click_url: this.ctaHref,
42
+ click_url: this.ctaHref.includes("http")
43
+ ? this.ctaHref
44
+ : `${window.location.origin}${this.ctaHref}`,
43
45
  element_type: "button",
44
46
  element_title: this.title,
45
47
  content_category: "cta"
@@ -47,7 +49,9 @@ export default class MainContentHeader extends LightningElement {
47
49
  track(e.currentTarget!, "custEv_linkClick", {
48
50
  click_text: this.ctaLabel,
49
51
  element_title: this.title,
50
- click_url: this.ctaHref,
52
+ click_url: this.ctaHref.includes("http")
53
+ ? this.ctaHref
54
+ : `${window.location.origin}${this.ctaHref}`,
51
55
  element_type: "link",
52
56
  content_category: "cta"
53
57
  });
@@ -58,7 +62,9 @@ export default class MainContentHeader extends LightningElement {
58
62
  if (e.currentTarget) {
59
63
  track(e.currentTarget, "custEv_ctaButtonClick", {
60
64
  click_text: this.ctaLabelSecondary,
61
- click_url: this.ctaHrefSecondary,
65
+ click_url: this.ctaHrefSecondary!.includes("http")
66
+ ? this.ctaHrefSecondary
67
+ : `${window.location.origin}${this.ctaHrefSecondary}`,
62
68
  element_type: "button",
63
69
  element_title: this.title,
64
70
  content_category: "cta"
@@ -66,7 +72,9 @@ export default class MainContentHeader extends LightningElement {
66
72
  track(e.currentTarget!, "custEv_linkClick", {
67
73
  click_text: this.ctaLabelSecondary,
68
74
  element_title: this.title,
69
- click_url: this.ctaHrefSecondary,
75
+ click_url: this.ctaHrefSecondary!.includes("http")
76
+ ? this.ctaHrefSecondary
77
+ : `${window.location.origin}${this.ctaHrefSecondary}`,
70
78
  element_type: "link",
71
79
  content_category: "cta"
72
80
  });
@@ -37,6 +37,7 @@
37
37
  variant={ctaBtnVariant}
38
38
  icon-symbol={ctaBtnSymbol}
39
39
  target={ctaBtnTarget}
40
+ onclick={handleLabelClick}
40
41
  >
41
42
  {ctaLabel}
42
43
  </dx-button>
@@ -1,6 +1,7 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import cx from "classnames";
3
3
  import { toDxColor } from "dxUtils/css";
4
+ import { track } from "dxUtils/analytics";
4
5
 
5
6
  export default class Section extends LightningElement {
6
7
  @api backgroundColor: string = "transparent";
@@ -48,4 +49,16 @@ export default class Section extends LightningElement {
48
49
  private get hasText(): boolean {
49
50
  return !!(this.title || this.label || this.subtitle);
50
51
  }
52
+
53
+ private handleLabelClick(e: Event) {
54
+ track(e.target!, "custEv_ctaLinkClick", {
55
+ click_text: this.ctaLabel,
56
+ element_title: this.title,
57
+ click_url: this.ctaHref!.includes("http")
58
+ ? this.ctaHref
59
+ : `${window.location.origin}${this.ctaHref}`,
60
+ element_type: "link",
61
+ content_category: "cta"
62
+ });
63
+ }
51
64
  }
@@ -53,7 +53,7 @@ export default class Toc extends LightningElement {
53
53
  sendGtm(e.currentTarget!, "custEv_tableOfContents", {
54
54
  click_text: text,
55
55
  clickAction: "click",
56
- click_url: href,
56
+ click_url: `${window.location.href}${href}`,
57
57
  element_title: this.title,
58
58
  element_type: "link",
59
59
  content_category: "cta"
@@ -174,7 +174,10 @@ export default class TreeItem extends LightningElement {
174
174
  private sendGtm(event: Event) {
175
175
  track(event.currentTarget!, "custEv_leftNavLinkClick", {
176
176
  click_text: this._treeNode.label,
177
- click_url: this.href,
177
+ click_url: this.href!.includes("/docs/")
178
+ ? `${window.location.origin}${this.href}`
179
+ : // TODO: this is a hack to get the correct url for the left nav
180
+ window.location.href.replace(/[^/]+$/, this.href!),
178
181
  nav_level: this._treeNode.level + 1,
179
182
  nav_item: this.treeLabels,
180
183
  nav_type: "left nav bar",
@@ -184,7 +187,10 @@ export default class TreeItem extends LightningElement {
184
187
  track(event.currentTarget!, "custEv_linkClick", {
185
188
  click_text: this._treeNode.label,
186
189
  element_title: this.rootParentLabel,
187
- click_url: this.href,
190
+ click_url: this.href!.includes("/docs/")
191
+ ? `${window.location.origin}${this.href}`
192
+ : // TODO: this is a hack to get the correct url for the left nav
193
+ window.location.href.replace(/[^/]+$/, this.href!),
188
194
  element_type: "link",
189
195
  content_category: "cta"
190
196
  });