strapi-plugin-comments 2.1.8 → 2.2.0-beta.0

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.
Files changed (167) hide show
  1. package/README.md +11 -2
  2. package/admin/src/components/Avatar/index.d.ts +3 -2
  3. package/admin/src/components/CommentReviewModal/index.d.ts +11 -0
  4. package/admin/src/components/CommentReviewModal/index.js +19 -0
  5. package/admin/src/components/ConfirmationDialog/index.d.ts +12 -10
  6. package/admin/src/components/ConfirmationDialog/index.js +3 -3
  7. package/admin/src/components/DiscussionStatus/index.d.ts +2 -1
  8. package/admin/src/components/DiscussionThread/index.d.ts +11 -5
  9. package/admin/src/components/DiscussionThread/index.js +3 -3
  10. package/admin/src/components/DiscussionThreadItem/index.d.ts +2 -7
  11. package/admin/src/components/DiscussionThreadItem/index.js +3 -12
  12. package/admin/src/components/DiscussionThreadItemActions/index.d.ts +10 -6
  13. package/admin/src/components/DiscussionThreadItemActions/index.js +75 -53
  14. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +9 -6
  15. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +6 -9
  16. package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +14 -7
  17. package/admin/src/components/DiscussionThreadItemFooter/index.js +3 -3
  18. package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +14 -18
  19. package/admin/src/components/DiscussionThreadItemReviewAction/index.js +71 -52
  20. package/admin/src/components/FormSwitch/index.d.ts +2 -1
  21. package/admin/src/components/Hint/index.d.ts +14 -0
  22. package/admin/src/components/Hint/index.js +22 -0
  23. package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +2 -1
  24. package/admin/src/components/ModeratorResponse/index.d.ts +8 -0
  25. package/admin/src/components/ModeratorResponse/index.js +108 -0
  26. package/admin/src/components/ModeratorResponse/styles.d.ts +2 -0
  27. package/admin/src/components/ModeratorResponse/styles.js +12 -0
  28. package/admin/src/components/ModeratorResponseModal/ModeratorResponseModal.d.ts +11 -0
  29. package/admin/src/components/ModeratorResponseModal/ModeratorResponseModal.js +98 -0
  30. package/admin/src/components/Nav/index.d.ts +2 -1
  31. package/admin/src/components/Nav/index.js +6 -9
  32. package/admin/src/components/PluginIcon/index.d.ts +2 -1
  33. package/admin/src/components/PluginIcon/index.js +2 -6
  34. package/admin/src/components/PreviewWysiwyg/Wrapper.d.ts +3 -0
  35. package/admin/src/components/PreviewWysiwyg/Wrapper.js +162 -0
  36. package/admin/src/components/PreviewWysiwyg/index.d.ts +7 -0
  37. package/admin/src/components/PreviewWysiwyg/index.js +39 -0
  38. package/admin/src/components/PreviewWysiwyg/utils/mdRenderer.d.ts +3 -0
  39. package/admin/src/components/PreviewWysiwyg/utils/mdRenderer.js +88 -0
  40. package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.d.ts +3 -0
  41. package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.js +18 -0
  42. package/admin/src/components/ReportsActions/components/BlockMenu/index.d.ts +16 -0
  43. package/admin/src/components/ReportsActions/components/BlockMenu/index.js +51 -0
  44. package/admin/src/components/ReportsActions/index.d.ts +12 -0
  45. package/admin/src/components/ReportsActions/index.js +31 -0
  46. package/admin/src/components/ReportsReviewModal/index.d.ts +14 -8
  47. package/admin/src/components/ReportsReviewTable/index.d.ts +13 -24
  48. package/admin/src/components/ReportsReviewTable/index.js +11 -24
  49. package/admin/src/components/StatusBadge/index.d.ts +2 -1
  50. package/admin/src/components/TableFilters/index.d.ts +12 -2
  51. package/admin/src/components/TableFilters/index.js +2 -2
  52. package/admin/src/components/TablePagination/index.d.ts +9 -2
  53. package/admin/src/components/Wysiwyg/Editor.d.ts +17 -0
  54. package/admin/src/components/Wysiwyg/Editor.js +84 -0
  55. package/admin/src/components/Wysiwyg/EditorLayout.d.ts +12 -0
  56. package/admin/src/components/Wysiwyg/EditorLayout.js +99 -0
  57. package/admin/src/components/Wysiwyg/EditorStylesContainer.d.ts +2 -0
  58. package/admin/src/components/Wysiwyg/EditorStylesContainer.js +348 -0
  59. package/admin/src/components/Wysiwyg/WysiwygFooter.d.ts +7 -0
  60. package/admin/src/components/Wysiwyg/WysiwygFooter.js +25 -0
  61. package/admin/src/components/Wysiwyg/WysiwygNav.d.ts +13 -0
  62. package/admin/src/components/Wysiwyg/WysiwygNav.js +118 -0
  63. package/admin/src/components/Wysiwyg/WysiwygStyles.d.ts +8 -0
  64. package/admin/src/components/Wysiwyg/WysiwygStyles.js +59 -0
  65. package/admin/src/components/Wysiwyg/index.d.ts +28 -0
  66. package/admin/src/components/Wysiwyg/index.js +136 -0
  67. package/admin/src/components/Wysiwyg/tests/index.test.d.ts +2 -0
  68. package/admin/src/components/Wysiwyg/tests/index.test.js +1633 -0
  69. package/admin/src/components/Wysiwyg/utils/continueList.d.ts +3 -0
  70. package/admin/src/components/Wysiwyg/utils/continueList.js +83 -0
  71. package/admin/src/components/Wysiwyg/utils/utils.d.ts +15 -0
  72. package/admin/src/components/Wysiwyg/utils/utils.js +249 -0
  73. package/admin/src/components/icons/comments.d.ts +2 -1
  74. package/admin/src/components/icons/index.d.ts +2 -5
  75. package/admin/src/components/icons/index.js +24 -12
  76. package/admin/src/components/icons/lock.d.ts +2 -1
  77. package/admin/src/components/icons/review.d.ts +2 -1
  78. package/admin/src/components/icons/strapiIcons.d.ts +24 -0
  79. package/admin/src/components/icons/strapiIcons.js +35 -0
  80. package/admin/src/components/icons/unlock.d.ts +2 -1
  81. package/admin/src/custom-fields/comments/components/icon.d.ts +3 -0
  82. package/admin/src/custom-fields/comments/components/icon.js +14 -0
  83. package/admin/src/custom-fields/comments/components/index.d.ts +3 -0
  84. package/admin/src/custom-fields/comments/components/index.js +19 -0
  85. package/admin/src/custom-fields/comments/components/input/index.d.ts +3 -0
  86. package/admin/src/custom-fields/comments/components/input/index.js +5 -0
  87. package/admin/src/custom-fields/comments/components/input/input.d.ts +4 -0
  88. package/admin/src/custom-fields/comments/components/input/input.js +102 -0
  89. package/admin/src/custom-fields/comments/components/input/types.d.ts +10 -0
  90. package/admin/src/custom-fields/comments/components/input/types.js +3 -0
  91. package/admin/src/custom-fields/comments/components/input/utils.d.ts +35 -0
  92. package/admin/src/custom-fields/comments/components/input/utils.js +146 -0
  93. package/admin/src/custom-fields/comments/index.d.ts +3 -0
  94. package/admin/src/custom-fields/comments/index.js +53 -0
  95. package/admin/src/custom-fields/index.d.ts +3 -0
  96. package/admin/src/custom-fields/index.js +13 -0
  97. package/admin/src/hooks/useConfig.d.ts +4 -4
  98. package/admin/src/hooks/useConfig.js +3 -6
  99. package/admin/src/hooks/useReportsActionsHandlers.d.ts +19 -0
  100. package/admin/src/hooks/useReportsActionsHandlers.js +70 -0
  101. package/admin/src/index.d.ts +2 -1
  102. package/admin/src/index.js +4 -2
  103. package/admin/src/pages/App/index.js +8 -7
  104. package/admin/src/pages/App/reducer/index.d.ts +1 -1
  105. package/admin/src/pages/ComingSoonPage/index.d.ts +2 -1
  106. package/admin/src/pages/ComingSoonPage/index.js +2 -2
  107. package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +8 -6
  108. package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +5 -3
  109. package/admin/src/pages/Details/index.js +10 -7
  110. package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +11 -5
  111. package/admin/src/pages/Discover/components/DiscoverTableRow/index.js +7 -81
  112. package/admin/src/pages/Discover/index.js +14 -13
  113. package/admin/src/pages/NoAccessPage/index.d.ts +4 -0
  114. package/admin/src/pages/NoAccessPage/index.js +31 -0
  115. package/admin/src/pages/Reports/components/ReportsTableRow/index.d.ts +16 -0
  116. package/admin/src/pages/Reports/components/ReportsTableRow/index.js +91 -0
  117. package/admin/src/pages/Reports/components/ReportsTableRow/styles.d.ts +2 -0
  118. package/admin/src/pages/Reports/components/ReportsTableRow/styles.js +14 -0
  119. package/admin/src/pages/Reports/index.d.ts +4 -0
  120. package/admin/src/pages/Reports/index.js +196 -0
  121. package/admin/src/pages/Reports/utils/api.d.ts +2 -0
  122. package/admin/src/pages/Reports/utils/api.js +16 -0
  123. package/admin/src/pages/Reports/utils/filtersSchema.d.ts +11 -0
  124. package/admin/src/pages/Reports/utils/filtersSchema.js +11 -0
  125. package/admin/src/pages/Settings/index.d.ts +2 -1
  126. package/admin/src/pages/Settings/index.js +6 -7
  127. package/admin/src/pages/utils/api.d.ts +17 -10
  128. package/admin/src/pages/utils/api.js +25 -2
  129. package/admin/src/reducers.d.ts +1 -1
  130. package/admin/src/translations/en.json +49 -1
  131. package/admin/src/utils/axiosInstance.d.ts +1 -1
  132. package/admin/src/utils/constants.d.ts +9 -5
  133. package/admin/src/utils/constants.js +5 -3
  134. package/admin/src/utils/errors.d.ts +5 -0
  135. package/admin/src/utils/errors.js +10 -0
  136. package/admin/src/utils/functions.d.ts +2 -0
  137. package/admin/src/utils/functions.js +11 -0
  138. package/admin/src/utils/getMessage.d.ts +1 -1
  139. package/admin/src/utils/getMessage.js +1 -1
  140. package/admin/src/utils/getRelatedGroups.d.ts +6 -2
  141. package/admin/src/utils/handleAPIError.d.ts +1 -1
  142. package/admin/src/utils/index.d.ts +16 -11
  143. package/admin/src/utils/index.js +12 -1
  144. package/admin/src/utils/resolveCommentStatus.d.ts +8 -2
  145. package/admin/src/utils/resolveReportStatus.d.ts +4 -0
  146. package/admin/src/utils/resolveReportStatus.js +23 -0
  147. package/admin/src/utils/resolveReportStatusColor.d.ts +4 -0
  148. package/admin/src/utils/resolveReportStatusColor.js +17 -0
  149. package/package.json +6 -3
  150. package/server/controllers/admin.js +67 -2
  151. package/server/index.d.ts +1 -1
  152. package/server/register/custom-fields/comments.d.ts +6 -0
  153. package/server/register/custom-fields/comments.js +9 -0
  154. package/server/register/custom-fields/index.d.ts +3 -0
  155. package/server/register/custom-fields/index.js +14 -0
  156. package/server/register/index.d.ts +4 -0
  157. package/server/register/index.js +8 -0
  158. package/server/routes/admin.js +56 -0
  159. package/server/services/admin.d.ts +1 -1
  160. package/server/services/admin.js +196 -10
  161. package/server/utils/error.js +1 -1
  162. package/strapi-server.d.ts +1 -1
  163. package/tsconfig.tsbuildinfo +1 -1
  164. package/types/utils.d.ts +5 -0
  165. package/types/utils.js +10 -0
  166. package/server/register.d.ts +0 -3
  167. package/server/register.js +0 -4
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const styled_components_1 = __importDefault(require("styled-components"));
7
+ const Wrapper = styled_components_1.default.div `
8
+ position: absolute;
9
+ top: 0;
10
+ width: 100%;
11
+ height: 100%;
12
+ overflow: auto;
13
+ padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};
14
+ font-size: ${14 / 16}rem;
15
+ background-color: ${({ theme }) => theme.colors.neutral0};
16
+ z-index: 2;
17
+ cursor: not-allowed;
18
+ color: ${({ theme }) => theme.colors.neutral800};
19
+
20
+ h1,
21
+ h2,
22
+ h3,
23
+ h4,
24
+ h5,
25
+ h6 {
26
+ margin-block-start: 10px;
27
+ margin-block-end: 10px;
28
+ }
29
+
30
+ p {
31
+ margin-bottom: 10px;
32
+ }
33
+
34
+ h1 {
35
+ font-size: ${36 / 16}rem;
36
+ font-weight: 600;
37
+ }
38
+
39
+ h2 {
40
+ font-size: ${30 / 16}rem;
41
+ font-weight: 500;
42
+ }
43
+
44
+ h3 {
45
+ font-size: ${24 / 16}rem;
46
+ font-weight: 500;
47
+ }
48
+
49
+ h4 {
50
+ font-size: ${20 / 16}rem;
51
+ font-weight: 500;
52
+ }
53
+
54
+ strong {
55
+ font-weight: 800;
56
+ }
57
+
58
+ em {
59
+ font-style: italic;
60
+ }
61
+
62
+ blockquote {
63
+ margin-top: 41px;
64
+ margin-bottom: 34px;
65
+ font-size: ${14 / 16}rem;
66
+ font-weight: 400;
67
+ border-left: 5px solid #eee;
68
+ font-style: italic;
69
+ padding: 10px 20px;
70
+ }
71
+
72
+ img {
73
+ max-width: 100%;
74
+ }
75
+
76
+ table {
77
+ font-size: 13px;
78
+ thead {
79
+ background: rgb(243, 243, 243);
80
+ tr {
81
+ height: 43px;
82
+ }
83
+ }
84
+ tr {
85
+ border: 1px solid #c6cbd1;
86
+ }
87
+ th,
88
+ td {
89
+ padding: 0 25px;
90
+ border: 1px solid #c6cbd1;
91
+ border-bottom: 0;
92
+ border-top: 0;
93
+ }
94
+
95
+ tbody {
96
+ tr {
97
+ height: 54px;
98
+ }
99
+ }
100
+ }
101
+
102
+ pre,
103
+ code {
104
+ font-size: 13px;
105
+ border-radius: 3px;
106
+ background-color: #002b36;
107
+ }
108
+
109
+ /* Inline code */
110
+ p,
111
+ pre,
112
+ td {
113
+ > code {
114
+ color: #839496;
115
+ }
116
+ }
117
+
118
+ .warning {
119
+ background-color: #faa684;
120
+ padding: 30px;
121
+ border-radius: 3px;
122
+ }
123
+ .tip {
124
+ padding: 30px;
125
+ border-radius: 3px;
126
+ }
127
+
128
+ .footnote-ref,
129
+ .footnote-backref {
130
+ color: #007bff;
131
+ }
132
+
133
+ ol {
134
+ list-style-type: decimal;
135
+ margin-block-start: ${({ theme }) => theme.spaces[4]};
136
+ margin-block-end: ${({ theme }) => theme.spaces[4]};
137
+ margin-inline-start: 0px;
138
+ margin-inline-end: 0px;
139
+ padding-inline-start: ${({ theme }) => theme.spaces[4]};
140
+ ol,
141
+ ul {
142
+ margin-block-start: 0px;
143
+ margin-block-end: 0px;
144
+ }
145
+ }
146
+
147
+ ul {
148
+ list-style-type: disc;
149
+ margin-block-start: ${({ theme }) => theme.spaces[4]};
150
+ margin-block-end: ${({ theme }) => theme.spaces[4]};
151
+ margin-inline-start: 0px;
152
+ margin-inline-end: 0px;
153
+ padding-inline-start: ${({ theme }) => theme.spaces[4]};
154
+ ul,
155
+ ol {
156
+ margin-block-start: 0px;
157
+ margin-block-end: 0px;
158
+ }
159
+ }
160
+ `;
161
+ exports.default = Wrapper;
162
+ //# sourceMappingURL=Wrapper.js.map
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare type PreviewWysiwygProps = {
3
+ data: string;
4
+ };
5
+ declare const _default: React.NamedExoticComponent<PreviewWysiwygProps>;
6
+ export default _default;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,39 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const react_1 = __importStar(require("react"));
30
+ const mdRenderer_1 = __importDefault(require("./utils/mdRenderer"));
31
+ const satinizeHtml_1 = __importDefault(require("./utils/satinizeHtml"));
32
+ const Wrapper_1 = __importDefault(require("./Wrapper"));
33
+ const PreviewWysiwyg = ({ data }) => {
34
+ const html = (0, react_1.useMemo)(() => (0, satinizeHtml_1.default)(mdRenderer_1.default.render(data || '')), [data]);
35
+ return (react_1.default.createElement(Wrapper_1.default, null,
36
+ react_1.default.createElement("div", { dangerouslySetInnerHTML: { __html: html } })));
37
+ };
38
+ exports.default = (0, react_1.memo)(PreviewWysiwyg);
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ declare const md: any;
2
+ export default md;
3
+ //# sourceMappingURL=mdRenderer.d.ts.map
@@ -0,0 +1,88 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const markdown_it_1 = __importDefault(require("markdown-it"));
30
+ const highlight_js_1 = require("highlight.js");
31
+ const markdown_it_abbr_1 = __importDefault(require("markdown-it-abbr"));
32
+ const markdown_it_container_1 = __importDefault(require("markdown-it-container"));
33
+ const markdown_it_deflist_1 = __importDefault(require("markdown-it-deflist"));
34
+ const markdown_it_emoji_1 = __importDefault(require("markdown-it-emoji"));
35
+ const markdown_it_footnote_1 = __importDefault(require("markdown-it-footnote"));
36
+ const markdown_it_ins_1 = __importDefault(require("markdown-it-ins"));
37
+ const markdown_it_mark_1 = __importDefault(require("markdown-it-mark"));
38
+ const markdown_it_sub_1 = __importDefault(require("markdown-it-sub"));
39
+ const markdown_it_sup_1 = __importDefault(require("markdown-it-sup"));
40
+ const loadCss = async () => {
41
+ await Promise.resolve().then(() => __importStar(require('highlight.js/styles/solarized-dark.css')));
42
+ };
43
+ loadCss();
44
+ const md = new markdown_it_1.default({
45
+ html: true,
46
+ xhtmlOut: false,
47
+ breaks: true,
48
+ langPrefix: 'language-',
49
+ linkify: true,
50
+ typographer: true,
51
+ highlight: (str, lang) => {
52
+ if (lang && lang !== 'auto' && (0, highlight_js_1.getLanguage)(lang)) {
53
+ return ('<pre class="hljs language-' +
54
+ md.utils.escapeHtml(lang.toLowerCase()) +
55
+ '"><code>' +
56
+ (0, highlight_js_1.highlight)(lang, str, true).value +
57
+ '</code></pre>');
58
+ }
59
+ if (lang === 'auto') {
60
+ const result = (0, highlight_js_1.highlightAuto)(str);
61
+ return ('<pre class="hljs language-' +
62
+ md.utils.escapeHtml(result.language) +
63
+ '"><code>' +
64
+ result.value +
65
+ '</code></pre>');
66
+ }
67
+ return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
68
+ },
69
+ })
70
+ .use(markdown_it_abbr_1.default)
71
+ .use(markdown_it_container_1.default, 'warning')
72
+ .use(markdown_it_container_1.default, 'tip')
73
+ .use(markdown_it_deflist_1.default)
74
+ .use(markdown_it_emoji_1.default)
75
+ .use(markdown_it_footnote_1.default)
76
+ .use(markdown_it_ins_1.default)
77
+ .use(markdown_it_mark_1.default)
78
+ .use(markdown_it_sub_1.default)
79
+ .use(markdown_it_sup_1.default);
80
+ md.renderer.rules.footnote_ref = (tokens, idx, options, env, slf) => {
81
+ const caption = slf.rules.footnote_caption(tokens, idx, options, env, slf);
82
+ return '<sup class="footnote-ref"><span>' + caption + '</span></sup>';
83
+ };
84
+ md.renderer.rules.footnote_anchor = () => {
85
+ return ' <span class="footnote-backref">\u21a9\uFE0E</span>';
86
+ };
87
+ exports.default = md;
88
+ //# sourceMappingURL=mdRenderer.js.map
@@ -0,0 +1,3 @@
1
+ declare const clean: (dirty: any) => any;
2
+ export default clean;
3
+ //# sourceMappingURL=satinizeHtml.d.ts.map
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const sanitize_html_1 = __importDefault(require("sanitize-html"));
7
+ const options = {
8
+ ...sanitize_html_1.default.defaults,
9
+ allowedTags: false,
10
+ allowedAttributes: {
11
+ '*': ['href', 'align', 'alt', 'center', 'width', 'height', 'type', 'controls', 'target'],
12
+ img: ['src', 'alt'],
13
+ source: ['src', 'type'],
14
+ },
15
+ };
16
+ const clean = dirty => (0, sanitize_html_1.default)(dirty, options);
17
+ exports.default = clean;
18
+ //# sourceMappingURL=satinizeHtml.js.map
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ declare const BlockMenu: ({ handlers: { handleBlockItemClick, handleBlockItemThreadClick, handleClickResolve, handleResolveAllAbuseReportsForComment, handleResolveAllAbuseReportsForThread, handleUnblockItemClick, handleUnblockThreadClick, }, item, type, }: {
3
+ handlers: {
4
+ handleBlockItemClick: any;
5
+ handleBlockItemThreadClick: any;
6
+ handleClickResolve: any;
7
+ handleResolveAllAbuseReportsForComment: any;
8
+ handleResolveAllAbuseReportsForThread: any;
9
+ handleUnblockItemClick: any;
10
+ handleUnblockThreadClick: any;
11
+ };
12
+ item: any;
13
+ type: any;
14
+ }) => JSX.Element;
15
+ export default BlockMenu;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,51 @@
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
+ const react_1 = __importStar(require("react"));
27
+ const SimpleMenu_1 = require("@strapi/design-system/SimpleMenu");
28
+ const utils_1 = require("../../../../utils");
29
+ const iconButtonStyle = { minHeight: "2em", paddingLeft: '5px', paddingRight: "12px" };
30
+ const BlockMenu = ({ handlers: { handleBlockItemClick, handleBlockItemThreadClick, handleClickResolve, handleResolveAllAbuseReportsForComment, handleResolveAllAbuseReportsForThread, handleUnblockItemClick, handleUnblockThreadClick, }, item, type, }) => {
31
+ const { id: reportId, related: { blocked: blockedComment, blockedThread, gotThread, id: commentId } } = item;
32
+ const isIconButton = type === "icon";
33
+ const handleBlockComment = (0, react_1.useCallback)(() => {
34
+ handleBlockItemClick(commentId);
35
+ handleResolveAllAbuseReportsForComment(commentId);
36
+ }, [handleBlockItemClick, handleResolveAllAbuseReportsForComment]);
37
+ const handleUnblockComment = (0, react_1.useCallback)(() => handleUnblockItemClick(commentId), [handleUnblockItemClick]);
38
+ const handleBlockThread = (0, react_1.useCallback)(() => {
39
+ handleBlockItemThreadClick(commentId);
40
+ handleResolveAllAbuseReportsForThread(commentId);
41
+ }, [handleBlockItemThreadClick, handleResolveAllAbuseReportsForThread]);
42
+ const handleUnblockThread = (0, react_1.useCallback)(() => {
43
+ handleUnblockThreadClick(commentId);
44
+ }, [handleUnblockThreadClick]);
45
+ return (react_1.default.createElement(SimpleMenu_1.SimpleMenu, { label: isIconButton ? null : "Block", variant: "danger-light", style: isIconButton ? iconButtonStyle : null },
46
+ !blockedComment ? (react_1.default.createElement(SimpleMenu_1.MenuItem, { disabled: blockedThread, onClick: handleBlockComment }, (0, utils_1.getMessage)("page.details.actions.comment.block", "Block comment"))) : (react_1.default.createElement(SimpleMenu_1.MenuItem, { disabled: blockedThread, onClick: handleUnblockComment }, (0, utils_1.getMessage)("page.details.actions.comment.unblock", "Unblock comment"))),
47
+ gotThread &&
48
+ (!blockedThread ? (react_1.default.createElement(SimpleMenu_1.MenuItem, { onClick: handleBlockThread }, (0, utils_1.getMessage)("page.details.actions.thread.block", "Block thread"))) : (react_1.default.createElement(SimpleMenu_1.MenuItem, { onClick: handleUnblockThread }, (0, utils_1.getMessage)("page.details.actions.thread.unblock", "Unblock thread"))))));
49
+ };
50
+ exports.default = BlockMenu;
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ declare const ReportsActions: ({ allowedActions, item, mutation, onSelectionChange, reports, selectedReports, updateReports, }: {
3
+ allowedActions: any;
4
+ item: any;
5
+ mutation: any;
6
+ onSelectionChange: any;
7
+ reports: any;
8
+ selectedReports: any;
9
+ updateReports: any;
10
+ }) => JSX.Element;
11
+ export default ReportsActions;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const styles_1 = require("../ActionButton/styles");
8
+ const Flex_1 = require("@strapi/design-system/Flex");
9
+ const icons_1 = require("../icons");
10
+ const utils_1 = require("../../utils");
11
+ const useReportsActionsHandlers_1 = __importDefault(require("../../hooks/useReportsActionsHandlers"));
12
+ const BlockMenu_1 = __importDefault(require("./components/BlockMenu"));
13
+ const ReportsActions = ({ allowedActions, item, mutation, onSelectionChange, reports, selectedReports, updateReports, }) => {
14
+ const { id: reportId, resolved, related: { blocked: blockedComment, blockedThread, gotThread, id: commentId } } = item;
15
+ const handlers = (0, useReportsActionsHandlers_1.default)({
16
+ allowedActions,
17
+ commentId,
18
+ mutation,
19
+ onSelectionChange,
20
+ reports,
21
+ selectedReports,
22
+ updateReports
23
+ });
24
+ const { handleClickResolve } = handlers;
25
+ return (react_1.default.createElement(Flex_1.Flex, null,
26
+ !resolved ? (react_1.default.createElement(styles_1.ActionButton, { isSingle: true, onClick: () => handleClickResolve(reportId), startIcon: icons_1.check, variant: "success" }, (0, utils_1.getMessage)("page.details.panel.discussion.warnings.reports.dialog.actions.resolve", "resolve"))) : (react_1.default.createElement(BlockMenu_1.default, { handlers: handlers, item: item })),
27
+ !resolved &&
28
+ react_1.default.createElement(BlockMenu_1.default, { handlers: handlers, item: item, type: "icon" })));
29
+ };
30
+ exports.default = ReportsActions;
31
+ //# sourceMappingURL=index.js.map
@@ -1,3 +1,5 @@
1
+ /// <reference types="react" />
2
+ import PropTypes from "prop-types";
1
3
  declare const ReportsReviewModal: {
2
4
  ({ isVisible, item, children, onClose, startActions, endActions, }: {
3
5
  isVisible?: boolean | undefined;
@@ -6,15 +8,19 @@ declare const ReportsReviewModal: {
6
8
  onClose: any;
7
9
  startActions: any;
8
10
  endActions: any;
9
- }): any;
11
+ }): false | JSX.Element;
10
12
  propTypes: {
11
- isVisible: any;
12
- startActions: any;
13
- endActions: any;
14
- item: any;
15
- children: any;
16
- allowedActions: any;
17
- onClose: any;
13
+ isVisible: PropTypes.Requireable<boolean>;
14
+ startActions: PropTypes.Requireable<any[]>;
15
+ endActions: PropTypes.Requireable<any[]>;
16
+ item: PropTypes.Validator<object>;
17
+ children: PropTypes.Validator<any[]>;
18
+ allowedActions: PropTypes.Requireable<PropTypes.InferProps<{
19
+ canModerate: PropTypes.Requireable<boolean>;
20
+ canAccessReports: PropTypes.Requireable<boolean>;
21
+ canReviewReports: PropTypes.Requireable<boolean>;
22
+ }>>;
23
+ onClose: PropTypes.Validator<(...args: any[]) => any>;
18
24
  };
