@edifice.io/react 2.0.0-develop-rc.7 → 2.0.0-develop-rc.11

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 (614) hide show
  1. package/dist/audience.js +15 -14
  2. package/dist/audience.js.map +1 -0
  3. package/dist/components/ActionBar/ActionBar.js +8 -7
  4. package/dist/components/ActionBar/ActionBar.js.map +1 -0
  5. package/dist/components/Alert/Alert.js +60 -59
  6. package/dist/components/Alert/Alert.js.map +1 -0
  7. package/dist/components/AppHeader/AppHeader.js +19 -18
  8. package/dist/components/AppHeader/AppHeader.js.map +1 -0
  9. package/dist/components/AppIcon/AppIcon.d.ts +1 -1
  10. package/dist/components/AppIcon/AppIcon.js +45 -44
  11. package/dist/components/AppIcon/AppIcon.js.map +1 -0
  12. package/dist/components/Attachment/Attachment.js +14 -13
  13. package/dist/components/Attachment/Attachment.js.map +1 -0
  14. package/dist/components/Avatar/Avatar.js +28 -27
  15. package/dist/components/Avatar/Avatar.js.map +1 -0
  16. package/dist/components/Badge/Badge.js +21 -20
  17. package/dist/components/Badge/Badge.js.map +1 -0
  18. package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -1
  19. package/dist/components/Breadcrumb/Breadcrumb.js +24 -23
  20. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
  21. package/dist/components/Breadcrumb/BreadcrumbItem.js +12 -11
  22. package/dist/components/Breadcrumb/BreadcrumbItem.js.map +1 -0
  23. package/dist/components/Breadcrumb/BreadcrumbList.js +11 -10
  24. package/dist/components/Breadcrumb/BreadcrumbList.js.map +1 -0
  25. package/dist/components/Breadcrumb/BreadcrumbNav.d.ts +1 -1
  26. package/dist/components/Breadcrumb/BreadcrumbNav.js +16 -15
  27. package/dist/components/Breadcrumb/BreadcrumbNav.js.map +1 -0
  28. package/dist/components/Button/Button.js +33 -32
  29. package/dist/components/Button/Button.js.map +1 -0
  30. package/dist/components/Button/IconButton.js +16 -15
  31. package/dist/components/Button/IconButton.js.map +1 -0
  32. package/dist/components/Button/SearchButton.js +16 -15
  33. package/dist/components/Button/SearchButton.js.map +1 -0
  34. package/dist/components/Card/Card.d.ts +1 -1
  35. package/dist/components/Card/Card.js +48 -47
  36. package/dist/components/Card/Card.js.map +1 -0
  37. package/dist/components/Card/CardBody.js +14 -13
  38. package/dist/components/Card/CardBody.js.map +1 -0
  39. package/dist/components/Card/CardContext.d.ts +1 -1
  40. package/dist/components/Card/CardContext.js +8 -7
  41. package/dist/components/Card/CardContext.js.map +1 -0
  42. package/dist/components/Card/CardFooter.js +6 -5
  43. package/dist/components/Card/CardFooter.js.map +1 -0
  44. package/dist/components/Card/CardHeader.js +15 -14
  45. package/dist/components/Card/CardHeader.js.map +1 -0
  46. package/dist/components/Card/CardImage.js +14 -13
  47. package/dist/components/Card/CardImage.js.map +1 -0
  48. package/dist/components/Card/CardText.js +9 -8
  49. package/dist/components/Card/CardText.js.map +1 -0
  50. package/dist/components/Card/CardTitle.js +9 -8
  51. package/dist/components/Card/CardTitle.js.map +1 -0
  52. package/dist/components/Card/CardUser.js +9 -8
  53. package/dist/components/Card/CardUser.js.map +1 -0
  54. package/dist/components/Checkbox/Checkbox.js +31 -30
  55. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  56. package/dist/components/ColorPicker/ColorPalette.js +5 -4
  57. package/dist/components/ColorPicker/ColorPalette.js.map +1 -0
  58. package/dist/components/ColorPicker/ColorPicker.js +29 -28
  59. package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
  60. package/dist/components/ColorPicker/ColorPickerItem.js +12 -11
  61. package/dist/components/ColorPicker/ColorPickerItem.js.map +1 -0
  62. package/dist/components/Combobox/Combobox.js +36 -35
  63. package/dist/components/Combobox/Combobox.js.map +1 -0
  64. package/dist/components/Combobox/ComboboxTrigger.js +22 -21
  65. package/dist/components/Combobox/ComboboxTrigger.js.map +1 -0
  66. package/dist/components/Dropdown/Dropdown.js +56 -55
  67. package/dist/components/Dropdown/Dropdown.js.map +1 -0
  68. package/dist/components/Dropdown/DropdownCheckboxItem.js +27 -26
  69. package/dist/components/Dropdown/DropdownCheckboxItem.js.map +1 -0
  70. package/dist/components/Dropdown/DropdownContext.js +8 -7
  71. package/dist/components/Dropdown/DropdownContext.js.map +1 -0
  72. package/dist/components/Dropdown/DropdownItem.js +28 -27
  73. package/dist/components/Dropdown/DropdownItem.js.map +1 -0
  74. package/dist/components/Dropdown/DropdownMenu.js +22 -21
  75. package/dist/components/Dropdown/DropdownMenu.js.map +1 -0
  76. package/dist/components/Dropdown/DropdownMenuGroup.js +10 -9
  77. package/dist/components/Dropdown/DropdownMenuGroup.js.map +1 -0
  78. package/dist/components/Dropdown/DropdownRadioItem.js +27 -26
  79. package/dist/components/Dropdown/DropdownRadioItem.js.map +1 -0
  80. package/dist/components/Dropdown/DropdownSeparator.js +4 -3
  81. package/dist/components/Dropdown/DropdownSeparator.js.map +1 -0
  82. package/dist/components/Dropdown/DropdownTrigger.js +29 -28
  83. package/dist/components/Dropdown/DropdownTrigger.js.map +1 -0
  84. package/dist/components/Dropzone/Dropzone.js +48 -47
  85. package/dist/components/Dropzone/Dropzone.js.map +1 -0
  86. package/dist/components/Dropzone/DropzoneContext.js +9 -8
  87. package/dist/components/Dropzone/DropzoneContext.js.map +1 -0
  88. package/dist/components/Dropzone/DropzoneDrag.js +8 -7
  89. package/dist/components/Dropzone/DropzoneDrag.js.map +1 -0
  90. package/dist/components/Dropzone/DropzoneFile.js +26 -25
  91. package/dist/components/Dropzone/DropzoneFile.js.map +1 -0
  92. package/dist/components/Dropzone/DropzoneImport.js +21 -20
  93. package/dist/components/Dropzone/DropzoneImport.js.map +1 -0
  94. package/dist/components/EmptyScreen/EmptyScreen.js +17 -16
  95. package/dist/components/EmptyScreen/EmptyScreen.js.map +1 -0
  96. package/dist/components/FileCard/FileCard.d.ts +1 -1
  97. package/dist/components/FileCard/FileCard.js +38 -37
  98. package/dist/components/FileCard/FileCard.js.map +1 -0
  99. package/dist/components/FileCard/FileIcon.d.ts +1 -1
  100. package/dist/components/FileCard/FileIcon.js +12 -11
  101. package/dist/components/FileCard/FileIcon.js.map +1 -0
  102. package/dist/components/Form/FormContext.js +8 -7
  103. package/dist/components/Form/FormContext.js.map +1 -0
  104. package/dist/components/Form/FormControl.js +31 -30
  105. package/dist/components/Form/FormControl.js.map +1 -0
  106. package/dist/components/Form/FormText.js +13 -12
  107. package/dist/components/Form/FormText.js.map +1 -0
  108. package/dist/components/Grid/Grid.js +28 -27
  109. package/dist/components/Grid/Grid.js.map +1 -0
  110. package/dist/components/Heading/Heading.js +15 -14
  111. package/dist/components/Heading/Heading.js.map +1 -0
  112. package/dist/components/Icon/Icon.js +9 -8
  113. package/dist/components/Icon/Icon.js.map +1 -0
  114. package/dist/components/Image/Image.js +40 -39
  115. package/dist/components/Image/Image.js.map +1 -0
  116. package/dist/components/ImagePicker/ImagePicker.d.ts +1 -1
  117. package/dist/components/ImagePicker/ImagePicker.js +52 -51
  118. package/dist/components/ImagePicker/ImagePicker.js.map +1 -0
  119. package/dist/components/Input/Input.js +29 -28
  120. package/dist/components/Input/Input.js.map +1 -0
  121. package/dist/components/Label/Label.js +31 -30
  122. package/dist/components/Label/Label.js.map +1 -0
  123. package/dist/components/Loading/Loading.js +24 -23
  124. package/dist/components/Loading/Loading.js.map +1 -0
  125. package/dist/components/LoadingScreen/LoadingScreen.js +21 -20
  126. package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -0
  127. package/dist/components/Logo/Logo.js +13 -12
  128. package/dist/components/Logo/Logo.js.map +1 -0
  129. package/dist/components/Menu/Menu.js +40 -39
  130. package/dist/components/Menu/Menu.js.map +1 -0
  131. package/dist/components/Menu/MenuButton.js +18 -17
  132. package/dist/components/Menu/MenuButton.js.map +1 -0
  133. package/dist/components/Menu/MenuContext.js +9 -8
  134. package/dist/components/Menu/MenuContext.js.map +1 -0
  135. package/dist/components/Menu/MenuItem.js +15 -14
  136. package/dist/components/Menu/MenuItem.js.map +1 -0
  137. package/dist/components/Modal/Modal.js +50 -49
  138. package/dist/components/Modal/Modal.js.map +1 -0
  139. package/dist/components/Modal/ModalBody.js +12 -11
  140. package/dist/components/Modal/ModalBody.js.map +1 -0
  141. package/dist/components/Modal/ModalContext.js +9 -8
  142. package/dist/components/Modal/ModalContext.js.map +1 -0
  143. package/dist/components/Modal/ModalFooter.js +4 -3
  144. package/dist/components/Modal/ModalFooter.js.map +1 -0
  145. package/dist/components/Modal/ModalHeader.js +23 -22
  146. package/dist/components/Modal/ModalHeader.js.map +1 -0
  147. package/dist/components/Modal/ModalSubtitle.js +4 -3
  148. package/dist/components/Modal/ModalSubtitle.js.map +1 -0
  149. package/dist/components/Popover/Popover.js +34 -33
  150. package/dist/components/Popover/Popover.js.map +1 -0
  151. package/dist/components/Radio/Radio.js +27 -26
  152. package/dist/components/Radio/Radio.js.map +1 -0
  153. package/dist/components/SearchBar/SearchBar.js +30 -29
  154. package/dist/components/SearchBar/SearchBar.js.map +1 -0
  155. package/dist/components/Select/Select.js +32 -31
  156. package/dist/components/Select/Select.js.map +1 -0
  157. package/dist/components/Select/SelectTrigger.js +5 -4
  158. package/dist/components/Select/SelectTrigger.js.map +1 -0
  159. package/dist/components/Table/TableExplorer.js +8 -7
  160. package/dist/components/Table/TableExplorer.js.map +1 -0
  161. package/dist/components/Tabs/Tabs.js +59 -58
  162. package/dist/components/Tabs/Tabs.js.map +1 -0
  163. package/dist/components/Tabs/TabsContext.js +9 -8
  164. package/dist/components/Tabs/TabsContext.js.map +1 -0
  165. package/dist/components/Tabs/TabsItem.js +21 -20
  166. package/dist/components/Tabs/TabsItem.js.map +1 -0
  167. package/dist/components/Tabs/TabsList.js +19 -18
  168. package/dist/components/Tabs/TabsList.js.map +1 -0
  169. package/dist/components/Tabs/TabsPanel.js +10 -9
  170. package/dist/components/Tabs/TabsPanel.js.map +1 -0
  171. package/dist/components/TextArea/TextArea.js +32 -31
  172. package/dist/components/TextArea/TextArea.js.map +1 -0
  173. package/dist/components/TextArea/TextareaCounter.js +7 -6
  174. package/dist/components/TextArea/TextareaCounter.js.map +1 -0
  175. package/dist/components/Toolbar/Toolbar.js +61 -60
  176. package/dist/components/Toolbar/Toolbar.js.map +1 -0
  177. package/dist/components/Tooltip/Tooltip.js +29 -28
  178. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  179. package/dist/components/TreeView/TreeItem.js +47 -46
  180. package/dist/components/TreeView/TreeItem.js.map +1 -0
  181. package/dist/components/TreeView/TreeView.js +34 -33
  182. package/dist/components/TreeView/TreeView.js.map +1 -0
  183. package/dist/components/TreeView/hooks/useTreeItemEvents.js +19 -18
  184. package/dist/components/TreeView/hooks/useTreeItemEvents.js.map +1 -0
  185. package/dist/components/UploadCard/UploadCard.js +53 -52
  186. package/dist/components/UploadCard/UploadCard.js.map +1 -0
  187. package/dist/components/VisuallyHidden/VisuallyHidden.js +8 -7
  188. package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
  189. package/dist/core/OdeClientProvider/OdeClientProvider.d.ts +1 -1
  190. package/dist/core/OdeClientProvider/OdeClientProvider.js +45 -44
  191. package/dist/core/OdeClientProvider/OdeClientProvider.js.map +1 -0
  192. package/dist/core/ThemeProvider/ThemeProvider.d.ts +1 -1
  193. package/dist/core/ThemeProvider/ThemeProvider.js +36 -35
  194. package/dist/core/ThemeProvider/ThemeProvider.js.map +1 -0
  195. package/dist/core/useAvatar/useAvatar.d.ts +1 -1
  196. package/dist/core/useAvatar/useAvatar.js +22 -21
  197. package/dist/core/useAvatar/useAvatar.js.map +1 -0
  198. package/dist/core/useBookmark/useBookmark.d.ts +1 -1
  199. package/dist/core/useBookmark/useBookmark.js +10 -9
  200. package/dist/core/useBookmark/useBookmark.js.map +1 -0
  201. package/dist/core/useConf/useConf.d.ts +1 -1
  202. package/dist/core/useConf/useConf.js +8 -7
  203. package/dist/core/useConf/useConf.js.map +1 -0
  204. package/dist/core/useConversation/useConversation.js +29 -28
  205. package/dist/core/useConversation/useConversation.js.map +1 -0
  206. package/dist/core/useCookiesConsent/useCookiesConsent.js +17 -16
  207. package/dist/core/useCookiesConsent/useCookiesConsent.js.map +1 -0
  208. package/dist/core/useDate/useDate.js +36 -35
  209. package/dist/core/useDate/useDate.js.map +1 -0
  210. package/dist/core/useHasWorkflow/useHasWorkflow.js +15 -14
  211. package/dist/core/useHasWorkflow/useHasWorkflow.js.map +1 -0
  212. package/dist/core/useHeader/useHeader.d.ts +1 -1
  213. package/dist/core/useHeader/useHeader.js +42 -41
  214. package/dist/core/useHeader/useHeader.js.map +1 -0
  215. package/dist/core/useHttpErrorToast/useHttpErrorToast.js +18 -17
  216. package/dist/core/useHttpErrorToast/useHttpErrorToast.js.map +1 -0
  217. package/dist/core/useIsAdml/useIsAdml.js +12 -11
  218. package/dist/core/useIsAdml/useIsAdml.js.map +1 -0
  219. package/dist/core/useLibraryUrl/useLibraryUrl.js +16 -15
  220. package/dist/core/useLibraryUrl/useLibraryUrl.js.map +1 -0
  221. package/dist/core/useMediaLibrary/useMediaLibrary.d.ts +1 -1
  222. package/dist/core/useMediaLibrary/useMediaLibrary.js +32 -31
  223. package/dist/core/useMediaLibrary/useMediaLibrary.js.map +1 -0
  224. package/dist/core/useOdeIcons/useOdeIcons.d.ts +1 -1
  225. package/dist/core/useOdeIcons/useOdeIcons.js +38 -37
  226. package/dist/core/useOdeIcons/useOdeIcons.js.map +1 -0
  227. package/dist/core/usePaths/usePaths.js +3 -2
  228. package/dist/core/usePaths/usePaths.js.map +1 -0
  229. package/dist/core/usePreferences/usePreferences.js +6 -5
  230. package/dist/core/usePreferences/usePreferences.js.map +1 -0
  231. package/dist/core/useResource/useResource.d.ts +1 -0
  232. package/dist/core/useResource/useResource.js +15 -14
  233. package/dist/core/useResource/useResource.js.map +1 -0
  234. package/dist/core/useResourceSearch/useResourceSearch.d.ts +1 -1
  235. package/dist/core/useResourceSearch/useResourceSearch.js +23 -22
  236. package/dist/core/useResourceSearch/useResourceSearch.js.map +1 -0
  237. package/dist/core/useSession/useSession.js +7 -6
  238. package/dist/core/useSession/useSession.js.map +1 -0
  239. package/dist/core/useTrashedResource/useTrashedResource.js +18 -17
  240. package/dist/core/useTrashedResource/useTrashedResource.js.map +1 -0
  241. package/dist/core/useUpload/useUpload.d.ts +5 -4
  242. package/dist/core/useUpload/useUpload.js +69 -68
  243. package/dist/core/useUpload/useUpload.js.map +1 -0
  244. package/dist/core/useUploadFiles/useUploadFiles.d.ts +6 -6
  245. package/dist/core/useUploadFiles/useUploadFiles.js +82 -81
  246. package/dist/core/useUploadFiles/useUploadFiles.js.map +1 -0
  247. package/dist/core/useUser/useUser.d.ts +1 -1
  248. package/dist/core/useUser/useUser.js +16 -15
  249. package/dist/core/useUser/useUser.js.map +1 -0
  250. package/dist/core/useWorkspaceFile/useWorkspaceFile.d.ts +5 -5
  251. package/dist/core/useWorkspaceFile/useWorkspaceFile.js +31 -30
  252. package/dist/core/useWorkspaceFile/useWorkspaceFile.js.map +1 -0
  253. package/dist/core/useWorkspaceSearch/useWorkspaceSearch.d.ts +2 -2
  254. package/dist/core/useWorkspaceSearch/useWorkspaceSearch.js +42 -41
  255. package/dist/core/useWorkspaceSearch/useWorkspaceSearch.js.map +1 -0
  256. package/dist/core/useXitiTrackPageLoad/useXitiTrackPageLoad.js +18 -17
  257. package/dist/core/useXitiTrackPageLoad/useXitiTrackPageLoad.js.map +1 -0
  258. package/dist/core/useZendeskGuide/useZendeskGuide.js +47 -46
  259. package/dist/core/useZendeskGuide/useZendeskGuide.js.map +1 -0
  260. package/dist/editor.js +57 -56
  261. package/dist/editor.js.map +1 -0
  262. package/dist/hooks/useBrowserInfo/useBrowserInfo.js +12 -11
  263. package/dist/hooks/useBrowserInfo/useBrowserInfo.js.map +1 -0
  264. package/dist/hooks/useClickOutside/useClickOutside.js +19 -18
  265. package/dist/hooks/useClickOutside/useClickOutside.js.map +1 -0
  266. package/dist/hooks/useDebounce/useDebounce.js +11 -10
  267. package/dist/hooks/useDebounce/useDebounce.js.map +1 -0
  268. package/dist/hooks/useDropdown/useDropdown.js +96 -95
  269. package/dist/hooks/useDropdown/useDropdown.js.map +1 -0
  270. package/dist/hooks/useDropzone/useDropzone.js +53 -52
  271. package/dist/hooks/useDropzone/useDropzone.js.map +1 -0
  272. package/dist/hooks/useHover/useHover.js +15 -14
  273. package/dist/hooks/useHover/useHover.js.map +1 -0
  274. package/dist/hooks/useImage/useImage.js +14 -13
  275. package/dist/hooks/useImage/useImage.js.map +1 -0
  276. package/dist/hooks/useImageResizer/useImageResizer.js +32 -31
  277. package/dist/hooks/useImageResizer/useImageResizer.js.map +1 -0
  278. package/dist/hooks/useKeyPress/useKeyPress.js +11 -10
  279. package/dist/hooks/useKeyPress/useKeyPress.js.map +1 -0
  280. package/dist/hooks/useScrollToTop/useScrollToTop.js +5 -4
  281. package/dist/hooks/useScrollToTop/useScrollToTop.js.map +1 -0
  282. package/dist/hooks/useThumbnail/useThumbnail.js +22 -21
  283. package/dist/hooks/useThumbnail/useThumbnail.js.map +1 -0
  284. package/dist/hooks/useTitle/useTitle.js +8 -7
  285. package/dist/hooks/useTitle/useTitle.js.map +1 -0
  286. package/dist/hooks/useToast/useToast.js +26 -25
  287. package/dist/hooks/useToast/useToast.js.map +1 -0
  288. package/dist/hooks/useToggle/useToggle.js +7 -6
  289. package/dist/hooks/useToggle/useToggle.js.map +1 -0
  290. package/dist/hooks/useTrapFocus/useTrapFocus.js +12 -11
  291. package/dist/hooks/useTrapFocus/useTrapFocus.js.map +1 -0
  292. package/dist/index.js +226 -225
  293. package/dist/index.js.map +1 -0
  294. package/dist/modals.js +15 -14
  295. package/dist/modals.js.map +1 -0
  296. package/dist/modules/audience/ReactionChoice.d.ts +1 -1
  297. package/dist/modules/audience/ReactionChoice.js +24 -23
  298. package/dist/modules/audience/ReactionChoice.js.map +1 -0
  299. package/dist/modules/audience/ReactionModal.Card.d.ts +1 -1
  300. package/dist/modules/audience/ReactionModal.Card.js +26 -25
  301. package/dist/modules/audience/ReactionModal.Card.js.map +1 -0
  302. package/dist/modules/audience/ReactionModal.d.ts +1 -1
  303. package/dist/modules/audience/ReactionModal.js +59 -58
  304. package/dist/modules/audience/ReactionModal.js.map +1 -0
  305. package/dist/modules/audience/ReactionSummary.d.ts +1 -1
  306. package/dist/modules/audience/ReactionSummary.js +19 -18
  307. package/dist/modules/audience/ReactionSummary.js.map +1 -0
  308. package/dist/modules/audience/ViewsByProfileCard.d.ts +1 -1
  309. package/dist/modules/audience/ViewsByProfileCard.js +23 -22
  310. package/dist/modules/audience/ViewsByProfileCard.js.map +1 -0
  311. package/dist/modules/audience/ViewsCounter.js +14 -13
  312. package/dist/modules/audience/ViewsCounter.js.map +1 -0
  313. package/dist/modules/audience/ViewsModal.d.ts +1 -1
  314. package/dist/modules/audience/ViewsModal.js +32 -31
  315. package/dist/modules/audience/ViewsModal.js.map +1 -0
  316. package/dist/modules/audience/hooks/useReactionIcons.d.ts +1 -1
  317. package/dist/modules/audience/hooks/useReactionIcons.js +14 -13
  318. package/dist/modules/audience/hooks/useReactionIcons.js.map +1 -0
  319. package/dist/modules/audience/hooks/useReactions.d.ts +6 -4
  320. package/dist/modules/audience/hooks/useReactions.js +25 -24
  321. package/dist/modules/audience/hooks/useReactions.js.map +1 -0
  322. package/dist/modules/audience/hooks/useViews.d.ts +3 -3
  323. package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js +59 -58
  324. package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js.map +1 -0
  325. package/dist/modules/editor/components/Editor/Editor.d.ts +1 -1
  326. package/dist/modules/editor/components/Editor/Editor.js +70 -69
  327. package/dist/modules/editor/components/Editor/Editor.js.map +1 -0
  328. package/dist/modules/editor/components/Editor/MathsModal.js +38 -37
  329. package/dist/modules/editor/components/Editor/MathsModal.js.map +1 -0
  330. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.js +15 -14
  331. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.js.map +1 -0
  332. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.js +38 -37
  333. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.js.map +1 -0
  334. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js +34 -33
  335. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js.map +1 -0
  336. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.js +13 -12
  337. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.js.map +1 -0
  338. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js +37 -36
  339. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js.map +1 -0
  340. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.js +36 -35
  341. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.js.map +1 -0
  342. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +31 -30
  343. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js.map +1 -0
  344. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +96 -95
  345. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js.map +1 -0
  346. package/dist/modules/editor/components/NodeView/AttachmentNodeView.js +6 -5
  347. package/dist/modules/editor/components/NodeView/AttachmentNodeView.js.map +1 -0
  348. package/dist/modules/editor/components/NodeView/AudioNodeView.js +6 -5
  349. package/dist/modules/editor/components/NodeView/AudioNodeView.js.map +1 -0
  350. package/dist/modules/editor/components/NodeView/ImageNodeView.js +6 -5
  351. package/dist/modules/editor/components/NodeView/ImageNodeView.js.map +1 -0
  352. package/dist/modules/editor/components/NodeView/LinkerNodeView.js +6 -5
  353. package/dist/modules/editor/components/NodeView/LinkerNodeView.js.map +1 -0
  354. package/dist/modules/editor/components/NodeView/VideoNodeView.js +6 -5
  355. package/dist/modules/editor/components/NodeView/VideoNodeView.js.map +1 -0
  356. package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +25 -24
  357. package/dist/modules/editor/components/Renderer/AttachmentRenderer.js.map +1 -0
  358. package/dist/modules/editor/components/Renderer/AudioRenderer.js +8 -7
  359. package/dist/modules/editor/components/Renderer/AudioRenderer.js.map +1 -0
  360. package/dist/modules/editor/components/Renderer/LinkerRenderer.js +27 -26
  361. package/dist/modules/editor/components/Renderer/LinkerRenderer.js.map +1 -0
  362. package/dist/modules/editor/components/Renderer/MediaRenderer.js +38 -37
  363. package/dist/modules/editor/components/Renderer/MediaRenderer.js.map +1 -0
  364. package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js +3 -2
  365. package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js.map +1 -0
  366. package/dist/modules/editor/components/Toolbar/LinkToolbar.js +32 -31
  367. package/dist/modules/editor/components/Toolbar/LinkToolbar.js.map +1 -0
  368. package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js +22 -21
  369. package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js.map +1 -0
  370. package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js +31 -30
  371. package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js.map +1 -0
  372. package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js +21 -20
  373. package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js.map +1 -0
  374. package/dist/modules/editor/components/Toolbar/TableToolbar.js +40 -39
  375. package/dist/modules/editor/components/Toolbar/TableToolbar.js.map +1 -0
  376. package/dist/modules/editor/hooks/useActionOptions.js +48 -47
  377. package/dist/modules/editor/hooks/useActionOptions.js.map +1 -0
  378. package/dist/modules/editor/hooks/useCommentEditor.js +28 -27
  379. package/dist/modules/editor/hooks/useCommentEditor.js.map +1 -0
  380. package/dist/modules/editor/hooks/useEditorContext.js +9 -8
  381. package/dist/modules/editor/hooks/useEditorContext.js.map +1 -0
  382. package/dist/modules/editor/hooks/useImageModal.d.ts +2 -1
  383. package/dist/modules/editor/hooks/useImageModal.js +33 -32
  384. package/dist/modules/editor/hooks/useImageModal.js.map +1 -0
  385. package/dist/modules/editor/hooks/useImageSelection.js +32 -31
  386. package/dist/modules/editor/hooks/useImageSelection.js.map +1 -0
  387. package/dist/modules/editor/hooks/useLinkToolbar.js +25 -24
  388. package/dist/modules/editor/hooks/useLinkToolbar.js.map +1 -0
  389. package/dist/modules/editor/hooks/useMathsModal.js +10 -9
  390. package/dist/modules/editor/hooks/useMathsModal.js.map +1 -0
  391. package/dist/modules/editor/hooks/useMathsStyles.js +14 -13
  392. package/dist/modules/editor/hooks/useMathsStyles.js.map +1 -0
  393. package/dist/modules/editor/hooks/useMediaLibraryEditor.d.ts +1 -1
  394. package/dist/modules/editor/hooks/useMediaLibraryEditor.js +97 -96
  395. package/dist/modules/editor/hooks/useMediaLibraryEditor.js.map +1 -0
  396. package/dist/modules/editor/hooks/useResizeMedia.js +32 -31
  397. package/dist/modules/editor/hooks/useResizeMedia.js.map +1 -0
  398. package/dist/modules/editor/hooks/useSpeechRecognition.js +13 -12
  399. package/dist/modules/editor/hooks/useSpeechRecognition.js.map +1 -0
  400. package/dist/modules/editor/hooks/useSpeechSynthetisis.js +14 -13
  401. package/dist/modules/editor/hooks/useSpeechSynthetisis.js.map +1 -0
  402. package/dist/modules/editor/hooks/useTipTapEditor.js +58 -57
  403. package/dist/modules/editor/hooks/useTipTapEditor.js.map +1 -0
  404. package/dist/modules/editor/utils/has-extension.js +3 -2
  405. package/dist/modules/editor/utils/has-extension.js.map +1 -0
  406. package/dist/modules/editor/utils/has-mark.js +3 -2
  407. package/dist/modules/editor/utils/has-mark.js.map +1 -0
  408. package/dist/modules/editor/utils/has-text-style.js +4 -3
  409. package/dist/modules/editor/utils/has-text-style.js.map +1 -0
  410. package/dist/modules/modals/OnboardingModal/OnboardingModal.js +49 -48
  411. package/dist/modules/modals/OnboardingModal/OnboardingModal.js.map +1 -0
  412. package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +19 -18
  413. package/dist/modules/modals/OnboardingModal/useOnboardingModal.js.map +1 -0
  414. package/dist/modules/modals/PublishModal/PublishModal.d.ts +1 -1
  415. package/dist/modules/modals/PublishModal/PublishModal.js +98 -97
  416. package/dist/modules/modals/PublishModal/PublishModal.js.map +1 -0
  417. package/dist/modules/modals/PublishModal/components/ActivitiesDropdown.js +20 -19
  418. package/dist/modules/modals/PublishModal/components/ActivitiesDropdown.js.map +1 -0
  419. package/dist/modules/modals/PublishModal/components/AgeSelect.js +15 -14
  420. package/dist/modules/modals/PublishModal/components/AgeSelect.js.map +1 -0
  421. package/dist/modules/modals/PublishModal/components/LangSelect.js +12 -11
  422. package/dist/modules/modals/PublishModal/components/LangSelect.js.map +1 -0
  423. package/dist/modules/modals/PublishModal/components/PublishModalFooter.js +17 -16
  424. package/dist/modules/modals/PublishModal/components/PublishModalFooter.js.map +1 -0
  425. package/dist/modules/modals/PublishModal/components/SubjectsDropdown.js +20 -19
  426. package/dist/modules/modals/PublishModal/components/SubjectsDropdown.js.map +1 -0
  427. package/dist/modules/modals/PublishModal/components/ToastError.js +18 -17
  428. package/dist/modules/modals/PublishModal/components/ToastError.js.map +1 -0
  429. package/dist/modules/modals/PublishModal/components/ToastSuccess.d.ts +1 -1
  430. package/dist/modules/modals/PublishModal/components/ToastSuccess.js +13 -12
  431. package/dist/modules/modals/PublishModal/components/ToastSuccess.js.map +1 -0
  432. package/dist/modules/modals/PublishModal/constants/ageOptions.js +3 -2
  433. package/dist/modules/modals/PublishModal/constants/ageOptions.js.map +1 -0
  434. package/dist/modules/modals/PublishModal/hooks/useActivitiesOptions.js +5 -4
  435. package/dist/modules/modals/PublishModal/hooks/useActivitiesOptions.js.map +1 -0
  436. package/dist/modules/modals/PublishModal/hooks/useLanguageOptions.js +17 -16
  437. package/dist/modules/modals/PublishModal/hooks/useLanguageOptions.js.map +1 -0
  438. package/dist/modules/modals/PublishModal/hooks/usePublishModal.d.ts +1 -1
  439. package/dist/modules/modals/PublishModal/hooks/usePublishModal.js +80 -79
  440. package/dist/modules/modals/PublishModal/hooks/usePublishModal.js.map +1 -0
  441. package/dist/modules/modals/PublishModal/hooks/useSubjectsOptions.js +42 -41
  442. package/dist/modules/modals/PublishModal/hooks/useSubjectsOptions.js.map +1 -0
  443. package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -1
  444. package/dist/modules/modals/ResourceModal/ResourceModal.js +116 -115
  445. package/dist/modules/modals/ResourceModal/ResourceModal.js.map +1 -0
  446. package/dist/modules/modals/ResourceModal/apps/BlogPublic.d.ts +1 -1
  447. package/dist/modules/modals/ResourceModal/apps/BlogPublic.js +48 -47
  448. package/dist/modules/modals/ResourceModal/apps/BlogPublic.js.map +1 -0
  449. package/dist/modules/modals/ResourceModal/hooks/useSlug.d.ts +1 -1
  450. package/dist/modules/modals/ResourceModal/hooks/useSlug.js +33 -32
  451. package/dist/modules/modals/ResourceModal/hooks/useSlug.js.map +1 -0
  452. package/dist/modules/modals/ResourceModal/hooks/useThumb.d.ts +1 -1
  453. package/dist/modules/modals/ResourceModal/hooks/useThumb.js +13 -12
  454. package/dist/modules/modals/ResourceModal/hooks/useThumb.js.map +1 -0
  455. package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.d.ts +1 -1
  456. package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.js +11 -10
  457. package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.js.map +1 -0
  458. package/dist/modules/modals/ShareModal/ShareBookmarkLine.d.ts +2 -2
  459. package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -1
  460. package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
  461. package/dist/modules/modals/ShareModal/apps/ShareBlog.js +34 -33
  462. package/dist/modules/modals/ShareModal/apps/ShareBlog.js.map +1 -0
  463. package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +1 -1
  464. package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +2 -2
  465. package/dist/modules/modals/ShareModal/hooks/useShareBookmark.d.ts +1 -1
  466. package/dist/modules/modals/ShareModal/hooks/useShareMutation.d.ts +1 -1
  467. package/dist/modules/modals/ShareModal/hooks/useShareMutation.js +13 -12
  468. package/dist/modules/modals/ShareModal/hooks/useShareMutation.js.map +1 -0
  469. package/dist/modules/modals/ShareModal/utils/hasRight.d.ts +1 -0
  470. package/dist/modules/modals/ShareModal/utils/showShareRightLine.d.ts +1 -0
  471. package/dist/modules/multimedia/AudioRecorder/AudioRecorder.d.ts +1 -1
  472. package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js +43 -42
  473. package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js.map +1 -0
  474. package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js +19 -18
  475. package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js.map +1 -0
  476. package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.d.ts +1 -1
  477. package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js +158 -157
  478. package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js.map +1 -0
  479. package/dist/modules/multimedia/Embed/Embed.js +22 -21
  480. package/dist/modules/multimedia/Embed/Embed.js.map +1 -0
  481. package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js +79 -78
  482. package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js.map +1 -0
  483. package/dist/modules/multimedia/ImageEditor/components/ImageEditorToolbar.js +38 -37
  484. package/dist/modules/multimedia/ImageEditor/components/ImageEditorToolbar.js.map +1 -0
  485. package/dist/modules/multimedia/ImageEditor/effects/blur.js +50 -49
  486. package/dist/modules/multimedia/ImageEditor/effects/blur.js.map +1 -0
  487. package/dist/modules/multimedia/ImageEditor/effects/crop.js +100 -99
  488. package/dist/modules/multimedia/ImageEditor/effects/crop.js.map +1 -0
  489. package/dist/modules/multimedia/ImageEditor/effects/misc.js +108 -107
  490. package/dist/modules/multimedia/ImageEditor/effects/misc.js.map +1 -0
  491. package/dist/modules/multimedia/ImageEditor/effects/resize.js +97 -96
  492. package/dist/modules/multimedia/ImageEditor/effects/resize.js.map +1 -0
  493. package/dist/modules/multimedia/ImageEditor/effects/rotate.js +26 -25
  494. package/dist/modules/multimedia/ImageEditor/effects/rotate.js.map +1 -0
  495. package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js +39 -38
  496. package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js.map +1 -0
  497. package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.js +57 -56
  498. package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.js.map +1 -0
  499. package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.js +29 -28
  500. package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.js.map +1 -0
  501. package/dist/modules/multimedia/ImageEditor/utils/aggregate.js +10 -9
  502. package/dist/modules/multimedia/ImageEditor/utils/aggregate.js.map +1 -0
  503. package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.d.ts +1 -1
  504. package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.js +34 -33
  505. package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.js.map +1 -0
  506. package/dist/modules/multimedia/Linker/ExternalLinker.js +35 -34
  507. package/dist/modules/multimedia/Linker/ExternalLinker.js.map +1 -0
  508. package/dist/modules/multimedia/Linker/InternalLinker.d.ts +1 -1
  509. package/dist/modules/multimedia/Linker/InternalLinker.js +88 -87
  510. package/dist/modules/multimedia/Linker/InternalLinker.js.map +1 -0
  511. package/dist/modules/multimedia/LinkerCard/LinkerCard.d.ts +1 -1
  512. package/dist/modules/multimedia/LinkerCard/LinkerCard.js +32 -31
  513. package/dist/modules/multimedia/LinkerCard/LinkerCard.js.map +1 -0
  514. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +1 -1
  515. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +119 -118
  516. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js.map +1 -0
  517. package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.d.ts +4 -4
  518. package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.js +9 -8
  519. package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.js.map +1 -0
  520. package/dist/modules/multimedia/MediaLibrary/innertabs/Audio.js +16 -15
  521. package/dist/modules/multimedia/MediaLibrary/innertabs/Audio.js.map +1 -0
  522. package/dist/modules/multimedia/MediaLibrary/innertabs/ExternalLink.js +13 -12
  523. package/dist/modules/multimedia/MediaLibrary/innertabs/ExternalLink.js.map +1 -0
  524. package/dist/modules/multimedia/MediaLibrary/innertabs/Iframe.js +10 -9
  525. package/dist/modules/multimedia/MediaLibrary/innertabs/Iframe.js.map +1 -0
  526. package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.d.ts +1 -1
  527. package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.js +29 -28
  528. package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.js.map +1 -0
  529. package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +23 -22
  530. package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js.map +1 -0
  531. package/dist/modules/multimedia/MediaLibrary/innertabs/Video.js +18 -17
  532. package/dist/modules/multimedia/MediaLibrary/innertabs/Video.js.map +1 -0
  533. package/dist/modules/multimedia/MediaLibrary/innertabs/VideoEmbedder.js +10 -9
  534. package/dist/modules/multimedia/MediaLibrary/innertabs/VideoEmbedder.js.map +1 -0
  535. package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +17 -16
  536. package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js.map +1 -0
  537. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +19 -18
  538. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js.map +1 -0
  539. package/dist/modules/multimedia/UploadFiles/UploadFiles.d.ts +2 -2
  540. package/dist/modules/multimedia/UploadFiles/UploadFiles.js +42 -41
  541. package/dist/modules/multimedia/UploadFiles/UploadFiles.js.map +1 -0
  542. package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js +60 -59
  543. package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js.map +1 -0
  544. package/dist/modules/multimedia/VideoRecorder/VideoRecorder.d.ts +1 -1
  545. package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js +153 -152
  546. package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js.map +1 -0
  547. package/dist/modules/multimedia/Workspace/Workspace.d.ts +1 -1
  548. package/dist/modules/multimedia/Workspace/Workspace.js +110 -109
  549. package/dist/modules/multimedia/Workspace/Workspace.js.map +1 -0
  550. package/dist/multimedia.js +19 -18
  551. package/dist/multimedia.js.map +1 -0
  552. package/dist/portal/Header/Badge.js +6 -5
  553. package/dist/portal/Header/Badge.js.map +1 -0
  554. package/dist/portal/Header/Header.js +138 -137
  555. package/dist/portal/Header/Header.js.map +1 -0
  556. package/dist/portal/Header/NavItem.js +12 -11
  557. package/dist/portal/Header/NavItem.js.map +1 -0
  558. package/dist/portal/Header/NavLink.js +15 -14
  559. package/dist/portal/Header/NavLink.js.map +1 -0
  560. package/dist/portal/Header/Navbar.js +10 -9
  561. package/dist/portal/Header/Navbar.js.map +1 -0
  562. package/dist/portal/Header/NavbarNav.js +10 -9
  563. package/dist/portal/Header/NavbarNav.js.map +1 -0
  564. package/dist/portal/Header/WidgetApps.d.ts +1 -1
  565. package/dist/portal/Header/WidgetApps.js +17 -16
  566. package/dist/portal/Header/WidgetApps.js.map +1 -0
  567. package/dist/portal/Help/Help.js +19 -18
  568. package/dist/portal/Help/Help.js.map +1 -0
  569. package/dist/portal/Help/hooks/useHelp.js +64 -63
  570. package/dist/portal/Help/hooks/useHelp.js.map +1 -0
  571. package/dist/portal/Layout/Layout.js +35 -34
  572. package/dist/portal/Layout/Layout.js.map +1 -0
  573. package/dist/portal/SearchEngine/SearchEngine.js +26 -25
  574. package/dist/portal/SearchEngine/SearchEngine.js.map +1 -0
  575. package/dist/utils/MockedDataProvider/MockedDataProvider.d.ts +1 -1
  576. package/dist/utils/MockedDataProvider/MockedDataProvider.js +22 -21
  577. package/dist/utils/MockedDataProvider/MockedDataProvider.js.map +1 -0
  578. package/dist/utils/StringUtils.js +9 -8
  579. package/dist/utils/StringUtils.js.map +1 -0
  580. package/dist/utils/addTimestampToUrl.js +5 -4
  581. package/dist/utils/addTimestampToUrl.js.map +1 -0
  582. package/dist/utils/blob.js +10 -9
  583. package/dist/utils/blob.js.map +1 -0
  584. package/dist/utils/checkUserRight.d.ts +1 -1
  585. package/dist/utils/checkUserRight.js +28 -27
  586. package/dist/utils/checkUserRight.js.map +1 -0
  587. package/dist/utils/fileSize.js +6 -5
  588. package/dist/utils/fileSize.js.map +1 -0
  589. package/dist/utils/findTreeNode.js +8 -7
  590. package/dist/utils/findTreeNode.js.map +1 -0
  591. package/dist/utils/isActionAvailable.d.ts +1 -1
  592. package/dist/utils/isActionAvailable.js +5 -4
  593. package/dist/utils/isActionAvailable.js.map +1 -0
  594. package/dist/utils/libraryMaps.js +3 -2
  595. package/dist/utils/libraryMaps.js.map +1 -0
  596. package/dist/utils/noop.js +3 -2
  597. package/dist/utils/noop.js.map +1 -0
  598. package/dist/utils/ref.js +9 -8
  599. package/dist/utils/ref.js.map +1 -0
  600. package/dist/utils/thumbnail.js +4 -3
  601. package/dist/utils/thumbnail.js.map +1 -0
  602. package/dist/utils/time.js +8 -7
  603. package/dist/utils/time.js.map +1 -0
  604. package/dist/utils/treeview.d.ts +1 -1
  605. package/dist/utils/treeview.js +97 -96
  606. package/dist/utils/treeview.js.map +1 -0
  607. package/dist/utils/video.js +3 -2
  608. package/dist/utils/video.js.map +1 -0
  609. package/dist/widgets/BookmarkedApps/BookmarkedApps.d.ts +1 -1
  610. package/dist/widgets/BookmarkedApps/BookmarkedApps.js +7 -6
  611. package/dist/widgets/BookmarkedApps/BookmarkedApps.js.map +1 -0
  612. package/dist/widgets/Widget/Widget.js +19 -18
  613. package/dist/widgets/Widget/Widget.js.map +1 -0
  614. package/package.json +4 -4
