@salesforcedevs/docs-components 1.3.103 → 1.3.104-alpha02

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/docs-components",
3
- "version": "1.3.103",
3
+ "version": "1.3.104-alpha02",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -24,5 +24,5 @@
24
24
  "@types/lodash.orderby": "^4.6.7",
25
25
  "@types/lodash.uniqby": "^4.7.7"
26
26
  },
27
- "gitHead": "1595697b3a469a6a1723fdc4066617092739b112"
27
+ "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
28
28
  }
@@ -9,32 +9,26 @@
9
9
  .dx-callout-base,
10
10
  .dx-callout-plain {
11
11
  background-color: var(--dx-g-gray-95);
12
- border-color: var(--dx-g-gray-50);
13
12
  }
14
13
 
15
14
  .dx-callout-plain {
16
- border: none;
17
15
  margin-bottom: var(--dx-g-text-2xl);
18
16
  }
19
17
 
20
18
  .dx-callout-note {
21
19
  background-color: var(--dx-g-blue-vibrant-95);
22
- border-color: var(--dx-g-blue-vibrant-50);
23
20
  }
24
21
 
25
22
  .dx-callout-tip {
26
23
  background-color: var(--dx-g-green-natural-95);
27
- border-color: var(--dx-g-green-vibrant-60);
28
24
  }
29
25
 
30
26
  .dx-callout-caution {
31
27
  background-color: var(--dx-g-red-natural-95);
32
- border-color: var(--dx-g-red-vibrant-50);
33
28
  }
34
29
 
35
30
  .dx-callout-warning {
36
31
  background-color: var(--dx-g-red-natural-95);
37
- border-color: var(--dx-g-red-vibrant-50);
38
32
  }
39
33
 
