From dd7d0d4c41e845e56126dcee2d7cf91d391c0628 Mon Sep 17 00:00:00 2001 From: Radu Cotescu Date: Tue, 22 Jul 2025 14:30:09 +0200 Subject: [PATCH 1/2] feat: added the redocly loading spinner for the RedoclyAPIBlock --- README.md | 10 ++++++++++ example/gatsby-config.js | 5 +++++ example/src/pages/api-2.md | 5 +++++ .../src/components/RedoclyAPIBlock/index.js | 4 +++- 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 example/src/pages/api-2.md diff --git a/README.md b/README.md index 8ce1f8d03f..267225f880 100644 --- a/README.md +++ b/README.md @@ -1201,6 +1201,16 @@ Defaults to ```false``` https://redocly.com/docs/api-reference-docs/configuration/functionality/#theme-object-openapi-schema +#### hideLoading (optional) + +```js + +``` + +When set to `true` it disables the loading spinner when rendering an OpenAPI file client-side. + +Defaults to ```false```. + #### hideTryItPanel (optional) ```js diff --git a/example/gatsby-config.js b/example/gatsby-config.js index c26163269d..c0be0dd49b 100644 --- a/example/gatsby-config.js +++ b/example/gatsby-config.js @@ -70,6 +70,11 @@ module.exports = { description: 'This is the OpenAPI page of Adobe Analytics', path: '/api/index.md/' }, + { + title: 'Analytics API - RedoclyAPIBlock', + description: 'This is the OpenAPI page of Adobe Analytics', + path: '/api-2.md/' + }, { title: 'Analytics Swagger file', description: 'External link', diff --git a/example/src/pages/api-2.md b/example/src/pages/api-2.md new file mode 100644 index 0000000000..de355b8484 --- /dev/null +++ b/example/src/pages/api-2.md @@ -0,0 +1,5 @@ +--- +title: OpenAPI - Adobe Analytics +layout: none +--- + \ No newline at end of file diff --git a/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js b/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js index 2c985447f4..0ffdac686b 100644 --- a/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js +++ b/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js @@ -26,6 +26,7 @@ const RedoclyAPIBlock = ({ disableSidebar = false, disableSearch = false, ctrlFHijack = true, + hideLoading = false, hideTryItPanel = false, scrollYOffset = 0, sortOperationsAlphabetically = false, @@ -79,7 +80,7 @@ const RedoclyAPIBlock = ({ jsonSampleExpandLevel: ${jsonSampleExpandLevel === all ? `'${jsonSampleExpandLevel}'` : jsonSampleExpandLevel}, ${generateCodeSamples ? "generateCodeSamples: { " + generateCodeSamples + "}," : ''} ${requestInterceptor ? "requestInterceptor: " + requestInterceptor + "," : ''} - hideLoading: true, + hideLoading: ${hideLoading}, theme: { ${typography ? "typography: { " + typography + "}," : ''} rightPanel: { @@ -104,6 +105,7 @@ RedoclyAPIBlock.propTypes = { codeBlock: PropTypes.string, disableSidebar: PropTypes.bool, disableSearch: PropTypes.bool, + hideLoading: PropTypes.bool, hideTryItPanel: PropTypes.bool, scrollYOffset: PropTypes.number, sortOperationsAlphabetically: PropTypes.bool, From 3d1e1449e28560b8f8db9f62caf3cf1e46982c6f Mon Sep 17 00:00:00 2001 From: Radu Cotescu Date: Wed, 23 Jul 2025 12:59:48 +0200 Subject: [PATCH 2/2] Update README.md Co-authored-by: melissag-ensemble <120194874+melissag-ensemble@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 267225f880..624bf9d825 100644 --- a/README.md +++ b/README.md @@ -1204,7 +1204,7 @@ https://redocly.com/docs/api-reference-docs/configuration/functionality/#theme-o #### hideLoading (optional) ```js - + ``` When set to `true` it disables the loading spinner when rendering an OpenAPI file client-side.