@salesforcedevs/dx-components 1.27.2 → 1.27.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.27.2",
3
+ "version": "1.27.3",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -41,11 +41,12 @@
41
41
  "@types/uuid": "8.3.4",
42
42
  "@types/vimeo__player": "2.18.3",
43
43
  "eventsourcemock": "2.0.0",
44
- "luxon": "3.4.4"
44
+ "luxon": "3.4.4",
45
+ "msw": "^2.12.4"
45
46
  },
46
47
  "volta": {
47
48
  "node": "20.19.0",
48
49
  "yarn": "1.22.19"
49
50
  },
50
- "gitHead": "4b8dda74b7cfa376e2c79b502c63209918778c8a"
51
+ "gitHead": "3eff5eb290ade403b407e4163c34fbf48900d662"
51
52
  }
@@ -48,11 +48,6 @@ footer.signup-variant-no-signup {
48
48
  color: var(--dx-footer-themed-header-color);
49
49
  }
50
50
 
51
- .term-icon {
52
- width: 35px;
53
- margin: 0 var(--dx-g-spacing-xs);
54
- }
55
-
56
51
  /* TOP */
57
52
 
58
53
  .content-container_top {
@@ -160,127 +155,6 @@ footer.signup-variant-no-signup {
160
155
  background-size: 101%;
161
156
  }
162
157
 
163
- /* MIDDLE */
164
-
165
- .content-container_middle {
166
- display: grid;
167
- grid-gap: var(--dx-g-spacing-xl);
168
- grid-template:
169
- "logo general" auto
170
- "socials general" max-content
171
- "locales general" max-content / auto max-content;
172
- background: var(--dx-footer-themed-background-color);
173
- padding-top: var(--dx-g-spacing-4xl);
174
- padding-bottom: var(--dx-g-spacing-3xl);
175
- }
176
-
177
- .logo {
178
- grid-area: logo;
179
- width: max-content;
180
- height: var(--dx-g-spacing-4xl);
181
- }
182
-
183
- .logo > img {
184
- height: 100%;
185
- user-select: none;
186
- -webkit-user-drag: none;
187
- }
188
-
189
- .general {
190
- grid-area: general;
191
- display: grid;
192
- grid-template-columns: repeat(3, max-content);
193
- grid-gap: var(--dx-g-spacing-4xl);
194
- }
195
-
196
- .locales {
197
- grid-area: locales;
198
- }
199
-
200
- .socials {
201
- grid-area: socials;
202
- display: grid;
203
- grid-template-columns: repeat(3, max-content);
204
- grid-auto-rows: min-content;
205
- grid-gap: var(--dx-g-spacing-sm);
206
- }
207
-
208
- .socials > a {
209
- border-radius: 50%;
210
- height: var(--dx-g-spacing-xl);
211
- width: var(--dx-g-spacing-xl);
212
- flex-shrink: 0;
213
- display: flex;
214
- justify-content: center;
215
- align-items: center;
216
- color: var(--dx-g-cloud-blue-vibrant-95);
217
- }
218
-
219
- .terms a {
220
- color: var(--dx-g-blue-vibrant-70);
221
- text-decoration: underline;
222
- }
223
-
224
- .terms > span,
225
- .terms_links > a {
226
- margin: var(--dx-g-spacing-sm) 0;
227
- }
228
-
229
- .terms > span > a {
230
- display: inline;
231
- }
232
-
233
- .terms a:hover {
234
- color: var(--dx-g-blue-vibrant-80);
235
- }
236
-
237
- .socials > a:hover {
238
- background: var(--dx-g-blue-vibrant-80);
239
- }
240
-
241
- .socials > a > svg {
242
- fill: var(--dx-footer-themed-svg-icon-color);
243
- height: 100%;
244
- }
245
-
246
- /* BOTTOM */
247
- .content-container_bottom {
248
- display: flex;
249
- background: var(--dx-footer-themed-terms-and-conditions-background-color);
250
- }
251
-
252
- .content-container_bottom a {
253
- text-decoration: underline;
254
- }
255
-
256
- .terms {
257
- width: 100%;
258
- display: flex;
259
- justify-content: center;
260
- flex-wrap: wrap;
261
- font-family: var(--dx-g-font-sans);
262
- font-size: var(--dx-g-text-xs);
263
- margin: var(--dx-g-spacing-md) 0;
264
- }
265
-
266
- .terms > span {
267
- padding-right: var(--dx-g-spacing-lg);
268
- color: white;
269
- }
270
-
271
- .terms > span > img {
272
- margin-right: var(--dx-g-spacing-xs);
273
- }
274
-
275
- .terms_links {
276
- display: flex;
277
- flex-wrap: wrap;
278
- }
279
-
280
- .terms_links > *:not(:last-child) {
281
- margin-right: var(--dx-g-spacing-lg);
282
- }
283
-
284
158
  @media screen and (min-width: 1400px) {
285
159
  .content-container_top_large:not(.content-container_top_large_no_signup) {
286
160
  /* takes into account the background assets' h:w ratio */
@@ -332,30 +206,6 @@ footer.signup-variant-no-signup {
332
206
  width: 320px;
333
207
  }
334
208
 
335
- /* MIDDLE */
336
- .content-container_middle {
337
- grid-gap: var(--dx-g-spacing-lg);
338
- padding-top: var(--dx-g-spacing-2xl);
339
- padding-bottom: var(--dx-g-spacing-2xl);
340
- }
341
-
342
- .logo {
343
- height: var(--dx-g-spacing-2xl);
344
- }
345
-
346
- .socials > a {
347
- height: var(--dx-g-spacing-lg);
348
- width: var(--dx-g-spacing-lg);
349
- }
350
-
351
- .socials > a > dx-icon {
352
- --dx-c-icon-size: var(--dx-g-icon-size-xs);
353
- }
354
-
355
- .socials > a.github > dx-icon {
356
- --dx-c-icon-size: var(--dx-g-spacing-lg);
357
- }
358
-
359
209
  .general {
360
210
  grid-gap: var(--dx-g-spacing-xl);
361
211
  }
@@ -416,11 +266,6 @@ footer.signup-variant-no-signup {
416
266
  .subscription p {
417
267
  width: 100%;
418
268
  }
419
-
420
- /* MIDDLE */
421
- .content-container_middle {
422
- display: none;
423
- }
424
269
  }
425
270
 
426
271
  /* MOBILE - SMALL */
@@ -429,8 +274,4 @@ footer.signup-variant-no-signup {
429
274
  .subscription dx-input {
430
275
  width: 100%;
431
276
  }
432
-
433
- .term-icon {
434
- margin-left: 0;
435
- }
436
277
  }
@@ -42,104 +42,9 @@
42
42
  onslotchange={onSlotChange}
43
43
  ></slot>
44
44
  </div>
45
- <div
46
- if:true={showContainerMiddle}
47
- class="content-container content-container_middle"
48
- >
49
- <a class="logo" href="/">
50
- <img
51
- src="https://a.sfdcstatic.com/developer-website/prod/images/salesforce-logo-corporate.svg"
52
- alt="Salesforce logo"
53
- />
54
- </a>
55
- <div class="socials">
56
- <template for:each={socialLinks} for:item="link">
57
- <a
58
- aria-label={link.label}
59
- href={link.href}
60
- key={link.iconSymbol}
61
- class={link.iconSymbol}
62
- target="_blank"
63
- rel="noopener"
64
- >
65
- <svg
66
- xmlns="http://www.w3.org/2000/svg"
67
- part="svg"
68
- aria-hidden="true"
69
- >
70
- <use xlink:href={link.iconURL}></use>
71
- </svg>
72
- </a>
73
- </template>
74
- </div>
75
- <dx-dropdown
76
- if:true={hasLocales}
77
- class="locales"
78
- options={locales}
79
- value={locale}
80
- onchange={onLocaleChange}
81
- small
82
- >
83
- <dx-button
84
- class="locales-selector"
85
- icon-symbol="chevrondown"
86
- aria-label="Select Locale"
87
- >
88
- {localeLabel}
89
- </dx-button>
90
- </dx-dropdown>
91
- <div class="general">
92
- <template for:each={generalLinks} for:item="item">
93
- <div class="footer-group" key={item.id}>
94
- <h2 class="subheading">{item.label}</h2>
95
- <template for:each={item.options} for:item="option">
96
- <dx-footer-option
97
- key={option.id}
98
- general-label={item.label}
99
- label={option.label}
100
- href={option.link.href}
101
- target={option.link.target}
102
- ></dx-footer-option>
103
- </template>
104
- </div>
105
- </template>
106
- </div>
107
- </div>
108
- <div class="content-container content-container_bottom">
109
- <div class="terms">
110
- <span>
111
- &copy; Copyright {currentYear} Salesforce, Inc.&nbsp;
112
- <a href={intellectualHref}>All rights reserved.</a>
113
- &nbsp;Various trademarks held by their respective
114
- owners.&nbsp; Salesforce, Inc. Salesforce Tower, 415 Mission
115
- Street, 3rd Floor, San Francisco, CA 94105, United States
116
- </span>
117
- <div class="terms_links">
118
- <template for:each={termsLinks} for:item="term">
119
- <template if:true={term.onclick}>
120
- <a
121
- href={term.href}
122
- key={term.label}
123
- rel={term.rel}
124
- onclick={term.onclick}
125
- >
126
- {term.label}
127
- </a>
128
- </template>
129
- <template if:false={term.onclick}>
130
- <a href={term.href} key={term.label} rel={term.rel}>
131
- <img
132
- if:true={term.img}
133
- class="term-icon"
134
- src={term.img}
135
- alt="Footer Term Icon"
136
- />
137
- {term.label}
138
- </a>
139
- </template>
140
- </template>
141
- </div>
142
- </div>
143
- </div>
45
+ <dx-footer-mfe
46
+ legal-only={showLegalOnly}
47
+ origin={mfeConfigOrigin}
48
+ ></dx-footer-mfe>
144
49
  </footer>
145
50
  </template>
@@ -1,48 +1,17 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import cx from "classnames";
3
- import {
4
- FooterVariant,
5
- LightningSlotElement,
6
- OptionWithLink
7
- } from "typings/custom";
8
- import { toJson } from "dxUtils/normalizers";
9
- import {
10
- defaultGeneralLinks,
11
- termsLinks,
12
- socialLinks,
13
- intellectualHref
14
- } from "./links";
3
+ import { FooterVariant, LightningSlotElement } from "typings/custom";
15
4
  import { track } from "dxUtils/analytics";
16
5
  import { isSlotEmpty } from "dxUtils/slot";
17
6
 
18
7
  export default class Footer extends LightningElement {
19
- @api locale: string | null = null;
20
- @api
21
- get locales() {
22
- return this._locales;
23
- }
24
- set locales(value: OptionWithLink[] | string | null) {
25
- this._locales = toJson(value);
26
- }
27
-
28
- @api
29
- get generalLinks() {
30
- return this._generalLinks;
31
- }
32
- set generalLinks(value) {
33
- if (value) {
34
- this._generalLinks = toJson(value);
35
- }
36
- }
37
-
38
- private _generalLinks = defaultGeneralLinks;
39
- private _locales: OptionWithLink[] | null = null;
40
8
  private _variant: FooterVariant = "small-signup";
41
- private intellectualHref = intellectualHref;
42
9
  private isSlotEmpty = true;
43
- private socialLinks = socialLinks;
44
- private termsLinks = termsLinks;
45
- private signupUrl = "https://www.salesforce.com/form/other/role-based-newsletter/?Developer=true";
10
+ private signupUrl =
11
+ "https://www.salesforce.com/form/other/role-based-newsletter/?Developer=true";
12
+
13
+ @api
14
+ mfeConfigOrigin: string = `${window.location.origin}/developer/en-us/wp-json`;
46
15
 
47
16
  @api
48
17
  set variant(value: FooterVariant) {
@@ -58,8 +27,8 @@ export default class Footer extends LightningElement {
58
27
  return this._variant;
59
28
  }
60
29
 
61
- get showContainerMiddle() {
62
- return this.variant !== "terms-only";
30
+ get showLegalOnly() {
31
+ return this.variant === "terms-only";
63
32
  }
64
33
 
65
34
  get showLargeSignup() {
@@ -74,21 +43,6 @@ export default class Footer extends LightningElement {
74
43
  return this.variant === "large-no-signup";
75
44
  }
76
45
 
77
- get hasLocales() {
78
- return this.locale && this.locales;
79
- }
80
-
81
- get localeLabel(): string | null {
82
- let label = null;
83
- if (this.locale && this.locales) {
84
- const locale = (this.locales as OptionWithLink[]).find(
85
- (l) => l.id === this.locale
86
- );
87
- label = locale ? locale.label : null;
88
- }
89
- return label;
90
- }
91
-
92
46
  get currentYear(): number {
93
47
  const date = new Date();
94
48
  return date.getFullYear();
@@ -113,12 +67,6 @@ export default class Footer extends LightningElement {
113
67
  );
114
68
  }
115
69
 
116
- private onLocaleChange(e: CustomEvent) {
117
- this.dispatchEvent(
118
- new CustomEvent("localechange", { detail: e.detail })
119
- );
120
- }
121
-
122
70
  private onSlotChange(e: LightningSlotElement): void {
123
71
  this.isSlotEmpty = isSlotEmpty(e);
124
72
  }
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <div lwc:dom="manual"></div>
3
+ </template>
@@ -0,0 +1,22 @@
1
+ import { LightningElement, api } from "lwc";
2
+
3
+ export default class FooterMfe extends LightningElement {
4
+ private footerElement: HTMLElement | null = null;
5
+
6
+ @api legalOnly = false;
7
+ @api origin: string = `${window.location.origin}/developer/en-us/wp-json`;
8
+
9
+ renderedCallback() {
10
+ // Since the footer is a third-party component, we need to create it dynamically (LWC won't recognize it as a valid component).
11
+ if (this.footerElement) {
12
+ return;
13
+ }
14
+ this.footerElement = document.createElement("hgf-footer");
15
+ this.footerElement.setAttribute("origin", this.origin);
16
+ this.footerElement.setAttribute("hide-language-selector", "true");
17
+ if (this.legalOnly) {
18
+ this.footerElement.setAttribute("legal-only", "true");
19
+ }
20
+ this.template.querySelector("div")!.appendChild(this.footerElement);
21
+ }
22
+ }
@@ -1,228 +0,0 @@
1
- import { OptionWithRequiredNested } from "typings/custom";
2
-
3
- export const generalLinksRaw: OptionWithRequiredNested[] = [
4
- {
5
- id: "Developer Centers",
6
- label: "Developer Centers",
7
- options: [
8
- {
9
- link: { href: "https://devcenter.heroku.com/" },
10
- label: "Heroku",
11
- id: "Heroku"
12
- },
13
- {
14
- link: { href: "https://developer.mulesoft.com/" },
15
- label: "MuleSoft",
16
- id: "MuleSoft"
17
- },
18
- {
19
- link: { href: "https://www.tableau.com/developer" },
20
- label: "Tableau",
21
- id: "Tableau"
22
- },
23
- {
24
- link: { href: "/developer-centers/commerce-cloud" },
25
- label: "Commerce Cloud",
26
- id: "Commerce Cloud"
27
- },
28
- {
29
- link: { href: "https://www.lightningdesignsystem.com/" },
30
- label: "Lightning Design System",
31
- id: "Lightning Design System"
32
- },
33
- {
34
- link: {
35
- href: "/developer-centers/einstein-1-studio"
36
- },
37
- label: "Einstein",
38
- id: "Einstein"
39
- },
40
- {
41
- link: { href: "https://salesforce.quip.com/dev" },
42
- label: "Quip",
43
- id: "Quip"
44
- }
45
- ]
46
- },
47
- {
48
- id: "Popular Resources",
49
- label: "Popular Resources",
50
- options: [
51
- {
52
- link: { href: "/docs" },
53
- label: "Documentation",
54
- id: "Documentation"
55
- },
56
- {
57
- link: { href: "/docs/component-library" },
58
- label: "Component Library",
59
- id: "Component Library"
60
- },
61
- { link: { href: "/docs/apis" }, label: "APIs", id: "APIs" },
62
- {
63
- link: { href: "https://trailhead.salesforce.com/" },
64
- label: "Trailhead",
65
- id: "Trailhead"
66
- },
67
- {
68
- link: { href: "/sample-apps" },
69
- label: "Sample Apps",
70
- id: "Sample Apps"
71
- },
72
- { link: { href: "/podcast" }, label: "Podcasts", id: "Podcasts" },
73
- {
74
- link: { href: "https://appexchange.salesforce.com/" },
75
- label: "AppExchange",
76
- id: "AppExchange"
77
- }
78
- ]
79
- },
80
- {
81
- label: "Community",
82
- id: "Community",
83
- options: [
84
- {
85
- link: {
86
- href: "https://trailhead.salesforce.com/trailblazer-community/feed"
87
- },
88
- label: "Trailblazer Community",
89
- id: "Trailblazer Community"
90
- },
91
- {
92
- link: { href: "/events" },
93
- label: "Events and Calendar",
94
- id: "Events and Calendar"
95
- },
96
- {
97
- link: {
98
- href: "https://www.salesforce.com/partners/become-a-partner/"
99
- },
100
- label: "Partner Community",
101
- id: "Partner Community"
102
- },
103
- { link: { href: "/blogs" }, label: "Blog", id: "Blog" },
104
- {
105
- link: { href: "https://admin.salesforce.com/" },
106
- label: "Salesforce Admins",
107
- id: "Salesforce Admins"
108
- },
109
- {
110
- link: { href: "https://architect.salesforce.com/" },
111
- label: "Salesforce Architects",
112
- id: "Salesforce Architects"
113
- }
114
- ]
115
- }
116
- ];
117
-
118
- export const defaultGeneralLinks = generalLinksRaw.map((section) => ({
119
- ...section,
120
- options: section.options.map((option) => {
121
- if (!option.link) {
122
- return option;
123
- }
124
- const external = option.link.href.startsWith("http");
125
- return {
126
- ...option,
127
- link: {
128
- ...option.link,
129
- target: external ? "_blank" : null
130
- }
131
- };
132
- })
133
- }));
134
-
135
- export const privacyHref = "https://www.salesforce.com/company/privacy/";
136
-
137
- export const intellectualHref =
138
- "https://www.salesforce.com/company/legal/intellectual/";
139
-
140
- const openOneTrustInfoDisplay = () => {
141
- if (
142
- (window as any).OneTrust &&
143
- (window as any).OneTrust.ToggleInfoDisplay
144
- ) {
145
- (window as any).OneTrust.ToggleInfoDisplay();
146
- }
147
- };
148
-
149
- export const termsLinks = [
150
- { href: privacyHref, label: "Privacy Information" },
151
- {
152
- href: "https://www.salesforce.com/company/legal/program-agreement/",
153
- label: "Terms of Service"
154
- },
155
- {
156
- href: "https://www.salesforce.com/company/legal/",
157
- label: "Legal"
158
- },
159
- {
160
- href: "https://www.salesforce.com/company/privacy/full_privacy/#nav_info",
161
- label: "Use of Cookies"
162
- },
163
- { href: "https://trust.salesforce.com/en/", label: "Trust" },
164
- {
165
- href: "#",
166
- rel: "nofollow",
167
- label: "Cookie Preferences",
168
- onclick: openOneTrustInfoDisplay
169
- },
170
- {
171
- href: "https://www.salesforce.com/form/other/privacy-request/",
172
- label: "Your Privacy Choices",
173
- img: "https://a.sfdcstatic.com/developer-website/prod/images/privacyoptions.svg"
174
- },
175
- {
176
- href: "https://www.salesforce.com/company/disclosure/",
177
- label: "Responsible Disclosure"
178
- },
179
- {
180
- href: "https://www.salesforce.com/company/contact-us/?d=cta-glob-footer-11",
181
- label: "Contact"
182
- }
183
- ];
184
-
185
- export const socialLinks = [
186
- {
187
- href: "https://developer.salesforce.com/blogs/feed",
188
- iconSymbol: "rss",
189
- iconURL: "/assets/icons/brand-sprite/svg/symbols.svg#themed-rss",
190
- iconSprite: "general",
191
- label: "RSS"
192
- },
193
- {
194
- href: "https://www.instagram.com/salesforcedevs",
195
- iconSymbol: "instagram",
196
- iconURL: "/assets/icons/brand-sprite/svg/symbols.svg#themed-instagram",
197
- iconSprite: "brand",
198
- label: "Instagram"
199
- },
200
- {
201
- href: "https://github.com/trailheadapps",
202
- iconSymbol: "github",
203
- iconURL: "/assets/icons/brand-sprite/svg/symbols.svg#themed-github",
204
- iconSprite: "brand",
205
- label: "Github"
206
- },
207
- {
208
- href: "https://twitter.com/salesforcedevs",
209
- iconSymbol: "twitter-x",
210
- iconURL: "/assets/icons/brand-sprite/svg/symbols.svg#twitter-x",
211
- iconSprite: "brand",
212
- label: "Twitter"
213
- },
214
- {
215
- href: "https://www.linkedin.com/showcase/salesforce-developers",
216
- iconSymbol: "linked-in",
217
- iconURL: "/assets/icons/brand-sprite/svg/symbols.svg#themed-linked-in",
218
- iconSprite: "brand",
219
- label: "LinkedIn"
220
- },
221
- {
222
- href: "https://www.youtube.com/user/DeveloperForce",
223
- iconSymbol: "youtube",
224
- iconURL: "/assets/icons/brand-sprite/svg/symbols.svg#themed-youtube",
225
- iconSprite: "brand",
226
- label: "Youtube"
227
- }
228
- ];