@salesforcedevs/dw-components 1.3.5-lightdom-2 → 1.3.9

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/LICENSE ADDED
@@ -0,0 +1,12 @@
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.
package/lwc.config.json CHANGED
@@ -13,7 +13,6 @@
13
13
  "dw/deSignupForm",
14
14
  "dw/docsGrid",
15
15
  "dw/eventsList",
16
- "dw/getStarted",
17
16
  "dw/instrumentation",
18
17
  "dw/newsletterForm",
19
18
  "dw/podcastSubscription",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dw-components",
3
- "version": "1.3.5-lightdom-2",
3
+ "version": "1.3.9",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -21,5 +21,6 @@
21
21
  "@types/lodash.clonedeep": "^4.5.7",
22
22
  "@types/lodash.orderby": "^4.6.7",
23
23
  "@types/lodash.uniqby": "^4.7.7"
24
- }
24
+ },
25
+ "gitHead": "4776acb3e3d37d421f444fd7ac628d5a89655aec"
25
26
  }
@@ -1,4 +1,4 @@
1
- <template lwc:render-mode="light">
1
+ <template>
2
2
  <div class={containerClass}>
3
3
  <h2 class="dx-text-heading-4"><slot></slot></h2>
4
4
 
@@ -3,8 +3,6 @@ import { SlackCtaBackgroundVariant } from "typings/custom";
3
3
  import cx from "classnames";
4
4
 
