@webiny/app-admin 0.0.0-unstable.d7f521b032 → 0.0.0-unstable.de38392959

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 (483) hide show
  1. package/assets/icons/add-18px.svg +1 -1
  2. package/assets/icons/arrow_drop_down-24px.svg +1 -1
  3. package/assets/icons/file_download.svg +1 -0
  4. package/assets/icons/file_upload.svg +1 -0
  5. package/assets/icons/filter-24px.svg +1 -1
  6. package/assets/icons/highlight-24px.svg +1 -1
  7. package/assets/icons/info.svg +1 -1
  8. package/assets/icons/insert_drive_file-24px.svg +1 -1
  9. package/assets/icons/insert_photo-24px.svg +1 -1
  10. package/assets/icons/label-24px.svg +1 -1
  11. package/assets/icons/round-account_circle-24px.svg +1 -1
  12. package/assets/icons/round-arrow_drop_down-24px.svg +1 -1
  13. package/assets/icons/round-help-24px.svg +1 -1
  14. package/assets/icons/round-settings-24px.svg +1 -1
  15. package/assets/icons/today-24px.svg +1 -1
  16. package/assets/icons/touch_app.svg +1 -1
  17. package/base/Admin.d.ts +1 -1
  18. package/base/Admin.js +6 -3
  19. package/base/Admin.js.map +1 -1
  20. package/base/Base.d.ts +1 -1
  21. package/base/Base.js +15 -29
  22. package/base/Base.js.map +1 -1
  23. package/base/plugins/AddGraphQLQuerySelection.d.ts +1 -2
  24. package/base/plugins/AddGraphQLQuerySelection.js +9 -3
  25. package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
  26. package/base/providers/ApolloProvider.d.ts +4 -1
  27. package/base/providers/ApolloProvider.js +3 -1
  28. package/base/providers/ApolloProvider.js.map +1 -1
  29. package/base/providers/TelemetryProvider.d.ts +5 -1
  30. package/base/providers/TelemetryProvider.js +3 -6
  31. package/base/providers/TelemetryProvider.js.map +1 -1
  32. package/base/providers/UiStateProvider.d.ts +5 -1
  33. package/base/providers/UiStateProvider.js +3 -1
  34. package/base/providers/UiStateProvider.js.map +1 -1
  35. package/base/providers/ViewCompositionProvider.d.ts +4 -1
  36. package/base/providers/ViewCompositionProvider.js +3 -1
  37. package/base/providers/ViewCompositionProvider.js.map +1 -1
  38. package/base/ui/Brand.d.ts +9 -2
  39. package/base/ui/Brand.js +3 -1
  40. package/base/ui/Brand.js.map +1 -1
  41. package/base/ui/CenteredView.d.ts +5 -1
  42. package/base/ui/CenteredView.js +3 -1
  43. package/base/ui/CenteredView.js.map +1 -1
  44. package/base/ui/Dashboard.d.ts +9 -2
  45. package/base/ui/Dashboard.js +3 -1
  46. package/base/ui/Dashboard.js.map +1 -1
  47. package/{components → base/ui}/FileManager.d.ts +14 -10
  48. package/base/ui/FileManager.js +77 -0
  49. package/base/ui/FileManager.js.map +1 -0
  50. package/base/ui/Layout.d.ts +8 -2
  51. package/base/ui/Layout.js +3 -1
  52. package/base/ui/Layout.js.map +1 -1
  53. package/base/ui/LocaleSelector.d.ts +9 -2
  54. package/base/ui/LocaleSelector.js +3 -1
  55. package/base/ui/LocaleSelector.js.map +1 -1
  56. package/base/ui/LoginScreen.d.ts +5 -2
  57. package/base/ui/LoginScreen.js +3 -1
  58. package/base/ui/LoginScreen.js.map +1 -1
  59. package/base/ui/Logo.d.ts +9 -3
  60. package/base/ui/Logo.js +3 -1
  61. package/base/ui/Logo.js.map +1 -1
  62. package/base/ui/Menu.d.ts +6 -1
  63. package/base/ui/Menu.js +4 -3
  64. package/base/ui/Menu.js.map +1 -1
  65. package/base/ui/Navigation.d.ts +18 -6
  66. package/base/ui/Navigation.js +9 -5
  67. package/base/ui/Navigation.js.map +1 -1
  68. package/base/ui/NotFound.d.ts +9 -2
  69. package/base/ui/NotFound.js +3 -1
  70. package/base/ui/NotFound.js.map +1 -1
  71. package/base/ui/Search.d.ts +15 -4
  72. package/base/ui/Search.js +3 -1
  73. package/base/ui/Search.js.map +1 -1
  74. package/base/ui/Tags.d.ts +1 -1
  75. package/base/ui/Tags.js +7 -2
  76. package/base/ui/Tags.js.map +1 -1
  77. package/base/ui/UserMenu.d.ts +35 -9
  78. package/base/ui/UserMenu.js +3 -1
  79. package/base/ui/UserMenu.js.map +1 -1
  80. package/components/AdminLayout.d.ts +2 -1
  81. package/components/AdminLayout.js +3 -1
  82. package/components/AdminLayout.js.map +1 -1
  83. package/components/AppInstaller/AppInstaller.d.ts +5 -1
  84. package/components/AppInstaller/AppInstaller.js +11 -37
  85. package/components/AppInstaller/AppInstaller.js.map +1 -1
  86. package/components/AppInstaller/Sidebar.d.ts +2 -2
  87. package/components/AppInstaller/Sidebar.js +5 -13
  88. package/components/AppInstaller/Sidebar.js.map +1 -1
  89. package/components/AppInstaller/index.js +3 -1
  90. package/components/AppInstaller/index.js.map +1 -1
  91. package/components/AppInstaller/styled.d.ts +16 -6
  92. package/components/AppInstaller/styled.js +3 -1
  93. package/components/AppInstaller/styled.js.map +1 -1
  94. package/components/AppInstaller/useInstaller.d.ts +1 -7
  95. package/components/AppInstaller/useInstaller.js +38 -123
  96. package/components/AppInstaller/useInstaller.js.map +1 -1
  97. package/components/BulkActions/Worker.d.ts +81 -0
  98. package/components/BulkActions/Worker.js +172 -0
  99. package/components/BulkActions/Worker.js.map +1 -0
  100. package/components/BulkActions/index.d.ts +2 -0
  101. package/components/BulkActions/index.js +29 -0
  102. package/components/BulkActions/index.js.map +1 -0
  103. package/components/BulkActions/useDialogWithReport/DialogMessage.d.ts +5 -0
  104. package/components/BulkActions/useDialogWithReport/DialogMessage.js +31 -0
  105. package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -0
  106. package/components/BulkActions/useDialogWithReport/index.d.ts +1 -0
  107. package/components/BulkActions/useDialogWithReport/index.js +18 -0
  108. package/components/BulkActions/useDialogWithReport/index.js.map +1 -0
  109. package/components/BulkActions/useDialogWithReport/useDialogWithReport.d.ts +17 -0
  110. package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +79 -0
  111. package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -0
  112. package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.d.ts +20 -0
  113. package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js +28 -0
  114. package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js.map +1 -0
  115. package/components/Buttons/Buttons.d.ts +23 -0
  116. package/components/Buttons/Buttons.js +78 -0
  117. package/components/Buttons/Buttons.js.map +1 -0
  118. package/components/Buttons/Buttons.styles.d.ts +5 -0
  119. package/components/Buttons/Buttons.styles.js +15 -0
  120. package/components/Buttons/Buttons.styles.js.map +1 -0
  121. package/components/Buttons/index.d.ts +2 -0
  122. package/components/Buttons/index.js +27 -0
  123. package/components/Buttons/index.js.map +1 -0
  124. package/components/Buttons/useButtons.d.ts +14 -0
  125. package/components/Buttons/useButtons.js +32 -0
  126. package/components/Buttons/useButtons.js.map +1 -0
  127. package/components/EmptyView.d.ts +2 -2
  128. package/components/EmptyView.js +4 -2
  129. package/components/EmptyView.js.map +1 -1
  130. package/components/Filters/Filters.d.ts +16 -0
  131. package/components/Filters/Filters.js +30 -0
  132. package/components/Filters/Filters.js.map +1 -0
  133. package/components/Filters/Filters.styled.d.ts +13 -0
  134. package/components/Filters/Filters.styled.js +25 -0
  135. package/components/Filters/Filters.styled.js.map +1 -0
  136. package/components/Filters/index.d.ts +1 -0
  137. package/components/Filters/index.js +18 -0
  138. package/components/Filters/index.js.map +1 -0
  139. package/components/FloatingActionButton.d.ts +4 -1
  140. package/components/FloatingActionButton.js +5 -3
  141. package/components/FloatingActionButton.js.map +1 -1
  142. package/components/LexicalEditor/LexicalEditor.d.ts +8 -0
  143. package/components/LexicalEditor/LexicalEditor.js +30 -0
  144. package/components/LexicalEditor/LexicalEditor.js.map +1 -0
  145. package/components/LexicalEditor/index.d.ts +1 -0
  146. package/components/LexicalEditor/index.js +14 -0
  147. package/components/LexicalEditor/index.js.map +1 -0
  148. package/components/MultiImageUpload.d.ts +2 -2
  149. package/components/MultiImageUpload.js +9 -3
  150. package/components/MultiImageUpload.js.map +1 -1
  151. package/components/OptionsMenu/OptionsMenu.d.ts +9 -0
  152. package/components/OptionsMenu/OptionsMenu.js +30 -0
  153. package/components/OptionsMenu/OptionsMenu.js.map +1 -0
  154. package/components/OptionsMenu/OptionsMenu.styled.d.ts +34 -0
  155. package/components/OptionsMenu/OptionsMenu.styled.js +16 -0
  156. package/components/OptionsMenu/OptionsMenu.styled.js.map +1 -0
  157. package/components/OptionsMenu/OptionsMenuItem.d.ts +9 -0
  158. package/components/OptionsMenu/OptionsMenuItem.js +23 -0
  159. package/components/OptionsMenu/OptionsMenuItem.js.map +1 -0
  160. package/components/OptionsMenu/OptionsMenuLink.d.ts +10 -0
  161. package/components/OptionsMenu/OptionsMenuLink.js +41 -0
  162. package/components/OptionsMenu/OptionsMenuLink.js.map +1 -0
  163. package/components/OptionsMenu/index.d.ts +4 -0
  164. package/components/OptionsMenu/index.js +53 -0
  165. package/components/OptionsMenu/index.js.map +1 -0
  166. package/components/OptionsMenu/useOptionsMenuItem.d.ts +13 -0
  167. package/components/OptionsMenu/useOptionsMenuItem.js +31 -0
  168. package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -0
  169. package/components/OverlayLayout/OverlayLayout.d.ts +0 -1
  170. package/components/OverlayLayout/OverlayLayout.js +5 -3
  171. package/components/OverlayLayout/OverlayLayout.js.map +1 -1
  172. package/components/OverlayLayout/index.js +3 -1
  173. package/components/OverlayLayout/index.js.map +1 -1
  174. package/components/Permissions/CannotUseAaclAlert.d.ts +2 -0
  175. package/components/Permissions/CannotUseAaclAlert.js +22 -0
  176. package/components/Permissions/CannotUseAaclAlert.js.map +1 -0
  177. package/components/Permissions/Permissions.d.ts +2 -2
  178. package/components/Permissions/Permissions.js +3 -1
  179. package/components/Permissions/Permissions.js.map +1 -1
  180. package/components/Permissions/StyledComponents.d.ts +2 -2
  181. package/components/Permissions/StyledComponents.js +3 -1
  182. package/components/Permissions/StyledComponents.js.map +1 -1
  183. package/components/Permissions/index.d.ts +1 -0
  184. package/components/Permissions/index.js +12 -2
  185. package/components/Permissions/index.js.map +1 -1
  186. package/components/RichTextEditor/RichTextEditor.d.ts +2 -2
  187. package/components/RichTextEditor/RichTextEditor.js +3 -1
  188. package/components/RichTextEditor/RichTextEditor.js.map +1 -1
  189. package/components/RichTextEditor/index.js +3 -1
  190. package/components/RichTextEditor/index.js.map +1 -1
  191. package/components/RichTextEditor/tools/header/index.d.ts +0 -2
  192. package/components/RichTextEditor/tools/header/index.js +3 -11
  193. package/components/RichTextEditor/tools/header/index.js.map +1 -1
  194. package/components/RichTextEditor/tools/image/index.d.ts +0 -2
  195. package/components/RichTextEditor/tools/image/index.js +3 -8
  196. package/components/RichTextEditor/tools/image/index.js.map +1 -1
  197. package/components/RichTextEditor/tools/image/svgs.js +3 -1
  198. package/components/RichTextEditor/tools/image/svgs.js.map +1 -1
  199. package/components/RichTextEditor/tools/image/tunes.d.ts +0 -2
  200. package/components/RichTextEditor/tools/image/tunes.js +3 -6
  201. package/components/RichTextEditor/tools/image/tunes.js.map +1 -1
  202. package/components/RichTextEditor/tools/image/types.js +3 -1
  203. package/components/RichTextEditor/tools/image/ui.d.ts +0 -2
  204. package/components/RichTextEditor/tools/image/ui.js +15 -14
  205. package/components/RichTextEditor/tools/image/ui.js.map +1 -1
  206. package/components/RichTextEditor/tools/paragraph/index.d.ts +0 -2
  207. package/components/RichTextEditor/tools/paragraph/index.js +13 -12
  208. package/components/RichTextEditor/tools/paragraph/index.js.map +1 -1
  209. package/components/RichTextEditor/tools/textColor/index.d.ts +0 -3
  210. package/components/RichTextEditor/tools/textColor/index.js +3 -11
  211. package/components/RichTextEditor/tools/textColor/index.js.map +1 -1
  212. package/components/RichTextEditor/tools/utils.js +7 -5
  213. package/components/RichTextEditor/tools/utils.js.map +1 -1
  214. package/components/Routes.d.ts +2 -2
  215. package/components/Routes.js +3 -1
  216. package/components/Routes.js.map +1 -1
  217. package/components/SearchUI.d.ts +2 -2
  218. package/components/SearchUI.js +5 -3
  219. package/components/SearchUI.js.map +1 -1
  220. package/components/SimpleForm/SimpleForm.d.ts +9 -5
  221. package/components/SimpleForm/SimpleForm.js +5 -2
  222. package/components/SimpleForm/SimpleForm.js.map +1 -1
  223. package/components/SimpleForm/index.js +3 -1
  224. package/components/SimpleForm/index.js.map +1 -1
  225. package/components/SimpleUI/InputField.d.ts +1 -2
  226. package/components/SimpleUI/InputField.js +3 -1
  227. package/components/SimpleUI/InputField.js.map +1 -1
  228. package/components/SingleImageUpload.d.ts +2 -2
  229. package/components/SingleImageUpload.js +5 -3
  230. package/components/SingleImageUpload.js.map +1 -1
  231. package/components/SplitView/SplitView.d.ts +3 -3
  232. package/components/SplitView/SplitView.js +8 -5
  233. package/components/SplitView/SplitView.js.map +1 -1
  234. package/components/SplitView/index.js +3 -1
  235. package/components/SplitView/index.js.map +1 -1
  236. package/components/Wcp.d.ts +9 -0
  237. package/components/Wcp.js +20 -0
  238. package/components/Wcp.js.map +1 -0
  239. package/components/index.d.ts +1 -1
  240. package/components/index.js +3 -1
  241. package/components/index.js.map +1 -1
  242. package/hooks/index.d.ts +7 -0
  243. package/hooks/index.js +84 -0
  244. package/hooks/index.js.map +1 -0
  245. package/hooks/useConfirmationDialog.d.ts +5 -3
  246. package/hooks/useConfirmationDialog.js +15 -7
  247. package/hooks/useConfirmationDialog.js.map +1 -1
  248. package/hooks/useDialog.js +5 -1
  249. package/hooks/useDialog.js.map +1 -1
  250. package/hooks/useIsMounted.d.ts +3 -0
  251. package/hooks/useIsMounted.js +24 -0
  252. package/hooks/useIsMounted.js.map +1 -0
  253. package/hooks/useKeyHandler.d.ts +8 -0
  254. package/hooks/useKeyHandler.js +82 -0
  255. package/hooks/useKeyHandler.js.map +1 -0
  256. package/hooks/useModKey.d.ts +1 -0
  257. package/hooks/useModKey.js +41 -0
  258. package/hooks/useModKey.js.map +1 -0
  259. package/hooks/useShiftKey.d.ts +1 -0
  260. package/hooks/useShiftKey.js +46 -0
  261. package/hooks/useShiftKey.js.map +1 -0
  262. package/hooks/useSnackbar.js +3 -1
  263. package/hooks/useSnackbar.js.map +1 -1
  264. package/index.d.ts +11 -6
  265. package/index.js +79 -26
  266. package/index.js.map +1 -1
  267. package/package.json +38 -44
  268. package/plugins/MenuPlugin.js +3 -3
  269. package/plugins/MenuPlugin.js.map +1 -1
  270. package/plugins/PermissionRendererPlugin.js +3 -3
  271. package/plugins/PermissionRendererPlugin.js.map +1 -1
  272. package/plugins/globalSearch/SearchBar.d.ts +5 -1
  273. package/plugins/globalSearch/SearchBar.js +18 -14
  274. package/plugins/globalSearch/SearchBar.js.map +1 -1
  275. package/plugins/globalSearch/SearchBarDropdown.js +5 -3
  276. package/plugins/globalSearch/SearchBarDropdown.js.map +1 -1
  277. package/plugins/globalSearch/index.d.ts +0 -1
  278. package/plugins/globalSearch/index.js +3 -1
  279. package/plugins/globalSearch/index.js.map +1 -1
  280. package/plugins/globalSearch/styled.d.ts +12 -5
  281. package/plugins/globalSearch/styled.js +3 -4
  282. package/plugins/globalSearch/styled.js.map +1 -1
  283. package/plugins/uiLayoutRenderer/index.js +3 -1
  284. package/plugins/uiLayoutRenderer/index.js.map +1 -1
  285. package/styles/material-theme-assignments.scss +1 -1
  286. package/types.d.ts +47 -28
  287. package/types.js +3 -1
  288. package/types.js.map +1 -1
  289. package/ui/UIElement.js +3 -1
  290. package/ui/UIElement.js.map +1 -1
  291. package/ui/UILayout.js +3 -1
  292. package/ui/UILayout.js.map +1 -1
  293. package/ui/UIRenderer.js +3 -1
  294. package/ui/UIRenderer.js.map +1 -1
  295. package/ui/UIView.js +3 -1
  296. package/ui/UIView.js.map +1 -1
  297. package/ui/elements/AccordionElement.js +4 -2
  298. package/ui/elements/AccordionElement.js.map +1 -1
  299. package/ui/elements/ButtonElement.js +6 -4
  300. package/ui/elements/ButtonElement.js.map +1 -1
  301. package/ui/elements/ButtonGroupElement.js +3 -1
  302. package/ui/elements/ButtonGroupElement.js.map +1 -1
  303. package/ui/elements/GenericElement.js +3 -1
  304. package/ui/elements/GenericElement.js.map +1 -1
  305. package/ui/elements/LabelElement.js +3 -1
  306. package/ui/elements/LabelElement.js.map +1 -1
  307. package/ui/elements/NavigationMenuElement.d.ts +1 -1
  308. package/ui/elements/NavigationMenuElement.js +7 -5
  309. package/ui/elements/NavigationMenuElement.js.map +1 -1
  310. package/ui/elements/PanelElement.js +3 -1
  311. package/ui/elements/PanelElement.js.map +1 -1
  312. package/ui/elements/PlaceholderElement.js +3 -1
  313. package/ui/elements/PlaceholderElement.js.map +1 -1
  314. package/ui/elements/SmallButtonElement.js +3 -1
  315. package/ui/elements/SmallButtonElement.js.map +1 -1
  316. package/ui/elements/TypographyElement.js +3 -1
  317. package/ui/elements/TypographyElement.js.map +1 -1
  318. package/ui/elements/ViewElement.js +3 -1
  319. package/ui/elements/ViewElement.js.map +1 -1
  320. package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +3 -1
  321. package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +1 -1
  322. package/ui/elements/form/DynamicFieldsetElement.js +3 -1
  323. package/ui/elements/form/DynamicFieldsetElement.js.map +1 -1
  324. package/ui/elements/form/FileManagerElement/EmptyStateElement.js +3 -1
  325. package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +1 -1
  326. package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +8 -6
  327. package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +1 -1
  328. package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +4 -2
  329. package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +1 -1
  330. package/ui/elements/form/FileManagerElement/styled.d.ts +22 -17
  331. package/ui/elements/form/FileManagerElement/styled.js +3 -1
  332. package/ui/elements/form/FileManagerElement/styled.js.map +1 -1
  333. package/ui/elements/form/FileManagerElement.js +3 -4
  334. package/ui/elements/form/FileManagerElement.js.map +1 -1
  335. package/ui/elements/form/FormElement.js +3 -1
  336. package/ui/elements/form/FormElement.js.map +1 -1
  337. package/ui/elements/form/FormFieldElement.js +4 -2
  338. package/ui/elements/form/FormFieldElement.js.map +1 -1
  339. package/ui/elements/form/HiddenElement.js +3 -1
  340. package/ui/elements/form/HiddenElement.js.map +1 -1
  341. package/ui/elements/form/InputElement.js +3 -1
  342. package/ui/elements/form/InputElement.js.map +1 -1
  343. package/ui/elements/form/PasswordElement.js +3 -1
  344. package/ui/elements/form/PasswordElement.js.map +1 -1
  345. package/ui/elements/form/SelectElement.js +3 -1
  346. package/ui/elements/form/SelectElement.js.map +1 -1
  347. package/ui/elements/form/TextareaElement.js +3 -1
  348. package/ui/elements/form/TextareaElement.js.map +1 -1
  349. package/ui/views/AdminView/ContentElement.js +3 -1
  350. package/ui/views/AdminView/ContentElement.js.map +1 -1
  351. package/ui/views/AdminView/HeaderElement.js +6 -4
  352. package/ui/views/AdminView/HeaderElement.js.map +1 -1
  353. package/ui/views/AdminView/HeaderSectionCenterElement.js +3 -1
  354. package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -1
  355. package/ui/views/AdminView/HeaderSectionLeftElement.js +3 -1
  356. package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -1
  357. package/ui/views/AdminView/HeaderSectionRightElement.js +3 -1
  358. package/ui/views/AdminView/HeaderSectionRightElement.js.map +1 -1
  359. package/ui/views/AdminView/components/Dialog.d.ts +2 -2
  360. package/ui/views/AdminView/components/Dialog.js +12 -10
  361. package/ui/views/AdminView/components/Dialog.js.map +1 -1
  362. package/ui/views/AdminView/components/Hamburger.d.ts +2 -2
  363. package/ui/views/AdminView/components/Hamburger.js +5 -3
  364. package/ui/views/AdminView/components/Hamburger.js.map +1 -1
  365. package/ui/views/AdminView/components/Snackbar.d.ts +2 -2
  366. package/ui/views/AdminView/components/Snackbar.js +6 -4
  367. package/ui/views/AdminView/components/Snackbar.js.map +1 -1
  368. package/ui/views/FormView/FormContainerElement.js +3 -1
  369. package/ui/views/FormView/FormContainerElement.js.map +1 -1
  370. package/ui/views/FormView/FormContentElement.js +3 -1
  371. package/ui/views/FormView/FormContentElement.js.map +1 -1
  372. package/ui/views/FormView/FormFooterElement.js +3 -1
  373. package/ui/views/FormView/FormFooterElement.js.map +1 -1
  374. package/ui/views/FormView/FormHeaderElement.js +3 -1
  375. package/ui/views/FormView/FormHeaderElement.js.map +1 -1
  376. package/ui/views/FormView.js +3 -1
  377. package/ui/views/FormView.js.map +1 -1
  378. package/ui/views/OverlayView/ContentElement.js +3 -1
  379. package/ui/views/OverlayView/ContentElement.js.map +1 -1
  380. package/ui/views/OverlayView/HeaderElement.js +4 -3
  381. package/ui/views/OverlayView/HeaderElement.js.map +1 -1
  382. package/ui/views/OverlayView/HeaderTitleElement.js +3 -1
  383. package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -1
  384. package/ui/views/OverlayView/useOverlayView.js +3 -1
  385. package/ui/views/OverlayView/useOverlayView.js.map +1 -1
  386. package/ui/views/OverlayView.js +8 -8
  387. package/ui/views/OverlayView.js.map +1 -1
  388. package/ui/views/SplitView/SplitViewPanelElement.js +3 -1
  389. package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -1
  390. package/ui/views/SplitView.js +3 -3
  391. package/ui/views/SplitView.js.map +1 -1
  392. package/assets/images/icons.png +0 -0
  393. package/assets/images/icons_retina.png +0 -0
  394. package/assets/images/swich.png +0 -0
  395. package/components/FileManager/BottomInfoBar/SupportedFileTypes.d.ts +0 -6
  396. package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +0 -41
  397. package/components/FileManager/BottomInfoBar/SupportedFileTypes.js.map +0 -1
  398. package/components/FileManager/BottomInfoBar/UploadStatus.d.ts +0 -6
  399. package/components/FileManager/BottomInfoBar/UploadStatus.js +0 -51
  400. package/components/FileManager/BottomInfoBar/UploadStatus.js.map +0 -1
  401. package/components/FileManager/BottomInfoBar.d.ts +0 -5
  402. package/components/FileManager/BottomInfoBar.js +0 -48
  403. package/components/FileManager/BottomInfoBar.js.map +0 -1
  404. package/components/FileManager/DropFilesHere.d.ts +0 -10
  405. package/components/FileManager/DropFilesHere.js +0 -67
  406. package/components/FileManager/DropFilesHere.js.map +0 -1
  407. package/components/FileManager/File.d.ts +0 -17
  408. package/components/FileManager/File.js +0 -142
  409. package/components/FileManager/File.js.map +0 -1
  410. package/components/FileManager/FileDetails/Name.d.ts +0 -8
  411. package/components/FileManager/FileDetails/Name.js +0 -108
  412. package/components/FileManager/FileDetails/Name.js.map +0 -1
  413. package/components/FileManager/FileDetails/Tags.d.ts +0 -10
  414. package/components/FileManager/FileDetails/Tags.js +0 -286
  415. package/components/FileManager/FileDetails/Tags.js.map +0 -1
  416. package/components/FileManager/FileDetails.d.ts +0 -24
  417. package/components/FileManager/FileDetails.js +0 -407
  418. package/components/FileManager/FileDetails.js.map +0 -1
  419. package/components/FileManager/FileManagerContext.d.ts +0 -42
  420. package/components/FileManager/FileManagerContext.js +0 -191
  421. package/components/FileManager/FileManagerContext.js.map +0 -1
  422. package/components/FileManager/FileManagerView.d.ts +0 -18
  423. package/components/FileManager/FileManagerView.js +0 -611
  424. package/components/FileManager/FileManagerView.js.map +0 -1
  425. package/components/FileManager/LeftSidebar.d.ts +0 -10
  426. package/components/FileManager/LeftSidebar.js +0 -108
  427. package/components/FileManager/LeftSidebar.js.map +0 -1
  428. package/components/FileManager/NoPermissionView.d.ts +0 -3
  429. package/components/FileManager/NoPermissionView.js +0 -74
  430. package/components/FileManager/NoPermissionView.js.map +0 -1
  431. package/components/FileManager/NoResults.d.ts +0 -3
  432. package/components/FileManager/NoResults.js +0 -22
  433. package/components/FileManager/NoResults.js.map +0 -1
  434. package/components/FileManager/getFileTypePlugin.d.ts +0 -4
  435. package/components/FileManager/getFileTypePlugin.js +0 -51
  436. package/components/FileManager/getFileTypePlugin.js.map +0 -1
  437. package/components/FileManager/getFileUploader.d.ts +0 -3
  438. package/components/FileManager/getFileUploader.js +0 -15
  439. package/components/FileManager/getFileUploader.js.map +0 -1
  440. package/components/FileManager/graphql.d.ts +0 -96
  441. package/components/FileManager/graphql.js +0 -47
  442. package/components/FileManager/graphql.js.map +0 -1
  443. package/components/FileManager/icons/content_copy-black-24px.svg +0 -1
  444. package/components/FileManager/icons/delete.svg +0 -12
  445. package/components/FileManager/icons/privacy_tip-24px.svg +0 -10
  446. package/components/FileManager/icons/round-check_box-24px.svg +0 -4
  447. package/components/FileManager/icons/round-check_box_outline_blank-24px.svg +0 -4
  448. package/components/FileManager/icons/round-cloud_download-24px.svg +0 -4
  449. package/components/FileManager/icons/round-cloud_upload-24px.svg +0 -4
  450. package/components/FileManager/icons/round-description-24px.svg +0 -4
  451. package/components/FileManager/icons/round-edit-24px.svg +0 -4
  452. package/components/FileManager/icons/round-info-24px.svg +0 -4
  453. package/components/FileManager/icons/round-label-24px.svg +0 -4
  454. package/components/FileManager/icons/round-more_vert-24px.svg +0 -4
  455. package/components/FileManager/icons/round-search-24px.svg +0 -20
  456. package/components/FileManager/outputFileSelectionError.d.ts +0 -7
  457. package/components/FileManager/outputFileSelectionError.js +0 -40
  458. package/components/FileManager/outputFileSelectionError.js.map +0 -1
  459. package/components/FileManager/types.d.ts +0 -21
  460. package/components/FileManager/types.js +0 -5
  461. package/components/FileManager/types.js.map +0 -1
  462. package/components/FileManager.js +0 -118
  463. package/components/FileManager.js.map +0 -1
  464. package/plugins/FileManagerFileTypePlugin.d.ts +0 -33
  465. package/plugins/FileManagerFileTypePlugin.js +0 -48
  466. package/plugins/FileManagerFileTypePlugin.js.map +0 -1
  467. package/plugins/fileManager/fileDefault.d.ts +0 -2
  468. package/plugins/fileManager/fileDefault.js +0 -28
  469. package/plugins/fileManager/fileDefault.js.map +0 -1
  470. package/plugins/fileManager/fileImage/DeleteAction.d.ts +0 -7
  471. package/plugins/fileManager/fileImage/DeleteAction.js +0 -59
  472. package/plugins/fileManager/fileImage/DeleteAction.js.map +0 -1
  473. package/plugins/fileManager/fileImage/EditAction.d.ts +0 -10
  474. package/plugins/fileManager/fileImage/EditAction.js +0 -143
  475. package/plugins/fileManager/fileImage/EditAction.js.map +0 -1
  476. package/plugins/fileManager/fileImage/index.d.ts +0 -2
  477. package/plugins/fileManager/fileImage/index.js +0 -38
  478. package/plugins/fileManager/fileImage/index.js.map +0 -1
  479. package/plugins/fileManager/icons/edit.svg +0 -17
  480. package/plugins/fileManager/icons/round-description-24px.svg +0 -1
  481. package/plugins/fileManager/index.d.ts +0 -2
  482. package/plugins/fileManager/index.js +0 -19
  483. package/plugins/fileManager/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["Dashboard","makeComposable","DashboardRenderer"],"sources":["Dashboard.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\n\nexport const Dashboard = makeComposable(\"Dashboard\", () => {\n return <DashboardRenderer />;\n});\n\nexport const DashboardRenderer = makeComposable(\"DashboardRenderer\");\n"],"mappings":";;;;;;;AAAA;AACA;AAEO,IAAMA,SAAS,GAAG,IAAAC,mBAAc,EAAC,WAAW,EAAE,YAAM;EACvD,oBAAO,6BAAC,iBAAiB,OAAG;AAChC,CAAC,CAAC;AAAC;AAEI,IAAMC,iBAAiB,GAAG,IAAAD,mBAAc,EAAC,mBAAmB,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_app","Dashboard","makeComposable","default","createElement","DashboardRenderer","exports"],"sources":["Dashboard.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\n\nexport const Dashboard = makeComposable(\"Dashboard\", () => {\n return <DashboardRenderer />;\n});\n\nexport const DashboardRenderer = makeComposable(\"DashboardRenderer\");\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEO,IAAME,SAAS,GAAG,IAAAC,mBAAc,EAAC,WAAW,EAAE,YAAM;EACvD,oBAAOL,MAAA,CAAAM,OAAA,CAAAC,aAAA,CAACC,iBAAiB,MAAE,CAAC;AAChC,CAAC,CAAC;AAACC,OAAA,CAAAL,SAAA,GAAAA,SAAA;AAEI,IAAMI,iBAAiB,GAAG,IAAAH,mBAAc,EAAC,mBAAmB,CAAC;AAACI,OAAA,CAAAD,iBAAA,GAAAA,iBAAA"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- interface OnChange<T> {
2
+ export interface FileManagerOnChange<T> {
3
3
  (value: T): void;
4
4
  }
5
5
  /**
@@ -18,10 +18,10 @@ export interface FileManagerFileItemMetaItem {
18
18
  value: any;
19
19
  }
20
20
  export declare type DeprecatedFileManagerRenderPropParams = {
21
- showFileManager: (onChange?: OnChange<FileManagerFileItem | FileManagerFileItem[]>) => void;
21
+ showFileManager: (onChange?: FileManagerOnChange<FileManagerFileItem | FileManagerFileItem[]>) => void;
22
22
  };
23
23
  export declare type FileManagerRenderPropParams<TValue> = {
24
- showFileManager: (onChange?: OnChange<TValue>) => void;
24
+ showFileManager: (onChange?: FileManagerOnChange<TValue>) => void;
25
25
  };
26
26
  interface SingleFileRenderProp {
27
27
  (params: FileManagerRenderPropParams<FileManagerFileItem>): React.ReactNode;
@@ -33,28 +33,29 @@ export declare type MultipleProps = {
33
33
  multiple?: never;
34
34
  multipleMaxCount?: never;
35
35
  multipleMaxSize?: never;
36
- onChange?: OnChange<FileManagerFileItem>;
36
+ onChange?: FileManagerOnChange<FileManagerFileItem>;
37
37
  render?: SingleFileRenderProp;
38
38
  } | {
39
39
  multiple: true;
40
40
  multipleMaxCount?: number;
41
41
  multipleMaxSize?: number | string;
42
- onChange?: OnChange<FileManagerFileItem[]>;
42
+ onChange?: FileManagerOnChange<FileManagerFileItem[]>;
43
43
  render?: MultiFileRenderProp;
44
44
  };
45
45
  export declare type FileManagerProps = {
46
- accept?: Array<string>;
46
+ accept?: string[];
47
47
  images?: boolean;
48
48
  maxSize?: number | string;
49
49
  /**
50
50
  * @deprecated This prop is no longer used. The file structure was reduced to a bare minimum so picking is no longer necessary.
51
51
  */
52
52
  onChangePick?: string[];
53
- onClose?: Function;
53
+ onClose?: () => void;
54
54
  onUploadCompletion?: (files: FileManagerFileItem[]) => void;
55
55
  own?: boolean;
56
56
  scope?: string;
57
- tags?: Array<string>;
57
+ tags?: string[];
58
+ show?: boolean;
58
59
  /**
59
60
  * @deprecated This prop is no longer used. Use the `render` prop to get better TS autocomplete.
60
61
  */
@@ -62,6 +63,9 @@ export declare type FileManagerProps = {
62
63
  } & MultipleProps;
63
64
  declare type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
64
65
  export declare type FileManagerRendererProps = DistributiveOmit<FileManagerProps, "render" | "children">;
65
- export declare const FileManagerRenderer: import("@webiny/react-composition").ComposableFC<FileManagerRendererProps>;
66
- export declare const FileManager: React.FC<FileManagerProps>;
66
+ export declare const FileManagerRenderer: React.FunctionComponent<FileManagerRendererProps> & {
67
+ original: React.ComponentType<FileManagerRendererProps>;
68
+ originalName: string;
69
+ };
70
+ export declare const FileManager: ({ children, render, onChange, ...rest }: FileManagerProps) => JSX.Element;
67
71
  export {};
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.FileManagerRenderer = exports.FileManager = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _reactDom = _interopRequireDefault(require("react-dom"));
13
+ var _reactComposition = require("@webiny/react-composition");
14
+ var _excluded = ["children", "render", "onChange"];
15
+ /**
16
+ * Represents a file object managed by the File Manager.
17
+ */
18
+
19
+ /**
20
+ * With this we allow developers to add any value to file's meta via component composition, thus the `value: any`.
21
+ */
22
+
23
+ function getPortalTarget() {
24
+ var target = window.document.getElementById("file-manager-container");
25
+ if (!target) {
26
+ target = document.createElement("div");
27
+ target.setAttribute("id", "file-manager-container");
28
+ document.body && document.body.appendChild(target);
29
+ }
30
+ return target;
31
+ }
32
+
33
+ // This jewel was taken from https://davidgomes.com/pick-omit-over-union-types-in-typescript/. Massive thanks, David!
34
+
35
+ var FileManagerRenderer = (0, _reactComposition.makeComposable)("FileManagerRenderer");
36
+ exports.FileManagerRenderer = FileManagerRenderer;
37
+ var FileManager = function FileManager(_ref) {
38
+ var children = _ref.children,
39
+ render = _ref.render,
40
+ onChange = _ref.onChange,
41
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
42
+ var containerRef = (0, _react.useRef)(getPortalTarget());
43
+ var _useState = (0, _react.useState)(rest.show ?? false),
44
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
45
+ show = _useState2[0],
46
+ setShow = _useState2[1];
47
+ var onChangeRef = (0, _react.useRef)(onChange);
48
+ (0, _react.useEffect)(function () {
49
+ onChangeRef.current = onChange;
50
+ }, [onChange]);
51
+ var showFileManager = (0, _react.useCallback)(function (onChange) {
52
+ if (typeof onChange === "function") {
53
+ onChangeRef.current = onChange;
54
+ }
55
+ setShow(true);
56
+ }, []);
57
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, show && /*#__PURE__*/_reactDom.default.createPortal(
58
+ /*#__PURE__*/
59
+ /**
60
+ * TODO @pavel
61
+ */
62
+ // @ts-expect-error
63
+ _react.default.createElement(FileManagerRenderer, Object.assign({
64
+ onClose: function onClose() {
65
+ return setShow(false);
66
+ },
67
+ onChange: /* TODO: figure out how to create a conditional type based on the value of `rest.multiple` */
68
+ onChangeRef.current
69
+ }, rest)), containerRef.current), children ? children({
70
+ showFileManager: showFileManager
71
+ }) : render ? render({
72
+ showFileManager: showFileManager
73
+ }) : null);
74
+ };
75
+ exports.FileManager = FileManager;
76
+
77
+ //# sourceMappingURL=FileManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactDom","_interopRequireDefault","_reactComposition","_excluded","getPortalTarget","target","window","document","getElementById","createElement","setAttribute","body","appendChild","FileManagerRenderer","makeComposable","exports","FileManager","_ref","children","render","onChange","rest","_objectWithoutProperties2","default","containerRef","useRef","_useState","useState","show","_useState2","_slicedToArray2","setShow","onChangeRef","useEffect","current","showFileManager","useCallback","Fragment","ReactDOM","createPortal","Object","assign","onClose"],"sources":["FileManager.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { makeComposable } from \"@webiny/react-composition\";\n\nexport interface FileManagerOnChange<T> {\n (value: T): void;\n}\n\n/**\n * Represents a file object managed by the File Manager.\n */\nexport interface FileManagerFileItem {\n id: string;\n src: string;\n meta?: Array<FileManagerFileItemMetaItem>;\n}\n\n/**\n * With this we allow developers to add any value to file's meta via component composition, thus the `value: any`.\n */\nexport interface FileManagerFileItemMetaItem {\n key: string;\n value: any;\n}\n\nexport type DeprecatedFileManagerRenderPropParams = {\n showFileManager: (\n onChange?: FileManagerOnChange<FileManagerFileItem | FileManagerFileItem[]>\n ) => void;\n};\n\nexport type FileManagerRenderPropParams<TValue> = {\n showFileManager: (onChange?: FileManagerOnChange<TValue>) => void;\n};\n\ninterface SingleFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem>): React.ReactNode;\n}\n\ninterface MultiFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem[]>): React.ReactNode;\n}\n\nexport type MultipleProps =\n | {\n multiple?: never;\n multipleMaxCount?: never;\n multipleMaxSize?: never;\n onChange?: FileManagerOnChange<FileManagerFileItem>;\n render?: SingleFileRenderProp;\n }\n | {\n multiple: true;\n multipleMaxCount?: number;\n multipleMaxSize?: number | string;\n onChange?: FileManagerOnChange<FileManagerFileItem[]>;\n render?: MultiFileRenderProp;\n };\n\nexport type FileManagerProps = {\n accept?: string[];\n images?: boolean;\n maxSize?: number | string;\n /**\n * @deprecated This prop is no longer used. The file structure was reduced to a bare minimum so picking is no longer necessary.\n */\n onChangePick?: string[];\n onClose?: () => void;\n onUploadCompletion?: (files: FileManagerFileItem[]) => void;\n own?: boolean;\n scope?: string;\n tags?: string[];\n show?: boolean;\n /**\n * @deprecated This prop is no longer used. Use the `render` prop to get better TS autocomplete.\n */\n children?: (params: DeprecatedFileManagerRenderPropParams) => React.ReactNode;\n} & MultipleProps;\n\nfunction getPortalTarget() {\n let target = window.document.getElementById(\"file-manager-container\");\n if (!target) {\n target = document.createElement(\"div\");\n target.setAttribute(\"id\", \"file-manager-container\");\n document.body && document.body.appendChild(target);\n }\n return target;\n}\n\n// This jewel was taken from https://davidgomes.com/pick-omit-over-union-types-in-typescript/. Massive thanks, David!\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;\n\nexport type FileManagerRendererProps = DistributiveOmit<FileManagerProps, \"render\" | \"children\">;\n\nexport const FileManagerRenderer = makeComposable<FileManagerRendererProps>(\"FileManagerRenderer\");\n\nexport const FileManager = ({ children, render, onChange, ...rest }: FileManagerProps) => {\n const containerRef = useRef<HTMLElement>(getPortalTarget());\n const [show, setShow] = useState(rest.show ?? false);\n const onChangeRef = useRef(onChange);\n\n useEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n const showFileManager = useCallback(onChange => {\n if (typeof onChange === \"function\") {\n onChangeRef.current = onChange;\n }\n setShow(true);\n }, []);\n\n return (\n <>\n {show &&\n ReactDOM.createPortal(\n /**\n * TODO @pavel\n */\n // @ts-expect-error\n <FileManagerRenderer\n onClose={() => setShow(false)}\n onChange={\n /* TODO: figure out how to create a conditional type based on the value of `rest.multiple` */\n onChangeRef.current\n }\n {...rest}\n />,\n containerRef.current\n )}\n {children ? children({ showFileManager }) : render ? render({ showFileManager }) : null}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAA2D,IAAAI,SAAA;A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,GAAG,IAAAC,kBAAW,EAAC,UAAAhB,QAAQ,EAAI;IAC5C,IAAI,OAAOA,QAAQ,KAAK,UAAU,EAAE;MAChCY,WAAW,CAACE,OAAO,GAAGd,QAAQ;IAClC;IACAW,OAAO,CAAC,IAAI,CAAC;EACjB,CAAC,EAAE,EAAE,CAAC;EAEN,oBACIlC,MAAA,CAAA0B,OAAA,CAAAd,aAAA,CAAAZ,MAAA,CAAA0B,OAAA,CAAAc,QAAA,QACKT,IAAI,iBACDU,iBAAQ,CAACC,YAAY;EAAA;EACjB;AACpB;AACA;EACoB;EACA1C,MAAA,CAAA0B,OAAA,CAAAd,aAAA,CAACI,mBAAmB,EAAA2B,MAAA,CAAAC,MAAA;IAChBC,OAAO,EAAE,SAAAA,QAAA;MAAA,OAAMX,OAAO,CAAC,KAAK,CAAC;IAAA,CAAC;IAC9BX,QAAQ,EACJ;IACAY,WAAW,CAACE;EACf,GACGb,IAAI,CACX,CAAC,EACFG,YAAY,CAACU,OACjB,CAAC,EACJhB,QAAQ,GAAGA,QAAQ,CAAC;IAAEiB,eAAe,EAAfA;EAAgB,CAAC,CAAC,GAAGhB,MAAM,GAAGA,MAAM,CAAC;IAAEgB,eAAe,EAAfA;EAAgB,CAAC,CAAC,GAAG,IACrF,CAAC;AAEX,CAAC;AAACpB,OAAA,CAAAC,WAAA,GAAAA,WAAA"}
@@ -3,5 +3,11 @@ export interface LayoutProps {
3
3
  title?: string;
4
4
  children: React.ReactNode;
5
5
  }
6
- export declare const Layout: import("@webiny/app").ComposableFC<LayoutProps>;
7
- export declare const LayoutRenderer: import("@webiny/app").ComposableFC<LayoutProps>;
6
+ export declare const Layout: React.FunctionComponent<LayoutProps> & {
7
+ original: React.ComponentType<LayoutProps>;
8
+ originalName: string;
9
+ };
10
+ export declare const LayoutRenderer: React.FunctionComponent<LayoutProps> & {
11
+ original: React.ComponentType<LayoutProps>;
12
+ originalName: string;
13
+ };
package/base/ui/Layout.js CHANGED
@@ -16,4 +16,6 @@ var Layout = (0, _app.makeComposable)("Layout", function (_ref) {
16
16
  });
17
17
  exports.Layout = Layout;
18
18
  var LayoutRenderer = (0, _app.makeComposable)("LayoutRenderer");
19
- exports.LayoutRenderer = LayoutRenderer;
19
+ exports.LayoutRenderer = LayoutRenderer;
20
+
21
+ //# sourceMappingURL=Layout.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Layout","makeComposable","children","props","LayoutRenderer"],"sources":["Layout.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\n\nexport interface LayoutProps {\n title?: string;\n children: React.ReactNode;\n}\n\nexport const Layout = makeComposable<LayoutProps>(\"Layout\", ({ children, ...props }) => {\n return <LayoutRenderer {...props}>{children}</LayoutRenderer>;\n});\n\nexport const LayoutRenderer = makeComposable<LayoutProps>(\"LayoutRenderer\");\n"],"mappings":";;;;;;;;AAAA;AACA;AAA6C;AAOtC,IAAMA,MAAM,GAAG,IAAAC,mBAAc,EAAc,QAAQ,EAAE,gBAA4B;EAAA,IAAzBC,QAAQ,QAARA,QAAQ;IAAKC,KAAK;EAC7E,oBAAO,6BAAC,cAAc,EAAKA,KAAK,EAAGD,QAAQ,CAAkB;AACjE,CAAC,CAAC;AAAC;AAEI,IAAME,cAAc,GAAG,IAAAH,mBAAc,EAAc,gBAAgB,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_app","_excluded","Layout","makeComposable","_ref","children","props","_objectWithoutProperties2","default","createElement","LayoutRenderer","exports"],"sources":["Layout.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\n\nexport interface LayoutProps {\n title?: string;\n children: React.ReactNode;\n}\n\nexport const Layout = makeComposable<LayoutProps>(\"Layout\", ({ children, ...props }) => {\n return <LayoutRenderer {...props}>{children}</LayoutRenderer>;\n});\n\nexport const LayoutRenderer = makeComposable<LayoutProps>(\"LayoutRenderer\");\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAA6C,IAAAE,SAAA;AAOtC,IAAMC,MAAM,GAAG,IAAAC,mBAAc,EAAc,QAAQ,EAAE,UAAAC,IAAA,EAA4B;EAAA,IAAzBC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAKC,KAAK,OAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,EAAAH,SAAA;EAC7E,oBAAOJ,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACC,cAAc,EAAKJ,KAAK,EAAGD,QAAyB,CAAC;AACjE,CAAC,CAAC;AAACM,OAAA,CAAAT,MAAA,GAAAA,MAAA;AAEI,IAAMQ,cAAc,GAAG,IAAAP,mBAAc,EAAc,gBAAgB,CAAC;AAACQ,OAAA,CAAAD,cAAA,GAAAA,cAAA"}
@@ -1,2 +1,9 @@
1
- export declare const LocaleSelector: import("@webiny/app").ComposableFC<unknown>;
2
- export declare const LocaleSelectorRenderer: import("@webiny/app").ComposableFC<unknown>;
1
+ import React from "react";
2
+ export declare const LocaleSelector: React.FunctionComponent<unknown> & {
3
+ original: React.ComponentType<unknown>;
4
+ originalName: string;
5
+ };
6
+ export declare const LocaleSelectorRenderer: React.FunctionComponent<unknown> & {
7
+ original: React.ComponentType<unknown>;
8
+ originalName: string;
9
+ };
@@ -12,4 +12,6 @@ var LocaleSelector = (0, _app.makeComposable)("LocaleSelector", function () {
12
12
  });
13
13
  exports.LocaleSelector = LocaleSelector;
14
14
  var LocaleSelectorRenderer = (0, _app.makeComposable)("LocaleSelectorRenderer");
15
- exports.LocaleSelectorRenderer = LocaleSelectorRenderer;
15
+ exports.LocaleSelectorRenderer = LocaleSelectorRenderer;
16
+
17
+ //# sourceMappingURL=LocaleSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LocaleSelector","makeComposable","LocaleSelectorRenderer"],"sources":["LocaleSelector.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\n\nexport const LocaleSelector = makeComposable(\"LocaleSelector\", () => {\n return <LocaleSelectorRenderer />;\n});\n\nexport const LocaleSelectorRenderer = makeComposable(\"LocaleSelectorRenderer\");\n"],"mappings":";;;;;;;AAAA;AACA;AAEO,IAAMA,cAAc,GAAG,IAAAC,mBAAc,EAAC,gBAAgB,EAAE,YAAM;EACjE,oBAAO,6BAAC,sBAAsB,OAAG;AACrC,CAAC,CAAC;AAAC;AAEI,IAAMC,sBAAsB,GAAG,IAAAD,mBAAc,EAAC,wBAAwB,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_app","LocaleSelector","makeComposable","default","createElement","LocaleSelectorRenderer","exports"],"sources":["LocaleSelector.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\n\nexport const LocaleSelector = makeComposable(\"LocaleSelector\", () => {\n return <LocaleSelectorRenderer />;\n});\n\nexport const LocaleSelectorRenderer = makeComposable(\"LocaleSelectorRenderer\");\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEO,IAAME,cAAc,GAAG,IAAAC,mBAAc,EAAC,gBAAgB,EAAE,YAAM;EACjE,oBAAOL,MAAA,CAAAM,OAAA,CAAAC,aAAA,CAACC,sBAAsB,MAAE,CAAC;AACrC,CAAC,CAAC;AAACC,OAAA,CAAAL,cAAA,GAAAA,cAAA;AAEI,IAAMI,sBAAsB,GAAG,IAAAH,mBAAc,EAAC,wBAAwB,CAAC;AAACI,OAAA,CAAAD,sBAAA,GAAAA,sBAAA"}
@@ -2,5 +2,8 @@ import React from "react";
2
2
  export interface LoginScreenProps {
3
3
  children: React.ReactNode;
4
4
  }
5
- export declare const LoginScreen: React.FC<LoginScreenProps>;
6
- export declare const LoginScreenRenderer: import("@webiny/app").ComposableFC<LoginScreenProps>;
5
+ export declare const LoginScreen: ({ children }: LoginScreenProps) => JSX.Element;
6
+ export declare const LoginScreenRenderer: React.FunctionComponent<LoginScreenProps> & {
7
+ original: React.ComponentType<LoginScreenProps>;
8
+ originalName: string;
9
+ };
@@ -18,4 +18,6 @@ var LoginScreen = function LoginScreen(_ref) {
18
18
  };
19
19
  exports.LoginScreen = LoginScreen;
20
20
  var LoginScreenRenderer = (0, _app.makeComposable)("LoginScreenRenderer");
21
- exports.LoginScreenRenderer = LoginScreenRenderer;
21
+ exports.LoginScreenRenderer = LoginScreenRenderer;
22
+
23
+ //# sourceMappingURL=LoginScreen.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LoginScreen","children","location","LoginScreenRenderer","makeComposable"],"sources":["LoginScreen.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\nimport { Tags } from \"./Tags\";\n\nexport interface LoginScreenProps {\n children: React.ReactNode;\n}\n\nexport const LoginScreen: React.FC<LoginScreenProps> = ({ children }) => {\n return (\n <Tags tags={{ location: \"loginScreen\" }}>\n <LoginScreenRenderer>{children}</LoginScreenRenderer>\n </Tags>\n );\n};\n\nexport const LoginScreenRenderer = makeComposable<LoginScreenProps>(\"LoginScreenRenderer\");\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAMO,IAAMA,WAAuC,GAAG,SAA1CA,WAAuC,OAAqB;EAAA,IAAfC,QAAQ,QAARA,QAAQ;EAC9D,oBACI,6BAAC,UAAI;IAAC,IAAI,EAAE;MAAEC,QAAQ,EAAE;IAAc;EAAE,gBACpC,6BAAC,mBAAmB,QAAED,QAAQ,CAAuB,CAClD;AAEf,CAAC;AAAC;AAEK,IAAME,mBAAmB,GAAG,IAAAC,mBAAc,EAAmB,qBAAqB,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_app","_Tags","LoginScreen","_ref","children","default","createElement","Tags","tags","location","LoginScreenRenderer","exports","makeComposable"],"sources":["LoginScreen.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\nimport { Tags } from \"./Tags\";\n\nexport interface LoginScreenProps {\n children: React.ReactNode;\n}\n\nexport const LoginScreen = ({ children }: LoginScreenProps) => {\n return (\n <Tags tags={{ location: \"loginScreen\" }}>\n <LoginScreenRenderer>{children}</LoginScreenRenderer>\n </Tags>\n );\n};\n\nexport const LoginScreenRenderer = makeComposable<LoginScreenProps>(\"LoginScreenRenderer\");\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAMO,IAAMG,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAuC;EAAA,IAAjCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EAClC,oBACIP,MAAA,CAAAQ,OAAA,CAAAC,aAAA,CAACL,KAAA,CAAAM,IAAI;IAACC,IAAI,EAAE;MAAEC,QAAQ,EAAE;IAAc;EAAE,gBACpCZ,MAAA,CAAAQ,OAAA,CAAAC,aAAA,CAACI,mBAAmB,QAAEN,QAA8B,CAClD,CAAC;AAEf,CAAC;AAACO,OAAA,CAAAT,WAAA,GAAAA,WAAA;AAEK,IAAMQ,mBAAmB,GAAG,IAAAE,mBAAc,EAAmB,qBAAqB,CAAC;AAACD,OAAA,CAAAD,mBAAA,GAAAA,mBAAA"}
package/base/ui/Logo.d.ts CHANGED
@@ -1,8 +1,14 @@
1
1
  import React from "react";
2
- export declare const Logo: import("@webiny/app").ComposableFC<unknown>;
3
- export declare const LogoRenderer: import("@webiny/app").ComposableFC<unknown>;
2
+ export declare const Logo: React.FunctionComponent<unknown> & {
3
+ original: React.ComponentType<unknown>;
4
+ originalName: string;
5
+ };
6
+ export declare const LogoRenderer: React.FunctionComponent<unknown> & {
7
+ original: React.ComponentType<unknown>;
8
+ originalName: string;
9
+ };
4
10
  interface AddLogoProps {
5
11
  logo: JSX.Element;
6
12
  }
7
- export declare const AddLogo: React.FC<AddLogoProps>;
13
+ export declare const AddLogo: ({ logo }: AddLogoProps) => JSX.Element;
8
14
  export {};
package/base/ui/Logo.js CHANGED
@@ -27,4 +27,6 @@ var AddLogo = function AddLogo(_ref) {
27
27
  with: LogoHOC
28
28
  });
