strapi-plugin-navigation 2.0.13 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/README.md +105 -27
  2. package/admin/src/components/Alert/styles.d.ts +2 -0
  3. package/admin/src/components/Alert/styles.js +10 -4
  4. package/admin/src/components/CollapseButton/index.d.ts +7 -0
  5. package/admin/src/components/CollapseButton/index.js +21 -22
  6. package/admin/src/components/ConfirmationDialog/index.d.ts +28 -0
  7. package/admin/src/components/ConfirmationDialog/index.js +32 -54
  8. package/admin/src/components/EmptyView/index.d.ts +3 -0
  9. package/admin/src/components/EmptyView/index.js +9 -7
  10. package/admin/src/components/Item/ItemCardBadge/index.d.ts +3 -0
  11. package/admin/src/components/Item/ItemCardBadge/index.js +11 -7
  12. package/admin/src/components/Item/ItemCardHeader/Wrapper.d.ts +3 -0
  13. package/admin/src/components/Item/ItemCardHeader/Wrapper.js +10 -6
  14. package/admin/src/components/Item/ItemCardHeader/index.d.ts +12 -0
  15. package/admin/src/components/Item/ItemCardHeader/index.js +33 -52
  16. package/admin/src/components/Item/ItemCardRemovedOverlay/index.d.ts +2 -0
  17. package/admin/src/components/Item/ItemCardRemovedOverlay/index.js +10 -4
  18. package/admin/src/components/Item/Wrapper.d.ts +3 -0
  19. package/admin/src/components/Item/Wrapper.js +10 -6
  20. package/admin/src/components/Item/index.d.ts +31 -0
  21. package/admin/src/components/Item/index.js +163 -242
  22. package/admin/src/components/NavigationItemList/Wrapper.d.ts +3 -0
  23. package/admin/src/components/NavigationItemList/Wrapper.js +9 -5
  24. package/admin/src/components/NavigationItemList/index.d.ts +35 -0
  25. package/admin/src/components/NavigationItemList/index.js +28 -66
  26. package/admin/src/components/RestartAlert/index.d.ts +3 -0
  27. package/admin/src/components/RestartAlert/index.js +10 -5
  28. package/admin/src/components/Search/index.d.ts +6 -0
  29. package/admin/src/components/Search/index.js +57 -46
  30. package/admin/src/components/icons/navigation.d.ts +6 -0
  31. package/admin/src/components/icons/navigation.js +11 -13
  32. package/admin/src/contexts/DataManagerContext.d.ts +3 -0
  33. package/admin/src/contexts/DataManagerContext.js +6 -5
  34. package/admin/src/hooks/useAllContentTypes.d.ts +6 -0
  35. package/admin/src/hooks/useAllContentTypes.js +10 -11
  36. package/admin/src/hooks/useDataManager.d.ts +3 -0
  37. package/admin/src/hooks/useDataManager.js +10 -6
  38. package/admin/src/hooks/useI18nCopyNavigationItemsModal.d.ts +9 -0
  39. package/admin/src/hooks/useI18nCopyNavigationItemsModal.js +51 -0
  40. package/admin/src/hooks/useNavigationConfig.d.ts +10 -0
  41. package/admin/src/hooks/useNavigationConfig.js +52 -56
  42. package/admin/src/hooks/useNavigationManager.d.ts +7 -0
  43. package/admin/src/hooks/useNavigationManager.js +41 -0
  44. package/admin/src/index.d.ts +14 -0
  45. package/admin/src/index.js +92 -76
  46. package/admin/src/pages/App/index.d.ts +3 -0
  47. package/admin/src/pages/App/index.js +43 -31
  48. package/admin/src/pages/DataManagerProvider/actions.d.ts +19 -0
  49. package/admin/src/pages/DataManagerProvider/actions.js +22 -26
  50. package/admin/src/pages/DataManagerProvider/index.d.ts +12 -0
  51. package/admin/src/pages/DataManagerProvider/index.js +316 -298
  52. package/admin/src/pages/DataManagerProvider/init.d.ts +3 -0
  53. package/admin/src/pages/DataManagerProvider/init.js +5 -3
  54. package/admin/src/pages/DataManagerProvider/reducer.d.ts +19 -0
  55. package/admin/src/pages/DataManagerProvider/reducer.js +119 -121
  56. package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.d.ts +24 -0
  57. package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.js +88 -0
  58. package/admin/src/pages/SettingsPage/index.d.ts +3 -0
  59. package/admin/src/pages/SettingsPage/index.js +242 -335
  60. package/admin/src/pages/SettingsPage/utils/functions.d.ts +5 -0
  61. package/admin/src/pages/SettingsPage/utils/functions.js +3 -8
  62. package/admin/src/pages/View/components/I18nCopyNavigationItems/index.d.ts +14 -0
  63. package/admin/src/pages/View/components/I18nCopyNavigationItems/index.js +15 -0
  64. package/admin/src/pages/View/components/NavigationContentHeader/index.d.ts +6 -0
  65. package/admin/src/pages/View/components/NavigationContentHeader/index.js +13 -17
  66. package/admin/src/pages/View/components/NavigationHeader/index.d.ts +12 -0
  67. package/admin/src/pages/View/components/NavigationHeader/index.js +79 -65
  68. package/admin/src/pages/View/components/NavigationHeader/styles.d.ts +2 -0
  69. package/admin/src/pages/View/components/NavigationHeader/styles.js +10 -5
  70. package/admin/src/pages/View/components/NavigationItemForm/index.d.ts +57 -0
  71. package/admin/src/pages/View/components/NavigationItemForm/index.js +416 -453
  72. package/admin/src/pages/View/components/NavigationItemForm/utils/form.d.ts +45 -0
  73. package/admin/src/pages/View/components/NavigationItemForm/utils/form.js +84 -52
  74. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +23 -0
  75. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js +24 -34
  76. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.d.ts +4 -0
  77. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js +16 -16
  78. package/admin/src/pages/View/components/NavigationItemPopup/index.d.ts +30 -0
  79. package/admin/src/pages/View/components/NavigationItemPopup/index.js +85 -108
  80. package/admin/src/pages/View/components/NavigationManager/Create/index.d.ts +9 -0
  81. package/admin/src/pages/View/components/NavigationManager/Create/index.js +57 -0
  82. package/admin/src/pages/View/components/NavigationManager/Delete/index.d.ts +8 -0
  83. package/admin/src/pages/View/components/NavigationManager/Delete/index.js +28 -0
  84. package/admin/src/pages/View/components/NavigationManager/Edit/index.d.ts +8 -0
  85. package/admin/src/pages/View/components/NavigationManager/Edit/index.js +54 -0
  86. package/admin/src/pages/View/components/NavigationManager/Error/index.d.ts +8 -0
  87. package/admin/src/pages/View/components/NavigationManager/Error/index.js +53 -0
  88. package/admin/src/pages/View/components/NavigationManager/Form/index.d.ts +19 -0
  89. package/admin/src/pages/View/components/NavigationManager/Form/index.js +98 -0
  90. package/admin/src/pages/View/components/NavigationManager/List/index.d.ts +8 -0
  91. package/admin/src/pages/View/components/NavigationManager/List/index.js +138 -0
  92. package/admin/src/pages/View/components/NavigationManager/index.d.ts +10 -0
  93. package/admin/src/pages/View/components/NavigationManager/index.js +189 -0
  94. package/admin/src/pages/View/components/NavigationManager/types.d.ts +53 -0
  95. package/admin/src/pages/View/components/NavigationManager/types.js +3 -0
  96. package/admin/src/pages/View/index.d.ts +4 -0
  97. package/admin/src/pages/View/index.js +231 -304
  98. package/admin/src/pages/View/utils/enums.d.ts +9 -0
  99. package/admin/src/pages/View/utils/enums.js +11 -8
  100. package/admin/src/pages/View/utils/form.d.ts +2 -0
  101. package/admin/src/pages/View/utils/form.js +15 -12
  102. package/admin/src/pages/View/utils/index.d.ts +2 -0
  103. package/admin/src/pages/View/utils/index.js +11 -3
  104. package/admin/src/pages/View/utils/parsers.d.ts +49 -0
  105. package/admin/src/pages/View/utils/parsers.js +239 -278
  106. package/admin/src/permissions.d.ts +12 -0
  107. package/admin/src/permissions.js +11 -7
  108. package/admin/src/pluginId.d.ts +3 -0
  109. package/admin/src/pluginId.js +2 -2
  110. package/admin/src/translations/en.json +157 -104
  111. package/admin/src/translations/fr.json +44 -44
  112. package/admin/src/translations/index.d.ts +12 -0
  113. package/admin/src/translations/index.js +17 -11
  114. package/admin/src/utils/api.d.ts +8 -0
  115. package/admin/src/utils/api.js +54 -50
  116. package/admin/src/utils/getTrad.d.ts +3 -0
  117. package/admin/src/utils/getTrad.js +9 -5
  118. package/admin/src/utils/index.d.ts +18 -0
  119. package/admin/src/utils/index.js +36 -15
  120. package/package.json +20 -19
  121. package/permissions.d.ts +9 -0
  122. package/permissions.js +5 -4
  123. package/server/bootstrap/index.d.ts +4 -0
  124. package/server/bootstrap/index.js +41 -0
  125. package/server/config/index.d.ts +5 -0
  126. package/server/config/index.js +33 -9
  127. package/server/config/setupStrategy.d.ts +3 -0
  128. package/server/config/setupStrategy.js +38 -0
  129. package/server/content-types/audience/index.d.ts +27 -0
  130. package/server/content-types/audience/index.js +9 -8
  131. package/server/content-types/audience/schema.d.ts +25 -0
  132. package/server/content-types/audience/schema.js +26 -0
  133. package/server/content-types/index.d.ts +255 -0
  134. package/server/content-types/index.js +15 -12
  135. package/server/content-types/navigation/index.d.ts +64 -0
  136. package/server/content-types/navigation/index.js +11 -8
  137. package/server/content-types/navigation/lifecycle.d.ts +9 -0
  138. package/server/content-types/navigation/lifecycle.js +8 -12
  139. package/server/content-types/navigation/schema.d.ts +55 -0
  140. package/server/content-types/navigation/schema.js +56 -0
  141. package/server/content-types/navigation-item/index.d.ts +112 -0
  142. package/server/content-types/navigation-item/index.js +11 -8
  143. package/server/content-types/navigation-item/lifecycle.d.ts +16 -0
  144. package/server/content-types/navigation-item/lifecycle.js +28 -32
  145. package/server/content-types/navigation-item/schema.d.ts +97 -0
  146. package/server/content-types/navigation-item/schema.js +102 -0
  147. package/server/content-types/navigations-items-related/index.d.ts +56 -0
  148. package/server/content-types/navigations-items-related/index.js +11 -8
  149. package/server/content-types/navigations-items-related/lifecycle.d.ts +8 -0
  150. package/server/content-types/navigations-items-related/lifecycle.js +20 -17
  151. package/server/content-types/navigations-items-related/schema.d.ts +49 -0
  152. package/server/content-types/navigations-items-related/schema.js +50 -0
  153. package/server/controllers/admin.d.ts +4 -0
  154. package/server/controllers/admin.js +130 -0
  155. package/server/controllers/client.d.ts +4 -0
  156. package/server/controllers/client.js +57 -0
  157. package/server/controllers/index.d.ts +4 -0
  158. package/server/controllers/index.js +12 -6
  159. package/server/destroy.d.ts +3 -0
  160. package/server/destroy.js +5 -0
  161. package/server/graphql/config.d.ts +4 -0
  162. package/server/graphql/config.js +28 -0
  163. package/server/graphql/index.d.ts +2 -0
  164. package/server/graphql/index.js +18 -22
  165. package/server/graphql/queries/index.d.ts +3 -0
  166. package/server/graphql/queries/index.js +15 -15
  167. package/server/graphql/queries/render-navigation-child.d.ts +15 -0
  168. package/server/graphql/queries/render-navigation-child.js +24 -15
  169. package/server/graphql/queries/render-navigation.d.ts +21 -0
  170. package/server/graphql/queries/render-navigation.js +31 -15
  171. package/server/graphql/resolvers-config.d.ts +10 -0
  172. package/server/graphql/resolvers-config.js +5 -3
  173. package/server/graphql/setupStrategy.d.ts +3 -0
  174. package/server/graphql/setupStrategy.js +15 -0
  175. package/server/graphql/types/content-types-name-fields.d.ts +6 -0
  176. package/server/graphql/types/content-types-name-fields.js +13 -9
  177. package/server/graphql/types/content-types.d.ts +5 -0
  178. package/server/graphql/types/content-types.js +17 -15
  179. package/server/graphql/types/create-navigation-item.d.ts +5 -0
  180. package/server/graphql/types/create-navigation-item.js +18 -16
  181. package/server/graphql/types/create-navigation-related.d.ts +5 -0
  182. package/server/graphql/types/create-navigation-related.js +9 -7
  183. package/server/graphql/types/create-navigation.d.ts +5 -0
  184. package/server/graphql/types/create-navigation.js +8 -6
  185. package/server/graphql/types/index.d.ts +3 -0
  186. package/server/graphql/types/index.js +15 -13
  187. package/server/graphql/types/navigation-config.d.ts +5 -0
  188. package/server/graphql/types/navigation-config.js +10 -8
  189. package/server/graphql/types/navigation-details.d.ts +5 -0
  190. package/server/graphql/types/navigation-details.js +11 -9
  191. package/server/graphql/types/navigation-item-related-data.d.ts +5 -0
  192. package/server/graphql/types/navigation-item-related-data.js +9 -0
  193. package/server/graphql/types/navigation-item-related.d.ts +7 -0
  194. package/server/graphql/types/navigation-item-related.js +25 -0
  195. package/server/graphql/types/navigation-item.d.ts +5 -0
  196. package/server/graphql/types/navigation-item.js +28 -29
  197. package/server/graphql/types/navigation-render-type.d.ts +5 -0
  198. package/server/graphql/types/navigation-render-type.js +7 -4
  199. package/server/graphql/types/navigation.d.ts +5 -0
  200. package/server/graphql/types/navigation.js +10 -8
  201. package/server/i18n/constant.d.ts +2 -0
  202. package/server/i18n/constant.js +5 -0
  203. package/server/i18n/errors.d.ts +7 -0
  204. package/server/i18n/errors.js +14 -0
  205. package/server/i18n/graphQLEnhancers.d.ts +10 -0
  206. package/server/i18n/graphQLEnhancers.js +10 -0
  207. package/server/i18n/index.d.ts +8 -0
  208. package/server/i18n/index.js +23 -0
  209. package/server/i18n/navigationSetupStrategy.d.ts +3 -0
  210. package/server/i18n/navigationSetupStrategy.js +119 -0
  211. package/server/i18n/serviceEnhancers.d.ts +13 -0
  212. package/server/i18n/serviceEnhancers.js +156 -0
  213. package/server/i18n/types.d.ts +60 -0
  214. package/server/i18n/types.js +3 -0
  215. package/server/i18n/utils.d.ts +12 -0
  216. package/server/i18n/utils.js +29 -0
  217. package/server/index.d.ts +273 -0
  218. package/server/index.js +26 -0
  219. package/server/navigation/index.d.ts +2 -0
  220. package/server/navigation/index.js +18 -0
  221. package/server/navigation/setupStrategy.d.ts +3 -0
  222. package/server/navigation/setupStrategy.js +39 -0
  223. package/server/register/index.d.ts +3 -0
  224. package/server/register/index.js +4 -0
  225. package/server/routes/admin.d.ts +4 -0
  226. package/server/routes/admin.js +82 -61
  227. package/server/routes/client.d.ts +4 -0
  228. package/server/routes/client.js +25 -21
  229. package/server/routes/index.d.ts +6 -0
  230. package/server/routes/index.js +13 -4
  231. package/server/services/admin.d.ts +5 -0
  232. package/server/services/admin.js +238 -0
  233. package/server/services/client.d.ts +5 -0
  234. package/server/services/client.js +249 -0
  235. package/server/services/common.d.ts +5 -0
  236. package/server/services/common.js +313 -0
  237. package/server/services/index.d.ts +7 -0
  238. package/server/services/index.js +14 -6
  239. package/server/utils/constant.d.ts +27 -0
  240. package/server/utils/constant.js +24 -0
  241. package/server/utils/functions.d.ts +139 -0
  242. package/server/utils/functions.js +226 -0
  243. package/server/utils/index.d.ts +3 -0
  244. package/server/utils/index.js +19 -0
  245. package/strapi-admin.d.ts +3 -0
  246. package/strapi-admin.js +8 -1
  247. package/strapi-server.d.ts +273 -0
  248. package/strapi-server.js +6 -17
  249. package/tsconfig.tsbuildinfo +1 -0
  250. package/types/bootstrap.d.ts +13 -0
  251. package/types/bootstrap.js +3 -0
  252. package/types/config.d.ts +21 -0
  253. package/types/config.js +3 -0
  254. package/types/contentTypes.d.ts +85 -0
  255. package/types/contentTypes.js +3 -0
  256. package/types/controllers.d.ts +48 -0
  257. package/types/controllers.js +5 -0
  258. package/types/graphQL.d.ts +3 -0
  259. package/types/graphQL.js +3 -0
  260. package/types/i18n.d.ts +9 -0
  261. package/types/i18n.js +3 -0
  262. package/types/index.d.ts +9 -0
  263. package/types/index.js +25 -0
  264. package/types/services.d.ts +74 -0
  265. package/types/services.js +3 -0
  266. package/types/utils.d.ts +62 -0
  267. package/types/utils.js +27 -0
  268. package/utils/InvalidParamNavigationError.d.ts +4 -0
  269. package/utils/InvalidParamNavigationError.js +8 -0
  270. package/utils/NavigationError.d.ts +5 -0
  271. package/utils/NavigationError.js +7 -7
  272. package/__mocks__/pages.settings.json +0 -25
  273. package/__mocks__/strapi.js +0 -207
  274. package/jest.config.js +0 -14
  275. package/server/bootstrap.js +0 -52
  276. package/server/config.js +0 -9
  277. package/server/content-types/audience/lifecycle.js +0 -8
  278. package/server/content-types/audience/schema.json +0 -23
  279. package/server/content-types/navigation/schema.json +0 -45
  280. package/server/content-types/navigation-item/schema.json +0 -99
  281. package/server/content-types/navigations-items-related/schema.json +0 -47
  282. package/server/controllers/navigation.js +0 -105
  283. package/server/graphql/types/navigation-related.js +0 -25
  284. package/server/services/__tests__/functions.test.js +0 -48
  285. package/server/services/__tests__/navigation.test.js +0 -91
  286. package/server/services/navigation.js +0 -791
  287. package/server/services/utils/constant.js +0 -21
  288. package/server/services/utils/functions.js +0 -226