5
5
  export default class SlackAdd extends LightningElement {
6
- static renderMode = "light";
7
-
8
6
  @api innerText?: string = "Add to Slack";
9
7
  @api background?: SlackCtaBackgroundVariant;
10
8
 
@@ -23,7 +23,7 @@
23
23
  <span class="sub-heading">{userInfo.username}</span>
24
24
  <div class="heading-links">
25
25
  <a
26
- href="#"
26
+ href={logoutUrl}
27
27
  onclick={handleComponentLogoutClick}
28
28
  class="inline-link"
29
29
  >
@@ -45,17 +45,16 @@ export default class TbidLoginMenu extends LightningElement {
45
45
  private userInfo: UserInfo = {};
46
46
 
47
47
  private handleComponentLogoutClick = (event: Event) => {
48
- event.preventDefault();
49
- this.trackLogoutClick();
48
+ this.trackLogoutClick(event.currentTarget as HTMLAnchorElement);
50
49
  (
51
50
  this.template.querySelector(
52
51
  "dx-tbid-avatar-button"
53
52
  ) as unknown as TbidAvatarButton
54
- ).logout();
53
+ ).logout(event);
55
54
  };
56
55
 
57
56
  private handleComponentLoginClick = (event: Event) => {
58
- this.trackLoginClick();
57
+ this.trackLoginMenuClick(event);
59
58
  (
60
59
  this.template.querySelector(
61
60
  "dx-tbid-avatar-button"
@@ -66,22 +65,7 @@ export default class TbidLoginMenu extends LightningElement {
66
65
  private handleTbidLoginSuccess = (event: CustomEvent) => {
67
66
  event.stopPropagation();
68
67
  this.isLoggedIn = true;
69
-
70
- // Special tracking for this event only
71
- track(document, "custEv_userLogin", {
72
- authenticationMethod: "tbid",
73
- id: {
74
- tb: Object.entries(this.userInfo)
75
- .filter(([key]) => trackableUserInfo.has(key))
76
- .reduce(
77
- (infoToTrack, [key, value]) => ({
78
- ...infoToTrack,
79
- [key]: value
80
- }),
81
- {} as Record<string, string>
82
- )
83
- }
84
- });
68
+ this.trackLoginSuccess();
85
69
  };
86
70
 
87
71
  private handleTbidLogoutSuccess = (event: CustomEvent) => {
@@ -105,21 +89,20 @@ export default class TbidLoginMenu extends LightningElement {
105
89
  }
106
90
  };
107
91
 
108
- private trackLoginClick = () => {
92
+ private trackLoginSuccess = () => {
109
93
  track(document, "custEv_userLogin", {
110
- clickText: "Trailblazer.me",
111
- clickUrl: this.loginUrl,
112
- itemTitle: "TBID Login Link",
113
- elementType: "link"
114
- });
115
- };
116
-
117
- private trackLogoutClick = () => {
118
- track(document, "custEv_userLogout", {
119
- clickText: "Logout",
120
- clickUrl: this.logoutUrl,
121
- itemTitle: "TBID Logout Link",
122
- elementType: "link"
94
+ authenticationMethod: "tbid",
95
+ id: {
96
+ tb: Object.entries(this.userInfo)
97
+ .filter(([key]) => trackableUserInfo.has(key))
98
+ .reduce(
99
+ (infoToTrack, [key, value]) => ({
100
+ ...infoToTrack,
101
+ [key]: value
102
+ }),
103
+ {} as Record<string, string>
104
+ )
105
+ }
123
106
  });
124
107
  };
125
108
 
@@ -149,7 +132,7 @@ export default class TbidLoginMenu extends LightningElement {
149
132
  // Track link clicks on the "logged out" version of the dropdown.
150
133
  private trackLoginMenuClick = (event: Event) => {
151
134
  const target = event.currentTarget as HTMLAnchorElement | null;
152
- this.trackMenuClick(target, "custEv_userLogin", "login:salesforce:");
135
+ this.trackMenuClick(target, "custEv_loginClick", "login:salesforce:");
153
136
  };
154
137
 
155
138
  // Track link clicks on the "logged in" version of the dropdown.
@@ -157,4 +140,9 @@ export default class TbidLoginMenu extends LightningElement {
157
140
  const target = event.currentTarget as HTMLAnchorElement | null;
158
141
  this.trackMenuClick(target, "custEv_loginMenuClick", "login:tbid:");
159
142
  };
143
+
144
+ // Special tracking for clicking on "Logout" specifically
145
+ private trackLogoutClick = (target: HTMLAnchorElement | null) => {
146
+ this.trackMenuClick(target, "custEv_userLogout", "login:tbid:");
147
+ };
160
148
  }
@@ -1,44 +0,0 @@
1
- .home-banner-main {
2
- display: flex;
3
- flex-direction: column;
4
- justify-content: center;
5
- align-items: center;
6
- padding: var(--dx-g-spacing-lg) var(--dx-g-page-padding-horizontal);
7
- margin-bottom: var(--dx-g-spacing-3xl);
8
- width: 100%;
9
- height: 532px;
10
- text-align: center;
11
- background-position: center;
12
- background-size: cover;
13
- background-repeat: no-repeat;
14
- background-image: url("/assets/images/home-banner-main.svg");
15
- }
16
-
17
- /* WIDESCREEN */
18
-
19
- @media screen and (min-width: 1440px) {
20
- .home-banner-main {
21
- height: calc(100vw * 0.369444);
22
- }
23
- }
24
-
25
- /* TABLET */
26
-
27
- @media screen and (max-width: 1024px) {
28
- .home-banner-main {
29
- height: 380px;
30
- margin-bottom: var(--dx-g-spacing-xl);
31
- }
32
-
33
- .home-banner-main .home-banner_heading {
34
- font-size: 26px;
35
- }
36
- }
37
-
38
- @media screen and (max-width: 768px) {
39
- .home-banner-main {
40
- align-items: flex-start;
41
- text-align: left;
42
- margin-bottom: 0;
43
- }
44
- }
@@ -1,15 +0,0 @@
1
- <template lwc:render-mode="light">
2
- <div class="home-banner-main">
3
- <h1 class="home-banner_heading dx-text-heading-2">{headerText}</h1>
4
- <div class="home-banner_button">
5
- <dx-button
6
- onclick={trackClick}
7
- href={href}
8
- target="_blank"
9
- size="hero"
10
- >
11
- {buttonText}
12
- </dx-button>
13
- </div>
14
- </div>
15
- </template>
@@ -1,26 +0,0 @@
1
- import { LightningElement, api } from "lwc";
2
- import { track } from "dxUtils/analytics";
3
-
4
- export default class GetStarted extends LightningElement {
5
- static renderMode = "light";
6
-
7
- @api
8
- buttonText = "Get Started";
9
-
10
- @api
11
- headerText = "innovation.start(here);";
12
-
13
- @api
14
- href = "/get-started";
15
-
16
- trackClick(event: Event): void {
17
- track(event.target!, "custEv_ctaButtonClick", {
18
- clickText: this.buttonText,
19
- itemTitle: this.headerText,
20
- clickUrl: this.href,
21
- elementType: "button",
22
- destinationType: "internal",
23
- ctaClick: true
24
- });
25
- }
26
- }