@salesforcedevs/docs-components 1.3.81 → 1.3.85
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 +2 -2
- package/src/modules/doc/amfReference/amfReference.ts +24 -16
- package/src/modules/doc/content/content.css +0 -7
- package/src/modules/doc/content/content.ts +3 -2
- package/src/modules/doc/contentLayout/contentLayout.ts +4 -7
- package/src/modules/doc/header/header.html +1 -1
- package/src/modules/doc/heading/heading.css +10 -31
- package/src/modules/doc/heading/heading.ts +5 -5
- package/src/modules/doc/phase/phase.ts +3 -2
- package/src/modules/doc/toc/toc.html +1 -3
- package/src/modules/doc/toolbar/toolbar.ts +6 -6
- package/src/modules/doc/xmlContent/utils.ts +3 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +14 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.85",
|
|
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": "
|
|
27
|
+
"gitHead": "6b738627c2fefd4e639f1def42cdc4d4a44c7171"
|
|
28
28
|
}
|
|
@@ -167,10 +167,12 @@ export default class AmfReference extends LightningElement {
|
|
|
167
167
|
constructor() {
|
|
168
168
|
super();
|
|
169
169
|
|
|
170
|
-
this._boundOnApiNavigationChanged =
|
|
171
|
-
this
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
this._boundOnApiNavigationChanged = this.onApiNavigationChanged.bind(
|
|
171
|
+
this
|
|
172
|
+
);
|
|
173
|
+
this._boundUpdateSelectedItemFromUrlQuery = this.updateSelectedItemFromUrlQuery.bind(
|
|
174
|
+
this
|
|
175
|
+
);
|
|
174
176
|
}
|
|
175
177
|
|
|
176
178
|
connectedCallback(): void {
|
|
@@ -226,8 +228,9 @@ export default class AmfReference extends LightningElement {
|
|
|
226
228
|
const updatedReferenceId =
|
|
227
229
|
oldReferenceIdNewReferenceIdMap[referenceId];
|
|
228
230
|
const newReferenceId = updatedReferenceId || referenceId;
|
|
229
|
-
const referenceItemConfig =
|
|
230
|
-
|
|
231
|
+
const referenceItemConfig = this.getAmfConfigWithId(
|
|
232
|
+
newReferenceId
|
|
233
|
+
);
|
|
231
234
|
if (referenceItemConfig) {
|
|
232
235
|
hashBasedRedirectUrl = `${referenceItemConfig.href}?meta=${encodedMeta}`;
|
|
233
236
|
}
|
|
@@ -296,8 +299,9 @@ export default class AmfReference extends LightningElement {
|
|
|
296
299
|
for (let i = 0; i < allVersions.length; i++) {
|
|
297
300
|
const versionItem = allVersions[i];
|
|
298
301
|
const referenceLink = versionItem.link.href;
|
|
299
|
-
const referenceId =
|
|
300
|
-
|
|
302
|
+
const referenceId = this.getReferenceIdFromUrl(
|
|
303
|
+
referenceLink
|
|
304
|
+
);
|
|
301
305
|
if (this._currentReferenceId === referenceId) {
|
|
302
306
|
// This is to navigate to respective topic in the changed version
|
|
303
307
|
versionItem.link.href = `${referenceLink}/${currentRefMeta}`;
|
|
@@ -1222,10 +1226,12 @@ export default class AmfReference extends LightningElement {
|
|
|
1222
1226
|
}
|
|
1223
1227
|
if (!isRedirecting) {
|
|
1224
1228
|
const currentReferenceUrl = window.location.href;
|
|
1225
|
-
const referenceMeta =
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
+
const referenceMeta = this.getMarkdownReferenceMeta(
|
|
1230
|
+
currentReferenceUrl
|
|
1231
|
+
);
|
|
1232
|
+
const selectedItemRefId = this.getReferenceIdFromUrl(
|
|
1233
|
+
currentReferenceUrl
|
|
1234
|
+
);
|
|
1229
1235
|
const referenceDetails = this.getRefDetailsForGivenTopicMeta(
|
|
1230
1236
|
selectedItemRefId,
|
|
1231
1237
|
referenceMeta
|
|
@@ -1264,8 +1270,9 @@ export default class AmfReference extends LightningElement {
|
|
|
1264
1270
|
const name = event.detail.name;
|
|
1265
1271
|
if (name) {
|
|
1266
1272
|
const urlReferenceId = this.getReferenceIdFromUrl(name);
|
|
1267
|
-
const specBasedReference =
|
|
1268
|
-
|
|
1273
|
+
const specBasedReference = this.isSpecBasedReference(
|
|
1274
|
+
urlReferenceId
|
|
1275
|
+
);
|
|
1269
1276
|
if (specBasedReference) {
|
|
1270
1277
|
const metaVal = this.getMetaFromUrl(name);
|
|
1271
1278
|
const currentSelectedMeta = this.selectedTopic
|
|
@@ -1315,8 +1322,9 @@ export default class AmfReference extends LightningElement {
|
|
|
1315
1322
|
const currentReferenceId = this.getReferenceIdFromUrl(currentUrl);
|
|
1316
1323
|
//No need to do anything if user is expanding currently selected reference
|
|
1317
1324
|
if (referenceId !== currentReferenceId) {
|
|
1318
|
-
const isSpecBasedReference =
|
|
1319
|
-
|
|
1325
|
+
const isSpecBasedReference = this.isSpecBasedReference(
|
|
1326
|
+
referenceId
|
|
1327
|
+
);
|
|
1320
1328
|
if (isSpecBasedReference) {
|
|
1321
1329
|
// Perform functionality same as item selection
|
|
1322
1330
|
this.onNavSelect(event);
|
|
@@ -111,13 +111,6 @@ h6 {
|
|
|
111
111
|
margin: var(--dx-g-spacing-sm) 0 var(--dx-g-spacing-sm) 0;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
.dx-text-heading-alt-1 {
|
|
115
|
-
color: var(--dx-g-gray-30);
|
|
116
|
-
font-family: var(--dx-g-font-sans);
|
|
117
|
-
font-size: var(--slds-text-lg);
|
|
118
|
-
line-height: 25px;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
114
|
p,
|
|
122
115
|
.p {
|
|
123
116
|
font-family: var(--dx-g-font-sans);
|
|
@@ -324,8 +324,9 @@ export default class Content extends LightningElement {
|
|
|
324
324
|
event.preventDefault();
|
|
325
325
|
// eslint-disable-next-line no-use-before-define
|
|
326
326
|
const target = event.currentTarget.dataset.id;
|
|
327
|
-
const [page, docId, deliverable, tempContentDocumentId] =
|
|
328
|
-
|
|
327
|
+
const [page, docId, deliverable, tempContentDocumentId] = target.split(
|
|
328
|
+
"/"
|
|
329
|
+
);
|
|
329
330
|
const [contentDocumentId, hash] = tempContentDocumentId.split("#");
|
|
330
331
|
const newPageReference = {
|
|
331
332
|
page: page,
|
|
@@ -220,17 +220,14 @@ export default class ContentLayout extends LightningElement {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
onSlotChange(event: Event): void {
|
|
223
|
-
const slotElements = (
|
|
224
|
-
event.target as HTMLSlotElement
|
|
225
|
-
).assignedElements();
|
|
223
|
+
const slotElements = (event.target as HTMLSlotElement).assignedElements();
|
|
226
224
|
|
|
227
225
|
if (slotElements.length) {
|
|
228
226
|
this.contentLoaded = true;
|
|
229
227
|
const slotContentElement = slotElements[0];
|
|
230
|
-
const headingElements =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
);
|
|
228
|
+
const headingElements = slotContentElement.ownerDocument?.getElementsByTagName(
|
|
229
|
+
TOC_HEADER_TAG
|
|
230
|
+
);
|
|
234
231
|
|
|
235
232
|
for (const headingElement of headingElements) {
|
|
236
233
|
// Sometimes elements hash is not being set when slot content is wrapped with div
|
|
@@ -1,54 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
h4,
|
|
5
|
-
h5,
|
|
6
|
-
h6 {
|
|
7
|
-
color: var(--dx-g-blue-vibrant-20);
|
|
8
|
-
font-family: var(--dx-g-font-display);
|
|
9
|
-
font-weight: var(--dx-g-font-demi);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.display-3 {
|
|
13
|
-
font-size: var(--dx-g-text-3xl);
|
|
14
|
-
letter-spacing: -0.85px;
|
|
15
|
-
line-height: var(--dx-g-spacing-3xl);
|
|
1
|
+
@import "dxHelpers/text";
|
|
2
|
+
|
|
3
|
+
h1 {
|
|
16
4
|
margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
|
|
17
5
|
}
|
|
18
6
|
|
|
19
|
-
|
|
7
|
+
h1 doc-heading-content {
|
|
20
8
|
--doc-c-heading-anchor-button-bottom: 9.5px;
|
|
21
9
|
}
|
|
22
10
|
|
|
23
|
-
|
|
24
|
-
font-size: var(--dx-g-text-2xl);
|
|
25
|
-
letter-spacing: -0.6px;
|
|
26
|
-
line-height: var(--dx-g-spacing-2xl);
|
|
11
|
+
h2 {
|
|
27
12
|
margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
|
|
28
13
|
}
|
|
29
14
|
|
|
30
|
-
|
|
15
|
+
h2 doc-heading-content {
|
|
31
16
|
--doc-c-heading-anchor-button-bottom: 3px;
|
|
32
17
|
}
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
font-size: var(--dx-g-text-xl);
|
|
36
|
-
letter-spacing: -0.5px;
|
|
37
|
-
line-height: var(--dx-g-spacing-xl);
|
|
19
|
+
h3 {
|
|
38
20
|
margin: var(--dx-g-spacing-xl) 0 var(--dx-g-spacing-md) 0;
|
|
39
21
|
}
|
|
40
22
|
|
|
41
|
-
|
|
23
|
+
h3 doc-heading-content {
|
|
42
24
|
--doc-c-heading-anchor-button-bottom: -0.5px;
|
|
43
25
|
}
|
|
44
26
|
|
|
45
|
-
|
|
46
|
-
font-size: var(--dx-g-text-base);
|
|
47
|
-
letter-spacing: -0.5px;
|
|
48
|
-
line-height: var(--dx-g-spacing-lg);
|
|
27
|
+
h4 {
|
|
49
28
|
margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-sm) 0;
|
|
50
29
|
}
|
|
51
30
|
|
|
52
|
-
|
|
31
|
+
h4 doc-heading-content {
|
|
53
32
|
--doc-c-heading-anchor-button-bottom: -6px;
|
|
54
33
|
}
|
|
@@ -5,10 +5,10 @@ export const displayLevels = ["3", "4", "5", "6"];
|
|
|
5
5
|
export const ariaLevels = ["1", "2", "3", "4"];
|
|
6
6
|
|
|
7
7
|
export const ariaDisplayLevels: { [key: string]: string } = {
|
|
8
|
-
"1": "
|
|
9
|
-
"2": "
|
|
10
|
-
"3": "
|
|
11
|
-
"4": "
|
|
8
|
+
"1": "4",
|
|
9
|
+
"2": "5",
|
|
10
|
+
"3": "6",
|
|
11
|
+
"4": "8"
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default class Heading extends LightningElement {
|
|
@@ -60,6 +60,6 @@ export default class Heading extends LightningElement {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
private get className(): string {
|
|
63
|
-
return `display-${this.displayLevel}`;
|
|
63
|
+
return `dx-text-display-${this.displayLevel}`;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -43,8 +43,9 @@ export default class Phase extends LightningElement {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
renderedCallback() {
|
|
46
|
-
const phaseBodyContainer =
|
|
47
|
-
|
|
46
|
+
const phaseBodyContainer = this.template.querySelector(
|
|
47
|
+
".doc-phase-body"
|
|
48
|
+
);
|
|
48
49
|
if (phaseBodyContainer && this.docPhaseInfo) {
|
|
49
50
|
// eslint-disable-next-line @lwc/lwc/no-inner-html
|
|
50
51
|
phaseBodyContainer.innerHTML = this.docPhaseInfo.body;
|
|
@@ -40,9 +40,9 @@ export default class Toolbar extends LightningElement {
|
|
|
40
40
|
"select[name=languages]"
|
|
41
41
|
) as HTMLSelectElement;
|
|
42
42
|
if (languageEl) {
|
|
43
|
-
const languageValue = (
|
|
44
|
-
languageEl
|
|
45
|
-
).value;
|
|
43
|
+
const languageValue = (languageEl[
|
|
44
|
+
languageEl.selectedIndex
|
|
45
|
+
] as HTMLOptionElement).value;
|
|
46
46
|
this.dispatchEvent(
|
|
47
47
|
new CustomEvent("languageselected", {
|
|
48
48
|
detail: {
|
|
@@ -61,9 +61,9 @@ export default class Toolbar extends LightningElement {
|
|
|
61
61
|
"select[name=versions]"
|
|
62
62
|
) as HTMLSelectElement;
|
|
63
63
|
if (versionEl) {
|
|
64
|
-
const versionValue = (
|
|
65
|
-
versionEl
|
|
66
|
-
).value;
|
|
64
|
+
const versionValue = (versionEl[
|
|
65
|
+
versionEl.selectedIndex
|
|
66
|
+
] as HTMLOptionElement).value;
|
|
67
67
|
this.dispatchEvent(
|
|
68
68
|
new CustomEvent("versionselected", {
|
|
69
69
|
detail: {
|
|
@@ -355,8 +355,12 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
getReferenceFromUrl(): PageReference {
|
|
358
|
-
const [
|
|
359
|
-
|
|
358
|
+
const [
|
|
359
|
+
page,
|
|
360
|
+
docId,
|
|
361
|
+
deliverable,
|
|
362
|
+
contentDocumentId
|
|
363
|
+
] = window.location.pathname.substr(1).split("/");
|
|
360
364
|
|
|
361
365
|
const { origin: domain, hash, search } = window.location;
|
|
362
366
|
|
|
@@ -523,8 +527,14 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
523
527
|
}
|
|
524
528
|
|
|
525
529
|
private pageReferenceToString(reference: PageReference): string {
|
|
526
|
-
const {
|
|
527
|
-
|
|
530
|
+
const {
|
|
531
|
+
page,
|
|
532
|
+
docId,
|
|
533
|
+
deliverable,
|
|
534
|
+
contentDocumentId,
|
|
535
|
+
hash,
|
|
536
|
+
search
|
|
537
|
+
} = reference;
|
|
528
538
|
return `/${page}/${docId}/${deliverable}/${contentDocumentId}${this.normalizeSearch(
|
|
529
539
|
search
|
|
530
540
|
)}${this.normalizeHash(hash)}`;
|