@salesforcedevs/docs-components 1.3.194 → 1.3.196-alpha.10
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 +27 -18
- package/src/modules/doc/content/content.css +1 -1
- package/src/modules/doc/header/header.css +0 -1
- 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/LICENSE +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.196-alpha.10",
|
|
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": "4629fdd9ca18a13480044ad43515b91945d16aad"
|
|
28
28
|
}
|
|
@@ -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) {
|
|
@@ -1267,10 +1272,12 @@ 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
|
|
@@ -1317,8 +1324,9 @@ export default class AmfReference extends LightningElement {
|
|
|
1317
1324
|
const name = event.detail.name;
|
|
1318
1325
|
if (name) {
|
|
1319
1326
|
const urlReferenceId = this.getReferenceIdFromUrl(name);
|
|
1320
|
-
const specBasedReference =
|
|
1321
|
-
|
|
1327
|
+
const specBasedReference = this.isSpecBasedReference(
|
|
1328
|
+
urlReferenceId
|
|
1329
|
+
);
|
|
1322
1330
|
if (specBasedReference) {
|
|
1323
1331
|
const metaVal = this.getMetaFromUrl(name);
|
|
1324
1332
|
const currentSelectedMeta = this.selectedTopic
|
|
@@ -1373,8 +1381,9 @@ export default class AmfReference extends LightningElement {
|
|
|
1373
1381
|
const currentReferenceId = this.getReferenceIdFromUrl(currentUrl);
|
|
1374
1382
|
//No need to do anything if user is expanding currently selected reference
|
|
1375
1383
|
if (referenceId !== currentReferenceId) {
|
|
1376
|
-
const isSpecBasedReference =
|
|
1377
|
-
|
|
1384
|
+
const isSpecBasedReference = this.isSpecBasedReference(
|
|
1385
|
+
referenceId
|
|
1386
|
+
);
|
|
1378
1387
|
if (isSpecBasedReference) {
|
|
1379
1388
|
// Perform functionality same as item selection
|
|
1380
1389
|
this.onNavSelect(event);
|
|
@@ -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
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
-
|
|
10
|
-
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
-
|
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|