@redocly/theme 0.27.2 → 0.27.4

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.
@@ -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) {
@@ -71,6 +71,7 @@ const Mood = ({ settings, onSubmit, className }) => {
71
71
  score: remapScore(score),
72
72
  comment,
73
73
  reasons,
74
+ path: window.location.href,
74
75
  });
75
76
  setIsSubmitted(true);
76
77
  };
@@ -50,6 +50,7 @@ const Rating = ({ settings, onSubmit, className }) => {
50
50
  comment,
51
51
  reasons,
52
52
  max: exports.FEEDBACK_MAX_RATING,
53
+ path: window.location.href,
53
54
  });
54
55
  setIsSubmitted(true);
55
56
  };
@@ -56,6 +56,7 @@ const Scale = ({ settings, onSubmit, className }) => {
56
56
  comment,
57
57
  reasons,
58
58
  max: exports.MAX_SCALE,
59
+ path: window.location.href,
59
60
  });
60
61
  setIsSubmitted(true);
61
62
  };
@@ -54,6 +54,7 @@ const Sentiment = ({ settings, onSubmit, className }) => {
54
54
  score,
55
55
  comment,
56
56
  reasons,
57
+ path: window.location.href,
57
58
  });
58
59
  setIsSubmitted(true);
59
60
  };
@@ -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?: {
@@ -14,11 +14,12 @@ const LastUpdated_1 = require("../../components/LastUpdated/LastUpdated");
14
14
  const hooks_1 = require("../../hooks");
15
15
  const Breadcrumbs_1 = require("../../components/Breadcrumbs");
16
16
  function MarkdownLayout({ tableOfContent, markdownWrapper, feedback, editPage, lastModified, nextPage, prevPage, className, }) {
17
+ var _a;
17
18
  const { markdown } = (0, hooks_1.useThemeConfig)();
18
19
  const { editPage: themeEditPage } = markdown || {};
19
20
  const mergedConf = editPage ? Object.assign(Object.assign({}, themeEditPage), editPage) : undefined;
20
21
  return (react_1.default.createElement(PageWrapper_1.PageWrapper, { "data-component-name": "Markdown/MarkdownLayout", className: className },
21
- react_1.default.createElement(ContainerWrapper_1.ContainerWrapper, { withToc: true },
22
+ react_1.default.createElement(ContainerWrapper_1.ContainerWrapper, { withToc: !((_a = markdown === null || markdown === void 0 ? void 0 : markdown.toc) === null || _a === void 0 ? void 0 : _a.hide) },
22
23
  react_1.default.createElement(Breadcrumbs, null),
23
24
  react_1.default.createElement(LayoutTop, null,
24
25
  lastModified && react_1.default.createElement(LastUpdated_1.LastUpdated, { lastModified: new Date(lastModified) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.27.2",
3
+ "version": "0.27.4",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -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
 
@@ -57,6 +57,7 @@ export const Mood = ({ settings, onSubmit, className }: MoodProps): JSX.Element
57
57
  score: remapScore(score),
58
58
  comment,
59
59
  reasons,
60
+ path: window.location.href,
60
61
  });
61
62
  setIsSubmitted(true);
62
63
  };
@@ -27,6 +27,7 @@ export const Rating = ({ settings, onSubmit, className }: RatingProps): JSX.Elem
27
27
  comment,
28
28
  reasons,
29
29
  max: FEEDBACK_MAX_RATING,
30
+ path: window.location.href,
30
31
  });
31
32
  setIsSubmitted(true);
32
33
  };
@@ -51,6 +51,7 @@ export const Scale = ({ settings, onSubmit, className }: ScaleProps): JSX.Elemen
51
51
  comment,
52
52
  reasons,
53
53
  max: MAX_SCALE,
54
+ path: window.location.href,
54
55
  });
55
56
  setIsSubmitted(true);
56
57
  };
@@ -38,6 +38,7 @@ export const Sentiment = ({ settings, onSubmit, className }: SentimentProps): JS
38
38
  score,
39
39
  comment,
40
40
  reasons,
41
+ path: window.location.href,
41
42
  });
42
43
  setIsSubmitted(true);
43
44
  };
@@ -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: { score: number; comment?: string; reasons?: string[]; max: number }) => void;
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: { score: number; comment?: string; reasons?: string[]; max?: number }) => void;
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;
@@ -42,7 +42,7 @@ export function MarkdownLayout({
42
42
 
43
43
  return (
44
44
  <PageWrapper data-component-name="Markdown/MarkdownLayout" className={className}>
45
- <ContainerWrapper withToc={true}>
45
+ <ContainerWrapper withToc={!markdown?.toc?.hide}>
46
46
  <Breadcrumbs />
47
47
  <LayoutTop>
48
48
  {lastModified && <LastUpdated lastModified={new Date(lastModified)} />}