29
29
  };
30
- exports.AddLogo = AddLogo;
30
+ exports.AddLogo = AddLogo;
31
+
32
+ //# sourceMappingURL=Logo.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Logo","makeComposable","LogoRenderer","AddLogo","logo","LogoHOC","useMemo"],"sources":["Logo.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Compose, makeComposable } from \"@webiny/app\";\n\nexport const Logo = makeComposable(\"Logo\", () => {\n return <LogoRenderer />;\n});\n\nexport const LogoRenderer = makeComposable(\"LogoRenderer\");\n\ninterface AddLogoProps {\n logo: JSX.Element;\n}\n\nexport const AddLogo: React.FC<AddLogoProps> = ({ logo }) => {\n const LogoHOC = useMemo(() => {\n return () => {\n return function Logo() {\n return logo;\n };\n };\n }, []);\n\n return <Compose component={LogoRenderer} with={LogoHOC} />;\n};\n"],"mappings":";;;;;;;AAAA;AACA;AAEO,IAAMA,IAAI,GAAG,IAAAC,mBAAc,EAAC,MAAM,EAAE,YAAM;EAC7C,oBAAO,6BAAC,YAAY,OAAG;AAC3B,CAAC,CAAC;AAAC;AAEI,IAAMC,YAAY,GAAG,IAAAD,mBAAc,EAAC,cAAc,CAAC;AAAC;AAMpD,IAAME,OAA+B,GAAG,SAAlCA,OAA+B,OAAiB;EAAA,IAAXC,IAAI,QAAJA,IAAI;EAClD,IAAMC,OAAO,GAAG,IAAAC,cAAO,EAAC,YAAM;IAC1B,OAAO,YAAM;MACT,OAAO,SAASN,IAAI,GAAG;QACnB,OAAOI,IAAI;MACf,CAAC;IACL,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAO,6BAAC,YAAO;IAAC,SAAS,EAAEF,YAAa;IAAC,IAAI,EAAEG;EAAQ,EAAG;AAC9D,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_app","Logo","makeComposable","default","createElement","LogoRenderer","exports","AddLogo","_ref","logo","LogoHOC","useMemo","Compose","component","with"],"sources":["Logo.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Compose, makeComposable } from \"@webiny/app\";\n\nexport const Logo = makeComposable(\"Logo\", () => {\n return <LogoRenderer />;\n});\n\nexport const LogoRenderer = makeComposable(\"LogoRenderer\");\n\ninterface AddLogoProps {\n logo: JSX.Element;\n}\n\nexport const AddLogo = ({ logo }: AddLogoProps) => {\n const LogoHOC = useMemo(() => {\n return () => {\n return function Logo() {\n return logo;\n };\n };\n }, []);\n\n return <Compose component={LogoRenderer} with={LogoHOC} />;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEO,IAAME,IAAI,GAAG,IAAAC,mBAAc,EAAC,MAAM,EAAE,YAAM;EAC7C,oBAAOL,MAAA,CAAAM,OAAA,CAAAC,aAAA,CAACC,YAAY,MAAE,CAAC;AAC3B,CAAC,CAAC;AAACC,OAAA,CAAAL,IAAA,GAAAA,IAAA;AAEI,IAAMI,YAAY,GAAG,IAAAH,mBAAc,EAAC,cAAc,CAAC;AAACI,OAAA,CAAAD,YAAA,GAAAA,YAAA;AAMpD,IAAME,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAA+B;EAAA,IAAzBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;EAC1B,IAAMC,OAAO,GAAG,IAAAC,cAAO,EAAC,YAAM;IAC1B,OAAO,YAAM;MACT,OAAO,SAASV,IAAIA,CAAA,EAAG;QACnB,OAAOQ,IAAI;MACf,CAAC;IACL,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOZ,MAAA,CAAAM,OAAA,CAAAC,aAAA,CAACJ,IAAA,CAAAY,OAAO;IAACC,SAAS,EAAER,YAAa;IAACS,IAAI,EAAEJ;EAAQ,CAAE,CAAC;AAC9D,CAAC;AAACJ,OAAA,CAAAC,OAAA,GAAAA,OAAA"}
package/base/ui/Menu.d.ts CHANGED
@@ -28,4 +28,9 @@ export declare const createEmptyMenu: (name: string) => MenuData;
28
28
  /**
29
29
  * Register a new menu item into the Admin app.
30
30
  */
