@salesforcedevs/dx-components 0.61.1 → 0.63.0

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": "0.61.1",
3
+ "version": "0.63.0",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -25,5 +25,5 @@
25
25
  "@types/lodash.get": "^4.4.6",
26
26
  "@types/vimeo__player": "^2.16.2"
27
27
  },
28
- "gitHead": "6e9bf005600ca7a99a22b99cf5d5e0618590d9ce"
28
+ "gitHead": "7c284ec7eaa387a82e1ce20d74d0aefc7346a8d7"
29
29
  }
@@ -103,17 +103,17 @@
103
103
  </dx-button>
104
104
  </dx-dropdown>
105
105
  <div class="general">
106
- <template for:each={generalLinks} for:item="general">
107
- <div class="footer-group" key={general.label}>
108
- <h2 class="subheading">{general.label}</h2>
109
- <template for:each={general.options} for:item="option">
106
+ <template for:each={generalLinks} for:item="item">
107
+ <div class="footer-group" key={item.id}>
108
+ <h2 class="subheading">{item.label}</h2>
109
+ <template for:each={item.options} for:item="option">
110
110
  <dx-footer-option
111
- key={option.label}
112
- general-label={general.label}
111
+ key={option.id}
112
+ general-label={item.label}
113
113
  label={option.label}
114
- href={option.href}
114
+ href={option.link.href}
115
115
  icon-symbol={option.iconSymbol}
116
- target={option.target}
116
+ target={option.link.target}
117
117
  ></dx-footer-option>
118
118
  </template>
119
119
  </div>
@@ -129,15 +129,22 @@
129
129
  </span>
130
130
  <div class="terms_links">
131
131
  <template for:each={termsLinks} for:item="term">
132
- <a href={term.href} key={term.label}>{term.label}</a>
132
+ <template if:true={term.onclick}>
133
+ <a
134
+ href={term.href}
135
+ key={term.label}
136
+ rel={term.rel}
137
+ onclick={term.onclick}
138
+ >
139
+ {term.label}
140
+ </a>
141
+ </template>
142
+ <template if:false={term.onclick}>
143
+ <a href={term.href} key={term.label} rel={term.rel}>
144
+ {term.label}
145
+ </a>
146
+ </template>
133
147
  </template>
134
- <a
135
- href="#"
136
- rel="nofollow"
137
- onclick={openOneTrustInfoDisplay}
138
- >
139
- Cookie Preferences
140
- </a>
141
148
  </div>
142
149
  </div>
143
150
  </div>
@@ -3,7 +3,7 @@ import cx from "classnames";
3
3
  import { FooterVariant, OptionWithLink } from "typings/custom";
4
4
  import { toJson } from "dxUtils/normalizers";
