@salesforcedevs/docs-components 1.3.115 → 1.3.120-alpha.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/docs-components",
3
- "version": "1.3.115",
3
+ "version": "1.3.120-alpha.0",
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": "4a003f8c32b10b375a96b466f37a609be0a4d860"
27
+ "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
28
28
  }
@@ -72,7 +72,7 @@ dx-toc {
72
72
  }
73
73
 
74
74
  .right-nav-bar {
75
- margin-left: var(--dx-c-content-vertical-spacing);
75
+ margin-left: var(--dx-g-spacing-2xl);
76
76
  }
77
77
 
78
78
  @media screen and (max-width: 1024px) {
@@ -100,6 +100,10 @@ dx-toc {
100
100
  padding-right: 0;
101
101
  }
102
102
 
103
+ .sidebar-open {
104
+ height: 0;
105
+ }
106
+
103
107
  .left-nav-bar {
104
108
  height: unset;
105
109
  z-index: 10;
@@ -6,6 +6,7 @@
6
6
  trees={sidebarContent}
7
7
  value={sidebarValue}
8
8
  header={sidebarHeader}
9
+ ontogglesidebar={onToggleSidebar}
9
10
  >
10
11
  <slot name="sidebar-header" slot="header"></slot>
11
12
  </dx-sidebar-old>
@@ -20,13 +21,14 @@
20
21
  coveo-public-access-token={coveoPublicAccessToken}
21
22
  coveo-search-hub={coveoSearchHub}
22
23
  coveo-advanced-query-config={coveoAdvancedQueryConfig}
24
+ ontogglesidebar={onToggleSidebar}
23
25
  >
24
26
  <slot name="sidebar-header" slot="header"></slot>
25
27
  </dx-sidebar>
26
28
  </template>
27
29
  <div class="content-body-doc-phase-container">
28
30
  <slot name="doc-phase"></slot>
29
- <div class="content-body-container">
31
+ <div class={contentBodyClass}>
30
32
  <div class="content-body">
31
33
  <doc-breadcrumbs
32
34
  if:true={showBreadcrumbs}
@@ -1,4 +1,5 @@
1
1
  import { LightningElement, api, track } from "lwc";
2
+ import cx from "classnames";
2
3
  import { closest } from "kagekiri";
3
4
  import { toJson } from "dxUtils/normalizers";
4
5
  import { highlightTerms } from "dxUtils/highlight";
@@ -83,6 +84,7 @@ export default class ContentLayout extends LightningElement {
83
84
  private observer?: IntersectionObserver;
84
85
  private hasRendered: boolean = false;
85
86
  private contentLoaded: boolean = false;
87
+ private sidebarOpen: boolean = false;
86
88
 
87
89
  get shouldDisplayFeedback() {
88
90
  return this.contentLoaded && typeof Sprig !== "undefined";
@@ -125,6 +127,13 @@ export default class ContentLayout extends LightningElement {
125
127
  );
126
128
  }
127
129
 
130
+ get contentBodyClass(): string {
131
+ return cx(
132
+ "content-body-container",
133
+ this.sidebarOpen ? "sidebar-open" : ""
134
+ );
135
+ }
136
+
128
137
  connectedCallback(): void {
129
138
  const hasParentHighlightListener = closest(
130
139
  "doc-xml-content",
@@ -153,6 +162,7 @@ export default class ContentLayout extends LightningElement {
153
162
  this.adjustNavPosition();
154
163
  window.addEventListener("scroll", this.adjustNavPosition);
155
164
  window.addEventListener("resize", this.adjustNavPosition);
165
+ window.addEventListener("resize", this.checkSidebarOpen);
156
166
 
157
167
  if (!this.hasRendered) {
158
168
  this.hasRendered = true;
@@ -168,6 +178,7 @@ export default class ContentLayout extends LightningElement {
168
178
  );
169
179
  window.removeEventListener("scroll", this.adjustNavPosition);
170
180
  window.removeEventListener("resize", this.adjustNavPosition);
181
+ window.removeEventListener("resize", this.checkSidebarOpen);
171
182
  this.searchSyncer.dispose();
172
183
  this.clearRenderObserverTimer();
173
184
 
@@ -185,7 +196,7 @@ export default class ContentLayout extends LightningElement {
185
196
  }
186
197
  };
187
198
 
188
- /*
199
+ /*
189
200
  This is a workaround for the global nav sticky header being decoupled from the doc header & doc phase.
190
201
  We have to account for the global nav changing height due to animations.
191
202
  */
@@ -391,4 +402,15 @@ export default class ContentLayout extends LightningElement {
391
402
  this.setSidebarInputValue(nextSearchParam);
392
403
  this.dispatchHighlightChange(nextSearchParam);
393
404
  }
405
+
406
+ private onToggleSidebar(e: CustomEvent): void {
407
+ this.sidebarOpen = e.detail.open;
408
+ }
409
+
410
+ // since the content body is set to a height of 0 when the sidebar is open, we need to reset the sidebarOpen state when the window is resized
411
+ private checkSidebarOpen = (): void => {
412
+ if (window.innerWidth > 769) {
413
+ this.sidebarOpen = false;
414
+ }
415
+ };
394
416
  }
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.