19
25
  };
20
26
  export default ReportsReviewModal;
@@ -1,27 +1,16 @@
1
- declare const ReportsReviewTable: {
2
- ({ commentId, items, selectedItems, mutation, updateItems, allowedActions: { canAccessReports, canReviewReports }, onBlockButtonsStateChange, onSelectionChange, }: {
3
- commentId: any;
4
- items: any;
5
- selectedItems?: never[] | undefined;
6
- mutation: any;
7
- updateItems: any;
8
- allowedActions: {
9
- canAccessReports: any;
10
- canReviewReports: any;
11
- };
12
- onBlockButtonsStateChange: any;
13
- onSelectionChange: any;
14
- }): any;
15
- propTypes: {
16
- commentId: any;
17
- items: any;
18
- selectedItems: any;
19
- mutation: any;
20
- allowedActions: any;
21
- onBlockButtonsStateChange: any;
22
- onSelectionChange: any;
23
- updateItems: any;
1
+ /// <reference types="react" />
2
+ declare const ReportsReviewTable: ({ commentId, items, selectedItems, mutation, updateItems, allowedActions: { canAccessReports, canReviewReports }, onBlockButtonsStateChange, onSelectionChange, }: {
3
+ commentId: any;
4
+ items: any;
5
+ selectedItems?: never[] | undefined;
6
+ mutation: any;
7
+ updateItems: any;
8
+ allowedActions: {
9
+ canAccessReports: any;
10
+ canReviewReports: any;
24
11
  };
25
- };
12
+ onBlockButtonsStateChange: any;
13
+ onSelectionChange: any;
14
+ }) => JSX.Element | null;
26
15
  export default ReportsReviewTable;
27
16
  //# sourceMappingURL=index.d.ts.map
@@ -28,14 +28,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const react_1 = __importStar(require("react"));
30
30
  const react_intl_1 = require("react-intl");
31
- const prop_types_1 = __importDefault(require("prop-types"));
32
31
  const lodash_1 = require("lodash");
33
32
  const BaseCheckbox_1 = require("@strapi/design-system/BaseCheckbox");
34
33
  const Flex_1 = require("@strapi/design-system/Flex");
35
34
  const Table_1 = require("@strapi/design-system/Table");
36
35
  const Typography_1 = require("@strapi/design-system/Typography");
37
36
  const VisuallyHidden_1 = require("@strapi/design-system/VisuallyHidden");
38
- const icons_1 = require("@strapi/icons");
37
+ const icons_1 = require("../icons");
39
38
  const helper_plugin_1 = require("@strapi/helper-plugin");
40
39
  const utils_1 = require("../../utils");
41
40
  const constants_1 = require("../../utils/constants");
@@ -72,15 +71,15 @@ const ReportsReviewTable = ({ commentId, items, selectedItems = [], mutation, up
72
71
  onSelectionChange(value ? selection : []);
73
72
  }
74
73
  else {
75
- onSelectionChange([...selectedItems, selection].filter(item => value || selection !== item));
74
+ onSelectionChange([...selectedItems, selection].filter((item) => value || selection !== item));
76
75
  }
77
76
  };
78
- const isNotResolved = entry => !entry.resolved;
77
+ const isNotResolved = (entry) => !entry.resolved;
79
78
  const unresolvedItems = items.filter(isNotResolved);
80
- const areAllItemsSelected = () => !(0, lodash_1.isEmpty)(selectedItems) ?
81
- selectedItems.length === unresolvedItems.length :
82
- false;
83
- const isItemSelected = id => selectedItems.includes(id);
79
+ const areAllItemsSelected = () => !(0, lodash_1.isEmpty)(selectedItems)
80
+ ? selectedItems.length === unresolvedItems.length
81
+ : false;
82
+ const isItemSelected = (id) => selectedItems.includes(id);
84
83
  const handleClickResolve = async (reportId) => {
85
84
  if (canReviewReports) {
86
85
  lockApp();
@@ -94,11 +93,12 @@ const ReportsReviewTable = ({ commentId, items, selectedItems = [], mutation, up
94
93
  resolved: reportId === _.id ? true : _.resolved,
95
94
  }));
96
95
  updateItems(updatedItems);
97
- onSelectionChange(selectedItems.filter(_ => _ !== reportId));
96
+ onSelectionChange(selectedItems.filter((_) => _ !== reportId));
98
97
  onBlockButtonsStateChange(updatedItems.filter(isNotResolved).length === 0);
99
98
  }
100
99
  }