40
34
  .dx-callout-base_section {
@@ -51,4 +45,5 @@
51
45
  .dx-callout-base_column {
52
46
  display: flex;
53
47
  flex-direction: row;
48
+ justify-content: center;
54
49
  }
@@ -43,7 +43,8 @@ dx-toc {
43
43
  .content-body-container {
44
44
  display: flex;
45
45
  flex-direction: row;
46
- padding-right: var(--dx-g-page-padding-horizontal);
46
+ justify-content: center;
47
+ padding-right: var(--sds-g-spacing-6);
47
48
  }
48
49
 
49
50
  .content-body {
@@ -51,12 +52,13 @@ dx-toc {
51
52
  var(--dx-g-spacing-xl);
52
53
  flex: 1;
53
54
  width: 0;
55
+ max-width: var(--dx-g-doc-content-max-width);
54
56
  }
55
57
 
56
58
  .is-sticky {
57
59
  height: 100vh;
58
60
  position: sticky;
59
- top: 0;
61
+ top: 135px;
60
62
  }
61
63
 
62
64
  .right-nav-bar {
@@ -77,6 +77,7 @@ export default class ContentLayout extends LightningElement {
77
77
  @track
78
78
  private _tocOptions: Array<unknown>;
79
79
 
80
+ private tocOptionIdsSet = new Set();
80
81
  private anchoredElements: AnchorMap = {};
81
82
  private lastScrollPosition: number;
82
83
  private observer?: IntersectionObserver;
@@ -220,14 +221,17 @@ export default class ContentLayout extends LightningElement {
220
221
  }
221
222
 
222
223
  onSlotChange(event: Event): void {
223
- const slotElements = (event.target as HTMLSlotElement).assignedElements();
224
+ const slotElements = (
225
+ event.target as HTMLSlotElement
226
+ ).assignedElements();
224
227
 
225
228
  if (slotElements.length) {
226
229
  this.contentLoaded = true;
227
230
  const slotContentElement = slotElements[0];
228
- const headingElements = slotContentElement.ownerDocument?.getElementsByTagName(
229
- TOC_HEADER_TAG
230
- );
231
+ const headingElements =
232
+ slotContentElement.ownerDocument?.getElementsByTagName(
233
+ TOC_HEADER_TAG
234
+ );
231
235
 
232
236
  for (const headingElement of headingElements) {
233
237
  // Sometimes elements hash is not being set when slot content is wrapped with div
@@ -239,13 +243,20 @@ export default class ContentLayout extends LightningElement {
239
243
  for (const headingElement of headingElements) {
240
244
  headingElement.id = headingElement.hash;
241
245
 
242
- // Update tocOptions from anchorTags
243
- const tocItem = {
244
- anchor: `#${headingElement.hash}`,
245
- id: headingElement.id,
246
- label: headingElement.title
247
- };
248
- tocOptions.push(tocItem);
246
+ // Update tocOptions from anchorTags only for H2, consider default as 2 as per component
247
+ const headingAriaLevel =
248
+ headingElement.attributes["aria-level"]?.nodeValue || "2";
249
+ const isH2 = headingAriaLevel === "2";
250
+
251
+ if (isH2) {
252
+ const tocItem = {
253
+ anchor: `#${headingElement.hash}`,
254
+ id: headingElement.id,
255
+ label: headingElement.title
256
+ };
257
+ tocOptions.push(tocItem);
258
+ this.tocOptionIdsSet.add(headingElement.id);
259
+ }
249
260
  }
250
261
 
251
262
  this._tocOptions = tocOptions;
@@ -296,7 +307,10 @@ export default class ContentLayout extends LightningElement {
296
307
  }
297
308
 
298
309
  private assignElementId(id: string): void {
299
- this.tocValue = id;
310
+ // Change toc(RNB) highlight only for H2
311
+ if (this.tocOptionIdsSet.has(id)) {
312
+ this.tocValue = id;
313
+ }
300
314
  }
301
315
 
302
316
  private dispatchHighlightChange(term: string): void {
@@ -82,7 +82,7 @@ header:not(.has-brand) > .header_l2 {
82
82
 
83
83
  .header_l2_group-title {
84
84
  margin-right: 0;
85
- padding: var(--dx-g-spacing-smd) var(--dx-g-page-padding-horizontal);
85
+ padding: var(--dx-g-spacing-smd) var(--dx-g-header-padding-horizontal);
86
86
  }
87
87
 
88
88
  .header_l2_group-title .header_lang-dropdown {
@@ -6,77 +6,6 @@
6
6
  if:true={showBanner}
7
7
  banner-markup={bannerMarkup}
8
8
  ></dx-banner>
9
- <div class="header_l1">
10
- <div if:true={showMenuButton} class="nav_menu-ctas">
11
- <dx-button
12
- aria-label="Menu Button"
13
- class="nav_menu-button"
14
- icon-size="large"
15
- icon-symbol={mobileMenuIconSymbol}
16
- variant="tertiary"
17
- onclick={toggleMobileNavMenu}
18
- ></dx-button>
19
- </div>
20
- <dx-logo label={title}></dx-logo>
21
- <dx-header-nav
22
- if:true={showDesktopNavItems}
23
- aria-label="Global Navigation Bar"
24
- nav-items={navItems}
25
- onrequestopennavmenu={onRequestOpenNavMenu}
26
- pathname={pathname}
27
- variant="small"
28
- ></dx-header-nav>
29
- <div class="header-cta-container">
30
- <dx-header-search
31
- if:true={hasSearch}
32
- coveo-organization-id={coveoOrganizationId}
33
- coveo-public-access-token={coveoPublicAccessToken}
34
- coveo-search-pipeline={coveoSearchPipeline}
35
- coveo-search-hub={coveoSearchHub}
36
- mobile={tablet}
37
- onstatechange={handleStateChange}
38
- ></dx-header-search>
39
- </div>
40
- <div
41
- if:true={showTbidLogin}
42
- class="header-tbid-login"
43
- onclick={closeMobileNavMenu}
44
- >
45
- <dw-tbid-login-menu
46
- tbid-api-base-url={tbidApiBaseUrl}
47
- tbid-base-url={tbidBaseUrl}
48
- ></dw-tbid-login-menu>
49
- </div>
50
- <div if:true={showSignup} class="header-login-signup">
51
- <dx-button
52
- aria-label="Browse Trials"
53
- size="small"
54
- href={signupLink}
55
- onclick={handleSignUpClick}
56
- >
57
- Browse Trials
58
- </dx-button>
59
- </div>
60
- <dx-header-mobile-nav-menu
61
- if:true={hasNavItems}
62
- nav-items={navItems}
63
- open={showMobileNavMenu}
64
- pathname={pathname}
65
- value={mobileNavMenuValue}
66
- onchange={onMobileNavMenuChange}
67
- onrequestclose={closeMobileNavMenu}
68
- >
69
- <dx-button
70
- aria-label={bailLabel}
71
- if:true={hasBailLink}
72
- href={bailHref}
73
- variant="tertiary"
74
- icon-symbol="new_window"
75
- >
76
- {bailLabel}
77
- </dx-button>
78
- </dx-header-mobile-nav-menu>
79
- </div>
80
9
  <div class="header_l2">
81
10
  <div class="header_l2_group header_l2_group-title">
82
11
  <a href={headerHref} class="home-link">
@@ -59,20 +59,6 @@ export default class Header extends HeaderBase {
59
59
  return this.scopedNavItems && this.scopedNavItems.length > 0;
60
60
  }
61
61
 
62
- private get showDesktopNavItems(): boolean {
63
- return !this.mobile && this.hasNavItems;
64
- }
65
-
66
- private get showTbidLogin(): boolean {
67
- return this.showSignup;
68
- }
69
-
70
- private get showSignup(): boolean {
71
- return this.signupLink
72
- ? (this.tablet && !this.isSearchOpen) || !this.tablet
73
- : false;
74
- }
75
-
76
62
  private get hasLanguages(): boolean {
77
63
  return !!(this.languages && this.languages.length);
78
64
  }
@@ -91,10 +77,6 @@ export default class Header extends HeaderBase {
91
77
  );
92
78
  }
93
79
 
94
- private get showMenuButton(): boolean {
95
- return this.mobile && this.hasNavItems;
96
- }
97
-
98
80
  connectedCallback(): void {
99
81
  super.connectedCallback();
100
82
  this.tabletMatchMedia = window.matchMedia(
@@ -5,11 +5,16 @@
5
5
  .doc-phase-container {
6
6
  display: flex;
7
7
  flex-direction: column;
8
- padding-left: var(--dx-g-spacing-3xl);
9
- padding-right: var(--dx-g-spacing-3xl);
8
+ align-items: center;
9
+ padding-left: var(--dx-g-header-padding-horizontal);
10
+ padding-right: var(--dx-g-header-padding-horizontal);
10
11
  width: 100%;
11
12
  }
12
13
 
14
+ .max-width-container {
15
+ max-width: var(--dx-g-doc-content-max-width);
16
+ }
17
+
13
18
  .doc-phase-title-container {
14
19
  display: flex;
15
20
  flex-direction: row;
@@ -1,28 +1,30 @@
1
1
  <template>
2
2
  <div class={className} part="container">
3
- <div class="doc-phase-title-container">
4
- <dx-icon
5
- class="doc-status-icon doc-phase-icon"
6
- symbol="recipe"
7
- size="large"
8
- color="status-icon-color"
9
- ></dx-icon>
10
- <p class="doc-status-title doc-phase-title dx-text-body-3">
11
- {docPhaseTitle}
12
- </p>
13
- <dx-button
14
- variant="inline"
15
- onclick={onButtonClick}
16
- aria-label={hideBodyText}
17
- >
18
- {hideBodyText}
19
- </dx-button>
20
- </div>
21
- <!--
3
+ <div class="max-width-container">
4
+ <div class="doc-phase-title-container">
5
+ <dx-icon
6
+ class="doc-status-icon doc-phase-icon"
7
+ symbol="recipe"
8
+ size="large"
9
+ color="status-icon-color"
10
+ ></dx-icon>
11
+ <p class="doc-status-title doc-phase-title dx-text-body-3">
12
+ {docPhaseTitle}
13
+ </p>
14
+ <dx-button
15
+ variant="inline"
16
+ onclick={onButtonClick}
17
+ aria-label={hideBodyText}
18
+ >
19
+ {hideBodyText}
20
+ </dx-button>
21
+ </div>
22
+ <!--
22
23
  NOTE: Here we are rendering mark up using lwc:dom & innerHTML
23
24
  option instead of slots because the html markup will come as a
24
25
  property to the component from a configuration
25
26
  -->
26
- <span lwc:dom="manual" class={bodyClassName}></span>
27
+ <span lwc:dom="manual" class={bodyClassName}></span>
28
+ </div>
27
29
  </div>
28
30
  </template>
@@ -4,13 +4,11 @@
4
4
  }
5
5
 
6
6
  .doc-status-base {
7
- border-left: 4px solid;
8
7
  padding: var(--doc-status-vertical-padding);
9
8
  }
10
9
 
11
10
  .doc-status-container {
12
11
  background-color: rgb(254, 243, 217);
13
- border-color: var(--dx-g-yellow-vibrant-80);
14
12
  }
15
13
 
16
14
  .doc-status-title {
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.