31
- export declare const AddMenu: React.FC<MenuProps>;
31
+ export declare const AddMenu: {
32
+ ({ children, ...props }: MenuProps): JSX.Element | null;
33
+ defaultProps: {
34
+ tags: never[];
35
+ };
36
+ };
package/base/ui/Menu.js CHANGED
@@ -29,8 +29,7 @@ exports.createEmptyMenu = createEmptyMenu;
29
29
  var keys = ["label", "path", "icon", "onClick", "testId", "tags", "target", "rel", "element", "pin"];
30
30
  var mergeMenuItems = function mergeMenuItems(item1, item2) {
31
31
  return (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, item1), keys.reduce(function (map, key) {
32
- var _item2$key;
33
- return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, map), {}, (0, _defineProperty2.default)({}, key, (_item2$key = item2[key]) !== null && _item2$key !== void 0 ? _item2$key : item1[key]));
32
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, map), {}, (0, _defineProperty2.default)({}, key, item2[key] ?? item1[key]));
34
33
  }, {})), {}, {
35
34
  children: (item2.children || []).reduce(function (acc, menu) {
36
35
  var index = acc.findIndex(function (i) {
@@ -134,4 +133,6 @@ var AddMenu = function AddMenu(_ref) {
134
133
  exports.AddMenu = AddMenu;
135
134
  AddMenu.defaultProps = {
136
135
  tags: []
137
- };
136
+ };
137
+
138
+ //# sourceMappingURL=Menu.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MenuContext","createContext","undefined","displayName","useMenu","useContext","createEmptyMenu","name","tags","children","keys","mergeMenuItems","item1","item2","reduce","map","key","acc","menu","index","findIndex","i","push","AddMenu","props","navigation","useNavigation","useEffect","setMenu","existing","removeMenu","context","menuItem","childIndex","ch","slice","updater","subItems","filter","Boolean","defaultProps"],"sources":["Menu.tsx"],"sourcesContent":["import React, { createContext, useContext, useEffect } from \"react\";\nimport { useNavigation } from \"~/index\";\n\nexport interface MenuUpdater {\n (menuItem: MenuData | undefined | null): MenuData | undefined;\n}\n\nexport interface MenuContext {\n menuItem: MenuData | null;\n setMenu(id: string, updater: MenuUpdater): void;\n removeMenu(id: string): void;\n}\n\nconst MenuContext = createContext<MenuContext | undefined>(undefined);\nMenuContext.displayName = \"MenuContext\";\n\nconst useMenu = () => {\n return useContext(MenuContext);\n};\n\nexport interface MenuProps {\n name: string;\n label?: string;\n path?: string;\n icon?: JSX.Element;\n onClick?: () => void;\n testId?: string;\n tags?: string[];\n target?: string;\n rel?: string;\n element?: JSX.Element;\n children?: React.ReactNode | React.ReactNode[];\n pin?: \"first\" | \"last\";\n}\n\nexport interface MenuData extends MenuProps {\n children: MenuData[];\n}\n\nexport const createEmptyMenu = (name: string): MenuData => {\n return {\n name,\n tags: [],\n children: []\n };\n};\n\nconst keys: (keyof MenuData)[] = [\n \"label\",\n \"path\",\n \"icon\",\n \"onClick\",\n \"testId\",\n \"tags\",\n \"target\",\n \"rel\",\n \"element\",\n \"pin\"\n];\n\nconst mergeMenuItems = (item1: MenuData, item2: MenuData): MenuData => {\n return {\n ...item1,\n ...keys.reduce((map, key) => ({ ...map, [key]: item2[key] ?? item1[key] }), {}),\n children: (item2.children || []).reduce(\n (acc, menu) => {\n const index = acc.findIndex(i => i.name === menu.name);\n if (index > -1) {\n acc[index] = mergeMenuItems(acc[index], menu);\n } else {\n acc.push(menu);\n }\n return acc;\n },\n [...item1.children]\n )\n };\n};\n\n/**\n * Register a new menu item into the Admin app.\n */\nexport const AddMenu: React.FC<MenuProps> = ({ children, ...props }) => {\n const menu = useMenu();\n const navigation = useNavigation();\n\n useEffect(() => {\n if (menu) {\n menu.setMenu(props.name, existing => {\n if (!existing) {\n return { ...props, children: [] } as MenuData;\n }\n\n return mergeMenuItems(existing, props as MenuData);\n });\n } else {\n navigation.setMenu(props.name, existing => {\n /**\n * We return props because this will break otherwise.\n * TODO @pavel check if this is correct\n */\n if (!existing) {\n return props as MenuData;\n }\n return mergeMenuItems(existing, props as MenuData);\n });\n }\n\n return () => {\n if (menu) {\n menu.removeMenu(props.name);\n } else {\n navigation.removeMenu(props.name);\n }\n };\n }, []);\n\n const context: MenuContext = {\n menuItem: { ...props, children: [] },\n removeMenu(name) {\n (menu || navigation).setMenu(props.name, existing => {\n if (!existing) {\n return undefined;\n }\n\n const childIndex = existing.children.findIndex(ch => ch.name === name);\n if (childIndex > -1) {\n return {\n ...existing,\n children: [\n ...existing.children.slice(0, childIndex),\n ...existing.children.slice(childIndex + 1)\n ]\n };\n }\n\n return existing;\n });\n },\n setMenu(name: string, updater: MenuUpdater) {\n (menu || navigation).setMenu(props.name, existing => {\n if (!existing) {\n existing = createEmptyMenu(props.name);\n }\n\n const subItems = existing.children;\n\n const childIndex = subItems.findIndex(ch => ch.name === name);\n if (childIndex === -1) {\n return {\n ...existing,\n children: [...subItems, updater(null)].filter(Boolean) as MenuData[]\n };\n }\n\n return {\n ...existing,\n children: [\n ...subItems.slice(0, childIndex),\n updater(subItems[childIndex]),\n ...subItems.slice(childIndex + 1)\n ].filter(Boolean) as MenuData[]\n };\n });\n }\n };\n\n if (!children) {\n return null;\n }\n\n return <MenuContext.Provider value={context}>{children}</MenuContext.Provider>;\n};\n\nAddMenu.defaultProps = { tags: [] };\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAAwC;AAYxC,IAAMA,WAAW,gBAAG,IAAAC,oBAAa,EAA0BC,SAAS,CAAC;AACrEF,WAAW,CAACG,WAAW,GAAG,aAAa;AAEvC,IAAMC,OAAO,GAAG,SAAVA,OAAO,GAAS;EAClB,OAAO,IAAAC,iBAAU,EAACL,WAAW,CAAC;AAClC,CAAC;AAqBM,IAAMM,eAAe,GAAG,SAAlBA,eAAe,CAAIC,IAAY,EAAe;EACvD,OAAO;IACHA,IAAI,EAAJA,IAAI;IACJC,IAAI,EAAE,EAAE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AAAC;AAEFc,OAAO,CAACiB,YAAY,GAAG;EAAEhC,IAAI,EAAE;AAAG,CAAC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_","_excluded","MenuContext","createContext","undefined","displayName","useMenu","useContext","createEmptyMenu","name","tags","children","exports","keys","mergeMenuItems","item1","item2","_objectSpread3","default","reduce","map","key","_defineProperty2","acc","menu","index","findIndex","i","push","_toConsumableArray2","AddMenu","_ref","props","_objectWithoutProperties2","navigation","useNavigation","useEffect","setMenu","existing","removeMenu","context","menuItem","childIndex","ch","concat","slice","updater","subItems","filter","Boolean","createElement","Provider","value","defaultProps"],"sources":["Menu.tsx"],"sourcesContent":["import React, { createContext, useContext, useEffect } from \"react\";\nimport { useNavigation } from \"~/index\";\n\nexport interface MenuUpdater {\n (menuItem: MenuData | undefined | null): MenuData | undefined;\n}\n\nexport interface MenuContext {\n menuItem: MenuData | null;\n setMenu(id: string, updater: MenuUpdater): void;\n removeMenu(id: string): void;\n}\n\nconst MenuContext = createContext<MenuContext | undefined>(undefined);\nMenuContext.displayName = \"MenuContext\";\n\nconst useMenu = () => {\n return useContext(MenuContext);\n};\n\nexport interface MenuProps {\n name: string;\n label?: string;\n path?: string;\n icon?: JSX.Element;\n onClick?: () => void;\n testId?: string;\n tags?: string[];\n target?: string;\n rel?: string;\n element?: JSX.Element;\n children?: React.ReactNode | React.ReactNode[];\n pin?: \"first\" | \"last\";\n}\n\nexport interface MenuData extends MenuProps {\n children: MenuData[];\n}\n\nexport const createEmptyMenu = (name: string): MenuData => {\n return {\n name,\n tags: [],\n children: []\n };\n};\n\nconst keys: (keyof MenuData)[] = [\n \"label\",\n \"path\",\n \"icon\",\n \"onClick\",\n \"testId\",\n \"tags\",\n \"target\",\n \"rel\",\n \"element\",\n \"pin\"\n];\n\nconst mergeMenuItems = (item1: MenuData, item2: MenuData): MenuData => {\n return {\n ...item1,\n ...keys.reduce((map, key) => ({ ...map, [key]: item2[key] ?? item1[key] }), {}),\n children: (item2.children || []).reduce(\n (acc, menu) => {\n const index = acc.findIndex(i => i.name === menu.name);\n if (index > -1) {\n acc[index] = mergeMenuItems(acc[index], menu);\n } else {\n acc.push(menu);\n }\n return acc;\n },\n [...item1.children]\n )\n };\n};\n\n/**\n * Register a new menu item into the Admin app.\n */\nexport const AddMenu = ({ children, ...props }: MenuProps) => {\n const menu = useMenu();\n const navigation = useNavigation();\n\n useEffect(() => {\n if (menu) {\n menu.setMenu(props.name, existing => {\n if (!existing) {\n return { ...props, children: [] } as MenuData;\n }\n\n return mergeMenuItems(existing, props as MenuData);\n });\n } else {\n navigation.setMenu(props.name, existing => {\n /**\n * We return props because this will break otherwise.\n * TODO @pavel check if this is correct\n */\n if (!existing) {\n return props as MenuData;\n }\n return mergeMenuItems(existing, props as MenuData);\n });\n }\n\n return () => {\n if (menu) {\n menu.removeMenu(props.name);\n } else {\n navigation.removeMenu(props.name);\n }\n };\n }, []);\n\n const context: MenuContext = {\n menuItem: { ...props, children: [] },\n removeMenu(name) {\n (menu || navigation).setMenu(props.name, existing => {\n if (!existing) {\n return undefined;\n }\n\n const childIndex = existing.children.findIndex(ch => ch.name === name);\n if (childIndex > -1) {\n return {\n ...existing,\n children: [\n ...existing.children.slice(0, childIndex),\n ...existing.children.slice(childIndex + 1)\n ]\n };\n }\n\n return existing;\n });\n },\n setMenu(name: string, updater: MenuUpdater) {\n (menu || navigation).setMenu(props.name, existing => {\n if (!existing) {\n existing = createEmptyMenu(props.name);\n }\n\n const subItems = existing.children;\n\n const childIndex = subItems.findIndex(ch => ch.name === name);\n if (childIndex === -1) {\n return {\n ...existing,\n children: [...subItems, updater(null)].filter(Boolean) as MenuData[]\n };\n }\n\n return {\n ...existing,\n children: [\n ...subItems.slice(0, childIndex),\n updater(subItems[childIndex]),\n ...subItems.slice(childIndex + 1)\n ].filter(Boolean) as MenuData[]\n };\n });\n }\n };\n\n if (!children) {\n return null;\n }\n\n return <MenuContext.Provider value={context}>{children}</MenuContext.Provider>;\n};\n\nAddMenu.default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;EAAQ,GAAE7B,QAA+B,CAAC;AAClF,CAAC;AAACC,OAAA,CAAAkB,OAAA,GAAAA,OAAA;AAEFA,OAAO,CAACuB,YAAY,GAAG;EAAE3C,IAAI,EAAE;AAAG,CAAC"}
@@ -6,9 +6,15 @@ export interface NavigationContext {
6
6
  removeMenu(id: string): void;
7
7
  }
8
8
  export declare function useNavigation(): NavigationContext;
9
- export declare const NavigationProvider: (Component: React.ComponentType<unknown>) => React.FC;
10
- export declare const Navigation: React.FC;
11
- export declare const NavigationRenderer: import("@webiny/app").ComposableFC<unknown>;
9
+ interface NavigationProviderProps {
10
+ children: React.ReactNode;
11
+ }
12
+ export declare const NavigationProvider: (Component: React.ComponentType<unknown>) => ({ children }: NavigationProviderProps) => JSX.Element;
13
+ export declare const Navigation: () => JSX.Element;
14
+ export declare const NavigationRenderer: React.FunctionComponent<unknown> & {
15
+ original: React.ComponentType<unknown>;
16
+ originalName: string;
17
+ };
12
18
  interface MenuItemContext {
13
19
  menuItem?: MenuData;
14
20
  depth: number;
@@ -18,7 +24,13 @@ export declare function useMenuItem(): MenuItemContext;
18
24
  export interface MenuItemsProps {
19
25
  menuItems: MenuData[];
20
26
  }
21
- export declare const MenuItems: import("@webiny/app").ComposableFC<MenuItemsProps>;
22
- export declare const MenuItem: React.FC;
23
- export declare const MenuItemRenderer: import("@webiny/app").ComposableFC<unknown>;
27
+ export declare const MenuItems: React.FunctionComponent<MenuItemsProps> & {
28
+ original: React.ComponentType<MenuItemsProps>;
29
+ originalName: string;
30
+ };
31
+ export declare const MenuItem: () => JSX.Element;
32
+ export declare const MenuItemRenderer: React.FunctionComponent<unknown> & {
33
+ original: React.ComponentType<unknown>;
34
+ originalName: string;
35
+ };
24
36
  export {};
@@ -11,7 +11,7 @@ exports.useNavigation = useNavigation;
11
11
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
13
  var _react = _interopRequireWildcard(require("react"));
14
- var _nanoid = require("nanoid");
14
+ var _utils = require("@webiny/utils");
15
15
  var _app = require("@webiny/app");
16
16
  var _ = require("../..");
17
17
  var _plugins = require("@webiny/plugins");
@@ -28,13 +28,12 @@ NavigationContext.displayName = "NavigationContext";
28
28
  function useNavigation() {
29
29
  return (0, _react.useContext)(NavigationContext);
30
30
  }
31
-
32
31
  // IMPORTANT! The following component is for BACKWARDS COMPATIBILITY purposes only!
33
32
  // It is not a public component, and is not even exported from this file. We need it to take care of
34
33
  // scaffolded plugins in users' projects, as well as our own applications (Page Builder and Form Builder).
35
34
  var LegacyMenu = function LegacyMenu(props) {
36
35
  return /*#__PURE__*/_react.default.createElement(_.AddMenu, Object.assign({}, props, {
37
- name: props.name || (0, _nanoid.nanoid)(),
36
+ name: props.name || (0, _utils.generateId)(),
38
37
  label: props.label
39
38
  }), props.children);
40
39
  };
@@ -59,7 +58,10 @@ var LegacyMenuPlugins = function LegacyMenuPlugins() {
59
58
  Section: LegacyMenu
60
59
  }));
61
60
  });
62
- // TODO @ts-refactor
61
+ /**
62
+ * TODO Figure out correct types for the menus.
63
+ */
64
+ // @ts-expect-error
63
65
  setMenus(menuElements);
64
66
  }, []);
