@redocly/theme 0.27.2 → 0.27.3
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/Feedback/Comment.js +2 -2
- package/lib/components/Feedback/Mood.js +1 -0
- package/lib/components/Feedback/Rating.js +1 -0
- package/lib/components/Feedback/Scale.js +1 -0
- package/lib/components/Feedback/Sentiment.js +1 -0
- package/lib/components/Feedback/types.d.ts +5 -0
- package/package.json +1 -1
- package/src/components/Feedback/Comment.tsx +2 -2
- package/src/components/Feedback/Mood.tsx +1 -0
- package/src/components/Feedback/Rating.tsx +1 -0
- package/src/components/Feedback/Scale.tsx +1 -0
- package/src/components/Feedback/Sentiment.tsx +1 -0
- package/src/components/Feedback/types.ts +17 -5
|
@@ -42,13 +42,13 @@ const Comment = ({ settings, onSubmit, onCancel, className, standAlone = true, }
|
|
|
42
42
|
if (!text)
|
|
43
43
|
return;
|
|
44
44
|
setSubmitValue(text);
|
|
45
|
-
onSubmit({ comment: text });
|
|
45
|
+
onSubmit({ comment: text, path: window.location.href });
|
|
46
46
|
};
|
|
47
47
|
const handleTextAreaChange = (e) => {
|
|
48
48
|
const commentValue = e.target.value;
|
|
49
49
|
setText(commentValue);
|
|
50
50
|
if (!standAlone) {
|
|
51
|
-
onSubmit({ comment: commentValue });
|
|
51
|
+
onSubmit({ comment: commentValue, path: window.location.href });
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
if (submitValue) {
|
|
@@ -5,6 +5,7 @@ export type RatingProps = {
|
|
|
5
5
|
comment?: string;
|
|
6
6
|
reasons?: string[];
|
|
7
7
|
max: number;
|
|
8
|
+
path?: string;
|
|
8
9
|
}) => void;
|
|
9
10
|
settings?: {
|
|
10
11
|
label?: string;
|
|
@@ -28,6 +29,7 @@ export type ScaleProps = {
|
|
|
28
29
|
comment?: string;
|
|
29
30
|
reasons?: string[];
|
|
30
31
|
max?: number;
|
|
32
|
+
path?: string;
|
|
31
33
|
}) => void;
|
|
32
34
|
settings?: {
|
|
33
35
|
label?: string;
|
|
@@ -52,6 +54,7 @@ export type MoodProps = {
|
|
|
52
54
|
score: number;
|
|
53
55
|
comment?: string;
|
|
54
56
|
reasons?: string[];
|
|
57
|
+
path?: string;
|
|
55
58
|
}) => void;
|
|
56
59
|
settings?: {
|
|
57
60
|
label?: string;
|
|
@@ -76,6 +79,7 @@ export type SentimentProps = {
|
|
|
76
79
|
score: number;
|
|
77
80
|
comment?: string;
|
|
78
81
|
reasons?: string[];
|
|
82
|
+
path?: string;
|
|
79
83
|
}) => void;
|
|
80
84
|
settings?: {
|
|
81
85
|
label?: string;
|
|
@@ -97,6 +101,7 @@ export type SentimentProps = {
|
|
|
97
101
|
export type CommentProps = {
|
|
98
102
|
onSubmit: (value: {
|
|
99
103
|
comment: string;
|
|
104
|
+
path?: string;
|
|
100
105
|
}) => void;
|
|
101
106
|
onCancel?: () => unknown;
|
|
102
107
|
settings?: {
|
package/package.json
CHANGED
|
@@ -22,14 +22,14 @@ export const Comment = ({
|
|
|
22
22
|
const send = () => {
|
|
23
23
|
if (!text) return;
|
|
24
24
|
setSubmitValue(text);
|
|
25
|
-
onSubmit({ comment: text });
|
|
25
|
+
onSubmit({ comment: text, path: window.location.href });
|
|
26
26
|
};
|
|
27
27
|
const handleTextAreaChange = (e: any) => {
|
|
28
28
|
const commentValue = e.target.value;
|
|
29
29
|
setText(commentValue);
|
|
30
30
|
|
|
31
31
|
if (!standAlone) {
|
|
32
|
-
onSubmit({ comment: commentValue });
|
|
32
|
+
onSubmit({ comment: commentValue, path: window.location.href });
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { SubmitFeedbackParams } from '@theme/types/portal/src/shared/types/feedback';
|
|
2
2
|
|
|
3
3
|
export type RatingProps = {
|
|
4
|
-
onSubmit: (value: {
|
|
4
|
+
onSubmit: (value: {
|
|
5
|
+
score: number;
|
|
6
|
+
comment?: string;
|
|
7
|
+
reasons?: string[];
|
|
8
|
+
max: number;
|
|
9
|
+
path?: string;
|
|
10
|
+
}) => void;
|
|
5
11
|
settings?: {
|
|
6
12
|
label?: string;
|
|
7
13
|
submitText?: string;
|
|
@@ -20,7 +26,13 @@ export type RatingProps = {
|
|
|
20
26
|
};
|
|
21
27
|
|
|
22
28
|
export type ScaleProps = {
|
|
23
|
-
onSubmit: (value: {
|
|
29
|
+
onSubmit: (value: {
|
|
30
|
+
score: number;
|
|
31
|
+
comment?: string;
|
|
32
|
+
reasons?: string[];
|
|
33
|
+
max?: number;
|
|
34
|
+
path?: string;
|
|
35
|
+
}) => void;
|
|
24
36
|
settings?: {
|
|
25
37
|
label?: string;
|
|
26
38
|
submitText?: string;
|
|
@@ -41,7 +53,7 @@ export type ScaleProps = {
|
|
|
41
53
|
};
|
|
42
54
|
|
|
43
55
|
export type MoodProps = {
|
|
44
|
-
onSubmit: (value: { score: number; comment?: string; reasons?: string[] }) => void;
|
|
56
|
+
onSubmit: (value: { score: number; comment?: string; reasons?: string[]; path?: string }) => void;
|
|
45
57
|
settings?: {
|
|
46
58
|
label?: string;
|
|
47
59
|
submitText?: string;
|
|
@@ -62,7 +74,7 @@ export type MoodProps = {
|
|
|
62
74
|
};
|
|
63
75
|
|
|
64
76
|
export type SentimentProps = {
|
|
65
|
-
onSubmit: (value: { score: number; comment?: string; reasons?: string[] }) => void;
|
|
77
|
+
onSubmit: (value: { score: number; comment?: string; reasons?: string[]; path?: string }) => void;
|
|
66
78
|
settings?: {
|
|
67
79
|
label?: string;
|
|
68
80
|
submitText?: string;
|
|
@@ -82,7 +94,7 @@ export type SentimentProps = {
|
|
|
82
94
|
};
|
|
83
95
|
|
|
84
96
|
export type CommentProps = {
|
|
85
|
-
onSubmit: (value: { comment: string }) => void;
|
|
97
|
+
onSubmit: (value: { comment: string; path?: string }) => void;
|
|
86
98
|
onCancel?: () => unknown;
|
|
87
99
|
settings?: {
|
|
88
100
|
label?: string;
|