@redocly/theme 0.69.0-next.9 → 0.70.0-next.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/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/CatalogEntities.js +1 -0
- 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 -1
- package/lib/components/Filter/FilterOptionLabel.d.ts +1 -1
- package/lib/components/LoadMore/LoadMore.d.ts +1 -1
- package/lib/components/MCP/McpConnectionTabs.js +22 -12
- package/lib/components/Markdown/Markdown.js +1 -3
- package/lib/components/Markdown/styles/base-table.js +8 -0
- package/lib/components/Markdown/variables.js +1 -2
- package/lib/components/PageActions/PageActions.d.ts +1 -1
- package/lib/components/Search/SearchAiDialog.d.ts +1 -1
- package/lib/components/Search/SearchAiDialog.js +3 -0
- 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/core/constants/markdown.d.ts +2 -0
- package/lib/core/constants/markdown.js +3 -1
- package/lib/core/contexts/AccordionGroupContext.d.ts +1 -0
- package/lib/core/contexts/AccordionGroupContext.js +6 -0
- package/lib/core/contexts/PageActionsContext.d.ts +5 -0
- package/lib/core/contexts/PageActionsContext.js +10 -0
- package/lib/core/contexts/index.d.ts +2 -0
- package/lib/core/contexts/index.js +2 -0
- package/lib/core/hooks/catalog/use-catalog-entity-schema.d.ts +1 -1
- 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-steps.js +1 -0
- package/lib/core/hooks/use-active-heading.js +4 -0
- package/lib/core/hooks/use-active-section-id.js +6 -0
- package/lib/core/hooks/use-connect-mcp-button.js +7 -2
- package/lib/core/hooks/use-element-size.d.ts +1 -1
- package/lib/core/hooks/use-product-picker.js +1 -1
- package/lib/core/hooks/use-tabs.js +4 -2
- package/lib/core/hooks/use-telemetry-fallback.d.ts +2 -0
- package/lib/core/hooks/use-telemetry-fallback.js +2 -0
- package/lib/core/styles/global.js +1 -0
- 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 -7
- package/lib/core/utils/class-names.d.ts +1 -0
- package/lib/core/utils/class-names.js +7 -0
- 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/Accordion/Accordion.js +6 -6
- package/lib/markdoc/components/Accordion/AccordionGroup.d.ts +2 -1
- package/lib/markdoc/components/Accordion/AccordionGroup.js +39 -3
- 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/Heading/Heading.js +5 -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/accordion-group.js +3 -0
- package/lib/markdoc/tags/code-walkthrough.d.ts +1 -1
- package/lib/markdoc/tags/markdoc-example.js +34 -22
- package/package.json +2 -2
- 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 +4 -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 -1
- package/src/components/Filter/FilterOptionLabel.tsx +1 -1
- package/src/components/LoadMore/LoadMore.tsx +2 -1
- package/src/components/MCP/McpConnectionTabs.tsx +35 -14
- package/src/components/Markdown/Markdown.tsx +1 -3
- package/src/components/Markdown/styles/base-table.ts +8 -0
- package/src/components/Markdown/variables.ts +1 -2
- package/src/components/PageActions/PageActions.tsx +2 -1
- package/src/components/Search/SearchAiDialog.tsx +4 -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/core/constants/markdown.ts +4 -0
- package/src/core/contexts/AccordionGroupContext.tsx +3 -0
- package/src/core/contexts/PageActionsContext.tsx +7 -0
- package/src/core/contexts/index.ts +2 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +2 -0
- package/src/core/hooks/catalog/use-catalog-entity-schema.ts +1 -1
- 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/use-code-walkthrough-steps.ts +1 -0
- package/src/core/hooks/menu/__mocks__/use-mobile-menu-items.ts +1 -1
- package/src/core/hooks/use-active-heading.ts +4 -0
- package/src/core/hooks/use-active-section-id.ts +8 -0
- package/src/core/hooks/use-connect-mcp-button.ts +8 -2
- package/src/core/hooks/use-element-size.ts +2 -1
- package/src/core/hooks/use-product-picker.ts +2 -2
- package/src/core/hooks/use-tabs.ts +4 -2
- package/src/core/hooks/use-telemetry-fallback.ts +2 -0
- package/src/core/styles/global.ts +1 -0
- package/src/core/types/catalog.ts +7 -3
- package/src/core/types/common.ts +1 -1
- package/src/core/types/hooks.ts +15 -13
- package/src/core/utils/class-names.ts +8 -0
- 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/Accordion/Accordion.tsx +8 -2
- package/src/markdoc/components/Accordion/AccordionGroup.tsx +9 -2
- 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/Heading/Heading.tsx +7 -4
- package/src/markdoc/components/Tabs/Tab.tsx +1 -1
- package/src/markdoc/components/Tabs/TabList.tsx +1 -1
- package/src/markdoc/tags/accordion-group.ts +3 -0
- package/src/markdoc/tags/code-walkthrough.ts +2 -1
- package/src/markdoc/tags/markdoc-example.ts +45 -28
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
|
|
5
5
|
import { CatalogEntityTypeIcon } from '@redocly/theme/components/Catalog/CatalogEntityTypeIcon';
|
|
6
|
-
import { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
6
|
+
import type { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
7
7
|
|
|
8
8
|
type Entity = Pick<BffCatalogEntity, 'type' | 'title' | 'summary'>;
|
|
9
9
|
export type CatalogEntityCellProps<T extends Entity> = {
|
|
@@ -4,7 +4,7 @@ import styled, { css } from 'styled-components';
|
|
|
4
4
|
import { CaretDownIcon } from '@redocly/theme/icons/CaretDownIcon/CaretDownIcon';
|
|
5
5
|
import { CaretUpIcon } from '@redocly/theme/icons/CaretUpIcon/CaretUpIcon';
|
|
6
6
|
import { useCatalogTableHeaderCellActions } from '@redocly/theme/core/hooks';
|
|
7
|
-
import {
|
|
7
|
+
import type {
|
|
8
8
|
BaseEntity,
|
|
9
9
|
CatalogColumn,
|
|
10
10
|
} from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
3
|
+
import type { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
4
4
|
import { CatalogTags } from '@redocly/theme/components/Catalog/CatalogTags';
|
|
5
5
|
|
|
6
6
|
export type CatalogTagsCellProps = {
|
|
@@ -1,8 +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 { CATALOG_TAG_MAX_LENGTH } from '@redocly/theme/core/constants';
|
|
5
|
-
import {
|
|
6
|
+
import type { TagProps } from '@redocly/theme/components/Tag/Tag';
|
|
7
|
+
import { Tag } from '@redocly/theme/components/Tag/Tag';
|
|
6
8
|
import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
7
9
|
import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
|
|
8
10
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import { TableIcon } from '@redocly/theme/icons/TableIcon/TableIcon';
|
|
5
5
|
import { CardsIcon } from '@redocly/theme/icons/CardsIcon/CardsIcon';
|
|
6
|
-
import { CatalogViewMode } from '@redocly/theme/core/types';
|
|
6
|
+
import type { CatalogViewMode } from '@redocly/theme/core/types';
|
|
7
7
|
|
|
8
8
|
export type CatalogViewModeToggleProps = {
|
|
9
9
|
viewMode: CatalogViewMode;
|
|
@@ -471,33 +471,31 @@ export const catalog = css`
|
|
|
471
471
|
* @tokens Catalog history button
|
|
472
472
|
*/
|
|
473
473
|
--catalog-history-button-width: 252px;
|
|
474
|
-
--catalog-history-button-item-width: 244px;
|
|
475
474
|
--catalog-history-separator-border-color: var(--border-color-secondary);
|
|
476
|
-
--catalog-history-separator-margin
|
|
475
|
+
--catalog-history-separator-margin: var(--spacing-sm) 0;
|
|
477
476
|
--catalog-history-item-padding: var(--spacing-xxs);
|
|
478
|
-
--catalog-history-item-
|
|
479
|
-
--catalog-history-item-
|
|
480
|
-
--catalog-history-item-border-radius: var(--menu-item-label-border-radius);
|
|
477
|
+
--catalog-history-item-gap: var(--spacing-xxs);
|
|
478
|
+
--catalog-history-item-border-radius: var(--border-radius-lg);
|
|
481
479
|
--catalog-history-item-bg-color-hover: var(--menu-item-bg-color-hover);
|
|
482
480
|
--catalog-history-icon-size: 16px;
|
|
483
|
-
--catalog-history-
|
|
481
|
+
--catalog-history-icon-gap: 2px;
|
|
484
482
|
--catalog-history-text-font-family: var(--font-family-base);
|
|
485
483
|
--catalog-history-text-font-size: var(--font-size-base);
|
|
486
484
|
--catalog-history-text-font-weight: var(--font-weight-regular);
|
|
487
485
|
--catalog-history-text-line-height: var(--line-height-base);
|
|
488
|
-
--catalog-history-text-color: var(--
|
|
486
|
+
--catalog-history-text-color: var(--menu-content-color);
|
|
489
487
|
--catalog-history-pill-gap: var(--spacing-xxs);
|
|
488
|
+
--catalog-history-pill-height: 22px;
|
|
490
489
|
--catalog-history-pill-padding-vertical: 1px;
|
|
491
490
|
--catalog-history-pill-padding-horizontal: var(--spacing-xs);
|
|
492
491
|
--catalog-history-pill-border-color: var(--border-color-primary);
|
|
493
|
-
--catalog-history-pill-border-radius:
|
|
494
|
-
--catalog-history-pill-icon-size:
|
|
492
|
+
--catalog-history-pill-border-radius: var(--border-radius-xl);
|
|
493
|
+
--catalog-history-pill-icon-size: 14px;
|
|
495
494
|
--catalog-history-pill-icon-color: var(--color-green-8);
|
|
496
495
|
--catalog-history-pill-font-family: var(--font-family-base);
|
|
497
496
|
--catalog-history-pill-font-size: var(--font-size-base);
|
|
498
497
|
--catalog-history-pill-line-height: var(--line-height-base);
|
|
499
498
|
--catalog-history-pill-text-color: var(--text-color-primary);
|
|
500
|
-
--catalog-history-pill-min-width: calc(100% - 118px - var(--catalog-history-item-gap));
|
|
501
499
|
// @tokens End
|
|
502
500
|
|
|
503
501
|
/**
|
|
@@ -506,50 +504,44 @@ export const catalog = css`
|
|
|
506
504
|
--catalog-history-sidebar-width: 320px;
|
|
507
505
|
--catalog-history-sidebar-bg-color: var(--sidebar-bg-color);
|
|
508
506
|
--catalog-history-sidebar-border-color: var(--border-color-secondary);
|
|
507
|
+
--catalog-history-sidebar-padding: var(--spacing-base) var(--spacing-base) 0;
|
|
508
|
+
--catalog-history-sidebar-divider-margin: var(--spacing-sm) 0 0;
|
|
509
509
|
|
|
510
|
-
--catalog-history-sidebar-header-padding: var(--spacing-
|
|
510
|
+
--catalog-history-sidebar-header-padding: var(--spacing-xxs);
|
|
511
511
|
--catalog-history-sidebar-header-font-family: var(--font-family-base);
|
|
512
512
|
--catalog-history-sidebar-header-font-size: var(--font-size-base);
|
|
513
513
|
--catalog-history-sidebar-header-font-weight: var(--font-weight-regular);
|
|
514
514
|
--catalog-history-sidebar-header-line-height: var(--line-height-base);
|
|
515
515
|
--catalog-history-sidebar-header-letter-spacing: 0;
|
|
516
|
-
--catalog-history-sidebar-header-color: var(--
|
|
516
|
+
--catalog-history-sidebar-header-color: var(--menu-content-color);
|
|
517
517
|
|
|
518
|
-
--catalog-history-sidebar-close-button-size:
|
|
519
|
-
--catalog-history-sidebar-close-button-border-radius: var(--border-radius-
|
|
518
|
+
--catalog-history-sidebar-close-button-size: 22px;
|
|
519
|
+
--catalog-history-sidebar-close-button-border-radius: var(--border-radius-xl);
|
|
520
520
|
--catalog-history-sidebar-close-button-bg-color-hover: var(--color-hover-base);
|
|
521
521
|
--catalog-history-sidebar-close-icon-color: var(--text-color-primary);
|
|
522
522
|
|
|
523
|
-
--catalog-history-sidebar-
|
|
524
|
-
--catalog-history-sidebar-content-margin-top: calc(var(--spacing-xxs) * -1);
|
|
525
|
-
|
|
526
|
-
--catalog-history-sidebar-version-header-padding: var(--spacing-xs) var(--spacing-xxs);
|
|
523
|
+
--catalog-history-sidebar-version-header-padding: var(--spacing-xxs);
|
|
527
524
|
--catalog-history-sidebar-version-header-border-radius: var(--border-radius-md);
|
|
528
525
|
--catalog-history-sidebar-version-header-bg-color-hover: var(--color-hover-base);
|
|
526
|
+
--catalog-history-sidebar-version-header-bg-color-current: var(--menu-item-bg-color-active);
|
|
529
527
|
|
|
530
|
-
--catalog-history-sidebar-version-icon-size:
|
|
531
|
-
--catalog-history-sidebar-version-icon-color: var(--text-color-
|
|
528
|
+
--catalog-history-sidebar-version-icon-size: 20px;
|
|
529
|
+
--catalog-history-sidebar-version-icon-color: var(--text-color-primary);
|
|
532
530
|
--catalog-history-sidebar-version-icon-color-current: var(--color-static-white);
|
|
533
|
-
--catalog-history-sidebar-version-icon-margin-right: var(--spacing-
|
|
531
|
+
--catalog-history-sidebar-version-icon-margin-right: var(--spacing-xxs);
|
|
534
532
|
--catalog-history-sidebar-chevron-icon-color: var(--text-color-secondary);
|
|
535
|
-
--catalog-history-sidebar-version-info-gap: 2px;
|
|
536
533
|
|
|
537
534
|
--catalog-history-sidebar-version-title-font-family: var(--font-family-base);
|
|
538
535
|
--catalog-history-sidebar-version-title-font-size: var(--font-size-base);
|
|
539
|
-
--catalog-history-sidebar-version-title-font-weight: var(--font-weight-
|
|
536
|
+
--catalog-history-sidebar-version-title-font-weight: var(--font-weight-regular);
|
|
540
537
|
--catalog-history-sidebar-version-title-line-height: var(--line-height-base);
|
|
541
|
-
--catalog-history-sidebar-version-title-color: var(--
|
|
542
|
-
|
|
543
|
-
--catalog-history-sidebar-version-date-font-family: var(--font-family-base);
|
|
544
|
-
--catalog-history-sidebar-version-date-font-size: var(--font-size-sm);
|
|
545
|
-
--catalog-history-sidebar-version-date-font-weight: var(--font-weight-regular);
|
|
546
|
-
--catalog-history-sidebar-version-date-line-height: var(--line-height-sm);
|
|
547
|
-
--catalog-history-sidebar-version-date-color: var(--color-warm-grey-7);
|
|
538
|
+
--catalog-history-sidebar-version-title-color: var(--menu-content-color);
|
|
548
539
|
|
|
549
|
-
--catalog-history-sidebar-revisions-padding-left:
|
|
540
|
+
--catalog-history-sidebar-revisions-padding-left: 28px;
|
|
550
541
|
--catalog-history-sidebar-revisions-padding-bottom: var(--spacing-base);
|
|
542
|
+
--catalog-history-sidebar-revision-line-left: 14px;
|
|
551
543
|
|
|
552
|
-
--catalog-history-sidebar-revision-item-padding: var(--spacing-
|
|
544
|
+
--catalog-history-sidebar-revision-item-padding: var(--spacing-xxs) var(--spacing-sm);
|
|
553
545
|
--catalog-history-sidebar-revision-item-border-radius: var(--border-radius-md);
|
|
554
546
|
--catalog-history-sidebar-revision-item-bg-color-hover: var(--bg-color-hover);
|
|
555
547
|
|
|
@@ -573,7 +565,6 @@ export const catalog = css`
|
|
|
573
565
|
/**
|
|
574
566
|
* @tokens Catalog history tag border radius
|
|
575
567
|
*/
|
|
576
|
-
--catalog-history-sidebar-version-tag-border-radius: var(--border-radius-xl);
|
|
577
568
|
--catalog-history-sidebar-revision-tag-border-radius: var(--border-radius-xl);
|
|
578
569
|
// @tokens End
|
|
579
570
|
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type JSX } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { JSX } from 'react';
|
|
5
|
-
|
|
6
4
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
7
|
-
import { getScorecardColorVariable } from '@redocly/theme/core/utils';
|
|
5
|
+
import { getScorecardColorVariable, getBaseDataAttributes } from '@redocly/theme/core/utils';
|
|
8
6
|
import { Tag } from '@redocly/theme/components/Tag/Tag';
|
|
9
7
|
import { Link } from '@redocly/theme/components/Link/Link';
|
|
10
|
-
import { getBaseDataAttributes } from '@redocly/theme/core/utils';
|
|
11
8
|
|
|
12
9
|
export type CatalogClassicInfoBlockProps = {
|
|
13
10
|
metadata?: {
|
|
@@ -2,7 +2,7 @@ import React, { useMemo, useEffect, useState } from 'react';
|
|
|
2
2
|
import { useWindowVirtualizer } from '@tanstack/react-virtual';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
|
-
import { CatalogItem, ResolvedFilter } from '@redocly/theme/core/types';
|
|
5
|
+
import type { CatalogItem, ResolvedFilter } from '@redocly/theme/core/types';
|
|
6
6
|
import { useElementSize } from '@redocly/theme/core/hooks';
|
|
7
7
|
import { CatalogClassicCard } from '@redocly/theme/components/CatalogClassic/CatalogClassicCard';
|
|
8
8
|
import { CounterTag } from '@redocly/theme/components/Tags/CounterTag';
|
|
@@ -7,7 +7,8 @@ import type { CodeBlockItems } from '@redocly/theme/components/CodeBlock/CodeBlo
|
|
|
7
7
|
import { CodeBlockTabs } from '@redocly/theme/components/CodeBlock/CodeBlockTabs';
|
|
8
8
|
import { CopyButton } from '@redocly/theme/components/Buttons/CopyButton';
|
|
9
9
|
import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
10
|
-
import {
|
|
10
|
+
import type { ReportButtonProps } from '@redocly/theme/core/hooks';
|
|
11
|
+
import { useThemeHooks, useThemeConfig } from '@redocly/theme/core/hooks';
|
|
11
12
|
import { DeselectIcon } from '@redocly/theme/icons/DeselectIcon/DeselectIcon';
|
|
12
13
|
import { MaximizeIcon } from '@redocly/theme/icons/MaximizeIcon/MaximizeIcon';
|
|
13
14
|
import { MinimizeIcon } from '@redocly/theme/icons/MinimizeIcon/MinimizeIcon';
|
|
@@ -116,8 +116,12 @@ export const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
116
116
|
const wrapper = wrapperRef.current;
|
|
117
117
|
if (!wrapper) return;
|
|
118
118
|
const rect = wrapper.getBoundingClientRect();
|
|
119
|
+
const menuHeight = menuRef.current?.offsetHeight ?? 0;
|
|
120
|
+
const fitsBelow = rect.bottom + menuHeight <= window.innerHeight;
|
|
121
|
+
const fitsAbove = rect.top - menuHeight >= 0;
|
|
122
|
+
const openUpward = placement === 'top' ? fitsAbove || !fitsBelow : !fitsBelow && fitsAbove;
|
|
119
123
|
const style: CSSProperties = { minWidth: rect.width };
|
|
120
|
-
if (
|
|
124
|
+
if (openUpward) {
|
|
121
125
|
style.bottom = window.innerHeight - rect.top;
|
|
122
126
|
} else {
|
|
123
127
|
style.top = rect.bottom;
|
|
@@ -3,13 +3,15 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import type { JSX, ReactNode } from 'react';
|
|
5
5
|
import type { TFunction } from '@redocly/theme/core/types';
|
|
6
|
+
import type { AsyncApiRealmUI } from '@redocly/realm-asyncapi-sdk';
|
|
7
|
+
import type { CodeBlockControlsProps } from '@redocly/theme/components/CodeBlock/CodeBlockControls';
|
|
6
8
|
|
|
7
9
|
import { useMCPConfig, useThemeHooks } from '@redocly/theme/core/hooks';
|
|
8
10
|
import {
|
|
9
11
|
generateClaudeCodeCommand,
|
|
10
|
-
generateClaudeDesktopConfig,
|
|
11
12
|
generateCodexCommand,
|
|
12
13
|
generateMcpInstallPrompt,
|
|
14
|
+
getBaseDataAttributes,
|
|
13
15
|
} from '@redocly/theme/core/utils';
|
|
14
16
|
import { CodeBlock } from '@redocly/theme/components/CodeBlock/CodeBlock';
|
|
15
17
|
import { ClaudeIcon } from '@redocly/theme/icons/ClaudeIcon/ClaudeIcon';
|
|
@@ -47,15 +49,18 @@ const TAB_LABELS: Record<
|
|
|
47
49
|
|
|
48
50
|
type TabClient = { headline: string; content: ReactNode };
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
type SnippetId =
|
|
53
|
+
AsyncApiRealmUI.EventPayload<'com.redocly.mcpConnectionSnippet.copied'>[0]['snippet'];
|
|
54
|
+
|
|
55
|
+
type SnippetHeader = (client: McpConnectionTab, snippet: SnippetId) => CodeBlockControlsProps;
|
|
52
56
|
|
|
53
57
|
export function McpConnectionTabs({
|
|
54
58
|
options = DEFAULT_TAB_OPTIONS,
|
|
55
59
|
className,
|
|
56
60
|
}: McpConnectionTabsProps): JSX.Element | null {
|
|
57
|
-
const { useTranslate } = useThemeHooks();
|
|
61
|
+
const { useTranslate, useTelemetry } = useThemeHooks();
|
|
58
62
|
const { translate } = useTranslate();
|
|
63
|
+
const telemetry = useTelemetry();
|
|
59
64
|
const { serverName, serverUrl, isMcpDisabled } = useMCPConfig();
|
|
60
65
|
// The SSR markup of error pages is cached with the build-time origin, so the
|
|
61
66
|
// tabs remount after hydration to pick up the real browser origin.
|
|
@@ -69,6 +74,19 @@ export function McpConnectionTabs({
|
|
|
69
74
|
|
|
70
75
|
const connection = { serverName, url: serverUrl };
|
|
71
76
|
|
|
77
|
+
const snippetHeader: SnippetHeader = (client, snippet) => ({
|
|
78
|
+
controls: {
|
|
79
|
+
copy: {
|
|
80
|
+
onClick: () =>
|
|
81
|
+
telemetry.sendMcpConnectionSnippetCopiedMessage([
|
|
82
|
+
{ ...getBaseDataAttributes('mcpConnectionSnippet', 'button'), client, snippet },
|
|
83
|
+
]),
|
|
84
|
+
},
|
|
85
|
+
// The report control is docs feedback, not useful on the connection page.
|
|
86
|
+
report: { hidden: true },
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
72
90
|
return (
|
|
73
91
|
<McpConnectionTabsWrapper
|
|
74
92
|
key={hydrated ? 'client' : 'ssr'}
|
|
@@ -86,7 +104,7 @@ export function McpConnectionTabs({
|
|
|
86
104
|
label={translate(translationKey, defaultLabel)}
|
|
87
105
|
icon={TabIcon ? <TabIcon /> : undefined}
|
|
88
106
|
>
|
|
89
|
-
{renderTabContent(option, connection, translate)}
|
|
107
|
+
{renderTabContent(option, connection, translate, snippetHeader)}
|
|
90
108
|
</TabItemFragment>
|
|
91
109
|
);
|
|
92
110
|
})}
|
|
@@ -99,6 +117,7 @@ function renderTabContent(
|
|
|
99
117
|
option: McpConnectionTab,
|
|
100
118
|
connection: { serverName: string; url: string },
|
|
101
119
|
translate: TFunction,
|
|
120
|
+
snippetHeader: SnippetHeader,
|
|
102
121
|
): ReactNode {
|
|
103
122
|
const terminalHint = (
|
|
104
123
|
<TabHint>
|
|
@@ -106,7 +125,9 @@ function renderTabContent(
|
|
|
106
125
|
</TabHint>
|
|
107
126
|
);
|
|
108
127
|
|
|
109
|
-
const urlBlock =
|
|
128
|
+
const urlBlock = (
|
|
129
|
+
<CodeBlock lang="text" source={connection.url} header={snippetHeader(option, 'chatgpt-app')} />
|
|
130
|
+
);
|
|
110
131
|
|
|
111
132
|
const assistantPromptClient: TabClient = {
|
|
112
133
|
headline: translate('page.mcpNotAllowed.snippets.prompt.headline', 'Prompt'),
|
|
@@ -121,7 +142,7 @@ function renderTabContent(
|
|
|
121
142
|
<CodeBlock
|
|
122
143
|
lang="text"
|
|
123
144
|
source={generateMcpInstallPrompt(connection)}
|
|
124
|
-
header={
|
|
145
|
+
header={snippetHeader(option, 'prompt')}
|
|
125
146
|
wrapContents
|
|
126
147
|
/>
|
|
127
148
|
</>
|
|
@@ -139,7 +160,7 @@ function renderTabContent(
|
|
|
139
160
|
<CodeBlock
|
|
140
161
|
lang="shell"
|
|
141
162
|
source={generateClaudeCodeCommand(connection)}
|
|
142
|
-
header={
|
|
163
|
+
header={snippetHeader(option, 'claude-code')}
|
|
143
164
|
wrapContents
|
|
144
165
|
/>
|
|
145
166
|
</>
|
|
@@ -155,13 +176,13 @@ function renderTabContent(
|
|
|
155
176
|
<TabHint>
|
|
156
177
|
{translate(
|
|
157
178
|
'page.mcpNotAllowed.snippets.claudeDesktop.instruction',
|
|
158
|
-
'
|
|
179
|
+
'Open Customize → Connectors → Add custom connector and paste this server URL:',
|
|
159
180
|
)}
|
|
160
181
|
</TabHint>
|
|
161
182
|
<CodeBlock
|
|
162
|
-
lang="
|
|
163
|
-
source={
|
|
164
|
-
header={
|
|
183
|
+
lang="text"
|
|
184
|
+
source={connection.url}
|
|
185
|
+
header={snippetHeader(option, 'claude-desktop')}
|
|
165
186
|
/>
|
|
166
187
|
</>
|
|
167
188
|
),
|
|
@@ -177,7 +198,7 @@ function renderTabContent(
|
|
|
177
198
|
<CodeBlock
|
|
178
199
|
lang="shell"
|
|
179
200
|
source={generateCodexCommand(connection)}
|
|
180
|
-
header={
|
|
201
|
+
header={snippetHeader(option, 'codex')}
|
|
181
202
|
wrapContents
|
|
182
203
|
/>
|
|
183
204
|
</>
|
|
@@ -218,7 +239,7 @@ function renderTabContent(
|
|
|
218
239
|
null,
|
|
219
240
|
2,
|
|
220
241
|
)}
|
|
221
|
-
header={
|
|
242
|
+
header={snippetHeader(option, 'json')}
|
|
222
243
|
/>
|
|
223
244
|
</>
|
|
224
245
|
);
|
|
@@ -167,10 +167,8 @@ export const Markdown = styled.main
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
hr {
|
|
170
|
-
border-top: 1px solid var(--md-hr-border-color);
|
|
171
|
-
background-color: var(--md-hr-bg-color);
|
|
172
|
-
height: var(--md-hr-height);
|
|
173
170
|
margin: var(--md-hr-margin-vertical) 0;
|
|
171
|
+
border: var(--md-hr-border);
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
details:not(${ACCORDION_SELECTOR}) {
|
|
@@ -45,6 +45,14 @@ export const markdownBaseTableCss = css`
|
|
|
45
45
|
background-color: var(--md-table-header-bg-color);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/* hide the header row when every cell is empty; one labelled cell keeps it visible */
|
|
49
|
+
thead:has(th:empty) {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
thead:has(th:not(:empty)) {
|
|
53
|
+
display: table-header-group;
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
tr {
|
|
49
57
|
background-color: var(--md-table-stripe-bg-color);
|
|
50
58
|
}
|
|
@@ -60,9 +60,8 @@ export const markdown = css`
|
|
|
60
60
|
* @tokens Markdown Horizontal Rule
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
|
-
--md-hr-bg-color: transparent; // @presenter Color
|
|
64
63
|
--md-hr-border-color: var(--border-color-secondary); // @presenter Color
|
|
65
|
-
--md-hr-
|
|
64
|
+
--md-hr-border: 0.5px solid var(--md-hr-border-color); // @presenter Border
|
|
66
65
|
--md-hr-margin-vertical: 20px; // @presenter Spacing
|
|
67
66
|
|
|
68
67
|
/**
|
|
@@ -12,7 +12,8 @@ import { SplitButton } from '@redocly/theme/components/SplitButton/SplitButton';
|
|
|
12
12
|
import { DropdownMenu } from '@redocly/theme/components/Dropdown/DropdownMenu';
|
|
13
13
|
import { Spinner } from '@redocly/theme/icons/Spinner/Spinner';
|
|
14
14
|
import { CheckmarkFilledIcon } from '@redocly/theme/icons/CheckmarkFilledIcon/CheckmarkFilledIcon';
|
|
15
|
-
import { PageActionType
|
|
15
|
+
import type { PageActionType } from '@redocly/theme/core/hooks';
|
|
16
|
+
import { usePageActions, useThemeHooks } from '@redocly/theme/core/hooks';
|
|
16
17
|
|
|
17
18
|
type ActionState = 'idle' | 'processing' | 'done';
|
|
18
19
|
|
|
@@ -13,8 +13,8 @@ import type {
|
|
|
13
13
|
import { useThemeConfig, useThemeHooks } from '@redocly/theme/core/hooks';
|
|
14
14
|
import { Button } from '@redocly/theme/components/Button/Button';
|
|
15
15
|
import { SearchAiConversationInput } from '@redocly/theme/components/Search/SearchAiConversationInput';
|
|
16
|
+
import type { AiSearchError } from '@redocly/theme/core/constants';
|
|
16
17
|
import {
|
|
17
|
-
AiSearchError,
|
|
18
18
|
AI_SEARCH_ERROR_CONFIG as ERROR_CONFIG,
|
|
19
19
|
AiSearchConversationRole,
|
|
20
20
|
} from '@redocly/theme/core/constants';
|
|
@@ -94,6 +94,7 @@ export function SearchAiDialog({
|
|
|
94
94
|
if (!initialMessage?.trim().length) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent -- appends the initial message into the conversation state lifted to the search root once the dialog mounts
|
|
97
98
|
setConversation((prev) => [
|
|
98
99
|
...prev,
|
|
99
100
|
{ role: AiSearchConversationRole.USER, content: initialMessage },
|
|
@@ -105,6 +106,7 @@ export function SearchAiDialog({
|
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
108
|
|
|
109
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent -- merges the streamed assistant response into the lifted conversation state as chunks arrive
|
|
108
110
|
setConversation((prev) => {
|
|
109
111
|
const lastMessage = prev[prev.length - 1];
|
|
110
112
|
const content: string = response || '';
|
|
@@ -146,6 +148,7 @@ export function SearchAiDialog({
|
|
|
146
148
|
|
|
147
149
|
useEffect(() => {
|
|
148
150
|
if (error) {
|
|
151
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent -- drops the pending message from the lifted conversation state once the request errors
|
|
149
152
|
setConversation((prev) => prev.slice(0, -1));
|
|
150
153
|
}
|
|
151
154
|
}, [error, setConversation]);
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import React, { memo, useState } from 'react';
|
|
1
|
+
import React, { memo, useState, type JSX } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { JSX } from 'react';
|
|
5
|
-
|
|
6
4
|
import {
|
|
7
5
|
FeedbackType,
|
|
8
6
|
type SearchAiMessageResource,
|
|
9
7
|
type ToolCall,
|
|
10
8
|
type ContentSegment,
|
|
9
|
+
ToolCallName,
|
|
11
10
|
} from '@redocly/theme/core/types';
|
|
12
|
-
import { TOOL_CALL_DISPLAY_TEXT } from '@redocly/theme/core/constants';
|
|
13
|
-
import { ToolCallName } from '@redocly/theme/core/types';
|
|
11
|
+
import { TOOL_CALL_DISPLAY_TEXT, AiSearchConversationRole } from '@redocly/theme/core/constants';
|
|
14
12
|
import { Link } from '@redocly/theme/components/Link/Link';
|
|
15
13
|
import { Tag } from '@redocly/theme/components/Tag/Tag';
|
|
16
|
-
import { AiSearchConversationRole } from '@redocly/theme/core/constants';
|
|
17
14
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
18
15
|
import { Markdown } from '@redocly/theme/components/Markdown/Markdown';
|
|
19
16
|
import { DocumentIcon } from '@redocly/theme/icons/DocumentIcon/DocumentIcon';
|
|
@@ -13,10 +13,8 @@ import { Markdown } from '@redocly/theme/components/Markdown/Markdown';
|
|
|
13
13
|
import { Typography } from '@redocly/theme/components/Typography/Typography';
|
|
14
14
|
import { Admonition } from '@redocly/theme/components/Admonition/Admonition';
|
|
15
15
|
import { ErrorFilledIcon } from '@redocly/theme/icons/ErrorFilledIcon/ErrorFilledIcon';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
AI_SEARCH_ERROR_CONFIG as ERROR_CONFIG,
|
|
19
|
-
} from '@redocly/theme/core/constants';
|
|
16
|
+
import type { AiSearchError } from '@redocly/theme/core/constants';
|
|
17
|
+
import { AI_SEARCH_ERROR_CONFIG as ERROR_CONFIG } from '@redocly/theme/core/constants';
|
|
20
18
|
import { ChatIcon } from '@redocly/theme/icons/ChatIcon/ChatIcon';
|
|
21
19
|
|
|
22
20
|
export type SearchAiResponseProps = {
|
|
@@ -3,11 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
type SearchFacet,
|
|
8
|
-
type SearchFacetCount,
|
|
9
|
-
type SearchFilterItem,
|
|
10
|
-
} from '@redocly/theme/core/types';
|
|
6
|
+
import type { SearchFacet, SearchFacetCount, SearchFilterItem } from '@redocly/theme/core/types';
|
|
11
7
|
import { Tag } from '@redocly/theme/components/Tag/Tag';
|
|
12
8
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
13
9
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Whether the first heading inside the enclosing `Markdown` mounts the page actions.
|
|
5
|
+
* Without a provider `Heading` falls back to the page type in the page metadata.
|
|
6
|
+
*/
|
|
7
|
+
export const PageActionsContext = createContext<boolean | null>(null);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './ThemeDataContext';
|
|
2
2
|
export * from './MarkdownLinkContext';
|
|
3
|
+
export * from './PageActionsContext';
|
|
3
4
|
export * from './CodeWalkthrough/CodeWalkthroughControlsContext';
|
|
4
5
|
export * from './CodeWalkthrough/CodeWalkthroughStepsContext';
|
|
6
|
+
export * from './AccordionGroupContext';
|
|
5
7
|
export * from './CodeSnippetContext';
|
|
6
8
|
export * from './SearchContext';
|
|
7
9
|
export * from './Toast/ToastContext';
|
|
@@ -18,6 +18,8 @@ export const useThemeHooks = vi.fn(() => ({
|
|
|
18
18
|
useTelemetry: vi.fn(() => ({
|
|
19
19
|
send: vi.fn(),
|
|
20
20
|
sendCodeSnippetReportedMessage: vi.fn(),
|
|
21
|
+
sendConnectMcpClickedMessage: vi.fn(),
|
|
22
|
+
sendMcpConnectionSnippetCopiedMessage: vi.fn(),
|
|
21
23
|
sendPageActionsButtonClickedMessage: vi.fn(),
|
|
22
24
|
sendColorModeSwitchedMessage: vi.fn(),
|
|
23
25
|
})),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo } from 'react';
|
|
2
2
|
import {
|
|
3
|
+
type OnNodesChange,
|
|
4
|
+
type OnEdgesChange,
|
|
3
5
|
addEdge,
|
|
4
6
|
type Node,
|
|
5
7
|
type Edge,
|
|
@@ -7,13 +9,11 @@ import {
|
|
|
7
9
|
useNodesState,
|
|
8
10
|
useEdgesState,
|
|
9
11
|
Position,
|
|
10
|
-
OnNodesChange,
|
|
11
|
-
OnEdgesChange,
|
|
12
12
|
} from '@xyflow/react';
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import type { CatalogEntityNodeData } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNode';
|
|
15
15
|
|
|
16
|
-
import { BffCatalogEntity, BffCatalogRelatedEntity } from '../../types';
|
|
16
|
+
import type { BffCatalogEntity, BffCatalogRelatedEntity } from '../../types';
|
|
17
17
|
import {
|
|
18
18
|
GraphCustomEdgeType,
|
|
19
19
|
GraphCustomNodeType,
|
|
@@ -95,6 +95,7 @@ export function useCodeWalkthroughSteps({
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-chain-state-updates -- marker geometry is derived from post-layout measurements (offsetTop, clientHeight, window.innerHeight)
|
|
98
99
|
setMarkers(
|
|
99
100
|
markers.reduce(
|
|
100
101
|
(acc, marker, index) => {
|
|
@@ -2,7 +2,7 @@ import { vi, type MockedFunction } from 'vitest';
|
|
|
2
2
|
|
|
3
3
|
import type { ResolvedNavItem } from '@redocly/config';
|
|
4
4
|
|
|
5
|
-
import { MobileMenuType } from '../../../constants/common';
|
|
5
|
+
import type { MobileMenuType } from '../../../constants/common';
|
|
6
6
|
|
|
7
7
|
export const useMobileMenuItems: MockedFunction<
|
|
8
8
|
(menuType: MobileMenuType) => {
|