@redocly/theme 0.4.14 → 0.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,6 @@ import React from 'react';
2
2
  declare type MarkdownLayoutProps = {
3
3
  tableOfContent: React.ReactNode;
4
4
  markdownWrapper: React.ReactNode;
5
- showPrevButton?: boolean;
6
- showNextButton?: boolean;
7
5
  editPage?: {
8
6
  to: string;
9
7
  text: string;
@@ -11,5 +9,5 @@ declare type MarkdownLayoutProps = {
11
9
  };
12
10
  lastModified?: string | null;
13
11
  };
14
- export declare function MarkdownLayout({ tableOfContent, markdownWrapper, showPrevButton, showNextButton, editPage, lastModified, }: MarkdownLayoutProps): JSX.Element;
12
+ export declare function MarkdownLayout({ tableOfContent, markdownWrapper, editPage, lastModified, }: MarkdownLayoutProps): JSX.Element;
15
13
  export {};
@@ -16,14 +16,14 @@ var PageNavigation_1 = require("../PageNavigation/PageNavigation");
16
16
  var EditPageButton_1 = require("../EditPageButton");
17
17
  var LastUpdated_1 = require("../LastUpdated/LastUpdated");
18
18
  function MarkdownLayout(_a) {
19
- var tableOfContent = _a.tableOfContent, markdownWrapper = _a.markdownWrapper, showPrevButton = _a.showPrevButton, showNextButton = _a.showNextButton, editPage = _a.editPage, lastModified = _a.lastModified;
19
+ var tableOfContent = _a.tableOfContent, markdownWrapper = _a.markdownWrapper, editPage = _a.editPage, lastModified = _a.lastModified;
20
20
  return (react_1.default.createElement(PageWrapper_1.PageWrapper, { "data-component-name": "Markdown/MarkdownLayout" },
21
21
  react_1.default.createElement(ContainerWrapper_1.ContainerWrapper, { withToc: true },
22
22
  react_1.default.createElement(LayoutTop, null,
23
23
  lastModified && react_1.default.createElement(LastUpdated_1.LastUpdated, { lastModified: lastModified }),
24
24
  editPage && (react_1.default.createElement(EditPageButton_1.EditPageButton, { text: editPage.text, to: editPage.to, icon: editPage.icon }))),
25
25
  markdownWrapper,
26
- react_1.default.createElement(PageNavigation_1.PageNavigation, { showPrevButton: showPrevButton, showNextButton: showNextButton })),
26
+ react_1.default.createElement(PageNavigation_1.PageNavigation, null)),
27
27
  tableOfContent));
28
28
  }
29
29
  exports.MarkdownLayout = MarkdownLayout;
@@ -1,7 +1,2 @@
1
1
  /// <reference types="react" />
2
- declare type PageNavigationProps = {
3
- showPrevButton?: boolean;
4
- showNextButton?: boolean;
5
- };
6
- export declare function PageNavigation({ showPrevButton, showNextButton, }: PageNavigationProps): JSX.Element | null;
7
- export {};
2
+ export declare function PageNavigation(): JSX.Element | null;
@@ -13,15 +13,14 @@ var styled_components_1 = __importDefault(require("styled-components"));
13
13
  var PreviousPageLink_1 = require("../PageNavigation/PreviousPageLink");
14
14
  var NextPageLink_1 = require("../PageNavigation/NextPageLink");
15
15
  var useDefaultThemeSettings_1 = require("../hooks/useDefaultThemeSettings");
16
- function PageNavigation(_a) {
17
- var _b = _a.showPrevButton, showPrevButton = _b === void 0 ? true : _b, _c = _a.showNextButton, showNextButton = _c === void 0 ? true : _c;
16
+ function PageNavigation() {
18
17
  var navigation = (0, useDefaultThemeSettings_1.useDefaultThemeSettings)().navigation;
19
18
  if (navigation === null || navigation === void 0 ? void 0 : navigation.hide) {
20
19
  return null;
21
20
  }
22
21
  return (react_1.default.createElement(PageNavigationWrapper, { "data-component-name": "PageNavigation/PageNavigation" },
23
- showPrevButton && react_1.default.createElement(PreviousPageLink_1.PreviousPageLink, null),
24
- showNextButton && react_1.default.createElement(NextPageLink_1.NextPageLink, null)));
22
+ react_1.default.createElement(PreviousPageLink_1.PreviousPageLink, null),
23
+ react_1.default.createElement(NextPageLink_1.NextPageLink, null)));
25
24
  }
26
25
  exports.PageNavigation = PageNavigation;
27
26
  var PageNavigationWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin: 25px 0;\n"], ["\n display: flex;\n justify-content: space-between;\n margin: 25px 0;\n"])));