101
100
  };
101
+ const handleValueChange = (0, react_1.useCallback)((value) => handleItemSelectionChange(unresolvedItems.map((_) => _.id), value), [unresolvedItems, handleItemSelectionChange]);
102
102
  if ((0, lodash_1.isEmpty)(items)) {
103
103
  return null;
104
104
  }
@@ -108,7 +108,7 @@ const ReportsReviewTable = ({ commentId, items, selectedItems = [], mutation, up
108
108
  react_1.default.createElement(Table_1.Thead, null,
109
109
  react_1.default.createElement(Table_1.Tr, null,
110
110
  react_1.default.createElement(Table_1.Th, null,
111
- react_1.default.createElement(BaseCheckbox_1.BaseCheckbox, { "aria-label": (0, utils_1.getMessage)("page.details.panel.discussion.warnings.reports.dialog.selectAll"), value: areAllItemsSelected(), disabled: (0, lodash_1.isEmpty)(unresolvedItems), onValueChange: (0, react_1.useCallback)((value) => handleItemSelectionChange(unresolvedItems.map(_ => _.id), value), [unresolvedItems]) })),
111
+ react_1.default.createElement(BaseCheckbox_1.BaseCheckbox, { "aria-label": (0, utils_1.getMessage)("page.details.panel.discussion.warnings.reports.dialog.selectAll"), value: areAllItemsSelected(), disabled: (0, lodash_1.isEmpty)(unresolvedItems), onValueChange: handleValueChange })),
112
112
  react_1.default.createElement(Table_1.Th, null,
113
113
  react_1.default.createElement(Typography_1.Typography, { variant: "sigma" }, (0, utils_1.getMessage)("page.details.panel.discussion.warnings.reports.dialog.reason"))),
114
114
  react_1.default.createElement(Table_1.Th, null,
@@ -133,22 +133,9 @@ const ReportsReviewTable = ({ commentId, items, selectedItems = [], mutation, up
133
133
  }))),
134
134
  react_1.default.createElement(Table_1.Td, null, renderStatus(entry.resolved)),
135
135
  canReviewReports && (react_1.default.createElement(Table_1.Td, null, !entry.resolved && (react_1.default.createElement(Flex_1.Flex, { direction: "column", alignItems: "flex-end" },
136
- react_1.default.createElement(styles_1.ActionButton, { isSingle: true, onClick: () => handleClickResolve(entry.id), startIcon: react_1.default.createElement(icons_1.Check, null), variant: "success" }, (0, utils_1.getMessage)("page.details.panel.discussion.warnings.reports.dialog.actions.resolve", "resolve"))))))))))));
136
+ react_1.default.createElement(styles_1.ActionButton, { isSingle: true, onClick: () => handleClickResolve(entry.id), startIcon: icons_1.check, variant: "success" }, (0, utils_1.getMessage)("page.details.panel.discussion.warnings.reports.dialog.actions.resolve", "resolve"))))))))))));
137
137
  }
