strapi-plugin-comments 2.0.8 → 2.1.0-beta.1

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 (267) hide show
  1. package/README.md +171 -127
  2. package/admin/src/components/ActionButton/styles.d.ts +2 -0
  3. package/admin/src/components/ActionButton/styles.js +13 -8
  4. package/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
  5. package/admin/src/components/ConfirmationDialog/index.js +36 -55
  6. package/admin/src/components/DiscussionStatus/index.d.ts +9 -0
  7. package/admin/src/components/DiscussionStatus/index.js +22 -31
  8. package/admin/src/components/DiscussionThread/index.d.ts +16 -0
  9. package/admin/src/components/DiscussionThread/index.js +39 -56
  10. package/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
  11. package/admin/src/components/DiscussionThreadItem/index.js +28 -52
  12. package/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
  13. package/admin/src/components/DiscussionThreadItem/styles.js +16 -11
  14. package/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
  15. package/admin/src/components/DiscussionThreadItemActions/index.js +121 -158
  16. package/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
  17. package/admin/src/components/DiscussionThreadItemActions/styles.js +13 -7
  18. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
  19. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +38 -48
  20. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
  21. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +12 -6
  22. package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
  23. package/admin/src/components/DiscussionThreadItemFooter/index.js +35 -42
  24. package/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
  25. package/admin/src/components/DiscussionThreadItemFooter/styles.js +17 -12
  26. package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
  27. package/admin/src/components/DiscussionThreadItemReviewAction/index.js +77 -91
  28. package/admin/src/components/FormSwitch/index.d.ts +7 -0
  29. package/admin/src/components/FormSwitch/index.js +15 -18
  30. package/admin/src/components/FormSwitch/styles.d.ts +2 -0
  31. package/admin/src/components/FormSwitch/styles.js +14 -8
  32. package/admin/src/components/IconButton/styles.d.ts +2 -0
  33. package/admin/src/components/IconButton/styles.js +16 -9
  34. package/admin/src/components/Initializer/index.d.ts +5 -0
  35. package/admin/src/components/Initializer/index.js +12 -24
  36. package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
  37. package/admin/src/components/LoadingIndicatorOverlay/index.js +12 -15
  38. package/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
  39. package/admin/src/components/LoadingIndicatorOverlay/styles.js +22 -17
  40. package/admin/src/components/Nav/index.d.ts +7 -0
  41. package/admin/src/components/Nav/index.js +25 -48
  42. package/admin/src/components/PluginIcon/index.d.ts +3 -0
  43. package/admin/src/components/PluginIcon/index.js +10 -12
  44. package/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
  45. package/admin/src/components/ReportsReviewModal/index.js +31 -46
  46. package/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
  47. package/admin/src/components/ReportsReviewTable/index.js +120 -140
  48. package/admin/src/components/StatusBadge/index.d.ts +7 -0
  49. package/admin/src/components/StatusBadge/index.js +12 -17
  50. package/admin/src/components/StatusBadge/styles.d.ts +2 -0
  51. package/admin/src/components/StatusBadge/styles.js +19 -13
  52. package/admin/src/components/TableFilters/index.d.ts +10 -0
  53. package/admin/src/components/TableFilters/index.js +52 -49
  54. package/admin/src/components/TablePagination/index.d.ts +17 -0
  55. package/admin/src/components/TablePagination/index.js +27 -29
  56. package/admin/src/components/icons/comments.d.ts +6 -0
  57. package/admin/src/components/icons/comments.js +11 -8
  58. package/admin/src/components/icons/index.d.ts +6 -0
  59. package/admin/src/components/icons/index.js +15 -6
  60. package/admin/src/components/icons/lock.d.ts +7 -0
  61. package/admin/src/components/icons/lock.js +11 -21
  62. package/admin/src/components/icons/review.d.ts +7 -0
  63. package/admin/src/components/icons/review.js +11 -17
  64. package/admin/src/components/icons/unlock.d.ts +7 -0
  65. package/admin/src/components/icons/unlock.js +11 -19
  66. package/admin/src/hooks/useConfig.d.ts +8 -0
  67. package/admin/src/hooks/useConfig.js +40 -45
  68. package/admin/src/index.d.ts +7 -0
  69. package/admin/src/index.js +98 -92
  70. package/admin/src/pages/App/index.d.ts +4 -0
  71. package/admin/src/pages/App/index.js +43 -67
  72. package/admin/src/pages/App/reducer/actions.d.ts +8 -0
  73. package/admin/src/pages/App/reducer/actions.js +11 -7
  74. package/admin/src/pages/App/reducer/constants.d.ts +4 -0
  75. package/admin/src/pages/App/reducer/constants.js +7 -4
  76. package/admin/src/pages/App/reducer/index.d.ts +9 -0
  77. package/admin/src/pages/App/reducer/index.js +24 -22
  78. package/admin/src/pages/App/reducer/init.d.ts +3 -0
  79. package/admin/src/pages/App/reducer/init.js +6 -4
  80. package/admin/src/pages/App/reducer/selectors.d.ts +6 -0
  81. package/admin/src/pages/App/reducer/selectors.js +17 -34
  82. package/admin/src/pages/App/utils/api.d.ts +2 -0
  83. package/admin/src/pages/App/utils/api.js +14 -11
  84. package/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
  85. package/admin/src/pages/ComingSoonPage/index.js +42 -24
  86. package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
  87. package/admin/src/pages/Details/components/DetailsEntity/index.js +49 -77
  88. package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
  89. package/admin/src/pages/Details/components/DetailsFilters/index.js +19 -26
  90. package/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
  91. package/admin/src/pages/Details/components/DetailsFilters/styles.js +14 -8
  92. package/admin/src/pages/Details/index.d.ts +4 -0
  93. package/admin/src/pages/Details/index.js +94 -133
  94. package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
  95. package/admin/src/pages/Discover/components/DiscoverTableRow/index.js +128 -139
  96. package/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
  97. package/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +14 -8
  98. package/admin/src/pages/Discover/index.d.ts +4 -0
  99. package/admin/src/pages/Discover/index.js +129 -170
  100. package/admin/src/pages/Discover/utils/api.d.ts +2 -0
  101. package/admin/src/pages/Discover/utils/api.js +15 -13
  102. package/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
  103. package/admin/src/pages/Discover/utils/filtersSchema.js +8 -6
  104. package/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
  105. package/admin/src/pages/Settings/components/RestartAlert/styles.js +14 -8
  106. package/admin/src/pages/Settings/index.d.ts +3 -0
  107. package/admin/src/pages/Settings/index.js +225 -391
  108. package/admin/src/pages/Settings/utils/api.d.ts +7 -0
  109. package/admin/src/pages/Settings/utils/api.js +60 -55
  110. package/admin/src/pages/utils/api.d.ts +12 -0
  111. package/admin/src/pages/utils/api.js +58 -53
  112. package/admin/src/permissions.d.ts +28 -0
  113. package/admin/src/permissions.js +31 -17
  114. package/admin/src/pluginId.d.ts +2 -0
  115. package/admin/src/pluginId.js +29 -5
  116. package/admin/src/reducers.d.ts +7 -0
  117. package/admin/src/reducers.js +10 -6
  118. package/admin/src/translations/en.json +131 -130
  119. package/admin/src/translations/fr.json +1 -1
  120. package/admin/src/translations/pt-BR.json +132 -0
  121. package/admin/src/utils/axiosInstance.d.ts +3 -0
  122. package/admin/src/utils/axiosInstance.js +21 -27
  123. package/admin/src/utils/constants.d.ts +25 -0
  124. package/admin/src/utils/constants.js +23 -22
  125. package/admin/src/utils/getApiUrl.d.ts +3 -0
  126. package/admin/src/utils/getApiUrl.js +6 -5
  127. package/admin/src/utils/getMessage.d.ts +4 -0
  128. package/admin/src/utils/getMessage.js +15 -15
  129. package/admin/src/utils/getRelatedGroups.d.ts +4 -0
  130. package/admin/src/utils/getRelatedGroups.js +5 -3
  131. package/admin/src/utils/getUrl.d.ts +3 -0
  132. package/admin/src/utils/getUrl.js +6 -5
  133. package/admin/src/utils/handleAPIError.d.ts +4 -0
  134. package/admin/src/utils/handleAPIError.js +12 -11
  135. package/admin/src/utils/index.d.ts +12 -0
  136. package/admin/src/utils/index.js +29 -11
  137. package/admin/src/utils/parseRegExp.d.ts +6 -0
  138. package/admin/src/utils/parseRegExp.js +6 -5
  139. package/admin/src/utils/renderEntryTitle.d.ts +4 -0
  140. package/admin/src/utils/renderEntryTitle.js +11 -12
  141. package/admin/src/utils/renderInitials.d.ts +3 -0
  142. package/admin/src/utils/renderInitials.js +10 -5
  143. package/admin/src/utils/resolveCommentStatus.d.ts +4 -0
  144. package/admin/src/utils/resolveCommentStatus.js +17 -21
  145. package/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
  146. package/admin/src/utils/resolveCommentStatusColor.js +19 -19
  147. package/content-types/comment.d.ts +91 -0
  148. package/content-types/comment.js +87 -88
  149. package/content-types/index.d.ts +143 -0
  150. package/content-types/index.js +15 -10
  151. package/content-types/report.d.ts +48 -0
  152. package/content-types/report.js +44 -49
  153. package/package.json +24 -19
  154. package/permissions.d.ts +18 -0
  155. package/permissions.js +12 -13
  156. package/server/bootstrap.d.ts +4 -0
  157. package/server/bootstrap.js +56 -62
  158. package/server/config/index.d.ts +4 -0
  159. package/server/config/index.js +17 -15
  160. package/server/controllers/admin.d.ts +4 -0
  161. package/server/controllers/admin.js +134 -167
  162. package/server/controllers/client.d.ts +4 -0
  163. package/server/controllers/client.js +104 -115
  164. package/server/controllers/index.d.ts +6 -0
  165. package/server/controllers/index.js +12 -8
  166. package/server/controllers/utils/functions.d.ts +7 -0
  167. package/server/controllers/utils/functions.js +22 -17
  168. package/server/controllers/utils/parsers.d.ts +15 -0
  169. package/server/controllers/utils/parsers.js +17 -17
  170. package/server/destroy.d.ts +3 -0
  171. package/server/destroy.js +3 -4
  172. package/server/graphql/index.d.ts +4 -0
  173. package/server/graphql/index.js +27 -25
  174. package/server/graphql/mutations/createAbuseReport.d.ts +11 -0
  175. package/server/graphql/mutations/createAbuseReport.js +22 -24
  176. package/server/graphql/mutations/createComment.d.ts +14 -0
  177. package/server/graphql/mutations/createComment.js +22 -24
  178. package/server/graphql/mutations/index.d.ts +4 -0
  179. package/server/graphql/mutations/index.js +24 -19
  180. package/server/graphql/mutations/removeComment.d.ts +11 -0
  181. package/server/graphql/mutations/removeComment.js +22 -24
  182. package/server/graphql/mutations/updateComment.d.ts +11 -0
  183. package/server/graphql/mutations/updateComment.js +22 -24
  184. package/server/graphql/queries/findAllFlat.d.ts +19 -0
  185. package/server/graphql/queries/findAllFlat.js +31 -30
  186. package/server/graphql/queries/findAllInHierarchy.d.ts +18 -0
  187. package/server/graphql/queries/findAllInHierarchy.js +26 -30
  188. package/server/graphql/queries/index.d.ts +4 -0
  189. package/server/graphql/queries/index.js +20 -17
  190. package/server/graphql/resolvers-config.d.ts +23 -0
  191. package/server/graphql/resolvers-config.js +11 -11
  192. package/server/graphql/types/comment-author.d.ts +4 -0
  193. package/server/graphql/types/comment-author.js +10 -8
  194. package/server/graphql/types/comment-nested.d.ts +4 -0
  195. package/server/graphql/types/comment-nested.js +17 -15
  196. package/server/graphql/types/comment.d.ts +4 -0
  197. package/server/graphql/types/comment.js +16 -14
  198. package/server/graphql/types/create-comment-author.d.ts +4 -0
  199. package/server/graphql/types/create-comment-author.js +10 -8
  200. package/server/graphql/types/create-comment.d.ts +4 -0
  201. package/server/graphql/types/create-comment.js +10 -8
  202. package/server/graphql/types/create-report.d.ts +4 -0
  203. package/server/graphql/types/create-report.js +10 -8
  204. package/server/graphql/types/id.d.ts +4 -0
  205. package/server/graphql/types/id.js +24 -23
  206. package/server/graphql/types/identify-comment-author.d.ts +4 -0
  207. package/server/graphql/types/identify-comment-author.js +7 -5
  208. package/server/graphql/types/index.d.ts +4 -0
  209. package/server/graphql/types/index.js +36 -17
  210. package/server/graphql/types/remove-comment.d.ts +4 -0
  211. package/server/graphql/types/remove-comment.js +9 -7
  212. package/server/graphql/types/report-reason.d.ts +4 -0
  213. package/server/graphql/types/report-reason.js +10 -8
  214. package/server/graphql/types/report.d.ts +4 -0
  215. package/server/graphql/types/report.js +12 -10
  216. package/server/graphql/types/response-find-all.d.ts +4 -0
  217. package/server/graphql/types/response-find-all.js +8 -6
  218. package/server/graphql/types/response-meta.d.ts +4 -0
  219. package/server/graphql/types/response-meta.js +7 -5
  220. package/server/graphql/types/response-pagination.d.ts +4 -0
  221. package/server/graphql/types/response-pagination.js +12 -10
  222. package/server/graphql/types/update-comment.d.ts +4 -0
  223. package/server/graphql/types/update-comment.js +10 -8
  224. package/server/index.d.ts +26 -0
  225. package/server/index.js +24 -21
  226. package/server/register.d.ts +3 -0
  227. package/server/register.js +3 -4
  228. package/server/routes/admin.d.ts +4 -0
  229. package/server/routes/admin.js +103 -109
  230. package/server/routes/client.d.ts +4 -0
  231. package/server/routes/client.js +48 -46
  232. package/server/routes/index.d.ts +11 -0
  233. package/server/routes/index.js +18 -14
  234. package/server/services/admin.d.ts +5 -0
  235. package/server/services/admin.js +126 -158
  236. package/server/services/client.d.ts +5 -0
  237. package/server/services/client.js +135 -151
  238. package/server/services/common.d.ts +5 -0
  239. package/server/services/common.js +165 -194
  240. package/server/services/graphql.d.ts +5 -0
  241. package/server/services/graphql.js +117 -182
  242. package/server/services/index.d.ts +8 -0
  243. package/server/services/index.js +15 -12
  244. package/server/services/utils/functions.d.ts +13 -0
  245. package/server/services/utils/functions.js +100 -109
  246. package/server/utils/constants.d.ts +9 -0
  247. package/server/utils/constants.js +19 -23
  248. package/server/utils/error.d.ts +19 -0
  249. package/server/utils/error.js +23 -18
  250. package/server/utils/functions.d.ts +6 -0
  251. package/server/utils/functions.js +35 -18
  252. package/strapi-admin.d.ts +3 -0
  253. package/strapi-admin.js +8 -3
  254. package/strapi-server.d.ts +177 -0
  255. package/strapi-server.js +43 -46
  256. package/tsconfig.tsbuildinfo +1 -0
  257. package/types/contentTypes.d.ts +44 -0
  258. package/types/contentTypes.js +3 -0
  259. package/.husky/pre-commit +0 -4
  260. package/LICENSE.md +0 -7
  261. package/__mocks__/initSetup.js +0 -108
  262. package/jest.config.js +0 -7
  263. package/server/controllers/utils/__tests__/functions.test.js +0 -43
  264. package/server/controllers/utils/__tests__/parsers.test.js +0 -94
  265. package/server/services/__tests__/common.test.js +0 -399
  266. package/server/services/utils/__tests__/functions.test.js +0 -53
  267. package/server/utils/__tests__/functions.test.js +0 -17
