From 2a28130c82969229a8b72a486d2997fddd9426f4 Mon Sep 17 00:00:00 2001 From: Sergey Dubovyk Date: Mon, 30 Sep 2019 12:56:03 +0300 Subject: [PATCH 01/15] feat(cli): added support for JSON string value for --options CLI argument (#1047) closes #797 --- cli/index.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cli/index.ts b/cli/index.ts index 73e3a209..7bb27bb2 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -69,9 +69,11 @@ YargsParser.command( watch: argv.watch as boolean, templateFileName: argv.template as string, templateOptions: argv.templateOptions || {}, - redocOptions: argv.options || {}, + redocOptions: getObjectOrJSON(argv.options), }; + console.log(config); + try { await serve(argv.port as number, argv.spec as string, config); } catch (e) { @@ -124,7 +126,7 @@ YargsParser.command( disableGoogleFont: argv.disableGoogleFont as boolean, templateFileName: argv.template as string, templateOptions: argv.templateOptions || {}, - redocOptions: argv.options || {}, + redocOptions: getObjectOrJSON(argv.options), }; try { @@ -353,3 +355,15 @@ function handleError(error: Error) { console.error(error.stack); process.exit(1); } + +function getObjectOrJSON(options) { + try { + return options && typeof options === 'string' + ? JSON.parse(options) : options + ? options + : {}; + } catch (e) { + console.log(`Encountered error:\n${options}\nis not a valid JSON.`); + handleError(e); + } +} From 9f0694c10f116cd2aa19932df4883aa1f56aad49 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 10:40:13 +0300 Subject: [PATCH 02/15] docs: expandDefaultServerVariables --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ffd317f1..81b78d36 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,7 @@ You can use all of the following options with standalone version on tag * `onlyRequiredInSamples` - shows only required fields in request samples. * `jsonSampleExpandLevel` - set the default expand level for JSON payload samples (responses and request body). Special value 'all' expands all levels. The default value is `2`. * `menuToggle` - if true clicking second time on expanded menu item will collapse it, default `false` +* `expandDefaultServerVariables` - enable expanding default server variables, default `false` * `theme` - ReDoc theme. Not documented yet. For details check source code: [theme.ts](https://github.com/Redocly/redoc/blob/master/src/theme.ts) ## Advanced usage of standalone version From e787d9e276ea85958a3b0258b8443ad3067efaf4 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 11:05:09 +0300 Subject: [PATCH 03/15] fix: do not crash on empty scopes fixes #1044 --- src/components/SecuritySchemes/SecuritySchemes.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SecuritySchemes/SecuritySchemes.tsx b/src/components/SecuritySchemes/SecuritySchemes.tsx index fc5f3bc0..f192cc2f 100644 --- a/src/components/SecuritySchemes/SecuritySchemes.tsx +++ b/src/components/SecuritySchemes/SecuritySchemes.tsx @@ -49,7 +49,7 @@ export class OAuthFlow extends React.PureComponent { Scopes:
    - {Object.keys(flow!.scopes).map(scope => ( + {Object.keys(flow!.scopes || {}).map(scope => (
  • {scope} -
  • From 5aa77843076558e4e6c27a922f0253d4c84de2d0 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 11:20:55 +0300 Subject: [PATCH 04/15] fix: auth section appears twice fixes #818 --- src/services/OpenAPIParser.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/services/OpenAPIParser.ts b/src/services/OpenAPIParser.ts index 9d1a716d..029af319 100644 --- a/src/services/OpenAPIParser.ts +++ b/src/services/OpenAPIParser.ts @@ -4,7 +4,11 @@ import { OpenAPIRef, OpenAPISchema, OpenAPISpec, Referenced } from '../types'; import { appendToMdHeading, IS_BROWSER } from '../utils/'; import { JsonPointer } from '../utils/JsonPointer'; -import { isNamedDefinition, SECURITY_DEFINITIONS_COMPONENT_NAME } from '../utils/openapi'; +import { + isNamedDefinition, + SECURITY_DEFINITIONS_COMPONENT_NAME, + SECURITY_DEFINITIONS_JSX_NAME, +} from '../utils/openapi'; import { buildComponentComment, MarkdownRenderer } from './MarkdownRenderer'; import { RedocNormalizedOptions } from './RedocNormalizedOptions'; @@ -74,7 +78,10 @@ export class OpenAPIParser { ) { // Automatically inject Authentication section with SecurityDefinitions component const description = spec.info.description || ''; - if (!MarkdownRenderer.containsComponent(description, SECURITY_DEFINITIONS_COMPONENT_NAME)) { + if ( + !MarkdownRenderer.containsComponent(description, SECURITY_DEFINITIONS_COMPONENT_NAME) && + !MarkdownRenderer.containsComponent(description, SECURITY_DEFINITIONS_JSX_NAME) + ) { const comment = buildComponentComment(SECURITY_DEFINITIONS_COMPONENT_NAME); spec.info.description = appendToMdHeading(description, 'Authentication', comment); } From 67e2a8fb797a525ae80782c10c0ab030da0367a0 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 11:32:27 +0300 Subject: [PATCH 05/15] fix: left menu item before group is not highligted fixes #1033 --- src/services/MenuStore.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/services/MenuStore.ts b/src/services/MenuStore.ts index f775070b..16119e7e 100644 --- a/src/services/MenuStore.ts +++ b/src/services/MenuStore.ts @@ -116,7 +116,7 @@ export class MenuStore { } if (isScrolledDown) { - const el = this.getElementAt(itemIdx + 1); + const el = this.getElementAtOrFirstChild(itemIdx + 1); if (this.scroll.isElementBellow(el)) { break; } @@ -163,6 +163,18 @@ export class MenuStore { return (item && querySelector(`[${SECTION_ATTR}="${item.id}"]`)) || null; } + /** + * get section/operation DOM Node related to the item or if it is group item, returns first item of the group + * @param idx item absolute index + */ + getElementAtOrFirstChild(idx: number): Element | null { + let item = this.flatItems[idx]; + if (item && item.type === 'group') { + item = item.items[0]; + } + return (item && querySelector(`[${SECTION_ATTR}="${item.id}"]`)) || null; + } + /** * current active item */ From 4649683785ac36320084e6f425cb3e23f053951b Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 11:37:35 +0300 Subject: [PATCH 06/15] fix: clicking on group title breaks first tag fixes #1034 --- src/services/MenuStore.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/services/MenuStore.ts b/src/services/MenuStore.ts index 16119e7e..0626196d 100644 --- a/src/services/MenuStore.ts +++ b/src/services/MenuStore.ts @@ -201,6 +201,11 @@ export class MenuStore { if ((this.activeItem && this.activeItem.id) === (item && item.id)) { return; } + + if (item && item.type === 'group') { + return; + } + this.deactivate(this.activeItem); if (!item) { this.history.replace('', rewriteHistory); From faa74d60026bf1900309f5bb7b1e9a331f7a2d96 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 12:55:47 +0300 Subject: [PATCH 07/15] fix: false-positive recursive detection with allOf at the same level --- src/services/OpenAPIParser.ts | 37 +++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/src/services/OpenAPIParser.ts b/src/services/OpenAPIParser.ts index 029af319..a215b4f0 100644 --- a/src/services/OpenAPIParser.ts +++ b/src/services/OpenAPIParser.ts @@ -44,6 +44,7 @@ class RefCounter { export class OpenAPIParser { specUrl?: string; spec: OpenAPISpec; + mergeRefs: Set; private _refCounter: RefCounter = new RefCounter(); @@ -57,6 +58,8 @@ export class OpenAPIParser { this.spec = spec; + this.mergeRefs = new Set(); + const href = IS_BROWSER ? window.location.href : ''; if (typeof specUrl === 'string') { this.specUrl = urlResolve(href, specUrl); @@ -183,7 +186,12 @@ export class OpenAPIParser { schema: OpenAPISchema, $ref?: string, forceCircular: boolean = false, + used$Refs = new Set(), ): MergedOpenAPISchema { + if ($ref) { + used$Refs.add($ref); + } + schema = this.hoistOneOfs(schema); if (schema.allOf === undefined) { @@ -205,16 +213,25 @@ export class OpenAPIParser { receiver.items = { ...receiver.items }; } - const allOfSchemas = schema.allOf.map(subSchema => { - const resolved = this.deref(subSchema, forceCircular); - const subRef = subSchema.$ref || undefined; - const subMerged = this.mergeAllOf(resolved, subRef, forceCircular); - receiver.parentRefs!.push(...(subMerged.parentRefs || [])); - return { - $ref: subRef, - schema: subMerged, - }; - }); + const allOfSchemas = schema.allOf + .map(subSchema => { + if (subSchema && subSchema.$ref && used$Refs.has(subSchema.$ref)) { + return undefined; + } + + const resolved = this.deref(subSchema, forceCircular); + const subRef = subSchema.$ref || undefined; + const subMerged = this.mergeAllOf(resolved, subRef, forceCircular, used$Refs); + receiver.parentRefs!.push(...(subMerged.parentRefs || [])); + return { + $ref: subRef, + schema: subMerged, + }; + }) + .filter(child => child !== undefined) as Array<{ + $ref: string | undefined; + schema: MergedOpenAPISchema; + }>; for (const { $ref: subSchemaRef, schema: subSchema } of allOfSchemas) { if ( From e318fb3381557e71683d6473a5a4d6ba9a0a9055 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 13:10:32 +0300 Subject: [PATCH 08/15] fix: remove excessive whitespace between md sections on small screens fixes #874 --- src/common-elements/panels.ts | 10 ++++++---- src/components/ContentItems/ContentItems.tsx | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/common-elements/panels.ts b/src/common-elements/panels.ts index 2f30b399..c434c503 100644 --- a/src/common-elements/panels.ts +++ b/src/common-elements/panels.ts @@ -1,14 +1,16 @@ import { SECTION_ATTR } from '../services/MenuStore'; import styled, { media } from '../styled-components'; -export const MiddlePanel = styled.div` +export const MiddlePanel = styled.div<{ compact?: boolean }>` width: calc(100% - ${props => props.theme.rightPanel.width}); padding: 0 ${props => props.theme.spacing.sectionHorizontal}px; - ${media.lessThan('medium', true)` + ${({ compact, theme }) => + media.lessThan('medium', true)` width: 100%; - padding: ${props => - `${props.theme.spacing.sectionVertical}px ${props.theme.spacing.sectionHorizontal}px`}; + padding: ${`${compact ? 0 : theme.spacing.sectionVertical}px ${ + theme.spacing.sectionHorizontal + }px`}; `}; `; diff --git a/src/components/ContentItems/ContentItems.tsx b/src/components/ContentItems/ContentItems.tsx index 3b638896..01f76eb5 100644 --- a/src/components/ContentItems/ContentItems.tsx +++ b/src/components/ContentItems/ContentItems.tsx @@ -60,7 +60,7 @@ export class ContentItem extends React.Component { } } -const middlePanelWrap = component => {component}; +const middlePanelWrap = component => {component}; @observer export class SectionItem extends React.Component { @@ -71,7 +71,7 @@ export class SectionItem extends React.Component { return ( <> - +
    {name} From 53962def827b87743df872dffb70e7552d296d74 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 13:33:05 +0300 Subject: [PATCH 09/15] =?UTF-8?q?chore:=20Release=202.0.0-rc.15=20?= =?UTF-8?q?=F0=9F=94=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 24 ++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3c424a1..d22adbb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +# [2.0.0-rc.15](https://github.com/Redocly/redoc/compare/v2.0.0-rc.14...v2.0.0-rc.15) (2019-09-30) + + +### Bug Fixes + +* auth section appears twice ([5aa7784](https://github.com/Redocly/redoc/commit/5aa7784)), closes [#818](https://github.com/Redocly/redoc/issues/818) +* clicking on group title breaks first tag ([4649683](https://github.com/Redocly/redoc/commit/4649683)), closes [#1034](https://github.com/Redocly/redoc/issues/1034) +* do not crash on empty scopes ([e787d9e](https://github.com/Redocly/redoc/commit/e787d9e)), closes [#1044](https://github.com/Redocly/redoc/issues/1044) +* false-positive recursive detection with allOf at the same level ([faa74d6](https://github.com/Redocly/redoc/commit/faa74d6)) +* fix scrollYOffset when SSR ([21258a5](https://github.com/Redocly/redoc/commit/21258a5)) +* left menu item before group is not highligted ([67e2a8f](https://github.com/Redocly/redoc/commit/67e2a8f)), closes [#1033](https://github.com/Redocly/redoc/issues/1033) +* remove excessive whitespace between md sections on small screens ([e318fb3](https://github.com/Redocly/redoc/commit/e318fb3)), closes [#874](https://github.com/Redocly/redoc/issues/874) +* use url-template dependency ([#1008](https://github.com/Redocly/redoc/issues/1008)) ([32a464a](https://github.com/Redocly/redoc/commit/32a464a)), closes [#1007](https://github.com/Redocly/redoc/issues/1007) + + +### Features + +* **cli:** added support for JSON string value for --options CLI argument ([#1047](https://github.com/Redocly/redoc/issues/1047)) ([2a28130](https://github.com/Redocly/redoc/commit/2a28130)), closes [#797](https://github.com/Redocly/redoc/issues/797) +* **cli:** add `disableGoogleFont` parameter to cli ([#1045](https://github.com/Redocly/redoc/issues/1045)) ([aceb343](https://github.com/Redocly/redoc/commit/aceb343)) +* new option expandDefaultServerVariables ([#1014](https://github.com/Redocly/redoc/issues/1014)) ([0360dce](https://github.com/Redocly/redoc/commit/0360dce)) + + + + # [2.0.0-rc.14](https://github.com/Redocly/redoc/compare/v2.0.0-rc.13...v2.0.0-rc.14) (2019-08-07) diff --git a/package.json b/package.json index 493d42d1..1e48b36e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redoc", - "version": "2.0.0-rc.14", + "version": "2.0.0-rc.15", "description": "ReDoc", "repository": { "type": "git", From 4f630886381e31ee98f0adeb60fd56fb86e1e7b3 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 13:34:27 +0300 Subject: [PATCH 10/15] chore(cli): redoc-cli v0.9.0 --- cli/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/package.json b/cli/package.json index 6823f4b8..644c1000 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "redoc-cli", - "version": "0.8.6", + "version": "0.9.0", "description": "ReDoc's Command Line Interface", "main": "index.js", "bin": "index.js", @@ -19,7 +19,7 @@ "node-libs-browser": "^2.2.1", "react": "^16.8.6", "react-dom": "^16.8.6", - "redoc": "2.0.0-rc.13", + "redoc": "2.0.0-rc.15", "styled-components": "^4.3.2", "tslib": "^1.10.0", "yargs": "^13.3.0" From dd583b6a2ebfc2f9848728cad8eb54e737a046ea Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 13:52:33 +0300 Subject: [PATCH 11/15] chore(cli): update yarn.lock --- cli/yarn.lock | 62 +++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/cli/yarn.lock b/cli/yarn.lock index fe2f4435..be5e09fb 100644 --- a/cli/yarn.lock +++ b/cli/yarn.lock @@ -629,10 +629,10 @@ domain-browser@^1.1.1: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== -dompurify@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-1.0.11.tgz#fe0f4a40d147f7cebbe31a50a1357539cfc1eb4d" - integrity sha512-XywCTXZtc/qCX3iprD1pIklRVk/uhl8BKpkTxr+ZyMVUzSUg7wkQXRBp/euJ5J5moa1QvfpvaPQVP71z1O59dQ== +dompurify@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.0.3.tgz#5cc4965a487d54aedba6ba9634b137cfbd7eb50d" + integrity sha512-q006uOkD2JGSJgF0qBt7rVhUvUPBWCxpGayALmHvXx2iNlMfNVz7PDGeXEUjNGgIDjADz59VZCv6UE3U8XRWVw== elliptic@^6.0.0: version "6.5.0" @@ -1092,7 +1092,7 @@ mem@^4.0.0: mimic-fn "^2.0.0" p-is-promise "^2.0.0" -memoize-one@^5.0.0, memoize-one@^5.0.5: +memoize-one@^5.0.0, memoize-one@~5.0.5: version "5.0.5" resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.0.5.tgz#8cd3809555723a07684afafcd6f756072ac75d7e" integrity sha512-ey6EpYv0tEaIbM/nTDOpHciXUvd+ackQrJgEzBwemhZZIWZjcyodqEcrmqDy2BKRTM3a65kKBV4WtLXJDt26SQ== @@ -1161,10 +1161,10 @@ mobx-react-lite@1.4.0: resolved "https://registry.yarnpkg.com/mobx-react-lite/-/mobx-react-lite-1.4.0.tgz#193beb5fdddf17ae61542f65ff951d84db402351" integrity sha512-5xCuus+QITQpzKOjAOIQ/YxNhOl/En+PlNJF+5QU4Qxn9gnNMJBbweAdEW3HnuVQbfqDYEUnkGs5hmkIIStehg== -mobx-react@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-6.1.1.tgz#24a2c8a3393890fa732b4efd34cc6dcccf6e0e7a" - integrity sha512-hjACWCTpxZf9Sv1YgWF/r6HS6Nsly1SYF22qBJeUE3j+FMfoptgjf8Zmcx2d6uzA07Cezwap5Cobq9QYa0MKUw== +mobx-react@^6.1.3: + version "6.1.3" + resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-6.1.3.tgz#ad07880ea60cdcdb2a7e2a0d54e01379710cf00a" + integrity sha512-eT/jO9dYIoB1AlZwI2VC3iX0gPOeOIqZsiwg7tDJV1B7Z69h+TZZL3dgOE0UeS2zoHhGeKbP+K+OLeLMnnkGnA== dependencies: mobx-react-lite "1.4.0" @@ -1540,10 +1540,10 @@ react-dropdown@^1.6.4: dependencies: classnames "^2.2.3" -react-hot-loader@^4.12.10: - version "4.12.10" - resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.10.tgz#b3457c0f733423c4827c6d2672e50c9f8bedaf6b" - integrity sha512-dX+ZUigxQijWLsKPnxc0khuCt2sYiZ1W59LgSBMOLeGSG3+HkknrTlnJu6BCNdhYxbEQkGvBsr7zXlNWYUIhAQ== +react-hot-loader@^4.12.14: + version "4.12.14" + resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.14.tgz#81ca06ffda0b90aad15d6069339f73ed6428340a" + integrity sha512-ecxH4eBvEaJ9onT8vkEmK1FAAJUh1PqzGqds9S3k+GeihSp7nKAp4fOxytO+Ghr491LiBD38jaKyDXYnnpI9pQ== dependencies: fast-levenshtein "^2.0.6" global "^4.3.0" @@ -1602,35 +1602,35 @@ readdirp@^3.1.1: dependencies: picomatch "^2.0.4" -redoc@2.0.0-rc.13: - version "2.0.0-rc.13" - resolved "https://registry.yarnpkg.com/redoc/-/redoc-2.0.0-rc.13.tgz#243e4d003ca9bd45006c215d8856a3b1229ca8bb" - integrity sha512-t0vlss1TIUknYXTI9RIZ1nRMyIW/pjo4KMMDFOMdRq5/8jopkNyf37q25BwBuAJfDxQV+tIUoy6o+rAAffeDkQ== +redoc@2.0.0-rc.15: + version "2.0.0-rc.15" + resolved "https://registry.yarnpkg.com/redoc/-/redoc-2.0.0-rc.15.tgz#e2aba00e7f64e002de57b0c98e170e4933776b7a" + integrity sha512-sNBM51UQqod8WFlNJZ0BhJDcH/cq7mYjp//YgUbrVVjXvjy4s6SYmqc9A58fW3/EJwidtq73Qie12gDBSocV0Q== dependencies: classnames "^2.2.6" decko "^1.2.0" - dompurify "^1.0.11" + dompurify "^2.0.3" eventemitter3 "^4.0.0" json-pointer "^0.6.0" json-schema-ref-parser "^6.1.0" lunr "2.3.6" mark.js "^8.11.1" marked "^0.7.0" - memoize-one "^5.0.5" - mobx-react "^6.1.1" + memoize-one "~5.0.5" + mobx-react "^6.1.3" openapi-sampler "1.0.0-beta.15" perfect-scrollbar "^1.4.0" polished "^3.4.1" prismjs "^1.17.1" prop-types "^15.7.2" react-dropdown "^1.6.4" - react-hot-loader "^4.12.10" + react-hot-loader "^4.12.14" react-tabs "^3.0.0" - slugify "^1.3.4" + slugify "^1.3.5" stickyfill "^1.1.1" swagger2openapi "^5.3.1" tslib "^1.10.0" - uri-template-lite "^19.4.0" + url-template "^2.0.8" reftools@^1.0.8: version "1.0.8" @@ -1782,10 +1782,10 @@ signal-exit@^3.0.0: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= -slugify@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.3.4.tgz#78d2792d7222b55cd9fc81fa018df99af779efeb" - integrity sha512-KP0ZYk5hJNBS8/eIjGkFDCzGQIoZ1mnfQRYS5WM3273z+fxGWXeN0fkwf2ebEweydv9tioZIHGZKoF21U07/nw== +slugify@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.3.5.tgz#90210678818b6d533cb060083aed0e8238133508" + integrity sha512-5VCnH7aS13b0UqWOs7Ef3E5rkhFe8Od+cp7wybFv5mv/sYSRkucZlJX0bamAJky7b2TTtGvrJBWVdpdEicsSrA== source-map@^0.5.0: version "0.5.7" @@ -2002,10 +2002,10 @@ uglify-js@^3.1.4: commander "~2.20.0" source-map "~0.6.1" -uri-template-lite@^19.4.0: - version "19.4.0" - resolved "https://registry.yarnpkg.com/uri-template-lite/-/uri-template-lite-19.4.0.tgz#cbc2c072cf4931428a2f9d3aea36b8254a33cce5" - integrity sha512-VY8dgwyMwnCztkzhq0cA/YhNmO+YZqow//5FdmgE2fZU/JPi+U0rPL7MRDi0F+Ch4vJ7nYidWzeWAeY7uywe9g== +url-template@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" + integrity sha1-/FZaPMy/93MMd19WQflVV5FDnyE= url@^0.11.0: version "0.11.0" From eb8d4fd678e38c187056c084f55d9ccfdcf368c8 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 13:56:53 +0300 Subject: [PATCH 12/15] chore(cli): redoc-cli@0.9.1 --- cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/package.json b/cli/package.json index 644c1000..42845ece 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "redoc-cli", - "version": "0.9.0", + "version": "0.9.1", "description": "ReDoc's Command Line Interface", "main": "index.js", "bin": "index.js", From d09c1c1086377e1c74232ccb03e33491606fe95b Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 14:39:58 +0300 Subject: [PATCH 13/15] fix: fix scrollYOffset when SSR --- src/components/StickySidebar/StickyResponsiveSidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/StickySidebar/StickyResponsiveSidebar.tsx b/src/components/StickySidebar/StickyResponsiveSidebar.tsx index 5b4aa394..7159dc1e 100644 --- a/src/components/StickySidebar/StickyResponsiveSidebar.tsx +++ b/src/components/StickySidebar/StickyResponsiveSidebar.tsx @@ -87,7 +87,7 @@ export class StickyResponsiveSidebar extends React.Component< > { static contextType = OptionsContext; context!: React.ContextType; - state: StickySidebarState = {}; + state: StickySidebarState = { offsetTop: '0px' }; stickyElement: Element; @@ -122,7 +122,7 @@ export class StickyResponsiveSidebar extends React.Component< render() { const open = this.props.menu.sideBarOpened; - const top = this.state.offsetTop || this.getScrollYOffset(this.context); + const top = this.state.offsetTop; return ( <> From 98a51391279396e7b1a0381c61203f4a20780c7e Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 14:40:58 +0300 Subject: [PATCH 14/15] =?UTF-8?q?chore:=20Release=202.0.0-rc.16=20?= =?UTF-8?q?=F0=9F=94=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d22adbb1..a948efbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [2.0.0-rc.16](https://github.com/Redocly/redoc/compare/v2.0.0-rc.15...v2.0.0-rc.16) (2019-09-30) + + +### Bug Fixes + +* fix scrollYOffset when SSR ([d09c1c1](https://github.com/Redocly/redoc/commit/d09c1c1)) + + + # [2.0.0-rc.15](https://github.com/Redocly/redoc/compare/v2.0.0-rc.14...v2.0.0-rc.15) (2019-09-30) diff --git a/package.json b/package.json index 1e48b36e..87aac37e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redoc", - "version": "2.0.0-rc.15", + "version": "2.0.0-rc.16", "description": "ReDoc", "repository": { "type": "git", From 69c3dce883db046f406d6984523d1695b6b6320a Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 30 Sep 2019 14:53:07 +0300 Subject: [PATCH 15/15] chore(cli): redoc-cli@0.9.2 --- cli/package.json | 4 ++-- cli/yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/package.json b/cli/package.json index 42845ece..0291c544 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "redoc-cli", - "version": "0.9.1", + "version": "0.9.2", "description": "ReDoc's Command Line Interface", "main": "index.js", "bin": "index.js", @@ -19,7 +19,7 @@ "node-libs-browser": "^2.2.1", "react": "^16.8.6", "react-dom": "^16.8.6", - "redoc": "2.0.0-rc.15", + "redoc": "2.0.0-rc.16", "styled-components": "^4.3.2", "tslib": "^1.10.0", "yargs": "^13.3.0" diff --git a/cli/yarn.lock b/cli/yarn.lock index be5e09fb..7e1362f3 100644 --- a/cli/yarn.lock +++ b/cli/yarn.lock @@ -1602,10 +1602,10 @@ readdirp@^3.1.1: dependencies: picomatch "^2.0.4" -redoc@2.0.0-rc.15: - version "2.0.0-rc.15" - resolved "https://registry.yarnpkg.com/redoc/-/redoc-2.0.0-rc.15.tgz#e2aba00e7f64e002de57b0c98e170e4933776b7a" - integrity sha512-sNBM51UQqod8WFlNJZ0BhJDcH/cq7mYjp//YgUbrVVjXvjy4s6SYmqc9A58fW3/EJwidtq73Qie12gDBSocV0Q== +redoc@2.0.0-rc.16: + version "2.0.0-rc.16" + resolved "https://registry.yarnpkg.com/redoc/-/redoc-2.0.0-rc.16.tgz#01d5dafba6ae266a5934dc9904b87bc8a175b222" + integrity sha512-5YWk7NBebYZ8xMbKXA1sD++QsSh7NbnB2sStJRKLeP/rU4oX586SIqHXl+MW1OhIZW44mYFMHpYzxpZKCllk9w== dependencies: classnames "^2.2.6" decko "^1.2.0"