@salesforcedevs/docs-components 1.20.13 → 1.20.15

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.20.13",
3
+ "version": "1.20.15",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -25,7 +25,7 @@
25
25
  "@types/lodash.orderby": "4.6.9",
26
26
  "@types/lodash.uniqby": "4.7.9"
27
27
  },
28
- "gitHead": "533981cf67f89f660ad584fa977baf14825f51a6",
28
+ "gitHead": "b0c563ba1d756155a08f24409062f9229efc311d",
29
29
  "volta": {
30
30
  "node": "20.19.0",
31
31
  "yarn": "1.22.19"
@@ -104,8 +104,11 @@ export default class AmfTopic extends LightningElement {
104
104
 
105
105
  // Add click handler for all links in the dynamically loaded content
106
106
  if (container) {
107
- container.removeEventListener("click", this.handleLinkClick);
108
- container.addEventListener("click", this.handleLinkClick);
107
+ if (this.isLinkTrackingHandledByAncestor()) {
108
+ container.removeEventListener("click", this.handleLinkClick);
109
+ } else {
110
+ container.addEventListener("click", this.handleLinkClick);
111
+ }
109
112
  }
110
113
 
111
114
  const isTabletOrDesktop = window.matchMedia(
@@ -124,4 +127,9 @@ export default class AmfTopic extends LightningElement {
124
127
  console.error(error);
125
128
  }
126
129
  }
130
+
131
+ private isLinkTrackingHandledByAncestor(): boolean {
132
+ const host = this.template.host as HTMLElement | undefined;
133
+ return !!host?.closest?.("doc-content-layout");
134
+ }
127
135
  }
@@ -6,8 +6,6 @@ import Button from "dx/button";
6
6
  import { highlightTerms } from "dxUtils/highlight";
7
7
  import ContentCallout from "doc/contentCallout";
8
8
  import ContentMedia from "doc/contentMedia";
9
- import { buildDocLinkClickHandler } from "dxUtils/analytics";
10
-
11
9
  const HIGHLIGHTABLE_SELECTOR = [
12
10
  "p",
13
11
  ".p",
@@ -161,8 +159,6 @@ export default class Content extends LightningElement {
161
159
  const anchorEls = divEl.querySelectorAll("a:not([href^='#'])");
162
160
 
163
161
  anchorEls.forEach((anchorEl: any) => {
164
- // Add click handler to track link clicks
165
- anchorEl.addEventListener("click", buildDocLinkClickHandler());
166
162
  if (
167
163
  anchorEl.textContent!.includes("Next →") ||
168
164
  anchorEl.textContent!.includes("← Previous")
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @lwc/lwc/no-document-query */
2
- import { LightningElement, api } from "lwc";
2
+ import { LightningElement, api, track } from "lwc";
3
3
  import { closest } from "kagekiri";
4
4
  import { toJson } from "dxUtils/normalizers";
5
5
  import { highlightTerms } from "dxUtils/highlight";
@@ -81,10 +81,12 @@ export default class ContentLayout extends LightningElement {
81
81
  );
82
82
  }
83
83
 
84
+ @track
84
85
  protected _sidebarContent: unknown;
85
86
 
86
87
  protected _breadcrumbs = null;
87
88
 
89
+ @track
88
90
  protected _tocOptions!: Array<unknown>;
89
91
 
90
92
  protected tocOptionIdsSet = new Set();