@@ -1,53 +1,56 @@
1
- import React, { useRef, useState } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Button } from '@strapi/design-system/Button';
4
- import { Box } from '@strapi/design-system/Box';
5
- import { Filter } from '@strapi/icons';
6
- import { FilterListURLQuery, FilterPopoverURLQuery } from '@strapi/helper-plugin';
7
- import { getMessage } from '../../utils';
8
-
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 prop_types_1 = __importDefault(require("prop-types"));
31
+ const Button_1 = require("@strapi/design-system/Button");
32
+ const Box_1 = require("@strapi/design-system/Box");
33
+ const icons_1 = require("@strapi/icons");
34
+ const helper_plugin_1 = require("@strapi/helper-plugin");
35
+ const utils_1 = require("../../utils");
9
36
  const TableFilters = ({ displayedFilters }) => {
10
- const [isVisible, setIsVisible] = useState(false);
11
- const buttonRef = useRef();
12
-
13
- const handleToggle = () => {
14
- setIsVisible(prev => !prev);
15
- };
16
-
17
- return (
18
- <>
19
- <Box paddingTop={1} paddingBottom={1}>
20
- <Button
21
- variant="tertiary"
22
- ref={buttonRef}
23
- startIcon={<Filter />}
24
- onClick={handleToggle}
25
- size="S"
26
- >
27
- {getMessage('page.discover.table.filters')}
28
- </Button>
29
- {isVisible && (
30
- <FilterPopoverURLQuery
31
- displayedFilters={displayedFilters}
32
- isVisible={isVisible}
33
- onToggle={handleToggle}
34
- source={buttonRef}
35
- />
36
- )}
37
- </Box>
38
- <FilterListURLQuery filtersSchema={displayedFilters} />
39
- </>
40
- );
37
+ const [isVisible, setIsVisible] = (0, react_1.useState)(false);
38
+ const buttonRef = (0, react_1.useRef)();
39
+ const handleToggle = () => {
40
+ setIsVisible((prev) => !prev);
41
+ };
42
+ return (react_1.default.createElement(react_1.default.Fragment, null,
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")),
45
+ isVisible && (react_1.default.createElement(helper_plugin_1.FilterPopoverURLQuery, { displayedFilters: displayedFilters, isVisible: isVisible, onToggle: handleToggle, source: buttonRef }))),
46
+ react_1.default.createElement(helper_plugin_1.FilterListURLQuery, { filtersSchema: displayedFilters })));
41
47
  };
