@redocly/theme 0.1.9 → 0.1.12
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.
- package/Button/index.d.ts +1 -1
- package/Button/index.js +1 -1
- package/CodeBlock/index.d.ts +1 -1
- package/CodeBlock/index.js +1 -1
- package/CopyButton/index.d.ts +2 -2
- package/CopyButton/index.js +2 -2
- package/Footer/Footer.d.ts +2 -2
- package/Footer/Footer.js +1 -1
- package/Footer/FooterColumn.js +6 -6
- package/Footer/FooterColumns.d.ts +3 -3
- package/Footer/FooterCopyright.d.ts +3 -3
- package/Footer/FooterCopyright.js +1 -1
- package/Footer/index.d.ts +4 -4
- package/Footer/index.js +4 -4
- package/Headings/index.d.ts +1 -1
- package/Headings/index.js +1 -1
- package/JsonViewer/index.d.ts +2 -2
- package/JsonViewer/index.js +2 -2
- package/Layout/index.d.ts +2 -2
- package/Layout/index.js +2 -2
- package/Markdown/Admonition.js +4 -4
- package/Markdown/CodeSample/index.d.ts +3 -3
- package/Markdown/CodeSample/index.js +3 -3
- package/Markdown/Heading.js +1 -1
- package/Markdown/MarkdownLayout.d.ts +2 -2
- package/Markdown/StyledMarkdown.js +2 -2
- package/Markdown/Tabs/index.d.ts +2 -2
- package/Markdown/Tabs/index.js +2 -2
- package/Markdown/index.d.ts +9 -9
- package/Markdown/index.js +9 -9
- package/Navbar/Navbar.d.ts +0 -1
- package/Navbar/Navbar.js +1 -1
- package/Navbar/NavbarItem.js +1 -1
- package/Navbar/NavbarMenu.js +1 -1
- package/Navbar/index.d.ts +3 -0
- package/Navbar/index.js +19 -0
- package/NavbarLogo/NavbarLogo.d.ts +6 -0
- package/{Logo/Logo.js → NavbarLogo/NavbarLogo.js} +8 -5
- package/NavbarLogo/index.d.ts +1 -0
- package/{Logo → NavbarLogo}/index.js +1 -1
- package/OperationBadge/index.d.ts +1 -1
- package/OperationBadge/index.js +1 -1
- package/PageNavigation/index.d.ts +3 -0
- package/PageNavigation/index.js +19 -0
- package/Panel/index.d.ts +8 -8
- package/Panel/index.js +8 -8
- package/REAMDE.md +1 -0
- package/SamplesPanelControls/index.d.ts +1 -1
- package/SamplesPanelControls/index.js +1 -1
- package/Search/Autocomplete.js +1 -1
- package/Search/ClearIcon.js +2 -2
- package/Search/Input.js +1 -1
- package/Search/Parameters.js +2 -2
- package/Search/Popover.js +1 -1
- package/Search/SearchIcon.js +2 -2
- package/Search/SearchItem.js +2 -2
- package/Search/index.d.ts +9 -9
- package/Search/index.js +9 -9
- package/Search/utils.js +1 -1
- package/Sidebar/ApiCallItem.js +1 -1
- package/Sidebar/BackButton.js +1 -1
- package/Sidebar/DrilldownMenuItem.js +3 -3
- package/Sidebar/Menu.js +1 -1
- package/Sidebar/MenuItemLabel.js +2 -2
- package/Sidebar/MenuLink.js +1 -1
- package/Sidebar/MobileSidebarButton.js +1 -1
- package/Sidebar/Sidebar.js +1 -1
- package/Sidebar/index.d.ts +19 -19
- package/Sidebar/index.js +19 -19
- package/Sidebar/types/index.d.ts +5 -5
- package/Sidebar/types/index.js +5 -5
- package/SidebarLogo/index.d.ts +1 -1
- package/SidebarLogo/index.js +1 -1
- package/SourceCode/index.d.ts +1 -1
- package/SourceCode/index.js +1 -1
- package/TableOfContent/TableOfContent.js +7 -8
- package/TableOfContent/index.d.ts +1 -1
- package/TableOfContent/index.js +1 -1
- package/Tooltip/index.d.ts +1 -1
- package/Tooltip/index.js +1 -1
- package/globalStyle.d.ts +1 -0
- package/globalStyle.js +25 -3
- package/hooks/index.d.ts +7 -7
- package/hooks/index.js +7 -7
- package/hooks/useActiveSectionId.d.ts +2 -2
- package/hooks/useActiveSectionId.js +1 -0
- package/icons/ShelfIcon/index.d.ts +2 -2
- package/icons/ShelfIcon/index.js +1 -1
- package/icons/index.d.ts +1 -1
- package/icons/index.js +1 -1
- package/mocks/Link.js +4 -1
- package/mocks/hooks/usePageData.js +4 -1
- package/package.json +1 -1
- package/src/Button/index.ts +1 -1
- package/src/CodeBlock/index.ts +1 -1
- package/src/CopyButton/index.ts +2 -2
- package/src/Footer/Footer.tsx +5 -8
- package/src/Footer/FooterColumn.tsx +7 -7
- package/src/Footer/FooterColumns.tsx +3 -1
- package/src/Footer/FooterCopyright.tsx +5 -3
- package/src/Footer/index.ts +4 -4
- package/src/Headings/index.ts +1 -1
- package/src/JsonViewer/index.ts +2 -2
- package/src/Layout/index.ts +2 -2
- package/src/Markdown/Admonition.tsx +15 -15
- package/src/Markdown/CodeSample/index.ts +3 -3
- package/src/Markdown/Heading.tsx +4 -1
- package/src/Markdown/MarkdownLayout.tsx +2 -2
- package/src/Markdown/StyledMarkdown.tsx +27 -27
- package/src/Markdown/Tabs/index.ts +2 -2
- package/src/Markdown/index.ts +9 -9
- package/src/Navbar/Navbar.tsx +2 -3
- package/src/Navbar/NavbarItem.tsx +1 -1
- package/src/Navbar/NavbarMenu.tsx +1 -1
- package/src/Navbar/index.ts +3 -0
- package/src/NavbarLogo/NavbarLogo.tsx +24 -0
- package/src/NavbarLogo/index.ts +1 -0
- package/src/OperationBadge/index.ts +1 -1
- package/src/PageNavigation/index.ts +3 -0
- package/src/Panel/index.ts +8 -8
- package/src/SamplesPanelControls/index.ts +1 -1
- package/src/Search/Autocomplete.tsx +1 -1
- package/src/Search/ClearIcon.tsx +12 -13
- package/src/Search/Input.tsx +7 -7
- package/src/Search/Parameters.tsx +2 -2
- package/src/Search/Popover.tsx +2 -2
- package/src/Search/SearchIcon.tsx +12 -13
- package/src/Search/SearchItem.tsx +2 -2
- package/src/Search/index.ts +9 -9
- package/src/Search/utils.tsx +1 -1
- package/src/Sidebar/ApiCallItem.tsx +1 -2
- package/src/Sidebar/BackButton.tsx +2 -2
- package/src/Sidebar/DrilldownMenuItem.tsx +4 -4
- package/src/Sidebar/Menu.tsx +1 -1
- package/src/Sidebar/MenuItemLabel.tsx +4 -4
- package/src/Sidebar/MenuLink.tsx +1 -1
- package/src/Sidebar/MobileSidebarButton.tsx +2 -2
- package/src/Sidebar/Sidebar.tsx +1 -1
- package/src/Sidebar/index.ts +19 -19
- package/src/Sidebar/types/index.ts +5 -5
- package/src/SidebarLogo/index.ts +1 -1
- package/src/SourceCode/index.ts +1 -1
- package/src/TableOfContent/TableOfContent.tsx +12 -10
- package/src/TableOfContent/index.ts +1 -1
- package/src/Tooltip/index.ts +1 -1
- package/src/globalStyle.ts +793 -441
- package/src/hooks/index.ts +7 -7
- package/src/hooks/useActiveSectionId.ts +3 -3
- package/src/icons/ShelfIcon/index.ts +2 -2
- package/src/icons/index.ts +1 -1
- package/src/mocks/Link.tsx +5 -2
- package/src/mocks/hooks/usePageData.ts +4 -1
- package/src/types/portal/index.d.ts +0 -1
- package/src/types/portal/src/client/app/Sidebar/types.d.ts +32 -41
- package/src/types/portal/src/client/app/media-css.d.ts +4 -4
- package/src/types/portal/src/client/styling/default.d.ts +585 -391
- package/src/types/portal/src/client/styling/index.d.ts +2 -6
- package/src/types/portal/src/server/constants.d.ts +5 -9
- package/src/types/portal/src/server/plugins/markdown/types.d.ts +14 -19
- package/src/types/portal/src/server/plugins/portal-config/types.d.ts +12 -12
- package/src/types/portal/src/server/plugins/types.d.ts +55 -0
- package/src/types/portal/src/server/store.d.ts +49 -97
- package/src/types/portal/src/server/utils/async.d.ts +1 -5
- package/src/types/portal/src/server/utils/content-provider.d.ts +51 -0
- package/src/types/portal/src/server/utils/index.d.ts +1 -1
- package/src/types/portal/src/server/utils/paths.d.ts +10 -13
- package/src/types/portal/src/server/utils/reporter/formatter.d.ts +8 -8
- package/src/types/portal/src/server/utils/reporter/reporter.d.ts +15 -15
- package/src/types/portal/src/server/version-store.d.ts +35 -0
- package/src/types/portal/src/shared/constants.d.ts +6 -6
- package/src/types/portal/src/shared/types.d.ts +97 -58
- package/src/types/portal/src/shared/urls.d.ts +2 -1
- package/src/ui/AlertIcon.tsx +8 -7
- package/src/ui/Background.tsx +3 -3
- package/src/ui/Dropdown.tsx +4 -4
- package/src/ui/Jumbotron.tsx +3 -3
- package/src/ui/Tiles/TileHeader.ts +1 -1
- package/src/ui/Tiles/TileText.tsx +2 -2
- package/src/ui/Tiles/index.ts +4 -4
- package/src/ui/Typography.tsx +27 -27
- package/src/ui/UniversalLink.tsx +3 -8
- package/src/utils/isUrl.ts +4 -4
- package/ui/AlertIcon.d.ts +3 -2
- package/ui/AlertIcon.js +2 -2
- package/ui/Background.js +1 -1
- package/ui/Dropdown.js +3 -3
- package/ui/Jumbotron.js +3 -3
- package/ui/Tiles/TileHeader.js +1 -1
- package/ui/Tiles/TileText.js +1 -1
- package/ui/Tiles/index.d.ts +4 -4
- package/ui/Tiles/index.js +4 -4
- package/ui/Typography.js +23 -23
- package/ui/UniversalLink.js +1 -5
- package/utils/isUrl.d.ts +2 -2
- package/utils/isUrl.js +4 -4
- package/Logo/Logo.d.ts +0 -5
- package/Logo/index.d.ts +0 -1
- package/src/Button/Button.stories.tsx +0 -74
- package/src/Button/__tests__/Button.test.tsx +0 -42
- package/src/Button/__tests__/__snapshots__/Button.test.tsx.snap +0 -274
- package/src/CodeBlock/__tests__/CodeBlock.test.tsx +0 -12
- package/src/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap +0 -140
- package/src/CopyButton/CopyButton.stories.tsx +0 -18
- package/src/CopyButton/__tests__/CopyButton.test.tsx +0 -35
- package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +0 -17
- package/src/CopyButton/__tests__/__snapshots__/CopyButton.test.tsx.snap +0 -55
- package/src/CopyButton/__tests__/__snapshots__/CopyButtonWrapper.test.tsx.snap +0 -46
- package/src/Headings/Headings.stories.tsx +0 -36
- package/src/Headings/__tests__/Headings.test.tsx +0 -24
- package/src/Headings/__tests__/__snapshots__/Headings.test.tsx.snap +0 -57
- package/src/Introduction.stories.mdx +0 -7
- package/src/JsonViewer/JsonViewer.stories.tsx +0 -57
- package/src/JsonViewer/__tests__/JsonViewer.test.tsx +0 -83
- package/src/JsonViewer/__tests__/__snapshots__/JsonViewer.test.tsx.snap +0 -2728
- package/src/Logo/Logo.tsx +0 -17
- package/src/Logo/index.ts +0 -1
- package/src/Navbar/Navbar.stories.tsx +0 -28
- package/src/OperationBadge/OperationBadge.stories.tsx +0 -35
- package/src/OperationBadge/__tests__/OperationBadge.test.tsx +0 -59
- package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +0 -651
- package/src/Panel/CodePanel.stories.tsx +0 -26
- package/src/Panel/ContentPanel.stories.tsx +0 -26
- package/src/Panel/Panel.stories.tsx +0 -56
- package/src/Panel/__tests__/CodePanel.test.tsx +0 -26
- package/src/Panel/__tests__/ContentPanel.test.tsx +0 -26
- package/src/Panel/__tests__/Panel.test.tsx +0 -53
- package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +0 -258
- package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +0 -278
- package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +0 -398
- package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +0 -18
- package/src/SamplesPanelControls/__tests__/SamplesPanelControls.test.tsx +0 -36
- package/src/SamplesPanelControls/__tests__/__snapshots__/SamplesPanelControls.test.tsx.snap +0 -228
- package/src/SidebarLogo/SidebarLogo.stories.tsx +0 -21
- package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +0 -32
- package/src/SidebarLogo/__tests__/__snapshots__/SidebarLogo.test.tsx.snap +0 -62
- package/src/SourceCode/SourceCode.stories.tsx +0 -29
- package/src/SourceCode/__tests__/SourceCode.test.tsx +0 -48
- package/src/SourceCode/__tests__/__snapshots__/SourceCode.test.tsx.snap +0 -786
- package/src/TableOfContent/TableOfContent.stories.tsx +0 -39
- package/src/Tooltip/Tooltip.stories.tsx +0 -27
- package/src/Tooltip/__tests__/Tooltip.test.tsx +0 -41
- package/src/Tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +0 -83
- package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +0 -36
- package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +0 -54
- package/src/icons/ShelfIcon/__tests__/__snapshots__/ShelfIcon.test.tsx.snap +0 -235
- package/src/types/portal/src/server/plugins/nav-utils.d.ts +0 -19
- package/src/types/portal/src/server/plugins/sidebars/index.d.ts +0 -16
- package/src/types/portal/src/server/plugins/versions/index.d.ts +0 -15
- package/src/types/portal/src/server/plugins/versions/types.d.ts +0 -23
- package/src/types/portal/src/server/plugins/versions/utils.d.ts +0 -10
- package/src/types/portal/src/server/utils/watcher.d.ts +0 -16
- package/src/utils/__tests__/ClipboardService.test.ts +0 -24
- package/src/utils/__tests__/__snapshots__/highlight.test.ts.snap +0 -5
- package/src/utils/__tests__/__snapshots__/jsonToHtml.test.ts.snap +0 -5
- package/src/utils/__tests__/css-variables.test.ts +0 -20
- package/src/utils/__tests__/highlight.test.ts +0 -51
- package/src/utils/__tests__/jsonToHtml.test.ts +0 -40
- package/src/utils/__tests__/media-css.test.ts +0 -20
- package/src/utils/__tests__/theme-helpers.test.ts +0 -25
package/src/hooks/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
1
|
+
export * from '@theme/hooks/useControl';
|
|
2
|
+
export * from '@theme/hooks/useMount';
|
|
3
|
+
export * from '@theme/hooks/useUnmount';
|
|
4
|
+
export * from '@theme/hooks/useActiveHeading';
|
|
5
|
+
export * from '@theme/hooks/useActiveSectionId';
|
|
6
|
+
export * from '@theme/hooks/useFullHeight';
|
|
7
|
+
export * from '@theme/hooks/useNavbarHeight';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { Location } from 'history';
|
|
1
2
|
import { useEffect, useState, useMemo } from 'react';
|
|
2
3
|
import throttle from 'lodash.throttle';
|
|
3
4
|
|
|
4
5
|
import { useNavbarHeight } from '@theme/hooks/useNavbarHeight';
|
|
5
|
-
import type { MenuProps } from '@theme/types/portal';
|
|
6
6
|
|
|
7
7
|
export type UseActiveSectionIdReturnType = string;
|
|
8
8
|
|
|
9
9
|
export function useActiveSectionId(
|
|
10
|
-
location:
|
|
11
|
-
hasOverviewPage
|
|
10
|
+
location: Location,
|
|
11
|
+
hasOverviewPage = false,
|
|
12
12
|
): UseActiveSectionIdReturnType {
|
|
13
13
|
const [itemId, setItemId] = useState<string>('');
|
|
14
14
|
const navbarHeight = useNavbarHeight(location);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ShelfIcon } from '
|
|
2
|
-
export type { ShelfIconProps } from '
|
|
1
|
+
export { ShelfIcon } from '@theme/icons/ShelfIcon/ShelfIcon';
|
|
2
|
+
export type { ShelfIconProps } from '@theme/icons/ShelfIcon/ShelfIcon';
|
package/src/icons/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '@theme/icons/ShelfIcon';
|
package/src/mocks/Link.tsx
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { omit } from 'lodash';
|
|
2
3
|
|
|
3
4
|
// TODO: use real typings here
|
|
4
5
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
5
6
|
export function Link(props: any): JSX.Element {
|
|
6
|
-
|
|
7
|
+
// We omit "active" property to avoid "Warning: Received `false` for a non-boolean attribute `active`."
|
|
8
|
+
const filteredProps = omit(props, ['active', 'httpVerb', 'hasActiveSubItem']);
|
|
9
|
+
return <a href={filteredProps.to} {...filteredProps} />;
|
|
7
10
|
}
|
|
@@ -4,5 +4,8 @@ export function usePageData(): {
|
|
|
4
4
|
prevPage: ResolvedNavLinkItem | null;
|
|
5
5
|
nextPage: ResolvedNavLinkItem | null;
|
|
6
6
|
} {
|
|
7
|
-
return {
|
|
7
|
+
return {
|
|
8
|
+
prevPage: { label: 'Intro', type: 'link', link: '#prev' },
|
|
9
|
+
nextPage: { label: 'FAQ', type: 'link', link: '#next' },
|
|
10
|
+
};
|
|
8
11
|
}
|
|
@@ -2,5 +2,4 @@ export * from './src/client/styling';
|
|
|
2
2
|
export * from './src/client/app/Sidebar/types';
|
|
3
3
|
export * from './src/server/plugins/portal-config/types';
|
|
4
4
|
export * from './src/shared/types';
|
|
5
|
-
export * from './src/server/plugins/versions/types';
|
|
6
5
|
export type { MdHeading } from './src/server/plugins/markdown/types';
|
|
@@ -1,50 +1,41 @@
|
|
|
1
|
-
import { Location } from 'history';
|
|
2
1
|
import { MenuStyle } from '../../../shared/types';
|
|
3
|
-
import type { Version } from '../../../server/plugins/versions/types';
|
|
4
2
|
export interface SidebarNavItem {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
default?: boolean;
|
|
3
|
+
label?: string;
|
|
4
|
+
sublabel?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
link?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
httpVerb?: string;
|
|
9
|
+
expanded?: string;
|
|
10
|
+
selectFirstItemOnExpand?: boolean;
|
|
11
|
+
pageId?: string;
|
|
12
|
+
redocPrevLink?: string;
|
|
13
|
+
redocPrevLabel?: string;
|
|
14
|
+
redocNextLink?: string;
|
|
15
|
+
redocNextLabel?: string;
|
|
16
|
+
redocFakePage?: boolean;
|
|
17
|
+
redocInfoPageId?: string;
|
|
18
|
+
target?: string;
|
|
19
|
+
external?: boolean;
|
|
20
|
+
items?: SidebarNavItem[];
|
|
21
|
+
permission?: string;
|
|
22
|
+
menuStyle?: MenuStyle;
|
|
23
|
+
separatorLine?: boolean;
|
|
24
|
+
version?: string;
|
|
28
25
|
}
|
|
29
26
|
export interface ItemState extends SidebarNavItem {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
export interface MenuProps {
|
|
36
|
-
items: SidebarNavItem[];
|
|
37
|
-
location: Location;
|
|
38
|
-
pageId: string;
|
|
39
|
-
versions?: Version[];
|
|
27
|
+
items: ItemState[];
|
|
28
|
+
active: boolean;
|
|
29
|
+
hasActiveSubItem: boolean;
|
|
30
|
+
menuStyle?: MenuStyle | null;
|
|
40
31
|
}
|
|
41
32
|
export declare enum MenuType {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
Separator = "separator",
|
|
34
|
+
DrillDown = "drilldown",
|
|
35
|
+
Group = "group",
|
|
36
|
+
Operation = "operation"
|
|
46
37
|
}
|
|
47
38
|
export interface MenuItemProps {
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
item: ItemState;
|
|
40
|
+
activeItem?: ItemState;
|
|
50
41
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const breakpoints: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
small: string;
|
|
3
|
+
medium: string;
|
|
4
|
+
large: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const mediaQueries: import(
|
|
6
|
+
export declare const mediaQueries: import("@theme/utils/media-css").MediaQueries;
|
|
7
7
|
export type { MediaQueries } from '@theme/utils/media-css';
|