@redocly/theme 0.62.0-custom.0 → 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/Buttons/EditPageButton.js +4 -26
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +6 -13
- 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/Menu/variables.js +3 -3
- package/lib/components/PageActions/PageActions.js +1 -1
- 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/hooks/use-page-actions.js +7 -4
- package/lib/core/openapi/index.d.ts +1 -0
- package/lib/core/openapi/index.js +3 -1
- package/lib/core/styles/dark.js +11 -0
- package/lib/core/styles/global.js +7 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/utils/transform-revisions-to-version-history.js +13 -20
- package/lib/ext/process-scorecard.d.ts +45 -1
- package/lib/ext/process-scorecard.js +1 -0
- package/lib/icons/DirectionRightIcon/DirectionRightIcon.d.ts +5 -0
- package/lib/icons/DirectionRightIcon/DirectionRightIcon.js +24 -0
- package/package.json +5 -5
- package/src/components/Buttons/EditPageButton.tsx +13 -34
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +2 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +5 -21
- 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/Menu/variables.ts +3 -3
- package/src/components/PageActions/PageActions.tsx +1 -1
- package/src/core/constants/feedback.ts +2 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/hooks/use-page-actions.ts +12 -6
- package/src/core/openapi/index.ts +1 -0
- package/src/core/styles/dark.ts +12 -0
- package/src/core/styles/global.ts +7 -0
- package/src/core/types/l10n.ts +1 -0
- package/src/core/utils/transform-revisions-to-version-history.ts +13 -21
- package/src/ext/process-scorecard.ts +46 -1
- package/src/icons/DirectionRightIcon/DirectionRightIcon.tsx +35 -0
|
@@ -8,37 +8,15 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const hooks_1 = require("../../core/hooks");
|
|
10
10
|
const EditIcon_1 = require("../../icons/EditIcon/EditIcon");
|
|
11
|
-
const
|
|
11
|
+
const Button_1 = require("../../components/Button/Button");
|
|
12
12
|
function EditPageButton({ to }) {
|
|
13
13
|
const { useTranslate, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
14
14
|
const { translate } = useTranslate();
|
|
15
15
|
const telemetry = useTelemetry();
|
|
16
|
-
return (react_1.default.createElement(EditPageButtonWrapper, { "data-component-name": "Buttons/EditPageButton"
|
|
17
|
-
react_1.default.createElement(
|
|
18
|
-
react_1.default.createElement(ButtonText, { "data-translation-key": "markdown.editPage.text" }, translate('markdown.editPage.text', 'Edit'))));
|
|
16
|
+
return (react_1.default.createElement(EditPageButtonWrapper, { "data-component-name": "Buttons/EditPageButton" },
|
|
17
|
+
react_1.default.createElement(Button_1.Button, { to: to, external: true, variant: "ghost", size: "small", icon: react_1.default.createElement(EditIcon_1.EditIcon, null), onClick: () => telemetry.sendEditPageLinkClickedMessage(), "data-translation-key": "markdown.editPage.text" }, translate('markdown.editPage.text', 'Edit'))));
|
|
19
18
|
}
|
|
20
|
-
const EditPageButtonWrapper =
|
|
21
|
-
height: fit-content;
|
|
19
|
+
const EditPageButtonWrapper = styled_components_1.default.div `
|
|
22
20
|
margin-left: auto;
|
|
23
|
-
display: inline-flex;
|
|
24
|
-
color: var(--text-color-secondary);
|
|
25
|
-
font-weight: var(--font-weight-bold);
|
|
26
|
-
font-size: var(--font-size-base);
|
|
27
|
-
font-family: var(--font-family-base);
|
|
28
|
-
text-decoration: none;
|
|
29
|
-
|
|
30
|
-
&:hover {
|
|
31
|
-
color: var(--text-color-primary);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@media print {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
const ButtonIcon = (0, styled_components_1.default)(EditIcon_1.EditIcon) `
|
|
39
|
-
margin-right: 3px;
|
|
40
|
-
`;
|
|
41
|
-
const ButtonText = styled_components_1.default.span `
|
|
42
|
-
line-height: 14px;
|
|
43
21
|
`;
|
|
44
22
|
//# sourceMappingURL=EditPageButton.js.map
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js
CHANGED
|
@@ -111,10 +111,10 @@ function CatalogEntityHistorySidebar({ entityKey, revision, version, className,
|
|
|
111
111
|
}
|
|
112
112
|
const SidebarOverlay = styled_components_1.default.div `
|
|
113
113
|
position: fixed;
|
|
114
|
-
top: var(--navbar-height);
|
|
114
|
+
top: calc(var(--navbar-height) + var(--banner-height, 0));
|
|
115
115
|
left: 0;
|
|
116
116
|
width: var(--sidebar-width);
|
|
117
|
-
height: calc(100vh - var(--navbar-height));
|
|
117
|
+
height: calc(100vh - var(--navbar-height) - var(--banner-height, 0));
|
|
118
118
|
background-color: var(--catalog-history-sidebar-bg-color);
|
|
119
119
|
border-right: 1px solid var(--catalog-history-sidebar-border-color);
|
|
120
120
|
display: flex;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js
CHANGED
|
@@ -70,12 +70,10 @@ function CatalogEntityVersionItem({ group, basePath, isExpanded, onToggle, }) {
|
|
|
70
70
|
}, [isExpanded]);
|
|
71
71
|
const isNotSpecifiedVersion = group.version === constants_1.VERSION_NOT_SPECIFIED;
|
|
72
72
|
const singleRevisionLink = (0, utils_1.buildRevisionUrl)(basePath, group.singleRevisionDate, group.version);
|
|
73
|
-
const isClickable = hasRevisions || Boolean(singleRevisionLink);
|
|
74
|
-
const isSingleRevisionActive = Boolean(singleRevisionLink && group.isCurrent);
|
|
75
73
|
const versionTitle = isNotSpecifiedVersion
|
|
76
74
|
? `${translate('catalog.history.version.label', 'Version')}: ${translate('catalog.history.version.notSpecified', 'not specified')}`
|
|
77
75
|
: `${translate('catalog.history.version.label', 'Version')}: ${group.version}`;
|
|
78
|
-
const versionButton = (react_1.default.createElement(VersionButton, { type: "button", onClick: () => hasRevisions && onToggle(group.version), "$
|
|
76
|
+
const versionButton = (react_1.default.createElement(VersionButton, { type: "button", onClick: () => hasRevisions && onToggle(group.version), "$isCurrent": group.isCurrent },
|
|
79
77
|
react_1.default.createElement(VersionIcon, { "$isCurrent": group.isCurrent }, group.isCurrent ? (react_1.default.createElement(CheckmarkOutlineIcon_1.CheckmarkOutlineIcon, { size: "16px", color: "--catalog-history-sidebar-version-icon-color-current" })) : (react_1.default.createElement(NavaidMilitaryIcon_1.NavaidMilitaryIcon, { size: "16px", color: "--catalog-history-sidebar-version-icon-color" }))),
|
|
80
78
|
react_1.default.createElement(VersionInfo, null,
|
|
81
79
|
react_1.default.createElement(VersionTitleRow, null,
|
|
@@ -105,21 +103,16 @@ const VersionButton = styled_components_1.default.button `
|
|
|
105
103
|
align-items: center;
|
|
106
104
|
width: calc(100% - var(--catalog-history-sidebar-version-icon-margin-right));
|
|
107
105
|
padding: var(--catalog-history-sidebar-version-header-padding);
|
|
108
|
-
cursor:
|
|
106
|
+
cursor: pointer;
|
|
109
107
|
border-radius: var(--catalog-history-sidebar-version-header-border-radius);
|
|
110
108
|
transition: 0.2s ease;
|
|
111
109
|
text-decoration: none;
|
|
112
110
|
color: inherit;
|
|
113
|
-
background-color:
|
|
111
|
+
background-color: 'transparent';
|
|
114
112
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
background-color: ${$isActive
|
|
119
|
-
? 'var(--catalog-history-sidebar-revision-item-bg-color-active)'
|
|
120
|
-
: 'var(--catalog-history-sidebar-version-header-bg-color-hover)'};
|
|
121
|
-
}
|
|
122
|
-
`}
|
|
113
|
+
&:hover {
|
|
114
|
+
background-color: var(--catalog-history-sidebar-version-header-bg-color-hover);
|
|
115
|
+
}
|
|
123
116
|
|
|
124
117
|
${({ $isCurrent }) => !$isCurrent &&
|
|
125
118
|
`
|
|
@@ -97,6 +97,6 @@ const ChildrenWrapper = styled_components_1.default.div `
|
|
|
97
97
|
right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
|
|
98
98
|
display: ${({ isOpen }) => (isOpen ? 'block' : 'none')};
|
|
99
99
|
|
|
100
|
-
z-index: var(--z-index
|
|
100
|
+
z-index: var(--dropdown-menu-z-index);
|
|
101
101
|
`;
|
|
102
102
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -10,6 +10,7 @@ exports.dropdown = (0, styled_components_1.css) `
|
|
|
10
10
|
--dropdown-menu-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
11
11
|
--dropdown-menu-line-height: var(--line-height-base); // @presenter LineHeight
|
|
12
12
|
--dropdown-menu-text-color: var(--text-color-secondary); // @presenter Color
|
|
13
|
+
--dropdown-menu-z-index: var(--z-index-raised); // @presenter ZIndex
|
|
13
14
|
|
|
14
15
|
--dropdown-menu-padding-top: var(--spacing-xxs);
|
|
15
16
|
--dropdown-menu-min-width: 100px;
|
|
@@ -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();
|
|
@@ -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);
|
|
@@ -115,7 +115,7 @@ const LinkMenuItem = (0, styled_components_1.default)(Link_1.Link) `
|
|
|
115
115
|
--link-decoration-hover: none;
|
|
116
116
|
`;
|
|
117
117
|
const StyledDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown) `
|
|
118
|
-
z-index: calc(var(--z-index-raised) - 1);
|
|
118
|
+
--dropdown-menu-z-index: calc(var(--z-index-raised) - 1);
|
|
119
119
|
`;
|
|
120
120
|
const StyledDropdownMenu = (0, styled_components_1.default)(DropdownMenu_1.DropdownMenu) `
|
|
121
121
|
--dropdown-menu-max-height: var(--page-actions-dropdown-max-height);
|
|
@@ -22,4 +22,5 @@ __exportStar(require("./catalog"), exports);
|
|
|
22
22
|
__exportStar(require("./breadcrumb"), exports);
|
|
23
23
|
__exportStar(require("./request-methods"), exports);
|
|
24
24
|
__exportStar(require("./mcp"), exports);
|
|
25
|
+
__exportStar(require("./feedback"), exports);
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -23,6 +23,7 @@ const use_mcp_config_1 = require("./use-mcp-config");
|
|
|
23
23
|
const clipboard_service_1 = require("../utils/clipboard-service");
|
|
24
24
|
const dom_1 = require("../utils/dom");
|
|
25
25
|
const mcp_1 = require("../utils/mcp");
|
|
26
|
+
const urls_1 = require("../utils/urls");
|
|
26
27
|
function createPageActionResource(pageSlug, pageUrl) {
|
|
27
28
|
return {
|
|
28
29
|
id: pageSlug,
|
|
@@ -80,9 +81,12 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
80
81
|
const origin = dom_1.IS_BROWSER
|
|
81
82
|
? window.location.origin
|
|
82
83
|
: ((_a = globalThis['SSR_HOSTNAME']) !== null && _a !== void 0 ? _a : '');
|
|
83
|
-
const
|
|
84
|
-
const pageUrl =
|
|
85
|
-
const
|
|
84
|
+
const pathname = (0, urls_1.addTrailingSlash)(pageSlug);
|
|
85
|
+
const pageUrl = (0, urls_1.combineUrls)(origin, pathname);
|
|
86
|
+
const isRoot = (0, urls_1.withoutPathPrefix)(pathname) === '/';
|
|
87
|
+
const mdPageUrl = isRoot
|
|
88
|
+
? (0, urls_1.combineUrls)(origin, pathname, 'index.html.md')
|
|
89
|
+
: (0, urls_1.combineUrls)(origin, (0, urls_1.removeTrailingSlash)(pathname) + '.md');
|
|
86
90
|
const actionHandlers = {
|
|
87
91
|
'docs-mcp-cursor': createMCPHandler('cursor', false),
|
|
88
92
|
'docs-mcp-vscode': createMCPHandler('vscode', false),
|
|
@@ -120,7 +124,6 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
120
124
|
telemetry.sendPageActionsButtonClickedMessage([
|
|
121
125
|
Object.assign(Object.assign({}, createPageActionResource(pageSlug, pageUrl)), { action_type: 'view' }),
|
|
122
126
|
]);
|
|
123
|
-
window.location.href = mdPageUrl;
|
|
124
127
|
},
|
|
125
128
|
}),
|
|
126
129
|
chatgpt: () => {
|
|
@@ -26,3 +26,4 @@ export { isUndefined, isString, isNotNull, isObject } from '../utils/type-guards
|
|
|
26
26
|
export { ThemeDataContext, type ThemeDataTransferObject } from '../contexts/ThemeDataContext';
|
|
27
27
|
export { SearchSessionProvider, SearchSessionContext } from '../contexts/SearchContext';
|
|
28
28
|
export { useUniqueSvgIds } from '../hooks/use-unique-svg-ids';
|
|
29
|
+
export { trimText } from '../utils/text-trimmer';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useUniqueSvgIds = exports.SearchSessionContext = exports.SearchSessionProvider = exports.ThemeDataContext = exports.isObject = exports.isNotNull = exports.isString = exports.isUndefined = exports.SecurityVariablesEnvSuffix = exports.useDialogHotKeys = exports.useSearchDialog = exports.useModalScrollLock = exports.useActiveSectionId = exports.useOutsideClick = exports.useThemeHooks = exports.useFocusTrap = exports.getUserAgent = exports.ClipboardService = exports.getOperationColor = exports.isPrimitive = exports.breakpoints = exports.GlobalStyle = exports.useMount = exports.typedMemo = exports.capitalize = exports.withPathPrefix = exports.addTrailingSlash = exports.combineUrls = exports.getPathPrefix = exports.removeLeadingSlash = exports.addLeadingSlash = exports.IS_BROWSER = void 0;
|
|
3
|
+
exports.trimText = exports.useUniqueSvgIds = exports.SearchSessionContext = exports.SearchSessionProvider = exports.ThemeDataContext = exports.isObject = exports.isNotNull = exports.isString = exports.isUndefined = exports.SecurityVariablesEnvSuffix = exports.useDialogHotKeys = exports.useSearchDialog = exports.useModalScrollLock = exports.useActiveSectionId = exports.useOutsideClick = exports.useThemeHooks = exports.useFocusTrap = exports.getUserAgent = exports.ClipboardService = exports.getOperationColor = exports.isPrimitive = exports.breakpoints = exports.GlobalStyle = exports.useMount = exports.typedMemo = exports.capitalize = exports.withPathPrefix = exports.addTrailingSlash = exports.combineUrls = exports.getPathPrefix = exports.removeLeadingSlash = exports.addLeadingSlash = exports.IS_BROWSER = void 0;
|
|
4
4
|
var dom_1 = require("../utils/dom");
|
|
5
5
|
Object.defineProperty(exports, "IS_BROWSER", { enumerable: true, get: function () { return dom_1.IS_BROWSER; } });
|
|
6
6
|
var urls_1 = require("../utils/urls");
|
|
@@ -56,4 +56,6 @@ Object.defineProperty(exports, "SearchSessionProvider", { enumerable: true, get:
|
|
|
56
56
|
Object.defineProperty(exports, "SearchSessionContext", { enumerable: true, get: function () { return SearchContext_1.SearchSessionContext; } });
|
|
57
57
|
var use_unique_svg_ids_1 = require("../hooks/use-unique-svg-ids");
|
|
58
58
|
Object.defineProperty(exports, "useUniqueSvgIds", { enumerable: true, get: function () { return use_unique_svg_ids_1.useUniqueSvgIds; } });
|
|
59
|
+
var text_trimmer_1 = require("../utils/text-trimmer");
|
|
60
|
+
Object.defineProperty(exports, "trimText", { enumerable: true, get: function () { return text_trimmer_1.trimText; } });
|
|
59
61
|
//# sourceMappingURL=index.js.map
|
package/lib/core/styles/dark.js
CHANGED
|
@@ -46,6 +46,16 @@ const replayDarkMode = (0, styled_components_1.css) `
|
|
|
46
46
|
|
|
47
47
|
// @tokens End
|
|
48
48
|
`;
|
|
49
|
+
const badgesDarkMode = (0, styled_components_1.css) `
|
|
50
|
+
/**
|
|
51
|
+
* @tokens Audience Badge
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
--badge-audience-text-color: var(--text-color-secondary); // @presenter Color
|
|
55
|
+
--badge-audience-bg-color: var(--color-warm-grey-4); // @presenter Color
|
|
56
|
+
|
|
57
|
+
// @tokens End
|
|
58
|
+
`;
|
|
49
59
|
exports.darkMode = (0, styled_components_1.css) `
|
|
50
60
|
/* === Dark Theme Colors === */
|
|
51
61
|
|
|
@@ -333,6 +343,7 @@ exports.darkMode = (0, styled_components_1.css) `
|
|
|
333
343
|
${variables_dark_15.bannerDarkMode}
|
|
334
344
|
${variables_dark_16.admonitionDarkMode}
|
|
335
345
|
${variables_dark_17.svgViewerDarkMode}
|
|
346
|
+
${badgesDarkMode}
|
|
336
347
|
|
|
337
348
|
/**
|
|
338
349
|
* @tokens Dark Theme Scrollbar Config
|
|
@@ -815,6 +815,13 @@ const badges = (0, styled_components_1.css) `
|
|
|
815
815
|
--badge-deprecated-bg-color: var(--color-warning-base); // @presenter Color
|
|
816
816
|
--badge-deprecated-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
817
817
|
|
|
818
|
+
/**
|
|
819
|
+
* @tokens Audience Badge
|
|
820
|
+
*/
|
|
821
|
+
|
|
822
|
+
--badge-audience-text-color: var(--text-color-secondary); // @presenter Color
|
|
823
|
+
--badge-audience-bg-color: var(--color-warm-grey-2); // @presenter Color
|
|
824
|
+
|
|
818
825
|
// @tokens End
|
|
819
826
|
`;
|
|
820
827
|
const loadProgressBar = (0, styled_components_1.css) `
|
package/lib/core/types/l10n.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TOptions } from 'i18next';
|
|
2
|
-
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolResult.found' | 'search.ai.toolResult.found.documents' | 'search.ai.toolCall.searching' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.tags.more' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'mermaid.openFullscreen' | 'mermaid.zoomIn' | 'mermaid.zoomOut' | 'mermaid.reset' | 'mermaid.close' | 'mermaid.viewer';
|
|
2
|
+
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolResult.found' | 'search.ai.toolResult.found.documents' | 'search.ai.toolCall.searching' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.tags.more' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.maxLength' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'mermaid.openFullscreen' | 'mermaid.zoomIn' | 'mermaid.zoomOut' | 'mermaid.reset' | 'mermaid.close' | 'mermaid.viewer';
|
|
3
3
|
export type Locale = {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
@@ -31,26 +31,19 @@ function transformRevisionsToVersionHistory({ revisions, currentRevisionDate, cu
|
|
|
31
31
|
}
|
|
32
32
|
// Check if any revision in this version group is the default version
|
|
33
33
|
const isDefaultVersion = versionRevisions.some((rev) => rev.isDefaultVersion === true);
|
|
34
|
-
const revisions = versionRevisions.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
date: (0, date_1.toLocalizedShortDateTime)(rev.revision, locale),
|
|
48
|
-
revisionDate: rev.revision,
|
|
49
|
-
isActive: isActiveRevision || isCurrentByDefault,
|
|
50
|
-
isCurrent: (_a = rev.isCurrent) !== null && _a !== void 0 ? _a : false,
|
|
51
|
-
};
|
|
52
|
-
})
|
|
53
|
-
: undefined;
|
|
34
|
+
const revisions = versionRevisions.map((rev, index) => {
|
|
35
|
+
var _a;
|
|
36
|
+
const revisionMatches = currentRevisionDate ? rev.revision === currentRevisionDate : false;
|
|
37
|
+
const isActiveRevision = revisionMatches && versionMatches;
|
|
38
|
+
const isCurrentByDefault = !currentRevisionDate && normalizedCurrentVersion === undefined && index === 0 && isCurrent;
|
|
39
|
+
return {
|
|
40
|
+
name: `r.${versionRevisions.length - index}`,
|
|
41
|
+
date: (0, date_1.toLocalizedShortDateTime)(rev.revision, locale),
|
|
42
|
+
revisionDate: rev.revision,
|
|
43
|
+
isActive: isActiveRevision || isCurrentByDefault,
|
|
44
|
+
isCurrent: (_a = rev.isCurrent) !== null && _a !== void 0 ? _a : false,
|
|
45
|
+
};
|
|
46
|
+
});
|
|
54
47
|
return {
|
|
55
48
|
version,
|
|
56
49
|
date: (0, date_1.toLocalizedShortDate)((latestRevision === null || latestRevision === void 0 ? void 0 : latestRevision.revision) || null, locale),
|