@redocly/theme 0.70.0-next.7 → 0.70.0-next.8
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/ConnectMCPButton.js +11 -1
- package/lib/components/Buttons/variables.d.ts +1 -0
- package/lib/components/Buttons/variables.js +4 -1
- package/lib/components/Catalog/Catalog.js +2 -2
- package/lib/components/JsonViewer/Helpers.js +3 -3
- package/lib/components/MCP/McpConnectionTabs.js +9 -2
- package/lib/components/Search/SearchItem.js +1 -1
- package/lib/components/Search/SearchTrigger.js +33 -8
- package/lib/components/Search/variables.js +2 -0
- package/lib/core/constants/mcp.d.ts +2 -2
- package/lib/core/constants/mcp.js +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-panel.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +1 -2
- package/lib/core/hooks/code-walkthrough/use-renderable-files.d.ts +1 -1
- package/lib/core/hooks/use-connect-mcp-button.js +1 -0
- package/lib/core/hooks/use-page-actions.d.ts +1 -1
- package/lib/core/hooks/use-page-actions.js +6 -0
- package/lib/core/styles/global.js +1 -0
- package/lib/core/types/code-walkthrough.d.ts +84 -0
- package/lib/core/types/hooks.d.ts +1 -1
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/mcp.d.ts +1 -1
- package/lib/core/utils/download-code-walkthrough.d.ts +1 -1
- package/lib/core/utils/get-code-walkthrough-file-text.d.ts +1 -1
- package/lib/core/utils/match-code-walkthrough-conditions.d.ts +1 -1
- package/lib/core/utils/mcp.js +7 -2
- package/lib/markdoc/components/CodeWalkthrough/CodeFilters.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.d.ts +1 -1
- package/lib/markdoc/components/Tabs/TabList.js +8 -6
- package/lib/markdoc/tags/code-walkthrough.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/Buttons/ConnectMCPButton.tsx +13 -2
- package/src/components/Buttons/variables.ts +4 -0
- package/src/components/Catalog/Catalog.tsx +5 -3
- package/src/components/JsonViewer/Helpers.tsx +5 -3
- package/src/components/MCP/McpConnectionTabs.tsx +22 -5
- package/src/components/Search/SearchItem.tsx +3 -1
- package/src/components/Search/SearchTrigger.tsx +42 -7
- package/src/components/Search/variables.ts +2 -0
- package/src/core/constants/mcp.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-panel.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +2 -2
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
- package/src/core/hooks/code-walkthrough/use-renderable-files.ts +1 -1
- package/src/core/hooks/use-connect-mcp-button.ts +7 -1
- package/src/core/hooks/use-page-actions.ts +17 -0
- package/src/core/styles/global.ts +2 -1
- package/src/core/types/code-walkthrough.ts +103 -0
- package/src/core/types/hooks.ts +1 -0
- package/src/core/types/l10n.ts +3 -0
- package/src/core/types/mcp.ts +1 -1
- package/src/core/utils/download-code-walkthrough.ts +1 -1
- package/src/core/utils/get-code-walkthrough-file-text.ts +1 -1
- package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
- package/src/core/utils/mcp.ts +8 -2
- package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanelToolbar.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +1 -1
- package/src/markdoc/components/Tabs/TabList.tsx +9 -12
- package/src/markdoc/tags/code-walkthrough.ts +1 -1
package/src/core/types/l10n.ts
CHANGED
|
@@ -152,6 +152,7 @@ export type TranslationKey =
|
|
|
152
152
|
| 'page.mcpNotAllowed.snippets.terminal.hint'
|
|
153
153
|
| 'page.mcpNotAllowed.snippets.claudeCode.headline'
|
|
154
154
|
| 'page.mcpNotAllowed.snippets.claudeDesktop.headline'
|
|
155
|
+
| 'page.mcpNotAllowed.snippets.claudeDesktop.accountHint'
|
|
155
156
|
| 'page.mcpNotAllowed.snippets.claudeDesktop.instruction'
|
|
156
157
|
| 'page.mcpNotAllowed.snippets.chatgptApp.headline'
|
|
157
158
|
| 'page.mcpNotAllowed.snippets.chatgptApp.instruction'
|
|
@@ -299,6 +300,8 @@ export type TranslationKey =
|
|
|
299
300
|
| 'page.actions.connectMcp.cursorDescription'
|
|
300
301
|
| 'page.actions.connectMcp.vscode'
|
|
301
302
|
| 'page.actions.connectMcp.vscodeDescription'
|
|
303
|
+
| 'page.actions.connectMcp.claude'
|
|
304
|
+
| 'page.actions.connectMcp.claudeDescription'
|
|
302
305
|
| 'page.actions.connectMcp.claudeCode'
|
|
303
306
|
| 'page.actions.connectMcp.claudeCodeDescription'
|
|
304
307
|
| 'page.actions.connectMcp.codex'
|
package/src/core/types/mcp.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { saveAs } from 'file-saver';
|
|
2
2
|
|
|
3
|
-
import type { CodeWalkthroughFile } from '@redocly/
|
|
3
|
+
import type { CodeWalkthroughFile } from '@redocly/theme/core/types';
|
|
4
4
|
|
|
5
5
|
import { removeLeadingSlash } from './urls';
|
|
6
6
|
import { findClosestCommonDirectory } from './find-closest-common-directory';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeWalkthroughFile, CodeWalkthroughNode } from '@redocly/
|
|
1
|
+
import type { CodeWalkthroughFile, CodeWalkthroughNode } from '@redocly/theme/core/types';
|
|
2
2
|
|
|
3
3
|
import { matchCodeWalkthroughConditions } from './match-code-walkthrough-conditions';
|
|
4
4
|
import { replaceInputsWithValue } from './replace-inputs-with-value';
|
package/src/core/utils/mcp.ts
CHANGED
|
@@ -25,6 +25,12 @@ function generateVSCodeMCPDeepLink(config: McpConnectionParams): string {
|
|
|
25
25
|
return `vscode:mcp/install?${encodedConfig}`;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
function generateClaudeConnectorLink(config: McpConnectionParams): string {
|
|
29
|
+
const connectorName = encodeURIComponent(config.serverName);
|
|
30
|
+
const connectorUrl = encodeURIComponent(config.url);
|
|
31
|
+
return `https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=${connectorName}&connectorUrl=${connectorUrl}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
export function generateMCPDeepLink(
|
|
29
35
|
clientType: MCPClientType,
|
|
30
36
|
config: McpConnectionParams,
|
|
@@ -34,8 +40,8 @@ export function generateMCPDeepLink(
|
|
|
34
40
|
return generateCursorMCPDeepLink(config);
|
|
35
41
|
case 'vscode':
|
|
36
42
|
return generateVSCodeMCPDeepLink(config);
|
|
37
|
-
|
|
38
|
-
return
|
|
43
|
+
case 'claude':
|
|
44
|
+
return generateClaudeConnectorLink(config);
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
47
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { CodeWalkthroughFilter } from '@redocly/
|
|
4
|
+
import type { CodeWalkthroughFilter } from '@redocly/theme/core/types';
|
|
5
5
|
|
|
6
6
|
import { Tag, ContentWrapper as TagContentWrapper } from '@redocly/theme/components/Tag/Tag';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
5
|
-
import type { CodeWalkthroughFile } from '@redocly/
|
|
5
|
+
import type { CodeWalkthroughFile } from '@redocly/theme/core/types';
|
|
6
6
|
|
|
7
7
|
import { useCodePanel } from '@redocly/theme/core/hooks';
|
|
8
8
|
import { CodeWalkthroughControlsStateContext } from '@redocly/theme/core/contexts';
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
5
|
-
import type { CodeWalkthroughFile } from '@redocly/
|
|
5
|
+
import type { CodeWalkthroughFile } from '@redocly/theme/core/types';
|
|
6
6
|
|
|
7
7
|
import { useThemeHooks, useRenderableFiles, type RenderableFile } from '@redocly/theme/core/hooks';
|
|
8
8
|
import { OverflowMenuVerticalIcon } from '@redocly/theme/icons/OverflowMenuVerticalIcon/OverflowMenuVerticalIcon';
|
|
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
5
|
-
import type { CodeWalkthroughFile } from '@redocly/
|
|
5
|
+
import type { CodeWalkthroughFile } from '@redocly/theme/core/types';
|
|
6
6
|
|
|
7
7
|
import { CodeWalkthroughControlsStateContext } from '@redocly/theme/core/contexts';
|
|
8
8
|
import { CopyButton } from '@redocly/theme/components/Buttons/CopyButton';
|
|
@@ -10,7 +10,7 @@ import React, {
|
|
|
10
10
|
import styled from 'styled-components';
|
|
11
11
|
import { useLocation } from 'react-router';
|
|
12
12
|
|
|
13
|
-
import type { WithConditions } from '@redocly/
|
|
13
|
+
import type { WithConditions } from '@redocly/theme/core/types';
|
|
14
14
|
|
|
15
15
|
import { Marker } from '@redocly/theme/components/Marker/Marker';
|
|
16
16
|
import {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, type PropsWithChildren } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { CodeWalkthroughAttr } from '@redocly/
|
|
4
|
+
import type { CodeWalkthroughAttr } from '@redocly/theme/core/types';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
CodeWalkthroughStepsContext,
|
|
@@ -193,10 +193,8 @@ export function TabList({
|
|
|
193
193
|
// Show as selector when no visible tabs (all tabs in dropdown)
|
|
194
194
|
const showAsSelector = visibleTabs.length === 0 && hasOverflow;
|
|
195
195
|
|
|
196
|
-
const { dropdownPosition, setIsDropdownOpen, setDropdownPosition } =
|
|
197
|
-
hasOverflow,
|
|
198
|
-
dropdownRef,
|
|
199
|
-
);
|
|
196
|
+
const { dropdownPosition, isDropdownOpen, setIsDropdownOpen, setDropdownPosition } =
|
|
197
|
+
useDropdownPosition(hasOverflow, dropdownRef);
|
|
200
198
|
|
|
201
199
|
return (
|
|
202
200
|
<TabListContainer role="tablist" ref={containerRef}>
|
|
@@ -216,15 +214,9 @@ export function TabList({
|
|
|
216
214
|
size={size}
|
|
217
215
|
active={isMoreActive || showAsSelector}
|
|
218
216
|
tabIndex={0}
|
|
219
|
-
className=
|
|
217
|
+
className={isDropdownOpen ? 'dropdown-tab dropdown-tab-open' : 'dropdown-tab'}
|
|
220
218
|
>
|
|
221
|
-
<DropdownWrapper
|
|
222
|
-
$top={dropdownPosition.top}
|
|
223
|
-
$left={dropdownPosition.left}
|
|
224
|
-
onClickCapture={() => {
|
|
225
|
-
setIsDropdownOpen(true);
|
|
226
|
-
}}
|
|
227
|
-
>
|
|
219
|
+
<DropdownWrapper $top={dropdownPosition.top} $left={dropdownPosition.left}>
|
|
228
220
|
<FixedPositionDropdown
|
|
229
221
|
ref={dropdownRef}
|
|
230
222
|
trigger={
|
|
@@ -237,6 +229,7 @@ export function TabList({
|
|
|
237
229
|
}
|
|
238
230
|
alignment="start"
|
|
239
231
|
withArrow
|
|
232
|
+
onOpen={() => setIsDropdownOpen(true)}
|
|
240
233
|
onClose={() => {
|
|
241
234
|
setIsDropdownOpen(false);
|
|
242
235
|
setDropdownPosition({});
|
|
@@ -360,6 +353,10 @@ export const TabListContainer = styled.ul`
|
|
|
360
353
|
min-width: 0;
|
|
361
354
|
max-width: 100%;
|
|
362
355
|
}
|
|
356
|
+
|
|
357
|
+
&.dropdown-tab-open {
|
|
358
|
+
z-index: var(--dropdown-menu-z-index);
|
|
359
|
+
}
|
|
363
360
|
}
|
|
364
361
|
}
|
|
365
362
|
`;
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
CodeWalkthroughFilterItem,
|
|
11
11
|
TogglesMarkdocAttr,
|
|
12
12
|
InputsMarkdocAttr,
|
|
13
|
-
} from '@redocly/
|
|
13
|
+
} from '@redocly/theme/core/types';
|
|
14
14
|
|
|
15
15
|
import { CodeWalkthroughFilesets } from '@redocly/theme/markdoc/attributes/code-walkthrough-filesets';
|
|
16
16
|
import { CodeWalkthroughFilters } from '@redocly/theme/markdoc/attributes/code-walkthrough-filters';
|