@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
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import { ThemeProvider } from 'styled-components';
|
|
4
|
-
|
|
5
|
-
import { TableOfContent } from '@theme/TableOfContent';
|
|
6
|
-
import { generateMediaQueries } from '@theme/utils/media-css';
|
|
7
|
-
|
|
8
|
-
const breakpoints = { small: '1rem', medium: '1rem', large: '1rem' };
|
|
9
|
-
|
|
10
|
-
const theme = {
|
|
11
|
-
mediaQueries: generateMediaQueries(breakpoints),
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
title: 'Portal/TableOfContent',
|
|
16
|
-
component: TableOfContent,
|
|
17
|
-
decorators: [
|
|
18
|
-
(Story) => (
|
|
19
|
-
<ThemeProvider theme={theme}>
|
|
20
|
-
<Story />
|
|
21
|
-
</ThemeProvider>
|
|
22
|
-
),
|
|
23
|
-
],
|
|
24
|
-
} as ComponentMeta<typeof TableOfContent>;
|
|
25
|
-
|
|
26
|
-
const Template: ComponentStory<typeof TableOfContent> = (args) => (
|
|
27
|
-
<TableOfContent {...args}>Click</TableOfContent>
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
export const Default = Template.bind({});
|
|
31
|
-
Default.args = {
|
|
32
|
-
headings: [
|
|
33
|
-
{ id: '1', value: 'test 1', depth: 1 },
|
|
34
|
-
{ id: '2', value: 'test 2', depth: 1 },
|
|
35
|
-
{ id: '3', value: 'test 3', depth: 2 },
|
|
36
|
-
{ id: '4', value: 'test 4', depth: 2 },
|
|
37
|
-
{ id: '5', value: 'test 5', depth: 1 },
|
|
38
|
-
],
|
|
39
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { Tooltip } from '@theme/Tooltip';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Tooltip',
|
|
8
|
-
component: Tooltip,
|
|
9
|
-
} as ComponentMeta<typeof Tooltip>;
|
|
10
|
-
|
|
11
|
-
const Template: ComponentStory<typeof Tooltip> = (args) => {
|
|
12
|
-
return (
|
|
13
|
-
<>
|
|
14
|
-
<div style={{ padding: '50px' }}>
|
|
15
|
-
<Tooltip {...args}>
|
|
16
|
-
<button>Sample</button>
|
|
17
|
-
</Tooltip>
|
|
18
|
-
</div>
|
|
19
|
-
</>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Default = Template.bind({});
|
|
24
|
-
Default.args = {
|
|
25
|
-
open: true,
|
|
26
|
-
tip: 'Try me!',
|
|
27
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import { Tooltip } from '@theme/Tooltip';
|
|
5
|
-
|
|
6
|
-
describe('Tooltip', () => {
|
|
7
|
-
it('renders closed', () => {
|
|
8
|
-
const { container } = render(
|
|
9
|
-
<Tooltip tip="Try me!">
|
|
10
|
-
<button>test</button>
|
|
11
|
-
</Tooltip>,
|
|
12
|
-
);
|
|
13
|
-
container;
|
|
14
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('renders opened', () => {
|
|
18
|
-
const { container } = render(
|
|
19
|
-
<Tooltip tip="Try me!" open={true} placement="bottom" dataTestId="tooltip-opened">
|
|
20
|
-
<button>test</button>
|
|
21
|
-
</Tooltip>,
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('should open and close on mouse enter/leave event', () => {
|
|
28
|
-
const { getByText } = render(
|
|
29
|
-
<Tooltip tip="Try me!" dataTestId="tooltip">
|
|
30
|
-
<button>test</button>
|
|
31
|
-
</Tooltip>,
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
fireEvent.mouseEnter(getByText('test'));
|
|
35
|
-
expect(getByText('Try me!')).toBeTruthy();
|
|
36
|
-
|
|
37
|
-
fireEvent.mouseLeave(getByText('test'));
|
|
38
|
-
// expect(getByText('Try me!')).toBeFalsy();
|
|
39
|
-
expect(() => getByText('Try me!')).toThrow();
|
|
40
|
-
});
|
|
41
|
-
});
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Tooltip renders closed 1`] = `
|
|
4
|
-
.c0 {
|
|
5
|
-
position: relative;
|
|
6
|
-
display: inline-block;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
<div
|
|
10
|
-
class="c0 tooltip-default"
|
|
11
|
-
>
|
|
12
|
-
<button>
|
|
13
|
-
test
|
|
14
|
-
</button>
|
|
15
|
-
</div>
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
exports[`Tooltip renders opened 1`] = `
|
|
19
|
-
.c0 {
|
|
20
|
-
position: relative;
|
|
21
|
-
display: inline-block;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.c1 {
|
|
25
|
-
display: inline-block;
|
|
26
|
-
position: absolute;
|
|
27
|
-
text-align: center;
|
|
28
|
-
padding: 10px 20px;
|
|
29
|
-
max-width: 250px;
|
|
30
|
-
white-space: normal;
|
|
31
|
-
overflow-wrap: break-word;
|
|
32
|
-
border-radius: var(--global-border-radius);
|
|
33
|
-
pointer-events: none;
|
|
34
|
-
-webkit-transition: opacity 0.3s ease-out;
|
|
35
|
-
transition: opacity 0.3s ease-out;
|
|
36
|
-
font-size: 13px;
|
|
37
|
-
background: var(--tooltip-background-color);
|
|
38
|
-
color: var(--tooltip-color);
|
|
39
|
-
box-shadow: rgb(0 0 0 / 25%) 0 2px 4px;
|
|
40
|
-
width: 120px;
|
|
41
|
-
bottom: 0;
|
|
42
|
-
left: 50%;
|
|
43
|
-
-webkit-transform: translate(-50%,99%);
|
|
44
|
-
-ms-transform: translate(-50%,99%);
|
|
45
|
-
transform: translate(-50%,99%);
|
|
46
|
-
margin-bottom: -10px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.c1::after {
|
|
50
|
-
position: absolute;
|
|
51
|
-
content: ' ';
|
|
52
|
-
display: inline-block;
|
|
53
|
-
width: 0;
|
|
54
|
-
height: 0;
|
|
55
|
-
border-color: var(--tooltip-background-color);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.c1::after {
|
|
59
|
-
border-left: 5px solid transparent;
|
|
60
|
-
border-right: 5px solid transparent;
|
|
61
|
-
border-bottom-width: 6px;
|
|
62
|
-
border-bottom-style: solid;
|
|
63
|
-
top: 0;
|
|
64
|
-
left: 50%;
|
|
65
|
-
-webkit-transform: translate(-50%,-99%);
|
|
66
|
-
-ms-transform: translate(-50%,-99%);
|
|
67
|
-
transform: translate(-50%,-99%);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
<div
|
|
71
|
-
class="c0 tooltip-default"
|
|
72
|
-
>
|
|
73
|
-
<button>
|
|
74
|
-
test
|
|
75
|
-
</button>
|
|
76
|
-
<span
|
|
77
|
-
class="c1"
|
|
78
|
-
data-cy="tooltip-opened"
|
|
79
|
-
>
|
|
80
|
-
Try me!
|
|
81
|
-
</span>
|
|
82
|
-
</div>
|
|
83
|
-
`;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Story, ComponentMeta } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { ShelfIcon, ShelfIconProps } from '@theme/icons/ShelfIcon';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Icons/ShelfIcon',
|
|
8
|
-
component: ShelfIcon,
|
|
9
|
-
argTypes: {},
|
|
10
|
-
} as ComponentMeta<typeof ShelfIcon>;
|
|
11
|
-
|
|
12
|
-
const Template: Story<ShelfIconProps> = (args) => <ShelfIcon {...args} />;
|
|
13
|
-
|
|
14
|
-
export const Right = Template.bind({});
|
|
15
|
-
Right.args = {
|
|
16
|
-
direction: 'right',
|
|
17
|
-
size: '20px',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const Down = Template.bind({});
|
|
21
|
-
Down.args = {
|
|
22
|
-
direction: 'down',
|
|
23
|
-
size: '20px',
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const Left = Template.bind({});
|
|
27
|
-
Left.args = {
|
|
28
|
-
direction: 'left',
|
|
29
|
-
size: '20px',
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Up = Template.bind({});
|
|
33
|
-
Up.args = {
|
|
34
|
-
direction: 'up',
|
|
35
|
-
size: '20px',
|
|
36
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import { ShelfIcon } from '@theme/icons/ShelfIcon';
|
|
5
|
-
|
|
6
|
-
describe('ShelfIcon', () => {
|
|
7
|
-
it('renders right', () => {
|
|
8
|
-
const { container } = render(<ShelfIcon direction={'right'} />);
|
|
9
|
-
|
|
10
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('renders left', () => {
|
|
14
|
-
const { container } = render(<ShelfIcon direction={'left'} />);
|
|
15
|
-
|
|
16
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('renders up', () => {
|
|
20
|
-
const { container } = render(<ShelfIcon direction={'up'} />);
|
|
21
|
-
|
|
22
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('renders down', () => {
|
|
26
|
-
const { container } = render(<ShelfIcon direction={'down'} />);
|
|
27
|
-
|
|
28
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('renders with float left', () => {
|
|
32
|
-
const { container } = render(<ShelfIcon direction={'right'} float={'left'} />);
|
|
33
|
-
|
|
34
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('renders with float right', () => {
|
|
38
|
-
const { container } = render(<ShelfIcon direction={'right'} float={'right'} />);
|
|
39
|
-
|
|
40
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('renders with big size', () => {
|
|
44
|
-
const { container } = render(<ShelfIcon direction={'right'} size={'30px'} />);
|
|
45
|
-
|
|
46
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders with color', () => {
|
|
50
|
-
const { container } = render(<ShelfIcon direction={'right'} color={'orange'} />);
|
|
51
|
-
|
|
52
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`ShelfIcon renders down 1`] = `
|
|
4
|
-
.c0 {
|
|
5
|
-
height: 9px;
|
|
6
|
-
width: 9px;
|
|
7
|
-
-webkit-transform: rotateZ(90deg);
|
|
8
|
-
-ms-transform: rotateZ(90deg);
|
|
9
|
-
transform: rotateZ(90deg);
|
|
10
|
-
fill: inherit;
|
|
11
|
-
vertical-align: middle;
|
|
12
|
-
-webkit-transition: -webkit-transform 0.2s ease-out;
|
|
13
|
-
-webkit-transition: transform 0.2s ease-out;
|
|
14
|
-
transition: transform 0.2s ease-out;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
<svg
|
|
18
|
-
aria-hidden="true"
|
|
19
|
-
class="c0"
|
|
20
|
-
viewBox="0 0 4.25 7"
|
|
21
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
-
>
|
|
23
|
-
<path
|
|
24
|
-
d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
|
|
25
|
-
/>
|
|
26
|
-
<path
|
|
27
|
-
d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
|
|
28
|
-
/>
|
|
29
|
-
</svg>
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
exports[`ShelfIcon renders left 1`] = `
|
|
33
|
-
.c0 {
|
|
34
|
-
height: 9px;
|
|
35
|
-
width: 9px;
|
|
36
|
-
-webkit-transform: rotateZ(180deg);
|
|
37
|
-
-ms-transform: rotateZ(180deg);
|
|
38
|
-
transform: rotateZ(180deg);
|
|
39
|
-
fill: inherit;
|
|
40
|
-
vertical-align: middle;
|
|
41
|
-
-webkit-transition: -webkit-transform 0.2s ease-out;
|
|
42
|
-
-webkit-transition: transform 0.2s ease-out;
|
|
43
|
-
transition: transform 0.2s ease-out;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
<svg
|
|
47
|
-
aria-hidden="true"
|
|
48
|
-
class="c0"
|
|
49
|
-
viewBox="0 0 4.25 7"
|
|
50
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
-
>
|
|
52
|
-
<path
|
|
53
|
-
d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
|
|
54
|
-
/>
|
|
55
|
-
<path
|
|
56
|
-
d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
|
|
57
|
-
/>
|
|
58
|
-
</svg>
|
|
59
|
-
`;
|
|
60
|
-
|
|
61
|
-
exports[`ShelfIcon renders right 1`] = `
|
|
62
|
-
.c0 {
|
|
63
|
-
height: 9px;
|
|
64
|
-
width: 9px;
|
|
65
|
-
-webkit-transform: rotateZ(0deg);
|
|
66
|
-
-ms-transform: rotateZ(0deg);
|
|
67
|
-
transform: rotateZ(0deg);
|
|
68
|
-
fill: inherit;
|
|
69
|
-
vertical-align: middle;
|
|
70
|
-
-webkit-transition: -webkit-transform 0.2s ease-out;
|
|
71
|
-
-webkit-transition: transform 0.2s ease-out;
|
|
72
|
-
transition: transform 0.2s ease-out;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
<svg
|
|
76
|
-
aria-hidden="true"
|
|
77
|
-
class="c0"
|
|
78
|
-
viewBox="0 0 4.25 7"
|
|
79
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
80
|
-
>
|
|
81
|
-
<path
|
|
82
|
-
d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
|
|
83
|
-
/>
|
|
84
|
-
<path
|
|
85
|
-
d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
|
|
86
|
-
/>
|
|
87
|
-
</svg>
|
|
88
|
-
`;
|
|
89
|
-
|
|
90
|
-
exports[`ShelfIcon renders up 1`] = `
|
|
91
|
-
.c0 {
|
|
92
|
-
height: 9px;
|
|
93
|
-
width: 9px;
|
|
94
|
-
-webkit-transform: rotateZ(270deg);
|
|
95
|
-
-ms-transform: rotateZ(270deg);
|
|
96
|
-
transform: rotateZ(270deg);
|
|
97
|
-
fill: inherit;
|
|
98
|
-
vertical-align: middle;
|
|
99
|
-
-webkit-transition: -webkit-transform 0.2s ease-out;
|
|
100
|
-
-webkit-transition: transform 0.2s ease-out;
|
|
101
|
-
transition: transform 0.2s ease-out;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
<svg
|
|
105
|
-
aria-hidden="true"
|
|
106
|
-
class="c0"
|
|
107
|
-
viewBox="0 0 4.25 7"
|
|
108
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
109
|
-
>
|
|
110
|
-
<path
|
|
111
|
-
d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
|
|
112
|
-
/>
|
|
113
|
-
<path
|
|
114
|
-
d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
|
|
115
|
-
/>
|
|
116
|
-
</svg>
|
|
117
|
-
`;
|
|
118
|
-
|
|
119
|
-
exports[`ShelfIcon renders with big size 1`] = `
|
|
120
|
-
.c0 {
|
|
121
|
-
height: 30px;
|
|
122
|
-
width: 30px;
|
|
123
|
-
-webkit-transform: rotateZ(0deg);
|
|
124
|
-
-ms-transform: rotateZ(0deg);
|
|
125
|
-
transform: rotateZ(0deg);
|
|
126
|
-
fill: inherit;
|
|
127
|
-
vertical-align: middle;
|
|
128
|
-
-webkit-transition: -webkit-transform 0.2s ease-out;
|
|
129
|
-
-webkit-transition: transform 0.2s ease-out;
|
|
130
|
-
transition: transform 0.2s ease-out;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
<svg
|
|
134
|
-
aria-hidden="true"
|
|
135
|
-
class="c0"
|
|
136
|
-
viewBox="0 0 4.25 7"
|
|
137
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
138
|
-
>
|
|
139
|
-
<path
|
|
140
|
-
d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
|
|
141
|
-
/>
|
|
142
|
-
<path
|
|
143
|
-
d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
|
|
144
|
-
/>
|
|
145
|
-
</svg>
|
|
146
|
-
`;
|
|
147
|
-
|
|
148
|
-
exports[`ShelfIcon renders with color 1`] = `
|
|
149
|
-
.c0 {
|
|
150
|
-
height: 9px;
|
|
151
|
-
width: 9px;
|
|
152
|
-
-webkit-transform: rotateZ(0deg);
|
|
153
|
-
-ms-transform: rotateZ(0deg);
|
|
154
|
-
transform: rotateZ(0deg);
|
|
155
|
-
fill: orange;
|
|
156
|
-
vertical-align: middle;
|
|
157
|
-
-webkit-transition: -webkit-transform 0.2s ease-out;
|
|
158
|
-
-webkit-transition: transform 0.2s ease-out;
|
|
159
|
-
transition: transform 0.2s ease-out;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
<svg
|
|
163
|
-
aria-hidden="true"
|
|
164
|
-
class="c0"
|
|
165
|
-
viewBox="0 0 4.25 7"
|
|
166
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
167
|
-
>
|
|
168
|
-
<path
|
|
169
|
-
d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
|
|
170
|
-
/>
|
|
171
|
-
<path
|
|
172
|
-
d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
|
|
173
|
-
/>
|
|
174
|
-
</svg>
|
|
175
|
-
`;
|
|
176
|
-
|
|
177
|
-
exports[`ShelfIcon renders with float left 1`] = `
|
|
178
|
-
.c0 {
|
|
179
|
-
height: 9px;
|
|
180
|
-
width: 9px;
|
|
181
|
-
float: left;
|
|
182
|
-
-webkit-transform: rotateZ(0deg);
|
|
183
|
-
-ms-transform: rotateZ(0deg);
|
|
184
|
-
transform: rotateZ(0deg);
|
|
185
|
-
fill: inherit;
|
|
186
|
-
vertical-align: middle;
|
|
187
|
-
-webkit-transition: -webkit-transform 0.2s ease-out;
|
|
188
|
-
-webkit-transition: transform 0.2s ease-out;
|
|
189
|
-
transition: transform 0.2s ease-out;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
<svg
|
|
193
|
-
aria-hidden="true"
|
|
194
|
-
class="c0"
|
|
195
|
-
viewBox="0 0 4.25 7"
|
|
196
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
197
|
-
>
|
|
198
|
-
<path
|
|
199
|
-
d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
|
|
200
|
-
/>
|
|
201
|
-
<path
|
|
202
|
-
d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
|
|
203
|
-
/>
|
|
204
|
-
</svg>
|
|
205
|
-
`;
|
|
206
|
-
|
|
207
|
-
exports[`ShelfIcon renders with float right 1`] = `
|
|
208
|
-
.c0 {
|
|
209
|
-
height: 9px;
|
|
210
|
-
width: 9px;
|
|
211
|
-
float: right;
|
|
212
|
-
-webkit-transform: rotateZ(0deg);
|
|
213
|
-
-ms-transform: rotateZ(0deg);
|
|
214
|
-
transform: rotateZ(0deg);
|
|
215
|
-
fill: inherit;
|
|
216
|
-
vertical-align: middle;
|
|
217
|
-
-webkit-transition: -webkit-transform 0.2s ease-out;
|
|
218
|
-
-webkit-transition: transform 0.2s ease-out;
|
|
219
|
-
transition: transform 0.2s ease-out;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
<svg
|
|
223
|
-
aria-hidden="true"
|
|
224
|
-
class="c0"
|
|
225
|
-
viewBox="0 0 4.25 7"
|
|
226
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
227
|
-
>
|
|
228
|
-
<path
|
|
229
|
-
d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
|
|
230
|
-
/>
|
|
231
|
-
<path
|
|
232
|
-
d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
|
|
233
|
-
/>
|
|
234
|
-
</svg>
|
|
235
|
-
`;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Page, Store } from '../store.js';
|
|
2
|
-
import type { ResolvedNavItem, NavItem, RawNavItem } from '../../shared/types.js';
|
|
3
|
-
export declare function normalizeItems(items: RawNavItem[]): NavItem[];
|
|
4
|
-
export declare function resolveVersionItems(
|
|
5
|
-
items: RawNavItem[],
|
|
6
|
-
store: Store,
|
|
7
|
-
versions?: any,
|
|
8
|
-
): RawNavItem[];
|
|
9
|
-
export declare function resolvePage(pagePath: string, fromFile: string, store: Store): Page;
|
|
10
|
-
export declare function resolveItems(
|
|
11
|
-
items: NavItem[],
|
|
12
|
-
fromFile: string,
|
|
13
|
-
store: Store,
|
|
14
|
-
): Promise<ResolvedNavItem[]>;
|
|
15
|
-
export declare function resolveItem(
|
|
16
|
-
item: NavItem,
|
|
17
|
-
fromFile: string,
|
|
18
|
-
store: Store,
|
|
19
|
-
): Promise<ResolvedNavItem | ResolvedNavItem[]>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { NavItem, RawNavItem, ResolvedNavItem } from '../../../shared/types.js';
|
|
2
|
-
import { Page, Store } from '../../store.js';
|
|
3
|
-
import { Watcher } from '../../utils/index.js';
|
|
4
|
-
export declare function sidebarsPlugin(watcher: Watcher, store: Store): void;
|
|
5
|
-
export declare class Sidebar {
|
|
6
|
-
absolutePath: string;
|
|
7
|
-
id: string;
|
|
8
|
-
store: Store;
|
|
9
|
-
hash: string;
|
|
10
|
-
dirname: string;
|
|
11
|
-
items: NavItem[];
|
|
12
|
-
constructor(absolutePath: string, items: RawNavItem[], id: string, store: Store);
|
|
13
|
-
resolve(): Promise<ResolvedNavItem[]>;
|
|
14
|
-
getDependentPages(): Set<Page>;
|
|
15
|
-
private collectDependentPages;
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { AllFilesType } from './types.js';
|
|
2
|
-
import { Watcher } from '../../utils/index.js';
|
|
3
|
-
import type { Store } from '../../store.js';
|
|
4
|
-
export declare function allFilesPaths(): AllFilesType;
|
|
5
|
-
export declare const existingVersionPages: Set<string>;
|
|
6
|
-
export declare function initVersionPlugin(
|
|
7
|
-
contentDir: string,
|
|
8
|
-
store: Store,
|
|
9
|
-
allFiles: AllFilesType,
|
|
10
|
-
): void;
|
|
11
|
-
export declare function versionsPlugin(
|
|
12
|
-
watcher: Watcher,
|
|
13
|
-
store: Store,
|
|
14
|
-
allFiles: AllFilesType,
|
|
15
|
-
): void;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare type Version = {
|
|
2
|
-
version: string;
|
|
3
|
-
label: string;
|
|
4
|
-
link: string;
|
|
5
|
-
default: boolean;
|
|
6
|
-
active: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare type VersionConfigItem = {
|
|
9
|
-
version: string;
|
|
10
|
-
name?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare type VersionsConfigType = {
|
|
13
|
-
versions: VersionConfigItem[];
|
|
14
|
-
default?: string;
|
|
15
|
-
missingBehavior?: string;
|
|
16
|
-
};
|
|
17
|
-
export declare type AllFilesType = {
|
|
18
|
-
addPath: (path: string) => string[];
|
|
19
|
-
addPaths: (paths: string[]) => void;
|
|
20
|
-
removePath: (path: string) => void;
|
|
21
|
-
getAll: () => string[];
|
|
22
|
-
hasPath: (path: string) => void;
|
|
23
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Version, VersionsConfigType } from './types.js';
|
|
2
|
-
export declare function getVersionConfigByBasePath(
|
|
3
|
-
versionsConfigMap: Map<string, VersionsConfigType>,
|
|
4
|
-
basePath: string,
|
|
5
|
-
): VersionsConfigType | null;
|
|
6
|
-
export declare function getPageVersions(
|
|
7
|
-
pathname: string,
|
|
8
|
-
currentVersion: string,
|
|
9
|
-
versionsConfig: VersionsConfigType,
|
|
10
|
-
): Version[];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as chokidar from 'chokidar';
|
|
3
|
-
import * as fs from 'fs';
|
|
4
|
-
declare type WatchCb = (event: 'add' | 'change' | 'unlink', path: string, stats?: fs.Stats) => void;
|
|
5
|
-
export declare class Watcher {
|
|
6
|
-
cwd: string;
|
|
7
|
-
private _readyPromise;
|
|
8
|
-
private listeners;
|
|
9
|
-
constructor(cwd: string);
|
|
10
|
-
watch(test: RegExp, cb: WatchCb): void;
|
|
11
|
-
emit(event: 'add' | 'change' | 'unlink', path: string, stats?: fs.Stats): void;
|
|
12
|
-
stop(): Promise<void>;
|
|
13
|
-
start(): void;
|
|
14
|
-
ready(): Promise<chokidar.FSWatcher>;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ClipboardService } from '@theme/utils';
|
|
2
|
-
|
|
3
|
-
describe('ClipboardService', () => {
|
|
4
|
-
describe('isSupported', () => {
|
|
5
|
-
it('should call queryCommandSupported', () => {
|
|
6
|
-
const queryCommandSupportedMock = jest.fn().mockReturnValue(true);
|
|
7
|
-
Object.assign(global.document, { queryCommandSupported: queryCommandSupportedMock });
|
|
8
|
-
|
|
9
|
-
expect(ClipboardService.isSupported()).toBe(true);
|
|
10
|
-
expect(queryCommandSupportedMock).toBeCalledTimes(1);
|
|
11
|
-
expect(queryCommandSupportedMock).toBeCalledWith('copy');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should return false, when queryCommandSupported is not defined', () => {
|
|
15
|
-
Object.assign(global.document, { queryCommandSupported: undefined });
|
|
16
|
-
expect(ClipboardService.isSupported()).toBe(false);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should return false, when document is not defined', () => {
|
|
20
|
-
Object.assign(global, { document: undefined });
|
|
21
|
-
expect(ClipboardService.isSupported()).toBe(false);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`highlight should work with correct lang name 1`] = `"<span class=\\"token keyword\\">int</span> name <span class=\\"token operator\\">=</span> <span class=\\"token string\\">\\"John\\"</span>"`;
|
|
4
|
-
|
|
5
|
-
exports[`highlight should work with mapped lang name 1`] = `"<span class=\\"token keyword\\">int</span> name <span class=\\"token operator\\">=</span> <span class=\\"token string\\">\\"John\\"</span>"`;
|