@m4l/components 9.2.0 → 9.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/.storybook/decorators/WithPopupsProvider/WithPopupsProvider.d.ts +6 -1
  2. package/.storybook/decorators/WithWindowsContainerSizer/WithWindowsContainerSizer.d.ts +5 -0
  3. package/@types/types.d.ts +11 -0
  4. package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +3 -3
  5. package/components/AppBar/slots/AppBarSlots.d.ts +2 -2
  6. package/components/Chip/slots/ChipSlots.d.ts +1 -1
  7. package/components/Color/slots/ColorSlots.d.ts +1 -1
  8. package/components/CommonActions/components/ActionCancel/slots/ActionsCancelSlots.d.ts +1 -1
  9. package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.js +1 -1
  10. package/components/CommonActions/components/ActionFormCancel/slots/ActionFormCancelSlots.d.ts +1 -1
  11. package/components/CommonActions/components/ActionIntro/slots/ActionsIntroSlots.d.ts +1 -1
  12. package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts +1 -1
  13. package/components/DragResizeWindow/DragResizeWindow.d.ts +2 -2
  14. package/components/DragResizeWindow/DragResizeWindow.js +69 -11
  15. package/components/DragResizeWindow/DragResizeWindow.styles.js +0 -2
  16. package/components/DragResizeWindow/classes/index.js +1 -0
  17. package/components/DragResizeWindow/classes/types.d.ts +1 -0
  18. package/components/DragResizeWindow/helpers/draggingOrResizingWindow.d.ts +7 -0
  19. package/components/DragResizeWindow/helpers/draggingOrResizingWindow.js +1 -0
  20. package/components/DragResizeWindow/helpers/expandingParentContainer.d.ts +12 -0
  21. package/components/DragResizeWindow/helpers/expandingParentContainer.js +31 -0
  22. package/components/DragResizeWindow/helpers/getInitialSize.d.ts +15 -0
  23. package/components/DragResizeWindow/helpers/getInitialSize.js +56 -0
  24. package/components/DragResizeWindow/helpers/index.d.ts +6 -15
  25. package/components/DragResizeWindow/helpers/index.js +1 -37
  26. package/components/DragResizeWindow/helpers/isElmentInViewport.d.ts +15 -0
  27. package/components/DragResizeWindow/helpers/isElmentInViewport.js +1 -0
  28. package/components/DragResizeWindow/helpers/pointPosition.d.ts +36 -0
  29. package/components/DragResizeWindow/helpers/pointPosition.js +82 -0
  30. package/components/DragResizeWindow/helpers/shrinkingParentContainer.d.ts +6 -0
  31. package/components/DragResizeWindow/helpers/shrinkingParentContainer.js +34 -0
  32. package/components/DragResizeWindow/hooks/useDimensionEffects.d.ts +2 -0
  33. package/components/DragResizeWindow/hooks/useDimensionEffects.js +20 -223
  34. package/components/DragResizeWindow/hooks/useDragOptions.d.ts +8 -1
  35. package/components/DragResizeWindow/hooks/useDragOptions.js +79 -6
  36. package/components/DragResizeWindow/hooks/useResizeOptions.d.ts +11 -0
  37. package/components/DragResizeWindow/hooks/useResizeOptions.js +164 -19
  38. package/components/DragResizeWindow/slots/DragResizeWindowSlots.d.ts +2 -2
  39. package/components/DragResizeWindow/types.d.ts +53 -4
  40. package/components/DragResizeWindow/utils.d.ts +5 -2
  41. package/components/DragResizeWindow/utils.js +32 -13
  42. package/components/DragResizeWindowRND/DragResizeWindowRND.d.ts +19 -0
  43. package/components/DragResizeWindowRND/DragResizeWindowRND.js +224 -0
  44. package/components/DragResizeWindowRND/DragResizeWindowRND.styles.d.ts +5 -0
  45. package/components/DragResizeWindowRND/DragResizeWindowRND.styles.js +75 -0
  46. package/components/DragResizeWindowRND/classes/index.d.ts +2 -0
  47. package/components/DragResizeWindowRND/classes/index.js +18 -0
  48. package/components/DragResizeWindowRND/classes/types.d.ts +9 -0
  49. package/components/DragResizeWindowRND/constants.d.ts +3 -0
  50. package/components/DragResizeWindowRND/constants.js +6 -0
  51. package/components/DragResizeWindowRND/helpers/expandingParentContainer.d.ts +12 -0
  52. package/components/DragResizeWindowRND/helpers/expandingParentContainer.js +31 -0
  53. package/components/DragResizeWindowRND/helpers/getInitialSize.d.ts +15 -0
  54. package/components/DragResizeWindowRND/helpers/getInitialSize.js +56 -0
  55. package/components/DragResizeWindowRND/helpers/index.d.ts +5 -0
  56. package/components/DragResizeWindowRND/helpers/index.js +1 -0
  57. package/components/DragResizeWindowRND/helpers/isElmentInViewport.d.ts +15 -0
  58. package/components/DragResizeWindowRND/helpers/isElmentInViewport.js +1 -0
  59. package/components/DragResizeWindowRND/helpers/pointPosition.d.ts +36 -0
  60. package/components/DragResizeWindowRND/helpers/pointPosition.js +1 -0
  61. package/components/DragResizeWindowRND/helpers/shrinkingParentContainer.d.ts +6 -0
  62. package/components/DragResizeWindowRND/helpers/shrinkingParentContainer.js +34 -0
  63. package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.d.ts +23 -0
  64. package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.js +90 -0
  65. package/components/DragResizeWindowRND/hooks/useRNDDragOptions.d.ts +28 -0
  66. package/components/DragResizeWindowRND/hooks/useRNDDragOptions.js +220 -0
  67. package/components/DragResizeWindowRND/hooks/useRNDReResizeOptions.d.ts +45 -0
  68. package/components/DragResizeWindowRND/hooks/useRNDReResizeOptions.js +173 -0
  69. package/components/DragResizeWindowRND/icons.d.ts +3 -0
  70. package/components/DragResizeWindowRND/index.d.ts +2 -0
  71. package/components/DragResizeWindowRND/index.js +1 -0
  72. package/components/DragResizeWindowRND/slots/DragResizeWindowRNDSlots.d.ts +12 -0
  73. package/components/DragResizeWindowRND/slots/DragResizeWindowRNDSlots.js +19 -0
  74. package/components/DragResizeWindowRND/slots/slots.d.ts +5 -0
  75. package/components/DragResizeWindowRND/slots/slots.js +9 -0
  76. package/components/DragResizeWindowRND/types.d.ts +295 -0
  77. package/components/DragResizeWindowRND/utils.d.ts +15 -0
  78. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +4 -4
  79. package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
  80. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +2 -2
  81. package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
  82. package/components/GridLayout/GridLayout.d.ts +2 -1
  83. package/components/GridLayout/GridLayout.js +10 -5
  84. package/components/GridLayout/classes/index.d.ts +1 -1
  85. package/components/GridLayout/subcomponents/Responsive/index.d.ts +1 -1
  86. package/components/GridLayout/subcomponents/Responsive/index.js +4 -3
  87. package/components/GridLayout/subcomponents/Responsive/types.d.ts +4 -0
  88. package/components/GridLayout/subcomponents/withSizeProvider/index.d.ts +3 -1
  89. package/components/GridLayout/subcomponents/withSizeProvider/index.js +11 -15
  90. package/components/GridLayout/types.d.ts +4 -0
  91. package/components/Label/slots/LabelSlots.d.ts +1 -1
  92. package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +1 -1
  93. package/components/MFIsolationApp/MFIsolationApp.js +24 -11
  94. package/components/MFIsolationApp/types.d.ts +8 -1
  95. package/components/MFLoader/styles.js +17 -2
  96. package/components/MFLoader/types.d.ts +19 -2
  97. package/components/MenuActions/slots/MenuActionsSlots.d.ts +2 -2
  98. package/components/ModalDialog/ModalDialog.js +2 -2
  99. package/components/ModalDialog/slots/ModalDialogSlots.d.ts +2 -2
  100. package/components/NumberInput/slots/NumberInputSlots.d.ts +2 -2
  101. package/components/ToastContainer/slots/toastContainerSlots.d.ts +2 -2
  102. package/components/ToastContainer/slots/toastContainerSlots.js +1 -1
  103. package/components/WindowBase/WindowBase.js +3 -5
  104. package/components/WindowBase/WindowBase.styles.js +26 -17
  105. package/components/{areas/contexts/DynamicMFParmsContext/index.js → WindowBase/contexts/DynamicMFParmsContext/DynamicMFParmsContext.js} +2 -2
  106. package/components/WindowBase/contexts/DynamicMFParmsContext/index.d.ts +4 -0
  107. package/components/WindowBase/contexts/DynamicMFParmsContext/index.js +1 -0
  108. package/components/{areas → WindowBase}/contexts/DynamicMFParmsContext/store.d.ts +0 -1
  109. package/components/{areas/contexts/WindowToolsMFContext/index.js → WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.js} +4 -3
  110. package/components/WindowBase/contexts/WindowToolsMFContext/index.d.ts +2 -0
  111. package/components/WindowBase/contexts/WindowToolsMFContext/index.js +1 -0
  112. package/components/{areas → WindowBase}/contexts/WindowToolsMFContext/types.d.ts +3 -2
  113. package/components/WindowBase/contexts/index.d.ts +2 -0
  114. package/components/WindowBase/helpers.d.ts +22 -0
  115. package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/helper.js → WindowBase/helpers.js} +17 -13
  116. package/components/{areas → WindowBase}/hooks/useDynamicMFParameters/index.js +9 -1
  117. package/components/{areas → WindowBase}/hooks/useWindowToolsMF/index.js +1 -1
  118. package/components/WindowBase/index.d.ts +5 -0
  119. package/components/WindowBase/slots/WindowBaseEnum.d.ts +2 -1
  120. package/components/WindowBase/slots/WindowBaseEnum.js +1 -0
  121. package/components/WindowBase/slots/WindowBaseSlots.d.ts +45 -14
  122. package/components/WindowBase/slots/WindowBaseSlots.js +10 -5
  123. package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window → WindowBase}/subcomponents/Component/index.d.ts +1 -1
  124. package/components/{areas/components/AreasViewer/subcomponents/Area/subcomponents/Window → WindowBase}/subcomponents/Component/index.js +6 -6
  125. package/components/WindowBase/subcomponents/Component/types.d.ts +9 -0
  126. package/components/WindowBase/subcomponents/EditionInfo/EditionInfo.js +1 -1
  127. package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +52 -24
  128. package/components/WindowBase/subcomponents/Header/types.d.ts +1 -38
  129. package/components/WindowBase/subcomponents/MicroFrontend/MicroFrontend.d.ts +8 -0
  130. package/components/WindowBase/subcomponents/MicroFrontend/MicroFrontend.js +10 -0
  131. package/components/WindowBase/subcomponents/MicroFrontend/types.d.ts +8 -0
  132. package/components/WindowBase/types.d.ts +52 -18
  133. package/components/WindowConfirm/WindowConfirm.js +1 -1
  134. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +2 -2
  135. package/components/areas/components/AreasViewer/AreasViewer.d.ts +1 -1
  136. package/components/areas/components/AreasViewer/AreasViewer.js +7 -9
  137. package/components/areas/components/AreasViewer/AreasViewer.styles.js +12 -11
  138. package/components/areas/components/AreasViewer/slots/AreasViewerEnum.d.ts +2 -2
  139. package/components/areas/components/AreasViewer/slots/AreasViewerEnum.js +1 -1
  140. package/components/areas/components/AreasViewer/slots/AreasViewerSlots.d.ts +3 -3
  141. package/components/areas/components/AreasViewer/slots/AreasViewerSlots.js +6 -5
  142. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +44 -4
  143. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.d.ts +7 -5
  144. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +9 -9
  145. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions.d.ts +12 -0
  146. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions.js +58 -0
  147. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.d.ts +6 -0
  148. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.js +88 -0
  149. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/{useWindow/useWindow.d.ts → useWindow.d.ts} +7 -7
  150. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/{useWindow/useWindow.js → useWindow.js} +13 -11
  151. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/types.d.ts +7 -3
  152. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/WindowModal.d.ts +5 -4
  153. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/WindowModal.js +25 -25
  154. package/components/areas/components/AreasViewer/types.d.ts +3 -1
  155. package/components/areas/components/index.d.ts +1 -1
  156. package/components/areas/constants.d.ts +1 -0
  157. package/components/areas/constants.js +3 -1
  158. package/components/areas/contexts/AreasContext/helpers/generateModuleCount.d.ts +2 -2
  159. package/components/areas/contexts/AreasContext/helpers/getWindowForAreaTest.d.ts +2 -2
  160. package/components/areas/contexts/AreasContext/helpers/helper.d.ts +4 -4
  161. package/components/areas/contexts/AreasContext/helpers/helper.js +6 -8
  162. package/components/areas/contexts/AreasContext/helpers/selectLayout.d.ts +6 -0
  163. package/components/areas/contexts/AreasContext/helpers/selectLayout.js +27 -0
  164. package/components/areas/contexts/AreasContext/index.d.ts +4 -4
  165. package/components/areas/contexts/AreasContext/index.js +24 -4
  166. package/components/areas/contexts/AreasContext/store.d.ts +4 -4
  167. package/components/areas/contexts/AreasContext/store.js +128 -86
  168. package/components/areas/contexts/AreasContext/types.d.ts +142 -31
  169. package/components/areas/contexts/index.d.ts +0 -6
  170. package/components/areas/hooks/index.d.ts +0 -2
  171. package/components/areas/hooks/useAreas/index.d.ts +5 -5
  172. package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle.js +2 -2
  173. package/components/areas/types.d.ts +109 -100
  174. package/components/extended/React-Resizable/Resizable/Resizable.js +2 -1
  175. package/components/extended/React-Resizable/Resizable/slots/ResizableSlots.d.ts +1 -1
  176. package/components/extended/React-Resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
  177. package/components/extended/React-Resizable/helpers.d.ts +6 -1
  178. package/components/extended/React-Resizable/helpers.js +11 -2
  179. package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
  180. package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +2 -2
  181. package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
  182. package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
  183. package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +2 -2
  184. package/components/index.d.ts +1 -0
  185. package/components/mui_extended/Accordion/slots/AccordionSlots.d.ts +2 -2
  186. package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +4 -4
  187. package/components/mui_extended/Avatar/slots/AvatarSlots.d.ts +1 -1
  188. package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
  189. package/components/mui_extended/Button/slots/ButtonSlots.d.ts +1 -1
  190. package/components/mui_extended/CheckBox/slots/CheckBoxSlots.d.ts +1 -1
  191. package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.d.ts +4 -4
  192. package/components/mui_extended/Divider/slots/DividerSlots.d.ts +1 -1
  193. package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +2 -2
  194. package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +1 -1
  195. package/components/mui_extended/MenuDivider/slots/MenuDividerSlots.d.ts +1 -1
  196. package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +1 -1
  197. package/components/mui_extended/MenuItem/types.d.ts +1 -1
  198. package/components/mui_extended/Popper/slots/PopperStlots.d.ts +1 -1
  199. package/components/mui_extended/Select/slots/SelectSlots.d.ts +2 -2
  200. package/components/mui_extended/Select/slots/SelectSlots.js +1 -1
  201. package/components/mui_extended/Skeleton/Slots/skeletonSlots.d.ts +1 -1
  202. package/components/mui_extended/Stack/slots/StackSlot.d.ts +1 -1
  203. package/components/mui_extended/Tab/Slots/TabSlots.d.ts +1 -1
  204. package/components/mui_extended/Tabs/slots/TabsSlots.d.ts +1 -1
  205. package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +1 -1
  206. package/components/mui_extended/TimePicker/slots/TimePickerSlots.d.ts +3 -3
  207. package/components/mui_extended/ToggleButton/slots/ToggleButtonSlots.d.ts +1 -1
  208. package/components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.d.ts +1 -1
  209. package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
  210. package/components/popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.d.ts +8 -2
  211. package/components/popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.js +6 -24
  212. package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.d.ts +9 -3
  213. package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +278 -211
  214. package/components/popups/components/PopupsProvider/contexts/PopupsContext/tests/PopupContext.test.d.ts +1 -0
  215. package/components/popups/components/PopupsProvider/contexts/PopupsContext/tests/PopusContext.store.test.d.ts +1 -0
  216. package/components/popups/components/PopupsProvider/contexts/PopupsContext/tests/__mocks__/storeMock.d.ts +29 -0
  217. package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +183 -79
  218. package/components/popups/components/PopupsProvider/hooks/{useHeaderActionsPopups/useHeaderActionsPopups.d.ts → useHeaderActionsPopups.d.ts} +2 -8
  219. package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups.js +60 -0
  220. package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +43 -0
  221. package/components/popups/components/PopupsProvider/hooks/usePopups.js +138 -0
  222. package/components/popups/components/PopupsProvider/hooks/usePopupsStore.d.ts +5 -0
  223. package/components/popups/components/PopupsProvider/hooks/{usePopupsStore/index.js → usePopupsStore.js} +1 -1
  224. package/components/popups/components/PopupsViewer/PopupsViewer.d.ts +13 -4
  225. package/components/popups/components/PopupsViewer/PopupsViewer.js +27 -6
  226. package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +3 -11
  227. package/components/popups/components/PopupsViewer/slots/popupsViewerSlots.d.ts +7 -10
  228. package/components/popups/components/PopupsViewer/slots/popupsViewerSlots.js +3 -8
  229. package/components/popups/components/PopupsViewer/slots/slots.d.ts +1 -2
  230. package/components/popups/components/PopupsViewer/slots/slots.js +0 -1
  231. package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.d.ts +1 -1
  232. package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +69 -53
  233. package/components/popups/components/PopupsViewer/subcomponents/Popup/types.d.ts +16 -0
  234. package/components/popups/components/PopupsViewer/tests/PopupsViewer.integration.test.d.ts +1 -0
  235. package/components/popups/components/PopupsViewer/types.d.ts +13 -5
  236. package/contexts/AppearanceComponentContext/AppearanceComponentContext.d.ts +8 -0
  237. package/contexts/AppearanceComponentContext/AppearanceComponentContext.js +4 -3
  238. package/contexts/AppearanceComponentContext/AppearanceComponentStore.d.ts +8 -1
  239. package/contexts/AppearanceComponentContext/AppearanceComponentStore.js +10 -3
  240. package/contexts/index.d.ts +1 -1
  241. package/hooks/useDataGridPersistence/useDataGridPersistence.js +4 -4
  242. package/hooks/useDynamicFilterAndSort/types.d.ts +1 -1
  243. package/hooks/useSizeContainer/index.js +2 -2
  244. package/index.js +91 -85
  245. package/not_recognized/index.js +1280 -0
  246. package/package.json +2 -1
  247. package/storybook/components/Areas/AreasViewer/{AreasViewr.stories.d.ts → AreasViewer.stories.d.ts} +2 -2
  248. package/storybook/components/Areas/AreasViewer/hooks/useWindowsActions.d.ts +4 -0
  249. package/storybook/components/Areas/AreasViewer/subcomponents/AreasViewerRender.d.ts +4 -0
  250. package/storybook/components/Areas/AreasViewer/subcomponents/Launcher/Launcher.d.ts +5 -0
  251. package/storybook/components/Areas/AreasViewer/subcomponents/Launcher/PopupButton.d.ts +21 -0
  252. package/storybook/components/Areas/AreasViewer/subcomponents/Launcher/PopupContentExample.d.ts +4 -0
  253. package/storybook/components/Areas/AreasViewer/subcomponents/layouts/ClientsLayout.d.ts +4 -0
  254. package/storybook/components/Areas/AreasViewer/subcomponents/layouts/UsersLayout.d.ts +4 -0
  255. package/storybook/components/DragResizeWindowRND/stories/DragResizeWindowRND.stories.d.ts +8 -0
  256. package/storybook/components/DragResizeWindowRND/stories/constants.d.ts +3 -0
  257. package/storybook/components/DragResizeWindowRND/stories/subcomponents/ContentExample.d.ts +4 -0
  258. package/storybook/components/DragResizeWindowRND/stories/subcomponents/RNDWindowsContainer/RNDWindowsContainer.d.ts +5 -0
  259. package/storybook/components/DragResizeWindowRND/stories/subcomponents/RNDWindowsContainer/index.d.ts +1 -0
  260. package/storybook/components/DragResizeWindowRND/stories/subcomponents/RNDWindowsContainer/types.d.ts +4 -0
  261. package/storybook/components/{Areas/AreasViewer → DragResizeWindowRND/stories}/subcomponents/WithExtendedContainer.d.ts +1 -1
  262. package/storybook/components/DragResizeWindowRND/stories/types.d.ts +3 -0
  263. package/storybook/components/PopupsViewer/basic.stories.d.ts +12 -2
  264. package/storybook/components/PopupsViewer/subcomponents/PopupActions.d.ts +3 -1
  265. package/storybook/components/PopupsViewer/subcomponents/PopupContentExample.d.ts +2 -1
  266. package/storybook/components/PopupsViewer/subcomponents/initialPopups.d.ts +1 -1
  267. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/helper.d.ts +0 -22
  268. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/useHeaderActions.d.ts +0 -28
  269. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/useHeaderActions.js +0 -155
  270. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/types.d.ts +0 -10
  271. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/MicroFrontend.d.ts +0 -8
  272. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/MicroFrontend.js +0 -10
  273. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/types.d.ts +0 -8
  274. package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups/helper.d.ts +0 -28
  275. package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups/helper.js +0 -44
  276. package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups/useHeaderActionsPopups.js +0 -157
  277. package/components/popups/components/PopupsProvider/hooks/usePopops/usePopups.d.ts +0 -28
  278. package/components/popups/components/PopupsProvider/hooks/usePopops/usePopups.js +0 -117
  279. package/components/popups/components/PopupsProvider/hooks/usePopupsStore/index.d.ts +0 -6
  280. package/storybook/components/Areas/AreasViewer/subcomponents/ClientsHeaderActions.d.ts +0 -4
  281. package/storybook/components/Areas/AreasViewer/subcomponents/UsersHeaderActions.d.ts +0 -4
  282. /package/components/{popups/components/PopupsProvider/tests/PopupsProvider.test.d.ts → DragResizeWindowRND/tests/DragResizeWindow.test.d.ts} +0 -0
  283. /package/components/{areas/contexts/DynamicMFParmsContext/index.d.ts → WindowBase/contexts/DynamicMFParmsContext/DynamicMFParmsContext.d.ts} +0 -0
  284. /package/components/{areas → WindowBase}/contexts/DynamicMFParmsContext/store.js +0 -0
  285. /package/components/{areas → WindowBase}/contexts/DynamicMFParmsContext/types.d.ts +0 -0
  286. /package/components/{areas/contexts/WindowToolsMFContext/index.d.ts → WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.d.ts} +0 -0
  287. /package/components/{areas → WindowBase}/hooks/useDynamicMFParameters/index.d.ts +0 -0
  288. /package/components/{areas → WindowBase}/hooks/useWindowToolsMF/index.d.ts +0 -0