42
-
43
48
  TableFilters.propTypes = {
44
- displayedFilters: PropTypes.arrayOf(
45
- PropTypes.shape({
46
- name: PropTypes.string.isRequired,
47
- metadatas: PropTypes.shape({ label: PropTypes.string }),
48
- fieldSchema: PropTypes.shape({ type: PropTypes.string }),
49
- })
50
- ).isRequired,
49
+ displayedFilters: prop_types_1.default.arrayOf(prop_types_1.default.shape({
50
+ name: prop_types_1.default.string.isRequired,
51
+ metadatas: prop_types_1.default.shape({ label: prop_types_1.default.string }),
52
+ fieldSchema: prop_types_1.default.shape({ type: prop_types_1.default.string }),
53
+ })).isRequired,
51
54
  };
52
-
53
- export default TableFilters;
55
+ exports.default = TableFilters;
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,17 @@
1
+ declare const TablePagination: {
2
+ ({ pagination }: {
3
+ pagination: any;
4
+ }): any;
5
+ defaultProps: {
6
+ pagination: {
7
+ pageCount: number;
8
+ pageSize: number;
9
+ total: number;
10
+ };
11
+ };
12
+ propTypes: {
13
+ pagination: any;
14
+ };
15
+ };
16
+ export default TablePagination;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -1,35 +1,33 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Box } from '@strapi/design-system/Box';
4
- import { Flex } from '@strapi/design-system/Flex';
5
- import { PaginationURLQuery, PageSizeURLQuery } from '@strapi/helper-plugin';
6
-
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 prop_types_1 = __importDefault(require("prop-types"));
8
+ const Box_1 = require("@strapi/design-system/Box");
9
+ const Flex_1 = require("@strapi/design-system/Flex");
10
+ const helper_plugin_1 = require("@strapi/helper-plugin");
7
11
  const TablePagination = ({ pagination }) => {
8
- return (
9
- <Box paddingTop={4}>
10
- <Flex alignItems="flex-end" justifyContent="space-between">
11
- <PageSizeURLQuery trackedEvent="willChangeNumberOfEntriesPerPage" />
12
- <PaginationURLQuery pagination={pagination} />
13
- </Flex>
14
- </Box>
15
- );
12
+ return (react_1.default.createElement(Box_1.Box, { paddingTop: 4 },
13
+ react_1.default.createElement(Flex_1.Flex, { alignItems: "flex-end", justifyContent: "space-between" },
14
+ react_1.default.createElement(helper_plugin_1.PageSizeURLQuery, { trackedEvent: "willChangeNumberOfEntriesPerPage" }),
15
+ react_1.default.createElement(helper_plugin_1.PaginationURLQuery, { pagination: pagination }))));
16
16
  };