138
138
  return null;
139
139
  };
140
- ReportsReviewTable.propTypes = {
141
- commentId: prop_types_1.default.oneOfType(prop_types_1.default.string, prop_types_1.default.number).isRequired,
142
- items: prop_types_1.default.array.isRequired,
143
- selectedItems: prop_types_1.default.array.isRequired,
144
- mutation: prop_types_1.default.func.isRequired,
145
- allowedActions: prop_types_1.default.shape({
146
- canAccessReports: prop_types_1.default.bool,
147
- canReviewReports: prop_types_1.default.bool,
148
- }),
149
- onBlockButtonsStateChange: prop_types_1.default.func.isRequired,
150
- onSelectionChange: prop_types_1.default.func.isRequired,
151
- updateItems: prop_types_1.default.func.isRequired,
152
- };
153
140
  exports.default = ReportsReviewTable;
154
141
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,8 @@
1
+ /// <reference types="react" />
1
2
  declare const StatusBadge: ({ children, textColor, ...rest }: {
2
3
  [x: string]: any;
3
4
  children: any;
4
5
  textColor: any;
5
- }) => any;
6
+ }) => JSX.Element;
6
7
  export default StatusBadge;
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,19 @@
1
+ /// <reference types="react" />
2
+ import PropTypes from "prop-types";
1
3
  declare const TableFilters: {
2
4
  ({ displayedFilters }: {
3
5
  displayedFilters: any;
4
- }): any;
6
+ }): JSX.Element;
5
7
  propTypes: {
6
- displayedFilters: any;
8
+ displayedFilters: PropTypes.Validator<(PropTypes.InferProps<{
9
+ name: PropTypes.Validator<string>;
10
+ metadatas: PropTypes.Requireable<PropTypes.InferProps<{
11
+ label: PropTypes.Requireable<string>;
12
+ }>>;
13
+ fieldSchema: PropTypes.Requireable<PropTypes.InferProps<{
14
+ type: PropTypes.Requireable<string>;
15
+ }>>;
16
+ }> | null | undefined)[]>;
7
17
  };