65
67
  return menus;
@@ -148,4 +150,6 @@ var MenuItem = function MenuItem() {
148
150
  };
149
151
  exports.MenuItem = MenuItem;
150
152
  var MenuItemRenderer = (0, _app.makeComposable)("MenuItemRenderer");
151
- exports.MenuItemRenderer = MenuItemRenderer;
153
+ exports.MenuItemRenderer = MenuItemRenderer;
154
+
155
+ //# sourceMappingURL=Navigation.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NavigationContext","createContext","menuItems","setMenu","removeMenu","displayName","useNavigation","useContext","LegacyMenu","props","name","nanoid","label","children","LegacyMenuPlugins","useState","menus","setMenus","useEffect","menuPlugins","plugins","byType","menuElements","map","plugin","render","Menu","Item","Section","NavigationProvider","Component","setState","id","updater","state","index","findIndex","m","newMenu","createEmptyMenu","slice","useCallback","context","useMemo","Navigation","location","NavigationRenderer","makeComposable","MenuItemContext","React","menuItem","undefined","depth","useMenuItem","MenuItems","MenuItem","MenuItemRenderer"],"sources":["Navigation.tsx"],"sourcesContent":["import React, {\n Fragment,\n useEffect,\n createContext,\n useCallback,\n useMemo,\n useState,\n useContext\n} from \"react\";\nimport { nanoid } from \"nanoid\";\nimport { makeComposable, Plugins } from \"@webiny/app\";\nimport { MenuData, MenuProps, AddMenu as Menu, Tags, MenuUpdater, createEmptyMenu } from \"~/index\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AdminMenuPlugin } from \"~/types\";\nimport { ItemProps, SectionProps } from \"~/plugins/MenuPlugin\";\n\nexport interface NavigationContext {\n menuItems: MenuData[];\n setMenu(id: string, update: MenuUpdater): void;\n removeMenu(id: string): void;\n}\n\nconst NavigationContext = createContext<NavigationContext>({\n menuItems: [],\n setMenu: () => {\n return void 0;\n },\n removeMenu: () => {\n return void 0;\n }\n});\nNavigationContext.displayName = \"NavigationContext\";\n\nexport function useNavigation() {\n return useContext(NavigationContext);\n}\n\n// IMPORTANT! The following component is for BACKWARDS COMPATIBILITY purposes only!\n// It is not a public component, and is not even exported from this file. We need it to take care of\n// scaffolded plugins in users' projects, as well as our own applications (Page Builder and Form Builder).\nconst LegacyMenu: React.FC<MenuProps | SectionProps | ItemProps> = props => {\n return (\n <Menu {...props} name={(props as MenuProps).name || nanoid()} label={props.label as string}>\n {props.children}\n </Menu>\n );\n};\n\nconst LegacyMenuPlugins: React.FC = () => {\n // IMPORTANT! The following piece of code is for BACKWARDS COMPATIBILITY purposes only!\n const [menus, setMenus] = useState<JSX.Element | null>(null);\n\n useEffect(() => {\n const menuPlugins = plugins.byType<AdminMenuPlugin>(\"admin-menu\");\n if (!menuPlugins) {\n return;\n }\n\n const menuElements = menuPlugins.map(plugin => {\n // TODO @ts-refactor figure out correct types or write a comment to leave as React.FC\n return (\n <Plugins key={plugin.name}>\n {plugin.render({\n Menu: LegacyMenu as React.FC,\n Item: LegacyMenu as React.FC,\n Section: LegacyMenu as React.FC\n })}\n </Plugins>\n );\n });\n // TODO @ts-refactor\n setMenus(menuElements as any);\n }, []);\n\n return menus;\n};\n\nexport const NavigationProvider = (Component: React.ComponentType<unknown>): React.FC => {\n return function NavigationProvider({ children }) {\n const [menuItems, setState] = useState<MenuData[]>([]);\n\n const setMenu = (id: string, updater: MenuUpdater): void => {\n setState(state => {\n const index = state.findIndex(m => m.name === id);\n\n const newMenu = index > -1 ? updater(state[index]) : updater(createEmptyMenu(id));\n if (!newMenu) {\n return [...state];\n }\n if (!newMenu.children) {\n newMenu.children = [];\n }\n\n return index > -1\n ? [...state.slice(0, index), newMenu, ...state.slice(index + 1)]\n : [...state, newMenu];\n });\n };\n const removeMenu = useCallback(\n id => {\n setState(state => {\n const index = state.findIndex(m => m.name === id);\n\n if (index < 0) {\n return state;\n }\n\n return [...state.slice(0, index), ...state.slice(index + 1)];\n });\n },\n [setState]\n );\n\n const context = useMemo<NavigationContext>(\n () => ({\n menuItems,\n setMenu,\n removeMenu\n }),\n [menuItems, setMenu, removeMenu]\n );\n\n return (\n <NavigationContext.Provider value={context}>\n <LegacyMenuPlugins />\n <Component>{children}</Component>\n </NavigationContext.Provider>\n );\n };\n};\n\nexport const Navigation: React.FC = () => {\n return (\n <Tags tags={{ location: \"navigation\" }}>\n <NavigationRenderer />\n </Tags>\n );\n};\n\nexport const NavigationRenderer = makeComposable(\"NavigationRenderer\");\n\ninterface MenuItemContext {\n menuItem?: MenuData;\n depth: number;\n}\n\nconst MenuItemContext = React.createContext<MenuItemContext>({\n menuItem: undefined,\n depth: -1\n});\nMenuItemContext.displayName = \"MenuItemContext\";\n\nexport function useMenuItem() {\n return React.useContext(MenuItemContext);\n}\n\nexport interface MenuItemsProps {\n menuItems: MenuData[];\n}\n\nexport const MenuItems = makeComposable<MenuItemsProps>(\"MenuItems\", ({ menuItems }) => {\n const menuItem = useMenuItem();\n\n const depth = menuItem ? menuItem.depth : -1;\n\n return (\n <Fragment>\n {menuItems.map(menuItem => (\n <MenuItemContext.Provider\n key={menuItem.name}\n value={{ menuItem, depth: depth + 1 }}\n >\n <MenuItem />\n </MenuItemContext.Provider>\n ))}\n </Fragment>\n );\n});\n\nexport const MenuItem: React.FC = () => {\n return <MenuItemRenderer />;\n};\n\nexport const MenuItemRenderer = makeComposable(\"MenuItemRenderer\");\n"],"mappings":";;;;;;;;;;;;AAAA;AASA;AACA;AACA;AACA;AAUA,IAAMA,iBAAiB,gBAAG,IAAAC,oBAAa,EAAoB;EACvDC,SAAS,EAAE,EAAE;EACbC,OAAO,EAAE,mBAAM;IACX,OAAO,KAAK,CAAC;EACjB,CAAC;EACDC,UAAU,EAAE,sBAAM;IACd,OAAO,KAAK,CAAC;EACjB;AACJ,CAAC,CAAC;AACFJ,iBAAiB,CAACK,WAAW,GAAG,mBAAmB;AAE5C,SAASC,aAAa,GAAG;EAC5B,OAAO,IAAAC,iBAAU,EAACP,iBAAiB,CAAC;AACxC;;AAEA;AACA;AACA;AACA,IAAMQ,UAA0D,GAAG,SAA7DA,UAA0D,CAAGC,KAAK,EAAI;EACxE,oBACI,6BAAC,SAAI,oBAAKA,KAAK;IAAE,IAAI,EAAGA,KAAK,CAAeC,IAAI,IAAI,IAAAC,cAAM,GAAG;IAAC,KAAK,EAAEF,KAAK,CAACG;EAAgB,IACtFH,KAAK,CAACI,QAAQ,CACZ;AAEf,CAAC;AAED,IAAMC,iBAA2B,GAAG,SAA9BA,iBAA2B,GAAS;EACtC;EACA,gBAA0B,IAAAC,eAAQ,EAAqB,IAAI,CAAC;IAAA;IAArDC,KAAK;IAAEC,QAAQ;EAEtB,IAAAC,gBAAS,EAAC,YAAM;IACZ,IAAMC,WAAW,GAAGC,gBAAO,CAACC,MAAM,CAAkB,YAAY,CAAC;IACjE,IAAI,CAACF,WAAW,EAAE;MACd;IACJ;IAEA,IAAMG,YAAY,GAAGH,WAAW,CAACI,GAAG,CAAC,UAAAC,MAAM,EAAI;MAC3C;MACA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EC,SAAS;EACnBC,KAAK,EAAE,CAAC;AACZ,CAAC,CAAC;AACFJ,eAAe,CAAC3C,WAAW,GAAG,iBAAiB;AAExC,SAASgD,WAAW,GAAG;EAC1B,OAAOJ,cAAK,CAAC1C,UAAU,CAACyC,eAAe,CAAC;AAC5C;AAMO,IAAMM,SAAS,GAAG,IAAAP,mBAAc,EAAiB,WAAW,EAAE,iBAAmB;EAAA,IAAhB7C,SAAS,SAATA,SAAS;EAC7E,IAAMgD,QAAQ,GAAGG,WAAW,EAAE;EAE9B,IAAMD,KAAK,GAAGF,QAAQ,GAAGA,QAAQ,CAACE,KAAK,GAAG,CAAC,CAAC;EAE5C,oBACI,6BAAC,eAAQ,QACJlD,SAAS,CAACqB,GAAG,CAAC,UAAA2B,QAAQ;IAAA,oBACnB,6BAAC,eAAe,CAAC,QAAQ;MACrB,GAAG,EAAEA,QAAQ,CAACxC,IAAK;MACnB,KAAK,EAAE;QAAEwC,QAAQ,EAARA,QAAQ;QAAEE,KAAK,EAAEA,KAAK,GAAG;MAAE;IAAE,gBAEtC,6BAAC,QAAQ,OAAG,CACW;EAAA,CAC9B,CAAC,CACK;AAEnB,CAAC,CAAC;AAAC;AAEI,IAAMG,QAAkB,GAAG,SAArBA,QAAkB,GAAS;EACpC,oBAAO,6BAAC,gBAAgB,OAAG;AAC/B,CAAC;AAAC;AAEK,IAAMC,gBAAgB,GAAG,IAAAT,mBAAc,EAAC,kBAAkB,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_utils","_app","_","_plugins","NavigationContext","createContext","menuItems","setMenu","removeMenu","displayName","useNavigation","useContext","LegacyMenu","props","default","createElement","AddMenu","Object","assign","name","generateId","label","children","LegacyMenuPlugins","_useState","useState","_useState2","_slicedToArray2","menus","setMenus","useEffect","menuPlugins","plugins","byType","menuElements","map","plugin","Plugins","key","render","Menu","Item","Section","NavigationProvider","Component","_ref","_useState3","_useState4","setState","id","updater","state","index","findIndex","m","newMenu","createEmptyMenu","_toConsumableArray2","concat","slice","useCallback","context","useMemo","Provider","value","exports","Navigation","Tags","tags","location","NavigationRenderer","makeComposable","MenuItemContext","React","menuItem","undefined","depth","useMenuItem","MenuItems","_ref2","Fragment","MenuItem","MenuItemRenderer"],"sources":["Navigation.tsx"],"sourcesContent":["import React, {\n createContext,\n Fragment,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState\n} from \"react\";\nimport { generateId } from \"@webiny/utils\";\nimport { makeComposable, Plugins } from \"@webiny/app\";\nimport { AddMenu as Menu, createEmptyMenu, MenuData, MenuProps, MenuUpdater, Tags } from \"~/index\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AdminMenuPlugin } from \"~/types\";\nimport { ItemProps, SectionProps } from \"~/plugins/MenuPlugin\";\n\nexport interface NavigationContext {\n menuItems: MenuData[];\n setMenu(id: string, update: MenuUpdater): void;\n removeMenu(id: string): void;\n}\n\nconst NavigationContext = createContext<NavigationContext>({\n menuItems: [],\n setMenu: () => {\n return void 0;\n },\n removeMenu: () => {\n return void 0;\n }\n});\nNavigationContext.displayName = \"NavigationContext\";\n\nexport function useNavigation() {\n return useContext(NavigationContext);\n}\n\ntype LegacyMenuProps = MenuProps | SectionProps | ItemProps;\n\n// IMPORTANT! The following component is for BACKWARDS COMPATIBILITY purposes only!\n// It is not a public component, and is not even exported from this file. We need it to take care of\n// scaffolded plugins in users' projects, as well as our own applications (Page Builder and Form Builder).\nconst LegacyMenu = (props: LegacyMenuProps & { children: React.ReactNode }) => {\n return (\n <Menu\n {...props}\n name={(props as MenuProps).name || generateId()}\n label={props.label as string}\n >\n {props.children}\n </Menu>\n );\n};\n\nconst LegacyMenuPlugins = () => {\n // IMPORTANT! The following piece of code is for BACKWARDS COMPATIBILITY purposes only!\n const [menus, setMenus] = useState<JSX.Element | null>(null);\n\n useEffect(() => {\n const menuPlugins = plugins.byType<AdminMenuPlugin>(\"admin-menu\");\n if (!menuPlugins) {\n return;\n }\n\n const menuElements = menuPlugins.map(plugin => {\n // TODO @ts-refactor figure out correct types or write a comment to leave as React.FC\n return (\n <Plugins key={plugin.name}>\n {plugin.render({\n Menu: LegacyMenu as React.FC,\n Item: LegacyMenu as React.FC,\n Section: LegacyMenu as React.FC\n })}\n </Plugins>\n );\n });\n /**\n * TODO Figure out correct types for the menus.\n */\n // @ts-expect-error\n setMenus(menuElements);\n }, []);\n\n return menus;\n};\n\ninterface NavigationProviderProps {\n children: React.ReactNode;\n}\n\nexport const NavigationProvider = (Component: React.ComponentType<unknown>) => {\n return function NavigationProvider({ children }: NavigationProviderProps) {\n const [menuItems, setState] = useState<MenuData[]>([]);\n\n const setMenu = (id: string, updater: MenuUpdater): void => {\n setState(state => {\n const index = state.findIndex(m => m.name === id);\n\n const newMenu = index > -1 ? updater(state[index]) : updater(createEmptyMenu(id));\n if (!newMenu) {\n return [...state];\n }\n if (!newMenu.children) {\n newMenu.children = [];\n }\n\n return index > -1\n ? [...state.slice(0, index), newMenu, ...state.slice(index + 1)]\n : [...state, newMenu];\n });\n };\n const removeMenu = useCallback(\n id => {\n setState(state => {\n const index = state.findIndex(m => m.name === id);\n\n if (index < 0) {\n return state;\n }\n\n return [...state.slice(0, index), ...state.slice(index + 1)];\n });\n },\n [setState]\n );\n\n const context = useMemo<NavigationContext>(\n () => ({\n menuItems,\n setMenu,\n removeMenu\n }),\n [menuItems, setMenu, removeMenu]\n );\n\n return (\n <NavigationContext.Provider value={context}>\n <LegacyMenuPlugins />\n <Component>{children}</Component>\n </NavigationContext.Provider>\n );\n };\n};\n\nexport const Navigation = () => {\n return (\n <Tags tags={{ location: \"navigation\" }}>\n <NavigationRenderer />\n </Tags>\n );\n};\n\nexport const NavigationRenderer = makeComposable(\"NavigationRenderer\");\n\ninterface MenuItemContext {\n menuItem?: MenuData;\n depth: number;\n}\n\nconst MenuItemContext = React.createContext<MenuItemContext>({\n menuItem: undefined,\n depth: -1\n});\nMenuItemContext.displayName = \"MenuItemContext\";\n\nexport function useMenuItem() {\n return React.useContext(MenuItemContext);\n}\n\nexport interface MenuItemsProps {\n menuItems: MenuData[];\n}\n\nexport const MenuItems = makeComposable<MenuItemsProps>(\"MenuItems\", ({ menuItems }) => {\n const menuItem = useMenuItem();\n\n const depth = menuItem ? menuItem.depth : -1;\n\n return (\n <Fragment>\n {menuItems.map(menuItem => (\n <MenuItemContext.Provider\n key={menuItem.name}\n value={{ menuItem, depth: depth + 1 }}\n >\n <MenuItem />\n </MenuItemContext.Provider>\n ))}\n </Fragment>\n );\n});\n\nexport const MenuItem = () => {\n return <MenuItemRenderer />;\n};\n\nexport const MenuItemRenderer = makeComposable(\"MenuItemRenderer\");\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,CAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAUA,IAAMK,iBAAiB,gBAAG,IAAAC,oBAAa,EAAoB;EACvDC,SAAS,EAAE,EAAE;EACbC,OAAO,EAAE,SAAAA,QAAA,EAAM;IACX,OAAO,KAAK,CAAC;EACjB,CAAC;EACDC,UAAU,EAAE,SAAAA,WAAA,EAAM;IACd,OAAO,KAAK,CAAC;EACjB;AACJ,CAAC,CAAC;AACFJ,iBAAiB,CAACK,WAAW,GAAG,mBAAmB;AAE5C,SAASC,aAAaA,CAAA,EAAG;EAC5B,OAAO,IAAAC,iBAAU,EAACP,iBAAiB,CAAC;AACxC;AAIA;AACA;AACA;AACA,IAAMQ,UAAU,GAAG,SAAbA,UAAUA,CAAIC,KAAsD,EAAK;EAC3E,oBACIhB,MAAA,CAAAiB,OAAA,CAAAC,aAAA,CAACb,CAAA,CAAAc,OAAI,EAAAC,MAAA,CAAAC,MAAA,KACGL,KAAK;IACTM,IAAI,EAAGN,KAAK,CAAeM,IAAI,IAAI,IAAAC,iBAAU,EAAC,CAAE;IAChDC,KAAK,EAAER,KAAK,CAAC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
@@ -1,2 +1,9 @@
1
- export declare const NotFound: import("@webiny/app").ComposableFC<unknown>;
2
- export declare const NotFoundRenderer: import("@webiny/app").ComposableFC<unknown>;
1
+ import React from "react";
2
+ export declare const NotFound: React.FunctionComponent<unknown> & {
3
+ original: React.ComponentType<unknown>;
4
+ originalName: string;
5
+ };
6
+ export declare const NotFoundRenderer: React.FunctionComponent<unknown> & {
7
+ original: React.ComponentType<unknown>;
8
+ originalName: string;
9
+ };
@@ -12,4 +12,6 @@ var NotFound = (0, _app.makeComposable)("NotFound", function () {
12
12
  });
