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
@@ -0,0 +1,249 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const lodash_1 = require("lodash");
7
+ const slugify_1 = __importDefault(require("slugify"));
8
+ const uuid_1 = require("uuid");
9
+ const types_1 = require("../../types");
10
+ const utils_1 = require("../utils");
11
+ const utils_2 = require("@strapi/utils");
12
+ const i18n_1 = require("../i18n");
13
+ const NavigationError_1 = require("../../utils/NavigationError");
14
+ const clientService = ({ strapi }) => ({
15
+ async render({ idOrSlug, type = utils_1.RENDER_TYPES.FLAT, menuOnly = false, rootPath = null, wrapRelated = false, locale, }) {
16
+ const clientService = (0, utils_1.getPluginService)('client');
17
+ const findById = !isNaN((0, lodash_1.toNumber)(idOrSlug)) || (0, uuid_1.validate)(idOrSlug);
18
+ const criteria = findById ? { id: idOrSlug } : { slug: idOrSlug };
19
+ const itemCriteria = menuOnly ? { menuAttached: true } : {};
20
+ return await clientService.renderType({
21
+ type, criteria, itemCriteria, filter: null, rootPath, wrapRelated, locale,
22
+ });
23
+ },
24
+ async renderChildren({ idOrSlug, childUIKey, type = utils_1.RENDER_TYPES.FLAT, menuOnly = false, wrapRelated = false, locale, }) {
25
+ const clientService = (0, utils_1.getPluginService)('client');
26
+ const findById = !isNaN((0, lodash_1.toNumber)(idOrSlug)) || (0, uuid_1.validate)(idOrSlug);
27
+ const criteria = findById ? { id: idOrSlug } : { slug: idOrSlug };
28
+ const filter = type === utils_1.RENDER_TYPES.FLAT ? null : childUIKey;
29
+ const itemCriteria = {
30
+ ...(menuOnly && { menuAttached: true }),
31
+ ...(type === utils_1.RENDER_TYPES.FLAT ? { uiRouterKey: childUIKey } : {}),
32
+ };
33
+ return clientService.renderType({ type, criteria, itemCriteria, filter, rootPath: null, wrapRelated, locale });
34
+ },
35
+ renderRFR(items, parent = null, parentNavItem = null, contentTypes = []) {
36
+ const clientService = (0, utils_1.getPluginService)('client');
37
+ let pages = {};
38
+ let nav = {};
39
+ let navItems = [];
40
+ items.forEach(item => {
41
+ const { items: itemChilds, ...itemProps } = item;
42
+ const itemNav = clientService.renderRFRNav(itemProps);
43
+ const itemPage = clientService.renderRFRPage(itemProps, parent);
44
+ if (item.type === "INTERNAL") {
45
+ pages = {
46
+ ...pages,
47
+ [itemPage.id]: {
48
+ ...itemPage,
49
+ },
50
+ };
51
+ }
52
+ if (item.menuAttached) {
53
+ navItems.push(itemNav);
54
+ }
55
+ if (!parent) {
56
+ nav = {
57
+ ...nav,
58
+ root: navItems,
59
+ };
60
+ }
61
+ else {
62
+ const navLevel = navItems
63
+ .filter(navItem => navItem.type === "INTERNAL");
64
+ if (!(0, lodash_1.isEmpty)(navLevel))
65
+ nav = {
66
+ ...nav,
67
+ [parent]: navLevel.concat(parentNavItem ? parentNavItem : []),
68
+ };
69
+ }
70
+ if (!(0, lodash_1.isEmpty)(itemChilds)) {
71
+ const { nav: nestedNavs } = clientService.renderRFR(itemChilds, itemPage.id, itemNav, contentTypes);
72
+ const { pages: nestedPages } = clientService.renderRFR((itemChilds).filter(child => child.type === "INTERNAL"), itemPage.id, itemNav, contentTypes);
73
+ pages = {
74
+ ...pages,
75
+ ...nestedPages,
76
+ };
77
+ nav = {
78
+ ...nav,
79
+ ...nestedNavs,
80
+ };
81
+ }
82
+ });
83
+ return {
84
+ pages,
85
+ nav,
86
+ };
87
+ },
88
+ renderRFRNav(item) {
89
+ const { uiRouterKey, title, path, type, audience } = item;
90
+ const itemCommon = {
91
+ label: title,
92
+ type: type,
93
+ audience,
94
+ };
95
+ if (type === "EXTERNAL") {
96
+ (0, types_1.assertNotEmpty)(path, new NavigationError_1.NavigationError("External navigation item's path is undefined", item));
97
+ return {
98
+ ...itemCommon,
99
+ url: path
100
+ };
101
+ }
102
+ if (type === "INTERNAL") {
103
+ return {
104
+ ...itemCommon,
105
+ page: uiRouterKey,
106
+ };
107
+ }
108
+ throw new NavigationError_1.NavigationError("Unknown item type", item);
109
+ },
110
+ renderRFRPage(item, parent) {
111
+ const { uiRouterKey, title, path, slug, related, type, audience, menuAttached } = item;
112
+ const { __contentType, id, __templateName } = related || {};
113
+ const contentType = __contentType || '';
114
+ return {
115
+ id: uiRouterKey,
116
+ title,
117
+ templateName: __templateName,
118
+ related: type === "INTERNAL" ? {
119
+ contentType,
120
+ id,
121
+ } : undefined,
122
+ path,
123
+ slug,
124
+ parent,
125
+ audience,
126
+ menuAttached,
127
+ };
128
+ },
129
+ renderTree(items = [], id = null, field = 'parent', path = '', itemParser = (i) => i) {
130
+ return items
131
+ .filter((item) => {
132
+ if (item[field] === null && id === null) {
133
+ return true;
134
+ }
135
+ let data = item[field];
136
+ if (data && typeof id === 'string') {
137
+ data = data.toString();
138
+ }
139
+ if (!!data && typeof data === 'object' && 'id' in data) {
140
+ return data.id === id;
141
+ }
142
+ return (data && data === id);
143
+ })
144
+ .filter(utils_1.filterOutUnpublished)
145
+ .map(item => itemParser({
146
+ ...item,
147
+ }, path, field))
148
+ .sort((x, y) => {
149
+ if (x.order !== undefined && y.order !== undefined)
150
+ return x.order - y.order;
151
+ else
152
+ return 0;
153
+ });
154
+ },
155
+ async renderType({ type = utils_1.RENDER_TYPES.FLAT, criteria = {}, itemCriteria = {}, filter = null, rootPath = null, wrapRelated = false, locale, }) {
156
+ const clientService = (0, utils_1.getPluginService)('client');
157
+ const adminService = (0, utils_1.getPluginService)('admin');
158
+ const commonService = (0, utils_1.getPluginService)('common');
159
+ const entityWhereClause = {
160
+ ...criteria,
161
+ visible: true,
162
+ };
163
+ const { masterModel, itemModel } = (0, utils_1.extractMeta)(strapi.plugins);
164
+ const entity = await (0, i18n_1.i18nAwareEntityReadHandler)({
165
+ entity: await strapi
166
+ .query(masterModel.uid)
167
+ .findOne({
168
+ where: entityWhereClause,
169
+ }),
170
+ entityUid: masterModel.uid,
171
+ strapi,
172
+ whereClause: entityWhereClause,
173
+ localeCode: locale,
174
+ });
175
+ if (entity && entity.id) {
176
+ const entities = await strapi.query(itemModel.uid).findMany({
177
+ where: {
178
+ master: entity.id,
179
+ ...itemCriteria,
180
+ },
181
+ limit: Number.MAX_SAFE_INTEGER,
182
+ orderBy: [{ order: 'asc', }],
183
+ populate: ['related', 'audience', 'parent'],
184
+ });
185
+ if (!entities) {
186
+ return [];
187
+ }
188
+ const items = await commonService.getRelatedItems(entities);
189
+ const { contentTypes, contentTypesNameFields } = await adminService.config(false);
190
+ const wrapContentType = (itemContentType) => wrapRelated && itemContentType ? {
191
+ id: itemContentType.id,
192
+ attributes: { ...itemContentType }
193
+ } : itemContentType;
194
+ switch (type) {
195
+ case utils_1.RENDER_TYPES.TREE:
196
+ case utils_1.RENDER_TYPES.RFR:
197
+ const getTemplateName = await (0, utils_1.templateNameFactory)(items, strapi, contentTypes);
198
+ const itemParser = (item, path = '', field) => {
199
+ const isExternal = item.type === "EXTERNAL";
200
+ const parentPath = isExternal ? undefined : `${path === '/' ? '' : path}/${(0, lodash_1.first)(item.path) === '/'
201
+ ? item.path.substring(1)
202
+ : item.path}`;
203
+ const slug = (0, lodash_1.isString)(parentPath) ? (0, slugify_1.default)(((0, lodash_1.first)(parentPath) === '/' ? parentPath.substring(1) : parentPath).replace(/\//g, '-')) : undefined;
204
+ const lastRelated = (0, lodash_1.isArray)(item.related) ? (0, lodash_1.last)(item.related) : item.related;
205
+ const relatedContentType = wrapContentType(lastRelated);
206
+ return {
207
+ id: item.id,
208
+ title: (0, utils_1.composeItemTitle)(item, contentTypesNameFields, contentTypes),
209
+ menuAttached: item.menuAttached,
210
+ order: item.order,
211
+ path: isExternal ? item.externalPath : parentPath,
212
+ type: item.type,
213
+ uiRouterKey: item.uiRouterKey,
214
+ slug: !slug && item.uiRouterKey ? (0, slugify_1.default)(item.uiRouterKey) : slug,
215
+ external: isExternal,
216
+ related: isExternal || !lastRelated ? undefined : {
217
+ ...relatedContentType,
218
+ __templateName: getTemplateName((lastRelated.relatedType || lastRelated.__contentType), lastRelated.id),
219
+ },
220
+ audience: !(0, lodash_1.isEmpty)(item.audience) ? item.audience.map(aItem => (aItem).key) : undefined,
221
+ items: isExternal ? undefined : clientService.renderTree(items, item.id, field, parentPath, itemParser),
222
+ };
223
+ };
224
+ const { items: itemsFilteredByPath, root: rootElement, } = (0, utils_1.filterByPath)(items, rootPath);
225
+ const treeStructure = clientService.renderTree((0, lodash_1.isNil)(rootPath) ? items : itemsFilteredByPath, (0, lodash_1.get)(rootElement, 'parent.id'), 'parent', (0, lodash_1.get)(rootElement, 'parent.path'), itemParser);
226
+ const filteredStructure = filter
227
+ ? treeStructure.filter((item) => item.uiRouterKey === filter)
228
+ : treeStructure;
229
+ if (type === utils_1.RENDER_TYPES.RFR) {
230
+ return clientService.renderRFR(filteredStructure, null, null, contentTypes);
231
+ }
232
+ return filteredStructure;
233
+ default:
234
+ const publishedItems = items.filter(utils_1.filterOutUnpublished);
235
+ const result = (0, lodash_1.isNil)(rootPath) ? items : (0, utils_1.filterByPath)(publishedItems, rootPath).items;
236
+ return result.map((item) => ({
237
+ ...item,
238
+ audience: item.audience?.map(_ => (_).key),
239
+ title: (0, utils_1.composeItemTitle)(item, contentTypesNameFields, contentTypes) || '',
240
+ related: wrapContentType(item.related),
241
+ items: null,
242
+ }));
243
+ }
244
+ }
245
+ throw new utils_2.errors.NotFoundError();
246
+ },
247
+ });
248
+ exports.default = clientService;
249
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,5 @@
1
+ import { StrapiContext } from "strapi-typed";
2
+ import { ICommonService } from "../../types";
3
+ declare const commonService: (context: StrapiContext) => ICommonService;
4
+ export default commonService;
5
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1,313 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const lodash_1 = require("lodash");
7
+ const pluralize_1 = __importDefault(require("pluralize"));
8
+ const utils_1 = require("@strapi/utils");
9
+ const config_1 = require("../config");
10
+ const i18n_1 = require("../i18n");
11
+ const utils_2 = require("../utils");
12
+ const commonService = ({ strapi }) => ({
13
+ analyzeBranch(items = [], masterEntity = null, parentItem = null, prevOperations = {}) {
14
+ const commonService = (0, utils_2.getPluginService)('common');
15
+ const { toCreate, toRemove, toUpdate } = items
16
+ .reduce((acc, _) => {
17
+ const branchName = commonService.getBranchName(_);
18
+ if (branchName) {
19
+ return { ...acc, [branchName]: [...acc[branchName], _] };
20
+ }
21
+ return acc;
22
+ }, { toRemove: [], toCreate: [], toUpdate: [] });
23
+ const operations = {
24
+ create: prevOperations.create || !!toCreate.length,
25
+ update: prevOperations.update || !!toUpdate.length,
26
+ remove: prevOperations.remove || !!toRemove.length,
27
+ };
28
+ return (0, utils_2.checkDuplicatePath)(parentItem || masterEntity, toCreate.concat(toUpdate))
29
+ .then(() => Promise.all([
30
+ commonService.createBranch(toCreate, masterEntity, parentItem, operations),
31
+ commonService.removeBranch(toRemove, operations),
32
+ commonService.updateBranch(toUpdate, masterEntity, parentItem, operations),
33
+ ]));
34
+ },
35
+ async configContentTypes(viaSettingsPage = false) {
36
+ const commonService = (0, utils_2.getPluginService)('common');
37
+ const pluginStore = await commonService.getPluginStore();
38
+ const config = await pluginStore.get({ key: 'config' });
39
+ const eligibleContentTypes = await Promise.all(config.contentTypes
40
+ .filter(contentType => !!strapi.contentTypes[contentType] && (0, utils_2.isContentTypeEligible)(contentType))
41
+ .map(async (key) => {
42
+ const item = strapi.contentTypes[key];
43
+ const { kind, options, uid } = item;
44
+ const { draftAndPublish } = options;
45
+ const isSingleType = kind === utils_2.KIND_TYPES.SINGLE;
46
+ const isSingleTypeWithPublishFlow = isSingleType && draftAndPublish;
47
+ const returnType = (available) => ({
48
+ key,
49
+ available,
50
+ });
51
+ if (isSingleType) {
52
+ if (isSingleTypeWithPublishFlow) {
53
+ const itemsCountOrBypass = isSingleTypeWithPublishFlow ?
54
+ await strapi.query(uid).count({
55
+ where: {
56
+ published_at: { $notNull: true },
57
+ },
58
+ }) :
59
+ true;
60
+ return returnType(itemsCountOrBypass !== 0);
61
+ }
62
+ const isAvailable = await strapi.query(uid).count({});
63
+ return isAvailable !== 0 ?
64
+ returnType(true) :
65
+ (viaSettingsPage ? returnType(false) : undefined);
66
+ }
67
+ return returnType(true);
68
+ }));
69
+ return eligibleContentTypes
70
+ .filter(key => key)
71
+ .map((value) => {
72
+ if (value === undefined)
73
+ return;
74
+ const { key, available } = value;
75
+ const item = strapi.contentTypes[key];
76
+ const relatedField = (item.associations || []).find((_) => _.model === 'navigationitem');
77
+ const { uid, options, info, collectionName, modelName, apiName, plugin, kind, pluginOptions } = item;
78
+ const { visible = true } = pluginOptions['content-manager'] || {};
79
+ const { name, description } = info;
80
+ const { hidden, templateName, draftAndPublish } = options;
81
+ const findRouteConfig = (0, lodash_1.find)((0, lodash_1.get)(strapi.api, `[${modelName}].config.routes`, []), route => route.handler.includes('.find'));
82
+ const findRoutePath = findRouteConfig && findRouteConfig.path.split('/')[1];
83
+ const apiPath = findRoutePath && (findRoutePath !== apiName) ? findRoutePath : apiName || modelName;
84
+ const isSingle = kind === utils_2.KIND_TYPES.SINGLE;
85
+ const endpoint = isSingle ? apiPath : (0, pluralize_1.default)(apiPath);
86
+ const relationName = (0, utils_2.singularize)(modelName);
87
+ const relationNameParts = typeof uid === 'string' ? (0, lodash_1.last)((uid).split('.')).split('-') : [];
88
+ const contentTypeName = relationNameParts.length > 1 ? relationNameParts.reduce((prev, curr) => `${prev}${(0, lodash_1.upperFirst)(curr)}`, '') : (0, lodash_1.upperFirst)(modelName);
89
+ const labelSingular = name ||
90
+ ((0, lodash_1.upperFirst)(relationNameParts.length > 1 ? relationNameParts.join(' ') : relationName));
91
+ return {
92
+ uid,
93
+ name: relationName,
94
+ draftAndPublish,
95
+ isSingle,
96
+ description,
97
+ collectionName,
98
+ contentTypeName,
99
+ label: isSingle ? labelSingular : (0, pluralize_1.default)(name || labelSingular),
100
+ relatedField: relatedField ? relatedField.alias : undefined,
101
+ labelSingular: (0, utils_2.singularize)(labelSingular),
102
+ endpoint,
103
+ plugin,
104
+ available: available && !hidden,
105
+ visible,
106
+ templateName,
107
+ };
108
+ })
109
+ .filter((item) => viaSettingsPage || (item && item.available));
110
+ },
111
+ async createBranch(items, masterEntity, parentItem, operations) {
112
+ const commonService = (0, utils_2.getPluginService)('common');
113
+ const { itemModel } = (0, utils_2.extractMeta)(strapi.plugins);
114
+ return await Promise.all(items.map(async (item) => {
115
+ operations.create = true;
116
+ const { parent, master, related, ...params } = item;
117
+ const relatedItems = await this.getIdsRelated(related, master);
118
+ const data = {
119
+ ...params,
120
+ related: relatedItems,
121
+ master: masterEntity,
122
+ parent: parentItem ? { ...parentItem, _id: parentItem.id } : null,
123
+ };
124
+ const navigationItem = await strapi
125
+ .query(itemModel.uid)
126
+ .create({ data, populate: ['related'] });
127
+ return !(0, lodash_1.isEmpty)(item.items)
128
+ ? commonService.createBranch(item.items, masterEntity, navigationItem, operations)
129
+ : operations;
130
+ }));
131
+ },
132
+ getBranchName(item) {
133
+ const hasId = !(0, lodash_1.isNil)(item.id);
134
+ const toRemove = item.removed;
135
+ if (hasId && !toRemove) {
136
+ return 'toUpdate';
137
+ }
138
+ if (hasId && toRemove) {
139
+ return 'toRemove';
140
+ }
141
+ if (!hasId && !toRemove) {
142
+ return 'toCreate';
143
+ }
144
+ },
145
+ async getContentTypeItems(uid, query) {
146
+ const commonService = (0, utils_2.getPluginService)('common');
147
+ const pluginStore = await commonService.getPluginStore();
148
+ const config = await pluginStore.get({ key: 'config' });
149
+ const where = await (0, i18n_1.addI18nWhereClause)({
150
+ strapi,
151
+ previousWhere: {},
152
+ query,
153
+ modelUid: uid,
154
+ });
155
+ try {
156
+ const contentTypeItems = await strapi.query(uid).findMany({
157
+ populate: config.contentTypesPopulate[uid] || [],
158
+ where,
159
+ });
160
+ return contentTypeItems;
161
+ }
162
+ catch (err) {
163
+ return [];
164
+ }
165
+ },
166
+ async getIdsRelated(relatedItems, master) {
167
+ if (relatedItems) {
168
+ return (await Promise.all(relatedItems.map(async (relatedItem) => {
169
+ try {
170
+ const model = strapi.query("plugin::navigation.navigations-items-related");
171
+ const entity = await model.findOne({
172
+ where: {
173
+ related_id: relatedItem.refId,
174
+ related_type: relatedItem.ref,
175
+ field: relatedItem.field,
176
+ master,
177
+ },
178
+ });
179
+ if (!entity) {
180
+ const newEntity = {
181
+ master,
182
+ order: 1,
183
+ field: relatedItem.field,
184
+ related_id: relatedItem.refId,
185
+ related_type: relatedItem.ref,
186
+ };
187
+ return model.create({ data: newEntity }).then(({ id }) => id);
188
+ }
189
+ return entity.id;
190
+ }
191
+ catch (e) {
192
+ console.error(e);
193
+ }
194
+ }))).reduce((acc, id) => (id ? acc.concat([id]) : acc), []);
195
+ }
196
+ },
197
+ async getPluginStore() {
198
+ return await strapi.store({ type: 'plugin', name: 'navigation' });
199
+ },
200
+ async getRelatedItems(entityItems) {
201
+ const commonService = (0, utils_2.getPluginService)('common');
202
+ const pluginStore = await commonService.getPluginStore();
203
+ const config = await pluginStore.get({ key: 'config' });
204
+ const relatedTypes = new Set(entityItems.flatMap((item) => (0, lodash_1.get)(item.related, 'related_type', '')));
205
+ const groupedItems = Array.from(relatedTypes).filter((relatedType) => relatedType).reduce((acc, relatedType) => Object.assign(acc, {
206
+ [relatedType]: [
207
+ ...(acc[relatedType] || []),
208
+ ...entityItems
209
+ .filter((item => (0, lodash_1.get)(item.related, 'related_type') === relatedType))
210
+ .flatMap((item) => Object.assign(item.related, { navigationItemId: item.id })),
211
+ ],
212
+ }), {});
213
+ const data = new Map((await Promise.all(Object.entries(groupedItems)
214
+ .map(async ([model, related]) => {
215
+ const relationData = await strapi
216
+ .query(model)
217
+ .findMany({
218
+ where: {
219
+ id: { $in: (0, lodash_1.map)(related, 'related_id') },
220
+ },
221
+ populate: config.contentTypesPopulate[model] || []
222
+ });
223
+ return relationData
224
+ .flatMap(_ => Object.assign(_, {
225
+ __contentType: model,
226
+ navigationItemId: related.find(({ related_id }) => related_id === _.id.toString())?.navigationItemId,
227
+ }));
228
+ })))
229
+ .flat(1)
230
+ .map(_ => [_.navigationItemId, _]));
231
+ return entityItems
232
+ .map(({ related, ...item }) => {
233
+ const relatedData = data.get(item.id);
234
+ if (relatedData) {
235
+ return Object.assign(item, { related: relatedData });
236
+ }
237
+ return { ...item, related: null };
238
+ });
239
+ },
240
+ removeBranch(items = [], operations = {}) {
241
+ const commonService = (0, utils_2.getPluginService)('common');
242
+ const { itemModel } = (0, utils_2.extractMeta)(strapi.plugins);
243
+ return Promise.all(items
244
+ .filter(item => item.id)
245
+ .map(async (item) => {
246
+ operations.remove = true;
247
+ const { id, related, master } = item;
248
+ await Promise.all([
249
+ strapi
250
+ .query(itemModel.uid)
251
+ .delete({ where: { id } }),
252
+ this.removeRelated(related, master),
253
+ ]);
254
+ return !(0, lodash_1.isEmpty)(item.items)
255
+ ? commonService.removeBranch(item.items, operations)
256
+ : operations;
257
+ }));
258
+ },
259
+ removeRelated(relatedItems, master) {
260
+ return Promise.all((relatedItems || []).map(relatedItem => {
261
+ const model = strapi.query('plugin::navigation.navigations-items-related');
262
+ const entityToRemove = {
263
+ master,
264
+ field: relatedItem.field,
265
+ related_id: relatedItem.refId,
266
+ related_type: relatedItem.ref,
267
+ };
268
+ return model.delete({ where: entityToRemove });
269
+ }));
270
+ },
271
+ setDefaultConfig() {
272
+ return (0, config_1.configSetupStrategy)({ strapi });
273
+ },
274
+ async updateBranch(toUpdate, masterEntity, parentItem, operations) {
275
+ const commonService = (0, utils_2.getPluginService)('common');
276
+ const { itemModel } = (0, utils_2.extractMeta)(strapi.plugins);
277
+ const databaseModel = strapi.query(itemModel.uid);
278
+ return Promise.all(toUpdate.map(async (item) => {
279
+ operations.update = true;
280
+ const { id, updated, parent, master, related, items, ...params } = item;
281
+ let currentItem;
282
+ if (updated) {
283
+ const relatedItems = await this.getIdsRelated(related, master);
284
+ currentItem = await databaseModel
285
+ .update({
286
+ where: { id },
287
+ data: {
288
+ ...params,
289
+ related: relatedItems,
290
+ master: masterEntity,
291
+ parent: parentItem ? { ...parentItem, _id: parentItem.id } : null,
292
+ },
293
+ });
294
+ }
295
+ else {
296
+ currentItem = item;
297
+ }
298
+ return !(0, lodash_1.isEmpty)(items)
299
+ ? commonService.analyzeBranch(items, masterEntity, currentItem, operations)
300
+ : operations;
301
+ }));
302
+ },
303
+ async emitEvent(uid, event, entity) {
304
+ const model = strapi.getModel(uid);
305
+ const sanitizedEntity = await utils_1.sanitize.sanitizers.defaultSanitizeOutput(model, entity);
306
+ strapi.webhookRunner.eventHub.emit(event, {
307
+ model: model.modelName,
308
+ entry: sanitizedEntity,
309
+ });
310
+ }
311
+ });
312
+ exports.default = commonService;
313
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1,7 @@
1
+ declare const navigationService: {
2
+ common: (context: import("strapi-typed").StrapiContext) => import("../../types").ICommonService;
3
+ admin: (context: import("strapi-typed").StrapiContext) => import("../../types").IAdminService;
4
+ client: (context: import("strapi-typed").StrapiContext) => import("../../types").IClientService;
5
+ };
6
+ export default navigationService;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,15 @@
1
- "use strict"
2
-
3
- const navigation = require("./navigation");
4
-
5
- module.exports = {
6
- navigation
1
+ 'use strict';
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
4
  };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const common_1 = __importDefault(require("./common"));
7
+ const admin_1 = __importDefault(require("./admin"));
8
+ const client_1 = __importDefault(require("./client"));
9
+ const navigationService = {
10
+ common: common_1.default,
11
+ admin: admin_1.default,
12
+ client: client_1.default,
13
+ };
14
+ exports.default = navigationService;
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,27 @@
1
+ export declare const TEMPLATE_DEFAULT: "Generic";
2
+ export declare const MODEL_TYPES: {
3
+ readonly CONTENT_TYPE: "contentType";
4
+ };
5
+ export declare const KIND_TYPES: {
6
+ readonly SINGLE: "singleType";
7
+ readonly COLLECTION: "collectionType";
8
+ };
9
+ export declare const ALLOWED_CONTENT_TYPES: readonly ["api::", "plugin::"];
10
+ export declare const RESTRICTED_CONTENT_TYPES: readonly ["plugin::users-permissions", "plugin::i18n.locale", "plugin::navigation"];
11
+ export declare const EXCLUDED_CONTENT_TYPES: string[];
12
+ export declare const CONTENT_TYPES_NAME_FIELDS_DEFAULTS: string[];
13
+ export declare const ADDITIONAL_FIELDS: {
14
+ AUDIENCE: string;
15
+ };
16
+ export declare const DEFAULT_POPULATE: "localizations"[];
17
+ export declare const DEFAULT_NAVIGATION_ITEM: {
18
+ readonly name: "Main navigation";
19
+ readonly slug: "main-navigation";
20
+ readonly visible: true;
21
+ };
22
+ export declare const RENDER_TYPES: Readonly<{
23
+ FLAT: "FLAT";
24
+ TREE: "TREE";
25
+ RFR: "RFR";
26
+ }>;
27
+ //# sourceMappingURL=constant.d.ts.map
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RENDER_TYPES = exports.DEFAULT_NAVIGATION_ITEM = exports.DEFAULT_POPULATE = exports.ADDITIONAL_FIELDS = exports.CONTENT_TYPES_NAME_FIELDS_DEFAULTS = exports.EXCLUDED_CONTENT_TYPES = exports.RESTRICTED_CONTENT_TYPES = exports.ALLOWED_CONTENT_TYPES = exports.KIND_TYPES = exports.MODEL_TYPES = exports.TEMPLATE_DEFAULT = void 0;
4
+ const i18n_1 = require("../i18n");
5
+ exports.TEMPLATE_DEFAULT = 'Generic';
6
+ exports.MODEL_TYPES = { CONTENT_TYPE: 'contentType' };
7
+ exports.KIND_TYPES = { SINGLE: 'singleType', COLLECTION: 'collectionType' };
8
+ exports.ALLOWED_CONTENT_TYPES = ['api::', 'plugin::'];
9
+ exports.RESTRICTED_CONTENT_TYPES = ['plugin::users-permissions', 'plugin::i18n.locale', 'plugin::navigation'];
10
+ exports.EXCLUDED_CONTENT_TYPES = ['strapi::'];
11
+ exports.CONTENT_TYPES_NAME_FIELDS_DEFAULTS = ['title', 'subject', 'name'];
12
+ exports.ADDITIONAL_FIELDS = { AUDIENCE: 'audience' };
13
+ exports.DEFAULT_POPULATE = [...i18n_1.I18N_DEFAULT_POPULATE];
14
+ exports.DEFAULT_NAVIGATION_ITEM = {
15
+ name: "Main navigation",
16
+ slug: "main-navigation",
17
+ visible: true,
18
+ };
19
+ exports.RENDER_TYPES = {
20
+ FLAT: 'FLAT',
21
+ TREE: 'TREE',
22
+ RFR: 'RFR'
23
+ };
24
+ //# sourceMappingURL=constant.js.map