strapi-plugin-comments 2.2.15 → 2.2.17

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 (73) hide show
  1. package/README.md +4 -4
  2. package/admin/src/components/CommentReviewModal/index.d.ts +0 -1
  3. package/admin/src/components/ConfirmationDialog/index.d.ts +0 -1
  4. package/admin/src/components/DiscussionStatus/index.d.ts +0 -1
  5. package/admin/src/components/DiscussionThread/index.d.ts +0 -1
  6. package/admin/src/components/DiscussionThreadItem/index.d.ts +0 -1
  7. package/admin/src/components/DiscussionThreadItemActions/index.d.ts +0 -1
  8. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +0 -1
  9. package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +0 -1
  10. package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +0 -1
  11. package/admin/src/components/FormSwitch/index.d.ts +0 -1
  12. package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +0 -1
  13. package/admin/src/components/ModeratorResponse/index.js +5 -8
  14. package/admin/src/components/ModeratorResponseModal/ModeratorResponseModal.js +5 -8
  15. package/admin/src/components/Nav/index.d.ts +0 -1
  16. package/admin/src/components/PluginIcon/index.d.ts +0 -1
  17. package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.d.ts +18 -1
  18. package/admin/src/components/ReportsActions/components/BlockMenu/index.d.ts +0 -1
  19. package/admin/src/components/ReportsActions/index.d.ts +0 -1
  20. package/admin/src/components/ReportsReviewModal/index.d.ts +0 -1
  21. package/admin/src/components/ReportsReviewTable/index.d.ts +0 -1
  22. package/admin/src/components/StatusBadge/index.d.ts +0 -1
  23. package/admin/src/components/TableFilters/index.d.ts +0 -1
  24. package/admin/src/components/TablePagination/index.d.ts +0 -1
  25. package/admin/src/components/Wysiwyg/Editor.d.ts +24 -12
  26. package/admin/src/components/Wysiwyg/Editor.js +375 -21
  27. package/admin/src/components/Wysiwyg/EditorLayout.d.ts +9 -8
  28. package/admin/src/components/Wysiwyg/EditorLayout.js +37 -51
  29. package/admin/src/components/Wysiwyg/Field.d.ts +15 -0
  30. package/admin/src/components/Wysiwyg/{index.js → Field.js} +48 -49
  31. package/admin/src/components/Wysiwyg/PreviewWysiwyg.d.ts +6 -0
  32. package/admin/src/components/Wysiwyg/PreviewWysiwyg.js +191 -0
  33. package/admin/src/components/Wysiwyg/WysiwygFooter.d.ts +7 -6
  34. package/admin/src/components/Wysiwyg/WysiwygFooter.js +32 -13
  35. package/admin/src/components/Wysiwyg/WysiwygNav.d.ts +12 -10
  36. package/admin/src/components/Wysiwyg/WysiwygNav.js +76 -58
  37. package/admin/src/components/Wysiwyg/WysiwygStyles.d.ts +0 -1
  38. package/admin/src/components/Wysiwyg/WysiwygStyles.js +8 -13
  39. package/admin/src/components/Wysiwyg/utils/continueList.d.ts +5 -2
  40. package/admin/src/components/Wysiwyg/utils/continueList.js +2 -1
  41. package/admin/src/components/Wysiwyg/utils/mdRenderer.d.ts +5 -0
  42. package/admin/src/components/Wysiwyg/utils/mdRenderer.js +63 -0
  43. package/admin/src/components/Wysiwyg/utils/utils.d.ts +11 -9
  44. package/admin/src/components/Wysiwyg/utils/utils.js +13 -12
  45. package/admin/src/components/icons/comments.d.ts +0 -1
  46. package/admin/src/components/icons/lock.d.ts +0 -1
  47. package/admin/src/components/icons/review.d.ts +0 -1
  48. package/admin/src/components/icons/strapiIcons.d.ts +0 -1
  49. package/admin/src/components/icons/unlock.d.ts +0 -1
  50. package/admin/src/custom-fields/comments/components/icon.d.ts +0 -1
  51. package/admin/src/index.d.ts +3 -1
  52. package/admin/src/index.js +1 -1
  53. package/admin/src/pages/App/index.d.ts +14 -2
  54. package/admin/src/pages/App/reducer/selectors.d.ts +5 -1
  55. package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +0 -1
  56. package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +0 -1
  57. package/admin/src/pages/Details/index.d.ts +9 -2
  58. package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +0 -1
  59. package/admin/src/pages/Discover/index.d.ts +9 -2
  60. package/admin/src/pages/NoAccessPage/index.d.ts +0 -1
  61. package/admin/src/pages/Reports/components/ReportsTableRow/index.d.ts +0 -1
  62. package/admin/src/pages/Reports/index.d.ts +9 -2
  63. package/admin/src/pages/Settings/index.d.ts +0 -1
  64. package/admin/src/pages/Settings/index.js +2 -5
  65. package/admin/src/permissions.js +0 -1
  66. package/package.json +9 -10
  67. package/server/services/common.js +3 -4
  68. package/tsconfig.tsbuildinfo +1 -1
  69. package/admin/src/components/Wysiwyg/EditorStylesContainer.d.ts +0 -2
  70. package/admin/src/components/Wysiwyg/EditorStylesContainer.js +0 -348
  71. package/admin/src/components/Wysiwyg/index.d.ts +0 -28
  72. package/admin/src/components/Wysiwyg/tests/index.test.d.ts +0 -2
  73. package/admin/src/components/Wysiwyg/tests/index.test.js +0 -1633
