@redocly/theme 0.11.5 → 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/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/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/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/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
package/src/mocks/utils.ts
CHANGED
|
@@ -2,8 +2,21 @@ export function withPathPrefix(link: string): string {
|
|
|
2
2
|
return link;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
export function withoutPathPrefix(link: string): string {
|
|
6
|
+
return link;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
export function timeAgo(lastModified: string | Date): string {
|
|
6
10
|
// should return format(lastModified) in portal
|
|
7
11
|
const d = new Date(lastModified);
|
|
8
12
|
return `${d.getDate()}-${d.getMonth() + 1}-${d.getFullYear()}`;
|
|
9
13
|
}
|
|
14
|
+
|
|
15
|
+
export function getPathnameForLocale(
|
|
16
|
+
pathname: string,
|
|
17
|
+
_defaultLocale: string,
|
|
18
|
+
_newLocale: string,
|
|
19
|
+
_allLocales: { code: string; name: string }[],
|
|
20
|
+
) {
|
|
21
|
+
return `${pathname}`;
|
|
22
|
+
}
|
|
@@ -10,9 +10,11 @@ export type FilteredCatalog = {
|
|
|
10
10
|
export type Filter = {
|
|
11
11
|
type?: 'select' | 'checkboxes';
|
|
12
12
|
title: string;
|
|
13
|
+
titleTranslationKey?: string;
|
|
13
14
|
property: string;
|
|
14
15
|
parentFilter?: string;
|
|
15
16
|
missingCategoryName?: string;
|
|
17
|
+
missingCategoryNameTranslationKey?: string;
|
|
16
18
|
options?: string[];
|
|
17
19
|
};
|
|
18
20
|
|
|
@@ -24,7 +26,9 @@ export type CatalogConfig = {
|
|
|
24
26
|
requiredPermission?: string;
|
|
25
27
|
separateVersions?: boolean;
|
|
26
28
|
title?: string;
|
|
29
|
+
titleTranslationKey?: string;
|
|
27
30
|
description?: string;
|
|
31
|
+
descriptionTranslationKey?: string;
|
|
28
32
|
};
|
|
29
33
|
|
|
30
34
|
export type ResolvedFilter = Omit<Filter, 'options'> & {
|
|
@@ -6,6 +6,7 @@ export type ResolvedNavLinkItem = {
|
|
|
6
6
|
metadata?: Record<string, unknown>;
|
|
7
7
|
link: string;
|
|
8
8
|
label: string;
|
|
9
|
+
labelTranslationKey?: string;
|
|
9
10
|
items?: ResolvedNavItem[];
|
|
10
11
|
sidebar?: ResolvedNavItem[]; // for API catalog it contains the corresponding sidebar first item
|
|
11
12
|
external?: boolean;
|
|
@@ -27,6 +28,7 @@ export type ResolvedNavGroupItem = {
|
|
|
27
28
|
metadata?: Record<string, unknown>;
|
|
28
29
|
link?: string;
|
|
29
30
|
label?: string;
|
|
31
|
+
labelTranslationKey?: string;
|
|
30
32
|
items?: ResolvedNavItem[];
|
|
31
33
|
sidebar?: ResolvedNavItem[]; // for API catalog it contains the corresponding sidebar first item
|
|
32
34
|
external?: boolean;
|
|
@@ -52,6 +54,7 @@ export type ResolvedNavItem =
|
|
|
52
54
|
type: 'separator';
|
|
53
55
|
metadata?: Record<string, unknown>;
|
|
54
56
|
label?: string;
|
|
57
|
+
labelTranslationKey?: string;
|
|
55
58
|
routeSlug?: never;
|
|
56
59
|
|
|
57
60
|
version?: string;
|
|
@@ -74,6 +77,7 @@ export type ResolvedNavItem =
|
|
|
74
77
|
routeSlug?: never;
|
|
75
78
|
|
|
76
79
|
label: string;
|
|
80
|
+
labelTranslationKey?: string;
|
|
77
81
|
link?: undefined;
|
|
78
82
|
items?: ResolvedNavItem[]; // for typescript
|
|
79
83
|
sidebar?: ResolvedNavItem[]; // for typescript
|
|
@@ -120,10 +124,13 @@ export type NavItem = {
|
|
|
120
124
|
page?: string;
|
|
121
125
|
directory?: string;
|
|
122
126
|
group?: string;
|
|
127
|
+
groupTranslationKey?: string;
|
|
123
128
|
label?: string;
|
|
129
|
+
labelTranslationKey?: string;
|
|
124
130
|
href?: never;
|
|
125
131
|
items?: NavItem[];
|
|
126
132
|
separator?: string;
|
|
133
|
+
separatorTranslationKey?: string;
|
|
127
134
|
separatorLine?: boolean;
|
|
128
135
|
version?: string;
|
|
129
136
|
menuStyle?: MenuStyle;
|