Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: redocly scroll y offset #1620

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1199,6 +1200,19 @@ Defaults to ```false```
https://redocly.com/docs/api-reference-docs/configuration/functionality/#theme-object-openapi-schema
#### scrollYOffset (optional)
```js
<RedoclyAPIBlock src="URL pointing to your open api yaml file." scrollYOffset={64} />
```
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
Expand Down
5 changes: 5 additions & 0 deletions packages/gatsby-theme-aio/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-theme-aio/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const RedoclyAPIBlock = ({
disableSidebar = false,
disableSearch = false,
hideTryItPanel = false,
scrollYOffset = 0,
sortOperationsAlphabetically = false,
sortTagsAlphabetically = false,
jsonSampleExpandLevel = 2,
Expand Down Expand Up @@ -70,6 +71,7 @@ const RedoclyAPIBlock = ({
disableSidebar: ${disableSidebar},
disableSearch: ${disableSearch},
hideTryItPanel: ${hideTryItPanel},
scrollYOffset: ${scrollYOffset},
sortOperationsAlphabetically: ${sortOperationsAlphabetically},
sortTagsAlphabetically: ${sortTagsAlphabetically},
jsonSampleExpandLevel: ${jsonSampleExpandLevel === all ? `'${jsonSampleExpandLevel}'` : jsonSampleExpandLevel},
Expand Down Expand Up @@ -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([
Expand Down
Loading