@@ -3,11 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ExpandButton = exports.EditorAndPreviewWrapper = exports.IconButtonGroupMargin = exports.MoreButton = exports.MainButtons = exports.CustomLinkIconButton = exports.CustomIconButton = void 0;
6
+ exports.ExpandButton = exports.IconButtonGroupMargin = exports.MoreButton = exports.MainButtons = exports.CustomLinkIconButton = exports.CustomIconButton = void 0;
7
+ const design_system_1 = require("@strapi/design-system");
7
8
  const styled_components_1 = __importDefault(require("styled-components"));
8
- const IconButton_1 = require("@strapi/design-system/IconButton");
9
- const BaseButton_1 = require("@strapi/design-system/BaseButton");
10
- exports.CustomIconButton = (0, styled_components_1.default)(IconButton_1.IconButton) `
9
+ exports.CustomIconButton = (0, styled_components_1.default)(design_system_1.IconButton) `
11
10
  padding: ${({ theme }) => theme.spaces[2]};
12
11
  /* Trick to prevent the outline from overflowing because of the general outline-offset */
13
12
  outline-offset: -2px !important;
@@ -23,10 +22,10 @@ exports.CustomLinkIconButton = (0, styled_components_1.default)(exports.CustomIc
23
22
  height: ${8 / 16}rem;
24
23
  }
25
24
  `;
26
- exports.MainButtons = (0, styled_components_1.default)(IconButton_1.IconButtonGroup) `
27
-
25
+ exports.MainButtons = (0, styled_components_1.default)(design_system_1.IconButtonGroup) `
26
+ margin-left: ${({ theme }) => theme.spaces[4]};
28
27
  `;
29
- exports.MoreButton = (0, styled_components_1.default)(IconButton_1.IconButton) `
28
+ exports.MoreButton = (0, styled_components_1.default)(design_system_1.IconButton) `
30
29
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
31
30
  padding: ${({ theme }) => theme.spaces[2]};
32
31
 
@@ -35,14 +34,10 @@ exports.MoreButton = (0, styled_components_1.default)(IconButton_1.IconButton) `
35
34
  height: ${18 / 16}rem;
36
35
  }
37
36
  `;
