From 1d2746c2bc74d5055ec3cdc425fd635bd7bc94ab Mon Sep 17 00:00:00 2001 From: Melissa Garcia Date: Tue, 24 Sep 2024 17:00:22 -0700 Subject: [PATCH] feat: redocly scroll y offset --- README.md | 14 ++++++++++++++ packages/gatsby-theme-aio/package.json | 2 +- .../src/components/RedoclyAPIBlock/index.js | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9622c68613..31763306b3 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ Using a theme, all of your default configuration lives in an npm package. - [disableSidebar (optional)](#disablesidebar-optional) - [disableSearch (optional)](#disablesearch-optional) - [hideTryItPanel (optional)](#hidetryitpanel-optional) + - [scrollYOffset (optional)](#scrollyoffset-optional) - [sortOperationsAlphabetically (optional)](#sortoperationsalphabetically-optional) - [sortTagsAlphabetically (optional)](#sorttagsalphabetically-optional) - [jsonSampleExpandLevel (optional)](#jsonsampleexpandlevel-optional) @@ -1199,6 +1200,19 @@ Defaults to ```false``` https://redocly.com/docs/api-reference-docs/configuration/functionality/#theme-object-openapi-schema +#### scrollYOffset (optional) + +```js + +``` + +Specifies a vertical scroll-offset. This is useful when there are fixed positioned elements at the top of the page, such as navbars, headers etc. You can specify the scrollYOffset value as a number - a fixed number of pixels to be used as the offset. + +Defaults to ```0``` + +https://redocly.com/docs/api-reference-docs/configuration/functionality/#theme-object-openapi-schema + + #### sortOperationsAlphabetically (optional) ```js diff --git a/packages/gatsby-theme-aio/package.json b/packages/gatsby-theme-aio/package.json index 1ddf159788..fc80f1b583 100644 --- a/packages/gatsby-theme-aio/package.json +++ b/packages/gatsby-theme-aio/package.json @@ -1,6 +1,6 @@ { "name": "@adobe/gatsby-theme-aio", - "version": "4.14.10", + "version": "4.14.11", "description": "The Adobe I/O theme for building markdown powered sites", "main": "index.js", "license": "Apache-2.0", diff --git a/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js b/packages/gatsby-theme-aio/src/components/RedoclyAPIBlock/index.js index c5d1614ef7..8f64adf468 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, hideTryItPanel = false, + scrollYOffset = 0, sortOperationsAlphabetically = false, sortTagsAlphabetically = false, jsonSampleExpandLevel = 2, @@ -70,6 +71,7 @@ const RedoclyAPIBlock = ({ disableSidebar: ${disableSidebar}, disableSearch: ${disableSearch}, hideTryItPanel: ${hideTryItPanel}, + scrollYOffset: ${scrollYOffset}, sortOperationsAlphabetically: ${sortOperationsAlphabetically}, sortTagsAlphabetically: ${sortTagsAlphabetically}, jsonSampleExpandLevel: ${jsonSampleExpandLevel === all ? `'${jsonSampleExpandLevel}'` : jsonSampleExpandLevel}, @@ -101,6 +103,7 @@ RedoclyAPIBlock.propTypes = { disableSidebar: PropTypes.bool, disableSearch: PropTypes.bool, hideTryItPanel: PropTypes.bool, + scrollYOffset: PropTypes.number, sortOperationsAlphabetically: PropTypes.bool, sortTagsAlphabetically: PropTypes.bool, jsonSampleExpandLevel: PropTypes.oneOfType([