17
-
18
17
  TablePagination.defaultProps = {
19
- pagination: {
20
- pageCount: 0,
21
- pageSize: 10,
22
- total: 0,
23
- },
18
+ pagination: {
19
+ pageCount: 0,
20
+ pageSize: 10,
21
+ total: 0,
22
+ },
24
23
  };
25
-
26
24
  TablePagination.propTypes = {
27
- pagination: PropTypes.shape({
28
- page: PropTypes.number,
29
- pageCount: PropTypes.number,
30
- pageSize: PropTypes.number,
31
- total: PropTypes.number,
32
- }),
25
+ pagination: prop_types_1.default.shape({
26
+ page: prop_types_1.default.number,
27
+ pageCount: prop_types_1.default.number,
28
+ pageSize: prop_types_1.default.number,
29
+ total: prop_types_1.default.number,
30
+ }),
33
31
  };
34
-
35
- export default TablePagination;
32
+ exports.default = TablePagination;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ declare const CommentsIcon: ({ width, height }: {
2
+ width?: number | undefined;
3
+ height?: number | undefined;
4
+ }) => any;
5
+ export default CommentsIcon;
6
+ //# sourceMappingURL=comments.d.ts.map
@@ -1,9 +1,12 @@
1
-
2
- import React from 'react';
3
-
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"));
4
7
  const initSize = 576;
