@redocly/theme 0.69.0-next.1 → 0.69.0-next.10
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/Accordion/Accordion.js +5 -1
- package/lib/components/Accordion/variables.js +1 -1
- package/lib/components/Admonition/Admonition.d.ts +1 -1
- package/lib/components/Admonition/Admonition.js +1 -1
- package/lib/components/Admonition/variables.dark.js +2 -2
- package/lib/components/Admonition/variables.js +10 -10
- package/lib/components/Badge/Badge.d.ts +3 -1
- package/lib/components/Badge/Badge.js +7 -2
- package/lib/components/Banner/variables.dark.js +2 -0
- package/lib/components/Banner/variables.js +3 -1
- package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
- package/lib/components/Breadcrumbs/variables.js +1 -1
- package/lib/components/Button/ButtonGroup.d.ts +3 -5
- package/lib/components/Button/ButtonGroup.js +25 -5
- package/lib/components/Button/variables.js +27 -4
- package/lib/components/Buttons/ConnectMCPButton.js +39 -123
- package/lib/components/Buttons/CopyButton.js +12 -1
- package/lib/components/Buttons/variables.d.ts +0 -1
- package/lib/components/Buttons/variables.js +3 -44
- package/lib/components/Catalog/CatalogEntities.js +1 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +5 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +1 -0
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
- package/lib/components/Catalog/CatalogViewModeToggle.js +2 -43
- package/lib/components/Catalog/variables.js +5 -5
- package/lib/components/CatalogClassic/variables.js +2 -2
- package/lib/components/CodeBlock/CodeBlock.js +2 -1
- package/lib/components/CodeBlock/CodeBlockContainer.js +1 -0
- package/lib/components/Dropdown/Dropdown.d.ts +10 -20
- package/lib/components/Dropdown/Dropdown.js +13 -2
- package/lib/components/Dropdown/DropdownMenuItemContent.d.ts +9 -0
- package/lib/components/Dropdown/DropdownMenuItemContent.js +56 -0
- package/lib/components/Dropdown/variables.js +19 -2
- package/lib/components/Feedback/Mood.js +18 -14
- package/lib/components/Feedback/Rating.js +18 -13
- package/lib/components/Feedback/Scale.js +27 -22
- package/lib/components/Feedback/Sentiment.js +17 -13
- package/lib/components/Filter/FilterInput.js +4 -2
- package/lib/components/Filter/FilterSelect.js +1 -0
- package/lib/components/Filter/variables.js +2 -2
- package/lib/components/Image/variables.js +5 -3
- package/lib/components/JsonViewer/Helpers.js +12 -42
- package/lib/components/LanguagePicker/variables.js +1 -1
- package/lib/components/MCP/McpConnectionTabs.d.ts +7 -0
- package/lib/components/MCP/McpConnectionTabs.js +151 -0
- package/lib/components/Markdown/styles/base-table.js +8 -0
- package/lib/components/Markdown/variables.js +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/Menu/variables.js +1 -1
- package/lib/components/Navbar/variables.js +1 -1
- package/lib/components/PageActions/PageActions.js +4 -6
- package/lib/components/PageActions/PageActionsMenuItem.d.ts +4 -4
- package/lib/components/PageActions/PageActionsMenuItem.js +27 -43
- package/lib/components/Panel/Panel.js +5 -1
- package/lib/components/Panel/variables.js +1 -1
- package/lib/components/Product/variables.js +2 -1
- package/lib/components/ReplayGate/ReplayGate.d.ts +1 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +22 -32
- package/lib/components/Search/SearchAiDialog.js +4 -1
- package/lib/components/Search/SearchAiMessage.js +1 -1
- package/lib/components/Search/SearchAiNegativeFeedbackForm.js +2 -2
- package/lib/components/Search/SearchDialog.js +2 -2
- package/lib/components/Search/SearchItem.js +6 -3
- package/lib/components/Search/SearchRecent.js +1 -0
- package/lib/components/Search/SearchSuggestedPages.js +1 -0
- package/lib/components/Search/variables.js +9 -5
- package/lib/components/Segmented/Segmented.js +3 -3
- package/lib/components/Select/Select.js +30 -23
- package/lib/components/Select/variables.js +3 -3
- package/lib/components/Sidebar/Sidebar.js +2 -38
- package/lib/components/SplitButton/SplitButton.d.ts +21 -0
- package/lib/components/SplitButton/SplitButton.js +37 -0
- package/lib/components/Switch/variables.dark.js +2 -2
- package/lib/components/Switch/variables.js +2 -2
- package/lib/components/Tag/variables.js +2 -2
- package/lib/components/Tags/variables.js +1 -1
- package/lib/components/Toast/variables.js +1 -1
- package/lib/components/Tooltip/AnchorTooltip.js +2 -2
- package/lib/components/Tooltip/JsTooltip.js +2 -2
- package/lib/components/UserMenu/variables.js +1 -1
- package/lib/core/constants/mcp.d.ts +4 -0
- package/lib/core/constants/mcp.js +10 -1
- package/lib/core/constants/search.js +2 -2
- package/lib/core/contexts/PageActionsContext.d.ts +5 -0
- package/lib/core/contexts/PageActionsContext.js +10 -0
- package/lib/core/contexts/index.d.ts +1 -0
- package/lib/core/contexts/index.js +1 -0
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +5 -17
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +1 -0
- package/lib/core/hooks/menu/use-menu-item-expanded.js +1 -0
- package/lib/core/hooks/use-active-heading.js +59 -15
- package/lib/core/hooks/use-active-section-id.js +3 -1
- package/lib/core/hooks/use-connect-mcp-button.d.ts +1 -1
- package/lib/core/hooks/use-connect-mcp-button.js +16 -13
- package/lib/core/hooks/use-control.js +3 -0
- package/lib/core/hooks/use-local-state.js +1 -0
- package/lib/core/hooks/use-mcp-config.d.ts +2 -0
- package/lib/core/hooks/use-mcp-config.js +14 -4
- package/lib/core/hooks/use-mobile-menu.js +10 -2
- package/lib/core/styles/global.js +16 -11
- package/lib/core/styles/palette.js +2 -0
- package/lib/core/types/button-group.d.ts +2 -0
- package/lib/core/types/button-group.js +3 -0
- package/lib/core/types/catalog.d.ts +2 -4
- package/lib/core/types/common.d.ts +2 -0
- package/lib/core/types/hooks.d.ts +1 -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 +1 -1
- package/lib/core/utils/RenderWithLink.d.ts +2 -0
- package/lib/core/utils/RenderWithLink.js +20 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/mcp.d.ts +5 -0
- package/lib/core/utils/mcp.js +35 -0
- package/lib/icons/CodexIcon/CodexIcon.d.ts +25 -0
- package/lib/icons/CodexIcon/CodexIcon.js +22 -0
- package/lib/icons/LinkIcon/LinkIcon.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/layouts/McpNotAllowed.js +10 -10
- package/lib/markdoc/components/Cards/Card.d.ts +8 -1
- package/lib/markdoc/components/Cards/Card.js +55 -16
- package/lib/markdoc/components/Cards/CardBadge.d.ts +9 -0
- package/lib/markdoc/components/Cards/CardBadge.js +30 -0
- package/lib/markdoc/components/Cards/CardIcon.d.ts +5 -4
- package/lib/markdoc/components/Cards/CardIcon.js +6 -3
- package/lib/markdoc/components/Cards/variables.dark.js +32 -0
- package/lib/markdoc/components/Cards/variables.js +81 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +1 -1
- package/lib/markdoc/components/CodeWalkthrough/variables.js +2 -1
- package/lib/markdoc/components/Heading/Heading.js +5 -2
- package/lib/markdoc/components/Tabs/TabList.js +6 -2
- package/lib/markdoc/components/Tabs/Tabs.js +4 -2
- package/lib/markdoc/components/Tabs/variables.js +4 -4
- package/lib/markdoc/tags/admonition.js +1 -1
- package/lib/markdoc/tags/card.js +14 -0
- package/lib/markdoc/tags/connect-mcp.js +2 -1
- package/package.json +19 -10
- package/src/components/Accordion/Accordion.tsx +7 -3
- package/src/components/Accordion/variables.ts +1 -1
- package/src/components/Admonition/Admonition.tsx +2 -2
- package/src/components/Admonition/variables.dark.ts +2 -2
- package/src/components/Admonition/variables.ts +10 -10
- package/src/components/Badge/Badge.tsx +16 -2
- package/src/components/Banner/variables.dark.ts +2 -0
- package/src/components/Banner/variables.ts +3 -1
- package/src/components/Breadcrumbs/Breadcrumb.tsx +1 -1
- package/src/components/Breadcrumbs/variables.ts +1 -1
- package/src/components/Button/ButtonGroup.tsx +28 -10
- package/src/components/Button/variables.ts +27 -4
- package/src/components/Buttons/ConnectMCPButton.tsx +88 -145
- package/src/components/Buttons/CopyButton.tsx +14 -2
- package/src/components/Buttons/variables.ts +2 -44
- package/src/components/Catalog/CatalogEntities.tsx +1 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +6 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
- package/src/components/Catalog/CatalogFilter/CatalogFilterSelect.tsx +1 -0
- package/src/components/Catalog/CatalogViewModeToggle.tsx +2 -17
- package/src/components/Catalog/variables.ts +5 -5
- package/src/components/CatalogClassic/variables.ts +2 -2
- package/src/components/CodeBlock/CodeBlock.tsx +2 -1
- package/src/components/CodeBlock/CodeBlockContainer.tsx +1 -0
- package/src/components/Dropdown/Dropdown.tsx +25 -4
- package/src/components/Dropdown/DropdownMenuItemContent.tsx +72 -0
- package/src/components/Dropdown/variables.ts +19 -2
- package/src/components/Feedback/Mood.tsx +22 -15
- package/src/components/Feedback/Rating.tsx +22 -14
- package/src/components/Feedback/Scale.tsx +40 -32
- package/src/components/Feedback/Sentiment.tsx +21 -14
- package/src/components/Filter/FilterInput.tsx +5 -3
- package/src/components/Filter/FilterSelect.tsx +1 -0
- package/src/components/Filter/variables.ts +2 -2
- package/src/components/Image/variables.ts +5 -3
- package/src/components/JsonViewer/Helpers.tsx +13 -9
- package/src/components/LanguagePicker/variables.ts +1 -1
- package/src/components/MCP/McpConnectionTabs.tsx +263 -0
- package/src/components/Markdown/styles/base-table.ts +8 -0
- package/src/components/Markdown/variables.ts +1 -1
- package/src/components/Menu/MenuItem.tsx +2 -2
- package/src/components/Menu/variables.ts +1 -1
- package/src/components/Navbar/variables.ts +1 -1
- package/src/components/PageActions/PageActions.tsx +22 -23
- package/src/components/PageActions/PageActionsMenuItem.tsx +41 -55
- package/src/components/Panel/Panel.tsx +7 -3
- package/src/components/Panel/variables.ts +1 -1
- package/src/components/Product/variables.ts +2 -1
- package/src/components/ReplayGate/ReplayGate.tsx +3 -0
- package/src/components/Search/FilterFields/SearchFilterFieldSelect.tsx +32 -40
- package/src/components/Search/SearchAiDialog.tsx +4 -1
- package/src/components/Search/SearchAiMessage.tsx +1 -1
- package/src/components/Search/SearchAiNegativeFeedbackForm.tsx +2 -2
- package/src/components/Search/SearchDialog.tsx +2 -2
- package/src/components/Search/SearchItem.tsx +7 -1
- package/src/components/Search/SearchRecent.tsx +1 -0
- package/src/components/Search/SearchSuggestedPages.tsx +1 -0
- package/src/components/Search/variables.ts +9 -5
- package/src/components/Segmented/Segmented.tsx +6 -3
- package/src/components/Select/Select.tsx +36 -22
- package/src/components/Select/variables.ts +3 -3
- package/src/components/Sidebar/Sidebar.tsx +2 -6
- package/src/components/SplitButton/SplitButton.tsx +95 -0
- package/src/components/Switch/variables.dark.ts +2 -2
- package/src/components/Switch/variables.ts +2 -2
- package/src/components/Tag/variables.ts +2 -2
- package/src/components/Tags/variables.ts +1 -1
- package/src/components/Toast/variables.ts +1 -1
- package/src/components/Tooltip/AnchorTooltip.tsx +2 -2
- package/src/components/Tooltip/JsTooltip.tsx +2 -2
- package/src/components/UserMenu/variables.ts +1 -1
- package/src/core/constants/mcp.ts +14 -0
- package/src/core/constants/search.ts +2 -2
- package/src/core/contexts/PageActionsContext.tsx +7 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +6 -20
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -0
- package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -0
- package/src/core/hooks/use-active-heading.ts +79 -15
- package/src/core/hooks/use-active-section-id.ts +3 -1
- package/src/core/hooks/use-connect-mcp-button.ts +23 -15
- package/src/core/hooks/use-control.ts +5 -1
- package/src/core/hooks/use-local-state.ts +1 -0
- package/src/core/hooks/use-mcp-config.ts +15 -4
- package/src/core/hooks/use-mobile-menu.ts +11 -3
- package/src/core/openapi/index.ts +1 -1
- package/src/core/styles/global.ts +17 -12
- package/src/core/styles/palette.ts +2 -0
- package/src/core/types/button-group.ts +2 -0
- package/src/core/types/catalog.ts +2 -4
- package/src/core/types/common.ts +3 -0
- package/src/core/types/hooks.ts +1 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +29 -1
- package/src/core/types/mcp.ts +1 -1
- package/src/core/utils/RenderWithLink.tsx +19 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/mcp.ts +39 -0
- package/src/icons/CodexIcon/CodexIcon.tsx +23 -0
- package/src/icons/LinkIcon/LinkIcon.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/layouts/McpNotAllowed.tsx +37 -11
- package/src/markdoc/components/Cards/Card.tsx +79 -14
- package/src/markdoc/components/Cards/CardBadge.tsx +39 -0
- package/src/markdoc/components/Cards/CardIcon.tsx +16 -5
- package/src/markdoc/components/Cards/variables.dark.ts +32 -0
- package/src/markdoc/components/Cards/variables.ts +81 -7
- package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -0
- package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/variables.ts +2 -1
- package/src/markdoc/components/Heading/Heading.tsx +7 -4
- package/src/markdoc/components/Tabs/TabList.tsx +6 -2
- package/src/markdoc/components/Tabs/Tabs.tsx +4 -2
- package/src/markdoc/components/Tabs/variables.ts +4 -4
- package/src/markdoc/tags/admonition.ts +1 -1
- package/src/markdoc/tags/card.ts +14 -0
- package/src/markdoc/tags/connect-mcp.ts +3 -1
|
@@ -38,7 +38,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Sentiment = Sentiment;
|
|
40
40
|
const React = __importStar(require("react"));
|
|
41
|
-
const react_1 = require("react");
|
|
42
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
43
42
|
const Reasons_1 = require("../../components/Feedback/Reasons");
|
|
44
43
|
const hooks_1 = require("../../core/hooks");
|
|
@@ -82,10 +81,12 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
82
81
|
}
|
|
83
82
|
return !(scoreSpecificReasonsSettings === null || scoreSpecificReasonsSettings === void 0 ? void 0 : scoreSpecificReasonsSettings.hide);
|
|
84
83
|
};
|
|
84
|
+
const hasComment = !(commentSettings === null || commentSettings === void 0 ? void 0 : commentSettings.hide);
|
|
85
|
+
const hasOptionalEmail = !(optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.hide) && !(userData === null || userData === void 0 ? void 0 : userData.isAuthenticated);
|
|
85
86
|
const displayReasons = checkIfShouldDisplayReasons(score);
|
|
86
|
-
const displayComment = !!
|
|
87
|
+
const displayComment = !!score && hasComment;
|
|
87
88
|
const displaySubmitBnt = !!(score && (displayReasons || displayComment));
|
|
88
|
-
const displayFeedbackEmail = !!score &&
|
|
89
|
+
const displayFeedbackEmail = !!score && hasOptionalEmail;
|
|
89
90
|
const commentLabel = score === 1
|
|
90
91
|
? (commentSettings && commentSettings.likeLabel) ||
|
|
91
92
|
translate('feedback.settings.comment.likeLabel', 'What was most helpful?')
|
|
@@ -105,29 +106,32 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
105
106
|
const scoreSpecificReasonSettings = getScoreSpecificReasonSettings(score);
|
|
106
107
|
return scoreSpecificReasonSettings === null || scoreSpecificReasonSettings === void 0 ? void 0 : scoreSpecificReasonSettings.component;
|
|
107
108
|
};
|
|
108
|
-
const
|
|
109
|
+
const submitSentiment = (sentimentScore) => {
|
|
109
110
|
const trimmedComment = (comment === null || comment === void 0 ? void 0 : comment.trim()) || undefined;
|
|
110
111
|
const trimmedEmail = (email === null || email === void 0 ? void 0 : email.trim()) || undefined;
|
|
111
112
|
onSubmit({
|
|
112
|
-
score,
|
|
113
|
+
score: sentimentScore,
|
|
113
114
|
comment: trimmedComment,
|
|
114
115
|
reasons,
|
|
115
116
|
email: trimmedEmail,
|
|
116
117
|
});
|
|
117
118
|
setIsSubmitted(true);
|
|
118
119
|
};
|
|
120
|
+
const onSubmitSentimentForm = () => {
|
|
121
|
+
submitSentiment(score);
|
|
122
|
+
};
|
|
123
|
+
const onScoreChange = (newScore) => {
|
|
124
|
+
setScore(newScore);
|
|
125
|
+
if (newScore && !checkIfShouldDisplayReasons(newScore) && !hasComment && !hasOptionalEmail) {
|
|
126
|
+
submitSentiment(newScore);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
119
129
|
const onCancelSentimentForm = () => {
|
|
120
130
|
setScore(0);
|
|
121
131
|
setComment('');
|
|
122
132
|
setReasons([]);
|
|
123
133
|
setEmail(undefined);
|
|
124
134
|
};
|
|
125
|
-
(0, react_1.useEffect)(() => {
|
|
126
|
-
if (score && !displayComment && !displayReasons && !displayFeedbackEmail) {
|
|
127
|
-
onSubmitSentimentForm();
|
|
128
|
-
}
|
|
129
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
130
|
-
}, [score, displayComment, displayReasons, displayFeedbackEmail]);
|
|
131
135
|
if (isSubmitted) {
|
|
132
136
|
return (React.createElement(SentimentWrapper, { "data-component-name": "Feedback/Sentiment" },
|
|
133
137
|
React.createElement(StyledFormMandatoryFields, null,
|
|
@@ -141,10 +145,10 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
141
145
|
React.createElement(Label, { "data-translation-key": "feedback.settings.label" }, label || translate('feedback.settings.label', 'Was this helpful?')),
|
|
142
146
|
React.createElement(StyledMandatoryFieldContainer, null,
|
|
143
147
|
React.createElement(Button_1.Button, { type: "button", size: "medium", variant: score === 1 ? 'primary' : 'secondary', onClick: () => {
|
|
144
|
-
|
|
148
|
+
onScoreChange(1);
|
|
145
149
|
}, "aria-label": translate('feedback.sentiment.thumbUp', 'Like'), icon: React.createElement(ThumbUpIcon_1.ThumbUpIcon, null) }),
|
|
146
150
|
React.createElement(Button_1.Button, { size: "medium", type: "button", variant: score === -1 ? 'primary' : 'secondary', tone: score === -1 ? 'danger' : 'default', onClick: () => {
|
|
147
|
-
|
|
151
|
+
onScoreChange(-1);
|
|
148
152
|
}, "aria-label": translate('feedback.sentiment.thumbDown', 'Dislike'), icon: React.createElement(ThumbDownIcon_1.ThumbDownIcon, null) }))),
|
|
149
153
|
(displayReasons || displayComment) && (React.createElement(StyledFormOptionalFields, null,
|
|
150
154
|
displayReasons && (React.createElement(Reasons_1.Reasons, { settings: {
|
|
@@ -44,9 +44,11 @@ const SearchIcon_1 = require("../../icons/SearchIcon/SearchIcon");
|
|
|
44
44
|
function FilterInput(props) {
|
|
45
45
|
const { value: initialValue, onChange, dataTestId } = props;
|
|
46
46
|
const [value, setValue] = (0, react_1.useState)(initialValue);
|
|
47
|
-
(0, react_1.
|
|
47
|
+
const [prevInitialValue, setPrevInitialValue] = (0, react_1.useState)(initialValue);
|
|
48
|
+
if (prevInitialValue !== initialValue) {
|
|
49
|
+
setPrevInitialValue(initialValue);
|
|
48
50
|
setValue(initialValue);
|
|
49
|
-
}
|
|
51
|
+
}
|
|
50
52
|
const handleChange = (e) => {
|
|
51
53
|
const newValue = e.target.value;
|
|
52
54
|
setValue(newValue);
|
|
@@ -53,6 +53,7 @@ const StyledSelect = (0, styled_components_1.default)(Select_1.Select) `
|
|
|
53
53
|
--select-text-color: var(--filter-select-color);
|
|
54
54
|
border: 1px solid var(--filter-select-border-color);
|
|
55
55
|
--select-border-radius: var(--filter-select-border-radius);
|
|
56
|
+
--select-input-border-radius: var(--filter-select-border-radius);
|
|
56
57
|
padding: var(--filter-select-padding);
|
|
57
58
|
|
|
58
59
|
&:hover {
|
|
@@ -74,7 +74,7 @@ exports.filter = (0, styled_components_1.css) `
|
|
|
74
74
|
--filter-select-max-width: 100%;
|
|
75
75
|
--filter-select-color: var(--text-color-primary);
|
|
76
76
|
--filter-select-border-color: var(--border-color-primary);
|
|
77
|
-
--filter-select-border-radius:
|
|
77
|
+
--filter-select-border-radius: var(--input-border-radius);
|
|
78
78
|
--filter-select-padding: 0;
|
|
79
79
|
--filter-select-border-color-hover: var(--text-color-primary);
|
|
80
80
|
--filter-select-option-margin: 0;
|
|
@@ -94,7 +94,7 @@ exports.filter = (0, styled_components_1.css) `
|
|
|
94
94
|
--filter-date-picker-icon-width: var(--spacing-sm);
|
|
95
95
|
--filter-date-picker-icon-stroke-hover: var(--text-color-primary);
|
|
96
96
|
--filter-date-picker-wrapper-border-color: var(--border-color-primary);
|
|
97
|
-
--filter-date-picker-wrapper-radius:
|
|
97
|
+
--filter-date-picker-wrapper-radius: var(--border-radius-md);
|
|
98
98
|
--filter-date-picker-wrapper-padding: calc(var(--spacing-xxs) / 2) var(--spacing-xs);
|
|
99
99
|
|
|
100
100
|
// @tokens End
|
|
@@ -12,7 +12,7 @@ exports.image = (0, styled_components_1.css) `
|
|
|
12
12
|
--image-frame-border-color: var(--border-color-secondary);
|
|
13
13
|
--image-frame-border-radius: var(--border-radius-xxl);
|
|
14
14
|
--image-frame-bg-color: var(--bg-color-raised);
|
|
15
|
-
--image-frame-image-border-radius: var(--border-radius-
|
|
15
|
+
--image-frame-image-border-radius: var(--border-radius-xl);
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @tokens Image caption
|
|
@@ -26,7 +26,7 @@ exports.image = (0, styled_components_1.css) `
|
|
|
26
26
|
/**
|
|
27
27
|
* @tokens Image gallery
|
|
28
28
|
*/
|
|
29
|
-
--image-gallery-border-radius: var(--border-radius-
|
|
29
|
+
--image-gallery-border-radius: var(--border-radius-xl);
|
|
30
30
|
--image-gallery-image-bg-color: var(--bg-color-tonal);
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -51,9 +51,11 @@ exports.image = (0, styled_components_1.css) `
|
|
|
51
51
|
--image-lightbox-close-size: 40px;
|
|
52
52
|
--image-lightbox-close-icon-size: 18px;
|
|
53
53
|
--image-lightbox-close-offset: var(--spacing-base);
|
|
54
|
-
--image-lightbox-close-border-radius: var(--border-radius-
|
|
54
|
+
--image-lightbox-close-border-radius: var(--border-radius-xl);
|
|
55
55
|
--image-lightbox-side-gutter: calc(
|
|
56
56
|
var(--image-lightbox-close-size) + var(--image-lightbox-close-offset) + var(--spacing-sm)
|
|
57
57
|
);
|
|
58
|
+
|
|
59
|
+
// @tokens End
|
|
58
60
|
`;
|
|
59
61
|
//# sourceMappingURL=variables.js.map
|
|
@@ -1,43 +1,10 @@
|
|
|
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
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
6
|
exports.JsonValue = JsonValue;
|
|
40
|
-
const react_1 =
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
41
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
9
|
const Button_1 = require("../../components/Button/Button");
|
|
43
10
|
const ShowMoreToggleButton_1 = require("../../components/Button/ShowMoreToggleButton");
|
|
@@ -47,14 +14,15 @@ function JsonValue(props) {
|
|
|
47
14
|
const indent = ' '.repeat(level * 2);
|
|
48
15
|
const [isExpandedState, setExpanded] = react_1.default.useState(expandAllSignal !== null && expandAllSignal !== void 0 ? expandAllSignal : level < defaultExpandLevel);
|
|
49
16
|
const isExpanded = expandAllSignal !== undefined && level > 0 ? expandAllSignal : isExpandedState;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
const [prevExpandAllSignal, setPrevExpandAllSignal] = react_1.default.useState(expandAllSignal);
|
|
18
|
+
const [prevLevel, setPrevLevel] = react_1.default.useState(level);
|
|
19
|
+
if (prevExpandAllSignal !== expandAllSignal || prevLevel !== level) {
|
|
20
|
+
setPrevExpandAllSignal(expandAllSignal);
|
|
21
|
+
setPrevLevel(level);
|
|
22
|
+
if (expandAllSignal !== undefined && !(expandAllSignal === false && level === 0)) {
|
|
55
23
|
setExpanded(expandAllSignal);
|
|
56
24
|
}
|
|
57
|
-
}
|
|
25
|
+
}
|
|
58
26
|
const keys = (value && Object.keys(value).filter((key) => value[key] !== undefined)) || []; // filter out undefined properties
|
|
59
27
|
const valueType = typeof value;
|
|
60
28
|
const isPrimitive = (valueType !== 'object' && value !== null) || keys.length === 0;
|
|
@@ -94,11 +62,13 @@ function JsonKeyValue(props) {
|
|
|
94
62
|
const isCollapsible = typeof value === 'object' && value !== null && keys.length > 0;
|
|
95
63
|
const [isExpandedState, setExpanded] = react_1.default.useState(expandAllSignal !== null && expandAllSignal !== void 0 ? expandAllSignal : level < defaultExpandLevel);
|
|
96
64
|
const isExpanded = expandAllSignal !== undefined ? expandAllSignal : isExpandedState;
|
|
97
|
-
|
|
65
|
+
const [prevExpandAllSignal, setPrevExpandAllSignal] = react_1.default.useState(expandAllSignal);
|
|
66
|
+
if (prevExpandAllSignal !== expandAllSignal) {
|
|
67
|
+
setPrevExpandAllSignal(expandAllSignal);
|
|
98
68
|
if (expandAllSignal !== undefined) {
|
|
99
69
|
setExpanded(expandAllSignal);
|
|
100
70
|
}
|
|
101
|
-
}
|
|
71
|
+
}
|
|
102
72
|
const openingPunctuation = Array.isArray(value) ? '[' : '{';
|
|
103
73
|
const closingPunctuation = Array.isArray(value) ? ']' : '}';
|
|
104
74
|
const valueElement = isCollapsible ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -24,7 +24,7 @@ exports.languagePicker = (0, styled_components_1.css) `
|
|
|
24
24
|
--language-picker-dropdown-item-padding-vertical: var(--dropdown-menu-item-padding-vertical); // @presenter Spacing
|
|
25
25
|
--language-picker-dropdown-item-separator-padding-top: var(--dropdown-menu-item-separator-padding-top ); // @presenter Spacing
|
|
26
26
|
--language-picker-dropdown-item-separator-padding-bottom: var(--dropdown-menu-item-separator-padding-bottom ); // @presenter Spacing
|
|
27
|
-
--language-picker-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius
|
|
27
|
+
--language-picker-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius); // @presenter BorderRadius
|
|
28
28
|
--language-picker-dropdown-item-bg-color-active: var(--dropdown-menu-item-bg-color-active); // @presenter Color
|
|
29
29
|
--language-picker-dropdown-item-bg-color-hover: var(--dropdown-menu-item-bg-color-hover); // @presenter Color
|
|
30
30
|
--language-picker-dropdown-item-bg-color-disabled: var(--dropdown-menu-item-bg-color-disabled); // @presenter Color
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
export type McpConnectionTab = 'claude' | 'chatgpt' | 'json';
|
|
3
|
+
export type McpConnectionTabsProps = {
|
|
4
|
+
options?: McpConnectionTab[];
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function McpConnectionTabs({ options, className, }: McpConnectionTabsProps): JSX.Element | null;
|
|
@@ -0,0 +1,151 @@
|
|
|
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.McpConnectionTabs = McpConnectionTabs;
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
|
+
const hooks_1 = require("../../core/hooks");
|
|
43
|
+
const utils_1 = require("../../core/utils");
|
|
44
|
+
const CodeBlock_1 = require("../../components/CodeBlock/CodeBlock");
|
|
45
|
+
const ClaudeIcon_1 = require("../../icons/ClaudeIcon/ClaudeIcon");
|
|
46
|
+
const ChatGptIcon_1 = require("../../icons/ChatGptIcon/ChatGptIcon");
|
|
47
|
+
const Tabs_1 = require("../../markdoc/components/Tabs/Tabs");
|
|
48
|
+
const TabItemFragment_1 = require("../../markdoc/components/Tabs/TabItemFragment");
|
|
49
|
+
const NumberedList_1 = require("../../markdoc/components/NumberedList/NumberedList");
|
|
50
|
+
const NumberedItem_1 = require("../../markdoc/components/NumberedList/NumberedItem");
|
|
51
|
+
const DEFAULT_TAB_OPTIONS = ['claude', 'chatgpt', 'json'];
|
|
52
|
+
const TAB_LABELS = {
|
|
53
|
+
claude: {
|
|
54
|
+
translationKey: 'page.mcpNotAllowed.tabs.claude',
|
|
55
|
+
defaultLabel: 'Claude',
|
|
56
|
+
icon: ClaudeIcon_1.ClaudeIcon,
|
|
57
|
+
},
|
|
58
|
+
chatgpt: {
|
|
59
|
+
translationKey: 'page.mcpNotAllowed.tabs.chatgpt',
|
|
60
|
+
defaultLabel: 'ChatGPT',
|
|
61
|
+
icon: ChatGptIcon_1.ChatGptIcon,
|
|
62
|
+
},
|
|
63
|
+
json: { translationKey: 'page.mcpNotAllowed.tabs.json', defaultLabel: 'JSON' },
|
|
64
|
+
};
|
|
65
|
+
// The report control is docs feedback, not useful on the connection page.
|
|
66
|
+
const CODE_BLOCK_HEADER = { controls: { copy: {}, report: { hidden: true } } };
|
|
67
|
+
function McpConnectionTabs({ options = DEFAULT_TAB_OPTIONS, className, }) {
|
|
68
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
69
|
+
const { translate } = useTranslate();
|
|
70
|
+
const { serverName, serverUrl, isMcpDisabled } = (0, hooks_1.useMCPConfig)();
|
|
71
|
+
// The SSR markup of error pages is cached with the build-time origin, so the
|
|
72
|
+
// tabs remount after hydration to pick up the real browser origin.
|
|
73
|
+
const [hydrated, setHydrated] = (0, react_1.useState)(false);
|
|
74
|
+
(0, react_1.useEffect)(() => setHydrated(true), []);
|
|
75
|
+
if (isMcpDisabled) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const connection = { serverName, url: serverUrl };
|
|
79
|
+
return (react_1.default.createElement(McpConnectionTabsWrapper, { key: hydrated ? 'client' : 'ssr', "data-component-name": "MCP/McpConnectionTabs", "data-testid": "mcp-connection-tabs", className: className },
|
|
80
|
+
react_1.default.createElement(Tabs_1.Tabs, { size: Tabs_1.TabsSize.SMALL }, options.map((option) => {
|
|
81
|
+
const { translationKey, defaultLabel, icon: TabIcon } = TAB_LABELS[option];
|
|
82
|
+
return (react_1.default.createElement(TabItemFragment_1.TabItemFragment, { key: option, label: translate(translationKey, defaultLabel), icon: TabIcon ? react_1.default.createElement(TabIcon, null) : undefined }, renderTabContent(option, connection, translate)));
|
|
83
|
+
}))));
|
|
84
|
+
}
|
|
85
|
+
function renderTabContent(option, connection, translate) {
|
|
86
|
+
const terminalHint = (react_1.default.createElement(TabHint, null, translate('page.mcpNotAllowed.snippets.terminal.hint', 'Run this command in your terminal:')));
|
|
87
|
+
const urlBlock = react_1.default.createElement(CodeBlock_1.CodeBlock, { lang: "text", source: connection.url, header: CODE_BLOCK_HEADER });
|
|
88
|
+
const assistantPromptClient = {
|
|
89
|
+
headline: translate('page.mcpNotAllowed.snippets.prompt.headline', 'Prompt'),
|
|
90
|
+
content: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
91
|
+
react_1.default.createElement(TabHint, null, translate('page.mcpNotAllowed.snippets.prompt.hint', 'Or paste this prompt into the chat to have it add the server for you:')),
|
|
92
|
+
react_1.default.createElement(CodeBlock_1.CodeBlock, { lang: "text", source: (0, utils_1.generateMcpInstallPrompt)(connection), header: CODE_BLOCK_HEADER, wrapContents: true }))),
|
|
93
|
+
};
|
|
94
|
+
switch (option) {
|
|
95
|
+
case 'claude':
|
|
96
|
+
return renderClientList([
|
|
97
|
+
{
|
|
98
|
+
headline: translate('page.mcpNotAllowed.snippets.claudeCode.headline', 'Claude Code'),
|
|
99
|
+
content: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
100
|
+
terminalHint,
|
|
101
|
+
react_1.default.createElement(CodeBlock_1.CodeBlock, { lang: "shell", source: (0, utils_1.generateClaudeCodeCommand)(connection), header: CODE_BLOCK_HEADER, wrapContents: true }))),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
headline: translate('page.mcpNotAllowed.snippets.claudeDesktop.headline', 'Claude Desktop'),
|
|
105
|
+
content: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
106
|
+
react_1.default.createElement(TabHint, null, translate('page.mcpNotAllowed.snippets.claudeDesktop.instruction', 'In Claude Desktop, open Settings → Developer → Edit Config, add this to the configuration file, and restart Claude Desktop:')),
|
|
107
|
+
react_1.default.createElement(CodeBlock_1.CodeBlock, { lang: "json", source: (0, utils_1.generateClaudeDesktopConfig)(connection), header: CODE_BLOCK_HEADER }))),
|
|
108
|
+
},
|
|
109
|
+
]);
|
|
110
|
+
case 'chatgpt':
|
|
111
|
+
return renderClientList([
|
|
112
|
+
{
|
|
113
|
+
headline: translate('page.mcpNotAllowed.snippets.codexCli.headline', 'Codex CLI'),
|
|
114
|
+
content: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
115
|
+
terminalHint,
|
|
116
|
+
react_1.default.createElement(CodeBlock_1.CodeBlock, { lang: "shell", source: (0, utils_1.generateCodexCommand)(connection), header: CODE_BLOCK_HEADER, wrapContents: true }))),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
headline: translate('page.mcpNotAllowed.snippets.chatgptApp.headline', 'ChatGPT desktop app'),
|
|
120
|
+
content: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
121
|
+
react_1.default.createElement(TabHint, null, translate('page.mcpNotAllowed.snippets.chatgptApp.instruction', 'In the ChatGPT desktop app, go to Settings → Plugins → MCPs and add a server with the "Streamable HTTP" type and this URL (restart the app afterwards):')),
|
|
122
|
+
urlBlock)),
|
|
123
|
+
},
|
|
124
|
+
assistantPromptClient,
|
|
125
|
+
]);
|
|
126
|
+
case 'json':
|
|
127
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
128
|
+
react_1.default.createElement(TabHint, null, translate('page.mcpNotAllowed.snippets.json.hint', 'Add this server entry to your MCP client configuration file:')),
|
|
129
|
+
react_1.default.createElement(CodeBlock_1.CodeBlock, { lang: "json", source: JSON.stringify({ [connection.serverName]: { url: connection.url, description: 'MCP Server' } }, null, 2), header: CODE_BLOCK_HEADER })));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function renderClientList(clients) {
|
|
133
|
+
return (react_1.default.createElement(NumberedList_1.NumberedList, null, clients.map((client, index) => (react_1.default.createElement(NumberedItem_1.NumberedItem, { key: index, type: "dot", size: "small", headline: client.headline, index: index + 1, isLast: index === clients.length - 1 }, client.content)))));
|
|
134
|
+
}
|
|
135
|
+
const McpConnectionTabsWrapper = styled_components_1.default.div `
|
|
136
|
+
--md-numbered-list-margin: 0 0 var(--spacing-sm);
|
|
137
|
+
|
|
138
|
+
font-size: var(--page-mcp-405-snippets-font-size);
|
|
139
|
+
line-height: var(--page-mcp-405-snippets-line-height);
|
|
140
|
+
text-align: left;
|
|
141
|
+
|
|
142
|
+
/* The copy control floats over the code, so wrapped lines need room to clear it. */
|
|
143
|
+
pre[data-testid='source-code'] {
|
|
144
|
+
padding-right: var(--page-mcp-405-snippets-code-padding-right);
|
|
145
|
+
}
|
|
146
|
+
`;
|
|
147
|
+
const TabHint = styled_components_1.default.p `
|
|
148
|
+
margin: 0 0 var(--spacing-xs);
|
|
149
|
+
color: var(--page-mcp-405-snippets-hint-text-color);
|
|
150
|
+
`;
|
|
151
|
+
//# sourceMappingURL=McpConnectionTabs.js.map
|
|
@@ -46,6 +46,14 @@ exports.markdownBaseTableCss = (0, styled_components_1.css) `
|
|
|
46
46
|
background-color: var(--md-table-header-bg-color);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/* hide the header row when every cell is empty; one labelled cell keeps it visible */
|
|
50
|
+
thead:has(th:empty) {
|
|
51
|
+
display: none;
|
|
52
|
+
}
|
|
53
|
+
thead:has(th:not(:empty)) {
|
|
54
|
+
display: table-header-group;
|
|
55
|
+
}
|
|
56
|
+
|
|
49
57
|
tr {
|
|
50
58
|
background-color: var(--md-table-stripe-bg-color);
|
|
51
59
|
}
|
|
@@ -42,7 +42,7 @@ exports.markdown = (0, styled_components_1.css) `
|
|
|
42
42
|
--md-table-line-height: var(--line-height-md); // @presenter FontSize
|
|
43
43
|
--md-table-margin-vertical: 20px; // @presenter Spacing
|
|
44
44
|
--md-table-bg-color: transparent; // @presenter Color
|
|
45
|
-
--md-table-border-radius: var(--border-radius);
|
|
45
|
+
--md-table-border-radius: var(--border-radius-xl);
|
|
46
46
|
|
|
47
47
|
--md-table-border-width: 1px;
|
|
48
48
|
--md-table-header-bg-color: var(--layer-color);
|
|
@@ -116,7 +116,7 @@ function MenuItemImpl(props) {
|
|
|
116
116
|
deprecated: item.deprecated,
|
|
117
117
|
httpVerb: item.httpVerb || '',
|
|
118
118
|
});
|
|
119
|
-
const label = item.label && (react_1.default.createElement(MenuItemLabelWrapper, { $active: item.active, $deprecated: item.deprecated, $depth: depth, $withChevron: hasChevron, $isSeparator: isSeparator, onClick: handleOnClick, onKeyDown: handleExpandOnEnter, ref: labelRef, role: item.link ? 'none' : 'link', tabIndex: !item.link ? 0 : undefined, "data-testid": "menu-item-label", "data-active": item.active },
|
|
119
|
+
const label = item.label && (react_1.default.createElement(MenuItemLabelWrapper, { $active: item.active, $deprecated: item.deprecated, $depth: depth, $withChevron: hasChevron, $isSeparator: isSeparator, onClick: handleOnClick, onKeyDown: handleExpandOnEnter, ref: labelRef, role: item.link || isSeparator ? 'none' : 'link', tabIndex: !item.link && !isSeparator ? 0 : undefined, "data-testid": "menu-item-label", "data-active": item.active },
|
|
120
120
|
hasChevron ? react_1.default.createElement(ChevronWrapper, null, chevron) : null,
|
|
121
121
|
react_1.default.createElement(MenuItemIcon, { icon: item.icon, srcSet: item.srcSet }),
|
|
122
122
|
react_1.default.createElement(MenuItemLabelTextWrapper, null,
|
|
@@ -58,7 +58,7 @@ exports.menu = (0, styled_components_1.css) `
|
|
|
58
58
|
--menu-item-label-margin: var(--menu-item-label-margin-vertical) var(--menu-item-label-margin-horizontal);
|
|
59
59
|
--menu-item-label-padding: var(--menu-item-padding-vertical) var(--menu-item-padding-horizontal);
|
|
60
60
|
--menu-item-label-gap: var(--spacing-xxs);
|
|
61
|
-
--menu-item-label-border-radius:
|
|
61
|
+
--menu-item-label-border-radius: var(--border-radius-lg);
|
|
62
62
|
--menu-item-label-chevron-size: 12px;
|
|
63
63
|
--menu-item-label-chevron-offset: calc(var(--menu-item-label-gap) + var(--menu-item-label-chevron-size));
|
|
64
64
|
|
|
@@ -29,7 +29,7 @@ exports.navbar = (0, styled_components_1.css) `
|
|
|
29
29
|
|
|
30
30
|
--navbar-item-line-height: var(--line-height-base);
|
|
31
31
|
--navbar-item-bg-color-active: var(--bg-color-active);
|
|
32
|
-
--navbar-item-border-radius: var(--border-radius);
|
|
32
|
+
--navbar-item-border-radius: var(--border-radius-lg);
|
|
33
33
|
--navbar-item-bottom-border: none;
|
|
34
34
|
|
|
35
35
|
--navbar-item-text-color-hover: var(--text-color-primary);
|
|
@@ -51,9 +51,8 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
51
51
|
const PageActionsMenuItem_1 = require("../../components/PageActions/PageActionsMenuItem");
|
|
52
52
|
const DropdownMenuItem_1 = require("../../components/Dropdown/DropdownMenuItem");
|
|
53
53
|
const Link_1 = require("../../components/Link/Link");
|
|
54
|
-
const ButtonGroup_1 = require("../../components/Button/ButtonGroup");
|
|
55
54
|
const Button_1 = require("../../components/Button/Button");
|
|
56
|
-
const
|
|
55
|
+
const SplitButton_1 = require("../../components/SplitButton/SplitButton");
|
|
57
56
|
const DropdownMenu_1 = require("../../components/Dropdown/DropdownMenu");
|
|
58
57
|
const Spinner_1 = require("../../icons/Spinner/Spinner");
|
|
59
58
|
const CheckmarkFilledIcon_1 = require("../../icons/CheckmarkFilledIcon/CheckmarkFilledIcon");
|
|
@@ -61,6 +60,8 @@ const hooks_1 = require("../../core/hooks");
|
|
|
61
60
|
const ACTION_DONE_DISPLAY_DURATION = 1000;
|
|
62
61
|
function PageActions(props) {
|
|
63
62
|
const { pageSlug, mcpUrl } = props;
|
|
63
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
64
|
+
const { translate } = useTranslate();
|
|
64
65
|
const actions = (0, hooks_1.usePageActions)(pageSlug || '/', mcpUrl, props.actions);
|
|
65
66
|
const [actionState, setActionState] = (0, react_1.useState)('idle');
|
|
66
67
|
if (!actions.length) {
|
|
@@ -86,10 +87,7 @@ function PageActions(props) {
|
|
|
86
87
|
return (react_1.default.createElement(StyledDropdownMenuItem, { key: key, onAction: () => handleActionClick(action) }, content));
|
|
87
88
|
});
|
|
88
89
|
return (react_1.default.createElement(PageActionsWrapper, { "data-component-name": "PageActions/PageActions" },
|
|
89
|
-
react_1.default.createElement(
|
|
90
|
-
react_1.default.createElement(Button_1.Button, { icon: renderIcon(buttonAction, actionState), to: 'link' in buttonAction ? buttonAction.link : undefined, external: true, onClick: () => handleActionClick(buttonAction) }, buttonAction.buttonText),
|
|
91
|
-
actions.length > 1 ? (react_1.default.createElement(Dropdown_1.Dropdown, { withArrow: true, portalled: true, trigger: react_1.default.createElement(Button_1.Button, { "aria-label": "More actions" }), placement: "bottom", alignment: "end" },
|
|
92
|
-
react_1.default.createElement(StyledDropdownMenu, null, menuItems))) : null)));
|
|
90
|
+
react_1.default.createElement(SplitButton_1.SplitButton, { portalled: true, variant: "outlined", size: "medium", toggleAriaLabel: translate('page.actions.moreActions', 'More actions'), button: react_1.default.createElement(Button_1.Button, { variant: "outlined", icon: renderIcon(buttonAction, actionState), to: 'link' in buttonAction ? buttonAction.link : undefined, external: true, onClick: () => handleActionClick(buttonAction) }, buttonAction.buttonText) }, actions.length > 1 ? react_1.default.createElement(StyledDropdownMenu, null, menuItems) : null)));
|
|
93
91
|
}
|
|
94
92
|
function renderIcon(buttonAction, actionState) {
|
|
95
93
|
switch (actionState) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
2
|
import type { PageAction } from '../../core/types';
|
|
3
|
-
type PageActionsMenuItemProps = {
|
|
3
|
+
export type PageActionsMenuItemProps = {
|
|
4
4
|
pageAction: PageAction;
|
|
5
|
+
className?: string;
|
|
5
6
|
};
|
|
6
|
-
export declare function PageActionsMenuItem(props: PageActionsMenuItemProps):
|
|
7
|
-
export {};
|
|
7
|
+
export declare function PageActionsMenuItem(props: PageActionsMenuItemProps): JSX.Element;
|
|
@@ -6,53 +6,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.PageActionsMenuItem = PageActionsMenuItem;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const DropdownMenuItemContent_1 = require("../../components/Dropdown/DropdownMenuItemContent");
|
|
9
10
|
const LaunchIcon_1 = require("../../icons/LaunchIcon/LaunchIcon");
|
|
10
11
|
function PageActionsMenuItem(props) {
|
|
11
|
-
const { pageAction } = props;
|
|
12
|
-
return (react_1.default.createElement(MenuItemWrapper, { "data-component-name": "PageActions/PageActionsMenuItem" },
|
|
13
|
-
react_1.default.createElement(
|
|
14
|
-
react_1.default.createElement(pageAction.iconComponent, null)),
|
|
15
|
-
react_1.default.createElement(ContentWrapper, null,
|
|
16
|
-
react_1.default.createElement(Title, null,
|
|
12
|
+
const { pageAction, className } = props;
|
|
13
|
+
return (react_1.default.createElement(MenuItemWrapper, { "data-component-name": "PageActions/PageActionsMenuItem", className: className },
|
|
14
|
+
react_1.default.createElement(DropdownMenuItemContent_1.DropdownMenuItemContent, { icon: react_1.default.createElement(pageAction.iconComponent, null), title: react_1.default.createElement(react_1.default.Fragment, null,
|
|
17
15
|
pageAction.title,
|
|
18
|
-
'link' in pageAction ? (react_1.default.createElement(LaunchIcon_1.LaunchIcon, { color: "var(--page-actions-menu-item-title-icon-color)", size: "14px" })) : null),
|
|
19
|
-
react_1.default.createElement(Description, null, pageAction.description))));
|
|
16
|
+
'link' in pageAction ? (react_1.default.createElement(LaunchIcon_1.LaunchIcon, { color: "var(--page-actions-menu-item-title-icon-color)", size: "14px" })) : null), description: pageAction.description })));
|
|
20
17
|
}
|
|
21
18
|
const MenuItemWrapper = styled_components_1.default.div `
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
font-weight: var(--page-actions-menu-item-title-font-weight);
|
|
45
|
-
font-size: var(--page-actions-menu-item-title-font-size);
|
|
46
|
-
line-height: var(--page-actions-menu-item-title-line-height);
|
|
47
|
-
color: var(--page-actions-menu-item-title-color);
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
gap: var(--page-actions-menu-item-title-icon-gap);
|
|
51
|
-
`;
|
|
52
|
-
const Description = styled_components_1.default.div `
|
|
53
|
-
font-weight: var(--page-actions-menu-item-description-font-weight);
|
|
54
|
-
font-size: var(--page-actions-menu-item-description-font-size);
|
|
55
|
-
line-height: var(--page-actions-menu-item-description-line-height);
|
|
56
|
-
color: var(--page-actions-menu-item-description-color);
|
|
19
|
+
--dropdown-menu-item-content-gap: var(--page-actions-menu-item-gap);
|
|
20
|
+
--dropdown-menu-item-content-padding: var(--page-actions-menu-item-padding);
|
|
21
|
+
--dropdown-menu-item-content-icon-size: var(--page-actions-menu-item-icon-wrapper-size);
|
|
22
|
+
--dropdown-menu-item-content-icon-color: var(--page-actions-menu-item-icon-color);
|
|
23
|
+
--dropdown-menu-item-content-icon-border: 1px solid var(--page-actions-menu-item-icon-border-color);
|
|
24
|
+
--dropdown-menu-item-content-icon-border-radius: var(--page-actions-menu-item-icon-border-radius);
|
|
25
|
+
--dropdown-menu-item-content-text-gap: var(--page-actions-menu-item-text-gap);
|
|
26
|
+
--dropdown-menu-item-content-title-icon-gap: var(--page-actions-menu-item-title-icon-gap);
|
|
27
|
+
--dropdown-menu-item-content-title-font-weight: var(--page-actions-menu-item-title-font-weight);
|
|
28
|
+
--dropdown-menu-item-content-title-font-size: var(--page-actions-menu-item-title-font-size);
|
|
29
|
+
--dropdown-menu-item-content-title-line-height: var(--page-actions-menu-item-title-line-height);
|
|
30
|
+
--dropdown-menu-item-content-title-color: var(--page-actions-menu-item-title-color);
|
|
31
|
+
--dropdown-menu-item-content-description-font-weight: var(
|
|
32
|
+
--page-actions-menu-item-description-font-weight
|
|
33
|
+
);
|
|
34
|
+
--dropdown-menu-item-content-description-font-size: var(
|
|
35
|
+
--page-actions-menu-item-description-font-size
|
|
36
|
+
);
|
|
37
|
+
--dropdown-menu-item-content-description-line-height: var(
|
|
38
|
+
--page-actions-menu-item-description-line-height
|
|
39
|
+
);
|
|
40
|
+
--dropdown-menu-item-content-description-color: var(--page-actions-menu-item-description-color);
|
|
57
41
|
`;
|
|
58
42
|
//# sourceMappingURL=PageActionsMenuItem.js.map
|
|
@@ -47,6 +47,11 @@ const ChevronRightIcon_1 = require("../../icons/ChevronRightIcon/ChevronRightIco
|
|
|
47
47
|
function Panel({ expanded = true, isExpandable = true, renderChildrenHidden = false, header, footer, className = 'panel-default', children, onToggle, description, }) {
|
|
48
48
|
const [isExpanded, setExpanded] = (0, react_1.useState)(expanded);
|
|
49
49
|
const [animate, setAnimate] = (0, react_1.useState)(false);
|
|
50
|
+
const [prevExpanded, setPrevExpanded] = (0, react_1.useState)(expanded);
|
|
51
|
+
if (prevExpanded !== expanded) {
|
|
52
|
+
setPrevExpanded(expanded);
|
|
53
|
+
setExpanded(expanded);
|
|
54
|
+
}
|
|
50
55
|
const toggle = ({ target }) => {
|
|
51
56
|
if (target instanceof HTMLAnchorElement || !isExpandable)
|
|
52
57
|
return;
|
|
@@ -54,7 +59,6 @@ function Panel({ expanded = true, isExpandable = true, renderChildrenHidden = fa
|
|
|
54
59
|
setExpanded(!isExpanded);
|
|
55
60
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(!isExpanded);
|
|
56
61
|
};
|
|
57
|
-
(0, react_1.useEffect)(() => setExpanded(expanded), [expanded]);
|
|
58
62
|
return (react_1.default.createElement(PanelWrapper, { className: className, "data-testid": typeof header === 'string' ? ('panel-' + header).replace(/ /g, '-').toLowerCase() : null, "data-component-name": "Panel/Panel" },
|
|
59
63
|
header &&
|
|
60
64
|
(typeof header === 'function' ? (header({ expanded: isExpanded, toggle })) : (react_1.default.createElement(PanelHeader_1.PanelHeader, { "data-testid": "panel-header", toggle: toggle, expanded: isExpanded, isExpandable: isExpandable },
|
|
@@ -179,7 +179,7 @@ exports.apiReferencePanels = (0, styled_components_1.css) `
|
|
|
179
179
|
* @tokens Panel common
|
|
180
180
|
*/
|
|
181
181
|
|
|
182
|
-
--panel-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
182
|
+
--panel-border-radius: var(--border-radius-xl); // @presenter BorderRadius
|
|
183
183
|
--panel-border: 1px solid var(--border-color-secondary); // @presenter Border
|
|
184
184
|
|
|
185
185
|
--panel-line-height: var(--line-height-base); // @presenter LineHeight
|