@redocly/theme 0.11.4 → 0.12.0
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/lib/I18n/LanguagePicker.d.ts +4 -0
- package/lib/I18n/LanguagePicker.js +111 -0
- package/lib/I18n/index.d.ts +1 -0
- package/lib/I18n/index.js +6 -0
- package/lib/components/Cards/Card.js +3 -1
- package/lib/components/Catalog/Catalog.js +14 -9
- package/lib/components/Catalog/CatalogCard.js +6 -1
- package/lib/components/Catalog/useCatalog.js +4 -1
- package/lib/components/CodeSample/CodeSample.js +11 -3
- package/lib/components/Feedback/Comment.js +12 -4
- package/lib/components/Feedback/Rating.js +8 -2
- package/lib/components/Feedback/Reasons.js +11 -4
- package/lib/components/Feedback/Sentiment.js +12 -4
- package/lib/components/Feedback/Thumbs.js +31 -18
- package/lib/components/Feedback/useReportDialog.js +8 -2
- package/lib/components/Filter/Filter.js +15 -8
- package/lib/components/Footer/FooterColumn.js +4 -2
- package/lib/components/Footer/FooterCopyright.d.ts +1 -2
- package/lib/components/Footer/FooterCopyright.js +6 -1
- package/lib/components/LastUpdated/LastUpdated.js +8 -4
- package/lib/components/Markdown/MarkdownLayout.js +6 -1
- package/lib/components/Markdown/MarkdownWrapper.js +4 -0
- package/lib/components/Menu/MenuGroup.js +3 -1
- package/lib/components/Menu/MenuItem.js +3 -1
- package/lib/components/Navbar/MobileNavbarItem.js +6 -2
- package/lib/components/Navbar/Navbar.d.ts +1 -0
- package/lib/components/Navbar/Navbar.js +6 -1
- package/lib/components/Navbar/NavbarDropdown.js +3 -1
- package/lib/components/Navbar/NavbarItem.js +9 -4
- package/lib/components/PageNavigation/NextButton.js +7 -2
- package/lib/components/PageNavigation/PreviousButton.js +10 -2
- package/lib/components/Profile/LoginLink.js +6 -1
- package/lib/components/Profile/UserProfileMenu.js +10 -4
- package/lib/components/Search/Autocomplete.d.ts +3 -3
- package/lib/components/Search/Autocomplete.js +21 -11
- package/lib/components/Search/ClearIcon.js +1 -1
- package/lib/components/Search/Search.js +6 -4
- package/lib/components/Separator/Separator.js +3 -1
- package/lib/components/Sidebar/DrilldownMenu.js +6 -1
- package/lib/components/Sidebar/DrilldownMenuItem.js +4 -2
- package/lib/components/Sidebar/types.d.ts +2 -0
- package/lib/components/TableOfContent/TableOfContent.js +6 -1
- package/lib/globalStyle.js +7 -0
- package/lib/icons/SpinnerIcon/SpinnerIcon.d.ts +8 -0
- package/lib/icons/SpinnerIcon/SpinnerIcon.js +32 -0
- package/lib/icons/SpinnerIcon/index.d.ts +1 -0
- package/lib/icons/SpinnerIcon/index.js +6 -0
- package/lib/icons/index.d.ts +1 -0
- package/lib/icons/index.js +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/layouts/Forbidden.js +8 -2
- package/lib/layouts/NotFound.js +8 -2
- package/lib/mocks/hooks/index.d.ts +15 -1
- package/lib/mocks/hooks/index.js +19 -1
- package/lib/mocks/search.d.ts +1 -0
- package/lib/mocks/search.js +1 -0
- package/lib/mocks/utils.d.ts +5 -0
- package/lib/mocks/utils.js +9 -1
- package/lib/types/portal/index.d.ts +1 -0
- package/lib/types/portal/index.js +1 -0
- package/lib/types/portal/src/shared/types/catalog.d.ts +4 -0
- package/lib/types/portal/src/shared/types/nav.d.ts +7 -0
- package/package.json +1 -1
- package/src/I18n/LanguagePicker.tsx +113 -0
- package/src/I18n/index.ts +1 -0
- package/src/components/Cards/Card.tsx +5 -1
- package/src/components/Catalog/Catalog.tsx +23 -6
- package/src/components/Catalog/CatalogCard.tsx +8 -1
- package/src/components/Catalog/useCatalog.ts +4 -2
- package/src/components/CodeSample/CodeSample.tsx +22 -4
- package/src/components/Feedback/Comment.tsx +25 -4
- package/src/components/Feedback/Rating.tsx +15 -2
- package/src/components/Feedback/Reasons.tsx +23 -5
- package/src/components/Feedback/Sentiment.tsx +25 -4
- package/src/components/Feedback/Thumbs.tsx +61 -46
- package/src/components/Feedback/useReportDialog.ts +11 -2
- package/src/components/Filter/Filter.tsx +17 -9
- package/src/components/Footer/CustomFooter.tsx +1 -1
- package/src/components/Footer/FooterColumn.tsx +5 -3
- package/src/components/Footer/FooterCopyright.tsx +12 -3
- package/src/components/LastUpdated/LastUpdated.tsx +10 -2
- package/src/components/Markdown/MarkdownLayout.tsx +11 -1
- package/src/components/Markdown/MarkdownWrapper.tsx +4 -0
- package/src/components/Menu/MenuGroup.tsx +4 -1
- package/src/components/Menu/MenuItem.tsx +3 -1
- package/src/components/Navbar/MobileNavbarItem.tsx +7 -1
- package/src/components/Navbar/Navbar.tsx +8 -0
- package/src/components/Navbar/NavbarDropdown.tsx +3 -1
- package/src/components/Navbar/NavbarItem.tsx +9 -3
- package/src/components/PageNavigation/NextButton.tsx +8 -2
- package/src/components/PageNavigation/PreviousButton.tsx +11 -2
- package/src/components/Profile/LoginLink.tsx +11 -1
- package/src/components/Profile/UserProfileMenu.tsx +13 -3
- package/src/components/Search/Autocomplete.tsx +31 -17
- package/src/components/Search/ClearIcon.tsx +1 -1
- package/src/components/Search/Search.tsx +8 -7
- package/src/components/Separator/Separator.tsx +4 -1
- package/src/components/Sidebar/DrilldownMenu.tsx +8 -1
- package/src/components/Sidebar/DrilldownMenuItem.tsx +7 -2
- package/src/components/Sidebar/types.ts +2 -0
- package/src/components/TableOfContent/TableOfContent.tsx +11 -1
- package/src/globalStyle.ts +7 -0
- package/src/icons/SpinnerIcon/SpinnerIcon.tsx +42 -0
- package/src/icons/SpinnerIcon/index.ts +1 -0
- package/src/icons/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/layouts/Forbidden.tsx +18 -3
- package/src/layouts/NotFound.tsx +17 -3
- package/src/mocks/hooks/index.ts +20 -1
- package/src/mocks/search.ts +2 -0
- package/src/mocks/utils.ts +13 -0
- package/src/types/portal/index.ts +1 -0
- package/src/types/portal/src/shared/types/catalog.ts +4 -0
- package/src/types/portal/src/shared/types/i18n.d.ts +3 -0
- package/src/types/portal/src/shared/types/nav.ts +7 -0
|
@@ -31,6 +31,7 @@ const React = __importStar(require("react"));
|
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const timeago_js_1 = require("timeago.js");
|
|
33
33
|
const useThemeConfig_1 = require("../../hooks/useThemeConfig");
|
|
34
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
34
35
|
const FORMATS = {
|
|
35
36
|
timeago: (date, locale) => (0, timeago_js_1.format)(date, locale),
|
|
36
37
|
iso: (date) => date.toISOString().split('T')[0],
|
|
@@ -39,6 +40,7 @@ const FORMATS = {
|
|
|
39
40
|
};
|
|
40
41
|
function LastUpdated(props) {
|
|
41
42
|
const { markdown: { lastUpdatedBlock = {} } = {} } = (0, useThemeConfig_1.useThemeConfig)();
|
|
43
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
42
44
|
if (lastUpdatedBlock === null || lastUpdatedBlock === void 0 ? void 0 : lastUpdatedBlock.hide) {
|
|
43
45
|
return null;
|
|
44
46
|
}
|
|
@@ -47,10 +49,12 @@ function LastUpdated(props) {
|
|
|
47
49
|
const locale = props.locale || lastUpdatedBlock.locale || 'en-US';
|
|
48
50
|
const isoDate = lastModified.toISOString().split('T')[0];
|
|
49
51
|
const lastUpdatedString = FORMATS[format](lastModified, locale);
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const translationKey = format === 'timeago' ? 'theme.page.lastUpdated.timeago' : 'theme.page.lastUpdated.on';
|
|
53
|
+
const text = format === 'timeago'
|
|
54
|
+
? translate(translationKey, 'Last updated ')
|
|
55
|
+
: translate(translationKey, 'Last updated on');
|
|
56
|
+
return (React.createElement(Wrapper, { "data-component-name": "LastUpdated/LastUpdated", rawOnPrint: format === 'timeago', "data-print-datetime": isoDate, "data-translation-key": translationKey },
|
|
57
|
+
text,
|
|
54
58
|
React.createElement("time", { dateTime: isoDate }, lastUpdatedString)));
|
|
55
59
|
}
|
|
56
60
|
exports.LastUpdated = LastUpdated;
|
|
@@ -12,15 +12,20 @@ const PageNavigation_1 = require("../../components/PageNavigation/PageNavigation
|
|
|
12
12
|
const EditPageButton_1 = require("../../components/EditPageButton");
|
|
13
13
|
const LastUpdated_1 = require("../../components/LastUpdated/LastUpdated");
|
|
14
14
|
const hooks_1 = require("../../hooks");
|
|
15
|
+
const hooks_2 = require("../../mocks/hooks");
|
|
15
16
|
function MarkdownLayout({ tableOfContent, markdownWrapper, feedback, editPage, lastModified, nextPage, prevPage, }) {
|
|
16
17
|
const { markdown } = (0, hooks_1.useThemeConfig)();
|
|
18
|
+
const { translate } = (0, hooks_2.useTranslate)();
|
|
19
|
+
const translationKeys = {
|
|
20
|
+
text: 'theme.markdown.editPage.text',
|
|
21
|
+
};
|
|
17
22
|
const { editPage: themeEditPage } = markdown || {};
|
|
18
23
|
const mergedConf = editPage ? Object.assign(Object.assign({}, themeEditPage), editPage) : undefined;
|
|
19
24
|
return (react_1.default.createElement(PageWrapper_1.PageWrapper, { "data-component-name": "Markdown/MarkdownLayout" },
|
|
20
25
|
react_1.default.createElement(ContainerWrapper_1.ContainerWrapper, { withToc: true },
|
|
21
26
|
react_1.default.createElement(LayoutTop, null,
|
|
22
27
|
lastModified && react_1.default.createElement(LastUpdated_1.LastUpdated, { lastModified: new Date(lastModified) }),
|
|
23
|
-
mergedConf && (react_1.default.createElement(EditPageButton_1.EditPageButton, { text: mergedConf.text, to: mergedConf.to, icon: mergedConf.icon }))),
|
|
28
|
+
mergedConf && (react_1.default.createElement(EditPageButton_1.EditPageButton, { text: translate(translationKeys.text, mergedConf.text), to: mergedConf.to, icon: mergedConf.icon, "data-translation-key": translationKeys.text }))),
|
|
24
29
|
markdownWrapper,
|
|
25
30
|
react_1.default.createElement(LayoutBottom, null, feedback),
|
|
26
31
|
react_1.default.createElement(PageNavigation_1.PageNavigation, { nextPage: nextPage, prevPage: prevPage })),
|
|
@@ -373,6 +373,10 @@ exports.MarkdownWrapper = styled_components_1.default.main.attrs(() => ({
|
|
|
373
373
|
list-style: var(--md-list-item-style);
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
ul > li:has(input[type='checkbox']) {
|
|
377
|
+
list-style: var(--md-checkbox-list-item-style);
|
|
378
|
+
}
|
|
379
|
+
|
|
376
380
|
ol > li {
|
|
377
381
|
list-style: var(--md-numbered-list-item-style);
|
|
378
382
|
}
|
|
@@ -33,9 +33,11 @@ const ArrowIcon_1 = require("../../icons/ArrowIcon/ArrowIcon");
|
|
|
33
33
|
const MenuLinkItem_1 = require("../../components/Menu/MenuLinkItem");
|
|
34
34
|
const MenuItemLabel_1 = require("../../components/Menu/MenuItemLabel");
|
|
35
35
|
const SeparatorLine_1 = require("../../components/Separator/SeparatorLine");
|
|
36
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
36
37
|
function MenuGroup({ item, isExpanded, toggleExpanded, children, }) {
|
|
37
38
|
const [showChildren, setShowChildren] = (0, react_1.useState)(isExpanded);
|
|
38
39
|
const timer = (0, react_1.useRef)(null);
|
|
40
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
39
41
|
(0, react_1.useEffect)(() => {
|
|
40
42
|
timer.current && clearTimeout(timer.current);
|
|
41
43
|
if (isExpanded) {
|
|
@@ -54,7 +56,7 @@ function MenuGroup({ item, isExpanded, toggleExpanded, children, }) {
|
|
|
54
56
|
react_1.default.createElement(MenuLinkItem_1.MenuLinkItem, { item: item },
|
|
55
57
|
react_1.default.createElement(MenuGroupLabel, { onClick: toggleExpanded, isAlwaysExpanded: item.expanded === 'always', active: item.active },
|
|
56
58
|
react_1.default.createElement(MenuGroupArrow, { visibility: item.items.length ? 'visible' : 'hidden', direction: isExpanded ? 'down' : 'right' }),
|
|
57
|
-
item.label)),
|
|
59
|
+
translate(item.labelTranslationKey, item.label))),
|
|
58
60
|
react_1.default.createElement(MenuWrapper, { isExpanded: isExpanded }, showChildren ? children : null),
|
|
59
61
|
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
60
62
|
}
|
|
@@ -10,11 +10,13 @@ const MenuLinkItem_1 = require("../../components/Menu/MenuLinkItem");
|
|
|
10
10
|
const ExternalIcon_1 = require("../../icons/ExternalIcon");
|
|
11
11
|
const MenuItemLabel_1 = require("../../components/Menu/MenuItemLabel");
|
|
12
12
|
const SeparatorLine_1 = require("../../components/Separator/SeparatorLine");
|
|
13
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
13
14
|
function MenuItem({ item }) {
|
|
15
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
14
16
|
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/MenuItem" },
|
|
15
17
|
react_1.default.createElement(MenuLinkItem_1.MenuLinkItem, { item: item },
|
|
16
18
|
react_1.default.createElement(MenuItemLabel_1.MenuItemLabel, { active: item.active },
|
|
17
|
-
item.label,
|
|
19
|
+
translate(item.labelTranslationKey, item.label),
|
|
18
20
|
item.external ? react_1.default.createElement(ExternalIcon_1.ExternalIcon, { dataComponentName: "Sidebar/ExternalIcon" }) : null)),
|
|
19
21
|
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
20
22
|
}
|
|
@@ -31,15 +31,19 @@ const react_1 = __importStar(require("react"));
|
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const react_router_dom_1 = require("react-router-dom");
|
|
33
33
|
const Link_1 = require("../../mocks/Link");
|
|
34
|
-
const
|
|
34
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
35
|
+
const utils_1 = require("../../mocks/utils");
|
|
36
|
+
const utils_2 = require("../../utils");
|
|
35
37
|
const MobileNavbarDropdown_1 = require("./MobileNavbarDropdown");
|
|
36
38
|
function MobileNavbarItem({ navItem, className }) {
|
|
37
39
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
38
40
|
const [expandedDropdown, setExpandedDropdown] = (0, react_1.useState)(false);
|
|
39
41
|
const toggleDropdown = () => setExpandedDropdown(!expandedDropdown);
|
|
42
|
+
const { defaultLocale, currentLocale, locales } = (0, hooks_1.useI18nConfig)();
|
|
40
43
|
if (navItem.link) {
|
|
41
44
|
const item = navItem;
|
|
42
|
-
const isActive = pathname ===
|
|
45
|
+
const isActive = pathname ===
|
|
46
|
+
(0, utils_2.withPathPrefix)((0, utils_1.getPathnameForLocale)(item.link, defaultLocale, currentLocale, locales));
|
|
43
47
|
return (react_1.default.createElement(exports.NavMenuItem, { active: isActive, "data-component-name": "Navbar/MobileNavbarItem", className: className },
|
|
44
48
|
react_1.default.createElement(exports.NavLink, { to: item.link, active: isActive },
|
|
45
49
|
react_1.default.createElement(NavLabel, null, item.label))));
|
|
@@ -10,6 +10,7 @@ interface NavbarPresentationalProps extends NavbarLogoProps {
|
|
|
10
10
|
hideSearch: boolean;
|
|
11
11
|
menu: ResolvedConfigLinks;
|
|
12
12
|
hideUserProfile: boolean | string | undefined;
|
|
13
|
+
changeLanguage: (value: string) => void;
|
|
13
14
|
}
|
|
14
15
|
export declare function NavbarPresentational(props: NavbarPresentationalProps): JSX.Element | null;
|
|
15
16
|
export declare const NavbarContainer: import("styled-components").StyledComponent<"nav", any, {}, never>;
|
|
@@ -39,6 +39,8 @@ const ColorModeSwitcher_1 = require("../../components/ColorModeSwitcher/ColorMod
|
|
|
39
39
|
const useThemeConfig_1 = require("../../hooks/useThemeConfig");
|
|
40
40
|
const Search_1 = require("../../components/Search/Search");
|
|
41
41
|
const AuthUserProfile_1 = require("../../components/Profile/AuthUserProfile");
|
|
42
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
43
|
+
const LanguagePicker_1 = require("../../I18n/LanguagePicker");
|
|
42
44
|
const EmptyNavbarHack = (0, styled_components_1.createGlobalStyle) `
|
|
43
45
|
#redocly_root {
|
|
44
46
|
--navbar-height: 0px !important;
|
|
@@ -48,6 +50,7 @@ function Navbar() {
|
|
|
48
50
|
var _a;
|
|
49
51
|
const [isOpen, setIsOpen] = (0, useMobileMenu_1.useMobileMenu)(false);
|
|
50
52
|
const themeConfig = (0, useThemeConfig_1.useThemeConfig)();
|
|
53
|
+
const { changeLanguage } = (0, hooks_1.useI18n)();
|
|
51
54
|
const menu = (_a = themeConfig.navbar) === null || _a === void 0 ? void 0 : _a.items;
|
|
52
55
|
const logo = themeConfig.logo;
|
|
53
56
|
const { search: searchSettings, navbar, userProfile: userProfileSettings } = themeConfig;
|
|
@@ -71,11 +74,12 @@ function Navbar() {
|
|
|
71
74
|
menu: menu,
|
|
72
75
|
logo: logo,
|
|
73
76
|
hideUserProfile,
|
|
77
|
+
changeLanguage,
|
|
74
78
|
})));
|
|
75
79
|
}
|
|
76
80
|
exports.Navbar = Navbar;
|
|
77
81
|
function NavbarPresentational(props) {
|
|
78
|
-
const { menuItemsExist, closeMobileMenu, openMobileMenu, isOpen, hideSearch, logo, menu, hideUserProfile, } = props;
|
|
82
|
+
const { menuItemsExist, closeMobileMenu, openMobileMenu, isOpen, hideSearch, logo, menu, hideUserProfile, changeLanguage, } = props;
|
|
79
83
|
return (react_1.default.createElement(exports.NavbarContainer, { "data-component-name": "Navbar/Navbar" },
|
|
80
84
|
menuItemsExist && react_1.default.createElement(MobileNavbarMenuButton_1.MobileNavbarMenuButton, { onClick: openMobileMenu }),
|
|
81
85
|
isOpen && (react_1.default.createElement(MobileNavbarMenu_1.MobileNavbarMenu, { closeMenu: closeMobileMenu, menuItems: menu, search: hideSearch ? null : react_1.default.createElement(Search_1.Search, null) })),
|
|
@@ -83,6 +87,7 @@ function NavbarPresentational(props) {
|
|
|
83
87
|
react_1.default.createElement(NavbarLogo_1.NavbarLogo, { logo: logo }),
|
|
84
88
|
react_1.default.createElement(Navbar_1.NavbarMenu, { menuItems: menu }),
|
|
85
89
|
hideSearch ? null : react_1.default.createElement(Search_1.Search, null),
|
|
90
|
+
react_1.default.createElement(LanguagePicker_1.LanguagePicker, { onChangeLanguage: changeLanguage }),
|
|
86
91
|
hideUserProfile ? null : react_1.default.createElement(AuthUserProfile_1.AuthUserProfile, null),
|
|
87
92
|
react_1.default.createElement(ColorModeSwitcher_1.ColorModeSwitcher, null))));
|
|
88
93
|
}
|
|
@@ -7,9 +7,11 @@ exports.DropdownWrapper = exports.NavbarDropdown = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Link_1 = require("../../mocks/Link");
|
|
10
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
10
11
|
function NavbarDropdown({ items }) {
|
|
12
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
11
13
|
return (react_1.default.createElement(exports.DropdownWrapper, { "data-component-name": "Navbar/NavbarDropdown" }, items.map((item, index) => (react_1.default.createElement("div", { key: `${item.label}_${index}` },
|
|
12
|
-
react_1.default.createElement(Link_1.Link, { to: item.link }, item.label))))));
|
|
14
|
+
react_1.default.createElement(Link_1.Link, { to: item.link }, translate(item.labelTranslationKey, item.label)))))));
|
|
13
15
|
}
|
|
14
16
|
exports.NavbarDropdown = NavbarDropdown;
|
|
15
17
|
exports.DropdownWrapper = styled_components_1.default.div `
|
|
@@ -8,22 +8,27 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const react_router_dom_1 = require("react-router-dom");
|
|
10
10
|
const Link_1 = require("../../mocks/Link");
|
|
11
|
+
const utils_1 = require("../../mocks/utils");
|
|
11
12
|
const NavbarDropdown_1 = require("../../components/Navbar/NavbarDropdown");
|
|
12
|
-
const
|
|
13
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
14
|
+
const utils_2 = require("../../utils");
|
|
13
15
|
function NavbarItem({ navItem, className }) {
|
|
14
16
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
17
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
18
|
+
const { defaultLocale, currentLocale, locales } = (0, hooks_1.useI18nConfig)();
|
|
15
19
|
if (navItem.link) {
|
|
16
20
|
const item = navItem;
|
|
17
|
-
const isActive = pathname ===
|
|
21
|
+
const isActive = pathname ===
|
|
22
|
+
(0, utils_2.withPathPrefix)((0, utils_1.getPathnameForLocale)(item.link, defaultLocale, currentLocale, locales));
|
|
18
23
|
return (react_1.default.createElement(exports.NavbarMenuItem, { active: isActive, "data-component-name": "Navbar/NavbarItem", className: className },
|
|
19
24
|
react_1.default.createElement(exports.NavbarLink, { to: item.link, external: item.external, target: item.target, active: isActive },
|
|
20
|
-
react_1.default.createElement(NavbarLabel, null, item.label))));
|
|
25
|
+
react_1.default.createElement(NavbarLabel, null, translate(item.labelTranslationKey, item.label)))));
|
|
21
26
|
}
|
|
22
27
|
if (navItem.items) {
|
|
23
28
|
const item = navItem;
|
|
24
29
|
return (react_1.default.createElement(exports.NavbarMenuItemWithDropdownWrapper, null,
|
|
25
30
|
react_1.default.createElement(exports.NavbarMenuItem, { active: false, "data-component-name": "Navbar/NavbarItem", className: className },
|
|
26
|
-
react_1.default.createElement(NavbarLabel, null, item.label)),
|
|
31
|
+
react_1.default.createElement(NavbarLabel, null, translate(item.labelTranslationKey, item.label))),
|
|
27
32
|
react_1.default.createElement(NavbarDropdown_1.NavbarDropdown, { items: item.items })));
|
|
28
33
|
}
|
|
29
34
|
return null;
|
|
@@ -31,14 +31,19 @@ const React = __importStar(require("react"));
|
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const Button_1 = require("../../components/Button");
|
|
33
33
|
const useThemeConfig_1 = require("../../hooks/useThemeConfig");
|
|
34
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
34
35
|
function NextButton({ nextPage }) {
|
|
35
36
|
var _a, _b;
|
|
36
37
|
const { navigation } = (0, useThemeConfig_1.useThemeConfig)();
|
|
38
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
37
39
|
if (!nextPage || ((_a = navigation === null || navigation === void 0 ? void 0 : navigation.nextButton) === null || _a === void 0 ? void 0 : _a.hide)) {
|
|
38
40
|
return React.createElement("div", null, "\u00A0");
|
|
39
41
|
}
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
+
const nextPageText = nextPage.label || nextPage.routeSlug || '';
|
|
43
|
+
const defaultText = (((_b = navigation === null || navigation === void 0 ? void 0 : navigation.nextButton) === null || _b === void 0 ? void 0 : _b.text) || 'Next to {label}').replace('{label}', nextPageText);
|
|
44
|
+
const translationKey = 'theme.page.nextButton';
|
|
45
|
+
const text = translate(translationKey, { label: nextPageText, defaultValue: defaultText });
|
|
46
|
+
return (React.createElement(StyledButton, { variant: "outlined", size: "large", to: nextPage.link, "data-component-name": "PageNavigation/NextPageLink", "data-translation-key": translationKey }, text));
|
|
42
47
|
}
|
|
43
48
|
exports.NextButton = NextButton;
|
|
44
49
|
const StyledButton = (0, styled_components_1.default)(Button_1.Button) `
|
|
@@ -8,14 +8,22 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Button_1 = require("../../components/Button");
|
|
10
10
|
const useThemeConfig_1 = require("../../hooks/useThemeConfig");
|
|
11
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
11
12
|
function PreviousButton({ prevPage }) {
|
|
12
13
|
var _a, _b;
|
|
13
14
|
const { navigation } = (0, useThemeConfig_1.useThemeConfig)();
|
|
15
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
14
16
|
if (!prevPage || ((_a = navigation === null || navigation === void 0 ? void 0 : navigation.previousButton) === null || _a === void 0 ? void 0 : _a.hide)) {
|
|
15
17
|
return react_1.default.createElement("div", null, "\u00A0");
|
|
16
18
|
}
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
+
const prevPageText = prevPage.label || prevPage.routeSlug || '';
|
|
20
|
+
const defaultText = (((_b = navigation === null || navigation === void 0 ? void 0 : navigation.previousButton) === null || _b === void 0 ? void 0 : _b.text) || 'Back to {label}').replace('{label}', prevPageText);
|
|
21
|
+
const translationKey = 'theme.page.previousButton';
|
|
22
|
+
const text = translate(translationKey, {
|
|
23
|
+
label: prevPageText,
|
|
24
|
+
defaultValue: defaultText,
|
|
25
|
+
});
|
|
26
|
+
return (react_1.default.createElement(StyledButton, { variant: "outlined", size: "large", to: prevPage.link, "data-component-name": "PageNavigation/PreviousPageLink", "data-translation-key": translationKey }, text));
|
|
19
27
|
}
|
|
20
28
|
exports.PreviousButton = PreviousButton;
|
|
21
29
|
const StyledButton = (0, styled_components_1.default)(Button_1.Button) `
|
|
@@ -7,9 +7,14 @@ exports.LoginLink = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const useThemeConfig_1 = require("../../hooks/useThemeConfig");
|
|
10
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
10
11
|
function LoginLink({ href }) {
|
|
11
12
|
const { userProfile } = (0, useThemeConfig_1.useThemeConfig)();
|
|
12
|
-
|
|
13
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
14
|
+
const translationKeys = {
|
|
15
|
+
login: 'theme.profile.login',
|
|
16
|
+
};
|
|
17
|
+
return (react_1.default.createElement(StyledLink, { href: href, "data-translation-key": translationKeys.login }, translate(translationKeys.login, (userProfile === null || userProfile === void 0 ? void 0 : userProfile.loginLabel) || 'Login')));
|
|
13
18
|
}
|
|
14
19
|
exports.LoginLink = LoginLink;
|
|
15
20
|
const StyledLink = styled_components_1.default.a.attrs(() => ({
|
|
@@ -30,17 +30,23 @@ exports.UserProfileMenu = void 0;
|
|
|
30
30
|
const react_1 = __importDefault(require("react"));
|
|
31
31
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
32
32
|
const Link_1 = require("../../mocks/Link");
|
|
33
|
-
const
|
|
33
|
+
const useThemeConfig_1 = require("../../hooks/useThemeConfig");
|
|
34
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
34
35
|
function UserProfileMenu({ hasDeveloperOnboarding, setIsOpened, handleLogout, }) {
|
|
35
36
|
var _a;
|
|
36
|
-
const { userProfile } = (0,
|
|
37
|
+
const { userProfile } = (0, useThemeConfig_1.useThemeConfig)();
|
|
38
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
39
|
+
const translationKeys = {
|
|
40
|
+
myApps: 'theme.profile.myApps',
|
|
41
|
+
logout: 'theme.profile.logout',
|
|
42
|
+
};
|
|
37
43
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
38
44
|
react_1.default.createElement(StyledUl, { onClick: () => setIsOpened(false) },
|
|
39
45
|
hasDeveloperOnboarding ? (react_1.default.createElement(Link_1.Link, { to: "/apps" },
|
|
40
|
-
react_1.default.createElement(StyledLi,
|
|
46
|
+
react_1.default.createElement(StyledLi, { "data-translation-key": translationKeys.myApps }, translate(translationKeys.myApps, 'My Apps')))) : null, (_a = userProfile === null || userProfile === void 0 ? void 0 : userProfile.menu) === null || _a === void 0 ? void 0 :
|
|
41
47
|
_a.map((item) => (react_1.default.createElement(Link_1.Link, { external: item.external, key: item.label, to: item.link || '' },
|
|
42
48
|
react_1.default.createElement(StyledLi, { separatorLine: item === null || item === void 0 ? void 0 : item.separatorLine }, item.label)))),
|
|
43
|
-
react_1.default.createElement(StyledLi, { onClick: () => handleLogout() }, (userProfile === null || userProfile === void 0 ? void 0 : userProfile.logoutLabel) || 'Log out'))));
|
|
49
|
+
react_1.default.createElement(StyledLi, { onClick: () => handleLogout(), "data-translation-key": translationKeys.logout }, translate(translationKeys.logout, (userProfile === null || userProfile === void 0 ? void 0 : userProfile.logoutLabel) || 'Log out')))));
|
|
44
50
|
}
|
|
45
51
|
exports.UserProfileMenu = UserProfileMenu;
|
|
46
52
|
const StyledUl = styled_components_1.default.ul `
|
|
@@ -4,13 +4,13 @@ import type { ActiveItem } from '../../types/portal/src/shared/types/activeItem'
|
|
|
4
4
|
interface AutocompleteProps<T> {
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
value: string;
|
|
7
|
-
items: T[];
|
|
7
|
+
items: T[] | null;
|
|
8
8
|
renderItem(item: ActiveItem<T>): ReactNode;
|
|
9
9
|
change(value: string): void;
|
|
10
10
|
select(item: T): void;
|
|
11
|
-
children?(isOpen: boolean, close: () => void): ReactNode;
|
|
12
11
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
13
12
|
keyShortcuts?: string[];
|
|
13
|
+
isLoading: boolean;
|
|
14
14
|
}
|
|
15
|
-
export declare function Autocomplete<T>({ placeholder, value, items, change, select, renderItem,
|
|
15
|
+
export declare function Autocomplete<T>({ placeholder, value, items, change, select, renderItem, keyShortcuts, isLoading, }: AutocompleteProps<T>): JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -34,11 +34,19 @@ const hotkeys_js_1 = __importDefault(require("hotkeys-js"));
|
|
|
34
34
|
const Input_1 = require("../../components/Search/Input");
|
|
35
35
|
const Popover_1 = require("../../components/Search/Popover");
|
|
36
36
|
const ShortcutKey_1 = require("../../components/Search/ShortcutKey");
|
|
37
|
-
|
|
37
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
38
|
+
const SearchIcon_1 = require("../../components/Search/SearchIcon");
|
|
39
|
+
const SpinnerIcon_1 = require("../../icons/SpinnerIcon");
|
|
40
|
+
const ClearIcon_1 = require("../../components/Search/ClearIcon");
|
|
41
|
+
function Autocomplete({ placeholder, value, items, change, select, renderItem, keyShortcuts, isLoading, }) {
|
|
38
42
|
const location = (0, react_router_dom_1.useLocation)();
|
|
39
|
-
const [
|
|
43
|
+
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
40
44
|
const [activeIdx, setActiveIdx] = (0, react_1.useState)(-1);
|
|
41
45
|
const refInput = (0, react_1.useRef)(null);
|
|
46
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
47
|
+
const translationKeys = {
|
|
48
|
+
noResults: 'theme.search.noResults',
|
|
49
|
+
};
|
|
42
50
|
const hotkeysKeys = keyShortcuts === null || keyShortcuts === void 0 ? void 0 : keyShortcuts.join(',');
|
|
43
51
|
(0, react_1.useEffect)(() => {
|
|
44
52
|
if (hotkeysKeys) {
|
|
@@ -50,9 +58,9 @@ function Autocomplete({ placeholder, value, items, change, select, renderItem, c
|
|
|
50
58
|
return () => hotkeys_js_1.default.unbind(hotkeysKeys);
|
|
51
59
|
}
|
|
52
60
|
}, [hotkeysKeys]);
|
|
53
|
-
const
|
|
61
|
+
const onFocus = () => setIsFocused(true);
|
|
54
62
|
const close = () => {
|
|
55
|
-
|
|
63
|
+
setIsFocused(false);
|
|
56
64
|
setActiveIdx(-1);
|
|
57
65
|
};
|
|
58
66
|
const reset = () => {
|
|
@@ -62,10 +70,12 @@ function Autocomplete({ placeholder, value, items, change, select, renderItem, c
|
|
|
62
70
|
const stopPropagation = (event) => event.stopPropagation();
|
|
63
71
|
const onChange = (event) => {
|
|
64
72
|
setActiveIdx(-1);
|
|
65
|
-
|
|
73
|
+
setIsFocused(true);
|
|
66
74
|
change(event.target.value);
|
|
67
75
|
};
|
|
68
76
|
const onKeydown = (event) => {
|
|
77
|
+
if (items === null)
|
|
78
|
+
return;
|
|
69
79
|
switch (event.code) {
|
|
70
80
|
case 'Escape':
|
|
71
81
|
close();
|
|
@@ -92,12 +102,12 @@ function Autocomplete({ placeholder, value, items, change, select, renderItem, c
|
|
|
92
102
|
};
|
|
93
103
|
(0, react_1.useEffect)(close, [location]);
|
|
94
104
|
return (react_1.default.createElement(Wrapper, { "data-component-name": "Search/Autocomplete" },
|
|
95
|
-
|
|
96
|
-
react_1.default.createElement(AutocompleteBox, { onKeyDown: onKeydown },
|
|
97
|
-
|
|
98
|
-
react_1.default.createElement(Input_1.FormInput, { value: value, placeholder: placeholder, onChange: onChange, onFocus:
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
isFocused ? react_1.default.createElement(Overlay, { onClick: close }) : null,
|
|
106
|
+
react_1.default.createElement(AutocompleteBox, { onKeyDown: onKeydown },
|
|
107
|
+
isFocused && isLoading ? react_1.default.createElement(SpinnerIcon_1.SpinnerIcon, null) : react_1.default.createElement(SearchIcon_1.SearchIcon, null),
|
|
108
|
+
react_1.default.createElement(Input_1.FormInput, { value: value, placeholder: placeholder, onChange: onChange, onFocus: onFocus, onClick: stopPropagation, ref: refInput }),
|
|
109
|
+
isFocused ? react_1.default.createElement(ClearIcon_1.ClearIcon, { onClick: reset }) : react_1.default.createElement(ShortcutKey_1.ShortcutKey, { keyShortcuts: keyShortcuts }),
|
|
110
|
+
isFocused && items !== null && value && (react_1.default.createElement(Popover_1.Popover, null, items.length ? (items.map(mapItem)) : (react_1.default.createElement(Message, { "data-translation-key": translationKeys.noResults }, translate(translationKeys.noResults, 'No results'))))))));
|
|
101
111
|
}
|
|
102
112
|
exports.Autocomplete = Autocomplete;
|
|
103
113
|
const Wrapper = styled_components_1.default.div ``;
|
|
@@ -31,20 +31,20 @@ const React = __importStar(require("react"));
|
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const search_1 = require("../../mocks/search");
|
|
33
33
|
const Autocomplete_1 = require("../../components/Search/Autocomplete");
|
|
34
|
-
const ClearIcon_1 = require("../../components/Search/ClearIcon");
|
|
35
|
-
const SearchIcon_1 = require("../../components/Search/SearchIcon");
|
|
36
34
|
const SearchItem_1 = require("../../components/Search/SearchItem");
|
|
37
35
|
const hooks_1 = require("../../hooks");
|
|
38
36
|
const usePreloadHistory_1 = require("../../mocks/usePreloadHistory");
|
|
37
|
+
const hooks_2 = require("../../mocks/hooks");
|
|
39
38
|
function Search() {
|
|
40
39
|
const history = (0, usePreloadHistory_1.usePreloadHistory)();
|
|
41
|
-
const { query, setQuery, items } = (0, search_1.useFuseSearch)();
|
|
40
|
+
const { query, setQuery, items, isLoading } = (0, search_1.useFuseSearch)();
|
|
42
41
|
const themeSettings = (0, hooks_1.useThemeConfig)();
|
|
42
|
+
const { translate } = (0, hooks_2.useTranslate)();
|
|
43
43
|
// TODO: ask somebody about typings
|
|
44
44
|
const navigate = (item) => history.push(item.url);
|
|
45
45
|
const renderAutocomplete = () => {
|
|
46
46
|
var _a, _b;
|
|
47
|
-
return (React.createElement(Autocomplete_1.Autocomplete, { items: items, value: query, change: setQuery, select: navigate, placeholder:
|
|
47
|
+
return (React.createElement(Autocomplete_1.Autocomplete, { items: items, value: query, change: setQuery, select: navigate, placeholder: translate('theme.search.label', 'Search the docs'), keyShortcuts: (_b = (_a = themeSettings === null || themeSettings === void 0 ? void 0 : themeSettings.search) === null || _a === void 0 ? void 0 : _a.shortcuts) !== null && _b !== void 0 ? _b : ['/'], renderItem: (item) => React.createElement(SearchItem_1.SearchItem, { key: item.id, item: item }), isLoading: isLoading }));
|
|
48
48
|
};
|
|
49
49
|
return React.createElement(Wrapper, { "data-component-name": "Search/Search" }, renderAutocomplete());
|
|
50
50
|
}
|
|
@@ -52,6 +52,8 @@ exports.Search = Search;
|
|
|
52
52
|
const Wrapper = styled_components_1.default.div `
|
|
53
53
|
margin-left: auto;
|
|
54
54
|
|
|
55
|
+
padding: 0 var(--navbar-item-padding-horizontal);
|
|
56
|
+
|
|
55
57
|
display: none;
|
|
56
58
|
|
|
57
59
|
${({ theme }) => { var _a; return (_a = theme.mediaQueries) === null || _a === void 0 ? void 0 : _a.small; }} {
|
|
@@ -8,9 +8,11 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const SeparatorLine_1 = require("../../components/Separator/SeparatorLine");
|
|
10
10
|
const SeparatorItem_1 = require("../../components/Separator/SeparatorItem");
|
|
11
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
11
12
|
function Separator({ item }) {
|
|
13
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
12
14
|
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/Separator" },
|
|
13
|
-
react_1.default.createElement(SeparatorItem_1.SeparatorItem, null, item.label),
|
|
15
|
+
react_1.default.createElement(SeparatorItem_1.SeparatorItem, null, translate(item.labelTranslationKey, item.label)),
|
|
14
16
|
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
15
17
|
}
|
|
16
18
|
exports.Separator = Separator;
|
|
@@ -31,11 +31,16 @@ const react_1 = __importDefault(require("react"));
|
|
|
31
31
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
32
32
|
const BackButton_1 = require("../../components/Sidebar/BackButton");
|
|
33
33
|
const DrilldownMenuItem_1 = require("../../components/Sidebar/DrilldownMenuItem");
|
|
34
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
34
35
|
function DrilldownMenu({ item, back, prevActiveItem, children, }) {
|
|
36
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
37
|
+
const translationKeys = {
|
|
38
|
+
backLabel: 'theme.sidebar.menu.backLabel',
|
|
39
|
+
};
|
|
35
40
|
return (react_1.default.createElement(MenuContainer, { "data-component-name": "Sidebar/DrilldownMenu" },
|
|
36
41
|
react_1.default.createElement(MenuContent, null,
|
|
37
42
|
react_1.default.createElement(MenuWrapper, null,
|
|
38
|
-
react_1.default.createElement(BackButton_1.BackButton, { back: back }, (prevActiveItem === null || prevActiveItem === void 0 ? void 0 : prevActiveItem.label) || 'Back'),
|
|
43
|
+
react_1.default.createElement(BackButton_1.BackButton, { back: back, "data-translation-key": translationKeys.backLabel }, (prevActiveItem === null || prevActiveItem === void 0 ? void 0 : prevActiveItem.label) || translate(translationKeys.backLabel, 'Back')),
|
|
39
44
|
react_1.default.createElement(DrilldownMenuItem_1.DrilldownMenuItem, { item: item })),
|
|
40
45
|
children)));
|
|
41
46
|
}
|
|
@@ -6,12 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.DrilldownMenuItem = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
9
10
|
function DrilldownMenuItem({ item }) {
|
|
11
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
10
12
|
return (react_1.default.createElement(Container, { "data-component-name": "Sidebar/DrilldownMenuItem" },
|
|
11
13
|
item.icon ? react_1.default.createElement(Icon, { src: item.icon }) : null,
|
|
12
14
|
react_1.default.createElement("div", null,
|
|
13
|
-
item.label,
|
|
14
|
-
item.sublabel ? react_1.default.createElement(SubLabel, null, item.sublabel) : null)));
|
|
15
|
+
translate(item.labelTranslationKey, item.label),
|
|
16
|
+
item.sublabel ? (react_1.default.createElement(SubLabel, null, translate(item.subLabelTranslationKey, item.sublabel))) : null)));
|
|
15
17
|
}
|
|
16
18
|
exports.DrilldownMenuItem = DrilldownMenuItem;
|
|
17
19
|
const Container = styled_components_1.default.div `
|
|
@@ -32,6 +32,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
32
32
|
const useFullHeight_1 = require("../../hooks/useFullHeight");
|
|
33
33
|
const useActiveHeading_1 = require("../../hooks/useActiveHeading");
|
|
34
34
|
const useThemeConfig_1 = require("../../hooks/useThemeConfig");
|
|
35
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
35
36
|
const utils_1 = require("../../components/TableOfContent/utils");
|
|
36
37
|
function TableOfContent(props) {
|
|
37
38
|
const { headings, contentWrapper } = props;
|
|
@@ -41,13 +42,17 @@ function TableOfContent(props) {
|
|
|
41
42
|
const displayedHeadings = (0, utils_1.getDisplayedHeadings)(headings, toc.depth || 3);
|
|
42
43
|
const leastDepth = (0, utils_1.getLeastDepth)(displayedHeadings);
|
|
43
44
|
const activeHeadingId = (0, useActiveHeading_1.useActiveHeading)(contentWrapper, (0, utils_1.getDisplayedHeadingsIds)(displayedHeadings));
|
|
45
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
46
|
+
const translationKeys = {
|
|
47
|
+
header: 'theme.toc.header',
|
|
48
|
+
};
|
|
44
49
|
if (toc === null || toc === void 0 ? void 0 : toc.hide) {
|
|
45
50
|
return null;
|
|
46
51
|
}
|
|
47
52
|
return (React.createElement(React.Fragment, null,
|
|
48
53
|
React.createElement(TableOfContentMenu, { "data-component-name": "TableOfContent/TableOfContent" },
|
|
49
54
|
React.createElement(TableOfContentItems, { ref: sidebar },
|
|
50
|
-
displayedHeadings.length ? React.createElement(TocHeader,
|
|
55
|
+
displayedHeadings.length ? (React.createElement(TocHeader, { "data-translation-key": translationKeys.header }, translate(translationKeys.header, toc.header || 'On this page'))) : null,
|
|
51
56
|
displayedHeadings.map((heading, idx) => {
|
|
52
57
|
if (!heading) {
|
|
53
58
|
return null;
|
package/lib/globalStyle.js
CHANGED
|
@@ -1772,6 +1772,13 @@ const markdown = (0, styled_components_1.css) `
|
|
|
1772
1772
|
--md-list-item-margin: 0.25rem; // @presenter Spacing
|
|
1773
1773
|
--md-list-item-style: inherit;
|
|
1774
1774
|
|
|
1775
|
+
|
|
1776
|
+
/**
|
|
1777
|
+
* @tokens Markdown Checkbox List
|
|
1778
|
+
*/
|
|
1779
|
+
|
|
1780
|
+
--md-checkbox-list-item-style: none;
|
|
1781
|
+
|
|
1775
1782
|
/**
|
|
1776
1783
|
* @tokens Markdown Numbered List
|
|
1777
1784
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SpinnerIconProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const Icon: ({ className }: SpinnerIconProps) => JSX.Element;
|
|
6
|
+
export declare const SpinnerIcon: import("styled-components").StyledComponent<({ className }: SpinnerIconProps) => JSX.Element, any, {
|
|
7
|
+
'data-component-name': string;
|
|
8
|
+
}, "data-component-name">;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SpinnerIcon = exports.Icon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Icon = ({ className }) => (react_1.default.createElement("svg", { className: className, viewBox: "0 -1 38 40", strokeOpacity: ".5" },
|
|
10
|
+
react_1.default.createElement("g", { fill: "none", fillRule: "evenodd" },
|
|
11
|
+
react_1.default.createElement("g", { transform: "translate(1 1)", strokeWidth: "4" },
|
|
12
|
+
react_1.default.createElement("circle", { strokeOpacity: ".3", cx: "18", cy: "18", r: "18" }),
|
|
13
|
+
react_1.default.createElement("path", { d: "M36 18c0-9.94-8.06-18-18-18" },
|
|
14
|
+
react_1.default.createElement("animateTransform", { attributeName: "transform", type: "rotate", from: "0 18 18", to: "360 18 18", dur: "1s", repeatCount: "indefinite" }))))));
|
|
15
|
+
exports.Icon = Icon;
|
|
16
|
+
exports.SpinnerIcon = (0, styled_components_1.default)(exports.Icon).attrs(() => ({
|
|
17
|
+
'data-component-name': 'icons/AnchorIcon/AnchorIcon',
|
|
18
|
+
})) `
|
|
19
|
+
position: absolute;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
width: 1em;
|
|
22
|
+
height: 1em;
|
|
23
|
+
left: 0.8em;
|
|
24
|
+
stroke: var(--search-input-text-color);
|
|
25
|
+
z-index: -1;
|
|
26
|
+
|
|
27
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
28
|
+
width: 1.2em;
|
|
29
|
+
height: 1.2em;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
//# sourceMappingURL=SpinnerIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SpinnerIcon } from '../../icons/SpinnerIcon/SpinnerIcon';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpinnerIcon = void 0;
|
|
4
|
+
var SpinnerIcon_1 = require("../../icons/SpinnerIcon/SpinnerIcon");
|
|
5
|
+
Object.defineProperty(exports, "SpinnerIcon", { enumerable: true, get: function () { return SpinnerIcon_1.SpinnerIcon; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|