5
5
  import {
6
- generalLinks,
6
+ defaultGeneralLinks,
7
7
  termsLinks,
8
8
  socialLinks,
9
9
  privacyHref,
@@ -31,16 +31,26 @@ export default class Footer extends LightningElement {
31
31
  this._locales = toJson(value);
32
32
  }
33
33
 
34
+ @api
35
+ get generalLinks() {
36
+ return this._generalLinks;
37
+ }
38
+ set generalLinks(value) {
39
+ if (value) {
40
+ this._generalLinks = toJson(value);
41
+ }
42
+ }
43
+
44
+ private _generalLinks = defaultGeneralLinks;
34
45
  private _locales?: OptionWithLink[] | null = null;
35
- private termsLinks = termsLinks;
36
- private generalLinks = generalLinks;
37
- private socialLinks = socialLinks;
38
- private privacyHref = privacyHref;
39
- private intellectualHref = intellectualHref;
40
- private inputSubmitLabel = "Subscribe";
41
- private inputPlaceholder = "Email";
42
- private inputAriaLabel = "Email sign up for developer updates newsletter";
43
46
  private _variant: FooterVariant = "small-signup";
47
+ private inputAriaLabel = "Email sign up for developer updates newsletter";
48
+ private inputPlaceholder = "Email";
49
+ private inputSubmitLabel = "Subscribe";
50
+ private intellectualHref = intellectualHref;
51
+ private privacyHref = privacyHref;
52
+ private socialLinks = socialLinks;
53
+ private termsLinks = termsLinks;
44
54
 
45
55
  @api
46
56
  set variant(value: FooterVariant) {
@@ -108,12 +118,6 @@ export default class Footer extends LightningElement {
108
118
  );
109
119
  }
110
120
 
111
- private openOneTrustInfoDisplay = () => {
112
- if (window.OneTrust && window.OneTrust.ToggleInfoDisplay) {
113
- window.OneTrust.ToggleInfoDisplay();
114
- }
115
- };
116
-
117
121
  private isFooterVariant(value: string): value is FooterVariant {
118
122
  return [
119
123
  "no-signup",
@@ -1,83 +1,137 @@
1
- export const generalLinksRaw = [
1
+ import { OptionWithRequiredNested } from "typings/custom";
2
+
3
+ export const generalLinksRaw: OptionWithRequiredNested[] = [
2
4
  {
5
+ id: "Developer Centers",
3
6
  label: "Developer Centers",
4
7
  options: [
5
- { href: "https://devcenter.heroku.com/", label: "Heroku" },
6
- { href: "https://developer.mulesoft.com/", label: "MuleSoft" },
7
- { href: "https://www.tableau.com/developer", label: "Tableau" },
8
8
  {
9
- href: "https://developer.commercecloud.com/s/",
10
- label: "Commerce Cloud"
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"
11
22
  },
12
23
  {
13
- href: "https://www.lightningdesignsystem.com/",
14
- label: "Lightning Design System"
24
+ link: { href: "https://developer.commercecloud.com/s/" },
25
+ label: "Commerce Cloud",
26
+ id: "Commerce Cloud"
15
27
  },
16
28
  {
17
- href: "https://metamind.readme.io/",
18
- label: "Einstein"
29
+ link: { href: "https://www.lightningdesignsystem.com/" },
30
+ label: "Lightning Design System",
31
+ id: "Lightning Design System"
19
32
  },
20
- { href: "https://salesforce.quip.com/dev", label: "Quip" }
33
+ {
34
+ link: { href: "https://metamind.readme.io/" },
35
+ label: "Einstein",
36
+ id: "Einstein"
37
+ },
38
+ {
39
+ link: { href: "https://salesforce.quip.com/dev" },
40
+ label: "Quip",
41
+ id: "Quip"
42
+ }
21
43
  ]
22
44
  },
23
45
  {
46
+ id: "Popular Resources",
24
47
  label: "Popular Resources",
25
48
  options: [
26
- { href: "/docs", label: "Documentation" },
27
49
  {
28
- href: "/docs/component-library",
29
- label: "Component Library"
50
+ link: { href: "/docs" },
51
+ label: "Documentation",
52
+ id: "Documentation"
53
+ },
54
+ {
55
+ link: { href: "/docs/component-library" },
56
+ label: "Component Library",
57
+ id: "Component Library"
58
+ },
59
+ { link: { href: "/docs/apis" }, label: "APIs", id: "APIs" },
60
+ {
61
+ link: { href: "https://trailhead.salesforce.com/" },
62
+ label: "Trailhead",
63
+ id: "Trailhead"
30
64
  },
31
- { href: "/docs/apis", label: "APIs" },
32
- { href: "https://trailhead.salesforce.com/", label: "Trailhead" },
33
65
  {
34
- href: "/code-samples-and-sdks",
35
- label: "Code Samples and SDKs"
66
+ link: { href: "/code-samples-and-sdks" },
67
+ label: "Code Samples and SDKs",
68
+ id: "Code Samples and SDKs"
36
69
  },
37
- { href: "/podcast", label: "Podcasts" },
70
+ { link: { href: "/podcast" }, label: "Podcasts", id: "Podcasts" },
38
71
  {
39
- href: "https://appexchange.salesforce.com/",
40
- label: "AppExchange"
72
+ link: { href: "https://appexchange.salesforce.com/" },
73
+ label: "AppExchange",
74
+ id: "AppExchange"
41
75
  }
42
76
  ]
43
77
  },
44
78
  {
45
79
  label: "Community",
80
+ id: "Community",
46
81
  options: [
47
82
  {
48
- href: "https://trailhead.salesforce.com/trailblazer-community/feed",
49
- label: "Trailblazer Community"
83
+ link: {
84
+ href: "https://trailhead.salesforce.com/trailblazer-community/feed"
85
+ },
86
+ label: "Trailblazer Community",
87
+ id: "Trailblazer Community"
88
+ },
89
+ {
90
+ link: {
91
+ href: "/forums#!/feedtype=RECENT&criteria=ALLQUESTIONS&"
92
+ },
93
+ label: "Forums",
94
+ id: "Forums"
50
95
  },
51
96
  {
52
- href: "/forums#!/feedtype=RECENT&criteria=ALLQUESTIONS&",
53
- label: "Forums"
97
+ link: { href: "/events" },
98
+ label: "Events and Calendar",
99
+ id: "Events and Calendar"
54
100
  },
55
- { href: "/events", label: "Events and Calendar" },
56
101
  {
57
- href: "https://go.appexchange.com/partnerprogram",
58
- label: "Partner Community"
102
+ link: { href: "https://go.appexchange.com/partnerprogram" },
103
+ label: "Partner Community",
104
+ id: "Partner Community"
59
105
  },
60
- { href: "/blogs", label: "Blog" },
106
+ { link: { href: "/blogs" }, label: "Blog", id: "Blog" },
61
107
  {
62
- href: "https://admin.salesforce.com/",
63
- label: "Salesforce Admins"
108
+ link: { href: "https://admin.salesforce.com/" },
109
+ label: "Salesforce Admins",
110
+ id: "Salesforce Admins"
64
111
  },
65
112
  {
66
- href: "https://architect.salesforce.com/",
67
- label: "Salesforce Architects"
113
+ link: { href: "https://architect.salesforce.com/" },
114
+ label: "Salesforce Architects",
115
+ id: "Salesforce Architects"
68
116
  }
69
117
  ]
70
118
  }
71
119
  ];
72
120
 
73
- export const generalLinks = generalLinksRaw.map((section) => ({
121
+ export const defaultGeneralLinks = generalLinksRaw.map((section) => ({
74
122
  ...section,
75
123
  options: section.options.map((option) => {
76
- const external = option.href.startsWith("http");
124
+ if (!option.link) {
125
+ return option;
126
+ }
127
+ const external = option.link.href.startsWith("http");
77
128
  return {
78
129
  ...option,
79
- iconSymbol: external ? "new_window" : null,
80
- target: external ? "_blank" : null
130
+ link: {
131
+ ...option.link,
132
+ iconSymbol: external ? "new_window" : null,
133
+ target: external ? "_blank" : null
134
+ }
81
135
  };
82
136
  })
83
137
  }));
@@ -87,6 +141,12 @@ export const privacyHref = "https://www.salesforce.com/company/privacy/";
87
141
  export const intellectualHref =
88
142
  "https://www.salesforce.com/company/legal/intellectual/";
89
143
 
144
+ const openOneTrustInfoDisplay = () => {
145
+ if (window.OneTrust && window.OneTrust.ToggleInfoDisplay) {
146
+ window.OneTrust.ToggleInfoDisplay();
147
+ }
148
+ };
149
+
90
150
  export const termsLinks = [
91
151
  { href: privacyHref, label: "Privacy Statement" },
92
152
  {
@@ -97,7 +157,13 @@ export const termsLinks = [
97
157
  href: "https://www.salesforce.com/company/privacy/full_privacy/#nav_info",
98
158
  label: "Use of Cookies"
99
159
  },
100
- { href: "https://trust.salesforce.com/en/", label: "Trust" }
160
+ { href: "https://trust.salesforce.com/en/", label: "Trust" },
161
+ {
162
+ href: "#",
163
+ rel: "nofollow",
164
+ label: "Cookie Preferences",
165
+ onclick: openOneTrustInfoDisplay
166
+ }
101
167
  ];
102
168
 
103
169
  export const socialLinks = [