@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.
- package/dist/audience.js +15 -14
- package/dist/audience.js.map +1 -0
- package/dist/components/ActionBar/ActionBar.js +8 -7
- package/dist/components/ActionBar/ActionBar.js.map +1 -0
- package/dist/components/Alert/Alert.js +60 -59
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/AppHeader/AppHeader.js +19 -18
- package/dist/components/AppHeader/AppHeader.js.map +1 -0
- package/dist/components/AppIcon/AppIcon.d.ts +1 -1
- package/dist/components/AppIcon/AppIcon.js +45 -44
- package/dist/components/AppIcon/AppIcon.js.map +1 -0
- package/dist/components/Attachment/Attachment.js +14 -13
- package/dist/components/Attachment/Attachment.js.map +1 -0
- package/dist/components/Avatar/Avatar.js +28 -27
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Badge/Badge.js +21 -20
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +24 -23
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.js +12 -11
- package/dist/components/Breadcrumb/BreadcrumbItem.js.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbList.js +11 -10
- package/dist/components/Breadcrumb/BreadcrumbList.js.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbNav.d.ts +1 -1
- package/dist/components/Breadcrumb/BreadcrumbNav.js +16 -15
- package/dist/components/Breadcrumb/BreadcrumbNav.js.map +1 -0
- package/dist/components/Button/Button.js +33 -32
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/IconButton.js +16 -15
- package/dist/components/Button/IconButton.js.map +1 -0
- package/dist/components/Button/SearchButton.js +16 -15
- package/dist/components/Button/SearchButton.js.map +1 -0
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js +48 -47
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/CardBody.js +14 -13
- package/dist/components/Card/CardBody.js.map +1 -0
- package/dist/components/Card/CardContext.d.ts +1 -1
- package/dist/components/Card/CardContext.js +8 -7
- package/dist/components/Card/CardContext.js.map +1 -0
- package/dist/components/Card/CardFooter.js +6 -5
- package/dist/components/Card/CardFooter.js.map +1 -0
- package/dist/components/Card/CardHeader.js +15 -14
- package/dist/components/Card/CardHeader.js.map +1 -0
- package/dist/components/Card/CardImage.js +14 -13
- package/dist/components/Card/CardImage.js.map +1 -0
- package/dist/components/Card/CardText.js +9 -8
- package/dist/components/Card/CardText.js.map +1 -0
- package/dist/components/Card/CardTitle.js +9 -8
- package/dist/components/Card/CardTitle.js.map +1 -0
- package/dist/components/Card/CardUser.js +9 -8
- package/dist/components/Card/CardUser.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +31 -30
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/ColorPicker/ColorPalette.js +5 -4
- package/dist/components/ColorPicker/ColorPalette.js.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.js +29 -28
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/ColorPicker/ColorPickerItem.js +12 -11
- package/dist/components/ColorPicker/ColorPickerItem.js.map +1 -0
- package/dist/components/Combobox/Combobox.js +36 -35
- package/dist/components/Combobox/Combobox.js.map +1 -0
- package/dist/components/Combobox/ComboboxTrigger.js +22 -21
- package/dist/components/Combobox/ComboboxTrigger.js.map +1 -0
- package/dist/components/Dropdown/Dropdown.js +56 -55
- package/dist/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/components/Dropdown/DropdownCheckboxItem.js +27 -26
- package/dist/components/Dropdown/DropdownCheckboxItem.js.map +1 -0
- package/dist/components/Dropdown/DropdownContext.js +8 -7
- package/dist/components/Dropdown/DropdownContext.js.map +1 -0
- package/dist/components/Dropdown/DropdownItem.js +28 -27
- package/dist/components/Dropdown/DropdownItem.js.map +1 -0
- package/dist/components/Dropdown/DropdownMenu.js +22 -21
- package/dist/components/Dropdown/DropdownMenu.js.map +1 -0
- package/dist/components/Dropdown/DropdownMenuGroup.js +10 -9
- package/dist/components/Dropdown/DropdownMenuGroup.js.map +1 -0
- package/dist/components/Dropdown/DropdownRadioItem.js +27 -26
- package/dist/components/Dropdown/DropdownRadioItem.js.map +1 -0
- package/dist/components/Dropdown/DropdownSeparator.js +4 -3
- package/dist/components/Dropdown/DropdownSeparator.js.map +1 -0
- package/dist/components/Dropdown/DropdownTrigger.js +29 -28
- package/dist/components/Dropdown/DropdownTrigger.js.map +1 -0
- package/dist/components/Dropzone/Dropzone.js +48 -47
- package/dist/components/Dropzone/Dropzone.js.map +1 -0
- package/dist/components/Dropzone/DropzoneContext.js +9 -8
- package/dist/components/Dropzone/DropzoneContext.js.map +1 -0
- package/dist/components/Dropzone/DropzoneDrag.js +8 -7
- package/dist/components/Dropzone/DropzoneDrag.js.map +1 -0
- package/dist/components/Dropzone/DropzoneFile.js +26 -25
- package/dist/components/Dropzone/DropzoneFile.js.map +1 -0
- package/dist/components/Dropzone/DropzoneImport.js +21 -20
- package/dist/components/Dropzone/DropzoneImport.js.map +1 -0
- package/dist/components/EmptyScreen/EmptyScreen.js +17 -16
- package/dist/components/EmptyScreen/EmptyScreen.js.map +1 -0
- package/dist/components/FileCard/FileCard.d.ts +1 -1
- package/dist/components/FileCard/FileCard.js +38 -37
- package/dist/components/FileCard/FileCard.js.map +1 -0
- package/dist/components/FileCard/FileIcon.d.ts +1 -1
- package/dist/components/FileCard/FileIcon.js +12 -11
- package/dist/components/FileCard/FileIcon.js.map +1 -0
- package/dist/components/Form/FormContext.js +8 -7
- package/dist/components/Form/FormContext.js.map +1 -0
- package/dist/components/Form/FormControl.js +31 -30
- package/dist/components/Form/FormControl.js.map +1 -0
- package/dist/components/Form/FormText.js +13 -12
- package/dist/components/Form/FormText.js.map +1 -0
- package/dist/components/Grid/Grid.js +28 -27
- package/dist/components/Grid/Grid.js.map +1 -0
- package/dist/components/Heading/Heading.js +15 -14
- package/dist/components/Heading/Heading.js.map +1 -0
- package/dist/components/Icon/Icon.js +9 -8
- package/dist/components/Icon/Icon.js.map +1 -0
- package/dist/components/Image/Image.js +40 -39
- package/dist/components/Image/Image.js.map +1 -0
- package/dist/components/ImagePicker/ImagePicker.d.ts +1 -1
- package/dist/components/ImagePicker/ImagePicker.js +52 -51
- package/dist/components/ImagePicker/ImagePicker.js.map +1 -0
- package/dist/components/Input/Input.js +29 -28
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Label/Label.js +31 -30
- package/dist/components/Label/Label.js.map +1 -0
- package/dist/components/Loading/Loading.js +24 -23
- package/dist/components/Loading/Loading.js.map +1 -0
- package/dist/components/LoadingScreen/LoadingScreen.js +21 -20
- package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -0
- package/dist/components/Logo/Logo.js +13 -12
- package/dist/components/Logo/Logo.js.map +1 -0
- package/dist/components/Menu/Menu.js +40 -39
- package/dist/components/Menu/Menu.js.map +1 -0
- package/dist/components/Menu/MenuButton.js +18 -17
- package/dist/components/Menu/MenuButton.js.map +1 -0
- package/dist/components/Menu/MenuContext.js +9 -8
- package/dist/components/Menu/MenuContext.js.map +1 -0
- package/dist/components/Menu/MenuItem.js +15 -14
- package/dist/components/Menu/MenuItem.js.map +1 -0
- package/dist/components/Modal/Modal.js +50 -49
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/ModalBody.js +12 -11
- package/dist/components/Modal/ModalBody.js.map +1 -0
- package/dist/components/Modal/ModalContext.js +9 -8
- package/dist/components/Modal/ModalContext.js.map +1 -0
- package/dist/components/Modal/ModalFooter.js +4 -3
- package/dist/components/Modal/ModalFooter.js.map +1 -0
- package/dist/components/Modal/ModalHeader.js +23 -22
- package/dist/components/Modal/ModalHeader.js.map +1 -0
- package/dist/components/Modal/ModalSubtitle.js +4 -3
- package/dist/components/Modal/ModalSubtitle.js.map +1 -0
- package/dist/components/Popover/Popover.js +34 -33
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Radio/Radio.js +27 -26
- package/dist/components/Radio/Radio.js.map +1 -0
- package/dist/components/SearchBar/SearchBar.js +30 -29
- package/dist/components/SearchBar/SearchBar.js.map +1 -0
- package/dist/components/Select/Select.js +32 -31
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Select/SelectTrigger.js +5 -4
- package/dist/components/Select/SelectTrigger.js.map +1 -0
- package/dist/components/Table/TableExplorer.js +8 -7
- package/dist/components/Table/TableExplorer.js.map +1 -0
- package/dist/components/Tabs/Tabs.js +59 -58
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/TabsContext.js +9 -8
- package/dist/components/Tabs/TabsContext.js.map +1 -0
- package/dist/components/Tabs/TabsItem.js +21 -20
- package/dist/components/Tabs/TabsItem.js.map +1 -0
- package/dist/components/Tabs/TabsList.js +19 -18
- package/dist/components/Tabs/TabsList.js.map +1 -0
- package/dist/components/Tabs/TabsPanel.js +10 -9
- package/dist/components/Tabs/TabsPanel.js.map +1 -0
- package/dist/components/TextArea/TextArea.js +32 -31
- package/dist/components/TextArea/TextArea.js.map +1 -0
- package/dist/components/TextArea/TextareaCounter.js +7 -6
- package/dist/components/TextArea/TextareaCounter.js.map +1 -0
- package/dist/components/Toolbar/Toolbar.js +61 -60
- package/dist/components/Toolbar/Toolbar.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +29 -28
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/TreeView/TreeItem.js +47 -46
- package/dist/components/TreeView/TreeItem.js.map +1 -0
- package/dist/components/TreeView/TreeView.js +34 -33
- package/dist/components/TreeView/TreeView.js.map +1 -0
- package/dist/components/TreeView/hooks/useTreeItemEvents.js +19 -18
- package/dist/components/TreeView/hooks/useTreeItemEvents.js.map +1 -0
- package/dist/components/UploadCard/UploadCard.js +53 -52
- package/dist/components/UploadCard/UploadCard.js.map +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +8 -7
- package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
- package/dist/core/OdeClientProvider/OdeClientProvider.d.ts +1 -1
- package/dist/core/OdeClientProvider/OdeClientProvider.js +45 -44
- package/dist/core/OdeClientProvider/OdeClientProvider.js.map +1 -0
- package/dist/core/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/core/ThemeProvider/ThemeProvider.js +36 -35
- package/dist/core/ThemeProvider/ThemeProvider.js.map +1 -0
- package/dist/core/useAvatar/useAvatar.d.ts +1 -1
- package/dist/core/useAvatar/useAvatar.js +22 -21
- package/dist/core/useAvatar/useAvatar.js.map +1 -0
- package/dist/core/useBookmark/useBookmark.d.ts +1 -1
- package/dist/core/useBookmark/useBookmark.js +10 -9
- package/dist/core/useBookmark/useBookmark.js.map +1 -0
- package/dist/core/useConf/useConf.d.ts +1 -1
- package/dist/core/useConf/useConf.js +8 -7
- package/dist/core/useConf/useConf.js.map +1 -0
- package/dist/core/useConversation/useConversation.js +29 -28
- package/dist/core/useConversation/useConversation.js.map +1 -0
- package/dist/core/useCookiesConsent/useCookiesConsent.js +17 -16
- package/dist/core/useCookiesConsent/useCookiesConsent.js.map +1 -0
- package/dist/core/useDate/useDate.js +36 -35
- package/dist/core/useDate/useDate.js.map +1 -0
- package/dist/core/useHasWorkflow/useHasWorkflow.js +15 -14
- package/dist/core/useHasWorkflow/useHasWorkflow.js.map +1 -0
- package/dist/core/useHeader/useHeader.d.ts +1 -1
- package/dist/core/useHeader/useHeader.js +42 -41
- package/dist/core/useHeader/useHeader.js.map +1 -0
- package/dist/core/useHttpErrorToast/useHttpErrorToast.js +18 -17
- package/dist/core/useHttpErrorToast/useHttpErrorToast.js.map +1 -0
- package/dist/core/useIsAdml/useIsAdml.js +12 -11
- package/dist/core/useIsAdml/useIsAdml.js.map +1 -0
- package/dist/core/useLibraryUrl/useLibraryUrl.js +16 -15
- package/dist/core/useLibraryUrl/useLibraryUrl.js.map +1 -0
- package/dist/core/useMediaLibrary/useMediaLibrary.d.ts +1 -1
- package/dist/core/useMediaLibrary/useMediaLibrary.js +32 -31
- package/dist/core/useMediaLibrary/useMediaLibrary.js.map +1 -0
- package/dist/core/useOdeIcons/useOdeIcons.d.ts +1 -1
- package/dist/core/useOdeIcons/useOdeIcons.js +38 -37
- package/dist/core/useOdeIcons/useOdeIcons.js.map +1 -0
- package/dist/core/usePaths/usePaths.js +3 -2
- package/dist/core/usePaths/usePaths.js.map +1 -0
- package/dist/core/usePreferences/usePreferences.js +6 -5
- package/dist/core/usePreferences/usePreferences.js.map +1 -0
- package/dist/core/useResource/useResource.d.ts +1 -0
- package/dist/core/useResource/useResource.js +15 -14
- package/dist/core/useResource/useResource.js.map +1 -0
- package/dist/core/useResourceSearch/useResourceSearch.d.ts +1 -1
- package/dist/core/useResourceSearch/useResourceSearch.js +23 -22
- package/dist/core/useResourceSearch/useResourceSearch.js.map +1 -0
- package/dist/core/useSession/useSession.js +7 -6
- package/dist/core/useSession/useSession.js.map +1 -0
- package/dist/core/useTrashedResource/useTrashedResource.js +18 -17
- package/dist/core/useTrashedResource/useTrashedResource.js.map +1 -0
- package/dist/core/useUpload/useUpload.d.ts +5 -4
- package/dist/core/useUpload/useUpload.js +69 -68
- package/dist/core/useUpload/useUpload.js.map +1 -0
- package/dist/core/useUploadFiles/useUploadFiles.d.ts +6 -6
- package/dist/core/useUploadFiles/useUploadFiles.js +82 -81
- package/dist/core/useUploadFiles/useUploadFiles.js.map +1 -0
- package/dist/core/useUser/useUser.d.ts +1 -1
- package/dist/core/useUser/useUser.js +16 -15
- package/dist/core/useUser/useUser.js.map +1 -0
- package/dist/core/useWorkspaceFile/useWorkspaceFile.d.ts +5 -5
- package/dist/core/useWorkspaceFile/useWorkspaceFile.js +31 -30
- package/dist/core/useWorkspaceFile/useWorkspaceFile.js.map +1 -0
- package/dist/core/useWorkspaceSearch/useWorkspaceSearch.d.ts +2 -2
- package/dist/core/useWorkspaceSearch/useWorkspaceSearch.js +42 -41
- package/dist/core/useWorkspaceSearch/useWorkspaceSearch.js.map +1 -0
- package/dist/core/useXitiTrackPageLoad/useXitiTrackPageLoad.js +18 -17
- package/dist/core/useXitiTrackPageLoad/useXitiTrackPageLoad.js.map +1 -0
- package/dist/core/useZendeskGuide/useZendeskGuide.js +47 -46
- package/dist/core/useZendeskGuide/useZendeskGuide.js.map +1 -0
- package/dist/editor.js +57 -56
- package/dist/editor.js.map +1 -0
- package/dist/hooks/useBrowserInfo/useBrowserInfo.js +12 -11
- package/dist/hooks/useBrowserInfo/useBrowserInfo.js.map +1 -0
- package/dist/hooks/useClickOutside/useClickOutside.js +19 -18
- package/dist/hooks/useClickOutside/useClickOutside.js.map +1 -0
- package/dist/hooks/useDebounce/useDebounce.js +11 -10
- package/dist/hooks/useDebounce/useDebounce.js.map +1 -0
- package/dist/hooks/useDropdown/useDropdown.js +96 -95
- package/dist/hooks/useDropdown/useDropdown.js.map +1 -0
- package/dist/hooks/useDropzone/useDropzone.js +53 -52
- package/dist/hooks/useDropzone/useDropzone.js.map +1 -0
- package/dist/hooks/useHover/useHover.js +15 -14
- package/dist/hooks/useHover/useHover.js.map +1 -0
- package/dist/hooks/useImage/useImage.js +14 -13
- package/dist/hooks/useImage/useImage.js.map +1 -0
- package/dist/hooks/useImageResizer/useImageResizer.js +32 -31
- package/dist/hooks/useImageResizer/useImageResizer.js.map +1 -0
- package/dist/hooks/useKeyPress/useKeyPress.js +11 -10
- package/dist/hooks/useKeyPress/useKeyPress.js.map +1 -0
- package/dist/hooks/useScrollToTop/useScrollToTop.js +5 -4
- package/dist/hooks/useScrollToTop/useScrollToTop.js.map +1 -0
- package/dist/hooks/useThumbnail/useThumbnail.js +22 -21
- package/dist/hooks/useThumbnail/useThumbnail.js.map +1 -0
- package/dist/hooks/useTitle/useTitle.js +8 -7
- package/dist/hooks/useTitle/useTitle.js.map +1 -0
- package/dist/hooks/useToast/useToast.js +26 -25
- package/dist/hooks/useToast/useToast.js.map +1 -0
- package/dist/hooks/useToggle/useToggle.js +7 -6
- package/dist/hooks/useToggle/useToggle.js.map +1 -0
- package/dist/hooks/useTrapFocus/useTrapFocus.js +12 -11
- package/dist/hooks/useTrapFocus/useTrapFocus.js.map +1 -0
- package/dist/index.js +226 -225
- package/dist/index.js.map +1 -0
- package/dist/modals.js +15 -14
- package/dist/modals.js.map +1 -0
- package/dist/modules/audience/ReactionChoice.d.ts +1 -1
- package/dist/modules/audience/ReactionChoice.js +24 -23
- package/dist/modules/audience/ReactionChoice.js.map +1 -0
- package/dist/modules/audience/ReactionModal.Card.d.ts +1 -1
- package/dist/modules/audience/ReactionModal.Card.js +26 -25
- package/dist/modules/audience/ReactionModal.Card.js.map +1 -0
- package/dist/modules/audience/ReactionModal.d.ts +1 -1
- package/dist/modules/audience/ReactionModal.js +59 -58
- package/dist/modules/audience/ReactionModal.js.map +1 -0
- package/dist/modules/audience/ReactionSummary.d.ts +1 -1
- package/dist/modules/audience/ReactionSummary.js +19 -18
- package/dist/modules/audience/ReactionSummary.js.map +1 -0
- package/dist/modules/audience/ViewsByProfileCard.d.ts +1 -1
- package/dist/modules/audience/ViewsByProfileCard.js +23 -22
- package/dist/modules/audience/ViewsByProfileCard.js.map +1 -0
- package/dist/modules/audience/ViewsCounter.js +14 -13
- package/dist/modules/audience/ViewsCounter.js.map +1 -0
- package/dist/modules/audience/ViewsModal.d.ts +1 -1
- package/dist/modules/audience/ViewsModal.js +32 -31
- package/dist/modules/audience/ViewsModal.js.map +1 -0
- package/dist/modules/audience/hooks/useReactionIcons.d.ts +1 -1
- package/dist/modules/audience/hooks/useReactionIcons.js +14 -13
- package/dist/modules/audience/hooks/useReactionIcons.js.map +1 -0
- package/dist/modules/audience/hooks/useReactions.d.ts +6 -4
- package/dist/modules/audience/hooks/useReactions.js +25 -24
- package/dist/modules/audience/hooks/useReactions.js.map +1 -0
- package/dist/modules/audience/hooks/useViews.d.ts +3 -3
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js +59 -58
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js.map +1 -0
- package/dist/modules/editor/components/Editor/Editor.d.ts +1 -1
- package/dist/modules/editor/components/Editor/Editor.js +70 -69
- package/dist/modules/editor/components/Editor/Editor.js.map +1 -0
- package/dist/modules/editor/components/Editor/MathsModal.js +38 -37
- package/dist/modules/editor/components/Editor/MathsModal.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.js +15 -14
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.js +38 -37
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js +34 -33
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.js +13 -12
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js +37 -36
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.js +36 -35
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +31 -30
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +96 -95
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js.map +1 -0
- package/dist/modules/editor/components/NodeView/AttachmentNodeView.js +6 -5
- package/dist/modules/editor/components/NodeView/AttachmentNodeView.js.map +1 -0
- package/dist/modules/editor/components/NodeView/AudioNodeView.js +6 -5
- package/dist/modules/editor/components/NodeView/AudioNodeView.js.map +1 -0
- package/dist/modules/editor/components/NodeView/ImageNodeView.js +6 -5
- package/dist/modules/editor/components/NodeView/ImageNodeView.js.map +1 -0
- package/dist/modules/editor/components/NodeView/LinkerNodeView.js +6 -5
- package/dist/modules/editor/components/NodeView/LinkerNodeView.js.map +1 -0
- package/dist/modules/editor/components/NodeView/VideoNodeView.js +6 -5
- package/dist/modules/editor/components/NodeView/VideoNodeView.js.map +1 -0
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +25 -24
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js.map +1 -0
- package/dist/modules/editor/components/Renderer/AudioRenderer.js +8 -7
- package/dist/modules/editor/components/Renderer/AudioRenderer.js.map +1 -0
- package/dist/modules/editor/components/Renderer/LinkerRenderer.js +27 -26
- package/dist/modules/editor/components/Renderer/LinkerRenderer.js.map +1 -0
- package/dist/modules/editor/components/Renderer/MediaRenderer.js +38 -37
- package/dist/modules/editor/components/Renderer/MediaRenderer.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js +3 -2
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/LinkToolbar.js +32 -31
- package/dist/modules/editor/components/Toolbar/LinkToolbar.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js +22 -21
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js +31 -30
- package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js +21 -20
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/TableToolbar.js +40 -39
- package/dist/modules/editor/components/Toolbar/TableToolbar.js.map +1 -0
- package/dist/modules/editor/hooks/useActionOptions.js +48 -47
- package/dist/modules/editor/hooks/useActionOptions.js.map +1 -0
- package/dist/modules/editor/hooks/useCommentEditor.js +28 -27
- package/dist/modules/editor/hooks/useCommentEditor.js.map +1 -0
- package/dist/modules/editor/hooks/useEditorContext.js +9 -8
- package/dist/modules/editor/hooks/useEditorContext.js.map +1 -0
- package/dist/modules/editor/hooks/useImageModal.d.ts +2 -1
- package/dist/modules/editor/hooks/useImageModal.js +33 -32
- package/dist/modules/editor/hooks/useImageModal.js.map +1 -0
- package/dist/modules/editor/hooks/useImageSelection.js +32 -31
- package/dist/modules/editor/hooks/useImageSelection.js.map +1 -0
- package/dist/modules/editor/hooks/useLinkToolbar.js +25 -24
- package/dist/modules/editor/hooks/useLinkToolbar.js.map +1 -0
- package/dist/modules/editor/hooks/useMathsModal.js +10 -9
- package/dist/modules/editor/hooks/useMathsModal.js.map +1 -0
- package/dist/modules/editor/hooks/useMathsStyles.js +14 -13
- package/dist/modules/editor/hooks/useMathsStyles.js.map +1 -0
- package/dist/modules/editor/hooks/useMediaLibraryEditor.d.ts +1 -1
- package/dist/modules/editor/hooks/useMediaLibraryEditor.js +97 -96
- package/dist/modules/editor/hooks/useMediaLibraryEditor.js.map +1 -0
- package/dist/modules/editor/hooks/useResizeMedia.js +32 -31
- package/dist/modules/editor/hooks/useResizeMedia.js.map +1 -0
- package/dist/modules/editor/hooks/useSpeechRecognition.js +13 -12
- package/dist/modules/editor/hooks/useSpeechRecognition.js.map +1 -0
- package/dist/modules/editor/hooks/useSpeechSynthetisis.js +14 -13
- package/dist/modules/editor/hooks/useSpeechSynthetisis.js.map +1 -0
- package/dist/modules/editor/hooks/useTipTapEditor.js +58 -57
- package/dist/modules/editor/hooks/useTipTapEditor.js.map +1 -0
- package/dist/modules/editor/utils/has-extension.js +3 -2
- package/dist/modules/editor/utils/has-extension.js.map +1 -0
- package/dist/modules/editor/utils/has-mark.js +3 -2
- package/dist/modules/editor/utils/has-mark.js.map +1 -0
- package/dist/modules/editor/utils/has-text-style.js +4 -3
- package/dist/modules/editor/utils/has-text-style.js.map +1 -0
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +49 -48
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js.map +1 -0
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +19 -18
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js.map +1 -0
- package/dist/modules/modals/PublishModal/PublishModal.d.ts +1 -1
- package/dist/modules/modals/PublishModal/PublishModal.js +98 -97
- package/dist/modules/modals/PublishModal/PublishModal.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/ActivitiesDropdown.js +20 -19
- package/dist/modules/modals/PublishModal/components/ActivitiesDropdown.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/AgeSelect.js +15 -14
- package/dist/modules/modals/PublishModal/components/AgeSelect.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/LangSelect.js +12 -11
- package/dist/modules/modals/PublishModal/components/LangSelect.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/PublishModalFooter.js +17 -16
- package/dist/modules/modals/PublishModal/components/PublishModalFooter.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/SubjectsDropdown.js +20 -19
- package/dist/modules/modals/PublishModal/components/SubjectsDropdown.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/ToastError.js +18 -17
- package/dist/modules/modals/PublishModal/components/ToastError.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/ToastSuccess.d.ts +1 -1
- package/dist/modules/modals/PublishModal/components/ToastSuccess.js +13 -12
- package/dist/modules/modals/PublishModal/components/ToastSuccess.js.map +1 -0
- package/dist/modules/modals/PublishModal/constants/ageOptions.js +3 -2
- package/dist/modules/modals/PublishModal/constants/ageOptions.js.map +1 -0
- package/dist/modules/modals/PublishModal/hooks/useActivitiesOptions.js +5 -4
- package/dist/modules/modals/PublishModal/hooks/useActivitiesOptions.js.map +1 -0
- package/dist/modules/modals/PublishModal/hooks/useLanguageOptions.js +17 -16
- package/dist/modules/modals/PublishModal/hooks/useLanguageOptions.js.map +1 -0
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.d.ts +1 -1
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.js +80 -79
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.js.map +1 -0
- package/dist/modules/modals/PublishModal/hooks/useSubjectsOptions.js +42 -41
- package/dist/modules/modals/PublishModal/hooks/useSubjectsOptions.js.map +1 -0
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/ResourceModal.js +116 -115
- package/dist/modules/modals/ResourceModal/ResourceModal.js.map +1 -0
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.js +48 -47
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.js.map +1 -0
- package/dist/modules/modals/ResourceModal/hooks/useSlug.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/hooks/useSlug.js +33 -32
- package/dist/modules/modals/ResourceModal/hooks/useSlug.js.map +1 -0
- package/dist/modules/modals/ResourceModal/hooks/useThumb.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/hooks/useThumb.js +13 -12
- package/dist/modules/modals/ResourceModal/hooks/useThumb.js.map +1 -0
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.js +11 -10
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.js.map +1 -0
- package/dist/modules/modals/ShareModal/ShareBookmarkLine.d.ts +2 -2
- package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -1
- package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
- package/dist/modules/modals/ShareModal/apps/ShareBlog.js +34 -33
- package/dist/modules/modals/ShareModal/apps/ShareBlog.js.map +1 -0
- package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +2 -2
- package/dist/modules/modals/ShareModal/hooks/useShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.js +13 -12
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.js.map +1 -0
- package/dist/modules/modals/ShareModal/utils/hasRight.d.ts +1 -0
- package/dist/modules/modals/ShareModal/utils/showShareRightLine.d.ts +1 -0
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.d.ts +1 -1
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js +43 -42
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js.map +1 -0
- package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js +19 -18
- package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js.map +1 -0
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.d.ts +1 -1
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js +158 -157
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js.map +1 -0
- package/dist/modules/multimedia/Embed/Embed.js +22 -21
- package/dist/modules/multimedia/Embed/Embed.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js +79 -78
- package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/components/ImageEditorToolbar.js +38 -37
- package/dist/modules/multimedia/ImageEditor/components/ImageEditorToolbar.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/blur.js +50 -49
- package/dist/modules/multimedia/ImageEditor/effects/blur.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/crop.js +100 -99
- package/dist/modules/multimedia/ImageEditor/effects/crop.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/misc.js +108 -107
- package/dist/modules/multimedia/ImageEditor/effects/misc.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/resize.js +97 -96
- package/dist/modules/multimedia/ImageEditor/effects/resize.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/rotate.js +26 -25
- package/dist/modules/multimedia/ImageEditor/effects/rotate.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js +39 -38
- package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.js +57 -56
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.js +29 -28
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/utils/aggregate.js +10 -9
- package/dist/modules/multimedia/ImageEditor/utils/aggregate.js.map +1 -0
- package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.d.ts +1 -1
- package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.js +34 -33
- package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.js.map +1 -0
- package/dist/modules/multimedia/Linker/ExternalLinker.js +35 -34
- package/dist/modules/multimedia/Linker/ExternalLinker.js.map +1 -0
- package/dist/modules/multimedia/Linker/InternalLinker.d.ts +1 -1
- package/dist/modules/multimedia/Linker/InternalLinker.js +88 -87
- package/dist/modules/multimedia/Linker/InternalLinker.js.map +1 -0
- package/dist/modules/multimedia/LinkerCard/LinkerCard.d.ts +1 -1
- package/dist/modules/multimedia/LinkerCard/LinkerCard.js +32 -31
- package/dist/modules/multimedia/LinkerCard/LinkerCard.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +1 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +119 -118
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.d.ts +4 -4
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.js +9 -8
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Audio.js +16 -15
- package/dist/modules/multimedia/MediaLibrary/innertabs/Audio.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/ExternalLink.js +13 -12
- package/dist/modules/multimedia/MediaLibrary/innertabs/ExternalLink.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Iframe.js +10 -9
- package/dist/modules/multimedia/MediaLibrary/innertabs/Iframe.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.d.ts +1 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.js +29 -28
- package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +23 -22
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Video.js +18 -17
- package/dist/modules/multimedia/MediaLibrary/innertabs/Video.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/VideoEmbedder.js +10 -9
- package/dist/modules/multimedia/MediaLibrary/innertabs/VideoEmbedder.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +17 -16
- package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +19 -18
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.js.map +1 -0
- package/dist/modules/multimedia/UploadFiles/UploadFiles.d.ts +2 -2
- package/dist/modules/multimedia/UploadFiles/UploadFiles.js +42 -41
- package/dist/modules/multimedia/UploadFiles/UploadFiles.js.map +1 -0
- package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js +60 -59
- package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js.map +1 -0
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.d.ts +1 -1
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js +153 -152
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js.map +1 -0
- package/dist/modules/multimedia/Workspace/Workspace.d.ts +1 -1
- package/dist/modules/multimedia/Workspace/Workspace.js +110 -109
- package/dist/modules/multimedia/Workspace/Workspace.js.map +1 -0
- package/dist/multimedia.js +19 -18
- package/dist/multimedia.js.map +1 -0
- package/dist/portal/Header/Badge.js +6 -5
- package/dist/portal/Header/Badge.js.map +1 -0
- package/dist/portal/Header/Header.js +138 -137
- package/dist/portal/Header/Header.js.map +1 -0
- package/dist/portal/Header/NavItem.js +12 -11
- package/dist/portal/Header/NavItem.js.map +1 -0
- package/dist/portal/Header/NavLink.js +15 -14
- package/dist/portal/Header/NavLink.js.map +1 -0
- package/dist/portal/Header/Navbar.js +10 -9
- package/dist/portal/Header/Navbar.js.map +1 -0
- package/dist/portal/Header/NavbarNav.js +10 -9
- package/dist/portal/Header/NavbarNav.js.map +1 -0
- package/dist/portal/Header/WidgetApps.d.ts +1 -1
- package/dist/portal/Header/WidgetApps.js +17 -16
- package/dist/portal/Header/WidgetApps.js.map +1 -0
- package/dist/portal/Help/Help.js +19 -18
- package/dist/portal/Help/Help.js.map +1 -0
- package/dist/portal/Help/hooks/useHelp.js +64 -63
- package/dist/portal/Help/hooks/useHelp.js.map +1 -0
- package/dist/portal/Layout/Layout.js +35 -34
- package/dist/portal/Layout/Layout.js.map +1 -0
- package/dist/portal/SearchEngine/SearchEngine.js +26 -25
- package/dist/portal/SearchEngine/SearchEngine.js.map +1 -0
- package/dist/utils/MockedDataProvider/MockedDataProvider.d.ts +1 -1
- package/dist/utils/MockedDataProvider/MockedDataProvider.js +22 -21
- package/dist/utils/MockedDataProvider/MockedDataProvider.js.map +1 -0
- package/dist/utils/StringUtils.js +9 -8
- package/dist/utils/StringUtils.js.map +1 -0
- package/dist/utils/addTimestampToUrl.js +5 -4
- package/dist/utils/addTimestampToUrl.js.map +1 -0
- package/dist/utils/blob.js +10 -9
- package/dist/utils/blob.js.map +1 -0
- package/dist/utils/checkUserRight.d.ts +1 -1
- package/dist/utils/checkUserRight.js +28 -27
- package/dist/utils/checkUserRight.js.map +1 -0
- package/dist/utils/fileSize.js +6 -5
- package/dist/utils/fileSize.js.map +1 -0
- package/dist/utils/findTreeNode.js +8 -7
- package/dist/utils/findTreeNode.js.map +1 -0
- package/dist/utils/isActionAvailable.d.ts +1 -1
- package/dist/utils/isActionAvailable.js +5 -4
- package/dist/utils/isActionAvailable.js.map +1 -0
- package/dist/utils/libraryMaps.js +3 -2
- package/dist/utils/libraryMaps.js.map +1 -0
- package/dist/utils/noop.js +3 -2
- package/dist/utils/noop.js.map +1 -0
- package/dist/utils/ref.js +9 -8
- package/dist/utils/ref.js.map +1 -0
- package/dist/utils/thumbnail.js +4 -3
- package/dist/utils/thumbnail.js.map +1 -0
- package/dist/utils/time.js +8 -7
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/treeview.d.ts +1 -1
- package/dist/utils/treeview.js +97 -96
- package/dist/utils/treeview.js.map +1 -0
- package/dist/utils/video.js +3 -2
- package/dist/utils/video.js.map +1 -0
- package/dist/widgets/BookmarkedApps/BookmarkedApps.d.ts +1 -1
- package/dist/widgets/BookmarkedApps/BookmarkedApps.js +7 -6
- package/dist/widgets/BookmarkedApps/BookmarkedApps.js.map +1 -0
- package/dist/widgets/Widget/Widget.js +19 -18
- package/dist/widgets/Widget/Widget.js.map +1 -0
- package/package.json +4 -4
|
@@ -1,76 +1,77 @@
|
|
|
1
|
-
import { useState, useRef } from "react";
|
|
2
|
-
const
|
|
3
|
-
const [
|
|
4
|
-
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
if (0 <=
|
|
10
|
-
const
|
|
11
|
-
return [...
|
|
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
|
|
13
|
+
return s;
|
|
14
14
|
});
|
|
15
|
-
},
|
|
16
|
-
var
|
|
17
|
-
let
|
|
18
|
-
if ((
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
(
|
|
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
|
|
26
|
-
},
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
|
|
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: (
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
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
|
-
|
|
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
|
|
3
|
-
const [
|
|
4
|
-
|
|
5
|
-
},
|
|
6
|
-
|
|
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
|
|
8
|
+
return v(
|
|
9
9
|
() => {
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
13
|
-
|
|
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
|
-
[
|
|
16
|
+
[t]
|
|
17
17
|
// Recall only if ref changes
|
|
18
|
-
), [
|
|
18
|
+
), [t, u];
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
|
-
|
|
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
|
|
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 [
|
|
7
|
-
|
|
8
|
-
}, [
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
}, [
|
|
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
|
-
|
|
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
|
|
2
|
-
const
|
|
3
|
-
height,
|
|
4
|
-
width
|
|
5
|
-
}),
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
},
|
|
9
|
-
const
|
|
10
|
-
let
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type:
|
|
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
|
-
})) :
|
|
20
|
-
},
|
|
19
|
+
})) : y();
|
|
20
|
+
}, l, i);
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
return {
|
|
24
|
-
resizeImageFile: async (
|
|
25
|
-
if (!
|
|
26
|
-
if (!
|
|
27
|
-
const
|
|
28
|
-
return new Promise((
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
throw Error("Image Loading 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
|
-
|
|
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
|
|
3
|
-
const
|
|
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
|
-
|
|
7
|
-
}, [
|
|
8
|
-
|
|
9
|
-
window.removeEventListener("keydown",
|
|
10
|
-
}), [
|
|
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
|
-
|
|
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
|
|
2
|
-
const
|
|
1
|
+
function e() {
|
|
2
|
+
const o = document.querySelector("html");
|
|
3
3
|
return () => {
|
|
4
|
-
|
|
4
|
+
o && o.scrollIntoView();
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
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
|
|
4
|
-
const [
|
|
5
|
-
ref:
|
|
6
|
-
inView
|
|
7
|
-
} =
|
|
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
|
-
...
|
|
9
|
+
...r == null ? void 0 : r.intersectionOptions
|
|
10
10
|
});
|
|
11
|
-
return
|
|
12
|
-
var
|
|
13
|
-
(
|
|
14
|
-
}, [
|
|
15
|
-
if ((
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
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
|
-
|
|
22
|
+
e.onload = null, e.onerror = null, l(null);
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
}, [
|
|
25
|
+
}, [f]), m;
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
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
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
}, [
|
|
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
|
-
|
|
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
|
|
3
|
-
import { Alert } from "../../components/Alert/Alert.js";
|
|
4
|
-
const
|
|
5
|
-
function
|
|
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: (
|
|
8
|
-
id:
|
|
9
|
-
duration:
|
|
10
|
-
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: (
|
|
13
|
-
id:
|
|
14
|
-
duration:
|
|
15
|
-
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: (
|
|
18
|
-
id:
|
|
19
|
-
duration:
|
|
20
|
-
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: (
|
|
23
|
-
id:
|
|
24
|
-
duration:
|
|
25
|
-
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:
|
|
28
|
-
dismiss: (
|
|
29
|
-
remove: (
|
|
27
|
+
loading: a.loading,
|
|
28
|
+
dismiss: (r) => a.dismiss(r),
|
|
29
|
+
remove: (r) => a.remove(r)
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
export {
|
|
33
|
-
|
|
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
|
|
3
|
-
const [
|
|
4
|
-
|
|
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 [
|
|
6
|
+
return [e, a];
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
|
-
|
|
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
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
const
|
|
6
|
-
|
|
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 (
|
|
9
|
-
return
|
|
10
|
-
|
|
8
|
+
if (e)
|
|
9
|
+
return e.addEventListener("keydown", c), () => {
|
|
10
|
+
e.removeEventListener("keydown", c);
|
|
11
11
|
};
|
|
12
|
-
}, []),
|
|
12
|
+
}, []), s;
|
|
13
13
|
}
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
d as default
|
|
16
16
|
};
|
|
17
|
+
//# sourceMappingURL=useTrapFocus.js.map
|