@@ -5,7 +5,9 @@ import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
5
5
  import { a as areasViewerClasses } from "../../../../classes/index.js";
6
6
  import clsx from "clsx";
7
7
  import { R as RESPONSIVE_COLAPSED_HEIGHTS, a as RESPONSIVE_ROW_HEIGHTS, M as MARGIN_GRIDLAYOUT, P as PADDING_GRIDLAYOUT } from "../../../../../../contexts/AreasContext/helpers/helper.js";
8
- import { d as dragResizeWindowClasses } from "../../../../../../../DragResizeWindow/classes/index.js";
8
+ import { M as MemonizePopupsViewer } from "../../../../../../../popups/components/PopupsViewer/PopupsViewer.js";
9
+ import { useState } from "react";
10
+ import { d as dragResizeWindowRNDClasses } from "../../../../../../../DragResizeWindowRND/classes/index.js";
9
11
  import { w as withSizeProvider } from "../../../../../../../GridLayout/subcomponents/withSizeProvider/index.js";
10
12
  import { R as Responsive } from "../../../../../../../GridLayout/subcomponents/Responsive/index.js";
11
13
  const ResponsiveGridLayout = withSizeProvider(Responsive);
@@ -20,9 +22,36 @@ const AreaGridLayout = (props) => {
20
22
  (state) => state.areaActions,
21
23
  shallow
22
24
  );
