strapi-plugin-comments 2.0.10 → 2.0.11

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 (261) hide show
  1. package/README.md +39 -5
  2. package/admin/src/translations/fr.json +132 -1
  3. package/build/README.md +818 -0
  4. package/build/admin/src/components/ActionButton/styles.d.ts +2 -0
  5. package/build/admin/src/components/ActionButton/styles.js +17 -0
  6. package/build/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
  7. package/build/admin/src/components/ConfirmationDialog/index.js +104 -0
  8. package/build/admin/src/components/DiscussionStatus/index.d.ts +9 -0
  9. package/build/admin/src/components/DiscussionStatus/index.js +38 -0
  10. package/build/admin/src/components/DiscussionThread/index.d.ts +16 -0
  11. package/build/admin/src/components/DiscussionThread/index.js +99 -0
  12. package/build/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
  13. package/build/admin/src/components/DiscussionThreadItem/index.js +72 -0
  14. package/build/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
  15. package/build/admin/src/components/DiscussionThreadItem/styles.js +27 -0
  16. package/build/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
  17. package/build/admin/src/components/DiscussionThreadItemActions/index.js +414 -0
  18. package/build/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
  19. package/build/admin/src/components/DiscussionThreadItemActions/styles.js +17 -0
  20. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
  21. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +103 -0
  22. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
  23. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +15 -0
  24. package/build/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
  25. package/build/admin/src/components/DiscussionThreadItemFooter/index.js +73 -0
  26. package/build/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
  27. package/build/admin/src/components/DiscussionThreadItemFooter/styles.js +25 -0
  28. package/build/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
  29. package/build/admin/src/components/DiscussionThreadItemReviewAction/index.js +233 -0
  30. package/build/admin/src/components/FormSwitch/index.d.ts +11 -0
  31. package/build/admin/src/components/FormSwitch/index.js +39 -0
  32. package/build/admin/src/components/FormSwitch/styles.d.ts +2 -0
  33. package/build/admin/src/components/FormSwitch/styles.js +16 -0
  34. package/build/admin/src/components/IconButton/styles.d.ts +2 -0
  35. package/build/admin/src/components/IconButton/styles.js +27 -0
  36. package/build/admin/src/components/Initializer/index.d.ts +3 -0
  37. package/build/admin/src/components/Initializer/index.js +14 -0
  38. package/build/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
  39. package/build/admin/src/components/LoadingIndicatorOverlay/index.js +18 -0
  40. package/build/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
  41. package/build/admin/src/components/LoadingIndicatorOverlay/styles.js +32 -0
  42. package/build/admin/src/components/Nav/index.d.ts +7 -0
  43. package/build/admin/src/components/Nav/index.js +72 -0
  44. package/build/admin/src/components/PluginIcon/index.d.ts +3 -0
  45. package/build/admin/src/components/PluginIcon/index.js +13 -0
  46. package/build/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
  47. package/build/admin/src/components/ReportsReviewModal/index.js +72 -0
  48. package/build/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
  49. package/build/admin/src/components/ReportsReviewTable/index.js +321 -0
  50. package/build/admin/src/components/StatusBadge/index.d.ts +11 -0
  51. package/build/admin/src/components/StatusBadge/index.js +22 -0
  52. package/build/admin/src/components/StatusBadge/styles.d.ts +2 -0
  53. package/build/admin/src/components/StatusBadge/styles.js +25 -0
  54. package/build/admin/src/components/TableFilters/index.d.ts +10 -0
  55. package/build/admin/src/components/TableFilters/index.js +109 -0
  56. package/build/admin/src/components/TablePagination/index.d.ts +15 -0
  57. package/build/admin/src/components/TablePagination/index.js +45 -0
  58. package/build/admin/src/components/icons/comments.d.ts +9 -0
  59. package/build/admin/src/components/icons/comments.js +23 -0
  60. package/build/admin/src/components/icons/index.d.ts +6 -0
  61. package/build/admin/src/components/icons/index.js +21 -0
  62. package/build/admin/src/components/icons/lock.d.ts +11 -0
  63. package/build/admin/src/components/icons/lock.js +29 -0
  64. package/build/admin/src/components/icons/review.d.ts +11 -0
  65. package/build/admin/src/components/icons/review.js +31 -0
  66. package/build/admin/src/components/icons/unlock.d.ts +11 -0
  67. package/build/admin/src/components/icons/unlock.js +29 -0
  68. package/build/admin/src/hooks/useConfig.d.ts +8 -0
  69. package/build/admin/src/hooks/useConfig.js +52 -0
  70. package/build/admin/src/index.d.ts +7 -0
  71. package/build/admin/src/index.js +137 -0
  72. package/build/admin/src/pages/App/index.d.ts +4 -0
  73. package/build/admin/src/pages/App/index.js +90 -0
  74. package/build/admin/src/pages/App/reducer/actions.d.ts +8 -0
  75. package/build/admin/src/pages/App/reducer/actions.js +12 -0
  76. package/build/admin/src/pages/App/reducer/constants.d.ts +4 -0
  77. package/build/admin/src/pages/App/reducer/constants.js +7 -0
  78. package/build/admin/src/pages/App/reducer/index.d.ts +14 -0
  79. package/build/admin/src/pages/App/reducer/index.js +31 -0
  80. package/build/admin/src/pages/App/reducer/init.d.ts +3 -0
  81. package/build/admin/src/pages/App/reducer/init.js +9 -0
  82. package/build/admin/src/pages/App/reducer/selectors.d.ts +6 -0
  83. package/build/admin/src/pages/App/reducer/selectors.js +20 -0
  84. package/build/admin/src/pages/App/utils/api.d.ts +2 -0
  85. package/build/admin/src/pages/App/utils/api.js +16 -0
  86. package/build/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
  87. package/build/admin/src/pages/ComingSoonPage/index.js +78 -0
  88. package/build/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
  89. package/build/admin/src/pages/Details/components/DetailsEntity/index.js +132 -0
  90. package/build/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
  91. package/build/admin/src/pages/Details/components/DetailsFilters/index.js +48 -0
  92. package/build/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
  93. package/build/admin/src/pages/Details/components/DetailsFilters/styles.js +16 -0
  94. package/build/admin/src/pages/Details/index.d.ts +4 -0
  95. package/build/admin/src/pages/Details/index.js +216 -0
  96. package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
  97. package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.js +344 -0
  98. package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
  99. package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +16 -0
  100. package/build/admin/src/pages/Discover/index.d.ts +4 -0
  101. package/build/admin/src/pages/Discover/index.js +332 -0
  102. package/build/admin/src/pages/Discover/utils/api.d.ts +2 -0
  103. package/build/admin/src/pages/Discover/utils/api.js +23 -0
  104. package/build/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
  105. package/build/admin/src/pages/Discover/utils/filtersSchema.js +11 -0
  106. package/build/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
  107. package/build/admin/src/pages/Settings/components/RestartAlert/styles.js +16 -0
  108. package/build/admin/src/pages/Settings/index.d.ts +3 -0
  109. package/build/admin/src/pages/Settings/index.js +712 -0
  110. package/build/admin/src/pages/Settings/utils/api.d.ts +7 -0
  111. package/build/admin/src/pages/Settings/utils/api.js +80 -0
  112. package/build/admin/src/pages/utils/api.d.ts +12 -0
  113. package/build/admin/src/pages/utils/api.js +83 -0
  114. package/build/admin/src/permissions.d.ts +28 -0
  115. package/build/admin/src/permissions.js +65 -0
  116. package/build/admin/src/pluginId.d.ts +2 -0
  117. package/build/admin/src/pluginId.js +50 -0
  118. package/build/admin/src/reducers.d.ts +12 -0
  119. package/build/admin/src/reducers.js +14 -0
  120. package/build/admin/src/translations/en.json +132 -0
  121. package/build/admin/src/translations/fr.json +1 -0
  122. package/build/admin/src/translations/pt-BR.json +132 -0
  123. package/build/admin/src/utils/axiosInstance.d.ts +3 -0
  124. package/build/admin/src/utils/axiosInstance.js +37 -0
  125. package/build/admin/src/utils/constants.d.ts +25 -0
  126. package/build/admin/src/utils/constants.js +30 -0
  127. package/build/admin/src/utils/getApiUrl.d.ts +3 -0
  128. package/build/admin/src/utils/getApiUrl.js +6 -0
  129. package/build/admin/src/utils/getMessage.d.ts +4 -0
  130. package/build/admin/src/utils/getMessage.js +25 -0
  131. package/build/admin/src/utils/getRelatedGroups.d.ts +4 -0
  132. package/build/admin/src/utils/getRelatedGroups.js +6 -0
  133. package/build/admin/src/utils/getUrl.d.ts +3 -0
  134. package/build/admin/src/utils/getUrl.js +6 -0
  135. package/build/admin/src/utils/handleAPIError.d.ts +4 -0
  136. package/build/admin/src/utils/handleAPIError.js +20 -0
  137. package/build/admin/src/utils/index.d.ts +12 -0
  138. package/build/admin/src/utils/index.js +97 -0
  139. package/build/admin/src/utils/parseRegExp.d.ts +6 -0
  140. package/build/admin/src/utils/parseRegExp.js +11 -0
  141. package/build/admin/src/utils/renderEntryTitle.d.ts +4 -0
  142. package/build/admin/src/utils/renderEntryTitle.js +16 -0
  143. package/build/admin/src/utils/renderInitials.d.ts +3 -0
  144. package/build/admin/src/utils/renderInitials.js +11 -0
  145. package/build/admin/src/utils/resolveCommentStatus.d.ts +4 -0
  146. package/build/admin/src/utils/resolveCommentStatus.js +32 -0
  147. package/build/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
  148. package/build/admin/src/utils/resolveCommentStatusColor.js +22 -0
  149. package/build/content-types/comment.d.ts +91 -0
  150. package/build/content-types/comment.js +92 -0
  151. package/build/content-types/index.d.ts +143 -0
  152. package/build/content-types/index.js +18 -0
  153. package/build/content-types/report.d.ts +48 -0
  154. package/build/content-types/report.js +49 -0
  155. package/build/package.json +94 -0
  156. package/build/permissions.d.ts +18 -0
  157. package/build/permissions.js +18 -0
  158. package/build/server/bootstrap.d.ts +4 -0
  159. package/build/server/bootstrap.js +65 -0
  160. package/build/server/config/index.d.ts +4 -0
  161. package/build/server/config/index.js +19 -0
  162. package/build/server/controllers/admin.d.ts +4 -0
  163. package/build/server/controllers/admin.js +124 -0
  164. package/build/server/controllers/client.d.ts +4 -0
  165. package/build/server/controllers/client.js +111 -0
  166. package/build/server/controllers/index.d.ts +6 -0
  167. package/build/server/controllers/index.js +15 -0
  168. package/build/server/controllers/utils/functions.d.ts +7 -0
  169. package/build/server/controllers/utils/functions.js +24 -0
  170. package/build/server/controllers/utils/parsers.d.ts +15 -0
  171. package/build/server/controllers/utils/parsers.js +25 -0
  172. package/build/server/destroy.d.ts +3 -0
  173. package/build/server/destroy.js +3 -0
  174. package/build/server/graphql/index.d.ts +4 -0
  175. package/build/server/graphql/index.js +37 -0
  176. package/build/server/graphql/mutations/createAbuseReport.d.ts +11 -0
  177. package/build/server/graphql/mutations/createAbuseReport.js +27 -0
  178. package/build/server/graphql/mutations/createComment.d.ts +14 -0
  179. package/build/server/graphql/mutations/createComment.js +26 -0
  180. package/build/server/graphql/mutations/index.d.ts +4 -0
  181. package/build/server/graphql/mutations/index.js +28 -0
  182. package/build/server/graphql/mutations/removeComment.d.ts +11 -0
  183. package/build/server/graphql/mutations/removeComment.js +27 -0
  184. package/build/server/graphql/mutations/updateComment.d.ts +11 -0
  185. package/build/server/graphql/mutations/updateComment.js +27 -0
  186. package/build/server/graphql/queries/findAllFlat.d.ts +19 -0
  187. package/build/server/graphql/queries/findAllFlat.js +47 -0
  188. package/build/server/graphql/queries/findAllInHierarchy.d.ts +18 -0
  189. package/build/server/graphql/queries/findAllInHierarchy.js +38 -0
  190. package/build/server/graphql/queries/index.d.ts +4 -0
  191. package/build/server/graphql/queries/index.js +24 -0
  192. package/build/server/graphql/resolvers-config.d.ts +23 -0
  193. package/build/server/graphql/resolvers-config.js +13 -0
  194. package/build/server/graphql/types/comment-author.d.ts +4 -0
  195. package/build/server/graphql/types/comment-author.js +12 -0
  196. package/build/server/graphql/types/comment-nested.d.ts +4 -0
  197. package/build/server/graphql/types/comment-nested.js +19 -0
  198. package/build/server/graphql/types/comment.d.ts +4 -0
  199. package/build/server/graphql/types/comment.js +18 -0
  200. package/build/server/graphql/types/create-comment-author.d.ts +4 -0
  201. package/build/server/graphql/types/create-comment-author.js +12 -0
  202. package/build/server/graphql/types/create-comment.d.ts +4 -0
  203. package/build/server/graphql/types/create-comment.js +12 -0
  204. package/build/server/graphql/types/create-report.d.ts +4 -0
  205. package/build/server/graphql/types/create-report.js +12 -0
  206. package/build/server/graphql/types/id.d.ts +4 -0
  207. package/build/server/graphql/types/id.js +26 -0
  208. package/build/server/graphql/types/identify-comment-author.d.ts +4 -0
  209. package/build/server/graphql/types/identify-comment-author.js +9 -0
  210. package/build/server/graphql/types/index.d.ts +4 -0
  211. package/build/server/graphql/types/index.js +44 -0
  212. package/build/server/graphql/types/remove-comment.d.ts +4 -0
  213. package/build/server/graphql/types/remove-comment.js +11 -0
  214. package/build/server/graphql/types/report-reason.d.ts +4 -0
  215. package/build/server/graphql/types/report-reason.js +12 -0
  216. package/build/server/graphql/types/report.d.ts +4 -0
  217. package/build/server/graphql/types/report.js +14 -0
  218. package/build/server/graphql/types/response-find-all.d.ts +4 -0
  219. package/build/server/graphql/types/response-find-all.js +10 -0
  220. package/build/server/graphql/types/response-meta.d.ts +4 -0
  221. package/build/server/graphql/types/response-meta.js +9 -0
  222. package/build/server/graphql/types/response-pagination.d.ts +4 -0
  223. package/build/server/graphql/types/response-pagination.js +14 -0
  224. package/build/server/graphql/types/update-comment.d.ts +4 -0
  225. package/build/server/graphql/types/update-comment.js +12 -0
  226. package/build/server/index.d.ts +26 -0
  227. package/build/server/index.js +25 -0
  228. package/build/server/register.d.ts +3 -0
  229. package/build/server/register.js +3 -0
  230. package/build/server/routes/admin.d.ts +4 -0
  231. package/build/server/routes/admin.js +118 -0
  232. package/build/server/routes/client.d.ts +4 -0
  233. package/build/server/routes/client.js +54 -0
  234. package/build/server/routes/index.d.ts +11 -0
  235. package/build/server/routes/index.js +21 -0
  236. package/build/server/services/admin.d.ts +5 -0
  237. package/build/server/services/admin.js +296 -0
  238. package/build/server/services/client.d.ts +5 -0
  239. package/build/server/services/client.js +247 -0
  240. package/build/server/services/common.d.ts +5 -0
  241. package/build/server/services/common.js +266 -0
  242. package/build/server/services/graphql.d.ts +5 -0
  243. package/build/server/services/graphql.js +136 -0
  244. package/build/server/services/index.d.ts +8 -0
  245. package/build/server/services/index.js +16 -0
  246. package/build/server/services/utils/functions.d.ts +13 -0
  247. package/build/server/services/utils/functions.js +141 -0
  248. package/build/server/utils/constants.d.ts +9 -0
  249. package/build/server/utils/constants.js +23 -0
  250. package/build/server/utils/error.d.ts +23 -0
  251. package/build/server/utils/error.js +29 -0
  252. package/build/server/utils/functions.d.ts +14 -0
  253. package/build/server/utils/functions.js +50 -0
  254. package/build/strapi-admin.d.ts +3 -0
  255. package/build/strapi-admin.js +10 -0
  256. package/build/strapi-server.d.ts +177 -0
  257. package/build/strapi-server.js +46 -0
  258. package/build/tsconfig.tsbuildinfo +1 -0
  259. package/build/types/contentTypes.d.ts +46 -0
  260. package/build/types/contentTypes.js +3 -0
  261. package/package.json +3 -3
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const react_1 = __importDefault(require("react"));
9
+ const initSize = 16;
10
+ const ReviewIcon = ({ width, height, size = 16 }) =>
11
+ react_1.default.createElement(
12
+ "svg",
13
+ {
14
+ width: width || size,
15
+ height: height || size,
16
+ viewBox: `0 0 ${width || size} ${height || size}`,
17
+ style: { width: `${width || size}px`, height: `${height || size}px` },
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ },
20
+ react_1.default.createElement(
21
+ "g",
22
+ { style: { transform: `scale(${(width || size) / initSize})` } },
23
+ react_1.default.createElement("path", {
24
+ fillRule: "evenodd",
25
+ clipRule: "evenodd",
26
+ d: "M0 4a4 4 0 014-4h8a4 4 0 014 4v8a4 4 0 01-4 4H4a4 4 0 01-4-4V4zm6.996.165a1.017 1.017 0 112.012 0L8 11 6.996 4.165zM8 11a1 1 0 110 2 1 1 0 010-2z",
27
+ })
28
+ )
29
+ );
30
+ exports.default = ReviewIcon;
31
+ //# sourceMappingURL=review.js.map
@@ -0,0 +1,11 @@
1
+ declare const UnlockIcon: ({
2
+ width,
3
+ height,
4
+ size,
5
+ }: {
6
+ width: any;
7
+ height: any;
8
+ size?: number | undefined;
9
+ }) => any;
10
+ export default UnlockIcon;
11
+ //# sourceMappingURL=unlock.d.ts.map
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const react_1 = __importDefault(require("react"));
9
+ const initSize = 330;
10
+ const UnlockIcon = ({ width, height, size = 16 }) =>
11
+ react_1.default.createElement(
12
+ "svg",
13
+ {
14
+ width: width || size,
15
+ height: height || size,
16
+ viewBox: `0 0 ${width || size} ${height || size}`,
17
+ style: { width: `${width || size}px`, height: `${height || size}px` },
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ },
20
+ react_1.default.createElement(
21
+ "g",
22
+ { style: { transform: `scale(${(width || size) / initSize})` } },
23
+ react_1.default.createElement("path", {
24
+ d: "M15,160c8.283,0,15-6.716,15-15V85c0-30.327,24.672-55,55-55c30.326,0,55,24.673,55,55v42.893\n c-24.479,21.105-40,52.327-40,87.107c0,63.411,51.588,115,115,115c63.41,0,115-51.589,115-115s-51.59-115-115-115\n c-15.961,0-31.172,3.271-45,9.174V85c0-46.869-38.131-85-85-85S0,38.131,0,85v60C0,153.284,6.715,160,15,160z",
25
+ })
26
+ )
27
+ );
28
+ exports.default = UnlockIcon;
29
+ //# sourceMappingURL=unlock.js.map
@@ -0,0 +1,8 @@
1
+ declare const useConfig: (toggleNotification: any) => {
2
+ fetch: any;
3
+ restartMutation: any;
4
+ submitMutation: any;
5
+ restoreMutation: any;
6
+ };
7
+ export default useConfig;
8
+ //# sourceMappingURL=useConfig.d.ts.map
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const react_query_1 = require("react-query");
9
+ const api_1 = require("../pages/Settings/utils/api");
10
+ const pluginId_1 = __importDefault(require("../pluginId"));
11
+ const useConfig = (toggleNotification) => {
12
+ const queryClient = (0, react_query_1.useQueryClient)();
13
+ const fetch = (0, react_query_1.useQuery)("get-config", () =>
14
+ (0, api_1.fetchConfig)(toggleNotification)
15
+ );
16
+ const handleError = (type, callback = () => {}) => {
17
+ toggleNotification({
18
+ type: "warning",
19
+ message: `${pluginId_1.default}.page.settings.notification.${type}.error`,
20
+ });
21
+ callback();
22
+ };
23
+ const handleSuccess = (
24
+ type,
25
+ callback = () => {},
26
+ invalidateQueries = true
27
+ ) => {
28
+ if (invalidateQueries) {
29
+ queryClient.invalidateQueries("get-config");
30
+ }
31
+ toggleNotification({
32
+ type: "success",
33
+ message: `${pluginId_1.default}.page.settings.notification.${type}.success`,
34
+ });
35
+ callback();
36
+ };
37
+ const submitMutation = (0, react_query_1.useMutation)(api_1.updateConfig, {
38
+ onSuccess: () => handleSuccess("submit"),
39
+ onError: () => handleError("submit"),
40
+ });
41
+ const restoreMutation = (0, react_query_1.useMutation)(api_1.restoreConfig, {
42
+ onSuccess: () => handleSuccess("restore"),
43
+ onError: () => handleError("restore"),
44
+ });
45
+ const restartMutation = (0, react_query_1.useMutation)(api_1.restartStrapi, {
46
+ onSuccess: () => handleSuccess("restart", () => {}, false),
47
+ onError: () => handleError("restart"),
48
+ });
49
+ return { fetch, restartMutation, submitMutation, restoreMutation };
50
+ };
51
+ exports.default = useConfig;
52
+ //# sourceMappingURL=useConfig.js.map
@@ -0,0 +1,7 @@
1
+ import { ToBeFixed } from "../../types";
2
+ declare const _default: {
3
+ register(app: ToBeFixed): void;
4
+ registerTrads({ locales }: ToBeFixed): Promise<any[]>;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ var __createBinding =
3
+ (this && this.__createBinding) ||
4
+ (Object.create
5
+ ? function (o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (
9
+ !desc ||
10
+ ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
+ ) {
12
+ desc = {
13
+ enumerable: true,
14
+ get: function () {
15
+ return m[k];
16
+ },
17
+ };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }
21
+ : function (o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ });
25
+ var __setModuleDefault =
26
+ (this && this.__setModuleDefault) ||
27
+ (Object.create
28
+ ? function (o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }
31
+ : function (o, v) {
32
+ o["default"] = v;
33
+ });
34
+ var __importStar =
35
+ (this && this.__importStar) ||
36
+ function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null)
40
+ for (var k in mod)
41
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
42
+ __createBinding(result, mod, k);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ var __importDefault =
47
+ (this && this.__importDefault) ||
48
+ function (mod) {
49
+ return mod && mod.__esModule ? mod : { default: mod };
50
+ };
51
+ Object.defineProperty(exports, "__esModule", { value: true });
52
+ const helper_plugin_1 = require("@strapi/helper-plugin");
53
+ const pluginPkg = __importStar(require("../../package.json"));
54
+ const pluginId_1 = require("./pluginId");
55
+ const Initializer_1 = __importDefault(require("./components/Initializer"));
56
+ const PluginIcon_1 = __importDefault(require("./components/PluginIcon"));
57
+ const permissions_1 = __importDefault(require("./permissions"));
58
+ const reducers_1 = __importDefault(require("./reducers"));
59
+ const { name, displayName } = pluginPkg.strapi;
60
+ exports.default = {
61
+ register(app) {
62
+ app.addMenuLink({
63
+ to: `/plugins/${pluginId_1.pluginId}/discover`,
64
+ badgeContent: 1,
65
+ icon: PluginIcon_1.default,
66
+ intlLabel: {
67
+ id: `${pluginId_1.pluginId}.plugin.name`,
68
+ defaultMessage: displayName,
69
+ },
70
+ Component: async () => {
71
+ const component = await Promise.resolve().then(() =>
72
+ __importStar(require("./pages/App"))
73
+ );
74
+ return component;
75
+ },
76
+ permissions: permissions_1.default.access,
77
+ });
78
+ app.createSettingSection(
79
+ {
80
+ id: pluginId_1.pluginId,
81
+ intlLabel: {
82
+ id: `${pluginId_1.pluginId}.plugin.section`,
83
+ defaultMessage: `${displayName} plugin`,
84
+ },
85
+ },
86
+ [
87
+ {
88
+ intlLabel: {
89
+ id: `${pluginId_1.pluginId}.plugin.section.item`,
90
+ defaultMessage: "Configuration",
91
+ },
92
+ id: "comments",
93
+ to: `/settings/${pluginId_1.pluginId}`,
94
+ Component: async () => {
95
+ const component = await Promise.resolve().then(() =>
96
+ __importStar(require("./pages/Settings"))
97
+ );
98
+ return component;
99
+ },
100
+ permissions: permissions_1.default.settings,
101
+ },
102
+ ]
103
+ );
104
+ app.addReducers(reducers_1.default);
105
+ app.registerPlugin({
106
+ id: pluginId_1.pluginId,
107
+ initializer: Initializer_1.default,
108
+ isReady: false,
109
+ name,
110
+ });
111
+ },
112
+ async registerTrads({ locales }) {
113
+ const importedTrads = await Promise.all(
114
+ locales.map((locale) => {
115
+ return Promise.resolve()
116
+ .then(() => __importStar(require(`./translations/${locale}.json`)))
117
+ .then(({ default: data }) => {
118
+ return {
119
+ data: (0, helper_plugin_1.prefixPluginTranslations)(
120
+ data,
121
+ pluginId_1.pluginId
122
+ ),
123
+ locale,
124
+ };
125
+ })
126
+ .catch(() => {
127
+ return {
128
+ data: {},
129
+ locale,
130
+ };
131
+ });
132
+ })
133
+ );
134
+ return Promise.resolve(importedTrads);
135
+ },
136
+ };
137
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ export declare function mapDispatchToProps(dispatch: any): any;
2
+ declare const _default: any;
3
+ export default _default;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.mapDispatchToProps = void 0;
9
+ const react_1 = __importDefault(require("react"));
10
+ const react_redux_1 = require("react-redux");
11
+ const redux_1 = require("redux");
12
+ const react_router_dom_1 = require("react-router-dom");
13
+ const react_query_1 = require("react-query");
14
+ const helper_plugin_1 = require("@strapi/helper-plugin");
15
+ const ComingSoonPage_1 = __importDefault(require("../ComingSoonPage"));
16
+ const getUrl_1 = __importDefault(require("../../utils/getUrl"));
17
+ const Discover_1 = __importDefault(require("../Discover"));
18
+ const Details_1 = __importDefault(require("../Details"));
19
+ const api_1 = require("./utils/api");
20
+ const actions_1 = require("./reducer/actions");
21
+ const selectors_1 = __importDefault(require("./reducer/selectors"));
22
+ const App = ({ setConfig }) => {
23
+ const toggleNotification = (0, helper_plugin_1.useNotification)();
24
+ const { isLoading, isFetching } = (0, react_query_1.useQuery)(
25
+ "get-config",
26
+ () => (0, api_1.fetchConfig)(toggleNotification),
27
+ {
28
+ initialData: {},
29
+ onSuccess: (response) => {
30
+ setConfig(response);
31
+ },
32
+ }
33
+ );
34
+ if (isLoading || isFetching) {
35
+ return react_1.default.createElement(
36
+ helper_plugin_1.LoadingIndicatorPage,
37
+ null
38
+ );
39
+ }
40
+ return react_1.default.createElement(
41
+ "div",
42
+ null,
43
+ react_1.default.createElement(
44
+ react_router_dom_1.Switch,
45
+ null,
46
+ react_1.default.createElement(react_router_dom_1.Route, {
47
+ path: (0, getUrl_1.default)("dashboard"),
48
+ component: ComingSoonPage_1.default,
49
+ exact: true,
50
+ }),
51
+ react_1.default.createElement(react_router_dom_1.Route, {
52
+ path: (0, getUrl_1.default)("discover"),
53
+ component: Discover_1.default,
54
+ exact: true,
55
+ }),
56
+ react_1.default.createElement(react_router_dom_1.Route, {
57
+ path: (0, getUrl_1.default)("discover/:id"),
58
+ component: Details_1.default,
59
+ exact: true,
60
+ }),
61
+ react_1.default.createElement(react_router_dom_1.Route, {
62
+ path: (0, getUrl_1.default)("reports"),
63
+ component: ComingSoonPage_1.default,
64
+ exact: true,
65
+ }),
66
+ react_1.default.createElement(react_router_dom_1.Route, {
67
+ path: (0, getUrl_1.default)("settings"),
68
+ component: ComingSoonPage_1.default,
69
+ exact: true,
70
+ }),
71
+ react_1.default.createElement(react_router_dom_1.Route, {
72
+ component: helper_plugin_1.NotFound,
73
+ })
74
+ )
75
+ );
76
+ };
77
+ const mapStateToProps = (0, selectors_1.default)();
78
+ function mapDispatchToProps(dispatch) {
79
+ return (0, redux_1.bindActionCreators)(
80
+ { setConfig: actions_1.setConfig },
81
+ dispatch
82
+ );
83
+ }
84
+ exports.mapDispatchToProps = mapDispatchToProps;
85
+ const withConnect = (0, react_redux_1.connect)(
86
+ mapStateToProps,
87
+ mapDispatchToProps
88
+ );
89
+ exports.default = (0, redux_1.compose)(withConnect)(App);
90
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,8 @@
1
+ export declare const setConfig: (data: any) => {
2
+ data: any;
3
+ type: string;
4
+ };
5
+ export declare const getConfig: () => {
6
+ type: string;
7
+ };
8
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConfig = exports.setConfig = void 0;
4
+ const constants_1 = require("./constants");
5
+ const setConfig = (data) => ({
6
+ data,
7
+ type: constants_1.SET_CONFIG,
8
+ });
9
+ exports.setConfig = setConfig;
10
+ const getConfig = () => ({ type: constants_1.GET_CONFIG });
11
+ exports.getConfig = getConfig;
12
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1,4 @@
1
+ export declare const REDUCER_NAME = "plugin-comments_app";
2
+ export declare const SET_CONFIG = "SET_CONFIG";
3
+ export declare const GET_CONFIG = "GET_CONFIG";
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_CONFIG = exports.SET_CONFIG = exports.REDUCER_NAME = void 0;
4
+ exports.REDUCER_NAME = "plugin-comments_app";
5
+ exports.SET_CONFIG = "SET_CONFIG";
6
+ exports.GET_CONFIG = "GET_CONFIG";
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,14 @@
1
+ declare const initialState: {
2
+ config: {};
3
+ };
4
+ declare const reducer: (
5
+ state:
6
+ | {
7
+ config: {};
8
+ }
9
+ | undefined,
10
+ action: any
11
+ ) => any;
12
+ export default reducer;
13
+ export { initialState };
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.initialState = void 0;
9
+ const immer_1 = __importDefault(require("immer"));
10
+ const lodash_1 = require("lodash");
11
+ const constants_1 = require("./constants");
12
+ const initialState = {
13
+ config: {},
14
+ };
15
+ exports.initialState = initialState;
16
+ const reducer = (state = initialState, action) =>
17
+ (0, immer_1.default)(state, (draftState) => {
18
+ switch (action.type) {
19
+ case constants_1.SET_CONFIG: {
20
+ (0, lodash_1.set)(draftState, "config", action.data);
21
+ break;
22
+ }
23
+ case constants_1.GET_CONFIG: {
24
+ return draftState?.config;
25
+ }
26
+ default:
27
+ return draftState;
28
+ }
29
+ });
30
+ exports.default = reducer;
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ declare const initReducer: (initialState: any) => any;
2
+ export default initReducer;
3
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const initReducer = (initialState) => {
4
+ return {
5
+ ...initialState,
6
+ };
7
+ };
8
+ exports.default = initReducer;
9
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1,6 @@
1
+ declare const appView: () => (state: any) => any;
2
+ declare const makeAppView: () => any;
3
+ declare const selectConfig: (state: any) => any;
4
+ export default makeAppView;
5
+ export { appView, selectConfig };
6
+ //# sourceMappingURL=selectors.d.ts.map
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectConfig = exports.appView = void 0;
4
+ const reselect_1 = require("reselect");
5
+ const _1 = require("./");
6
+ const constants_1 = require("./constants");
7
+ const appView = () => (state) =>
8
+ state[constants_1.REDUCER_NAME] || _1.initialState;
9
+ exports.appView = appView;
10
+ const makeAppView = () =>
11
+ (0, reselect_1.createSelector)(appView(), (substate) => {
12
+ return substate;
13
+ });
14
+ const selectConfig = (state) => {
15
+ const { config } = state;
16
+ return config;
17
+ };
18
+ exports.selectConfig = selectConfig;
19
+ exports.default = makeAppView;
20
+ //# sourceMappingURL=selectors.js.map
@@ -0,0 +1,2 @@
1
+ export declare const fetchConfig: (toggleNotification: any) => Promise<any>;
2
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchConfig = void 0;
4
+ const utils_1 = require("../../../utils");
5
+ const fetchConfig = async (toggleNotification) => {
6
+ try {
7
+ const { data } = await utils_1.axiosInstance.get(
8
+ (0, utils_1.getApiURL)(`moderate/config`)
9
+ );
10
+ return data;
11
+ } catch (err) {
12
+ (0, utils_1.handleAPIError)(err, toggleNotification);
13
+ }
14
+ };
15
+ exports.fetchConfig = fetchConfig;
16
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1,3 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __createBinding =
3
+ (this && this.__createBinding) ||
4
+ (Object.create
5
+ ? function (o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (
9
+ !desc ||
10
+ ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
+ ) {
12
+ desc = {
13
+ enumerable: true,
14
+ get: function () {
15
+ return m[k];
16
+ },
17
+ };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }
21
+ : function (o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ });
25
+ var __setModuleDefault =
26
+ (this && this.__setModuleDefault) ||
27
+ (Object.create
28
+ ? function (o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }
31
+ : function (o, v) {
32
+ o["default"] = v;
33
+ });
34
+ var __importStar =
35
+ (this && this.__importStar) ||
36
+ function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null)
40
+ for (var k in mod)
41
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
42
+ __createBinding(result, mod, k);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ var __importDefault =
47
+ (this && this.__importDefault) ||
48
+ function (mod) {
49
+ return mod && mod.__esModule ? mod : { default: mod };
50
+ };
51
+ Object.defineProperty(exports, "__esModule", { value: true });
52
+ const react_1 = __importStar(require("react"));
53
+ const Box_1 = require("@strapi/design-system/Box");
54
+ const EmptyStateLayout_1 = require("@strapi/design-system/EmptyStateLayout");
55
+ const Layout_1 = require("@strapi/design-system/Layout");
56
+ const icons_1 = require("@strapi/icons");
57
+ const getMessage_1 = __importDefault(require("../../utils/getMessage"));
58
+ const Nav_1 = __importDefault(require("../../components/Nav"));
59
+ const ComingSoonPage = () => {
60
+ return react_1.default.createElement(
61
+ Box_1.Box,
62
+ { background: "neutral100" },
63
+ react_1.default.createElement(
64
+ Layout_1.Layout,
65
+ { sideNav: react_1.default.createElement(Nav_1.default, null) },
66
+ react_1.default.createElement(
67
+ Box_1.Box,
68
+ { padding: 8, background: "neutral100" },
69
+ react_1.default.createElement(EmptyStateLayout_1.EmptyStateLayout, {
70
+ icon: react_1.default.createElement(icons_1.Illo, null),
71
+ content: (0, getMessage_1.default)("page.coming.soon"),
72
+ })
73
+ )
74
+ )
75
+ );
76
+ };
77
+ exports.default = (0, react_1.memo)(ComingSoonPage);
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,18 @@
1
+ declare const DetailsEntity: {
2
+ ({ data, schema, config, filters, onFiltersChange, }: {
3
+ data?: {} | undefined;
4
+ schema?: {} | undefined;
5
+ config?: {} | undefined;
6
+ filters: any;
7
+ onFiltersChange: any;
8
+ }): any;
9
+ propTypes: {
10
+ data: any;
11
+ schema: any;
12
+ config: any;
13
+ filters: any;
14
+ onFiltersChange: any;
15
+ };
16
+ };
17
+ export default DetailsEntity;
18
+ //# sourceMappingURL=index.d.ts.map