@salesforcedevs/docs-components 1.3.190-3-cssalpha → 1.3.190-4-cssalpha
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 +1 -1
- package/src/modules/doc/amfReference/amfReference.ts +12 -1
- package/src/modules/doc/contentLayout/contentLayout.ts +0 -20
- package/src/modules/doc/header/header.css +6 -6
- package/src/modules/doc/header/header.html +1 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +2 -1
- package/src/modules/docUtils/utils/utils.ts +25 -0
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./constants";
|
|
28
28
|
import { restoreScroll } from "dx/scrollManager";
|
|
29
29
|
import { DocPhaseInfo } from "typings/custom";
|
|
30
|
-
import { oldVersionDocInfo } from "docUtils/utils";
|
|
30
|
+
import { logCoveoPageView, oldVersionDocInfo } from "docUtils/utils";
|
|
31
31
|
|
|
32
32
|
type NavigationItem = {
|
|
33
33
|
label: string;
|
|
@@ -822,6 +822,7 @@ export default class AmfReference extends LightningElement {
|
|
|
822
822
|
if (meta) {
|
|
823
823
|
// update the encoded url meta param
|
|
824
824
|
const encodedMeta = this.getUrlEncoded(meta);
|
|
825
|
+
|
|
825
826
|
window.history.replaceState(
|
|
826
827
|
window.history.state,
|
|
827
828
|
"",
|
|
@@ -1155,6 +1156,7 @@ export default class AmfReference extends LightningElement {
|
|
|
1155
1156
|
"",
|
|
1156
1157
|
selectedItemMetaData.meta
|
|
1157
1158
|
);
|
|
1159
|
+
|
|
1158
1160
|
this.updateUrlWithSelected(
|
|
1159
1161
|
selectedItemMetaData.parentReferencePath,
|
|
1160
1162
|
selectedItemMetaData.meta
|
|
@@ -1198,6 +1200,9 @@ export default class AmfReference extends LightningElement {
|
|
|
1198
1200
|
*/
|
|
1199
1201
|
|
|
1200
1202
|
private loadMarkdownBasedReference(referenceUrl?: string | null): void {
|
|
1203
|
+
// MILES TODO: figure out if we ever need to log a coveo page view in here
|
|
1204
|
+
// this would be the case if at some point we 'load' a new 'markdown based reference'
|
|
1205
|
+
// without actually triggering a page load
|
|
1201
1206
|
let referenceId = "";
|
|
1202
1207
|
const currentUrl = window.location.href;
|
|
1203
1208
|
if (this.isProjectRootPath()) {
|
|
@@ -1278,6 +1283,7 @@ export default class AmfReference extends LightningElement {
|
|
|
1278
1283
|
if (this.oldVersionInfo) {
|
|
1279
1284
|
this.showVersionBanner = true;
|
|
1280
1285
|
}
|
|
1286
|
+
|
|
1281
1287
|
this.updateDocPhase();
|
|
1282
1288
|
this.selectedSidebarValue = window.location.pathname;
|
|
1283
1289
|
}
|
|
@@ -1341,6 +1347,11 @@ export default class AmfReference extends LightningElement {
|
|
|
1341
1347
|
elementId,
|
|
1342
1348
|
metaVal
|
|
1343
1349
|
);
|
|
1350
|
+
|
|
1351
|
+
logCoveoPageView(
|
|
1352
|
+
this.coveoOrganizationId,
|
|
1353
|
+
this.coveoAnalyticsToken
|
|
1354
|
+
);
|
|
1344
1355
|
this.updateUrlWithSelected(parentReferencePath, metaVal);
|
|
1345
1356
|
this.updateNavTitleMetaTag(metadata.navTitle);
|
|
1346
1357
|
} else {
|
|
@@ -4,7 +4,6 @@ import { closest } from "kagekiri";
|
|
|
4
4
|
import { toJson } from "dxUtils/normalizers";
|
|
5
5
|
import { highlightTerms } from "dxUtils/highlight";
|
|
6
6
|
import { SearchSyncer } from "docUtils/searchSyncer";
|
|
7
|
-
import { CoveoAnalyticsClient } from "coveo.analytics";
|
|
8
7
|
|
|
9
8
|
type AnchorMap = { [key: string]: { intersect: boolean; id: string } };
|
|
10
9
|
|
|
@@ -37,7 +36,6 @@ export default class ContentLayout extends LightningElement {
|
|
|
37
36
|
@api coveoSearchHub!: string;
|
|
38
37
|
@api coveoAdvancedQueryConfig!: string;
|
|
39
38
|
@api useOldSidebar?: boolean = false;
|
|
40
|
-
@api logCoveoPageViewOnlyOnConnect: boolean = false;
|
|
41
39
|
|
|
42
40
|
@api
|
|
43
41
|
get breadcrumbs() {
|
|
@@ -130,19 +128,6 @@ export default class ContentLayout extends LightningElement {
|
|
|
130
128
|
);
|
|
131
129
|
}
|
|
132
130
|
|
|
133
|
-
private logCoveoPageView() {
|
|
134
|
-
if (this.coveoOrganizationId && this.coveoAnalyticsToken) {
|
|
135
|
-
const ua = new CoveoAnalyticsClient({
|
|
136
|
-
token: this.coveoAnalyticsToken,
|
|
137
|
-
endpoint: `https://${this.coveoOrganizationId}.analytics.org.coveo.com`
|
|
138
|
-
});
|
|
139
|
-
ua.sendViewEvent({
|
|
140
|
-
contentIdKey: "@clickableuri",
|
|
141
|
-
contentIdValue: window.location.href
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
131
|
connectedCallback(): void {
|
|
147
132
|
const hasParentHighlightListener = closest(
|
|
148
133
|
"doc-xml-content",
|
|
@@ -155,9 +140,6 @@ export default class ContentLayout extends LightningElement {
|
|
|
155
140
|
);
|
|
156
141
|
this.searchSyncer.init();
|
|
157
142
|
}
|
|
158
|
-
if (this.logCoveoPageViewOnlyOnConnect) {
|
|
159
|
-
this.logCoveoPageView();
|
|
160
|
-
}
|
|
161
143
|
}
|
|
162
144
|
|
|
163
145
|
renderedCallback(): void {
|
|
@@ -178,8 +160,6 @@ export default class ContentLayout extends LightningElement {
|
|
|
178
160
|
if (!this.hasRendered) {
|
|
179
161
|
this.hasRendered = true;
|
|
180
162
|
this.restoreScroll();
|
|
181
|
-
} else if (!this.logCoveoPageViewOnlyOnConnect) {
|
|
182
|
-
this.logCoveoPageView();
|
|
183
163
|
}
|
|
184
164
|
}
|
|
185
165
|
|
|
@@ -8,7 +8,7 @@ dx-logo {
|
|
|
8
8
|
.header_l2 {
|
|
9
9
|
justify-content: space-between;
|
|
10
10
|
height: var(--dx-g-doc-header-main-nav-height);
|
|
11
|
-
padding-bottom:
|
|
11
|
+
padding-bottom: var(--dx-g-spacing-xs);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.nav_menu-button {
|
|
@@ -18,6 +18,10 @@ dx-logo {
|
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
.has-brand.has-scoped-nav-items {
|
|
22
|
+
border-bottom: 1px solid var(--dx-g-gray-90);
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
.nav_menu-ctas {
|
|
22
26
|
margin-right: var(--dx-g-spacing-sm);
|
|
23
27
|
}
|
|
@@ -58,10 +62,6 @@ header:not(.has-brand) > .header_l2 {
|
|
|
58
62
|
--border-color: var(--button-primary-color-hover);
|
|
59
63
|
}
|
|
60
64
|
|
|
61
|
-
.has-brand.has-scoped-nav-items {
|
|
62
|
-
border-bottom: 1px solid var(--dx-g-gray-90);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
65
|
@media (max-width: 768px) {
|
|
66
66
|
.header_l2 {
|
|
67
67
|
padding: 0;
|
|
@@ -108,6 +108,6 @@ header:not(.has-brand) > .header_l2 {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.has-scoped-nav-items .header_l2_group-title {
|
|
111
|
-
border-bottom: 1px solid var(--dx-g-
|
|
111
|
+
border-bottom: 1px solid var(--dx-g-brand-current-color-border-2);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./types";
|
|
15
15
|
import { SearchSyncer } from "docUtils/searchSyncer";
|
|
16
16
|
import { LightningElementWithState } from "dxBaseElements/lightningElementWithState";
|
|
17
|
-
import { oldVersionDocInfo } from "docUtils/utils";
|
|
17
|
+
import { logCoveoPageView, oldVersionDocInfo } from "docUtils/utils";
|
|
18
18
|
import { Breadcrumb, DocPhaseInfo, Language } from "typings/custom";
|
|
19
19
|
import { track as trackGTM } from "dxUtils/analytics";
|
|
20
20
|
|
|
@@ -558,6 +558,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
558
558
|
}
|
|
559
559
|
|
|
560
560
|
updateUrl(method = HistoryState.PUSH_STATE): void {
|
|
561
|
+
logCoveoPageView(this.coveoOrganizationId, this.coveoAnalyticsToken);
|
|
561
562
|
window.history[method](
|
|
562
563
|
{},
|
|
563
564
|
"docs",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CoveoAnalyticsClient } from "coveo.analytics";
|
|
2
|
+
|
|
1
3
|
export const oldVersionDocInfo = (latestVersionLink: string) => {
|
|
2
4
|
return {
|
|
3
5
|
title: "Newer Version Available",
|
|
@@ -5,3 +7,26 @@ export const oldVersionDocInfo = (latestVersionLink: string) => {
|
|
|
5
7
|
<a style="font-weight: bold;" href="${latestVersionLink}">View Latest</a>`
|
|
6
8
|
};
|
|
7
9
|
};
|
|
10
|
+
|
|
11
|
+
export function logCoveoPageView(
|
|
12
|
+
coveoOrganizationId: string | undefined,
|
|
13
|
+
coveoAnalyticsToken: string | undefined
|
|
14
|
+
) {
|
|
15
|
+
if (coveoOrganizationId && coveoAnalyticsToken) {
|
|
16
|
+
const ua = new CoveoAnalyticsClient({
|
|
17
|
+
token: coveoAnalyticsToken,
|
|
18
|
+
endpoint: `https://${coveoOrganizationId}.analytics.org.coveo.com`
|
|
19
|
+
});
|
|
20
|
+
const pathParts = window.location.pathname.split("/");
|
|
21
|
+
let contentType;
|
|
22
|
+
if (pathParts.length >= 2) {
|
|
23
|
+
contentType = pathParts[1];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ua.sendViewEvent({
|
|
27
|
+
contentIdKey: "@clickableuri",
|
|
28
|
+
contentType: contentType,
|
|
29
|
+
contentIdValue: window.location.href
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|