From 5f59612fe7ce82c5335718bdf75b1165544541b7 Mon Sep 17 00:00:00 2001 From: melissag-ensemble <120194874+melissag-ensemble@users.noreply.github.com> Date: Tue, 1 Oct 2024 12:45:18 -0700 Subject: [PATCH] feat: redocly scroll y offset (#1620) --- README.md | 14 ++++++++++++++ packages/gatsby-theme-aio/CHANGELOG.md | 5 +++++ packages/gatsby-theme-aio/package.json | 2 +- .../src/components/RedoclyAPIBlock/index.js | 3 +++ 4 files changed, 23 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/CHANGELOG.md b/packages/gatsby-theme-aio/CHANGELOG.md index af96cd0ec6..757f2c8d44 100644 --- a/packages/gatsby-theme-aio/CHANGELOG.md +++ b/packages/gatsby-theme-aio/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.14.11](https://github.com/adobe/aio-theme/compare/@adobe/gatsby-theme-aio@4.14.10..@adobe/gatsby-theme-aio@4.14.11) (2024-09-24) + +### Features +* Add scrollYOffset config to RedoclyAPIBlock [1d2746c](https://github.com/adobe/aio-theme/commit/1d2746c2bc74d5055ec3cdc425fd635bd7bc94ab) + ## [4.14.10](https://github.com/adobe/aio-theme/compare/@adobe/gatsby-theme-aio@4.14.9..@adobe/gatsby-theme-aio@4.14.10) (2024-08-14) ### Features 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([