@@ -1,76 +1,77 @@
1
- import { useState, useRef } from "react";
2
- const useDropzone = (props) => {
3
- const [dragging, setDragging] = useState(!1), [files, setFiles] = useState([]), inputRef = useRef(null), addFile = (file) => {
4
- addFiles([file]);
5
- }, deleteFile = (file) => {
6
- setFiles((prevFiles) => prevFiles.filter((prevFile) => prevFile.name !== file.name));
7
- }, replaceFileAt = (index, file) => {
8
- setFiles((prevFiles) => {
9
- if (0 <= index && index < prevFiles.length) {
10
- const firstPart = prevFiles.slice(0, index), lastPart = index === prevFiles.length - 1 ? [] : prevFiles.slice(index + 1);
11
- return [...firstPart, file, ...lastPart];
1
+ import { useState as d, useRef as A } from "react";
2
+ const z = (c) => {
3
+ const [h, u] = d(!1), [m, r] = d([]), a = A(null), p = (t) => {
4
+ o([t]);
5
+ }, D = (t) => {
6
+ r((e) => e.filter((s) => s.name !== t.name));
7
+ }, F = (t, e) => {
8
+ r((s) => {
9
+ if (0 <= t && t < s.length) {
10
+ const l = s.slice(0, t), i = t === s.length - 1 ? [] : s.slice(t + 1);
11
+ return [...l, e, ...i];
12
12
  }
13
- return prevFiles;
13
+ return s;
14
14
  });
15
- }, applyInputFiltersOn = (files2) => {
16
- var _a;
17
- let filteredFiles = files2;
18
- if ((_a = inputRef.current) != null && _a.accept) {
19
- const filters = inputRef.current.accept.split(",").map((filter) => filter.trim().toLowerCase()), extensions = filters.filter((filter) => filter.startsWith(".")), mimes = filters.filter((filter) => !filter.startsWith(".")).map((mime) => mime.replace("*", ""));
20
- filteredFiles = [], files2.forEach((file) => {
21
- const fileName = file.name.toLowerCase();
22
- (extensions.some((extension) => fileName.endsWith(extension)) || mimes.some((mime) => file.type.includes(mime))) && filteredFiles.push(file);
15
+ }, P = (t) => {
16
+ var s;
17
+ let e = t;
18
+ if ((s = a.current) != null && s.accept) {
19
+ const l = a.current.accept.split(",").map((n) => n.trim().toLowerCase()), i = l.filter((n) => n.startsWith(".")), w = l.filter((n) => !n.startsWith(".")).map((n) => n.replace("*", ""));
20
+ e = [], t.forEach((n) => {
21
+ const y = n.name.toLowerCase();
22
+ (i.some((f) => y.endsWith(f)) || w.some((f) => n.type.includes(f))) && e.push(n);
23
23
  });
24
24
  }
25
- return filteredFiles;
26
- }, addFiles = (files2) => {
27
- if (props != null && props.forceFilters) {
28
- const filesToAdd = applyInputFiltersOn(files2);
29
- filesToAdd && filesToAdd.length && setFiles((prevFiles) => [...prevFiles, ...filesToAdd]);
25
+ return e;
26
+ }, o = (t) => {
27
+ if (c != null && c.forceFilters) {
28
+ const e = P(t);
29
+ e && e.length && r((s) => [...s, ...e]);
30
30
  } else
31
- setFiles((prevFiles) => [...prevFiles, ...files2]);
32
- }, cleanFiles = () => {
33
- setFiles([]);
34
- }, handleOnChange = (event) => {
35
- const files2 = event.target.files;
36
- files2 && addFiles([...files2]);
37
- }, handleDragging = (event) => {
38
- event.preventDefault(), event.stopPropagation(), setDragging(!0);
39
- }, handleDragLeave = (event) => {
40
- event.preventDefault(), event.stopPropagation(), setDragging(!1);
31
+ r((e) => [...e, ...t]);
32
+ }, C = () => {
33
+ r([]);
34
+ }, L = (t) => {
35
+ const e = t.target.files;
36
+ e && o([...e]);
37
+ }, W = (t) => {
38
+ t.preventDefault(), t.stopPropagation(), u(!0);
39
+ }, g = (t) => {
40
+ t.preventDefault(), t.stopPropagation(), u(!1);
41
41
  };
42
42
  return {
43
43
  /** Reference to an `input[type=file]` HTMLElement, null at first. */
44
- inputRef,
44
+ inputRef: a,
45
45
  /** Read-only list of File·s managed by this hook. */
46
- files,
46
+ files: m,
47
47
  /** Truthy when a drag event is triggered. */
48
- dragging,
48
+ dragging: h,
49
49
  /** Callback to attach to your drop zone (any HTMLElement). */
50
- handleDragging,
50
+ handleDragging: W,
51
51
  /** Callback to attach to your drop zone (any HTMLElement). */
52
- handleDragLeave,
52
+ handleDragLeave: g,
53
53
  /** Callback to attach to your drop zone (any HTMLElement). */
54
- handleDrop: (event) => {
55
- var _a;
56
- handleDragLeave(event);
57
- const files2 = (_a = event.dataTransfer) == null ? void 0 : _a.files;
58
- files2 && (addFiles([...files2]), inputRef != null && inputRef.current && (inputRef.current.files = files2));
54
+ handleDrop: (t) => {
55
+ var s;
56
+ g(t);
57
+ const e = (s = t.dataTransfer) == null ? void 0 : s.files;
58
+ e && (o([...e]), a != null && a.current && (a.current.files = e));
59
59
  },
60
60
  /** Replace a file in the `files` list. */
61
- replaceFileAt,
61
+ replaceFileAt: F,
62
62
  /** Remove a file from the `files` list. */
63
- deleteFile,
63
+ deleteFile: D,
64
64
  /** Add a file to the `files` list. */
65
- addFile,
65
+ addFile: p,
66
66
  /** Add many files to the `files` list. */
67
- addFiles,
67
+ addFiles: o,
68
68
  /** Empty the `files` list. */
69
- cleanFiles,
69
+ cleanFiles: C,
70
70
  /** Callback to attach to your `input[type=file]` HTMLElement. */
71
- handleOnChange
71
+ handleOnChange: L
72
72
  };
73
73
  };
74
74
  export {
75
- useDropzone as default
75
+ z as default
76
76
  };
77
+ //# sourceMappingURL=useDropzone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDropzone.js","sources":["../../../src/hooks/useDropzone/useDropzone.ts"],"sourcesContent":["import { ChangeEvent, useRef, useState } from 'react';\n\nconst useDropzone = (props?: {\n /**\n * Truthy when the `accept` attribute of the referenced `input[type=file]`\n * must be force-checked against any added file.\n */\n forceFilters: boolean;\n}) => {\n const [dragging, setDragging] = useState<boolean>(false);\n const [files, setFiles] = useState<File[]>([]);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const addFile = (file: File) => {\n addFiles([file]);\n };\n\n const deleteFile = (file: File) => {\n setFiles((prevFiles) =>\n prevFiles.filter((prevFile) => prevFile.name !== file.name),\n );\n };\n\n const replaceFileAt = (index: number, file: File) => {\n setFiles((prevFiles) => {\n if (0 <= index && index < prevFiles.length) {\n const firstPart = prevFiles.slice(0, index);\n const lastPart =\n index === prevFiles.length - 1 ? [] : prevFiles.slice(index + 1);\n return [...firstPart, file, ...lastPart];\n }\n return prevFiles;\n });\n };\n\n const applyInputFiltersOn = (files: File[]) => {\n let filteredFiles: File[] = files;\n if (inputRef.current?.accept) {\n // Reject files which do not pass the `accept` filter.\n const filters = inputRef.current.accept\n .split(',')\n .map((filter) => filter.trim().toLowerCase());\n const extensions = filters.filter((filter) => filter.startsWith('.'));\n const mimes = filters\n .filter((filter) => !filter.startsWith('.'))\n .map((mime) => mime.replace('*', ''));\n\n filteredFiles = [];\n files.forEach((file) => {\n const fileName = file.name.toLowerCase();\n if (\n extensions.some((extension) => fileName.endsWith(extension)) ||\n mimes.some((mime) => file.type.includes(mime))\n ) {\n filteredFiles.push(file);\n }\n });\n }\n return filteredFiles;\n };\n\n const addFiles = (files: File[]) => {\n if (props?.forceFilters) {\n const filesToAdd = applyInputFiltersOn(files);\n if (filesToAdd && filesToAdd.length)\n setFiles((prevFiles) => [...prevFiles, ...filesToAdd]);\n } else {\n setFiles((prevFiles) => [...prevFiles, ...files]);\n }\n };\n\n const cleanFiles = () => {\n setFiles([]);\n };\n\n const handleOnChange = (event: ChangeEvent<HTMLInputElement>) => {\n const files = event.target.files;\n if (files) addFiles([...files]);\n };\n\n const handleDragging = <T extends HTMLElement>(event: React.DragEvent<T>) => {\n event.preventDefault();\n event.stopPropagation();\n setDragging(true);\n };\n\n const handleDragLeave = <T extends HTMLElement>(\n event: React.DragEvent<T>,\n ) => {\n event.preventDefault();\n event.stopPropagation();\n setDragging(false);\n };\n\n const handleDrop = <T extends HTMLElement>(event: React.DragEvent<T>) => {\n handleDragLeave(event);\n const files = event.dataTransfer?.files;\n if (files) {\n addFiles([...files]);\n if (inputRef?.current) {\n inputRef.current.files = files;\n }\n }\n };\n\n return {\n /** Reference to an `input[type=file]` HTMLElement, null at first. */\n inputRef,\n /** Read-only list of File·s managed by this hook. */\n files,\n /** Truthy when a drag event is triggered. */\n dragging,\n /** Callback to attach to your drop zone (any HTMLElement). */\n handleDragging,\n /** Callback to attach to your drop zone (any HTMLElement). */\n handleDragLeave,\n /** Callback to attach to your drop zone (any HTMLElement). */\n handleDrop,\n /** Replace a file in the `files` list. */\n replaceFileAt,\n /** Remove a file from the `files` list. */\n deleteFile,\n /** Add a file to the `files` list. */\n addFile,\n /** Add many files to the `files` list. */\n addFiles,\n /** Empty the `files` list. */\n cleanFiles,\n /** Callback to attach to your `input[type=file]` HTMLElement. */\n handleOnChange,\n };\n};\n\nexport default useDropzone;\n"],"names":["useDropzone","props","dragging","setDragging","useState","files","setFiles","inputRef","useRef","addFile","file","addFiles","deleteFile","prevFiles","filter","prevFile","name","replaceFileAt","index","length","firstPart","slice","lastPart","applyInputFiltersOn","filteredFiles","current","accept","filters","split","map","trim","toLowerCase","extensions","startsWith","mimes","mime","replace","forEach","fileName","some","extension","endsWith","type","includes","push","forceFilters","filesToAdd","cleanFiles","handleOnChange","event","target","handleDragging","preventDefault","stopPropagation","handleDragLeave","handleDrop","dataTransfer"],"mappings":";AAEMA,MAAAA,IAAcA,CAACC,MAMf;AACJ,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAkB,EAAK,GACjD,CAACC,GAAOC,CAAQ,IAAIF,EAAiB,CAAE,CAAA,GAEvCG,IAAWC,EAAgC,IAAI,GAE/CC,IAAUA,CAACC,MAAe;AACrB,IAAAC,EAAA,CAACD,CAAI,CAAC;AAAA,EAAA,GAGXE,IAAaA,CAACF,MAAe;AACvBG,IAAAA,EAAAA,CAAAA,MACRA,EAAUC,OAAQC,CAAAA,MAAaA,EAASC,SAASN,EAAKM,IAAI,CAC5D;AAAA,EAAA,GAGIC,IAAgBA,CAACC,GAAeR,MAAe;AACnDJ,IAAAA,EAAUO,CAAcA,MAAA;AACtB,UAAI,KAAKK,KAASA,IAAQL,EAAUM,QAAQ;AAC1C,cAAMC,IAAYP,EAAUQ,MAAM,GAAGH,CAAK,GACpCI,IACJJ,MAAUL,EAAUM,SAAS,IAAI,CAAKN,IAAAA,EAAUQ,MAAMH,IAAQ,CAAC;AACjE,eAAO,CAAC,GAAGE,GAAWV,GAAM,GAAGY,CAAQ;AAAA,MACzC;AACOT,aAAAA;AAAAA,IAAAA,CACR;AAAA,EAAA,GAGGU,IAAsBA,CAAClB,MAAkB;;AAC7C,QAAImB,IAAwBnB;AACxBE,SAAAA,IAAAA,EAASkB,YAATlB,QAAAA,EAAkBmB,QAAQ;AAE5B,YAAMC,IAAUpB,EAASkB,QAAQC,OAC9BE,MAAM,GAAG,EACTC,IAAKf,CAAWA,MAAAA,EAAOgB,KAAK,EAAEC,YAAa,CAAA,GACxCC,IAAaL,EAAQb,OAAQA,OAAWA,EAAOmB,WAAW,GAAG,CAAC,GAC9DC,IAAQP,EACXb,OAAQA,CAAWA,MAAA,CAACA,EAAOmB,WAAW,GAAG,CAAC,EAC1CJ,IAAKM,CAASA,MAAAA,EAAKC,QAAQ,KAAK,EAAE,CAAC;AAEtCZ,MAAAA,IAAgB,CAAA,GAChBnB,EAAMgC,QAAS3B,CAASA,MAAA;AAChB4B,cAAAA,IAAW5B,EAAKM,KAAKe,YAAY;AACvC,SACEC,EAAWO,KAAMC,CAAAA,MAAcF,EAASG,SAASD,CAAS,CAAC,KAC3DN,EAAMK,KAAMJ,OAASzB,EAAKgC,KAAKC,SAASR,CAAI,CAAC,MAE7CX,EAAcoB,KAAKlC,CAAI;AAAA,MACzB,CACD;AAAA,IACH;AACOc,WAAAA;AAAAA,EAAAA,GAGHb,IAAWA,CAACN,MAAkB;AAClC,QAAIJ,KAAAA,QAAAA,EAAO4C,cAAc;AACjBC,YAAAA,IAAavB,EAAoBlB,CAAK;AACxCyC,MAAAA,KAAcA,EAAW3B,UACjBN,EAAAA,CAAAA,MAAc,CAAC,GAAGA,GAAW,GAAGiC,CAAU,CAAC;AAAA,IAAA;AAEvDxC,MAAAA,EAAUO,OAAc,CAAC,GAAGA,GAAW,GAAGR,CAAK,CAAC;AAAA,EAClD,GAGI0C,IAAaA,MAAM;AACvBzC,IAAAA,EAAS,CAAE,CAAA;AAAA,EAAA,GAGP0C,IAAiBA,CAACC,MAAyC;AACzD5C,UAAAA,IAAQ4C,EAAMC,OAAO7C;AAC3B,IAAIA,KAAOM,EAAS,CAAC,GAAGN,CAAK,CAAC;AAAA,EAAA,GAG1B8C,IAAiB,CAAwBF,MAA8B;AAC3EA,IAAAA,EAAMG,eAAe,GACrBH,EAAMI,gBAAgB,GACtBlD,EAAY,EAAI;AAAA,EAAA,GAGZmD,IAAkB,CACtBL,MACG;AACHA,IAAAA,EAAMG,eAAe,GACrBH,EAAMI,gBAAgB,GACtBlD,EAAY,EAAK;AAAA,EAAA;AAcZ,SAAA;AAAA;AAAA,IAELI,UAAAA;AAAAA;AAAAA,IAEAF,OAAAA;AAAAA;AAAAA,IAEAH,UAAAA;AAAAA;AAAAA,IAEAiD,gBAAAA;AAAAA;AAAAA,IAEAG,iBAAAA;AAAAA;AAAAA,IAEAC,YAvBiB,CAAwBN,MAA8B;;AACvEK,MAAAA,EAAgBL,CAAK;AACf5C,YAAAA,KAAQ4C,IAAAA,EAAMO,iBAANP,gBAAAA,EAAoB5C;AAClC,MAAIA,MACOM,EAAA,CAAC,GAAGN,CAAK,CAAC,GACfE,KAAAA,QAAAA,EAAUkB,YACZlB,EAASkB,QAAQpB,QAAQA;AAAAA,IAE7B;AAAA;AAAA,IAiBAY,eAAAA;AAAAA;AAAAA,IAEAL,YAAAA;AAAAA;AAAAA,IAEAH,SAAAA;AAAAA;AAAAA,IAEAE,UAAAA;AAAAA;AAAAA,IAEAoC,YAAAA;AAAAA;AAAAA,IAEAC,gBAAAA;AAAAA,EAAAA;AAEJ;"}
@@ -1,22 +1,23 @@
1
- import { useState, useRef, useEffect } from "react";
2
- function useHover() {
3
- const [value, setValue] = useState(!1), ref = useRef(null), handleMouseOver = () => {
4
- setValue(!0);
5
- }, handleMouseOut = () => {
6
- setValue(!1);
1
+ import { useState as r, useRef as a, useEffect as v } from "react";
2
+ function l() {
3
+ const [u, o] = r(!1), t = a(null), s = () => {
4
+ o(!0);
5
+ }, n = () => {
6
+ o(!1);
7
7
  };
8
- return useEffect(
8
+ return v(
9
9
  () => {
10
- const node = ref.current;
11
- if (node)
12
- return node.addEventListener("mouseover", handleMouseOver), node.addEventListener("mouseout", handleMouseOut), () => {
13
- node.removeEventListener("mouseover", handleMouseOver), node.removeEventListener("mouseout", handleMouseOut);
10
+ const e = t.current;
11
+ if (e)
12
+ return e.addEventListener("mouseover", s), e.addEventListener("mouseout", n), () => {
13
+ e.removeEventListener("mouseover", s), e.removeEventListener("mouseout", n);
14
14
  };
15
15
  },
16
- [ref]
16
+ [t]
17
17
  // Recall only if ref changes
18
- ), [ref, value];
18
+ ), [t, u];
19
19
  }
20
20
  export {
21
- useHover as default
21
+ l as default
22
22
  };
23
+ //# sourceMappingURL=useHover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHover.js","sources":["../../../src/hooks/useHover/useHover.ts"],"sourcesContent":["import { type MutableRefObject, useState, useRef, useEffect } from 'react';\n\nexport default function useHover<T>(): [MutableRefObject<T>, boolean] {\n const [value, setValue] = useState<boolean>(false);\n const ref: any = useRef<T | null>(null);\n const handleMouseOver = (): void => {\n setValue(true);\n };\n const handleMouseOut = (): void => {\n setValue(false);\n };\n useEffect(\n () => {\n const node: any = ref.current;\n if (node) {\n node.addEventListener('mouseover', handleMouseOver);\n node.addEventListener('mouseout', handleMouseOut);\n return () => {\n node.removeEventListener('mouseover', handleMouseOver);\n node.removeEventListener('mouseout', handleMouseOut);\n };\n }\n },\n [ref], // Recall only if ref changes\n );\n return [ref, value];\n}\n"],"names":["useHover","value","setValue","useState","ref","useRef","handleMouseOver","handleMouseOut","useEffect","node","current","addEventListener","removeEventListener"],"mappings":";AAEA,SAAwBA,IAA8C;AACpE,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAkB,EAAK,GAC3CC,IAAWC,EAAiB,IAAI,GAChCC,IAAkBA,MAAY;AAClCJ,IAAAA,EAAS,EAAI;AAAA,EAAA,GAETK,IAAiBA,MAAY;AACjCL,IAAAA,EAAS,EAAK;AAAA,EAAA;AAEhBM,SAAAA;AAAAA,IACE,MAAM;AACJ,YAAMC,IAAYL,EAAIM;AACtB,UAAID;AACGE,eAAAA,EAAAA,iBAAiB,aAAaL,CAAe,GAC7CK,EAAAA,iBAAiB,YAAYJ,CAAc,GACzC,MAAM;AACNK,UAAAA,EAAAA,oBAAoB,aAAaN,CAAe,GAChDM,EAAAA,oBAAoB,YAAYL,CAAc;AAAA,QAAA;AAAA,IAGzD;AAAA,IACA,CAACH,CAAG;AAAA;AAAA,EAAA,GAEC,CAACA,GAAKH,CAAK;AACpB;"}
@@ -1,18 +1,19 @@
1
- import { useState, useCallback, useEffect } from "react";
2
- function useImage({
3
- src,
4
- placeholder
1
+ import { useState as r, useCallback as s, useEffect as f } from "react";
2
+ function a({
3
+ src: t,
4
+ placeholder: e
5
5
  }) {
6
- const [imgSrc, setImgSrc] = useState(src || placeholder), onError = useCallback(() => {
7
- setImgSrc(placeholder);
8
- }, [placeholder]);
9
- return useEffect(() => {
10
- setImgSrc(src);
11
- }, [src]), {
12
- imgSrc,
13
- onError
6
+ const [n, u] = r(t || e), o = s(() => {
7
+ u(e);
8
+ }, [e]);
9
+ return f(() => {
10
+ u(t);
11
+ }, [t]), {
12
+ imgSrc: n,
13
+ onError: o
14
14
  };
15
15
  }
16
16
  export {
17
- useImage as default
17
+ a as default
18
18
  };
19
+ //# sourceMappingURL=useImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useImage.js","sources":["../../../src/hooks/useImage/useImage.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\ninterface useImageProps {\n src: string;\n placeholder: string;\n}\n\nexport default function useImage({ src, placeholder }: useImageProps) {\n const [imgSrc, setImgSrc] = useState<string>(src || placeholder);\n\n const onError = useCallback(() => {\n setImgSrc(placeholder);\n }, [placeholder]);\n\n // Force initial value imgSrc to src. If we use the value returned by useState it is wrong the second time the hook is called\n useEffect(() => {\n setImgSrc(src);\n }, [src]);\n return { imgSrc, onError };\n}\n"],"names":["useImage","src","placeholder","imgSrc","setImgSrc","useState","onError","useCallback","useEffect"],"mappings":";AAOA,SAAwBA,EAAS;AAAA,EAAEC,KAAAA;AAAAA,EAAKC,aAAAA;AAA2B,GAAG;AACpE,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAiBJ,KAAOC,CAAW,GAEzDI,IAAUC,EAAY,MAAM;AAChCH,IAAAA,EAAUF,CAAW;AAAA,EAAA,GACpB,CAACA,CAAW,CAAC;AAGhBM,SAAAA,EAAU,MAAM;AACdJ,IAAAA,EAAUH,CAAG;AAAA,EAAA,GACZ,CAACA,CAAG,CAAC,GACD;AAAA,IAAEE,QAAAA;AAAAA,IAAQG,SAAAA;AAAAA,EAAAA;AACnB;"}
@@ -1,42 +1,43 @@
1
- function useImageResizer() {
2
- const changeHeightWidth = (height, maxHeight, width, maxWidth) => (width > maxWidth && (height = Math.round(height * maxWidth / width), width = maxWidth), height > maxHeight && (width = Math.round(width * maxHeight / height), height = maxHeight), {
3
- height,
4
- width
5
- }), renameFileNameExtension = (filename, newExtension) => {
6
- const filenameParts = filename.split(".");
7
- return filenameParts.pop(), filenameParts.join(".") + "." + newExtension;
8
- }, resizeImage = (image, fileName, maxWidth, maxHeight, compressFormat = "jpeg", quality = 80) => {
9
- const qualityDecimal = quality / 100, canvas = document.createElement("canvas"), contentType = `image/${compressFormat}`;
10
- let width = image.width, height = image.height;
11
- const newHeightWidth = changeHeightWidth(height, maxHeight, width, maxWidth);
12
- width = newHeightWidth.width, height = newHeightWidth.height;
13
- const ctx = canvas.getContext("2d");
14
- return ctx && (canvas.width = width, canvas.height = height, ctx.imageSmoothingEnabled && ctx.imageSmoothingQuality && (ctx.imageSmoothingQuality = "high"), ctx.drawImage(image, 0, 0, width, height)), new Promise((resolve, reject) => {
15
- canvas.toBlob((blob) => {
16
- blob ? resolve(new File([blob], fileName, {
17
- type: contentType,
1
+ function z() {
2
+ const h = (e, n, t, o) => (t > o && (e = Math.round(e * o / t), t = o), e > n && (t = Math.round(t * n / e), e = n), {
3
+ height: e,
4
+ width: t
5
+ }), p = (e, n) => {
6
+ const t = e.split(".");
7
+ return t.pop(), t.join(".") + "." + n;
8
+ }, w = (e, n, t, o, s = "jpeg", g = 80) => {
9
+ const i = g / 100, r = document.createElement("canvas"), l = `image/${s}`;
10
+ let c = e.width, m = e.height;
11
+ const u = h(m, o, c, t);
12
+ c = u.width, m = u.height;
13
+ const a = r.getContext("2d");
14
+ return a && (r.width = c, r.height = m, a.imageSmoothingEnabled && a.imageSmoothingQuality && (a.imageSmoothingQuality = "high"), a.drawImage(e, 0, 0, c, m)), new Promise((f, y) => {
15
+ r.toBlob((d) => {
16
+ d ? f(new File([d], n, {
17
+ type: l,
18
18
  lastModified: (/* @__PURE__ */ new Date()).getTime()
19
- })) : reject();
20
- }, contentType, qualityDecimal);
19
+ })) : y();
20
+ }, l, i);
21
21
  });
22
22
  };
23
23
  return {
24
- resizeImageFile: async (file, maxWidth = 1440, maxHeight = 1440, quality = 80) => {
25
- if (!file) throw Error("Image resizer: file not found!");
26
- if (!file.type || !file.type.startsWith("image/")) throw Error("Image resizer: the file given is not an image.");
27
- const compressFormat = "jpeg";
28
- return new Promise((resolve) => {
29
- const image = new Image();
30
- image.setAttribute("style", "max-width: none;"), image.src = URL.createObjectURL(file), image.onload = async () => {
31
- const resizedFile = await resizeImage(image, renameFileNameExtension(file.name, compressFormat), maxWidth, maxHeight, compressFormat, quality);
32
- resolve(resizedFile);
33
- }, image.onerror = (error) => {
34
- throw Error("Image Loading Error: " + error);
24
+ resizeImageFile: async (e, n = 1440, t = 1440, o = 80) => {
25
+ if (!e) throw Error("Image resizer: file not found!");
26
+ if (!e.type || !e.type.startsWith("image/")) throw Error("Image resizer: the file given is not an image.");
27
+ const s = "jpeg";
28
+ return new Promise((g) => {
29
+ const i = new Image();
30
+ i.setAttribute("style", "max-width: none;"), i.src = URL.createObjectURL(e), i.onload = async () => {
31
+ const r = await w(i, p(e.name, s), n, t, s, o);
32
+ g(r);
33
+ }, i.onerror = (r) => {
34
+ throw Error("Image Loading Error: " + r);
35
35
  };
36
36
  });
37
37
  }
38
38
  };
39
39
  }
40
40
  export {
41
- useImageResizer as default
41
+ z as default
42
42
  };
43
+ //# sourceMappingURL=useImageResizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useImageResizer.js","sources":["../../../src/hooks/useImageResizer/useImageResizer.ts"],"sourcesContent":["/**\n * @module useImageResizer\n * @description This module provides a hook to resize and compress image files.\n * @returns all the action available for the image resizer\n */\nexport default function useImageResizer() {\n const changeHeightWidth = (\n height: number,\n maxHeight: number,\n width: number,\n maxWidth: number,\n ) => {\n if (width > maxWidth) {\n height = Math.round((height * maxWidth) / width);\n width = maxWidth;\n }\n if (height > maxHeight) {\n width = Math.round((width * maxHeight) / height);\n height = maxHeight;\n }\n return { height, width };\n };\n\n const renameFileNameExtension = (filename: string, newExtension: string) => {\n const filenameParts = filename.split('.');\n filenameParts.pop();\n return filenameParts.join('.') + '.' + newExtension;\n };\n\n const resizeImage = (\n image: HTMLImageElement,\n fileName: string,\n maxWidth: number,\n maxHeight: number,\n compressFormat = 'jpeg',\n quality = 80,\n ): Promise<File> => {\n const qualityDecimal = quality / 100;\n const canvas = document.createElement('canvas');\n const contentType = `image/${compressFormat}`;\n\n let width = image.width;\n let height = image.height;\n\n const newHeightWidth = changeHeightWidth(\n height,\n maxHeight,\n width,\n maxWidth,\n );\n\n width = newHeightWidth.width;\n height = newHeightWidth.height;\n\n const ctx = canvas.getContext('2d');\n if (ctx) {\n canvas.width = width;\n canvas.height = height;\n\n if (ctx.imageSmoothingEnabled && ctx.imageSmoothingQuality) {\n ctx.imageSmoothingQuality = 'high';\n }\n\n ctx.drawImage(image, 0, 0, width, height);\n }\n return new Promise((resolve, reject) => {\n canvas.toBlob(\n (blob) => {\n if (blob) {\n resolve(\n new File([blob], fileName, {\n type: contentType,\n lastModified: new Date().getTime(),\n }),\n );\n } else {\n reject();\n }\n },\n contentType,\n qualityDecimal,\n );\n });\n };\n\n /**\n * Resize and compress Image File in JPEG format (other format don't work well with canvas.toBlob() with quality parameter)\n * @param file The image file to resize\n * @param maxWidth The maximum width of the resized image\n * @param maxHeight The maximum height of the resized image\n * @param quality The quality of the compressed image\n * @returns The resized image file\n */\n const resizeImageFile = async (\n file: File,\n maxWidth = 1440,\n maxHeight = 1440,\n quality = 80,\n ): Promise<File> => {\n if (!file) throw Error('Image resizer: file not found!');\n\n if (!file.type || !file.type.startsWith('image/'))\n throw Error('Image resizer: the file given is not an image.');\n\n const compressFormat = 'jpeg';\n\n return new Promise((resolve) => {\n const image = new Image();\n image.setAttribute('style', 'max-width: none;');\n image.src = URL.createObjectURL(file);\n image.onload = async () => {\n const resizedFile = await resizeImage(\n image,\n renameFileNameExtension(file.name, compressFormat),\n maxWidth,\n maxHeight,\n compressFormat,\n quality,\n );\n resolve(resizedFile);\n };\n image.onerror = (error) => {\n throw Error('Image Loading Error: ' + error);\n };\n });\n };\n\n return {\n resizeImageFile,\n };\n}\n"],"names":["useImageResizer","changeHeightWidth","height","maxHeight","width","maxWidth","Math","round","renameFileNameExtension","filename","newExtension","filenameParts","split","pop","join","resizeImage","image","fileName","compressFormat","quality","qualityDecimal","canvas","document","createElement","contentType","newHeightWidth","ctx","getContext","imageSmoothingEnabled","imageSmoothingQuality","drawImage","Promise","resolve","reject","toBlob","blob","File","type","lastModified","Date","getTime","resizeImageFile","file","Error","startsWith","Image","setAttribute","src","URL","createObjectURL","onload","resizedFile","name","onerror","error"],"mappings":"AAKA,SAAwBA,IAAkB;AACxC,QAAMC,IAAoBA,CACxBC,GACAC,GACAC,GACAC,OAEID,IAAQC,MACVH,IAASI,KAAKC,MAAOL,IAASG,IAAYD,CAAK,GACvCC,IAAAA,IAENH,IAASC,MACXC,IAAQE,KAAKC,MAAOH,IAAQD,IAAaD,CAAM,GACtCC,IAAAA,IAEJ;AAAA,IAAED,QAAAA;AAAAA,IAAQE,OAAAA;AAAAA,EAAAA,IAGbI,IAA0BA,CAACC,GAAkBC,MAAyB;AACpEC,UAAAA,IAAgBF,EAASG,MAAM,GAAG;AACxCD,WAAAA,EAAcE,IAAI,GACXF,EAAcG,KAAK,GAAG,IAAI,MAAMJ;AAAAA,EAAAA,GAGnCK,IAAcA,CAClBC,GACAC,GACAZ,GACAF,GACAe,IAAiB,QACjBC,IAAU,OACQ;AAClB,UAAMC,IAAiBD,IAAU,KAC3BE,IAASC,SAASC,cAAc,QAAQ,GACxCC,IAAc,SAASN,CAAc;AAE3C,QAAId,IAAQY,EAAMZ,OACdF,IAASc,EAAMd;AAEnB,UAAMuB,IAAiBxB,EACrBC,GACAC,GACAC,GACAC,CACF;AAEAD,IAAAA,IAAQqB,EAAerB,OACvBF,IAASuB,EAAevB;AAElBwB,UAAAA,IAAML,EAAOM,WAAW,IAAI;AAClC,WAAID,MACFL,EAAOjB,QAAQA,GACfiB,EAAOnB,SAASA,GAEZwB,EAAIE,yBAAyBF,EAAIG,0BACnCH,EAAIG,wBAAwB,SAG9BH,EAAII,UAAUd,GAAO,GAAG,GAAGZ,GAAOF,CAAM,IAEnC,IAAI6B,QAAQ,CAACC,GAASC,MAAW;AACtCZ,MAAAA,EAAOa,OACJC,CAASA,MAAA;AACR,QAAIA,IACFH,EACE,IAAII,KAAK,CAACD,CAAI,GAAGlB,GAAU;AAAA,UACzBoB,MAAMb;AAAAA,UACNc,eAAc,oBAAIC,KAAK,GAAEC,QAAQ;AAAA,QAClC,CAAA,CACH,IAEOP;MACT,GAEFT,GACAJ,CACF;AAAA,IAAA,CACD;AAAA,EAAA;AA6CI,SAAA;AAAA,IACLqB,iBAnCsB,OACtBC,GACArC,IAAW,MACXF,IAAY,MACZgB,IAAU,OACQ;AAClB,UAAI,CAACuB,EAAYC,OAAAA,MAAM,gCAAgC;AAEnD,UAAA,CAACD,EAAKL,QAAQ,CAACK,EAAKL,KAAKO,WAAW,QAAQ,EACxCD,OAAAA,MAAM,gDAAgD;AAE9D,YAAMzB,IAAiB;AAEhB,aAAA,IAAIa,QAASC,CAAYA,MAAA;AACxBhB,cAAAA,IAAQ,IAAI6B;AACZC,QAAAA,EAAAA,aAAa,SAAS,kBAAkB,GACxCC,EAAAA,MAAMC,IAAIC,gBAAgBP,CAAI,GACpC1B,EAAMkC,SAAS,YAAY;AACzB,gBAAMC,IAAc,MAAMpC,EACxBC,GACAR,EAAwBkC,EAAKU,MAAMlC,CAAc,GACjDb,GACAF,GACAe,GACAC,CACF;AACAa,UAAAA,EAAQmB,CAAW;AAAA,QAAA,GAErBnC,EAAMqC,UAAWC,CAAUA,MAAA;AACnBX,gBAAAA,MAAM,0BAA0BW,CAAK;AAAA,QAAA;AAAA,MAC7C,CACD;AAAA,IAAA;AAAA,EAIDb;AAEJ;"}
@@ -1,14 +1,15 @@
1
- import { useCallback, useEffect } from "react";
2
- function useKeyPress(callback, keyCodes) {
3
- const handler = useCallback(({
4
- code
1
+ import { useCallback as o, useEffect as s } from "react";
2
+ function i(n, t) {
3
+ const e = o(({
4
+ code: r
5
5
  }) => {
6
- keyCodes.includes(code) && callback();
7
- }, [callback, keyCodes]);
8
- useEffect(() => (window.addEventListener("keydown", handler), () => {
9
- window.removeEventListener("keydown", handler);
10
- }), [handler]);
6
+ t.includes(r) && n();
7
+ }, [n, t]);
8
+ s(() => (window.addEventListener("keydown", e), () => {
9
+ window.removeEventListener("keydown", e);
10
+ }), [e]);
11
11
  }
12
12
  export {
13
- useKeyPress as default
13
+ i as default
14
14
  };
15
+ //# sourceMappingURL=useKeyPress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyPress.js","sources":["../../../src/hooks/useKeyPress/useKeyPress.ts"],"sourcesContent":["import { useCallback, useEffect } from 'react';\n\nexport default function useKeyPress(\n callback: () => void,\n keyCodes: string[],\n): void {\n const handler = useCallback(\n ({ code }: KeyboardEvent) => {\n if (keyCodes.includes(code)) {\n callback();\n }\n },\n [callback, keyCodes],\n );\n\n useEffect(() => {\n window.addEventListener('keydown', handler);\n return () => {\n window.removeEventListener('keydown', handler);\n };\n }, [handler]);\n}\n"],"names":["useKeyPress","callback","keyCodes","handler","useCallback","code","includes","useEffect","addEventListener","removeEventListener"],"mappings":";AAEwBA,SAAAA,EACtBC,GACAC,GACM;AACAC,QAAAA,IAAUC,EACd,CAAC;AAAA,IAAEC,MAAAA;AAAAA,EAAAA,MAA0B;AACvBH,IAAAA,EAASI,SAASD,CAAI,KACfJ;EACX,GAEF,CAACA,GAAUC,CAAQ,CACrB;AAEAK,EAAAA,EAAU,OACDC,OAAAA,iBAAiB,WAAWL,CAAO,GACnC,MAAM;AACJM,WAAAA,oBAAoB,WAAWN,CAAO;AAAA,EAAA,IAE9C,CAACA,CAAO,CAAC;AACd;"}
@@ -1,9 +1,10 @@
1
- function useScrollToTop() {
2
- const refToTop = document.querySelector("html");
1
+ function e() {
2
+ const o = document.querySelector("html");
3
3
  return () => {
4
- refToTop && refToTop.scrollIntoView();
4
+ o && o.scrollIntoView();
5
5
  };
6
6
  }
7
7
  export {
8
- useScrollToTop as default
8
+ e as default
9
9
  };
10
+ //# sourceMappingURL=useScrollToTop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollToTop.js","sources":["../../../src/hooks/useScrollToTop/useScrollToTop.ts"],"sourcesContent":["export default function useScrollToTop() {\n const refToTop = document.querySelector('html');\n\n const scrollToTop = () => {\n refToTop && refToTop.scrollIntoView();\n };\n return scrollToTop;\n}\n"],"names":["useScrollToTop","refToTop","document","querySelector","scrollToTop","scrollIntoView"],"mappings":"AAAA,SAAwBA,IAAiB;AACjCC,QAAAA,IAAWC,SAASC,cAAc,MAAM;AAKvCC,SAHaA,MAAM;AACxBH,IAAAA,KAAYA,EAASI;EAAe;AAGxC;"}
@@ -1,29 +1,30 @@
1
- import { useState, useEffect } from "react";
2
- import { useInView } from "react-intersection-observer";
3
- function useThumbnail(src, options) {
4
- const [status, setStatus] = useState(null), {
5
- ref: inViewRef,
6
- inView
7
- } = useInView({
1
+ import { useState as t, useEffect as a } from "react";
2
+ import { useInView as d } from "react-intersection-observer";
3
+ function w(c, r) {
4
+ const [m, l] = t(null), {
5
+ ref: u,
6
+ inView: f
7
+ } = d({
8
8
  triggerOnce: !0,
9
- ...options == null ? void 0 : options.intersectionOptions
9
+ ...r == null ? void 0 : r.intersectionOptions
10
10
  });
11
- return useEffect(() => {
12
- var _a;
13
- (_a = options == null ? void 0 : options.ref) != null && _a.current && (inViewRef == null || inViewRef(options.ref.current));
14
- }, [options == null ? void 0 : options.ref, inViewRef]), useEffect(() => {
15
- if ((options == null ? void 0 : options.ref) === void 0 || inView) {
16
- const img = new Image();
17
- return img.src = src, img.onload = () => {
18
- setStatus(!0);
19
- }, img.onerror = () => {
20
- setStatus(!1);
11
+ return a(() => {
12
+ var e;
13
+ (e = r == null ? void 0 : r.ref) != null && e.current && (u == null || u(r.ref.current));
14
+ }, [r == null ? void 0 : r.ref, u]), a(() => {
15
+ if ((r == null ? void 0 : r.ref) === void 0 || f) {
16
+ const e = new Image();
17
+ return e.src = c, e.onload = () => {
18
+ l(!0);
19
+ }, e.onerror = () => {
20
+ l(!1);
21
21
  }, () => {
22
- img.onload = null, img.onerror = null, setStatus(null);
22
+ e.onload = null, e.onerror = null, l(null);
23
23
  };
24
24
  }
25
- }, [inView]), status;
25
+ }, [f]), m;
26
26
  }
27
27
  export {
28
- useThumbnail as default
28
+ w as default
29
29
  };
30
+ //# sourceMappingURL=useThumbnail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useThumbnail.js","sources":["../../../src/hooks/useThumbnail/useThumbnail.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport { useEffect, useState } from 'react';\n\nimport { IntersectionOptions, useInView } from 'react-intersection-observer';\n\ntype LazyLoadOptions = {\n ref?: React.RefObject<HTMLElement>;\n intersectionOptions?: IntersectionOptions;\n};\n\n/**\n * Preload a `src` URL and return true if it is available.\n * @param src the URL to preload\n * @param options if defined, lazy-load the `src` URL when ref is defined and visible,\n * with respect to the [`intersectionOptions`](https://github.com/thebuilder/react-intersection-observer/tree/dceba7f52aebea4d62d539bc55a1db129226bb6c?tab=readme-ov-file#options)\n * @return `true` if `src` is available, or false otherwise, or `null` while not tested.\n */\nexport default function useThumbnail(src: string, options?: LazyLoadOptions) {\n const [status, setStatus] = useState<boolean | null>(null);\n\n // If defined, wait for the currentRef to be \"InView\" to check if its thumbnail exists.\n const { ref: inViewRef, inView } = useInView({\n triggerOnce: true,\n ...options?.intersectionOptions,\n });\n\n // This `useEffect` is required to share the ref node with useInView() above\n useEffect(() => {\n // Callback refs, like the one from `useInView`, is a function that takes the node as an argument\n options?.ref?.current && inViewRef?.(options.ref.current);\n }, [options?.ref, inViewRef]);\n\n useEffect(() => {\n if (options?.ref === undefined || inView) {\n const img = new Image();\n img.src = src;\n\n img.onload = () => {\n setStatus(true);\n };\n\n img.onerror = () => {\n setStatus(false);\n };\n\n return () => {\n img.onload = null;\n img.onerror = null;\n setStatus(null);\n };\n }\n }, [inView]);\n\n return status;\n}\n"],"names":["useThumbnail","src","options","status","setStatus","useState","ref","inViewRef","inView","useInView","triggerOnce","intersectionOptions","useEffect","current","undefined","img","Image","onload","onerror"],"mappings":";;AAiBwBA,SAAAA,EAAaC,GAAaC,GAA2B;AAC3E,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAyB,IAAI,GAGnD;AAAA,IAAEC,KAAKC;AAAAA,IAAWC,QAAAA;AAAAA,MAAWC,EAAU;AAAA,IAC3CC,aAAa;AAAA,IACb,GAAGR,KAAAA,gBAAAA,EAASS;AAAAA,EAAAA,CACb;AAGDC,SAAAA,EAAU,MAAM;;AAEdV,KAAAA,IAAAA,KAAAA,gBAAAA,EAASI,QAATJ,QAAAA,EAAcW,YAAWN,KAAAA,QAAAA,EAAYL,EAAQI,IAAIO;AAAAA,EAChD,GAAA,CAACX,KAAAA,gBAAAA,EAASI,KAAKC,CAAS,CAAC,GAE5BK,EAAU,MAAM;AACVV,SAAAA,KAAAA,gBAAAA,EAASI,SAAQQ,UAAaN,GAAQ;AAClCO,YAAAA,IAAM,IAAIC;AAChBD,aAAAA,EAAId,MAAMA,GAEVc,EAAIE,SAAS,MAAM;AACjBb,QAAAA,EAAU,EAAI;AAAA,MAAA,GAGhBW,EAAIG,UAAU,MAAM;AAClBd,QAAAA,EAAU,EAAK;AAAA,MAAA,GAGV,MAAM;AACXW,QAAAA,EAAIE,SAAS,MACbF,EAAIG,UAAU,MACdd,EAAU,IAAI;AAAA,MAAA;AAAA,IAElB;AAAA,EAAA,GACC,CAACI,CAAM,CAAC,GAEJL;AACT;"}
@@ -1,10 +1,11 @@
1
- import { useState, useEffect } from "react";
2
- function useTitle() {
3
- const documentDefined = typeof document < "u", [title, setTitle] = useState(() => document.title);
4
- return useEffect(() => {
5
- documentDefined && setTitle(document.title);
6
- }, [documentDefined]), title;
1
+ import { useState as u, useEffect as o } from "react";
2
+ function f() {
3
+ const t = typeof document < "u", [e, n] = u(() => document.title);
4
+ return o(() => {
5
+ t && n(document.title);
6
+ }, [t]), e;
7
7
  }
8
8
  export {
9
- useTitle as default
9
+ f as default
10
10
  };
11
+ //# sourceMappingURL=useTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTitle.js","sources":["../../../src/hooks/useTitle/useTitle.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport default function useTitle(): string {\n const documentDefined = typeof document !== 'undefined';\n\n const [title, setTitle] = useState<string>(() => document.title);\n\n useEffect(() => {\n if (!documentDefined) return;\n\n setTitle(document.title);\n }, [documentDefined]);\n\n return title;\n}\n"],"names":["useTitle","documentDefined","document","title","setTitle","useState","useEffect"],"mappings":";AAEA,SAAwBA,IAAmB;AACnCC,QAAAA,IAAkB,OAAOC,WAAa,KAEtC,CAACC,GAAOC,CAAQ,IAAIC,EAAiB,MAAMH,SAASC,KAAK;AAE/DG,SAAAA,EAAU,MAAM;AACd,IAAKL,KAELG,EAASF,SAASC,KAAK;AAAA,EAAA,GACtB,CAACF,CAAe,CAAC,GAEbE;AACT;"}
@@ -1,34 +1,35 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import toast from "react-hot-toast";
3
- import { Alert } from "../../components/Alert/Alert.js";
4
- const DEFAULT_POSITION = "top-right";
5
- function useToast() {
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import a from "react-hot-toast";
3
+ import { Alert as d } from "../../components/Alert/Alert.js";
4
+ const u = "top-right";
5
+ function D() {
6
6
  return {
7
- success: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "success", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
8
- id: options == null ? void 0 : options.id,
9
- duration: options == null ? void 0 : options.duration,
10
- position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
7
+ success: (r, e) => a.custom(/* @__PURE__ */ m(d, { type: "success", isToast: !0, isDismissible: e == null ? void 0 : e.isDismissible, className: "mb-12", children: r }), {
8
+ id: e == null ? void 0 : e.id,
9
+ duration: e == null ? void 0 : e.duration,
10
+ position: (e == null ? void 0 : e.position) ?? u
11
11
  }),
12
- error: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "danger", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
13
- id: options == null ? void 0 : options.id,
14
- duration: options == null ? void 0 : options.duration,
15
- position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
12
+ error: (r, e) => a.custom(/* @__PURE__ */ m(d, { type: "danger", isToast: !0, isDismissible: e == null ? void 0 : e.isDismissible, className: "mb-12", children: r }), {
13
+ id: e == null ? void 0 : e.id,
14
+ duration: e == null ? void 0 : e.duration,
15
+ position: (e == null ? void 0 : e.position) ?? u
16
16
  }),
17
- info: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "info", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
18
- id: options == null ? void 0 : options.id,
19
- duration: options == null ? void 0 : options.duration,
20
- position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
17
+ info: (r, e) => a.custom(/* @__PURE__ */ m(d, { type: "info", isToast: !0, isDismissible: e == null ? void 0 : e.isDismissible, className: "mb-12", children: r }), {
18
+ id: e == null ? void 0 : e.id,
19
+ duration: e == null ? void 0 : e.duration,
20
+ position: (e == null ? void 0 : e.position) ?? u
21
21
  }),
22
- warning: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "warning", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
23
- id: options == null ? void 0 : options.id,
24
- duration: options == null ? void 0 : options.duration,
25
- position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
22
+ warning: (r, e) => a.custom(/* @__PURE__ */ m(d, { type: "warning", isToast: !0, isDismissible: e == null ? void 0 : e.isDismissible, className: "mb-12", children: r }), {
23
+ id: e == null ? void 0 : e.id,
24
+ duration: e == null ? void 0 : e.duration,
25
+ position: (e == null ? void 0 : e.position) ?? u
26
26
  }),
27
- loading: toast.loading,
28
- dismiss: (id) => toast.dismiss(id),
29
- remove: (id) => toast.remove(id)
27
+ loading: a.loading,
28
+ dismiss: (r) => a.dismiss(r),
29
+ remove: (r) => a.remove(r)
30
30
  };
31
31
  }
32
32
  export {
33
- useToast as default
33
+ D as default
34
34
  };
35
+ //# sourceMappingURL=useToast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToast.js","sources":["../../../src/hooks/useToast/useToast.tsx"],"sourcesContent":["import { ReactNode } from 'react';\n\nimport toast, { ToastPosition } from 'react-hot-toast';\n\nimport Alert from '../../components/Alert/Alert';\n\nexport interface CustomToastOptions {\n id?: string;\n isDismissible?: boolean;\n position?: ToastPosition;\n duration?: number;\n}\n\nconst DEFAULT_POSITION = 'top-right';\n\nexport default function useToast() {\n const toasts = {\n success: (message: string | ReactNode, options?: CustomToastOptions) =>\n toast.custom(\n <Alert\n type=\"success\"\n isToast={true}\n isDismissible={options?.isDismissible}\n className=\"mb-12\"\n >\n {message}\n </Alert>,\n {\n id: options?.id,\n duration: options?.duration,\n position: options?.position ?? DEFAULT_POSITION,\n },\n ),\n error: (message: string | ReactNode, options?: CustomToastOptions) =>\n toast.custom(\n <Alert\n type=\"danger\"\n isToast={true}\n isDismissible={options?.isDismissible}\n className=\"mb-12\"\n >\n {message}\n </Alert>,\n {\n id: options?.id,\n duration: options?.duration,\n position: options?.position ?? DEFAULT_POSITION,\n },\n ),\n info: (message: string | ReactNode, options?: CustomToastOptions) =>\n toast.custom(\n <Alert\n type=\"info\"\n isToast={true}\n isDismissible={options?.isDismissible}\n className=\"mb-12\"\n >\n {message}\n </Alert>,\n {\n id: options?.id,\n duration: options?.duration,\n position: options?.position ?? DEFAULT_POSITION,\n },\n ),\n warning: (message: string | ReactNode, options?: CustomToastOptions) =>\n toast.custom(\n <Alert\n type=\"warning\"\n isToast={true}\n isDismissible={options?.isDismissible}\n className=\"mb-12\"\n >\n {message}\n </Alert>,\n {\n id: options?.id,\n duration: options?.duration,\n position: options?.position ?? DEFAULT_POSITION,\n },\n ),\n loading: toast.loading,\n dismiss: (id: string) => toast.dismiss(id),\n remove: (id: string) => toast.remove(id),\n };\n\n return toasts;\n}\n"],"names":["DEFAULT_POSITION","useToast","toasts","success","message","options","toast","custom","Alert","isDismissible","id","duration","position","error","info","warning","loading","dismiss","remove"],"mappings":";;;AAaA,MAAMA,IAAmB;AAEzB,SAAwBC,IAAW;AAuE1BC,SAtEQ;AAAA,IACbC,SAASA,CAACC,GAA6BC,MACrCC,EAAMC,yBACHC,GACC,EAAA,MAAK,WACL,SAAS,IACT,eAAeH,KAAAA,gBAAAA,EAASI,eACxB,WAAU,SAETL,aACH,GACA;AAAA,MACEM,IAAIL,KAAAA,gBAAAA,EAASK;AAAAA,MACbC,UAAUN,KAAAA,gBAAAA,EAASM;AAAAA,MACnBC,WAAUP,KAAAA,gBAAAA,EAASO,aAAYZ;AAAAA,IAAAA,CAEnC;AAAA,IACFa,OAAOA,CAACT,GAA6BC,MACnCC,EAAMC,yBACHC,GACC,EAAA,MAAK,UACL,SAAS,IACT,eAAeH,KAAAA,gBAAAA,EAASI,eACxB,WAAU,SAETL,aACH,GACA;AAAA,MACEM,IAAIL,KAAAA,gBAAAA,EAASK;AAAAA,MACbC,UAAUN,KAAAA,gBAAAA,EAASM;AAAAA,MACnBC,WAAUP,KAAAA,gBAAAA,EAASO,aAAYZ;AAAAA,IAAAA,CAEnC;AAAA,IACFc,MAAMA,CAACV,GAA6BC,MAClCC,EAAMC,yBACHC,GACC,EAAA,MAAK,QACL,SAAS,IACT,eAAeH,KAAAA,gBAAAA,EAASI,eACxB,WAAU,SAETL,aACH,GACA;AAAA,MACEM,IAAIL,KAAAA,gBAAAA,EAASK;AAAAA,MACbC,UAAUN,KAAAA,gBAAAA,EAASM;AAAAA,MACnBC,WAAUP,KAAAA,gBAAAA,EAASO,aAAYZ;AAAAA,IAAAA,CAEnC;AAAA,IACFe,SAASA,CAACX,GAA6BC,MACrCC,EAAMC,yBACHC,GACC,EAAA,MAAK,WACL,SAAS,IACT,eAAeH,KAAAA,gBAAAA,EAASI,eACxB,WAAU,SAETL,aACH,GACA;AAAA,MACEM,IAAIL,KAAAA,gBAAAA,EAASK;AAAAA,MACbC,UAAUN,KAAAA,gBAAAA,EAASM;AAAAA,MACnBC,WAAUP,KAAAA,gBAAAA,EAASO,aAAYZ;AAAAA,IAAAA,CAEnC;AAAA,IACFgB,SAASV,EAAMU;AAAAA,IACfC,SAASA,CAACP,MAAeJ,EAAMW,QAAQP,CAAE;AAAA,IACzCQ,QAAQA,CAACR,MAAeJ,EAAMY,OAAOR,CAAE;AAAA,EAAA;AAI3C;"}
@@ -1,10 +1,11 @@
1
- import { useState, useCallback } from "react";
2
- function useToggle(initialState = !1) {
3
- const [state, setState] = useState(initialState), toggle = useCallback(() => {
4
- setState((prevState) => !prevState);
1
+ import { useState as l, useCallback as u } from "react";
2
+ function r(t = !1) {
3
+ const [e, s] = l(t), a = u(() => {
4
+ s((o) => !o);
5
5
  }, []);
6
- return [state, toggle];
6
+ return [e, a];
7
7
  }
8
8
  export {
9
- useToggle as default
9
+ r as default
10
10
  };
11
+ //# sourceMappingURL=useToggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToggle.js","sources":["../../../src/hooks/useToggle/useToggle.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\n// Hook\n// Parameter is the boolean, with default \"false\" value\nexport default function useToggle(initialState = false): [boolean, any] {\n // Initialize the state\n const [state, setState] = useState<boolean>(initialState);\n // Define and memorize toggler function in case we pass down the comopnent,\n // This function change the boolean value to it's opposite value\n const toggle = useCallback((): void => {\n setState((prevState: any) => !prevState);\n }, []);\n return [state, toggle];\n}\n"],"names":["useToggle","initialState","state","setState","useState","toggle","useCallback","prevState"],"mappings":";AAGwBA,SAAAA,EAAUC,IAAe,IAAuB;AAEtE,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAkBH,CAAY,GAGlDI,IAASC,EAAY,MAAY;AAC5B,IAAAH,EAAA,CAACI,MAAmB,CAACA,CAAS;AAAA,EACzC,GAAG,CAAE,CAAA;AACE,SAAA,CAACL,GAAOG,CAAM;AACvB;"}
@@ -1,16 +1,17 @@
1
- import { useRef, useEffect } from "react";
2
- function useTrapFocus() {
3
- const ref = useRef(null), focusableElements = 'button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
4
- return useEffect(() => {
5
- const node = ref.current, firstFocusableElement = node.querySelectorAll(focusableElements)[0], focusableContent = node.querySelectorAll(focusableElements), lastFocusableElement = ref && (focusableContent == null ? void 0 : focusableContent[focusableContent.length - 1]), handleKeydown = (event) => {
6
- event.key === "Tab" && (event.shiftKey ? document.activeElement === firstFocusableElement && (lastFocusableElement.focus(), event.preventDefault()) : document.activeElement === lastFocusableElement && (firstFocusableElement.focus(), event.preventDefault()));
1
+ import { useRef as u, useEffect as a } from "react";
2
+ function d() {
3
+ const s = u(null), o = 'button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
4
+ return a(() => {
5
+ const e = s.current, r = e.querySelectorAll(o)[0], t = e.querySelectorAll(o), l = s && (t == null ? void 0 : t[t.length - 1]), c = (n) => {
6
+ n.key === "Tab" && (n.shiftKey ? document.activeElement === r && (l.focus(), n.preventDefault()) : document.activeElement === l && (r.focus(), n.preventDefault()));
7
7
  };
8
- if (node)
9
- return node.addEventListener("keydown", handleKeydown), () => {
10
- node.removeEventListener("keydown", handleKeydown);
8
+ if (e)
9
+ return e.addEventListener("keydown", c), () => {
10
+ e.removeEventListener("keydown", c);
11
11
  };
12
- }, []), ref;
12
+ }, []), s;
13
13
  }
14
14
  export {
15
- useTrapFocus as default
15
+ d as default
16
16
  };
17
+ //# sourceMappingURL=useTrapFocus.js.map