@edifice.io/react 2.0.0-develop-rc.8 → 2.0.0-develop-rc.13
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/README.md +88 -17
- package/dist/common/OnboardingModal/OnboardingModal.js +59 -0
- package/dist/common/OnboardingModal/useOnboardingModal.js +30 -0
- package/dist/{modules/modals → common}/PublishModal/PublishModal.d.ts +1 -1
- package/dist/common/PublishModal/PublishModal.js +120 -0
- package/dist/common/PublishModal/components/ActivitiesDropdown.js +29 -0
- package/dist/common/PublishModal/components/AgeSelect.js +20 -0
- package/dist/common/PublishModal/components/LangSelect.js +19 -0
- package/dist/common/PublishModal/components/PublishModalFooter.js +23 -0
- package/dist/common/PublishModal/components/SubjectsDropdown.js +29 -0
- package/dist/common/PublishModal/components/ToastError.js +24 -0
- package/dist/{modules/modals → common}/PublishModal/components/ToastSuccess.d.ts +1 -1
- package/dist/common/PublishModal/components/ToastSuccess.js +18 -0
- package/dist/common/PublishModal/constants/ageOptions.js +4 -0
- package/dist/{modules/modals → common}/PublishModal/hooks/useActivitiesOptions.js +4 -5
- package/dist/common/PublishModal/hooks/useLanguageOptions.js +43 -0
- package/dist/{modules/modals → common}/PublishModal/hooks/usePublishModal.d.ts +1 -1
- package/dist/common/PublishModal/hooks/usePublishModal.js +106 -0
- package/dist/{modules/modals → common}/PublishModal/hooks/useSubjectsOptions.js +41 -42
- package/dist/{modules/modals → common}/ResourceModal/ResourceModal.d.ts +3 -3
- package/dist/common/ResourceModal/ResourceModal.js +156 -0
- package/dist/{modules/modals → common}/ResourceModal/apps/BlogPublic.d.ts +2 -2
- package/dist/common/ResourceModal/apps/BlogPublic.js +62 -0
- package/dist/{modules/modals → common}/ResourceModal/hooks/useSlug.d.ts +1 -1
- package/dist/common/ResourceModal/hooks/useSlug.js +41 -0
- package/dist/{modules/modals → common}/ResourceModal/hooks/useThumb.d.ts +1 -1
- package/dist/common/ResourceModal/hooks/useThumb.js +17 -0
- package/dist/{modules/modals → common}/ResourceModal/hooks/useUpdateMutation.d.ts +3 -3
- package/dist/common/ResourceModal/hooks/useUpdateMutation.js +12 -0
- package/dist/common/ResourceModal/index.d.ts +3 -0
- package/dist/common/ShareModal/ShareBookmark.js +22 -0
- package/dist/{modules/modals → common}/ShareModal/ShareBookmarkLine.d.ts +1 -1
- package/dist/common/ShareModal/ShareBookmarkLine.js +42 -0
- package/dist/{modules/modals → common}/ShareModal/ShareModal.d.ts +2 -2
- package/dist/common/ShareModal/ShareModal.js +128 -0
- package/dist/common/ShareModal/apps/ShareBlog.d.ts +8 -0
- package/dist/common/ShareModal/apps/ShareBlog.js +43 -0
- package/dist/{modules/modals → common}/ShareModal/hooks/useSearch.d.ts +2 -2
- package/dist/common/ShareModal/hooks/useSearch.js +178 -0
- package/dist/{modules/modals → common}/ShareModal/hooks/useShare.d.ts +1 -1
- package/dist/common/ShareModal/hooks/useShare.js +192 -0
- package/dist/{modules/modals → common}/ShareModal/hooks/useShareBookmark.d.ts +1 -1
- package/dist/common/ShareModal/hooks/useShareBookmark.js +67 -0
- package/dist/{modules/modals → common}/ShareModal/hooks/useShareMutation.d.ts +3 -3
- package/dist/common/ShareModal/hooks/useShareMutation.js +15 -0
- package/dist/common/ShareModal/index.d.ts +3 -0
- package/dist/{modules/modals → common}/ShareModal/utils/hasRight.d.ts +1 -1
- package/dist/common/ShareModal/utils/hasRight.js +4 -0
- package/dist/{modules/modals → common}/ShareModal/utils/showShareRightLine.d.ts +1 -1
- package/dist/common/ShareModal/utils/showShareRightLine.js +4 -0
- package/dist/components/ActionBar/ActionBar.d.ts +1 -1
- package/dist/components/ActionBar/ActionBar.js +6 -8
- package/dist/components/ActionBar/index.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Alert/Alert.js +60 -62
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/AppHeader/AppHeader.d.ts +1 -1
- package/dist/components/AppHeader/AppHeader.js +18 -20
- package/dist/components/AppHeader/index.d.ts +1 -0
- package/dist/components/AppIcon/AppIcon.d.ts +1 -1
- package/dist/components/AppIcon/AppIcon.js +44 -45
- package/dist/components/Attachment/Attachment.d.ts +1 -1
- package/dist/components/Attachment/Attachment.js +13 -15
- package/dist/components/Attachment/index.d.ts +1 -0
- package/dist/{modules/audience → components/Audience}/ReactionChoice.d.ts +1 -1
- package/dist/components/Audience/ReactionChoice.js +33 -0
- package/dist/{modules/audience → components/Audience}/ReactionModal.Card.d.ts +1 -1
- package/dist/components/Audience/ReactionModal.Card.js +33 -0
- package/dist/{modules/audience → components/Audience}/ReactionModal.d.ts +1 -1
- package/dist/components/Audience/ReactionModal.js +73 -0
- package/dist/{modules/audience → components/Audience}/ReactionSummary.d.ts +1 -1
- package/dist/components/Audience/ReactionSummary.js +27 -0
- package/dist/{modules/audience → components/Audience}/ViewsByProfileCard.d.ts +1 -1
- package/dist/components/Audience/ViewsByProfileCard.js +36 -0
- package/dist/components/Audience/ViewsCounter.js +18 -0
- package/dist/{modules/audience → components/Audience}/ViewsModal.d.ts +1 -1
- package/dist/components/Audience/ViewsModal.js +40 -0
- package/dist/{modules/audience → components/Audience}/hooks/useReactionIcons.d.ts +1 -1
- package/dist/components/Audience/hooks/useReactionIcons.js +38 -0
- package/dist/{modules/audience → components/Audience}/hooks/useReactions.d.ts +3 -3
- package/dist/components/Audience/hooks/useReactions.js +35 -0
- package/dist/{modules/audience → components/Audience}/hooks/useViews.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +27 -29
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Badge/Badge.js +20 -22
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +23 -24
- package/dist/components/Breadcrumb/BreadcrumbItem.js +11 -12
- package/dist/components/Breadcrumb/BreadcrumbList.js +10 -11
- package/dist/components/Breadcrumb/BreadcrumbNav.d.ts +1 -1
- package/dist/components/Breadcrumb/BreadcrumbNav.js +15 -16
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +32 -34
- package/dist/components/Button/IconButton.d.ts +1 -1
- package/dist/components/Button/IconButton.js +15 -17
- package/dist/components/Button/SearchButton.d.ts +1 -1
- package/dist/components/Button/SearchButton.js +15 -17
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Card/Card.d.ts +4 -4
- package/dist/components/Card/Card.js +47 -49
- package/dist/components/Card/CardBody.d.ts +1 -1
- package/dist/components/Card/CardBody.js +13 -14
- package/dist/components/Card/CardContext.d.ts +1 -1
- package/dist/components/Card/CardContext.js +7 -8
- package/dist/components/Card/CardFooter.js +5 -6
- package/dist/components/Card/CardHeader.js +14 -15
- package/dist/components/Card/CardImage.d.ts +1 -1
- package/dist/components/Card/CardImage.js +13 -14
- package/dist/components/Card/CardText.js +8 -9
- package/dist/components/Card/CardTitle.js +8 -9
- package/dist/components/Card/CardUser.js +8 -9
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +30 -32
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPalette.js +4 -5
- package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +28 -30
- package/dist/components/ColorPicker/ColorPickerItem.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPickerItem.js +11 -13
- package/dist/components/ColorPicker/index.d.ts +3 -1
- package/dist/components/Combobox/Combobox.d.ts +1 -1
- package/dist/components/Combobox/Combobox.js +35 -36
- package/dist/components/Combobox/ComboboxTrigger.js +21 -22
- package/dist/components/Combobox/index.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.js +55 -57
- package/dist/components/Dropdown/DropdownCheckboxItem.js +26 -27
- package/dist/components/Dropdown/DropdownContext.js +7 -8
- package/dist/components/Dropdown/DropdownItem.js +27 -28
- package/dist/components/Dropdown/DropdownMenu.js +21 -22
- package/dist/components/Dropdown/DropdownMenuGroup.js +9 -10
- package/dist/components/Dropdown/DropdownRadioItem.js +26 -27
- package/dist/components/Dropdown/DropdownSeparator.js +3 -4
- package/dist/components/Dropdown/DropdownTrigger.js +28 -29
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropzone/Dropzone.d.ts +1 -1
- package/dist/components/Dropzone/Dropzone.js +47 -48
- package/dist/components/Dropzone/DropzoneContext.js +8 -9
- package/dist/components/Dropzone/DropzoneDrag.js +7 -8
- package/dist/components/Dropzone/DropzoneFile.js +25 -26
- package/dist/components/Dropzone/DropzoneImport.js +20 -21
- package/dist/components/Dropzone/index.d.ts +1 -0
- package/dist/components/EmptyScreen/EmptyScreen.d.ts +1 -1
- package/dist/components/EmptyScreen/EmptyScreen.js +16 -18
- package/dist/components/EmptyScreen/index.d.ts +1 -0
- package/dist/components/FileCard/FileCard.d.ts +2 -2
- package/dist/components/FileCard/FileCard.js +37 -39
- package/dist/components/FileCard/FileIcon.d.ts +1 -1
- package/dist/components/FileCard/FileIcon.js +11 -12
- package/dist/components/FileCard/index.d.ts +1 -0
- package/dist/components/Form/FormContext.js +7 -8
- package/dist/components/Form/FormControl.d.ts +1 -1
- package/dist/components/Form/FormControl.js +30 -32
- package/dist/components/Form/FormText.d.ts +1 -1
- package/dist/components/Form/FormText.js +12 -14
- package/dist/components/Form/index.d.ts +2 -1
- package/dist/components/Grid/Grid.js +27 -28
- package/dist/components/Heading/Heading.d.ts +1 -1
- package/dist/components/Heading/Heading.js +14 -16
- package/dist/components/Heading/index.d.ts +1 -0
- package/dist/components/Image/Image.d.ts +1 -1
- package/dist/components/Image/Image.js +39 -41
- package/dist/components/Image/index.d.ts +1 -0
- package/dist/components/ImagePicker/ImagePicker.d.ts +1 -1
- package/dist/components/ImagePicker/ImagePicker.js +51 -52
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +28 -30
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Label/Label.d.ts +1 -1
- package/dist/components/Label/Label.js +30 -32
- package/dist/components/Label/index.d.ts +1 -0
- package/dist/components/Loading/Loading.d.ts +1 -1
- package/dist/components/Loading/Loading.js +23 -25
- package/dist/components/Loading/index.d.ts +1 -0
- package/dist/components/LoadingScreen/LoadingScreen.d.ts +1 -1
- package/dist/components/LoadingScreen/LoadingScreen.js +20 -22
- package/dist/components/LoadingScreen/index.d.ts +1 -1
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo/Logo.js +12 -14
- package/dist/components/Logo/index.d.ts +1 -0
- package/dist/components/Menu/Menu.js +39 -40
- package/dist/components/Menu/MenuButton.js +17 -18
- package/dist/components/Menu/MenuContext.js +8 -9
- package/dist/components/Menu/MenuItem.js +14 -15
- package/dist/components/Modal/Modal.d.ts +4 -1
- package/dist/components/Modal/Modal.js +49 -51
- package/dist/components/Modal/ModalBody.js +11 -12
- package/dist/components/Modal/ModalContext.js +8 -9
- package/dist/components/Modal/ModalFooter.js +3 -4
- package/dist/components/Modal/ModalHeader.js +22 -23
- package/dist/components/Modal/ModalSubtitle.js +3 -4
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/Popover/Popover.js +33 -34
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +26 -28
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/SearchBar/SearchBar.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.js +29 -31
- package/dist/components/SearchBar/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +31 -33
- package/dist/components/Select/SelectTrigger.js +4 -5
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Table/Table.components.d.ts +20 -0
- package/dist/components/Table/Table.components.js +39 -0
- package/dist/components/Table/Table.d.ts +33 -0
- package/dist/components/Table/Table.js +16 -0
- package/dist/components/Table/TableExplorer.d.ts +1 -1
- package/dist/components/Table/index.d.ts +2 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +58 -59
- package/dist/components/Tabs/TabsContext.js +8 -9
- package/dist/components/Tabs/TabsItem.js +20 -21
- package/dist/components/Tabs/TabsList.js +18 -19
- package/dist/components/Tabs/TabsPanel.js +9 -10
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/components/TextArea/TextArea.js +31 -33
- package/dist/components/TextArea/TextareaCounter.js +6 -7
- package/dist/components/TextArea/index.d.ts +1 -0
- package/dist/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/components/Toolbar/Toolbar.js +60 -62
- package/dist/components/Toolbar/index.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +28 -30
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/TreeView/TreeItem.js +46 -47
- package/dist/components/TreeView/TreeView.d.ts +1 -1
- package/dist/components/TreeView/TreeView.js +33 -35
- package/dist/components/TreeView/hooks/useTreeItemEvents.js +18 -19
- package/dist/components/TreeView/index.d.ts +1 -0
- package/dist/components/UploadCard/UploadCard.js +52 -53
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.js +6 -8
- package/dist/components/VisuallyHidden/index.d.ts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/core/OdeClientProvider/OdeClientProvider.d.ts +1 -1
- package/dist/core/OdeClientProvider/OdeClientProvider.js +44 -45
- package/dist/core/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/core/ThemeProvider/ThemeProvider.js +36 -36
- package/dist/core/index.d.ts +1 -0
- package/dist/core/useAvatar/useAvatar.d.ts +1 -1
- package/dist/core/useAvatar/useAvatar.js +21 -22
- package/dist/core/useBookmark/useBookmark.d.ts +1 -1
- package/dist/core/useBookmark/useBookmark.js +9 -10
- package/dist/core/useCantoo/index.d.ts +1 -0
- package/dist/core/useCantoo/useCantoo.d.ts +1 -0
- package/dist/core/useCantoo/useCantoo.js +18 -0
- package/dist/core/useConf/useConf.d.ts +1 -1
- package/dist/core/useConf/useConf.js +7 -8
- package/dist/core/useConversation/useConversation.js +29 -30
- package/dist/core/useCookiesConsent/useCookiesConsent.js +16 -17
- package/dist/core/useDate/useDate.js +35 -36
- package/dist/core/useHasWorkflow/useHasWorkflow.js +15 -16
- package/dist/core/useHeader/useHeader.d.ts +1 -1
- package/dist/core/useHeader/useHeader.js +45 -42
- package/dist/core/useHttpErrorToast/useHttpErrorToast.js +17 -18
- package/dist/core/useIsAdml/useIsAdml.js +11 -12
- package/dist/core/useLibraryUrl/useLibraryUrl.js +16 -17
- package/dist/core/useMediaLibrary/useMediaLibrary.d.ts +2 -2
- package/dist/core/useMediaLibrary/useMediaLibrary.js +32 -33
- package/dist/core/useOdeIcons/useOdeIcons.d.ts +1 -1
- package/dist/core/useOdeIcons/useOdeIcons.js +37 -38
- package/dist/core/usePaths/usePaths.js +2 -3
- package/dist/core/usePreferences/usePreferences.js +5 -6
- package/dist/core/useResource/useResource.d.ts +1 -1
- package/dist/core/useResource/useResource.js +14 -15
- package/dist/core/useResourceSearch/useResourceSearch.d.ts +1 -1
- package/dist/core/useResourceSearch/useResourceSearch.js +22 -23
- package/dist/core/useSession/useSession.js +6 -7
- package/dist/core/useTrashedResource/useTrashedResource.js +18 -19
- package/dist/core/useUpload/useUpload.d.ts +1 -1
- package/dist/core/useUpload/useUpload.js +68 -69
- package/dist/core/useUploadFiles/useUploadFiles.d.ts +1 -1
- package/dist/core/useUploadFiles/useUploadFiles.js +82 -83
- package/dist/core/useUser/useUser.d.ts +1 -1
- package/dist/core/useUser/useUser.js +15 -16
- package/dist/core/useWorkspaceFile/useWorkspaceFile.d.ts +1 -1
- package/dist/core/useWorkspaceFile/useWorkspaceFile.js +31 -32
- package/dist/core/useWorkspaceSearch/useWorkspaceSearch.d.ts +1 -1
- package/dist/core/useWorkspaceSearch/useWorkspaceSearch.js +41 -42
- package/dist/core/useXitiTrackPageLoad/useXitiTrackPageLoad.js +17 -18
- package/dist/core/useZendeskGuide/useZendeskGuide.js +46 -47
- package/dist/hooks/useBrowserInfo/useBrowserInfo.js +11 -12
- package/dist/hooks/useClickOutside/useClickOutside.js +18 -19
- package/dist/hooks/useDebounce/useDebounce.js +10 -11
- package/dist/hooks/useDropdown/useDropdown.d.ts +1 -1
- package/dist/hooks/useDropdown/useDropdown.js +96 -97
- package/dist/hooks/useDropzone/useDropzone.js +53 -54
- package/dist/hooks/useHover/useHover.js +14 -15
- package/dist/hooks/useImage/useImage.js +13 -14
- package/dist/hooks/useImageResizer/useImageResizer.js +31 -32
- package/dist/hooks/useKeyPress/useKeyPress.js +10 -11
- package/dist/hooks/useScrollToTop/useScrollToTop.js +4 -5
- package/dist/hooks/useThumbnail/useThumbnail.js +21 -22
- package/dist/hooks/useTitle/useTitle.js +7 -8
- package/dist/hooks/useToast/useToast.js +25 -26
- package/dist/hooks/useToggle/useToggle.js +6 -7
- package/dist/hooks/useTrapFocus/useTrapFocus.js +11 -12
- package/dist/index.d.ts +3 -1
- package/dist/index.js +274 -226
- package/dist/{modules/multimedia → multimedia}/AudioRecorder/AudioRecorder.d.ts +1 -1
- package/dist/multimedia/AudioRecorder/AudioRecorder.js +49 -0
- package/dist/multimedia/AudioRecorder/AudioRecorderTimer.js +24 -0
- package/dist/{modules/multimedia → multimedia}/AudioRecorder/useAudioRecorder.d.ts +2 -2
- package/dist/multimedia/AudioRecorder/useAudioRecorder.js +307 -0
- package/dist/multimedia/Embed/Embed.js +32 -0
- package/dist/multimedia/ImageEditor/components/ImageEditor.js +116 -0
- package/dist/multimedia/ImageEditor/components/ImageEditorToolbar.js +69 -0
- package/dist/multimedia/ImageEditor/effects/blur.js +72 -0
- package/dist/multimedia/ImageEditor/effects/crop.js +155 -0
- package/dist/multimedia/ImageEditor/effects/misc.js +162 -0
- package/dist/multimedia/ImageEditor/effects/resize.js +157 -0
- package/dist/multimedia/ImageEditor/effects/rotate.js +33 -0
- package/dist/multimedia/ImageEditor/hooks/useHistoryTool.js +66 -0
- package/dist/multimedia/ImageEditor/hooks/useImageEditor.js +76 -0
- package/dist/multimedia/ImageEditor/hooks/useImageEffects.js +52 -0
- package/dist/multimedia/ImageEditor/utils/aggregate.js +13 -0
- package/dist/{modules/multimedia → multimedia}/ImagePickerWorkspace/ImagePickerWorkspace.d.ts +1 -1
- package/dist/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.js +39 -0
- package/dist/multimedia/Linker/ExternalLinker.js +45 -0
- package/dist/{modules/multimedia → multimedia}/Linker/InternalLinker.d.ts +1 -1
- package/dist/multimedia/Linker/InternalLinker.js +114 -0
- package/dist/{modules/multimedia → multimedia}/LinkerCard/LinkerCard.d.ts +3 -3
- package/dist/multimedia/LinkerCard/LinkerCard.js +38 -0
- package/dist/multimedia/LinkerCard/index.d.ts +2 -0
- package/dist/{modules/multimedia → multimedia}/MediaLibrary/MediaLibrary.d.ts +2 -2
- package/dist/multimedia/MediaLibrary/MediaLibrary.js +211 -0
- package/dist/{modules/multimedia → multimedia}/MediaLibrary/MediaLibraryContext.d.ts +2 -2
- package/dist/multimedia/MediaLibrary/MediaLibraryContext.js +12 -0
- package/dist/multimedia/MediaLibrary/innertabs/Audio.js +19 -0
- package/dist/multimedia/MediaLibrary/innertabs/ExternalLink.js +17 -0
- package/dist/multimedia/MediaLibrary/innertabs/Iframe.js +14 -0
- package/dist/{modules/multimedia → multimedia}/MediaLibrary/innertabs/InternalLink.d.ts +1 -1
- package/dist/multimedia/MediaLibrary/innertabs/InternalLink.js +35 -0
- package/dist/multimedia/MediaLibrary/innertabs/Upload.js +34 -0
- package/dist/multimedia/MediaLibrary/innertabs/Video.js +22 -0
- package/dist/multimedia/MediaLibrary/innertabs/VideoEmbedder.js +14 -0
- package/dist/multimedia/MediaLibrary/innertabs/Workspace.js +31 -0
- package/dist/multimedia/MediaLibrary/innertabs/index.js +21 -0
- package/dist/{modules/multimedia → multimedia}/UploadFiles/UploadFiles.d.ts +1 -1
- package/dist/multimedia/UploadFiles/UploadFiles.js +56 -0
- package/dist/multimedia/VideoEmbed/VideoEmbed.js +77 -0
- package/dist/{modules/multimedia → multimedia}/VideoRecorder/VideoRecorder.d.ts +1 -1
- package/dist/multimedia/VideoRecorder/VideoRecorder.js +259 -0
- package/dist/{modules/multimedia → multimedia}/Workspace/Workspace.d.ts +1 -1
- package/dist/multimedia/Workspace/Workspace.js +169 -0
- package/dist/portal/Header/Badge.js +5 -6
- package/dist/portal/Header/Header.js +138 -138
- package/dist/portal/Header/NavItem.js +11 -12
- package/dist/portal/Header/NavLink.js +14 -15
- package/dist/portal/Header/Navbar.js +9 -10
- package/dist/portal/Header/NavbarNav.js +9 -10
- package/dist/portal/Header/WidgetApps.d.ts +1 -1
- package/dist/portal/Header/WidgetApps.js +16 -17
- package/dist/portal/Help/Help.js +18 -19
- package/dist/portal/Help/hooks/useHelp.js +63 -64
- package/dist/portal/Layout/Layout.js +36 -36
- package/dist/portal/SearchEngine/SearchEngine.js +25 -26
- package/dist/utils/MockedDataProvider/MockedDataProvider.d.ts +1 -1
- package/dist/utils/MockedDataProvider/MockedDataProvider.js +21 -22
- package/dist/utils/StringUtils.js +8 -9
- package/dist/utils/addTimestampToUrl.js +4 -5
- package/dist/utils/blob.js +9 -10
- package/dist/utils/checkUserRight.d.ts +1 -1
- package/dist/utils/checkUserRight.js +27 -28
- package/dist/utils/fileSize.js +5 -6
- package/dist/utils/findTreeNode.js +7 -8
- package/dist/utils/isActionAvailable.d.ts +1 -1
- package/dist/utils/isActionAvailable.js +4 -5
- package/dist/utils/libraryMaps.js +2 -3
- package/dist/utils/noop.js +2 -3
- package/dist/utils/ref.js +8 -9
- package/dist/utils/thumbnail.js +3 -4
- package/dist/utils/time.js +7 -8
- package/dist/utils/treeview.d.ts +1 -1
- package/dist/utils/treeview.js +96 -97
- package/dist/utils/video.js +2 -3
- package/dist/widgets/BookmarkedApps/BookmarkedApps.d.ts +1 -1
- package/dist/widgets/BookmarkedApps/BookmarkedApps.js +6 -7
- package/dist/widgets/Widget/Widget.js +18 -19
- package/package.json +27 -58
- package/dist/audience.js +0 -17
- package/dist/audience.js.map +0 -1
- package/dist/components/ActionBar/ActionBar.js.map +0 -1
- package/dist/components/Alert/Alert.js.map +0 -1
- package/dist/components/AppHeader/AppHeader.js.map +0 -1
- package/dist/components/AppIcon/AppIcon.js.map +0 -1
- package/dist/components/Attachment/Attachment.js.map +0 -1
- package/dist/components/Avatar/Avatar.js.map +0 -1
- package/dist/components/Badge/Badge.js.map +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.js.map +0 -1
- package/dist/components/Breadcrumb/BreadcrumbItem.js.map +0 -1
- package/dist/components/Breadcrumb/BreadcrumbList.js.map +0 -1
- package/dist/components/Breadcrumb/BreadcrumbNav.js.map +0 -1
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/IconButton.js.map +0 -1
- package/dist/components/Button/SearchButton.js.map +0 -1
- package/dist/components/Card/Card.js.map +0 -1
- package/dist/components/Card/CardBody.js.map +0 -1
- package/dist/components/Card/CardContext.js.map +0 -1
- package/dist/components/Card/CardFooter.js.map +0 -1
- package/dist/components/Card/CardHeader.js.map +0 -1
- package/dist/components/Card/CardImage.js.map +0 -1
- package/dist/components/Card/CardText.js.map +0 -1
- package/dist/components/Card/CardTitle.js.map +0 -1
- package/dist/components/Card/CardUser.js.map +0 -1
- package/dist/components/Checkbox/Checkbox.js.map +0 -1
- package/dist/components/ColorPicker/ColorPalette.js.map +0 -1
- package/dist/components/ColorPicker/ColorPicker.js.map +0 -1
- package/dist/components/ColorPicker/ColorPickerItem.js.map +0 -1
- package/dist/components/Combobox/Combobox.js.map +0 -1
- package/dist/components/Combobox/ComboboxTrigger.js.map +0 -1
- package/dist/components/Dropdown/Dropdown.js.map +0 -1
- package/dist/components/Dropdown/DropdownCheckboxItem.js.map +0 -1
- package/dist/components/Dropdown/DropdownContext.js.map +0 -1
- package/dist/components/Dropdown/DropdownItem.js.map +0 -1
- package/dist/components/Dropdown/DropdownMenu.js.map +0 -1
- package/dist/components/Dropdown/DropdownMenuGroup.js.map +0 -1
- package/dist/components/Dropdown/DropdownRadioItem.js.map +0 -1
- package/dist/components/Dropdown/DropdownSeparator.js.map +0 -1
- package/dist/components/Dropdown/DropdownTrigger.js.map +0 -1
- package/dist/components/Dropzone/Dropzone.js.map +0 -1
- package/dist/components/Dropzone/DropzoneContext.js.map +0 -1
- package/dist/components/Dropzone/DropzoneDrag.js.map +0 -1
- package/dist/components/Dropzone/DropzoneFile.js.map +0 -1
- package/dist/components/Dropzone/DropzoneImport.js.map +0 -1
- package/dist/components/EmptyScreen/EmptyScreen.js.map +0 -1
- package/dist/components/FileCard/FileCard.js.map +0 -1
- package/dist/components/FileCard/FileIcon.js.map +0 -1
- package/dist/components/Form/FormContext.js.map +0 -1
- package/dist/components/Form/FormControl.js.map +0 -1
- package/dist/components/Form/FormText.js.map +0 -1
- package/dist/components/Grid/Grid.js.map +0 -1
- package/dist/components/Heading/Heading.js.map +0 -1
- package/dist/components/Icon/Icon.d.ts +0 -17
- package/dist/components/Icon/Icon.js +0 -11
- package/dist/components/Icon/Icon.js.map +0 -1
- package/dist/components/Icon/index.d.ts +0 -1
- package/dist/components/Image/Image.js.map +0 -1
- package/dist/components/ImagePicker/ImagePicker.js.map +0 -1
- package/dist/components/Input/Input.js.map +0 -1
- package/dist/components/Label/Label.js.map +0 -1
- package/dist/components/Loading/Loading.js.map +0 -1
- package/dist/components/LoadingScreen/LoadingScreen.js.map +0 -1
- package/dist/components/Logo/Logo.js.map +0 -1
- package/dist/components/Menu/Menu.js.map +0 -1
- package/dist/components/Menu/MenuButton.js.map +0 -1
- package/dist/components/Menu/MenuContext.js.map +0 -1
- package/dist/components/Menu/MenuItem.js.map +0 -1
- package/dist/components/Modal/Modal.js.map +0 -1
- package/dist/components/Modal/ModalBody.js.map +0 -1
- package/dist/components/Modal/ModalContext.js.map +0 -1
- package/dist/components/Modal/ModalFooter.js.map +0 -1
- package/dist/components/Modal/ModalHeader.js.map +0 -1
- package/dist/components/Modal/ModalSubtitle.js.map +0 -1
- package/dist/components/Popover/Popover.js.map +0 -1
- package/dist/components/Radio/Radio.js.map +0 -1
- package/dist/components/SearchBar/SearchBar.js.map +0 -1
- package/dist/components/Select/Select.js.map +0 -1
- package/dist/components/Select/SelectTrigger.js.map +0 -1
- package/dist/components/Table/TableExplorer.js +0 -10
- package/dist/components/Table/TableExplorer.js.map +0 -1
- package/dist/components/Tabs/Tabs.js.map +0 -1
- package/dist/components/Tabs/TabsContext.js.map +0 -1
- package/dist/components/Tabs/TabsItem.js.map +0 -1
- package/dist/components/Tabs/TabsList.js.map +0 -1
- package/dist/components/Tabs/TabsPanel.js.map +0 -1
- package/dist/components/TextArea/TextArea.js.map +0 -1
- package/dist/components/TextArea/TextareaCounter.js.map +0 -1
- package/dist/components/Toolbar/Toolbar.js.map +0 -1
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/TreeView/TreeItem.js.map +0 -1
- package/dist/components/TreeView/TreeView.js.map +0 -1
- package/dist/components/TreeView/hooks/useTreeItemEvents.js.map +0 -1
- package/dist/components/UploadCard/UploadCard.js.map +0 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.js.map +0 -1
- package/dist/core/OdeClientProvider/OdeClientProvider.js.map +0 -1
- package/dist/core/ThemeProvider/ThemeProvider.js.map +0 -1
- package/dist/core/useAvatar/useAvatar.js.map +0 -1
- package/dist/core/useBookmark/useBookmark.js.map +0 -1
- package/dist/core/useConf/useConf.js.map +0 -1
- package/dist/core/useConversation/useConversation.js.map +0 -1
- package/dist/core/useCookiesConsent/useCookiesConsent.js.map +0 -1
- package/dist/core/useDate/useDate.js.map +0 -1
- package/dist/core/useHasWorkflow/useHasWorkflow.js.map +0 -1
- package/dist/core/useHeader/useHeader.js.map +0 -1
- package/dist/core/useHttpErrorToast/useHttpErrorToast.js.map +0 -1
- package/dist/core/useIsAdml/useIsAdml.js.map +0 -1
- package/dist/core/useLibraryUrl/useLibraryUrl.js.map +0 -1
- package/dist/core/useMediaLibrary/useMediaLibrary.js.map +0 -1
- package/dist/core/useOdeIcons/useOdeIcons.js.map +0 -1
- package/dist/core/usePaths/usePaths.js.map +0 -1
- package/dist/core/usePreferences/usePreferences.js.map +0 -1
- package/dist/core/useResource/useResource.js.map +0 -1
- package/dist/core/useResourceSearch/useResourceSearch.js.map +0 -1
- package/dist/core/useSession/useSession.js.map +0 -1
- package/dist/core/useTrashedResource/useTrashedResource.js.map +0 -1
- package/dist/core/useUpload/useUpload.js.map +0 -1
- package/dist/core/useUploadFiles/useUploadFiles.js.map +0 -1
- package/dist/core/useUser/useUser.js.map +0 -1
- package/dist/core/useWorkspaceFile/useWorkspaceFile.js.map +0 -1
- package/dist/core/useWorkspaceSearch/useWorkspaceSearch.js.map +0 -1
- package/dist/core/useXitiTrackPageLoad/useXitiTrackPageLoad.js.map +0 -1
- package/dist/core/useZendeskGuide/useZendeskGuide.js.map +0 -1
- package/dist/editor.js +0 -59
- package/dist/editor.js.map +0 -1
- package/dist/hooks/useBrowserInfo/useBrowserInfo.js.map +0 -1
- package/dist/hooks/useClickOutside/useClickOutside.js.map +0 -1
- package/dist/hooks/useDebounce/useDebounce.js.map +0 -1
- package/dist/hooks/useDropdown/useDropdown.js.map +0 -1
- package/dist/hooks/useDropzone/useDropzone.js.map +0 -1
- package/dist/hooks/useHover/useHover.js.map +0 -1
- package/dist/hooks/useImage/useImage.js.map +0 -1
- package/dist/hooks/useImageResizer/useImageResizer.js.map +0 -1
- package/dist/hooks/useKeyPress/useKeyPress.js.map +0 -1
- package/dist/hooks/useScrollToTop/useScrollToTop.js.map +0 -1
- package/dist/hooks/useThumbnail/useThumbnail.js.map +0 -1
- package/dist/hooks/useTitle/useTitle.js.map +0 -1
- package/dist/hooks/useToast/useToast.js.map +0 -1
- package/dist/hooks/useToggle/useToggle.js.map +0 -1
- package/dist/hooks/useTrapFocus/useTrapFocus.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/modals.js +0 -17
- package/dist/modals.js.map +0 -1
- package/dist/modules/audience/ReactionChoice.js +0 -34
- package/dist/modules/audience/ReactionChoice.js.map +0 -1
- package/dist/modules/audience/ReactionModal.Card.js +0 -35
- package/dist/modules/audience/ReactionModal.Card.js.map +0 -1
- package/dist/modules/audience/ReactionModal.js +0 -73
- package/dist/modules/audience/ReactionModal.js.map +0 -1
- package/dist/modules/audience/ReactionSummary.js +0 -28
- package/dist/modules/audience/ReactionSummary.js.map +0 -1
- package/dist/modules/audience/ViewsByProfileCard.js +0 -36
- package/dist/modules/audience/ViewsByProfileCard.js.map +0 -1
- package/dist/modules/audience/ViewsCounter.js +0 -19
- package/dist/modules/audience/ViewsCounter.js.map +0 -1
- package/dist/modules/audience/ViewsModal.js +0 -41
- package/dist/modules/audience/ViewsModal.js.map +0 -1
- package/dist/modules/audience/hooks/useReactionIcons.js +0 -38
- package/dist/modules/audience/hooks/useReactionIcons.js.map +0 -1
- package/dist/modules/audience/hooks/useReactions.js +0 -36
- package/dist/modules/audience/hooks/useReactions.js.map +0 -1
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.d.ts +0 -8
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js +0 -133
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js.map +0 -1
- package/dist/modules/editor/components/BubbleMenuEditImage/index.d.ts +0 -1
- package/dist/modules/editor/components/Editor/Editor.d.ts +0 -45
- package/dist/modules/editor/components/Editor/Editor.js +0 -84
- package/dist/modules/editor/components/Editor/Editor.js.map +0 -1
- package/dist/modules/editor/components/Editor/MathsModal.d.ts +0 -7
- package/dist/modules/editor/components/Editor/MathsModal.js +0 -51
- package/dist/modules/editor/components/Editor/MathsModal.js.map +0 -1
- package/dist/modules/editor/components/Editor/index.d.ts +0 -2
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.d.ts +0 -22
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.js +0 -18
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.js.map +0 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.d.ts +0 -14
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.js +0 -55
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.js.map +0 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.d.ts +0 -14
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js +0 -48
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js.map +0 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.d.ts +0 -9
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.js +0 -19
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.js.map +0 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.d.ts +0 -14
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js +0 -51
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js.map +0 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.d.ts +0 -10
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.js +0 -63
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.js.map +0 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.d.ts +0 -10
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +0 -53
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js.map +0 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.d.ts +0 -10
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +0 -320
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js.map +0 -1
- package/dist/modules/editor/components/EditorToolbar/index.d.ts +0 -1
- package/dist/modules/editor/components/NodeView/AttachmentNodeView.d.ts +0 -2
- package/dist/modules/editor/components/NodeView/AttachmentNodeView.js +0 -11
- package/dist/modules/editor/components/NodeView/AttachmentNodeView.js.map +0 -1
- package/dist/modules/editor/components/NodeView/AudioNodeView.d.ts +0 -2
- package/dist/modules/editor/components/NodeView/AudioNodeView.js +0 -11
- package/dist/modules/editor/components/NodeView/AudioNodeView.js.map +0 -1
- package/dist/modules/editor/components/NodeView/ImageNodeView.d.ts +0 -2
- package/dist/modules/editor/components/NodeView/ImageNodeView.js +0 -11
- package/dist/modules/editor/components/NodeView/ImageNodeView.js.map +0 -1
- package/dist/modules/editor/components/NodeView/LinkerNodeView.d.ts +0 -2
- package/dist/modules/editor/components/NodeView/LinkerNodeView.js +0 -11
- package/dist/modules/editor/components/NodeView/LinkerNodeView.js.map +0 -1
- package/dist/modules/editor/components/NodeView/VideoNodeView.d.ts +0 -2
- package/dist/modules/editor/components/NodeView/VideoNodeView.js +0 -11
- package/dist/modules/editor/components/NodeView/VideoNodeView.js.map +0 -1
- package/dist/modules/editor/components/NodeView/index.d.ts +0 -5
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.d.ts +0 -7
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +0 -35
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js.map +0 -1
- package/dist/modules/editor/components/Renderer/AudioRenderer.d.ts +0 -7
- package/dist/modules/editor/components/Renderer/AudioRenderer.js +0 -12
- package/dist/modules/editor/components/Renderer/AudioRenderer.js.map +0 -1
- package/dist/modules/editor/components/Renderer/LinkerRenderer.d.ts +0 -9
- package/dist/modules/editor/components/Renderer/LinkerRenderer.js +0 -35
- package/dist/modules/editor/components/Renderer/LinkerRenderer.js.map +0 -1
- package/dist/modules/editor/components/Renderer/MediaRenderer.d.ts +0 -2
- package/dist/modules/editor/components/Renderer/MediaRenderer.js +0 -70
- package/dist/modules/editor/components/Renderer/MediaRenderer.js.map +0 -1
- package/dist/modules/editor/components/Renderer/index.d.ts +0 -4
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.d.ts +0 -2
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js +0 -9
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js.map +0 -1
- package/dist/modules/editor/components/Toolbar/LinkToolbar.d.ts +0 -15
- package/dist/modules/editor/components/Toolbar/LinkToolbar.js +0 -60
- package/dist/modules/editor/components/Toolbar/LinkToolbar.js.map +0 -1
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.d.ts +0 -9
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js +0 -29
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js.map +0 -1
- package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.d.ts +0 -13
- package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js +0 -46
- package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js.map +0 -1
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.d.ts +0 -9
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js +0 -28
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js.map +0 -1
- package/dist/modules/editor/components/Toolbar/TableToolbar.d.ts +0 -9
- package/dist/modules/editor/components/Toolbar/TableToolbar.js +0 -89
- package/dist/modules/editor/components/Toolbar/TableToolbar.js.map +0 -1
- package/dist/modules/editor/components/Toolbar/index.d.ts +0 -2
- package/dist/modules/editor/components/index.d.ts +0 -6
- package/dist/modules/editor/hooks/index.d.ts +0 -12
- package/dist/modules/editor/hooks/useActionOptions.d.ts +0 -5
- package/dist/modules/editor/hooks/useActionOptions.js +0 -76
- package/dist/modules/editor/hooks/useActionOptions.js.map +0 -1
- package/dist/modules/editor/hooks/useCommentEditor.d.ts +0 -13
- package/dist/modules/editor/hooks/useCommentEditor.js +0 -38
- package/dist/modules/editor/hooks/useCommentEditor.js.map +0 -1
- package/dist/modules/editor/hooks/useEditorContext.d.ts +0 -37
- package/dist/modules/editor/hooks/useEditorContext.js +0 -13
- package/dist/modules/editor/hooks/useEditorContext.js.map +0 -1
- package/dist/modules/editor/hooks/useImageModal.d.ts +0 -31
- package/dist/modules/editor/hooks/useImageModal.js +0 -47
- package/dist/modules/editor/hooks/useImageModal.js.map +0 -1
- package/dist/modules/editor/hooks/useImageSelection.d.ts +0 -21
- package/dist/modules/editor/hooks/useImageSelection.js +0 -47
- package/dist/modules/editor/hooks/useImageSelection.js.map +0 -1
- package/dist/modules/editor/hooks/useLinkToolbar.d.ts +0 -17
- package/dist/modules/editor/hooks/useLinkToolbar.js +0 -38
- package/dist/modules/editor/hooks/useLinkToolbar.js.map +0 -1
- package/dist/modules/editor/hooks/useMathsModal.d.ts +0 -17
- package/dist/modules/editor/hooks/useMathsModal.js +0 -18
- package/dist/modules/editor/hooks/useMathsModal.js.map +0 -1
- package/dist/modules/editor/hooks/useMathsStyles.d.ts +0 -1
- package/dist/modules/editor/hooks/useMathsStyles.js +0 -21
- package/dist/modules/editor/hooks/useMathsStyles.js.map +0 -1
- package/dist/modules/editor/hooks/useMediaLibraryEditor.d.ts +0 -19
- package/dist/modules/editor/hooks/useMediaLibraryEditor.js +0 -153
- package/dist/modules/editor/hooks/useMediaLibraryEditor.js.map +0 -1
- package/dist/modules/editor/hooks/useResizeMedia.d.ts +0 -10
- package/dist/modules/editor/hooks/useResizeMedia.js +0 -48
- package/dist/modules/editor/hooks/useResizeMedia.js.map +0 -1
- package/dist/modules/editor/hooks/useSpeechRecognition.d.ts +0 -6
- package/dist/modules/editor/hooks/useSpeechRecognition.js +0 -22
- package/dist/modules/editor/hooks/useSpeechRecognition.js.map +0 -1
- package/dist/modules/editor/hooks/useSpeechSynthetisis.d.ts +0 -12
- package/dist/modules/editor/hooks/useSpeechSynthetisis.js +0 -21
- package/dist/modules/editor/hooks/useSpeechSynthetisis.js.map +0 -1
- package/dist/modules/editor/hooks/useTipTapEditor.d.ts +0 -15
- package/dist/modules/editor/hooks/useTipTapEditor.js +0 -76
- package/dist/modules/editor/hooks/useTipTapEditor.js.map +0 -1
- package/dist/modules/editor/index.d.ts +0 -3
- package/dist/modules/editor/utils/has-extension.d.ts +0 -2
- package/dist/modules/editor/utils/has-extension.js +0 -5
- package/dist/modules/editor/utils/has-extension.js.map +0 -1
- package/dist/modules/editor/utils/has-mark.d.ts +0 -2
- package/dist/modules/editor/utils/has-mark.js +0 -5
- package/dist/modules/editor/utils/has-mark.js.map +0 -1
- package/dist/modules/editor/utils/has-text-style.d.ts +0 -2
- package/dist/modules/editor/utils/has-text-style.js +0 -6
- package/dist/modules/editor/utils/has-text-style.js.map +0 -1
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +0 -60
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js.map +0 -1
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +0 -31
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js.map +0 -1
- package/dist/modules/modals/PublishModal/PublishModal.js +0 -121
- package/dist/modules/modals/PublishModal/PublishModal.js.map +0 -1
- package/dist/modules/modals/PublishModal/components/ActivitiesDropdown.js +0 -30
- package/dist/modules/modals/PublishModal/components/ActivitiesDropdown.js.map +0 -1
- package/dist/modules/modals/PublishModal/components/AgeSelect.js +0 -21
- package/dist/modules/modals/PublishModal/components/AgeSelect.js.map +0 -1
- package/dist/modules/modals/PublishModal/components/LangSelect.js +0 -20
- package/dist/modules/modals/PublishModal/components/LangSelect.js.map +0 -1
- package/dist/modules/modals/PublishModal/components/PublishModalFooter.js +0 -24
- package/dist/modules/modals/PublishModal/components/PublishModalFooter.js.map +0 -1
- package/dist/modules/modals/PublishModal/components/SubjectsDropdown.js +0 -30
- package/dist/modules/modals/PublishModal/components/SubjectsDropdown.js.map +0 -1
- package/dist/modules/modals/PublishModal/components/ToastError.js +0 -25
- package/dist/modules/modals/PublishModal/components/ToastError.js.map +0 -1
- package/dist/modules/modals/PublishModal/components/ToastSuccess.js +0 -19
- package/dist/modules/modals/PublishModal/components/ToastSuccess.js.map +0 -1
- package/dist/modules/modals/PublishModal/constants/ageOptions.js +0 -5
- package/dist/modules/modals/PublishModal/constants/ageOptions.js.map +0 -1
- package/dist/modules/modals/PublishModal/hooks/useActivitiesOptions.js.map +0 -1
- package/dist/modules/modals/PublishModal/hooks/useLanguageOptions.js +0 -44
- package/dist/modules/modals/PublishModal/hooks/useLanguageOptions.js.map +0 -1
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.js +0 -107
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.js.map +0 -1
- package/dist/modules/modals/PublishModal/hooks/useSubjectsOptions.js.map +0 -1
- package/dist/modules/modals/ResourceModal/ResourceModal.js +0 -158
- package/dist/modules/modals/ResourceModal/ResourceModal.js.map +0 -1
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.js +0 -64
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.js.map +0 -1
- package/dist/modules/modals/ResourceModal/hooks/useSlug.js +0 -42
- package/dist/modules/modals/ResourceModal/hooks/useSlug.js.map +0 -1
- package/dist/modules/modals/ResourceModal/hooks/useThumb.js +0 -18
- package/dist/modules/modals/ResourceModal/hooks/useThumb.js.map +0 -1
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.js +0 -14
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.js.map +0 -1
- package/dist/modules/modals/ResourceModal/index.d.ts +0 -3
- package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +0 -9
- package/dist/modules/modals/ShareModal/apps/ShareBlog.js +0 -44
- package/dist/modules/modals/ShareModal/apps/ShareBlog.js.map +0 -1
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.js +0 -17
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.js.map +0 -1
- package/dist/modules/modals/ShareModal/index.d.ts +0 -3
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js +0 -50
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js.map +0 -1
- package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js +0 -25
- package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js.map +0 -1
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js +0 -308
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js.map +0 -1
- package/dist/modules/multimedia/Embed/Embed.js +0 -33
- package/dist/modules/multimedia/Embed/Embed.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js +0 -117
- package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/components/ImageEditorToolbar.js +0 -70
- package/dist/modules/multimedia/ImageEditor/components/ImageEditorToolbar.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/effects/blur.js +0 -73
- package/dist/modules/multimedia/ImageEditor/effects/blur.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/effects/crop.js +0 -156
- package/dist/modules/multimedia/ImageEditor/effects/crop.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/effects/misc.js +0 -163
- package/dist/modules/multimedia/ImageEditor/effects/misc.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/effects/resize.js +0 -158
- package/dist/modules/multimedia/ImageEditor/effects/resize.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/effects/rotate.js +0 -34
- package/dist/modules/multimedia/ImageEditor/effects/rotate.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js +0 -65
- package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.js +0 -77
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.js +0 -53
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.js.map +0 -1
- package/dist/modules/multimedia/ImageEditor/utils/aggregate.js +0 -14
- package/dist/modules/multimedia/ImageEditor/utils/aggregate.js.map +0 -1
- package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.js +0 -40
- package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.js.map +0 -1
- package/dist/modules/multimedia/Linker/ExternalLinker.js +0 -46
- package/dist/modules/multimedia/Linker/ExternalLinker.js.map +0 -1
- package/dist/modules/multimedia/Linker/InternalLinker.js +0 -115
- package/dist/modules/multimedia/Linker/InternalLinker.js.map +0 -1
- package/dist/modules/multimedia/LinkerCard/LinkerCard.js +0 -40
- package/dist/modules/multimedia/LinkerCard/LinkerCard.js.map +0 -1
- package/dist/modules/multimedia/LinkerCard/index.d.ts +0 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +0 -212
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.js +0 -13
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Audio.js +0 -20
- package/dist/modules/multimedia/MediaLibrary/innertabs/Audio.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/ExternalLink.js +0 -18
- package/dist/modules/multimedia/MediaLibrary/innertabs/ExternalLink.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Iframe.js +0 -15
- package/dist/modules/multimedia/MediaLibrary/innertabs/Iframe.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.js +0 -36
- package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +0 -35
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Video.js +0 -23
- package/dist/modules/multimedia/MediaLibrary/innertabs/Video.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/VideoEmbedder.js +0 -15
- package/dist/modules/multimedia/MediaLibrary/innertabs/VideoEmbedder.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +0 -32
- package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js.map +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +0 -22
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.js.map +0 -1
- package/dist/modules/multimedia/UploadFiles/UploadFiles.js +0 -57
- package/dist/modules/multimedia/UploadFiles/UploadFiles.js.map +0 -1
- package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js +0 -78
- package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js.map +0 -1
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js +0 -260
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js.map +0 -1
- package/dist/modules/multimedia/Workspace/Workspace.js +0 -170
- package/dist/modules/multimedia/Workspace/Workspace.js.map +0 -1
- package/dist/multimedia.js +0 -21
- package/dist/multimedia.js.map +0 -1
- package/dist/portal/Header/Badge.js.map +0 -1
- package/dist/portal/Header/Header.js.map +0 -1
- package/dist/portal/Header/NavItem.js.map +0 -1
- package/dist/portal/Header/NavLink.js.map +0 -1
- package/dist/portal/Header/Navbar.js.map +0 -1
- package/dist/portal/Header/NavbarNav.js.map +0 -1
- package/dist/portal/Header/WidgetApps.js.map +0 -1
- package/dist/portal/Help/Help.js.map +0 -1
- package/dist/portal/Help/hooks/useHelp.js.map +0 -1
- package/dist/portal/Layout/Layout.js.map +0 -1
- package/dist/portal/SearchEngine/SearchEngine.js.map +0 -1
- package/dist/utils/MockedDataProvider/MockedDataProvider.js.map +0 -1
- package/dist/utils/StringUtils.js.map +0 -1
- package/dist/utils/addTimestampToUrl.js.map +0 -1
- package/dist/utils/blob.js.map +0 -1
- package/dist/utils/checkUserRight.js.map +0 -1
- package/dist/utils/fileSize.js.map +0 -1
- package/dist/utils/findTreeNode.js.map +0 -1
- package/dist/utils/isActionAvailable.js.map +0 -1
- package/dist/utils/libraryMaps.js.map +0 -1
- package/dist/utils/noop.js.map +0 -1
- package/dist/utils/ref.js.map +0 -1
- package/dist/utils/thumbnail.js.map +0 -1
- package/dist/utils/time.js.map +0 -1
- package/dist/utils/treeview.js.map +0 -1
- package/dist/utils/video.js.map +0 -1
- package/dist/widgets/BookmarkedApps/BookmarkedApps.js.map +0 -1
- package/dist/widgets/Widget/Widget.js.map +0 -1
- /package/dist/{modules/modals → common}/OnboardingModal/OnboardingModal.d.ts +0 -0
- /package/dist/{modules/modals → common}/OnboardingModal/index.d.ts +0 -0
- /package/dist/{modules/modals → common}/OnboardingModal/useOnboardingModal.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/components/ActivitiesDropdown.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/components/AgeSelect.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/components/LangSelect.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/components/PublishModalFooter.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/components/SubjectsDropdown.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/components/ToastError.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/constants/ageOptions.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/hooks/useActivitiesOptions.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/hooks/useLanguageOptions.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/hooks/useSubjectsOptions.d.ts +0 -0
- /package/dist/{modules/modals → common}/PublishModal/index.d.ts +0 -0
- /package/dist/{modules/modals → common}/ShareModal/ShareBookmark.d.ts +0 -0
- /package/dist/{modules/modals → common}/index.d.ts +0 -0
- /package/dist/{modules/audience → components/Audience}/ViewsCounter.d.ts +0 -0
- /package/dist/{modules/audience → components/Audience}/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/AudioRecorder/AudioRecorderTimer.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/AudioRecorder/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/Embed/Embed.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/Embed/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/components/ImageEditor.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/components/ImageEditorToolbar.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/effects/blur.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/effects/crop.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/effects/misc.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/effects/resize.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/effects/rotate.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/hooks/useHistoryTool.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/hooks/useImageEditor.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/hooks/useImageEffects.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/utils/aggregate.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImageEditor/utils/debounceAggregate.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/ImagePickerWorkspace/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/Linker/ExternalLinker.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/Linker/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/MediaLibrary/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/MediaLibrary/innertabs/Audio.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/MediaLibrary/innertabs/ExternalLink.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/MediaLibrary/innertabs/Iframe.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/MediaLibrary/innertabs/Upload.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/MediaLibrary/innertabs/Video.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/MediaLibrary/innertabs/VideoEmbedder.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/MediaLibrary/innertabs/Workspace.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/MediaLibrary/innertabs/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/UploadFiles/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/VideoEmbed/VideoEmbed.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/VideoEmbed/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/VideoRecorder/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/Workspace/index.d.ts +0 -0
- /package/dist/{modules/multimedia → multimedia}/index.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditor.js","sources":["../../../../../src/modules/multimedia/ImageEditor/components/ImageEditor.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { Stage } from '@pixi/react';\nimport { useTranslation } from 'react-i18next';\n\nimport {\n Button,\n FormControl,\n Input,\n Label,\n LoadingScreen,\n Modal,\n} from '../../../../components';\nimport useImageEditor from '../hooks/useImageEditor';\nimport ImageEditorToolbar, { ImageEditorAction } from './ImageEditorToolbar';\n\ninterface ImageEditorProps {\n image: string;\n isOpen: boolean;\n legend?: string;\n altText?: string;\n onCancel(): void;\n onSave(arg: {\n blob: Blob;\n legend: string;\n altText: string;\n }): void | Promise<void>;\n onError?(err: string): void;\n}\n/**\n * This component display the Image Editor as a Modal\n *\n * @param param.altText the initial alternative text of the image\n * @param param.legend the initial title text of the image\n * @param param.image the URL of the image to edit\n * @param param.isOpen whether the modal is visible\n * @param param.onCancel callback when the modal is closed without saving\n * @param param.onError callback when the save action failed\n * @param param.onSave callback when the save action succeed and receive as params the new image as blob and also the new legend and alt\n * @returns A React Component\n */\nconst ImageEditor = ({\n altText: altTextParam,\n legend: legendParam,\n image: imageSrc,\n isOpen,\n onCancel,\n onError,\n onSave,\n}: ImageEditorProps) => {\n const { t } = useTranslation();\n // Store the current operation in a state\n const [currentOperation, setCurrentOperation] = useState<\n ImageEditorAction | undefined\n >(undefined);\n // Whether we are saving or not\n const [isSaving, setSaving] = useState(false);\n // Store the alt text modofied by the input text\n const [altText, setAltText] = useState(altTextParam ?? '');\n // Store the legend text modofied by the input text\n const [legend, setLegend] = useState(legendParam ?? '');\n // Whether the image has been edited or the text has been changed\n const [dirty, setDirty] = useState<boolean>(false);\n // Load Image Editor action\n const {\n toBlob,\n setApplication,\n startBlur,\n stopBlur,\n restore,\n rotate,\n startCrop,\n stopCrop,\n startResize,\n stopResize,\n historyCount,\n loading,\n } = useImageEditor({\n imageSrc,\n });\n // A function to remove all opened controllers and backup changes if needed\n const stopAll = () => {\n stopBlur();\n stopCrop(currentOperation === 'CROP');\n stopResize(currentOperation === 'RESIZE');\n };\n // A handle to save edited image as Blob\n const handleSave = async () => {\n try {\n setSaving(true);\n stopAll();\n const blob = await toBlob();\n if (blob) {\n await onSave({ blob, altText, legend });\n }\n } catch (e) {\n onError?.(`${e}`);\n } finally {\n setSaving(false);\n }\n };\n // A handle to cancel without saving\n const handleCancel = () => {\n onCancel();\n };\n // A handle to trigger actions on toolbar action\n const handleOperation = async (operation: ImageEditorAction) => {\n // Stop Remove all previous graphical controllers\n stopAll();\n // Save the current operation\n setCurrentOperation(operation);\n // Update the dirty state because image is going to change\n setDirty(true);\n // Call action according to the selected operation\n switch (operation) {\n case 'ROTATE': {\n await rotate();\n break;\n }\n case 'UNDO': {\n await restore();\n break;\n }\n case 'CROP': {\n startCrop();\n break;\n }\n case 'RESIZE': {\n await startResize();\n break;\n }\n case 'BLUR': {\n await startBlur();\n break;\n }\n }\n };\n return (\n <Modal\n id=\"image-editor\"\n isOpen={isOpen}\n onModalClose={handleCancel}\n size=\"lg\"\n >\n <Modal.Header onModalClose={handleCancel}>\n <span className=\"h2\">{t('imageeditor.title')}</span>\n </Modal.Header>\n <Modal.Body className=\"d-flex flex-column align-items-center\">\n <div className=\"d-flex flex-column gap-12 w-100 flex-grow-1\">\n <ImageEditorToolbar\n handle={handleOperation}\n historyCount={historyCount}\n />\n <div className=\"position-relative d-flex flex-column align-items-center justify-content-center flex-grow-1 w-100 image-editor\">\n <Stage\n onMount={(app) => setApplication(app)}\n options={{\n preserveDrawingBuffer: true,\n backgroundAlpha: 0,\n resolution: 1,\n }}\n ></Stage>\n {!!loading && (\n <div className=\"position-absolute top-0 start-0 bottom-0 end-0 m-10 d-flex align-items-center justify-content-center bg-black opacity-25\">\n <LoadingScreen />\n </div>\n )}\n </div>\n <div className=\"d-flex flex-column flex-md-row m-10 gap-12 w-100\">\n <FormControl id=\"alt\" className=\"flex-grow-1\">\n <Label>{t('alttext')}</Label>\n <Input\n value={altText}\n onChange={(e) => {\n setDirty(true);\n setAltText(e.target.value);\n }}\n placeholder={t('alttext.help')}\n size=\"md\"\n type=\"text\"\n />\n </FormControl>\n <FormControl id=\"legend\" className=\"flex-grow-1\">\n <Label>{t('legend')}</Label>\n <Input\n value={legend}\n onChange={(e) => {\n setDirty(true);\n setLegend(e.target.value);\n }}\n placeholder={t('legend.help')}\n size=\"md\"\n type=\"text\"\n />\n </FormControl>\n </div>\n </div>\n </Modal.Body>\n <Modal.Footer>\n <Button\n color=\"tertiary\"\n onClick={handleCancel}\n type=\"button\"\n variant=\"ghost\"\n >\n {t('imageeditor.cancel')}\n </Button>\n <Button\n color=\"primary\"\n onClick={handleSave}\n type=\"button\"\n variant=\"filled\"\n isLoading={isSaving}\n disabled={isSaving || !dirty}\n >\n {t('imageeditor.save')}\n </Button>\n </Modal.Footer>\n </Modal>\n );\n};\n\nexport default ImageEditor;\n"],"names":["ImageEditor","altText","altTextParam","legend","legendParam","image","imageSrc","isOpen","onCancel","onError","onSave","t","useTranslation","currentOperation","setCurrentOperation","useState","undefined","isSaving","setSaving","setAltText","setLegend","dirty","setDirty","toBlob","setApplication","startBlur","stopBlur","restore","rotate","startCrop","stopCrop","startResize","stopResize","historyCount","loading","useImageEditor","stopAll","handleSave","blob","e","handleCancel","handleOperation","operation","jsxs","Modal","jsx","ImageEditorToolbar","Stage","app","preserveDrawingBuffer","backgroundAlpha","resolution","LoadingScreen","FormControl","Label","Input","target","value","Button"],"mappings":";;;;;;;;;;;;AAyCA,MAAMA,KAAcA,CAAC;AAAA,EACnBC,SAASC;AAAAA,EACTC,QAAQC;AAAAA,EACRC,OAAOC;AAAAA,EACPC,QAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,QAAAA;AACgB,MAAM;AAChB,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GAEvB,CAACC,GAAkBC,CAAmB,IAAIC,EAE9CC,MAAS,GAEL,CAACC,GAAUC,CAAS,IAAIH,EAAS,EAAK,GAEtC,CAACd,GAASkB,CAAU,IAAIJ,EAASb,KAAgB,EAAE,GAEnD,CAACC,GAAQiB,CAAS,IAAIL,EAASX,KAAe,EAAE,GAEhD,CAACiB,GAAOC,CAAQ,IAAIP,EAAkB,EAAK,GAE3C;AAAA,IACJQ,QAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,SAAAA;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Aa,GAC5B,MAAK,MACL,MAAK,QAAM;AAAA,QAAA,GAEf;AAAA,MAAA,GACF;AAAA,IAAA,EAAA,CACF,EACF,CAAA;AAAA,IACA,gBAAAgC,EAACC,EAAM,QAAN,EACC,UAAA;AAAA,MAAC,gBAAAC,EAAAa,GAAA,EACC,OAAM,YACN,SAASlB,GACT,MAAK,UACL,SAAQ,SAEP7B,UAAEA,EAAA,oBAAoB,EACzB,CAAA;AAAA,wBACC+C,GACC,EAAA,OAAM,WACN,SAASrB,GACT,MAAK,UACL,SAAQ,UACR,WAAWpB,GACX,UAAUA,KAAY,CAACI,GAEtBV,UAAAA,EAAE,kBAAkB,GACvB;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as p } from "react";
|
|
3
|
-
import { useTranslation as m } from "react-i18next";
|
|
4
|
-
import { Icon as r } from "../../../../components/Icon/Icon.js";
|
|
5
|
-
import { Toolbar as d } from "../../../../components/Toolbar/Toolbar.js";
|
|
6
|
-
const h = ({
|
|
7
|
-
historyCount: n,
|
|
8
|
-
handle: i
|
|
9
|
-
}) => {
|
|
10
|
-
const {
|
|
11
|
-
t: o
|
|
12
|
-
} = m(), [a, c] = p(void 0), e = (l) => {
|
|
13
|
-
c(l), i(l);
|
|
14
|
-
}, s = [{
|
|
15
|
-
type: "button",
|
|
16
|
-
name: "undo",
|
|
17
|
-
props: {
|
|
18
|
-
color: "tertiary",
|
|
19
|
-
leftIcon: /* @__PURE__ */ t(r, { name: "undo" }),
|
|
20
|
-
"aria-label": o("cancel"),
|
|
21
|
-
children: o("cancel"),
|
|
22
|
-
onClick: () => e("UNDO"),
|
|
23
|
-
disabled: n === 0
|
|
24
|
-
},
|
|
25
|
-
tooltip: o("cancel")
|
|
26
|
-
}, {
|
|
27
|
-
type: "divider",
|
|
28
|
-
name: "div-1"
|
|
29
|
-
}, {
|
|
30
|
-
type: "button",
|
|
31
|
-
name: "reset",
|
|
32
|
-
props: {
|
|
33
|
-
color: "tertiary",
|
|
34
|
-
leftIcon: /* @__PURE__ */ t(r, { name: "reset" }),
|
|
35
|
-
"aria-label": o("rotate"),
|
|
36
|
-
children: o("rotate"),
|
|
37
|
-
onClick: () => e("ROTATE")
|
|
38
|
-
},
|
|
39
|
-
tooltip: o("rotate")
|
|
40
|
-
}, {
|
|
41
|
-
type: "button",
|
|
42
|
-
name: "crop",
|
|
43
|
-
props: {
|
|
44
|
-
color: "tertiary",
|
|
45
|
-
leftIcon: /* @__PURE__ */ t(r, { name: "crop" }),
|
|
46
|
-
"aria-label": o("crop"),
|
|
47
|
-
children: o("crop"),
|
|
48
|
-
className: a === "CROP" ? "is-selected" : "",
|
|
49
|
-
onClick: () => e("CROP")
|
|
50
|
-
},
|
|
51
|
-
tooltip: o("crop")
|
|
52
|
-
}, {
|
|
53
|
-
type: "button",
|
|
54
|
-
name: "blur",
|
|
55
|
-
props: {
|
|
56
|
-
color: "tertiary",
|
|
57
|
-
leftIcon: /* @__PURE__ */ t(r, { name: "blur" }),
|
|
58
|
-
"aria-label": o("blur"),
|
|
59
|
-
children: o("blur"),
|
|
60
|
-
className: a === "BLUR" ? "is-selected" : "",
|
|
61
|
-
onClick: () => e("BLUR")
|
|
62
|
-
},
|
|
63
|
-
tooltip: o("blur")
|
|
64
|
-
}];
|
|
65
|
-
return /* @__PURE__ */ t(d, { variant: "no-shadow", align: "left", isBlock: !0, items: s });
|
|
66
|
-
};
|
|
67
|
-
export {
|
|
68
|
-
h as default
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=ImageEditorToolbar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditorToolbar.js","sources":["../../../../../src/modules/multimedia/ImageEditor/components/ImageEditorToolbar.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { useTranslation } from 'react-i18next';\n\nimport { Icon, Toolbar, ToolbarItem } from '../../../../components';\n\nexport type ImageEditorAction = 'ROTATE' | 'UNDO' | 'CROP' | 'BLUR' | 'RESIZE';\ninterface ImageEditorToolbarProps {\n historyCount: number;\n handle(operation: ImageEditorAction): void;\n}\n\nconst ImageEditorToolbar = ({\n historyCount,\n handle,\n}: ImageEditorToolbarProps) => {\n const { t } = useTranslation();\n const [action, setAction] = useState<ImageEditorAction | undefined>(\n undefined,\n );\n const handleAndSave = (action: ImageEditorAction) => {\n setAction(action);\n handle(action);\n };\n\n const ImageEditorItems: ToolbarItem[] = [\n {\n type: 'button',\n name: 'undo',\n props: {\n color: 'tertiary',\n leftIcon: <Icon name=\"undo\" />,\n 'aria-label': t('cancel'),\n children: t('cancel'),\n onClick: () => handleAndSave('UNDO'),\n disabled: historyCount === 0,\n },\n tooltip: t('cancel'),\n },\n {\n type: 'divider',\n name: 'div-1',\n },\n {\n type: 'button',\n name: 'reset',\n props: {\n color: 'tertiary',\n leftIcon: <Icon name=\"reset\" />,\n 'aria-label': t('rotate'),\n children: t('rotate'),\n onClick: () => handleAndSave('ROTATE'),\n },\n tooltip: t('rotate'),\n },\n {\n type: 'button',\n name: 'crop',\n props: {\n color: 'tertiary',\n leftIcon: <Icon name=\"crop\" />,\n 'aria-label': t('crop'),\n children: t('crop'),\n className: action === 'CROP' ? 'is-selected' : '',\n onClick: () => handleAndSave('CROP'),\n },\n tooltip: t('crop'),\n },\n {\n type: 'button',\n name: 'blur',\n props: {\n color: 'tertiary',\n leftIcon: <Icon name=\"blur\" />,\n 'aria-label': t('blur'),\n children: t('blur'),\n className: action === 'BLUR' ? 'is-selected' : '',\n onClick: () => handleAndSave('BLUR'),\n },\n tooltip: t('blur'),\n },\n ];\n\n return (\n <Toolbar\n variant=\"no-shadow\"\n align=\"left\"\n isBlock\n items={ImageEditorItems}\n />\n );\n};\nexport default ImageEditorToolbar;\n"],"names":["ImageEditorToolbar","historyCount","handle","t","useTranslation","action","setAction","useState","undefined","handleAndSave","ImageEditorItems","type","name","props","color","leftIcon","jsx","Icon","children","onClick","disabled","tooltip","className","Toolbar"],"mappings":";;;;;AAYA,MAAMA,IAAqBA,CAAC;AAAA,EAC1BC,cAAAA;AAAAA,EACAC,QAAAA;AACuB,MAAM;AACvB,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB,CAACC,GAAQC,CAAS,IAAIC,EAC1BC,MACF,GACMC,IAAgBA,CAACJ,MAA8B;AACnDC,IAAAA,EAAUD,CAAM,GAChBH,EAAOG,CAAM;AAAA,EAAA,GAGTK,IAAkC,CACtC;AAAA,IACEC,MAAM;AAAA,IACNC,MAAM;AAAA,IACNC,OAAO;AAAA,MACLC,OAAO;AAAA,MACPC,UAAU,gBAAAC,EAACC,GAAK,EAAA,MAAK,OAAS,CAAA;AAAA,MAC9B,cAAcd,EAAE,QAAQ;AAAA,MACxBe,UAAUf,EAAE,QAAQ;AAAA,MACpBgB,SAASA,MAAMV,EAAc,MAAM;AAAA,MACnCW,UAAUnB,MAAiB;AAAA,IAC7B;AAAA,IACAoB,SAASlB,EAAE,QAAQ;AAAA,EAAA,GAErB;AAAA,IACEQ,MAAM;AAAA,IACNC,MAAM;AAAA,EAAA,GAER;AAAA,IACED,MAAM;AAAA,IACNC,MAAM;AAAA,IACNC,OAAO;AAAA,MACLC,OAAO;AAAA,MACPC,UAAU,gBAAAC,EAACC,GAAK,EAAA,MAAK,QAAU,CAAA;AAAA,MAC/B,cAAcd,EAAE,QAAQ;AAAA,MACxBe,UAAUf,EAAE,QAAQ;AAAA,MACpBgB,SAASA,MAAMV,EAAc,QAAQ;AAAA,IACvC;AAAA,IACAY,SAASlB,EAAE,QAAQ;AAAA,EAAA,GAErB;AAAA,IACEQ,MAAM;AAAA,IACNC,MAAM;AAAA,IACNC,OAAO;AAAA,MACLC,OAAO;AAAA,MACPC,UAAU,gBAAAC,EAACC,GAAK,EAAA,MAAK,OAAS,CAAA;AAAA,MAC9B,cAAcd,EAAE,MAAM;AAAA,MACtBe,UAAUf,EAAE,MAAM;AAAA,MAClBmB,WAAWjB,MAAW,SAAS,gBAAgB;AAAA,MAC/Cc,SAASA,MAAMV,EAAc,MAAM;AAAA,IACrC;AAAA,IACAY,SAASlB,EAAE,MAAM;AAAA,EAAA,GAEnB;AAAA,IACEQ,MAAM;AAAA,IACNC,MAAM;AAAA,IACNC,OAAO;AAAA,MACLC,OAAO;AAAA,MACPC,UAAU,gBAAAC,EAACC,GAAK,EAAA,MAAK,OAAS,CAAA;AAAA,MAC9B,cAAcd,EAAE,MAAM;AAAA,MACtBe,UAAUf,EAAE,MAAM;AAAA,MAClBmB,WAAWjB,MAAW,SAAS,gBAAgB;AAAA,MAC/Cc,SAASA,MAAMV,EAAc,MAAM;AAAA,IACrC;AAAA,IACAY,SAASlB,EAAE,MAAM;AAAA,EAAA,CAClB;AAID,SAAA,gBAAAa,EAACO,KACC,SAAQ,aACR,OAAM,QACN,SAAO,IACP,OAAOb,EACP,CAAA;AAEN;"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import * as i from "pixi.js";
|
|
2
|
-
import { getApplicationScale as d } from "./misc.js";
|
|
3
|
-
import { aggregate as l } from "../utils/aggregate.js";
|
|
4
|
-
const g = 20, h = 50, u = "BRUSH_CURSOR";
|
|
5
|
-
function m(e, n) {
|
|
6
|
-
const t = new i.Graphics();
|
|
7
|
-
for (const r of e)
|
|
8
|
-
r && (t.beginFill(16777215, 1), t.drawCircle(r.x, r.y, g / n), t.lineStyle(0), t.endFill());
|
|
9
|
-
return t;
|
|
10
|
-
}
|
|
11
|
-
function w(e, {
|
|
12
|
-
spriteName: n
|
|
13
|
-
}) {
|
|
14
|
-
return l(h, (t) => e.stage.toLocal(t.global), (t) => {
|
|
15
|
-
const r = e.stage.getChildByName(n), s = d(e);
|
|
16
|
-
if (r == null) return;
|
|
17
|
-
const o = new i.Sprite(r.texture);
|
|
18
|
-
o.filters = [
|
|
19
|
-
new i.BlurFilter(
|
|
20
|
-
8,
|
|
21
|
-
// PIXI Default value for strength of the blur effect
|
|
22
|
-
4,
|
|
23
|
-
// Quality of the blur effect depending on the scale (4 is the PIXI default value)
|
|
24
|
-
Math.min(s, 1)
|
|
25
|
-
)
|
|
26
|
-
// Resolution of the blur effect depending on the scale
|
|
27
|
-
], o.width = r.width, o.height = r.height, o.scale = new i.Point(1, 1), o.anchor = r.anchor, o.mask = m(t, s), r.addChild(o);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function a(e) {
|
|
31
|
-
f(e);
|
|
32
|
-
const n = d(e), t = new i.Graphics();
|
|
33
|
-
return t.lineStyle(Math.max(1, 1 / n), 16711680), t.drawCircle(0, 0, g / n), t.endFill(), t.name = u, e.stage.addChild(t), t;
|
|
34
|
-
}
|
|
35
|
-
function f(e) {
|
|
36
|
-
const n = e.stage.getChildByName(u);
|
|
37
|
-
n && n.removeFromParent();
|
|
38
|
-
}
|
|
39
|
-
function C(e) {
|
|
40
|
-
return (n) => {
|
|
41
|
-
if (!e) return;
|
|
42
|
-
const t = e.stage.toLocal(n.global), r = e.stage.getChildByName(u, !0);
|
|
43
|
-
r && (r.position.x = t.x, r.position.y = t.y);
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function y(e, {
|
|
47
|
-
spriteName: n
|
|
48
|
-
}) {
|
|
49
|
-
e.stage.interactive = !0;
|
|
50
|
-
const t = a(e), r = C(e);
|
|
51
|
-
e.stage.on("pointermove", r);
|
|
52
|
-
const s = w(e, {
|
|
53
|
-
spriteName: n
|
|
54
|
-
});
|
|
55
|
-
e.stage.on("pointerdown", () => {
|
|
56
|
-
e.stage.on("pointermove", s);
|
|
57
|
-
});
|
|
58
|
-
const o = () => {
|
|
59
|
-
var c;
|
|
60
|
-
(c = e == null ? void 0 : e.stage) == null || c.off("pointermove", s);
|
|
61
|
-
};
|
|
62
|
-
globalThis.addEventListener("pointerup", o), t.once("destroyed", () => {
|
|
63
|
-
globalThis.removeEventListener("pointerup", o);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
function B(e) {
|
|
67
|
-
f(e), e.stage.off("pointerdown"), e.stage.off("pointermove");
|
|
68
|
-
}
|
|
69
|
-
export {
|
|
70
|
-
y as start,
|
|
71
|
-
B as stop
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=blur.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blur.js","sources":["../../../../../src/modules/multimedia/ImageEditor/effects/blur.ts"],"sourcesContent":["import * as PIXI from 'pixi.js';\n\nimport { getApplicationScale } from './misc';\nimport { aggregate } from '../utils/aggregate';\n\n//\n// Global constants used for crop effects\n//\n\n// Define the radius (pixel) of the brush used to apply blur\nconst BRUSH_SIZE = 20;\n// Define the delay (in ms) of the debounce to avoid lags\nconst DEBOUNCE = 50;\n// Define the name of brush object in the PIXI context\nconst CURSOR_NAME = 'BRUSH_CURSOR';\n\n//\n// Implementation\n//\n\n/**\n * This function draw brush graphical object for each points\n *\n * @param points a list of PIXI.Point used to draw brush\n * @returns a graphical object that draw brush for each of theses points\n */\nfunction drawBrush(\n points: Array<PIXI.Point | undefined>,\n scale: number,\n): PIXI.Graphics {\n const container = new PIXI.Graphics();\n for (const point of points) {\n if (point) {\n container.beginFill(0xffffff, 1);\n container.drawCircle(point.x, point.y, BRUSH_SIZE / scale);\n container.lineStyle(0);\n container.endFill();\n }\n }\n return container;\n}\n\n/**\n * This function create a mouse event listener that merge and aggregate mouse events\n * The aggregated events are used to draw brush and apply blur filter to the stage\n * If the spriteName has not been found in the context, the listener do nothing\n *\n * @param application The PIXI.Application context\n * @param {spriteName} arg The name of the sprite identifying the original image\n * @returns A mouse event listener\n */\nfunction drawBlurListener(\n application: PIXI.Application,\n { spriteName }: { spriteName: string },\n) {\n return aggregate(\n DEBOUNCE,\n (event: PIXI.FederatedMouseEvent) => {\n return application.stage.toLocal(event.global);\n },\n (points: Array<PIXI.Point | undefined>) => {\n // Search for sprite\n const child = application.stage.getChildByName(spriteName);\n const scale = getApplicationScale(application);\n if (child === undefined || child === null) return;\n // Create a sprite by copying texture and apply blurFilter\n const newSprite = new PIXI.Sprite((child as PIXI.Sprite).texture);\n // Apply blur filter to the new sprite, quality for big image (fix lag issue)\n\n newSprite.filters = [\n new PIXI.BlurFilter(\n 8, // PIXI Default value for strength of the blur effect\n (Math.min(Math.round(4 * scale)), 4), // Quality of the blur effect depending on the scale (4 is the PIXI default value)\n Math.min(scale, 1), // Resolution of the blur effect depending on the scale\n ),\n ];\n newSprite.width = (child as PIXI.Sprite).width;\n newSprite.height = (child as PIXI.Sprite).height;\n // Resize the new sprite to match the original\n newSprite.scale = new PIXI.Point(1, 1);\n newSprite.anchor = (child as PIXI.Sprite).anchor;\n newSprite.mask = drawBrush(points, scale);\n (child as PIXI.Sprite).addChild(newSprite);\n },\n );\n}\n/**\n * This function draw the graphical cursor use to apply the blur effect\n *\n * @param application The PIXI.Application context\n * @returns the PIXI.Graphics object representing the cursor\n */\nfunction drawCursor(application: PIXI.Application): PIXI.Graphics {\n // Remove cursor if exists before draw\n removeCursor(application);\n const scale = getApplicationScale(application);\n const circle = new PIXI.Graphics();\n circle.lineStyle(Math.max(1, 1 / scale), 0xff0000);\n circle.drawCircle(0, 0, BRUSH_SIZE / scale);\n circle.endFill();\n circle.name = CURSOR_NAME;\n application.stage.addChild(circle);\n return circle;\n}\n/**\n * This function remove cursor if exists in context\n *\n * @param application The PIXI.Application context\n */\nfunction removeCursor(application: PIXI.Application) {\n const child = application.stage.getChildByName(CURSOR_NAME);\n if (child) {\n child.removeFromParent();\n }\n}\n/**\n * Move the cursor graphical controler while mouse is moving\n *\n * @param application the PIXI.Application context\n * @returns A mouse event listener\n */\nfunction moveCursorListener(application: PIXI.Application) {\n return (event: PIXI.FederatedMouseEvent) => {\n if (!application) return;\n const point = application.stage.toLocal(event.global);\n const child = application.stage.getChildByName(CURSOR_NAME, true);\n if (child) {\n child.position.x = point.x;\n child.position.y = point.y;\n }\n };\n}\n/**\n * This function start the blur controler\n * - drawing cursor\n * - listening mouse move to move cursor\n * - listening\n *\n * @param application\n * @param param1\n */\nexport function start(\n application: PIXI.Application,\n { spriteName }: { spriteName: string },\n) {\n application.stage.interactive = true;\n // Draw cursor\n const cursor = drawCursor(application);\n // Apply blur effect and move cursor while mouse moving\n const cursorListener = moveCursorListener(application);\n application.stage.on('pointermove', cursorListener);\n const blurListener = drawBlurListener(application, { spriteName });\n application.stage.on('pointerdown', () => {\n application.stage.on('pointermove', blurListener);\n });\n // Stop listening move when cursor is up\n const stopListening = () => {\n application?.stage?.off('pointermove', blurListener);\n };\n globalThis.addEventListener('pointerup', stopListening);\n // Remove global listener when cursor is destroyed\n cursor.once('destroyed', () => {\n globalThis.removeEventListener('pointerup', stopListening);\n });\n}\n/**\n * This function remove cursor and all mouse event listeners\n *\n * @param application the PIXI.Application context\n */\nexport function stop(application: PIXI.Application): void {\n removeCursor(application);\n application.stage.off('pointerdown');\n application.stage.off('pointermove');\n}\n"],"names":["BRUSH_SIZE","DEBOUNCE","CURSOR_NAME","drawBrush","points","scale","container","PIXI","Graphics","point","beginFill","drawCircle","x","y","lineStyle","endFill","drawBlurListener","application","spriteName","aggregate","event","stage","toLocal","global","child","getChildByName","getApplicationScale","newSprite","Sprite","texture","filters","BlurFilter","Math","min","width","height","Point","anchor","mask","addChild","drawCursor","removeCursor","circle","max","name","removeFromParent","moveCursorListener","position","start","interactive","cursor","cursorListener","on","blurListener","stopListening","off","addEventListener","once","removeEventListener","stop"],"mappings":";;;AAUA,MAAMA,IAAa,IAEbC,IAAW,IAEXC,IAAc;AAYpB,SAASC,EACPC,GACAC,GACe;AACTC,QAAAA,IAAY,IAAIC,EAAKC;AAC3B,aAAWC,KAASL;AAClB,IAAIK,MACQC,EAAAA,UAAU,UAAU,CAAC,GAC/BJ,EAAUK,WAAWF,EAAMG,GAAGH,EAAMI,GAAGb,IAAaK,CAAK,GACzDC,EAAUQ,UAAU,CAAC,GACrBR,EAAUS,QAAQ;AAGfT,SAAAA;AACT;AAWA,SAAS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R = 20, y = "CROP_BACKGROUND_NAME", a = "CROP_MASK_NAME";
|
|
4
|
-
function x(e) {
|
|
5
|
-
return "CROP_CORNER_" + e;
|
|
6
|
-
}
|
|
7
|
-
function v(e, {
|
|
8
|
-
spriteName: t
|
|
9
|
-
}) {
|
|
10
|
-
P(e);
|
|
11
|
-
const r = e.stage.getChildByName(t);
|
|
12
|
-
if (r == null) return;
|
|
13
|
-
const n = r.getBounds(), i = e.renderer.generateTexture(e.stage).clone(), s = new d.Sprite(i);
|
|
14
|
-
s.height = n.height, s.width = n.width, s.position = new d.Point(0, 0);
|
|
15
|
-
const o = new d.Graphics();
|
|
16
|
-
o.beginFill(16777215, 0.5), o.drawRect(0, 0, n.width, n.height), o.endFill(), o.name = y, o.position = new d.Point(n.x, n.y);
|
|
17
|
-
const g = new d.Graphics();
|
|
18
|
-
g.beginFill(0, 1), g.drawRect(0, 0, n.width - 2 * u, n.height - 2 * u), g.endFill(), g.position = new d.Point(u, u), g.name = a, s.mask = g, e.stage.addChild(o), o.addChild(g), o.addChild(s);
|
|
19
|
-
}
|
|
20
|
-
function P(e) {
|
|
21
|
-
const t = e.stage.getChildByName(y, !0);
|
|
22
|
-
t == null || t.removeFromParent();
|
|
23
|
-
}
|
|
24
|
-
function f(e, t) {
|
|
25
|
-
switch (e) {
|
|
26
|
-
case "TOP_LEFT":
|
|
27
|
-
return {
|
|
28
|
-
x: t.x,
|
|
29
|
-
y: t.y,
|
|
30
|
-
start: 0,
|
|
31
|
-
end: Math.PI / 2
|
|
32
|
-
};
|
|
33
|
-
case "TOP_RIGHT":
|
|
34
|
-
return {
|
|
35
|
-
x: t.x + t.width,
|
|
36
|
-
y: t.y,
|
|
37
|
-
start: Math.PI / 2,
|
|
38
|
-
end: Math.PI
|
|
39
|
-
};
|
|
40
|
-
case "BOTTOM_LEFT":
|
|
41
|
-
return {
|
|
42
|
-
x: t.x,
|
|
43
|
-
y: t.y + t.height,
|
|
44
|
-
start: 3 * Math.PI / 2,
|
|
45
|
-
end: 2 * Math.PI
|
|
46
|
-
};
|
|
47
|
-
case "BOTTOM_RIGHT":
|
|
48
|
-
return {
|
|
49
|
-
x: t.x + t.width,
|
|
50
|
-
y: t.y + t.height,
|
|
51
|
-
start: Math.PI,
|
|
52
|
-
end: 3 * Math.PI / 2
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function I(e) {
|
|
57
|
-
const t = e.stage.getChildByName(a, !0);
|
|
58
|
-
t != null && B.forEach((r) => {
|
|
59
|
-
const n = e.stage.getChildByName(x(r), !0);
|
|
60
|
-
if (n == null) return;
|
|
61
|
-
const i = f(r, {
|
|
62
|
-
height: t.height,
|
|
63
|
-
width: t.width,
|
|
64
|
-
x: t.x,
|
|
65
|
-
y: t.y
|
|
66
|
-
});
|
|
67
|
-
n.position = new d.Point(i.x, i.y);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function l(e, t, {
|
|
71
|
-
spriteName: r
|
|
72
|
-
}) {
|
|
73
|
-
const n = e.stage.getChildByName(x(t), !0), i = _(e);
|
|
74
|
-
n == null || n.removeFromParent();
|
|
75
|
-
const s = e.stage.getChildByName(y, !0), o = e.stage.getChildByName(a, !0), g = e.stage.getChildByName(r);
|
|
76
|
-
if (g == null || s === null || s === void 0 || o === void 0 || o === null)
|
|
77
|
-
return;
|
|
78
|
-
const c = f(t, {
|
|
79
|
-
height: o.height,
|
|
80
|
-
width: o.width,
|
|
81
|
-
x: o.x,
|
|
82
|
-
y: o.y
|
|
83
|
-
}), h = new d.Graphics();
|
|
84
|
-
h.beginFill(4960213, 1), h.arc(0, 0, R / i, c.start, c.end), h.lineTo(0, 0), h.endFill(), h.position = new d.Point(c.x, c.y), h.name = x(t), h.interactive = !0;
|
|
85
|
-
let T = !1;
|
|
86
|
-
e.stage.on("pointermove", (M) => {
|
|
87
|
-
if (T === !1) return;
|
|
88
|
-
const w = s.toLocal(M.global);
|
|
89
|
-
h.position.x = w.x, h.position.y = w.y, E(e, t, w);
|
|
90
|
-
});
|
|
91
|
-
const C = () => {
|
|
92
|
-
T = !0;
|
|
93
|
-
};
|
|
94
|
-
h.on("pointerdown", C);
|
|
95
|
-
const O = () => {
|
|
96
|
-
T = !1;
|
|
97
|
-
};
|
|
98
|
-
globalThis.addEventListener("pointerup", O), h.once("destroyed", () => {
|
|
99
|
-
h.off("pointerdown"), globalThis.removeEventListener("pointerup", O);
|
|
100
|
-
}), s.addChild(h);
|
|
101
|
-
}
|
|
102
|
-
function E(e, t, r) {
|
|
103
|
-
const n = e.stage.getChildByName(a, !0);
|
|
104
|
-
if (n == null) return;
|
|
105
|
-
const i = n.position.x + n.width, s = n.position.y + n.height;
|
|
106
|
-
switch (t) {
|
|
107
|
-
case "TOP_LEFT": {
|
|
108
|
-
n.position.x = r.x, n.position.y = r.y, n.width = i - r.x, n.height = s - r.y;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
case "TOP_RIGHT": {
|
|
112
|
-
n.position.y = r.y, n.width = r.x - n.position.x, n.height = s - r.y;
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
case "BOTTOM_LEFT": {
|
|
116
|
-
n.position.x = r.x, n.width = i - r.x, n.height = r.y - n.position.y;
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
case "BOTTOM_RIGHT": {
|
|
120
|
-
n.width = r.x - n.position.x, n.height = r.y - n.position.y;
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
I(e);
|
|
125
|
-
}
|
|
126
|
-
function k(e, {
|
|
127
|
-
spriteName: t
|
|
128
|
-
}) {
|
|
129
|
-
m(e), e.stage.interactive = !0, e.stage.interactiveChildren = !0, v(e, {
|
|
130
|
-
spriteName: t
|
|
131
|
-
}), l(e, "BOTTOM_LEFT", {
|
|
132
|
-
spriteName: t
|
|
133
|
-
}), l(e, "BOTTOM_RIGHT", {
|
|
134
|
-
spriteName: t
|
|
135
|
-
}), l(e, "TOP_LEFT", {
|
|
136
|
-
spriteName: t
|
|
137
|
-
}), l(e, "TOP_RIGHT", {
|
|
138
|
-
spriteName: t
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
function m(e) {
|
|
142
|
-
P(e), e.stage.off("pointermove"), e.render();
|
|
143
|
-
}
|
|
144
|
-
function F(e) {
|
|
145
|
-
const t = e.stage.getChildByName(a, !0);
|
|
146
|
-
if (t == null) return;
|
|
147
|
-
m(e);
|
|
148
|
-
const r = e.renderer.generateTexture(e.stage).clone(), n = new d.Sprite(r), i = t.getBounds(), s = new d.Rectangle(Math.floor(i.x), Math.floor(i.y), Math.floor(i.width), Math.floor(i.height)), o = new d.Texture(n.texture.baseTexture, s);
|
|
149
|
-
return new d.Sprite(o);
|
|
150
|
-
}
|
|
151
|
-
export {
|
|
152
|
-
F as save,
|
|
153
|
-
k as start,
|
|
154
|
-
m as stop
|
|
155
|
-
};
|
|
156
|
-
//# sourceMappingURL=crop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crop.js","sources":["../../../../../src/modules/multimedia/ImageEditor/effects/crop.ts"],"sourcesContent":["import * as PIXI from 'pixi.js';\n\nimport { getApplicationScale } from './misc';\n\n//\n// Global constants used for crop effects\n//\n\n// Union type to identify corners\nexport type CornerType =\n | 'TOP_LEFT'\n | 'TOP_RIGHT'\n | 'BOTTOM_LEFT'\n | 'BOTTOM_RIGHT';\n// List of available corners\nconst CORNERS: Array<CornerType> = [\n 'TOP_LEFT',\n 'TOP_RIGHT',\n 'BOTTOM_LEFT',\n 'BOTTOM_RIGHT',\n];\n// Define initial padding (pixel) between anchors and image corners\nconst PADDING = 0;\n// Define the radius (pixel) of the corner control\nconst POINT_RADIUS = 20;\n// Define the name of the background backdrop applied while we are cropping\nconst CROP_BACKGROUND_NAME = 'CROP_BACKGROUND_NAME';\n// Define the name of the mask (crop) applied to the final image\nconst CROP_MASK_NAME = 'CROP_MASK_NAME';\n\n//\n// Implementation\n//\n\n/**\n * This function generate names for corner objects\n * @param corner COrnerType identifying one corner\n * @returns A name identifying the corner object\n */\nfunction getCornerName(corner: CornerType) {\n return 'CROP_CORNER_' + corner;\n}\n/**\n * This function draw background having:\n * - a backdrop with 0.5 opacity over the initial image\n * - a duplicate texture of the initial stage\n * - a rectangle/mask applied to the cloned texture\n *\n * If the sprite does not exists in this context this function do nothing\n *\n * @param application The PIXI.Application context\n * @param {spriteName:string} {spriteName} The name of the sprite in the context\n */\nfunction drawBackground(\n application: PIXI.Application,\n { spriteName }: { spriteName: string },\n): void {\n removeBackground(application);\n const sprite = application.stage.getChildByName(\n spriteName,\n ) as PIXI.Sprite | null;\n if (sprite === null || sprite === undefined) return;\n const spriteBounds = sprite.getBounds();\n // Clone the stage\n const stageTexture = application.renderer\n .generateTexture(application.stage)\n .clone();\n const clonedStage = new PIXI.Sprite(stageTexture);\n clonedStage.height = spriteBounds.height;\n clonedStage.width = spriteBounds.width;\n clonedStage.position = new PIXI.Point(0, 0);\n // Draw the background\n const background = new PIXI.Graphics();\n background.beginFill(0xffffff, 0.5);\n background.drawRect(0, 0, spriteBounds.width, spriteBounds.height);\n background.endFill();\n background.name = CROP_BACKGROUND_NAME;\n background.position = new PIXI.Point(spriteBounds.x, spriteBounds.y);\n // Draw the mask to apply to the cloned stage\n const rectMask = new PIXI.Graphics();\n rectMask.beginFill(0x000000, 1);\n rectMask.drawRect(\n 0,\n 0,\n spriteBounds.width - 2 * PADDING,\n spriteBounds.height - 2 * PADDING,\n );\n rectMask.endFill();\n rectMask.position = new PIXI.Point(PADDING, PADDING);\n rectMask.name = CROP_MASK_NAME;\n // Apply the mask to the cloned stage and add children\n clonedStage.mask = rectMask;\n application.stage.addChild(background);\n background.addChild(rectMask);\n background.addChild(clonedStage);\n}\n/**\n * This function remove the background with all his children (corners, backdrop and cloned stage)\n * If the background does not exists this function do nothing\n *\n * @param application The PIXI.Application context\n */\nfunction removeBackground(application: PIXI.Application): void {\n const child = application.stage.getChildByName(CROP_BACKGROUND_NAME, true);\n child?.removeFromParent();\n}\n/**\n * This function compute coordinate (x,y) and angles (start,end) of a corner according to the CornerType\n * - (x,y) are coordinate of the corner in pixel relative to the parent\n * - (start, end) are angles between 0 and 2PI used to draw the corner relative using the Arc tool\n *\n * @param cornerType a CornerType for which we want to compute angles and coordinates\n * @param bounds bounds of the Cropped Texture (which is also the parent of the corner)\n * @returns the coordinates and the angles\n */\nfunction computeCornerPosition(\n cornerType: CornerType,\n bounds: { x: number; y: number; width: number; height: number },\n): { x: number; y: number; start: number; end: number } {\n switch (cornerType) {\n case 'TOP_LEFT': {\n return { x: bounds.x, y: bounds.y, start: 0, end: Math.PI / 2 };\n }\n case 'TOP_RIGHT': {\n return {\n x: bounds.x + bounds.width,\n y: bounds.y,\n start: Math.PI / 2,\n end: Math.PI,\n };\n }\n case 'BOTTOM_LEFT': {\n return {\n x: bounds.x,\n y: bounds.y + bounds.height,\n start: (3 * Math.PI) / 2,\n end: 2 * Math.PI,\n };\n }\n case 'BOTTOM_RIGHT': {\n return {\n x: bounds.x + bounds.width,\n y: bounds.y + bounds.height,\n start: Math.PI,\n end: (3 * Math.PI) / 2,\n };\n }\n }\n}\n/**\n * This function reposition all corners according the bounds of the mask\n * If the mask has not been found in this context this function do nothing\n *\n * @param application The PIXI.Application context\n */\nfunction refreshCorners(application: PIXI.Application): void {\n const mask = application.stage.getChildByName(\n CROP_MASK_NAME,\n true,\n ) as PIXI.Graphics | null;\n if (mask === undefined || mask === null) return;\n CORNERS.forEach((cornerType) => {\n const corner = application.stage.getChildByName(\n getCornerName(cornerType),\n true,\n );\n if (corner === undefined || corner === null) return;\n const position = computeCornerPosition(cornerType, {\n height: mask.height,\n width: mask.width,\n x: mask.x,\n y: mask.y,\n });\n corner.position = new PIXI.Point(position.x, position.y);\n });\n}\n/**\n * This function draw one corner according to his type.\n * It also binds mouse events to move mask according when the corner move\n *\n * @param application The PIXI.Application context\n * @param cornerType The cornerType identifying the corner we are drawing\n * @param { spriteName:string } {spriteName} The sprite name identifying the original image\n */\nfunction drawCorner(\n application: PIXI.Application,\n cornerType: CornerType,\n { spriteName }: { spriteName: string },\n): void {\n // Delete corner if exists before redrawing\n const previous = application.stage.getChildByName(\n getCornerName(cornerType),\n true,\n );\n const scale = getApplicationScale(application);\n previous?.removeFromParent();\n // Search for background\n const background = application.stage.getChildByName(\n CROP_BACKGROUND_NAME,\n true,\n ) as PIXI.Graphics | null;\n // Search for mask\n const mask = application.stage.getChildByName(\n CROP_MASK_NAME,\n true,\n ) as PIXI.Graphics | null;\n // Search for sprite\n const sprite = application.stage.getChildByName(\n spriteName,\n ) as PIXI.Sprite | null;\n if (\n sprite === null ||\n sprite === undefined ||\n background === null ||\n background === undefined ||\n mask === undefined ||\n mask === null\n ) {\n return;\n }\n // Compute corner position\n const position = computeCornerPosition(cornerType, {\n height: mask.height,\n width: mask.width,\n x: mask.x,\n y: mask.y,\n });\n //Draw corner\n const corner = new PIXI.Graphics();\n corner.beginFill(0x4bafd5, 1);\n corner.arc(0, 0, POINT_RADIUS / scale, position.start, position.end);\n corner.lineTo(0, 0);\n corner.endFill();\n corner.position = new PIXI.Point(position.x, position.y);\n corner.name = getCornerName(cornerType);\n corner.interactive = true;\n // Add mouse event move => on corner move redraw mask\n let enable = false;\n application.stage.on('pointermove', (event: PIXI.FederatedMouseEvent) => {\n if (enable === false) return;\n const localPosition = background.toLocal(event.global);\n corner.position.x = localPosition.x;\n corner.position.y = localPosition.y;\n moveMask(application, cornerType, localPosition);\n });\n // Add mouse down event => on pointer down start moving mask\n const handlePointerDown = () => {\n enable = true;\n };\n corner.on('pointerdown', handlePointerDown);\n // Add mouse up event => on pointer down stop moving mask\n const handlePointerUp = () => {\n enable = false;\n };\n globalThis.addEventListener('pointerup', handlePointerUp);\n // Remove listeners when corner destroyed\n corner.once('destroyed', () => {\n // cancel listener\n corner.off('pointerdown');\n globalThis.removeEventListener('pointerup', handlePointerUp);\n });\n // Add corner\n background.addChild(corner);\n}\n/**\n * This function move the rectangle mask used to crop the image\n * If the mask does not exists in this context the function do nothing\n *\n * @param application the PIXI.Application context\n * @param cornerType The cornerType identifying the corner that changed position\n * @param position The coordinate (x,y) of the corner that moved\n */\nfunction moveMask(\n application: PIXI.Application,\n cornerType: CornerType,\n position: { x: number; y: number },\n): void {\n const mask = application.stage.getChildByName(\n CROP_MASK_NAME,\n true,\n ) as PIXI.Graphics | null;\n if (mask === undefined || mask === null) return;\n const right = mask.position.x + mask.width;\n const bottom = mask.position.y + mask.height;\n switch (cornerType) {\n case 'TOP_LEFT': {\n mask.position.x = position.x;\n mask.position.y = position.y;\n mask.width = right - position.x;\n mask.height = bottom - position.y;\n break;\n }\n case 'TOP_RIGHT': {\n mask.position.y = position.y;\n mask.width = position.x - mask.position.x;\n mask.height = bottom - position.y;\n break;\n }\n case 'BOTTOM_LEFT': {\n mask.position.x = position.x;\n mask.width = right - position.x;\n mask.height = position.y - mask.position.y;\n break;\n }\n case 'BOTTOM_RIGHT': {\n mask.width = position.x - mask.position.x;\n mask.height = position.y - mask.position.y;\n break;\n }\n }\n refreshCorners(application);\n}\n/**\n * This function draw all graphics controls used to crop an image:\n * - 4 corners to select the cropped area\n * - A background with an transparent backdrop effect\n * - A mask applied to the original image\n *\n * @param application The PIXI.Application context\n * @param {spriteName:string} {spriteName} The sprite name identifying the original image\n */\nexport function start(\n application: PIXI.Application,\n { spriteName }: { spriteName: string },\n): void {\n // Remove controls before redrawing if exists\n stop(application);\n application.stage.interactive = true;\n application.stage.interactiveChildren = true;\n drawBackground(application, { spriteName });\n drawCorner(application, 'BOTTOM_LEFT', { spriteName });\n drawCorner(application, 'BOTTOM_RIGHT', { spriteName });\n drawCorner(application, 'TOP_LEFT', { spriteName });\n drawCorner(application, 'TOP_RIGHT', { spriteName });\n}\n/**\n * This function remove all graphics controls if exists. And it also remove any mouse event on this stage\n *\n * @param application The PIXI.Application context\n */\nexport function stop(application: PIXI.Application) {\n removeBackground(application);\n application.stage.off('pointermove');\n application.render();\n}\n/**\n * This function apply a crop to the imageSrc and return the result as a PIXI.Sprite object\n *\n * @param application\n * @param imageSrc a string URI of the image to crop\n * @returns a PIXI.Sprite with a imageSrc cropped or undefined if the image has not been cropped\n */\nexport function save(application: PIXI.Application): PIXI.Sprite | undefined {\n // Search for mask in this context\n const mask = application.stage.getChildByName(\n CROP_MASK_NAME,\n true,\n ) as PIXI.Graphics | null;\n // Stop if mask does not exists\n if (mask === undefined || mask === null) return;\n // Remove controls before cloning stage\n stop(application);\n // Clone stage\n const stageTexture = application.renderer\n .generateTexture(application.stage)\n .clone();\n const clonedStage = new PIXI.Sprite(stageTexture);\n // Compute bounds and round lower to avoid overflow\n const maskBounds = mask.getBounds();\n const bounds = new PIXI.Rectangle(\n Math.floor(maskBounds.x),\n Math.floor(maskBounds.y),\n Math.floor(maskBounds.width),\n Math.floor(maskBounds.height),\n );\n // Apply crop to the cloned stage\n const cropped = new PIXI.Texture(clonedStage.texture.baseTexture, bounds);\n const sprite = new PIXI.Sprite(cropped);\n return sprite;\n}\n"],"names":["CORNERS","PADDING","POINT_RADIUS","CROP_BACKGROUND_NAME","CROP_MASK_NAME","getCornerName","corner","drawBackground","application","spriteName","removeBackground","sprite","stage","getChildByName","spriteBounds","getBounds","stageTexture","renderer","generateTexture","clone","clonedStage","PIXI","Sprite","height","width","position","Point","background","Graphics","beginFill","drawRect","endFill","name","x","y","rectMask","mask","addChild","child","removeFromParent","computeCornerPosition","cornerType","bounds","start","end","Math","PI","refreshCorners","forEach","drawCorner","previous","scale","getApplicationScale","undefined","arc","lineTo","interactive","enable","on","event","localPosition","toLocal","global","handlePointerDown","handlePointerUp","addEventListener","once","off","removeEventListener","moveMask","right","bottom","stop","interactiveChildren","render","save","maskBounds","Rectangle","floor","cropped","Texture","texture","baseTexture"],"mappings":";;AAeA,MAAMA,IAA6B,CACjC,YACA,aACA,eACA,cAAc,GAGVC,IAAU,GAEVC,IAAe,IAEfC,IAAuB,wBAEvBC,IAAiB;AAWvB,SAASC,EAAcC,GAAoB;AACzC,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EMwD,IAAU,IAAI1D,EAAK2D,QAAQ5D,EAAY6D,QAAQC,aAAaxC,CAAM;AAEjE/B,SADQ,IAAIU,EAAKC,OAAOyD,CAAO;AAExC;"}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import * as d from "pixi.js";
|
|
2
|
-
const u = 100, x = 100, y = 450, I = 64, A = 0.5, R = "image";
|
|
3
|
-
function z(e, {
|
|
4
|
-
spriteName: t,
|
|
5
|
-
imgDatasource: i,
|
|
6
|
-
settings: h
|
|
7
|
-
}) {
|
|
8
|
-
const s = URL.createObjectURL(i), o = new Image();
|
|
9
|
-
return o.src = s, new Promise((n) => {
|
|
10
|
-
o.onload = async () => {
|
|
11
|
-
await T(e, {
|
|
12
|
-
spriteName: t,
|
|
13
|
-
imgDatasource: o,
|
|
14
|
-
settings: h
|
|
15
|
-
});
|
|
16
|
-
const r = e == null ? void 0 : e.stage.getChildByName(t, !0);
|
|
17
|
-
n(r);
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
async function T(e, {
|
|
22
|
-
spriteName: t,
|
|
23
|
-
imgDatasource: i,
|
|
24
|
-
settings: h
|
|
25
|
-
}) {
|
|
26
|
-
if (e === void 0 || e.stage === null)
|
|
27
|
-
return;
|
|
28
|
-
const s = e.stage.getChildByName(t, !0);
|
|
29
|
-
s == null || s.removeFromParent();
|
|
30
|
-
const o = i instanceof HTMLImageElement ? d.Texture.from(i) : i instanceof d.Sprite ? i : await d.Texture.fromURL(i), n = o instanceof d.Sprite ? o : d.Sprite.from(o, {});
|
|
31
|
-
if (n.interactive = !0, n.name = t, h) {
|
|
32
|
-
const {
|
|
33
|
-
sprite: {
|
|
34
|
-
anchor: r,
|
|
35
|
-
position: g,
|
|
36
|
-
scale: c,
|
|
37
|
-
size: w,
|
|
38
|
-
rotation: f
|
|
39
|
-
},
|
|
40
|
-
stage: {
|
|
41
|
-
size: m
|
|
42
|
-
}
|
|
43
|
-
} = h, a = f % Math.PI !== 0;
|
|
44
|
-
n.anchor.x = r.x, n.anchor.y = r.y, n.position.x = g.x, n.position.y = g.y, n.scale.x = c.x, n.scale.y = c.y, n.width = a ? w.height : w.width, n.height = a ? w.width : w.height, e.stage.height = m.height, e.stage.width = m.width, e.renderer.resize(m.width, m.height), e.stage.addChild(n);
|
|
45
|
-
} else
|
|
46
|
-
e.stage.addChild(n), e.renderer.resize(n.width, n.height);
|
|
47
|
-
L(e, n);
|
|
48
|
-
}
|
|
49
|
-
function L(e, t) {
|
|
50
|
-
var g;
|
|
51
|
-
const i = e.view.parentNode, h = window.innerWidth - I, s = Math.max((i == null ? void 0 : i.offsetWidth) ?? 0, x), o = v({
|
|
52
|
-
width: t.width,
|
|
53
|
-
height: t.height
|
|
54
|
-
}, {
|
|
55
|
-
width: {
|
|
56
|
-
max: Math.min(s, h),
|
|
57
|
-
min: x
|
|
58
|
-
},
|
|
59
|
-
height: {
|
|
60
|
-
min: u,
|
|
61
|
-
max: window.innerHeight - y
|
|
62
|
-
}
|
|
63
|
-
}), {
|
|
64
|
-
height: n,
|
|
65
|
-
width: r
|
|
66
|
-
} = o;
|
|
67
|
-
(g = e.view) != null && g.style && (e.view.style.width = `${r}px`, e.view.style.height = `${n}px`);
|
|
68
|
-
}
|
|
69
|
-
function v(e, t) {
|
|
70
|
-
const {
|
|
71
|
-
height: i,
|
|
72
|
-
width: h
|
|
73
|
-
} = e, s = h / i, {
|
|
74
|
-
height: o,
|
|
75
|
-
width: n
|
|
76
|
-
} = t;
|
|
77
|
-
let r = n.max, g = n.max / s;
|
|
78
|
-
return h > n.max && (r = n.max, g = r / s), g > o.max && (g = o.max, r = g * s), r < n.min && (r = n.min, g = r / s), g < o.min && (g = o.min, r = g * s), {
|
|
79
|
-
width: r,
|
|
80
|
-
height: g
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function E(e) {
|
|
84
|
-
return new Promise((t, i) => {
|
|
85
|
-
var h;
|
|
86
|
-
(h = e == null ? void 0 : e.view) != null && h.toBlob ? e.view.toBlob((s) => {
|
|
87
|
-
s ? t(s) : i("EXTRACT_FAILED");
|
|
88
|
-
}, "image/jpeg", A) : i("EXTRACT_FAILED");
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function S(e) {
|
|
92
|
-
var t, i;
|
|
93
|
-
return (i = (t = e.view).toDataURL) == null ? void 0 : i.call(t);
|
|
94
|
-
}
|
|
95
|
-
function _(e) {
|
|
96
|
-
return e.view.getBoundingClientRect ? e.view.getBoundingClientRect().width / e.view.width : 1;
|
|
97
|
-
}
|
|
98
|
-
function B(e) {
|
|
99
|
-
return new Promise((t, i) => {
|
|
100
|
-
var h, s;
|
|
101
|
-
(s = (h = e.view).toBlob) == null || s.call(h, (o) => {
|
|
102
|
-
o ? t(o) : i("EXTRACT_FAIL");
|
|
103
|
-
}, "image/png", 1);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function C({
|
|
107
|
-
application: e,
|
|
108
|
-
sprite: t
|
|
109
|
-
}) {
|
|
110
|
-
return {
|
|
111
|
-
sprite: {
|
|
112
|
-
rotation: t.rotation,
|
|
113
|
-
size: {
|
|
114
|
-
width: t.width,
|
|
115
|
-
height: t.height
|
|
116
|
-
},
|
|
117
|
-
position: {
|
|
118
|
-
x: t.position.x,
|
|
119
|
-
y: t.position.y
|
|
120
|
-
},
|
|
121
|
-
scale: {
|
|
122
|
-
x: t.scale.x,
|
|
123
|
-
y: t.scale.y
|
|
124
|
-
},
|
|
125
|
-
anchor: {
|
|
126
|
-
x: t.anchor.x,
|
|
127
|
-
y: t.anchor.y
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
stage: {
|
|
131
|
-
size: {
|
|
132
|
-
width: e.stage.width,
|
|
133
|
-
height: e.stage.height
|
|
134
|
-
},
|
|
135
|
-
scale: {
|
|
136
|
-
x: e.stage.scale.x,
|
|
137
|
-
y: e.stage.scale.y
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
function D({
|
|
143
|
-
application: e,
|
|
144
|
-
sprite: t,
|
|
145
|
-
newHeight: i,
|
|
146
|
-
newWidth: h
|
|
147
|
-
}) {
|
|
148
|
-
t.anchor.x = 0.5, t.anchor.y = 0.5, t.position = new d.Point(h / 2, i / 2), e.stage.height = i, e.stage.width = h, e.renderer.resize(h, i);
|
|
149
|
-
}
|
|
150
|
-
export {
|
|
151
|
-
R as DEFAULT_SPRITE_NAME,
|
|
152
|
-
L as autoResize,
|
|
153
|
-
v as constraintSize,
|
|
154
|
-
C as createImageSettings,
|
|
155
|
-
_ as getApplicationScale,
|
|
156
|
-
D as resizeStage,
|
|
157
|
-
E as saveAsBlob,
|
|
158
|
-
S as saveAsDataURL,
|
|
159
|
-
B as toBlob,
|
|
160
|
-
T as updateImage,
|
|
161
|
-
z as updateImageFromBlob
|
|
162
|
-
};
|
|
163
|
-
//# sourceMappingURL=misc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"misc.js","sources":["../../../../../src/modules/multimedia/ImageEditor/effects/misc.ts"],"sourcesContent":["import * as PIXI from 'pixi.js';\n\n// Define (in pixel) the minimal height the sprite should have\nconst MIN_HEIGHT = 100;\n// Define (in pixel) the minimal width the sprite should have\nconst MIN_WIDTH = 100;\n// Modal padding\nconst MODAL_VERTICAL_PADDING = 450;\nconst MODAL_HORIZONTAL_PADDING = 64;\n\n// Using canvas to download the image increase the file size so to keep the same we need to apply a quality\nconst DEFAULT_QUALITY = 0.5;\n\n// Define the default name of the sprite in the PIXI.Application context\nexport const DEFAULT_SPRITE_NAME = 'image';\n\n/**\n * A structure that define all setting of an image\n * - positon\n * - scale\n * - size\n * - size of the stage\n */\nexport interface ImageSettings {\n stage: {\n size: { width: number; height: number };\n scale: { x: number; y: number };\n };\n sprite: {\n rotation: number;\n size: { width: number; height: number };\n scale: { x: number; y: number };\n position: { x: number; y: number };\n anchor: { x: number; y: number };\n };\n}\n/**\n * This function update the image content using Blob datasource\n *\n * @param application the PIXI.Application context\n * @param param.spriteName the name of the sprite in the context\n * @param param.imgDatasource the img data could be one of: string url, HTMLImageElement, PIXI.Sprite\n * @param param.stageSize?: { width: number; height: number };\n * @param param.spriteSize?: { width: number; height: number };\n */\nexport function updateImageFromBlob(\n application: PIXI.Application,\n {\n spriteName,\n imgDatasource,\n settings,\n }: {\n spriteName: string;\n imgDatasource: Blob;\n settings?: ImageSettings;\n },\n): Promise<PIXI.Sprite | null> {\n const imageUrl = URL.createObjectURL(imgDatasource);\n const image = new Image();\n image.src = imageUrl;\n return new Promise<PIXI.Sprite | null>((resolve) => {\n image.onload = async () => {\n await updateImage(application, {\n spriteName,\n imgDatasource: image,\n settings,\n });\n\n // get new sprite\n const newSprite = application?.stage.getChildByName(\n spriteName,\n true,\n ) as PIXI.Sprite | null;\n resolve(newSprite);\n };\n });\n}\n/**\n * This function update the image content for the sprite in the PIXI.Application context\n *\n * @param application the PIXI.Application context\n * @param param.spriteName the name of the sprite in the context\n * @param param.imgDatasource the img data could be one of: string url, HTMLImageElement, PIXI.Sprite\n * @param param.spriteSize\n * @param param.stageSize\n */\nexport async function updateImage(\n application: PIXI.Application,\n {\n spriteName,\n imgDatasource,\n settings,\n }: {\n spriteName: string;\n imgDatasource: string | HTMLImageElement | PIXI.Sprite;\n settings?: ImageSettings;\n },\n): Promise<void> {\n if (application === undefined || application.stage === null) {\n return;\n }\n // Remove previous sprite if exists\n const previous = application.stage.getChildByName(spriteName, true);\n previous?.removeFromParent();\n // Create texture from datasource\n const texture =\n imgDatasource instanceof HTMLImageElement\n ? PIXI.Texture.from(imgDatasource)\n : imgDatasource instanceof PIXI.Sprite\n ? imgDatasource\n : await PIXI.Texture.fromURL(imgDatasource);\n // Create sprite from texture and set name\n const sprite =\n texture instanceof PIXI.Sprite ? texture : PIXI.Sprite.from(texture, {});\n sprite.interactive = true;\n sprite.name = spriteName;\n // If settings are defined => resize accordingly\n if (settings) {\n const {\n sprite: { anchor, position, scale, size: spriteSize, rotation },\n stage: { size: stageSize },\n } = settings;\n // Check whether sprite has been rotated\n const isRotated = rotation % Math.PI !== 0;\n //Config sprite\n sprite.anchor.x = anchor.x;\n sprite.anchor.y = anchor.y;\n sprite.position.x = position.x;\n sprite.position.y = position.y;\n sprite.scale.x = scale.x;\n sprite.scale.y = scale.y;\n // If sprite is rotated a multiple of 90°=>width and height are swapped\n sprite.width = isRotated ? spriteSize.height : spriteSize.width;\n sprite.height = isRotated ? spriteSize.width : spriteSize.height;\n // Resize stage\n application.stage.height = stageSize.height;\n application.stage.width = stageSize.width;\n application.renderer.resize(stageSize.width, stageSize.height);\n // Add sprite to context\n application.stage.addChild(sprite);\n } else {\n // Add sprite to context\n application.stage.addChild(sprite);\n // Resize the sprite\n application.renderer.resize(sprite.width, sprite.height);\n }\n // Resize the view in css to keep img quality\n autoResize(application, sprite);\n}\n\n/**\n * This function resize the sprite according to the container width\n *\n * @param application The PIXI.Application context\n * @param sprite The sprite object representing the image to resize\n */\nexport function autoResize(\n application: PIXI.Application,\n sprite: PIXI.Sprite,\n): void {\n // Get parent html object\n const parent = application.view.parentNode as HTMLElement | undefined;\n const maxMobileWidth = window.innerWidth - MODAL_HORIZONTAL_PADDING;\n const parentWidth = Math.max(parent?.offsetWidth ?? 0, MIN_WIDTH);\n const newSize = constraintSize(\n {\n width: sprite.width,\n height: sprite.height,\n },\n {\n width: {\n max: Math.min(parentWidth, maxMobileWidth),\n min: MIN_WIDTH,\n },\n height: {\n min: MIN_HEIGHT,\n max: window.innerHeight - MODAL_VERTICAL_PADDING,\n },\n },\n );\n // Define the new width to the parentWidth\n const { height: newHeight, width: newWidth } = newSize;\n\n // Anchor the sprite to the middle (for rotation)\n if (application.view?.style) {\n application.view.style.width = `${newWidth}px`;\n application.view.style.height = `${newHeight}px`;\n }\n}\n\nexport function constraintSize(\n size: { width: number; height: number },\n constraints: {\n width: { max: number; min: number };\n height: { max: number; min: number };\n },\n) {\n const { height, width } = size;\n const ratio = width / height;\n const { height: constraintHeight, width: constraintWidth } = constraints;\n // set max size\n let newWidth = constraintWidth.max;\n let newHeight = constraintWidth.max / ratio;\n // constraint width max\n if (width > constraintWidth.max) {\n newWidth = constraintWidth.max;\n newHeight = newWidth / ratio;\n }\n // constraint height max\n if (newHeight > constraintHeight.max) {\n newHeight = constraintHeight.max;\n newWidth = newHeight * ratio;\n }\n // constraint width min\n if (newWidth < constraintWidth.min) {\n newWidth = constraintWidth.min;\n newHeight = newWidth / ratio;\n }\n // constraint height max\n if (newHeight < constraintHeight.min) {\n newHeight = constraintHeight.min;\n newWidth = newHeight * ratio;\n }\n return { width: newWidth, height: newHeight };\n}\n\n/**\n * This function transform the stage into a blob\n *\n * @param application the PIXI.Application context\n * @returns A promise of the generated blob\n */\nexport function saveAsBlob(application: PIXI.Application): Promise<Blob> {\n return new Promise<Blob>((resolve, reject) => {\n if (application?.view?.toBlob) {\n application.view.toBlob(\n (blob) => {\n blob ? resolve(blob) : reject('EXTRACT_FAILED');\n },\n 'image/jpeg',\n DEFAULT_QUALITY,\n );\n } else {\n reject('EXTRACT_FAILED');\n }\n });\n}\n/**\n * This function transform the stage into a data URL encoded image\n *\n * @param application the PIXI.Application context\n * @returns the generated image as Data URL or undefined if failed\n */\nexport function saveAsDataURL(\n application: PIXI.Application,\n): string | undefined {\n return application.view.toDataURL?.();\n}\n\n/**\n * Calculates the scale percentage for a PIXI.Sprite or the application view based on the parent container's dimensions.\n * @param application - The PIXI.Application instance.\n * @param sprite - The PIXI.Sprite instance (optional).\n * @returns The scale percentage.\n */\nexport function getApplicationScale(application: PIXI.Application) {\n if (application.view.getBoundingClientRect) {\n return (\n application.view.getBoundingClientRect()!.width / application.view.width\n );\n }\n return 1;\n}\n\nexport function toBlob(application: PIXI.Application) {\n return new Promise<Blob>((resolve, reject) => {\n application.view.toBlob?.(\n (blob) => {\n if (blob) {\n resolve(blob);\n } else {\n reject('EXTRACT_FAIL');\n }\n },\n 'image/png',\n 1,\n );\n });\n}\n\nexport function createImageSettings({\n application,\n sprite,\n}: {\n sprite: PIXI.Sprite;\n application: PIXI.Application;\n}) {\n return {\n sprite: {\n rotation: sprite.rotation,\n size: { width: sprite.width, height: sprite.height },\n position: { x: sprite.position.x, y: sprite.position.y },\n scale: { x: sprite.scale.x, y: sprite.scale.y },\n anchor: { x: sprite.anchor.x, y: sprite.anchor.y },\n },\n stage: {\n size: {\n width: application.stage.width,\n height: application.stage.height,\n },\n scale: { x: application.stage.scale.x, y: application.stage.scale.y },\n },\n };\n}\n\nexport function trimStage(application: PIXI.Application, sprite: PIXI.Sprite) {\n application.renderer.resize(sprite.width, sprite.height);\n}\nexport function resizeStage({\n application,\n sprite,\n newHeight,\n newWidth,\n}: {\n newHeight: number;\n newWidth: number;\n application: PIXI.Application;\n sprite: PIXI.Sprite;\n}) {\n // Anchor the sprite to the middle (for rotation)\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n // Position the sprite to the middle\n sprite.position = new PIXI.Point(newWidth / 2, newHeight / 2);\n // Resize the stage\n application.stage.height = newHeight;\n application.stage.width = newWidth;\n application.renderer.resize(newWidth, newHeight);\n}\n"],"names":["MIN_HEIGHT","MIN_WIDTH","MODAL_VERTICAL_PADDING","MODAL_HORIZONTAL_PADDING","DEFAULT_QUALITY","DEFAULT_SPRITE_NAME","updateImageFromBlob","application","spriteName","imgDatasource","settings","imageUrl","URL","createObjectURL","image","Image","src","Promise","resolve","onload","updateImage","newSprite","stage","getChildByName","undefined","previous","removeFromParent","texture","HTMLImageElement","PIXI","Texture","from","Sprite","fromURL","sprite","interactive","name","anchor","position","scale","size","spriteSize","rotation","stageSize","isRotated","Math","PI","x","y","width","height","renderer","resize","addChild","autoResize","parent","view","parentNode","maxMobileWidth","window","innerWidth","parentWidth","max","offsetWidth","newSize","constraintSize","min","innerHeight","newHeight","newWidth","style","constraints","ratio","constraintHeight","constraintWidth","saveAsBlob","reject","toBlob","blob","saveAsDataURL","toDataURL","getApplicationScale","getBoundingClientRect","createImageSettings","resizeStage","Point"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