@redocly/theme 0.61.1 → 0.62.0-custom.1
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/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.d.ts +1 -0
- package/lib/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.js +12 -0
- package/lib/components/Badge/Badge.d.ts +2 -1
- package/lib/components/Badge/Badge.js +24 -2
- package/lib/components/Banner/Banner.js +19 -1
- package/lib/components/Banner/variables.js +1 -0
- package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
- package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +9 -6
- package/lib/components/Breadcrumbs/Breadcrumbs.js +24 -15
- package/lib/components/Buttons/AIAssistantButton.js +7 -4
- package/lib/components/Buttons/EditPageButton.js +4 -26
- package/lib/components/Catalog/CatalogEntities.js +10 -8
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +6 -13
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +13 -11
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +7 -5
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +9 -7
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +1 -1
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +2 -2
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +1 -1
- package/lib/components/CodeBlock/CodeBlockControls.js +8 -6
- package/lib/components/Dropdown/Dropdown.js +1 -1
- package/lib/components/Dropdown/variables.js +1 -0
- package/lib/components/Feedback/Comment.js +17 -4
- package/lib/components/Feedback/Mood.js +6 -3
- package/lib/components/Feedback/Rating.js +6 -3
- package/lib/components/Feedback/Scale.js +6 -3
- package/lib/components/Feedback/Sentiment.js +6 -3
- package/lib/components/Filter/FilterCheckboxes.js +1 -1
- package/lib/components/JsonViewer/JsonViewer.js +2 -2
- package/lib/components/JsonViewer/{Helpers.js → helpers.js} +2 -1
- package/lib/components/LanguagePicker/LanguagePicker.js +1 -1
- package/lib/components/Markdown/Markdown.js +2 -2
- package/lib/components/Menu/MenuItem.js +41 -15
- package/lib/components/Menu/variables.js +3 -3
- package/lib/components/Navbar/NavbarItem.js +1 -1
- package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.js +12 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +6 -0
- package/lib/components/PageActions/PageActions.js +25 -8
- package/lib/components/Search/SearchAiDialog.d.ts +4 -2
- package/lib/components/Search/SearchAiDialog.js +23 -4
- package/lib/components/Search/SearchAiMessage.d.ts +4 -2
- package/lib/components/Search/SearchAiMessage.js +82 -23
- package/lib/components/Search/SearchDialog.js +50 -25
- package/lib/components/Select/variables.js +2 -2
- package/lib/components/SvgViewer/SvgViewer.d.ts +15 -0
- package/lib/components/SvgViewer/SvgViewer.js +312 -0
- package/lib/components/SvgViewer/variables.d.ts +1 -0
- package/lib/components/SvgViewer/variables.dark.d.ts +1 -0
- package/lib/components/SvgViewer/variables.dark.js +8 -0
- package/lib/components/SvgViewer/variables.js +17 -0
- package/lib/components/Tag/Tag.js +1 -1
- package/lib/components/Tag/variables.dark.js +6 -0
- package/lib/components/Tag/variables.js +6 -0
- package/lib/components/Tooltip/Tooltip.d.ts +2 -3
- package/lib/components/Tooltip/Tooltip.js +66 -113
- package/lib/components/Tooltip/variables.dark.js +4 -0
- package/lib/components/Tooltip/variables.js +3 -3
- package/lib/components/UserMenu/LoginButton.d.ts +8 -2
- package/lib/components/UserMenu/LoginButton.js +4 -3
- package/lib/core/constants/feedback.d.ts +2 -0
- package/lib/core/constants/feedback.js +6 -0
- package/lib/core/constants/index.d.ts +1 -0
- package/lib/core/constants/index.js +1 -0
- package/lib/core/constants/search.d.ts +5 -1
- package/lib/core/constants/search.js +24 -1
- package/lib/core/hooks/search/use-search-dialog.js +2 -2
- package/lib/core/hooks/use-color-switcher.js +3 -1
- package/lib/core/hooks/use-mcp-config.js +2 -1
- package/lib/core/hooks/use-modal-scroll-lock.js +24 -10
- package/lib/core/hooks/use-outside-click.d.ts +3 -1
- package/lib/core/hooks/use-outside-click.js +8 -4
- package/lib/core/hooks/use-page-actions.d.ts +1 -1
- package/lib/core/hooks/use-page-actions.js +50 -14
- package/lib/core/hooks/use-product-picker.js +1 -1
- package/lib/core/hooks/use-unique-svg-ids.d.ts +6 -0
- package/lib/core/hooks/use-unique-svg-ids.js +15 -0
- package/lib/core/openapi/index.d.ts +2 -0
- package/lib/core/openapi/index.js +5 -1
- package/lib/core/styles/dark.js +13 -0
- package/lib/core/styles/global.js +38 -15
- package/lib/core/types/catalog.d.ts +1 -1
- package/lib/core/types/hooks.d.ts +23 -2
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +24 -0
- package/lib/core/types/search.js +9 -1
- package/lib/core/utils/content-segments.d.ts +2 -0
- package/lib/core/utils/content-segments.js +22 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/transform-revisions-to-version-history.js +18 -68
- package/lib/ext/process-scorecard.d.ts +49 -0
- package/lib/ext/process-scorecard.js +12 -0
- package/lib/icons/DirectionRightIcon/DirectionRightIcon.d.ts +5 -0
- package/lib/icons/DirectionRightIcon/DirectionRightIcon.js +24 -0
- package/lib/icons/FitToViewIcon/FitToViewIcon.d.ts +9 -0
- package/lib/icons/FitToViewIcon/FitToViewIcon.js +25 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +8 -0
- package/lib/layouts/DocumentationLayout.js +4 -25
- package/lib/layouts/DocumentationLayoutBottom.d.ts +11 -0
- package/lib/layouts/DocumentationLayoutBottom.js +28 -0
- package/lib/layouts/DocumentationLayoutTop.d.ts +13 -0
- package/lib/layouts/DocumentationLayoutTop.js +33 -0
- package/lib/layouts/Forbidden.js +22 -18
- package/lib/markdoc/components/Cards/Card.js +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
- package/lib/markdoc/components/Heading/Heading.js +40 -2
- package/lib/markdoc/components/LoginButton/LoginButton.d.ts +9 -0
- package/lib/markdoc/components/LoginButton/LoginButton.js +48 -0
- package/lib/markdoc/components/Mermaid/Mermaid.js +70 -2
- package/lib/markdoc/components/default.d.ts +1 -0
- package/lib/markdoc/components/default.js +1 -0
- package/lib/markdoc/default.d.ts +6 -0
- package/lib/markdoc/default.js +2 -0
- package/lib/markdoc/tags/login-button.d.ts +2 -0
- package/lib/markdoc/tags/login-button.js +32 -0
- package/package.json +10 -10
- package/src/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.tsx +10 -0
- package/src/components/Badge/Badge.tsx +18 -2
- package/src/components/Banner/Banner.tsx +23 -1
- package/src/components/Banner/variables.ts +1 -0
- package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -3
- package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +11 -8
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +24 -15
- package/src/components/Buttons/AIAssistantButton.tsx +7 -4
- package/src/components/Buttons/EditPageButton.tsx +13 -34
- package/src/components/Catalog/CatalogEntities.tsx +10 -8
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +3 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +5 -21
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +13 -11
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +7 -5
- package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +9 -7
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +1 -2
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +9 -5
- package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +3 -1
- package/src/components/CodeBlock/CodeBlockControls.tsx +16 -10
- package/src/components/Dropdown/Dropdown.tsx +1 -1
- package/src/components/Dropdown/variables.ts +1 -0
- package/src/components/Feedback/Comment.tsx +22 -4
- package/src/components/Feedback/Mood.tsx +6 -2
- package/src/components/Feedback/Rating.tsx +6 -2
- package/src/components/Feedback/Scale.tsx +6 -2
- package/src/components/Feedback/Sentiment.tsx +6 -2
- package/src/components/Filter/FilterCheckboxes.tsx +1 -1
- package/src/components/JsonViewer/JsonViewer.tsx +1 -2
- package/src/components/JsonViewer/{Helpers.tsx → helpers.tsx} +1 -0
- package/src/components/LanguagePicker/LanguagePicker.tsx +1 -1
- package/src/components/Markdown/Markdown.tsx +2 -2
- package/src/components/Menu/MenuItem.tsx +61 -16
- package/src/components/Menu/variables.ts +3 -3
- package/src/components/Navbar/NavbarItem.tsx +3 -1
- package/src/components/OpenApiDocs/hooks/AdditionalOverviewInfo.tsx +10 -0
- package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +2 -0
- package/src/components/PageActions/PageActions.tsx +38 -15
- package/src/components/Search/SearchAiDialog.tsx +31 -2
- package/src/components/Search/SearchAiMessage.tsx +103 -17
- package/src/components/Search/SearchDialog.tsx +70 -37
- package/src/components/Select/variables.ts +2 -2
- package/src/components/SvgViewer/SvgViewer.tsx +405 -0
- package/src/components/SvgViewer/variables.dark.ts +5 -0
- package/src/components/SvgViewer/variables.ts +14 -0
- package/src/components/Tag/Tag.tsx +2 -1
- package/src/components/Tag/variables.dark.ts +6 -0
- package/src/components/Tag/variables.ts +6 -0
- package/src/components/Tooltip/Tooltip.tsx +77 -120
- package/src/components/Tooltip/variables.dark.ts +4 -0
- package/src/components/Tooltip/variables.ts +3 -3
- package/src/components/UserMenu/LoginButton.tsx +23 -8
- package/src/core/constants/feedback.ts +2 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/constants/search.ts +27 -1
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +10 -1
- package/src/core/hooks/search/use-search-dialog.ts +2 -2
- package/src/core/hooks/use-color-switcher.ts +3 -1
- package/src/core/hooks/use-mcp-config.ts +2 -1
- package/src/core/hooks/use-modal-scroll-lock.ts +29 -10
- package/src/core/hooks/use-outside-click.ts +16 -5
- package/src/core/hooks/use-page-actions.ts +77 -30
- package/src/core/hooks/use-product-picker.ts +1 -1
- package/src/core/hooks/use-unique-svg-ids.ts +12 -0
- package/src/core/openapi/index.ts +2 -0
- package/src/core/styles/dark.ts +14 -0
- package/src/core/styles/global.ts +38 -15
- package/src/core/types/catalog.ts +1 -1
- package/src/core/types/hooks.ts +29 -1
- package/src/core/types/l10n.ts +13 -1
- package/src/core/types/search.ts +19 -0
- package/src/core/utils/content-segments.ts +27 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/transform-revisions-to-version-history.ts +19 -99
- package/src/ext/process-scorecard.ts +59 -0
- package/src/icons/DirectionRightIcon/DirectionRightIcon.tsx +35 -0
- package/src/icons/FitToViewIcon/FitToViewIcon.tsx +26 -0
- package/src/index.ts +8 -0
- package/src/layouts/DocumentationLayout.tsx +4 -30
- package/src/layouts/DocumentationLayoutBottom.tsx +42 -0
- package/src/layouts/DocumentationLayoutTop.tsx +52 -0
- package/src/layouts/Forbidden.tsx +36 -21
- package/src/markdoc/components/Cards/Card.tsx +1 -0
- package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
- package/src/markdoc/components/Heading/Heading.tsx +52 -4
- package/src/markdoc/components/LoginButton/LoginButton.tsx +38 -0
- package/src/markdoc/components/Mermaid/Mermaid.tsx +57 -8
- package/src/markdoc/components/default.ts +1 -0
- package/src/markdoc/default.ts +2 -0
- package/src/markdoc/tags/login-button.ts +30 -0
- package/lib/components/Tooltip/TooltipWrapper.d.ts +0 -12
- package/lib/components/Tooltip/TooltipWrapper.js +0 -34
- package/src/components/Tooltip/TooltipWrapper.tsx +0 -70
- /package/lib/components/JsonViewer/{Helpers.d.ts → helpers.d.ts} +0 -0
|
@@ -39,23 +39,27 @@ const styled_components_1 = __importStar(require("styled-components"));
|
|
|
39
39
|
const hooks_1 = require("../../core/hooks");
|
|
40
40
|
const RadioCheckButtonIcon_1 = require("../../icons/RadioCheckButtonIcon/RadioCheckButtonIcon");
|
|
41
41
|
const Button_1 = require("../../components/Button/Button");
|
|
42
|
+
const constants_1 = require("../../core/constants");
|
|
42
43
|
function Comment({ settings, onSubmit, onCancel, className, standAlone = true, isDialog = false, }) {
|
|
43
44
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
44
45
|
const { translate } = useTranslate();
|
|
45
46
|
const { label, submitText } = settings || {};
|
|
46
47
|
const [text, setText] = react_1.default.useState('');
|
|
47
48
|
const [submitValue, setSubmitValue] = react_1.default.useState('');
|
|
49
|
+
const [isMaxLengthReached, setIsMaxLengthReached] = react_1.default.useState(false);
|
|
48
50
|
const modalRef = (0, react_1.useRef)(null);
|
|
49
51
|
(0, hooks_1.useOutsideClick)(modalRef, onCancel);
|
|
50
52
|
const send = () => {
|
|
51
|
-
|
|
53
|
+
const trimmedText = text.trim();
|
|
54
|
+
if (!trimmedText)
|
|
52
55
|
return;
|
|
53
|
-
setSubmitValue(
|
|
54
|
-
onSubmit({ comment:
|
|
56
|
+
setSubmitValue(trimmedText);
|
|
57
|
+
onSubmit({ comment: trimmedText });
|
|
55
58
|
};
|
|
56
59
|
const handleTextAreaChange = (e) => {
|
|
57
60
|
const commentValue = e.target.value;
|
|
58
61
|
setText(commentValue);
|
|
62
|
+
setIsMaxLengthReached(commentValue.length >= constants_1.MAX_CONTEXT_LENGTH);
|
|
59
63
|
if (!standAlone) {
|
|
60
64
|
onSubmit({ comment: commentValue });
|
|
61
65
|
}
|
|
@@ -70,7 +74,11 @@ function Comment({ settings, onSubmit, onCancel, className, standAlone = true, i
|
|
|
70
74
|
return (react_1.default.createElement(CommentWrapper, { ref: modalRef, "data-component-name": "Feedback/Comment", className: className, style: standAlone ? { width: 'var(--feedback-report-dialog-width)' } : { width: 'auto' } },
|
|
71
75
|
react_1.default.createElement(Label, { "data-translation-key": "feedback.settings.comment.label", standAlone: standAlone }, label ||
|
|
72
76
|
translate('feedback.settings.comment.label', 'Please share your feedback with us.')),
|
|
73
|
-
react_1.default.createElement(TextArea, { rows: 3, onChange: handleTextAreaChange }),
|
|
77
|
+
react_1.default.createElement(TextArea, { rows: 3, maxLength: constants_1.MAX_CONTEXT_LENGTH, onChange: handleTextAreaChange }),
|
|
78
|
+
isMaxLengthReached && (react_1.default.createElement(MaxLengthMessage, { "data-translation-key": "feedback.settings.comment.maxLength" }, translate('feedback.settings.comment.maxLength', {
|
|
79
|
+
maxLength: constants_1.MAX_CONTEXT_LENGTH,
|
|
80
|
+
defaultValue: `Maximum content length of ${constants_1.MAX_CONTEXT_LENGTH} characters reached`,
|
|
81
|
+
}))),
|
|
74
82
|
standAlone && (react_1.default.createElement(ButtonsContainer, null,
|
|
75
83
|
onCancel && (react_1.default.createElement(Button_1.Button, { "data-translation-key": "feedback.settings.comment.cancel", onClick: onCancel, variant: "text", size: "small" }, translate('feedback.settings.comment.cancel', 'Cancel'))),
|
|
76
84
|
react_1.default.createElement(Button_1.Button, { "data-translation-key": "feedback.settings.comment.send", onClick: send, variant: isDialog ? 'primary' : 'secondary', size: "small" }, translate('feedback.settings.comment.send', 'Send'))))));
|
|
@@ -136,4 +144,9 @@ const ButtonsContainer = styled_components_1.default.div `
|
|
|
136
144
|
margin-top: var(--spacing-xs);
|
|
137
145
|
gap: var(--spacing-xs);
|
|
138
146
|
`;
|
|
147
|
+
const MaxLengthMessage = styled_components_1.default.div `
|
|
148
|
+
font-size: var(--font-size-sm);
|
|
149
|
+
color: var(--text-color-secondary);
|
|
150
|
+
margin-top: var(--spacing-xxs);
|
|
151
|
+
`;
|
|
139
152
|
//# sourceMappingURL=Comment.js.map
|
|
@@ -46,6 +46,7 @@ const Button_1 = require("../../components/Button/Button");
|
|
|
46
46
|
const FaceDissatisfiedIcon_1 = require("../../icons/FaceDissatisfiedIcon/FaceDissatisfiedIcon");
|
|
47
47
|
const FaceSatisfiedIcon_1 = require("../../icons/FaceSatisfiedIcon/FaceSatisfiedIcon");
|
|
48
48
|
const FaceNeutralIcon_1 = require("../../icons/FaceNeutralIcon/FaceNeutralIcon");
|
|
49
|
+
const constants_1 = require("../../core/constants");
|
|
49
50
|
var MOOD_STATES;
|
|
50
51
|
(function (MOOD_STATES) {
|
|
51
52
|
MOOD_STATES["SATISFIED"] = "satisfied";
|
|
@@ -118,11 +119,13 @@ function Mood({ settings, onSubmit, className }) {
|
|
|
118
119
|
const displaySubmitBnt = !!(score && (displayReasons || displayComment));
|
|
119
120
|
const displayFeedbackEmail = !!score && !(optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.hide) && !userData.isAuthenticated;
|
|
120
121
|
const onSubmitMoodForm = () => {
|
|
122
|
+
const trimmedComment = (comment === null || comment === void 0 ? void 0 : comment.trim()) || undefined;
|
|
123
|
+
const trimmedEmail = (email === null || email === void 0 ? void 0 : email.trim()) || undefined;
|
|
121
124
|
onSubmit({
|
|
122
125
|
score: remapScore(score),
|
|
123
|
-
comment,
|
|
126
|
+
comment: trimmedComment,
|
|
124
127
|
reasons,
|
|
125
|
-
email,
|
|
128
|
+
email: trimmedEmail,
|
|
126
129
|
});
|
|
127
130
|
setIsSubmitted(true);
|
|
128
131
|
};
|
|
@@ -170,7 +173,7 @@ function Mood({ settings, onSubmit, className }) {
|
|
|
170
173
|
React.createElement(InputLabel, { "data-translation-key": "feedback.settings.optionalEmail.label" }, (optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.label) ||
|
|
171
174
|
translate('feedback.settings.optionalEmail.label', 'Your email (optional, for follow-up)')),
|
|
172
175
|
React.createElement(EmailInput, { onChange: onEmailChange, placeholder: (optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.placeholder) ||
|
|
173
|
-
translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com'), type: "email", required: !!email, onKeyDown: (e) => {
|
|
176
|
+
translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com'), type: "email", maxLength: constants_1.MAX_EMAIL_LENGTH, required: !!email, onKeyDown: (e) => {
|
|
174
177
|
if (e.key === 'Enter') {
|
|
175
178
|
e.preventDefault();
|
|
176
179
|
onSubmitMoodForm();
|
|
@@ -47,6 +47,7 @@ const RadioCheckButtonIcon_1 = require("../../icons/RadioCheckButtonIcon/RadioCh
|
|
|
47
47
|
const Comment_1 = require("../../components/Feedback/Comment");
|
|
48
48
|
const Stars_1 = require("../../components/Feedback/Stars");
|
|
49
49
|
const Button_1 = require("../../components/Button/Button");
|
|
50
|
+
const constants_1 = require("../../core/constants");
|
|
50
51
|
exports.FEEDBACK_MAX_RATING = 5;
|
|
51
52
|
function Rating({ settings, onSubmit, className }) {
|
|
52
53
|
const { label, submitText, comment: commentSettings, reasons: reasonsSettings, optionalEmail: optionalEmailSettings, } = settings || {};
|
|
@@ -63,12 +64,14 @@ function Rating({ settings, onSubmit, className }) {
|
|
|
63
64
|
setEmail(value || undefined);
|
|
64
65
|
};
|
|
65
66
|
const onSubmitRatingForm = () => {
|
|
67
|
+
const trimmedComment = (comment === null || comment === void 0 ? void 0 : comment.trim()) || undefined;
|
|
68
|
+
const trimmedEmail = (email === null || email === void 0 ? void 0 : email.trim()) || undefined;
|
|
66
69
|
onSubmit({
|
|
67
70
|
score,
|
|
68
|
-
comment,
|
|
71
|
+
comment: trimmedComment,
|
|
69
72
|
reasons,
|
|
70
73
|
max: exports.FEEDBACK_MAX_RATING,
|
|
71
|
-
email,
|
|
74
|
+
email: trimmedEmail,
|
|
72
75
|
});
|
|
73
76
|
setIsSubmitted(true);
|
|
74
77
|
};
|
|
@@ -115,7 +118,7 @@ function Rating({ settings, onSubmit, className }) {
|
|
|
115
118
|
React.createElement(InputLabel, { "data-translation-key": "feedback.settings.optionalEmail.label" }, (optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.label) ||
|
|
116
119
|
translate('feedback.settings.optionalEmail.label', 'Your email (optional, for follow-up)')),
|
|
117
120
|
React.createElement(EmailInput, { onChange: onEmailChange, placeholder: (optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.placeholder) ||
|
|
118
|
-
translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com'), type: "email", required: !!email, onKeyDown: (e) => {
|
|
121
|
+
translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com'), type: "email", maxLength: constants_1.MAX_EMAIL_LENGTH, required: !!email, onKeyDown: (e) => {
|
|
119
122
|
if (e.key === 'Enter') {
|
|
120
123
|
e.preventDefault();
|
|
121
124
|
onSubmitRatingForm();
|
|
@@ -47,6 +47,7 @@ const RadioCheckButtonIcon_1 = require("../../icons/RadioCheckButtonIcon/RadioCh
|
|
|
47
47
|
const Comment_1 = require("../../components/Feedback/Comment");
|
|
48
48
|
const Reasons_1 = require("../../components/Feedback/Reasons");
|
|
49
49
|
const Button_1 = require("../../components/Button/Button");
|
|
50
|
+
const constants_1 = require("../../core/constants");
|
|
50
51
|
exports.MAX_SCALE = 10;
|
|
51
52
|
function Scale({ settings, onSubmit, className }) {
|
|
52
53
|
const { label, submitText, leftScaleLabel, rightScaleLabel, comment: commentSettings, reasons: reasonsSettings, optionalEmail: optionalEmailSettings, } = settings || {};
|
|
@@ -77,12 +78,14 @@ function Scale({ settings, onSubmit, className }) {
|
|
|
77
78
|
setEmail(undefined);
|
|
78
79
|
};
|
|
79
80
|
const onSubmitScaleForm = () => {
|
|
81
|
+
const trimmedComment = (comment === null || comment === void 0 ? void 0 : comment.trim()) || undefined;
|
|
82
|
+
const trimmedEmail = (email === null || email === void 0 ? void 0 : email.trim()) || undefined;
|
|
80
83
|
onSubmit({
|
|
81
84
|
score,
|
|
82
|
-
comment,
|
|
85
|
+
comment: trimmedComment,
|
|
83
86
|
reasons,
|
|
84
87
|
max: exports.MAX_SCALE,
|
|
85
|
-
email,
|
|
88
|
+
email: trimmedEmail,
|
|
86
89
|
});
|
|
87
90
|
setIsSubmitted(true);
|
|
88
91
|
};
|
|
@@ -122,7 +125,7 @@ function Scale({ settings, onSubmit, className }) {
|
|
|
122
125
|
React.createElement(InputLabel, { "data-translation-key": "feedback.settings.optionalEmail.label" }, (optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.label) ||
|
|
123
126
|
translate('feedback.settings.optionalEmail.label', 'Your email (optional, for follow-up)')),
|
|
124
127
|
React.createElement(EmailInput, { onChange: onEmailChange, placeholder: (optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.placeholder) ||
|
|
125
|
-
translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com'), type: "email", required: !!email, onKeyDown: (e) => {
|
|
128
|
+
translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com'), type: "email", maxLength: constants_1.MAX_EMAIL_LENGTH, required: !!email, onKeyDown: (e) => {
|
|
126
129
|
if (e.key === 'Enter') {
|
|
127
130
|
e.preventDefault();
|
|
128
131
|
onSubmitScaleForm();
|
|
@@ -47,6 +47,7 @@ const Comment_1 = require("../../components/Feedback/Comment");
|
|
|
47
47
|
const Button_1 = require("../../components/Button/Button");
|
|
48
48
|
const ThumbDownIcon_1 = require("../../icons/ThumbDownIcon/ThumbDownIcon");
|
|
49
49
|
const ThumbUpIcon_1 = require("../../icons/ThumbUpIcon/ThumbUpIcon");
|
|
50
|
+
const constants_1 = require("../../core/constants");
|
|
50
51
|
function Sentiment({ settings, onSubmit, className }) {
|
|
51
52
|
const { label, submitText, comment: commentSettings, reasons: reasonsSettings, optionalEmail: optionalEmailSettings, } = settings || {};
|
|
52
53
|
const [isSubmitted, setIsSubmitted] = React.useState(false);
|
|
@@ -105,11 +106,13 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
105
106
|
return scoreSpecificReasonSettings === null || scoreSpecificReasonSettings === void 0 ? void 0 : scoreSpecificReasonSettings.component;
|
|
106
107
|
};
|
|
107
108
|
const onSubmitSentimentForm = () => {
|
|
109
|
+
const trimmedComment = (comment === null || comment === void 0 ? void 0 : comment.trim()) || undefined;
|
|
110
|
+
const trimmedEmail = (email === null || email === void 0 ? void 0 : email.trim()) || undefined;
|
|
108
111
|
onSubmit({
|
|
109
112
|
score,
|
|
110
|
-
comment,
|
|
113
|
+
comment: trimmedComment,
|
|
111
114
|
reasons,
|
|
112
|
-
email,
|
|
115
|
+
email: trimmedEmail,
|
|
113
116
|
});
|
|
114
117
|
setIsSubmitted(true);
|
|
115
118
|
};
|
|
@@ -154,7 +157,7 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
154
157
|
React.createElement(InputLabel, { "data-translation-key": "feedback.settings.optionalEmail.label" }, (optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.label) ||
|
|
155
158
|
translate('feedback.settings.optionalEmail.label', 'Your email (optional, for follow-up)')),
|
|
156
159
|
React.createElement(EmailInput, { onChange: onEmailChange, placeholder: (optionalEmailSettings === null || optionalEmailSettings === void 0 ? void 0 : optionalEmailSettings.placeholder) ||
|
|
157
|
-
translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com'), type: "email", required: !!email, onKeyDown: (e) => {
|
|
160
|
+
translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com'), type: "email", maxLength: constants_1.MAX_EMAIL_LENGTH, required: !!email, onKeyDown: (e) => {
|
|
158
161
|
if (e.key === 'Enter') {
|
|
159
162
|
e.preventDefault();
|
|
160
163
|
onSubmitSentimentForm();
|
|
@@ -24,7 +24,7 @@ function FilterCheckboxes({ filter, filterValuesCasing, showCounter = true, }) {
|
|
|
24
24
|
const id = 'filter--' + filter.property + '--' + value;
|
|
25
25
|
return (react_1.default.createElement(FilterCheckboxOption, { key: id, role: "link", onClick: () => {
|
|
26
26
|
filter.toggleOption(value);
|
|
27
|
-
telemetry.sendFilterCheckboxToggledMessage({ id });
|
|
27
|
+
telemetry.sendFilterCheckboxToggledMessage([{ object: 'checkbox', id }]);
|
|
28
28
|
} },
|
|
29
29
|
react_1.default.createElement(CheckboxIcon_1.CheckboxIcon, { checked: filter.selectedOptions instanceof Set
|
|
30
30
|
? filter.selectedOptions.has(value) ||
|
|
@@ -40,7 +40,7 @@ exports.JsonViewerWrap = exports.JsonViewer = void 0;
|
|
|
40
40
|
const react_1 = __importStar(require("react"));
|
|
41
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
42
|
const CodeBlock_1 = require("../../components/CodeBlock/CodeBlock");
|
|
43
|
-
const
|
|
43
|
+
const helpers_1 = require("../../components/JsonViewer/helpers");
|
|
44
44
|
function JsonComponent({ data, expandLevel = 1, className, onCopyClick, onPanelToggle, title, controls = {}, }) {
|
|
45
45
|
const showFoldingButtons = data && Object.values(data).some((value) => typeof value === 'object' && value !== null);
|
|
46
46
|
const [expandAllSignal, setExpandAllSignal] = react_1.default.useState(undefined);
|
|
@@ -71,7 +71,7 @@ function JsonComponent({ data, expandLevel = 1, className, onCopyClick, onPanelT
|
|
|
71
71
|
}
|
|
72
72
|
: undefined, source: source },
|
|
73
73
|
react_1.default.createElement(FoldingWrap, null,
|
|
74
|
-
react_1.default.createElement(
|
|
74
|
+
react_1.default.createElement(helpers_1.JsonValue, { value: data, level: 0, standalone: true, expandAllSignal: expandAllSignal, defaultExpandLevel: Math.max(1, expandLevel) })))));
|
|
75
75
|
}
|
|
76
76
|
exports.JsonViewer = (0, react_1.memo)(JsonComponent);
|
|
77
77
|
const FoldingWrap = styled_components_1.default.div `
|
|
@@ -37,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.JsonValue = JsonValue;
|
|
40
|
+
/* eslint-disable check-file/filename-naming-convention */
|
|
40
41
|
const react_1 = __importStar(require("react"));
|
|
41
42
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
43
|
const Button_1 = require("../../components/Button/Button");
|
|
@@ -137,4 +138,4 @@ const ExpandButton = (0, styled_components_1.default)(Button_1.Button) `
|
|
|
137
138
|
margin-left: 0;
|
|
138
139
|
}
|
|
139
140
|
`;
|
|
140
|
-
//# sourceMappingURL=
|
|
141
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -26,7 +26,7 @@ function LanguagePicker(props) {
|
|
|
26
26
|
onAction: () => {
|
|
27
27
|
setLocale(locale.code);
|
|
28
28
|
props.onChangeLanguage(locale.code);
|
|
29
|
-
telemetry.sendLanguagePickerLocaleChangedMessage({ locale: locale.code });
|
|
29
|
+
telemetry.sendLanguagePickerLocaleChangedMessage([{ object: 'locale', locale: locale.code }]);
|
|
30
30
|
},
|
|
31
31
|
active: locale.code === currentLocale.code,
|
|
32
32
|
suffix: locale.code === currentLocale.code && react_1.default.createElement(CheckmarkIcon_1.CheckmarkIcon, null),
|
|
@@ -77,7 +77,7 @@ exports.Markdown = styled_components_1.default.main.attrs(({ className }) => ({
|
|
|
77
77
|
${links_1.markdownLinksCss}
|
|
78
78
|
|
|
79
79
|
a[name], [id] {
|
|
80
|
-
scroll-margin-top: var(--navbar-height);
|
|
80
|
+
scroll-margin-top: calc(var(--navbar-height) + var(--banner-height));
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
img,
|
|
@@ -95,7 +95,7 @@ exports.Markdown = styled_components_1.default.main.attrs(({ className }) => ({
|
|
|
95
95
|
font-family: var(--heading-font-family);
|
|
96
96
|
position: relative;
|
|
97
97
|
|
|
98
|
-
scroll-margin-top: var(--navbar-height);
|
|
98
|
+
scroll-margin-top: calc(var(--navbar-height) + var(--banner-height));
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
strong {
|
|
@@ -45,10 +45,10 @@ const HttpTag_1 = require("../../components/Tags/HttpTag");
|
|
|
45
45
|
const constants_1 = require("../../core/constants");
|
|
46
46
|
const utils_1 = require("../../core/utils");
|
|
47
47
|
const ArrowRightIcon_1 = require("../../icons/ArrowRightIcon/ArrowRightIcon");
|
|
48
|
-
const Badge_1 = require("../../components/Badge/Badge");
|
|
49
48
|
const GenericIcon_1 = require("../../icons/GenericIcon/GenericIcon");
|
|
49
|
+
const Tag_1 = require("../../components/Tag/Tag");
|
|
50
50
|
function MenuItem(props) {
|
|
51
|
-
var _a;
|
|
51
|
+
var _a, _b;
|
|
52
52
|
const { item, depth, className, onClick } = props;
|
|
53
53
|
const { useTranslate, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
54
54
|
const { translate } = useTranslate();
|
|
@@ -65,10 +65,13 @@ function MenuItem(props) {
|
|
|
65
65
|
const hasChevron = isNested && !isDrilldown;
|
|
66
66
|
const hasHttpTag = !!item.httpVerb || type === constants_1.MenuItemType.Operation;
|
|
67
67
|
const handleOnClick = () => {
|
|
68
|
-
telemetry.sendSidebarItemClickedMessage(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
telemetry.sendSidebarItemClickedMessage([
|
|
69
|
+
{
|
|
70
|
+
object: 'sidebar_item',
|
|
71
|
+
label: item.label,
|
|
72
|
+
type: item.type === 'link' || item.type === 'group' ? item.type : undefined,
|
|
73
|
+
},
|
|
74
|
+
]);
|
|
72
75
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
73
76
|
if (isNested) {
|
|
74
77
|
handleExpand();
|
|
@@ -89,9 +92,10 @@ function MenuItem(props) {
|
|
|
89
92
|
hasChevron ? react_1.default.createElement(ChevronWrapper, null, chevron) : null,
|
|
90
93
|
react_1.default.createElement(MenuItemIcon, { icon: item.icon, srcSet: item.srcSet }),
|
|
91
94
|
react_1.default.createElement(MenuItemLabelTextWrapper, null,
|
|
92
|
-
react_1.default.createElement(MenuItemLabel, null,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
react_1.default.createElement(MenuItemLabel, null, (_a = item.badges) === null || _a === void 0 ? void 0 :
|
|
96
|
+
_a.filter(({ position }) => position === 'before').map(({ name, color, icon }) => (react_1.default.createElement(SidebarTag, { color: isDirectColorValue(color) ? undefined : color, "$bgColor": isDirectColorValue(color) ? color : undefined, key: name, icon: icon && react_1.default.createElement(BadgeIcon, { icon: icon }) }, name))),
|
|
97
|
+
react_1.default.createElement("span", null, translate(item.labelTranslationKey, item.label)), (_b = item.badges) === null || _b === void 0 ? void 0 :
|
|
98
|
+
_b.filter(({ position }) => position !== 'before').map(({ name, color, icon }) => (react_1.default.createElement(SidebarTag, { color: isDirectColorValue(color) ? undefined : color, "$bgColor": isDirectColorValue(color) ? color : undefined, key: name, icon: icon && react_1.default.createElement(BadgeIcon, { icon: icon }) }, name))),
|
|
95
99
|
item.external ? react_1.default.createElement(LaunchIcon_1.LaunchIcon, { size: "var(--menu-item-external-icon-size)" }) : null),
|
|
96
100
|
item.sublabel ? (react_1.default.createElement(MenuItemSubLabel, null, translate(item.subLabelTranslationKey, item.sublabel))) : null),
|
|
97
101
|
isDrilldown ? react_1.default.createElement(ArrowRightIcon_1.ArrowRightIcon, { size: "12px" }) : null,
|
|
@@ -101,6 +105,12 @@ function MenuItem(props) {
|
|
|
101
105
|
isNested ? (react_1.default.createElement(MenuItemNestedWrapper, { depth: depth, ref: nestedMenuRef, style: style }, isExpanded || !canUnmount ? props.children : null)) : null,
|
|
102
106
|
item.separatorLine ? (react_1.default.createElement(MenuItemSeparatorLine, { depth: depth, linePosition: item.linePosition })) : null));
|
|
103
107
|
}
|
|
108
|
+
/* for backward compatibility */
|
|
109
|
+
function isDirectColorValue(color) {
|
|
110
|
+
if (!color)
|
|
111
|
+
return false;
|
|
112
|
+
return color.startsWith('#') || color.startsWith('rgb') || color.startsWith('hsl');
|
|
113
|
+
}
|
|
104
114
|
function generateClassName({ type, item, className, }) {
|
|
105
115
|
const classNames = [className, `menu-item-type-${type}`];
|
|
106
116
|
if (type === constants_1.MenuItemType.Separator) {
|
|
@@ -279,15 +289,31 @@ const MenuItemLabel = styled_components_1.default.span `
|
|
|
279
289
|
margin-right: var(--spacing-xxs);
|
|
280
290
|
}
|
|
281
291
|
`;
|
|
282
|
-
const
|
|
292
|
+
const SidebarTag = (0, styled_components_1.default)(Tag_1.Tag) `
|
|
293
|
+
${({ $bgColor }) => $bgColor && `background-color: ${$bgColor};`} /* for backward compatibility */
|
|
283
294
|
margin-left: 0;
|
|
284
|
-
background-color: ${({ color }) => color || 'var(--color-info-base)'};
|
|
285
295
|
font-size: var(--font-size-sm);
|
|
286
296
|
line-height: var(--line-height-sm);
|
|
287
297
|
padding: 0 var(--spacing-xxs);
|
|
288
|
-
max-width:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
298
|
+
max-width: 90px;
|
|
299
|
+
|
|
300
|
+
--tag-padding: 0 var(--spacing-xxs);
|
|
301
|
+
--tag-content-padding: 0;
|
|
302
|
+
--tag-font-size: var(--font-size-sm);
|
|
303
|
+
--tag-line-height: var(--line-height-sm);
|
|
304
|
+
vertical-align: middle;
|
|
305
|
+
|
|
306
|
+
${Tag_1.ContentWrapper} {
|
|
307
|
+
text-overflow: ellipsis;
|
|
308
|
+
white-space: nowrap;
|
|
309
|
+
overflow: hidden;
|
|
310
|
+
display: block;
|
|
311
|
+
}
|
|
312
|
+
`;
|
|
313
|
+
const BadgeIcon = (0, styled_components_1.default)(GenericIcon_1.GenericIcon) `
|
|
314
|
+
--icon-width: var(--font-size-sm);
|
|
315
|
+
--icon-height: var(--font-size-sm);
|
|
316
|
+
margin-right: var(--spacing-xxs);
|
|
317
|
+
flex-shrink: 0;
|
|
292
318
|
`;
|
|
293
319
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -131,12 +131,12 @@ exports.mobileMenu = (0, styled_components_1.css) `
|
|
|
131
131
|
* @tokens Mobile Menu
|
|
132
132
|
* */
|
|
133
133
|
/* Fallback for older browsers. dvh accounts for dynamic UI elements like mobile address bars */
|
|
134
|
-
--menu-mobile-height: calc(100vh - var(--navbar-height));
|
|
135
|
-
--menu-mobile-height: calc(100dvh - var(--navbar-height));
|
|
134
|
+
--menu-mobile-height: calc(100vh - var(--navbar-height) - var(--banner-height));
|
|
135
|
+
--menu-mobile-height: calc(100dvh - var(--navbar-height) - var(--banner-height));
|
|
136
136
|
--menu-mobile-width: 100%;
|
|
137
137
|
--menu-mobile-z-index: var(--z-index-raised);
|
|
138
138
|
--menu-mobile-left: 0;
|
|
139
|
-
--menu-mobile-top: var(--navbar-height);
|
|
139
|
+
--menu-mobile-top: calc(var(--navbar-height) + var(--banner-height));
|
|
140
140
|
--menu-mobile-transition: 0.5s;
|
|
141
141
|
--menu-mobile-bg: var(--bg-color); // @presenter Color
|
|
142
142
|
--menu-mobile-margin: var(--menu-mobile-items-margin-top) var(--menu-mobile-margin-horizontal) 0 var(--menu-mobile-margin-horizontal);
|
|
@@ -27,7 +27,7 @@ function NavbarItem({ navItem, className }) {
|
|
|
27
27
|
const normalizedPath = (item.link ? (0, utils_1.removeTrailingSlash)(item.link) : item.link) || '';
|
|
28
28
|
const pathWithPathPrefix = (0, utils_1.withPathPrefix)((0, utils_1.getPathnameForLocale)(normalizedPath, defaultLocale, currentLocale, locales));
|
|
29
29
|
const isActive = (0, utils_1.removeTrailingSlash)(pathname) === (0, utils_1.removeTrailingSlash)(pathWithPathPrefix);
|
|
30
|
-
const itemContent = (react_1.default.createElement(NavbarMenuItem, { as: item.link ? Link_1.Link : undefined, active: isActive, className: className, onClick: () => telemetry.sendNavbarMenuItemClickedMessage({ type: item.type }), external: item.external, target: item.target, to: item.link },
|
|
30
|
+
const itemContent = (react_1.default.createElement(NavbarMenuItem, { as: item.link ? Link_1.Link : undefined, active: isActive, className: className, onClick: () => telemetry.sendNavbarMenuItemClickedMessage([{ object: 'menu_item', type: item.type }]), external: item.external, target: item.target, to: item.link },
|
|
31
31
|
react_1.default.createElement(NavbarIcon, { icon: item.icon, srcSet: item.srcSet }),
|
|
32
32
|
react_1.default.createElement(NavbarLabel, { "data-translation-key": item.labelTranslationKey }, translate(item.labelTranslationKey, item.label)),
|
|
33
33
|
item.external ? react_1.default.createElement(ExternalLinkIcon, { size: "10px" }) : null));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdditionalOverviewInfo: any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// interface AdditionalOverviewInfoProps {
|
|
3
|
+
// info: any;
|
|
4
|
+
// }
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AdditionalOverviewInfo = void 0;
|
|
7
|
+
// export function AdditionalOverviewInfo(_props: AdditionalOverviewInfoProps) {
|
|
8
|
+
// return null;
|
|
9
|
+
// }
|
|
10
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
11
|
+
exports.AdditionalOverviewInfo = null;
|
|
12
|
+
//# sourceMappingURL=AdditionalOverviewInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AfterOpenApiDescription: any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AfterOpenApiDescription = void 0;
|
|
4
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
5
|
+
exports.AfterOpenApiDescription = null;
|
|
6
|
+
//# sourceMappingURL=AfterOpenApiDescription.js.map
|
|
@@ -49,6 +49,7 @@ exports.PageActions = PageActions;
|
|
|
49
49
|
const react_1 = __importStar(require("react"));
|
|
50
50
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
51
51
|
const PageActionsMenuItem_1 = require("../../components/PageActions/PageActionsMenuItem");
|
|
52
|
+
const DropdownMenuItem_1 = require("../../components/Dropdown/DropdownMenuItem");
|
|
52
53
|
const Link_1 = require("../../components/Link/Link");
|
|
53
54
|
const ButtonGroup_1 = require("../../components/Button/ButtonGroup");
|
|
54
55
|
const Button_1 = require("../../components/Button/Button");
|
|
@@ -77,16 +78,18 @@ function PageActions(props) {
|
|
|
77
78
|
setActionState('idle');
|
|
78
79
|
}, ACTION_DONE_DISPLAY_DURATION);
|
|
79
80
|
});
|
|
80
|
-
const menuItems = actions.map((action) =>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
const menuItems = actions.map((action, index) => {
|
|
82
|
+
const key = `${action.title}-${index}`;
|
|
83
|
+
const hasLink = 'link' in action;
|
|
84
|
+
const content = hasLink ? (react_1.default.createElement(LinkMenuItem, { key: `${key}-link`, to: action.link, tabIndex: -1, external: true },
|
|
85
|
+
react_1.default.createElement(PageActionsMenuItem_1.PageActionsMenuItem, { pageAction: action }))) : (react_1.default.createElement(PageActionsMenuItem_1.PageActionsMenuItem, { pageAction: action }));
|
|
86
|
+
return (react_1.default.createElement(StyledDropdownMenuItem, { key: key, onAction: () => handleActionClick(action) }, content));
|
|
87
|
+
});
|
|
88
|
+
return (react_1.default.createElement(PageActionsWrapper, { "data-component-name": "PageActions/PageActions" },
|
|
86
89
|
react_1.default.createElement(ButtonGroup_1.ButtonGroup, { variant: "outlined", size: "medium" },
|
|
87
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),
|
|
88
|
-
actions.length > 1 ? (react_1.default.createElement(
|
|
89
|
-
react_1.default.createElement(StyledDropdownMenu,
|
|
91
|
+
actions.length > 1 ? (react_1.default.createElement(StyledDropdown, { withArrow: true, trigger: react_1.default.createElement(Button_1.Button, null), placement: "bottom", alignment: "end" },
|
|
92
|
+
react_1.default.createElement(StyledDropdownMenu, null, menuItems))) : null)));
|
|
90
93
|
}
|
|
91
94
|
function renderIcon(buttonAction, actionState) {
|
|
92
95
|
switch (actionState) {
|
|
@@ -111,7 +114,21 @@ const LinkMenuItem = (0, styled_components_1.default)(Link_1.Link) `
|
|
|
111
114
|
text-decoration: none;
|
|
112
115
|
--link-decoration-hover: none;
|
|
113
116
|
`;
|
|
117
|
+
const StyledDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown) `
|
|
118
|
+
--dropdown-menu-z-index: calc(var(--z-index-raised) - 1);
|
|
119
|
+
`;
|
|
114
120
|
const StyledDropdownMenu = (0, styled_components_1.default)(DropdownMenu_1.DropdownMenu) `
|
|
115
121
|
--dropdown-menu-max-height: var(--page-actions-dropdown-max-height);
|
|
116
122
|
`;
|
|
123
|
+
const StyledDropdownMenuItem = (0, styled_components_1.default)(DropdownMenuItem_1.DropdownMenuItem) `
|
|
124
|
+
&:has(a) {
|
|
125
|
+
padding: 0;
|
|
126
|
+
& > a {
|
|
127
|
+
display: inline-block;
|
|
128
|
+
width: 100%;
|
|
129
|
+
padding: var(--dropdown-menu-item-padding-vertical)
|
|
130
|
+
var(--dropdown-menu-item-padding-horizontal);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
117
134
|
//# sourceMappingURL=PageActions.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { JSX } from 'react';
|
|
3
|
-
import type { AiSearchConversationItem, SearchAiMessageResource } from '../../core/types';
|
|
3
|
+
import type { AiSearchConversationItem, SearchAiMessageResource, ToolCall, ContentSegment } from '../../core/types';
|
|
4
4
|
import { AiSearchError } from '../../core/constants';
|
|
5
5
|
export type SearchAiDialogProps = {
|
|
6
6
|
response: string | undefined;
|
|
@@ -12,5 +12,7 @@ export type SearchAiDialogProps = {
|
|
|
12
12
|
conversation: AiSearchConversationItem[];
|
|
13
13
|
setConversation: React.Dispatch<React.SetStateAction<AiSearchConversationItem[]>>;
|
|
14
14
|
onMessageSent: (message: string, history?: AiSearchConversationItem[], messageId?: string) => void;
|
|
15
|
+
toolCalls?: ToolCall[];
|
|
16
|
+
contentSegments?: ContentSegment[];
|
|
15
17
|
};
|
|
16
|
-
export declare function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error, resources, onMessageSent, className, conversation, setConversation, }: SearchAiDialogProps): JSX.Element;
|
|
18
|
+
export declare function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error, resources, onMessageSent, className, conversation, setConversation, toolCalls, contentSegments, }: SearchAiDialogProps): JSX.Element;
|
|
@@ -46,7 +46,7 @@ const constants_1 = require("../../core/constants");
|
|
|
46
46
|
const SearchAiMessage_1 = require("../../components/Search/SearchAiMessage");
|
|
47
47
|
const Admonition_1 = require("../../components/Admonition/Admonition");
|
|
48
48
|
const AiStarsIcon_1 = require("../../icons/AiStarsIcon/AiStarsIcon");
|
|
49
|
-
function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error, resources, onMessageSent, className, conversation, setConversation, }) {
|
|
49
|
+
function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error, resources, onMessageSent, className, conversation, setConversation, toolCalls = [], contentSegments, }) {
|
|
50
50
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
51
51
|
const { aiAssistant } = (0, hooks_1.useThemeConfig)();
|
|
52
52
|
const { translate } = useTranslate();
|
|
@@ -99,12 +99,31 @@ function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error,
|
|
|
99
99
|
content,
|
|
100
100
|
resources,
|
|
101
101
|
messageId: lastMessage.messageId,
|
|
102
|
+
toolCalls,
|
|
103
|
+
contentSegments,
|
|
102
104
|
},
|
|
103
105
|
];
|
|
104
106
|
}
|
|
105
|
-
return [
|
|
107
|
+
return [
|
|
108
|
+
...prev,
|
|
109
|
+
{
|
|
110
|
+
role: constants_1.AiSearchConversationRole.ASSISTANT,
|
|
111
|
+
content,
|
|
112
|
+
resources,
|
|
113
|
+
toolCalls,
|
|
114
|
+
contentSegments,
|
|
115
|
+
},
|
|
116
|
+
];
|
|
106
117
|
});
|
|
107
|
-
}, [
|
|
118
|
+
}, [
|
|
119
|
+
response,
|
|
120
|
+
conversation.length,
|
|
121
|
+
error,
|
|
122
|
+
resources,
|
|
123
|
+
toolCalls,
|
|
124
|
+
contentSegments,
|
|
125
|
+
setConversation,
|
|
126
|
+
]);
|
|
108
127
|
(0, react_1.useEffect)(() => {
|
|
109
128
|
if (error) {
|
|
110
129
|
setConversation((prev) => prev.slice(0, -1));
|
|
@@ -123,7 +142,7 @@ function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error,
|
|
|
123
142
|
react_1.default.createElement(ConversationWrapper, null,
|
|
124
143
|
conversation.map((item, index) => (react_1.default.createElement(SearchAiMessage_1.SearchAiMessage, { key: `search-ai-message-${index}`, role: item.role, content: item.content, isThinking: item.role === constants_1.AiSearchConversationRole.ASSISTANT &&
|
|
125
144
|
isGeneratingResponse &&
|
|
126
|
-
index === conversation.length - 1, resources: item.resources, messageId: item.messageId, feedback: item.feedback, onFeedbackChange: handleFeedbackChange }))),
|
|
145
|
+
index === conversation.length - 1, resources: item.resources, messageId: item.messageId, feedback: item.feedback, onFeedbackChange: handleFeedbackChange, toolCalls: item.toolCalls || (index === conversation.length - 1 ? toolCalls : undefined), contentSegments: item.contentSegments }))),
|
|
127
146
|
error && (react_1.default.createElement(Admonition_1.Admonition, { type: "danger", name: translate(constants_1.AI_SEARCH_ERROR_CONFIG[error].headerKey, constants_1.AI_SEARCH_ERROR_CONFIG[error].headerDefault) }, translate(constants_1.AI_SEARCH_ERROR_CONFIG[error].messageKey, constants_1.AI_SEARCH_ERROR_CONFIG[error].messageDefault))),
|
|
128
147
|
!conversation.length && !error && (react_1.default.createElement(SuggestionsWrapper, null, suggestions === null || suggestions === void 0 ? void 0 : suggestions.map((suggestion) => (react_1.default.createElement(Button_1.Button, { key: suggestion, variant: "outlined", onClick: () => handleOnMessageSent(suggestion) }, suggestion))))),
|
|
129
148
|
react_1.default.createElement("div", { ref: conversationEndRef })),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { JSX } from 'react';
|
|
3
|
-
import { FeedbackType, type SearchAiMessageResource } from '../../core/types';
|
|
3
|
+
import { FeedbackType, type SearchAiMessageResource, type ToolCall, type ContentSegment } from '../../core/types';
|
|
4
4
|
import { AiSearchConversationRole } from '../../core/constants';
|
|
5
5
|
export type SearchAiMessageProps = {
|
|
6
6
|
role: AiSearchConversationRole;
|
|
@@ -11,7 +11,9 @@ export type SearchAiMessageProps = {
|
|
|
11
11
|
messageId?: string;
|
|
12
12
|
feedback?: FeedbackType;
|
|
13
13
|
onFeedbackChange: (messageId: string, feedback: FeedbackType | undefined) => void;
|
|
14
|
+
toolCalls?: ToolCall[];
|
|
15
|
+
contentSegments?: ContentSegment[];
|
|
14
16
|
};
|
|
15
|
-
declare function SearchAiMessageComponent({ role, content, isThinking, resources, className, messageId, feedback, onFeedbackChange, }: SearchAiMessageProps): JSX.Element;
|
|
17
|
+
declare function SearchAiMessageComponent({ role, content, isThinking, resources, className, messageId, feedback, onFeedbackChange, toolCalls, contentSegments, }: SearchAiMessageProps): JSX.Element;
|
|
16
18
|
export declare const SearchAiMessage: React.MemoExoticComponent<typeof SearchAiMessageComponent>;
|
|
17
19
|
export {};
|