@salesforcedevs/docs-components 1.3.138-coveo-fix4 → 1.3.138-j2s
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.html +0 -1
- package/src/modules/doc/amfReference/amfReference.ts +0 -3
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +2 -2
- package/src/modules/doc/contentLayout/contentLayout.html +0 -1
- package/src/modules/doc/contentLayout/contentLayout.ts +0 -1
- package/src/modules/doc/header/header.css +2 -2
- package/src/modules/doc/header/header.ts +0 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +1 -13
- package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +0 -93
package/package.json
CHANGED
|
@@ -110,7 +110,6 @@ export default class AmfReference extends LightningElement {
|
|
|
110
110
|
this.oldVersionInfo
|
|
111
111
|
) {
|
|
112
112
|
this.showVersionBanner = true;
|
|
113
|
-
this.version = this.selectedVersion.id.replace("v", "");
|
|
114
113
|
}
|
|
115
114
|
}
|
|
116
115
|
|
|
@@ -164,7 +163,6 @@ export default class AmfReference extends LightningElement {
|
|
|
164
163
|
private isParentLevelDocPhaseEnabled = false;
|
|
165
164
|
private selectedReferenceDocPhase?: string | null = null;
|
|
166
165
|
private _expandChildren?: boolean = false;
|
|
167
|
-
private version = "latest";
|
|
168
166
|
|
|
169
167
|
/**
|
|
170
168
|
* Key for storing the currently selected reference url. This will be used to save the
|
|
@@ -1259,7 +1257,6 @@ export default class AmfReference extends LightningElement {
|
|
|
1259
1257
|
this.versions = this.getVersions();
|
|
1260
1258
|
if (this.oldVersionInfo) {
|
|
1261
1259
|
this.showVersionBanner = true;
|
|
1262
|
-
this.version = this.getSelectedVersion().id.replace("v", "");
|
|
1263
1260
|
}
|
|
1264
1261
|
this.updateDocPhase();
|
|
1265
1262
|
this.selectedSidebarValue = window.location.pathname;
|
|
@@ -53,7 +53,7 @@ export default class BreadcrumbItem extends LightningElement {
|
|
|
53
53
|
private onLinkClick(event: Event): void {
|
|
54
54
|
track(event.target!, "custEv_breadcrumbClick", {
|
|
55
55
|
click_text: this.label,
|
|
56
|
-
click_url:
|
|
56
|
+
click_url: this.href,
|
|
57
57
|
element_type: "link",
|
|
58
58
|
nav_type: "breadcrumb",
|
|
59
59
|
nav_level: this.level ? this.level + 1 : 1,
|
|
@@ -62,7 +62,7 @@ export default class BreadcrumbItem extends LightningElement {
|
|
|
62
62
|
|
|
63
63
|
track(event.target!, "custEv_linkClick", {
|
|
64
64
|
click_text: this.label,
|
|
65
|
-
click_url:
|
|
65
|
+
click_url: this.href,
|
|
66
66
|
element_title: this.label,
|
|
67
67
|
element_type: "link",
|
|
68
68
|
content_category: "cta"
|
|
@@ -40,8 +40,8 @@ header:not(.has-brand) > .header_l2 {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.header_lang-dropdown {
|
|
43
|
-
--button-primary-color: var(--dx-g-blue-vibrant-
|
|
44
|
-
--button-primary-color-hover: var(--dx-g-blue-vibrant-
|
|
43
|
+
--button-primary-color: var(--dx-g-blue-vibrant-50);
|
|
44
|
+
--button-primary-color-hover: var(--dx-g-blue-vibrant-40);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.header_lang-dropdown > dx-button {
|
|
@@ -13,10 +13,9 @@ import {
|
|
|
13
13
|
TocMap
|
|
14
14
|
} from "./types";
|
|
15
15
|
import { SearchSyncer } from "docUtils/SearchSyncer";
|
|
16
|
-
import { LightningElementWithState } from "
|
|
16
|
+
import { LightningElementWithState } from "dxBaseElements/lightningElementWithState";
|
|
17
17
|
import { oldVersionDocInfo } from "docUtils/utils";
|
|
18
18
|
import { Breadcrumb, DocPhaseInfo, Language } from "typings/custom";
|
|
19
|
-
import { track as trackGTM } from "dxUtils/analytics";
|
|
20
19
|
|
|
21
20
|
// TODO: Imitating from actual implementation as doc-content use it like this. We should refactor it later.
|
|
22
21
|
const handleContentError = (error): void => console.log(error);
|
|
@@ -365,17 +364,6 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
365
364
|
({ id }) => id === event.detail
|
|
366
365
|
);
|
|
367
366
|
this.pageReference.docId = this.language.url;
|
|
368
|
-
|
|
369
|
-
trackGTM(event.target!, "custEv_ctaLinkClick", {
|
|
370
|
-
click_text: event.detail,
|
|
371
|
-
element_title: "language selector",
|
|
372
|
-
click_url: `${window.location.origin}${this.pageReferenceToString(
|
|
373
|
-
this.pageReference
|
|
374
|
-
)}`,
|
|
375
|
-
element_type: "link",
|
|
376
|
-
content_category: "cta"
|
|
377
|
-
});
|
|
378
|
-
|
|
379
367
|
this.updateUrl();
|
|
380
368
|
this.fetchDocument();
|
|
381
369
|
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { LightningElement, track } from "lwc";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This is a helper class for when you want your LWC component to have state
|
|
5
|
-
* that is automatically tracked _along with_ its previous state, in a React-
|
|
6
|
-
* like fashion, so that you can compare current state with previous state
|
|
7
|
-
* after a render (like React's `commponentDidUpdate`). One benefit of doing
|
|
8
|
-
* things this way is that you can put all of your reactions to state changes
|
|
9
|
-
* in one place, in `renderedCallback`, rather than having them in various
|
|
10
|
-
* places throughout the component.
|
|
11
|
-
*
|
|
12
|
-
* The API consists in `this.prevState`, `this.state`, and `this.setState`.
|
|
13
|
-
*
|
|
14
|
-
* Usage:
|
|
15
|
-
*
|
|
16
|
-
* ```
|
|
17
|
-
* type MyState = {
|
|
18
|
-
* isFetchingContent: boolean;
|
|
19
|
-
* };
|
|
20
|
-
*
|
|
21
|
-
* class MyFetchingComponent extends LightningElementWithState<MyState> {
|
|
22
|
-
* constructor() {
|
|
23
|
-
* // `this.state` can only be initialized once
|
|
24
|
-
* this.state = {
|
|
25
|
-
* isFetchingContent: false
|
|
26
|
-
* };
|
|
27
|
-
* }
|
|
28
|
-
*
|
|
29
|
-
* // Queued for execution whenever a `setState` call completes
|
|
30
|
-
* renderedCallback() {
|
|
31
|
-
* if (this.prevState.isFetchingContent && !this.state.isFetchingContent) {
|
|
32
|
-
* // Do something knowing that we just finished fetching.
|
|
33
|
-
* notifyFetchSuccessful();
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
*
|
|
37
|
-
* fetchSomething() {
|
|
38
|
-
* this.setState({
|
|
39
|
-
* isFetchingContent: true
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* fetch(whatever).then(() => {
|
|
43
|
-
* this.setState({
|
|
44
|
-
* isFetching: false
|
|
45
|
-
* }
|
|
46
|
-
* });
|
|
47
|
-
* }
|
|
48
|
-
* }
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export abstract class LightningElementWithState<
|
|
52
|
-
T extends { [key: string]: unknown }
|
|
53
|
-
> extends LightningElement {
|
|
54
|
-
private _prevState = {} as T;
|
|
55
|
-
@track private _state = {} as T;
|
|
56
|
-
|
|
57
|
-
private _didInitializeState = false;
|
|
58
|
-
|
|
59
|
-
protected get prevState(): T {
|
|
60
|
-
return Object.freeze({
|
|
61
|
-
...this._prevState
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
protected get state(): T {
|
|
66
|
-
return Object.freeze({
|
|
67
|
-
...this._state
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
protected set state(initialState: T) {
|
|
72
|
-
if (!this._didInitializeState) {
|
|
73
|
-
this._state = {
|
|
74
|
-
...initialState
|
|
75
|
-
};
|
|
76
|
-
this._didInitializeState = true;
|
|
77
|
-
} else {
|
|
78
|
-
throw new Error(
|
|
79
|
-
"To mutate state after initialization, use `this.setState`."
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
protected setState = (state: Partial<T>): void => {
|
|
85
|
-
this._prevState = {
|
|
86
|
-
...this._state
|
|
87
|
-
};
|
|
88
|
-
this._state = {
|
|
89
|
-
...this._state,
|
|
90
|
-
...state
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
}
|