@salesforcedevs/docs-components 0.69.1-callout-fix-2 → 0.69.2

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": "0.69.1-callout-fix-2",
3
+ "version": "0.69.2",
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": "57f2c7b6dbeda99ecf4ad713b32816f03f0d7db3"
28
28
  }
@@ -150,7 +150,7 @@ export default class Content extends LightningElement {
150
150
  is: ContentCallout
151
151
  });
152
152
  const detailEls = calloutEl.querySelectorAll(
153
- "p, .p, div.data, ol, ul, p+.codeSection, p~.codeSection, div >.codeSection, .mediaBd > span.ph"
153
+ "p, div.data, ol, ul, p+.codeSection, .mediaBd > span.ph"
154
154
  );
155
155
  detailEls.forEach((detailEl) => {
156
156
  if (detailEl.innerHTML.trim() !== "") {
@@ -159,7 +159,7 @@ export default class Content extends LightningElement {
159
159
  });
160
160
 
161
161
  let flag = 1;
162
- for (let i: number = 0; i < detailEls.length; i++) {
162
+ for (let i = 0; i < detailEls.length; i++) {
163
163
  flag &= detailEls[i].innerHTML.trim() === "";
164
164
  }
165
165
 
@@ -78,6 +78,8 @@ export default class ContentLayout extends LightningElement {
78
78
  private anchoredElements: AnchorMap = {};
79
79
  private lastScrollPosition: number;
80
80
  private observer?: IntersectionObserver;
81
+ private hasRendered: boolean = false;
82
+
81
83
  private searchSyncer = new SearchSyncer({
82
84
  callbacks: {
83
85
  onUrlChange: (nextSearchString: string): void => {
@@ -125,6 +127,7 @@ export default class ContentLayout extends LightningElement {
125
127
  this._scrollInterval = window.setInterval(() => {
126
128
  this.saveScroll();
127
129
  }, 1000);
130
+
128
131
 
129
132
  }
130
133
 
@@ -138,7 +141,10 @@ export default class ContentLayout extends LightningElement {
138
141
  this.attachInteractionObserver,
139
142
  OBSERVER_ATTACH_WAIT_TIME
140
143
  );
141
- this.restoreScroll();
144
+ if(!this.hasRendered) {
145
+ this.hasRendered = true;
146
+ this.restoreScroll();
147
+ }
142
148
  }
143
149
 
144
150
  disconnectedCallback(): void {