@@ -1,77 +1,93 @@
1
- import { prefixPluginTranslations } from '@strapi/helper-plugin';
2
- import pluginPkg from '../../package.json';
3
- import pluginId from './pluginId';
4
- import pluginPermissions from './permissions';
5
- import NavigationIcon from './components/icons/navigation';
6
- import { getTrad } from './translations';
7
- const name = pluginPkg.strapi.name;
8
-
9
- export default {
10
- register(app) {
11
- app.createSettingSection(
12
- {
13
- id: pluginId,
14
- intlLabel: { id: getTrad('pages.settings.section.title'), defaultMessage: 'Navigation Plugin' },
15
- },
16
- [
17
- {
18
- intlLabel: {
19
- id: getTrad('pages.settings.section.subtitle'),
20
- defaultMessage: 'Configuration',
21
- },
22
- id: 'navigation',
23
- to: `/settings/${pluginId}`,
24
- Component: async () => {
25
- const component = await import(
26
- /* webpackChunkName: "navigation-settings" */ './pages/SettingsPage'
27
- );
28
-
29
- return component;
30
- },
31
- permissions: pluginPermissions.access,
32
- }
33
- ]);
34
- app.addMenuLink({
35
- to: `/plugins/${pluginId}`,
36
- icon: NavigationIcon,
37
- intlLabel: {
38
- id: `${pluginId}.plugin.name`,
39
- defaultMessage: 'Navigation',
40
- },
41
- Component: async () => {
42
- const component = await import(/* webpackChunkName: "my-plugin" */ './pages/App');
43
-
44
- return component;
45
- },
46
- permissions: pluginPermissions.access,
47
- });
48
- app.registerPlugin({
49
- id: pluginId,
50
- name,
51
- });
52
- },
53
- bootstrap() {},
54
- async registerTrads({ locales }) {
55
- const importedTrads = await Promise.all(
56
- locales.map(locale => {
57
- return import(
58
- /* webpackChunkName: "[pluginId]-[request]" */ `./translations/${locale}.json`
59
- )
60
- .then(({ default: data }) => {
61
- return {
62
- data: prefixPluginTranslations(data, pluginId),
63
- locale,
64
- };
65
- })
66
- .catch(() => {
67
- return {
68
- data: {},
69
- locale,
70
- };
71
- });
72
- })
73
- );
74
-
75
- return Promise.resolve(importedTrads);
76
- },
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;
77
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 helper_plugin_1 = require("@strapi/helper-plugin");
30
+ const package_json_1 = __importDefault(require("../../package.json"));
31
+ const pluginId_1 = __importDefault(require("./pluginId"));
32
+ const permissions_1 = __importDefault(require("./permissions"));
33
+ const navigation_1 = __importDefault(require("./components/icons/navigation"));
34
+ const translations_1 = require("./translations");
35
+ const name = package_json_1.default.strapi.name;
36
+ exports.default = {
37
+ register(app) {
38
+ app.createSettingSection({
39
+ id: pluginId_1.default,
40
+ intlLabel: { id: (0, translations_1.getTrad)('pages.settings.section.title'), defaultMessage: 'Navigation Plugin' },
41
+ }, [
42
+ {
43
+ intlLabel: {
44
+ id: (0, translations_1.getTrad)('pages.settings.section.subtitle'),
45
+ defaultMessage: 'Configuration',
46
+ },
47
+ id: 'navigation',
48
+ to: `/settings/${pluginId_1.default}`,
49
+ Component: async () => {
50
+ const component = await Promise.resolve().then(() => __importStar(require('./pages/SettingsPage')));
51
+ return component;
52
+ },
53
+ permissions: permissions_1.default.access,
54
+ }
55
+ ]);
56
+ app.addMenuLink({
57
+ to: `/plugins/${pluginId_1.default}`,
58
+ icon: navigation_1.default,
59
+ intlLabel: {
60
+ id: `${pluginId_1.default}.plugin.name`,
61
+ defaultMessage: 'Navigation',
62
+ },
63
+ Component: async () => {
64
+ const component = await Promise.resolve().then(() => __importStar(require('./pages/App')));
65
+ return component;
66
+ },
67
+ permissions: permissions_1.default.access,
68
+ });
69
+ app.registerPlugin({
70
+ id: pluginId_1.default,
71
+ name,
72
+ });
73
+ },
74
+ bootstrap() { },
75
+ async registerTrads({ locales }) {
76
+ const importedTrads = await Promise.all(locales.map(locale => {
77
+ return Promise.resolve().then(() => __importStar(require(`./translations/${locale}.json`))).then(({ default: data }) => {
78
+ return {
79
+ data: (0, helper_plugin_1.prefixPluginTranslations)(data, pluginId_1.default),
80
+ locale,
81
+ };
82
+ })
83
+ .catch(() => {
84
+ return {
85
+ data: {},
86
+ locale,
87
+ };
88
+ });
89
+ }));
90
+ return Promise.resolve(importedTrads);
91
+ },
92
+ };
93
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ export default App;
2
+ declare function App(): JSX.Element;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1,31 +1,43 @@
1
- /**
2
- *
3
- * This component is the skeleton around the actual pages, and should only
4
- * contain code that should be seen on all pages. (e.g. navigation bar)
5
- *
6
- */
7
-
8
- import React, { Suspense, lazy } from "react";
9
- import { Switch, Route } from "react-router-dom";
10
- import { NotFound, LoadingIndicatorPage } from "@strapi/helper-plugin";
11
- // Utils
12
- import DataManagerProvider from "../DataManagerProvider";
13
- import pluginId from "../../pluginId";
14
- // Containers
15
- const View = lazy(() => import("../View"));
16
-
17
- const App = () => {
18
- return (
19
- <DataManagerProvider>
20
- <Suspense fallback={<LoadingIndicatorPage />}>
21
- <Switch>
22
- <Route path={`/plugins/${pluginId}`} component={View} exact />
23
- <Route component={NotFound} />
24
- </Switch>
25
- </Suspense>
26
- </DataManagerProvider>
27
- );
28
- };
29
-
30
- export default App;
31
-
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 react_router_dom_1 = require("react-router-dom");
31
+ const helper_plugin_1 = require("@strapi/helper-plugin");
32
+ const DataManagerProvider_1 = __importDefault(require("../DataManagerProvider"));
33
+ const pluginId_1 = __importDefault(require("../../pluginId"));
34
+ const View = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require("../View"))));
35
+ const App = () => {
36
+ return (react_1.default.createElement(DataManagerProvider_1.default, null,
37
+ react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement(helper_plugin_1.LoadingIndicatorPage, null) },
38
+ react_1.default.createElement(react_router_dom_1.Switch, null,
39
+ react_1.default.createElement(react_router_dom_1.Route, { path: `/plugins/${pluginId_1.default}`, component: View, exact: true }),
40
+ react_1.default.createElement(react_router_dom_1.Route, { component: helper_plugin_1.NotFound })))));
41
+ };
42
+ exports.default = App;
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,19 @@
1
+ export const GET_LIST_DATA: "GET_LIST_DATA";
2
+ export const GET_LIST_DATA_SUCCEEDED: "GET_LIST_DATA_SUCCEEDED";
3
+ export const GET_NAVIGATION_DATA: "GET_NAVIGATION_DATA";
4
+ export const GET_NAVIGATION_DATA_SUCCEEDED: "GET_NAVIGATION_DATA_SUCCEEDED";
5
+ export const CHANGE_NAVIGATION_DATA: "CHANGE_NAVIGATION_DATA";
6
+ export const RESET_NAVIGATION_DATA: "RESET_NAVIGATION_DATA";
7
+ export const CHANGE_NAVIGATION_POPUP_VISIBILITY: "CHANGE_NAVIGATION_POPUP_VISIBILITY";
8
+ export const CHANGE_NAVIGATION_ITEM_POPUP_VISIBILITY: "CHANGE_NAVIGATION_ITEM_POPUP_VISIBILITY";
9
+ export const GET_CONTENT_TYPE_ITEMS: "GET_CONTENT_TYPE_ITEMS";
10
+ export const GET_CONTENT_TYPE_ITEMS_SUCCEEDED: "GET_CONTENT_TYPE_ITEMS_SUCCEEDED";
11
+ export const GET_CONFIG: "GET_CONFIG";
12
+ export const GET_CONFIG_SUCCEEDED: "GET_CONFIG_SUCCEEDED";
13
+ export const SUBMIT_NAVIGATION: "SUBMIT_NAVIGATION";
14
+ export const SUBMIT_NAVIGATION_SUCCEEDED: "SUBMIT_NAVIGATION_SUCCEEDED";
15
+ export const SUBMIT_NAVIGATION_ERROR: "SUBMIT_NAVIGATION_ERROR";
16
+ export const RELOAD_PLUGIN: "RELOAD_PLUGIN";
17
+ export const I18N_COPY_NAVIGATION: "I18N_COPY_NAVIGATION";
18
+ export const I18N_COPY_NAVIGATION_SUCCESS: "I18N_COPY_NAVIGATION_SUCCESS";
19
+ //# sourceMappingURL=actions.d.ts.map
@@ -1,26 +1,22 @@
1
- export const GET_LIST_DATA = "GET_LIST_DATA";
2
- export const GET_LIST_DATA_SUCCEEDED = "GET_LIST_DATA_SUCCEEDED";
3
- export const GET_NAVIGATION_DATA = "GET_NAVIGATION_DATA";
4
- export const GET_NAVIGATION_DATA_SUCCEEDED = "GET_NAVIGATION_DATA_SUCCEEDED";
5
-
6
- export const CHANGE_NAVIGATION_DATA = "CHANGE_NAVIGATION_DATA";
7
- export const RESET_NAVIGATION_DATA = "RESET_NAVIGATION_DATA";
8
-
9
- export const CHANGE_NAVIGATION_POPUP_VISIBILITY =
10
- "CHANGE_NAVIGATION_POPUP_VISIBILITY";
11
- export const CHANGE_NAVIGATION_ITEM_POPUP_VISIBILITY =
12
- "CHANGE_NAVIGATION_ITEM_POPUP_VISIBILITY";
13
-
14
- export const GET_CONTENT_TYPE_ITEMS = "GET_CONTENT_TYPE_ITEMS";
15
- export const GET_CONTENT_TYPE_ITEMS_SUCCEEDED =
16
- "GET_CONTENT_TYPE_ITEMS_SUCCEEDED";
17
-
18
- export const GET_CONFIG = "GET_CONFIG";
19
- export const GET_CONFIG_SUCCEEDED = "GET_CONFIG_SUCCEEDED";
20
-
21
- export const SUBMIT_NAVIGATION = "SUBMIT_NAVIGATION";
22
- export const SUBMIT_NAVIGATION_SUCCEEDED = "SUBMIT_NAVIGATION_SUCCEEDED";
23
- export const SUBMIT_NAVIGATION_ERROR = "SUBMIT_NAVIGATION_ERROR";
24
-
25
-
26
- export const RELOAD_PLUGIN = "RELOAD_PLUGIN";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.I18N_COPY_NAVIGATION_SUCCESS = exports.I18N_COPY_NAVIGATION = exports.RELOAD_PLUGIN = exports.SUBMIT_NAVIGATION_ERROR = exports.SUBMIT_NAVIGATION_SUCCEEDED = exports.SUBMIT_NAVIGATION = exports.GET_CONFIG_SUCCEEDED = exports.GET_CONFIG = exports.GET_CONTENT_TYPE_ITEMS_SUCCEEDED = exports.GET_CONTENT_TYPE_ITEMS = exports.CHANGE_NAVIGATION_ITEM_POPUP_VISIBILITY = exports.CHANGE_NAVIGATION_POPUP_VISIBILITY = exports.RESET_NAVIGATION_DATA = exports.CHANGE_NAVIGATION_DATA = exports.GET_NAVIGATION_DATA_SUCCEEDED = exports.GET_NAVIGATION_DATA = exports.GET_LIST_DATA_SUCCEEDED = exports.GET_LIST_DATA = void 0;
4
+ exports.GET_LIST_DATA = "GET_LIST_DATA";
5
+ exports.GET_LIST_DATA_SUCCEEDED = "GET_LIST_DATA_SUCCEEDED";
6
+ exports.GET_NAVIGATION_DATA = "GET_NAVIGATION_DATA";
7
+ exports.GET_NAVIGATION_DATA_SUCCEEDED = "GET_NAVIGATION_DATA_SUCCEEDED";
8
+ exports.CHANGE_NAVIGATION_DATA = "CHANGE_NAVIGATION_DATA";
9
+ exports.RESET_NAVIGATION_DATA = "RESET_NAVIGATION_DATA";
10
+ exports.CHANGE_NAVIGATION_POPUP_VISIBILITY = "CHANGE_NAVIGATION_POPUP_VISIBILITY";
11
+ exports.CHANGE_NAVIGATION_ITEM_POPUP_VISIBILITY = "CHANGE_NAVIGATION_ITEM_POPUP_VISIBILITY";
12
+ exports.GET_CONTENT_TYPE_ITEMS = "GET_CONTENT_TYPE_ITEMS";
13
+ exports.GET_CONTENT_TYPE_ITEMS_SUCCEEDED = "GET_CONTENT_TYPE_ITEMS_SUCCEEDED";
14
+ exports.GET_CONFIG = "GET_CONFIG";
15
+ exports.GET_CONFIG_SUCCEEDED = "GET_CONFIG_SUCCEEDED";
16
+ exports.SUBMIT_NAVIGATION = "SUBMIT_NAVIGATION";
17
+ exports.SUBMIT_NAVIGATION_SUCCEEDED = "SUBMIT_NAVIGATION_SUCCEEDED";
18
+ exports.SUBMIT_NAVIGATION_ERROR = "SUBMIT_NAVIGATION_ERROR";
19
+ exports.RELOAD_PLUGIN = "RELOAD_PLUGIN";
20
+ exports.I18N_COPY_NAVIGATION = "I18N_COPY_NAVIGATION";
21
+ exports.I18N_COPY_NAVIGATION_SUCCESS = "I18N_COPY_NAVIGATION_SUCCESS";
22
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1,12 @@
1
+ declare var _default: React.MemoExoticComponent<{
2
+ ({ children }: {
3
+ children: any;
4
+ }): JSX.Element;
5
+ propTypes: {
6
+ children: PropTypes.Validator<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
7
+ };
8
+ }>;
9
+ export default _default;
10
+ import PropTypes from "prop-types";
11
+ import React from "react";
12
+ //# sourceMappingURL=index.d.ts.map