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,22 +1,43 @@
1
- import { useIntl } from 'react-intl';
2
- import { isString } from 'lodash';
3
-
4
- import pluginId from '../pluginId';
5
-
6
- export const getMessage = (input, defaultMessage = '', inPluginScope = true) => {
7
- const { formatMessage } = useIntl();
8
- let formattedId = ''
9
- if (isString(input)) {
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.errorStatusResourceFor = exports.resolvedResourceFor = exports.ResourceState = exports.ItemTypes = exports.getMessage = void 0;
7
+ const react_intl_1 = require("react-intl");
8
+ const lodash_1 = require("lodash");
9
+ const pluginId_1 = __importDefault(require("../pluginId"));
10
+ const getMessage = (input, defaultMessage = '', inPluginScope = true) => {
11
+ const { formatMessage } = (0, react_intl_1.useIntl)();
12
+ let formattedId = '';
13
+ if ((0, lodash_1.isString)(input)) {
10
14
  formattedId = input;
11
- } else {
15
+ }
16
+ else {
12
17
  formattedId = input?.id;
13
18
  }
14
19
  return formatMessage({
15
- id: `${inPluginScope ? pluginId : 'app.components'}.${formattedId}`,
20
+ id: `${inPluginScope ? pluginId_1.default : 'app.components'}.${formattedId}`,
16
21
  defaultMessage,
17
- }, input?.props || undefined)
22
+ }, input?.props || undefined);
18
23
  };
19
-
20
- export const ItemTypes = {
24
+ exports.getMessage = getMessage;
25
+ exports.ItemTypes = {
21
26
  NAVIGATION_ITEM: 'navigationItem'
22
- }
27
+ };
28
+ exports.ResourceState = {
29
+ RESOLVED: 'RESOLVED',
30
+ LOADING: 'LOADING',
31
+ ERROR: 'ERROR',
32
+ };
33
+ const resolvedResourceFor = (value) => ({
34
+ type: exports.ResourceState.RESOLVED,
35
+ value,
36
+ });
37
+ exports.resolvedResourceFor = resolvedResourceFor;
38
+ const errorStatusResourceFor = (errors) => ({
39
+ type: exports.ResourceState.ERROR,
40
+ errors,
41
+ });
42
+ exports.errorStatusResourceFor = errorStatusResourceFor;
43
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-navigation",
3
- "version": "2.0.13",
3
+ "version": "2.1.0",
4
4
  "description": "Strapi - Navigation plugin",
5
5
  "strapi": {
6
6
  "name": "navigation",
@@ -12,14 +12,12 @@
12
12
  "type": "git",
13
13
  "url": "https://github.com/VirtusLab/strapi-plugin-navigation"
14
14
  },
15
- "scripts": {
16
- "publish:latest": "npm publish --tag latest",
17
- "test:unit": "jest --verbose --coverage"
18
- },
15
+ "scripts": {},
19
16
  "dependencies": {
20
- "@strapi/utils": "^4.1.8",
17
+ "@strapi/utils": "^4.2.0",
21
18
  "uuid": "^8.3.0",
22
19
  "lodash": "^4.17.11",
20
+ "pluralize": "^8.0.0",
23
21
  "react": "^16.9.0",
24
22
  "react-dom": "^16.9.0",
25
23
  "react-intl": "4.5.0",
@@ -29,16 +27,9 @@
29
27
  "reactstrap": "8.4.1",
30
28
  "redux-saga": "^0.16.0",
31
29
  "request": "^2.83.0",
32
- "slugify": "^1.4.5",
33
- "pluralize": "^8.0.0"
34
- },
35
- "devDependencies": {
36
- "koa": "^2.8.0",
37
- "jest": "^26.0.1",
38
- "jest-cli": "^26.0.1",
39
- "jest-styled-components": "^7.0.2",
40
- "codecov": "^3.7.2"
30
+ "slugify": "^1.4.5"
41
31
  },
32
+ "devDependencies": {},
42
33
  "peerDependencies": {
43
34
  "@strapi/strapi": "4.x"
44
35
  },
@@ -65,9 +56,19 @@
65
56
  }
66
57
  ],
67
58
  "engines": {
68
- "node": ">=10.16.0",
69
- "npm": ">=6.0.0"
59
+ "node": ">=14.19.1 <=17.x.x",
60
+ "npm": ">=7.x.x"
70
61
  },
71
- "keywords": ["strapi", "plugin", "navigation"],
62
+ "nodemonConfig": {
63
+ "ignore": [
64
+ "./build/**/*"
65
+ ],
66
+ "ext": "js,json,ts"
67
+ },
68
+ "keywords": [
69
+ "strapi",
70
+ "plugin",
71
+ "navigation"
72
+ ],
72
73
  "license": "MIT"
