@salesforcedevs/docs-components 1.3.120-alpha.2 → 1.3.121

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