strapi-plugin-navigation 2.3.0-beta.0 → 2.3.2

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 (390) hide show
  1. package/__mocks__/strapi.d.ts +3 -0
  2. package/__mocks__/strapi.d.ts.map +1 -0
  3. package/__mocks__/strapi.js +206 -0
  4. package/__mocks__/strapi.js.map +1 -0
  5. package/admin/src/components/AdditionalFieldInput/index.d.ts.map +1 -0
  6. package/admin/src/components/AdditionalFieldInput/index.js +2 -2
  7. package/admin/src/components/AdditionalFieldInput/index.js.map +1 -0
  8. package/admin/src/components/AdditionalFieldInput/types.d.ts +4 -3
  9. package/admin/src/components/AdditionalFieldInput/types.d.ts.map +1 -0
  10. package/admin/src/components/AdditionalFieldInput/types.js.map +1 -0
  11. package/admin/src/components/Alert/styles.d.ts.map +1 -0
  12. package/admin/src/components/Alert/styles.js.map +1 -0
  13. package/admin/src/components/CollapseButton/index.d.ts.map +1 -0
  14. package/admin/src/components/CollapseButton/index.js.map +1 -0
  15. package/admin/src/components/ConfirmationDialog/index.d.ts +10 -10
  16. package/admin/src/components/ConfirmationDialog/index.d.ts.map +1 -0
  17. package/admin/src/components/ConfirmationDialog/index.js.map +1 -0
  18. package/admin/src/components/DragButton/index.d.ts.map +1 -0
  19. package/admin/src/components/DragButton/index.js.map +1 -0
  20. package/admin/src/components/EmptyView/index.d.ts.map +1 -0
  21. package/admin/src/components/EmptyView/index.js +2 -0
  22. package/admin/src/components/EmptyView/index.js.map +1 -0
  23. package/admin/src/components/Item/ItemCardBadge/index.d.ts.map +1 -0
  24. package/admin/src/components/Item/ItemCardBadge/index.js.map +1 -0
  25. package/admin/src/components/Item/ItemCardHeader/Wrapper.d.ts.map +1 -0
  26. package/admin/src/components/Item/ItemCardHeader/Wrapper.js.map +1 -0
  27. package/admin/src/components/Item/ItemCardHeader/icons.d.ts +1 -1
  28. package/admin/src/components/Item/ItemCardHeader/icons.d.ts.map +1 -0
  29. package/admin/src/components/Item/ItemCardHeader/icons.js +2 -1
  30. package/admin/src/components/Item/ItemCardHeader/icons.js.map +1 -0
  31. package/admin/src/components/Item/ItemCardHeader/index.d.ts +1 -0
  32. package/admin/src/components/Item/ItemCardHeader/index.d.ts.map +1 -0
  33. package/admin/src/components/Item/ItemCardHeader/index.js +10 -8
  34. package/admin/src/components/Item/ItemCardHeader/index.js.map +1 -0
  35. package/admin/src/components/Item/ItemCardRemovedOverlay/index.d.ts.map +1 -0
  36. package/admin/src/components/Item/ItemCardRemovedOverlay/index.js.map +1 -0
  37. package/admin/src/components/Item/Wrapper.d.ts.map +1 -0
  38. package/admin/src/components/Item/Wrapper.js.map +1 -0
  39. package/admin/src/components/Item/index.d.ts +15 -15
  40. package/admin/src/components/Item/index.d.ts.map +1 -0
  41. package/admin/src/components/Item/index.js +10 -8
  42. package/admin/src/components/Item/index.js.map +1 -0
  43. package/admin/src/components/NavigationItemList/Wrapper.d.ts.map +1 -0
  44. package/admin/src/components/NavigationItemList/Wrapper.js.map +1 -0
  45. package/admin/src/components/NavigationItemList/index.d.ts +13 -12
  46. package/admin/src/components/NavigationItemList/index.d.ts.map +1 -0
  47. package/admin/src/components/NavigationItemList/index.js +2 -2
  48. package/admin/src/components/NavigationItemList/index.js.map +1 -0
  49. package/admin/src/components/RestartAlert/index.d.ts.map +1 -0
  50. package/admin/src/components/RestartAlert/index.js.map +1 -0
  51. package/admin/src/components/Search/index.d.ts.map +1 -0
  52. package/admin/src/components/Search/index.js.map +1 -0
  53. package/admin/src/components/TextArrayInput/index.d.ts.map +1 -0
  54. package/admin/src/components/TextArrayInput/index.js.map +1 -0
  55. package/admin/src/components/icons/navigation.d.ts.map +1 -0
  56. package/admin/src/components/icons/navigation.js.map +1 -0
  57. package/admin/src/contexts/DataManagerContext.d.ts.map +1 -0
  58. package/admin/src/contexts/DataManagerContext.js.map +1 -0
  59. package/admin/src/hooks/useAllContentTypes.d.ts +1 -1
  60. package/admin/src/hooks/useAllContentTypes.d.ts.map +1 -0
  61. package/admin/src/hooks/useAllContentTypes.js.map +1 -0
  62. package/admin/src/hooks/useDataManager.d.ts.map +1 -0
  63. package/admin/src/hooks/useDataManager.js.map +1 -0
  64. package/admin/src/hooks/useI18nCopyNavigationItemsModal.d.ts.map +1 -0
  65. package/admin/src/hooks/useI18nCopyNavigationItemsModal.js.map +1 -0
  66. package/admin/src/hooks/useNavigationConfig.d.ts +3 -3
  67. package/admin/src/hooks/useNavigationConfig.d.ts.map +1 -0
  68. package/admin/src/hooks/useNavigationConfig.js.map +1 -0
  69. package/admin/src/hooks/useNavigationManager.d.ts +0 -1
  70. package/admin/src/hooks/useNavigationManager.d.ts.map +1 -0
  71. package/admin/src/hooks/useNavigationManager.js.map +1 -0
  72. package/admin/src/index.d.ts +7 -7
  73. package/admin/src/index.d.ts.map +1 -0
  74. package/admin/src/index.js +12 -18
  75. package/admin/src/index.js.map +1 -0
  76. package/admin/src/pages/App/index.d.ts.map +1 -0
  77. package/admin/src/pages/App/index.js.map +1 -0
  78. package/admin/src/pages/DataManagerProvider/actions.d.ts.map +1 -0
  79. package/admin/src/pages/DataManagerProvider/actions.js.map +1 -0
  80. package/admin/src/pages/DataManagerProvider/index.d.ts +1 -1
  81. package/admin/src/pages/DataManagerProvider/index.d.ts.map +1 -0
  82. package/admin/src/pages/DataManagerProvider/index.js +32 -5
  83. package/admin/src/pages/DataManagerProvider/index.js.map +1 -0
  84. package/admin/src/pages/DataManagerProvider/init.d.ts.map +1 -0
  85. package/admin/src/pages/DataManagerProvider/init.js.map +1 -0
  86. package/admin/src/pages/DataManagerProvider/reducer.d.ts +16 -16
  87. package/admin/src/pages/DataManagerProvider/reducer.d.ts.map +1 -0
  88. package/admin/src/pages/DataManagerProvider/reducer.js.map +1 -0
  89. package/admin/src/pages/NoAccessPage/index.d.ts +3 -0
  90. package/admin/src/pages/NoAccessPage/index.d.ts.map +1 -0
  91. package/admin/src/pages/NoAccessPage/index.js +31 -0
  92. package/admin/src/pages/NoAccessPage/index.js.map +1 -0
  93. package/admin/src/pages/SettingsPage/components/CustomFieldForm/index.d.ts.map +1 -0
  94. package/admin/src/pages/SettingsPage/components/CustomFieldForm/index.js.map +1 -0
  95. package/admin/src/pages/SettingsPage/components/CustomFieldModal/index.d.ts.map +1 -0
  96. package/admin/src/pages/SettingsPage/components/CustomFieldModal/index.js.map +1 -0
  97. package/admin/src/pages/SettingsPage/components/CustomFieldTable/index.d.ts.map +1 -0
  98. package/admin/src/pages/SettingsPage/components/CustomFieldTable/index.js.map +1 -0
  99. package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.d.ts.map +1 -0
  100. package/admin/src/pages/SettingsPage/components/DisableI18nModal/index.js.map +1 -0
  101. package/admin/src/pages/SettingsPage/index.d.ts +0 -1
  102. package/admin/src/pages/SettingsPage/index.d.ts.map +1 -0
  103. package/admin/src/pages/SettingsPage/index.js +9 -0
  104. package/admin/src/pages/SettingsPage/index.js.map +1 -0
  105. package/admin/src/pages/SettingsPage/types.d.ts +8 -8
  106. package/admin/src/pages/SettingsPage/types.d.ts.map +1 -0
  107. package/admin/src/pages/SettingsPage/types.js.map +1 -0
  108. package/admin/src/pages/SettingsPage/utils/form.d.ts.map +1 -0
  109. package/admin/src/pages/SettingsPage/utils/form.js.map +1 -0
  110. package/admin/src/pages/SettingsPage/utils/functions.d.ts +0 -2
  111. package/admin/src/pages/SettingsPage/utils/functions.d.ts.map +1 -0
  112. package/admin/src/pages/SettingsPage/utils/functions.js.map +1 -0
  113. package/admin/src/pages/View/components/I18nCopyNavigationItems/index.d.ts.map +1 -0
  114. package/admin/src/pages/View/components/I18nCopyNavigationItems/index.js.map +1 -0
  115. package/admin/src/pages/View/components/NavigationContentHeader/index.d.ts.map +1 -0
  116. package/admin/src/pages/View/components/NavigationContentHeader/index.js.map +1 -0
  117. package/admin/src/pages/View/components/NavigationHeader/index.d.ts +2 -1
  118. package/admin/src/pages/View/components/NavigationHeader/index.d.ts.map +1 -0
  119. package/admin/src/pages/View/components/NavigationHeader/index.js +19 -9
  120. package/admin/src/pages/View/components/NavigationHeader/index.js.map +1 -0
  121. package/admin/src/pages/View/components/NavigationHeader/styles.d.ts.map +1 -0
  122. package/admin/src/pages/View/components/NavigationHeader/styles.js.map +1 -0
  123. package/admin/src/pages/View/components/NavigationItemForm/index.d.ts.map +1 -0
  124. package/admin/src/pages/View/components/NavigationItemForm/index.js +25 -19
  125. package/admin/src/pages/View/components/NavigationItemForm/index.js.map +1 -0
  126. package/admin/src/pages/View/components/NavigationItemForm/types.d.ts +10 -9
  127. package/admin/src/pages/View/components/NavigationItemForm/types.d.ts.map +1 -0
  128. package/admin/src/pages/View/components/NavigationItemForm/types.js.map +1 -0
  129. package/admin/src/pages/View/components/NavigationItemForm/utils/form.d.ts +6 -6
  130. package/admin/src/pages/View/components/NavigationItemForm/utils/form.d.ts.map +1 -0
  131. package/admin/src/pages/View/components/NavigationItemForm/utils/form.js.map +1 -0
  132. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +12 -10
  133. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts.map +1 -0
  134. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js +5 -1
  135. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js.map +1 -0
  136. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.d.ts +2 -1
  137. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.d.ts.map +1 -0
  138. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js +6 -2
  139. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js.map +1 -0
  140. package/admin/src/pages/View/components/NavigationItemPopup/index.d.ts +13 -12
  141. package/admin/src/pages/View/components/NavigationItemPopup/index.d.ts.map +1 -0
  142. package/admin/src/pages/View/components/NavigationItemPopup/index.js +4 -3
  143. package/admin/src/pages/View/components/NavigationItemPopup/index.js.map +1 -0
  144. package/admin/src/pages/View/components/NavigationManager/AllNavigations/icons.d.ts +0 -1
  145. package/admin/src/pages/View/components/NavigationManager/AllNavigations/icons.d.ts.map +1 -0
  146. package/admin/src/pages/View/components/NavigationManager/AllNavigations/icons.js.map +1 -0
  147. package/admin/src/pages/View/components/NavigationManager/AllNavigations/index.d.ts +0 -1
  148. package/admin/src/pages/View/components/NavigationManager/AllNavigations/index.d.ts.map +1 -0
  149. package/admin/src/pages/View/components/NavigationManager/AllNavigations/index.js.map +1 -0
  150. package/admin/src/pages/View/components/NavigationManager/DeletionConfirm/index.d.ts +0 -1
  151. package/admin/src/pages/View/components/NavigationManager/DeletionConfirm/index.d.ts.map +1 -0
  152. package/admin/src/pages/View/components/NavigationManager/DeletionConfirm/index.js.map +1 -0
  153. package/admin/src/pages/View/components/NavigationManager/ErrorDetails/index.d.ts +0 -1
  154. package/admin/src/pages/View/components/NavigationManager/ErrorDetails/index.d.ts.map +1 -0
  155. package/admin/src/pages/View/components/NavigationManager/ErrorDetails/index.js.map +1 -0
  156. package/admin/src/pages/View/components/NavigationManager/Footer/index.d.ts +1 -1
  157. package/admin/src/pages/View/components/NavigationManager/Footer/index.d.ts.map +1 -0
  158. package/admin/src/pages/View/components/NavigationManager/Footer/index.js.map +1 -0
  159. package/admin/src/pages/View/components/NavigationManager/Form/index.d.ts +0 -1
  160. package/admin/src/pages/View/components/NavigationManager/Form/index.d.ts.map +1 -0
  161. package/admin/src/pages/View/components/NavigationManager/Form/index.js.map +1 -0
  162. package/admin/src/pages/View/components/NavigationManager/NavigationUpdate/index.d.ts +0 -1
  163. package/admin/src/pages/View/components/NavigationManager/NavigationUpdate/index.d.ts.map +1 -0
  164. package/admin/src/pages/View/components/NavigationManager/NavigationUpdate/index.js.map +1 -0
  165. package/admin/src/pages/View/components/NavigationManager/NewNavigation/index.d.ts +0 -1
  166. package/admin/src/pages/View/components/NavigationManager/NewNavigation/index.d.ts.map +1 -0
  167. package/admin/src/pages/View/components/NavigationManager/NewNavigation/index.js.map +1 -0
  168. package/admin/src/pages/View/components/NavigationManager/index.d.ts +0 -1
  169. package/admin/src/pages/View/components/NavigationManager/index.d.ts.map +1 -0
  170. package/admin/src/pages/View/components/NavigationManager/index.js.map +1 -0
  171. package/admin/src/pages/View/components/NavigationManager/types.d.ts +3 -3
  172. package/admin/src/pages/View/components/NavigationManager/types.d.ts.map +1 -0
  173. package/admin/src/pages/View/components/NavigationManager/types.js.map +1 -0
  174. package/admin/src/pages/View/index.d.ts +1 -1
  175. package/admin/src/pages/View/index.d.ts.map +1 -0
  176. package/admin/src/pages/View/index.js +42 -25
  177. package/admin/src/pages/View/index.js.map +1 -0
  178. package/admin/src/pages/View/utils/form.d.ts +1 -1
  179. package/admin/src/pages/View/utils/form.d.ts.map +1 -0
  180. package/admin/src/pages/View/utils/form.js.map +1 -0
  181. package/admin/src/pages/View/utils/index.d.ts.map +1 -0
  182. package/admin/src/pages/View/utils/index.js.map +1 -0
  183. package/admin/src/pages/View/utils/parsers.d.ts.map +1 -0
  184. package/admin/src/pages/View/utils/parsers.js.map +1 -0
  185. package/admin/src/permissions.d.ts +6 -2
  186. package/admin/src/permissions.d.ts.map +1 -0
  187. package/admin/src/permissions.js +1 -0
  188. package/admin/src/permissions.js.map +1 -0
  189. package/admin/src/pluginId.d.ts.map +1 -0
  190. package/admin/src/pluginId.js.map +1 -0
  191. package/admin/src/translations/ca.json +198 -0
  192. package/admin/src/translations/en.json +11 -1
  193. package/admin/src/translations/fr.json +3 -1
  194. package/admin/src/translations/index.d.ts +2 -0
  195. package/admin/src/translations/index.d.ts.map +1 -0
  196. package/admin/src/translations/index.js +2 -0
  197. package/admin/src/translations/index.js.map +1 -0
  198. package/admin/src/utils/api.d.ts +4 -4
  199. package/admin/src/utils/api.d.ts.map +1 -0
  200. package/admin/src/utils/api.js.map +1 -0
  201. package/admin/src/utils/enums.d.ts.map +1 -0
  202. package/admin/src/utils/enums.js.map +1 -0
  203. package/admin/src/utils/functions.d.ts +2 -2
  204. package/admin/src/utils/functions.d.ts.map +1 -0
  205. package/admin/src/utils/functions.js.map +1 -0
  206. package/admin/src/utils/index.d.ts.map +1 -0
  207. package/admin/src/utils/index.js.map +1 -0
  208. package/package.json +102 -70
  209. package/permissions.d.ts +1 -0
  210. package/permissions.d.ts.map +1 -0
  211. package/permissions.js +1 -0
  212. package/permissions.js.map +1 -0
  213. package/server/bootstrap/index.d.ts.map +1 -0
  214. package/server/bootstrap/index.js +6 -0
  215. package/server/bootstrap/index.js.map +1 -0
  216. package/server/config/index.d.ts.map +1 -0
  217. package/server/config/index.js.map +1 -0
  218. package/server/config/setupStrategy.d.ts.map +1 -0
  219. package/server/config/setupStrategy.js +11 -0
  220. package/server/config/setupStrategy.js.map +1 -0
  221. package/server/content-types/audience/index.d.ts.map +1 -0
  222. package/server/content-types/audience/index.js.map +1 -0
  223. package/server/content-types/audience/schema.d.ts.map +1 -0
  224. package/server/content-types/audience/schema.js.map +1 -0
  225. package/server/content-types/index.d.ts.map +1 -0
  226. package/server/content-types/index.js.map +1 -0
  227. package/server/content-types/navigation/index.d.ts.map +1 -0
  228. package/server/content-types/navigation/index.js.map +1 -0
  229. package/server/content-types/navigation/schema.d.ts.map +1 -0
  230. package/server/content-types/navigation/schema.js.map +1 -0
  231. package/server/content-types/navigation-item/index.d.ts.map +1 -0
  232. package/server/content-types/navigation-item/index.js.map +1 -0
  233. package/server/content-types/navigation-item/schema.d.ts.map +1 -0
  234. package/server/content-types/navigation-item/schema.js.map +1 -0
  235. package/server/content-types/navigations-items-related/index.d.ts.map +1 -0
  236. package/server/content-types/navigations-items-related/index.js.map +1 -0
  237. package/server/content-types/navigations-items-related/schema.d.ts.map +1 -0
  238. package/server/content-types/navigations-items-related/schema.js.map +1 -0
  239. package/server/controllers/admin.d.ts.map +1 -0
  240. package/server/controllers/admin.js.map +1 -0
  241. package/server/controllers/client.d.ts.map +1 -0
  242. package/server/controllers/client.js +18 -1
  243. package/server/controllers/client.js.map +1 -0
  244. package/server/controllers/index.d.ts.map +1 -0
  245. package/server/controllers/index.js.map +1 -0
  246. package/server/destroy.d.ts.map +1 -0
  247. package/server/destroy.js.map +1 -0
  248. package/server/graphql/config.d.ts.map +1 -0
  249. package/server/graphql/config.js.map +1 -0
  250. package/server/graphql/index.d.ts.map +1 -0
  251. package/server/graphql/index.js.map +1 -0
  252. package/server/graphql/queries/index.d.ts.map +1 -0
  253. package/server/graphql/queries/index.js.map +1 -0
  254. package/server/graphql/queries/render-navigation-child.d.ts.map +1 -0
  255. package/server/graphql/queries/render-navigation-child.js.map +1 -0
  256. package/server/graphql/queries/render-navigation.d.ts.map +1 -0
  257. package/server/graphql/queries/render-navigation.js.map +1 -0
  258. package/server/graphql/resolvers-config.d.ts.map +1 -0
  259. package/server/graphql/resolvers-config.js.map +1 -0
  260. package/server/graphql/setupStrategy.d.ts.map +1 -0
  261. package/server/graphql/setupStrategy.js.map +1 -0
  262. package/server/graphql/types/content-types-name-fields.d.ts.map +1 -0
  263. package/server/graphql/types/content-types-name-fields.js.map +1 -0
  264. package/server/graphql/types/content-types.d.ts.map +1 -0
  265. package/server/graphql/types/content-types.js.map +1 -0
  266. package/server/graphql/types/create-navigation-item.d.ts.map +1 -0
  267. package/server/graphql/types/create-navigation-item.js.map +1 -0
  268. package/server/graphql/types/create-navigation-related.d.ts.map +1 -0
  269. package/server/graphql/types/create-navigation-related.js.map +1 -0
  270. package/server/graphql/types/create-navigation.d.ts.map +1 -0
  271. package/server/graphql/types/create-navigation.js.map +1 -0
  272. package/server/graphql/types/index.d.ts.map +1 -0
  273. package/server/graphql/types/index.js.map +1 -0
  274. package/server/graphql/types/navigation-config.d.ts.map +1 -0
  275. package/server/graphql/types/navigation-config.js.map +1 -0
  276. package/server/graphql/types/navigation-details.d.ts.map +1 -0
  277. package/server/graphql/types/navigation-details.js.map +1 -0
  278. package/server/graphql/types/navigation-item-related-data.d.ts.map +1 -0
  279. package/server/graphql/types/navigation-item-related-data.js.map +1 -0
  280. package/server/graphql/types/navigation-item-related.d.ts.map +1 -0
  281. package/server/graphql/types/navigation-item-related.js.map +1 -0
  282. package/server/graphql/types/navigation-item.d.ts.map +1 -0
  283. package/server/graphql/types/navigation-item.js.map +1 -0
  284. package/server/graphql/types/navigation-render-type.d.ts.map +1 -0
  285. package/server/graphql/types/navigation-render-type.js.map +1 -0
  286. package/server/graphql/types/navigation.d.ts.map +1 -0
  287. package/server/graphql/types/navigation.js.map +1 -0
  288. package/server/i18n/constant.d.ts.map +1 -0
  289. package/server/i18n/constant.js.map +1 -0
  290. package/server/i18n/errors.d.ts.map +1 -0
  291. package/server/i18n/errors.js.map +1 -0
  292. package/server/i18n/graphQLEnhancers.d.ts +1 -1
  293. package/server/i18n/graphQLEnhancers.d.ts.map +1 -0
  294. package/server/i18n/graphQLEnhancers.js.map +1 -0
  295. package/server/i18n/index.d.ts.map +1 -0
  296. package/server/i18n/index.js.map +1 -0
  297. package/server/i18n/navigationSetupStrategy.d.ts.map +1 -0
  298. package/server/i18n/navigationSetupStrategy.js +68 -40
  299. package/server/i18n/navigationSetupStrategy.js.map +1 -0
  300. package/server/i18n/serviceEnhancers.d.ts.map +1 -0
  301. package/server/i18n/serviceEnhancers.js.map +1 -0
  302. package/server/i18n/types.d.ts +11 -11
  303. package/server/i18n/types.d.ts.map +1 -0
  304. package/server/i18n/types.js.map +1 -0
  305. package/server/i18n/utils.d.ts +2 -2
  306. package/server/i18n/utils.d.ts.map +1 -0
  307. package/server/i18n/utils.js.map +1 -0
  308. package/server/index.d.ts.map +1 -0
  309. package/server/index.js.map +1 -0
  310. package/server/navigation/index.d.ts.map +1 -0
  311. package/server/navigation/index.js.map +1 -0
  312. package/server/navigation/setupStrategy.d.ts.map +1 -0
  313. package/server/navigation/setupStrategy.js.map +1 -0
  314. package/server/register/index.d.ts.map +1 -0
  315. package/server/register/index.js.map +1 -0
  316. package/server/routes/admin.d.ts.map +1 -0
  317. package/server/routes/admin.js +99 -2
  318. package/server/routes/admin.js.map +1 -0
  319. package/server/routes/client.d.ts.map +1 -0
  320. package/server/routes/client.js +8 -0
  321. package/server/routes/client.js.map +1 -0
  322. package/server/routes/index.d.ts.map +1 -0
  323. package/server/routes/index.js.map +1 -0
  324. package/server/services/__tests__/service.test.d.ts +2 -0
  325. package/server/services/__tests__/service.test.d.ts.map +1 -0
  326. package/server/services/__tests__/service.test.js +131 -0
  327. package/server/services/__tests__/service.test.js.map +1 -0
  328. package/server/services/admin.d.ts.map +1 -0
  329. package/server/services/admin.js +114 -57
  330. package/server/services/admin.js.map +1 -0
  331. package/server/services/client.d.ts.map +1 -0
  332. package/server/services/client.js +17 -1
  333. package/server/services/client.js.map +1 -0
  334. package/server/services/common.d.ts.map +1 -0
  335. package/server/services/common.js +27 -16
  336. package/server/services/common.js.map +1 -0
  337. package/server/services/index.d.ts.map +1 -0
  338. package/server/services/index.js.map +1 -0
  339. package/server/utils/__tests__/functions.test.d.ts +2 -0
  340. package/server/utils/__tests__/functions.test.d.ts.map +1 -0
  341. package/server/utils/__tests__/functions.test.js +153 -0
  342. package/server/utils/__tests__/functions.test.js.map +1 -0
  343. package/server/utils/constant.d.ts.map +1 -0
  344. package/server/utils/constant.js.map +1 -0
  345. package/server/utils/functions.d.ts +7 -1
  346. package/server/utils/functions.d.ts.map +1 -0
  347. package/server/utils/functions.js +59 -2
  348. package/server/utils/functions.js.map +1 -0
  349. package/server/utils/index.d.ts.map +1 -0
  350. package/server/utils/index.js.map +1 -0
  351. package/setup-package.d.ts +2 -0
  352. package/setup-package.d.ts.map +1 -0
  353. package/setup-package.js +19 -0
  354. package/setup-package.js.map +1 -0
  355. package/strapi-admin.d.ts.map +1 -0
  356. package/strapi-admin.js.map +1 -0
  357. package/strapi-server.d.ts.map +1 -0
  358. package/strapi-server.js.map +1 -0
  359. package/tsconfig.tsbuildinfo +1 -1
  360. package/types/bootstrap.d.ts.map +1 -0
  361. package/types/bootstrap.js.map +1 -0
  362. package/types/config.d.ts +8 -8
  363. package/types/config.d.ts.map +1 -0
  364. package/types/config.js.map +1 -0
  365. package/types/contentTypes.d.ts +20 -20
  366. package/types/contentTypes.d.ts.map +1 -0
  367. package/types/contentTypes.js.map +1 -0
  368. package/types/controllers.d.ts +3 -2
  369. package/types/controllers.d.ts.map +1 -0
  370. package/types/controllers.js.map +1 -0
  371. package/types/graphQL.d.ts +1 -1
  372. package/types/graphQL.d.ts.map +1 -0
  373. package/types/graphQL.js.map +1 -0
  374. package/types/i18n.d.ts +2 -2
  375. package/types/i18n.d.ts.map +1 -0
  376. package/types/i18n.js.map +1 -0
  377. package/types/index.d.ts.map +1 -0
  378. package/types/index.js.map +1 -0
  379. package/types/services.d.ts +7 -3
  380. package/types/services.d.ts.map +1 -0
  381. package/types/services.js.map +1 -0
  382. package/types/utils.d.ts +25 -20
  383. package/types/utils.d.ts.map +1 -0
  384. package/types/utils.js.map +1 -0
  385. package/utils/InvalidParamNavigationError.d.ts.map +1 -0
  386. package/utils/InvalidParamNavigationError.js.map +1 -0
  387. package/utils/NavigationError.d.ts.map +1 -0
  388. package/utils/NavigationError.js.map +1 -0
  389. package/LICENSE.md +0 -7
  390. package/README.md +0 -706
