@salesforcedevs/docs-components 1.17.6-redoc2 → 1.17.6-redoc3
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
CHANGED
|
@@ -355,11 +355,11 @@ export default class FlexReference extends LightningElement {
|
|
|
355
355
|
* Fetch spec and generate Redoc structure
|
|
356
356
|
*/
|
|
357
357
|
private async fetchSpec(amfConfig: AmfConfig): Promise<RedocSidebarData | null> {
|
|
358
|
-
const {
|
|
358
|
+
const { source } = amfConfig;
|
|
359
359
|
try {
|
|
360
|
-
// Load Redoc sidebar structure
|
|
361
|
-
if (window.Redoc?.getSpecStructure &&
|
|
362
|
-
return await window.Redoc.getSpecStructure(
|
|
360
|
+
// Load Redoc sidebar structure using the source spec URL
|
|
361
|
+
if (window.Redoc?.getSpecStructure && source) {
|
|
362
|
+
return await window.Redoc.getSpecStructure(source);
|
|
363
363
|
}
|
|
364
364
|
return null;
|
|
365
365
|
} catch (error) {
|
|
@@ -554,9 +554,9 @@ export default class FlexReference extends LightningElement {
|
|
|
554
554
|
redocContainer.firstChild.remove();
|
|
555
555
|
}
|
|
556
556
|
|
|
557
|
-
// Initialize Redoc
|
|
558
|
-
if (window.Redoc && amfConfig.
|
|
559
|
-
await window.Redoc.init(amfConfig.
|
|
557
|
+
// Initialize Redoc using the source spec URL
|
|
558
|
+
if (window.Redoc && amfConfig.source) {
|
|
559
|
+
await window.Redoc.init(amfConfig.source, {
|
|
560
560
|
expandResponses: '200,400',
|
|
561
561
|
scrollYOffset: 73,
|
|
562
562
|
sidebar: false
|
|
@@ -45,7 +45,8 @@ export interface AmfConfig {
|
|
|
45
45
|
isSelected: boolean;
|
|
46
46
|
|
|
47
47
|
// required for spec based references
|
|
48
|
-
amf?: string;
|
|
48
|
+
amf?: string; // compiled JSON for amfTopic (legacy)
|
|
49
|
+
source?: string; // spec URL
|
|
49
50
|
|
|
50
51
|
// required for markdown based references
|
|
51
52
|
topic?: ParsedMarkdownTopic;
|