5
-
6
- const CommentsIcon = ({ width = 24, height = 24 }) =>
7
- <svg viewBox={`0 0 ${width} ${height}`} xmlns="http://www.w3.org/2000/svg"><g style={ {transform: `scale(${width/initSize})` } }><path d="M416 192c0-88.4-93.1-160-208-160S0 103.6 0 192c0 34.3 14.1 65.9 38 92-13.4 30.2-35.5 54.2-35.8 54.5-2.2 2.3-2.8 5.7-1.5 8.7S4.8 352 8 352c36.6 0 66.9-12.3 88.7-25 32.2 15.7 70.3 25 111.3 25 114.9 0 208-71.6 208-160zm122 220c23.9-26 38-57.7 38-92 0-66.9-53.5-124.2-129.3-148.1.9 6.6 1.3 13.3 1.3 20.1 0 105.9-107.7 192-240 192-10.8 0-21.3-.8-31.7-1.9C207.8 439.6 281.8 480 368 480c41 0 79.1-9.2 111.3-25 21.8 12.7 52.1 25 88.7 25 3.2 0 6.1-1.9 7.3-4.8 1.3-2.9.7-6.3-1.5-8.7-.3-.3-22.4-24.2-35.8-54.5z"/></g></svg>;
8
-
9
- export default CommentsIcon;
8
+ const CommentsIcon = ({ width = 24, height = 24 }) => (react_1.default.createElement("svg", { viewBox: `0 0 ${width} ${height}`, xmlns: "http://www.w3.org/2000/svg" },
9
+ react_1.default.createElement("g", { style: { transform: `scale(${width / initSize})` } },
10
+ react_1.default.createElement("path", { d: "M416 192c0-88.4-93.1-160-208-160S0 103.6 0 192c0 34.3 14.1 65.9 38 92-13.4 30.2-35.5 54.2-35.8 54.5-2.2 2.3-2.8 5.7-1.5 8.7S4.8 352 8 352c36.6 0 66.9-12.3 88.7-25 32.2 15.7 70.3 25 111.3 25 114.9 0 208-71.6 208-160zm122 220c23.9-26 38-57.7 38-92 0-66.9-53.5-124.2-129.3-148.1.9 6.6 1.3 13.3 1.3 20.1 0 105.9-107.7 192-240 192-10.8 0-21.3-.8-31.7-1.9C207.8 439.6 281.8 480 368 480c41 0 79.1-9.2 111.3-25 21.8 12.7 52.1 25 88.7 25 3.2 0 6.1-1.9 7.3-4.8 1.3-2.9.7-6.3-1.5-8.7-.3-.3-22.4-24.2-35.8-54.5z" }))));
11
+ exports.default = CommentsIcon;
12
+ //# sourceMappingURL=comments.js.map
@@ -0,0 +1,6 @@
1
+ import CommentsIcon from "./comments";
2
+ import ReviewIcon from "./review";
3
+ import LockIcon from "./lock";
4
+ import UnlockIcon from "./unlock";
5
+ export { CommentsIcon, ReviewIcon, LockIcon, UnlockIcon };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,15 @@
1
- import CommentsIcon from './comments';
2
- import ReviewIcon from './review';
3
- import LockIcon from './lock';
4
- import UnlockIcon from './unlock';
5
-
6
- export { CommentsIcon, ReviewIcon, LockIcon, UnlockIcon };
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.UnlockIcon = exports.LockIcon = exports.ReviewIcon = exports.CommentsIcon = void 0;
7
+ const comments_1 = __importDefault(require("./comments"));
8
+ exports.CommentsIcon = comments_1.default;
9
+ const review_1 = __importDefault(require("./review"));
10
+ exports.ReviewIcon = review_1.default;
11
+ const lock_1 = __importDefault(require("./lock"));
12
+ exports.LockIcon = lock_1.default;
13
+ const unlock_1 = __importDefault(require("./unlock"));
14
+ exports.UnlockIcon = unlock_1.default;
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ declare const LockIcon: ({ width, height, size }: {
2
+ width: any;
3
+ height: any;
4
+ size?: number | undefined;
5
+ }) => any;
6
+ export default LockIcon;
7
+ //# sourceMappingURL=lock.d.ts.map
@@ -1,22 +1,12 @@
1
-
2
- import React from 'react';
3
-
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"));
4
7
  const initSize = 330;
