@redocly/theme 0.64.0-next.3 → 0.64.0-next.4
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/Catalog/CatalogTags.js +5 -2
- package/lib/components/LanguagePicker/LanguagePicker.js +5 -6
- package/lib/components/Search/SearchAiMessage.js +9 -6
- package/lib/components/SvgViewer/SvgViewer.js +0 -3
- package/lib/components/SvgViewer/variables.js +1 -1
- package/lib/core/constants/search.d.ts +3 -3
- package/lib/core/contexts/MarkdownLinkContext.d.ts +5 -0
- package/lib/core/contexts/MarkdownLinkContext.js +6 -0
- package/lib/core/contexts/index.d.ts +1 -0
- package/lib/core/contexts/index.js +1 -0
- package/lib/core/styles/dark.js +28 -32
- package/lib/core/styles/global.js +2 -2
- package/lib/core/types/hooks.d.ts +2 -9
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +1 -1
- package/lib/markdoc/attributes/diagram-file.d.ts +5 -0
- package/lib/markdoc/attributes/diagram-file.js +16 -0
- package/lib/markdoc/components/Diagram/Diagram.d.ts +15 -0
- package/lib/markdoc/components/Diagram/Diagram.js +135 -0
- package/lib/markdoc/components/Diagram/variables.d.ts +1 -0
- package/lib/markdoc/components/Diagram/variables.js +15 -0
- package/lib/markdoc/components/MarkdownLink/MarkdownLink.d.ts +7 -0
- package/lib/markdoc/components/MarkdownLink/MarkdownLink.js +61 -0
- package/lib/markdoc/components/default.d.ts +2 -1
- package/lib/markdoc/components/default.js +2 -1
- package/lib/markdoc/default.d.ts +7 -0
- package/lib/markdoc/default.js +3 -0
- package/lib/markdoc/tags/diagram.d.ts +2 -0
- package/lib/markdoc/tags/diagram.js +63 -0
- package/package.json +3 -3
- package/src/components/Catalog/CatalogTags.tsx +6 -1
- package/src/components/LanguagePicker/LanguagePicker.tsx +5 -5
- package/src/components/Search/SearchAiMessage.tsx +15 -10
- package/src/components/SvgViewer/SvgViewer.tsx +0 -4
- package/src/components/SvgViewer/variables.ts +1 -1
- package/src/core/constants/search.ts +2 -3
- package/src/core/contexts/MarkdownLinkContext.tsx +9 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/styles/dark.ts +0 -4
- package/src/core/styles/global.ts +2 -2
- package/src/core/types/hooks.ts +2 -7
- package/src/core/types/l10n.ts +9 -9
- package/src/core/types/search.ts +1 -1
- package/src/markdoc/attributes/diagram-file.ts +9 -0
- package/src/markdoc/components/Diagram/Diagram.tsx +173 -0
- package/src/markdoc/components/Diagram/variables.ts +12 -0
- package/src/markdoc/components/MarkdownLink/MarkdownLink.tsx +21 -0
- package/src/markdoc/components/default.ts +2 -1
- package/src/markdoc/default.ts +3 -0
- package/src/markdoc/tags/diagram.ts +73 -0
- package/lib/components/SvgViewer/variables.dark.d.ts +0 -1
- package/lib/components/SvgViewer/variables.dark.js +0 -8
- package/lib/markdoc/components/Mermaid/Mermaid.d.ts +0 -9
- package/lib/markdoc/components/Mermaid/Mermaid.js +0 -94
- package/lib/markdoc/components/Mermaid/variables.d.ts +0 -1
- package/lib/markdoc/components/Mermaid/variables.dark.d.ts +0 -1
- package/lib/markdoc/components/Mermaid/variables.dark.js +0 -8
- package/lib/markdoc/components/Mermaid/variables.js +0 -16
- package/src/components/SvgViewer/variables.dark.ts +0 -5
- package/src/markdoc/components/Mermaid/Mermaid.tsx +0 -93
- package/src/markdoc/components/Mermaid/variables.dark.ts +0 -5
- package/src/markdoc/components/Mermaid/variables.ts +0 -13
|
@@ -29,6 +29,7 @@ function CatalogTags({ items, itemsToShow = 1, showPlaceholder = false, showAvat
|
|
|
29
29
|
if (shouldUseVariantWithTooltip) {
|
|
30
30
|
const displayedItems = items.slice(0, itemsToShow);
|
|
31
31
|
const remainingCount = items.length - itemsToShow;
|
|
32
|
+
const moreLabel = translate('catalog.tags.more', 'more');
|
|
32
33
|
return (react_1.default.createElement(Tooltip_1.Tooltip, { tip: items.join(', '), placement: "bottom", className: "catalog" },
|
|
33
34
|
react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTags" },
|
|
34
35
|
displayedItems.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
|
|
@@ -36,9 +37,11 @@ function CatalogTags({ items, itemsToShow = 1, showPlaceholder = false, showAvat
|
|
|
36
37
|
style: Object.assign(Object.assign({}, tagProps === null || tagProps === void 0 ? void 0 : tagProps.style), { paddingLeft: 'var(--catalog-tags-tag-left-padding)' }),
|
|
37
38
|
}), { textTransform: "none", maxLength: maxLength }),
|
|
38
39
|
react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item)))),
|
|
39
|
-
remainingCount > 0 && react_1.default.createElement(MoreTagsButton, null,
|
|
40
|
+
remainingCount > 0 && (react_1.default.createElement(MoreTagsButton, null,
|
|
40
41
|
"+ ",
|
|
41
|
-
remainingCount
|
|
42
|
+
remainingCount,
|
|
43
|
+
" ",
|
|
44
|
+
react_1.default.createElement("span", { "data-translation-key": "catalog.tags.more" }, moreLabel))))));
|
|
42
45
|
}
|
|
43
46
|
return (react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTags" }, items.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
|
|
44
47
|
icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
|
|
@@ -31,14 +31,13 @@ function LanguagePicker(props) {
|
|
|
31
31
|
active: locale.code === currentLocale.code,
|
|
32
32
|
suffix: locale.code === currentLocale.code && react_1.default.createElement(CheckmarkIcon_1.CheckmarkIcon, null),
|
|
33
33
|
}));
|
|
34
|
-
return (react_1.default.createElement(LanguageDropdown, { triggerEvent: "click", placement: props.placement, alignment: props.alignment, trigger: languagePickerButton
|
|
34
|
+
return (react_1.default.createElement(LanguageDropdown, { triggerEvent: "click", placement: props.placement, alignment: props.alignment, trigger: languagePickerButton, dataAttributes: {
|
|
35
|
+
'data-component-name': 'LanguagePicker/LanguagePicker',
|
|
36
|
+
'data-current-locale': currentLocale.code,
|
|
37
|
+
} },
|
|
35
38
|
react_1.default.createElement(DropdownMenu_1.DropdownMenu, { items: languageItems })));
|
|
36
39
|
}
|
|
37
|
-
const LanguageDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown)
|
|
38
|
-
dataAttributes: {
|
|
39
|
-
'data-component-name': 'LanguagePicker/LanguagePicker',
|
|
40
|
-
},
|
|
41
|
-
})) `
|
|
40
|
+
const LanguageDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown) `
|
|
42
41
|
display: none;
|
|
43
42
|
height: auto;
|
|
44
43
|
@media screen and (min-width: ${utils_1.breakpoints.medium}) {
|
|
@@ -56,6 +56,13 @@ function MarkdownSegment({ text }) {
|
|
|
56
56
|
const markdown = useMarkdownText(text);
|
|
57
57
|
return react_1.default.createElement(ResponseText, { as: "div", children: markdown, "data-testid": "response-text" });
|
|
58
58
|
}
|
|
59
|
+
function getToolCallDisplayText(toolName) {
|
|
60
|
+
var _a;
|
|
61
|
+
return ((_a = constants_1.TOOL_CALL_DISPLAY_TEXT[toolName]) !== null && _a !== void 0 ? _a : {
|
|
62
|
+
inProgressText: `Executing ${toolName}...`,
|
|
63
|
+
completedText: `${toolName} executed`,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
59
66
|
function SearchAiMessageComponent({ role, content, isThinking, resources, className, messageId, feedback, onFeedbackChange, toolCalls = [], contentSegments = [{ type: 'text', text: content }], }) {
|
|
60
67
|
var _a;
|
|
61
68
|
const { useTranslate, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
@@ -100,14 +107,10 @@ function SearchAiMessageComponent({ role, content, isThinking, resources, classN
|
|
|
100
107
|
react_1.default.createElement(MessageContentWrapper, null, role === constants_2.AiSearchConversationRole.ASSISTANT ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
101
108
|
react_1.default.createElement(MessageWrapper, { role: role },
|
|
102
109
|
contentSegments.map((segment, index) => {
|
|
103
|
-
var _a, _b, _c, _d, _e, _f;
|
|
104
110
|
if (segment.type === 'tool') {
|
|
105
111
|
const toolCallCompleted = Boolean(segment.toolCall.result);
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
const toolCallDisplayText = toolCallCompleted
|
|
109
|
-
? toolCallCompletedText
|
|
110
|
-
: toolCallInProgressText;
|
|
112
|
+
const { inProgressText, completedText } = getToolCallDisplayText(segment.toolCall.name);
|
|
113
|
+
const toolCallDisplayText = toolCallCompleted ? completedText : inProgressText;
|
|
111
114
|
return (react_1.default.createElement(ToolCallsInfoWrapper, { key: `tool-${index}`, "data-testid": "tool-calls-info" },
|
|
112
115
|
react_1.default.createElement(ToolCallInfoItem, null,
|
|
113
116
|
react_1.default.createElement(DocumentIcon_1.DocumentIcon, { size: "14px", color: "--search-ai-text-color" }),
|
|
@@ -116,8 +116,6 @@ function SvgViewer({ isOpen, onClose, children, labels = {}, }) {
|
|
|
116
116
|
}
|
|
117
117
|
}, [onClose, zoomIn, zoomOut, resetView]);
|
|
118
118
|
const handleWheel = (0, react_1.useCallback)((e) => {
|
|
119
|
-
e.preventDefault();
|
|
120
|
-
e.stopPropagation();
|
|
121
119
|
setIsWheelZooming(true);
|
|
122
120
|
if (wheelTimeoutRef.current)
|
|
123
121
|
clearTimeout(wheelTimeoutRef.current);
|
|
@@ -158,7 +156,6 @@ function SvgViewer({ isOpen, onClose, children, labels = {}, }) {
|
|
|
158
156
|
}
|
|
159
157
|
}, [position, scale]);
|
|
160
158
|
const handleTouchMove = (0, react_1.useCallback)((e) => {
|
|
161
|
-
e.preventDefault();
|
|
162
159
|
if (e.touches.length === 2 && pinchState) {
|
|
163
160
|
const distance = getTouchDistance(e.touches);
|
|
164
161
|
setScale(clampScale(pinchState.scale * (distance / pinchState.distance)));
|
|
@@ -8,7 +8,7 @@ exports.svgViewer = (0, styled_components_1.css) `
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
--svg-viewer-overlay-bg-color: var(--bg-color-modal-overlay); // @presenter Color
|
|
11
|
-
--svg-viewer-bg-color: var(--bg-color); // @presenter Color
|
|
11
|
+
--svg-viewer-bg-color: var(--bg-color-raised); // @presenter Color
|
|
12
12
|
--svg-viewer-border-radius: var(--border-radius-xl); // @presenter BorderRadius
|
|
13
13
|
--svg-viewer-box-shadow: var(--bg-raised-shadow); // @presenter BoxShadow
|
|
14
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AiSearchErrorConfig
|
|
1
|
+
import { type AiSearchErrorConfig } from '../types/search';
|
|
2
2
|
export declare enum AiSearchError {
|
|
3
3
|
Unauthorized = "ai_search_unauthorized",
|
|
4
4
|
Forbidden = "ai_search_forbidden",
|
|
@@ -14,7 +14,7 @@ export type AiSearchConversationRole = (typeof AiSearchConversationRole)[keyof t
|
|
|
14
14
|
export declare const AI_SEARCH_ERROR_CONFIG: Record<AiSearchError, AiSearchErrorConfig>;
|
|
15
15
|
export declare const AI_SEARCH_MAX_MESSAGE_LENGTH = 45000;
|
|
16
16
|
export declare const SEARCH_DEBOUNCE_TIME_MS = 300;
|
|
17
|
-
export declare const TOOL_CALL_DISPLAY_TEXT: Record<
|
|
17
|
+
export declare const TOOL_CALL_DISPLAY_TEXT: Partial<Record<string, {
|
|
18
18
|
inProgressText: string;
|
|
19
19
|
completedText: string;
|
|
20
|
-
}
|
|
20
|
+
}>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MarkdownLinkContext = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
exports.MarkdownLinkContext = (0, react_1.createContext)(null);
|
|
6
|
+
//# sourceMappingURL=MarkdownLinkContext.js.map
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ThemeDataContext"), exports);
|
|
18
|
+
__exportStar(require("./MarkdownLinkContext"), exports);
|
|
18
19
|
__exportStar(require("./CodeWalkthrough/CodeWalkthroughControlsContext"), exports);
|
|
19
20
|
__exportStar(require("./CodeWalkthrough/CodeWalkthroughStepsContext"), exports);
|
|
20
21
|
__exportStar(require("./CodeSnippetContext"), exports);
|
package/lib/core/styles/dark.js
CHANGED
|
@@ -3,22 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.darkMode = void 0;
|
|
4
4
|
const styled_components_1 = require("styled-components");
|
|
5
5
|
const variables_dark_1 = require("../../components/Scorecard/variables.dark");
|
|
6
|
-
const variables_dark_2 = require("../../
|
|
7
|
-
const variables_dark_3 = require("../../components/
|
|
8
|
-
const variables_dark_4 = require("../../components/
|
|
9
|
-
const variables_dark_5 = require("../../components/
|
|
10
|
-
const variables_dark_6 = require("../../
|
|
11
|
-
const variables_dark_7 = require("../../
|
|
12
|
-
const variables_dark_8 = require("../../components/
|
|
13
|
-
const variables_dark_9 = require("../../components/
|
|
14
|
-
const variables_dark_10 = require("../../components/
|
|
15
|
-
const variables_dark_11 = require("../../
|
|
16
|
-
const variables_dark_12 = require("../../components/
|
|
17
|
-
const variables_dark_13 = require("../../components/
|
|
18
|
-
const variables_dark_14 = require("../../components/
|
|
19
|
-
const variables_dark_15 = require("../../components/
|
|
20
|
-
const variables_dark_16 = require("../../components/Admonition/variables.dark");
|
|
21
|
-
const variables_dark_17 = require("../../components/SvgViewer/variables.dark");
|
|
6
|
+
const variables_dark_2 = require("../../components/Menu/variables.dark");
|
|
7
|
+
const variables_dark_3 = require("../../components/Button/variables.dark");
|
|
8
|
+
const variables_dark_4 = require("../../components/Buttons/variables.dark");
|
|
9
|
+
const variables_dark_5 = require("../../components/Segmented/variables.dark");
|
|
10
|
+
const variables_dark_6 = require("../../icons/CheckboxIcon/variables.dark");
|
|
11
|
+
const variables_dark_7 = require("../../components/Tag/variables.dark");
|
|
12
|
+
const variables_dark_8 = require("../../components/StatusCode/variables.dark");
|
|
13
|
+
const variables_dark_9 = require("../../components/Switch/variables.dark");
|
|
14
|
+
const variables_dark_10 = require("../../markdoc/components/Cards/variables.dark");
|
|
15
|
+
const variables_dark_11 = require("../../components/Catalog/variables.dark");
|
|
16
|
+
const variables_dark_12 = require("../../components/PageActions/variables.dark");
|
|
17
|
+
const variables_dark_13 = require("../../components/Tooltip/variables.dark");
|
|
18
|
+
const variables_dark_14 = require("../../components/Banner/variables.dark");
|
|
19
|
+
const variables_dark_15 = require("../../components/Admonition/variables.dark");
|
|
22
20
|
const palette_dark_1 = require("./palette.dark");
|
|
23
21
|
const replayDarkMode = (0, styled_components_1.css) `
|
|
24
22
|
/**
|
|
@@ -333,24 +331,22 @@ exports.darkMode = (0, styled_components_1.css) `
|
|
|
333
331
|
--plus-square-outlined-icon: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.20312 5.3125H4.6875V6.79687C4.6875 6.83984 4.72266 6.875 4.76562 6.875H5.23438C5.27734 6.875 5.3125 6.83984 5.3125 6.79687V5.3125H6.79688C6.83984 5.3125 6.875 5.27734 6.875 5.23437V4.76562C6.875 4.72266 6.83984 4.6875 6.79688 4.6875H5.3125V3.20312C5.3125 3.16016 5.27734 3.125 5.23438 3.125H4.76562C4.72266 3.125 4.6875 3.16016 4.6875 3.20312V4.6875H3.20312C3.16016 4.6875 3.125 4.72266 3.125 4.76562V5.23437C3.125 5.27734 3.16016 5.3125 3.20312 5.3125Z' fill='%239B9CA8'/%3E%3Cpath d='M8.59375 1.09375H1.40625C1.2334 1.09375 1.09375 1.2334 1.09375 1.40625V8.59375C1.09375 8.7666 1.2334 8.90625 1.40625 8.90625H8.59375C8.7666 8.90625 8.90625 8.7666 8.90625 8.59375V1.40625C8.90625 1.2334 8.7666 1.09375 8.59375 1.09375ZM8.20312 8.20312H1.79688V1.79687H8.20312V8.20312Z' fill='%239B9CA8'/%3E%3C/svg%3E%0A");
|
|
334
332
|
--minus-square-outlined-icon: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.20312 5.3125H6.79688C6.83984 5.3125 6.875 5.27734 6.875 5.23437V4.76562C6.875 4.72266 6.83984 4.6875 6.79688 4.6875H3.20312C3.16016 4.6875 3.125 4.72266 3.125 4.76562V5.23437C3.125 5.27734 3.16016 5.3125 3.20312 5.3125Z' fill='%239B9CA8'/%3E%3Cpath d='M8.59375 1.09375H1.40625C1.2334 1.09375 1.09375 1.2334 1.09375 1.40625V8.59375C1.09375 8.7666 1.2334 8.90625 1.40625 8.90625H8.59375C8.7666 8.90625 8.90625 8.7666 8.90625 8.59375V1.40625C8.90625 1.2334 8.7666 1.09375 8.59375 1.09375ZM8.20312 8.20312H1.79688V1.79687H8.20312V8.20312Z' fill='%239B9CA8'/%3E%3C/svg%3E%0A");
|
|
335
333
|
|
|
336
|
-
${
|
|
337
|
-
${
|
|
338
|
-
${
|
|
339
|
-
${
|
|
340
|
-
${
|
|
341
|
-
${
|
|
342
|
-
${
|
|
343
|
-
${variables_dark_2.mermaidDarkMode}
|
|
334
|
+
${variables_dark_5.segmentedButtonsDarkMode}
|
|
335
|
+
${variables_dark_3.buttonDarkMode}
|
|
336
|
+
${variables_dark_4.aiAssistantButtonDarkMode}
|
|
337
|
+
${variables_dark_6.checkboxDarkMode}
|
|
338
|
+
${variables_dark_7.tagDarkMode}
|
|
339
|
+
${variables_dark_8.statusCodeDarkMode}
|
|
340
|
+
${variables_dark_2.menuDarkMode}
|
|
344
341
|
${variables_dark_1.scorecardDarkMode}
|
|
345
342
|
${replayDarkMode}
|
|
346
|
-
${
|
|
347
|
-
${
|
|
348
|
-
${
|
|
349
|
-
${
|
|
350
|
-
${
|
|
351
|
-
${
|
|
352
|
-
${
|
|
353
|
-
${variables_dark_17.svgViewerDarkMode}
|
|
343
|
+
${variables_dark_9.switcherDarkMode}
|
|
344
|
+
${variables_dark_10.cardsDarkMode}
|
|
345
|
+
${variables_dark_11.catalogDarkMode}
|
|
346
|
+
${variables_dark_12.pageActionsDarkMode}
|
|
347
|
+
${variables_dark_13.tooltipDarkMode}
|
|
348
|
+
${variables_dark_14.bannerDarkMode}
|
|
349
|
+
${variables_dark_15.admonitionDarkMode}
|
|
354
350
|
${badgesDarkMode}
|
|
355
351
|
${palette_dark_1.activeBrandPaletteDark}
|
|
356
352
|
/**
|
|
@@ -30,7 +30,7 @@ const variables_25 = require("../../components/Product/variables");
|
|
|
30
30
|
const variables_26 = require("../../components/Markdown/variables");
|
|
31
31
|
const variables_27 = require("../../components/Banner/variables");
|
|
32
32
|
const variables_28 = require("../../markdoc/components/Tabs/variables");
|
|
33
|
-
const variables_29 = require("../../markdoc/components/
|
|
33
|
+
const variables_29 = require("../../markdoc/components/Diagram/variables");
|
|
34
34
|
const variables_30 = require("../../components/LastUpdated/variables");
|
|
35
35
|
const variables_31 = require("../../components/Logo/variables");
|
|
36
36
|
const variables_32 = require("../../components/StatusCode/variables");
|
|
@@ -1280,7 +1280,7 @@ exports.styles = (0, styled_components_1.css) `
|
|
|
1280
1280
|
${variables_31.logo}
|
|
1281
1281
|
${variables_26.markdown}
|
|
1282
1282
|
${variables_28.markdownTabs}
|
|
1283
|
-
${variables_29.
|
|
1283
|
+
${variables_29.diagram}
|
|
1284
1284
|
${variables_23.menu}
|
|
1285
1285
|
${variables_23.mobileMenu}
|
|
1286
1286
|
${modal}
|
|
@@ -9,7 +9,7 @@ import type { CatalogConfig, ProductUiConfig } from '../../config';
|
|
|
9
9
|
import type { UseCatalogResponse, FilteredCatalog, UseCatalogSortResponse, UseCatalogSearchResponse, UseCatalogProps, CatalogApiParams, CatalogApiResults } from './catalog';
|
|
10
10
|
import type { UserMenuData } from './user-menu';
|
|
11
11
|
import type { ItemState } from './sidebar';
|
|
12
|
-
import type { SearchItemData, SearchFacet, SearchFilterItem, SearchFacetQuery, AiSearchConversationItem,
|
|
12
|
+
import type { SearchItemData, SearchFacet, SearchFilterItem, SearchFacetQuery, AiSearchConversationItem, ContentSegment, ToolCall } from './search';
|
|
13
13
|
import type { SubmitFeedbackParams } from './feedback';
|
|
14
14
|
import type { TFunction } from './l10n';
|
|
15
15
|
import type { BreadcrumbItem } from './breadcrumb';
|
|
@@ -101,14 +101,7 @@ export type ThemeHooks = {
|
|
|
101
101
|
error: null | AiSearchError;
|
|
102
102
|
conversation: AiSearchConversationItem[];
|
|
103
103
|
setConversation: React.Dispatch<React.SetStateAction<AiSearchConversationItem[]>>;
|
|
104
|
-
toolCalls: Array<
|
|
105
|
-
name: ToolCallName;
|
|
106
|
-
args: unknown;
|
|
107
|
-
position: number;
|
|
108
|
-
result?: {
|
|
109
|
-
documentCount: number;
|
|
110
|
-
};
|
|
111
|
-
}>;
|
|
104
|
+
toolCalls: Array<ToolCall>;
|
|
112
105
|
contentSegments: ContentSegment[];
|
|
113
106
|
};
|
|
114
107
|
useMarkdownText: (text: string) => React.ReactNode;
|
package/lib/core/types/l10n.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TOptions } from 'i18next';
|
|
2
|
-
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolResult.found' | 'search.ai.toolResult.found.documents' | 'search.ai.toolCall.searching' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.notConnected' | 'catalog.tags.more' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.filters.close' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.maxLength' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.languages.moreButton.tooltipText' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'button.copy.tooltipText' | 'button.download.tooltipText' | 'button.externalLink.tooltipText' | 'button.email.tooltipText' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'mermaid.openFullscreen' | 'mermaid.zoomIn' | 'mermaid.zoomOut' | 'mermaid.reset' | 'mermaid.close' | 'mermaid.viewer';
|
|
2
|
+
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolCall.executed' | 'search.ai.toolCall.executing' | 'search.ai.toolCall.withArgs' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.notConnected' | 'catalog.tags.more' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.filters.close' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.maxLength' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.languages.moreButton.tooltipText' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'button.copy.tooltipText' | 'button.download.tooltipText' | 'button.externalLink.tooltipText' | 'button.email.tooltipText' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'diagram.openFullscreen' | 'diagram.zoomIn' | 'diagram.zoomOut' | 'diagram.reset' | 'diagram.close' | 'diagram.viewer';
|
|
3
3
|
export type Locale = {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiagramFile = void 0;
|
|
4
|
+
class DiagramFile {
|
|
5
|
+
validate(_value) {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.DiagramFile = DiagramFile;
|
|
10
|
+
Object.defineProperty(DiagramFile, "resolver", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: 'diagramFile'
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=diagram-file.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
type DiagramProps = {
|
|
3
|
+
id?: string;
|
|
4
|
+
diagramHtml: string;
|
|
5
|
+
diagramHtmlDark?: string;
|
|
6
|
+
diagramError?: string;
|
|
7
|
+
diagramType: string;
|
|
8
|
+
align?: 'left' | 'center' | 'right';
|
|
9
|
+
width?: string;
|
|
10
|
+
'data-source'?: string;
|
|
11
|
+
'data-hash'?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function Diagram({ id, diagramHtml, diagramHtmlDark, diagramError, diagramType, align, width, 'data-source': dataSource, 'data-hash': dataHash, className, }: DiagramProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Diagram = Diagram;
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
|
+
const utils_1 = require("../../../core/utils");
|
|
43
|
+
const hooks_1 = require("../../../core/hooks");
|
|
44
|
+
const hooks_2 = require("../../../core/hooks");
|
|
45
|
+
const SvgViewer_1 = require("../../../components/SvgViewer/SvgViewer");
|
|
46
|
+
function Diagram({ id, diagramHtml, diagramHtmlDark, diagramError, diagramType, align, width, 'data-source': dataSource, 'data-hash': dataHash, className, }) {
|
|
47
|
+
const { useTranslate } = (0, hooks_2.useThemeHooks)();
|
|
48
|
+
const { translate } = useTranslate();
|
|
49
|
+
const { activeColorMode } = (0, hooks_1.useColorSwitcher)();
|
|
50
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
51
|
+
const activeDiagramHtml = activeColorMode === 'dark' ? diagramHtmlDark || diagramHtml : diagramHtml;
|
|
52
|
+
const open = () => setIsOpen(true);
|
|
53
|
+
const close = () => setIsOpen(false);
|
|
54
|
+
const handleKeyDown = (event) => {
|
|
55
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
open();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
if (diagramError) {
|
|
61
|
+
return (react_1.default.createElement(ErrorWrapper, { id: id, className: (0, utils_1.concatClassNames)('diagram-error', className) }, diagramError));
|
|
62
|
+
}
|
|
63
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
64
|
+
react_1.default.createElement(Wrapper, { id: id, "$width": width, className: (0, utils_1.concatClassNames)(`diagram-wrapper diagram-${diagramType}`, className), "data-component-name": "Markdoc/Diagram/Diagram", "data-diagram-type": diagramType, "data-source": dataSource, "data-hash": dataHash, onClick: open, onKeyDown: handleKeyDown, role: "button", tabIndex: 0, "aria-label": translate('diagram.openFullscreen', 'Click to open diagram in fullscreen') },
|
|
65
|
+
react_1.default.createElement(DiagramVariant, { "$align": align, "$colorMode": "light", className: `diagram-variant diagram-variant-light diagram-${diagramType}`, dangerouslySetInnerHTML: { __html: diagramHtml } }),
|
|
66
|
+
diagramHtmlDark ? (react_1.default.createElement(DiagramVariant, { "$align": align, "$colorMode": "dark", className: `diagram-variant diagram-variant-dark diagram-${diagramType}`, dangerouslySetInnerHTML: { __html: diagramHtmlDark } })) : null),
|
|
67
|
+
react_1.default.createElement(SvgViewer_1.SvgViewer, { isOpen: isOpen, onClose: close, labels: {
|
|
68
|
+
zoomIn: translate('diagram.zoomIn', 'Zoom in'),
|
|
69
|
+
zoomOut: translate('diagram.zoomOut', 'Zoom out'),
|
|
70
|
+
fitToView: translate('diagram.reset', 'Fit to view'),
|
|
71
|
+
close: translate('diagram.close', 'Close'),
|
|
72
|
+
dialogLabel: translate('diagram.viewer', 'Diagram viewer'),
|
|
73
|
+
} },
|
|
74
|
+
react_1.default.createElement(ViewerContent, { className: `diagram-viewer-content diagram-${diagramType}`, dangerouslySetInnerHTML: { __html: activeDiagramHtml } }))));
|
|
75
|
+
}
|
|
76
|
+
const Wrapper = styled_components_1.default.div `
|
|
77
|
+
background-color: var(--diagram-bg-color);
|
|
78
|
+
border-radius: var(--diagram-border-radius);
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
transition: box-shadow 0.2s ease;
|
|
81
|
+
|
|
82
|
+
&:hover,
|
|
83
|
+
&:focus {
|
|
84
|
+
outline: none;
|
|
85
|
+
box-shadow: 0 0 0 2px var(--border-color-input-focus);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
svg {
|
|
89
|
+
max-width: 100%;
|
|
90
|
+
display: block;
|
|
91
|
+
${({ $width }) => ($width ? `width: ${$width} !important; height: auto !important;` : '')}
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
const DiagramVariant = styled_components_1.default.div `
|
|
95
|
+
display: flex;
|
|
96
|
+
justify-content: ${({ $align }) => {
|
|
97
|
+
switch ($align) {
|
|
98
|
+
case 'center':
|
|
99
|
+
return 'center';
|
|
100
|
+
case 'right':
|
|
101
|
+
return 'flex-end';
|
|
102
|
+
default:
|
|
103
|
+
return 'flex-start';
|
|
104
|
+
}
|
|
105
|
+
}};
|
|
106
|
+
width: 100%;
|
|
107
|
+
${({ $colorMode }) => $colorMode === 'dark'
|
|
108
|
+
? `
|
|
109
|
+
html:not(.dark) && {
|
|
110
|
+
display: none;
|
|
111
|
+
}
|
|
112
|
+
`
|
|
113
|
+
: `
|
|
114
|
+
html.dark && {
|
|
115
|
+
display: none;
|
|
116
|
+
}
|
|
117
|
+
`}
|
|
118
|
+
`;
|
|
119
|
+
const ErrorWrapper = styled_components_1.default.div `
|
|
120
|
+
border: 1px solid var(--color-error-border);
|
|
121
|
+
border-radius: var(--diagram-border-radius);
|
|
122
|
+
background: var(--color-error-bg);
|
|
123
|
+
color: var(--color-error-text);
|
|
124
|
+
font-size: var(--font-size-sm);
|
|
125
|
+
padding: var(--spacing-sm);
|
|
126
|
+
white-space: pre-wrap;
|
|
127
|
+
word-break: break-word;
|
|
128
|
+
`;
|
|
129
|
+
const ViewerContent = styled_components_1.default.div `
|
|
130
|
+
svg {
|
|
131
|
+
display: block;
|
|
132
|
+
max-width: none !important;
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
//# sourceMappingURL=Diagram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const diagram: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.diagram = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.diagram = (0, styled_components_1.css) `
|
|
6
|
+
/**
|
|
7
|
+
* @tokens Diagram
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
--diagram-bg-color: var(--bg-color-raised); // @presenter Color
|
|
11
|
+
--diagram-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
12
|
+
|
|
13
|
+
// @tokens End
|
|
14
|
+
`;
|
|
15
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps, ReactElement } from 'react';
|
|
2
|
+
import { Link } from '../../../components/Link/Link';
|
|
3
|
+
type MarkdownLinkProps = Omit<ComponentProps<typeof Link>, 'to' | 'onClick'> & {
|
|
4
|
+
href: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function MarkdownLink({ href, ...props }: MarkdownLinkProps): ReactElement;
|
|
7
|
+
export {};
|