38
- exports.IconButtonGroupMargin = (0, styled_components_1.default)(IconButton_1.IconButtonGroup) `
37
+ exports.IconButtonGroupMargin = (0, styled_components_1.default)(design_system_1.IconButtonGroup) `
39
38
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
40
39
  `;
41
- exports.EditorAndPreviewWrapper = styled_components_1.default.div `
42
- position: relative;
43
- height: calc(100% - 48px);
44
- `;
45
- exports.ExpandButton = (0, styled_components_1.default)(BaseButton_1.BaseButton) `
40
+ exports.ExpandButton = (0, styled_components_1.default)(design_system_1.BaseButton) `
46
41
  background-color: transparent;
47
42
  border: none;
48
43
  align-items: center;
@@ -1,3 +1,6 @@
1
- declare function newlineAndIndentContinueMarkdownList(cm: any): any;
2
- export default newlineAndIndentContinueMarkdownList;
1
+ import CodeMirror from 'codemirror5';
2
+ declare function newlineAndIndentContinueMarkdownList(cm: CodeMirror.Editor): {
3
+ toString(): "CodeMirror.PASS";
4
+ } | undefined;
5
+ export { newlineAndIndentContinueMarkdownList };
3
6
  //# sourceMappingURL=continueList.d.ts.map
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.newlineAndIndentContinueMarkdownList = void 0;
6
7
  const codemirror5_1 = __importDefault(require("codemirror5"));
7
8
  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
8
9
  function newlineAndIndentContinueMarkdownList(cm) {
@@ -44,6 +45,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
44
45
  }
45
46
  cm.replaceSelections(replacements);
46
47
  }
48
+ exports.newlineAndIndentContinueMarkdownList = newlineAndIndentContinueMarkdownList;
47
49
  function incrementRemainingMarkdownListNumbers(cm, pos) {
48
50
  var startLine = pos.line, lookAhead = 0, skipCount = 0;
49
51
  var startItem = listRE.exec(cm.getLine(startLine)), startIndent = startItem[1];
@@ -79,5 +81,4 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
79
81
  }
80
82
  } while (nextItem);
81
83
  }
82
- exports.default = newlineAndIndentContinueMarkdownList;
83
84
  //# sourceMappingURL=continueList.js.map
@@ -0,0 +1,5 @@
1
+ import Markdown from 'markdown-it';
2
+ import 'highlight.js/styles/solarized-dark.css';
3
+ declare const md: Markdown;
4
+ export { md };
5
+ //# sourceMappingURL=mdRenderer.d.ts.map
@@ -0,0 +1,63 @@
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
+ exports.md = void 0;
7
+ const highlight_js_1 = require("highlight.js");
8
+ const markdown_it_1 = __importDefault(require("markdown-it"));
9
+ const markdown_it_abbr_1 = __importDefault(require("markdown-it-abbr"));
10
+ const markdown_it_container_1 = __importDefault(require("markdown-it-container"));
11
+ const markdown_it_deflist_1 = __importDefault(require("markdown-it-deflist"));
12
+ const markdown_it_emoji_1 = __importDefault(require("markdown-it-emoji"));
13
+ const markdown_it_footnote_1 = __importDefault(require("markdown-it-footnote"));
14
+ const markdown_it_ins_1 = __importDefault(require("markdown-it-ins"));
15
+ const markdown_it_mark_1 = __importDefault(require("markdown-it-mark"));
16
+ const markdown_it_sub_1 = __importDefault(require("markdown-it-sub"));
17
+ const markdown_it_sup_1 = __importDefault(require("markdown-it-sup"));
18
+ require("highlight.js/styles/solarized-dark.css");
19
+ const md = new markdown_it_1.default({
20
+ html: true,
21
+ xhtmlOut: false,
22
+ breaks: true,
23
+ langPrefix: 'language-',
24
+ linkify: true,
25
+ typographer: true,
26
+ highlight(str, lang) {
27
+ if (lang && lang !== 'auto' && (0, highlight_js_1.getLanguage)(lang)) {
28
+ return ('<pre class="hljs language-' +
29
+ md.utils.escapeHtml(lang.toLowerCase()) +
30
+ '"><code>' +
31
+ (0, highlight_js_1.highlight)(lang, str, true).value +
32
+ '</code></pre>');
33
+ }
34
+ if (lang === 'auto') {
35
+ const result = (0, highlight_js_1.highlightAuto)(str);
36
+ return ('<pre class="hljs language-' +
37
+ md.utils.escapeHtml(result.language) +
38
+ '"><code>' +
39
+ result.value +
40
+ '</code></pre>');
41
+ }
42
+ return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
43
+ },
44
+ })
45
+ .use(markdown_it_abbr_1.default)
46
+ .use(markdown_it_container_1.default, 'warning')
47
+ .use(markdown_it_container_1.default, 'tip')
48
+ .use(markdown_it_deflist_1.default)
49
+ .use(markdown_it_emoji_1.default)
50
+ .use(markdown_it_footnote_1.default)
51
+ .use(markdown_it_ins_1.default)
52
+ .use(markdown_it_mark_1.default)
53
+ .use(markdown_it_sub_1.default)
54
+ .use(markdown_it_sup_1.default);
55
+ exports.md = md;
56
+ md.renderer.rules.footnote_ref = (tokens, idx, options, env, slf) => {
57
+ const caption = slf.rules.footnote_caption?.(tokens, idx, options, env, slf);
58
+ return '<sup class="footnote-ref"><span>' + caption + '</span></sup>';
59
+ };
60
+ md.renderer.rules.footnote_anchor = () => {
61
+ return ' <span class="footnote-backref">\u21a9\uFE0E</span>';
62
+ };
63
+ //# sourceMappingURL=mdRenderer.js.map
@@ -1,15 +1,17 @@
1
- export declare const replaceText: (markdownName: any, textToChange: any) => any;
2
- export declare const insertText: (markdownName: any) => {
1
+ import { MutableRefObject } from 'react';
2
+ import CodeMirror from 'codemirror5';
3
+ export declare const replaceText: (markdownName: string, textToChange: string) => string;
4
+ export declare const insertText: (markdownName: string) => {
3
5
  editedText: string;
4
6
  selection: {
5
- start: any;
7
+ start: number;
6
8
  end: number;
7
9
  };
8
10
  };
9
- export declare const insertListOrTitle: (markdown: any) => string;
10
- export declare const markdownHandler: (editor: any, markdownType: any) => void;
11
- export declare const listHandler: (editor: any, listType: any) => void;
12
- export declare const titleHandler: (editor: any, titleType: any) => void;
13
- export declare const insertFile: (editor: any, files: any) => void;
14
- export declare const quoteAndCodeHandler: (editor: any, markdownType: any) => void;
11
+ export declare const insertListOrTitle: (markdown: string) => string;
12
+ export declare const markdownHandler: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, markdownType: string) => void;
13
+ export declare const listHandler: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, listType: string) => void;
14
+ export declare const titleHandler: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, titleType: string) => void;
15
+ export declare const insertFile: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, files: any[]) => void;
16
+ export declare const quoteAndCodeHandler: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, markdownType: string) => void;
15
17
  //# sourceMappingURL=utils.d.ts.map
@@ -31,9 +31,9 @@ const replaceText = (markdownName, textToChange) => {
31
31
  return editedText;
32
32
  };
33
33
  exports.replaceText = replaceText;
34
- const insertText = markdownName => {
34
+ const insertText = (markdownName) => {
35
35
  let editedText;
36
- let selection = { start: markdownName.length, end: 0 };
36
+ const selection = { start: markdownName.length, end: 0 };
37
37
  switch (markdownName) {
38
38
  case 'Strikethrough':
39
39
  editedText = `~~${markdownName}~~`;
@@ -73,7 +73,7 @@ const insertText = markdownName => {
73
73
  return { editedText, selection };
74
74
  };
75
75
  exports.insertText = insertText;
76
- const insertListOrTitle = markdown => {
76
+ const insertListOrTitle = (markdown) => {
77
77
  let textToInsert;
78
78
  switch (markdown) {
79
79
  case 'BulletList':
@@ -152,7 +152,7 @@ const listHandler = (editor, listType) => {
152
152
  });
153
153
  }
154
154
  else {
155
- let { line: currentLine } = doc.getCursor();
155
+ const { line: currentLine } = doc.getCursor();
156
156
  const listToInsert = (0, exports.insertListOrTitle)(listType);
157
157
  const lineContent = editor.current.getLine(currentLine);
158
158
  const textToInsert = listToInsert + lineContent;
@@ -163,7 +163,7 @@ const listHandler = (editor, listType) => {
163
163
  };
164
164
  exports.listHandler = listHandler;
165
165
  const titleHandler = (editor, titleType) => {
166
- let { line: currentLine } = editor.current.getCursor();
166
+ const { line: currentLine } = editor.current.getCursor();
167
167
  const titleToInsert = (0, exports.insertListOrTitle)(titleType);
168
168
  const lineContent = editor.current.getLine(currentLine);
169
169
  const lineWithNoTitle = lineContent.replace(/#{1,6}\s/g, '').trim();
@@ -178,7 +178,8 @@ const titleHandler = (editor, titleType) => {
178
178
  };
179
179
  exports.titleHandler = titleHandler;
180
180
  const insertFile = (editor, files) => {
181
- let { line, ch } = editor.current.getCursor();
181
+ let { line } = editor.current.getCursor();
182
+ const { ch } = editor.current.getCursor();
182
183
  files.forEach((file, i) => {
183
184
  let contentLength = editor.current.getLine(line).length;
184
185
  editor.current.setCursor({ line, ch: contentLength });
@@ -207,7 +208,7 @@ const insertWithTextToEdit = (editor, markdownType, line, contentLength, textToE
207
208
  editor.current.replaceSelection('\n');
208
209
  editor.current.replaceSelection(textToInsert);
209
210
  if (markdownType === 'Code') {
210
- let { line: newLine } = editor.current.getCursor();
211
+ const { line: newLine } = editor.current.getCursor();
211
212
  editor.current.setCursor({ line: newLine - 1, ch: textToEdit.length });
212
213
  }
213
214
  editor.current.replaceRange(contentToMove, { line: line + 4, ch: 0 }, { line: Infinity, ch: Infinity });
@@ -226,9 +227,9 @@ const insertWithoutTextToEdit = (editor, markdownType, line, contentLength) => {
226
227
  }
227
228
  else {
228
229
  line += 1;
229
- let { ch } = editor.current.getCursor();
230
- let endSelection = ch - textToInsert.selection.end;
231
- let startSelection = ch - textToInsert.selection.end - textToInsert.selection.start;
230
+ const { ch } = editor.current.getCursor();
231
+ const endSelection = ch - textToInsert.selection.end;
232
+ const startSelection = ch - textToInsert.selection.end - textToInsert.selection.start;
232
233
  editor.current.setSelection({ line, ch: startSelection }, { line, ch: endSelection });
233
234
  }
234
235
  editor.current.replaceRange(contentToMove, { line: line + 2, ch: 0 }, { line: Infinity, ch: Infinity });
@@ -236,8 +237,8 @@ const insertWithoutTextToEdit = (editor, markdownType, line, contentLength) => {
236
237
  };
237
238
  const quoteAndCodeHandler = (editor, markdownType) => {
238
239
  const textToEdit = editor.current.getSelection();
239
- let { line } = editor.current.getCursor();
240
- let contentLength = editor.current.getLine(line).length;
240
+ const { line } = editor.current.getCursor();
241
+ const contentLength = editor.current.getLine(line).length;
241
242
  if (textToEdit) {
242
243
  insertWithTextToEdit(editor, markdownType, line, contentLength, textToEdit);
243
244
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const CommentsIcon: ({ width, height }: {
3
2
  width?: number | undefined;
4
3
  height?: number | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const LockIcon: ({ width, height, size }: {
3
2
  width: any;
4
3
  height: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ReviewIcon: ({ width, height, size }: {
3
2
  width: any;
4
3
  height: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const apps: JSX.Element;
3
2
  export declare const arrowLeft: JSX.Element;
4
3
  export declare const arrowRight: JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const UnlockIcon: ({ width, height, size }: {
3
2
  width: any;
4
3
  height: any;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  export declare const CustomFieldIcon: () => JSX.Element;
3
2
  //# sourceMappingURL=icon.d.ts.map
@@ -5,7 +5,9 @@ declare const _default: {
5
5
  registerTrads({ locales }: {
6
6
  locales: Array<TranslationKey>;
7
7
  }): {
8
- data: any;
8
+ data: {
9
+ [x: string]: string;
10
+ };
9
11
  locale: string;
10
12
  }[];
11
13
  };
@@ -88,7 +88,7 @@ exports.default = {
88
88
  .filter((locale) => Object.keys(translations_1.default).includes(locale))
89
89
  .map((locale) => {
90
90
  return {
91
- data: (0, helper_plugin_1.prefixPluginTranslations)((0, lodash_1.get)(translations_1.default, locale, translations_1.default.en), pluginId_1.pluginId, {}),
91
+ data: (0, helper_plugin_1.prefixPluginTranslations)((0, lodash_1.get)(translations_1.default, locale, translations_1.default.en), pluginId_1.pluginId),
92
92
  locale,
93
93
  };
94
94
  });
@@ -1,4 +1,16 @@
1
- export declare function mapDispatchToProps(dispatch: any): any;
2
- declare const _default: any;
1
+ import React from "react";
2
+ export declare function mapDispatchToProps(dispatch: any): {
3
+ setConfig: (data: any) => {
4
+ data: any;
5
+ type: string;
6
+ };
7
+ };
8
+ declare const _default: import("react-redux").ConnectedComponent<({ setConfig }: {
9
+ setConfig: any;
10
+ }) => JSX.Element, {
11
+ setConfig: any;
12
+ context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
13
+ store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
14
+ }>;
3
15
  export default _default;
4
16
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,9 @@
1
1
  declare const appView: () => (state: any) => any;
2
- declare const makeAppView: () => any;
2
+ declare const makeAppView: () => ((state: any) => any) & import("reselect").OutputSelectorFields<(args_0: any) => any, {
3
+ clearCache: () => void;
4
+ }> & {
5
+ clearCache: () => void;
6
+ };
3
7
  declare const selectConfig: (state: any) => any;
4
8
  export default makeAppView;
5
9
  export { appView, selectConfig };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import PropTypes from "prop-types";
3
2
  declare const DetailsEntity: {
4
3
  ({ data, schema, config, filters, onFiltersChange, }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import PropTypes from "prop-types";
3
2
  declare const DetailsFilters: {
4
3
  ({ data, onChange }: {
@@ -1,4 +1,11 @@
1
- export declare function mapDispatchToProps(dispatch: any): any;
2
- declare const _default: any;
1
+ import React from "react";
2
+ export declare function mapDispatchToProps(dispatch: any): {};
3
+ declare const _default: import("react-redux").ConnectedComponent<React.MemoExoticComponent<({ config }: {
4
+ config: any;
5
+ }) => JSX.Element | null>, {
6
+ config: any;
7
+ context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
8
+ store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
9
+ }>;
3
10
  export default _default;
4
11
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import PropTypes from "prop-types";
3
2
  declare const DiscoverTableRow: {
4
3
  ({ config, item, allowedActions: { canModerate, canAccessReports, canReviewReports }, onClick, }: {
@@ -1,4 +1,11 @@
1
- export declare function mapDispatchToProps(dispatch: any): any;
2
- declare const _default: any;
1
+ import React from 'react';
2
+ export declare function mapDispatchToProps(dispatch: any): {};
3
+ declare const _default: import("react-redux").ConnectedComponent<React.MemoExoticComponent<({ config }: {
4
+ config: any;
5
+ }) => JSX.Element>, {
6
+ config: any;
7
+ context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
8
+ store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
9
+ }>;
3
10
  export default _default;
4
11
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const NoAcccessPage: () => JSX.Element;
3
2
  export default NoAcccessPage;
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ReportsTableRow: ({ allowedActions, config, handleItemSelectionChange, isChecked, item, mutation, onClick, onSelectionChange, reports, selectedReports, updateReports, }: {
3
2
  allowedActions: any;
4
3
  config: any;
@@ -1,4 +1,11 @@
1
- export declare const mapDispatchToProps: (dispatch: any) => any;
2
- declare const _default: any;
1
+ import React from "react";
2
+ export declare const mapDispatchToProps: (dispatch: any) => {};
3
+ declare const _default: import("react-redux").ConnectedComponent<React.MemoExoticComponent<({ config }: {
4
+ config: any;
5
+ }) => JSX.Element>, {
6
+ config: any;
7
+ context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
8
+ store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
9
+ }>;
3
10
  export default _default;
4
11
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const Settings: () => JSX.Element;
3
2
  export default Settings;
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -59,11 +59,8 @@ const Settings = () => {
59
59
  const trackUsageRef = (0, react_1.useRef)(trackUsage);
60
60
  const toggleNotification = (0, helper_plugin_1.useNotification)();
61
61
  const { lockApp, unlockApp } = (0, helper_plugin_1.useOverlayBlocker)();
62
- const viewPermissions = (0, react_1.useMemo)(() => ({
63
- access: permissions_1.default.settings.read,
64
- change: permissions_1.default.settings.change,
65
- }), []);
66
- const { isLoading: isLoadingForPermissions, allowedActions: { canAccess, canChange }, } = (0, helper_plugin_1.useRBAC)(viewPermissions);
62
+ const { isLoading: isLoadingForPermissions, allowedActions } = (0, helper_plugin_1.useRBAC)(permissions_1.default);
63
+ const { canSettings: canAccess, canSettingsChange: canChange } = allowedActions;
67
64
  const [restoreConfigmationVisible, setRestoreConfigmationVisible] = (0, react_1.useState)(false);
68
65
  const [restartRequired, setRestartRequired] = (0, react_1.useState)(false);
69
66
  const [contentTypeExpanded, setContentTypeExpanded] = (0, react_1.useState)(undefined);
@@ -9,7 +9,6 @@ exports.default = {
9
9
  { action: permissions_1.default.render(permissions_1.default.comments.read), subject: null },
10
10
  { action: permissions_1.default.render(permissions_1.default.reports.read), subject: null },
11
11
  { action: permissions_1.default.render(permissions_1.default.settings.read), subject: null },
12
- { action: permissions_1.default.render(permissions_1.default.settings.read), subject: null },
13
12
  ],
14
13
  moderate: [
15
14
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-comments",
3
- "version": "2.2.15",
3
+ "version": "2.2.17",
4
4
  "description": "Strapi - Comments plugin",
5
5
  "strapi": {
6
6
  "name": "comments",
@@ -14,15 +14,14 @@
14
14
  "url": "https://github.com/VirtusLab-Open-Source/strapi-plugin-comments"
15
15
  },
16
16
  "dependencies": {
17
- "@strapi/plugin-graphql": "^4.13.6",
18
- "@strapi/utils": "^4.13.6",
19
- "@types/axios": "^0.14.0",
20
- "@types/react-intl": "^3.0.0",
21
- "@types/react-query": "^1.2.9",
22
- "@types/styled-components": "^5.1.26",
23
- "bad-words": "^3.0.4",
17
+ "@strapi/design-system": "1.18.0",
18
+ "@strapi/plugin-graphql": "^4.24.4",
19
+ "@strapi/utils": "^4.24.4",
20
+ "@strapi/types": "4.24.4",
21
+ "no-profanity": "^1.4.2",
24
22
  "styled-components": "^5.3.8",
25
23
  "match-sorter": "^4.0.2",
24
+ "react-query": "3.39.3",
26
25
  "codemirror5": "npm:codemirror@^5.65.11"
27
26
  },
28
27
  "devDependencies": {},
@@ -64,8 +63,8 @@
64
63
  }
65
64
  ],
66
65
  "engines": {
67
- "node": ">=16.0.0 <=20.x.x",
68
- "npm": ">=7.x.x"
66
+ "node": ">=18.0.0 <=20.x.x",
67
+ "npm": ">=6.0.0"
69
68
  },
70
69
  "keywords": [
71
70
  "strapi",
@@ -2,7 +2,7 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- const bad_words_1 = __importDefault(require("bad-words"));
5
+ const no_profanity_1 = require("no-profanity");
6
6
  const lodash_1 = require("lodash");
7
7
  const constants_1 = require("../utils/constants");
8
8
  const error_1 = __importDefault(require("./../utils/error"));
@@ -257,12 +257,11 @@ module.exports = ({ strapi }) => ({
257
257
  async checkBadWords(content) {
258
258
  const config = await this.getConfig(constants_1.CONFIG_PARAMS.BAD_WORDS, true);
259
259
  if (config) {
260
- const filter = new bad_words_1.default((0, lodash_1.isObject)(config) ? config : undefined);
261
- if (content && filter.isProfane(content)) {
260
+ if (content && (0, no_profanity_1.isProfane)({ testString: content })) {
262
261
  throw new error_1.default(400, "Bad language used! Please polite your comment...", {
263
262
  content: {
264
263
  original: content,
265
- filtered: content && filter.clean(content),
264
+ filtered: content && (0, no_profanity_1.replaceProfanities)({ testString: content }),
266
265
  },
267
266
  });
268
267
  }