@redocly/theme 0.9.7 → 0.9.9
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/Feedback/Comment.d.ts +1 -1
- package/lib/Feedback/Comment.js +2 -2
- package/lib/Feedback/Feedback.d.ts +5 -0
- package/lib/Feedback/Feedback.js +50 -0
- package/lib/Feedback/ReportDialog.js +2 -2
- package/lib/Feedback/index.d.ts +1 -0
- package/lib/Feedback/index.js +3 -1
- package/lib/Feedback/types.d.ts +1 -1
- package/lib/SamplesPanelControls/SamplesPanelControls.js +1 -0
- package/lib/Search/utils.js +4 -3
- package/lib/config.d.ts +1505 -508
- package/lib/config.js +27 -2
- package/lib/globalStyle.js +2 -2
- package/lib/ui/darkColors.js +1 -1
- package/package.json +2 -2
- package/src/Feedback/Comment.tsx +2 -2
- package/src/Feedback/Feedback.tsx +43 -0
- package/src/Feedback/ReportDialog.tsx +2 -1
- package/src/Feedback/index.ts +1 -0
- package/src/Feedback/types.ts +1 -1
- package/src/SamplesPanelControls/SamplesPanelControls.ts +1 -0
- package/src/Search/utils.tsx +4 -3
- package/src/config.ts +29 -3
- package/src/globalStyle.ts +2 -2
- package/src/types/portal/index.d.ts +1 -0
- package/src/types/portal/src/shared/types/feedback.d.ts +12 -0
- package/src/ui/darkColors.tsx +1 -1
package/lib/Feedback/Comment.js
CHANGED
|
@@ -30,8 +30,8 @@ exports.Comment = void 0;
|
|
|
30
30
|
const React = __importStar(require("react"));
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const Button_1 = require("../Button/Button");
|
|
33
|
-
const Comment = ({ settings, onSubmit }) => {
|
|
34
|
-
const { label, submitText
|
|
33
|
+
const Comment = ({ settings, onSubmit, onCancel }) => {
|
|
34
|
+
const { label, submitText } = settings || {};
|
|
35
35
|
const [text, setText] = React.useState('');
|
|
36
36
|
const [submitValue, setSubmitValue] = React.useState('');
|
|
37
37
|
const send = () => {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Feedback = void 0;
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const Feedback_1 = require("../Feedback");
|
|
29
|
+
const hooks_1 = require("../hooks");
|
|
30
|
+
const useSubmitFeedback_1 = require("../mocks/Feedback/useSubmitFeedback");
|
|
31
|
+
const Feedback = (props) => {
|
|
32
|
+
const { submitFeedback } = (0, useSubmitFeedback_1.useSubmitFeedback)();
|
|
33
|
+
const { feedback: themeFeedbackConf } = (0, hooks_1.useThemeConfig)();
|
|
34
|
+
const feedbackConf = Object.assign(Object.assign({}, themeFeedbackConf), props);
|
|
35
|
+
const { type, settings, path } = feedbackConf;
|
|
36
|
+
switch (type) {
|
|
37
|
+
case 'rating':
|
|
38
|
+
return (React.createElement(Feedback_1.Rating, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'rating', values, path }) }));
|
|
39
|
+
case 'sentiment':
|
|
40
|
+
return (React.createElement(Feedback_1.Sentiment, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'sentiment', values, path }) }));
|
|
41
|
+
case 'comment':
|
|
42
|
+
return (React.createElement(Feedback_1.Comment, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'comment', values, path }) }));
|
|
43
|
+
default:
|
|
44
|
+
console.log(`No feedback with type ${type}!`);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
return React.createElement(React.Fragment, null);
|
|
48
|
+
};
|
|
49
|
+
exports.Feedback = Feedback;
|
|
50
|
+
//# sourceMappingURL=Feedback.js.map
|
|
@@ -35,10 +35,10 @@ const ReportDialog = ({ location, settings, onSubmit, onCancel, }) => {
|
|
|
35
35
|
const { label } = settings;
|
|
36
36
|
const { submitFeedback } = (0, useSubmitFeedback_1.useSubmitFeedback)();
|
|
37
37
|
return (React.createElement(Wrapper, { className: "modal" },
|
|
38
|
-
React.createElement(Comment_1.Comment, { settings: { label
|
|
38
|
+
React.createElement(Comment_1.Comment, { settings: { label }, onSubmit: (value) => {
|
|
39
39
|
submitFeedback('problem', Object.assign(Object.assign({}, value), { location }));
|
|
40
40
|
onSubmit();
|
|
41
|
-
} })));
|
|
41
|
+
}, onCancel: onCancel })));
|
|
42
42
|
};
|
|
43
43
|
exports.ReportDialog = ReportDialog;
|
|
44
44
|
const Wrapper = styled_components_1.default.div `
|
package/lib/Feedback/index.d.ts
CHANGED
package/lib/Feedback/index.js
CHANGED
|
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.useReportDialog = exports.ReportDialog = exports.Reasons = exports.Comment = exports.Sentiment = exports.Rating = void 0;
|
|
17
|
+
exports.useReportDialog = exports.ReportDialog = exports.Reasons = exports.Comment = exports.Sentiment = exports.Rating = exports.Feedback = void 0;
|
|
18
|
+
var Feedback_1 = require("../Feedback/Feedback");
|
|
19
|
+
Object.defineProperty(exports, "Feedback", { enumerable: true, get: function () { return Feedback_1.Feedback; } });
|
|
18
20
|
var Rating_1 = require("../Feedback/Rating");
|
|
19
21
|
Object.defineProperty(exports, "Rating", { enumerable: true, get: function () { return Rating_1.Rating; } });
|
|
20
22
|
var Sentiment_1 = require("../Feedback/Sentiment");
|
package/lib/Feedback/types.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ exports.SampleControlsWrap = styled_components_1.default.div `
|
|
|
63
63
|
exports.PreformattedCodeBlock = (0, styled_components_1.default)(CodeBlock_1.CodeBlock.withComponent('pre')) `
|
|
64
64
|
overflow-x: auto;
|
|
65
65
|
margin: 0;
|
|
66
|
+
max-height: var(--code-block-max-height);
|
|
66
67
|
font-family: var(--code-font-family);
|
|
67
68
|
padding: 20px;
|
|
68
69
|
border-radius: var(--border-radius);
|
package/lib/Search/utils.js
CHANGED
|
@@ -35,11 +35,12 @@ const highlight = (text) => {
|
|
|
35
35
|
const [pre, entry, suf] = text;
|
|
36
36
|
return (React.createElement(React.Fragment, null,
|
|
37
37
|
pre,
|
|
38
|
-
React.createElement(
|
|
38
|
+
React.createElement(Highlight, null, entry),
|
|
39
39
|
suf));
|
|
40
40
|
};
|
|
41
41
|
exports.highlight = highlight;
|
|
42
|
-
const
|
|
43
|
-
color: var(--search-highlight-text-color);
|
|
42
|
+
const Highlight = styled_components_1.default.span `
|
|
43
|
+
background-color: var(--search-highlight-text-color);
|
|
44
|
+
color: var(--color-emphasis-900);
|
|
44
45
|
`;
|
|
45
46
|
//# sourceMappingURL=utils.js.map
|