@salesforcedevs/dx-components 1.30.1-node22-2 → 1.30.1-node22-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.
package/lwc.config.json CHANGED
@@ -59,6 +59,7 @@
59
59
  "dx/footerMfe",
60
60
  "dx/formattedDateTime",
61
61
  "dx/formattedRichText",
62
+ "dx/globalHeader",
62
63
  "dx/grid",
63
64
  "dx/groupText",
64
65
  "dx/headerMobileNavMenu",
package/package.json CHANGED
@@ -1,52 +1,47 @@
1
1
  {
2
- "name": "@salesforcedevs/dx-components",
3
- "version": "1.30.1-node22-2",
4
- "description": "DX Lightning web components",
5
- "license": "MIT",
6
- "engines": {
7
- "node": ">=22.0.0"
8
- },
9
- "volta": {
10
- "node": "22.22.0",
11
- "yarn": "1.22.22"
12
- },
13
- "publishConfig": {
14
- "access": "public"
15
- },
16
- "dependencies": {
17
- "@coveo/headless": "3.22.2",
18
- "@floating-ui/dom": "1.5.1",
19
- "@optimizely/optimizely-sdk": "5.3.0",
20
- "@shikijs/colorized-brackets": "^3.12.2",
21
- "@types/throttle-debounce": "5.0.2",
22
- "@vimeo/player": "2.22.0",
23
- "classnames": "2.5.1",
24
- "composed-offset-position": "0.0.4",
25
- "coveo-search-ui": "2.10113.0",
26
- "debounce": "1.2.1",
27
- "js-cookie": "3.0.5",
28
- "lodash.defaults": "4.2.0",
29
- "lodash.get": "4.4.2",
30
- "lodash.kebabcase": "4.1.1",
31
- "memoize-one": "6.0.0",
32
- "microtip": "0.2.2",
33
- "shiki": "^3.12.2",
34
- "throttle-debounce": "5.0.0",
35
- "uuid": "9.0.1"
36
- },
37
- "devDependencies": {
38
- "@types/classnames": "2.3.1",
39
- "@types/debounce": "1.2.4",
40
- "@types/js-cookie": "3.0.6",
41
- "@types/lodash.defaults": "4.2.9",
42
- "@types/lodash.get": "4.4.9",
43
- "@types/lodash.kebabcase": "4.1.9",
44
- "@types/luxon": "3.4.2",
45
- "@types/uuid": "8.3.4",
46
- "@types/vimeo__player": "2.18.3",
47
- "eventsourcemock": "2.0.0",
48
- "luxon": "3.4.4",
49
- "msw": "^2.12.4"
50
- },
51
- "gitHead": "db460ac1fb9b1f752d0c129dfe19012c8a085867"
52
- }
2
+ "name": "@salesforcedevs/dx-components",
3
+ "version": "1.30.1-node22-3",
4
+ "description": "DX Lightning web components",
5
+ "license": "MIT",
6
+ "engines": {
7
+ "node": "22.x"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "dependencies": {
13
+ "@coveo/headless": "3.22.2",
14
+ "@floating-ui/dom": "1.5.1",
15
+ "@optimizely/optimizely-sdk": "5.3.0",
16
+ "@shikijs/colorized-brackets": "^3.12.2",
17
+ "@types/throttle-debounce": "5.0.2",
18
+ "@vimeo/player": "2.22.0",
19
+ "classnames": "2.5.1",
20
+ "composed-offset-position": "0.0.4",
21
+ "coveo-search-ui": "2.10113.0",
22
+ "debounce": "1.2.1",
23
+ "js-cookie": "3.0.5",
24
+ "lodash.defaults": "4.2.0",
25
+ "lodash.get": "4.4.2",
26
+ "lodash.kebabcase": "4.1.1",
27
+ "memoize-one": "6.0.0",
28
+ "microtip": "0.2.2",
29
+ "shiki": "^3.12.2",
30
+ "throttle-debounce": "5.0.0",
31
+ "uuid": "9.0.1"
32
+ },
33
+ "devDependencies": {
34
+ "@types/classnames": "2.3.1",
35
+ "@types/debounce": "1.2.4",
36
+ "@types/js-cookie": "3.0.6",
37
+ "@types/lodash.defaults": "4.2.9",
38
+ "@types/lodash.get": "4.4.9",
39
+ "@types/lodash.kebabcase": "4.1.9",
40
+ "@types/luxon": "3.4.2",
41
+ "@types/uuid": "8.3.4",
42
+ "@types/vimeo__player": "2.18.3",
43
+ "eventsourcemock": "2.0.0",
44
+ "luxon": "3.4.4",
45
+ "msw": "^2.12.4"
46
+ }
47
+ }
@@ -3,7 +3,7 @@
3
3
  <img class={imageClassName} src={imageAssetPath} alt={imageAlt} />
