@salesforcedevs/dx-components 1.3.85 → 1.3.88

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.85",
3
+ "version": "1.3.88",
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": "6b738627c2fefd4e639f1def42cdc4d4a44c7171"
43
+ "gitHead": "0fd9edba15fb1e8120046a70384598e805388237"
44
44
  }
@@ -30,13 +30,6 @@ export default class CardCallout extends LightningElement {
30
30
  }
31
31
 
32
32
  private sendGtm(e: PointerEvent) {
33
- track(e.currentTarget, ANALYTICS_EVENT_NAME, {
34
- clickURL: this.href,
35
- itemTitle: this.title,
36
- clickText: this.label,
37
- elementType: "card callout",
38
- destinationType: "internal"
39
- });
40
33
  track(e.currentTarget!, "custEv_ctaLinkClick", {
41
34
  click_text: this.title,
42
35
  click_url: this.href,
@@ -33,17 +33,17 @@ export default class CardDocs extends LightningElement {
33
33
  // @ts-ignore
34
34
  const slot = e.target;
35
35
  const elements = slot.assignedElements();
36
- elements.forEach((slotElement) => {
36
+ elements.forEach((slotElement: any) => {
37
37
  slotElement?.addEventListener("click", (event: Event) => {
38
38
  track(event.currentTarget!, "custEv_cardClick", {
39
39
  ...payloadInnerButton,
40
- element_title: slotElement.innerText,
40
+ element_title: this.title,
41
41
  click_text: slotElement.innerText,
42
42
  click_url: slotElement.href
43
43
  });
44
44
  track(event.currentTarget!, "custEv_linkClick", {
45
45
  ...payloadInnerButton,
46
- element_title: slotElement.innerText,
46
+ element_title: this.title,
47
47
  click_text: slotElement.innerText,
48
48
  click_url: slotElement.href
49
49
  });
@@ -67,7 +67,7 @@ export default class CardDocs extends LightningElement {
67
67
  private handleTextClick(event: PointerEvent) {
68
68
  const payloadCardTextInfo = {
69
69
  click_text: this.body,
70
- element_title: this.body,
70
+ element_title: this.title,
71
71
  click_url: this.href,
72
72
  element_type: "tile",
73
73
  content_category: "cta"
@@ -66,12 +66,11 @@ export default class CardNews extends LightningElement {
66
66
 
67
67
  private trackClick(e: Event) {
68
68
  const payload = {
69
- clickText: this.buttonText,
70
- itemTitle: this.title,
71
- elementType: "link",
72
- destinationType: "internal",
73
- ctaClick: true,
74
- clickUrl: this.href
69
+ click_text: this.buttonText,
70
+ click_url: this.href,
71
+ element_title: this.title,
72
+ element_type: "link",
73
+ content_category: "cta"
75
74
  };
76
75
  track(e.currentTarget!, "custEv_ctaLinkClick", payload);
77
76
  track(e.currentTarget!, "custEv_linkClick", payload);
@@ -72,7 +72,7 @@ export default class CardTrial extends LightningElement {
72
72
  if (this.href.includes("signup")) {
73
73
  const payload = {
74
74
  click_text: this.buttonCta,
75
- element_title: "dx-button",
75
+ element_title: this.title,
76
76
  element_type: "card",
77
77
  click_url: this.href,
78
78
  content_category: "cta"
@@ -36,7 +36,7 @@ export default class Feature extends LightningElement {
36
36
  handleClick(event: Event) {
37
37
  const payload = {
38
38
  click_text: this.buttonLabel,
39
- element_title: "dx-button",
39
+ element_title: this.title,
40
40
  click_url: this.buttonHref,
41
41
  element_type: "button",
42
42
  content_category: "cta"
@@ -104,7 +104,9 @@ export default class Footer extends LightningElement {
104
104
  click_text: this.inputSubmitLabel,
105
105
  click_url: PATH,
106
106
  element_type: "button",
107
- element_title: "dx-footer",
107
+ element_title: this.showSmallSignup
108
+ ? "Get Developer Updates"
109
+ : "get the latest developer updates.",
108
110
  content_category: "cta"
109
111
  });
110
112
 
@@ -13,13 +13,13 @@ export default class FooterOption extends LightningElement {
13
13
  click_text: this.label || undefined,
14
14
  click_url: this.href || undefined,
15
15
  nav_item: this.label || undefined,
16
- nav_level: "2",
16
+ nav_level: "1",
17
17
  element_type: "link",
18
18
  nav_type: "footer"
19
19
  });
20
20
  track(e.currentTarget!, "custEv_linkClick", {
21
21
  click_text: this.label,
22
- element_title: this.label,
22
+ element_title: this.generalLabel,
23
23
  click_url: this.href,
24
24
  element_type: "link",
25
25
  content_category: "cta"
@@ -89,7 +89,7 @@ export default class GroupText extends LightningElement {
89
89
  item_title: event.currentTarget.innerText,
90
90
  click_url: event.currentTarget.href,
91
91
  element_type: "button",
92
- element_title: "dx-group-text",
92
+ element_title: this.title,
93
93
  content_category: "cta"
94
94
  });
95
95
  }
@@ -41,12 +41,12 @@ export default class MainContentHeader extends LightningElement {
41
41
  click_text: this.ctaLabel,
42
42
  click_url: this.ctaHref,
43
43
  element_type: "button",
44
- element_title: this.ctaLabel,
44
+ element_title: this.title,
45
45
  content_category: "cta"
46
46
  });
47
47
  track(e.currentTarget!, "custEv_linkClick", {
48
48
  click_text: this.ctaLabel,
49
- element_title: this.ctaLabel,
49
+ element_title: this.title,
50
50
  click_url: this.ctaHref,
51
51
  element_type: "link",
52
52
  content_category: "cta"
@@ -60,12 +60,12 @@ export default class MainContentHeader extends LightningElement {
60
60
  click_text: this.ctaLabelSecondary,
61
61
  click_url: this.ctaHrefSecondary,
62
62
  element_type: "button",
63
- element_title: this.ctaLabelSecondary,
63
+ element_title: this.title,
64
64
  content_category: "cta"
65
65
  });
66
66
  track(e.currentTarget!, "custEv_linkClick", {
67
67
  click_text: this.ctaLabelSecondary,
68
- element_title: this.ctaLabelSecondary,
68
+ element_title: this.title,
69
69
  click_url: this.ctaHrefSecondary,
70
70
  element_type: "link",
71
71
  content_category: "cta"
@@ -29,9 +29,7 @@
29
29
  <div part="text" class="text" if:true={hasText}>
30
30
  <span class="label dx-text-display-8" if:true={label}>{label}</span>
31
31
  <h2 class={headingClassName} if:true={title}>{title}</h2>
32
- <span class="subtitle dx-text-body-1" if:true={subtitle}>
33
- {subtitle}
34
- </span>
32
+ <span class={subtitleClassName} if:true={subtitle}>{subtitle}</span>
35
33
  <dx-button
36
34
  class="cta"
37
35
  if:true={ctaLabel}
@@ -8,6 +8,7 @@ export default class Section extends LightningElement {
8
8
  @api headingLevel: "1" | "2" | "3" | "4" | "5" | "custom" = "3";
9
9
  @api label?: string;
10
10
  @api subtitle?: string;
11
+ @api subtitleLevel?: "1" | "2" | "3" | "4" = "1";
11
12
  @api textAlign: "center" | "left" = "left";
12
13
  @api title?: string;
13
14
  @api ctaLabel?: string;
@@ -36,6 +37,10 @@ export default class Section extends LightningElement {
36
37
  );
37
38
  }
38
39
 
40
+ private get subtitleClassName() {
41
+ return cx("subtitle", `dx-text-body-${this.subtitleLevel}`);
42
+ }
43
+
39
44
  private get headingClassName() {
40
45
  return cx("heading", `dx-text-display-${this.headingLevel}`);
41
46
  }
@@ -1,18 +1,12 @@
1
1
  import cx from "classnames";
2
2
  import { api, track } from "lwc";
3
- import {
4
- TreeNode,
5
- SidebarGtmAction,
6
- SidebarSearchResult
7
- } from "typings/custom";
8
- import { track as trackAnalytics } from "dxUtils/analytics";
3
+ import { TreeNode, SidebarSearchResult } from "typings/custom";
9
4
  import { getSidebarSearchParams } from "dxUtils/coveo";
10
5
  import { toJson } from "dxUtils/normalizers";
11
6
  import SidebarSearch from "dx/sidebarSearch";
12
7
  import { SidebarBase } from "dxBaseElements/sidebarBase";
13
8
 
14
9
  const MOBILE_SIZE_MATCH = "768px";
15
- const TOGGLE_BUTTON_LABEL = "Toggle Sidebar";
16
10
 
17
11
  export default class Sidebar extends SidebarBase {
18
12
  @api coveoOrganizationId!: string;
@@ -51,9 +45,11 @@ export default class Sidebar extends SidebarBase {
51
45
 
52
46
  @api
53
47
  setInputValue(searchTerm: string) {
54
- ((this.template.querySelector(
55
- "dx-sidebar-search"
56
- ) as unknown) as SidebarSearch)?.setInputValue(searchTerm);
48
+ (
49
+ this.template.querySelector(
50
+ "dx-sidebar-search"
51
+ ) as unknown as SidebarSearch
52
+ )?.setInputValue(searchTerm);
57
53
  }
58
54
 
59
55
  private expanded: boolean = true;
@@ -169,16 +165,9 @@ export default class Sidebar extends SidebarBase {
169
165
  this._value = event.detail.name;
170
166
  }
171
167
 
172
- private onToggleClick(event: Event) {
168
+ private onToggleClick() {
173
169
  this.expanded = !this.expanded;
174
170
  this._toggleHovered = false;
175
- const sideNavAction: SidebarGtmAction = this.expanded
176
- ? "expand"
177
- : "collapse";
178
- trackAnalytics(event.currentTarget!, "custEv_leftNavLinkClick", {
179
- sideNavAction,
180
- clickText: TOGGLE_BUTTON_LABEL
181
- });
182
171
  }
183
172
 
184
173
  private onToggleMouseEnter() {
@@ -213,9 +202,9 @@ export default class Sidebar extends SidebarBase {
213
202
  return;
214
203
  }
215
204
 
216
- const search = (this.template.querySelector(
205
+ const search = this.template.querySelector(
217
206
  "dx-sidebar-search"
218
- ) as unknown) as SidebarSearch;
207
+ ) as unknown as SidebarSearch;
219
208
 
220
209
  if (
221
210
  this.isNearBottomOfSearchResults &&
@@ -1,14 +1,12 @@
1
1
  import cx from "classnames";
2
- import { track } from "dxUtils/analytics";
3
2
  import { api } from "lwc";
4
3
 
5
- import { TreeNode, SidebarGtmAction } from "typings/custom";
4
+ import { TreeNode } from "typings/custom";
6
5
  import { toJson } from "dxUtils/normalizers";
7
6
  import { SidebarBase } from "dxBaseElements/sidebarBase";
8
7
 
9
8
  const WAIT_TIME = 500;
10
9
  const MOBILE_SIZE_MATCH = "768px";
11
- const TOGGLE_BUTTON_LABEL = "Toggle Sidebar";
12
10
 
13
11
  export default class Sidebar extends SidebarBase {
14
12
  @api header: string = "";
@@ -97,16 +95,9 @@ export default class Sidebar extends SidebarBase {
97
95
  this._value = event.detail.name;
98
96
  }
99
97
 
100
- private onToggleClick(event: Event) {
98
+ private onToggleClick() {
101
99
  this.expanded = !this.expanded;
102
100
  this._toggleHovered = false;
103
- const sideNavAction: SidebarGtmAction = this.expanded
104
- ? "expand"
105
- : "collapse";
106
- track(event.currentTarget!, "custEv_leftNavLinkClick", {
107
- sideNavAction,
108
- clickText: TOGGLE_BUTTON_LABEL
109
- });
110
101
  }
111
102
 
112
103
  private onToggleMouseEnter() {
@@ -79,7 +79,7 @@ export default class Toc extends LightningElement {
79
79
  click_text: text,
80
80
  clickAction: "click",
81
81
  click_url: href,
82
- element_title: text,
82
+ element_title: this.title,
83
83
  element_type: "link",
84
84
  content_category: "cta"
85
85
  });
@@ -99,7 +99,7 @@ export default class Toc extends LightningElement {
99
99
  click_text: this.toggleButtonAriaLabel,
100
100
  clickAction: action,
101
101
  click_url: "",
102
- element_title: this.toggleButtonAriaLabel,
102
+ element_title: this.title,
103
103
  element_type: "button",
104
104
  content_category: "cta"
105
105
  });
@@ -24,7 +24,6 @@
24
24
  key={child.key}
25
25
  tree-node={child}
26
26
  selected-key={selectedKey}
27
- parent-name={treeNode.label}
28
27
  ></dx-tree-item>
29
28
  </template>
30
29
  </template>
@@ -8,7 +8,6 @@ const DEFAULT_TARGET = "_self";
8
8
  export default class TreeItem extends LightningElement {
9
9
  @api selectedKey?: string;
10
10
  @api isRoot: boolean = false;
11
- @api parentName?: string = "";
12
11
 
13
12
  @api
14
13
  public get treeNode() {
@@ -24,6 +23,7 @@ export default class TreeItem extends LightningElement {
24
23
  private _treeNode!: InternalTreeNode;
25
24
  private isExpanded: boolean = false;
26
25
  private isChildrenLoading: boolean = false;
26
+ private rootParentLabel: string = "";
27
27
 
28
28
  private get isSelected(): boolean {
29
29
  return this._treeNode.key === this.selectedKey;
@@ -49,6 +49,32 @@ export default class TreeItem extends LightningElement {
49
49
  return this.isExpanded && this.hasChildren;
50
50
  }
51
51
 
52
+ private get treeLabels(): string {
53
+ let parentEl = this.template
54
+ .querySelector("dx-tree-tile")
55
+ ?.getRootNode().host;
56
+
57
+ if (!parentEl) {
58
+ return "";
59
+ }
60
+
61
+ const parentLabels = [];
62
+
63
+ while (parentEl) {
64
+ parentEl = parentEl?.getRootNode()?.host;
65
+
66
+ if (parentEl && parentEl.treeNode) {
67
+ parentLabels.push(parentEl.treeNode.label);
68
+ }
69
+ }
70
+
71
+ if (parentEl?.isRoot) {
72
+ this.rootParentLabel = parentEl.treeNode.label;
73
+ }
74
+
75
+ return `${parentLabels.reverse().join(":")}:${this.treeNode.label}`;
76
+ }
77
+
52
78
  private get href(): string | undefined {
53
79
  return (
54
80
  (this._treeNode.link && this._treeNode.link.href) ||
@@ -150,14 +176,14 @@ export default class TreeItem extends LightningElement {
150
176
  click_text: this._treeNode.label,
151
177
  click_url: this.href,
152
178
  nav_level: this._treeNode.level + 1,
153
- nav_item: `${this.parentName}:${this._treeNode.label}`,
179
+ nav_item: this.treeLabels,
154
180
  nav_type: "left nav bar",
155
181
  element_type: "link"
156
182
  });
157
183
 
158
184
  track(event.currentTarget!, "custEv_linkClick", {
159
185
  click_text: this._treeNode.label,
160
- element_title: this._treeNode.label,
186
+ element_title: this.rootParentLabel,
161
187
  click_url: this.href,
162
188
  element_type: "link",
163
189
  content_category: "cta"
@@ -22,7 +22,6 @@ const VALID_BRANDS = [
22
22
 
23
23
  export const ANALYTICS_INFO = {
24
24
  click_text: "browse trials",
25
- element_title: "browse trials",
26
25
  element_type: "button",
27
26
  content_category: "cta"
28
27
  };
@@ -204,7 +203,8 @@ export abstract class HeaderBase extends LightningElement {
204
203
  private handleSignUpClick(e: PointerEvent) {
205
204
  const payload = {
206
205
  ...ANALYTICS_INFO,
207
- click_url: this.signupLink
206
+ click_url: this.signupLink,
207
+ element_title: this.title
208
208
  };
209
209
 
210
210
  track(e.currentTarget!, "custEv_browseTrialsClick", payload);