@docusaurus/theme-classic 2.0.0-beta.13 → 2.0.0-beta.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.
- package/README.md +1 -1
- package/lib/index.js +7 -16
- package/lib/theme-classic.d.ts +111 -188
- package/lib/translations.js +13 -4
- package/lib/validateThemeConfig.js +18 -4
- package/lib-next/theme/Admonition/index.js +101 -0
- package/lib-next/theme/BackToTopButton/styles.module.css +1 -1
- package/lib-next/theme/BlogListPaginator/index.js +12 -12
- package/lib-next/theme/BlogPostAuthor/index.js +1 -1
- package/lib-next/theme/BlogPostAuthors/index.js +12 -2
- package/lib-next/theme/BlogPostAuthors/styles.module.css +10 -0
- package/lib-next/theme/BlogPostItem/index.js +12 -15
- package/lib-next/theme/BlogPostPage/index.js +10 -7
- package/lib-next/theme/BlogPostPaginator/index.js +11 -15
- package/lib-next/theme/BlogSidebar/styles.module.css +2 -0
- package/lib-next/theme/CodeBlock/index.js +51 -10
- package/lib-next/theme/CodeBlock/styles.module.css +18 -7
- package/lib-next/theme/DocCard/styles.module.css +3 -3
- package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +6 -3
- package/lib-next/theme/DocItem/index.js +9 -6
- package/lib-next/theme/DocItem/styles.module.css +2 -2
- package/lib-next/theme/DocPage/index.js +7 -3
- package/lib-next/theme/DocPage/styles.module.css +1 -0
- package/lib-next/theme/DocPaginator/index.js +11 -13
- package/lib-next/theme/DocSidebar/index.js +2 -2
- package/lib-next/theme/DocSidebar/styles.module.css +1 -0
- package/lib-next/theme/DocSidebarItem/index.js +43 -21
- package/lib-next/theme/DocSidebarItem/styles.module.css +1 -0
- package/lib-next/theme/DocSidebarItems/index.js +28 -0
- package/{lib/theme/DocSidebarItem → lib-next/theme/DocSidebarItems}/styles.module.css +1 -0
- package/lib-next/theme/DocVersionBanner/index.js +4 -1
- package/lib-next/theme/Footer/index.js +73 -35
- package/lib-next/theme/Footer/styles.module.css +2 -1
- package/lib-next/theme/Heading/index.js +39 -43
- package/lib-next/theme/Heading/styles.css +1 -1
- package/lib-next/theme/Layout/index.js +1 -2
- package/lib-next/theme/LayoutHead/index.js +5 -9
- package/lib-next/theme/LayoutProviders/index.js +6 -6
- package/lib-next/theme/MDXComponents/index.js +18 -31
- package/lib-next/theme/MDXComponents/styles.css +4 -0
- package/lib-next/theme/MDXPage/index.js +3 -10
- package/lib-next/theme/Navbar/index.js +6 -6
- package/lib-next/theme/NavbarItem/DefaultNavbarItem.js +4 -66
- package/lib-next/theme/NavbarItem/DocNavbarItem.js +5 -2
- package/lib-next/theme/NavbarItem/DocSidebarNavbarItem.js +73 -0
- package/lib-next/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +5 -3
- package/lib-next/theme/NavbarItem/DocsVersionNavbarItem.js +4 -1
- package/lib-next/theme/NavbarItem/DropdownNavbarItem.js +6 -7
- package/lib-next/theme/NavbarItem/NavbarNavLink.js +70 -0
- package/lib-next/theme/NavbarItem/index.js +1 -2
- package/lib-next/theme/{UserPreferencesContext.js → NavbarItem/utils.js} +3 -3
- package/lib-next/theme/PaginatorNavLink/index.js +20 -0
- package/lib-next/theme/SkipToContent/index.js +1 -1
- package/lib-next/theme/SkipToContent/styles.module.css +7 -0
- package/lib-next/theme/TOCCollapsible/styles.module.css +2 -2
- package/lib-next/theme/Tabs/__tests__/index.test.js +8 -6
- package/lib-next/theme/Tabs/index.js +20 -10
- package/lib-next/theme/Tag/styles.module.css +4 -4
- package/lib-next/theme/ThemedImage/index.js +2 -2
- package/lib-next/theme/Toggle/styles.module.css +16 -15
- package/lib-next/theme/prism-include-languages.js +10 -3
- package/package.json +17 -19
- package/src/index.ts +12 -26
- package/src/theme/Admonition/index.tsx +106 -0
- package/src/theme/BackToTopButton/styles.module.css +1 -1
- package/src/theme/BlogListPaginator/index.tsx +12 -12
- package/src/theme/BlogPostAuthor/index.tsx +1 -1
- package/src/theme/BlogPostAuthors/index.tsx +12 -2
- package/src/theme/BlogPostAuthors/styles.module.css +10 -0
- package/src/theme/BlogPostItem/index.tsx +13 -15
- package/src/theme/BlogPostPage/index.tsx +10 -7
- package/src/theme/BlogPostPaginator/index.tsx +11 -15
- package/src/theme/BlogSidebar/styles.module.css +2 -0
- package/src/theme/CodeBlock/index.tsx +52 -11
- package/src/theme/CodeBlock/styles.module.css +18 -7
- package/src/theme/DocCard/index.tsx +2 -2
- package/src/theme/DocCard/styles.module.css +3 -3
- package/src/theme/DocCardList/index.tsx +1 -1
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +7 -3
- package/src/theme/DocItem/index.tsx +9 -6
- package/src/theme/DocItem/styles.module.css +2 -2
- package/src/theme/DocItemFooter/index.tsx +1 -1
- package/src/theme/DocPage/index.tsx +8 -4
- package/src/theme/DocPage/styles.module.css +1 -0
- package/src/theme/DocPaginator/index.tsx +13 -15
- package/src/theme/DocSidebar/index.tsx +3 -3
- package/src/theme/DocSidebar/styles.module.css +1 -0
- package/src/theme/DocSidebarItem/index.tsx +34 -23
- package/src/theme/DocSidebarItem/styles.module.css +1 -0
- package/src/theme/DocSidebarItems/index.tsx +32 -0
- package/{lib/theme/DocItemFooter → src/theme/DocSidebarItems}/styles.module.css +10 -8
- package/src/theme/DocVersionBanner/index.tsx +3 -3
- package/src/theme/Footer/index.tsx +84 -38
- package/src/theme/Footer/styles.module.css +2 -1
- package/src/theme/Heading/index.tsx +39 -47
- package/src/theme/Heading/styles.css +1 -1
- package/src/theme/Layout/index.tsx +1 -2
- package/src/theme/LayoutHead/index.tsx +4 -8
- package/src/theme/LayoutProviders/index.tsx +6 -6
- package/src/theme/MDXComponents/index.tsx +26 -37
- package/src/theme/MDXComponents/styles.css +4 -0
- package/src/theme/MDXPage/index.tsx +3 -11
- package/src/theme/Navbar/index.tsx +7 -7
- package/src/theme/NavbarItem/DefaultNavbarItem.tsx +6 -62
- package/src/theme/NavbarItem/DocNavbarItem.tsx +8 -5
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +84 -0
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +9 -6
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +2 -2
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +6 -7
- package/src/theme/NavbarItem/NavbarNavLink.tsx +68 -0
- package/src/theme/NavbarItem/index.tsx +3 -5
- package/{lib-next/theme/hooks/styles.css → src/theme/NavbarItem/utils.ts} +3 -3
- package/src/theme/PaginatorNavLink/index.tsx +22 -0
- package/src/theme/SkipToContent/index.tsx +1 -1
- package/src/theme/SkipToContent/styles.module.css +7 -0
- package/src/theme/TOCCollapsible/styles.module.css +2 -2
- package/src/theme/TOCItems/index.tsx +2 -2
- package/src/theme/Tabs/index.tsx +25 -10
- package/src/theme/Tag/styles.module.css +4 -4
- package/src/theme/TagsListByLetter/index.tsx +1 -1
- package/src/theme/ThemedImage/index.tsx +2 -2
- package/src/theme/Toggle/index.tsx +1 -1
- package/src/theme/Toggle/styles.module.css +16 -15
- package/src/theme/prism-include-languages.ts +10 -3
- package/src/theme-classic.d.ts +111 -188
- package/src/translations.ts +36 -16
- package/src/validateThemeConfig.ts +25 -4
- package/babel.config.js +0 -35
- package/lib/__tests__/__snapshots__/translations.test.ts.snap +0 -116
- package/lib/__tests__/translations.test.js +0 -112
- package/lib/__tests__/validateThemeConfig.test.js +0 -607
- package/lib/theme/AnnouncementBar/index.js +0 -68
- package/lib/theme/AnnouncementBar/styles.module.css +0 -63
- package/lib/theme/BackToTopButton/index.js +0 -140
- package/lib/theme/BackToTopButton/styles.module.css +0 -42
- package/lib/theme/BlogArchivePage/index.js +0 -89
- package/lib/theme/BlogLayout/index.js +0 -51
- package/lib/theme/BlogListPage/index.js +0 -60
- package/lib/theme/BlogListPaginator/index.js +0 -63
- package/lib/theme/BlogPostAuthor/index.js +0 -51
- package/lib/theme/BlogPostAuthor/styles.module.css +0 -12
- package/lib/theme/BlogPostAuthors/index.js +0 -47
- package/lib/theme/BlogPostAuthors/styles.module.css +0 -11
- package/lib/theme/BlogPostItem/index.js +0 -152
- package/lib/theme/BlogPostItem/styles.module.css +0 -18
- package/lib/theme/BlogPostPage/index.js +0 -82
- package/lib/theme/BlogPostPaginator/index.js +0 -64
- package/lib/theme/BlogSidebar/index.js +0 -49
- package/lib/theme/BlogSidebar/styles.module.css +0 -44
- package/lib/theme/BlogTagsListPage/index.js +0 -40
- package/lib/theme/BlogTagsPostsPage/index.js +0 -86
- package/lib/theme/CodeBlock/index.js +0 -133
- package/lib/theme/CodeBlock/styles.module.css +0 -65
- package/lib/theme/Details/index.js +0 -30
- package/lib/theme/Details/styles.module.css +0 -13
- package/lib/theme/DocCard/index.js +0 -84
- package/lib/theme/DocCard/styles.module.css +0 -43
- package/lib/theme/DocCardList/index.js +0 -28
- package/lib/theme/DocCategoryGeneratedIndexPage/index.js +0 -57
- package/lib/theme/DocCategoryGeneratedIndexPage/styles.module.css +0 -18
- package/lib/theme/DocItem/index.js +0 -112
- package/lib/theme/DocItem/styles.module.css +0 -22
- package/lib/theme/DocItemFooter/index.js +0 -79
- package/lib/theme/DocPage/index.js +0 -154
- package/lib/theme/DocPage/styles.module.css +0 -85
- package/lib/theme/DocPaginator/index.js +0 -62
- package/lib/theme/DocSidebar/index.js +0 -134
- package/lib/theme/DocSidebar/styles.module.css +0 -106
- package/lib/theme/DocSidebarItem/index.js +0 -209
- package/lib/theme/DocTagDocListPage/index.js +0 -89
- package/lib/theme/DocTagsListPage/index.js +0 -44
- package/lib/theme/DocVersionBadge/index.js +0 -34
- package/lib/theme/DocVersionBanner/index.js +0 -130
- package/lib/theme/EditThisPage/index.js +0 -33
- package/lib/theme/ErrorPageContent.js +0 -43
- package/lib/theme/Footer/index.js +0 -119
- package/lib/theme/Footer/styles.module.css +0 -15
- package/lib/theme/Heading/index.js +0 -71
- package/lib/theme/Heading/styles.css +0 -22
- package/lib/theme/Heading/styles.module.css +0 -19
- package/lib/theme/IconArrow/index.js +0 -28
- package/lib/theme/IconClose/index.js +0 -31
- package/lib/theme/IconEdit/index.js +0 -34
- package/lib/theme/IconEdit/styles.module.css +0 -11
- package/lib/theme/IconExternalLink/index.js +0 -30
- package/lib/theme/IconExternalLink/styles.module.css +0 -12
- package/lib/theme/IconLanguage/index.js +0 -29
- package/lib/theme/IconMenu/index.js +0 -30
- package/lib/theme/LastUpdated/index.js +0 -63
- package/lib/theme/Layout/index.js +0 -68
- package/lib/theme/Layout/styles.css +0 -27
- package/lib/theme/LayoutHead/index.js +0 -149
- package/lib/theme/LayoutProviders/index.js +0 -40
- package/lib/theme/Logo/index.js +0 -62
- package/lib/theme/MDXComponents/index.js +0 -106
- package/lib/theme/MDXComponents/styles.css +0 -11
- package/lib/theme/MDXPage/index.js +0 -67
- package/lib/theme/MDXPage/styles.module.css +0 -10
- package/lib/theme/Navbar/index.js +0 -267
- package/lib/theme/Navbar/styles.module.css +0 -27
- package/lib/theme/NavbarItem/DefaultNavbarItem.js +0 -113
- package/lib/theme/NavbarItem/DocNavbarItem.js +0 -62
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +0 -83
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +0 -43
- package/lib/theme/NavbarItem/DropdownNavbarItem.js +0 -155
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +0 -68
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +0 -11
- package/lib/theme/NavbarItem/SearchNavbarItem.js +0 -28
- package/lib/theme/NavbarItem/index.js +0 -74
- package/lib/theme/NotFound.js +0 -57
- package/lib/theme/SearchBar.js +0 -15
- package/lib/theme/SearchMetadata/index.js +0 -33
- package/lib/theme/Seo/index.js +0 -52
- package/lib/theme/SkipToContent/index.js +0 -71
- package/lib/theme/SkipToContent/styles.module.css +0 -14
- package/lib/theme/TOC/index.js +0 -39
- package/lib/theme/TOC/styles.module.css +0 -23
- package/lib/theme/TOCCollapsible/index.js +0 -53
- package/lib/theme/TOCCollapsible/styles.module.css +0 -50
- package/lib/theme/TOCInline/index.js +0 -33
- package/lib/theme/TOCInline/styles.module.css +0 -12
- package/lib/theme/TOCItems/index.js +0 -78
- package/lib/theme/TabItem/index.js +0 -32
- package/lib/theme/Tabs/__tests__/index.test.js +0 -123
- package/lib/theme/Tabs/index.js +0 -173
- package/lib/theme/Tabs/styles.module.css +0 -10
- package/lib/theme/Tag/index.js +0 -40
- package/lib/theme/Tag/styles.module.css +0 -70
- package/lib/theme/TagsListByLetter/index.js +0 -48
- package/lib/theme/TagsListByLetter/styles.module.css +0 -11
- package/lib/theme/TagsListInline/index.js +0 -44
- package/lib/theme/TagsListInline/styles.module.css +0 -15
- package/lib/theme/ThemeContext.js +0 -21
- package/lib/theme/ThemeProvider/index.js +0 -43
- package/lib/theme/ThemedImage/index.js +0 -47
- package/lib/theme/ThemedImage/styles.module.css +0 -18
- package/lib/theme/Toggle/index.js +0 -91
- package/lib/theme/Toggle/styles.module.css +0 -105
- package/lib/theme/UserPreferencesContext.js +0 -18
- package/lib/theme/UserPreferencesProvider/index.js +0 -41
- package/lib/theme/hooks/styles.css +0 -10
- package/lib/theme/hooks/useDocs.js +0 -18
- package/lib/theme/hooks/useHideableNavbar.js +0 -74
- package/lib/theme/hooks/useKeyboardNavigation.js +0 -45
- package/lib/theme/hooks/useLocationHash.js +0 -28
- package/lib/theme/hooks/useLockBodyScroll.js +0 -26
- package/lib/theme/hooks/usePrismTheme.js +0 -36
- package/lib/theme/hooks/useTabGroupChoice.js +0 -51
- package/lib/theme/hooks/useTheme.js +0 -97
- package/lib/theme/hooks/useThemeContext.js +0 -31
- package/lib/theme/hooks/useUserPreferencesContext.js +0 -31
- package/lib/theme/hooks/useWindowSize.js +0 -68
- package/lib/theme/prism-include-languages.js +0 -40
- package/lib-next/__tests__/__snapshots__/translations.test.ts.snap +0 -116
- package/lib-next/__tests__/translations.test.js +0 -128
- package/lib-next/__tests__/validateThemeConfig.test.js +0 -607
- package/lib-next/admonitions.css +0 -35
- package/lib-next/deps.d.ts +0 -13
- package/lib-next/index.js +0 -227
- package/lib-next/prism-include-languages.js +0 -9
- package/lib-next/theme/ThemeContext.js +0 -9
- package/lib-next/theme/ThemeProvider/index.js +0 -28
- package/lib-next/theme/UserPreferencesProvider/index.js +0 -27
- package/lib-next/theme/hooks/useDocs.js +0 -10
- package/lib-next/theme/hooks/useHideableNavbar.js +0 -66
- package/lib-next/theme/hooks/useKeyboardNavigation.js +0 -35
- package/lib-next/theme/hooks/useLocationHash.js +0 -20
- package/lib-next/theme/hooks/useLockBodyScroll.js +0 -18
- package/lib-next/theme/hooks/usePrismTheme.js +0 -20
- package/lib-next/theme/hooks/useTabGroupChoice.js +0 -39
- package/lib-next/theme/hooks/useTheme.js +0 -81
- package/lib-next/theme/hooks/useThemeContext.js +0 -22
- package/lib-next/theme/hooks/useUserPreferencesContext.js +0 -22
- package/lib-next/theme/hooks/useWindowSize.js +0 -59
- package/lib-next/theme-classic.d.ts +0 -806
- package/lib-next/translations.js +0 -141
- package/lib-next/types.d.ts +0 -11
- package/lib-next/validateThemeConfig.js +0 -344
- package/src/__tests__/__snapshots__/translations.test.ts.snap +0 -116
- package/src/__tests__/translations.test.ts +0 -116
- package/src/__tests__/validateThemeConfig.test.js +0 -607
- package/src/theme/Tabs/__tests__/index.test.tsx +0 -129
- package/src/theme/ThemeContext.ts +0 -15
- package/src/theme/ThemeProvider/index.tsx +0 -28
- package/src/theme/UserPreferencesContext.ts +0 -12
- package/src/theme/UserPreferencesProvider/index.tsx +0 -30
- package/src/theme/hooks/styles.css +0 -10
- package/src/theme/hooks/useDocs.ts +0 -11
- package/src/theme/hooks/useHideableNavbar.ts +0 -72
- package/src/theme/hooks/useKeyboardNavigation.ts +0 -39
- package/src/theme/hooks/useLocationHash.ts +0 -25
- package/src/theme/hooks/useLockBodyScroll.ts +0 -20
- package/src/theme/hooks/usePrismTheme.ts +0 -22
- package/src/theme/hooks/useTabGroupChoice.ts +0 -46
- package/src/theme/hooks/useTheme.ts +0 -91
- package/src/theme/hooks/useThemeContext.ts +0 -23
- package/src/theme/hooks/useUserPreferencesContext.ts +0 -25
- package/src/theme/hooks/useWindowSize.ts +0 -69
- package/tsconfig.json +0 -11
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
|
-
|
|
12
|
-
var _themeCommon = require("@docusaurus/theme-common");
|
|
13
|
-
|
|
14
|
-
var _DefaultNavbarItem = require("@theme/NavbarItem/DefaultNavbarItem");
|
|
15
|
-
|
|
16
|
-
var _NavbarItem = _interopRequireDefault(require("@theme/NavbarItem"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
26
|
-
*
|
|
27
|
-
* This source code is licensed under the MIT license found in the
|
|
28
|
-
* LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/
|
|
30
|
-
const dropdownLinkActiveClass = 'dropdown__link--active';
|
|
31
|
-
|
|
32
|
-
function isItemActive(item, localPathname) {
|
|
33
|
-
if ((0, _themeCommon.isSamePath)(item.to, localPathname)) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if ((0, _themeCommon.isRegexpStringMatch)(item.activeBaseRegex, localPathname)) {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (item.activeBasePath && localPathname.startsWith(item.activeBasePath)) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function containsActiveItems(items, localPathname) {
|
|
49
|
-
return items.some(item => isItemActive(item, localPathname));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function DropdownNavbarItemDesktop({
|
|
53
|
-
items,
|
|
54
|
-
position,
|
|
55
|
-
className,
|
|
56
|
-
...props
|
|
57
|
-
}) {
|
|
58
|
-
var _props$children;
|
|
59
|
-
|
|
60
|
-
const dropdownRef = (0, _react.useRef)(null);
|
|
61
|
-
const dropdownMenuRef = (0, _react.useRef)(null);
|
|
62
|
-
const [showDropdown, setShowDropdown] = (0, _react.useState)(false);
|
|
63
|
-
(0, _react.useEffect)(() => {
|
|
64
|
-
const handleClickOutside = event => {
|
|
65
|
-
if (!dropdownRef.current || dropdownRef.current.contains(event.target)) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
setShowDropdown(false);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
73
|
-
document.addEventListener('touchstart', handleClickOutside);
|
|
74
|
-
return () => {
|
|
75
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
76
|
-
document.removeEventListener('touchstart', handleClickOutside);
|
|
77
|
-
};
|
|
78
|
-
}, [dropdownRef]);
|
|
79
|
-
return <div ref={dropdownRef} className={(0, _clsx.default)('navbar__item', 'dropdown', 'dropdown--hoverable', {
|
|
80
|
-
'dropdown--right': position === 'right',
|
|
81
|
-
'dropdown--show': showDropdown
|
|
82
|
-
})}>
|
|
83
|
-
<_DefaultNavbarItem.NavLink href={props.to ? undefined : '#'} className={(0, _clsx.default)('navbar__link', className)} {...props} onClick={props.to ? undefined : e => e.preventDefault()} onKeyDown={e => {
|
|
84
|
-
if (e.key === 'Enter') {
|
|
85
|
-
e.preventDefault();
|
|
86
|
-
setShowDropdown(!showDropdown);
|
|
87
|
-
}
|
|
88
|
-
}}>
|
|
89
|
-
{(_props$children = props.children) !== null && _props$children !== void 0 ? _props$children : props.label}
|
|
90
|
-
</_DefaultNavbarItem.NavLink>
|
|
91
|
-
<ul ref={dropdownMenuRef} className="dropdown__menu">
|
|
92
|
-
{items.map((childItemProps, i) => <_NavbarItem.default isDropdownItem onKeyDown={e => {
|
|
93
|
-
if (i === items.length - 1 && e.key === 'Tab') {
|
|
94
|
-
e.preventDefault();
|
|
95
|
-
setShowDropdown(false);
|
|
96
|
-
const nextNavbarItem = dropdownRef.current.nextElementSibling;
|
|
97
|
-
|
|
98
|
-
if (nextNavbarItem) {
|
|
99
|
-
nextNavbarItem.focus();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}} activeClassName={dropdownLinkActiveClass} {...childItemProps} key={i} />)}
|
|
103
|
-
</ul>
|
|
104
|
-
</div>;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function DropdownNavbarItemMobile({
|
|
108
|
-
items,
|
|
109
|
-
className,
|
|
110
|
-
position: _position,
|
|
111
|
-
// Need to destructure position from props so that it doesn't get passed on.
|
|
112
|
-
...props
|
|
113
|
-
}) {
|
|
114
|
-
var _props$children2;
|
|
115
|
-
|
|
116
|
-
const localPathname = (0, _themeCommon.useLocalPathname)();
|
|
117
|
-
const containsActive = containsActiveItems(items, localPathname);
|
|
118
|
-
const {
|
|
119
|
-
collapsed,
|
|
120
|
-
toggleCollapsed,
|
|
121
|
-
setCollapsed
|
|
122
|
-
} = (0, _themeCommon.useCollapsible)({
|
|
123
|
-
initialState: () => !containsActive
|
|
124
|
-
}); // Expand/collapse if any item active after a navigation
|
|
125
|
-
|
|
126
|
-
(0, _react.useEffect)(() => {
|
|
127
|
-
if (containsActive) {
|
|
128
|
-
setCollapsed(!containsActive);
|
|
129
|
-
}
|
|
130
|
-
}, [localPathname, containsActive, setCollapsed]);
|
|
131
|
-
return <li className={(0, _clsx.default)('menu__list-item', {
|
|
132
|
-
'menu__list-item--collapsed': collapsed
|
|
133
|
-
})}>
|
|
134
|
-
<_DefaultNavbarItem.NavLink role="button" className={(0, _clsx.default)('menu__link menu__link--sublist', className)} {...props} onClick={e => {
|
|
135
|
-
e.preventDefault();
|
|
136
|
-
toggleCollapsed();
|
|
137
|
-
}}>
|
|
138
|
-
{(_props$children2 = props.children) !== null && _props$children2 !== void 0 ? _props$children2 : props.label}
|
|
139
|
-
</_DefaultNavbarItem.NavLink>
|
|
140
|
-
<_themeCommon.Collapsible lazy as="ul" className="menu__list" collapsed={collapsed}>
|
|
141
|
-
{items.map((childItemProps, i) => <_NavbarItem.default mobile isDropdownItem onClick={props.onClick} activeClassName="menu__link--active" {...childItemProps} key={i} />)}
|
|
142
|
-
</_themeCommon.Collapsible>
|
|
143
|
-
</li>;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function DropdownNavbarItem({
|
|
147
|
-
mobile = false,
|
|
148
|
-
...props
|
|
149
|
-
}) {
|
|
150
|
-
const Comp = mobile ? DropdownNavbarItemMobile : DropdownNavbarItemDesktop;
|
|
151
|
-
return <Comp {...props} />;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
var _default = DropdownNavbarItem;
|
|
155
|
-
exports.default = _default;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = LocaleDropdownNavbarItem;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _DropdownNavbarItem = _interopRequireDefault(require("@theme/NavbarItem/DropdownNavbarItem"));
|
|
11
|
-
|
|
12
|
-
var _IconLanguage = _interopRequireDefault(require("@theme/IconLanguage"));
|
|
13
|
-
|
|
14
|
-
var _useDocusaurusContext = _interopRequireDefault(require("@docusaurus/useDocusaurusContext"));
|
|
15
|
-
|
|
16
|
-
var _themeCommon = require("@docusaurus/theme-common");
|
|
17
|
-
|
|
18
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the MIT license found in the
|
|
26
|
-
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/
|
|
28
|
-
function LocaleDropdownNavbarItem({
|
|
29
|
-
mobile,
|
|
30
|
-
dropdownItemsBefore,
|
|
31
|
-
dropdownItemsAfter,
|
|
32
|
-
...props
|
|
33
|
-
}) {
|
|
34
|
-
const {
|
|
35
|
-
i18n: {
|
|
36
|
-
currentLocale,
|
|
37
|
-
locales,
|
|
38
|
-
localeConfigs
|
|
39
|
-
}
|
|
40
|
-
} = (0, _useDocusaurusContext.default)();
|
|
41
|
-
const alternatePageUtils = (0, _themeCommon.useAlternatePageUtils)();
|
|
42
|
-
|
|
43
|
-
function getLocaleLabel(locale) {
|
|
44
|
-
return localeConfigs[locale].label;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const localeItems = locales.map(locale => {
|
|
48
|
-
const to = `pathname://${alternatePageUtils.createUrl({
|
|
49
|
-
locale,
|
|
50
|
-
fullyQualified: false
|
|
51
|
-
})}`;
|
|
52
|
-
return {
|
|
53
|
-
isNavLink: true,
|
|
54
|
-
label: getLocaleLabel(locale),
|
|
55
|
-
to,
|
|
56
|
-
target: '_self',
|
|
57
|
-
autoAddBaseUrl: false,
|
|
58
|
-
className: locale === currentLocale ? 'dropdown__link--active' : ''
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
const items = [...dropdownItemsBefore, ...localeItems, ...dropdownItemsAfter]; // Mobile is handled a bit differently
|
|
62
|
-
|
|
63
|
-
const dropdownLabel = mobile ? 'Languages' : getLocaleLabel(currentLocale);
|
|
64
|
-
return <_DropdownNavbarItem.default {...props} mobile={mobile} label={<span>
|
|
65
|
-
<_IconLanguage.default className={_stylesModule.default.iconLanguage} />
|
|
66
|
-
<span>{dropdownLabel}</span>
|
|
67
|
-
</span>} items={items} />;
|
|
68
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
.iconLanguage {
|
|
9
|
-
vertical-align: text-bottom;
|
|
10
|
-
margin-right: 5px;
|
|
11
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = SearchNavbarItem;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _SearchBar = _interopRequireDefault(require("@theme/SearchBar"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the MIT license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/
|
|
20
|
-
function SearchNavbarItem({
|
|
21
|
-
mobile
|
|
22
|
-
}) {
|
|
23
|
-
if (mobile) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return <_SearchBar.default />;
|
|
28
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = NavbarItem;
|
|
7
|
-
exports.getInfimaActiveClassName = void 0;
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
|
-
var _DefaultNavbarItem = _interopRequireDefault(require("@theme/NavbarItem/DefaultNavbarItem"));
|
|
12
|
-
|
|
13
|
-
var _DropdownNavbarItem = _interopRequireDefault(require("@theme/NavbarItem/DropdownNavbarItem"));
|
|
14
|
-
|
|
15
|
-
var _LocaleDropdownNavbarItem = _interopRequireDefault(require("@theme/NavbarItem/LocaleDropdownNavbarItem"));
|
|
16
|
-
|
|
17
|
-
var _SearchNavbarItem = _interopRequireDefault(require("@theme/NavbarItem/SearchNavbarItem"));
|
|
18
|
-
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/
|
|
27
|
-
const NavbarItemComponents = {
|
|
28
|
-
default: () => _DefaultNavbarItem.default,
|
|
29
|
-
localeDropdown: () => _LocaleDropdownNavbarItem.default,
|
|
30
|
-
search: () => _SearchNavbarItem.default,
|
|
31
|
-
dropdown: () => _DropdownNavbarItem.default,
|
|
32
|
-
// Need to lazy load these items as we don't know for sure the docs plugin is loaded
|
|
33
|
-
// See https://github.com/facebook/docusaurus/issues/3360
|
|
34
|
-
|
|
35
|
-
/* eslint-disable @typescript-eslint/no-var-requires, global-require */
|
|
36
|
-
docsVersion: () => require('@theme/NavbarItem/DocsVersionNavbarItem').default,
|
|
37
|
-
docsVersionDropdown: () => require('@theme/NavbarItem/DocsVersionDropdownNavbarItem').default,
|
|
38
|
-
doc: () => require('@theme/NavbarItem/DocNavbarItem').default
|
|
39
|
-
/* eslint-enable @typescript-eslint/no-var-requires, global-require */
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const getNavbarItemComponent = type => {
|
|
44
|
-
const navbarItemComponentFn = NavbarItemComponents[type];
|
|
45
|
-
|
|
46
|
-
if (!navbarItemComponentFn) {
|
|
47
|
-
throw new Error(`No NavbarItem component found for type "${type}".`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return navbarItemComponentFn();
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
function getComponentType(type, isDropdown) {
|
|
54
|
-
// Backward compatibility: navbar item with no type set
|
|
55
|
-
// but containing dropdown items should use the type "dropdown"
|
|
56
|
-
if (!type || type === 'default') {
|
|
57
|
-
return isDropdown ? 'dropdown' : 'default';
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return type;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const getInfimaActiveClassName = mobile => mobile ? 'menu__link--active' : 'navbar__link--active';
|
|
64
|
-
|
|
65
|
-
exports.getInfimaActiveClassName = getInfimaActiveClassName;
|
|
66
|
-
|
|
67
|
-
function NavbarItem({
|
|
68
|
-
type,
|
|
69
|
-
...props
|
|
70
|
-
}) {
|
|
71
|
-
const componentType = getComponentType(type, props.items !== undefined);
|
|
72
|
-
const NavbarItemComponent = getNavbarItemComponent(componentType);
|
|
73
|
-
return <NavbarItemComponent {...props} />;
|
|
74
|
-
}
|
package/lib/theme/NotFound.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _Layout = _interopRequireDefault(require("@theme/Layout"));
|
|
11
|
-
|
|
12
|
-
var _Translate = _interopRequireWildcard(require("@docusaurus/Translate"));
|
|
13
|
-
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/
|
|
26
|
-
function NotFound() {
|
|
27
|
-
return <_Layout.default title={(0, _Translate.translate)({
|
|
28
|
-
id: 'theme.NotFound.title',
|
|
29
|
-
message: 'Page Not Found'
|
|
30
|
-
})}>
|
|
31
|
-
<main className="container margin-vert--xl">
|
|
32
|
-
<div className="row">
|
|
33
|
-
<div className="col col--6 col--offset-3">
|
|
34
|
-
<h1 className="hero__title">
|
|
35
|
-
<_Translate.default id="theme.NotFound.title" description="The title of the 404 page">
|
|
36
|
-
Page Not Found
|
|
37
|
-
</_Translate.default>
|
|
38
|
-
</h1>
|
|
39
|
-
<p>
|
|
40
|
-
<_Translate.default id="theme.NotFound.p1" description="The first paragraph of the 404 page">
|
|
41
|
-
We could not find what you were looking for.
|
|
42
|
-
</_Translate.default>
|
|
43
|
-
</p>
|
|
44
|
-
<p>
|
|
45
|
-
<_Translate.default id="theme.NotFound.p2" description="The 2nd paragraph of the 404 page">
|
|
46
|
-
Please contact the owner of the site that linked you to the
|
|
47
|
-
original URL and let them know their link is broken.
|
|
48
|
-
</_Translate.default>
|
|
49
|
-
</p>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</main>
|
|
53
|
-
</_Layout.default>;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
var _default = NotFound;
|
|
57
|
-
exports.default = _default;
|
package/lib/theme/SearchBar.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Noop.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
var _Noop = _interopRequireDefault(require("@docusaurus/Noop"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = SearchMetadata;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _Head = _interopRequireDefault(require("@docusaurus/Head"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the MIT license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/
|
|
20
|
-
// Note: we don't couple this to Algolia/DocSearch on purpose
|
|
21
|
-
// We may want to support other search engine plugins too
|
|
22
|
-
// Search plugins should swizzle/override this comp to add their behavior
|
|
23
|
-
function SearchMetadata({
|
|
24
|
-
locale,
|
|
25
|
-
version,
|
|
26
|
-
tag
|
|
27
|
-
}) {
|
|
28
|
-
return <_Head.default>
|
|
29
|
-
{locale && <meta name="docusaurus_locale" content={locale} />}
|
|
30
|
-
{version && <meta name="docusaurus_version" content={version} />}
|
|
31
|
-
{tag && <meta name="docusaurus_tag" content={tag} />}
|
|
32
|
-
</_Head.default>;
|
|
33
|
-
}
|
package/lib/theme/Seo/index.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = Seo;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _Head = _interopRequireDefault(require("@docusaurus/Head"));
|
|
11
|
-
|
|
12
|
-
var _themeCommon = require("@docusaurus/theme-common");
|
|
13
|
-
|
|
14
|
-
var _useBaseUrl = require("@docusaurus/useBaseUrl");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the MIT license found in the
|
|
22
|
-
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/
|
|
24
|
-
function Seo({
|
|
25
|
-
title,
|
|
26
|
-
description,
|
|
27
|
-
keywords,
|
|
28
|
-
image,
|
|
29
|
-
children
|
|
30
|
-
}) {
|
|
31
|
-
const pageTitle = (0, _themeCommon.useTitleFormatter)(title);
|
|
32
|
-
const {
|
|
33
|
-
withBaseUrl
|
|
34
|
-
} = (0, _useBaseUrl.useBaseUrlUtils)();
|
|
35
|
-
const pageImage = image ? withBaseUrl(image, {
|
|
36
|
-
absolute: true
|
|
37
|
-
}) : undefined;
|
|
38
|
-
return <_Head.default>
|
|
39
|
-
{title && <title>{pageTitle}</title>}
|
|
40
|
-
{title && <meta property="og:title" content={pageTitle} />}
|
|
41
|
-
|
|
42
|
-
{description && <meta name="description" content={description} />}
|
|
43
|
-
{description && <meta property="og:description" content={description} />}
|
|
44
|
-
|
|
45
|
-
{keywords && <meta name="keywords" content={Array.isArray(keywords) ? keywords.join(',') : keywords} />}
|
|
46
|
-
|
|
47
|
-
{pageImage && <meta property="og:image" content={pageImage} />}
|
|
48
|
-
{pageImage && <meta name="twitter:image" content={pageImage} />}
|
|
49
|
-
|
|
50
|
-
{children}
|
|
51
|
-
</_Head.default>;
|
|
52
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _router = require("@docusaurus/router");
|
|
11
|
-
|
|
12
|
-
var _Translate = _interopRequireDefault(require("@docusaurus/Translate"));
|
|
13
|
-
|
|
14
|
-
var _themeCommon = require("@docusaurus/theme-common");
|
|
15
|
-
|
|
16
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
26
|
-
*
|
|
27
|
-
* This source code is licensed under the MIT license found in the
|
|
28
|
-
* LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/
|
|
30
|
-
function programmaticFocus(el) {
|
|
31
|
-
el.setAttribute('tabindex', '-1');
|
|
32
|
-
el.focus();
|
|
33
|
-
el.removeAttribute('tabindex');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function SkipToContent() {
|
|
37
|
-
const containerRef = (0, _react.useRef)(null);
|
|
38
|
-
const {
|
|
39
|
-
action
|
|
40
|
-
} = (0, _router.useHistory)();
|
|
41
|
-
|
|
42
|
-
const handleSkip = e => {
|
|
43
|
-
e.preventDefault();
|
|
44
|
-
const targetElement = document.querySelector('main:first-of-type') || document.querySelector('.main-wrapper');
|
|
45
|
-
|
|
46
|
-
if (targetElement) {
|
|
47
|
-
programmaticFocus(targetElement);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
(0, _themeCommon.useLocationChange)(({
|
|
52
|
-
location
|
|
53
|
-
}) => {
|
|
54
|
-
if (containerRef.current && !location.hash && action === 'PUSH') {
|
|
55
|
-
programmaticFocus(containerRef.current);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return <div ref={containerRef}>
|
|
59
|
-
{
|
|
60
|
-
/* eslint-disable-next-line jsx-a11y/anchor-is-valid */
|
|
61
|
-
}
|
|
62
|
-
<a href="#" className={_stylesModule.default.skipToContent} onClick={handleSkip}>
|
|
63
|
-
<_Translate.default id="theme.common.skipToMainContent" description="The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation">
|
|
64
|
-
Skip to main content
|
|
65
|
-
</_Translate.default>
|
|
66
|
-
</a>
|
|
67
|
-
</div>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
var _default = SkipToContent;
|
|
71
|
-
exports.default = _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
.skipToContent {
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 1rem;
|
|
4
|
-
left: 100%;
|
|
5
|
-
z-index: calc(var(--ifm-z-index-fixed) + 1);
|
|
6
|
-
padding: calc(var(--ifm-global-spacing) / 2) var(--ifm-global-spacing);
|
|
7
|
-
color: var(--ifm-color-emphasis-900);
|
|
8
|
-
background-color: var(--ifm-background-surface-color);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.skipToContent:focus {
|
|
12
|
-
left: 1rem;
|
|
13
|
-
box-shadow: var(--ifm-global-shadow-md);
|
|
14
|
-
}
|
package/lib/theme/TOC/index.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
|
-
|
|
12
|
-
var _TOCItems = _interopRequireDefault(require("@theme/TOCItems"));
|
|
13
|
-
|
|
14
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the MIT license found in the
|
|
22
|
-
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/
|
|
24
|
-
// Using a custom className
|
|
25
|
-
// This prevents TOC highlighting to highlight TOCInline/TOCCollapsible by mistake
|
|
26
|
-
const LINK_CLASS_NAME = 'table-of-contents__link toc-highlight';
|
|
27
|
-
const LINK_ACTIVE_CLASS_NAME = 'table-of-contents__link--active';
|
|
28
|
-
|
|
29
|
-
function TOC({
|
|
30
|
-
className,
|
|
31
|
-
...props
|
|
32
|
-
}) {
|
|
33
|
-
return <div className={(0, _clsx.default)(_stylesModule.default.tableOfContents, 'thin-scrollbar', className)}>
|
|
34
|
-
<_TOCItems.default {...props} linkClassName={LINK_CLASS_NAME} linkActiveClassName={LINK_ACTIVE_CLASS_NAME} />
|
|
35
|
-
</div>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var _default = TOC;
|
|
39
|
-
exports.default = _default;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
.tableOfContents {
|
|
9
|
-
max-height: calc(100vh - (var(--ifm-navbar-height) + 2rem));
|
|
10
|
-
overflow-y: auto;
|
|
11
|
-
position: sticky;
|
|
12
|
-
top: calc(var(--ifm-navbar-height) + 1rem);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@media (max-width: 996px) {
|
|
16
|
-
.tableOfContents {
|
|
17
|
-
display: none;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.docItemContainer {
|
|
21
|
-
padding: 0 0.3rem;
|
|
22
|
-
}
|
|
23
|
-
}
|