8
18
  };
9
19
  export default TableFilters;
@@ -30,7 +30,7 @@ const react_1 = __importStar(require("react"));
30
30
  const prop_types_1 = __importDefault(require("prop-types"));
31
31
  const Button_1 = require("@strapi/design-system/Button");
32
32
  const Box_1 = require("@strapi/design-system/Box");
33
- const icons_1 = require("@strapi/icons");
33
+ const icons_1 = require("../icons");
34
34
  const helper_plugin_1 = require("@strapi/helper-plugin");
35
35
  const utils_1 = require("../../utils");
36
36
  const TableFilters = ({ displayedFilters }) => {
@@ -41,7 +41,7 @@ const TableFilters = ({ displayedFilters }) => {
41
41
  };
42
42
  return (react_1.default.createElement(react_1.default.Fragment, null,
43
43
  react_1.default.createElement(Box_1.Box, { paddingTop: 1, paddingBottom: 1 },
44
- react_1.default.createElement(Button_1.Button, { variant: "tertiary", ref: buttonRef, startIcon: react_1.default.createElement(icons_1.Filter, null), onClick: handleToggle, size: "S" }, (0, utils_1.getMessage)("page.discover.table.filters")),
44
+ react_1.default.createElement(Button_1.Button, { variant: "tertiary", ref: buttonRef, startIcon: icons_1.filter, onClick: handleToggle, size: "S" }, (0, utils_1.getMessage)("page.discover.table.filters")),
45
45
  isVisible && (react_1.default.createElement(helper_plugin_1.FilterPopoverURLQuery, { displayedFilters: displayedFilters, isVisible: isVisible, onToggle: handleToggle, source: buttonRef }))),
46
46
  react_1.default.createElement(helper_plugin_1.FilterListURLQuery, { filtersSchema: displayedFilters })));
47
47
  };