@redocly/theme 0.69.0-next.1 → 0.69.0-next.11
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 +161 -0
- 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/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/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/code-walkthrough/use-code-walkthrough-controls.js +5 -17
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +2 -0
- package/lib/core/hooks/menu/use-menu-item-expanded.js +1 -0
- package/lib/core/hooks/use-active-heading.js +63 -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 +23 -15
- 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/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 +16 -11
- 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.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/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/tags/accordion-group.js +3 -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 +285 -0
- 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/mcp.ts +14 -0
- package/src/core/constants/search.ts +2 -2
- 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/code-walkthrough/use-code-walkthrough-controls.ts +6 -20
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +2 -0
- package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -0
- package/src/core/hooks/use-active-heading.ts +83 -15
- package/src/core/hooks/use-active-section-id.ts +3 -1
- package/src/core/hooks/use-connect-mcp-button.ts +31 -17
- 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/hooks/use-tabs.ts +4 -2
- package/src/core/hooks/use-telemetry-fallback.ts +2 -0
- package/src/core/openapi/index.ts +1 -1
- package/src/core/styles/global.ts +17 -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 +8 -2
- package/src/markdoc/components/Accordion/AccordionGroup.tsx +9 -2
- 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/tags/accordion-group.ts +3 -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
|
@@ -18,7 +18,7 @@ exports.toast = (0, styled_components_1.css) `
|
|
|
18
18
|
--toast-max-width: 360px;
|
|
19
19
|
--toast-bg-color: var(--layer-color); // @presenter Color
|
|
20
20
|
--toast-border: var(--border-width) var(--border-style) var(--border-color-secondary); // @presenter Border
|
|
21
|
-
--toast-border-radius: var(--border-radius-
|
|
21
|
+
--toast-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
22
22
|
--toast-font-family: var(--font-family-base); // @presenter FontFamily
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -209,7 +209,7 @@ const TooltipBody = styled_components_1.default.span.attrs(({ $anchorName }) =>
|
|
|
209
209
|
overflow-wrap: break-word;
|
|
210
210
|
text-align: left;
|
|
211
211
|
|
|
212
|
-
border-radius: var(--border-radius-
|
|
212
|
+
border-radius: var(--border-radius-lg);
|
|
213
213
|
transition: opacity 0.3s ease-out;
|
|
214
214
|
|
|
215
215
|
font-size: var(--font-size-base);
|
|
@@ -229,7 +229,7 @@ const TooltipBody = styled_components_1.default.span.attrs(({ $anchorName }) =>
|
|
|
229
229
|
|
|
230
230
|
background: var(--tooltip-bg-color);
|
|
231
231
|
color: var(--tooltip-text-color);
|
|
232
|
-
border: var(--tooltip-border-width,
|
|
232
|
+
border: var(--tooltip-border-width, 2px) var(--tooltip-border-style, solid)
|
|
233
233
|
var(--tooltip-border-color, transparent);
|
|
234
234
|
box-shadow: var(--bg-raised-shadow);
|
|
235
235
|
|
|
@@ -227,7 +227,7 @@ const TooltipBody = styled_components_1.default.span `
|
|
|
227
227
|
word-break: normal;
|
|
228
228
|
overflow-wrap: break-word;
|
|
229
229
|
|
|
230
|
-
border-radius: var(--border-radius-
|
|
230
|
+
border-radius: var(--border-radius-lg);
|
|
231
231
|
transition: opacity 0.3s ease-out;
|
|
232
232
|
|
|
233
233
|
font-size: var(--font-size-base);
|
|
@@ -247,7 +247,7 @@ const TooltipBody = styled_components_1.default.span `
|
|
|
247
247
|
|
|
248
248
|
background: var(--tooltip-bg-color);
|
|
249
249
|
color: var(--tooltip-text-color);
|
|
250
|
-
border: var(--tooltip-border-width,
|
|
250
|
+
border: var(--tooltip-border-width, 2px) var(--tooltip-border-style, solid)
|
|
251
251
|
var(--tooltip-border-color, transparent);
|
|
252
252
|
box-shadow: var(--bg-raised-shadow);
|
|
253
253
|
|
|
@@ -51,7 +51,7 @@ exports.userMenu = (0, styled_components_1.css) `
|
|
|
51
51
|
--user-menu-dropdown-item-padding-vertical: var(--dropdown-menu-item-padding-vertical); // @presenter Spacing
|
|
52
52
|
--user-menu-dropdown-item-separator-padding-top: var(--dropdown-menu-item-separator-padding-top ); // @presenter Spacing
|
|
53
53
|
--user-menu-dropdown-item-separator-padding-bottom: var(--dropdown-menu-item-separator-padding-bottom ); // @presenter Spacing
|
|
54
|
-
--user-menu-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius
|
|
54
|
+
--user-menu-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius); // @presenter BorderRadius
|
|
55
55
|
--user-menu-dropdown-item-bg-color-active: var(--dropdown-menu-item-bg-color-active); // @presenter Color
|
|
56
56
|
--user-menu-dropdown-item-bg-color-hover: var(--dropdown-menu-item-bg-color-hover); // @presenter Color
|
|
57
57
|
--user-menu-dropdown-item-bg-color-disabled: var(--dropdown-menu-item-bg-color-disabled); // @presenter Color
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_MCP_SERVER_NAME = void 0;
|
|
3
|
+
exports.DEFAULT_MCP_OPTIONS = exports.PUBLIC_MCP_ROUTE = exports.MCP_ROUTE = exports.DEFAULT_MCP_SERVER_NAME = void 0;
|
|
4
4
|
exports.DEFAULT_MCP_SERVER_NAME = 'mcp-server';
|
|
5
|
+
exports.MCP_ROUTE = '/mcp';
|
|
6
|
+
exports.PUBLIC_MCP_ROUTE = '/mcp-public';
|
|
7
|
+
exports.DEFAULT_MCP_OPTIONS = [
|
|
8
|
+
'cursor',
|
|
9
|
+
'vscode',
|
|
10
|
+
'claude-code',
|
|
11
|
+
'codex',
|
|
12
|
+
'copy',
|
|
13
|
+
];
|
|
5
14
|
//# sourceMappingURL=mcp.js.map
|
|
@@ -25,13 +25,13 @@ exports.AI_SEARCH_ERROR_CONFIG = {
|
|
|
25
25
|
headerKey: 'search.ai.error.header.forbidden',
|
|
26
26
|
headerDefault: 'Feature Unavailable',
|
|
27
27
|
messageKey: 'search.ai.error.description.forbidden',
|
|
28
|
-
messageDefault: 'AI
|
|
28
|
+
messageDefault: 'AI assistant is currently unavailable.',
|
|
29
29
|
},
|
|
30
30
|
[AiSearchError.Unauthorized]: {
|
|
31
31
|
headerKey: 'search.ai.error.header.unauthorized',
|
|
32
32
|
headerDefault: 'Authentication Required',
|
|
33
33
|
messageKey: 'search.ai.error.description.unauthorized',
|
|
34
|
-
messageDefault: 'You are not authorized to use AI
|
|
34
|
+
messageDefault: 'You are not authorized to use AI assistant.',
|
|
35
35
|
},
|
|
36
36
|
[AiSearchError.HttpRequestFailed]: defaultErrorConfig,
|
|
37
37
|
[AiSearchError.EmptyResponse]: defaultErrorConfig,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AccordionGroupContext: import("react").Context<string | null>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccordionGroupContext = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
exports.AccordionGroupContext = (0, react_1.createContext)(null);
|
|
6
|
+
//# sourceMappingURL=AccordionGroupContext.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageActionsContext = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* Whether the first heading inside the enclosing `Markdown` mounts the page actions.
|
|
7
|
+
* Without a provider `Heading` falls back to the page type in the page metadata.
|
|
8
|
+
*/
|
|
9
|
+
exports.PageActionsContext = (0, react_1.createContext)(null);
|
|
10
|
+
//# sourceMappingURL=PageActionsContext.js.map
|
|
@@ -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';
|
|
@@ -16,8 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ThemeDataContext"), exports);
|
|
18
18
|
__exportStar(require("./MarkdownLinkContext"), exports);
|
|
19
|
+
__exportStar(require("./PageActionsContext"), exports);
|
|
19
20
|
__exportStar(require("./CodeWalkthrough/CodeWalkthroughControlsContext"), exports);
|
|
20
21
|
__exportStar(require("./CodeWalkthrough/CodeWalkthroughStepsContext"), exports);
|
|
22
|
+
__exportStar(require("./AccordionGroupContext"), exports);
|
|
21
23
|
__exportStar(require("./CodeSnippetContext"), exports);
|
|
22
24
|
__exportStar(require("./SearchContext"), exports);
|
|
23
25
|
__exportStar(require("./Toast/ToastContext"), exports);
|
|
@@ -16,9 +16,6 @@ function useCodeWalkthroughControls(filters, inputs, toggles, enableDeepLink) {
|
|
|
16
16
|
const location = (0, react_router_1.useLocation)();
|
|
17
17
|
const navigate = (0, react_router_1.useNavigate)();
|
|
18
18
|
const searchParams = (0, react_1.useMemo)(() => new URLSearchParams(location.search), [location.search]);
|
|
19
|
-
const filtersRef = (0, react_1.useRef)(filters);
|
|
20
|
-
const inputsRef = (0, react_1.useRef)(inputs);
|
|
21
|
-
const togglesRef = (0, react_1.useRef)(toggles);
|
|
22
19
|
const getInitialState = () => {
|
|
23
20
|
var _a, _b;
|
|
24
21
|
var _c, _d;
|
|
@@ -36,18 +33,10 @@ function useCodeWalkthroughControls(filters, inputs, toggles, enableDeepLink) {
|
|
|
36
33
|
return state;
|
|
37
34
|
};
|
|
38
35
|
const [controlsState, setControlsState] = (0, react_1.useState)(getInitialState);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
JSON.stringify(toggles) === JSON.stringify(togglesRef.current),
|
|
44
|
-
];
|
|
45
|
-
if (sameProps.every(Boolean)) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
filtersRef.current = filters;
|
|
49
|
-
inputsRef.current = inputs;
|
|
50
|
-
togglesRef.current = toggles;
|
|
36
|
+
const controlsKey = JSON.stringify([filters, inputs, toggles]);
|
|
37
|
+
const [prevControlsKey, setPrevControlsKey] = (0, react_1.useState)(controlsKey);
|
|
38
|
+
if (prevControlsKey !== controlsKey) {
|
|
39
|
+
setPrevControlsKey(controlsKey);
|
|
51
40
|
const newState = getInitialState();
|
|
52
41
|
// Preserve existing values where control type hasn't changed
|
|
53
42
|
Object.entries(newState).forEach(([id, control]) => {
|
|
@@ -58,8 +47,7 @@ function useCodeWalkthroughControls(filters, inputs, toggles, enableDeepLink) {
|
|
|
58
47
|
}
|
|
59
48
|
});
|
|
60
49
|
setControlsState(newState);
|
|
61
|
-
|
|
62
|
-
}, [filters, inputs, toggles, enableDeepLink]);
|
|
50
|
+
}
|
|
63
51
|
const changeControlState = (id, value) => {
|
|
64
52
|
setControlsState((prev) => {
|
|
65
53
|
const control = prev[id];
|
|
@@ -58,6 +58,7 @@ function useCodeWalkthroughSteps({ steps, enableDeepLink, root, }) {
|
|
|
58
58
|
startOffset: markersMinTopOffset < endOffset ? startOffset : 0,
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
+
// 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)
|
|
61
62
|
setMarkers(markers.reduce((acc, marker, index) => {
|
|
62
63
|
var _a;
|
|
63
64
|
const step = visibleSteps[index];
|
|
@@ -171,6 +172,7 @@ function useCodeWalkthroughSteps({ steps, enableDeepLink, root, }) {
|
|
|
171
172
|
}
|
|
172
173
|
const rootTopOffset = (_c = (_a = root.current) === null || _a === void 0 ? void 0 : _a.offsetTop) !== null && _c !== void 0 ? _c : 0;
|
|
173
174
|
if (!activeStep && rootTopOffset <= options.navbarHeight) {
|
|
175
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state -- seeded from root.current.offsetTop, a post-layout measurement
|
|
174
176
|
setActiveStep(((_b = visibleSteps[0]) === null || _b === void 0 ? void 0 : _b.id) || null);
|
|
175
177
|
}
|
|
176
178
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -11,6 +11,7 @@ function useMenuItemExpanded(item) {
|
|
|
11
11
|
// it's important for transitions
|
|
12
12
|
const [controlledValue, setControlledValue] = (0, react_1.useState)(isItemExpanded(item));
|
|
13
13
|
(0, react_1.useEffect)(() => {
|
|
14
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state -- deferred a commit on purpose so CSS transitions still run
|
|
14
15
|
setIsExpanded(controlledValue);
|
|
15
16
|
}, [controlledValue]);
|
|
16
17
|
(0, react_1.useEffect)(() => {
|
|
@@ -5,16 +5,20 @@ const react_1 = require("react");
|
|
|
5
5
|
const react_router_1 = require("react-router");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
|
+
const TARGET_TOLERANCE = 2;
|
|
8
9
|
function useActiveHeading(contentElement, displayedHeadings) {
|
|
9
10
|
const [heading, setHeading] = (0, react_1.useState)(undefined);
|
|
10
11
|
const [headingElements, setHeadingElements] = (0, react_1.useState)([]);
|
|
11
12
|
const headingElementsRef = (0, react_1.useRef)({});
|
|
12
13
|
const displayedHeadingsRef = (0, react_1.useRef)(displayedHeadings);
|
|
13
14
|
const lockObserver = (0, react_1.useRef)(false);
|
|
15
|
+
const clickScroll = (0, react_1.useRef)(null);
|
|
14
16
|
const location = (0, react_router_1.useLocation)();
|
|
15
17
|
(0, react_1.useEffect)(() => {
|
|
16
18
|
setHeading(undefined);
|
|
17
19
|
headingElementsRef.current = {};
|
|
20
|
+
clickScroll.current = null;
|
|
21
|
+
lockObserver.current = false;
|
|
18
22
|
}, [location.pathname]);
|
|
19
23
|
(0, react_1.useEffect)(() => {
|
|
20
24
|
displayedHeadingsRef.current = displayedHeadings;
|
|
@@ -98,13 +102,13 @@ function useActiveHeading(contentElement, displayedHeadings) {
|
|
|
98
102
|
}, [calculateVirtualPositions]);
|
|
99
103
|
const intersectionCallback = (0, react_1.useCallback)((entries) => {
|
|
100
104
|
var _a, _b, _c;
|
|
101
|
-
if (lockObserver.current) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
105
|
headingElementsRef.current = entries.reduce((map, entry) => {
|
|
105
106
|
map[entry.target.id] = entry;
|
|
106
107
|
return map;
|
|
107
108
|
}, headingElementsRef.current);
|
|
109
|
+
if (lockObserver.current) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
108
112
|
if (isTopOfPage()) {
|
|
109
113
|
const newHeading = ((_a = headingElements[0]) === null || _a === void 0 ? void 0 : _a.id) || undefined;
|
|
110
114
|
setHeading(newHeading);
|
|
@@ -145,37 +149,79 @@ function useActiveHeading(contentElement, displayedHeadings) {
|
|
|
145
149
|
}
|
|
146
150
|
setHeading(visibleHeadings[0].target.id);
|
|
147
151
|
}, [getIndexFromId, headingElements, getTriggerOffset, findActiveHeaderByVirtualPosition]);
|
|
152
|
+
const releaseClickScroll = (0, react_1.useCallback)(() => {
|
|
153
|
+
clickScroll.current = null;
|
|
154
|
+
lockObserver.current = false;
|
|
155
|
+
}, []);
|
|
156
|
+
const trackClickScroll = (0, react_1.useCallback)(() => {
|
|
157
|
+
const clickScrollState = clickScroll.current;
|
|
158
|
+
if (!clickScrollState) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const { top } = clickScrollState.target.getBoundingClientRect();
|
|
162
|
+
if (clickScrollState.reached) {
|
|
163
|
+
if (top >= 0 && top <= getTriggerOffset()) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
const distance = Math.abs(top - clickScrollState.scrollMargin);
|
|
169
|
+
if (distance <= TARGET_TOLERANCE) {
|
|
170
|
+
clickScrollState.reached = true;
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (distance <= clickScrollState.closestDistance + TARGET_TOLERANCE) {
|
|
174
|
+
clickScrollState.closestDistance = Math.min(clickScrollState.closestDistance, distance);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
releaseClickScroll();
|
|
179
|
+
intersectionCallback([]);
|
|
180
|
+
}, [releaseClickScroll, intersectionCallback, getTriggerOffset]);
|
|
148
181
|
const handleHeadingClick = (0, react_1.useCallback)((headingId) => {
|
|
149
|
-
|
|
182
|
+
releaseClickScroll();
|
|
150
183
|
setHeading(headingId);
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
184
|
+
const target = document.getElementById(headingId) || headingElements.find((el) => el.id === headingId);
|
|
185
|
+
if (!(target === null || target === void 0 ? void 0 : target.scrollIntoView)) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
189
|
+
if (!target.getClientRects().length) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const scrollMargin = parseFloat(getComputedStyle(target).scrollMarginTop) || 0;
|
|
193
|
+
const distance = Math.abs(target.getBoundingClientRect().top - scrollMargin);
|
|
194
|
+
lockObserver.current = true;
|
|
195
|
+
clickScroll.current = {
|
|
196
|
+
target,
|
|
197
|
+
scrollMargin,
|
|
198
|
+
closestDistance: distance,
|
|
199
|
+
reached: distance <= TARGET_TOLERANCE,
|
|
200
|
+
};
|
|
201
|
+
}, [headingElements, releaseClickScroll]);
|
|
160
202
|
(0, react_1.useEffect)(() => {
|
|
161
203
|
var _a;
|
|
162
204
|
if (!contentElement) {
|
|
163
205
|
return;
|
|
164
206
|
}
|
|
165
207
|
const headers = findHeaders(contentElement);
|
|
208
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-chain-state-updates -- headings and the initial active heading come from DOM queries and scroll measurement, available only after layout
|
|
166
209
|
setHeadingElements(headers);
|
|
167
210
|
if (headers.length > 0 && !heading) {
|
|
168
211
|
if (isTopOfPage()) {
|
|
212
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-chain-state-updates -- see above
|
|
169
213
|
setHeading(headers[0].id);
|
|
170
214
|
}
|
|
171
215
|
else {
|
|
172
216
|
const totalHeight = scrollY + window.innerHeight;
|
|
173
217
|
if (totalHeight >= document.body.scrollHeight - 10) {
|
|
218
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-chain-state-updates -- see above
|
|
174
219
|
setHeading(((_a = headers[headers.length - 1]) === null || _a === void 0 ? void 0 : _a.id) || undefined);
|
|
175
220
|
}
|
|
176
221
|
else {
|
|
177
222
|
const triggerOffset = getTriggerOffset();
|
|
178
223
|
const activeHeader = findActiveHeaderByVirtualPosition(headers, scrollY, triggerOffset);
|
|
224
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-chain-state-updates -- see above
|
|
179
225
|
setHeading(activeHeader.id);
|
|
180
226
|
}
|
|
181
227
|
}
|
|
@@ -203,8 +249,10 @@ function useActiveHeading(contentElement, displayedHeadings) {
|
|
|
203
249
|
});
|
|
204
250
|
const handleScroll = () => {
|
|
205
251
|
var _a;
|
|
206
|
-
if (
|
|
252
|
+
if (clickScroll.current) {
|
|
253
|
+
trackClickScroll();
|
|
207
254
|
return;
|
|
255
|
+
}
|
|
208
256
|
if (isTopOfPage()) {
|
|
209
257
|
setHeading(((_a = headingElements[0]) === null || _a === void 0 ? void 0 : _a.id) || undefined);
|
|
210
258
|
}
|
|
@@ -214,7 +262,7 @@ function useActiveHeading(contentElement, displayedHeadings) {
|
|
|
214
262
|
observer.disconnect();
|
|
215
263
|
window.removeEventListener('scroll', handleScroll);
|
|
216
264
|
};
|
|
217
|
-
}, [headingElements, intersectionCallback, getTriggerOffset]);
|
|
265
|
+
}, [headingElements, intersectionCallback, getTriggerOffset, trackClickScroll]);
|
|
218
266
|
return { heading, handleHeadingClick };
|
|
219
267
|
}
|
|
220
268
|
//# sourceMappingURL=use-active-heading.js.map
|
|
@@ -45,10 +45,12 @@ function useActiveSectionId(location, hasOverviewPage = false, withNavbar = true
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
window.addEventListener('scroll', scrollListener, { capture: false });
|
|
48
|
-
setTimeout(() => {
|
|
48
|
+
const initialRead = setTimeout(() => {
|
|
49
49
|
scrollListener();
|
|
50
50
|
}, 10);
|
|
51
51
|
return () => {
|
|
52
|
+
clearTimeout(initialRead);
|
|
53
|
+
scrollListener.cancel();
|
|
52
54
|
window.removeEventListener('scroll', scrollListener);
|
|
53
55
|
};
|
|
54
56
|
}, [location, heightOffset, scrollListener]);
|
|
@@ -9,24 +9,32 @@ const lodash_debounce_1 = __importDefault(require("lodash.debounce"));
|
|
|
9
9
|
const use_theme_hooks_1 = require("./use-theme-hooks");
|
|
10
10
|
const use_mcp_config_1 = require("./use-mcp-config");
|
|
11
11
|
const clipboard_service_1 = require("../utils/clipboard-service");
|
|
12
|
+
const mcp_1 = require("../constants/mcp");
|
|
13
|
+
const mcp_2 = require("../utils/mcp");
|
|
14
|
+
const get_base_data_attributes_1 = require("../utils/telemetry/get-base-data-attributes");
|
|
12
15
|
const COPIED_RESET_TIMEOUT = 1000;
|
|
13
|
-
function useConnectMCPButton({ options =
|
|
14
|
-
const { useTranslate } = (0, use_theme_hooks_1.useThemeHooks)();
|
|
16
|
+
function useConnectMCPButton({ options = mcp_1.DEFAULT_MCP_OPTIONS, } = {}) {
|
|
17
|
+
const { useTranslate, useTelemetry } = (0, use_theme_hooks_1.useThemeHooks)();
|
|
15
18
|
const { translate } = useTranslate();
|
|
19
|
+
const telemetry = useTelemetry();
|
|
16
20
|
const { serverName, serverUrl, cursorUrl, vscodeUrl } = (0, use_mcp_config_1.useMCPConfig)();
|
|
17
|
-
const [
|
|
21
|
+
const [copiedOption, setCopiedOption] = (0, react_1.useState)(null);
|
|
18
22
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
-
const resetCopied = (0, react_1.useCallback)((0, lodash_debounce_1.default)(() =>
|
|
23
|
+
const resetCopied = (0, react_1.useCallback)((0, lodash_debounce_1.default)(() => setCopiedOption(null), COPIED_RESET_TIMEOUT), []);
|
|
20
24
|
const handleAction = (0, react_1.useCallback)((action) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
telemetry.sendConnectMcpClickedMessage([
|
|
26
|
+
Object.assign(Object.assign({}, (0, get_base_data_attributes_1.getBaseDataAttributes)('connectMcp', 'button')), { option: action }),
|
|
27
|
+
]);
|
|
28
|
+
const connection = { serverName, url: serverUrl };
|
|
29
|
+
const copyTextMap = {
|
|
30
|
+
copy: JSON.stringify({ [serverName]: { url: serverUrl, description: 'MCP Server' } }, null, 2),
|
|
31
|
+
'claude-code': (0, mcp_2.generateClaudeCodeCommand)(connection),
|
|
32
|
+
codex: (0, mcp_2.generateCodexCommand)(connection),
|
|
33
|
+
};
|
|
34
|
+
const copyText = copyTextMap[action];
|
|
35
|
+
if (copyText !== undefined) {
|
|
36
|
+
clipboard_service_1.ClipboardService.copyCustom(copyText);
|
|
37
|
+
setCopiedOption(action);
|
|
30
38
|
resetCopied();
|
|
31
39
|
return;
|
|
32
40
|
}
|
|
@@ -35,11 +43,11 @@ function useConnectMCPButton({ options = ['cursor', 'vscode', 'copy'], } = {}) {
|
|
|
35
43
|
vscode: vscodeUrl,
|
|
36
44
|
};
|
|
37
45
|
window.open(urlMap[action], '_blank');
|
|
38
|
-
}, [cursorUrl, vscodeUrl, serverUrl, serverName, resetCopied]);
|
|
46
|
+
}, [cursorUrl, vscodeUrl, serverUrl, serverName, resetCopied, telemetry]);
|
|
39
47
|
const triggerButtonText = (0, react_1.useMemo)(() => translate('page.actions.connectMcp', 'Connect MCP'), [translate]);
|
|
40
48
|
const visibleOptions = (0, react_1.useMemo)(() => options.filter(Boolean), [options]);
|
|
41
49
|
return {
|
|
42
|
-
|
|
50
|
+
copiedOption,
|
|
43
51
|
cursorUrl,
|
|
44
52
|
vscodeUrl,
|
|
45
53
|
triggerButtonText,
|
|
@@ -11,6 +11,9 @@ const useControl = (initialVal = false) => {
|
|
|
11
11
|
clearTimeout(timeoutRef.current);
|
|
12
12
|
}
|
|
13
13
|
}, []);
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
return clearOpenTimer;
|
|
16
|
+
}, [clearOpenTimer]);
|
|
14
17
|
const handleOpen = (0, react_1.useCallback)(() => {
|
|
15
18
|
clearOpenTimer();
|
|
16
19
|
timeoutRef.current = setTimeout(() => {
|
|
@@ -22,6 +22,7 @@ function useLocalState(key, initialValue) {
|
|
|
22
22
|
(0, react_1.useEffect)(() => {
|
|
23
23
|
if (!(0, js_utils_1.isBrowser)())
|
|
24
24
|
return;
|
|
25
|
+
// 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
|
|
25
26
|
setValue(getStoredValue(key, initialValue));
|
|
26
27
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
28
|
}, [key]);
|
|
@@ -9,13 +9,21 @@ const mcp_1 = require("../utils/mcp");
|
|
|
9
9
|
const urls_1 = require("../utils/urls");
|
|
10
10
|
function useMCPConfig() {
|
|
11
11
|
var _a;
|
|
12
|
-
|
|
13
|
-
const {
|
|
12
|
+
var _b;
|
|
13
|
+
const { useMcpData, usePageData } = (0, use_theme_hooks_1.useThemeHooks)();
|
|
14
|
+
const { docs: { enabled, name, publicEndpoint }, } = useMcpData();
|
|
15
|
+
const pageSlug = (_a = usePageData()) === null || _a === void 0 ? void 0 : _a.slug;
|
|
14
16
|
const origin = dom_1.IS_BROWSER
|
|
15
17
|
? window.location.origin
|
|
16
|
-
: ((
|
|
18
|
+
: ((_b = globalThis['SSR_HOSTNAME']) !== null && _b !== void 0 ? _b : '');
|
|
17
19
|
const serverName = name || constants_1.DEFAULT_MCP_SERVER_NAME;
|
|
18
|
-
const
|
|
20
|
+
const isPublicEndpointPage = pageSlug === (0, urls_1.withPathPrefix)(constants_1.PUBLIC_MCP_ROUTE);
|
|
21
|
+
const serverUrl = `${origin}${(0, urls_1.withPathPrefix)(isPublicEndpointPage ? constants_1.PUBLIC_MCP_ROUTE : constants_1.MCP_ROUTE)}`;
|
|
22
|
+
const alternateServerUrl = isPublicEndpointPage
|
|
23
|
+
? `${origin}${(0, urls_1.withPathPrefix)(constants_1.MCP_ROUTE)}`
|
|
24
|
+
: publicEndpoint
|
|
25
|
+
? `${origin}${(0, urls_1.withPathPrefix)(constants_1.PUBLIC_MCP_ROUTE)}`
|
|
26
|
+
: undefined;
|
|
19
27
|
const isMcpDisabled = !enabled || false;
|
|
20
28
|
const cursorUrl = (0, react_1.useMemo)(() => (0, mcp_1.generateMCPDeepLink)('cursor', { serverName, url: serverUrl }), [serverName, serverUrl]);
|
|
21
29
|
const vscodeUrl = (0, react_1.useMemo)(() => (0, mcp_1.generateMCPDeepLink)('vscode', { serverName, url: serverUrl }), [serverName, serverUrl]);
|
|
@@ -26,6 +34,8 @@ function useMCPConfig() {
|
|
|
26
34
|
cursorUrl,
|
|
27
35
|
vscodeUrl,
|
|
28
36
|
isMcpDisabled,
|
|
37
|
+
isPublicEndpointPage,
|
|
38
|
+
alternateServerUrl,
|
|
29
39
|
};
|
|
30
40
|
}
|
|
31
41
|
//# sourceMappingURL=use-mcp-config.js.map
|
|
@@ -7,9 +7,17 @@ const use_modal_scroll_lock_1 = require("./use-modal-scroll-lock");
|
|
|
7
7
|
function useMobileMenu(initialState = false) {
|
|
8
8
|
const location = (0, react_router_1.useLocation)();
|
|
9
9
|
const [isOpen, setIsOpen] = (0, react_1.useState)(initialState);
|
|
10
|
-
|
|
10
|
+
const locationKey = `${location.pathname}${location.hash}`;
|
|
11
|
+
const [prevLocationKey, setPrevLocationKey] = (0, react_1.useState)(locationKey);
|
|
12
|
+
if (isOpen && prevLocationKey !== locationKey) {
|
|
13
|
+
setPrevLocationKey(locationKey);
|
|
14
|
+
setIsOpen(false);
|
|
15
|
+
}
|
|
11
16
|
(0, use_modal_scroll_lock_1.useModalScrollLock)(isOpen);
|
|
12
|
-
const openMobileMenu = () =>
|
|
17
|
+
const openMobileMenu = () => {
|
|
18
|
+
setPrevLocationKey(locationKey);
|
|
19
|
+
setIsOpen(true);
|
|
20
|
+
};
|
|
13
21
|
const closeMobileMenu = () => setIsOpen(false);
|
|
14
22
|
return { isOpen, openMobileMenu, closeMobileMenu };
|
|
15
23
|
}
|
|
@@ -220,12 +220,14 @@ const useActiveTab = ({ initialTab, tabsId }) => {
|
|
|
220
220
|
const [activeTab, setActiveTab] = (0, react_1.useState)(undefined);
|
|
221
221
|
const resolvedActiveTab = activeTab !== null && activeTab !== void 0 ? activeTab : initialTab;
|
|
222
222
|
const prevActiveTabRef = (0, react_1.useRef)(resolvedActiveTab);
|
|
223
|
+
const isTabResolvedFromHashRef = (0, react_1.useRef)(false);
|
|
223
224
|
(0, react_1.useEffect)(() => {
|
|
224
|
-
if (
|
|
225
|
+
if (isTabResolvedFromHashRef.current) {
|
|
225
226
|
return;
|
|
226
227
|
}
|
|
228
|
+
isTabResolvedFromHashRef.current = true;
|
|
227
229
|
setActiveTab(getInitialTab({ initialTab, hash: location.hash, tabsId }));
|
|
228
|
-
}, [
|
|
230
|
+
}, [initialTab, location.hash, tabsId]);
|
|
229
231
|
(0, react_1.useEffect)(() => {
|
|
230
232
|
const hasActiveTabChanged = prevActiveTabRef.current !== resolvedActiveTab;
|
|
231
233
|
if (!tabsId || !hasActiveTabChanged) {
|
|
@@ -34,6 +34,8 @@ export declare const useTelemetryFallback: () => {
|
|
|
34
34
|
sendProductPickerChangedMessage: () => void;
|
|
35
35
|
sendLogoClickedMessage: () => void;
|
|
36
36
|
sendCodeSnippetReportedMessage: () => void;
|
|
37
|
+
sendConnectMcpClickedMessage: () => void;
|
|
38
|
+
sendMcpConnectionSnippetCopiedMessage: () => void;
|
|
37
39
|
sendMobileMenuClosedMessage: () => void;
|
|
38
40
|
sendMobileMenuOpenedMessage: () => void;
|
|
39
41
|
sendPageViewedMessage: () => void;
|
|
@@ -39,6 +39,8 @@ const useTelemetryFallback = () => ({
|
|
|
39
39
|
sendProductPickerChangedMessage: () => { },
|
|
40
40
|
sendLogoClickedMessage: () => { },
|
|
41
41
|
sendCodeSnippetReportedMessage: () => { },
|
|
42
|
+
sendConnectMcpClickedMessage: () => { },
|
|
43
|
+
sendMcpConnectionSnippetCopiedMessage: () => { },
|
|
42
44
|
sendMobileMenuClosedMessage: () => { },
|
|
43
45
|
sendMobileMenuOpenedMessage: () => { },
|
|
44
46
|
sendPageViewedMessage: () => { },
|