@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.
Files changed (87) hide show
  1. package/lib/components/Buttons/ConnectMCPButton.js +11 -1
  2. package/lib/components/Buttons/variables.d.ts +1 -0
  3. package/lib/components/Buttons/variables.js +4 -1
  4. package/lib/components/Catalog/Catalog.js +2 -2
  5. package/lib/components/JsonViewer/Helpers.js +3 -3
  6. package/lib/components/MCP/McpConnectionTabs.js +9 -2
  7. package/lib/components/Portal/Portal.js +37 -5
  8. package/lib/components/Search/SearchAiActionButtons.js +8 -3
  9. package/lib/components/Search/SearchDialog.js +10 -0
  10. package/lib/components/Search/SearchItem.js +1 -1
  11. package/lib/components/Search/SearchTrigger.js +33 -8
  12. package/lib/components/Search/variables.js +2 -0
  13. package/lib/core/constants/mcp.d.ts +2 -2
  14. package/lib/core/constants/mcp.js +1 -1
  15. package/lib/core/contexts/PortalContainerContext.d.ts +2 -0
  16. package/lib/core/contexts/PortalContainerContext.js +7 -0
  17. package/lib/core/hooks/code-walkthrough/use-code-panel.d.ts +1 -1
  18. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.d.ts +1 -1
  19. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +1 -1
  20. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
  21. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +1 -2
  22. package/lib/core/hooks/code-walkthrough/use-renderable-files.d.ts +1 -1
  23. package/lib/core/hooks/index.d.ts +1 -0
  24. package/lib/core/hooks/index.js +1 -0
  25. package/lib/core/hooks/search/use-persisted-quick-filter.d.ts +21 -0
  26. package/lib/core/hooks/search/use-persisted-quick-filter.js +92 -0
  27. package/lib/core/hooks/use-connect-mcp-button.js +1 -0
  28. package/lib/core/hooks/use-page-actions.d.ts +1 -1
  29. package/lib/core/hooks/use-page-actions.js +6 -0
  30. package/lib/core/styles/global.js +1 -0
  31. package/lib/core/types/code-walkthrough.d.ts +84 -0
  32. package/lib/core/types/hooks.d.ts +1 -1
  33. package/lib/core/types/l10n.d.ts +1 -1
  34. package/lib/core/types/mcp.d.ts +1 -1
  35. package/lib/core/utils/download-code-walkthrough.d.ts +1 -1
  36. package/lib/core/utils/get-code-walkthrough-file-text.d.ts +1 -1
  37. package/lib/core/utils/match-code-walkthrough-conditions.d.ts +1 -1
  38. package/lib/core/utils/mcp.js +7 -2
  39. package/lib/markdoc/components/CodeWalkthrough/CodeFilters.d.ts +1 -1
  40. package/lib/markdoc/components/CodeWalkthrough/CodePanel.d.ts +1 -1
  41. package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.d.ts +1 -1
  42. package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.d.ts +1 -1
  43. package/lib/markdoc/components/CodeWalkthrough/CodeStep.d.ts +1 -1
  44. package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.d.ts +1 -1
  45. package/lib/markdoc/components/Tabs/TabList.js +8 -6
  46. package/lib/markdoc/tags/code-walkthrough.d.ts +1 -1
  47. package/package.json +4 -3
  48. package/src/components/Buttons/ConnectMCPButton.tsx +13 -2
  49. package/src/components/Buttons/variables.ts +4 -0
  50. package/src/components/Catalog/Catalog.tsx +5 -3
  51. package/src/components/JsonViewer/Helpers.tsx +5 -3
  52. package/src/components/MCP/McpConnectionTabs.tsx +22 -5
  53. package/src/components/Portal/Portal.tsx +4 -2
  54. package/src/components/Search/SearchAiActionButtons.tsx +31 -19
  55. package/src/components/Search/SearchDialog.tsx +11 -0
  56. package/src/components/Search/SearchItem.tsx +3 -1
  57. package/src/components/Search/SearchTrigger.tsx +42 -7
  58. package/src/components/Search/variables.ts +2 -0
  59. package/src/core/constants/mcp.ts +1 -1
  60. package/src/core/contexts/PortalContainerContext.tsx +4 -0
  61. package/src/core/hooks/__mocks__/index.ts +1 -0
  62. package/src/core/hooks/code-walkthrough/use-code-panel.ts +1 -1
  63. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +2 -2
  64. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -1
  65. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
  66. package/src/core/hooks/code-walkthrough/use-renderable-files.ts +1 -1
  67. package/src/core/hooks/index.ts +1 -0
  68. package/src/core/hooks/search/use-persisted-quick-filter.ts +125 -0
  69. package/src/core/hooks/use-connect-mcp-button.ts +7 -1
  70. package/src/core/hooks/use-page-actions.ts +17 -0
  71. package/src/core/styles/global.ts +2 -1
  72. package/src/core/types/code-walkthrough.ts +103 -0
  73. package/src/core/types/hooks.ts +1 -0
  74. package/src/core/types/l10n.ts +6 -0
  75. package/src/core/types/mcp.ts +1 -1
  76. package/src/core/utils/download-code-walkthrough.ts +1 -1
  77. package/src/core/utils/get-code-walkthrough-file-text.ts +1 -1
  78. package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
  79. package/src/core/utils/mcp.ts +8 -2
  80. package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
  81. package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -1
  82. package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +1 -1
  83. package/src/markdoc/components/CodeWalkthrough/CodePanelToolbar.tsx +1 -1
  84. package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
  85. package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +1 -1
  86. package/src/markdoc/components/Tabs/TabList.tsx +9 -12
  87. 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/config';
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/config';
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/config';
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/config';
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 } = useDropdownPosition(
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="dropdown-tab"
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/config';
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';