@redocly/theme 0.61.0 → 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/Admonition/Admonition.js +14 -18
- package/lib/components/Admonition/variables.dark.d.ts +1 -0
- package/lib/components/Admonition/variables.dark.js +18 -0
- package/lib/components/Admonition/variables.js +24 -28
- 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 +5 -3
- 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.d.ts +1 -0
- package/lib/core/hooks/use-color-switcher.js +8 -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 +4 -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/icons/WarningCycleIcon/WarningCycleIcon.d.ts +9 -0
- package/lib/icons/WarningCycleIcon/WarningCycleIcon.js +24 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +9 -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 +9 -9
- package/src/components/Admonition/Admonition.tsx +14 -18
- package/src/components/Admonition/variables.dark.ts +15 -0
- package/src/components/Admonition/variables.ts +24 -28
- 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 +7 -4
- 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 +10 -2
- 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 +4 -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/icons/WarningCycleIcon/WarningCycleIcon.tsx +32 -0
- package/src/index.ts +9 -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
package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx
CHANGED
|
@@ -6,8 +6,8 @@ import { CloseIcon } from '@redocly/theme/icons/CloseIcon/CloseIcon';
|
|
|
6
6
|
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
|
-
|
|
10
|
-
import { CatalogEntityVersionItem } from '
|
|
9
|
+
import { DEFAULT_LOCALE_PLACEHOLDER } from '@redocly/theme/core/constants';
|
|
10
|
+
import { CatalogEntityVersionItem } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem';
|
|
11
11
|
|
|
12
12
|
export type CatalogHistorySidebarProps = {
|
|
13
13
|
entityKey: string;
|
|
@@ -31,15 +31,18 @@ export function CatalogEntityHistorySidebar({
|
|
|
31
31
|
|
|
32
32
|
const { items: revisions } = useFetchCatalogEntityRevisions({ entityKey });
|
|
33
33
|
|
|
34
|
+
const normalizedLocale =
|
|
35
|
+
currentLocale && currentLocale !== DEFAULT_LOCALE_PLACEHOLDER ? currentLocale : 'en-US';
|
|
36
|
+
|
|
34
37
|
const versionHistoryItems = useMemo(
|
|
35
38
|
() =>
|
|
36
39
|
transformRevisionsToVersionHistory({
|
|
37
40
|
revisions,
|
|
38
41
|
currentRevisionDate: revision,
|
|
39
42
|
currentVersion: version,
|
|
40
|
-
locale:
|
|
43
|
+
locale: normalizedLocale,
|
|
41
44
|
}),
|
|
42
|
-
[revisions, revision, version,
|
|
45
|
+
[revisions, revision, version, normalizedLocale],
|
|
43
46
|
);
|
|
44
47
|
const activeRevisionLabel = useMemo(() => {
|
|
45
48
|
const itemWithActiveRevision = versionHistoryItems.find((item) =>
|
|
@@ -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
|
|
@@ -5,8 +5,7 @@ import type { JSX } from 'react';
|
|
|
5
5
|
import type { CodeBlockControlsProps } from '@redocly/theme/components/CodeBlock/CodeBlockControls';
|
|
6
6
|
|
|
7
7
|
import { CodeBlock } from '@redocly/theme/components/CodeBlock/CodeBlock';
|
|
8
|
-
|
|
9
|
-
import { JsonValue } from './Helpers';
|
|
8
|
+
import { JsonValue } from '@redocly/theme/components/JsonViewer/helpers';
|
|
10
9
|
|
|
11
10
|
export type PanelType = 'request' | 'responses' | 'request-samples' | 'response-samples';
|
|
12
11
|
|
|
@@ -40,7 +40,7 @@ export function LanguagePicker(props: LanguagePickerProps): JSX.Element | null {
|
|
|
40
40
|
onAction: () => {
|
|
41
41
|
setLocale(locale.code);
|
|
42
42
|
props.onChangeLanguage(locale.code);
|
|
43
|
-
telemetry.sendLanguagePickerLocaleChangedMessage({ locale: locale.code });
|
|
43
|
+
telemetry.sendLanguagePickerLocaleChangedMessage([{ object: 'locale', locale: locale.code }]);
|
|
44
44
|
},
|
|
45
45
|
active: locale.code === currentLocale.code,
|
|
46
46
|
suffix: locale.code === currentLocale.code && <CheckmarkIcon />,
|
|
@@ -58,7 +58,7 @@ export const Markdown = styled.main.attrs<{
|
|
|
58
58
|
${markdownLinksCss}
|
|
59
59
|
|
|
60
60
|
a[name], [id] {
|
|
61
|
-
scroll-margin-top: var(--navbar-height);
|
|
61
|
+
scroll-margin-top: calc(var(--navbar-height) + var(--banner-height));
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
img,
|
|
@@ -76,7 +76,7 @@ export const Markdown = styled.main.attrs<{
|
|
|
76
76
|
font-family: var(--heading-font-family);
|
|
77
77
|
position: relative;
|
|
78
78
|
|
|
79
|
-
scroll-margin-top: var(--navbar-height);
|
|
79
|
+
scroll-margin-top: calc(var(--navbar-height) + var(--banner-height));
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
strong {
|
|
@@ -13,8 +13,8 @@ import { HttpTag } from '@redocly/theme/components/Tags/HttpTag';
|
|
|
13
13
|
import { MenuItemType } from '@redocly/theme/core/constants';
|
|
14
14
|
import { getMenuItemType, getOperationColor } from '@redocly/theme/core/utils';
|
|
15
15
|
import { ArrowRightIcon } from '@redocly/theme/icons/ArrowRightIcon/ArrowRightIcon';
|
|
16
|
-
import { Badge } from '@redocly/theme/components/Badge/Badge';
|
|
17
16
|
import { GenericIcon } from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
17
|
+
import { Tag, ContentWrapper } from '@redocly/theme/components/Tag/Tag';
|
|
18
18
|
|
|
19
19
|
export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Element {
|
|
20
20
|
const { item, depth, className, onClick } = props;
|
|
@@ -37,10 +37,13 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
|
|
|
37
37
|
const hasHttpTag = !!item.httpVerb || type === MenuItemType.Operation;
|
|
38
38
|
|
|
39
39
|
const handleOnClick = () => {
|
|
40
|
-
telemetry.sendSidebarItemClickedMessage(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
telemetry.sendSidebarItemClickedMessage([
|
|
41
|
+
{
|
|
42
|
+
object: 'sidebar_item',
|
|
43
|
+
label: item.label,
|
|
44
|
+
type: item.type === 'link' || item.type === 'group' ? item.type : undefined,
|
|
45
|
+
},
|
|
46
|
+
]);
|
|
44
47
|
onClick?.();
|
|
45
48
|
if (isNested) {
|
|
46
49
|
handleExpand();
|
|
@@ -92,12 +95,31 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
|
|
|
92
95
|
<MenuItemIcon icon={item.icon} srcSet={item.srcSet} />
|
|
93
96
|
<MenuItemLabelTextWrapper>
|
|
94
97
|
<MenuItemLabel>
|
|
98
|
+
{item.badges
|
|
99
|
+
?.filter(({ position }) => position === 'before')
|
|
100
|
+
.map(({ name, color, icon }) => (
|
|
101
|
+
<SidebarTag
|
|
102
|
+
color={isDirectColorValue(color) ? undefined : color}
|
|
103
|
+
$bgColor={isDirectColorValue(color) ? color : undefined}
|
|
104
|
+
key={name}
|
|
105
|
+
icon={icon && <BadgeIcon icon={icon} />}
|
|
106
|
+
>
|
|
107
|
+
{name}
|
|
108
|
+
</SidebarTag>
|
|
109
|
+
))}
|
|
95
110
|
<span>{translate(item.labelTranslationKey, item.label)}</span>
|
|
96
|
-
{item.badges
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
{item.badges
|
|
112
|
+
?.filter(({ position }) => position !== 'before')
|
|
113
|
+
.map(({ name, color, icon }) => (
|
|
114
|
+
<SidebarTag
|
|
115
|
+
color={isDirectColorValue(color) ? undefined : color}
|
|
116
|
+
$bgColor={isDirectColorValue(color) ? color : undefined}
|
|
117
|
+
key={name}
|
|
118
|
+
icon={icon && <BadgeIcon icon={icon} />}
|
|
119
|
+
>
|
|
120
|
+
{name}
|
|
121
|
+
</SidebarTag>
|
|
122
|
+
))}
|
|
101
123
|
{item.external ? <LaunchIcon size="var(--menu-item-external-icon-size)" /> : null}
|
|
102
124
|
</MenuItemLabel>
|
|
103
125
|
{item.sublabel ? (
|
|
@@ -146,6 +168,12 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
|
|
|
146
168
|
);
|
|
147
169
|
}
|
|
148
170
|
|
|
171
|
+
/* for backward compatibility */
|
|
172
|
+
function isDirectColorValue(color?: string) {
|
|
173
|
+
if (!color) return false;
|
|
174
|
+
return color.startsWith('#') || color.startsWith('rgb') || color.startsWith('hsl');
|
|
175
|
+
}
|
|
176
|
+
|
|
149
177
|
function generateClassName({
|
|
150
178
|
type,
|
|
151
179
|
item,
|
|
@@ -359,14 +387,31 @@ const MenuItemLabel = styled.span`
|
|
|
359
387
|
}
|
|
360
388
|
`;
|
|
361
389
|
|
|
362
|
-
const
|
|
390
|
+
const SidebarTag = styled(Tag)<{ $bgColor?: string; icon?: React.ReactNode }>`
|
|
391
|
+
${({ $bgColor }) => $bgColor && `background-color: ${$bgColor};`} /* for backward compatibility */
|
|
363
392
|
margin-left: 0;
|
|
364
|
-
background-color: ${({ color }) => color || 'var(--color-info-base)'};
|
|
365
393
|
font-size: var(--font-size-sm);
|
|
366
394
|
line-height: var(--line-height-sm);
|
|
367
395
|
padding: 0 var(--spacing-xxs);
|
|
368
|
-
max-width:
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
396
|
+
max-width: 90px;
|
|
397
|
+
|
|
398
|
+
--tag-padding: 0 var(--spacing-xxs);
|
|
399
|
+
--tag-content-padding: 0;
|
|
400
|
+
--tag-font-size: var(--font-size-sm);
|
|
401
|
+
--tag-line-height: var(--line-height-sm);
|
|
402
|
+
vertical-align: middle;
|
|
403
|
+
|
|
404
|
+
${ContentWrapper} {
|
|
405
|
+
text-overflow: ellipsis;
|
|
406
|
+
white-space: nowrap;
|
|
407
|
+
overflow: hidden;
|
|
408
|
+
display: block;
|
|
409
|
+
}
|
|
410
|
+
`;
|
|
411
|
+
|
|
412
|
+
const BadgeIcon = styled(GenericIcon)`
|
|
413
|
+
--icon-width: var(--font-size-sm);
|
|
414
|
+
--icon-height: var(--font-size-sm);
|
|
415
|
+
margin-right: var(--spacing-xxs);
|
|
416
|
+
flex-shrink: 0;
|
|
372
417
|
`;
|
|
@@ -47,7 +47,9 @@ export function NavbarItem({ navItem, className }: NavbarItemProps): JSX.Element
|
|
|
47
47
|
as={item.link ? Link : undefined}
|
|
48
48
|
active={isActive}
|
|
49
49
|
className={className}
|
|
50
|
-
onClick={() =>
|
|
50
|
+
onClick={() =>
|
|
51
|
+
telemetry.sendNavbarMenuItemClickedMessage([{ object: 'menu_item', type: item.type }])
|
|
52
|
+
}
|
|
51
53
|
external={item.external}
|
|
52
54
|
target={item.target}
|
|
53
55
|
to={item.link}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// interface AdditionalOverviewInfoProps {
|
|
2
|
+
// info: any;
|
|
3
|
+
// }
|
|
4
|
+
|
|
5
|
+
// export function AdditionalOverviewInfo(_props: AdditionalOverviewInfoProps) {
|
|
6
|
+
// return null;
|
|
7
|
+
// }
|
|
8
|
+
|
|
9
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
10
|
+
export const AdditionalOverviewInfo: any = null;
|
|
@@ -3,9 +3,9 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
5
5
|
import type { PageAction } from '@redocly/theme/core/types';
|
|
6
|
-
import type { DropdownMenuItemProps } from '@redocly/theme/components/Dropdown/DropdownMenuItem';
|
|
7
6
|
|
|
8
7
|
import { PageActionsMenuItem } from '@redocly/theme/components/PageActions/PageActionsMenuItem';
|
|
8
|
+
import { DropdownMenuItem } from '@redocly/theme/components/Dropdown/DropdownMenuItem';
|
|
9
9
|
import { Link } from '@redocly/theme/components/Link/Link';
|
|
10
10
|
import { ButtonGroup } from '@redocly/theme/components/Button/ButtonGroup';
|
|
11
11
|
import { Button } from '@redocly/theme/components/Button/Button';
|
|
@@ -52,20 +52,27 @@ export function PageActions(props: PageActionProps): JSX.Element | null {
|
|
|
52
52
|
}, ACTION_DONE_DISPLAY_DURATION);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const menuItems
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
) : (
|
|
55
|
+
const menuItems = actions.map((action, index) => {
|
|
56
|
+
const key = `${action.title}-${index}`;
|
|
57
|
+
const hasLink = 'link' in action;
|
|
58
|
+
|
|
59
|
+
const content = hasLink ? (
|
|
60
|
+
<LinkMenuItem key={`${key}-link`} to={action.link} tabIndex={-1} external>
|
|
62
61
|
<PageActionsMenuItem pageAction={action} />
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
</LinkMenuItem>
|
|
63
|
+
) : (
|
|
64
|
+
<PageActionsMenuItem pageAction={action} />
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<StyledDropdownMenuItem key={key} onAction={() => handleActionClick(action)}>
|
|
69
|
+
{content}
|
|
70
|
+
</StyledDropdownMenuItem>
|
|
71
|
+
);
|
|
72
|
+
});
|
|
66
73
|
|
|
67
74
|
return (
|
|
68
|
-
<PageActionsWrapper>
|
|
75
|
+
<PageActionsWrapper data-component-name="PageActions/PageActions">
|
|
69
76
|
<ButtonGroup variant="outlined" size="medium">
|
|
70
77
|
<Button
|
|
71
78
|
icon={renderIcon(buttonAction, actionState)}
|
|
@@ -76,9 +83,9 @@ export function PageActions(props: PageActionProps): JSX.Element | null {
|
|
|
76
83
|
{buttonAction.buttonText}
|
|
77
84
|
</Button>
|
|
78
85
|
{actions.length > 1 ? (
|
|
79
|
-
<
|
|
80
|
-
<StyledDropdownMenu
|
|
81
|
-
</
|
|
86
|
+
<StyledDropdown withArrow trigger={<Button />} placement="bottom" alignment="end">
|
|
87
|
+
<StyledDropdownMenu>{menuItems}</StyledDropdownMenu>
|
|
88
|
+
</StyledDropdown>
|
|
82
89
|
) : null}
|
|
83
90
|
</ButtonGroup>
|
|
84
91
|
</PageActionsWrapper>
|
|
@@ -111,6 +118,22 @@ const LinkMenuItem = styled(Link)`
|
|
|
111
118
|
--link-decoration-hover: none;
|
|
112
119
|
`;
|
|
113
120
|
|
|
121
|
+
const StyledDropdown = styled(Dropdown)`
|
|
122
|
+
z-index: calc(var(--z-index-raised) - 1);
|
|
123
|
+
`;
|
|
124
|
+
|
|
114
125
|
const StyledDropdownMenu = styled(DropdownMenu)`
|
|
115
126
|
--dropdown-menu-max-height: var(--page-actions-dropdown-max-height);
|
|
116
127
|
`;
|
|
128
|
+
|
|
129
|
+
const StyledDropdownMenuItem = styled(DropdownMenuItem)`
|
|
130
|
+
&:has(a) {
|
|
131
|
+
padding: 0;
|
|
132
|
+
& > a {
|
|
133
|
+
display: inline-block;
|
|
134
|
+
width: 100%;
|
|
135
|
+
padding: var(--dropdown-menu-item-padding-vertical)
|
|
136
|
+
var(--dropdown-menu-item-padding-horizontal);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
@@ -6,6 +6,8 @@ import type {
|
|
|
6
6
|
AiSearchConversationItem,
|
|
7
7
|
SearchAiMessageResource,
|
|
8
8
|
FeedbackType,
|
|
9
|
+
ToolCall,
|
|
10
|
+
ContentSegment,
|
|
9
11
|
} from '@redocly/theme/core/types';
|
|
10
12
|
|
|
11
13
|
import { useThemeConfig, useThemeHooks } from '@redocly/theme/core/hooks';
|
|
@@ -34,6 +36,8 @@ export type SearchAiDialogProps = {
|
|
|
34
36
|
history?: AiSearchConversationItem[],
|
|
35
37
|
messageId?: string,
|
|
36
38
|
) => void;
|
|
39
|
+
toolCalls?: ToolCall[];
|
|
40
|
+
contentSegments?: ContentSegment[];
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
export function SearchAiDialog({
|
|
@@ -46,6 +50,8 @@ export function SearchAiDialog({
|
|
|
46
50
|
className,
|
|
47
51
|
conversation,
|
|
48
52
|
setConversation,
|
|
53
|
+
toolCalls = [],
|
|
54
|
+
contentSegments,
|
|
49
55
|
}: SearchAiDialogProps): JSX.Element {
|
|
50
56
|
const { useTranslate } = useThemeHooks();
|
|
51
57
|
const { aiAssistant } = useThemeConfig();
|
|
@@ -111,13 +117,32 @@ export function SearchAiDialog({
|
|
|
111
117
|
content,
|
|
112
118
|
resources,
|
|
113
119
|
messageId: lastMessage.messageId,
|
|
120
|
+
toolCalls,
|
|
121
|
+
contentSegments,
|
|
114
122
|
},
|
|
115
123
|
];
|
|
116
124
|
}
|
|
117
125
|
|
|
118
|
-
return [
|
|
126
|
+
return [
|
|
127
|
+
...prev,
|
|
128
|
+
{
|
|
129
|
+
role: AiSearchConversationRole.ASSISTANT,
|
|
130
|
+
content,
|
|
131
|
+
resources,
|
|
132
|
+
toolCalls,
|
|
133
|
+
contentSegments,
|
|
134
|
+
},
|
|
135
|
+
];
|
|
119
136
|
});
|
|
120
|
-
}, [
|
|
137
|
+
}, [
|
|
138
|
+
response,
|
|
139
|
+
conversation.length,
|
|
140
|
+
error,
|
|
141
|
+
resources,
|
|
142
|
+
toolCalls,
|
|
143
|
+
contentSegments,
|
|
144
|
+
setConversation,
|
|
145
|
+
]);
|
|
121
146
|
|
|
122
147
|
useEffect(() => {
|
|
123
148
|
if (error) {
|
|
@@ -171,6 +196,10 @@ export function SearchAiDialog({
|
|
|
171
196
|
messageId={item.messageId}
|
|
172
197
|
feedback={item.feedback}
|
|
173
198
|
onFeedbackChange={handleFeedbackChange}
|
|
199
|
+
toolCalls={
|
|
200
|
+
item.toolCalls || (index === conversation.length - 1 ? toolCalls : undefined)
|
|
201
|
+
}
|
|
202
|
+
contentSegments={item.contentSegments}
|
|
174
203
|
/>
|
|
175
204
|
))}
|
|
176
205
|
|