@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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MARKDOWN_CLASS_NAME = void 0;
|
|
3
|
+
exports.EXAMPLE_CONTENT_ATTRIBUTE = exports.MARKDOC_EXAMPLE_TAG = exports.MARKDOWN_CLASS_NAME = void 0;
|
|
4
4
|
exports.MARKDOWN_CLASS_NAME = 'md';
|
|
5
|
+
exports.MARKDOC_EXAMPLE_TAG = 'markdoc-example';
|
|
6
|
+
exports.EXAMPLE_CONTENT_ATTRIBUTE = 'exampleContent';
|
|
5
7
|
//# sourceMappingURL=markdown.js.map
|
|
@@ -8,7 +8,7 @@ function useCatalogEntitySchema({ entity, relatedEntity }) {
|
|
|
8
8
|
try {
|
|
9
9
|
parsedSchema = JSON.parse(schema);
|
|
10
10
|
}
|
|
11
|
-
catch (
|
|
11
|
+
catch (_c) {
|
|
12
12
|
parsedSchema = undefined;
|
|
13
13
|
}
|
|
14
14
|
let parsedApiDefinition;
|
|
@@ -17,7 +17,7 @@ function useCatalogEntitySchema({ entity, relatedEntity }) {
|
|
|
17
17
|
? JSON.parse(relatedEntity.metadata.schema)
|
|
18
18
|
: undefined;
|
|
19
19
|
}
|
|
20
|
-
catch (
|
|
20
|
+
catch (_d) {
|
|
21
21
|
parsedApiDefinition = undefined;
|
|
22
22
|
}
|
|
23
23
|
const definition = !parsedApiDefinition || ((_b = relatedEntity === null || relatedEntity === void 0 ? void 0 : relatedEntity.metadata) === null || _b === void 0 ? void 0 : _b.specType) !== 'openapi'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseEntity, CatalogColumn } from '../../../components/Catalog/CatalogTableView/CatalogTableView';
|
|
1
|
+
import type { BaseEntity, CatalogColumn } from '../../../components/Catalog/CatalogTableView/CatalogTableView';
|
|
2
2
|
type CatalogTableHeaderCellActionsProps<T extends BaseEntity> = {
|
|
3
3
|
column: CatalogColumn<T>;
|
|
4
4
|
currentSortOption?: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
import { BffCatalogEntity, BffCatalogRelatedEntity } from '../../types';
|
|
1
|
+
import { type OnNodesChange, type OnEdgesChange, type Node, type Edge, type Connection } from '@xyflow/react';
|
|
2
|
+
import type { CatalogEntityNodeData } from '../../../components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNode';
|
|
3
|
+
import type { BffCatalogEntity, BffCatalogRelatedEntity } from '../../types';
|
|
4
4
|
export type UseGraphProps = {
|
|
5
5
|
entity: BffCatalogEntity;
|
|
6
6
|
relations: BffCatalogRelatedEntity[];
|
|
@@ -42,7 +42,7 @@ function useCodeWalkthroughControls(filters, inputs, toggles, enableDeepLink) {
|
|
|
42
42
|
Object.entries(newState).forEach(([id, control]) => {
|
|
43
43
|
const existingControl = controlsState[id];
|
|
44
44
|
if (existingControl && existingControl.type === control.type) {
|
|
45
|
-
// @ts-
|
|
45
|
+
// @ts-expect-error
|
|
46
46
|
newState[id] = Object.assign(Object.assign({}, control), { value: existingControl.value });
|
|
47
47
|
}
|
|
48
48
|
});
|
package/lib/core/hooks/index.js
CHANGED
|
@@ -71,4 +71,5 @@ __exportStar(require("./use-toast"), exports);
|
|
|
71
71
|
__exportStar(require("./use-toast-logic"), exports);
|
|
72
72
|
__exportStar(require("./use-banner-telemetry"), exports);
|
|
73
73
|
__exportStar(require("./use-tooltip-fallback-placement"), exports);
|
|
74
|
+
__exportStar(require("./use-anchor-positioning"), exports);
|
|
74
75
|
//# sourceMappingURL=index.js.map
|
|
@@ -46,9 +46,9 @@ function useNestedMenu({ item, labelRef, nestedMenuRef }) {
|
|
|
46
46
|
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
47
47
|
rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
48
48
|
// Only scroll if element is in viewport to prevent page jumping
|
|
49
|
-
// @ts-
|
|
49
|
+
// @ts-expect-error
|
|
50
50
|
if (isInViewport && typeof el.scrollIntoViewIfNeeded === 'function') {
|
|
51
|
-
// @ts-
|
|
51
|
+
// @ts-expect-error
|
|
52
52
|
el.scrollIntoViewIfNeeded(centerIfNeeded);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -32,6 +32,8 @@ function useActiveSectionId(location, hasOverviewPage = false, withNavbar = true
|
|
|
32
32
|
const section = sections[i];
|
|
33
33
|
const rect = section.getBoundingClientRect();
|
|
34
34
|
if (rect.y < heightOffset && rect.bottom > heightOffset) {
|
|
35
|
+
if (isSkippedContent(section))
|
|
36
|
+
continue;
|
|
35
37
|
setItemId(section.getAttribute('data-section-id') || '');
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
@@ -56,4 +58,8 @@ function useActiveSectionId(location, hasOverviewPage = false, withNavbar = true
|
|
|
56
58
|
}, [location, heightOffset, scrollListener]);
|
|
57
59
|
return itemId;
|
|
58
60
|
}
|
|
61
|
+
function isSkippedContent(element) {
|
|
62
|
+
return (typeof element.checkVisibility === 'function' &&
|
|
63
|
+
!element.checkVisibility({ contentVisibilityAuto: true }));
|
|
64
|
+
}
|
|
59
65
|
//# sourceMappingURL=use-active-section-id.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAnchorPositioning = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useAnchorPositioning = () => {
|
|
6
|
+
const [isSupported, setIsSupported] = (0, react_1.useState)(false);
|
|
7
|
+
(0, react_1.useEffect)(() => {
|
|
8
|
+
setIsSupported(isAnchorPositioningSupported());
|
|
9
|
+
}, []);
|
|
10
|
+
return { isSupported };
|
|
11
|
+
};
|
|
12
|
+
exports.useAnchorPositioning = useAnchorPositioning;
|
|
13
|
+
function isAnchorPositioningSupported() {
|
|
14
|
+
if (typeof CSS === 'undefined' || typeof CSS.supports !== 'function') {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return (CSS.supports('anchor-name: --a') &&
|
|
18
|
+
CSS.supports('position-anchor: --a') &&
|
|
19
|
+
CSS.supports('top: anchor(top)'));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=use-anchor-positioning.js.map
|
|
@@ -5,7 +5,6 @@ const react_1 = require("react");
|
|
|
5
5
|
const ThemeDataContext_1 = require("../contexts/ThemeDataContext");
|
|
6
6
|
const use_telemetry_fallback_1 = require("./use-telemetry-fallback");
|
|
7
7
|
const fallbacks = {
|
|
8
|
-
useAnchorPositioning: () => ({ isSupported: false }),
|
|
9
8
|
useTranslate: () => ({
|
|
10
9
|
translate: (value, options) => (typeof options === 'string' ? options : options === null || options === void 0 ? void 0 : options.defaultValue) || value || '',
|
|
11
10
|
}),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import { ENTITY_RELATION_TYPES } from '@redocly/config';
|
|
3
|
-
import type { CatalogEntityConfig, EntitiesCatalogConfig, LayoutVariant } from '@redocly/config';
|
|
1
|
+
import type { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { ENTITY_RELATION_TYPES, CatalogEntityConfig, EntitiesCatalogConfig, LayoutVariant } from '@redocly/config';
|
|
4
3
|
import type { CatalogFilterConfig } from '../../config';
|
|
5
4
|
export type FilterResult = {
|
|
6
5
|
value: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { DEFAULT_COLOR_MODES } from '../constants';
|
|
2
|
+
import type { DEFAULT_COLOR_MODES } from '../constants';
|
|
3
3
|
export type Plural<T extends string> = `${T}s`;
|
|
4
4
|
export type ColorMode = (typeof DEFAULT_COLOR_MODES)[keyof typeof DEFAULT_COLOR_MODES];
|
|
5
5
|
export type RenderableChildren<Context> = React.ReactNode | ((context: Context) => React.ReactNode);
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import type { ResolvedBannerConfig } from '@redocly/config';
|
|
1
|
+
import type { ResolvedBannerConfig, PageData, PageProps, ResolvedNavItemWithLink, Version } from '@redocly/config';
|
|
2
2
|
import type { AsyncApiRealmUI } from '@redocly/realm-asyncapi-sdk';
|
|
3
|
-
import type { PageData, PageProps, ResolvedNavItemWithLink, Version } from '@redocly/config';
|
|
4
3
|
import type { ShikiTransformer } from '@shikijs/types';
|
|
5
4
|
import type { Callback, TFunction as TFunc } from 'i18next';
|
|
6
5
|
import type { To, Location, NavigateFunction } from 'react-router';
|
|
7
6
|
import type { UseQueryResult } from '@tanstack/react-query';
|
|
8
7
|
import type { CatalogConfig, ProductUiConfig } from '../../config';
|
|
9
|
-
import type { UseCatalogResponse, FilteredCatalog, UseCatalogSortResponse, UseCatalogSearchResponse, UseCatalogProps, CatalogApiParams, CatalogApiResults } from './catalog';
|
|
8
|
+
import type { UseCatalogResponse, FilteredCatalog, UseCatalogSortResponse, UseCatalogSearchResponse, UseCatalogProps, CatalogApiParams, CatalogApiResults, BffCatalogEntity, BffCatalogEntityList, BffCatalogRelatedEntity, BffCatalogRelatedEntityList, BffCatalogEntityRevision, BffCatalogEntityRevisionList } from './catalog';
|
|
10
9
|
import type { UserMenuData } from './user-menu';
|
|
11
|
-
import type { ItemState } from './sidebar';
|
|
10
|
+
import type { ItemState, DrilldownMenuItemDetails } from './sidebar';
|
|
12
11
|
import type { SearchItemData, SearchFacet, SearchFilterItem, SearchFacetQuery, AiSearchConversationItem, ContentSegment, ToolCall } from './search';
|
|
13
12
|
import type { SubmitFeedbackParams } from './feedback';
|
|
14
13
|
import type { TFunction } from './l10n';
|
|
15
14
|
import type { BreadcrumbItem } from './breadcrumb';
|
|
16
|
-
import type {
|
|
17
|
-
import { BffCatalogEntity, BffCatalogEntityList, BffCatalogRelatedEntity, BffCatalogRelatedEntityList, BffCatalogEntityRevision, BffCatalogEntityRevisionList } from './catalog';
|
|
18
|
-
import { AiSearchError } from '../constants/search';
|
|
15
|
+
import type { AiSearchError } from '../constants/search';
|
|
19
16
|
export type ThemeHooks = {
|
|
20
|
-
useAnchorPositioning: () => {
|
|
21
|
-
isSupported: boolean;
|
|
22
|
-
};
|
|
23
17
|
useTranslate: () => {
|
|
24
18
|
translate: TFunction;
|
|
25
19
|
};
|
|
@@ -24,9 +24,9 @@ function loadAndNavigate(_a) {
|
|
|
24
24
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
25
25
|
const loader = window['__LOADER'];
|
|
26
26
|
const result = yield (0, with_load_progress_1.withLoadProgress)(loader.tryLoad(pathname));
|
|
27
|
-
// @ts-
|
|
27
|
+
// @ts-expect-error
|
|
28
28
|
if (result === null || result === void 0 ? void 0 : result.redirectTo) {
|
|
29
|
-
// @ts-
|
|
29
|
+
// @ts-expect-error
|
|
30
30
|
return loadAndNavigate({ navigate, to: result.redirectTo, origin, options });
|
|
31
31
|
}
|
|
32
32
|
if (result && lastNavigatedPath === to) {
|
|
@@ -34,7 +34,7 @@ function loadAndNavigate(_a) {
|
|
|
34
34
|
// origin is used to prevent infinite loop when navigating from post message (from wysiwyg)
|
|
35
35
|
navigate({ pathname, search, hash }, Object.assign(Object.assign({}, options), { state: { origin }, unstable_flushSync: true }));
|
|
36
36
|
}
|
|
37
|
-
// @ts-
|
|
37
|
+
// @ts-expect-error
|
|
38
38
|
if ((_b = result.props) === null || _b === void 0 ? void 0 : _b.disableAutoScroll)
|
|
39
39
|
return;
|
|
40
40
|
if (hash) {
|
package/lib/core/utils/mcp.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { MCPClientType, McpConnectionParams } from '../types';
|
|
2
2
|
export declare function generateMCPDeepLink(clientType: MCPClientType, config: McpConnectionParams): string;
|
|
3
3
|
export declare function slugifyMcpServerName(name: string): string;
|
|
4
|
-
export declare function generateClaudeDesktopConfig(config: McpConnectionParams): string;
|
|
5
4
|
export declare function generateClaudeCodeCommand(config: McpConnectionParams): string;
|
|
6
5
|
export declare function generateCodexCommand(config: McpConnectionParams): string;
|
|
7
6
|
export declare function generateMcpInstallPrompt(config: McpConnectionParams): string;
|
package/lib/core/utils/mcp.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateMCPDeepLink = generateMCPDeepLink;
|
|
4
4
|
exports.slugifyMcpServerName = slugifyMcpServerName;
|
|
5
|
-
exports.generateClaudeDesktopConfig = generateClaudeDesktopConfig;
|
|
6
5
|
exports.generateClaudeCodeCommand = generateClaudeCodeCommand;
|
|
7
6
|
exports.generateCodexCommand = generateCodexCommand;
|
|
8
7
|
exports.generateMcpInstallPrompt = generateMcpInstallPrompt;
|
|
@@ -41,18 +40,6 @@ function slugifyMcpServerName(name) {
|
|
|
41
40
|
.replace(/[^a-z0-9_-]+/g, '-')
|
|
42
41
|
.replace(/^-+|-+$/g, '');
|
|
43
42
|
}
|
|
44
|
-
// Claude Desktop's config file only launches stdio commands, so remote servers
|
|
45
|
-
// connect through the mcp-remote bridge.
|
|
46
|
-
function generateClaudeDesktopConfig(config) {
|
|
47
|
-
return JSON.stringify({
|
|
48
|
-
mcpServers: {
|
|
49
|
-
[slugifyMcpServerName(config.serverName)]: {
|
|
50
|
-
command: 'npx',
|
|
51
|
-
args: ['-y', 'mcp-remote', config.url],
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
}, null, 2);
|
|
55
|
-
}
|
|
56
43
|
function generateClaudeCodeCommand(config) {
|
|
57
44
|
return `claude mcp add --transport http ${slugifyMcpServerName(config.serverName)} ${config.url}`;
|
|
58
45
|
}
|
package/lib/core/utils/menu.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ResolvedNavItem, Version } from '@redocly/config';
|
|
2
2
|
import type { Location } from 'react-router';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { Locale, TFunction } from '../types/l10n';
|
|
4
|
+
import type { ItemState } from '../types/sidebar';
|
|
5
5
|
import { MenuItemType } from '../constants/common';
|
|
6
6
|
export declare const mapNavbarItems: (items: ResolvedNavItem[], defaultLocale: string, currentLocale: string, locales: Locale[], location: Location) => ItemState[];
|
|
7
7
|
export declare const isItemActive: (item: ResolvedNavItem, defaultLocale: string, currentLocale: string, locales: Locale[], location: Location) => boolean;
|
package/lib/core/utils/urls.js
CHANGED
|
@@ -18,9 +18,7 @@ const common_1 = require("../constants/common");
|
|
|
18
18
|
function combineUrls(baseURL, ...relativeURLs) {
|
|
19
19
|
let res = baseURL;
|
|
20
20
|
for (let relativeURL of relativeURLs) {
|
|
21
|
-
res = relativeURL
|
|
22
|
-
? res.replace(/[\/\\]+$/, '') + '/' + relativeURL.replace(/^[\/\\]+/, '')
|
|
23
|
-
: res;
|
|
21
|
+
res = relativeURL ? res.replace(/[/\\]+$/, '') + '/' + relativeURL.replace(/^[/\\]+/, '') : res;
|
|
24
22
|
}
|
|
25
23
|
return res;
|
|
26
24
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ConfigureRequestValues, ConfigureServerRequestValues } from '../ext/configure';
|
|
2
2
|
import type { UserClaims, OpenAPIServer, OpenAPIInfo } from '../core/types';
|
|
3
3
|
type ContextProps = {
|
|
4
4
|
operation: {
|
|
@@ -47,7 +47,7 @@ function OIDCForbidden() {
|
|
|
47
47
|
const [searchParams, setSearchParams] = (0, react_router_1.useSearchParams)();
|
|
48
48
|
const [errorDescription, setErrorDescription] = (0, react_1.useState)('');
|
|
49
49
|
// use whatever you want here
|
|
50
|
-
const URL_REGEX = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._
|
|
50
|
+
const URL_REGEX = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
|
|
51
51
|
const renderText = (text) => text.split(' ').map((part) => URL_REGEX.test(part) ? (react_1.default.createElement(ErrorDescriptionLink, { key: part, href: part },
|
|
52
52
|
part,
|
|
53
53
|
' ')) : (part + ' '));
|
|
@@ -41,10 +41,9 @@ const react_1 = __importStar(require("react"));
|
|
|
41
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
42
|
const utils_1 = require("../../../core/utils");
|
|
43
43
|
const hooks_1 = require("../../../core/hooks");
|
|
44
|
-
const hooks_2 = require("../../../core/hooks");
|
|
45
44
|
const SvgViewer_1 = require("../../../components/SvgViewer/SvgViewer");
|
|
46
45
|
function Diagram({ id, diagramHtml, diagramHtmlDark, diagramError, diagramType, align, width, 'data-source': dataSource, 'data-hash': dataHash, className, }) {
|
|
47
|
-
const { useTranslate } = (0,
|
|
46
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
48
47
|
const { translate } = useTranslate();
|
|
49
48
|
const { activeColorMode } = (0, hooks_1.useColorSwitcher)();
|
|
50
49
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { JSX } from 'react';
|
|
3
3
|
import type { TabItemProps } from '../../../markdoc/components/Tabs/TabItemFragment';
|
|
4
|
-
import { TabsSize } from '../../../markdoc/components/Tabs/Tabs';
|
|
4
|
+
import type { TabsSize } from '../../../markdoc/components/Tabs/Tabs';
|
|
5
5
|
type TabListProps = {
|
|
6
6
|
childrenArray: React.ReactElement<TabItemProps>[];
|
|
7
7
|
size: TabsSize;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, RenderableTreeNode } from '@markdoc/markdoc';
|
|
1
|
+
import type { Node, RenderableTreeNode } from '@markdoc/markdoc';
|
|
2
2
|
import type { MarkdocSchemaWrapper } from '../../markdoc/tags/types';
|
|
3
3
|
import type { CodeWalkthroughConditions, CodeWalkthroughFilter, TogglesMarkdocAttr, InputsMarkdocAttr } from '@redocly/config';
|
|
4
4
|
export declare const codeWalkthrough: MarkdocSchemaWrapper;
|
|
@@ -5,21 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.markdocExample = void 0;
|
|
7
7
|
const markdoc_1 = __importDefault(require("@markdoc/markdoc"));
|
|
8
|
-
|
|
9
|
-
function parseInlineMarkdown(ast, config) {
|
|
10
|
-
if (Array.isArray(ast)) {
|
|
11
|
-
return ast.flatMap((child) => parseInlineMarkdown(child, config));
|
|
12
|
-
}
|
|
13
|
-
if (typeof ast === 'string') {
|
|
14
|
-
const parsed = markdoc_1.default.parse(ast);
|
|
15
|
-
return markdoc_1.default.transform(parsed, config);
|
|
16
|
-
}
|
|
17
|
-
if (ast && typeof ast === 'object' && ast.$$mdtype === 'Tag') {
|
|
18
|
-
const children = parseInlineMarkdown(ast.children, config);
|
|
19
|
-
return Object.assign(Object.assign({}, ast), { children });
|
|
20
|
-
}
|
|
21
|
-
return ast;
|
|
22
|
-
}
|
|
8
|
+
const constants_1 = require("../../core/constants");
|
|
23
9
|
// This custom tag prevents evaluating any children markdoc tags (no children) so we can
|
|
24
10
|
// have markdoc examples in code fences
|
|
25
11
|
// approach copied from: https://github.com/markdoc/docs/blob/main/markdoc/tags/markdoc-example.markdoc.js
|
|
@@ -33,24 +19,50 @@ exports.markdocExample = {
|
|
|
33
19
|
},
|
|
34
20
|
children: ['fence'],
|
|
35
21
|
transform(node, config) {
|
|
36
|
-
var _a;
|
|
37
22
|
const attributes = node.transformAttributes(config);
|
|
38
|
-
const
|
|
23
|
+
const fenceNode = node.children[0];
|
|
24
|
+
const { content } = (fenceNode === null || fenceNode === void 0 ? void 0 : fenceNode.attributes) || {};
|
|
39
25
|
if (!content)
|
|
40
26
|
return null;
|
|
41
27
|
const language = 'markdoc';
|
|
42
|
-
const annotations =
|
|
28
|
+
const annotations = fenceNode.annotations;
|
|
43
29
|
let title = null;
|
|
44
30
|
if (annotations.length > 0) {
|
|
45
31
|
const fenceWithTitle = annotations.find((annotation) => annotation.name === 'title');
|
|
46
32
|
title = fenceWithTitle === null || fenceWithTitle === void 0 ? void 0 : fenceWithTitle.value;
|
|
47
33
|
}
|
|
48
|
-
const demoContent = node.children[0].transformChildren(config);
|
|
49
|
-
const parsedDemoContent = parseInlineMarkdown(demoContent, config);
|
|
50
34
|
return new markdoc_1.default.Tag('MarkdocExample', Object.assign(Object.assign({}, attributes), { title,
|
|
51
|
-
language, demoContent:
|
|
35
|
+
language, demoContent: transformDemoContent(fenceNode, content, config), rawContent: content }), []);
|
|
52
36
|
},
|
|
53
37
|
},
|
|
54
|
-
tagName:
|
|
38
|
+
tagName: constants_1.MARKDOC_EXAMPLE_TAG,
|
|
55
39
|
};
|
|
40
|
+
// Walk through AST and look for raw markdown to parse
|
|
41
|
+
function parseRawMarkdown(ast, config) {
|
|
42
|
+
if (Array.isArray(ast)) {
|
|
43
|
+
return ast.flatMap((child) => parseRawMarkdown(child, config));
|
|
44
|
+
}
|
|
45
|
+
if (typeof ast === 'string') {
|
|
46
|
+
const parsed = markdoc_1.default.parse(ast);
|
|
47
|
+
return markdoc_1.default.transform(parsed, config);
|
|
48
|
+
}
|
|
49
|
+
if (ast && typeof ast === 'object' && ast.$$mdtype === 'Tag') {
|
|
50
|
+
const children = parseRawMarkdown(ast.children, config);
|
|
51
|
+
return Object.assign(Object.assign({}, ast), { children });
|
|
52
|
+
}
|
|
53
|
+
return ast;
|
|
54
|
+
}
|
|
55
|
+
function toRenderableArray(node) {
|
|
56
|
+
return Array.isArray(node) ? node : [node];
|
|
57
|
+
}
|
|
58
|
+
function transformDemoContent(fenceNode, content, config) {
|
|
59
|
+
const parsedBody = fenceNode.attributes[constants_1.EXAMPLE_CONTENT_ATTRIBUTE];
|
|
60
|
+
if (parsedBody) {
|
|
61
|
+
return toRenderableArray(markdoc_1.default.transform(parsedBody.children, config));
|
|
62
|
+
}
|
|
63
|
+
if (!fenceNode.children.length) {
|
|
64
|
+
return toRenderableArray(markdoc_1.default.transform(markdoc_1.default.parse(content).children, config));
|
|
65
|
+
}
|
|
66
|
+
return toRenderableArray(parseRawMarkdown(fenceNode.transformChildren(config), config));
|
|
67
|
+
}
|
|
56
68
|
//# sourceMappingURL=markdoc-example.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0-next.1",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/core": "7.29.7",
|
|
44
44
|
"@markdoc/markdoc": "0.5.2",
|
|
45
|
-
"@redocly/realm-asyncapi-sdk": "0.
|
|
45
|
+
"@redocly/realm-asyncapi-sdk": "0.16.0-next.0",
|
|
46
46
|
"@shikijs/types": "3.21.0",
|
|
47
47
|
"@testing-library/react": "16.3.0",
|
|
48
48
|
"@testing-library/user-event": "14.6.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"webpack": "5.105.2"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@redocly/config": "0.
|
|
74
|
+
"@redocly/config": "0.57.0",
|
|
75
75
|
"@tanstack/react-query": "5.62.3",
|
|
76
76
|
"@tanstack/react-virtual": "3.13.0",
|
|
77
77
|
"@xyflow/react": "12.8.3",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"lodash.debounce": "^4.0.8",
|
|
85
85
|
"lodash.throttle": "4.1.1",
|
|
86
86
|
"nprogress": "0.2.0",
|
|
87
|
-
"openapi-sampler": "^1.7.
|
|
87
|
+
"openapi-sampler": "^1.7.6",
|
|
88
88
|
"react-calendar": "5.1.0",
|
|
89
89
|
"react-date-picker": "11.0.0"
|
|
90
90
|
},
|
|
@@ -123,7 +123,9 @@ const StyledButton = styled.button<{
|
|
|
123
123
|
height: var(--button-icon-size);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
/* A button that owns an open menu keeps its hovered appearance. */
|
|
127
|
+
&:hover,
|
|
128
|
+
&[aria-expanded='true'] {
|
|
127
129
|
background-color: var(--button-bg-color-hover);
|
|
128
130
|
color: var(--button-color-hover);
|
|
129
131
|
border-color: var(--button-border-color-hover);
|
|
@@ -145,7 +147,8 @@ const StyledButton = styled.button<{
|
|
|
145
147
|
border-color: var(--button-border-color-danger);
|
|
146
148
|
background-color: var(--button-bg-color-danger);
|
|
147
149
|
|
|
148
|
-
&:hover
|
|
150
|
+
&:hover,
|
|
151
|
+
&[aria-expanded='true'] {
|
|
149
152
|
color: var(--button-content-color-danger-hover);
|
|
150
153
|
border-color: var(--button-border-color-danger-hover);
|
|
151
154
|
background-color: var(--button-bg-color-danger-hover);
|
|
@@ -249,20 +249,29 @@ export const button = css`
|
|
|
249
249
|
--button-group-divider-opacity: 1;
|
|
250
250
|
--button-group-divider-color-disabled: var(--color-warm-grey-2); // @presenter Color
|
|
251
251
|
|
|
252
|
-
.button-group-primary {
|
|
253
|
-
--button-group-divider-color: var(--button-
|
|
252
|
+
.button-group-primary .button {
|
|
253
|
+
--button-group-divider-color: var(--button-color); // @presenter Color
|
|
254
254
|
--button-group-divider-opacity: 0.32;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
.button-group-secondary {
|
|
258
|
-
--button-group-divider-color: var(--button-
|
|
257
|
+
.button-group-secondary .button {
|
|
258
|
+
--button-group-divider-color: var(--button-color); // @presenter Color
|
|
259
259
|
--button-group-divider-opacity: 0.12;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
.button-group-outlined {
|
|
262
|
+
.button-group-outlined .button {
|
|
263
263
|
--button-group-divider-color: var(--button-border-color); // @presenter Color
|
|
264
264
|
--button-group-divider-opacity: 1;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
+
.button-group-primary .button.button-tone-danger,
|
|
268
|
+
.button-group-secondary .button.button-tone-danger {
|
|
269
|
+
--button-group-divider-color: var(--button-content-color-danger); // @presenter Color
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.button-group-outlined .button.button-tone-danger {
|
|
273
|
+
--button-group-divider-color: var(--button-border-color-danger); // @presenter Color
|
|
274
|
+
}
|
|
275
|
+
|
|
267
276
|
// @tokens End
|
|
268
277
|
`;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
2
3
|
|
|
3
4
|
import type { JSX } from 'react';
|
|
4
5
|
|
|
@@ -18,24 +19,31 @@ export function DownloadButton({
|
|
|
18
19
|
}: DownloadButtonProps): JSX.Element {
|
|
19
20
|
const { useTranslate } = useThemeHooks();
|
|
20
21
|
const { translate } = useTranslate();
|
|
22
|
+
const label = translate('button.download.tooltipText', 'Download description');
|
|
21
23
|
|
|
22
24
|
return (
|
|
23
25
|
<div data-component-name="Buttons/DownloadButton">
|
|
24
|
-
<Tooltip
|
|
25
|
-
|
|
26
|
-
placement="top"
|
|
27
|
-
arrowPosition="right"
|
|
28
|
-
>
|
|
29
|
-
<a href={data} target="_blank" download rel="noreferrer">
|
|
26
|
+
<Tooltip tip={label} placement="top" arrowPosition="right">
|
|
27
|
+
<DownloadLink href={data} target="_blank" download rel="noreferrer" aria-label={label}>
|
|
30
28
|
<Button
|
|
31
29
|
variant="text"
|
|
32
30
|
size="small"
|
|
33
|
-
aria-
|
|
31
|
+
aria-hidden={true}
|
|
32
|
+
tabIndex={-1}
|
|
34
33
|
icon={<DownloadIcon />}
|
|
35
34
|
data-testid={dataTestId}
|
|
36
35
|
/>
|
|
37
|
-
</
|
|
36
|
+
</DownloadLink>
|
|
38
37
|
</Tooltip>
|
|
39
38
|
</div>
|
|
40
39
|
);
|
|
41
40
|
}
|
|
41
|
+
|
|
42
|
+
const DownloadLink = styled.a`
|
|
43
|
+
text-decoration: none;
|
|
44
|
+
border-radius: var(--button-border-radius);
|
|
45
|
+
|
|
46
|
+
&:focus-visible {
|
|
47
|
+
outline: 1px solid var(--button-border-color-focused);
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React, { useState, useMemo
|
|
1
|
+
import React, { type JSX, useState, useMemo } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { CatalogEntityConfig } from '@redocly/config';
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
import {
|
|
5
|
+
import type {
|
|
6
|
+
ResolvedFilter,
|
|
8
7
|
BffCatalogEntityList,
|
|
9
8
|
CatalogSwitcherItem,
|
|
10
9
|
CatalogViewMode,
|
|
11
10
|
} from '@redocly/theme/core/types';
|
|
11
|
+
|
|
12
12
|
import {
|
|
13
13
|
breakpoints,
|
|
14
14
|
customCatalogOptionsCasing,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import styled, { css } from 'styled-components';
|
|
3
4
|
|
|
4
|
-
import { CatalogViewMode } from '@redocly/theme/core/types';
|
|
5
|
+
import type { CatalogViewMode } from '@redocly/theme/core/types';
|
|
5
6
|
import { FilterInput } from '@redocly/theme/components/Filter/FilterInput';
|
|
6
7
|
import { CatalogSortButton } from '@redocly/theme/components/Catalog/CatalogSortButton';
|
|
7
8
|
import { CatalogViewModeToggle } from '@redocly/theme/components/Catalog/CatalogViewModeToggle';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
|
|
4
5
|
import type { CatalogEntityConfig } from '@redocly/config';
|
|
5
6
|
|
|
6
|
-
import { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
7
|
+
import type { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
7
8
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
8
9
|
import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
|
|
9
10
|
import { GraphIcon } from '@redocly/theme/icons/GraphIcon/GraphIcon';
|