@redocly/theme 0.69.0-next.0 → 0.69.0-next.10
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/Accordion/Accordion.js +5 -1
- package/lib/components/Accordion/variables.js +1 -1
- package/lib/components/Admonition/Admonition.d.ts +1 -1
- package/lib/components/Admonition/Admonition.js +1 -1
- package/lib/components/Admonition/variables.dark.js +2 -2
- package/lib/components/Admonition/variables.js +10 -10
- package/lib/components/Badge/Badge.d.ts +3 -1
- package/lib/components/Badge/Badge.js +7 -2
- package/lib/components/Banner/variables.dark.js +2 -0
- package/lib/components/Banner/variables.js +3 -1
- package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
- package/lib/components/Breadcrumbs/variables.js +1 -1
- package/lib/components/Button/ButtonGroup.d.ts +3 -5
- package/lib/components/Button/ButtonGroup.js +25 -5
- package/lib/components/Button/variables.js +27 -4
- package/lib/components/Buttons/ConnectMCPButton.js +39 -123
- package/lib/components/Buttons/CopyButton.js +12 -1
- package/lib/components/Buttons/variables.d.ts +0 -1
- package/lib/components/Buttons/variables.js +3 -44
- package/lib/components/Catalog/CatalogEntities.js +1 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +5 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +1 -0
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
- package/lib/components/Catalog/CatalogViewModeToggle.js +2 -43
- package/lib/components/Catalog/variables.js +5 -5
- package/lib/components/CatalogClassic/variables.js +2 -2
- package/lib/components/CodeBlock/CodeBlock.js +2 -1
- package/lib/components/CodeBlock/CodeBlockContainer.js +1 -0
- package/lib/components/Dropdown/Dropdown.d.ts +10 -20
- package/lib/components/Dropdown/Dropdown.js +13 -2
- package/lib/components/Dropdown/DropdownMenuItemContent.d.ts +9 -0
- package/lib/components/Dropdown/DropdownMenuItemContent.js +56 -0
- package/lib/components/Dropdown/variables.js +19 -2
- package/lib/components/Feedback/Mood.js +18 -14
- package/lib/components/Feedback/Rating.js +18 -13
- package/lib/components/Feedback/Scale.js +27 -22
- package/lib/components/Feedback/Sentiment.js +17 -13
- package/lib/components/Filter/FilterInput.js +4 -2
- package/lib/components/Filter/FilterSelect.js +1 -0
- package/lib/components/Filter/variables.js +2 -2
- package/lib/components/Image/variables.js +5 -3
- package/lib/components/JsonViewer/Helpers.js +12 -42
- package/lib/components/LanguagePicker/variables.js +1 -1
- package/lib/components/MCP/McpConnectionTabs.d.ts +7 -0
- package/lib/components/MCP/McpConnectionTabs.js +151 -0
- package/lib/components/Markdown/Markdown.js +1 -1
- package/lib/components/Markdown/styles/base-table.js +8 -0
- package/lib/components/Markdown/variables.js +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/Menu/variables.js +1 -1
- package/lib/components/Navbar/variables.js +1 -1
- package/lib/components/PageActions/PageActions.js +4 -6
- package/lib/components/PageActions/PageActionsMenuItem.d.ts +4 -4
- package/lib/components/PageActions/PageActionsMenuItem.js +27 -43
- package/lib/components/Panel/Panel.js +5 -1
- package/lib/components/Panel/variables.js +1 -1
- package/lib/components/Product/variables.js +2 -1
- package/lib/components/ReplayGate/ReplayGate.d.ts +1 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +22 -32
- package/lib/components/Search/SearchAiDialog.js +4 -1
- package/lib/components/Search/SearchAiMessage.js +1 -1
- package/lib/components/Search/SearchAiNegativeFeedbackForm.js +2 -2
- package/lib/components/Search/SearchDialog.js +2 -2
- package/lib/components/Search/SearchItem.js +6 -3
- package/lib/components/Search/SearchRecent.js +1 -0
- package/lib/components/Search/SearchSuggestedPages.js +1 -0
- package/lib/components/Search/variables.js +9 -5
- package/lib/components/Segmented/Segmented.js +3 -3
- package/lib/components/Select/Select.js +30 -23
- package/lib/components/Select/variables.js +3 -3
- package/lib/components/Sidebar/Sidebar.js +2 -38
- package/lib/components/SplitButton/SplitButton.d.ts +21 -0
- package/lib/components/SplitButton/SplitButton.js +37 -0
- package/lib/components/Switch/variables.dark.js +2 -2
- package/lib/components/Switch/variables.js +2 -2
- package/lib/components/Tag/variables.js +2 -2
- package/lib/components/Tags/variables.js +1 -1
- package/lib/components/Toast/variables.js +1 -1
- package/lib/components/Tooltip/AnchorTooltip.js +2 -2
- package/lib/components/Tooltip/JsTooltip.js +2 -2
- package/lib/components/UserMenu/variables.js +1 -1
- package/lib/core/constants/accordion.d.ts +3 -0
- package/lib/core/constants/accordion.js +7 -0
- package/lib/core/constants/index.d.ts +1 -0
- package/lib/core/constants/index.js +1 -0
- package/lib/core/constants/mcp.d.ts +4 -0
- package/lib/core/constants/mcp.js +10 -1
- package/lib/core/constants/search.js +2 -2
- package/lib/core/contexts/PageActionsContext.d.ts +5 -0
- package/lib/core/contexts/PageActionsContext.js +10 -0
- package/lib/core/contexts/index.d.ts +1 -0
- package/lib/core/contexts/index.js +1 -0
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +5 -17
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +1 -0
- package/lib/core/hooks/menu/use-menu-item-expanded.js +1 -0
- package/lib/core/hooks/use-active-heading.js +59 -15
- package/lib/core/hooks/use-active-section-id.js +3 -1
- package/lib/core/hooks/use-connect-mcp-button.d.ts +1 -1
- package/lib/core/hooks/use-connect-mcp-button.js +16 -13
- package/lib/core/hooks/use-control.js +3 -0
- package/lib/core/hooks/use-local-state.js +1 -0
- package/lib/core/hooks/use-mcp-config.d.ts +2 -0
- package/lib/core/hooks/use-mcp-config.js +14 -4
- package/lib/core/hooks/use-mobile-menu.js +10 -2
- package/lib/core/styles/global.js +56 -49
- package/lib/core/styles/palette.js +2 -0
- package/lib/core/types/button-group.d.ts +2 -0
- package/lib/core/types/button-group.js +3 -0
- package/lib/core/types/catalog.d.ts +2 -4
- package/lib/core/types/common.d.ts +2 -0
- package/lib/core/types/hooks.d.ts +1 -0
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/mcp.d.ts +1 -1
- package/lib/core/utils/RenderWithLink.d.ts +2 -0
- package/lib/core/utils/RenderWithLink.js +20 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/mcp.d.ts +5 -0
- package/lib/core/utils/mcp.js +35 -0
- package/lib/icons/CodexIcon/CodexIcon.d.ts +25 -0
- package/lib/icons/CodexIcon/CodexIcon.js +22 -0
- package/lib/icons/LinkIcon/LinkIcon.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/layouts/McpNotAllowed.js +10 -10
- package/lib/markdoc/components/Accordion/Accordion.d.ts +9 -0
- package/lib/markdoc/components/Accordion/Accordion.js +132 -0
- package/lib/markdoc/components/Accordion/AccordionGroup.d.ts +5 -0
- package/lib/markdoc/components/Accordion/AccordionGroup.js +29 -0
- package/lib/markdoc/components/Accordion/variables.d.ts +1 -0
- package/lib/markdoc/components/Accordion/variables.js +40 -0
- package/lib/markdoc/components/Cards/Card.d.ts +8 -1
- package/lib/markdoc/components/Cards/Card.js +55 -16
- package/lib/markdoc/components/Cards/CardBadge.d.ts +9 -0
- package/lib/markdoc/components/Cards/CardBadge.js +30 -0
- package/lib/markdoc/components/Cards/CardIcon.d.ts +5 -4
- package/lib/markdoc/components/Cards/CardIcon.js +6 -3
- package/lib/markdoc/components/Cards/variables.dark.js +32 -0
- package/lib/markdoc/components/Cards/variables.js +81 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +1 -1
- package/lib/markdoc/components/CodeWalkthrough/variables.js +2 -1
- package/lib/markdoc/components/Heading/Heading.js +5 -2
- package/lib/markdoc/components/Tabs/TabList.js +6 -2
- package/lib/markdoc/components/Tabs/Tabs.js +4 -2
- package/lib/markdoc/components/Tabs/variables.js +4 -4
- package/lib/markdoc/components/default.d.ts +2 -0
- package/lib/markdoc/components/default.js +2 -0
- package/lib/markdoc/default.d.ts +4 -0
- package/lib/markdoc/default.js +4 -0
- package/lib/markdoc/tags/accordion-group.d.ts +2 -0
- package/lib/markdoc/tags/accordion-group.js +10 -0
- package/lib/markdoc/tags/accordion.d.ts +2 -0
- package/lib/markdoc/tags/accordion.js +14 -0
- package/lib/markdoc/tags/admonition.js +1 -1
- package/lib/markdoc/tags/card.js +14 -0
- package/lib/markdoc/tags/connect-mcp.js +2 -1
- package/package.json +19 -10
- package/src/components/Accordion/Accordion.tsx +7 -3
- package/src/components/Accordion/variables.ts +1 -1
- package/src/components/Admonition/Admonition.tsx +2 -2
- package/src/components/Admonition/variables.dark.ts +2 -2
- package/src/components/Admonition/variables.ts +10 -10
- package/src/components/Badge/Badge.tsx +16 -2
- package/src/components/Banner/variables.dark.ts +2 -0
- package/src/components/Banner/variables.ts +3 -1
- package/src/components/Breadcrumbs/Breadcrumb.tsx +1 -1
- package/src/components/Breadcrumbs/variables.ts +1 -1
- package/src/components/Button/ButtonGroup.tsx +28 -10
- package/src/components/Button/variables.ts +27 -4
- package/src/components/Buttons/ConnectMCPButton.tsx +88 -145
- package/src/components/Buttons/CopyButton.tsx +14 -2
- package/src/components/Buttons/variables.ts +2 -44
- package/src/components/Catalog/CatalogEntities.tsx +1 -0
- 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/CatalogEntityRelations/CatalogEntityRelations.tsx +6 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
- package/src/components/Catalog/CatalogFilter/CatalogFilterSelect.tsx +1 -0
- package/src/components/Catalog/CatalogViewModeToggle.tsx +2 -17
- package/src/components/Catalog/variables.ts +5 -5
- package/src/components/CatalogClassic/variables.ts +2 -2
- package/src/components/CodeBlock/CodeBlock.tsx +2 -1
- package/src/components/CodeBlock/CodeBlockContainer.tsx +1 -0
- package/src/components/Dropdown/Dropdown.tsx +25 -4
- package/src/components/Dropdown/DropdownMenuItemContent.tsx +72 -0
- package/src/components/Dropdown/variables.ts +19 -2
- package/src/components/Feedback/Mood.tsx +22 -15
- package/src/components/Feedback/Rating.tsx +22 -14
- package/src/components/Feedback/Scale.tsx +40 -32
- package/src/components/Feedback/Sentiment.tsx +21 -14
- package/src/components/Filter/FilterInput.tsx +5 -3
- package/src/components/Filter/FilterSelect.tsx +1 -0
- package/src/components/Filter/variables.ts +2 -2
- package/src/components/Image/variables.ts +5 -3
- package/src/components/JsonViewer/Helpers.tsx +13 -9
- package/src/components/LanguagePicker/variables.ts +1 -1
- package/src/components/MCP/McpConnectionTabs.tsx +263 -0
- package/src/components/Markdown/Markdown.tsx +2 -1
- package/src/components/Markdown/styles/base-table.ts +8 -0
- package/src/components/Markdown/variables.ts +1 -1
- package/src/components/Menu/MenuItem.tsx +2 -2
- package/src/components/Menu/variables.ts +1 -1
- package/src/components/Navbar/variables.ts +1 -1
- package/src/components/PageActions/PageActions.tsx +22 -23
- package/src/components/PageActions/PageActionsMenuItem.tsx +41 -55
- package/src/components/Panel/Panel.tsx +7 -3
- package/src/components/Panel/variables.ts +1 -1
- package/src/components/Product/variables.ts +2 -1
- package/src/components/ReplayGate/ReplayGate.tsx +3 -0
- package/src/components/Search/FilterFields/SearchFilterFieldSelect.tsx +32 -40
- package/src/components/Search/SearchAiDialog.tsx +4 -1
- package/src/components/Search/SearchAiMessage.tsx +1 -1
- package/src/components/Search/SearchAiNegativeFeedbackForm.tsx +2 -2
- package/src/components/Search/SearchDialog.tsx +2 -2
- package/src/components/Search/SearchItem.tsx +7 -1
- package/src/components/Search/SearchRecent.tsx +1 -0
- package/src/components/Search/SearchSuggestedPages.tsx +1 -0
- package/src/components/Search/variables.ts +9 -5
- package/src/components/Segmented/Segmented.tsx +6 -3
- package/src/components/Select/Select.tsx +36 -22
- package/src/components/Select/variables.ts +3 -3
- package/src/components/Sidebar/Sidebar.tsx +2 -6
- package/src/components/SplitButton/SplitButton.tsx +95 -0
- package/src/components/Switch/variables.dark.ts +2 -2
- package/src/components/Switch/variables.ts +2 -2
- package/src/components/Tag/variables.ts +2 -2
- package/src/components/Tags/variables.ts +1 -1
- package/src/components/Toast/variables.ts +1 -1
- package/src/components/Tooltip/AnchorTooltip.tsx +2 -2
- package/src/components/Tooltip/JsTooltip.tsx +2 -2
- package/src/components/UserMenu/variables.ts +1 -1
- package/src/core/constants/accordion.ts +4 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/constants/mcp.ts +14 -0
- package/src/core/constants/search.ts +2 -2
- package/src/core/contexts/PageActionsContext.tsx +7 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +6 -20
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -0
- package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -0
- package/src/core/hooks/use-active-heading.ts +79 -15
- package/src/core/hooks/use-active-section-id.ts +3 -1
- package/src/core/hooks/use-connect-mcp-button.ts +23 -15
- package/src/core/hooks/use-control.ts +5 -1
- package/src/core/hooks/use-local-state.ts +1 -0
- package/src/core/hooks/use-mcp-config.ts +15 -4
- package/src/core/hooks/use-mobile-menu.ts +11 -3
- package/src/core/openapi/index.ts +1 -1
- package/src/core/styles/global.ts +19 -12
- package/src/core/styles/palette.ts +2 -0
- package/src/core/types/button-group.ts +2 -0
- package/src/core/types/catalog.ts +2 -4
- package/src/core/types/common.ts +3 -0
- package/src/core/types/hooks.ts +1 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +29 -1
- package/src/core/types/mcp.ts +1 -1
- package/src/core/utils/RenderWithLink.tsx +19 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/mcp.ts +39 -0
- package/src/icons/CodexIcon/CodexIcon.tsx +23 -0
- package/src/icons/LinkIcon/LinkIcon.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/layouts/McpNotAllowed.tsx +37 -11
- package/src/markdoc/components/Accordion/Accordion.tsx +128 -0
- package/src/markdoc/components/Accordion/AccordionGroup.tsx +41 -0
- package/src/markdoc/components/Accordion/variables.ts +37 -0
- package/src/markdoc/components/Cards/Card.tsx +79 -14
- package/src/markdoc/components/Cards/CardBadge.tsx +39 -0
- package/src/markdoc/components/Cards/CardIcon.tsx +16 -5
- package/src/markdoc/components/Cards/variables.dark.ts +32 -0
- package/src/markdoc/components/Cards/variables.ts +81 -7
- package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -0
- package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/variables.ts +2 -1
- package/src/markdoc/components/Heading/Heading.tsx +7 -4
- package/src/markdoc/components/Tabs/TabList.tsx +6 -2
- package/src/markdoc/components/Tabs/Tabs.tsx +4 -2
- package/src/markdoc/components/Tabs/variables.ts +4 -4
- package/src/markdoc/components/default.ts +2 -0
- package/src/markdoc/default.ts +4 -0
- package/src/markdoc/tags/accordion-group.ts +8 -0
- package/src/markdoc/tags/accordion.ts +12 -0
- package/src/markdoc/tags/admonition.ts +1 -1
- package/src/markdoc/tags/card.ts +14 -0
- package/src/markdoc/tags/connect-mcp.ts +3 -1
|
@@ -254,7 +254,7 @@ const TooltipBody = styled.span<{
|
|
|
254
254
|
word-break: normal;
|
|
255
255
|
overflow-wrap: break-word;
|
|
256
256
|
|
|
257
|
-
border-radius: var(--border-radius-
|
|
257
|
+
border-radius: var(--border-radius-lg);
|
|
258
258
|
transition: opacity 0.3s ease-out;
|
|
259
259
|
|
|
260
260
|
font-size: var(--font-size-base);
|
|
@@ -274,7 +274,7 @@ const TooltipBody = styled.span<{
|
|
|
274
274
|
|
|
275
275
|
background: var(--tooltip-bg-color);
|
|
276
276
|
color: var(--tooltip-text-color);
|
|
277
|
-
border: var(--tooltip-border-width,
|
|
277
|
+
border: var(--tooltip-border-width, 2px) var(--tooltip-border-style, solid)
|
|
278
278
|
var(--tooltip-border-color, transparent);
|
|
279
279
|
box-shadow: var(--bg-raised-shadow);
|
|
280
280
|
|
|
@@ -49,7 +49,7 @@ export const userMenu = css`
|
|
|
49
49
|
--user-menu-dropdown-item-padding-vertical: var(--dropdown-menu-item-padding-vertical); // @presenter Spacing
|
|
50
50
|
--user-menu-dropdown-item-separator-padding-top: var(--dropdown-menu-item-separator-padding-top ); // @presenter Spacing
|
|
51
51
|
--user-menu-dropdown-item-separator-padding-bottom: var(--dropdown-menu-item-separator-padding-bottom ); // @presenter Spacing
|
|
52
|
-
--user-menu-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius
|
|
52
|
+
--user-menu-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius); // @presenter BorderRadius
|
|
53
53
|
--user-menu-dropdown-item-bg-color-active: var(--dropdown-menu-item-bg-color-active); // @presenter Color
|
|
54
54
|
--user-menu-dropdown-item-bg-color-hover: var(--dropdown-menu-item-bg-color-hover); // @presenter Color
|
|
55
55
|
--user-menu-dropdown-item-bg-color-disabled: var(--dropdown-menu-item-bg-color-disabled); // @presenter Color
|
|
@@ -1 +1,15 @@
|
|
|
1
|
+
import type { MCPOption } from '../types/mcp';
|
|
2
|
+
|
|
1
3
|
export const DEFAULT_MCP_SERVER_NAME = 'mcp-server';
|
|
4
|
+
|
|
5
|
+
export const MCP_ROUTE = '/mcp';
|
|
6
|
+
|
|
7
|
+
export const PUBLIC_MCP_ROUTE = '/mcp-public';
|
|
8
|
+
|
|
9
|
+
export const DEFAULT_MCP_OPTIONS: MCPOption[] = [
|
|
10
|
+
'cursor',
|
|
11
|
+
'vscode',
|
|
12
|
+
'claude-code',
|
|
13
|
+
'codex',
|
|
14
|
+
'copy',
|
|
15
|
+
];
|
|
@@ -29,13 +29,13 @@ export const AI_SEARCH_ERROR_CONFIG: Record<AiSearchError, AiSearchErrorConfig>
|
|
|
29
29
|
headerKey: 'search.ai.error.header.forbidden',
|
|
30
30
|
headerDefault: 'Feature Unavailable',
|
|
31
31
|
messageKey: 'search.ai.error.description.forbidden',
|
|
32
|
-
messageDefault: 'AI
|
|
32
|
+
messageDefault: 'AI assistant is currently unavailable.',
|
|
33
33
|
},
|
|
34
34
|
[AiSearchError.Unauthorized]: {
|
|
35
35
|
headerKey: 'search.ai.error.header.unauthorized',
|
|
36
36
|
headerDefault: 'Authentication Required',
|
|
37
37
|
messageKey: 'search.ai.error.description.unauthorized',
|
|
38
|
-
messageDefault: 'You are not authorized to use AI
|
|
38
|
+
messageDefault: 'You are not authorized to use AI assistant.',
|
|
39
39
|
},
|
|
40
40
|
[AiSearchError.HttpRequestFailed]: defaultErrorConfig,
|
|
41
41
|
[AiSearchError.EmptyResponse]: defaultErrorConfig,
|
|
@@ -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,5 +1,6 @@
|
|
|
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';
|
|
5
6
|
export * from './CodeSnippetContext';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useEffect, useMemo
|
|
1
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { useLocation, useNavigate } from 'react-router';
|
|
3
3
|
|
|
4
4
|
import type {
|
|
@@ -50,10 +50,6 @@ export function useCodeWalkthroughControls(
|
|
|
50
50
|
const navigate = useNavigate();
|
|
51
51
|
const searchParams = useMemo(() => new URLSearchParams(location.search), [location.search]);
|
|
52
52
|
|
|
53
|
-
const filtersRef = useRef(filters);
|
|
54
|
-
const inputsRef = useRef(inputs);
|
|
55
|
-
const togglesRef = useRef(toggles);
|
|
56
|
-
|
|
57
53
|
const getInitialState = () => {
|
|
58
54
|
const state: CodeWalkthroughControlsState = {};
|
|
59
55
|
|
|
@@ -90,20 +86,11 @@ export function useCodeWalkthroughControls(
|
|
|
90
86
|
|
|
91
87
|
const [controlsState, setControlsState] = useState(getInitialState);
|
|
92
88
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
JSON.stringify(filters) === JSON.stringify(filtersRef.current),
|
|
96
|
-
JSON.stringify(inputs) === JSON.stringify(inputsRef.current),
|
|
97
|
-
JSON.stringify(toggles) === JSON.stringify(togglesRef.current),
|
|
98
|
-
];
|
|
99
|
-
|
|
100
|
-
if (sameProps.every(Boolean)) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
89
|
+
const controlsKey = JSON.stringify([filters, inputs, toggles]);
|
|
90
|
+
const [prevControlsKey, setPrevControlsKey] = useState(controlsKey);
|
|
103
91
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
togglesRef.current = toggles;
|
|
92
|
+
if (prevControlsKey !== controlsKey) {
|
|
93
|
+
setPrevControlsKey(controlsKey);
|
|
107
94
|
|
|
108
95
|
const newState = getInitialState();
|
|
109
96
|
|
|
@@ -120,8 +107,7 @@ export function useCodeWalkthroughControls(
|
|
|
120
107
|
});
|
|
121
108
|
|
|
122
109
|
setControlsState(newState);
|
|
123
|
-
|
|
124
|
-
}, [filters, inputs, toggles, enableDeepLink]);
|
|
110
|
+
}
|
|
125
111
|
|
|
126
112
|
const changeControlState = (id: string, value: string | boolean) => {
|
|
127
113
|
setControlsState((prev) => {
|
|
@@ -252,6 +252,7 @@ export function useCodeWalkthroughSteps({
|
|
|
252
252
|
|
|
253
253
|
const rootTopOffset = root.current?.offsetTop ?? 0;
|
|
254
254
|
if (!activeStep && rootTopOffset <= options.navbarHeight) {
|
|
255
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state -- seeded from root.current.offsetTop, a post-layout measurement
|
|
255
256
|
setActiveStep(visibleSteps[0]?.id || null);
|
|
256
257
|
}
|
|
257
258
|
|
|
@@ -16,6 +16,7 @@ export function useMenuItemExpanded(item: ItemState): [boolean, Dispatch<SetStat
|
|
|
16
16
|
const [controlledValue, setControlledValue] = useState(isItemExpanded(item));
|
|
17
17
|
|
|
18
18
|
useEffect(() => {
|
|
19
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state -- deferred a commit on purpose so CSS transitions still run
|
|
19
20
|
setIsExpanded(controlledValue);
|
|
20
21
|
}, [controlledValue]);
|
|
21
22
|
|
|
@@ -8,6 +8,15 @@ type HeadingEntry = {
|
|
|
8
8
|
[key: string]: IntersectionObserverEntry;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
type ClickScroll = {
|
|
12
|
+
target: HTMLElement;
|
|
13
|
+
scrollMargin: number;
|
|
14
|
+
closestDistance: number;
|
|
15
|
+
reached: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const TARGET_TOLERANCE = 2;
|
|
19
|
+
|
|
11
20
|
export function useActiveHeading(
|
|
12
21
|
contentElement: HTMLDivElement | null,
|
|
13
22
|
displayedHeadings?: Array<{ id: string; depth: number } | null>,
|
|
@@ -17,11 +26,14 @@ export function useActiveHeading(
|
|
|
17
26
|
const headingElementsRef = useRef<HeadingEntry>({});
|
|
18
27
|
const displayedHeadingsRef = useRef(displayedHeadings);
|
|
19
28
|
const lockObserver = useRef<boolean>(false);
|
|
29
|
+
const clickScroll = useRef<ClickScroll | null>(null);
|
|
20
30
|
const location = useLocation();
|
|
21
31
|
|
|
22
32
|
useEffect(() => {
|
|
23
33
|
setHeading(undefined);
|
|
24
34
|
headingElementsRef.current = {};
|
|
35
|
+
clickScroll.current = null;
|
|
36
|
+
lockObserver.current = false;
|
|
25
37
|
}, [location.pathname]);
|
|
26
38
|
|
|
27
39
|
useEffect(() => {
|
|
@@ -133,10 +145,6 @@ export function useActiveHeading(
|
|
|
133
145
|
|
|
134
146
|
const intersectionCallback = useCallback(
|
|
135
147
|
(entries: IntersectionObserverEntry[]) => {
|
|
136
|
-
if (lockObserver.current) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
148
|
headingElementsRef.current = entries.reduce(
|
|
141
149
|
(map: HeadingEntry, entry: IntersectionObserverEntry) => {
|
|
142
150
|
map[entry.target.id] = entry;
|
|
@@ -145,6 +153,10 @@ export function useActiveHeading(
|
|
|
145
153
|
headingElementsRef.current,
|
|
146
154
|
);
|
|
147
155
|
|
|
156
|
+
if (lockObserver.current) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
|
|
148
160
|
if (isTopOfPage()) {
|
|
149
161
|
const newHeading = headingElements[0]?.id || undefined;
|
|
150
162
|
setHeading(newHeading);
|
|
@@ -202,22 +214,71 @@ export function useActiveHeading(
|
|
|
202
214
|
[getIndexFromId, headingElements, getTriggerOffset, findActiveHeaderByVirtualPosition],
|
|
203
215
|
);
|
|
204
216
|
|
|
217
|
+
const releaseClickScroll = useCallback(() => {
|
|
218
|
+
clickScroll.current = null;
|
|
219
|
+
lockObserver.current = false;
|
|
220
|
+
}, []);
|
|
221
|
+
|
|
222
|
+
const trackClickScroll = useCallback(() => {
|
|
223
|
+
const clickScrollState = clickScroll.current;
|
|
224
|
+
if (!clickScrollState) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const { top } = clickScrollState.target.getBoundingClientRect();
|
|
229
|
+
|
|
230
|
+
if (clickScrollState.reached) {
|
|
231
|
+
if (top >= 0 && top <= getTriggerOffset()) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
} else {
|
|
235
|
+
const distance = Math.abs(top - clickScrollState.scrollMargin);
|
|
236
|
+
|
|
237
|
+
if (distance <= TARGET_TOLERANCE) {
|
|
238
|
+
clickScrollState.reached = true;
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (distance <= clickScrollState.closestDistance + TARGET_TOLERANCE) {
|
|
243
|
+
clickScrollState.closestDistance = Math.min(clickScrollState.closestDistance, distance);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
releaseClickScroll();
|
|
249
|
+
intersectionCallback([]);
|
|
250
|
+
}, [releaseClickScroll, intersectionCallback, getTriggerOffset]);
|
|
251
|
+
|
|
205
252
|
const handleHeadingClick = useCallback(
|
|
206
253
|
(headingId: string) => {
|
|
207
|
-
|
|
254
|
+
releaseClickScroll();
|
|
208
255
|
setHeading(headingId);
|
|
209
256
|
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
257
|
+
const target =
|
|
258
|
+
document.getElementById(headingId) || headingElements.find((el) => el.id === headingId);
|
|
259
|
+
|
|
260
|
+
if (!target?.scrollIntoView) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
265
|
+
|
|
266
|
+
if (!target.getClientRects().length) {
|
|
267
|
+
return;
|
|
213
268
|
}
|
|
214
269
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
270
|
+
const scrollMargin = parseFloat(getComputedStyle(target).scrollMarginTop) || 0;
|
|
271
|
+
const distance = Math.abs(target.getBoundingClientRect().top - scrollMargin);
|
|
272
|
+
|
|
273
|
+
lockObserver.current = true;
|
|
274
|
+
clickScroll.current = {
|
|
275
|
+
target,
|
|
276
|
+
scrollMargin,
|
|
277
|
+
closestDistance: distance,
|
|
278
|
+
reached: distance <= TARGET_TOLERANCE,
|
|
279
|
+
};
|
|
219
280
|
},
|
|
220
|
-
[headingElements],
|
|
281
|
+
[headingElements, releaseClickScroll],
|
|
221
282
|
);
|
|
222
283
|
|
|
223
284
|
useEffect(() => {
|
|
@@ -268,7 +329,10 @@ export function useActiveHeading(
|
|
|
268
329
|
});
|
|
269
330
|
|
|
270
331
|
const handleScroll = () => {
|
|
271
|
-
if (
|
|
332
|
+
if (clickScroll.current) {
|
|
333
|
+
trackClickScroll();
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
272
336
|
|
|
273
337
|
if (isTopOfPage()) {
|
|
274
338
|
setHeading(headingElements[0]?.id || undefined);
|
|
@@ -281,7 +345,7 @@ export function useActiveHeading(
|
|
|
281
345
|
observer.disconnect();
|
|
282
346
|
window.removeEventListener('scroll', handleScroll);
|
|
283
347
|
};
|
|
284
|
-
}, [headingElements, intersectionCallback, getTriggerOffset]);
|
|
348
|
+
}, [headingElements, intersectionCallback, getTriggerOffset, trackClickScroll]);
|
|
285
349
|
|
|
286
350
|
return { heading, handleHeadingClick };
|
|
287
351
|
}
|
|
@@ -60,11 +60,13 @@ export function useActiveSectionId(
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
window.addEventListener('scroll', scrollListener, { capture: false });
|
|
63
|
-
setTimeout(() => {
|
|
63
|
+
const initialRead = setTimeout(() => {
|
|
64
64
|
scrollListener();
|
|
65
65
|
}, 10);
|
|
66
66
|
|
|
67
67
|
return () => {
|
|
68
|
+
clearTimeout(initialRead);
|
|
69
|
+
scrollListener.cancel();
|
|
68
70
|
window.removeEventListener('scroll', scrollListener);
|
|
69
71
|
};
|
|
70
72
|
}, [location, heightOffset, scrollListener]);
|
|
@@ -6,13 +6,15 @@ import type { MCPOption } from '../types';
|
|
|
6
6
|
import { useThemeHooks } from './use-theme-hooks';
|
|
7
7
|
import { useMCPConfig } from './use-mcp-config';
|
|
8
8
|
import { ClipboardService } from '../utils/clipboard-service';
|
|
9
|
+
import { DEFAULT_MCP_OPTIONS } from '../constants/mcp';
|
|
10
|
+
import { generateClaudeCodeCommand, generateCodexCommand } from '../utils/mcp';
|
|
9
11
|
|
|
10
12
|
export type McpButtonOptions = {
|
|
11
13
|
options?: MCPOption[];
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
export type McpButtonSettings = {
|
|
15
|
-
|
|
17
|
+
copiedOption: MCPOption | null;
|
|
16
18
|
cursorUrl: string;
|
|
17
19
|
vscodeUrl: string;
|
|
18
20
|
triggerButtonText: string;
|
|
@@ -23,35 +25,41 @@ export type McpButtonSettings = {
|
|
|
23
25
|
const COPIED_RESET_TIMEOUT = 1000;
|
|
24
26
|
|
|
25
27
|
export function useConnectMCPButton({
|
|
26
|
-
options =
|
|
28
|
+
options = DEFAULT_MCP_OPTIONS,
|
|
27
29
|
}: McpButtonOptions = {}): McpButtonSettings {
|
|
28
30
|
const { useTranslate } = useThemeHooks();
|
|
29
31
|
const { translate } = useTranslate();
|
|
30
32
|
const { serverName, serverUrl, cursorUrl, vscodeUrl } = useMCPConfig();
|
|
31
|
-
const [
|
|
33
|
+
const [copiedOption, setCopiedOption] = useState<MCPOption | null>(null);
|
|
32
34
|
|
|
33
35
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
36
|
const resetCopied = useCallback(
|
|
35
|
-
debounce(() =>
|
|
37
|
+
debounce(() => setCopiedOption(null), COPIED_RESET_TIMEOUT),
|
|
36
38
|
[],
|
|
37
39
|
);
|
|
38
40
|
|
|
39
41
|
const handleAction = useCallback(
|
|
40
42
|
(action: MCPOption) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
const connection = { serverName, url: serverUrl };
|
|
44
|
+
const copyTextMap: Partial<Record<MCPOption, string>> = {
|
|
45
|
+
copy: JSON.stringify(
|
|
46
|
+
{ [serverName]: { url: serverUrl, description: 'MCP Server' } },
|
|
47
|
+
null,
|
|
48
|
+
2,
|
|
49
|
+
),
|
|
50
|
+
'claude-code': generateClaudeCodeCommand(connection),
|
|
51
|
+
codex: generateCodexCommand(connection),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const copyText = copyTextMap[action];
|
|
55
|
+
if (copyText !== undefined) {
|
|
56
|
+
ClipboardService.copyCustom(copyText);
|
|
57
|
+
setCopiedOption(action);
|
|
50
58
|
resetCopied();
|
|
51
59
|
return;
|
|
52
60
|
}
|
|
53
61
|
|
|
54
|
-
const urlMap: Record<
|
|
62
|
+
const urlMap: Partial<Record<MCPOption, string>> = {
|
|
55
63
|
cursor: cursorUrl,
|
|
56
64
|
vscode: vscodeUrl,
|
|
57
65
|
};
|
|
@@ -69,7 +77,7 @@ export function useConnectMCPButton({
|
|
|
69
77
|
const visibleOptions = useMemo(() => options.filter(Boolean), [options]);
|
|
70
78
|
|
|
71
79
|
return {
|
|
72
|
-
|
|
80
|
+
copiedOption,
|
|
73
81
|
cursorUrl,
|
|
74
82
|
vscodeUrl,
|
|
75
83
|
triggerButtonText,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useCallback, useRef } from 'react';
|
|
1
|
+
import { useState, useCallback, useEffect, useRef } from 'react';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_CONTROL_OPEN_DELAY = 300;
|
|
4
4
|
|
|
@@ -18,6 +18,10 @@ export const useControl = (initialVal = false): UseControlReturnType => {
|
|
|
18
18
|
}
|
|
19
19
|
}, []);
|
|
20
20
|
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
return clearOpenTimer;
|
|
23
|
+
}, [clearOpenTimer]);
|
|
24
|
+
|
|
21
25
|
const handleOpen = useCallback(() => {
|
|
22
26
|
clearOpenTimer();
|
|
23
27
|
timeoutRef.current = setTimeout(() => {
|
|
@@ -21,6 +21,7 @@ export function useLocalState<T>(key: string, initialValue: T): [T, (value: T) =
|
|
|
21
21
|
// then client loads the actual stored value without hydration mismatch
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
if (!isBrowser()) return;
|
|
24
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state -- localStorage is read after mount so SSR and client hydrate from the same value
|
|
24
25
|
setValue(getStoredValue(key, initialValue));
|
|
25
26
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
27
|
}, [key]);
|
|
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { useThemeHooks } from './use-theme-hooks';
|
|
4
4
|
import { IS_BROWSER } from '../utils/dom';
|
|
5
|
-
import { DEFAULT_MCP_SERVER_NAME } from '../constants';
|
|
5
|
+
import { DEFAULT_MCP_SERVER_NAME, MCP_ROUTE, PUBLIC_MCP_ROUTE } from '../constants';
|
|
6
6
|
import { generateMCPDeepLink } from '../utils/mcp';
|
|
7
7
|
import { withPathPrefix } from '../utils/urls';
|
|
8
8
|
|
|
@@ -13,20 +13,29 @@ export type McpConfig = {
|
|
|
13
13
|
cursorUrl: string;
|
|
14
14
|
vscodeUrl: string;
|
|
15
15
|
isMcpDisabled: boolean;
|
|
16
|
+
isPublicEndpointPage: boolean;
|
|
17
|
+
alternateServerUrl?: string;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
export function useMCPConfig(): McpConfig {
|
|
19
|
-
const { useMcpData } = useThemeHooks();
|
|
21
|
+
const { useMcpData, usePageData } = useThemeHooks();
|
|
20
22
|
|
|
21
23
|
const {
|
|
22
|
-
docs: { enabled, name },
|
|
24
|
+
docs: { enabled, name, publicEndpoint },
|
|
23
25
|
} = useMcpData();
|
|
26
|
+
const pageSlug = usePageData()?.slug;
|
|
24
27
|
|
|
25
28
|
const origin = IS_BROWSER
|
|
26
29
|
? window.location.origin
|
|
27
30
|
: ((globalThis as { SSR_HOSTNAME?: string })['SSR_HOSTNAME'] ?? '');
|
|
28
31
|
const serverName = name || DEFAULT_MCP_SERVER_NAME;
|
|
29
|
-
const
|
|
32
|
+
const isPublicEndpointPage = pageSlug === withPathPrefix(PUBLIC_MCP_ROUTE);
|
|
33
|
+
const serverUrl = `${origin}${withPathPrefix(isPublicEndpointPage ? PUBLIC_MCP_ROUTE : MCP_ROUTE)}`;
|
|
34
|
+
const alternateServerUrl = isPublicEndpointPage
|
|
35
|
+
? `${origin}${withPathPrefix(MCP_ROUTE)}`
|
|
36
|
+
: publicEndpoint
|
|
37
|
+
? `${origin}${withPathPrefix(PUBLIC_MCP_ROUTE)}`
|
|
38
|
+
: undefined;
|
|
30
39
|
const isMcpDisabled = !enabled || false;
|
|
31
40
|
|
|
32
41
|
const cursorUrl = useMemo(
|
|
@@ -46,5 +55,7 @@ export function useMCPConfig(): McpConfig {
|
|
|
46
55
|
cursorUrl,
|
|
47
56
|
vscodeUrl,
|
|
48
57
|
isMcpDisabled,
|
|
58
|
+
isPublicEndpointPage,
|
|
59
|
+
alternateServerUrl,
|
|
49
60
|
};
|
|
50
61
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
import { useLocation } from 'react-router';
|
|
3
3
|
|
|
4
4
|
import { useModalScrollLock } from './use-modal-scroll-lock';
|
|
@@ -6,11 +6,19 @@ import { useModalScrollLock } from './use-modal-scroll-lock';
|
|
|
6
6
|
export function useMobileMenu(initialState = false) {
|
|
7
7
|
const location = useLocation();
|
|
8
8
|
const [isOpen, setIsOpen] = useState(initialState);
|
|
9
|
+
const locationKey = `${location.pathname}${location.hash}`;
|
|
10
|
+
const [prevLocationKey, setPrevLocationKey] = useState(locationKey);
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
if (isOpen && prevLocationKey !== locationKey) {
|
|
13
|
+
setPrevLocationKey(locationKey);
|
|
14
|
+
setIsOpen(false);
|
|
15
|
+
}
|
|
11
16
|
useModalScrollLock(isOpen);
|
|
12
17
|
|
|
13
|
-
const openMobileMenu = () =>
|
|
18
|
+
const openMobileMenu = () => {
|
|
19
|
+
setPrevLocationKey(locationKey);
|
|
20
|
+
setIsOpen(true);
|
|
21
|
+
};
|
|
14
22
|
const closeMobileMenu = () => setIsOpen(false);
|
|
15
23
|
|
|
16
24
|
return { isOpen, openMobileMenu, closeMobileMenu };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is intended to provide selective imports from @redocly/theme/core
|
|
2
|
-
// to reduce bundle size by exporting only functionality used in the @redocly/
|
|
2
|
+
// to reduce bundle size by exporting only functionality used in the @redocly/api-docs package.
|
|
3
3
|
//
|
|
4
4
|
// This selective import approach will help with tree shaking and reduce
|
|
5
5
|
// the overall bundle size by avoiding importing the entire theme package
|
|
@@ -20,7 +20,7 @@ import { checkbox } from '@redocly/theme/icons/CheckboxIcon/variables';
|
|
|
20
20
|
import { admonition } from '@redocly/theme/components/Admonition/variables';
|
|
21
21
|
import { footer } from '@redocly/theme/components/Footer/variables';
|
|
22
22
|
import { button } from '@redocly/theme/components/Button/variables';
|
|
23
|
-
import { aiAssistantButton
|
|
23
|
+
import { aiAssistantButton } from '@redocly/theme/components/Buttons/variables';
|
|
24
24
|
import { navbar } from '@redocly/theme/components/Navbar/variables';
|
|
25
25
|
import { search } from '@redocly/theme/components/Search/variables';
|
|
26
26
|
import { menu, mobileMenu } from '@redocly/theme/components/Menu/variables';
|
|
@@ -28,6 +28,7 @@ import { code } from '@redocly/theme/components/CodeBlock/variables';
|
|
|
28
28
|
import { productPicker } from '@redocly/theme/components/Product/variables';
|
|
29
29
|
import { markdown } from '@redocly/theme/components/Markdown/variables';
|
|
30
30
|
import { banner } from '@redocly/theme/components/Banner/variables';
|
|
31
|
+
import { markdownAccordion } from '@redocly/theme/markdoc/components/Accordion/variables';
|
|
31
32
|
import { markdownTabs } from '@redocly/theme/markdoc/components/Tabs/variables';
|
|
32
33
|
import { markdownNumberedList } from '@redocly/theme/markdoc/components/NumberedList/variables';
|
|
33
34
|
import { diagram } from '@redocly/theme/markdoc/components/Diagram/variables';
|
|
@@ -453,18 +454,24 @@ const borders = css`
|
|
|
453
454
|
|
|
454
455
|
--border-color-primary: var(--color-warm-grey-3); // Raised dividers
|
|
455
456
|
--border-color-secondary: var(--color-warm-grey-2); // Default dividers, borders
|
|
456
|
-
--border-color-
|
|
457
|
+
--border-color-inverse: var(--color-warm-grey-10);
|
|
458
|
+
--border-color-invers: var(--border-color-inverse, var(--color-warm-grey-10)); // Deprecated: use --border-color-inverse
|
|
457
459
|
|
|
458
460
|
/**
|
|
459
461
|
* @tokens Border Radius
|
|
460
462
|
* @presenter BorderRadius
|
|
461
463
|
*/
|
|
462
464
|
|
|
465
|
+
--border-radius-none: 0;
|
|
463
466
|
--border-radius: 4px;
|
|
464
467
|
--border-radius-md: calc(var(--border-radius) * 1.5);
|
|
465
468
|
--border-radius-lg: calc(var(--border-radius) * 2);
|
|
466
469
|
--border-radius-xl: calc(var(--border-radius) * 3);
|
|
467
470
|
--border-radius-xxl: calc(var(--border-radius) * 4);
|
|
471
|
+
--border-radius-xxxl: calc(var(--border-radius) * 6);
|
|
472
|
+
--border-radius-full: 999px;
|
|
473
|
+
|
|
474
|
+
// @tokens End
|
|
468
475
|
`;
|
|
469
476
|
|
|
470
477
|
const headingsTypography = css`
|
|
@@ -823,7 +830,7 @@ const badges = css`
|
|
|
823
830
|
|
|
824
831
|
--badge-text-color: var(--text-color-inverse); // @presenter Color
|
|
825
832
|
--badge-bg-color: var(--color-purple-6); // @presenter Color
|
|
826
|
-
--badge-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
833
|
+
--badge-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
827
834
|
|
|
828
835
|
/**
|
|
829
836
|
* @tokens Deprecated Badge
|
|
@@ -831,7 +838,7 @@ const badges = css`
|
|
|
831
838
|
|
|
832
839
|
--badge-deprecated-text-color: var(--color-warm-grey-1); // @presenter Color
|
|
833
840
|
--badge-deprecated-bg-color: var(--color-warning-base); // @presenter Color
|
|
834
|
-
--badge-deprecated-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
841
|
+
--badge-deprecated-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
835
842
|
|
|
836
843
|
/**
|
|
837
844
|
* @tokens Webhook Badge
|
|
@@ -839,7 +846,7 @@ const badges = css`
|
|
|
839
846
|
|
|
840
847
|
--badge-webhook-text-color: var(--color-warm-grey-1); // @presenter Color
|
|
841
848
|
--badge-webhook-bg-color: var(--color-purple-7); // @presenter Color
|
|
842
|
-
--badge-webhook-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
849
|
+
--badge-webhook-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
843
850
|
|
|
844
851
|
/**
|
|
845
852
|
* @tokens Audience Badge
|
|
@@ -1047,11 +1054,6 @@ const pages = css`
|
|
|
1047
1054
|
--page-mcp-405-margin-vertical-mobile: var(--spacing-xxl);
|
|
1048
1055
|
--page-mcp-405-margin-horizontal-mobile: 1rem;
|
|
1049
1056
|
|
|
1050
|
-
--page-mcp-405-status-text-color: var(--text-color-helper);
|
|
1051
|
-
--page-mcp-405-status-font-size: var(--font-size-lg); // @presenter FontSize
|
|
1052
|
-
--page-mcp-405-status-line-height: var(--line-height-lg); // @presenter LineHeight
|
|
1053
|
-
--page-mcp-405-status-font-weight: var(--font-weight-semibold); // @presenter FontWeight
|
|
1054
|
-
|
|
1055
1057
|
--page-mcp-405-title-text-color: var(--text-color-primary);
|
|
1056
1058
|
--page-mcp-405-title-font-size: 42px; // @presenter FontSize
|
|
1057
1059
|
--page-mcp-405-title-font-weight: var(--font-weight-bold); // @presenter FontWeight
|
|
@@ -1066,6 +1068,11 @@ const pages = css`
|
|
|
1066
1068
|
--page-mcp-405-description-font-size-mobile: var(--font-size-lg);
|
|
1067
1069
|
--page-mcp-405-description-line-height-mobile: var(--line-height-lg);
|
|
1068
1070
|
|
|
1071
|
+
--page-mcp-405-snippets-font-size: var(--font-size-base); // @presenter FontSize
|
|
1072
|
+
--page-mcp-405-snippets-line-height: var(--line-height-base); // @presenter LineHeight
|
|
1073
|
+
--page-mcp-405-snippets-hint-text-color: var(--text-color-secondary);
|
|
1074
|
+
--page-mcp-405-snippets-code-padding-right: var(--spacing-xxl);
|
|
1075
|
+
|
|
1069
1076
|
// @tokens End
|
|
1070
1077
|
|
|
1071
1078
|
/**
|
|
@@ -1263,7 +1270,7 @@ const tree = css`
|
|
|
1263
1270
|
|
|
1264
1271
|
*::-webkit-scrollbar-thumb {
|
|
1265
1272
|
background-color: var(--color-warm-grey-2);
|
|
1266
|
-
border-radius: var(--border-radius);
|
|
1273
|
+
border-radius: var(--border-radius-full);
|
|
1267
1274
|
}
|
|
1268
1275
|
|
|
1269
1276
|
*::-webkit-scrollbar-thumb:hover {
|
|
@@ -1331,7 +1338,6 @@ export const styles = css<{ palette?: string }>`
|
|
|
1331
1338
|
${breadcrumbs}
|
|
1332
1339
|
${button}
|
|
1333
1340
|
${aiAssistantButton}
|
|
1334
|
-
${connectMCPButton}
|
|
1335
1341
|
${cards}
|
|
1336
1342
|
${catalog}
|
|
1337
1343
|
${catalogClassic}
|
|
@@ -1352,6 +1358,7 @@ export const styles = css<{ palette?: string }>`
|
|
|
1352
1358
|
${loadProgressBar}
|
|
1353
1359
|
${logo}
|
|
1354
1360
|
${markdown}
|
|
1361
|
+
${markdownAccordion}
|
|
1355
1362
|
${markdownTabs}
|
|
1356
1363
|
${markdownNumberedList}
|
|
1357
1364
|
${diagram}
|