@@ -17,10 +17,10 @@ function PreviousPageLink() {
17
17
  var _a, _b;
18
18
  var prevPage = ((0, hooks_1.useSidebarSiblingsData)() || {}).prevPage;
19
19
  var navigation = (0, useDefaultThemeSettings_1.useDefaultThemeSettings)().navigation;
20
- if (!prevPage || (navigation === null || navigation === void 0 ? void 0 : navigation.hide) || ((_a = navigation === null || navigation === void 0 ? void 0 : navigation.previousPageLink) === null || _a === void 0 ? void 0 : _a.hide)) {
20
+ if (!prevPage || (navigation === null || navigation === void 0 ? void 0 : navigation.hide) || ((_a = navigation === null || navigation === void 0 ? void 0 : navigation.prevPageLink) === null || _a === void 0 ? void 0 : _a.hide)) {
21
21
  return react_1.default.createElement("div", null, "\u00A0");
22
22
  }
23
- var label = ((_b = navigation === null || navigation === void 0 ? void 0 : navigation.previousPageLink) === null || _b === void 0 ? void 0 : _b.label) || "Back to ".concat(prevPage.label);
23
+ var label = ((_b = navigation === null || navigation === void 0 ? void 0 : navigation.prevPageLink) === null || _b === void 0 ? void 0 : _b.label) || "Back to ".concat(prevPage.label);
24
24
  return (react_1.default.createElement(StyledButton, { variant: "outlined", size: "large", to: prevPage.link, "data-component-name": "PageNavigation/PreviousPageLink" }, label));
25
25
  }
26
26
  exports.PreviousPageLink = PreviousPageLink;
@@ -6,7 +6,7 @@ function useThemeSettings(_) {
6
6
  toc: { header: 'header', hide: false },
7
7
  navigation: {
8
8
  nextPageLink: { label: 'next page theme settings label' },
9
- previousPageLink: { label: 'prev page theme settings label' },
9
+ prevPageLink: { label: 'prev page theme settings label' },
10
10
  },
11
11
  colorMode: {
12
12
  modes: ['light', 'dark'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.4.14",
3
+ "version": "0.4.15",
4
4
  "description": "Shared UI components",
5
5
  "author": "team@redocly.com",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -10,8 +10,6 @@ import { LastUpdated } from '@theme/LastUpdated/LastUpdated';
10
10
  type MarkdownLayoutProps = {
11
11
  tableOfContent: React.ReactNode;
12
12
  markdownWrapper: React.ReactNode;
13
- showPrevButton?: boolean;
14
- showNextButton?: boolean;
15
13
  editPage?: {
16
14
  to: string;
17
15
  text: string;
@@ -23,8 +21,6 @@ type MarkdownLayoutProps = {
23
21
  export function MarkdownLayout({
24
22
  tableOfContent,
25
23
  markdownWrapper,
26
- showPrevButton,
27
- showNextButton,
28
24
  editPage,
29
25
  lastModified,
30
26
  }: MarkdownLayoutProps): JSX.Element {
@@ -38,7 +34,7 @@ export function MarkdownLayout({
38
34
  )}
39
35
  </LayoutTop>
40
36
  {markdownWrapper}
41
- <PageNavigation showPrevButton={showPrevButton} showNextButton={showNextButton} />
37
+ <PageNavigation />
42
38
  </ContainerWrapper>
43
39
  {tableOfContent}
44
40
  </PageWrapper>
@@ -5,15 +5,7 @@ import { PreviousPageLink } from '@theme/PageNavigation/PreviousPageLink';
5
5
  import { NextPageLink } from '@theme/PageNavigation/NextPageLink';
6
6
  import { useDefaultThemeSettings } from '@theme/hooks/useDefaultThemeSettings';
7
7
 
8
- type PageNavigationProps = {
9
- showPrevButton?: boolean;
10
- showNextButton?: boolean;
11
- };
12
-
13
- export function PageNavigation({
14
- showPrevButton = true,
15
- showNextButton = true,
16
- }: PageNavigationProps): JSX.Element | null {
8
+ export function PageNavigation(): JSX.Element | null {
17
9
  const { navigation } = useDefaultThemeSettings();
18
10
 
19
11
  if (navigation?.hide) {
@@ -22,8 +14,8 @@ export function PageNavigation({
22
14
 
23
15
  return (
24
16
  <PageNavigationWrapper data-component-name="PageNavigation/PageNavigation">
25
- {showPrevButton && <PreviousPageLink />}
26
- {showNextButton && <NextPageLink />}
17
+ <PreviousPageLink />
18
+ <NextPageLink />
27
19
  </PageNavigationWrapper>
28
20
  );
29
21
  }
@@ -15,11 +15,11 @@ export function PreviousPageLink(): JSX.Element {
15
15
  const { prevPage }: PreviousPageType = useSidebarSiblingsData() || {};
16
16
  const { navigation } = useDefaultThemeSettings();
17
17
 
18
- if (!prevPage || navigation?.hide || navigation?.previousPageLink?.hide) {
18
+ if (!prevPage || navigation?.hide || navigation?.prevPageLink?.hide) {
19
19
  return <div>&nbsp;</div>;
20
20
  }
21
21
 
22
- const label = navigation?.previousPageLink?.label || `Back to ${prevPage.label}`;
22
+ const label = navigation?.prevPageLink?.label || `Back to ${prevPage.label}`;
23
23
 
24
24
  return (
25
25
  <StyledButton
@@ -14,7 +14,7 @@ export function useThemeSettings(_: string): RawTheme['settings'] {
14
14
  toc: { header: 'header', hide: false },
15
15
  navigation: {
16
16
  nextPageLink: { label: 'next page theme settings label' },
17
- previousPageLink: { label: 'prev page theme settings label' },
17
+ prevPageLink: { label: 'prev page theme settings label' },
18
18
  },
19
19
  colorMode: {
20
20
  modes: ['light', 'dark'],