73
- }
74
+ }
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ render: (uid: string) => string;
3
+ navigation: {
4
+ read: string;
5
+ update: string;
6
+ };
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=permissions.d.ts.map
package/permissions.js CHANGED
@@ -1,11 +1,12 @@
1
1
  'use strict';
2
-
3
- module.exports = {
4
- render: function(uid) {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ render: function (uid) {
5
5
  return `plugin::navigation.${uid}`;
6
6
  },
7
7
  navigation: {
8
8
  read: 'read',
9
9
  update: 'update',
10
10
  },
11
- };
11
+ };
12
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1,4 @@
1
+ import { StrapiContext } from "strapi-typed";
2
+ declare const _default: ({ strapi }: StrapiContext) => Promise<void>;
3
+ export = _default;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const permissions_1 = __importDefault(require("../../permissions"));
6
+ const graphql_1 = require("../graphql");
7
+ const navigation_1 = require("../navigation");
8
+ const config_1 = require("../config");
9
+ const assertUserPermissionsAvailability = ({ strapi }) => {
10
+ if (!strapi.plugin("users-permissions")) {
11
+ throw new Error("In order to make the navigation plugin work the users-permissions plugin is required");
12
+ }
13
+ };
14
+ const setupGraphQL = graphql_1.graphQLSetupStrategy;
15
+ const setupNavigation = navigation_1.navigationSetupStrategy;
16
+ const setupConfig = config_1.configSetupStrategy;
17
+ const setupPermissions = async ({ strapi }) => {
18
+ const actions = [
19
+ {
20
+ section: "plugins",
21
+ displayName: "Read",
22
+ uid: permissions_1.default.navigation.read,
23
+ pluginName: "navigation",
24
+ },
25
+ {
26
+ section: "plugins",
27
+ displayName: "Update",
28
+ uid: permissions_1.default.navigation.update,
29
+ pluginName: "navigation",
30
+ },
31
+ ];
32
+ await strapi.admin.services.permission.actionProvider.registerMany(actions);
33
+ };
34
+ module.exports = async ({ strapi }) => {
35
+ assertUserPermissionsAvailability({ strapi });
36
+ await setupPermissions({ strapi });
37
+ await setupConfig({ strapi });
38
+ await setupGraphQL({ strapi });
39
+ await setupNavigation({ strapi });
40
+ };
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,5 @@
1
+ import { NavigationPluginConfig, StrapiConfig } from "../../types";
2
+ export * from "./setupStrategy";
3
+ declare const config: StrapiConfig<NavigationPluginConfig>;
4
+ export default config;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,33 @@
1
- module.exports = {
2
- default: {
3
- additionalFields: [],
4
- contentTypes: [],
5
- contentTypesNameFields: {},
6
- contentTypesPopulate: {},
7
- allowedLevels: 2
8
- }
9
- }
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./setupStrategy"), exports);
18
+ const config = {
19
+ default: {
20
+ additionalFields: [],
21
+ contentTypes: [],
22
+ contentTypesNameFields: {},
23
+ contentTypesPopulate: {},
24
+ allowedLevels: 2,
25
+ i18nEnabled: false,
26
+ pruneObsoleteI18nNavigations: false,
27
+ gql: {
28
+ navigationItemRelated: []
29
+ },
30
+ },
31
+ };
32
+ exports.default = config;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ import { IConfigSetupStrategy } from "../../types";
2
+ export declare const configSetupStrategy: IConfigSetupStrategy;
3
+ //# sourceMappingURL=setupStrategy.d.ts.map
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configSetupStrategy = void 0;
4
+ const types_1 = require("../../types");
5
+ const configSetupStrategy = async ({ strapi }) => {
6
+ const pluginStore = strapi.store({
7
+ type: "plugin",
8
+ name: "navigation",
9
+ });
10
+ const getFromPluginDefaults = await strapi.plugin("navigation").config;
11
+ const hasI18nPlugin = !!strapi.plugin("i18n");
12
+ let config = await pluginStore.get({
13
+ key: "config",
14
+ });
15
+ const getWithFallback = getWithFallbackFactory(config, getFromPluginDefaults);
16
+ config = {
17
+ additionalFields: getWithFallback("additionalFields"),
18
+ contentTypes: getWithFallback("contentTypes"),
19
+ contentTypesNameFields: getWithFallback("contentTypesNameFields"),
20
+ contentTypesPopulate: getWithFallback("contentTypesPopulate"),
21
+ allowedLevels: getWithFallback("allowedLevels"),
22
+ gql: getWithFallback("gql"),
23
+ i18nEnabled: hasI18nPlugin && getWithFallback("i18nEnabled"),
24
+ pruneObsoleteI18nNavigations: false,
25
+ };
26
+ pluginStore.set({
27
+ key: "config",
28
+ value: config,
29
+ });
30
+ return config;
31
+ };
32
+ exports.configSetupStrategy = configSetupStrategy;
33
+ const getWithFallbackFactory = (config, fallback) => (key) => {
34
+ const value = config?.[key] ?? fallback(key);
35
+ (0, types_1.assertNotEmpty)(value, new Error(`[Navigation] Config "${key}" is undefined`));
36
+ return value;
37
+ };
38
+ //# sourceMappingURL=setupStrategy.js.map
@@ -0,0 +1,27 @@
1
+ declare const _default: {
2
+ schema: {
3
+ collectionName: string;
4
+ info: {
5
+ singularName: string;
6
+ pluralName: string;
7
+ displayName: string;
8
+ name: string;
9
+ };
10
+ options: {
11
+ increments: boolean;
12
+ comment: string;
13
+ };
14
+ attributes: {
15
+ name: {
16
+ type: string;
17
+ required: boolean;
18
+ };
19
+ key: {
20
+ type: string;
21
+ targetField: string;
22
+ };
23
+ };
24
+ };
25
+ };
26
+ export default _default;
27
+ //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,10 @@
1
- "use strict"
2
-
3
- const schema = require("./schema");
4
- const lifecycle = require("./lifecycle");
5
-
6
- module.exports = {
7
- lifecycle,
8
- schema
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
4
  };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const schema_1 = __importDefault(require("./schema"));
