@redocly/theme 0.70.0-next.6 → 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/Portal/Portal.js +37 -5
- package/lib/components/Search/SearchAiActionButtons.js +8 -3
- package/lib/components/Search/SearchDialog.js +10 -0
- 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/contexts/PortalContainerContext.d.ts +2 -0
- package/lib/core/contexts/PortalContainerContext.js +7 -0
- 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/index.d.ts +1 -0
- package/lib/core/hooks/index.js +1 -0
- package/lib/core/hooks/search/use-persisted-quick-filter.d.ts +21 -0
- package/lib/core/hooks/search/use-persisted-quick-filter.js +92 -0
- 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 +4 -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/Portal/Portal.tsx +4 -2
- package/src/components/Search/SearchAiActionButtons.tsx +31 -19
- package/src/components/Search/SearchDialog.tsx +11 -0
- 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/contexts/PortalContainerContext.tsx +4 -0
- package/src/core/hooks/__mocks__/index.ts +1 -0
- 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/index.ts +1 -0
- package/src/core/hooks/search/use-persisted-quick-filter.ts +125 -0
- 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 +6 -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
|
@@ -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';
|