5
-
6
- const LockIcon = ({ width, height, size = 16 }) =>
7
- <svg
8
- width={width || size}
9
- height={height || size}
10
- viewBox={`0 0 ${width || size} ${height || size}`}
11
- style={{ width: `${width || size}px`, height: `${height || size}px`, }}
12
- xmlns="http://www.w3.org/2000/svg">
13
- <g style={ { transform: `scale(${(width || size)/initSize})` } }>
14
- <path d="M165,330c63.411,0,115-51.589,115-115c0-29.771-11.373-56.936-30-77.379V85c0-46.869-38.131-85-85-85
15
- S80.001,38.131,80.001,85v52.619C61.373,158.064,50,185.229,50,215C50,278.411,101.589,330,165,330z M180,219.986V240
16
- c0,8.284-6.716,15-15,15s-15-6.716-15-15v-20.014c-6.068-4.565-10-11.824-10-19.986c0-13.785,11.215-25,25-25s25,11.215,25,25
17
- C190,208.162,186.068,215.421,180,219.986z M110.001,85c0-30.327,24.673-55,54.999-55c30.327,0,55,24.673,55,55v29.029
18
- C203.652,105.088,184.91,100,165,100c-19.909,0-38.651,5.088-54.999,14.028V85z"/>
19
- </g>
20
- </svg>
21
-
22
- export default LockIcon;
8
+ const LockIcon = ({ width, height, size = 16 }) => (react_1.default.createElement("svg", { width: width || size, height: height || size, viewBox: `0 0 ${width || size} ${height || size}`, style: { width: `${width || size}px`, height: `${height || size}px` }, xmlns: "http://www.w3.org/2000/svg" },
9
+ react_1.default.createElement("g", { style: { transform: `scale(${(width || size) / initSize})` } },
10
+ react_1.default.createElement("path", { d: "M165,330c63.411,0,115-51.589,115-115c0-29.771-11.373-56.936-30-77.379V85c0-46.869-38.131-85-85-85\n S80.001,38.131,80.001,85v52.619C61.373,158.064,50,185.229,50,215C50,278.411,101.589,330,165,330z M180,219.986V240\n c0,8.284-6.716,15-15,15s-15-6.716-15-15v-20.014c-6.068-4.565-10-11.824-10-19.986c0-13.785,11.215-25,25-25s25,11.215,25,25\n C190,208.162,186.068,215.421,180,219.986z M110.001,85c0-30.327,24.673-55,54.999-55c30.327,0,55,24.673,55,55v29.029\n C203.652,105.088,184.91,100,165,100c-19.909,0-38.651,5.088-54.999,14.028V85z" }))));
11
+ exports.default = LockIcon;
12
+ //# sourceMappingURL=lock.js.map
@@ -0,0 +1,7 @@
1
+ declare const ReviewIcon: ({ width, height, size }: {
2
+ width: any;
3
+ height: any;
4
+ size?: number | undefined;
5
+ }) => any;
6
+ export default ReviewIcon;
7
+ //# sourceMappingURL=review.d.ts.map
@@ -1,18 +1,12 @@
1
-
2
- import React from 'react';
3
-
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"));
4
7
  const initSize = 16;