7
+ exports.default = {
8
+ schema: schema_1.default
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,25 @@
1
+ declare const _default: {
2
+ collectionName: string;
3
+ info: {
4
+ singularName: string;
5
+ pluralName: string;
6
+ displayName: string;
7
+ name: string;
8
+ };
9
+ options: {
10
+ increments: boolean;
11
+ comment: string;
12
+ };
13
+ attributes: {
14
+ name: {
15
+ type: string;
16
+ required: boolean;
17
+ };
18
+ key: {
19
+ type: string;
20
+ targetField: string;
21
+ };
22
+ };
23
+ };
24
+ export default _default;
25
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ collectionName: "audience",
5
+ info: {
6
+ singularName: "audience",
7
+ pluralName: "audiences",
8
+ displayName: "Audience",
9
+ name: "audience"
10
+ },
11
+ options: {
12
+ increments: true,
13
+ comment: "Audience"
14
+ },
15
+ attributes: {
16
+ name: {
17
+ type: "string",
18
+ required: true
19
+ },
20
+ key: {
21
+ type: "uid",
22
+ targetField: "name"
23
+ }
24
+ }
25
+ };
26
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1,255 @@
1
+ declare const _default: {
2
+ audience: {
3
+ schema: {
4
+ collectionName: string;
5
+ info: {
6
+ singularName: string;
7
+ pluralName: string;
8
+ displayName: string;
9
+ name: string;
10
+ };
11
+ options: {
12
+ increments: boolean;
13
+ comment: string;
14
+ };
15
+ attributes: {
16
+ name: {
17
+ type: string;
18
+ required: boolean;
19
+ };
20
+ key: {
21
+ type: string;
22
+ targetField: string;
23
+ };
24
+ };
25
+ };
26
+ };
27
+ navigation: {
28
+ lifecycle: {
29
+ renderType: {
30
+ FLAT: string;
31
+ TREE: string;
32
+ RFR: string;
33
+ };
34
+ };
35
+ schema: {
36
+ collectionName: string;
37
+ info: {
38
+ singularName: string;
39
+ pluralName: string;
40
+ displayName: string;
41
+ name: string;
42
+ };
43
+ options: {
44
+ increments: boolean;
45
+ comment: string;
46
+ };
47
+ pluginOptions: {
48
+ "content-manager": {
49
+ visible: boolean;
50
+ };
51
+ "content-type-builder": {
52
+ visible: boolean;
53
+ };
54
+ };
55
+ attributes: {
56
+ name: {
57
+ type: string;
58
+ configurable: boolean;
59
+ required: boolean;
60
+ };
61
+ slug: {
62
+ type: string;
63
+ target: string;
64
+ configurable: boolean;
65
+ required: boolean;
66
+ };
67
+ visible: {
68
+ type: string;
69
+ default: boolean;
70
+ configurable: boolean;
71
+ };
72
+ items: {
73
+ type: string;
74
+ relation: string;
75
+ target: string;
76
+ configurable: boolean;
77
+ };
78
+ localizations: {
79
+ type: string;
80
+ relation: string;
81
+ target: string;
82
+ };
83
+ localeCode: {
84
+ type: string;
85
+ };
86
+ };
87
+ };
88
+ };
89
+ "navigation-item": {
90
+ lifecycle: {
91
+ type: {
92
+ INTERNAL: string;
93
+ EXTERNAL: string;
94
+ WRAPPER: string;
95
+ };
96
+ additionalFields: {
97
+ AUDIENCE: string;
98
+ };
99
+ lifecycles: {
100
+ afterFind(results: any): void;
101
+ };
102
+ };
103
+ schema: {
104
+ collectionName: string;
105
+ info: {
106
+ singularName: string;
107
+ pluralName: string;
108
+ displayName: string;
109
+ name: string;
110
+ };
111
+ options: {
112
+ increments: boolean;
113
+ timestamps: boolean;
114
+ comment: string;
115
+ };
116
+ pluginOptions: {
117
+ "content-manager": {
118
+ visible: boolean;
119
+ };
120
+ "content-type-builder": {
121
+ visible: boolean;
122
+ };
123
+ i18n: {
124
+ localized: boolean;
125
+ };
126
+ };
127
+ attributes: {
128
+ title: {
129
+ type: string;
130
+ configurable: boolean;
131
+ required: boolean;
132
+ pluginOptions: {
133
+ i18n: {
134
+ localized: boolean;
135
+ };
136
+ };
137
+ };
138
+ type: {
139
+ type: string;
140
+ enum: string[];
141
+ default: string;
142
+ configurable: boolean;
143
+ };
144
+ path: {
145
+ type: string;
146
+ targetField: string;
147
+ configurable: boolean;
148
+ };
149
+ externalPath: {
150
+ type: string;
151
+ configurable: boolean;
152
+ };
153
+ uiRouterKey: {
154
+ type: string;
155
+ configurable: boolean;
156
+ };
157
+ menuAttached: {
158
+ type: string;
159
+ default: boolean;
160
+ configurable: boolean;
161
+ };
162
+ order: {
163
+ type: string;
164
+ default: number;
165
+ configurable: boolean;
166
+ };
167
+ collapsed: {
168
+ type: string;
169
+ default: boolean;
170
+ configurable: boolean;
171
+ };
172
+ related: {
173
+ type: string;
174
+ relation: string;
175
+ target: string;
176
+ configurable: boolean;
177
+ };
178
+ parent: {
179
+ type: string;
180
+ relation: string;
181
+ target: string;
182
+ configurable: boolean;
183
+ default: null;
184
+ };
185
+ master: {
186
+ type: string;
187
+ relation: string;
188
+ target: string;
189
+ configurable: boolean;
190
+ };
191
+ audience: {
192
+ type: string;
193
+ relation: string;
194
+ target: string;
195
+ };
196
+ };
197
+ };
198
+ };
199
+ "navigations-items-related": {
200
+ lifecycle: {
201
+ lifecycles: {
202
+ afterFind(results: any): void;
203
+ };
204
+ };
205
+ schema: {
206
+ collectionName: string;
207
+ info: {
208
+ singularName: string;
209
+ pluralName: string;
210
+ displayName: string;
211
+ name: string;
212
+ };
213
+ options: {
214
+ increments: boolean;
215
+ timestamps: boolean;
216
+ populateCreatorFields: boolean;
217
+ };
218
+ pluginOptions: {
219
+ "content-manager": {
220
+ visible: boolean;
221
+ };
222
+ "content-type-builder": {
223
+ visible: boolean;
224
+ };
225
+ i18n: {
226
+ localized: boolean;
227
+ };
228
+ };
229
+ attributes: {
230
+ related_id: {
231
+ type: string;
232
+ required: boolean;
233
+ };
234
+ related_type: {
235
+ type: string;
236
+ required: boolean;
237
+ };
238
+ field: {
239
+ type: string;
240
+ required: boolean;
241
+ };
242
+ order: {
243
+ type: string;
244
+ required: boolean;
245
+ };
246
+ master: {
247
+ type: string;
248
+ required: boolean;
249
+ };
250
+ };
251
+ };
252
+ };
253
+ };
254
+ export default _default;
255
+ //# sourceMappingURL=index.d.ts.map
@@ -1,13 +1,16 @@
1
- "use strict"
2
-
3
- const navigationsItemsRelated = require("./navigations-items-related");
4
- const navigationItem = require("./navigation-item");
5
- const navigation = require("./navigation");
6
- const audience = require("./audience");
7
-
8
- module.exports = {
9
- audience,
10
- navigation,
11
- "navigation-item": navigationItem,
12
- "navigations-items-related": navigationsItemsRelated
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const navigations_items_related_1 = __importDefault(require("./navigations-items-related"));
7
+ const navigation_item_1 = __importDefault(require("./navigation-item"));
8
+ const navigation_1 = __importDefault(require("./navigation"));
9
+ const audience_1 = __importDefault(require("./audience"));
10
+ exports.default = {
11
+ audience: audience_1.default,
12
+ navigation: navigation_1.default,
13
+ "navigation-item": navigation_item_1.default,
14
+ "navigations-items-related": navigations_items_related_1.default
15
+ };
16
+ //# sourceMappingURL=index.js.map