@redocly/theme 0.61.1 → 0.62.0-custom.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/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.d.ts +1 -0
- package/lib/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.js +12 -0
- package/lib/components/Badge/Badge.d.ts +2 -1
- package/lib/components/Badge/Badge.js +24 -2
- package/lib/components/Banner/Banner.js +19 -1
- package/lib/components/Banner/variables.js +1 -0
- package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
- package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +9 -6
- package/lib/components/Breadcrumbs/Breadcrumbs.js +24 -15
- package/lib/components/Buttons/AIAssistantButton.js +7 -4
- package/lib/components/Catalog/CatalogEntities.js +10 -8
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +13 -11
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +7 -5
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +9 -7
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +1 -1
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +2 -2
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +1 -1
- package/lib/components/CodeBlock/CodeBlockControls.js +8 -6
- package/lib/components/Filter/FilterCheckboxes.js +1 -1
- package/lib/components/JsonViewer/JsonViewer.js +2 -2
- package/lib/components/JsonViewer/{Helpers.js → helpers.js} +2 -1
- package/lib/components/LanguagePicker/LanguagePicker.js +1 -1
- package/lib/components/Markdown/Markdown.js +2 -2
- package/lib/components/Menu/MenuItem.js +41 -15
- package/lib/components/Navbar/NavbarItem.js +1 -1
- package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.js +12 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +6 -0
- package/lib/components/PageActions/PageActions.js +25 -8
- package/lib/components/Search/SearchAiDialog.d.ts +4 -2
- package/lib/components/Search/SearchAiDialog.js +23 -4
- package/lib/components/Search/SearchAiMessage.d.ts +4 -2
- package/lib/components/Search/SearchAiMessage.js +82 -23
- package/lib/components/Search/SearchDialog.js +50 -25
- package/lib/components/Select/variables.js +2 -2
- package/lib/components/SvgViewer/SvgViewer.d.ts +15 -0
- package/lib/components/SvgViewer/SvgViewer.js +312 -0
- package/lib/components/SvgViewer/variables.d.ts +1 -0
- package/lib/components/SvgViewer/variables.dark.d.ts +1 -0
- package/lib/components/SvgViewer/variables.dark.js +8 -0
- package/lib/components/SvgViewer/variables.js +17 -0
- package/lib/components/Tag/Tag.js +1 -1
- package/lib/components/Tag/variables.dark.js +6 -0
- package/lib/components/Tag/variables.js +6 -0
- package/lib/components/Tooltip/Tooltip.d.ts +2 -3
- package/lib/components/Tooltip/Tooltip.js +66 -113
- package/lib/components/Tooltip/variables.dark.js +4 -0
- package/lib/components/Tooltip/variables.js +3 -3
- package/lib/components/UserMenu/LoginButton.d.ts +8 -2
- package/lib/components/UserMenu/LoginButton.js +4 -3
- package/lib/core/constants/search.d.ts +5 -1
- package/lib/core/constants/search.js +24 -1
- package/lib/core/hooks/search/use-search-dialog.js +2 -2
- package/lib/core/hooks/use-color-switcher.js +3 -1
- package/lib/core/hooks/use-mcp-config.js +2 -1
- package/lib/core/hooks/use-modal-scroll-lock.js +24 -10
- package/lib/core/hooks/use-outside-click.d.ts +3 -1
- package/lib/core/hooks/use-outside-click.js +8 -4
- package/lib/core/hooks/use-page-actions.d.ts +1 -1
- package/lib/core/hooks/use-page-actions.js +44 -11
- package/lib/core/hooks/use-product-picker.js +1 -1
- package/lib/core/hooks/use-unique-svg-ids.d.ts +6 -0
- package/lib/core/hooks/use-unique-svg-ids.js +15 -0
- package/lib/core/openapi/index.d.ts +1 -0
- package/lib/core/openapi/index.js +3 -1
- package/lib/core/styles/dark.js +2 -0
- package/lib/core/styles/global.js +31 -15
- package/lib/core/types/catalog.d.ts +1 -1
- package/lib/core/types/hooks.d.ts +23 -2
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +24 -0
- package/lib/core/types/search.js +9 -1
- package/lib/core/utils/content-segments.d.ts +2 -0
- package/lib/core/utils/content-segments.js +22 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/transform-revisions-to-version-history.js +8 -51
- package/lib/ext/process-scorecard.d.ts +5 -0
- package/lib/ext/process-scorecard.js +11 -0
- package/lib/icons/FitToViewIcon/FitToViewIcon.d.ts +9 -0
- package/lib/icons/FitToViewIcon/FitToViewIcon.js +25 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +8 -0
- package/lib/layouts/DocumentationLayout.js +4 -25
- package/lib/layouts/DocumentationLayoutBottom.d.ts +11 -0
- package/lib/layouts/DocumentationLayoutBottom.js +28 -0
- package/lib/layouts/DocumentationLayoutTop.d.ts +13 -0
- package/lib/layouts/DocumentationLayoutTop.js +33 -0
- package/lib/layouts/Forbidden.js +22 -18
- package/lib/markdoc/components/Cards/Card.js +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
- package/lib/markdoc/components/Heading/Heading.js +40 -2
- package/lib/markdoc/components/LoginButton/LoginButton.d.ts +9 -0
- package/lib/markdoc/components/LoginButton/LoginButton.js +48 -0
- package/lib/markdoc/components/Mermaid/Mermaid.js +70 -2
- package/lib/markdoc/components/default.d.ts +1 -0
- package/lib/markdoc/components/default.js +1 -0
- package/lib/markdoc/default.d.ts +6 -0
- package/lib/markdoc/default.js +2 -0
- package/lib/markdoc/tags/login-button.d.ts +2 -0
- package/lib/markdoc/tags/login-button.js +32 -0
- package/package.json +8 -8
- package/src/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.tsx +10 -0
- package/src/components/Badge/Badge.tsx +18 -2
- package/src/components/Banner/Banner.tsx +23 -1
- package/src/components/Banner/variables.ts +1 -0
- package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -3
- package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +11 -8
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +24 -15
- package/src/components/Buttons/AIAssistantButton.tsx +7 -4
- package/src/components/Catalog/CatalogEntities.tsx +10 -8
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +1 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +13 -11
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +7 -5
- package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +9 -7
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +1 -2
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +9 -5
- package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +3 -1
- package/src/components/CodeBlock/CodeBlockControls.tsx +16 -10
- package/src/components/Filter/FilterCheckboxes.tsx +1 -1
- package/src/components/JsonViewer/JsonViewer.tsx +1 -2
- package/src/components/JsonViewer/{Helpers.tsx → helpers.tsx} +1 -0
- package/src/components/LanguagePicker/LanguagePicker.tsx +1 -1
- package/src/components/Markdown/Markdown.tsx +2 -2
- package/src/components/Menu/MenuItem.tsx +61 -16
- package/src/components/Navbar/NavbarItem.tsx +3 -1
- package/src/components/OpenApiDocs/hooks/AdditionalOverviewInfo.tsx +10 -0
- package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +2 -0
- package/src/components/PageActions/PageActions.tsx +38 -15
- package/src/components/Search/SearchAiDialog.tsx +31 -2
- package/src/components/Search/SearchAiMessage.tsx +103 -17
- package/src/components/Search/SearchDialog.tsx +70 -37
- package/src/components/Select/variables.ts +2 -2
- package/src/components/SvgViewer/SvgViewer.tsx +405 -0
- package/src/components/SvgViewer/variables.dark.ts +5 -0
- package/src/components/SvgViewer/variables.ts +14 -0
- package/src/components/Tag/Tag.tsx +2 -1
- package/src/components/Tag/variables.dark.ts +6 -0
- package/src/components/Tag/variables.ts +6 -0
- package/src/components/Tooltip/Tooltip.tsx +77 -120
- package/src/components/Tooltip/variables.dark.ts +4 -0
- package/src/components/Tooltip/variables.ts +3 -3
- package/src/components/UserMenu/LoginButton.tsx +23 -8
- package/src/core/constants/search.ts +27 -1
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +10 -1
- package/src/core/hooks/search/use-search-dialog.ts +2 -2
- package/src/core/hooks/use-color-switcher.ts +3 -1
- package/src/core/hooks/use-mcp-config.ts +2 -1
- package/src/core/hooks/use-modal-scroll-lock.ts +29 -10
- package/src/core/hooks/use-outside-click.ts +16 -5
- package/src/core/hooks/use-page-actions.ts +66 -25
- package/src/core/hooks/use-product-picker.ts +1 -1
- package/src/core/hooks/use-unique-svg-ids.ts +12 -0
- package/src/core/openapi/index.ts +1 -0
- package/src/core/styles/dark.ts +2 -0
- package/src/core/styles/global.ts +31 -15
- package/src/core/types/catalog.ts +1 -1
- package/src/core/types/hooks.ts +29 -1
- package/src/core/types/l10n.ts +12 -1
- package/src/core/types/search.ts +19 -0
- package/src/core/utils/content-segments.ts +27 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/transform-revisions-to-version-history.ts +8 -80
- package/src/ext/process-scorecard.ts +14 -0
- package/src/icons/FitToViewIcon/FitToViewIcon.tsx +26 -0
- package/src/index.ts +8 -0
- package/src/layouts/DocumentationLayout.tsx +4 -30
- package/src/layouts/DocumentationLayoutBottom.tsx +42 -0
- package/src/layouts/DocumentationLayoutTop.tsx +52 -0
- package/src/layouts/Forbidden.tsx +36 -21
- package/src/markdoc/components/Cards/Card.tsx +1 -0
- package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
- package/src/markdoc/components/Heading/Heading.tsx +52 -4
- package/src/markdoc/components/LoginButton/LoginButton.tsx +38 -0
- package/src/markdoc/components/Mermaid/Mermaid.tsx +57 -8
- package/src/markdoc/components/default.ts +1 -0
- package/src/markdoc/default.ts +2 -0
- package/src/markdoc/tags/login-button.ts +30 -0
- package/lib/components/Tooltip/TooltipWrapper.d.ts +0 -12
- package/lib/components/Tooltip/TooltipWrapper.js +0 -34
- package/src/components/Tooltip/TooltipWrapper.tsx +0 -70
- /package/lib/components/JsonViewer/{Helpers.d.ts → helpers.d.ts} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loginButton = void 0;
|
|
4
|
+
exports.loginButton = {
|
|
5
|
+
schema: {
|
|
6
|
+
render: 'LoginButton',
|
|
7
|
+
attributes: {
|
|
8
|
+
variant: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: 'primary',
|
|
11
|
+
matches: ['primary', 'secondary', 'outlined', 'text', 'link', 'ghost'],
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'medium',
|
|
16
|
+
matches: ['small', 'medium', 'large'],
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
type: String,
|
|
20
|
+
description: 'Custom button label text. Overrides translation.',
|
|
21
|
+
},
|
|
22
|
+
labelTranslationKey: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'userMenu.login',
|
|
25
|
+
description: 'Translation key for the button label.',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
selfClosing: true,
|
|
29
|
+
},
|
|
30
|
+
tagName: 'login-button',
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=login-button.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.0-custom.0",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@markdoc/markdoc": "0.5.2",
|
|
30
30
|
"lodash.debounce": "^4.0.8",
|
|
31
31
|
"lodash.throttle": "^4.1.1",
|
|
32
|
-
"react": "19.2.
|
|
33
|
-
"react-dom": "19.2.
|
|
34
|
-
"react-router-dom": "^6.
|
|
32
|
+
"react": "^19.2.4",
|
|
33
|
+
"react-dom": "^19.2.4",
|
|
34
|
+
"react-router-dom": "^6.30.3",
|
|
35
35
|
"styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@vitest/coverage-v8": "4.0.10",
|
|
52
52
|
"@vitest/ui": "3.2.4",
|
|
53
53
|
"concurrently": "7.6.0",
|
|
54
|
-
"react-router-dom": "^6.
|
|
54
|
+
"react-router-dom": "^6.30.3",
|
|
55
55
|
"resize-observer-polyfill": "1.5.1",
|
|
56
56
|
"rimraf": "5.0.7",
|
|
57
57
|
"styled-components": "5.3.11",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"vitest": "4.0.10",
|
|
64
64
|
"vitest-when": "0.6.2",
|
|
65
65
|
"webpack": "5.94.0",
|
|
66
|
-
"@redocly/realm-asyncapi-sdk": "0.
|
|
66
|
+
"@redocly/realm-asyncapi-sdk": "0.9.0-next.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@tanstack/react-query": "5.62.3",
|
|
@@ -81,14 +81,14 @@
|
|
|
81
81
|
"openapi-sampler": "1.6.2",
|
|
82
82
|
"react-calendar": "5.1.0",
|
|
83
83
|
"react-date-picker": "11.0.0",
|
|
84
|
-
"@redocly/config": "0.
|
|
84
|
+
"@redocly/config": "0.43.0-custom.0"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
88
88
|
"ts:check": "tsc --noEmit --skipLibCheck",
|
|
89
89
|
"clean": "rimraf lib",
|
|
90
90
|
"compile": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
91
|
-
"build": "
|
|
91
|
+
"build": "pnpm run clean && pnpm run compile",
|
|
92
92
|
"test": "vitest run",
|
|
93
93
|
"test:update": "vitest run --update",
|
|
94
94
|
"test:watch": "vitest",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// interface AfterAsyncApiChannelDescriptionProps {
|
|
2
|
+
// channel: any;
|
|
3
|
+
// }
|
|
4
|
+
|
|
5
|
+
// export function AfterAsyncApiChannelDescription(_props: AfterAsyncApiChannelDescriptionProps) {
|
|
6
|
+
// return null;
|
|
7
|
+
// }
|
|
8
|
+
|
|
9
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
10
|
+
export const AfterAsyncApiChannelDescription: any = null;
|
|
@@ -3,15 +3,23 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import type { PropsWithChildren, JSX } from 'react';
|
|
5
5
|
|
|
6
|
+
import { GenericIcon } from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
7
|
+
|
|
6
8
|
export type BadgeProps = PropsWithChildren<{
|
|
7
9
|
deprecated?: boolean;
|
|
8
10
|
color?: string;
|
|
9
11
|
key?: string;
|
|
10
12
|
className?: string;
|
|
13
|
+
icon?: string;
|
|
11
14
|
}>;
|
|
12
15
|
|
|
13
|
-
export function Badge(props: BadgeProps): JSX.Element {
|
|
14
|
-
return
|
|
16
|
+
export function Badge({ icon, children, ...props }: BadgeProps): JSX.Element {
|
|
17
|
+
return (
|
|
18
|
+
<BadgeComponent {...props} data-component-name="Badge/Badge">
|
|
19
|
+
{icon ? <BadgeIcon icon={icon} /> : null}
|
|
20
|
+
{children}
|
|
21
|
+
</BadgeComponent>
|
|
22
|
+
);
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
const BadgeComponent = styled.span<BadgeProps>`
|
|
@@ -34,3 +42,11 @@ const BadgeComponent = styled.span<BadgeProps>`
|
|
|
34
42
|
border-radius: var(--badge-deprecated-border-radius);
|
|
35
43
|
`}
|
|
36
44
|
`;
|
|
45
|
+
|
|
46
|
+
const BadgeIcon = styled(GenericIcon)`
|
|
47
|
+
--icon-width: var(--font-size-sm);
|
|
48
|
+
--icon-height: var(--font-size-sm);
|
|
49
|
+
margin-right: var(--spacing-xxs);
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
vertical-align: middle;
|
|
52
|
+
`;
|
|
@@ -5,10 +5,13 @@ import type { BannerConfig } from '@redocly/config';
|
|
|
5
5
|
import type { JSX } from 'react';
|
|
6
6
|
|
|
7
7
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
8
|
+
import { getNavbarElement } from '@redocly/theme/core/utils';
|
|
8
9
|
import { Markdown } from '@redocly/theme/components/Markdown/Markdown';
|
|
9
10
|
import { CloseIcon } from '@redocly/theme/icons/CloseIcon/CloseIcon';
|
|
10
11
|
import { Button } from '@redocly/theme/components/Button/Button';
|
|
11
12
|
|
|
13
|
+
const ANIMATION_DURATION = 0.4;
|
|
14
|
+
|
|
12
15
|
type BannerColor = 'info' | 'success' | 'warning' | 'error';
|
|
13
16
|
|
|
14
17
|
type BannerProps = {
|
|
@@ -67,6 +70,25 @@ export function Banner({ className }: BannerProps): JSX.Element | null {
|
|
|
67
70
|
|
|
68
71
|
updateHeight();
|
|
69
72
|
|
|
73
|
+
if (window.location.hash) {
|
|
74
|
+
setTimeout(
|
|
75
|
+
() => {
|
|
76
|
+
const hash = window.location.hash;
|
|
77
|
+
const el = document.getElementById(hash.slice(1));
|
|
78
|
+
if (el) {
|
|
79
|
+
const navbar = getNavbarElement();
|
|
80
|
+
const navbarHeight = navbar?.getBoundingClientRect().height ?? 0;
|
|
81
|
+
const elementTop = el.getBoundingClientRect().top + window.scrollY;
|
|
82
|
+
const scrollPosition = elementTop - navbarHeight;
|
|
83
|
+
if (Math.abs(window.scrollY - scrollPosition) > 1) {
|
|
84
|
+
window.scrollTo({ top: scrollPosition });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
ANIMATION_DURATION * 1000 + 100,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
70
92
|
const resizeObserver = new ResizeObserver(updateHeight);
|
|
71
93
|
resizeObserver.observe(bannerElement);
|
|
72
94
|
|
|
@@ -154,7 +176,7 @@ const BannerWrapper = styled.div<{ $color?: BannerColor; $isVisible?: boolean }>
|
|
|
154
176
|
width: 100%;
|
|
155
177
|
z-index: var(--z-index-overlay);
|
|
156
178
|
transform: ${({ $isVisible }) => ($isVisible ? 'translateY(0)' : 'translateY(-100%)')};
|
|
157
|
-
transition: transform
|
|
179
|
+
transition: transform ${ANIMATION_DURATION}s ease-out;
|
|
158
180
|
${({ $color }) =>
|
|
159
181
|
$color &&
|
|
160
182
|
css`
|
|
@@ -4,6 +4,7 @@ export const banner = css`
|
|
|
4
4
|
/**
|
|
5
5
|
* @tokens Banner
|
|
6
6
|
*/
|
|
7
|
+
--banner-height: 0px; /* default 0px so calc formulas work on page load */
|
|
7
8
|
--banner-button-size: 22px;
|
|
8
9
|
--banner-button-padding: 3px; // @presenter Spacing
|
|
9
10
|
--banner-button-font-size: var(--font-size-base);
|
|
@@ -4,7 +4,7 @@ import styled, { css } from 'styled-components';
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
5
5
|
|
|
6
6
|
import { Link } from '@redocly/theme/components/Link/Link';
|
|
7
|
-
import {
|
|
7
|
+
import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
8
8
|
import { BreadcrumbIcon } from '@redocly/theme/components/Breadcrumbs/BreadcrumbIcon';
|
|
9
9
|
import { trimText } from '@redocly/theme/core/utils';
|
|
10
10
|
import { BREADCRUMB_MAX_LENGTH } from '@redocly/theme/core/constants';
|
|
@@ -48,9 +48,9 @@ export function Breadcrumb({ label, link, isActive, onClick, icon }: BreadcrumbP
|
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
return isTruncated ? (
|
|
51
|
-
<
|
|
51
|
+
<Tooltip tip={label} placement="bottom">
|
|
52
52
|
{breadcrumbContent}
|
|
53
|
-
</
|
|
53
|
+
</Tooltip>
|
|
54
54
|
) : (
|
|
55
55
|
breadcrumbContent
|
|
56
56
|
);
|
|
@@ -8,7 +8,7 @@ import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
|
8
8
|
import { Dropdown } from '@redocly/theme/components/Dropdown/Dropdown';
|
|
9
9
|
import { DropdownMenu } from '@redocly/theme/components/Dropdown/DropdownMenu';
|
|
10
10
|
import { DropdownMenuItem } from '@redocly/theme/components/Dropdown/DropdownMenuItem';
|
|
11
|
-
import {
|
|
11
|
+
import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
12
12
|
import { GenericIcon } from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
13
13
|
import { BREADCRUMB_MAX_LENGTH } from '@redocly/theme/core/constants';
|
|
14
14
|
import { BreadcrumbIcon } from '@redocly/theme/components/Breadcrumbs/BreadcrumbIcon';
|
|
@@ -39,9 +39,9 @@ export function BreadcrumbDropdown({
|
|
|
39
39
|
const isTruncated = label.length > BREADCRUMB_MAX_LENGTH;
|
|
40
40
|
|
|
41
41
|
const triggerContent = isTruncated ? (
|
|
42
|
-
<
|
|
42
|
+
<Tooltip tip={label} placement="bottom">
|
|
43
43
|
<TriggerContentWrapper>{children}</TriggerContentWrapper>
|
|
44
|
-
</
|
|
44
|
+
</Tooltip>
|
|
45
45
|
) : (
|
|
46
46
|
children
|
|
47
47
|
);
|
|
@@ -66,11 +66,14 @@ export function BreadcrumbDropdown({
|
|
|
66
66
|
key={index}
|
|
67
67
|
onAction={() => {
|
|
68
68
|
onItemClick?.(item, index);
|
|
69
|
-
telemetry.sendBreadcrumbClickedMessage(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
telemetry.sendBreadcrumbClickedMessage([
|
|
70
|
+
{
|
|
71
|
+
object: 'breadcrumb',
|
|
72
|
+
link: item.link,
|
|
73
|
+
position: index + 1,
|
|
74
|
+
totalBreadcrumbs: items.length,
|
|
75
|
+
},
|
|
76
|
+
]);
|
|
74
77
|
}}
|
|
75
78
|
$hasLink={hasLink}
|
|
76
79
|
to={item.link}
|
|
@@ -66,11 +66,14 @@ export function Breadcrumbs(props: {
|
|
|
66
66
|
label={translatedLabel}
|
|
67
67
|
items={siblingsWithActive}
|
|
68
68
|
onItemClick={(item, itemIdx) =>
|
|
69
|
-
telemetry.sendBreadcrumbClickedMessage(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
telemetry.sendBreadcrumbClickedMessage([
|
|
70
|
+
{
|
|
71
|
+
object: 'breadcrumb',
|
|
72
|
+
link: item.link,
|
|
73
|
+
position: itemIdx + 1,
|
|
74
|
+
totalBreadcrumbs: siblingsWithActive.length,
|
|
75
|
+
},
|
|
76
|
+
])
|
|
74
77
|
}
|
|
75
78
|
>
|
|
76
79
|
<BreadcrumbIcon icon={breadcrumb.icon} />
|
|
@@ -87,11 +90,14 @@ export function Breadcrumbs(props: {
|
|
|
87
90
|
isActive={isActive}
|
|
88
91
|
icon={breadcrumb.icon}
|
|
89
92
|
onClick={() =>
|
|
90
|
-
telemetry.sendBreadcrumbClickedMessage(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
telemetry.sendBreadcrumbClickedMessage([
|
|
94
|
+
{
|
|
95
|
+
object: 'breadcrumb',
|
|
96
|
+
link: breadcrumb.link,
|
|
97
|
+
position: idx + 1,
|
|
98
|
+
totalBreadcrumbs: breadcrumbs.length,
|
|
99
|
+
},
|
|
100
|
+
])
|
|
95
101
|
}
|
|
96
102
|
/>
|
|
97
103
|
);
|
|
@@ -112,11 +118,14 @@ export function Breadcrumbs(props: {
|
|
|
112
118
|
label="..."
|
|
113
119
|
items={collapsedBreadcrumbs}
|
|
114
120
|
onItemClick={(item, itemIdx) =>
|
|
115
|
-
telemetry.sendBreadcrumbClickedMessage(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
telemetry.sendBreadcrumbClickedMessage([
|
|
122
|
+
{
|
|
123
|
+
object: 'breadcrumb',
|
|
124
|
+
link: item.link,
|
|
125
|
+
position: itemIdx + 1,
|
|
126
|
+
totalBreadcrumbs: breadcrumbs.length,
|
|
127
|
+
},
|
|
128
|
+
])
|
|
120
129
|
}
|
|
121
130
|
>
|
|
122
131
|
...
|
|
@@ -77,9 +77,12 @@ export function AIAssistantButton() {
|
|
|
77
77
|
|
|
78
78
|
const handleOpen = () => {
|
|
79
79
|
setIsOpen(true);
|
|
80
|
-
telemetry.sendSearchAiOpenedMessage(
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
telemetry.sendSearchAiOpenedMessage([
|
|
81
|
+
{
|
|
82
|
+
object: 'search',
|
|
83
|
+
method: 'ai_trigger_button',
|
|
84
|
+
},
|
|
85
|
+
]);
|
|
83
86
|
};
|
|
84
87
|
|
|
85
88
|
const handleClose = () => {
|
|
@@ -108,7 +111,7 @@ export function AIAssistantButton() {
|
|
|
108
111
|
const StyledAIAssistantButton = styled(Button)<{ $inputType?: AIAssistantButtonType }>`
|
|
109
112
|
position: fixed;
|
|
110
113
|
bottom: var(--ai-assistant-button-bottom);
|
|
111
|
-
right: var(--ai-assistant-button-right);
|
|
114
|
+
right: calc(var(--ai-assistant-button-right) + var(--modal-scrollbar-width, 0px));
|
|
112
115
|
${({ $inputType }) =>
|
|
113
116
|
$inputType === 'icon'
|
|
114
117
|
? `
|
|
@@ -76,14 +76,16 @@ export function CatalogEntities(props: CatalogEntitiesProps): JSX.Element {
|
|
|
76
76
|
|
|
77
77
|
const onRowClick = (entity: BffCatalogEntity) => {
|
|
78
78
|
if (searchQuery) {
|
|
79
|
-
telemetry.sendCatalogEntitiesListSearchResultClickedMessage(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
telemetry.sendCatalogEntitiesListSearchResultClickedMessage([
|
|
80
|
+
{
|
|
81
|
+
id: entity.id,
|
|
82
|
+
object: 'catalog_entity',
|
|
83
|
+
uri: getEntityDetailsLink(entity),
|
|
84
|
+
query: searchQuery,
|
|
85
|
+
entityKey: entity.key,
|
|
86
|
+
entityType: entity.type,
|
|
87
|
+
},
|
|
88
|
+
]);
|
|
87
89
|
}
|
|
88
90
|
};
|
|
89
91
|
|
|
@@ -20,7 +20,7 @@ import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
|
20
20
|
import { CatalogEntitySchema } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntitySchema';
|
|
21
21
|
import { CatalogEntityMethodAndPath } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath';
|
|
22
22
|
import { CatalogEntityRelationsGraph } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy';
|
|
23
|
-
import { CatalogEntityHistorySidebar } from '@redocly/theme';
|
|
23
|
+
import { CatalogEntityHistorySidebar } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar';
|
|
24
24
|
|
|
25
25
|
export type CatalogEntityProps = {
|
|
26
26
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx
CHANGED
|
@@ -7,8 +7,7 @@ import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
|
7
7
|
import { MenuContainer } from '@redocly/theme/components/Menu/MenuContainer';
|
|
8
8
|
import { transformRevisionsToVersionHistory } from '@redocly/theme/core/utils';
|
|
9
9
|
import { DEFAULT_LOCALE_PLACEHOLDER } from '@redocly/theme/core/constants';
|
|
10
|
-
|
|
11
|
-
import { CatalogEntityVersionItem } from './CatalogEntityVersionItem';
|
|
10
|
+
import { CatalogEntityVersionItem } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem';
|
|
12
11
|
|
|
13
12
|
export type CatalogHistorySidebarProps = {
|
|
14
13
|
entityKey: string;
|
|
@@ -2,7 +2,7 @@ import React, { JSX } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
4
4
|
import { TagsIcon } from '@redocly/theme/icons/TagsIcon/TagsIcon';
|
|
5
|
-
import { CatalogTagsWithTooltip } from '@redocly/theme';
|
|
5
|
+
import { CatalogTagsWithTooltip } from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
|
|
6
6
|
import { CatalogEntityPropertyCard } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard';
|
|
7
7
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
8
8
|
|
package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx
CHANGED
|
@@ -62,17 +62,19 @@ export function CatalogEntityRelationsTable({
|
|
|
62
62
|
|
|
63
63
|
const onRowClick = (relatedEntity: BffCatalogRelatedEntity) => {
|
|
64
64
|
if (searchQuery) {
|
|
65
|
-
telemetry.sendCatalogEntitiesRelatedEntitiesListSearchResultClickMessage(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
telemetry.sendCatalogEntitiesRelatedEntitiesListSearchResultClickMessage([
|
|
66
|
+
{
|
|
67
|
+
id: relatedEntity.id,
|
|
68
|
+
object: 'catalog_entity',
|
|
69
|
+
uri: getEntityDetailsLink(relatedEntity),
|
|
70
|
+
query: searchQuery,
|
|
71
|
+
entityKey: entity.key,
|
|
72
|
+
entityType: entity.type,
|
|
73
|
+
relationType: reverseRelationMap[relatedEntity.relationType],
|
|
74
|
+
relatedEntityKey: relatedEntity.key,
|
|
75
|
+
relatedEntityType: relatedEntity.type,
|
|
76
|
+
},
|
|
77
|
+
]);
|
|
76
78
|
}
|
|
77
79
|
};
|
|
78
80
|
|
|
@@ -52,11 +52,13 @@ export function CatalogEntitySchema({
|
|
|
52
52
|
iconPosition="right"
|
|
53
53
|
size="medium"
|
|
54
54
|
onCopyClick={() =>
|
|
55
|
-
telemetry.sendCatalogEntitiesCopyDataSchemaClickedMessage(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
telemetry.sendCatalogEntitiesCopyDataSchemaClickedMessage([
|
|
56
|
+
{
|
|
57
|
+
id: entity.id,
|
|
58
|
+
object: 'catalog_entity',
|
|
59
|
+
uri: getEntityDetailsLink(entity),
|
|
60
|
+
},
|
|
61
|
+
])
|
|
60
62
|
}
|
|
61
63
|
></CopyButton>
|
|
62
64
|
)}
|
|
@@ -102,13 +102,15 @@ export function CatalogFilterCheckboxes({
|
|
|
102
102
|
role="link"
|
|
103
103
|
onClick={() => {
|
|
104
104
|
filter.toggleOption(value);
|
|
105
|
-
telemetry.sendCatalogEntitiesFilterCheckboxToggledMessage(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
telemetry.sendCatalogEntitiesFilterCheckboxToggledMessage([
|
|
106
|
+
{
|
|
107
|
+
id: filter.property + '--' + value,
|
|
108
|
+
object: 'checkbox',
|
|
109
|
+
uri: window.location.href,
|
|
110
|
+
category: filter.property,
|
|
111
|
+
value: value,
|
|
112
|
+
},
|
|
113
|
+
]);
|
|
112
114
|
}}
|
|
113
115
|
>
|
|
114
116
|
<CheckboxIcon
|
|
@@ -10,8 +10,7 @@ import { CatalogEntityCell } from '@redocly/theme/components/Catalog/CatalogTabl
|
|
|
10
10
|
import { CatalogTagsCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTagsCell';
|
|
11
11
|
import { useCatalogEntityDetails } from '@redocly/theme/core/hooks';
|
|
12
12
|
import { CatalogEntityTypeTag } from '@redocly/theme/components/Catalog/CatalogEntityTypeTag';
|
|
13
|
-
|
|
14
|
-
import { Link } from '../../Link/Link';
|
|
13
|
+
import { Link } from '@redocly/theme/components/Link/Link';
|
|
15
14
|
|
|
16
15
|
export type BaseEntity = {
|
|
17
16
|
id: string;
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import { CATALOG_TAG_MAX_LENGTH } from '@redocly/theme/core/constants';
|
|
5
5
|
import { Tag, TagProps } from '@redocly/theme/components/Tag/Tag';
|
|
6
|
-
import {
|
|
6
|
+
import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
7
7
|
import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
|
|
8
8
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
9
9
|
|
|
@@ -27,8 +27,12 @@ export function CatalogTagsWithTooltip({
|
|
|
27
27
|
if (showPlaceholder) {
|
|
28
28
|
return (
|
|
29
29
|
<CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
<Tag
|
|
31
|
+
variant="outline"
|
|
32
|
+
style={{ backgroundColor: 'var(--catalog-tags-placeholder-bg-color)' }}
|
|
33
|
+
color="grey"
|
|
34
|
+
// eslint-disable-next-line theme/require-translate
|
|
35
|
+
>
|
|
32
36
|
N/A
|
|
33
37
|
</Tag>
|
|
34
38
|
</CatalogTagsWrapper>
|
|
@@ -53,7 +57,7 @@ export function CatalogTagsWithTooltip({
|
|
|
53
57
|
const remainingCount = items.length - itemsToShow;
|
|
54
58
|
|
|
55
59
|
return (
|
|
56
|
-
<
|
|
60
|
+
<Tooltip tip={items.join(', ')} placement="bottom" className="catalog" width="400px">
|
|
57
61
|
<CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
|
|
58
62
|
{displayedItems.map((item, index) => (
|
|
59
63
|
<Tag
|
|
@@ -70,7 +74,7 @@ export function CatalogTagsWithTooltip({
|
|
|
70
74
|
+{remainingCount} {translate('catalog.tags.more', 'more')}
|
|
71
75
|
</MoreTagsButton>
|
|
72
76
|
</CatalogTagsWrapper>
|
|
73
|
-
</
|
|
77
|
+
</Tooltip>
|
|
74
78
|
);
|
|
75
79
|
}
|
|
76
80
|
|
|
@@ -52,7 +52,9 @@ function ScorecardBadge(props: {
|
|
|
52
52
|
return (
|
|
53
53
|
<Link to={slug}>
|
|
54
54
|
<Tag
|
|
55
|
-
onClick={() =>
|
|
55
|
+
onClick={() =>
|
|
56
|
+
telemetry.sendScorecardLinkClickedMessage([{ object: 'link', action: 'click' }])
|
|
57
|
+
}
|
|
56
58
|
withStatusDot
|
|
57
59
|
statusDotColor={`var(${colorVariable})`}
|
|
58
60
|
>
|
|
@@ -6,7 +6,7 @@ import type { CodeBlockItems } from '@redocly/theme/components/CodeBlock/CodeBlo
|
|
|
6
6
|
|
|
7
7
|
import { CodeBlockTabs } from '@redocly/theme/components/CodeBlock/CodeBlockTabs';
|
|
8
8
|
import { CopyButton } from '@redocly/theme/components/Buttons/CopyButton';
|
|
9
|
-
import {
|
|
9
|
+
import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
10
10
|
import { useThemeHooks, useThemeConfig } from '@redocly/theme/core/hooks';
|
|
11
11
|
import { DeselectIcon } from '@redocly/theme/icons/DeselectIcon/DeselectIcon';
|
|
12
12
|
import { MaximizeIcon } from '@redocly/theme/icons/MaximizeIcon/MaximizeIcon';
|
|
@@ -86,9 +86,10 @@ export function CodeBlockControls({
|
|
|
86
86
|
<ControlsWrapper>
|
|
87
87
|
{dropdown && <CodeBlockDropdown {...dropdown} />}
|
|
88
88
|
{report && !report.hidden && !report?.props?.hide ? (
|
|
89
|
-
<
|
|
89
|
+
<Tooltip
|
|
90
90
|
tip={translate('codeSnippet.report.tooltipText', 'Report a problem')}
|
|
91
91
|
placement="top"
|
|
92
|
+
arrowPosition="right"
|
|
92
93
|
>
|
|
93
94
|
<ControlButton
|
|
94
95
|
variant="text"
|
|
@@ -99,13 +100,14 @@ export function CodeBlockControls({
|
|
|
99
100
|
>
|
|
100
101
|
{controlsType != 'icon' && (report.props?.buttonText || 'Report')}
|
|
101
102
|
</ControlButton>
|
|
102
|
-
</
|
|
103
|
+
</Tooltip>
|
|
103
104
|
) : null}
|
|
104
105
|
|
|
105
106
|
{expand && !codeSnippet?.expand?.hide ? (
|
|
106
|
-
<
|
|
107
|
+
<Tooltip
|
|
107
108
|
tip={translate('codeSnippet.expand.tooltipText', 'Expand all')}
|
|
108
109
|
placement="top"
|
|
110
|
+
arrowPosition="right"
|
|
109
111
|
>
|
|
110
112
|
<ControlButton
|
|
111
113
|
variant="text"
|
|
@@ -116,13 +118,14 @@ export function CodeBlockControls({
|
|
|
116
118
|
>
|
|
117
119
|
{controlsType !== 'icon' && (expand?.label || 'Expand all')}
|
|
118
120
|
</ControlButton>
|
|
119
|
-
</
|
|
121
|
+
</Tooltip>
|
|
120
122
|
) : null}
|
|
121
123
|
|
|
122
124
|
{collapse && !codeSnippet?.collapse?.hide ? (
|
|
123
|
-
<
|
|
125
|
+
<Tooltip
|
|
124
126
|
tip={translate('codeSnippet.collapse.tooltipText', 'Collapse all')}
|
|
125
127
|
placement="top"
|
|
128
|
+
arrowPosition="right"
|
|
126
129
|
>
|
|
127
130
|
<ControlButton
|
|
128
131
|
variant="text"
|
|
@@ -133,7 +136,7 @@ export function CodeBlockControls({
|
|
|
133
136
|
>
|
|
134
137
|
{controlsType !== 'icon' && (expand?.label || 'Collapse all')}
|
|
135
138
|
</ControlButton>
|
|
136
|
-
</
|
|
139
|
+
</Tooltip>
|
|
137
140
|
) : null}
|
|
138
141
|
|
|
139
142
|
{select ? (
|
|
@@ -161,9 +164,10 @@ export function CodeBlockControls({
|
|
|
161
164
|
) : null}
|
|
162
165
|
|
|
163
166
|
{copy && !codeSnippet?.copy?.hide ? (
|
|
164
|
-
<
|
|
167
|
+
<Tooltip
|
|
165
168
|
tip={translate('codeSnippet.copy.tooltipText', 'Copy to clipboard')}
|
|
166
169
|
placement="top"
|
|
170
|
+
arrowPosition="right"
|
|
167
171
|
>
|
|
168
172
|
<StyledCopyButton
|
|
169
173
|
data={copy.data}
|
|
@@ -178,11 +182,13 @@ export function CodeBlockControls({
|
|
|
178
182
|
if (copy?.onClick) {
|
|
179
183
|
copy?.onClick?.();
|
|
180
184
|
} else {
|
|
181
|
-
telemetry.sendCopyCodeSnippetClickedMessage(
|
|
185
|
+
telemetry.sendCopyCodeSnippetClickedMessage([
|
|
186
|
+
{ object: 'code_snippet', snippetType: 'copy' },
|
|
187
|
+
]);
|
|
182
188
|
}
|
|
183
189
|
}}
|
|
184
190
|
/>
|
|
185
|
-
</
|
|
191
|
+
</Tooltip>
|
|
186
192
|
) : null}
|
|
187
193
|
</ControlsWrapper>
|
|
188
194
|
</>
|
|
@@ -36,7 +36,7 @@ export function FilterCheckboxes({
|
|
|
36
36
|
role="link"
|
|
37
37
|
onClick={() => {
|
|
38
38
|
filter.toggleOption(value);
|
|
39
|
-
telemetry.sendFilterCheckboxToggledMessage({ id });
|
|
39
|
+
telemetry.sendFilterCheckboxToggledMessage([{ object: 'checkbox', id }]);
|
|
40
40
|
}}
|
|
41
41
|
>
|
|
42
42
|
<CheckboxIcon
|