package/README.md DELETED
@@ -1,706 +0,0 @@
1
- <div align="center" width="150px">
2
- <img style="width: 150px; height: auto;" src="public/assets/logo.png" alt="Logo - Strapi Navigation plugin" />
3
- </div>
4
- <div align="center">
5
- <h1>Strapi v4 - Navigation plugin</h1>
6
- <p>Create consumable navigation with a simple and straightforward visual builder</p>
7
- <a href="https://www.npmjs.org/package/strapi-plugin-navigation">
8
- <img alt="GitHub package.json version" src="https://img.shields.io/github/package-json/v/VirtusLab-Open-Source/strapi-plugin-navigation?label=npm&logo=npm">
9
- </a>
10
- <a href="https://www.npmjs.org/package/strapi-plugin-navigation">
11
- <img src="https://img.shields.io/npm/dm/strapi-plugin-navigation.svg" alt="Monthly download on NPM" />
12
- </a>
13
- <a href="https://circleci.com/gh/VirtusLab/strapi-plugin-navigation">
14
- <img src="https://circleci.com/gh/VirtusLab-Open-Source/strapi-plugin-navigation.svg?style=shield" alt="CircleCI" />
15
- </a>
16
- <a href="https://codecov.io/gh/VirtusLab/strapi-plugin-navigation">
17
- <img src="https://codecov.io/gh/VirtusLab/strapi-plugin-navigation/coverage.svg?branch=master" alt="codecov.io" />
18
- </a>
19
- <a href="https://sharing.clickup.com/tl/xhcmx-43/strapiv-4-navigation-roadmap">
20
- <img src="https://img.shields.io/website?down_message=roadmap&label=product&up_message=roadmap&url=https%3A%2F%2Fsharing.clickup.com%2Ftl%2Fxhcmx-43%2Fstrapiv-4-navigation-roadmap" />
21
- </a>
22
- <a href="https://sharing.clickup.com/b/6-169004201-2/strapiv-4-navigation-board">
23
- <img src="https://img.shields.io/website?down_message=board&label=product&up_color=blue&up_message=board&url=https%3A%2F%2Fsharing.clickup.com%2Fb%2F6-169004201-2%2Fstrapiv-4-navigation-board" />
24
- </a>
25
- </div>
26
-
27
- ---
28
-
29
- <div style="margin: 20px 0" align="center">
30
- <img style="width: 100%; height: auto;" src="public/assets/preview.png" alt="UI preview" />
31
- </div>
32
-
33
- Strapi Navigation Plugin provides a website navigation / menu builder feature for [Strapi Headless CMS](https://github.com/strapi/strapi) admin panel. Navigation has the possibility to control the audience and can be consumed by the website with different output structure renderers:
34
-
35
- - Flat
36
- - Tree (nested)
37
- - RFR (ready for handling by Redux First Router)
38
-
39
- ### Table of Contents
40
- 1. [✨ Features](#-features)
41
- 2. [⏳ Installation](#-installation)
42
- 3. [🖐 Requirements](#-requirements)
43
- 4. [🔧 Basic Configuration](#-configuration)
44
- - [Settings page](#in-v203-and-newer)
45
- - [Plugin file](#in-v202-and-older--default-configuration-state-for-v203-and-newer)
46
- 5. [🔧 GraphQL Configuration](#-gql-configuration)
47
- 6. [🌍 i18n Internationalization](#-i18n-internationalization)
48
- 7. [🕸️ Public API specification](#%EF%B8%8F-public-api-specification)
49
- - [REST API](#rest-api)
50
- - [GraphQL API](#graphql-api)
51
- 8. [💬 FAQ](#-faq)
52
- 10. [🤝 Contributing](#-contributing)
53
- 11. [👨‍💻 Community support](#-community-support)
54
-
55
- ## ✨ Features
56
-
57
- - **Navigation Public API:** Simple and ready for use API endpoint for consuming the navigation structure you've created
58
- - **Visual builder:** Elegant and easy to use visual builder
59
- - **Any Content Type relation:** Navigation can by linked to any of your Content Types by default. Simply, you're controlling it and also limiting available content types by configuration props
60
- - **Different types of navigation items:** Create navigation with items linked to internal types, to external links or wrapper elements to keep structure clean
61
- - **Multiple navigations:** Create as many Navigation containers as you want, setup them and use in the consumer application
62
- - **Light / Dark mode compatible:** By design we're supporting Strapi ☀️ Light / 🌙 Dark modes
63
- - **Webhooks integration:** Changes to navigation will trigger 'entry.update' or 'entry.create' webhook events.
64
- - **Customizable:** Possibility to customize the options like: available Content Types, Maximum level for "attach to menu", Additional fields (audience)
65
- - **[Audit log](https://github.com/VirtusLab/strapi-molecules/tree/master/packages/strapi-plugin-audit-log):** integration with Strapi Molecules Audit Log plugin that provides changes track record
66
-
67
- ## ⚙️ Versions
68
-
69
- - **Strapi v4** - (current) - [v2.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation)
70
- - **Strapi v3** - [v1.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation/tree/strapi-v3)
71
-
72
- ## ⏳ Installation
73
-
74
- ### Via Strapi Markerplace
75
-
76
- As a ✅ **verified** plugin by Strapi team we're available on the [**Strapi Marketplace**](https://market.strapi.io/plugins/strapi-plugin-navigation) as well as **In-App Marketplace** where you can follow the installation instructions.
77
-
78
- <div style="margin: 20px 0" align="center">
79
- <img style="width: 100%; height: auto;" src="public/assets/marketplace.png" alt="Strapi In-App Marketplace" />
80
- </div>
81
-
82
- ### Via command line
83
-
84
- It's recommended to use **yarn** to install this plugin within your Strapi project. [You can install yarn with these docs](https://yarnpkg.com/lang/en/docs/install/).
85
-
86
- ```bash
87
- yarn add strapi-plugin-navigation@latest
88
- ```
89
-
90
- After successful installation you've to re-build your Strapi instance. To archive that simply use:
91
-
92
- ```bash
93
- yarn build
94
- yarn develop
95
- ```
96
-
97
- or just run Strapi in the development mode with `--watch-admin` option:
98
-
99
- ```bash
100
- yarn develop --watch-admin
101
- ```
102
-
103
- The **UI Navigation** plugin should appear in the **Plugins** section of Strapi sidebar after you run app again.
104
-
105
- You can manage your multiple navigation containers by going to the **Navigation** manage view by clicking "Manage" button.
106
-
107
- <div style="margin: 20px 0" align="center">
108
- <img style="width: 100%; height: auto;" src="public/assets/manager-view.png" alt="Navigation Manager View" />
109
- </div>
110
-
111
- As a next step you must configure your the plugin by the way you want to. See [**Configuration**](#🔧-configuration) section.
112
-
113
- All done. Enjoy 🎉
114
-
115
- ## 🖐 Requirements
116
-
117
- Complete installation requirements are exact same as for Strapi itself and can be found in the documentation under <a href="https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/installation/cli.html#preparing-the-installation">Installation Requirements</a>.
118
-
119
- **Supported Strapi versions**:
120
-
121
- - Strapi v4.2.0 (recently tested)
122
- - Strapi v4.x
123
-
124
- > This plugin is designed for **Strapi v4** and is not working with v3.x. To get version for **Strapi v3** install version [v1.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation/tree/strapi-v3).
125
-
126
- **We recommend always using the latest version of Strapi to start your new projects**.
127
-
128
- ## 🔧 Configuration
129
-
130
- To start your journey with **Navigation plugin** you must first setup it using the dedicated Settings page (`v2.0.3` and newer) or for any version, put your configuration in `config/plugins.js`. Anyway we're recommending the click-through option where your configuration is going to be properly validated.
131
-
132
- ### In `v2.0.3` and newer
133
-
134
- Version `2.0.3` introduces the intuitive **Settings** page which you can easily access via `Strapi Settings -> Section: Navigation Plugin -> Configuration`.
135
-
136
- On the dedicated page, you will be able to set up all crucial properties which drive the plugin and customize each individual collection for which **Navigation plugin** should be enabled.
137
-
138
- <div style="margin: 20px 0" align="center">
139
- <img style="width: 100%; height: auto;" src="public/assets/configuration.png" alt="Plugin configuration" />
140
- </div>
141
-
142
- > *Note*
143
- > The default configuration for your plugin is fetched from `config/plugins.js` or, if the file is not there, directly from the plugin itself. If you would like to customize the default state to which you might revert, please follow the next section.
144
-
145
- ### In `v2.0.2` and older + default configuration state for `v2.0.3` and newer
146
-
147
- Config for this plugin is stored as a part of the `config/plugins.js` or `config/<env>/plugins.js` file. You can use the following snippet to make sure that the config structure is correct. If you've got already configurations for other plugins stores by this way, you can use the `navigation` along with them.
148
-
149
- > *Note v2.0.3 and newer only*
150
- > Changing this file will not automatically change plugin configuration. To synchronize plugin's config with plugins.js file, it is necessary to restore configuration through the settings page
151
-
152
- > *Note for newer than v2.2.0*
153
- > `slugify` as been removed. **THIS A BREAKING CHANGE**
154
-
155
- ```js
156
- module.exports = ({ env }) => ({
157
- // ...
158
- navigation: {
159
- enabled: true,
160
- config: {
161
- additionalFields: ['audience', { name: 'my_custom_field', type: 'boolean', label: 'My custom field' }],
162
- contentTypes: ['api::page.page'],
163
- contentTypesNameFields: {
164
- 'api::page.page': ['title']
165
- },
166
- allowedLevels: 2,
167
- gql: {...},
168
- }
169
- }
170
- });
171
- ```
172
-
173
- ### Properties
174
- - `additionalFields` - Additional fields for navigation items. More **[ here ](#additional-fields)**
175
- - `allowedLevels` - Maximum level for which you're able to mark item as "Menu attached"
176
- - `contentTypes` - UIDs of related content types
177
- - `contentTypesNameFields` - Definition of content type title fields like `'api::<collection name>.<content type name>': ['field_name_1', 'field_name_2']`, if not set titles are pulled from fields like `['title', 'subject', 'name']`. **TIP** - Proper content type uid you can find in the URL of Content Manager where you're managing relevant entities like: `admin/content-manager/collectionType/< THE UID HERE >?page=1&pageSize=10&sort=Title:ASC&plugins[i18n][locale]=en`
178
- - `gql` - If you're using GraphQL that's the right place to put all necessary settings. More **[ here ](#gql-configuration)**
179
- - `i18nEnabled` - should you want to manage multi-locale content via navigation set this value `Enabled`. More **[ here ](#i18n-internationalization)**
180
- - `cascadeMenuAttached` - If you don't want "Menu attached" to cascade on child items set this value `Disabled`.
181
- - `slugify` - allows to extend configuration of our "slugging" solution of choice. To learn more visit the [documentation](https://github.com/sindresorhus/slugify#api). It can be left unset since it's optional. **This option can only be handled by configuration in config file**.
182
-
183
- ### Properties
184
-
185
- ### Additional Fields
186
- It is advised to configure additional fields through the plugin's Settings Page. There you can find the table of custom fields and toggle input for the audience field. When enabled, the audience field can be customized through the content manager. Custom fields can be added, edited, toggled, and removed with the use of the table provided on the Settings Page. When removing custom fields be advised that their values in navigation items will be lost. Disabling the custom fields will not affect the data and can be done with no consequence of loosing information.
187
-
188
- Creating configuration for additional fields with the `config.js` file should be done with caution. Config object contains the `additionalFields` property of type `Array<CustomField | 'audience'>`, where CustomField is of type `{type: 'string' | 'boolean', name: string, label: string}`. When creating custom fields be advised that the `name` property has to be unique. When editing a custom field it is advised not to edit its `name` and `type` properties. After config has been restored the custom fields that are not present in `config.js` file will be deleted and their values in navigation items will be lost.
189
-
190
- ## 🔧 GQL Configuration
191
- Using navigation with GraphQL requires both plugins to be installed and working. You can find installation guide for GraphQL plugin **[here](https://docs.strapi.io/developer-docs/latest/plugins/graphql.html#graphql)**. To properly configure GQL to work with navigation you should provide `gql` prop. This should contain union types that will be used to define GQL response format for your data while fetching:
192
-
193
- > **Important!**
194
- > If you're using `config/plugins.js` to configure your plugins , please put `navigation` property before `graphql`. Otherwise types are not going to be properly added to GraphQL Schema. That's because of dynamic types which base on plugin configuration which are added on `bootstrap` stage, not `register`. This is not valid if you're using `graphql` plugin without any custom configuration, so most of cases in real.
195
-
196
- ```gql
197
- master: Int
198
- items: [NavigationItem]
199
- related: NavigationRelated
200
- ```
201
-
202
- This prop should look as follows:
203
-
204
- ```js
205
- gql: {
206
- navigationItemRelated: ['<your GQL related content types>'],
207
- },
208
- ```
209
-
210
- for example:
211
-
212
- ```js
213
- gql: {
214
- navigationItemRelated: ['Page', 'UploadFile'],
215
- },
216
- ```
217
- where `Page` and `UploadFile` are your type names for the **Content Types** you're referring by navigation items relations.
218
-
219
- ## 🌍 i18n Internationalization
220
-
221
- ### Settings
222
-
223
- This feature is **opt-in**.
224
-
225
- In order to use this functionality setting **default locale** is required. (See: Settings -> Internationalization)
226
-
227
- Once feature is enabled a restart is required. On server startup missing navigations for other locales will be created. From then you can manage navigation's localizations just like before.
228
-
229
- If you want go back to _pre-i18n_ way you can disable it in settings. Already created navigations will not be removed unless you make a choice for plugin to do so(this will require a restart).
230
-
231
- If your newly created navigation localization is empty you can copy contents of one version's to the empty one. If related item is localized and locale version exists localization will be used as a related item. Otherwise plugin will fallback to an original item.
232
-
233
- ### Rendering
234
-
235
- Shape of the rendered navigation will not change. Querying stays almost the same. To query for specific locale version just add `locale` query param. For example:
236
-
237
- ```https://yourdomain.cool/api/navigation/render/1?locale=fr```
238
-
239
- or
240
-
241
- ```https://yourdomain.cool/api/navigation/render/main-navigation?locale=fr```
242
-
243
- If `locale` is not specified whatever version used to be at id `1` will be returned.
244
-
245
- Of course if you know that `fr` version is present at id `2` you can just query for that.
246
-
247
- ### GraphQL
248
-
249
- If feature is enabled GQL render navigation query is expanded to handle `locale` param(it will work the same as regular requests). Checkout schema provided by GraphQL plugin.
250
-
251
- ## 👤 RBAC
252
- Plugin provides granular permissions based on Strapi RBAC functionality.
253
-
254
- ### Mandatory permissions
255
- For any role different than **Super Admin**, to access the **Navigation panel** you must set following permissions:
256
- - _Plugins_ -> _Navigation_ -> _Read_ - gives you the access to **Navigation Panel**
257
-
258
- ## Base Navigation Item model
259
-
260
- ### Flat
261
- ```json
262
- {
263
- "id": 1,
264
- "title": "News",
265
- "type": "INTERNAL",
266
- "path": "news",
267
- "externalPath": null,
268
- "uiRouterKey": "News",
269
- "menuAttached": false,
270
- "parent": 8, // Parent Navigation Item 'id', null in case of root level
271
- "master": 1, // Navigation 'id'
272
- "createdAt": "2020-09-29T13:29:19.086Z",
273
- "updatedAt": "2020-09-29T13:29:19.128Z",
274
- "related": {/*<Content Type model >*/ },
275
- "audience": []
276
- }
277
- ```
278
-
279
- ### Tree
280
- ```json
281
- {
282
- "title": "News",
283
- "menuAttached": true,
284
- "path": "/news",
285
- "type": "INTERNAL",
286
- "uiRouterKey": "news",
287
- "slug": "benefits",
288
- "external": false,
289
- "related": {
290
- // <Content Type model >
291
- },
292
- "items": [
293
- {
294
- "title": "External url",
295
- "menuAttached": true,
296
- "path": "http://example.com",
297
- "type": "EXTERNAL",
298
- "uiRouterKey": "generic",
299
- "external": true
300
- },
301
- // < Tree Navigation Item models >
302
- ]
303
- }
304
- ```
305
-
306
- ### RFR
307
- ```json
308
- {
309
- "id": "News",
310
- "title": "News",
311
- "templateName": "pages:1",
312
- "related": {
313
- "contentType": "page",
314
- "collectionName": "pages",
315
- "id": 1
316
- },
317
- "path": "/news",
318
- "slug": "news",
319
- "parent": null, // Parent Navigation Item 'id', null in case of root level
320
- "menuAttached": true
321
- }
322
- ```
323
-
324
- ## 🕸️ Public API specification
325
-
326
- Plugin supports both **REST API** and **GraphQL API** exposed by Strapi.
327
-
328
- **Query Params**
329
-
330
- - `navigationIdOrSlug` - ID or slug for which your navigation structure is generated like for REST API:
331
-
332
- > `https://localhost:1337/api/navigation/render/1`
333
- > `https://localhost:1337/api/navigation/render/main-menu`
334
-
335
- - `type` - Enum value representing structure type of returned navigation:
336
- > `https://localhost:1337/api/navigation/render/1?type=FLAT`
337
-
338
- - `menu` (`menuOnly` for GQL) - Boolean value for querying only navigation items that are attached to menu should be rendered eg.
339
- > `https://localhost:1337/api/navigation/render/1?menu=true`
340
-
341
- - `path` - String value for querying navigation items by its path:
342
- > `https://localhost:1337/api/navigation/render/1?path=/home/about-us`
343
-
344
- ### REST API
345
-
346
- > **Important!**
347
- > Version `v2.0.13` introduced breaking change!
348
- > All responses have changed their structure. Related field will now be of type ContentType instead of Array\<ContentType\>
349
-
350
- `GET <host>/api/navigation/render/<navigationIdOrSlug>?type=<type>`
351
-
352
- Return a rendered navigation structure depends on passed type (`TREE`, `RFR` or nothing to render as `FLAT`).
353
-
354
- > The ID of navigation by default is `1`, if you've got defined multiple navigations you must work with their IDs or Slugs to fetch.
355
-
356
- **Example URL**: `https://localhost:1337/api/navigation/render/1`
357
-
358
- **Example response body**
359
-
360
- ```json
361
- [
362
- {
363
- "id": 1,
364
- "title": "News",
365
- "type": "INTERNAL",
366
- "path": "news",
367
- "externalPath": null,
368
- "uiRouterKey": "News",
369
- "menuAttached": false,
370
- "parent": null,
371
- "master": 1,
372
- "created_at": "2020-09-29T13:29:19.086Z",
373
- "updated_at": "2020-09-29T13:29:19.128Z",
374
- "related": {
375
- "__contentType": "Page",
376
- "id": 1,
377
- "title": "News",
378
- // ...
379
- }
380
- },
381
- // ...
382
- ]
383
- ```
384
-
385
- **Example URL**: `https://localhost:1337/api/navigation/render/1?type=TREE`
386
-
387
- **Example response body**
388
-
389
- ```json
390
- [
391
- {
392
- "title": "News",
393
- "menuAttached": true,
394
- "path": "/news",
395
- "type": "INTERNAL",
396
- "uiRouterKey": "news",
397
- "slug": "benefits",
398
- "external": false,
399
- "related": {
400
- "__contentType": "Page",
401
- "id": 1,
402
- "title": "News",
403
- // ...
404
- },
405
- "items": [
406
- {
407
- "title": "External url",
408
- "menuAttached": true,
409
- "path": "http://example.com",
410
- "type": "EXTERNAL",
411
- "uiRouterKey": "generic",
412
- "external": true
413
- },
414
- // ...
415
- ]
416
- },
417
- // ...
418
- ]
419
- ```
420
-
421
- **Example URL**: `https://localhost:1337/api/navigation/render/1?type=RFR`
422
-
423
- **Example response body**
424
-
425
- ```json
426
- {
427
- "pages": {
428
- "News": {
429
- "id": "News",
430
- "title": "News",
431
- "templateName": "pages:1",
432
- "related": {
433
- "contentType": "page",
434
- "collectionName": "pages",
435
- "id": 1
436
- },
437
- "path": "/news",
438
- "slug": "news",
439
- "parent": null,
440
- "menuAttached": true
441
- },
442
- "Community": {
443
- "id": "Community",
444
- "title": "Community",
445
- "templateName": "pages:2",
446
- "related": {
447
- "contentType": "page",
448
- "collectionName": "pages",
449
- "id": 2
450
- },
451
- "path": "/community",
452
- "slug": "community",
453
- "parent": null,
454
- "menuAttached": true
455
- },
456
- "Highlights": {
457
- "id": "Highlights",
458
- "title": "Highlights",
459
- "templateName": "pages:3",
460
- "related": {
461
- "contentType": "page",
462
- "collectionName": "pages",
463
- "id": 3
464
- },
465
- "path": "/community/highlights",
466
- "slug": "community-highlights",
467
- "parent": "Community",
468
- "menuAttached": false
469
- },
470
- // ...
471
- },
472
- "nav": {
473
- "root": [
474
- {
475
- "label": "News",
476
- "type": "internal",
477
- "page": "News"
478
- },
479
- {
480
- "label": "Community",
481
- "type": "internal",
482
- "page": "Community"
483
- },
484
- {
485
- "label": "External url",
486
- "type": "external",
487
- "url": "http://example.com"
488
- },
489
- // ...
490
- ],
491
- "Community": [
492
- {
493
- "label": "Highlights",
494
- "type": "internal",
495
- "page": "Highlights"
496
- },
497
- // ...
498
- ],
499
- // ...
500
- }
501
- }
502
- ```
503
-
504
- ### GraphQL API
505
-
506
- Same as [**REST API**](#rest-api) returns a rendered navigation structure depends on passed type (`TREE`, `RFR` or nothing to render as `FLAT`).
507
-
508
- **Example request**
509
-
510
- ```graphql
511
- query {
512
- renderNavigation(
513
- navigationIdOrSlug: "main-navigation"
514
- type: TREE
515
- menuOnly: false
516
- ) {
517
- id
518
- title
519
- path
520
- related {
521
- id
522
- attributes {
523
- __typename
524
-
525
- ... on Page {
526
- Title
527
- }
528
-
529
- ... on WithFlowType {
530
- Name
531
- }
532
- }
533
- }
534
- items {
535
- id
536
- title
537
- path
538
- related {
539
- id
540
- attributes {
541
- __typename
542
-
543
- ... on Page {
544
- Title
545
- }
546
-
547
- ... on WithFlowType {
548
- Name
549
- }
550
- }
551
- }
552
- }
553
- }
554
- }
555
- ```
556
-
557
- **Example response**
558
-
559
- ```json
560
- {
561
- "data": {
562
- "renderNavigation": [
563
- {
564
- "id": 8,
565
- "title": "Test page",
566
- "path": "/test-path",
567
- "related": {
568
- "id": 3,
569
- "attributes": {
570
- "__typename": "WithFlowType",
571
- "Name": "Test"
572
- }
573
- },
574
- "items": [
575
- {
576
- "id": 11,
577
- "title": "Nested",
578
- "path": "/test-path/nested-one",
579
- "related": {
580
- "id": 1,
581
- "attributes": {
582
- "__typename": "Page",
583
- "Title": "Eg. Page title"
584
- }
585
- }
586
- }
587
- ]
588
- },
589
- {
590
- "id": 10,
591
- "title": "Another page",
592
- "path": "/another",
593
- "related": {
594
- "__typename": "Page",
595
- "Title": "Eg. Page title"
596
- },
597
- "items": []
598
- }
599
- ]
600
- }
601
- }
602
- ```
603
-
604
- ### Template name
605
-
606
- Depending on a content type `templateName` will be resolved differently
607
-
608
- For collection types it will be read from content type's attribute name `template` holding a component which definition has option named `templateName`.
609
-
610
- For single types a global name of this content type will be used as a template name or it can be set manually with an option named `templateName`.
611
-
612
- ## 🧩 Examples
613
-
614
- Live example of plugin usage can be found in the [VirtusLab Strapi Examples](https://github.com/VirtusLab/strapi-examples/tree/master/strapi-plugin-navigation) repository.
615
-
616
- ## 💬 FAQ
617
-
618
- ### GraphQL tricks
619
-
620
- **Q:** I would like to use GraphQL schemas but I'm not getting renderNavigation query or even proper types as Navigation, NavigationItem etc. What should I do?
621
-
622
- **A:** **A:** There is a one trick you might try. Strapi by default is ordering plugins by the way which takes `strapi-plugin-graphql` to initialize earlier than other plugins so types might not be injected. If you don't have it yet, please create `config/plugins.js` file and put there following lines (put `graphql` at the end):
623
-
624
- ```js
625
- module.exports = {
626
- 'navigation': { enabled: true },
627
- 'graphql': { enabled: true },
628
- };
629
- ```
630
-
631
- If you already got it, make sure that `navigation` plugin is inserted before `graphql`. That should do the job.
632
-
633
- ### Slug generation
634
-
635
- #### Customisation
636
-
637
- Slug generation is available as a controller and service. If you have custom requirements outside of what this plugin provides you can add your own logic with [plugins extensions](https://docs.strapi.io/developer-docs/latest/development/plugins-extension.html).
638
-
639
- For example:
640
-
641
- ```ts
642
- // path: ./src/index.js
643
-
644
- module.exports = {
645
- // ...
646
- bootstrap({ strapi }) {
647
- const navigationCommonService = strapi.plugin("navigation").service("common");
648
- const originalGetSlug = navigationCommonService.getSlug;
649
- const preprocess = (q) => {
650
- return q + "suffix";
651
- };
652
-
653
- navigationCommonService.getSlug = (query) => {
654
- return originalGetSlug(preprocess(query));
655
- };
656
- },
657
- };
658
- ```
659
-
660
- ## 🤝 Contributing
661
-
662
- <div>
663
- <a href="https://sharing.clickup.com/tl/xhcmx-43/strapiv-4-navigation-roadmap">
664
- <img src="https://img.shields.io/website?down_message=roadmap&label=product&up_message=roadmap&url=https%3A%2F%2Fsharing.clickup.com%2Ftl%2Fxhcmx-43%2Fstrapiv-4-navigation-roadmap" />
665
- </a>
666
- <a href="https://sharing.clickup.com/b/6-169004201-2/strapiv-4-navigation-board">
667
- <img src="https://img.shields.io/website?down_message=board&label=product&up_color=blue&up_message=board&url=https%3A%2F%2Fsharing.clickup.com%2Fb%2F6-169004201-2%2Fstrapiv-4-navigation-board" />
668
- </a>
669
- </div>
670
-
671
- Feel free to fork and make a Pull Request to this plugin project. All the input is warmly welcome!
672
-
673
- - Clone repository
674
-
675
- ```
676
- git clone git@github.com:VirtusLab-Open-Source/strapi-plugin-navigation.git
677
- ```
678
-
679
- - Create a soft link in your strapi project to plugin build folder
680
-
681
- ```sh
682
- ln -s <...>/strapi-plugin-navigation/build <...>/strapi-project/src/plugins/navigation
683
- ```
684
-
685
- - Run build command
686
-
687
- ```ts
688
- // Watch for file changes
689
- yarn develop
690
-
691
- // or run build without nodemon
692
- yarn build:dev
693
- ```
694
-
695
- ## 👨‍💻 Community support
696
-
697
- For general help using Strapi, please refer to [the official Strapi documentation](https://strapi.io/documentation/). For additional help, you can use one of these channels to ask a question:
698
-
699
- - [Discord](https://discord.strapi.io/) We're present on official Strapi Discord workspace. Find us by `[VirtusLab]` prefix and DM.
700
- - [Slack - VirtusLab Open Source](https://virtuslab-oss.slack.com) We're present on a public channel #strapi-molecules
701
- - [GitHub](https://github.com/VirtusLab/strapi-plugin-navigation/issues) (Bug reports, Contributions, Questions and Discussions)
702
- - [E-mail](mailto:strapi@virtuslab.com) - we will respond back as soon as possible
703
-
704
- ## 📝 License
705
-
706
- [MIT License](LICENSE.md) Copyright (c) [VirtusLab Sp. z o.o.](https://virtuslab.com/) &amp; [Strapi Solutions](https://strapi.io/).