@salesforcedevs/docs-components 1.3.194-docfooter8-alpha → 1.3.194-search1-alpha
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 +60 -23
- package/src/modules/doc/content/content.css +1 -1
- package/src/modules/doc/contentLayout/contentLayout.css +0 -3
- package/src/modules/doc/contentLayout/contentLayout.html +0 -3
- package/src/modules/doc/contentLayout/contentLayout.ts +13 -15
- package/src/modules/doc/header/header.css +3 -26
- package/src/modules/doc/header/header.html +2 -2
- package/src/modules/doc/headingAnchor/headingAnchor.css +2 -2
- package/src/modules/doc/headingContent/headingContent.css +1 -1
- package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +1 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +25 -12
- package/src/modules/docHelpers/amfStyle/amfStyle.css +6 -6
- package/src/modules/docHelpers/status/status.css +1 -1
package/package.json
CHANGED
|
@@ -185,10 +185,12 @@ export default class AmfReference extends LightningElement {
|
|
|
185
185
|
constructor() {
|
|
186
186
|
super();
|
|
187
187
|
|
|
188
|
-
this._boundOnApiNavigationChanged =
|
|
189
|
-
this
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
this._boundOnApiNavigationChanged = this.onApiNavigationChanged.bind(
|
|
189
|
+
this
|
|
190
|
+
);
|
|
191
|
+
this._boundUpdateSelectedItemFromUrlQuery = this.updateSelectedItemFromUrlQuery.bind(
|
|
192
|
+
this
|
|
193
|
+
);
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
connectedCallback(): void {
|
|
@@ -244,8 +246,9 @@ export default class AmfReference extends LightningElement {
|
|
|
244
246
|
const updatedReferenceId =
|
|
245
247
|
oldReferenceIdNewReferenceIdMap[referenceId];
|
|
246
248
|
const newReferenceId = updatedReferenceId || referenceId;
|
|
247
|
-
const referenceItemConfig =
|
|
248
|
-
|
|
249
|
+
const referenceItemConfig = this.getAmfConfigWithId(
|
|
250
|
+
newReferenceId
|
|
251
|
+
);
|
|
249
252
|
if (referenceItemConfig) {
|
|
250
253
|
hashBasedRedirectUrl = `${referenceItemConfig.href}?meta=${encodedMeta}`;
|
|
251
254
|
}
|
|
@@ -325,8 +328,9 @@ export default class AmfReference extends LightningElement {
|
|
|
325
328
|
for (let i = 0; i < allVersions.length; i++) {
|
|
326
329
|
const versionItem = allVersions[i];
|
|
327
330
|
const referenceLink = versionItem.link.href;
|
|
328
|
-
const referenceId =
|
|
329
|
-
|
|
331
|
+
const referenceId = this.getReferenceIdFromUrl(
|
|
332
|
+
referenceLink
|
|
333
|
+
);
|
|
330
334
|
if (this._currentReferenceId === referenceId) {
|
|
331
335
|
// This is to navigate to respective topic in the changed version
|
|
332
336
|
versionItem.link.href = `${referenceLink}/${currentRefMeta}`;
|
|
@@ -840,8 +844,9 @@ export default class AmfReference extends LightningElement {
|
|
|
840
844
|
this._currentReferenceId
|
|
841
845
|
);
|
|
842
846
|
if (specBasedReference) {
|
|
843
|
-
const currentMeta:
|
|
844
|
-
|
|
847
|
+
const currentMeta:
|
|
848
|
+
| RouteMeta
|
|
849
|
+
| undefined = this.getReferenceMetaInfo(window.location.href);
|
|
845
850
|
const metadata =
|
|
846
851
|
currentMeta && this.getMetadataByUrlQuery(currentMeta);
|
|
847
852
|
if (metadata) {
|
|
@@ -1161,7 +1166,7 @@ export default class AmfReference extends LightningElement {
|
|
|
1161
1166
|
selectedItemMetaData.parentReferencePath,
|
|
1162
1167
|
selectedItemMetaData.meta
|
|
1163
1168
|
);
|
|
1164
|
-
this.
|
|
1169
|
+
this.updateTags(selectedItemMetaData.navTitle);
|
|
1165
1170
|
}
|
|
1166
1171
|
});
|
|
1167
1172
|
} else {
|
|
@@ -1267,16 +1272,18 @@ export default class AmfReference extends LightningElement {
|
|
|
1267
1272
|
}
|
|
1268
1273
|
if (!isRedirecting) {
|
|
1269
1274
|
const currentReferenceUrl = window.location.href;
|
|
1270
|
-
const referenceMeta =
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1275
|
+
const referenceMeta = this.getMarkdownReferenceMeta(
|
|
1276
|
+
currentReferenceUrl
|
|
1277
|
+
);
|
|
1278
|
+
const selectedItemRefId = this.getReferenceIdFromUrl(
|
|
1279
|
+
currentReferenceUrl
|
|
1280
|
+
);
|
|
1274
1281
|
const referenceDetails = this.getRefDetailsForGivenTopicMeta(
|
|
1275
1282
|
selectedItemRefId,
|
|
1276
1283
|
referenceMeta
|
|
1277
1284
|
);
|
|
1278
1285
|
if (referenceDetails) {
|
|
1279
|
-
this.
|
|
1286
|
+
this.updateTags(referenceDetails.topicTitle);
|
|
1280
1287
|
}
|
|
1281
1288
|
|
|
1282
1289
|
this.versions = this.getVersions();
|
|
@@ -1304,21 +1311,50 @@ export default class AmfReference extends LightningElement {
|
|
|
1304
1311
|
this.showVersionBanner = false;
|
|
1305
1312
|
}
|
|
1306
1313
|
|
|
1307
|
-
private
|
|
1314
|
+
private updateTags(navTitle = ""): void {
|
|
1315
|
+
if (!navTitle) {
|
|
1316
|
+
return;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1308
1319
|
// this is required to update the nav title meta tag.
|
|
1309
1320
|
// eslint-disable-next-line @lwc/lwc/no-document-query
|
|
1310
1321
|
const metaNavTitle = document.querySelector('meta[name="nav-title"]');
|
|
1311
|
-
|
|
1322
|
+
// eslint-disable-next-line @lwc/lwc/no-document-query
|
|
1323
|
+
const titleTag = document.querySelector("title");
|
|
1324
|
+
if (metaNavTitle) {
|
|
1312
1325
|
metaNavTitle.setAttribute("content", navTitle);
|
|
1313
1326
|
}
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* Right now, the title tag only changes when you pick a Ref spec,
|
|
1330
|
+
* not every time you choose a subsection of the Ref spec.
|
|
1331
|
+
* This update aims to refresh the title tag with each selection.
|
|
1332
|
+
* If a Ref spec is chosen, we add the value of the <selected topic> to the title.
|
|
1333
|
+
* If a subsection is selected, we update the first part of the current
|
|
1334
|
+
* title with the new <selected topic>.
|
|
1335
|
+
*/
|
|
1336
|
+
if (titleTag) {
|
|
1337
|
+
let titleTagValue = titleTag.textContent;
|
|
1338
|
+
const titleTagSectionValues: string[] = titleTagValue?.split(" | ");
|
|
1339
|
+
if (titleTagSectionValues) {
|
|
1340
|
+
if (titleTagSectionValues.length <= 3) {
|
|
1341
|
+
titleTagValue = navTitle + " | " + titleTagValue;
|
|
1342
|
+
} else {
|
|
1343
|
+
titleTagSectionValues[0] = navTitle;
|
|
1344
|
+
titleTagValue = titleTagSectionValues.join(" | ");
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
titleTag.textContent = titleTagValue;
|
|
1348
|
+
}
|
|
1314
1349
|
}
|
|
1315
1350
|
|
|
1316
1351
|
onNavSelect(event: CustomEvent): void {
|
|
1317
1352
|
const name = event.detail.name;
|
|
1318
1353
|
if (name) {
|
|
1319
1354
|
const urlReferenceId = this.getReferenceIdFromUrl(name);
|
|
1320
|
-
const specBasedReference =
|
|
1321
|
-
|
|
1355
|
+
const specBasedReference = this.isSpecBasedReference(
|
|
1356
|
+
urlReferenceId
|
|
1357
|
+
);
|
|
1322
1358
|
if (specBasedReference) {
|
|
1323
1359
|
const metaVal = this.getMetaFromUrl(name);
|
|
1324
1360
|
const currentSelectedMeta = this.selectedTopic
|
|
@@ -1353,7 +1389,7 @@ export default class AmfReference extends LightningElement {
|
|
|
1353
1389
|
this.coveoAnalyticsToken
|
|
1354
1390
|
);
|
|
1355
1391
|
this.updateUrlWithSelected(parentReferencePath, metaVal);
|
|
1356
|
-
this.
|
|
1392
|
+
this.updateTags(metadata.navTitle);
|
|
1357
1393
|
} else {
|
|
1358
1394
|
if (this.isParentReferencePath(name)) {
|
|
1359
1395
|
this.loadNewReferenceItem(name);
|
|
@@ -1373,8 +1409,9 @@ export default class AmfReference extends LightningElement {
|
|
|
1373
1409
|
const currentReferenceId = this.getReferenceIdFromUrl(currentUrl);
|
|
1374
1410
|
//No need to do anything if user is expanding currently selected reference
|
|
1375
1411
|
if (referenceId !== currentReferenceId) {
|
|
1376
|
-
const isSpecBasedReference =
|
|
1377
|
-
|
|
1412
|
+
const isSpecBasedReference = this.isSpecBasedReference(
|
|
1413
|
+
referenceId
|
|
1414
|
+
);
|
|
1378
1415
|
if (isSpecBasedReference) {
|
|
1379
1416
|
// Perform functionality same as item selection
|
|
1380
1417
|
this.onNavSelect(event);
|
|
@@ -61,10 +61,8 @@ dx-toc {
|
|
|
61
61
|
flex-direction: row;
|
|
62
62
|
justify-content: center;
|
|
63
63
|
max-width: var(--dx-g-doc-content-max-width);
|
|
64
|
-
min-height: 100vh;
|
|
65
64
|
margin: auto;
|
|
66
65
|
padding: 0 var(--dx-g-global-header-padding-horizontal);
|
|
67
|
-
margin-bottom: calc(2 * (var(--dx-g-spacing-5xl) + 4px));
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
.content-body {
|
|
@@ -108,7 +106,6 @@ dx-toc {
|
|
|
108
106
|
.content-body-container {
|
|
109
107
|
padding-right: 0;
|
|
110
108
|
overflow-x: auto;
|
|
111
|
-
margin-bottom: calc(var(--dx-g-spacing-5xl) + 4px);
|
|
112
109
|
}
|
|
113
110
|
|
|
114
111
|
.left-nav-bar {
|
|
@@ -207,9 +207,9 @@ export default class ContentLayout extends LightningElement {
|
|
|
207
207
|
".sticky-doc-header"
|
|
208
208
|
) as HTMLElement;
|
|
209
209
|
|
|
210
|
-
const docPhaseEl = (
|
|
211
|
-
|
|
212
|
-
).assignedElements()[0] as HTMLSlotElement;
|
|
210
|
+
const docPhaseEl = (this.template.querySelector(
|
|
211
|
+
"[name=doc-phase]"
|
|
212
|
+
)! as any).assignedElements()[0] as HTMLSlotElement;
|
|
213
213
|
|
|
214
214
|
if (!sidebarEl || !globalNavEl || !contextNavEl || !docHeaderEl) {
|
|
215
215
|
console.warn("One or more required elements are missing.");
|
|
@@ -259,8 +259,9 @@ export default class ContentLayout extends LightningElement {
|
|
|
259
259
|
});
|
|
260
260
|
|
|
261
261
|
// Adjust right nav bar position when doc phase is present
|
|
262
|
-
const rightNavBarEl =
|
|
263
|
-
|
|
262
|
+
const rightNavBarEl = this.template.querySelector(
|
|
263
|
+
".right-nav-bar"
|
|
264
|
+
);
|
|
264
265
|
|
|
265
266
|
if (rightNavBarEl) {
|
|
266
267
|
rightNavBarEl.style.top = `${
|
|
@@ -322,17 +323,14 @@ export default class ContentLayout extends LightningElement {
|
|
|
322
323
|
};
|
|
323
324
|
|
|
324
325
|
onSlotChange(event: Event): void {
|
|
325
|
-
const slotElements = (
|
|
326
|
-
event.target as HTMLSlotElement
|
|
327
|
-
).assignedElements();
|
|
326
|
+
const slotElements = (event.target as HTMLSlotElement).assignedElements();
|
|
328
327
|
|
|
329
328
|
if (slotElements.length) {
|
|
330
329
|
this.contentLoaded = true;
|
|
331
330
|
const slotContentElement = slotElements[0];
|
|
332
|
-
const headingElements =
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
);
|
|
331
|
+
const headingElements = slotContentElement.ownerDocument?.getElementsByTagName(
|
|
332
|
+
TOC_HEADER_TAG
|
|
333
|
+
);
|
|
336
334
|
|
|
337
335
|
for (const headingElement of headingElements as any) {
|
|
338
336
|
// Sometimes elements hash is not being set when slot content is wrapped with div
|
|
@@ -392,9 +390,9 @@ export default class ContentLayout extends LightningElement {
|
|
|
392
390
|
globalNavEl?.offsetHeight +
|
|
393
391
|
contextNavEl?.offsetHeight;
|
|
394
392
|
|
|
395
|
-
const docPhaseEl = (
|
|
396
|
-
|
|
397
|
-
).assignedElements()[0] as HTMLSlotElement;
|
|
393
|
+
const docPhaseEl = (this.template.querySelector(
|
|
394
|
+
"[name=doc-phase]"
|
|
395
|
+
)! as any).assignedElements()[0] as HTMLSlotElement;
|
|
398
396
|
|
|
399
397
|
const offset = docPhaseEl
|
|
400
398
|
? headerHeight + docPhaseEl.offsetHeight
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
dx-logo {
|
|
4
4
|
min-width: fit-content;
|
|
5
|
-
min-width: -moz-fit-content;
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
.header_l2 {
|
|
9
8
|
justify-content: space-between;
|
|
10
9
|
height: var(--dx-g-doc-header-main-nav-height);
|
|
11
|
-
padding-bottom: var(--dx-g-spacing-xs);
|
|
12
|
-
background: white;
|
|
13
10
|
}
|
|
14
11
|
|
|
15
12
|
.nav_menu-button {
|
|
@@ -19,24 +16,16 @@ dx-logo {
|
|
|
19
16
|
);
|
|
20
17
|
}
|
|
21
18
|
|
|
22
|
-
.has-brand.has-scoped-nav-items {
|
|
23
|
-
border-bottom: 1px solid var(--dx-g-gray-90);
|
|
24
|
-
border-top: 1px solid var(--dx-g-gray-90);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
19
|
.nav_menu-ctas {
|
|
28
20
|
margin-right: var(--dx-g-spacing-sm);
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
header:not(.has-brand) > .header_l1 {
|
|
32
|
-
background:
|
|
33
|
-
border-bottom: 1px solid var(--dx-g-gray-90);
|
|
24
|
+
background: var(--dx-g-brand-current-color-background);
|
|
34
25
|
}
|
|
35
26
|
|
|
36
27
|
header:not(.has-brand) > .header_l2 {
|
|
37
|
-
|
|
38
|
-
border-top: 1px solid var(--dx-g-gray-90);
|
|
39
|
-
padding-bottom: var(--dx-g-spacing-lg);
|
|
28
|
+
background: var(--dx-g-brand-current-color-background-2);
|
|
40
29
|
}
|
|
41
30
|
|
|
42
31
|
.header_l2_group.header_l2_group-right-ctas {
|
|
@@ -67,10 +56,6 @@ header:not(.has-brand) > .header_l2 {
|
|
|
67
56
|
--border-color: var(--button-primary-color-hover);
|
|
68
57
|
}
|
|
69
58
|
|
|
70
|
-
.has-brand .header_l2_group-title {
|
|
71
|
-
padding-bottom: calc(var(--dx-g-spacing-md) + 2px);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
59
|
@media (max-width: 768px) {
|
|
75
60
|
.header_l2 {
|
|
76
61
|
padding: 0;
|
|
@@ -97,10 +82,6 @@ header:not(.has-brand) > .header_l2 {
|
|
|
97
82
|
margin-right: var(--dx-g-spacing-sm);
|
|
98
83
|
}
|
|
99
84
|
|
|
100
|
-
.has-brand .header_l2_group-title {
|
|
101
|
-
padding-bottom: var(--dx-g-spacing-smd);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
85
|
.header_l2_group-title {
|
|
105
86
|
margin-right: 0;
|
|
106
87
|
padding: var(--dx-g-spacing-smd)
|
|
@@ -121,10 +102,6 @@ header:not(.has-brand) > .header_l2 {
|
|
|
121
102
|
}
|
|
122
103
|
|
|
123
104
|
.has-scoped-nav-items .header_l2_group-title {
|
|
124
|
-
border-bottom: 1px solid var(--dx-g-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
header:not(.has-brand) > .header_l2 {
|
|
128
|
-
padding-bottom: 0;
|
|
105
|
+
border-bottom: 1px solid var(--dx-g-brand-current-color-border-2);
|
|
129
106
|
}
|
|
130
107
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
button {
|
|
4
4
|
opacity: 0;
|
|
5
|
-
color: rgb(11
|
|
5
|
+
color: rgb(11 92 171);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
button:hover {
|
|
@@ -17,7 +17,7 @@ button:focus {
|
|
|
17
17
|
|
|
18
18
|
button:focus-visible {
|
|
19
19
|
border-radius: 4px;
|
|
20
|
-
border: 2px solid rgb(11
|
|
20
|
+
border: 2px solid rgb(11 92 171);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.icon-wrapper {
|
|
@@ -252,11 +252,14 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
private get coveoAdvancedQueryConfig(): CoveoAdvancedQueryXMLConfig {
|
|
255
|
-
const config: {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
const config: {
|
|
256
|
+
locale?: string;
|
|
257
|
+
topicid?: string;
|
|
258
|
+
version?: string;
|
|
259
|
+
} = {
|
|
260
|
+
locale: this.languageId,
|
|
261
|
+
topicid: this.deliverable
|
|
262
|
+
};
|
|
260
263
|
|
|
261
264
|
if (this.releaseVersionId && this.releaseVersionId !== "noversion") {
|
|
262
265
|
config.version = this.releaseVersionId;
|
|
@@ -411,8 +414,12 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
411
414
|
}
|
|
412
415
|
|
|
413
416
|
getReferenceFromUrl(): PageReference {
|
|
414
|
-
const [
|
|
415
|
-
|
|
417
|
+
const [
|
|
418
|
+
page,
|
|
419
|
+
docId,
|
|
420
|
+
deliverable,
|
|
421
|
+
contentDocumentId
|
|
422
|
+
] = window.location.pathname.substr(1).split("/");
|
|
416
423
|
|
|
417
424
|
const { origin: domain, hash, search } = window.location;
|
|
418
425
|
|
|
@@ -574,14 +581,20 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
574
581
|
}
|
|
575
582
|
|
|
576
583
|
private updateSearchInput(searchParam: string): void {
|
|
577
|
-
(
|
|
578
|
-
|
|
579
|
-
)?.setSidebarInputValue(searchParam);
|
|
584
|
+
(this.template.querySelector(
|
|
585
|
+
"doc-content-layout"
|
|
586
|
+
) as any)?.setSidebarInputValue(searchParam);
|
|
580
587
|
}
|
|
581
588
|
|
|
582
589
|
private pageReferenceToString(reference: PageReference): string {
|
|
583
|
-
const {
|
|
584
|
-
|
|
590
|
+
const {
|
|
591
|
+
page,
|
|
592
|
+
docId,
|
|
593
|
+
deliverable,
|
|
594
|
+
contentDocumentId,
|
|
595
|
+
hash,
|
|
596
|
+
search
|
|
597
|
+
} = reference;
|
|
585
598
|
return `/${page}/${docId}/${deliverable}/${contentDocumentId}${this.normalizeSearch(
|
|
586
599
|
search!
|
|
587
600
|
)}${this.normalizeHash(hash)}`;
|
|
@@ -166,12 +166,12 @@ api-security-documentation {
|
|
|
166
166
|
--anypoint-button-emphasis-high-active-background-color: transparent;
|
|
167
167
|
|
|
168
168
|
/* api example */
|
|
169
|
-
--api-example-accent-color: rgb(250
|
|
170
|
-
--api-example-background-color: rgb(250
|
|
169
|
+
--api-example-accent-color: rgb(250 250 250);
|
|
170
|
+
--api-example-background-color: rgb(250 250 250);
|
|
171
171
|
--api-example-title-background-color: transparent;
|
|
172
172
|
|
|
173
173
|
/* code snippets */
|
|
174
|
-
--http-code-snippet-container-background-color: rgb(250
|
|
174
|
+
--http-code-snippet-container-background-color: rgb(250 250 250);
|
|
175
175
|
--http-code-snippet-container-padding: var(--dx-g-spacing-md);
|
|
176
176
|
|
|
177
177
|
/* prism */
|
|
@@ -208,7 +208,7 @@ api-endpoint-documentation {
|
|
|
208
208
|
);
|
|
209
209
|
|
|
210
210
|
/* description */
|
|
211
|
-
--api-endpoint-documentation-description-color: rgb(24
|
|
211
|
+
--api-endpoint-documentation-description-color: rgb(24 24 24);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
api-endpoint-documentation,
|
|
@@ -271,11 +271,11 @@ api-method-documentation {
|
|
|
271
271
|
--api-method-documentation-http-method-label-font-weight: var(
|
|
272
272
|
--dx-g-font-bold
|
|
273
273
|
);
|
|
274
|
-
--api-method-documentation-description-color: rgb(24
|
|
274
|
+
--api-method-documentation-description-color: rgb(24 24 24);
|
|
275
275
|
--api-method-documentation-operation-id-color: var(--dx-g-gray-50);
|
|
276
276
|
|
|
277
277
|
/* body */
|
|
278
|
-
--api-body-document-description-color: rgb(24
|
|
278
|
+
--api-body-document-description-color: rgb(24 24 24);
|
|
279
279
|
--api-body-document-media-type-selector-color: var(--dx-g-blue-vibrant-20);
|
|
280
280
|
--api-body-document-media-type-selector-font-size: var(
|
|
281
281
|
--amf-h8-mod-font-size
|