5
-
6
- const ReviewIcon = ({ width, height, size = 16 }) =>
7
- <svg
8
- width={width || size}
9
- height={height || size}
10
- viewBox={`0 0 ${width || size} ${height || size}`}
11
- style={{ width: `${width || size}px`, height: `${height || size}px`, }}
12
- xmlns="http://www.w3.org/2000/svg">
13
- <g style={ {transform: `scale(${(width || size)/initSize})` } }>
14
- <path fillRule="evenodd" clipRule="evenodd" 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" />
15
- </g>
16
- </svg>
17
-
18
- export default ReviewIcon;
8
+ const ReviewIcon = ({ width, height, size = 16 }) => (react_1.default.createElement("svg", { width: width || size, height: height || size, viewBox: `0 0 ${width || size} ${height || size}`, style: { width: `${width || size}px`, height: `${height || size}px` }, xmlns: "http://www.w3.org/2000/svg" },
9
+ react_1.default.createElement("g", { style: { transform: `scale(${(width || size) / initSize})` } },
10
+ react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", 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" }))));
11
+ exports.default = ReviewIcon;
12
+ //# sourceMappingURL=review.js.map
@@ -0,0 +1,7 @@
1
+ declare const UnlockIcon: ({ width, height, size }: {
2
+ width: any;
3
+ height: any;
4
+ size?: number | undefined;
5
+ }) => any;
6
+ export default UnlockIcon;
7
+ //# sourceMappingURL=unlock.d.ts.map
@@ -1,20 +1,12 @@
1
-
2
- import React from 'react';
3
-
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"));
4
7
  const initSize = 330;
