@redocly/theme 0.69.0 → 0.70.0-next.1
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/Button/Button.js +5 -2
- package/lib/components/Button/variables.js +14 -5
- package/lib/components/Buttons/DownloadButton.js +13 -3
- package/lib/components/Catalog/Catalog.d.ts +2 -2
- package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -2
- package/lib/components/Catalog/CatalogCardView/CatalogCard.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.js +1 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.d.ts +3 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.js +45 -23
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +67 -33
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityRevisionItem.d.ts +3 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityRevisionItem.js +15 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.d.ts +3 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +48 -57
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +1 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +2 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -4
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +3 -4
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -2
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +2 -2
- package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.d.ts +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.js +1 -2
- package/lib/components/Catalog/CatalogHighlight.d.ts +2 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.d.ts +2 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.d.ts +1 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.d.ts +2 -1
- package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -2
- package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -2
- package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.d.ts +1 -1
- package/lib/components/Catalog/CatalogSelector.d.ts +3 -2
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +2 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +2 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTags.d.ts +2 -2
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
- package/lib/components/Catalog/variables.js +24 -33
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.d.ts +1 -1
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +1 -2
- package/lib/components/CatalogClassic/CatalogClassicVirtualizedGroups.d.ts +1 -1
- package/lib/components/CodeBlock/CodeBlockControls.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +7 -8
- package/lib/components/Filter/FilterOptionLabel.d.ts +1 -1
- package/lib/components/LoadMore/LoadMore.d.ts +1 -1
- package/lib/components/MCP/McpConnectionTabs.js +2 -2
- package/lib/components/PageActions/PageActions.d.ts +1 -1
- package/lib/components/ReplaySecuritySchemeActions/ReplaySecuritySchemeActions.d.ts +11 -0
- package/lib/components/ReplaySecuritySchemeActions/ReplaySecuritySchemeActions.js +7 -0
- package/lib/components/Search/SearchAiDialog.d.ts +1 -1
- package/lib/components/Search/SearchAiMessage.d.ts +1 -2
- package/lib/components/Search/SearchAiMessage.js +8 -10
- package/lib/components/Search/SearchAiResponse.d.ts +1 -1
- package/lib/components/Search/SearchGroups.d.ts +1 -1
- package/lib/components/SplitButton/SplitButton.d.ts +1 -0
- package/lib/components/SplitButton/SplitButton.js +2 -2
- package/lib/components/Tooltip/AnchorTooltip.js +17 -27
- package/lib/components/Tooltip/JsTooltip.js +34 -46
- package/lib/components/Tooltip/Tooltip.js +1 -2
- package/lib/core/constants/markdown.d.ts +2 -0
- package/lib/core/constants/markdown.js +3 -1
- package/lib/core/hooks/catalog/use-catalog-entity-schema.d.ts +1 -1
- package/lib/core/hooks/catalog/use-catalog-entity-schema.js +2 -2
- package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +1 -1
- package/lib/core/hooks/catalog/use-graph.d.ts +3 -3
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +1 -1
- package/lib/core/hooks/index.d.ts +1 -0
- package/lib/core/hooks/index.js +1 -0
- package/lib/core/hooks/menu/use-nested-menu.js +2 -2
- package/lib/core/hooks/use-active-section-id.js +6 -0
- package/lib/core/hooks/use-anchor-positioning.d.ts +3 -0
- package/lib/core/hooks/use-anchor-positioning.js +21 -0
- package/lib/core/hooks/use-element-size.d.ts +1 -1
- package/lib/core/hooks/use-theme-hooks.js +0 -1
- package/lib/core/types/catalog.d.ts +2 -3
- package/lib/core/types/common.d.ts +1 -1
- package/lib/core/types/hooks.d.ts +4 -10
- package/lib/core/utils/load-and-navigate.js +3 -3
- package/lib/core/utils/mcp.d.ts +0 -1
- package/lib/core/utils/mcp.js +0 -13
- package/lib/core/utils/menu.d.ts +2 -2
- package/lib/core/utils/urls.js +1 -3
- package/lib/ext/use-configure-replay.d.ts +1 -1
- package/lib/layouts/OIDCForbidden.js +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanelPreview.d.ts +1 -2
- package/lib/markdoc/components/Diagram/Diagram.d.ts +1 -1
- package/lib/markdoc/components/Diagram/Diagram.js +1 -2
- package/lib/markdoc/components/Tabs/Tab.d.ts +1 -1
- package/lib/markdoc/components/Tabs/TabList.d.ts +1 -1
- package/lib/markdoc/tags/code-walkthrough.d.ts +1 -1
- package/lib/markdoc/tags/markdoc-example.js +34 -22
- package/package.json +4 -4
- package/src/components/Button/Button.tsx +5 -2
- package/src/components/Button/variables.ts +14 -5
- package/src/components/Buttons/DownloadButton.tsx +16 -8
- package/src/components/Catalog/Catalog.tsx +4 -4
- package/src/components/Catalog/CatalogActionsRow.tsx +3 -2
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +3 -2
- package/src/components/Catalog/CatalogEntities.tsx +3 -2
- package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +6 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.tsx +4 -5
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.tsx +56 -35
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +80 -42
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityRevisionItem.tsx +18 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +61 -75
- package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +3 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +7 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +7 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +3 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -2
- package/src/components/Catalog/CatalogEntityIcon.tsx +3 -2
- package/src/components/Catalog/CatalogEntityTypeTag.tsx +3 -2
- package/src/components/Catalog/CatalogFilter/CatalogFilterContent.tsx +2 -4
- package/src/components/Catalog/CatalogHighlight.tsx +2 -1
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.tsx +2 -1
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.tsx +2 -1
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.tsx +2 -1
- package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -2
- package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +3 -2
- package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.tsx +2 -1
- package/src/components/Catalog/CatalogSelector.tsx +3 -2
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +1 -1
- package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +1 -1
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +2 -1
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +2 -1
- package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +1 -1
- package/src/components/Catalog/CatalogTags.tsx +4 -2
- package/src/components/Catalog/CatalogViewModeToggle.tsx +1 -1
- package/src/components/Catalog/variables.ts +24 -33
- package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +2 -5
- package/src/components/CatalogClassic/CatalogClassicVirtualizedGroups.tsx +1 -1
- package/src/components/CodeBlock/CodeBlockControls.tsx +2 -1
- package/src/components/Dropdown/Dropdown.tsx +5 -8
- package/src/components/Filter/FilterOptionLabel.tsx +1 -1
- package/src/components/LoadMore/LoadMore.tsx +2 -1
- package/src/components/MCP/McpConnectionTabs.tsx +3 -4
- package/src/components/PageActions/PageActions.tsx +2 -1
- package/src/components/ReplaySecuritySchemeActions/ReplaySecuritySchemeActions.tsx +19 -0
- package/src/components/Search/SearchAiDialog.tsx +1 -1
- package/src/components/Search/SearchAiMessage.tsx +3 -6
- package/src/components/Search/SearchAiResponse.tsx +2 -4
- package/src/components/Search/SearchGroups.tsx +1 -5
- package/src/components/SplitButton/SplitButton.tsx +3 -0
- package/src/components/Tooltip/AnchorTooltip.tsx +17 -27
- package/src/components/Tooltip/JsTooltip.tsx +55 -62
- package/src/components/Tooltip/Tooltip.tsx +1 -2
- package/src/core/constants/markdown.ts +4 -0
- package/src/core/hooks/__mocks__/index.ts +1 -0
- package/src/core/hooks/__mocks__/use-anchor-positioning.ts +3 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +0 -3
- package/src/core/hooks/catalog/use-catalog-entity-schema.ts +3 -3
- package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +1 -1
- package/src/core/hooks/catalog/use-graph.ts +4 -4
- package/src/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.ts +1 -1
- package/src/core/hooks/code-walkthrough/__mocks__/mock-intersection-observer.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +1 -1
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/menu/__mocks__/use-mobile-menu-items.ts +1 -1
- package/src/core/hooks/menu/use-nested-menu.ts +2 -2
- package/src/core/hooks/use-active-section-id.ts +8 -0
- package/src/core/hooks/use-anchor-positioning.ts +22 -0
- package/src/core/hooks/use-element-size.ts +2 -1
- package/src/core/hooks/use-theme-hooks.ts +0 -1
- package/src/core/types/catalog.ts +7 -3
- package/src/core/types/common.ts +1 -1
- package/src/core/types/hooks.ts +15 -14
- package/src/core/utils/load-and-navigate.ts +3 -3
- package/src/core/utils/mcp.ts +0 -17
- package/src/core/utils/menu.ts +2 -2
- package/src/core/utils/urls.ts +1 -3
- package/src/ext/use-configure-replay.ts +3 -3
- package/src/layouts/OIDCForbidden.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanelPreview.tsx +2 -2
- package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +2 -4
- package/src/markdoc/components/Diagram/Diagram.tsx +2 -5
- package/src/markdoc/components/Tabs/Tab.tsx +1 -1
- package/src/markdoc/components/Tabs/TabList.tsx +1 -1
- package/src/markdoc/tags/code-walkthrough.ts +2 -1
- package/src/markdoc/tags/markdoc-example.ts +45 -28
|
@@ -118,7 +118,9 @@ const StyledButton = styled_components_1.default.button `
|
|
|
118
118
|
height: var(--button-icon-size);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
/* A button that owns an open menu keeps its hovered appearance. */
|
|
122
|
+
&:hover,
|
|
123
|
+
&[aria-expanded='true'] {
|
|
122
124
|
background-color: var(--button-bg-color-hover);
|
|
123
125
|
color: var(--button-color-hover);
|
|
124
126
|
border-color: var(--button-border-color-hover);
|
|
@@ -140,7 +142,8 @@ const StyledButton = styled_components_1.default.button `
|
|
|
140
142
|
border-color: var(--button-border-color-danger);
|
|
141
143
|
background-color: var(--button-bg-color-danger);
|
|
142
144
|
|
|
143
|
-
&:hover
|
|
145
|
+
&:hover,
|
|
146
|
+
&[aria-expanded='true'] {
|
|
144
147
|
color: var(--button-content-color-danger-hover);
|
|
145
148
|
border-color: var(--button-border-color-danger-hover);
|
|
146
149
|
background-color: var(--button-bg-color-danger-hover);
|
|
@@ -251,21 +251,30 @@ exports.button = (0, styled_components_1.css) `
|
|
|
251
251
|
--button-group-divider-opacity: 1;
|
|
252
252
|
--button-group-divider-color-disabled: var(--color-warm-grey-2); // @presenter Color
|
|
253
253
|
|
|
254
|
-
.button-group-primary {
|
|
255
|
-
--button-group-divider-color: var(--button-
|
|
254
|
+
.button-group-primary .button {
|
|
255
|
+
--button-group-divider-color: var(--button-color); // @presenter Color
|
|
256
256
|
--button-group-divider-opacity: 0.32;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
.button-group-secondary {
|
|
260
|
-
--button-group-divider-color: var(--button-
|
|
259
|
+
.button-group-secondary .button {
|
|
260
|
+
--button-group-divider-color: var(--button-color); // @presenter Color
|
|
261
261
|
--button-group-divider-opacity: 0.12;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
.button-group-outlined {
|
|
264
|
+
.button-group-outlined .button {
|
|
265
265
|
--button-group-divider-color: var(--button-border-color); // @presenter Color
|
|
266
266
|
--button-group-divider-opacity: 1;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
+
.button-group-primary .button.button-tone-danger,
|
|
270
|
+
.button-group-secondary .button.button-tone-danger {
|
|
271
|
+
--button-group-divider-color: var(--button-content-color-danger); // @presenter Color
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.button-group-outlined .button.button-tone-danger {
|
|
275
|
+
--button-group-divider-color: var(--button-border-color-danger); // @presenter Color
|
|
276
|
+
}
|
|
277
|
+
|
|
269
278
|
// @tokens End
|
|
270
279
|
`;
|
|
271
280
|
//# sourceMappingURL=variables.js.map
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DownloadButton = DownloadButton;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
9
|
const Button_1 = require("../../components/Button/Button");
|
|
9
10
|
const DownloadIcon_1 = require("../../icons/DownloadIcon/DownloadIcon");
|
|
10
11
|
const Tooltip_1 = require("../../components/Tooltip/Tooltip");
|
|
@@ -12,9 +13,18 @@ const hooks_1 = require("../../core/hooks");
|
|
|
12
13
|
function DownloadButton({ data, dataTestId = 'download-button', }) {
|
|
13
14
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
14
15
|
const { translate } = useTranslate();
|
|
16
|
+
const label = translate('button.download.tooltipText', 'Download description');
|
|
15
17
|
return (react_1.default.createElement("div", { "data-component-name": "Buttons/DownloadButton" },
|
|
16
|
-
react_1.default.createElement(Tooltip_1.Tooltip, { tip:
|
|
17
|
-
react_1.default.createElement(
|
|
18
|
-
react_1.default.createElement(Button_1.Button, { variant: "text", size: "small", "aria-
|
|
18
|
+
react_1.default.createElement(Tooltip_1.Tooltip, { tip: label, placement: "top", arrowPosition: "right" },
|
|
19
|
+
react_1.default.createElement(DownloadLink, { href: data, target: "_blank", download: true, rel: "noreferrer", "aria-label": label },
|
|
20
|
+
react_1.default.createElement(Button_1.Button, { variant: "text", size: "small", "aria-hidden": true, tabIndex: -1, icon: react_1.default.createElement(DownloadIcon_1.DownloadIcon, null), "data-testid": dataTestId })))));
|
|
19
21
|
}
|
|
22
|
+
const DownloadLink = styled_components_1.default.a `
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
border-radius: var(--button-border-radius);
|
|
25
|
+
|
|
26
|
+
&:focus-visible {
|
|
27
|
+
outline: 1px solid var(--button-border-color-focused);
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
20
30
|
//# sourceMappingURL=DownloadButton.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
2
|
import type { CatalogEntityConfig } from '@redocly/config';
|
|
3
|
-
import { BffCatalogEntityList, CatalogSwitcherItem, CatalogViewMode } from '../../core/types';
|
|
3
|
+
import type { BffCatalogEntityList, CatalogSwitcherItem, CatalogViewMode } from '../../core/types';
|
|
4
4
|
type CatalogFiltersWithCounts = Record<string, {
|
|
5
5
|
value: string;
|
|
6
6
|
count: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { CatalogViewMode } from '../../core/types';
|
|
3
4
|
export type CatalogActionsRowProps = {
|
|
4
5
|
searchQuery: string;
|
|
5
6
|
setSearchQuery: (updatedTerm: string) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
2
|
import type { CatalogEntityConfig } from '@redocly/config';
|
|
3
|
-
import { BffCatalogEntity } from '../../../core/types';
|
|
3
|
+
import type { BffCatalogEntity } from '../../../core/types';
|
|
4
4
|
export type CatalogCardProps = {
|
|
5
5
|
entity: BffCatalogEntity;
|
|
6
6
|
catalogConfig: CatalogEntityConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
2
|
import type { CatalogEntityConfig } from '@redocly/config';
|
|
3
|
-
import { BffCatalogEntityList } from '../../core/types';
|
|
3
|
+
import type { BffCatalogEntityList } from '../../core/types';
|
|
4
4
|
export type CatalogEntitiesProps = {
|
|
5
5
|
catalogConfig: CatalogEntityConfig;
|
|
6
6
|
excludedEntities?: CatalogEntityConfig['excludes'];
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
|
-
import { BffCatalogEntity } from '../../../../core/types';
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { BffCatalogEntity } from '../../../../core/types';
|
|
3
3
|
export type CatalogEntityRelationsGraphProps = {
|
|
4
4
|
entity: BffCatalogEntity;
|
|
5
5
|
};
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.js
CHANGED
|
@@ -41,7 +41,6 @@ const react_1 = __importStar(require("react"));
|
|
|
41
41
|
const react_2 = require("@xyflow/react");
|
|
42
42
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
43
43
|
const hooks_1 = require("../../../../core/hooks");
|
|
44
|
-
const hooks_2 = require("../../../../core/hooks");
|
|
45
44
|
const CatalogEntityRelationsNode_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNode");
|
|
46
45
|
const CatalogEntityRelationsEdge_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsEdge");
|
|
47
46
|
const styles_1 = require("../../../../core/styles");
|
|
@@ -73,7 +72,7 @@ function CatalogEntityRelationsGraph({ entity, }) {
|
|
|
73
72
|
entityKey: entity.key,
|
|
74
73
|
filter: combinedFilter,
|
|
75
74
|
});
|
|
76
|
-
const { nodes, edges, onNodesChange, onEdgesChange, onConnect } = (0,
|
|
75
|
+
const { nodes, edges, onNodesChange, onEdgesChange, onConnect } = (0, hooks_1.useGraph)({
|
|
77
76
|
entity,
|
|
78
77
|
relations: allRelations !== null && allRelations !== void 0 ? allRelations : [],
|
|
79
78
|
});
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type CatalogHistoryButtonProps = {
|
|
3
3
|
version: string | null;
|
|
4
|
+
/** Marks `version` as the group's default, shown as a "(latest)" suffix on the pill. */
|
|
5
|
+
isDefaultVersion?: boolean;
|
|
4
6
|
className?: string;
|
|
5
7
|
};
|
|
6
|
-
export declare function CatalogEntityHistoryButton({ version, className, }: CatalogHistoryButtonProps): React.ReactElement;
|
|
8
|
+
export declare function CatalogEntityHistoryButton({ version, isDefaultVersion, className, }: CatalogHistoryButtonProps): React.ReactElement;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.js
CHANGED
|
@@ -40,41 +40,63 @@ exports.CatalogEntityHistoryButton = CatalogEntityHistoryButton;
|
|
|
40
40
|
const react_1 = __importStar(require("react"));
|
|
41
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
42
|
const RecentlyViewedIcon_1 = require("../../../../icons/RecentlyViewedIcon/RecentlyViewedIcon");
|
|
43
|
-
const
|
|
43
|
+
const RadioCheckButtonIcon_1 = require("../../../../icons/RadioCheckButtonIcon/RadioCheckButtonIcon");
|
|
44
44
|
const hooks_1 = require("../../../../core/hooks");
|
|
45
45
|
const constants_1 = require("../../../../core/constants");
|
|
46
46
|
const Tooltip_1 = require("../../../../components/Tooltip/Tooltip");
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The pill label: the page's version, updated by the overlay's close event
|
|
49
|
+
* (which appends the revision while an old revision is open), with a
|
|
50
|
+
* "(latest)" suffix on the plain default-version label.
|
|
51
|
+
*/
|
|
52
|
+
function useVersionPillLabel(version, isDefaultVersion) {
|
|
53
|
+
const pageLabel = version === constants_1.VERSION_NOT_SPECIFIED ? null : version;
|
|
54
|
+
const [label, setLabel] = (0, react_1.useState)(pageLabel);
|
|
55
|
+
// Keep the pill in sync when navigation changes the page version.
|
|
56
|
+
const [lastPageLabel, setLastPageLabel] = (0, react_1.useState)(pageLabel);
|
|
57
|
+
if (lastPageLabel !== pageLabel) {
|
|
58
|
+
setLastPageLabel(pageLabel);
|
|
59
|
+
setLabel(pageLabel);
|
|
60
|
+
}
|
|
50
61
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
51
62
|
const { translate } = useTranslate();
|
|
52
|
-
const
|
|
63
|
+
const latestWord = translate('catalog.history.version.latest', 'latest');
|
|
53
64
|
const handleClose = (0, react_1.useCallback)((e) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
: `${e.detail.version || version}, ${e.detail.revision || 'r.1'}`);
|
|
65
|
+
const closedVersion = e.detail.version === constants_1.VERSION_NOT_SPECIFIED ? null : e.detail.version || version;
|
|
66
|
+
setLabel([closedVersion, e.detail.revision].filter(Boolean).join(', ') || null);
|
|
57
67
|
}, [version]);
|
|
58
68
|
(0, react_1.useEffect)(() => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
69
|
+
const onClose = (e) => handleClose(e);
|
|
70
|
+
window.addEventListener('portal:sidebar:close-version-history', onClose);
|
|
71
|
+
return () => window.removeEventListener('portal:sidebar:close-version-history', onClose);
|
|
63
72
|
}, [handleClose]);
|
|
73
|
+
// A label with a revision, or a version named "latest", stays as-is.
|
|
74
|
+
return label !== null &&
|
|
75
|
+
label === pageLabel &&
|
|
76
|
+
isDefaultVersion &&
|
|
77
|
+
label.toLowerCase() !== latestWord.toLowerCase()
|
|
78
|
+
? `${label} (${latestWord})`
|
|
79
|
+
: label;
|
|
80
|
+
}
|
|
81
|
+
function CatalogEntityHistoryButton({ version, isDefaultVersion, className, }) {
|
|
82
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
83
|
+
const { translate } = useTranslate();
|
|
84
|
+
const displayLabel = useVersionPillLabel(version, isDefaultVersion);
|
|
85
|
+
const [labelRef, isLabelTruncated] = (0, hooks_1.useIsTruncated)(displayLabel);
|
|
64
86
|
const handleClick = () => {
|
|
65
87
|
window.dispatchEvent(new CustomEvent('portal:sidebar:open-version-history'));
|
|
66
88
|
};
|
|
67
89
|
return (react_1.default.createElement(CatalogHistoryButtonWrapper, { className: className, "data-component-name": "Catalog/CatalogHistoryButton" },
|
|
68
|
-
react_1.default.createElement(Separator, null),
|
|
69
90
|
react_1.default.createElement(HistoryItem, { onClick: handleClick },
|
|
70
91
|
react_1.default.createElement(HistoryIcon, null),
|
|
71
92
|
react_1.default.createElement(HistoryContent, null,
|
|
72
|
-
react_1.default.createElement(HistoryText, null, translate('catalog.history.button.label', 'Version
|
|
73
|
-
|
|
93
|
+
react_1.default.createElement(HistoryText, null, translate('catalog.history.button.label', 'Version')),
|
|
94
|
+
displayLabel && (react_1.default.createElement(Tooltip_1.Tooltip, { tip: displayLabel, placement: "bottom", arrowPosition: "left", disabled: !isLabelTruncated },
|
|
74
95
|
react_1.default.createElement(VersionPillWrapper, null,
|
|
75
96
|
react_1.default.createElement(VersionPill, null,
|
|
76
97
|
react_1.default.createElement(CheckmarkIcon, null),
|
|
77
|
-
react_1.default.createElement("span", { ref: labelRef },
|
|
98
|
+
react_1.default.createElement("span", { ref: labelRef }, displayLabel))))))),
|
|
99
|
+
react_1.default.createElement(Separator, null)));
|
|
78
100
|
}
|
|
79
101
|
const CatalogHistoryButtonWrapper = styled_components_1.default.div `
|
|
80
102
|
width: var(--catalog-history-button-width);
|
|
@@ -83,18 +105,18 @@ const Separator = styled_components_1.default.div `
|
|
|
83
105
|
width: 100%;
|
|
84
106
|
height: 1px;
|
|
85
107
|
background-color: var(--catalog-history-separator-border-color);
|
|
86
|
-
margin
|
|
108
|
+
margin: var(--catalog-history-separator-margin);
|
|
87
109
|
flex-shrink: 0;
|
|
88
110
|
`;
|
|
89
111
|
const HistoryItem = styled_components_1.default.button `
|
|
90
112
|
all: unset;
|
|
113
|
+
box-sizing: border-box;
|
|
91
114
|
display: flex;
|
|
92
115
|
align-items: center;
|
|
93
116
|
justify-content: space-between;
|
|
94
117
|
gap: var(--catalog-history-item-gap);
|
|
95
118
|
padding: var(--catalog-history-item-padding);
|
|
96
|
-
|
|
97
|
-
width: var(--catalog-history-button-item-width);
|
|
119
|
+
width: 100%;
|
|
98
120
|
border-radius: var(--catalog-history-item-border-radius);
|
|
99
121
|
cursor: pointer;
|
|
100
122
|
transition: background-color 0.2s ease;
|
|
@@ -105,13 +127,11 @@ const HistoryItem = styled_components_1.default.button `
|
|
|
105
127
|
`;
|
|
106
128
|
const HistoryContent = styled_components_1.default.div `
|
|
107
129
|
display: flex;
|
|
108
|
-
flex-wrap: wrap;
|
|
109
130
|
align-items: center;
|
|
110
131
|
justify-content: space-between;
|
|
111
132
|
flex: 1;
|
|
112
133
|
gap: var(--catalog-history-item-gap);
|
|
113
134
|
min-width: 0;
|
|
114
|
-
max-width: var(--catalog-history-content-max-width);
|
|
115
135
|
`;
|
|
116
136
|
const HistoryText = styled_components_1.default.span `
|
|
117
137
|
flex: 0 0 auto;
|
|
@@ -125,17 +145,19 @@ const HistoryText = styled_components_1.default.span `
|
|
|
125
145
|
const VersionPillWrapper = styled_components_1.default.div `
|
|
126
146
|
flex: 0 1 auto;
|
|
127
147
|
min-width: 0;
|
|
128
|
-
max-width: var(--catalog-history-content-max-width);
|
|
129
148
|
`;
|
|
130
149
|
const HistoryIcon = (0, styled_components_1.default)(RecentlyViewedIcon_1.RecentlyViewedIcon) `
|
|
131
150
|
width: var(--catalog-history-icon-size);
|
|
132
151
|
height: var(--catalog-history-icon-size);
|
|
133
152
|
flex-shrink: 0;
|
|
153
|
+
margin-right: var(--catalog-history-icon-gap);
|
|
134
154
|
`;
|
|
135
155
|
const VersionPill = styled_components_1.default.div `
|
|
156
|
+
box-sizing: border-box;
|
|
136
157
|
display: flex;
|
|
137
158
|
align-items: center;
|
|
138
159
|
gap: var(--catalog-history-pill-gap);
|
|
160
|
+
height: var(--catalog-history-pill-height);
|
|
139
161
|
padding: var(--catalog-history-pill-padding-vertical) var(--catalog-history-pill-padding-horizontal);
|
|
140
162
|
border: 1px solid var(--catalog-history-pill-border-color);
|
|
141
163
|
border-radius: var(--catalog-history-pill-border-radius);
|
|
@@ -154,7 +176,7 @@ const VersionPill = styled_components_1.default.div `
|
|
|
154
176
|
min-width: 0;
|
|
155
177
|
}
|
|
156
178
|
`;
|
|
157
|
-
const CheckmarkIcon = (0, styled_components_1.default)(
|
|
179
|
+
const CheckmarkIcon = (0, styled_components_1.default)(RadioCheckButtonIcon_1.RadioCheckButtonIcon) `
|
|
158
180
|
width: var(--catalog-history-pill-icon-size);
|
|
159
181
|
height: var(--catalog-history-pill-icon-size);
|
|
160
182
|
min-width: var(--catalog-history-pill-icon-size);
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js
CHANGED
|
@@ -47,13 +47,54 @@ const utils_1 = require("../../../../core/utils");
|
|
|
47
47
|
const constants_1 = require("../../../../core/constants");
|
|
48
48
|
const CatalogEntityVersionItem_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem");
|
|
49
49
|
const RecentlyViewedIcon_1 = require("../../../../icons/RecentlyViewedIcon/RecentlyViewedIcon");
|
|
50
|
+
/**
|
|
51
|
+
* Overlay visibility, driven by the button's open event. The overlay stays
|
|
52
|
+
* open only on the location it was opened at, so navigation closes it; every
|
|
53
|
+
* close (explicit or by navigation) emits the close event that syncs the
|
|
54
|
+
* button pill with the given version/revision.
|
|
55
|
+
*/
|
|
56
|
+
function useVersionHistoryOverlay(version, revisionLabel) {
|
|
57
|
+
const location = (0, react_router_1.useLocation)();
|
|
58
|
+
const locationKey = `${location.pathname}${location.search}`;
|
|
59
|
+
const locationKeyRef = (0, react_1.useRef)(locationKey);
|
|
60
|
+
locationKeyRef.current = locationKey;
|
|
61
|
+
const [openLocation, setOpenLocation] = (0, react_1.useState)(null);
|
|
62
|
+
const closeEventPending = (0, react_1.useRef)(false);
|
|
63
|
+
if (openLocation !== null && openLocation !== locationKey) {
|
|
64
|
+
closeEventPending.current = true;
|
|
65
|
+
setOpenLocation(null);
|
|
66
|
+
}
|
|
67
|
+
(0, react_1.useEffect)(() => {
|
|
68
|
+
const open = () => setOpenLocation(locationKeyRef.current);
|
|
69
|
+
window.addEventListener('portal:sidebar:open-version-history', open);
|
|
70
|
+
return () => window.removeEventListener('portal:sidebar:open-version-history', open);
|
|
71
|
+
}, []);
|
|
72
|
+
const emitClose = (0, react_1.useCallback)(() => {
|
|
73
|
+
window.dispatchEvent(new CustomEvent('portal:sidebar:close-version-history', {
|
|
74
|
+
detail: { version, revision: revisionLabel },
|
|
75
|
+
}));
|
|
76
|
+
}, [version, revisionLabel]);
|
|
77
|
+
// Dispatched after the post-navigation render so the close event carries
|
|
78
|
+
// the freshly navigated-to version/revision.
|
|
79
|
+
(0, react_1.useEffect)(() => {
|
|
80
|
+
if (!closeEventPending.current)
|
|
81
|
+
return;
|
|
82
|
+
closeEventPending.current = false;
|
|
83
|
+
emitClose();
|
|
84
|
+
}, [openLocation, emitClose]);
|
|
85
|
+
const close = (0, react_1.useCallback)(() => {
|
|
86
|
+
emitClose();
|
|
87
|
+
setOpenLocation(null);
|
|
88
|
+
}, [emitClose]);
|
|
89
|
+
return { isOpen: openLocation !== null && openLocation === locationKey, close };
|
|
90
|
+
}
|
|
50
91
|
function CatalogEntityHistorySidebar({ entityKey, revision, version, className, }) {
|
|
51
|
-
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
52
92
|
const location = (0, react_router_1.useLocation)();
|
|
53
93
|
const basePath = location.pathname;
|
|
54
|
-
const { useTranslate, useFetchCatalogEntityRevisions, useL10nConfig } = (0, hooks_1.useThemeHooks)();
|
|
94
|
+
const { useTranslate, useFetchCatalogEntityRevisions, useL10nConfig, usePageVersions } = (0, hooks_1.useThemeHooks)();
|
|
55
95
|
const { translate } = useTranslate();
|
|
56
96
|
const { currentLocale } = useL10nConfig();
|
|
97
|
+
const { versions: pageVersions } = usePageVersions();
|
|
57
98
|
const { items: revisions } = useFetchCatalogEntityRevisions({ entityKey });
|
|
58
99
|
const normalizedLocale = currentLocale && currentLocale !== constants_1.DEFAULT_LOCALE_PLACEHOLDER ? currentLocale : 'en-US';
|
|
59
100
|
const versionHistoryItems = (0, react_1.useMemo)(() => (0, utils_1.transformRevisionsToVersionHistory)({
|
|
@@ -66,27 +107,14 @@ function CatalogEntityHistorySidebar({ entityKey, revision, version, className,
|
|
|
66
107
|
var _a;
|
|
67
108
|
const itemWithActiveRevision = versionHistoryItems.find((item) => { var _a; return (_a = item.revisions) === null || _a === void 0 ? void 0 : _a.some((revision) => revision.isActive); });
|
|
68
109
|
const activeRevision = (_a = itemWithActiveRevision === null || itemWithActiveRevision === void 0 ? void 0 : itemWithActiveRevision.revisions) === null || _a === void 0 ? void 0 : _a.find((revision) => revision.isActive);
|
|
69
|
-
|
|
110
|
+
// Show the revision label only while an old revision is open.
|
|
111
|
+
return activeRevision && !activeRevision.isCurrent ? activeRevision.name : undefined;
|
|
70
112
|
}, [versionHistoryItems]);
|
|
113
|
+
const { isOpen, close } = useVersionHistoryOverlay(version, activeRevisionLabel);
|
|
71
114
|
const [expandedVersions, setExpandedVersions] = (0, react_1.useState)(new Set());
|
|
72
115
|
(0, react_1.useEffect)(() => {
|
|
73
116
|
setExpandedVersions(new Set(versionHistoryItems.filter((item) => item.isExpanded).map((item) => item.version)));
|
|
74
117
|
}, [versionHistoryItems]);
|
|
75
|
-
const handleOpenSidebar = (0, react_1.useCallback)(() => {
|
|
76
|
-
setIsOpen(true);
|
|
77
|
-
}, []);
|
|
78
|
-
(0, react_1.useEffect)(() => {
|
|
79
|
-
window.addEventListener('portal:sidebar:open-version-history', handleOpenSidebar);
|
|
80
|
-
return () => {
|
|
81
|
-
window.removeEventListener('portal:sidebar:open-version-history', handleOpenSidebar);
|
|
82
|
-
};
|
|
83
|
-
}, [handleOpenSidebar]);
|
|
84
|
-
const handleClose = () => {
|
|
85
|
-
window.dispatchEvent(new CustomEvent('portal:sidebar:close-version-history', {
|
|
86
|
-
detail: { version, revision: activeRevisionLabel },
|
|
87
|
-
}));
|
|
88
|
-
setIsOpen(false);
|
|
89
|
-
};
|
|
90
118
|
const toggleVersion = (version) => {
|
|
91
119
|
setExpandedVersions((prev) => {
|
|
92
120
|
const newSet = new Set(prev);
|
|
@@ -104,13 +132,13 @@ function CatalogEntityHistorySidebar({ entityKey, revision, version, className,
|
|
|
104
132
|
}
|
|
105
133
|
return (react_1.default.createElement(SidebarOverlay, { className: className, "data-component-name": "Catalog/CatalogHistorySidebar" },
|
|
106
134
|
react_1.default.createElement(SidebarHeader, null,
|
|
107
|
-
react_1.default.createElement(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
135
|
+
react_1.default.createElement(HistoryIcon, null),
|
|
136
|
+
react_1.default.createElement(HeaderTitle, null, translate('catalog.history.sidebar.title', 'Version')),
|
|
137
|
+
react_1.default.createElement(CloseButton, { onClick: close, "aria-label": translate('catalog.history.sidebar.close', 'Close version history') },
|
|
138
|
+
react_1.default.createElement(CloseIcon_1.CloseIcon, { size: "14px", color: "--catalog-history-sidebar-close-icon-color" }))),
|
|
139
|
+
react_1.default.createElement(Divider, null),
|
|
112
140
|
react_1.default.createElement(MenuContainer_1.MenuContainer, { growContent: true },
|
|
113
|
-
react_1.default.createElement(VersionList, null, versionHistoryItems.map((group) => (react_1.default.createElement(CatalogEntityVersionItem_1.CatalogEntityVersionItem, { key: group.version, group: group, basePath: basePath, isExpanded: expandedVersions.has(group.version), onToggle: toggleVersion })))))));
|
|
141
|
+
react_1.default.createElement(VersionList, null, versionHistoryItems.map((group) => { var _a; return (react_1.default.createElement(CatalogEntityVersionItem_1.CatalogEntityVersionItem, { key: group.version, group: group, basePath: basePath, isExpanded: expandedVersions.has(group.version), onToggle: toggleVersion, versionLink: (_a = pageVersions === null || pageVersions === void 0 ? void 0 : pageVersions.find((pageVersion) => pageVersion.version === group.version)) === null || _a === void 0 ? void 0 : _a.link })); })))));
|
|
114
142
|
}
|
|
115
143
|
const SidebarOverlay = styled_components_1.default.div `
|
|
116
144
|
position: fixed;
|
|
@@ -118,6 +146,7 @@ const SidebarOverlay = styled_components_1.default.div `
|
|
|
118
146
|
left: 0;
|
|
119
147
|
width: var(--sidebar-width);
|
|
120
148
|
height: calc(100vh - var(--navbar-height) - var(--banner-height));
|
|
149
|
+
padding: var(--catalog-history-sidebar-padding);
|
|
121
150
|
background-color: var(--catalog-history-sidebar-bg-color);
|
|
122
151
|
border-right: 1px solid var(--catalog-history-sidebar-border-color);
|
|
123
152
|
display: flex;
|
|
@@ -125,15 +154,25 @@ const SidebarOverlay = styled_components_1.default.div `
|
|
|
125
154
|
z-index: calc(var(--z-index-raised) - 1);
|
|
126
155
|
overflow: hidden;
|
|
127
156
|
`;
|
|
157
|
+
// Same row geometry as the history button, so opening the overlay keeps the
|
|
158
|
+
// icon and title in place.
|
|
128
159
|
const SidebarHeader = styled_components_1.default.div `
|
|
129
160
|
display: flex;
|
|
130
161
|
align-items: center;
|
|
131
|
-
|
|
162
|
+
gap: var(--catalog-history-item-gap);
|
|
132
163
|
padding: var(--catalog-history-sidebar-header-padding);
|
|
133
|
-
border-
|
|
164
|
+
border-radius: var(--border-radius-lg);
|
|
165
|
+
flex-shrink: 0;
|
|
166
|
+
`;
|
|
167
|
+
const Divider = styled_components_1.default.div `
|
|
168
|
+
height: 1px;
|
|
169
|
+
background-color: var(--catalog-history-sidebar-border-color);
|
|
170
|
+
margin: var(--catalog-history-sidebar-divider-margin);
|
|
134
171
|
flex-shrink: 0;
|
|
135
172
|
`;
|
|
136
173
|
const HeaderTitle = styled_components_1.default.h2 `
|
|
174
|
+
flex: 1;
|
|
175
|
+
min-width: 0;
|
|
137
176
|
margin: 0;
|
|
138
177
|
font-family: var(--catalog-history-sidebar-header-font-family);
|
|
139
178
|
font-size: var(--catalog-history-sidebar-header-font-size);
|
|
@@ -160,17 +199,12 @@ const CloseButton = styled_components_1.default.button `
|
|
|
160
199
|
const VersionList = styled_components_1.default.ul `
|
|
161
200
|
list-style: none;
|
|
162
201
|
margin: 0;
|
|
163
|
-
padding:
|
|
164
|
-
margin-top: var(--catalog-history-sidebar-content-margin-top);
|
|
202
|
+
padding: 0;
|
|
165
203
|
`;
|
|
166
204
|
const HistoryIcon = (0, styled_components_1.default)(RecentlyViewedIcon_1.RecentlyViewedIcon) `
|
|
167
205
|
width: var(--catalog-history-icon-size);
|
|
168
206
|
height: var(--catalog-history-icon-size);
|
|
169
207
|
flex-shrink: 0;
|
|
170
|
-
|
|
171
|
-
const HeaderWrapper = styled_components_1.default.div `
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
gap: var(--spacing-xs);
|
|
208
|
+
margin-right: var(--catalog-history-icon-gap);
|
|
175
209
|
`;
|
|
176
210
|
//# sourceMappingURL=CatalogEntityHistorySidebar.js.map
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityRevisionItem.d.ts
CHANGED
|
@@ -4,5 +4,7 @@ export type CatalogEntityRevisionItemProps = {
|
|
|
4
4
|
revisionItem: CatalogEntityRevision;
|
|
5
5
|
basePath: string;
|
|
6
6
|
version?: string | null;
|
|
7
|
+
/** The version's own page URL (from the host's usePageVersions). */
|
|
8
|
+
versionLink?: string;
|
|
7
9
|
};
|
|
8
|
-
export declare function CatalogEntityRevisionItem({ revisionItem, basePath, version, }: CatalogEntityRevisionItemProps): React.ReactElement;
|
|
10
|
+
export declare function CatalogEntityRevisionItem({ revisionItem, basePath, version, versionLink, }: CatalogEntityRevisionItemProps): React.ReactElement;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityRevisionItem.js
CHANGED
|
@@ -10,11 +10,17 @@ const Link_1 = require("../../../../components/Link/Link");
|
|
|
10
10
|
const Tag_1 = require("../../../../components/Tag/Tag");
|
|
11
11
|
const utils_1 = require("../../../../core/utils");
|
|
12
12
|
const hooks_1 = require("../../../../core/hooks");
|
|
13
|
-
function CatalogEntityRevisionItem({ revisionItem, basePath, version, }) {
|
|
13
|
+
function CatalogEntityRevisionItem({ revisionItem, basePath, version, versionLink, }) {
|
|
14
14
|
var _a, _b;
|
|
15
15
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
16
16
|
const { translate } = useTranslate();
|
|
17
|
-
|
|
17
|
+
// The current revision links to the version's live page. Older revisions
|
|
18
|
+
// add ?revision= to that URL. Hosts without page-version links keep the
|
|
19
|
+
// legacy ?revision=&version= contract.
|
|
20
|
+
const base = versionLink !== null && versionLink !== void 0 ? versionLink : basePath;
|
|
21
|
+
const revisionFilter = revisionItem.isCurrent
|
|
22
|
+
? base
|
|
23
|
+
: ((_a = (0, utils_1.buildRevisionUrl)(base, revisionItem.revisionDate, versionLink ? undefined : version)) !== null && _a !== void 0 ? _a : base);
|
|
18
24
|
const isActive = (_b = revisionItem.isActive) !== null && _b !== void 0 ? _b : false;
|
|
19
25
|
return (react_1.default.createElement(RevisionItemWrapper, { to: revisionFilter, $isActive: isActive },
|
|
20
26
|
react_1.default.createElement(RevisionNameRow, null,
|
|
@@ -34,11 +40,17 @@ const RevisionItemWrapper = (0, styled_components_1.default)(Link_1.Link) `
|
|
|
34
40
|
padding-left: var(--catalog-history-sidebar-revisions-padding-left);
|
|
35
41
|
border-radius: var(--catalog-history-sidebar-revision-item-border-radius);
|
|
36
42
|
transition: 0.2s ease;
|
|
37
|
-
text-decoration: none;
|
|
38
43
|
color: inherit;
|
|
39
44
|
cursor: pointer;
|
|
40
45
|
background-color: ${({ $isActive }) => $isActive ? 'var(--catalog-history-sidebar-revision-item-bg-color-active)' : 'transparent'};
|
|
41
46
|
|
|
47
|
+
&,
|
|
48
|
+
&:hover,
|
|
49
|
+
&:focus,
|
|
50
|
+
&:visited {
|
|
51
|
+
text-decoration: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
42
54
|
&:hover {
|
|
43
55
|
background-color: ${({ $isActive }) => $isActive
|
|
44
56
|
? 'var(--catalog-history-sidebar-revision-item-bg-color-active)'
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.d.ts
CHANGED
|
@@ -5,5 +5,7 @@ export type CatalogEntityVersionItemProps = {
|
|
|
5
5
|
basePath: string;
|
|
6
6
|
isExpanded: boolean;
|
|
7
7
|
onToggle: (version: string) => void;
|
|
8
|
+
/** This version's own page URL (from the host's usePageVersions). */
|
|
9
|
+
versionLink?: string;
|
|
8
10
|
};
|
|
9
|
-
export declare function CatalogEntityVersionItem({ group, basePath, isExpanded, onToggle, }: CatalogEntityVersionItemProps): React.ReactElement;
|
|
11
|
+
export declare function CatalogEntityVersionItem({ group, basePath, isExpanded, onToggle, versionLink, }: CatalogEntityVersionItemProps): React.ReactElement;
|