@salesforcedevs/docs-components 1.3.122 → 1.3.123-alpha.1

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.122",
3
+ "version": "1.3.123-alpha.1",
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": "9741a2ed52c5106459cb1bd807bafac9aff25ff3"
27
+ "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
28
28
  }
@@ -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,6 +21,7 @@
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>
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @lwc/lwc/no-document-query */
1
2
  import { LightningElement, api, track } from "lwc";
2
3
  import { closest } from "kagekiri";
3
4
  import { toJson } from "dxUtils/normalizers";
@@ -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";
@@ -185,7 +187,7 @@ export default class ContentLayout extends LightningElement {
185
187
  }
186
188
  };
187
189
 
188
- /*
190
+ /*
189
191
  This is a workaround for the global nav sticky header being decoupled from the doc header & doc phase.
190
192
  We have to account for the global nav changing height due to animations.
191
193
  */
@@ -203,7 +205,10 @@ export default class ContentLayout extends LightningElement {
203
205
  const docHeaderEl = document.querySelector(
204
206
  ".sticky-doc-header"
205
207
  ) as HTMLElement;
206
- const docPhaseEl = document.querySelector("doc-phase") as HTMLElement;
208
+
209
+ const docPhaseEl = this.template
210
+ .querySelector("[name=doc-phase]")!
211
+ .assignedElements()[0] as HTMLSlotElement;
207
212
 
208
213
  if (!sidebarEl || !globalNavEl || !contextNavEl || !docHeaderEl) {
209
214
  console.warn("One or more required elements are missing.");
@@ -236,6 +241,17 @@ export default class ContentLayout extends LightningElement {
236
241
  : globalNavHeight + docHeaderHeight
237
242
  }px`
238
243
  );
244
+
245
+ const rightNavBarEl =
246
+ this.template.querySelector(".right-nav-bar");
247
+
248
+ if (rightNavBarEl) {
249
+ rightNavBarEl.style.top = `${
250
+ globalNavHeight +
251
+ docHeaderHeight +
252
+ docPhaseEl.offsetHeight
253
+ }px`;
254
+ }
239
255
  }
240
256
  });
241
257
  };
@@ -391,4 +407,15 @@ export default class ContentLayout extends LightningElement {
391
407
  this.setSidebarInputValue(nextSearchParam);
392
408
  this.dispatchHighlightChange(nextSearchParam);
393
409
  }
410
+
411
+ private onToggleSidebar(e: CustomEvent): void {
412
+ this.sidebarOpen = e.detail.open;
413
+
414
+ // eslint-disable-next-line @lwc/lwc/no-document-query
415
+ const footer = document.querySelector("dx-footer") as HTMLElement;
416
+
417
+ if (footer) {
418
+ footer.style.display = this.sidebarOpen ? "none" : "block";
419
+ }
420
+ }
394
421
  }
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.