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.
- package/README.md +4 -4
- package/admin/src/components/CommentReviewModal/index.d.ts +0 -1
- package/admin/src/components/ConfirmationDialog/index.d.ts +0 -1
- package/admin/src/components/DiscussionStatus/index.d.ts +0 -1
- package/admin/src/components/DiscussionThread/index.d.ts +0 -1
- package/admin/src/components/DiscussionThreadItem/index.d.ts +0 -1
- package/admin/src/components/DiscussionThreadItemActions/index.d.ts +0 -1
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +0 -1
- package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +0 -1
- package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +0 -1
- package/admin/src/components/FormSwitch/index.d.ts +0 -1
- package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +0 -1
- package/admin/src/components/ModeratorResponse/index.js +5 -8
- package/admin/src/components/ModeratorResponseModal/ModeratorResponseModal.js +5 -8
- package/admin/src/components/Nav/index.d.ts +0 -1
- package/admin/src/components/PluginIcon/index.d.ts +0 -1
- package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.d.ts +18 -1
- package/admin/src/components/ReportsActions/components/BlockMenu/index.d.ts +0 -1
- package/admin/src/components/ReportsActions/index.d.ts +0 -1
- package/admin/src/components/ReportsReviewModal/index.d.ts +0 -1
- package/admin/src/components/ReportsReviewTable/index.d.ts +0 -1
- package/admin/src/components/StatusBadge/index.d.ts +0 -1
- package/admin/src/components/TableFilters/index.d.ts +0 -1
- package/admin/src/components/TablePagination/index.d.ts +0 -1
- package/admin/src/components/Wysiwyg/Editor.d.ts +24 -12
- package/admin/src/components/Wysiwyg/Editor.js +375 -21
- package/admin/src/components/Wysiwyg/EditorLayout.d.ts +9 -8
- package/admin/src/components/Wysiwyg/EditorLayout.js +37 -51
- package/admin/src/components/Wysiwyg/Field.d.ts +15 -0
- package/admin/src/components/Wysiwyg/{index.js → Field.js} +48 -49
- package/admin/src/components/Wysiwyg/PreviewWysiwyg.d.ts +6 -0
- package/admin/src/components/Wysiwyg/PreviewWysiwyg.js +191 -0
- package/admin/src/components/Wysiwyg/WysiwygFooter.d.ts +7 -6
- package/admin/src/components/Wysiwyg/WysiwygFooter.js +32 -13
- package/admin/src/components/Wysiwyg/WysiwygNav.d.ts +12 -10
- package/admin/src/components/Wysiwyg/WysiwygNav.js +76 -58
- package/admin/src/components/Wysiwyg/WysiwygStyles.d.ts +0 -1
- package/admin/src/components/Wysiwyg/WysiwygStyles.js +8 -13
- package/admin/src/components/Wysiwyg/utils/continueList.d.ts +5 -2
- package/admin/src/components/Wysiwyg/utils/continueList.js +2 -1
- package/admin/src/components/Wysiwyg/utils/mdRenderer.d.ts +5 -0
- package/admin/src/components/Wysiwyg/utils/mdRenderer.js +63 -0
- package/admin/src/components/Wysiwyg/utils/utils.d.ts +11 -9
- package/admin/src/components/Wysiwyg/utils/utils.js +13 -12
- package/admin/src/components/icons/comments.d.ts +0 -1
- package/admin/src/components/icons/lock.d.ts +0 -1
- package/admin/src/components/icons/review.d.ts +0 -1
- package/admin/src/components/icons/strapiIcons.d.ts +0 -1
- package/admin/src/components/icons/unlock.d.ts +0 -1
- package/admin/src/custom-fields/comments/components/icon.d.ts +0 -1
- package/admin/src/index.d.ts +3 -1
- package/admin/src/index.js +1 -1
- package/admin/src/pages/App/index.d.ts +14 -2
- package/admin/src/pages/App/reducer/selectors.d.ts +5 -1
- package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +0 -1
- package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +0 -1
- package/admin/src/pages/Details/index.d.ts +9 -2
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +0 -1
- package/admin/src/pages/Discover/index.d.ts +9 -2
- package/admin/src/pages/NoAccessPage/index.d.ts +0 -1
- package/admin/src/pages/Reports/components/ReportsTableRow/index.d.ts +0 -1
- package/admin/src/pages/Reports/index.d.ts +9 -2
- package/admin/src/pages/Settings/index.d.ts +0 -1
- package/admin/src/pages/Settings/index.js +2 -5
- package/admin/src/permissions.js +0 -1
- package/package.json +9 -10
- package/server/services/common.js +3 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/admin/src/components/Wysiwyg/EditorStylesContainer.d.ts +0 -2
- package/admin/src/components/Wysiwyg/EditorStylesContainer.js +0 -348
- package/admin/src/components/Wysiwyg/index.d.ts +0 -28
- package/admin/src/components/Wysiwyg/tests/index.test.d.ts +0 -2
- package/admin/src/components/Wysiwyg/tests/index.test.js +0 -1633
package/README.md
CHANGED
|
@@ -127,14 +127,14 @@ Complete installation requirements are exact same as for Strapi itself and can b
|
|
|
127
127
|
|
|
128
128
|
**Minimum environment requirements**
|
|
129
129
|
|
|
130
|
-
- Node.js `>=
|
|
131
|
-
- NPM `>=
|
|
130
|
+
- Node.js `>=18.0.0 <=20.x.x`
|
|
131
|
+
- NPM `>=6.x.x`
|
|
132
132
|
|
|
133
133
|
In our minimum support we're following [official Node.js releases timelines](https://nodejs.org/en/about/releases/).
|
|
134
134
|
|
|
135
135
|
**Supported Strapi versions**:
|
|
136
136
|
|
|
137
|
-
- Strapi v4.
|
|
137
|
+
- Strapi v4.24.x (recently tested)
|
|
138
138
|
- Strapi v4.x
|
|
139
139
|
|
|
140
140
|
> This plugin is designed for **Strapi v4** and is not working with v3.x. To get version for **Strapi v3** install version [v1.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-comments/tree/strapi-v3).
|
|
@@ -192,7 +192,7 @@ module.exports = ({ env }) => ({
|
|
|
192
192
|
### Properties
|
|
193
193
|
|
|
194
194
|
- `enabledCollections` - list of Collection and Single Types for which plugin should be enabled in format like `'api::<collection name>.<content type name>'`. By default it's empty and none comments are not enabled for any of type in Strapi.
|
|
195
|
-
- `
|
|
195
|
+
- `no-profanity` - Enabled support for [profanity filtering](https://www.npmjs.com/package/no-profanity). Can be turned off or altered using the [options reference](https://www.npmjs.com/package/no-profanity?activeTab=readme#options). Default value: `true`.
|
|
196
196
|
- `moderatorRoles` - Optional list of names of roles. Users with those roles will be notified by email when a new abuse report is created. This feature requires a built-in [Strapi email plugin](https://docs.strapi.io/developer-docs/latest/plugins/email.html) configured.
|
|
197
197
|
- `approvalFlow` - list of Content Types which are supporting approval flow. Values must be in format like `'api::<collection name>.<content type name>'`. For not included, posted comments are going to be immediately visible.
|
|
198
198
|
- `entryLabel` - ordered list of property names per Content Type to generate related entity label. Keys must be in format like `'api::<collection name>.<content type name>'`. Default formatting set as `*`.
|
|
@@ -22,9 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
const react_1 = __importStar(require("react"));
|
|
30
27
|
const react_query_1 = require("react-query");
|
|
@@ -37,7 +34,7 @@ const Flex_1 = require("@strapi/design-system/Flex");
|
|
|
37
34
|
const Button_1 = require("@strapi/design-system/Button");
|
|
38
35
|
const Divider_1 = require("@strapi/design-system/Divider");
|
|
39
36
|
const utils_1 = require("../../utils");
|
|
40
|
-
const
|
|
37
|
+
const Field_1 = require("../Wysiwyg/Field");
|
|
41
38
|
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
42
39
|
const pluginId_1 = require("../../pluginId");
|
|
43
40
|
const ModeratorResponse = ({ rootThread, }) => {
|
|
@@ -62,7 +59,7 @@ const ModeratorResponse = ({ rootThread, }) => {
|
|
|
62
59
|
});
|
|
63
60
|
stateAction(false);
|
|
64
61
|
setCommentField('');
|
|
65
|
-
unlockApp();
|
|
62
|
+
unlockApp && unlockApp();
|
|
66
63
|
};
|
|
67
64
|
const onError = (err) => {
|
|
68
65
|
(0, utils_1.handleAPIError)(err, toggleNotification);
|
|
@@ -73,7 +70,7 @@ const ModeratorResponse = ({ rootThread, }) => {
|
|
|
73
70
|
onError,
|
|
74
71
|
});
|
|
75
72
|
const handleSave = async () => {
|
|
76
|
-
lockApp();
|
|
73
|
+
lockApp && lockApp();
|
|
77
74
|
await postCommentMutation.mutate({
|
|
78
75
|
threadId,
|
|
79
76
|
body: commentField,
|
|
@@ -81,7 +78,7 @@ const ModeratorResponse = ({ rootThread, }) => {
|
|
|
81
78
|
});
|
|
82
79
|
};
|
|
83
80
|
const handleReopen = async () => {
|
|
84
|
-
lockApp();
|
|
81
|
+
lockApp && lockApp();
|
|
85
82
|
await unblockItemThreadMutation.mutate(threadId);
|
|
86
83
|
await postCommentMutation.mutate({
|
|
87
84
|
threadId,
|
|
@@ -100,7 +97,7 @@ const ModeratorResponse = ({ rootThread, }) => {
|
|
|
100
97
|
react_1.default.createElement(Box_1.Box, null,
|
|
101
98
|
react_1.default.createElement(Typography_1.Typography, { variant: "delta", textColor: "neutral800", id: "moderator-reply" }, (0, utils_1.getMessage)("page.details.panel.discussion.reply", "Reply"))),
|
|
102
99
|
react_1.default.createElement(Box_1.Box, { paddingTop: 2, paddingBottom: 4 },
|
|
103
|
-
react_1.default.createElement(
|
|
100
|
+
react_1.default.createElement(Field_1.Wysiwyg, { name: "", type: "wysiwyg", value: commentField, onChange: handleCommentChange, intlLabel: intlLabel })),
|
|
104
101
|
react_1.default.createElement(Flex_1.Flex, { direction: "row", justifyContent: "flex-end", gap: 2 },
|
|
105
102
|
blockedThread && (react_1.default.createElement(Button_1.Button, { variant: "secondary", onClick: handleReopen, disabled: isFieldEmpty }, (0, utils_1.getMessage)("page.details.panel.discussion.reopen", "Re-open"))),
|
|
106
103
|
react_1.default.createElement(Button_1.Button, { variant: "primary", onClick: handleSave, disabled: isFieldEmpty }, (0, utils_1.getMessage)("page.details.panel.discussion.send", "Send"))))));
|
|
@@ -22,9 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
const react_1 = __importStar(require("react"));
|
|
30
27
|
const react_query_1 = require("react-query");
|
|
@@ -33,7 +30,7 @@ const ModalLayout_1 = require("@strapi/design-system/ModalLayout");
|
|
|
33
30
|
const Typography_1 = require("@strapi/design-system/Typography");
|
|
34
31
|
const Button_1 = require("@strapi/design-system/Button");
|
|
35
32
|
const utils_1 = require("../../utils");
|
|
36
|
-
const
|
|
33
|
+
const Field_1 = require("../Wysiwyg/Field");
|
|
37
34
|
const helper_plugin_1 = require("@strapi/helper-plugin");
|
|
38
35
|
const pluginId_1 = require("../../pluginId");
|
|
39
36
|
const ModeratorResponseModal = ({ content, id, title, onClose, }) => {
|
|
@@ -54,7 +51,7 @@ const ModeratorResponseModal = ({ content, id, title, onClose, }) => {
|
|
|
54
51
|
message: `${pluginId_1.pluginId}.${message}`,
|
|
55
52
|
});
|
|
56
53
|
stateAction(false);
|
|
57
|
-
unlockApp();
|
|
54
|
+
unlockApp && unlockApp();
|
|
58
55
|
};
|
|
59
56
|
const onError = (err) => {
|
|
60
57
|
(0, utils_1.handleAPIError)(err, toggleNotification);
|
|
@@ -68,7 +65,7 @@ const ModeratorResponseModal = ({ content, id, title, onClose, }) => {
|
|
|
68
65
|
onError,
|
|
69
66
|
});
|
|
70
67
|
const handlePostComment = async () => {
|
|
71
|
-
lockApp();
|
|
68
|
+
lockApp && lockApp();
|
|
72
69
|
await postCommentMutation.mutate({
|
|
73
70
|
threadId: id,
|
|
74
71
|
body: commentField,
|
|
@@ -76,7 +73,7 @@ const ModeratorResponseModal = ({ content, id, title, onClose, }) => {
|
|
|
76
73
|
});
|
|
77
74
|
};
|
|
78
75
|
const handleUpdateComment = async () => {
|
|
79
|
-
lockApp();
|
|
76
|
+
lockApp && lockApp();
|
|
80
77
|
await updateCommentMutation.mutate({
|
|
81
78
|
id,
|
|
82
79
|
body: commentField,
|
|
@@ -91,7 +88,7 @@ const ModeratorResponseModal = ({ content, id, title, onClose, }) => {
|
|
|
91
88
|
react_1.default.createElement(ModalLayout_1.ModalHeader, null,
|
|
92
89
|
react_1.default.createElement(Typography_1.Typography, { fontWeight: "bold", textColor: "neutral800", as: "h2", id: "title" }, title)),
|
|
93
90
|
react_1.default.createElement(ModalLayout_1.ModalBody, null,
|
|
94
|
-
react_1.default.createElement(
|
|
91
|
+
react_1.default.createElement(Field_1.Wysiwyg, { name: "", value: commentField, onChange: handleCommentChange, intlLabel: intlLabel })),
|
|
95
92
|
react_1.default.createElement(ModalLayout_1.ModalFooter, { startActions: react_1.default.createElement(Button_1.Button, { onClick: handleClose, variant: "tertiary" }, (0, utils_1.getMessage)("compontents.confirmation.dialog.button.cancel")), endActions: content.length ? (react_1.default.createElement(Button_1.Button, { onClick: handleUpdateComment }, (0, utils_1.getMessage)("page.details.actions.thread.modal.update.comment"))) : (react_1.default.createElement(Button_1.Button, { onClick: handlePostComment }, (0, utils_1.getMessage)("page.details.actions.thread.modal.start.thread"))) })));
|
|
96
93
|
};
|
|
97
94
|
exports.default = ModeratorResponseModal;
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import sanitizeHtml from 'sanitize-html';
|
|
2
|
+
declare const clean: (dirty: any, options?: {
|
|
3
|
+
allowedTags: boolean;
|
|
4
|
+
allowedAttributes: {
|
|
5
|
+
'*': string[];
|
|
6
|
+
img: string[];
|
|
7
|
+
source: string[];
|
|
8
|
+
};
|
|
9
|
+
allowedSchemes: string[];
|
|
10
|
+
allowedSchemesByTag: {
|
|
11
|
+
[index: string]: string[];
|
|
12
|
+
};
|
|
13
|
+
allowedSchemesAppliedToAttributes: string[];
|
|
14
|
+
allowProtocolRelative: boolean;
|
|
15
|
+
disallowedTagsMode: sanitizeHtml.DisallowedTagsModes;
|
|
16
|
+
enforceHtmlBoundary: boolean;
|
|
17
|
+
selfClosing: string[];
|
|
18
|
+
}) => string;
|
|
2
19
|
export default clean;
|
|
3
20
|
//# sourceMappingURL=satinizeHtml.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const BlockMenu: ({ handlers: { handleBlockItemClick, handleBlockItemThreadClick, handleClickResolve, handleResolveAllAbuseReportsForComment, handleResolveAllAbuseReportsForThread, handleUnblockItemClick, handleUnblockThreadClick, }, item, type, }: {
|
|
3
2
|
handlers: {
|
|
4
3
|
handleBlockItemClick: any;
|
|
@@ -1,17 +1,29 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EditorFromTextArea } from 'codemirror5';
|
|
2
3
|
import 'codemirror5/addon/display/placeholder';
|
|
3
|
-
|
|
4
|
+
interface EditorApi {
|
|
5
|
+
focus: () => void;
|
|
6
|
+
scrollIntoView: (args?: Parameters<HTMLElement['scrollIntoView']>[0]) => void;
|
|
7
|
+
}
|
|
8
|
+
interface EditorProps {
|
|
4
9
|
disabled?: boolean;
|
|
5
|
-
editorRef:
|
|
10
|
+
editorRef: React.MutableRefObject<EditorFromTextArea>;
|
|
6
11
|
error?: string;
|
|
7
|
-
isPreviewMode
|
|
8
|
-
isExpandMode
|
|
12
|
+
isPreviewMode?: boolean;
|
|
13
|
+
isExpandMode?: boolean;
|
|
9
14
|
name: string;
|
|
10
|
-
onChange: (event:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
onChange: (event: {
|
|
16
|
+
target: {
|
|
17
|
+
name: string;
|
|
18
|
+
value: string;
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
}) => void;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
textareaRef: React.RefObject<HTMLTextAreaElement>;
|
|
24
|
+
value?: string;
|
|
25
|
+
}
|
|
26
|
+
declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorApi>>;
|
|
27
|
+
export { Editor };
|
|
28
|
+
export type { EditorProps, EditorApi };
|
|
17
29
|
//# sourceMappingURL=Editor.d.ts.map
|