25
+ const [gridLayouContainer, setGridLayouContainer] = useState(void 0);
26
+ const onResizeStart = () => {
27
+ if (gridLayouContainer) {
28
+ gridLayouContainer.classList.add(dragResizeWindowRNDClasses.resizing);
29
+ }
30
+ };
31
+ const onResizeStop = () => {
32
+ if (gridLayouContainer) {
33
+ gridLayouContainer.classList.remove(dragResizeWindowRNDClasses.resizing);
34
+ }
35
+ };
36
+ const onDragStart = () => {
37
+ if (gridLayouContainer) {
38
+ gridLayouContainer.classList.add(dragResizeWindowRNDClasses.dragging);
39
+ }
40
+ };
41
+ const onDragStop = () => {
42
+ if (gridLayouContainer) {
43
+ gridLayouContainer.classList.remove(dragResizeWindowRNDClasses.dragging);
44
+ }
45
+ };
46
+ const setContainerElementRef = (nodeElement) => {
47
+ if (nodeElement && nodeElement !== gridLayouContainer) {
48
+ setGridLayouContainer(nodeElement);
49
+ }
50
+ };
23
51
  return /* @__PURE__ */ jsx(
24
52
  ResponsiveGridLayout,
25
53
  {
54
+ ref: setContainerElementRef,
26
55
  autoSize: false,
27
56
  compactType: "vertical",
28
57
  measureBeforeMount: true,
@@ -33,8 +62,8 @@ const AreaGridLayout = (props) => {
33
62
  ),
34
63
  layouts,
35
64
  onLayoutChange: (layout, newLayouts) => onBreakpointsLayoutsChange(areaId, layout, newLayouts),
36
- draggableHandle: `.${dragResizeWindowClasses.draggableHandle}`,
37
- draggableCancel: `.${dragResizeWindowClasses.draggableCancel}`,
65
+ draggableHandle: `.${dragResizeWindowRNDClasses.draggableHandle}`,
66
+ draggableCancel: `.${dragResizeWindowRNDClasses.draggableCancel}`,
38
67
  layoutItemRender: (p) => {
39
68
  if (hashLayoutItems.indexOf(p.i) === -1) {
40
69
  return /* @__PURE__ */ jsx(Fragment, {});
@@ -54,7 +83,18 @@ const AreaGridLayout = (props) => {
54
83
  onContainerChange(areaId, e);
55
84
  },
56
85
  preventCollision: false,
57
- maximizeId: maximizedId
86
+ maximizeId: maximizedId,
87
+ children: /* @__PURE__ */ jsx(
88
+ MemonizePopupsViewer,
89
+ {
90
+ groupId: areaId,
91
+ containerElement: gridLayouContainer,
92
+ onResizeStart,
93
+ onResizeStop,
94
+ onDragStart,
95
+ onDragStop
96
+ }
97
+ )
58
98
  }
59
99
  );
60
100
  };
@@ -1,5 +1,11 @@
1
1
  import { default as React } from 'react';
2
- import { WindowProps } from './types';
2
+ /**
3
+ *
4
+ */
5
+ export type WindowProps = {
6
+ windowId: string;
7
+ areaId?: string;
8
+ };
3
9
  /**
4
10
  * Componente Window
5
11
  *
@@ -7,10 +13,6 @@ import { WindowProps } from './types';
7
13
  * Lee los datos y configuraciones de la ventana desde el store de Zustand,
8
14
  * crea herramientas para el microfrontend o componente y utiliza un hook
9
15
  * personalizado para definir las acciones del header.
10
- * @param {WindowProps} props - Propiedades del componente, que incluyen areaId y windowId.
11
- * @returns {JSX.Element|null} Renderiza la ventana o null si aún no se carga.
12
- * @example
13
- * <Window areaId="area_123" windowId="win_456" />
14
16
  */
15
17
  export declare const Window: (props: WindowProps) => import("react/jsx-runtime").JSX.Element | null;
16
18
  export declare const MemonizedWindow: React.MemoExoticComponent<(props: WindowProps) => import("react/jsx-runtime").JSX.Element | null>;
@@ -1,12 +1,12 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
- import { M as MemonizedMicroFrontend } from "./subcomponents/MicroFrontend/MicroFrontend.js";
4
- import { C as Component } from "./subcomponents/Component/index.js";
3
+ import { M as MemonizedWindowBaseMicroFrontend } from "../../../../../../../WindowBase/subcomponents/MicroFrontend/MicroFrontend.js";
4
+ import { W as WindowBaseComponent } from "../../../../../../../WindowBase/subcomponents/Component/index.js";
5
5
  import { T as TEST_PROP_ID } from "../../../../../../../../test/constants_no_mock.js";
6
6
  import { a as getNameDataTestId } from "../../../../../../../../test/getNameDataTestId.js";
7
7
  import { A as AREAS_VIEWER_CLASS_NAME } from "../../../../../../constants.js";
8
- import { u as useWindow } from "./hooks/useWindow/useWindow.js";
9
- import { W as WindowBase } from "../../../../../../../WindowBase/WindowBase.js";
8
+ import { u as useWindow } from "./hooks/useWindow.js";
9
+ import { W as WindowBaseStyled } from "../../../../slots/AreasViewerSlots.js";
10
10
  const Window = (props) => {
11
11
  const { areaId, windowId } = props;
12
12
  const {
@@ -26,13 +26,14 @@ const Window = (props) => {
26
26
  windowTools,
27
27
  onTouch,
28
28
  memoizedActions
29
- } = useWindow(areaId, windowId);
29
+ } = useWindow(windowId, areaId);
30
30
  if (status === void 0) {
31
31
  return null;
32
32
  }
33
33
  return /* @__PURE__ */ jsx(
34
- WindowBase,
34
+ WindowBaseStyled,
35
35
  {
36
+ ownerState: {},
36
37
  title: `${title}${moduleCount ? `:${moduleCount}` : ""}`,
37
38
  iconUrl,
38
39
  isLoading: loading,
@@ -50,7 +51,7 @@ const Window = (props) => {
50
51
  )
51
52
  } : {},
52
53
  children: status === "loaded" ? winType === "microfrontend" ? /* @__PURE__ */ jsx(
53
- MemonizedMicroFrontend,
54
+ MemonizedWindowBaseMicroFrontend,
54
55
  {
55
56
  moduleId,
56
57
  dynamicMFStore,
@@ -58,9 +59,8 @@ const Window = (props) => {
58
59
  ...mfProps
59
60
  }
60
61
  ) : /* @__PURE__ */ jsx(
61
- Component,
62
+ WindowBaseComponent,
62
63
  {
63
- moduleId,
64
64
  dynamicMFStore,
65
65
  windowTools,
66
66
  component
@@ -0,0 +1,12 @@
1
+ import { WindowBaseAction } from '../../../../../../../../WindowBase/types';
2
+ import { UseHeaderActionsParams } from '../types';
3
+ /**
4
+ * Hook useHeaderActions
5
+ *
6
+ * Retorna las acciones del header de una ventana. Izquierda, derecha y dentro del menu.
7
+ */
8
+ export declare const useHeaderActions: ({ windowId, areaId, }: UseHeaderActionsParams) => {
9
+ leftActions: WindowBaseAction[];
10
+ insideActions: WindowBaseAction[];
11
+ rightActions: WindowBaseAction[];
12
+ };
@@ -0,0 +1,58 @@
1
+ import { useMemo } from "react";
2
+ import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
+ import { u as useAreasStore } from "../../../../../../../hooks/useAreas/index.js";
4
+ import { shallow } from "zustand/shallow";
5
+ import { useIsMobile } from "@m4l/graphics";
6
+ import { g as getLeftActions, a as getInsideMenuActions } from "../../../../../../../../WindowBase/helpers.js";
7
+ import { u as useRightActions } from "./useRightActions.js";
8
+ const useHeaderActions = ({
9
+ windowId,
10
+ areaId
11
+ }) => {
12
+ const { host_static_assets, environment_assets } = useEnvironment();
13
+ const { getLabel } = useModuleDictionary();
14
+ const isMobile = useIsMobile();
15
+ const urlPrefix = `${host_static_assets}/${environment_assets}`;
16
+ const moduleActions = useAreasStore(
17
+ (state) => {
18
+ const window = state.hashWindows[windowId];
19
+ return window?.moduleActions || [];
20
+ },
21
+ shallow
22
+ );
23
+ const leftActions = useMemo(() => {
24
+ return getLeftActions(isMobile, moduleActions);
25
+ }, [!isMobile, moduleActions]);
26
+ const windowOptions = useAreasStore(
27
+ (state) => state.hashWindows[windowId]?.windowOptions,
28
+ shallow
29
+ );
30
+ const { saveModuleCookies, resetModuleCookies } = useAreasStore(
31
+ (state) => state.windowActions,
32
+ shallow
33
+ );
34
+ const insideActions = useMemo(() => {
35
+ return getInsideMenuActions({
36
+ windowId,
37
+ isMobile,
38
+ moduleActions,
39
+ urlPrefix,
40
+ saveModuleCookies,
41
+ resetModuleCookies,
42
+ windowOptions: windowOptions || { allowPersistCookies: false },
43
+ getLabel
44
+ });
45
+ }, [windowId, isMobile, moduleActions, urlPrefix, saveModuleCookies, resetModuleCookies, windowOptions, getLabel]);
46
+ const rightActions = useRightActions({
47
+ windowId,
48
+ areaId
49
+ });
50
+ return {
51
+ leftActions,
52
+ insideActions,
53
+ rightActions
54
+ };
55
+ };
56
+ export {
57
+ useHeaderActions as u
58
+ };
@@ -0,0 +1,6 @@
1
+ import { WindowBaseAction } from '../../../../../../../../WindowBase/types';
2
+ import { UseHeaderActionsParams } from '../types';
3
+ /**
4
+ * Hook useRightActions, retorna las acciones de maximizar y minimizar una ventana, colapsar y expandir una ventana
5
+ */
6
+ export declare const useRightActions: ({ windowId, areaId, }: UseHeaderActionsParams) => WindowBaseAction[];
@@ -0,0 +1,88 @@
1
+ import { useMemo } from "react";
2
+ import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
+ import { u as useAreasStore } from "../../../../../../../hooks/useAreas/index.js";
4
+ import { shallow } from "zustand/shallow";
5
+ import { I as ICONS } from "../../../../../../../icons.js";
6
+ import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../../../../../dictionary.js";
7
+ const useRightActions = ({
8
+ windowId,
9
+ areaId
10
+ }) => {
11
+ const { host_static_assets, environment_assets } = useEnvironment();
12
+ const { getLabel } = useModuleDictionary();
13
+ const collapsed = useAreasStore(
14
+ (state) => {
15
+ const area = areaId ? state.hashAreas[areaId] : void 0;
16
+ if (area && area.currentBreakpoint && area.layouts && area.layouts[area.currentBreakpoint]) {
17
+ return area.layouts[area.currentBreakpoint].find(
18
+ (li) => li.i === windowId
19
+ )?.colapsed || false;
20
+ }
21
+ return false;
22
+ },
23
+ shallow
24
+ );
25
+ const maximizedId = useAreasStore(
26
+ (state) => areaId ? state.hashAreas[areaId]?.maximizedId : void 0,
27
+ shallow
28
+ );
29
+ const { maximizeLayout, normalizeLayouts, colapseLayoutItem, unColapseLayoutItem } = useAreasStore((state) => state.areaActions);
30
+ const rightActions = useMemo(() => {
31
+ const actions = [];
32
+ actions.push({
33
+ place: "right",
34
+ key: "maximize",
35
+ iconUrl: maximizedId ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.NORMALIZE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.MAXIMIZE}`,
36
+ label: maximizedId ? getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_minimize_window)) : getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_maximize_window)),
37
+ /**
38
+ * Acción de maximize/normalize.
39
+ */
40
+ onClick: () => {
41
+ if (areaId) {
42
+ if (maximizedId) {
43
+ normalizeLayouts(areaId);
44
+ } else {
45
+ maximizeLayout(areaId, windowId);
46
+ }
47
+ }
48
+ },
49
+ disabled: false
50
+ });
51
+ actions.push({
52
+ place: "right",
53
+ key: "collapseToggle",
54
+ iconUrl: !collapsed ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.COLAPSE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.UNCOLPASE}`,
55
+ label: !collapsed ? getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_collapse_window)) : getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_uncollapse_window)),
56
+ /**
57
+ * Acción de collapse/expand.
58
+ */
59
+ onClick: () => {
60
+ if (areaId) {
61
+ if (collapsed) {
62
+ unColapseLayoutItem(areaId, windowId);
63
+ } else {
64
+ colapseLayoutItem(areaId, windowId);
65
+ }
66
+ }
67
+ },
68
+ disabled: !(maximizedId === void 0)
69
+ });
70
+ return actions;
71
+ }, [
72
+ collapsed,
73
+ maximizedId,
74
+ host_static_assets,
75
+ environment_assets,
76
+ getLabel,
77
+ areaId,
78
+ windowId,
79
+ colapseLayoutItem,
80
+ unColapseLayoutItem,
81
+ normalizeLayouts,
82
+ maximizeLayout
83
+ ]);
84
+ return rightActions;
85
+ };
86
+ export {
87
+ useRightActions as u
88
+ };
@@ -1,15 +1,15 @@
1
- import { WindowToolsMF } from '../../../../../../../../contexts';
1
+ import { WindowToolsMF } from '../../../../../../../../WindowBase/contexts';
2
2
  /**
3
3
  * Hook useWindow
4
4
  *
5
5
  * Este hook encapsula toda la lógica relacionada con el estado y las funciones necesarias
6
6
  * para el componente Window. Retorna un objeto con el estado, las acciones y las herramientas
7
7
  * de la ventana.
8
- * @param {string} areaId - Identificador del área.
9
8
  * @param {string} windowId - Identificador de la ventana.
9
+ * @param {string} areaId - Identificador del área.
10
10
  * @returns {Object} Un objeto con el estado, las acciones y las herramientas de la ventana.
11
11
  */
12
- export declare const useWindow: (areaId: string, windowId: string) => {
12
+ export declare const useWindow: (windowId: string, areaId?: string) => {
13
13
  emergeType: "layout" | "popup" | "modal";
14
14
  moduleId: string;
15
15
  winType: "component" | "microfrontend";
@@ -21,11 +21,11 @@ export declare const useWindow: (areaId: string, windowId: string) => {
21
21
  mfProps: any;
22
22
  component: any;
23
23
  loading: boolean;
24
- status: import('../../../../../../../../types').WindowStatus;
25
- dynamicMFStore: Omit<import('zustand').StoreApi<import('../../../../../../../../contexts/DynamicMFParmsContext/store').DynamicMFStateWithActions>, "setState"> & {
26
- setState(nextStateOrUpdater: import('../../../../../../../../contexts/DynamicMFParmsContext/store').DynamicMFStateWithActions | Partial<import('../../../../../../../../contexts/DynamicMFParmsContext/store').DynamicMFStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('../../../../../../../../contexts/DynamicMFParmsContext/store').DynamicMFStateWithActions>) => void), shouldReplace?: boolean | undefined): void;
24
+ status: import('../../../../../../../types').WindowStatus;
25
+ dynamicMFStore: Omit<import('zustand').StoreApi<import('../../../../../../../../WindowBase/contexts/DynamicMFParmsContext/store').DynamicMFStateWithActions>, "setState"> & {
26
+ setState(nextStateOrUpdater: import('../../../../../../../../WindowBase/contexts/DynamicMFParmsContext/store').DynamicMFStateWithActions | Partial<import('../../../../../../../../WindowBase/contexts/DynamicMFParmsContext/store').DynamicMFStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('../../../../../../../../WindowBase/contexts/DynamicMFParmsContext/store').DynamicMFStateWithActions>) => void), shouldReplace?: boolean | undefined): void;
27
27
  };
28
28
  windowTools: WindowToolsMF;
29
29
  onTouch: () => void;
30
- memoizedActions: import('../../../../../../../../../WindowBase/types').WindowBaseAction[];
30
+ memoizedActions: import('../../../../../../../../WindowBase/types').WindowBaseAction[];
31
31
  };