13
13
  exports.NotFound = NotFound;
14
14
  var NotFoundRenderer = (0, _app.makeComposable)("NotFoundRenderer");
15
- exports.NotFoundRenderer = NotFoundRenderer;
15
+ exports.NotFoundRenderer = NotFoundRenderer;
16
+
17
+ //# sourceMappingURL=NotFound.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NotFound","makeComposable","NotFoundRenderer"],"sources":["NotFound.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\n\nexport const NotFound = makeComposable(\"NotFound\", () => {\n return <NotFoundRenderer />;\n});\n\nexport const NotFoundRenderer = makeComposable(\"NotFoundRenderer\");\n"],"mappings":";;;;;;;AAAA;AACA;AAEO,IAAMA,QAAQ,GAAG,IAAAC,mBAAc,EAAC,UAAU,EAAE,YAAM;EACrD,oBAAO,6BAAC,gBAAgB,OAAG;AAC/B,CAAC,CAAC;AAAC;AAEI,IAAMC,gBAAgB,GAAG,IAAAD,mBAAc,EAAC,kBAAkB,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_app","NotFound","makeComposable","default","createElement","NotFoundRenderer","exports"],"sources":["NotFound.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeComposable } from \"@webiny/app\";\n\nexport const NotFound = makeComposable(\"NotFound\", () => {\n return <NotFoundRenderer />;\n});\n\nexport const NotFoundRenderer = makeComposable(\"NotFoundRenderer\");\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEO,IAAME,QAAQ,GAAG,IAAAC,mBAAc,EAAC,UAAU,EAAE,YAAM;EACrD,oBAAOL,MAAA,CAAAM,OAAA,CAAAC,aAAA,CAACC,gBAAgB,MAAE,CAAC;AAC/B,CAAC,CAAC;AAACC,OAAA,CAAAL,QAAA,GAAAA,QAAA;AAEI,IAAMI,gBAAgB,GAAG,IAAAH,mBAAc,EAAC,kBAAkB,CAAC;AAACI,OAAA,CAAAD,gBAAA,GAAAA,gBAAA"}
@@ -12,8 +12,19 @@ export interface SearchContext {
12
12
  addOption(option: SearchOptionData): void;
13
13
  }
