@salesforcedevs/docs-components 1.3.345-refactor-tab-alpha → 1.3.345-refactor-tab-alpha2

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.345-refactor-tab-alpha",
3
+ "version": "1.3.345-refactor-tab-alpha2",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -1,5 +1,3 @@
1
- /* eslint-disable @lwc/lwc/no-document-query */
2
- import { closest } from "kagekiri";
3
1
  import ContentLayout from "doc/contentLayout";
4
2
 
5
3
  const TOC_HEADER_TAG = "doc-heading";
@@ -103,17 +101,6 @@ export default class LwcContentLayout extends ContentLayout {
103
101
  };
104
102
 
105
103
  connectedCallback(): void {
106
- const hasParentHighlightListener = closest(
107
- "doc-xml-content",
108
- this.template.host
109
- );
110
- if (!hasParentHighlightListener) {
111
- window.addEventListener(
112
- "highlightedtermchange",
113
- this.updateHighlighted
114
- );
115
- this.searchSyncer.init();
116
- }
117
104
  window.addEventListener("popstate", this.handlePopState);
118
105
  }
119
106
 
@@ -175,6 +162,13 @@ export default class LwcContentLayout extends ContentLayout {
175
162
  this.setRNBByTab();
176
163
  if (this.showTabBasedRNB) {
177
164
  window.addEventListener("tabchanged", this.onTabChanged);
165
+ window.addEventListener(
166
+ "specificationdatarendered",
167
+ this.onTabChanged
168
+ );
169
+ window.addEventListener("selectedcontent", (event) =>
170
+ this.onRNBClick(event as CustomEvent)
171
+ );
178
172
  this.restoreTabSelection();
179
173
  }
180
174
  this.restoreScroll();
@@ -182,6 +176,14 @@ export default class LwcContentLayout extends ContentLayout {
182
176
  }
183
177
 
184
178
  disconnectedCallback(): void {
179
+ this.disconnectObserver();
180
+ window.removeEventListener(
181
+ "highlightedtermchange",
182
+ this.updateHighlighted
183
+ );
184
+ window.removeEventListener("scroll", this.adjustNavPosition);
185
+ window.removeEventListener("resize", this.adjustNavPosition);
186
+
185
187
  if (this.showTabBasedRNB) {
186
188
  window.removeEventListener("tabchanged", this.onTabChanged);
187
189
  window.removeEventListener(
@@ -193,6 +195,10 @@ export default class LwcContentLayout extends ContentLayout {
193
195
  );
194
196
  window.removeEventListener("popstate", this.handlePopState);
195
197
  }
198
+ this.searchSyncer.dispose();
199
+ this.clearRenderObserverTimer();
200
+
201
+ window.clearInterval(this._scrollInterval);
196
202
  }
197
203
 
198
204
  attachInteractionObserver = (): void => {