@@ -1,12 +1,13 @@
1
1
  import { useMemo, useEffect } from "react";
2
2
  import { shallow } from "zustand/shallow";
3
- import { u as useAreasStore } from "../../../../../../../../hooks/useAreas/index.js";
4
- import { u as useHeaderActions } from "../useHeaderActions/useHeaderActions.js";
5
- import { c as createToaster } from "../../../../../../../../../ToastContainer/helpers/toaster.js";
6
- const useWindow = (areaId, windowId) => {
3
+ import { u as useAreasStore } from "../../../../../../../hooks/useAreas/index.js";
4
+ import { u as useHeaderActions } from "./useHeaderActions.js";
5
+ import { u as usePopupsStore } from "../../../../../../../../popups/components/PopupsProvider/hooks/usePopupsStore.js";
6
+ import { c as createToaster } from "../../../../../../../../ToastContainer/helpers/toaster.js";
7
+ const useWindow = (windowId, areaId) => {
7
8
  const [emergeType, moduleId, winType, title, iconUrl, version, moduleCount, selected, loading, status, dynamicMFStore] = useAreasStore((state) => {
8
9
  const window = state.hashWindows[windowId];
9
- const selected2 = state.hashAreas[areaId]?.currentLayoutId === windowId || state.hashAreas[areaId]?.currentPopUpId === windowId;
10
+ const selected2 = areaId ? state.hashAreas[areaId]?.currentLayoutId === windowId : false;
10
11
  return [
11
12
  window?.emergeType,
12
13
  window?.moduleId,
@@ -28,16 +29,18 @@ const useWindow = (areaId, windowId) => {
28
29
  );
29
30
  const { setActions, getCookie, getCookies, setCookie, close, startProgress, stopProgress, setFnQueryClose, setWindowTitle, loadCookiesFromApi } = useAreasStore((state) => state.windowActions, shallow);
30
31
  const { selectLayout } = useAreasStore((state) => state.areaActions, shallow);
32
+ const { setSelectedPopupId } = usePopupsStore((state) => state.popupsActions, shallow);
31
33
  const onTouch = () => {
32
- if (!selected) {
34
+ if (!selected && emergeType === "layout" && areaId) {
33
35
  selectLayout(areaId, windowId);
36
+ setSelectedPopupId(areaId, void 0);
34
37
  }
35
38
  };
36
39
  const windowTools = useMemo(
37
40
  () => ({
38
41
  getWindowId: () => windowId,
39
- setActions: (newActions) => {
40
- setActions(windowId, newActions, version);
42
+ setActions: (newActions, newVersion) => {
43
+ setActions(windowId, newActions, newVersion);
41
44
  },
42
45
  getCookie: (id) => getCookie(windowId, id),
43
46
  getCookies: (type) => getCookies(windowId, type),
@@ -65,10 +68,9 @@ const useWindow = (areaId, windowId) => {
65
68
  loadCookiesFromApi(windowId);
66
69
  }
67
70
  }, [status, loadCookiesFromApi, windowId]);
68
- const { leftActions, menuActions, rightActions } = useHeaderActions({
71
+ const { leftActions, insideActions: menuActions, rightActions } = useHeaderActions({
69
72
  windowId,
70
- areaId,
71
- menuActions: []
73
+ areaId
72
74
  });
73
75
  const memoizedActions = useMemo(() => {
74
76
  return [...leftActions, ...menuActions, ...rightActions];
@@ -1,8 +1,12 @@
1
- import { WindowBaseAction } from '../../../../../../../WindowBase/types';
2
- import { WindowBaseProps } from '../../../../../../types';
3
- export interface WindowProps extends Pick<WindowBaseProps, 'windowId' | 'areaId'> {
1
+ import { WindowBaseAction } from '../../../../../../../../../src/components/WindowBase/types';
2
+ import { AreaWindowBaseProps } from '../../../../../../types';
3
+ export interface WindowProps extends Pick<AreaWindowBaseProps, 'windowId' | 'areaId'> {
4
4
  /**
5
5
  * Acciones que se mostrarán en el header
6
6
  */
7
7
  actions?: WindowBaseAction[];
8
8
  }
9
+ export interface UseHeaderActionsParams {
10
+ windowId: string;
11
+ areaId?: string;
12
+ }
@@ -1,8 +1,9 @@
1
1
  import { default as React } from 'react';
2
- import { ModalProps } from '../../../../../../types';
3
- import { DialogProperties } from '../../../../../../../ModalDialog/types';
2
+ export type ModalProps = {
3
+ windowId: string;
4
+ };
4
5
  /**
5
6
  * A draggable and resizable window modal component.
6
7
  */
7
- export declare const WindowModal: (props: ModalProps, dialogProperties: DialogProperties) => import("react/jsx-runtime").JSX.Element;
8
- export declare const MemonizedWindowModal: React.MemoExoticComponent<(props: ModalProps, dialogProperties: DialogProperties) => import("react/jsx-runtime").JSX.Element>;
8
+ export declare const AreaWindowModal: (props: ModalProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const AreaMemonizedWindowModal: React.MemoExoticComponent<(props: ModalProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,46 +1,46 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
2
- import React, { useEffect } from "react";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React from "react";
3
3
  import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
4
4
  import { W as Window } from "../Window/Window.js";
5
5
  import { useIsMobile } from "@m4l/graphics";
6
6
  import { b as WrapperWindowModalStyled } from "../../../../slots/AreasViewerSlots.js";
7
7
  import { u as useStateRef } from "../../../../../../../../hooks/useStateRef/index.js";
8
- import { D as DragResizeWindow } from "../../../../../../../DragResizeWindow/DragResizeWindow.js";
8
+ import { D as DragResizeWindowRND } from "../../../../../../../DragResizeWindowRND/DragResizeWindowRND.js";
9
9
  import { D as Dialog } from "../../../../../../../mui_extended/Dialog/Dialog.js";
10
10
  const WrapperWindowModalWithRef = React.forwardRef(
11
11
  (props, ref) => /* @__PURE__ */ jsx(Dialog, { ref, ...props })
12
12
  );
13
- const WindowModal = (props, dialogProperties) => {
14
- const { initialWidth, initialHeight, maxWidth, maxHeight } = dialogProperties;
13
+ const AreaWindowModal = (props) => {
15
14
  const { windowId } = props;
16
- const { onClose } = useAreasStore((state) => state.hashWindowsModals[windowId]);
15
+ const { onClose } = useAreasStore((state) => state.hashWindows[windowId]);
16
+ const { width = 400, height = 200, minWindowWidth = 400, minWindowHeight = 200 } = useAreasStore(
17
+ (state) => state.hashWindows[windowId].emergeType === "modal" ? state.hashWindows[windowId].modalProps : {
18
+ width: 400,
19
+ height: 200,
20
+ minWindowWidth: 400,
21
+ minWindowHeight: 200
22
+ }
23
+ );
17
24
  const isMobile = useIsMobile();
18
25
  const [containerRef, setContainerRef] = useStateRef(null);
19
- useEffect(() => {
20
- const container = containerRef;
21
- if (!container) {
22
- console.warn("El containerRef es null en useLayoutEffect");
23
- return;
24
- }
25
- }, [initialHeight, initialWidth, containerRef]);
26
- const topPosition = Math.max(0, window.innerHeight / 2 - (initialHeight ?? 100) / 2);
27
- const leftPosition = Math.max(0, window.innerWidth / 2 - (initialWidth ?? 100) / 2);
26
+ const leftPosition = Math.max(0, window.innerWidth / 2 - (width ?? 100) / 2);
27
+ const topPosition = Math.max(0, window.innerHeight / 2 - (height ?? 100) / 2);
28
28
  const DraggableComponent = () => {
29
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
30
- DragResizeWindow,
29
+ return /* @__PURE__ */ jsx(
30
+ DragResizeWindowRND,
31
31
  {
32
32
  containerElement: containerRef ?? void 0,
33
- minWindowWidth: maxWidth,
34
- minWindowHeight: maxHeight,
33
+ minWindowWidth,
34
+ minWindowHeight,
35
35
  bounds: { left: 0, top: 0, right: 0, bottom: 0 },
36
36
  resizeHandles: ["se", "nw", "sw", "ne", "n", "e", "s", "w"],
37
37
  defaultPosition: {
38
- vertical: { top: topPosition, height: initialHeight ?? 100 },
39
- horizontal: { left: leftPosition, width: initialWidth ?? 200 }
38
+ vertical: { top: topPosition, height },
39
+ horizontal: { left: leftPosition, width }
40
40
  },
41
- children: /* @__PURE__ */ jsx(Window, { ...props })
41
+ children: /* @__PURE__ */ jsx(Window, { windowId, areaId: void 0 })
42
42
  }
43
- ) });
43
+ );
44
44
  };
45
45
  return /* @__PURE__ */ jsx(
46
46
  WrapperWindowModalWithRef,
@@ -70,7 +70,7 @@ const WindowModal = (props, dialogProperties) => {
70
70
  }
71
71
  );
72
72
  };
73
- const MemonizedWindowModal = React.memo(WindowModal);
73
+ const AreaMemonizedWindowModal = React.memo(AreaWindowModal);
74
74
  export {
75
- MemonizedWindowModal as M
75
+ AreaMemonizedWindowModal as A
76
76
  };
@@ -18,5 +18,7 @@ export interface AreasViewerProps {
18
18
  */
19
19
  [key: string]: unknown;
20
20
  }
21
- export type AreasViewerOwnerState = Pick<AreaProps, 'selected'>;
21
+ export type AreasViewerOwnerState = Pick<AreaProps, 'selected'> & {
22
+ isDraggingResizingPopup?: boolean;
23
+ };
22
24
  export type AreasViewerStyles = M4LOverridesStyleRules<AreasViewerType, typeof AREAS_VIEWER_KEY_COMPONENT, Theme>;
@@ -1,3 +1,3 @@
1
1
  export * from './AreasAdmin/AreasAdmin';
2
2
  export * from './AreasViewer/AreasViewer';
3
- export type { NewWindowProps as NewWindow } from '../types';
3
+ export type { EmmitNewWindowProps as NewWindow } from '../types';
@@ -1,3 +1,4 @@
1
1
  export declare const COMPONENT_TEST_ID = "M4LAreasViewer";
2
2
  export declare const AREAS_VIEWER_CLASS_NAME = "M4LAreasViewer";
3
3
  export declare const AREAS_ADMIN_CLASS_NAME = "M4LAreasAdmin";
4
+ export declare const AREAS_STORE_ID = "M4LAreasStore";
@@ -1,4 +1,6 @@
1
1
  const AREAS_VIEWER_CLASS_NAME = "M4LAreasViewer";
2
+ const AREAS_STORE_ID = "M4LAreasStore";
2
3
  export {
3
- AREAS_VIEWER_CLASS_NAME as A
4
+ AREAS_VIEWER_CLASS_NAME as A,
5
+ AREAS_STORE_ID as a
4
6
  };
@@ -1,4 +1,4 @@
1
- import { WindowStateProps } from '../../../types';
1
+ import { AreaWindowProps } from '../../../types';
2
2
  /**
3
3
  * Función que genera un string con el número de módulos repetidos en una misma área.
4
4
  * Esta función recibe un hash de ventanas y evalúa cada ventana para contar cuántas veces se repite un módulo en una misma área
@@ -6,4 +6,4 @@ import { WindowStateProps } from '../../../types';
6
6
  * @param hashWindows
7
7
  * @returns number con el número de módulos repetidos en una mista area
8
8
  */
9
- export declare const generateModuleCount: (areaId: string, moduleId: string, hashWindows: Record<string, WindowStateProps>) => number;
9
+ export declare const generateModuleCount: (areaId: string, moduleId: string, hashWindows: Record<string, AreaWindowProps>) => number;
@@ -1,4 +1,4 @@
1
- import { NewWindowProps } from '../../../types';
1
+ import { EmmitNewWindowProps } from '../../../types';
2
2
  export declare const moduleIdsTest: {
3
3
  users: {
4
4
  moduleId: string;
@@ -29,5 +29,5 @@ interface WindowForAreaTest {
29
29
  * @param moduleId Identificador del módulo.
30
30
  * *****************************************************************************************
31
31
  */
32
- export declare const getWindowForAreaTest: ({ title, moduleId }: WindowForAreaTest) => NewWindowProps;
32
+ export declare const getWindowForAreaTest: ({ title, moduleId }: WindowForAreaTest) => EmmitNewWindowProps;
33
33
  export {};
@@ -1,5 +1,5 @@
1
1
  import { WritableDraft } from 'immer/dist/internal';
2
- import { Area, AreasStateWithActions } from '../types';
2
+ import { Area, AreasStoreStateWithActions } from '../types';
3
3
  import { WindowState } from '../../../types';
4
4
  import { Layouts } from '../../../../GridLayout/types';
5
5
  export declare const PADDING_GRIDLAYOUT = 11;
@@ -56,7 +56,7 @@ export declare const DEFAULT_AREA: Omit<Area, 'id' | 'name' | 'viewMode'>;
56
56
  * @param state
57
57
  * @returns
58
58
  */
59
- export declare const addArea: (state: WritableDraft<AreasStateWithActions>) => string;
59
+ export declare const addArea: (state: WritableDraft<AreasStoreStateWithActions>) => string;
60
60
  /**
61
61
  * Actualiza la clases basado en owner state
62
62
  * @param state immer State
@@ -64,7 +64,7 @@ export declare const addArea: (state: WritableDraft<AreasStateWithActions>) => s
64
64
  /**
65
65
  * TODO: Documentar
66
66
  */
67
- export declare const getCurrentArea: (state: WritableDraft<AreasStateWithActions> | AreasStateWithActions) => Area;
67
+ export declare const getCurrentArea: (state: WritableDraft<AreasStoreStateWithActions> | AreasStoreStateWithActions) => Area;
68
68
  /**
69
69
  * TODO: Documentar
70
70
  */
@@ -80,7 +80,7 @@ export declare function deleteLayoutFromBreakPoints(state: WritableDraft<Area>,
80
80
  /**
81
81
  * TODO: Documentar
82
82
  */
83
- export declare function getDataFromResponse(data: any, state: WritableDraft<AreasStateWithActions>, areaId: string): {
83
+ export declare function getDataFromResponse(data: any, state: WritableDraft<AreasStoreStateWithActions>, areaId: string): {
84
84
  newBreakPointsLayouts: Layouts;
85
85
  newHashLayoutItems: string[];
86
86
  };