@redocly/theme 0.70.0-next.4 → 0.70.0-next.6
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 +8 -13
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.js +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +30 -11
- package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.js +2 -1
- package/lib/components/Dropdown/Dropdown.d.ts +4 -2
- package/lib/components/Dropdown/Dropdown.js +28 -8
- package/lib/components/Dropdown/DropdownMenu.d.ts +1 -0
- package/lib/components/Dropdown/DropdownMenu.js +1 -1
- package/lib/components/Feedback/Reasons.js +3 -2
- package/lib/components/Filter/FilterCheckboxes.js +30 -11
- package/lib/components/Filter/FilterDateRange.js +36 -2
- package/lib/components/Image/Image.js +24 -4
- package/lib/components/Search/SearchAiActivity.d.ts +10 -0
- package/lib/components/Search/SearchAiActivity.js +278 -0
- package/lib/components/Search/SearchAiDialog.js +5 -1
- package/lib/components/Search/SearchAiMessage.d.ts +2 -1
- package/lib/components/Search/SearchAiMessage.js +20 -108
- package/lib/components/Search/SearchItem.js +1 -8
- package/lib/components/Search/variables.js +15 -2
- package/lib/components/Segmented/Segmented.js +23 -3
- package/lib/components/Select/Select.js +10 -3
- package/lib/components/Select/SelectInput.d.ts +1 -0
- package/lib/components/Select/SelectInput.js +5 -11
- package/lib/components/SplitButton/SplitButton.js +37 -3
- package/lib/core/constants/mcp.d.ts +2 -2
- package/lib/core/constants/mcp.js +3 -8
- package/lib/core/constants/search.js +5 -1
- package/lib/core/hooks/index.d.ts +2 -0
- package/lib/core/hooks/index.js +2 -0
- package/lib/core/hooks/menu/use-collapse.js +1 -1
- package/lib/core/hooks/search/use-search-ai-activity.d.ts +11 -0
- package/lib/core/hooks/search/use-search-ai-activity.js +15 -0
- package/lib/core/hooks/use-connect-mcp-button.js +2 -1
- package/lib/core/hooks/use-full-height.d.ts +1 -1
- package/lib/core/hooks/use-full-height.js +8 -8
- package/lib/core/hooks/use-tab-list.d.ts +31 -0
- package/lib/core/hooks/use-tab-list.js +49 -0
- package/lib/core/styles/global.d.ts +2 -0
- package/lib/core/styles/global.js +80 -76
- package/lib/core/styles/index.d.ts +1 -0
- package/lib/core/styles/index.js +3 -1
- package/lib/core/styles/search-ai-appear.d.ts +1 -0
- package/lib/core/styles/search-ai-appear.js +18 -0
- package/lib/core/types/dropdown.d.ts +1 -0
- package/lib/core/types/dropdown.js +3 -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 +2 -1
- package/lib/core/types/search.d.ts +23 -0
- package/lib/core/utils/Dynamic.d.ts +8 -1
- package/lib/core/utils/Dynamic.js +34 -3
- package/lib/core/utils/assign-ref.d.ts +2 -0
- package/lib/core/utils/assign-ref.js +12 -0
- package/lib/core/utils/content-segments.d.ts +12 -1
- package/lib/core/utils/content-segments.js +90 -5
- package/lib/core/utils/dropdown.d.ts +2 -0
- package/lib/core/utils/dropdown.js +12 -0
- package/lib/core/utils/index.d.ts +2 -0
- package/lib/core/utils/index.js +2 -0
- package/lib/core/utils/mcp.d.ts +2 -1
- package/lib/core/utils/mcp.js +5 -0
- package/lib/core/utils/search-ai-activity.d.ts +4 -0
- package/lib/core/utils/search-ai-activity.js +83 -0
- package/lib/markdoc/tags/connect-mcp.js +15 -0
- package/package.json +2 -2
- package/src/components/Buttons/ConnectMCPButton.tsx +8 -14
- package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.tsx +3 -1
- package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +37 -22
- package/src/components/Catalog/CatalogFilter/CatalogFilterDateRange.tsx +3 -2
- package/src/components/Dropdown/Dropdown.tsx +28 -6
- package/src/components/Dropdown/DropdownMenu.tsx +7 -1
- package/src/components/Feedback/Reasons.tsx +3 -2
- package/src/components/Filter/FilterCheckboxes.tsx +33 -18
- package/src/components/Filter/FilterDateRange.tsx +3 -2
- package/src/components/Image/Image.tsx +26 -5
- package/src/components/Search/SearchAiActivity.tsx +318 -0
- package/src/components/Search/SearchAiDialog.tsx +4 -3
- package/src/components/Search/SearchAiMessage.tsx +27 -135
- package/src/components/Search/SearchItem.tsx +2 -9
- package/src/components/Search/variables.ts +15 -2
- package/src/components/Segmented/Segmented.tsx +25 -16
- package/src/components/Select/Select.tsx +12 -6
- package/src/components/Select/SelectInput.tsx +10 -18
- package/src/components/SplitButton/SplitButton.tsx +8 -2
- package/src/core/constants/mcp.ts +3 -9
- package/src/core/constants/search.ts +5 -1
- package/src/core/hooks/__mocks__/index.ts +1 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -0
- package/src/core/hooks/index.ts +2 -0
- package/src/core/hooks/menu/use-collapse.ts +1 -1
- package/src/core/hooks/search/use-search-ai-activity.ts +31 -0
- package/src/core/hooks/use-connect-mcp-button.ts +7 -2
- package/src/core/hooks/use-full-height.ts +8 -8
- package/src/core/hooks/use-tab-list.ts +63 -0
- package/src/core/styles/global.ts +80 -75
- package/src/core/styles/index.ts +2 -1
- package/src/core/styles/search-ai-appear.ts +16 -0
- package/src/core/types/dropdown.ts +1 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +1 -1
- package/src/core/types/mcp.ts +3 -1
- package/src/core/types/search.ts +21 -0
- package/src/core/utils/Dynamic.tsx +67 -35
- package/src/core/utils/assign-ref.ts +9 -0
- package/src/core/utils/content-segments.ts +98 -6
- package/src/core/utils/dropdown.ts +14 -0
- package/src/core/utils/index.ts +2 -0
- package/src/core/utils/mcp.ts +7 -1
- package/src/core/utils/search-ai-activity.ts +110 -0
- package/src/icons/CheckboxIcon/CheckboxIcon.tsx +1 -0
- package/src/icons/ChevronSortIcon/ChevronSortIcon.tsx +1 -0
- package/src/markdoc/tags/connect-mcp.ts +16 -1
|
@@ -43,8 +43,9 @@ const react_1 = __importStar(require("react"));
|
|
|
43
43
|
const Tag_1 = require("../../components/Tag/Tag");
|
|
44
44
|
const CloseIcon_1 = require("../../icons/CloseIcon/CloseIcon");
|
|
45
45
|
const Button_1 = require("../../components/Button/Button");
|
|
46
|
+
const utils_1 = require("../../core/utils");
|
|
46
47
|
function SelectInput(props) {
|
|
47
|
-
const { id, listboxId, onlyIcon, icon, customIcon, selectedOptions, placeholder, stickyValue, multiple, searchable, clearable, clearHandler, searchHandler, clickHandler, searchValue, inputBlurHandler, inputFocusHandler, inputRef: forwardedInputRef, } = props;
|
|
48
|
+
const { id, listboxId, onlyIcon, icon, customIcon, selectedOptions, placeholder, stickyValue, multiple, searchable, expanded, clearable, clearHandler, searchHandler, clickHandler, searchValue, inputBlurHandler, inputFocusHandler, inputRef: forwardedInputRef, } = props;
|
|
48
49
|
const inputRef = (0, react_1.useRef)(null);
|
|
49
50
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
50
51
|
const onChangeHandler = (e) => {
|
|
@@ -87,22 +88,15 @@ function SelectInput(props) {
|
|
|
87
88
|
if (!input)
|
|
88
89
|
return;
|
|
89
90
|
inputRef.current = input;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (typeof forwardedInputRef === 'function') {
|
|
93
|
-
forwardedInputRef(input);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
forwardedInputRef.current = input;
|
|
97
|
-
}
|
|
98
|
-
}, $width: multiple ? (!searchValue && selectedOptions.length ? '10px' : 'auto') : '100%', tabIndex: 0, onFocus: (e) => {
|
|
91
|
+
(0, utils_1.assignRef)(forwardedInputRef, input);
|
|
92
|
+
}, $width: multiple ? (!searchValue && selectedOptions.length ? '10px' : 'auto') : '100%', tabIndex: 0, role: "combobox", "aria-expanded": !!expanded, "aria-controls": listboxId, "aria-autocomplete": "list", "aria-label": "Select option", onFocus: (e) => {
|
|
99
93
|
e.stopPropagation();
|
|
100
94
|
}, onMouseDown: (e) => {
|
|
101
95
|
e.preventDefault();
|
|
102
96
|
} }));
|
|
103
97
|
const simpleValue = selectedOptions.length ? (selectedOptions[0].label || selectedOptions[0].element || selectedOptions[0].value) : (react_1.default.createElement(SelectInternalInputPlaceholder, null, placeholder));
|
|
104
98
|
const multipleValues = selectedOptions.length ? (selectTags) : (react_1.default.createElement(SelectInternalInputPlaceholder, null, placeholder));
|
|
105
|
-
return (react_1.default.createElement(exports.SelectInputWrapper, { id: id, onFocus: onFocusHandler, onClick: onClickHandler
|
|
99
|
+
return (react_1.default.createElement(exports.SelectInputWrapper, { id: id, onFocus: onFocusHandler, onClick: onClickHandler },
|
|
106
100
|
!onlyIcon && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
107
101
|
react_1.default.createElement(SelectInputValue, null, multiple ? (searchable ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
108
102
|
selectTags,
|
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.SplitButton = SplitButton;
|
|
7
|
-
const react_1 =
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
8
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
42
|
const Button_1 = require("../../components/Button/Button");
|
|
10
43
|
const ButtonGroup_1 = require("../../components/Button/ButtonGroup");
|
|
@@ -12,10 +45,11 @@ const Dropdown_1 = require("../../components/Dropdown/Dropdown");
|
|
|
12
45
|
function SplitButton(props) {
|
|
13
46
|
const { button, children, variant, size, tone, placement = 'bottom', alignment = 'end', portalled, closeOnSelect = true, disabled, toggleAriaLabel, onOpen, onClose, className, } = props;
|
|
14
47
|
const hasMenu = typeof children === 'function' || react_1.default.Children.toArray(children).length > 0;
|
|
15
|
-
|
|
48
|
+
const wrapperRef = (0, react_1.useRef)(null);
|
|
49
|
+
return (react_1.default.createElement(SplitButtonWrapper, { "data-component-name": "SplitButton/SplitButton", className: className, ref: wrapperRef },
|
|
16
50
|
react_1.default.createElement(ButtonGroup_1.ButtonGroup, { variant: variant, size: size },
|
|
17
51
|
button,
|
|
18
|
-
hasMenu ? (react_1.default.createElement(ToggleDropdown, { closeOnClick: closeOnSelect, placement: placement, alignment: alignment, portalled: portalled, withArrow: true, onOpen: onOpen, onClose: onClose, trigger: react_1.default.createElement(Button_1.Button, { "aria-label": toggleAriaLabel, "aria-haspopup": "menu", variant: variant, size: size, tone: tone, disabled: disabled }) }, children)) : null)));
|
|
52
|
+
hasMenu ? (react_1.default.createElement(ToggleDropdown, { closeOnClick: closeOnSelect, placement: placement, alignment: alignment, portalled: portalled, alignmentAnchorRef: wrapperRef, withArrow: true, onOpen: onOpen, onClose: onClose, trigger: react_1.default.createElement(Button_1.Button, { "aria-label": toggleAriaLabel, "aria-haspopup": "menu", variant: variant, size: size, tone: tone, disabled: disabled }) }, children)) : null)));
|
|
19
53
|
}
|
|
20
54
|
const SplitButtonWrapper = styled_components_1.default.div `
|
|
21
55
|
position: relative;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MCPOption } from '../types/mcp';
|
|
2
1
|
export declare const DEFAULT_MCP_SERVER_NAME = "mcp-server";
|
|
3
2
|
export declare const MCP_ROUTE = "/mcp";
|
|
4
3
|
export declare const PUBLIC_MCP_ROUTE = "/mcp-public";
|
|
5
|
-
export declare const
|
|
4
|
+
export declare const MCP_OPTIONS: readonly ['cursor', 'vscode', 'claude-code', 'codex', 'copy'];
|
|
5
|
+
export declare const DEFAULT_MCP_OPTIONS: ("claude-code" | "codex" | "copy" | "cursor" | "vscode")[];
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_MCP_OPTIONS = exports.PUBLIC_MCP_ROUTE = exports.MCP_ROUTE = exports.DEFAULT_MCP_SERVER_NAME = void 0;
|
|
3
|
+
exports.DEFAULT_MCP_OPTIONS = exports.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
5
|
exports.MCP_ROUTE = '/mcp';
|
|
6
6
|
exports.PUBLIC_MCP_ROUTE = '/mcp-public';
|
|
7
|
-
exports.
|
|
8
|
-
|
|
9
|
-
'vscode',
|
|
10
|
-
'claude-code',
|
|
11
|
-
'codex',
|
|
12
|
-
'copy',
|
|
13
|
-
];
|
|
7
|
+
exports.MCP_OPTIONS = ['cursor', 'vscode', 'claude-code', 'codex', 'copy'];
|
|
8
|
+
exports.DEFAULT_MCP_OPTIONS = [...exports.MCP_OPTIONS];
|
|
14
9
|
//# sourceMappingURL=mcp.js.map
|
|
@@ -43,7 +43,7 @@ exports.DEFAULT_KEYBOARD_SHORTCUTS = '⌘+K,CTRL+K';
|
|
|
43
43
|
exports.TOOL_CALL_DISPLAY_TEXT = {
|
|
44
44
|
[search_1.ToolCallName.SearchDocumentation]: {
|
|
45
45
|
inProgressText: 'Searching documentation...',
|
|
46
|
-
completedText: '
|
|
46
|
+
completedText: 'Searched the documentation',
|
|
47
47
|
},
|
|
48
48
|
[search_1.ToolCallName.ListApis]: {
|
|
49
49
|
inProgressText: 'Browsing APIs...',
|
|
@@ -65,6 +65,10 @@ exports.TOOL_CALL_DISPLAY_TEXT = {
|
|
|
65
65
|
inProgressText: 'Reading API description...',
|
|
66
66
|
completedText: 'Read API description',
|
|
67
67
|
},
|
|
68
|
+
[search_1.ToolCallName.Execute]: {
|
|
69
|
+
inProgressText: 'Running code...',
|
|
70
|
+
completedText: 'Ran code',
|
|
71
|
+
},
|
|
68
72
|
[search_1.ToolCallName.DescribeTools]: {
|
|
69
73
|
inProgressText: 'Discovering available tools...',
|
|
70
74
|
completedText: 'Discovered available tools',
|
|
@@ -21,6 +21,7 @@ export * from './menu/use-mobile-menu-levels';
|
|
|
21
21
|
export * from './menu/use-collapse';
|
|
22
22
|
export * from './feedback/use-report-dialog';
|
|
23
23
|
export * from './use-tabs';
|
|
24
|
+
export * from './use-tab-list';
|
|
24
25
|
export * from './use-focus-trap';
|
|
25
26
|
export * from './use-consent-dialog';
|
|
26
27
|
export * from './use-consent-telemetry';
|
|
@@ -29,6 +30,7 @@ export * from './use-product-picker';
|
|
|
29
30
|
export * from './search/use-search-dialog';
|
|
30
31
|
export * from './search/use-search-filter';
|
|
31
32
|
export * from './search/use-feedback-tooltip';
|
|
33
|
+
export * from './search/use-search-ai-activity';
|
|
32
34
|
export * from './use-controlled-state';
|
|
33
35
|
export * from './use-codeblock-tabs-controls';
|
|
34
36
|
export * from './code-walkthrough/use-code-walkthrough';
|
package/lib/core/hooks/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __exportStar(require("./menu/use-mobile-menu-levels"), exports);
|
|
|
37
37
|
__exportStar(require("./menu/use-collapse"), exports);
|
|
38
38
|
__exportStar(require("./feedback/use-report-dialog"), exports);
|
|
39
39
|
__exportStar(require("./use-tabs"), exports);
|
|
40
|
+
__exportStar(require("./use-tab-list"), exports);
|
|
40
41
|
__exportStar(require("./use-focus-trap"), exports);
|
|
41
42
|
__exportStar(require("./use-consent-dialog"), exports);
|
|
42
43
|
__exportStar(require("./use-consent-telemetry"), exports);
|
|
@@ -45,6 +46,7 @@ __exportStar(require("./use-product-picker"), exports);
|
|
|
45
46
|
__exportStar(require("./search/use-search-dialog"), exports);
|
|
46
47
|
__exportStar(require("./search/use-search-filter"), exports);
|
|
47
48
|
__exportStar(require("./search/use-feedback-tooltip"), exports);
|
|
49
|
+
__exportStar(require("./search/use-search-ai-activity"), exports);
|
|
48
50
|
__exportStar(require("./use-controlled-state"), exports);
|
|
49
51
|
__exportStar(require("./use-codeblock-tabs-controls"), exports);
|
|
50
52
|
__exportStar(require("./code-walkthrough/use-code-walkthrough"), exports);
|
|
@@ -169,6 +169,6 @@ function useEvent(callback) {
|
|
|
169
169
|
(0, react_1.useEffect)(() => {
|
|
170
170
|
ref.current = callback;
|
|
171
171
|
});
|
|
172
|
-
return (0, react_1.useCallback)((
|
|
172
|
+
return (0, react_1.useCallback)((...args) => { var _a; return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.call(ref, ...args); }, []);
|
|
173
173
|
}
|
|
174
174
|
//# sourceMappingURL=use-collapse.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SearchAiActivityStatus, SearchAiActivityStep, ToolCall } from '../../types/search';
|
|
2
|
+
type UseSearchAiActivityParams = {
|
|
3
|
+
toolCalls: ToolCall[];
|
|
4
|
+
isActive: boolean;
|
|
5
|
+
};
|
|
6
|
+
type UseSearchAiActivityReturn = {
|
|
7
|
+
status: SearchAiActivityStatus;
|
|
8
|
+
steps: SearchAiActivityStep[];
|
|
9
|
+
};
|
|
10
|
+
export declare function useSearchAiActivity({ toolCalls, isActive, }: UseSearchAiActivityParams): UseSearchAiActivityReturn;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSearchAiActivity = useSearchAiActivity;
|
|
4
|
+
const use_theme_hooks_1 = require("../use-theme-hooks");
|
|
5
|
+
const search_ai_activity_1 = require("../../utils/search-ai-activity");
|
|
6
|
+
function useSearchAiActivity({ toolCalls, isActive, }) {
|
|
7
|
+
const { useTranslate } = (0, use_theme_hooks_1.useThemeHooks)();
|
|
8
|
+
const { translate } = useTranslate();
|
|
9
|
+
const runningToolCall = isActive ? toolCalls.find((toolCall) => !toolCall.result) : undefined;
|
|
10
|
+
return {
|
|
11
|
+
status: (0, search_ai_activity_1.getSearchAiActivityStatus)(toolCalls, isActive, runningToolCall, translate),
|
|
12
|
+
steps: toolCalls.map((toolCall) => (0, search_ai_activity_1.getSearchAiActivityStep)(toolCall, isActive && !toolCall.result, translate)),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=use-search-ai-activity.js.map
|
|
@@ -45,7 +45,8 @@ function useConnectMCPButton({ options = mcp_1.DEFAULT_MCP_OPTIONS, } = {}) {
|
|
|
45
45
|
window.open(urlMap[action], '_blank');
|
|
46
46
|
}, [cursorUrl, vscodeUrl, serverUrl, serverName, resetCopied, telemetry]);
|
|
47
47
|
const triggerButtonText = (0, react_1.useMemo)(() => translate('page.actions.connectMcp', 'Connect MCP'), [translate]);
|
|
48
|
-
|
|
48
|
+
// Markdoc reports attribute errors but still renders the tag, so `options` can be any value.
|
|
49
|
+
const visibleOptions = (0, react_1.useMemo)(() => Array.isArray(options) ? [...new Set(options.filter(mcp_2.isMCPOption))] : [...mcp_1.DEFAULT_MCP_OPTIONS], [options]);
|
|
49
50
|
return {
|
|
50
51
|
copiedOption,
|
|
51
52
|
cursorUrl,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
|
-
export declare function useFullHeight(
|
|
2
|
+
export declare function useFullHeight(elementRef: RefObject<HTMLElement | null>): void;
|
|
@@ -6,27 +6,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.useFullHeight = useFullHeight;
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const lodash_throttle_1 = __importDefault(require("lodash.throttle"));
|
|
9
|
-
function useFullHeight(
|
|
9
|
+
function useFullHeight(elementRef) {
|
|
10
10
|
const handler = (0, react_1.useCallback)(() => {
|
|
11
|
-
if (!
|
|
11
|
+
if (!elementRef.current) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const footer = document.querySelector('footer');
|
|
15
15
|
if (!footer) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
const elementTop =
|
|
18
|
+
const elementTop = elementRef.current.getBoundingClientRect().top;
|
|
19
19
|
const footerOffset = footer.offsetTop - window.scrollY - elementTop;
|
|
20
20
|
if (footerOffset > window.innerHeight) {
|
|
21
|
-
|
|
21
|
+
elementRef.current.style.maxHeight = `${window.innerHeight - elementTop}px`;
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
|
-
|
|
24
|
+
elementRef.current.style.maxHeight = `${footerOffset}px`;
|
|
25
25
|
}
|
|
26
|
-
}, [
|
|
26
|
+
}, [elementRef]);
|
|
27
27
|
const throttledHandler = (0, react_1.useMemo)(() => (0, lodash_throttle_1.default)(handler, 150), [handler]);
|
|
28
28
|
(0, react_1.useEffect)(() => {
|
|
29
|
-
if (typeof window === 'undefined' || !
|
|
29
|
+
if (typeof window === 'undefined' || !elementRef.current) {
|
|
30
30
|
return () => {
|
|
31
31
|
// nope
|
|
32
32
|
};
|
|
@@ -42,6 +42,6 @@ function useFullHeight(element) {
|
|
|
42
42
|
window.removeEventListener('scroll', throttledHandler);
|
|
43
43
|
window.removeEventListener('resize', throttledHandler);
|
|
44
44
|
};
|
|
45
|
-
}, [throttledHandler,
|
|
45
|
+
}, [throttledHandler, elementRef, handler]);
|
|
46
46
|
}
|
|
47
47
|
//# sourceMappingURL=use-full-height.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { KeyboardEvent } from 'react';
|
|
2
|
+
type UseTabListProps = {
|
|
3
|
+
count: number;
|
|
4
|
+
activeIndex: number;
|
|
5
|
+
onChange: (index: number) => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Props for a WAI-ARIA tab list with automatic activation: only the active tab is a tab stop,
|
|
9
|
+
* and Left/Right/Home/End select and focus another tab.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useTabList({ count, activeIndex, onChange }: UseTabListProps): {
|
|
12
|
+
tabListProps: {
|
|
13
|
+
role: string;
|
|
14
|
+
};
|
|
15
|
+
getTabProps: (index: number) => {
|
|
16
|
+
id: string;
|
|
17
|
+
role: string;
|
|
18
|
+
'aria-selected': boolean;
|
|
19
|
+
'aria-controls': string;
|
|
20
|
+
tabIndex: number;
|
|
21
|
+
ref: (element: HTMLElement | null) => void;
|
|
22
|
+
onClick: () => void;
|
|
23
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
24
|
+
};
|
|
25
|
+
getTabPanelProps: (index: number) => {
|
|
26
|
+
id: string;
|
|
27
|
+
role: string;
|
|
28
|
+
'aria-labelledby': string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTabList = useTabList;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* Props for a WAI-ARIA tab list with automatic activation: only the active tab is a tab stop,
|
|
7
|
+
* and Left/Right/Home/End select and focus another tab.
|
|
8
|
+
*/
|
|
9
|
+
function useTabList({ count, activeIndex, onChange }) {
|
|
10
|
+
const idPrefix = (0, react_1.useId)();
|
|
11
|
+
const focusableIndex = activeIndex >= 0 ? activeIndex : 0;
|
|
12
|
+
const tabRefs = (0, react_1.useRef)([]);
|
|
13
|
+
const select = (0, react_1.useCallback)((index) => {
|
|
14
|
+
var _a;
|
|
15
|
+
onChange(index);
|
|
16
|
+
(_a = tabRefs.current[index]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
17
|
+
}, [onChange]);
|
|
18
|
+
const onKeyDown = (0, react_1.useCallback)((event, index) => {
|
|
19
|
+
const target = {
|
|
20
|
+
ArrowRight: (index + 1) % count,
|
|
21
|
+
ArrowLeft: (index - 1 + count) % count,
|
|
22
|
+
Home: 0,
|
|
23
|
+
End: count - 1,
|
|
24
|
+
}[event.key];
|
|
25
|
+
if (target === undefined)
|
|
26
|
+
return;
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
select(target);
|
|
29
|
+
}, [count, select]);
|
|
30
|
+
const getTabProps = (index) => ({
|
|
31
|
+
id: `${idPrefix}-tab-${index}`,
|
|
32
|
+
role: 'tab',
|
|
33
|
+
'aria-selected': index === activeIndex,
|
|
34
|
+
'aria-controls': `${idPrefix}-panel-${index}`,
|
|
35
|
+
tabIndex: index === focusableIndex ? 0 : -1,
|
|
36
|
+
ref: (element) => {
|
|
37
|
+
tabRefs.current[index] = element;
|
|
38
|
+
},
|
|
39
|
+
onClick: () => select(index),
|
|
40
|
+
onKeyDown: (event) => onKeyDown(event, index),
|
|
41
|
+
});
|
|
42
|
+
const getTabPanelProps = (index) => ({
|
|
43
|
+
id: `${idPrefix}-panel-${index}`,
|
|
44
|
+
role: 'tabpanel',
|
|
45
|
+
'aria-labelledby': `${idPrefix}-tab-${index}`,
|
|
46
|
+
});
|
|
47
|
+
return { tabListProps: { role: 'tablist' }, getTabProps, getTabPanelProps };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=use-tab-list.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GlobalStyle = exports.styles = void 0;
|
|
3
|
+
exports.GlobalStyle = exports.styles = exports.tokens = void 0;
|
|
4
4
|
const styled_components_1 = require("styled-components");
|
|
5
5
|
const variables_1 = require("../../components/LanguagePicker/variables");
|
|
6
6
|
const variables_2 = require("../../components/Scorecard/variables");
|
|
@@ -1307,83 +1307,87 @@ const replay = (0, styled_components_1.css) `
|
|
|
1307
1307
|
}
|
|
1308
1308
|
// @tokens End
|
|
1309
1309
|
`;
|
|
1310
|
+
/** The light theme tokens without a selector, for a host that sets them on one element. */
|
|
1311
|
+
exports.tokens = (0, styled_components_1.css) `
|
|
1312
|
+
${variables_13.accordion}
|
|
1313
|
+
${variables_18.admonition}
|
|
1314
|
+
${apiReferenceDocs}
|
|
1315
|
+
${variables_12.apiReferencePanels}
|
|
1316
|
+
${badges}
|
|
1317
|
+
${variables_28.banner}
|
|
1318
|
+
${borders}
|
|
1319
|
+
${variables_29.consent}
|
|
1320
|
+
${variables_5.breadcrumbs}
|
|
1321
|
+
${variables_20.button}
|
|
1322
|
+
${variables_21.aiAssistantButton}
|
|
1323
|
+
${variables_43.cards}
|
|
1324
|
+
${variables_8.catalog}
|
|
1325
|
+
${variables_11.catalogClassic}
|
|
1326
|
+
${variables_25.code}
|
|
1327
|
+
${variables_44.codeWalkthrough}
|
|
1328
|
+
${docsDropdown}
|
|
1329
|
+
${variables_15.dropdown}
|
|
1330
|
+
${error}
|
|
1331
|
+
${variables_10.filter}
|
|
1332
|
+
${variables_19.footer}
|
|
1333
|
+
${headingsTypography}
|
|
1334
|
+
${variables_39.httpTag}
|
|
1335
|
+
${variables_9.image}
|
|
1336
|
+
${inputs}
|
|
1337
|
+
${variables_1.languagePicker}
|
|
1338
|
+
${variables_34.lastUpdated}
|
|
1339
|
+
${links}
|
|
1340
|
+
${loadProgressBar}
|
|
1341
|
+
${variables_35.logo}
|
|
1342
|
+
${variables_27.markdown}
|
|
1343
|
+
${variables_30.markdownAccordion}
|
|
1344
|
+
${variables_31.markdownTabs}
|
|
1345
|
+
${variables_32.markdownNumberedList}
|
|
1346
|
+
${variables_33.diagram}
|
|
1347
|
+
${variables_24.menu}
|
|
1348
|
+
${variables_24.mobileMenu}
|
|
1349
|
+
${modal}
|
|
1350
|
+
${variables_22.navbar}
|
|
1351
|
+
${pages}
|
|
1352
|
+
${variables_26.productPicker}
|
|
1353
|
+
${variables_12.responsePanelColors}
|
|
1354
|
+
${variables_23.search}
|
|
1355
|
+
${variables_50.navigationTabs}
|
|
1356
|
+
${variables_14.select}
|
|
1357
|
+
${variables_4.sidebar}
|
|
1358
|
+
${sizeAndSpace}
|
|
1359
|
+
${variables_6.tag}
|
|
1360
|
+
${themeColors}
|
|
1361
|
+
${palette_1.activeBrandPaletteLight}
|
|
1362
|
+
${tile}
|
|
1363
|
+
${variables_7.toc}
|
|
1364
|
+
${variables_16.tooltip}
|
|
1365
|
+
${typography}
|
|
1366
|
+
${variables_38.userMenu}
|
|
1367
|
+
${variables_40.versionPicker}
|
|
1368
|
+
${zIndexDepth}
|
|
1369
|
+
${scorecardColors}
|
|
1370
|
+
${variables_36.statusCode}
|
|
1371
|
+
${tab}
|
|
1372
|
+
${icon}
|
|
1373
|
+
${tree}
|
|
1374
|
+
${variables_37.segmented}
|
|
1375
|
+
${variables_42.switcher}
|
|
1376
|
+
${variables_17.checkbox}
|
|
1377
|
+
${variables_3.feedback}
|
|
1378
|
+
${variables_2.scorecard}
|
|
1379
|
+
${variables_41.datePicker}
|
|
1380
|
+
${replay}
|
|
1381
|
+
${variables_45.skipContent}
|
|
1382
|
+
${variables_46.pageActions}
|
|
1383
|
+
${variables_47.svgViewer}
|
|
1384
|
+
${variables_48.toast}
|
|
1385
|
+
${variables_49.pageNavigation}
|
|
1386
|
+
|
|
1387
|
+
`;
|
|
1310
1388
|
exports.styles = (0, styled_components_1.css) `
|
|
1311
1389
|
:root {
|
|
1312
|
-
${
|
|
1313
|
-
${variables_18.admonition}
|
|
1314
|
-
${apiReferenceDocs}
|
|
1315
|
-
${variables_12.apiReferencePanels}
|
|
1316
|
-
${badges}
|
|
1317
|
-
${variables_28.banner}
|
|
1318
|
-
${borders}
|
|
1319
|
-
${variables_29.consent}
|
|
1320
|
-
${variables_5.breadcrumbs}
|
|
1321
|
-
${variables_20.button}
|
|
1322
|
-
${variables_21.aiAssistantButton}
|
|
1323
|
-
${variables_43.cards}
|
|
1324
|
-
${variables_8.catalog}
|
|
1325
|
-
${variables_11.catalogClassic}
|
|
1326
|
-
${variables_25.code}
|
|
1327
|
-
${variables_44.codeWalkthrough}
|
|
1328
|
-
${docsDropdown}
|
|
1329
|
-
${variables_15.dropdown}
|
|
1330
|
-
${error}
|
|
1331
|
-
${variables_10.filter}
|
|
1332
|
-
${variables_19.footer}
|
|
1333
|
-
${headingsTypography}
|
|
1334
|
-
${variables_39.httpTag}
|
|
1335
|
-
${variables_9.image}
|
|
1336
|
-
${inputs}
|
|
1337
|
-
${variables_1.languagePicker}
|
|
1338
|
-
${variables_34.lastUpdated}
|
|
1339
|
-
${links}
|
|
1340
|
-
${loadProgressBar}
|
|
1341
|
-
${variables_35.logo}
|
|
1342
|
-
${variables_27.markdown}
|
|
1343
|
-
${variables_30.markdownAccordion}
|
|
1344
|
-
${variables_31.markdownTabs}
|
|
1345
|
-
${variables_32.markdownNumberedList}
|
|
1346
|
-
${variables_33.diagram}
|
|
1347
|
-
${variables_24.menu}
|
|
1348
|
-
${variables_24.mobileMenu}
|
|
1349
|
-
${modal}
|
|
1350
|
-
${variables_22.navbar}
|
|
1351
|
-
${pages}
|
|
1352
|
-
${variables_26.productPicker}
|
|
1353
|
-
${variables_12.responsePanelColors}
|
|
1354
|
-
${variables_23.search}
|
|
1355
|
-
${variables_50.navigationTabs}
|
|
1356
|
-
${variables_14.select}
|
|
1357
|
-
${variables_4.sidebar}
|
|
1358
|
-
${sizeAndSpace}
|
|
1359
|
-
${variables_6.tag}
|
|
1360
|
-
${themeColors}
|
|
1361
|
-
${palette_1.activeBrandPaletteLight}
|
|
1362
|
-
${tile}
|
|
1363
|
-
${variables_7.toc}
|
|
1364
|
-
${variables_16.tooltip}
|
|
1365
|
-
${typography}
|
|
1366
|
-
${variables_38.userMenu}
|
|
1367
|
-
${variables_40.versionPicker}
|
|
1368
|
-
${zIndexDepth}
|
|
1369
|
-
${scorecardColors}
|
|
1370
|
-
${variables_36.statusCode}
|
|
1371
|
-
${tab}
|
|
1372
|
-
${icon}
|
|
1373
|
-
${tree}
|
|
1374
|
-
${variables_37.segmented}
|
|
1375
|
-
${variables_42.switcher}
|
|
1376
|
-
${variables_17.checkbox}
|
|
1377
|
-
${variables_3.feedback}
|
|
1378
|
-
${variables_2.scorecard}
|
|
1379
|
-
${variables_41.datePicker}
|
|
1380
|
-
${replay}
|
|
1381
|
-
${variables_45.skipContent}
|
|
1382
|
-
${variables_46.pageActions}
|
|
1383
|
-
${variables_47.svgViewer}
|
|
1384
|
-
${variables_48.toast}
|
|
1385
|
-
${variables_49.pageNavigation}
|
|
1386
|
-
|
|
1390
|
+
${exports.tokens}
|
|
1387
1391
|
background-color: var(--bg-color);
|
|
1388
1392
|
color: var(--text-color-primary);
|
|
1389
1393
|
font-family: var(--font-family-base);
|
package/lib/core/styles/index.js
CHANGED
|
@@ -14,9 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.xyflow = void 0;
|
|
17
|
+
exports.searchAiAppearAnimation = exports.xyflow = void 0;
|
|
18
18
|
__exportStar(require("./global"), exports);
|
|
19
19
|
__exportStar(require("./dark"), exports);
|
|
20
20
|
var xyflow_1 = require("./xyflow");
|
|
21
21
|
Object.defineProperty(exports, "xyflow", { enumerable: true, get: function () { return xyflow_1.xyflow; } });
|
|
22
|
+
var search_ai_appear_1 = require("./search-ai-appear");
|
|
23
|
+
Object.defineProperty(exports, "searchAiAppearAnimation", { enumerable: true, get: function () { return search_ai_appear_1.searchAiAppearAnimation; } });
|
|
22
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const searchAiAppearAnimation: import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchAiAppearAnimation = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
const appear = (0, styled_components_1.keyframes) `
|
|
6
|
+
from {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
transform: translateY(4px);
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
exports.searchAiAppearAnimation = (0, styled_components_1.css) `
|
|
12
|
+
animation: ${appear} var(--search-ai-activity-fade-duration) ease-out;
|
|
13
|
+
|
|
14
|
+
@media (prefers-reduced-motion: reduce) {
|
|
15
|
+
animation: none;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
//# sourceMappingURL=search-ai-appear.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DropdownAlignment = 'start' | 'end';
|