@salesforcedevs/dx-components 1.28.2 → 1.28.4

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
@@ -56,6 +56,7 @@
56
56
  "dx/featuresListHeader",
57
57
  "dx/filterMenu",
58
58
  "dx/footer",
59
+ "dx/footerMfe",
59
60
  "dx/formattedDateTime",
60
61
  "dx/formattedRichText",
61
62
  "dx/grid",
@@ -93,7 +94,6 @@
93
94
  "dx/sidebarOld",
94
95
  "dx/sidebarFooterNav",
95
96
  "dx/skipNavLink",
96
- "dx/socials",
97
97
  "dx/spinner",
98
98
  "dx/stepSequence",
99
99
  "dx/stepSequenceStep",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.28.2",
3
+ "version": "1.28.4",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -44,5 +44,5 @@
44
44
  "luxon": "3.4.4",
45
45
  "msw": "^2.12.4"
46
46
  },
47
- "gitHead": "39f762aa6e34b9a3607c0f3ce4c1ad445c79c3bc"
47
+ "gitHead": "d11123799036226e3b1f23d80cfee54897126dd1"
48
48
  }
@@ -45,6 +45,7 @@
45
45
  <dx-footer-mfe
46
46
  legal-only={showLegalOnly}
47
47
  origin={mfeConfigOrigin}
48
+ home-href={mfeHomeHref}
48
49
  ></dx-footer-mfe>
49
50
  </footer>
50
51
  </template>
@@ -10,6 +10,9 @@ export default class Footer extends LightningElement {
10
10
  private signupUrl =
11
11
  "https://www.salesforce.com/form/other/role-based-newsletter/?Developer=true";
12
12
 
13
+ @api
14
+ mfeHomeHref: string = `/${window.location.host}`; // ugly hack: ideally this wouldn't be necessary, but the only way to remove the "See all ways to contact us" link from the footer MFE is to set this to a non-empty value other than "us"; and given the way that the footer works, the non-empty value needs to be something that can be appended to `/` and work correctly
15
+
13
16
  @api
14
17
  mfeConfigOrigin: string = `${window.location.origin}/developer/en-us/wp-json`;
15
18
 
@@ -4,6 +4,7 @@ export default class FooterMfe extends LightningElement {
4
4
  private footerElement: HTMLElement | null = null;
5
5
 
6
6
  @api legalOnly = false;
7
+ @api homeHref: string = `/${window.location.host}`; // ugly hack by default: ideally this wouldn't be necessary, but the only way to remove the "See all ways to contact us" link from the footer MFE is to set this to a non-empty value other than "us"; and given the way that the footer works, the non-empty value needs to be something that can be appended to `/` and work correctly
7
8
  @api origin: string = `${window.location.origin}/developer/en-us/wp-json`;
8
9
 
9
10
  renderedCallback() {
@@ -1,36 +0,0 @@
1
- :host {
2
- display: inline-block;
3
- }
4
-
5
- .details-section {
6
- color: var(--dx-g-text-label-color);
7
- font-family: var(--dx-g-font-display);
8
- font-size: var(--dx-g-text-xs);
9
- letter-spacing: 0.7px;
10
- margin-bottom: var(--dx-g-spacing-sm);
11
- text-transform: uppercase;
12
- }
13
-
14
- .details-section span {
15
- display: block;
16
- line-height: var(--dx-g-spacing-md);
17
- }
18
-
19
- .socials-group {
20
- display: flex;
21
- }
22
-
23
- .socials-group a:not(:last-child) {
24
- margin-right: var(--dx-g-spacing-md);
25
- }
26
-
27
- dx-icon-badge {
28
- --dx-c-icon-badge-background-color: var(--dx-g-social-svg-background-color);
29
- --dx-c-icon-badge-color: var(--dx-g-social-svg-icon-color);
30
- --dx-c-icon-badge-size: 34px;
31
- --dx-c-icon-badge-icon-size: 18px;
32
- }
33
-
34
- dx-icon-badge:hover {
35
- --dx-c-icon-badge-background-color: var(--dx-g-social-svg-hover-color);
36
- }
@@ -1,22 +0,0 @@
1
- <template>
2
- <div class="details-section" if:true={hasDetails}>
3
- <template for:each={details} for:item="detail">
4
- <span key={detail}>{detail}</span>
5
- </template>
6
- </div>
7
- <div class="socials-group">
8
- <template for:each={socials} for:item="social">
9
- <a
10
- href={social.href}
11
- key={social.name}
12
- target={linksTarget}
13
- title={social.name}
14
- >
15
- <dx-icon-badge
16
- sprite={spriteName}
17
- symbol={social.symbol}
18
- ></dx-icon-badge>
19
- </a>
20
- </template>
21
- </div>
22
- </template>
@@ -1,76 +0,0 @@
1
- import { LightningElement, api } from "lwc";
2
- import { normalizeToArray } from "dxUtils/normalizers";
3
-
4
- type Icon = { name: string; symbol: string; baseShareUrl: string };
5
-
6
- const URL_TOKEN = "{url}";
7
- const TEXT_TOKEN = "{text}";
8
-
9
- const SOCIAL_ICONS: Array<Icon> = [
10
- {
11
- name: "Twitter",
12
- symbol: "twitter",
13
- baseShareUrl: `https://twitter.com/intent/tweet?url=${URL_TOKEN}&text=${TEXT_TOKEN}`
14
- },
15
- {
16
- name: "Linkedin",
17
- symbol: "linkedin-in",
18
- baseShareUrl: `http://www.linkedin.com/sharing/share-offsite/?url=${URL_TOKEN}`
19
- }
20
- ];
21
-
22
- const SPRITE_NAME = "brand";
23
-
24
- const VALID_TARGETS = ["_self", "_blank", "_parent", "_top", "framename"];
25
-
26
- export default class Socials extends LightningElement {
27
- private _linksTarget: string = "_blank";
28
- private _details: Array<string> = [];
29
-
30
- @api
31
- get details() {
32
- return this._details;
33
- }
34
-
35
- set details(value) {
36
- this._details = normalizeToArray(value, "|") as Array<string>;
37
- }
38
-
39
- @api
40
- get linksTarget(): string {
41
- return this._linksTarget;
42
- }
43
-
44
- set linksTarget(value: string) {
45
- if (value && !VALID_TARGETS.includes(value)) {
46
- console.error(
47
- `Invalid links target, valid options are: ${VALID_TARGETS.join(
48
- ", "
49
- )}`
50
- );
51
- return;
52
- }
53
- this._linksTarget = value;
54
- }
55
-
56
- get socials() {
57
- const url = encodeURIComponent(document.location.href);
58
- const text = encodeURIComponent(document.title);
59
- return SOCIAL_ICONS.map(({ baseShareUrl, ...value }: Icon) => {
60
- return {
61
- ...value,
62
- href: baseShareUrl
63
- .replace(URL_TOKEN, url)
64
- .replace(TEXT_TOKEN, text)
65
- };
66
- });
67
- }
68
-
69
- get spriteName() {
70
- return SPRITE_NAME;
71
- }
72
-
73
- get hasDetails() {
74
- return this.details && this.details.length > 0;
75
- }
76
- }