5
-
6
- const UnlockIcon = ({ width, height, size = 16 }) =>
7
- <svg
8
- width={width || size}
9
- height={height || size}
10
- viewBox={`0 0 ${width || size} ${height || size}`}
11
- style={{ width: `${width || size}px`, height: `${height || size}px`, }}
12
- xmlns="http://www.w3.org/2000/svg">
13
- <g style={ { transform: `scale(${(width || size)/initSize})` } }>
14
- <path 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
15
- 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
16
- 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"/>
17
- </g>
18
- </svg>
19
-
20
- export default UnlockIcon;
8
+ const UnlockIcon = ({ width, height, size = 16 }) => (react_1.default.createElement("svg", { width: width || size, height: height || size, viewBox: `0 0 ${width || size} ${height || size}`, style: { width: `${width || size}px`, height: `${height || size}px` }, xmlns: "http://www.w3.org/2000/svg" },
9
+ react_1.default.createElement("g", { style: { transform: `scale(${(width || size) / initSize})` } },
10
+ react_1.default.createElement("path", { 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" }))));
11
+ exports.default = UnlockIcon;
12
+ //# 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
@@ -1,49 +1,44 @@
1
- import { useQuery, useMutation, useQueryClient } from 'react-query';
2
- import { fetchConfig, restartStrapi, restoreConfig, updateConfig } from '../pages/Settings/utils/api';
3
- import pluginId from '../pluginId';
4
-
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_query_1 = require("react-query");
7
+ const api_1 = require("../pages/Settings/utils/api");
8
+ const pluginId_1 = __importDefault(require("../pluginId"));
5
9
  const useConfig = (toggleNotification) => {
6
- const queryClient = useQueryClient();
7
-
8
- const fetch = useQuery('get-config', () =>
9
- fetchConfig(toggleNotification)
10
- );
11
-
12
- const handleError = (type, callback = () => {}) => {
13
- toggleNotification({
14
- type: 'warning',
15
- message: `${pluginId}.page.settings.notification.${type}.error`,
16
- });
17
- callback();
18
- };
19
-
20
- const handleSuccess = (type, callback = () => {}, invalidateQueries = true) => {
21
- if (invalidateQueries) {
22
- queryClient.invalidateQueries('get-config');
10
+ const queryClient = (0, react_query_1.useQueryClient)();
11
+ const fetch = (0, react_query_1.useQuery)("get-config", () => (0, api_1.fetchConfig)(toggleNotification));
12
+ const handleError = (type, callback = () => { }) => {
13
+ toggleNotification({
14
+ type: "warning",
15
+ message: `${pluginId_1.default}.page.settings.notification.${type}.error`,
16
+ });
17
+ callback();
18
+ };
19
+ const handleSuccess = (type, callback = () => { }, invalidateQueries = true) => {
20
+ if (invalidateQueries) {
21
+ queryClient.invalidateQueries("get-config");
22
+ }
23
+ toggleNotification({
24
+ type: "success",
25
+ message: `${pluginId_1.default}.page.settings.notification.${type}.success`,
26
+ });
27
+ callback();
23
28
  };
24
- toggleNotification({
25
- type: 'success',
26
- message: `${pluginId}.page.settings.notification.${type}.success`,
29
+ const submitMutation = (0, react_query_1.useMutation)(api_1.updateConfig, {
30
+ onSuccess: () => handleSuccess("submit"),
31
+ onError: () => handleError("submit"),
32
+ });
33
+ const restoreMutation = (0, react_query_1.useMutation)(api_1.restoreConfig, {
34
+ onSuccess: () => handleSuccess("restore"),
35
+ onError: () => handleError("restore"),
36
+ });
37
+ const restartMutation = (0, react_query_1.useMutation)(api_1.restartStrapi, {
38
+ onSuccess: () => handleSuccess("restart", () => { }, false),
39
+ onError: () => handleError("restart"),
27
40
  });
28
- callback();
29
- };
30
-
31
- const submitMutation = useMutation(updateConfig, {
32
- onSuccess: () => handleSuccess('submit'),
33
- onError: () => handleError('submit'),
34
- });
35
-
36
- const restoreMutation = useMutation(restoreConfig, {
37
- onSuccess: () => handleSuccess('restore'),
38
- onError: () => handleError('restore'),
39
- });
40
-
41
- const restartMutation = useMutation(restartStrapi, {
42
- onSuccess: () => handleSuccess('restart', () => {}, false),
43
- onError: () => handleError('restart'),
44
- });
45
-
46
- return { fetch, restartMutation, submitMutation, restoreMutation };
41
+ return { fetch, restartMutation, submitMutation, restoreMutation };
47
42
  };
48
-
49
- export default useConfig;
43
+ exports.default = useConfig;
44
+ //# 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