4
4
  <img
5
5
  class="image-alt-small"
6
- src="https://developer.salesforce.com/ns-assets/images/binary-cloud-circle-small.svg"
6
+ src="https://developer.salesforce.com/ns-assets/binary-cloud-circle-small.svg"
7
7
  alt="Cloud with binary code floating above"
8
8
  lwc:if={altVariant}
9
9
  />
@@ -60,10 +60,10 @@ export default class EmptyState extends LightningElement {
60
60
 
61
61
  get imageAssetPath() {
62
62
  return this.variant === "base"
63
- ? `https://developer.salesforce.com/ns-assets/images/docs-empty-state${
63
+ ? `https://developer.salesforce.com/ns-assets/docs-empty-state${
64
64
  this.size === "small" ? "-small" : ""
65
65
  }.svg`
66
- : `https://developer.salesforce.com/ns-assets/images/binary-cloud-circle${
66
+ : `https://developer.salesforce.com/ns-assets/binary-cloud-circle${
67
67
  this.size === "small" ? "-small" : ""
68
68
  }.svg`;
69
69
  }
@@ -8,9 +8,9 @@
8
8
 
9
9
  .error_container {
10
10
  background-color: #3a49da;
11
- background-image: url("https://developer.salesforce.com/ns-assets/images/bottom-right.svg"),
12
- url("https://developer.salesforce.com/ns-assets/images/lower-left.svg"),
13
- url("https://developer.salesforce.com/ns-assets/images/top-right.svg");
11
+ background-image: url("https://developer.salesforce.com/ns-assets/bottom-right.svg"),
12
+ url("https://developer.salesforce.com/ns-assets/lower-left.svg"),
13
+ url("https://developer.salesforce.com/ns-assets/top-right.svg");
14
14
  background-position: right bottom, left 90%, right top;
15
15
  background-repeat: no-repeat;
16
16
  padding: var(--dx-g-spacing-3xl) calc(var(--dx-g-spacing-3xl) + 20px) 130px
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="error-container">
3
3
  <img
4
- src="https://developer.salesforce.com/ns-assets/images/error-fallback.svg"
4
+ src="https://developer.salesforce.com/ns-assets/error-fallback.svg"
5
5
  alt="error fallback image"
6
6
  class="error-image"
7
7
  />
@@ -3,7 +3,7 @@
3
3
 
4
4
  :host {
5
5
  --dx-c-feature-img-box-shadow: 0 6px 30px 0 rgb(0 20 45 / 40%);
6
- --dx-c-feature-description-left-img-src: url("https://developer.salesforce.com/ns-assets/images/feature-backdrop1.svg");
6
+ --dx-c-feature-description-left-img-src: url("https://developer.salesforce.com/ns-assets/feature-backdrop1.svg");
7
7
  --dx-c-feature-description-max-width: 31.75rem;
8
8
  --dx-c-feature-img-margin-left: auto;
9
9
  --dx-c-feature-img-container-padding: 4rem;
@@ -83,7 +83,7 @@ section {
83
83
 
84
84
  .description-right .image {
85
85
  margin-right: auto;
86
- background-image: url("https://developer.salesforce.com/ns-assets/images/feature-backdrop2.svg");
86
+ background-image: url("https://developer.salesforce.com/ns-assets/feature-backdrop2.svg");
87
87
  }
88
88
 
89
89
  .image-display-container {
@@ -21,7 +21,7 @@
21
21
  <div if:true={isDisplay} class="image-display-container">
22
22
  <img
23
23
  class="image-display"
24
- src="https://developer.salesforce.com/ns-assets/images/featured-demo-art-blank.svg"
24
+ src="https://developer.salesforce.com/ns-assets/featured-demo-art-blank.svg"
25
25
  alt={header}
26
26
  />
27
27
  <div class="image-container">
@@ -221,8 +221,8 @@
221
221
 
222
222
  .custom-bg-trial::after {
223
223
  content: "";
224
- background-image: url("https://developer.salesforce.com/ns-assets/images/trial-left.svg"),
225
- url("https://developer.salesforce.com/ns-assets/images/trial-right.svg");
224
+ background-image: url("https://developer.salesforce.com/ns-assets/trial-left.svg"),
225
+ url("https://developer.salesforce.com/ns-assets/trial-right.svg");
226
226
  background-position: var(--dx-g-page-padding-horizontal) 50px,
227
227
  right 15px top;
228
228
  background-repeat: no-repeat;
@@ -235,7 +235,7 @@
235
235
 
236
236
  @media screen and (max-width: 1024px) {
237
237
  .custom-bg-trial::after {
238
- background-image: url("https://developer.salesforce.com/ns-assets/images/trial-left.svg");
238
+ background-image: url("https://developer.salesforce.com/ns-assets/trial-left.svg");
239
239
  background-position: 48px 30px;
240
240
  background-size: contain;
241
241
  }
@@ -243,7 +243,7 @@
243
243
 
244
244
  .custom-bg-big-moon::after {
245
245
  content: "";
246
- background-image: url("https://developer.salesforce.com/ns-assets/images/big-moon.svg");
246
+ background-image: url("https://developer.salesforce.com/ns-assets/big-moon.svg");
247
247
  background-position: top right;
248
248
  background-repeat: no-repeat;
249
249
  position: absolute;
@@ -258,7 +258,7 @@
258
258
  justify-content: center;
259
259
  align-items: center;
260
260
  position: absolute;
261
- background-image: url("https://developer.salesforce.com/ns-assets/images/blue-circle.svg");
261
+ background-image: url("https://developer.salesforce.com/ns-assets/blue-circle.svg");
262
262
  top: 110px;
263
263
  right: 230px;
264
264
  left: unset;
@@ -6,10 +6,10 @@ const treesMobile =
6
6
 
7
7
  // These codey-* ones are a bit of a hack for now: we were only given a PNG and limited time, so we're wrapping the PNG in an SVG.
8
8
  const codeyDesktop =
9
- '<svg class="codey-desktop" width="381" height="337" viewBox="0 0 381 337" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><image width="381" height="337" xlink:href="https://developer.salesforce.com/ns-assets/images/podcast-bear.png" />';
9
+ '<svg class="codey-desktop" width="381" height="337" viewBox="0 0 381 337" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><image width="381" height="337" xlink:href="https://developer.salesforce.com/ns-assets/podcast-bear.png" />';
10
10
 
11
11
  const codeyMobile =
12
- '<svg class="codey-mobile" width="381" height="337" viewBox="0 0 381 337" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><image width="381" height="337" xlink:href="https://developer.salesforce.com/ns-assets/images/podcast-bear.png" />';
12
+ '<svg class="codey-mobile" width="381" height="337" viewBox="0 0 381 337" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><image width="381" height="337" xlink:href="https://developer.salesforce.com/ns-assets/podcast-bear.png" />';
13
13
 
14
14
  const moonDesktop =
15
15
  '<svg width="1221" height="507" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M745.819 45.482c0 24.567-19.915 44.482-44.482 44.482s-44.483-19.915-44.483-44.482C656.854 20.916 676.77 1 701.337 1c24.567 0 44.482 19.916 44.482 44.482"/><path d="M745.819 45.482c0 24.567-19.915 44.482-44.482 44.482s-44.483-19.915-44.483-44.482C656.854 20.916 676.77 1 701.337 1c24.567 0 44.482 19.916 44.482 44.482Z" stroke="#90D0FE" stroke-width="2"/><path d="M476.154 420.627a4.095 4.095 0 1 1-8.191 0 4.095 4.095 0 1 1 8.19 0ZM99.154 150.627a4.095 4.095 0 1 1-8.191 0 4.095 4.095 0 1 1 8.19 0ZM1210.142 97.587l-1.518 4.1a1.063 1.063 0 0 1-.631.633l-4.102 1.518c-.933.346-.933 1.664 0 2.009l4.102 1.517c.293.109.523.34.63.633l1.519 4.102c.346.93 1.664.93 2.009 0l1.517-4.102c.109-.293.34-.524.633-.633l4.102-1.517c.932-.345.932-1.663 0-2.01l-4.102-1.517a1.068 1.068 0 0 1-.633-.632l-1.517-4.101c-.345-.933-1.663-.933-2.01 0ZM8.142 490.372l-1.518 4.1a1.067 1.067 0 0 1-.632.633l-4.1 1.518c-.934.345-.934 1.664 0 2.009l4.1 1.517c.293.109.524.34.632.633l1.518 4.1c.345.933 1.664.933 2.01 0l1.516-4.1c.11-.293.34-.524.633-.633l4.101-1.517c.932-.345.932-1.664 0-2.01l-4.1-1.517a1.071 1.071 0 0 1-.634-.632l-1.517-4.101c-.345-.933-1.664-.933-2.009 0ZM127.142 115.587l-1.518 4.1a1.064 1.064 0 0 1-.632.633l-4.1 1.518c-.934.346-.934 1.664 0 2.009l4.1 1.517c.293.109.524.34.632.633l1.518 4.102c.345.93 1.664.93 2.01 0l1.516-4.102c.11-.293.34-.524.633-.633l4.101-1.517c.932-.345.932-1.663 0-2.01l-4.1-1.517a1.068 1.068 0 0 1-.634-.632l-1.517-4.101c-.345-.933-1.664-.933-2.009 0ZM909.009 306.108c-5.999-11.612-9.387-24.793-9.387-38.765 0-11.403 2.257-22.279 6.348-32.206M1067.92 255.215c.568 3.96.862 8.01.862 12.129 0 46.713-37.867 84.58-84.58 84.58-28.474 0-53.664-14.071-68.99-35.64M911.555 224.004c14.768-24.701 41.776-41.24 72.647-41.24 38.302 0 70.658 25.459 81.068 60.378M1055.511 147.787l-3.452 9.329a2.439 2.439 0 0 1-1.44 1.44l-9.329 3.452c-2.121.784-2.121 3.784 0 4.569l9.329 3.452a2.436 2.436 0 0 1 1.44 1.44l3.452 9.329c.785 2.12 3.785 2.12 4.569 0l3.452-9.33a2.441 2.441 0 0 1 1.44-1.44l9.329-3.451c2.121-.785 2.121-3.785 0-4.57l-9.329-3.451a2.444 2.444 0 0 1-1.44-1.44l-3.452-9.33c-.784-2.12-3.784-2.12-4.569 0ZM919.251 376.385c0 5.69-4.614 10.304-10.306 10.304-5.69 0-10.305-4.613-10.305-10.305 0-5.692 4.614-10.306 10.305-10.306 5.692 0 10.306 4.615 10.306 10.307Z" stroke="#90D0FE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M984.116 224.502a5.027 5.027 0 1 1-10.054 0 5.027 5.027 0 0 1 10.054 0" fill="#90D0FE"/><path stroke="#90D0FE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M1046.716 254.771h29.772M1087.929 254.771h7.089M902.279 225.33h23.242M870.108 225.33h10.053"/><path d="M893.055 225.33a2.01 2.01 0 1 1-4.021 0 2.01 2.01 0 0 1 4.02 0" fill="#90D0FE"/><path stroke="#90D0FE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M893.425 315.627h31.409"/><path d="M936.898 315.627a2.011 2.011 0 1 1-4.023 0 2.011 2.011 0 0 1 4.023 0" fill="#90D0FE"/><path stroke="#90D0FE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M1013.52 292.398v-16.036M1021.537 284.382l-16.051.002"/></g></svg>';
@@ -113,7 +113,7 @@ footer.signup-variant-no-signup {
113
113
  height: 112px;
114
114
  width: 110px;
115
115
  margin-right: var(--dx-g-spacing-lg);
116
- background-image: url("https://developer.salesforce.com/ns-assets/images/footer-graphic-trees.svg");
116
+ background-image: url("https://developer.salesforce.com/ns-assets/footer-graphic-trees.svg");
117
117
  filter: var(--dx-g-svg-filter);
118
118
  }
119
119
 
@@ -121,7 +121,7 @@ footer.signup-variant-no-signup {
121
121
  height: 96px;
122
122
  width: 220px;
123
123
  margin-right: var(--dx-g-spacing-lg);
124
- background-image: url("https://developer.salesforce.com/ns-assets/images/footer-graphic-mountains-2.svg");
124
+ background-image: url("https://developer.salesforce.com/ns-assets/footer-graphic-mountains-2.svg");
125
125
  filter: var(--dx-g-svg-filter);
126
126
  }
127
127
 
@@ -132,7 +132,7 @@ footer.signup-variant-no-signup {
132
132
  bottom: 0;
133
133
  height: 56px;
134
134
  width: 100px;
135
- background-image: url("https://developer.salesforce.com/ns-assets/images/footer-graphic-mountains-small-2.svg");
135
+ background-image: url("https://developer.salesforce.com/ns-assets/footer-graphic-mountains-small-2.svg");
136
136
  filter: var(--dx-g-svg-filter);
137
137
  }
138
138
 
@@ -140,7 +140,7 @@ footer.signup-variant-no-signup {
140
140
  height: 66px;
141
141
  width: 52px;
142
142
  margin-left: var(--dx-g-spacing-lg);
143
- background-image: url("https://developer.salesforce.com/ns-assets/images/footer-graphic-trees-small.svg");
143
+ background-image: url("https://developer.salesforce.com/ns-assets/footer-graphic-trees-small.svg");
144
144
  filter: var(--dx-g-svg-filter);
145
145
  }
146
146
 
@@ -54,9 +54,9 @@
54
54
  lwc:if={showContainerMiddle}
55
55
  class="content-container content-container_middle"
56
56
  >
57
- <a class="logo" href="/">
57
+ <a class="logo" href="/" onclick={handleLogoClick}>
58
58
  <img
59
- src="https://developer.salesforce.com/ns-assets/images/salesforce-logo-corporate.svg"
59
+ src="https://developer.salesforce.com/ns-assets/salesforce-logo-corporate.svg"
60
60
  alt="Salesforce logo"
61
61
  />
62
62
  </a>
@@ -69,6 +69,7 @@
69
69
  class={link.iconSymbol}
70
70
  target="_blank"
71
71
  rel="noopener"
72
+ onclick={handleSocialLinkClick}
72
73
  >
73
74
  <svg
74
75
  xmlns="http://www.w3.org/2000/svg"
@@ -107,13 +108,18 @@
107
108
  href={term.href}
108
109
  key={term.label}
109
110
  rel={term.rel}
110
- onclick={term.onclick}
111
+ onclick={handleCookiePreferencesClick}
111
112
  >
112
113
  {term.label}
113
114
  </a>
114
115
  </template>
115
116
  <template lwc:else>
116
- <a href={term.href} key={term.label} rel={term.rel}>
117
+ <a
118
+ href={term.href}
119
+ key={term.label}
120
+ rel={term.rel}
121
+ onclick={handleTermsClick}
122
+ >
117
123
  <img
118
124
  lwc:if={term.img}
119
125
  class="term-icon"
@@ -150,7 +150,8 @@ function augmentWithNonMFEFooterFunctionality(FooterClass: typeof Footer) {
150
150
 
151
151
  private buildFooterConfigLookupTables(config: any[]) {
152
152
  config.forEach((item: any) => {
153
- this.configItemTitleToItemLookup.set(item.title, item);
153
+ // attr_title is preferable to title because it is not language-specific
154
+ this.configItemTitleToItemLookup.set(item.attr_title || item.title, item);
154
155
  if (item.menu_item_parent) {
155
156
  const parentId = parseInt(item.menu_item_parent, 10);
156
157
  const children =
@@ -189,10 +190,11 @@ function augmentWithNonMFEFooterFunctionality(FooterClass: typeof Footer) {
189
190
 
190
191
  this.socialLinks =
191
192
  socialLinksItems.map((child: any) => {
193
+ const childTitle: string = child.attr_title || child.title || ""; // attr_title is preferable to title because it is not language-specific
192
194
  const iconSymbol =
193
- child.title === "LinkedIn"
195
+ childTitle === "LinkedIn"
194
196
  ? "linked-in"
195
- : child.title.toLowerCase();
197
+ : childTitle.toLocaleLowerCase();
196
198
  const iconUrlHash =
197
199
  iconSymbol === "twitter"
198
200
  ? "#twitter-x"
@@ -267,7 +269,14 @@ function augmentWithNonMFEFooterFunctionality(FooterClass: typeof Footer) {
267
269
 
268
270
  const { url, description } = copyrightNoticeItem;
269
271
  const copyrightNoticeInnerHtml = description.replace("{{All rights reserved}}", `<a href="${url}">All rights reserved</a>`);
270
- this.template.querySelector(".copyright-notice")!.innerHTML = copyrightNoticeInnerHtml;
272
+ const copyrightNoticeEl = this.template.querySelector(".copyright-notice")!;
273
+ copyrightNoticeEl.innerHTML = copyrightNoticeInnerHtml;
274
+ const copyrightLink = copyrightNoticeEl.querySelector("a");
275
+ if (copyrightLink) {
276
+ copyrightLink.addEventListener("click", (e) =>
277
+ this.handleCopyrightLinkClick(e as Event)
278
+ );
279
+ }
271
280
 
272
281
  const legalLinksItems = this.configItemParentToChildrenLookup.get(copyrightNoticeItem.ID);
273
282
 
@@ -284,11 +293,12 @@ function augmentWithNonMFEFooterFunctionality(FooterClass: typeof Footer) {
284
293
  rel: item.rel
285
294
  };
286
295
 
287
- if (item.title === "Cookie Preferences") {
296
+ const itemTitle: string = item.attr_title || item.title || ""; // attr_title is preferable to title because it is not language-specific
297
+ if (itemTitle === "Cookie Preferences") {
288
298
  link.href = "#";
289
- link.onclick = this.openOneTrustInfoDisplay;
290
- } else if (item.title === "Your Privacy Choices") {
291
- link.img = "https://developer.salesforce.com/ns-assets/images/privacyoptions.svg";
299
+ link.onclick = this.handleCookiePreferencesClick;
300
+ } else if (itemTitle === "Your Privacy Choices") {
301
+ link.img = "https://developer.salesforce.com/ns-assets/privacyoptions.svg";
292
302
  }
293
303
 
294
304
  return link;
@@ -300,6 +310,63 @@ function augmentWithNonMFEFooterFunctionality(FooterClass: typeof Footer) {
300
310
  (window as any).OneTrust.ToggleInfoDisplay();
301
311
  }
302
312
  }
313
+
314
+ private trackFooterLinkClick(
315
+ e: Event,
316
+ options?: {
317
+ label?: string;
318
+ elementTitle?: string;
319
+ clickUrl?: string;
320
+ }
321
+ ) {
322
+ const anchor = e.currentTarget as HTMLAnchorElement;
323
+ const clickText =
324
+ options?.label ??
325
+ anchor.textContent?.trim() ??
326
+ anchor.getAttribute("aria-label") ??
327
+ anchor.href;
328
+ const elementTitle = options?.elementTitle ?? clickText;
329
+ const clickUrl = options?.clickUrl ?? anchor.href;
330
+
331
+ track(anchor, "custEv_linkClick", {
332
+ click_text: clickText,
333
+ click_url: clickUrl,
334
+ element_type: "link",
335
+ element_title: elementTitle,
336
+ content_category: "footer",
337
+ nav_item: clickText,
338
+ nav_level: "1",
339
+ nav_type: "footer"
340
+ });
341
+ }
342
+
343
+ private handleLogoClick(e: Event) {
344
+ this.trackFooterLinkClick(e, {
345
+ label: "Salesforce",
346
+ elementTitle: "Salesforce logo",
347
+ clickUrl: `${window.location.origin}/`
348
+ });
349
+ }
350
+
351
+ private handleSocialLinkClick(e: Event) {
352
+ this.trackFooterLinkClick(e);
353
+ }
354
+
355
+ private handleCookiePreferencesClick(e: Event) {
356
+ this.trackFooterLinkClick(e, {
357
+ label: "Cookie Preferences",
358
+ clickUrl: (e.currentTarget as HTMLAnchorElement).href || "#"
359
+ });
360
+ this.openOneTrustInfoDisplay();
361
+ }
362
+
363
+ private handleTermsClick(e: Event) {
364
+ this.trackFooterLinkClick(e);
365
+ }
366
+
367
+ private handleCopyrightLinkClick(e: Event) {
368
+ this.trackFooterLinkClick(e, { label: "All rights reserved" });
369
+ }
303
370
  };
304
371
  }
305
372
 
@@ -0,0 +1,5 @@
1
+ <template lwc:render-mode="light">
2
+ <div lwc:ref="globalNavContainer" part="container">
3
+ <dx-skip-nav-link></dx-skip-nav-link>
4
+ </div>
5
+ </template>
@@ -0,0 +1,84 @@
1
+ import kebabCase from "lodash.kebabcase";
2
+ import { LightningElement, api } from "lwc";
3
+
4
+ const defaultDomain = "https://developer.salesforce.com";
5
+ const defaultLocale = "en-us";
6
+ const defaultHeaderSettingsBasePath = "/c/public/header-settings";
7
+ const headerSettingsJsonKeys = [
8
+ "regionSelectorOverride",
9
+ "contactLinksOverride"
10
+ ];
11
+
12
+ export default class DevExNavigation extends LightningElement {
13
+ static renderMode = "light";
14
+
15
+ @api locale: string = defaultLocale;
16
+ @api path: string = defaultHeaderSettingsBasePath;
17
+ @api domain: string = defaultDomain;
18
+
19
+ async connectedCallback(): Promise<void> {
20
+ try {
21
+ const headerSettingsResponse = await fetch(
22
+ `${this.domain}${this.path}/${this.locale}.json`,
23
+ {
24
+ headers: {
25
+ "Content-Type": "application/json"
26
+ }
27
+ }
28
+ );
29
+ if (headerSettingsResponse.ok) {
30
+ this.createFullNav(await headerSettingsResponse.json());
31
+ } else {
32
+ this.createBarebonesNav();
33
+ }
34
+ } catch (ex) {
35
+ console.error(`Navigation error: ${ex}`);
36
+ this.createBarebonesNav();
37
+ }
38
+ }
39
+
40
+ private createGlobalNav(globalNavSettings: any): HTMLElement {
41
+ const hgfNav = document.createElement("hgf-c360nav");
42
+
43
+ Object.entries(globalNavSettings).forEach(([key, value]) => {
44
+ if (headerSettingsJsonKeys.includes(key)) {
45
+ value = JSON.stringify(value);
46
+ }
47
+ hgfNav.setAttribute(kebabCase(key), value as string);
48
+ });
49
+
50
+ return hgfNav;
51
+ }
52
+
53
+ private createContextNav(contextNavData: any): HTMLElement {
54
+ const hgfNavContext = document.createElement("hgf-c360contextnav");
55
+ hgfNavContext.setAttribute("data", JSON.stringify(contextNavData));
56
+ return hgfNavContext;
57
+ }
58
+
59
+ private createFullNav(headerData: any): void {
60
+ const hgfNav = this.createGlobalNav(headerData.headerSettings);
61
+ const hgfNavContext = this.createContextNav(headerData.navItems);
62
+ const containerEl = this.refs.globalNavContainer as Element;
63
+ containerEl.appendChild(hgfNav);
64
+ containerEl.appendChild(hgfNavContext);
65
+ }
66
+
67
+ private createBarebonesNav(): void {
68
+ const hgfNav = this.createGlobalNav({
69
+ origin: "",
70
+ contextNavEnabled: "true"
71
+ });
72
+ const hgfNavContext = this.createContextNav({
73
+ variation: "static",
74
+ propertyTitle: {
75
+ label: "Developers",
76
+ url: "/"
77
+ },
78
+ menuGroup: {}
79
+ });
80
+ const containerEl = this.refs.globalNavContainer as Element;
81
+ containerEl.appendChild(hgfNav);
82
+ containerEl.appendChild(hgfNavContext);
83
+ }
84
+ }
@@ -195,7 +195,7 @@ export default class Input extends LightningElement {
195
195
  }
196
196
 
197
197
  private get shortcutImgSrc() {
198
- return `https://developer.salesforce.com/ns-assets/images/${this.commandKey}.svg`;
198
+ return `https://developer.salesforce.com/ns-assets/${this.commandKey}.svg`;
199
199
  }
200
200
 
201
201
  private get shortcutImgAlt() {
@@ -3,7 +3,7 @@ import { LightningElement, api } from "lwc";
3
3
  export default class Logo extends LightningElement {
4
4
  @api href: string = "/";
5
5
  @api imgSrc: string =
6
- "https://developer.salesforce.com/ns-assets/images/salesforce-cloud.svg";
6
+ "https://developer.salesforce.com/ns-assets/salesforce-cloud.svg";
7
7
  @api imgAlt: string = "Salesforce logo";
8
8
  @api label!: string;
9
9
  }
@@ -9,7 +9,7 @@ export default html`
9
9
  <div class="coveo-show-if-no-results">
10
10
  <div class="no-results">
11
11
  <img
12
- src="https://developer.salesforce.com/ns-assets/images/binary-cloud-circle-small.svg"
12
+ src="https://developer.salesforce.com/ns-assets/binary-cloud-circle-small.svg"
13
13
  alt="purple cloud with floating binary numbers above"
14
14
  />
15
15
  <div class="no-results-info">
@@ -311,7 +311,7 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
311
311
 
312
312
  .dx-search-header {
313
313
  padding: var(--dx-g-spacing-xl);
314
- background: url("https://developer.salesforce.com/ns-assets/images/binary-cloud-trees.svg")
314
+ background: url("https://developer.salesforce.com/ns-assets/binary-cloud-trees.svg")
315
315
  no-repeat 100% 0,
316
316
  linear-gradient(
317
317
  77deg,
@@ -352,7 +352,7 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
352
352
 
353
353
  @media (min-width: 928px) and (max-width: 1024px) {
354
354
  .dx-search-header {
355
- background: url("https://developer.salesforce.com/ns-assets/images/binary-cloud-trees.svg")
355
+ background: url("https://developer.salesforce.com/ns-assets/binary-cloud-trees.svg")
356
356
  no-repeat 200% 0,
357
357
  linear-gradient(
358
358
  77deg,
@@ -380,7 +380,7 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
380
380
 
381
381
  @media (min-width: 768px) and (max-width: 928px) {
382
382
  .dx-search-header {
383
- background: url("https://developer.salesforce.com/ns-assets/images/binary-trees.svg")
383
+ background: url("https://developer.salesforce.com/ns-assets/binary-trees.svg")
384
384
  no-repeat 90% 50%,
385
385
  linear-gradient(
386
386
  77deg,
@@ -392,7 +392,7 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
392
392
 
393
393
  @media (max-width: 768px) {
394
394
  .dx-search-header {
395
- background: url("https://developer.salesforce.com/ns-assets/images/binary.svg")
395
+ background: url("https://developer.salesforce.com/ns-assets/binary.svg")
396
396
  no-repeat 90% 50%,
397
397
  linear-gradient(
398
398
  77deg,
@@ -3,7 +3,7 @@
3
3
  <img
4
4
  if:false={hideTopGraphic}
5
5
  class="graphic"
6
- src="https://developer.salesforce.com/ns-assets/images/dx-section-banner-graphic-1.svg"
6
+ src="https://developer.salesforce.com/ns-assets/dx-section-banner-graphic-1.svg"
7
7
  alt=""
8
8
  />
9
9
  <div class="content">
@@ -69,7 +69,7 @@
69
69
  <img
70
70
  lwc:if={isSearchLoading}
71
71
  class="loading-skeleton padding-horizontal"
72
- src="https://developer.salesforce.com/ns-assets/images/sidebar-loading.svg"
72
+ src="https://developer.salesforce.com/ns-assets/sidebar-loading.svg"
73
73
  alt="loading"
74
74
  />
75
75
  <template
@@ -16,7 +16,7 @@
16
16
  <img
17
17
  if:true={showChildrenLoading}
18
18
  class="tree-children-loading"
19
- src="https://developer.salesforce.com/ns-assets/images/sidebar-item-loading.svg"
19
+ src="https://developer.salesforce.com/ns-assets/sidebar-item-loading.svg"
20
20
  alt="childrenLoading"
21
21
  />
22
22
  <template if:true={showChildren} tabindex="0">
package/LICENSE DELETED
@@ -1,12 +0,0 @@
1
- Copyright (c) 2020, Salesforce.com, Inc.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
-
8
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
-
10
- * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.