14
14
  export declare function useSearch(): SearchContext;
15
- export declare const SearchProvider: (Component: React.FC) => React.FC;
16
- export declare const Search: import("@webiny/app").ComposableFC<unknown>;
17
- export declare const SearchRenderer: import("@webiny/app").ComposableFC<unknown>;
15
+ interface SearchProviderProps {
16
+ children: React.ReactNode;
17
+ [key: string]: any;
18
+ }
19
+ export declare const SearchProvider: (Component: React.ComponentType) => ({ children, ...props }: SearchProviderProps) => JSX.Element;
20
+ export declare const Search: React.FunctionComponent<unknown> & {
21
+ original: React.ComponentType<unknown>;
22
+ originalName: string;
23
+ };
24
+ export declare const SearchRenderer: React.FunctionComponent<unknown> & {
25
+ original: React.ComponentType<unknown>;
26
+ originalName: string;
27
+ };
18
28
  export declare type SearchOptionProps = SearchOptionData;
19
- export declare const SearchOption: React.FC<SearchOptionProps>;
29
+ export declare const SearchOption: (props: SearchOptionProps) => null;
30
+ export {};
package/base/ui/Search.js CHANGED
@@ -60,4 +60,6 @@ var SearchOption = function SearchOption(props) {
60
60
  }, []);
61
61
  return null;
62
62
  };
63
- exports.SearchOption = SearchOption;
63
+ exports.SearchOption = SearchOption;
64
+
65
+ //# sourceMappingURL=Search.js.map