@edifice.io/react 2.0.0-develop-rc.4 → 2.0.0-develop-rc.10
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 +17 -88
- package/dist/audience.js +15 -14
- package/dist/audience.js.map +1 -0
- package/dist/components/ActionBar/ActionBar.js +8 -7
- package/dist/components/ActionBar/ActionBar.js.map +1 -0
- package/dist/components/Alert/Alert.js +62 -61
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/AppHeader/AppHeader.js +19 -18
- package/dist/components/AppHeader/AppHeader.js.map +1 -0
- package/dist/components/AppIcon/AppIcon.d.ts +1 -1
- package/dist/components/AppIcon/AppIcon.js +45 -44
- package/dist/components/AppIcon/AppIcon.js.map +1 -0
- package/dist/components/Attachment/Attachment.js +14 -13
- package/dist/components/Attachment/Attachment.js.map +1 -0
- package/dist/components/Avatar/Avatar.js +28 -27
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Badge/Badge.js +21 -20
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +24 -23
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.js +12 -11
- package/dist/components/Breadcrumb/BreadcrumbItem.js.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbList.js +11 -10
- package/dist/components/Breadcrumb/BreadcrumbList.js.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbNav.d.ts +1 -1
- package/dist/components/Breadcrumb/BreadcrumbNav.js +16 -15
- package/dist/components/Breadcrumb/BreadcrumbNav.js.map +1 -0
- package/dist/components/Button/Button.js +33 -32
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/IconButton.js +16 -15
- package/dist/components/Button/IconButton.js.map +1 -0
- package/dist/components/Button/SearchButton.js +16 -15
- package/dist/components/Button/SearchButton.js.map +1 -0
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js +48 -47
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/CardBody.js +14 -13
- package/dist/components/Card/CardBody.js.map +1 -0
- package/dist/components/Card/CardContext.d.ts +1 -1
- package/dist/components/Card/CardContext.js +8 -7
- package/dist/components/Card/CardContext.js.map +1 -0
- package/dist/components/Card/CardFooter.js +6 -5
- package/dist/components/Card/CardFooter.js.map +1 -0
- package/dist/components/Card/CardHeader.js +15 -14
- package/dist/components/Card/CardHeader.js.map +1 -0
- package/dist/components/Card/CardImage.js +14 -13
- package/dist/components/Card/CardImage.js.map +1 -0
- package/dist/components/Card/CardText.js +9 -8
- package/dist/components/Card/CardText.js.map +1 -0
- package/dist/components/Card/CardTitle.js +9 -8
- package/dist/components/Card/CardTitle.js.map +1 -0
- package/dist/components/Card/CardUser.js +9 -8
- package/dist/components/Card/CardUser.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +31 -30
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/ColorPicker/ColorPalette.js +5 -4
- package/dist/components/ColorPicker/ColorPalette.js.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.js +29 -28
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/ColorPicker/ColorPickerItem.js +12 -11
- package/dist/components/ColorPicker/ColorPickerItem.js.map +1 -0
- package/dist/components/Combobox/Combobox.js +36 -35
- package/dist/components/Combobox/Combobox.js.map +1 -0
- package/dist/components/Combobox/ComboboxTrigger.js +22 -21
- package/dist/components/Combobox/ComboboxTrigger.js.map +1 -0
- package/dist/components/Dropdown/Dropdown.js +56 -55
- package/dist/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/components/Dropdown/DropdownCheckboxItem.js +27 -26
- package/dist/components/Dropdown/DropdownCheckboxItem.js.map +1 -0
- package/dist/components/Dropdown/DropdownContext.js +8 -7
- package/dist/components/Dropdown/DropdownContext.js.map +1 -0
- package/dist/components/Dropdown/DropdownItem.js +28 -27
- package/dist/components/Dropdown/DropdownItem.js.map +1 -0
- package/dist/components/Dropdown/DropdownMenu.js +22 -21
- package/dist/components/Dropdown/DropdownMenu.js.map +1 -0
- package/dist/components/Dropdown/DropdownMenuGroup.js +10 -9
- package/dist/components/Dropdown/DropdownMenuGroup.js.map +1 -0
- package/dist/components/Dropdown/DropdownRadioItem.js +27 -26
- package/dist/components/Dropdown/DropdownRadioItem.js.map +1 -0
- package/dist/components/Dropdown/DropdownSeparator.js +4 -3
- package/dist/components/Dropdown/DropdownSeparator.js.map +1 -0
- package/dist/components/Dropdown/DropdownTrigger.js +29 -28
- package/dist/components/Dropdown/DropdownTrigger.js.map +1 -0
- package/dist/components/Dropzone/Dropzone.js +48 -47
- package/dist/components/Dropzone/Dropzone.js.map +1 -0
- package/dist/components/Dropzone/DropzoneContext.js +9 -8
- package/dist/components/Dropzone/DropzoneContext.js.map +1 -0
- package/dist/components/Dropzone/DropzoneDrag.js +8 -7
- package/dist/components/Dropzone/DropzoneDrag.js.map +1 -0
- package/dist/components/Dropzone/DropzoneFile.js +26 -25
- package/dist/components/Dropzone/DropzoneFile.js.map +1 -0
- package/dist/components/Dropzone/DropzoneImport.js +21 -20
- package/dist/components/Dropzone/DropzoneImport.js.map +1 -0
- package/dist/components/EmptyScreen/EmptyScreen.js +17 -16
- package/dist/components/EmptyScreen/EmptyScreen.js.map +1 -0
- package/dist/components/FileCard/FileCard.d.ts +1 -1
- package/dist/components/FileCard/FileCard.js +38 -37
- package/dist/components/FileCard/FileCard.js.map +1 -0
- package/dist/components/FileCard/FileIcon.d.ts +1 -1
- package/dist/components/FileCard/FileIcon.js +12 -11
- package/dist/components/FileCard/FileIcon.js.map +1 -0
- package/dist/components/Form/FormContext.js +8 -7
- package/dist/components/Form/FormContext.js.map +1 -0
- package/dist/components/Form/FormControl.js +31 -30
- package/dist/components/Form/FormControl.js.map +1 -0
- package/dist/components/Form/FormText.js +13 -12
- package/dist/components/Form/FormText.js.map +1 -0
- package/dist/components/Grid/Grid.js +28 -27
- package/dist/components/Grid/Grid.js.map +1 -0
- package/dist/components/Heading/Heading.js +15 -14
- package/dist/components/Heading/Heading.js.map +1 -0
- package/dist/components/Icon/Icon.js +9 -8
- package/dist/components/Icon/Icon.js.map +1 -0
- package/dist/components/Image/Image.js +40 -39
- package/dist/components/Image/Image.js.map +1 -0
- package/dist/components/ImagePicker/ImagePicker.d.ts +1 -1
- package/dist/components/ImagePicker/ImagePicker.js +52 -51
- package/dist/components/ImagePicker/ImagePicker.js.map +1 -0
- package/dist/components/Input/Input.js +29 -28
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Label/Label.js +31 -30
- package/dist/components/Label/Label.js.map +1 -0
- package/dist/components/Loading/Loading.js +24 -23
- package/dist/components/Loading/Loading.js.map +1 -0
- package/dist/components/LoadingScreen/LoadingScreen.js +21 -20
- package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -0
- package/dist/components/Logo/Logo.js +13 -12
- package/dist/components/Logo/Logo.js.map +1 -0
- package/dist/components/Menu/Menu.js +40 -39
- package/dist/components/Menu/Menu.js.map +1 -0
- package/dist/components/Menu/MenuButton.js +18 -17
- package/dist/components/Menu/MenuButton.js.map +1 -0
- package/dist/components/Menu/MenuContext.js +9 -8
- package/dist/components/Menu/MenuContext.js.map +1 -0
- package/dist/components/Menu/MenuItem.js +15 -14
- package/dist/components/Menu/MenuItem.js.map +1 -0
- package/dist/components/Modal/Modal.js +50 -49
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/ModalBody.js +12 -11
- package/dist/components/Modal/ModalBody.js.map +1 -0
- package/dist/components/Modal/ModalContext.js +9 -8
- package/dist/components/Modal/ModalContext.js.map +1 -0
- package/dist/components/Modal/ModalFooter.js +4 -3
- package/dist/components/Modal/ModalFooter.js.map +1 -0
- package/dist/components/Modal/ModalHeader.js +23 -22
- package/dist/components/Modal/ModalHeader.js.map +1 -0
- package/dist/components/Modal/ModalSubtitle.js +4 -3
- package/dist/components/Modal/ModalSubtitle.js.map +1 -0
- package/dist/components/Popover/Popover.js +34 -33
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Radio/Radio.js +27 -26
- package/dist/components/Radio/Radio.js.map +1 -0
- package/dist/components/SearchBar/SearchBar.js +30 -29
- package/dist/components/SearchBar/SearchBar.js.map +1 -0
- package/dist/components/Select/Select.js +32 -31
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Select/SelectTrigger.js +5 -4
- package/dist/components/Select/SelectTrigger.js.map +1 -0
- package/dist/components/Table/TableExplorer.js +8 -7
- package/dist/components/Table/TableExplorer.js.map +1 -0
- package/dist/components/Tabs/Tabs.js +59 -58
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/TabsContext.js +9 -8
- package/dist/components/Tabs/TabsContext.js.map +1 -0
- package/dist/components/Tabs/TabsItem.js +21 -20
- package/dist/components/Tabs/TabsItem.js.map +1 -0
- package/dist/components/Tabs/TabsList.js +19 -18
- package/dist/components/Tabs/TabsList.js.map +1 -0
- package/dist/components/Tabs/TabsPanel.js +10 -9
- package/dist/components/Tabs/TabsPanel.js.map +1 -0
- package/dist/components/TextArea/TextArea.js +32 -31
- package/dist/components/TextArea/TextArea.js.map +1 -0
- package/dist/components/TextArea/TextareaCounter.js +7 -6
- package/dist/components/TextArea/TextareaCounter.js.map +1 -0
- package/dist/components/Toolbar/Toolbar.js +61 -60
- package/dist/components/Toolbar/Toolbar.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +29 -28
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/TreeView/TreeItem.js +47 -46
- package/dist/components/TreeView/TreeItem.js.map +1 -0
- package/dist/components/TreeView/TreeView.js +34 -33
- package/dist/components/TreeView/TreeView.js.map +1 -0
- package/dist/components/TreeView/hooks/useTreeItemEvents.js +19 -18
- package/dist/components/TreeView/hooks/useTreeItemEvents.js.map +1 -0
- package/dist/components/UploadCard/UploadCard.js +53 -52
- package/dist/components/UploadCard/UploadCard.js.map +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +8 -7
- package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
- package/dist/core/OdeClientProvider/OdeClientProvider.d.ts +1 -1
- package/dist/core/OdeClientProvider/OdeClientProvider.js +45 -44
- package/dist/core/OdeClientProvider/OdeClientProvider.js.map +1 -0
- package/dist/core/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/core/ThemeProvider/ThemeProvider.js +36 -35
- package/dist/core/ThemeProvider/ThemeProvider.js.map +1 -0
- package/dist/core/useAvatar/useAvatar.d.ts +1 -1
- package/dist/core/useAvatar/useAvatar.js +22 -21
- package/dist/core/useAvatar/useAvatar.js.map +1 -0
- package/dist/core/useBookmark/useBookmark.d.ts +1 -1
- package/dist/core/useBookmark/useBookmark.js +10 -9
- package/dist/core/useBookmark/useBookmark.js.map +1 -0
- package/dist/core/useConf/useConf.d.ts +1 -1
- package/dist/core/useConf/useConf.js +8 -7
- package/dist/core/useConf/useConf.js.map +1 -0
- package/dist/core/useConversation/useConversation.js +30 -29
- package/dist/core/useConversation/useConversation.js.map +1 -0
- package/dist/core/useCookiesConsent/useCookiesConsent.js +17 -16
- package/dist/core/useCookiesConsent/useCookiesConsent.js.map +1 -0
- package/dist/core/useDate/useDate.js +36 -35
- package/dist/core/useDate/useDate.js.map +1 -0
- package/dist/core/useHasWorkflow/useHasWorkflow.js +16 -15
- package/dist/core/useHasWorkflow/useHasWorkflow.js.map +1 -0
- package/dist/core/useHeader/useHeader.d.ts +1 -1
- package/dist/core/useHeader/useHeader.js +42 -41
- package/dist/core/useHeader/useHeader.js.map +1 -0
- package/dist/core/useHttpErrorToast/useHttpErrorToast.js +18 -17
- package/dist/core/useHttpErrorToast/useHttpErrorToast.js.map +1 -0
- package/dist/core/useIsAdml/useIsAdml.js +12 -11
- package/dist/core/useIsAdml/useIsAdml.js.map +1 -0
- package/dist/core/useLibraryUrl/useLibraryUrl.js +17 -16
- package/dist/core/useLibraryUrl/useLibraryUrl.js.map +1 -0
- package/dist/core/useMediaLibrary/useMediaLibrary.d.ts +1 -1
- package/dist/core/useMediaLibrary/useMediaLibrary.js +33 -32
- package/dist/core/useMediaLibrary/useMediaLibrary.js.map +1 -0
- package/dist/core/useOdeIcons/useOdeIcons.d.ts +1 -1
- package/dist/core/useOdeIcons/useOdeIcons.js +38 -37
- package/dist/core/useOdeIcons/useOdeIcons.js.map +1 -0
- package/dist/core/usePaths/usePaths.js +3 -2
- package/dist/core/usePaths/usePaths.js.map +1 -0
- package/dist/core/usePreferences/usePreferences.js +6 -5
- package/dist/core/usePreferences/usePreferences.js.map +1 -0
- package/dist/core/useResource/useResource.d.ts +1 -1
- package/dist/core/useResource/useResource.js +15 -14
- package/dist/core/useResource/useResource.js.map +1 -0
- package/dist/core/useResourceSearch/useResourceSearch.d.ts +1 -1
- package/dist/core/useResourceSearch/useResourceSearch.js +23 -22
- package/dist/core/useResourceSearch/useResourceSearch.js.map +1 -0
- package/dist/core/useSession/useSession.js +7 -6
- package/dist/core/useSession/useSession.js.map +1 -0
- package/dist/core/useTrashedResource/useTrashedResource.js +19 -18
- package/dist/core/useTrashedResource/useTrashedResource.js.map +1 -0
- package/dist/core/useUpload/useUpload.d.ts +1 -1
- package/dist/core/useUpload/useUpload.js +69 -68
- package/dist/core/useUpload/useUpload.js.map +1 -0
- package/dist/core/useUploadFiles/useUploadFiles.d.ts +1 -1
- package/dist/core/useUploadFiles/useUploadFiles.js +83 -82
- package/dist/core/useUploadFiles/useUploadFiles.js.map +1 -0
- package/dist/core/useUser/useUser.d.ts +1 -1
- package/dist/core/useUser/useUser.js +16 -15
- package/dist/core/useUser/useUser.js.map +1 -0
- package/dist/core/useWorkspaceFile/useWorkspaceFile.d.ts +1 -1
- package/dist/core/useWorkspaceFile/useWorkspaceFile.js +32 -31
- package/dist/core/useWorkspaceFile/useWorkspaceFile.js.map +1 -0
- package/dist/core/useWorkspaceSearch/useWorkspaceSearch.d.ts +1 -1
- package/dist/core/useWorkspaceSearch/useWorkspaceSearch.js +42 -41
- package/dist/core/useWorkspaceSearch/useWorkspaceSearch.js.map +1 -0
- package/dist/core/useXitiTrackPageLoad/useXitiTrackPageLoad.js +18 -17
- package/dist/core/useXitiTrackPageLoad/useXitiTrackPageLoad.js.map +1 -0
- package/dist/core/useZendeskGuide/useZendeskGuide.js +47 -46
- package/dist/core/useZendeskGuide/useZendeskGuide.js.map +1 -0
- package/dist/editor.js +57 -56
- package/dist/editor.js.map +1 -0
- package/dist/hooks/useBrowserInfo/useBrowserInfo.js +12 -11
- package/dist/hooks/useBrowserInfo/useBrowserInfo.js.map +1 -0
- package/dist/hooks/useClickOutside/useClickOutside.js +19 -18
- package/dist/hooks/useClickOutside/useClickOutside.js.map +1 -0
- package/dist/hooks/useDebounce/useDebounce.js +11 -10
- package/dist/hooks/useDebounce/useDebounce.js.map +1 -0
- package/dist/hooks/useDropdown/useDropdown.d.ts +1 -1
- package/dist/hooks/useDropdown/useDropdown.js +97 -96
- package/dist/hooks/useDropdown/useDropdown.js.map +1 -0
- package/dist/hooks/useDropzone/useDropzone.js +54 -53
- package/dist/hooks/useDropzone/useDropzone.js.map +1 -0
- package/dist/hooks/useHover/useHover.js +15 -14
- package/dist/hooks/useHover/useHover.js.map +1 -0
- package/dist/hooks/useImage/useImage.js +14 -13
- package/dist/hooks/useImage/useImage.js.map +1 -0
- package/dist/hooks/useImageResizer/useImageResizer.js +32 -31
- package/dist/hooks/useImageResizer/useImageResizer.js.map +1 -0
- package/dist/hooks/useKeyPress/useKeyPress.js +11 -10
- package/dist/hooks/useKeyPress/useKeyPress.js.map +1 -0
- package/dist/hooks/useScrollToTop/useScrollToTop.js +5 -4
- package/dist/hooks/useScrollToTop/useScrollToTop.js.map +1 -0
- package/dist/hooks/useThumbnail/useThumbnail.js +22 -21
- package/dist/hooks/useThumbnail/useThumbnail.js.map +1 -0
- package/dist/hooks/useTitle/useTitle.js +8 -7
- package/dist/hooks/useTitle/useTitle.js.map +1 -0
- package/dist/hooks/useToast/useToast.js +26 -25
- package/dist/hooks/useToast/useToast.js.map +1 -0
- package/dist/hooks/useToggle/useToggle.js +7 -6
- package/dist/hooks/useToggle/useToggle.js.map +1 -0
- package/dist/hooks/useTrapFocus/useTrapFocus.js +12 -11
- package/dist/hooks/useTrapFocus/useTrapFocus.js.map +1 -0
- package/dist/index.js +226 -225
- package/dist/index.js.map +1 -0
- package/dist/modals.js +15 -14
- package/dist/modals.js.map +1 -0
- package/dist/modules/audience/ReactionChoice.d.ts +1 -1
- package/dist/modules/audience/ReactionChoice.js +25 -24
- package/dist/modules/audience/ReactionChoice.js.map +1 -0
- package/dist/modules/audience/ReactionModal.Card.d.ts +1 -1
- package/dist/modules/audience/ReactionModal.Card.js +26 -25
- package/dist/modules/audience/ReactionModal.Card.js.map +1 -0
- package/dist/modules/audience/ReactionModal.d.ts +1 -1
- package/dist/modules/audience/ReactionModal.js +59 -59
- package/dist/modules/audience/ReactionModal.js.map +1 -0
- package/dist/modules/audience/ReactionSummary.d.ts +1 -1
- package/dist/modules/audience/ReactionSummary.js +20 -19
- package/dist/modules/audience/ReactionSummary.js.map +1 -0
- package/dist/modules/audience/ViewsByProfileCard.d.ts +1 -1
- package/dist/modules/audience/ViewsByProfileCard.js +23 -22
- package/dist/modules/audience/ViewsByProfileCard.js.map +1 -0
- package/dist/modules/audience/ViewsCounter.js +15 -14
- package/dist/modules/audience/ViewsCounter.js.map +1 -0
- package/dist/modules/audience/ViewsModal.d.ts +1 -1
- package/dist/modules/audience/ViewsModal.js +33 -32
- package/dist/modules/audience/ViewsModal.js.map +1 -0
- package/dist/modules/audience/hooks/useReactionIcons.d.ts +1 -1
- package/dist/modules/audience/hooks/useReactionIcons.js +14 -13
- package/dist/modules/audience/hooks/useReactionIcons.js.map +1 -0
- package/dist/modules/audience/hooks/useReactions.d.ts +3 -3
- package/dist/modules/audience/hooks/useReactions.js +25 -24
- package/dist/modules/audience/hooks/useReactions.js.map +1 -0
- package/dist/modules/audience/hooks/useViews.d.ts +2 -2
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js +60 -59
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js.map +1 -0
- package/dist/modules/editor/components/Editor/Editor.d.ts +1 -1
- package/dist/modules/editor/components/Editor/Editor.js +71 -70
- package/dist/modules/editor/components/Editor/Editor.js.map +1 -0
- package/dist/modules/editor/components/Editor/MathsModal.d.ts +0 -1
- package/dist/modules/editor/components/Editor/MathsModal.js +38 -37
- package/dist/modules/editor/components/Editor/MathsModal.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.js +15 -14
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.js +38 -37
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js +34 -33
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.js +13 -12
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js +37 -36
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.js +36 -35
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +31 -30
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js.map +1 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +96 -95
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js.map +1 -0
- package/dist/modules/editor/components/NodeView/AttachmentNodeView.js +7 -6
- package/dist/modules/editor/components/NodeView/AttachmentNodeView.js.map +1 -0
- package/dist/modules/editor/components/NodeView/AudioNodeView.js +7 -6
- package/dist/modules/editor/components/NodeView/AudioNodeView.js.map +1 -0
- package/dist/modules/editor/components/NodeView/ImageNodeView.js +7 -6
- package/dist/modules/editor/components/NodeView/ImageNodeView.js.map +1 -0
- package/dist/modules/editor/components/NodeView/LinkerNodeView.js +7 -6
- package/dist/modules/editor/components/NodeView/LinkerNodeView.js.map +1 -0
- package/dist/modules/editor/components/NodeView/VideoNodeView.js +7 -6
- package/dist/modules/editor/components/NodeView/VideoNodeView.js.map +1 -0
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +25 -24
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js.map +1 -0
- package/dist/modules/editor/components/Renderer/AudioRenderer.js +8 -7
- package/dist/modules/editor/components/Renderer/AudioRenderer.js.map +1 -0
- package/dist/modules/editor/components/Renderer/LinkerRenderer.js +27 -26
- package/dist/modules/editor/components/Renderer/LinkerRenderer.js.map +1 -0
- package/dist/modules/editor/components/Renderer/MediaRenderer.js +38 -37
- package/dist/modules/editor/components/Renderer/MediaRenderer.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js +3 -2
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/LinkToolbar.d.ts +1 -1
- package/dist/modules/editor/components/Toolbar/LinkToolbar.js +33 -32
- package/dist/modules/editor/components/Toolbar/LinkToolbar.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js +22 -21
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js +31 -30
- package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js +21 -20
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js.map +1 -0
- package/dist/modules/editor/components/Toolbar/TableToolbar.d.ts +1 -1
- package/dist/modules/editor/components/Toolbar/TableToolbar.js +42 -41
- package/dist/modules/editor/components/Toolbar/TableToolbar.js.map +1 -0
- package/dist/modules/editor/hooks/useActionOptions.js +48 -47
- package/dist/modules/editor/hooks/useActionOptions.js.map +1 -0
- package/dist/modules/editor/hooks/useCommentEditor.js +28 -27
- package/dist/modules/editor/hooks/useCommentEditor.js.map +1 -0
- package/dist/modules/editor/hooks/useEditorContext.js +9 -8
- package/dist/modules/editor/hooks/useEditorContext.js.map +1 -0
- package/dist/modules/editor/hooks/useImageModal.d.ts +1 -1
- package/dist/modules/editor/hooks/useImageModal.js +33 -32
- package/dist/modules/editor/hooks/useImageModal.js.map +1 -0
- package/dist/modules/editor/hooks/useImageSelection.js +32 -31
- package/dist/modules/editor/hooks/useImageSelection.js.map +1 -0
- package/dist/modules/editor/hooks/useLinkToolbar.js +25 -24
- package/dist/modules/editor/hooks/useLinkToolbar.js.map +1 -0
- package/dist/modules/editor/hooks/useMathsModal.js +10 -9
- package/dist/modules/editor/hooks/useMathsModal.js.map +1 -0
- package/dist/modules/editor/hooks/useMathsStyles.js +14 -13
- package/dist/modules/editor/hooks/useMathsStyles.js.map +1 -0
- package/dist/modules/editor/hooks/useMediaLibraryEditor.d.ts +1 -1
- package/dist/modules/editor/hooks/useMediaLibraryEditor.js +97 -96
- package/dist/modules/editor/hooks/useMediaLibraryEditor.js.map +1 -0
- package/dist/modules/editor/hooks/useResizeMedia.js +32 -31
- package/dist/modules/editor/hooks/useResizeMedia.js.map +1 -0
- package/dist/modules/editor/hooks/useSpeechRecognition.js +13 -12
- package/dist/modules/editor/hooks/useSpeechRecognition.js.map +1 -0
- package/dist/modules/editor/hooks/useSpeechSynthetisis.js +14 -13
- package/dist/modules/editor/hooks/useSpeechSynthetisis.js.map +1 -0
- package/dist/modules/editor/hooks/useTipTapEditor.js +58 -57
- package/dist/modules/editor/hooks/useTipTapEditor.js.map +1 -0
- package/dist/modules/editor/utils/has-extension.js +3 -2
- package/dist/modules/editor/utils/has-extension.js.map +1 -0
- package/dist/modules/editor/utils/has-mark.js +3 -2
- package/dist/modules/editor/utils/has-mark.js.map +1 -0
- package/dist/modules/editor/utils/has-text-style.js +4 -3
- package/dist/modules/editor/utils/has-text-style.js.map +1 -0
- package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +0 -1
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +50 -49
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js.map +1 -0
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +19 -18
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js.map +1 -0
- package/dist/modules/modals/PublishModal/PublishModal.d.ts +1 -1
- package/dist/modules/modals/PublishModal/PublishModal.js +98 -97
- package/dist/modules/modals/PublishModal/PublishModal.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/ActivitiesDropdown.js +20 -19
- package/dist/modules/modals/PublishModal/components/ActivitiesDropdown.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/AgeSelect.js +15 -14
- package/dist/modules/modals/PublishModal/components/AgeSelect.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/LangSelect.js +12 -11
- package/dist/modules/modals/PublishModal/components/LangSelect.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/PublishModalFooter.js +17 -16
- package/dist/modules/modals/PublishModal/components/PublishModalFooter.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/SubjectsDropdown.js +20 -19
- package/dist/modules/modals/PublishModal/components/SubjectsDropdown.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/ToastError.js +18 -17
- package/dist/modules/modals/PublishModal/components/ToastError.js.map +1 -0
- package/dist/modules/modals/PublishModal/components/ToastSuccess.d.ts +1 -1
- package/dist/modules/modals/PublishModal/components/ToastSuccess.js +13 -12
- package/dist/modules/modals/PublishModal/components/ToastSuccess.js.map +1 -0
- package/dist/modules/modals/PublishModal/constants/ageOptions.js +3 -2
- package/dist/modules/modals/PublishModal/constants/ageOptions.js.map +1 -0
- package/dist/modules/modals/PublishModal/hooks/useActivitiesOptions.js +5 -4
- package/dist/modules/modals/PublishModal/hooks/useActivitiesOptions.js.map +1 -0
- package/dist/modules/modals/PublishModal/hooks/useLanguageOptions.js +17 -16
- package/dist/modules/modals/PublishModal/hooks/useLanguageOptions.js.map +1 -0
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.d.ts +1 -1
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.js +80 -79
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.js.map +1 -0
- package/dist/modules/modals/PublishModal/hooks/useSubjectsOptions.js +42 -41
- package/dist/modules/modals/PublishModal/hooks/useSubjectsOptions.js.map +1 -0
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/ResourceModal.js +116 -115
- package/dist/modules/modals/ResourceModal/ResourceModal.js.map +1 -0
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.js +48 -47
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.js.map +1 -0
- package/dist/modules/modals/ResourceModal/hooks/useSlug.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/hooks/useSlug.js +33 -32
- package/dist/modules/modals/ResourceModal/hooks/useSlug.js.map +1 -0
- package/dist/modules/modals/ResourceModal/hooks/useThumb.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/hooks/useThumb.js +13 -12
- package/dist/modules/modals/ResourceModal/hooks/useThumb.js.map +1 -0
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.js +11 -10
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.js.map +1 -0
- package/dist/modules/modals/ShareModal/ShareBookmarkLine.d.ts +1 -1
- package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -1
- package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
- package/dist/modules/modals/ShareModal/apps/ShareBlog.js +34 -33
- package/dist/modules/modals/ShareModal/apps/ShareBlog.js.map +1 -0
- package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.js +13 -12
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.js.map +1 -0
- package/dist/modules/modals/ShareModal/utils/hasRight.d.ts +1 -1
- package/dist/modules/modals/ShareModal/utils/showShareRightLine.d.ts +1 -1
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.d.ts +1 -1
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js +44 -43
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js.map +1 -0
- package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js +19 -18
- package/dist/modules/multimedia/AudioRecorder/AudioRecorderTimer.js.map +1 -0
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.d.ts +1 -1
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js +158 -157
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.js.map +1 -0
- package/dist/modules/multimedia/Embed/Embed.js +23 -22
- package/dist/modules/multimedia/Embed/Embed.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js +80 -79
- package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/components/ImageEditorToolbar.js +38 -37
- package/dist/modules/multimedia/ImageEditor/components/ImageEditorToolbar.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/blur.js +50 -49
- package/dist/modules/multimedia/ImageEditor/effects/blur.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/crop.js +100 -99
- package/dist/modules/multimedia/ImageEditor/effects/crop.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/misc.js +108 -107
- package/dist/modules/multimedia/ImageEditor/effects/misc.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/resize.js +97 -96
- package/dist/modules/multimedia/ImageEditor/effects/resize.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/effects/rotate.js +26 -25
- package/dist/modules/multimedia/ImageEditor/effects/rotate.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js +56 -57
- package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.js +57 -56
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.js +29 -28
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.js.map +1 -0
- package/dist/modules/multimedia/ImageEditor/utils/aggregate.js +10 -9
- package/dist/modules/multimedia/ImageEditor/utils/aggregate.js.map +1 -0
- package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.d.ts +1 -1
- package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.js +34 -33
- package/dist/modules/multimedia/ImagePickerWorkspace/ImagePickerWorkspace.js.map +1 -0
- package/dist/modules/multimedia/Linker/ExternalLinker.js +37 -36
- package/dist/modules/multimedia/Linker/ExternalLinker.js.map +1 -0
- package/dist/modules/multimedia/Linker/InternalLinker.d.ts +1 -1
- package/dist/modules/multimedia/Linker/InternalLinker.js +89 -88
- package/dist/modules/multimedia/Linker/InternalLinker.js.map +1 -0
- package/dist/modules/multimedia/LinkerCard/LinkerCard.d.ts +1 -1
- package/dist/modules/multimedia/LinkerCard/LinkerCard.js +32 -31
- package/dist/modules/multimedia/LinkerCard/LinkerCard.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +1 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +119 -118
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.d.ts +2 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.js +9 -8
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Audio.js +16 -15
- package/dist/modules/multimedia/MediaLibrary/innertabs/Audio.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/ExternalLink.js +13 -12
- package/dist/modules/multimedia/MediaLibrary/innertabs/ExternalLink.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Iframe.js +10 -9
- package/dist/modules/multimedia/MediaLibrary/innertabs/Iframe.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.d.ts +1 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.js +29 -28
- package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +23 -22
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Video.js +18 -17
- package/dist/modules/multimedia/MediaLibrary/innertabs/Video.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/VideoEmbedder.js +10 -9
- package/dist/modules/multimedia/MediaLibrary/innertabs/VideoEmbedder.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +17 -16
- package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js.map +1 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +19 -18
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.js.map +1 -0
- package/dist/modules/multimedia/UploadFiles/UploadFiles.d.ts +1 -1
- package/dist/modules/multimedia/UploadFiles/UploadFiles.js +42 -41
- package/dist/modules/multimedia/UploadFiles/UploadFiles.js.map +1 -0
- package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js +60 -59
- package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js.map +1 -0
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.d.ts +1 -1
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js +154 -153
- package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js.map +1 -0
- package/dist/modules/multimedia/Workspace/Workspace.d.ts +1 -1
- package/dist/modules/multimedia/Workspace/Workspace.js +113 -112
- package/dist/modules/multimedia/Workspace/Workspace.js.map +1 -0
- package/dist/multimedia.js +19 -18
- package/dist/multimedia.js.map +1 -0
- package/dist/portal/Header/Badge.js +6 -5
- package/dist/portal/Header/Badge.js.map +1 -0
- package/dist/portal/Header/Header.js +138 -137
- package/dist/portal/Header/Header.js.map +1 -0
- package/dist/portal/Header/NavItem.js +12 -11
- package/dist/portal/Header/NavItem.js.map +1 -0
- package/dist/portal/Header/NavLink.js +15 -14
- package/dist/portal/Header/NavLink.js.map +1 -0
- package/dist/portal/Header/Navbar.js +10 -9
- package/dist/portal/Header/Navbar.js.map +1 -0
- package/dist/portal/Header/NavbarNav.js +10 -9
- package/dist/portal/Header/NavbarNav.js.map +1 -0
- package/dist/portal/Header/WidgetApps.d.ts +1 -1
- package/dist/portal/Header/WidgetApps.js +17 -16
- package/dist/portal/Header/WidgetApps.js.map +1 -0
- package/dist/portal/Help/Help.d.ts +0 -1
- package/dist/portal/Help/Help.js +19 -18
- package/dist/portal/Help/Help.js.map +1 -0
- package/dist/portal/Help/hooks/useHelp.js +64 -63
- package/dist/portal/Help/hooks/useHelp.js.map +1 -0
- package/dist/portal/Layout/Layout.js +36 -35
- package/dist/portal/Layout/Layout.js.map +1 -0
- package/dist/portal/SearchEngine/SearchEngine.js +26 -25
- package/dist/portal/SearchEngine/SearchEngine.js.map +1 -0
- package/dist/utils/MockedDataProvider/MockedDataProvider.d.ts +1 -1
- package/dist/utils/MockedDataProvider/MockedDataProvider.js +22 -21
- package/dist/utils/MockedDataProvider/MockedDataProvider.js.map +1 -0
- package/dist/utils/StringUtils.js +9 -8
- package/dist/utils/StringUtils.js.map +1 -0
- package/dist/utils/addTimestampToUrl.js +5 -4
- package/dist/utils/addTimestampToUrl.js.map +1 -0
- package/dist/utils/blob.js +10 -9
- package/dist/utils/blob.js.map +1 -0
- package/dist/utils/checkUserRight.d.ts +1 -1
- package/dist/utils/checkUserRight.js +28 -27
- package/dist/utils/checkUserRight.js.map +1 -0
- package/dist/utils/fileSize.js +6 -5
- package/dist/utils/fileSize.js.map +1 -0
- package/dist/utils/findTreeNode.js +8 -7
- package/dist/utils/findTreeNode.js.map +1 -0
- package/dist/utils/isActionAvailable.d.ts +1 -1
- package/dist/utils/isActionAvailable.js +5 -4
- package/dist/utils/isActionAvailable.js.map +1 -0
- package/dist/utils/libraryMaps.js +3 -2
- package/dist/utils/libraryMaps.js.map +1 -0
- package/dist/utils/noop.js +3 -2
- package/dist/utils/noop.js.map +1 -0
- package/dist/utils/ref.js +9 -8
- package/dist/utils/ref.js.map +1 -0
- package/dist/utils/thumbnail.js +4 -3
- package/dist/utils/thumbnail.js.map +1 -0
- package/dist/utils/time.js +8 -7
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/treeview.d.ts +1 -1
- package/dist/utils/treeview.js +97 -96
- package/dist/utils/treeview.js.map +1 -0
- package/dist/utils/video.js +3 -2
- package/dist/utils/video.js.map +1 -0
- package/dist/widgets/BookmarkedApps/BookmarkedApps.d.ts +1 -1
- package/dist/widgets/BookmarkedApps/BookmarkedApps.js +7 -6
- package/dist/widgets/BookmarkedApps/BookmarkedApps.js.map +1 -0
- package/dist/widgets/Widget/Widget.js +19 -18
- package/dist/widgets/Widget/Widget.js.map +1 -0
- package/package.json +19 -28
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
import
|
|
4
|
-
import { useEditor, EditorContent } from "@tiptap/react";
|
|
5
|
-
import
|
|
6
|
-
import { createPortal } from "react-dom";
|
|
7
|
-
import { useTranslation } from "react-i18next";
|
|
8
|
-
import { Modal } from "../../../../components/Modal/Modal.js";
|
|
9
|
-
import { Button } from "../../../../components/Button/Button.js";
|
|
10
|
-
const
|
|
11
|
-
isOpen,
|
|
12
|
-
onSuccess,
|
|
13
|
-
onCancel
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useEffect as $ } from "react";
|
|
3
|
+
import x from "@tiptap-pro/extension-mathematics";
|
|
4
|
+
import { useEditor as E, EditorContent as C } from "@tiptap/react";
|
|
5
|
+
import M from "@tiptap/starter-kit";
|
|
6
|
+
import { createPortal as g } from "react-dom";
|
|
7
|
+
import { useTranslation as w } from "react-i18next";
|
|
8
|
+
import { Modal as a } from "../../../../components/Modal/Modal.js";
|
|
9
|
+
import { Button as c } from "../../../../components/Button/Button.js";
|
|
10
|
+
const j = ({
|
|
11
|
+
isOpen: h,
|
|
12
|
+
onSuccess: l,
|
|
13
|
+
onCancel: o
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
t
|
|
17
|
-
} =
|
|
18
|
-
extensions: [
|
|
15
|
+
const i = "\\frac{-b + \\sqrt{b^2 - 4ac}}{2a}", [m, d] = b(`$${i}$`), {
|
|
16
|
+
t: e
|
|
17
|
+
} = w(), t = E({
|
|
18
|
+
extensions: [M, x],
|
|
19
19
|
content: "",
|
|
20
20
|
editable: !1
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
const
|
|
26
|
-
const
|
|
22
|
+
$(() => {
|
|
23
|
+
t == null || t.commands.setContent(m), t == null || t.commands.enter();
|
|
24
|
+
}, [t, m]);
|
|
25
|
+
const f = (u) => {
|
|
26
|
+
const s = u.target.value.replaceAll(`
|
|
27
27
|
`, "$<br/>$");
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
28
|
+
s ? (t == null || t.commands.setContent(`$${s}$`), d(`$${s}$`)) : (t == null || t.commands.setContent(""), d("")), t == null || t.commands.enter();
|
|
29
|
+
}, p = () => {
|
|
30
|
+
o == null || o();
|
|
31
31
|
};
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
/* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ g(/* @__PURE__ */ n(a, { id: "MathsModal", isOpen: h, onModalClose: p, children: [
|
|
33
|
+
/* @__PURE__ */ r(a.Header, { onModalClose: p, children: e("tiptap.maths.title") }),
|
|
34
|
+
/* @__PURE__ */ n(a.Subtitle, { children: [
|
|
35
|
+
e("tiptap.maths.subtitle.1"),
|
|
36
|
+
/* @__PURE__ */ r("a", { href: e("https://fr.wikibooks.org/wiki/LaTeX/%C3%89crire_des_math%C3%A9matiques"), target: "_blank", rel: "noreferrer", children: e("tiptap.maths.subtitle.2") })
|
|
37
37
|
] }),
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ n(a.Body, { children: [
|
|
39
|
+
/* @__PURE__ */ r("textarea", { id: "formulaTextArea", name: "formula", rows: 4, cols: 50, onChange: f, placeholder: `Exemple : ${i}`, className: "border rounded-3 w-100 px-16 py-12" }),
|
|
40
|
+
/* @__PURE__ */ r(C, { editor: t, className: "pt-24 pb-0 text-center fs-1" })
|
|
41
41
|
] }),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ n(a.Footer, { children: [
|
|
43
|
+
/* @__PURE__ */ r(c, { color: "tertiary", onClick: o, type: "button", variant: "ghost", children: e("tiptap.maths.cancel") }),
|
|
44
|
+
/* @__PURE__ */ r(c, { color: "primary", onClick: () => l == null ? void 0 : l(m), type: "button", variant: "filled", children: e("tiptap.maths.add") })
|
|
45
45
|
] })
|
|
46
46
|
] }), document.getElementById("portal"));
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
j as default
|
|
50
50
|
};
|
|
51
|
+
//# sourceMappingURL=MathsModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MathsModal.js","sources":["../../../../../src/modules/editor/components/Editor/MathsModal.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport Mathematics from '@tiptap-pro/extension-mathematics';\nimport { Editor, EditorContent, useEditor } from '@tiptap/react';\nimport StarterKit from '@tiptap/starter-kit';\nimport { createPortal } from 'react-dom';\nimport { useTranslation } from 'react-i18next';\nimport { Button, Modal } from '../../../..';\n\ninterface ModalProps {\n isOpen: boolean;\n onSuccess?: (formulaEditor: string) => void;\n onCancel?: () => void;\n}\n\nconst MathsModal = ({ isOpen, onSuccess, onCancel }: ModalProps) => {\n const FORMULA_PLACEHOLDER = '\\\\frac{-b + \\\\sqrt{b^2 - 4ac}}{2a}';\n const [formulaEditor, setFormulaEditor] = useState<string>(\n `$${FORMULA_PLACEHOLDER}$`,\n );\n\n const { t } = useTranslation();\n\n const editor: Editor | null = useEditor({\n extensions: [StarterKit, Mathematics],\n content: ``,\n editable: false,\n });\n\n useEffect(() => {\n editor?.commands.setContent(formulaEditor);\n editor?.commands.enter();\n return;\n }, [editor, formulaEditor]);\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n const newFormulaTextarea: string = event.target.value;\n const newFormulaEditor = newFormulaTextarea.replaceAll('\\n', '$<br/>$');\n // replace editor content\n if (newFormulaEditor) {\n editor?.commands.setContent(`$${newFormulaEditor}$`);\n setFormulaEditor(`$${newFormulaEditor}$`);\n } else {\n editor?.commands.setContent('');\n setFormulaEditor('');\n }\n editor?.commands.enter();\n };\n\n const handleOnCancel = () => {\n onCancel?.();\n };\n\n return createPortal(\n <Modal id=\"MathsModal\" isOpen={isOpen} onModalClose={handleOnCancel}>\n <Modal.Header onModalClose={handleOnCancel}>\n {t('tiptap.maths.title')}\n </Modal.Header>\n <Modal.Subtitle>\n {t('tiptap.maths.subtitle.1')}\n <a\n href={t(\n 'https://fr.wikibooks.org/wiki/LaTeX/%C3%89crire_des_math%C3%A9matiques',\n )}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n {t('tiptap.maths.subtitle.2')}\n </a>\n </Modal.Subtitle>\n <Modal.Body>\n <textarea\n id=\"formulaTextArea\"\n name=\"formula\"\n rows={4}\n cols={50}\n onChange={handleChange}\n placeholder={`Exemple : ${FORMULA_PLACEHOLDER}`}\n className=\"border rounded-3 w-100 px-16 py-12\"\n ></textarea>\n <EditorContent\n editor={editor}\n className=\"pt-24 pb-0 text-center fs-1\"\n />\n </Modal.Body>\n <Modal.Footer>\n <Button\n color=\"tertiary\"\n onClick={onCancel}\n type=\"button\"\n variant=\"ghost\"\n >\n {t('tiptap.maths.cancel')}\n </Button>\n <Button\n color=\"primary\"\n onClick={() => onSuccess?.(formulaEditor)}\n type=\"button\"\n variant=\"filled\"\n >\n {t('tiptap.maths.add')}\n </Button>\n </Modal.Footer>\n </Modal>,\n document.getElementById('portal') as HTMLElement,\n );\n};\n\nexport default MathsModal;\n"],"names":["MathsModal","isOpen","onSuccess","onCancel","FORMULA_PLACEHOLDER","formulaEditor","setFormulaEditor","useState","t","useTranslation","editor","useEditor","extensions","StarterKit","Mathematics","content","editable","useEffect","commands","setContent","enter","handleChange","event","newFormulaEditor","target","value","replaceAll","handleOnCancel","jsxs","Modal","jsx","EditorContent","Button","document","getElementById"],"mappings":";;;;;;;;;AAeA,MAAMA,IAAaA,CAAC;AAAA,EAAEC,QAAAA;AAAAA,EAAQC,WAAAA;AAAAA,EAAWC,UAAAA;AAAqB,MAAM;AAClE,QAAMC,IAAsB,sCACtB,CAACC,GAAeC,CAAgB,IAAIC,EACxC,IAAIH,CAAmB,GACzB,GAEM;AAAA,IAAEI,GAAAA;AAAAA,MAAMC,EAAe,GAEvBC,IAAwBC,EAAU;AAAA,IACtCC,YAAY,CAACC,GAAYC,CAAW;AAAA,IACpCC,SAAS;AAAA,IACTC,UAAU;AAAA,EAAA,CACX;AAEDC,EAAAA,EAAU,MAAM;AACNC,IAAAA,KAAAA,QAAAA,EAAAA,SAASC,WAAWd,IAC5BK,KAAAA,QAAAA,EAAQQ,SAASE;AAAAA,EACjB,GACC,CAACV,GAAQL,CAAa,CAAC;AAEpBgB,QAAAA,IAAeA,CAACC,MAAkD;AAEtE,UAAMC,IAD6BD,EAAME,OAAOC,MACJC,WAAW;AAAA,GAAM,SAAS;AAEtE,IAAIH,KACFb,KAAAA,QAAAA,EAAQQ,SAASC,WAAW,IAAII,CAAgB,MAC/BjB,EAAA,IAAIiB,CAAgB,GAAG,MAEhCL,KAAAA,QAAAA,EAAAA,SAASC,WAAW,KAC5Bb,EAAiB,EAAE,IAErBI,KAAAA,QAAAA,EAAQQ,SAASE;AAAAA,EAAM,GAGnBO,IAAiBA,MAAM;AAChB,IAAAxB,KAAA,QAAAA;AAAA,EAAA;AAGb,2BACG,gBAAAyB,EAAAC,GAAA,EAAM,IAAG,cAAa,QAAA5B,GAAgB,cAAc0B,GACnD,UAAA;AAAA,IAAA,gBAAAG,EAACD,EAAM,QAAN,EAAa,cAAcF,GACzBnB,UAAAA,EAAE,oBAAoB,GACzB;AAAA,IACA,gBAAAoB,EAACC,EAAM,UAAN,EACErB,UAAAA;AAAAA,MAAAA,EAAE,yBAAyB;AAAA,MAC3B,gBAAAsB,EAAA,KAAA,EACC,MAAMtB,EACJ,wEACF,GACA,QAAO,UACP,KAAI,cAEHA,UAAEA,EAAA,yBAAyB,EAC9B,CAAA;AAAA,IAAA,GACF;AAAA,IACA,gBAAAoB,EAACC,EAAM,MAAN,EACC,UAAA;AAAA,MAAA,gBAAAC,EAAC,cACC,IAAG,mBACH,MAAK,WACL,MAAM,GACN,MAAM,IACN,UAAUT,GACV,aAAa,aAAajB,CAAmB,IAC7C,WAAU,sCACX;AAAA,MACA,gBAAA0B,EAAAC,GAAA,EACC,QAAArB,GACA,WAAU,8BAA6B,CAAA;AAAA,IAAA,GAE3C;AAAA,IACA,gBAAAkB,EAACC,EAAM,QAAN,EACC,UAAA;AAAA,MAAC,gBAAAC,EAAAE,GAAA,EACC,OAAM,YACN,SAAS7B,GACT,MAAK,UACL,SAAQ,SAEPK,UAAEA,EAAA,qBAAqB,EAC1B,CAAA;AAAA,MACC,gBAAAsB,EAAAE,GAAA,EACC,OAAM,WACN,SAAS,MAAM9B,KAAAA,gBAAAA,EAAYG,IAC3B,MAAK,UACL,SAAQ,UAEPG,UAAAA,EAAE,kBAAkB,GACvB;AAAA,IAAA,GACF;AAAA,EAAA,EAAA,CACF,GACAyB,SAASC,eAAe,QAAQ,CAClC;AACF;"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment as
|
|
3
|
-
import { Tooltip } from "../../../../components/Tooltip/Tooltip.js";
|
|
4
|
-
import { IconButton } from "../../../../components/Button/IconButton.js";
|
|
5
|
-
import { Dropdown } from "../../../../components/Dropdown/Dropdown.js";
|
|
6
|
-
const
|
|
7
|
-
triggerProps,
|
|
8
|
-
icon,
|
|
9
|
-
ariaLabel,
|
|
10
|
-
options
|
|
11
|
-
}) => /* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
1
|
+
import { jsxs as l, Fragment as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as p } from "react";
|
|
3
|
+
import { Tooltip as d } from "../../../../components/Tooltip/Tooltip.js";
|
|
4
|
+
import { IconButton as s } from "../../../../components/Button/IconButton.js";
|
|
5
|
+
import { Dropdown as t } from "../../../../components/Dropdown/Dropdown.js";
|
|
6
|
+
const x = ({
|
|
7
|
+
triggerProps: n,
|
|
8
|
+
icon: i,
|
|
9
|
+
ariaLabel: e,
|
|
10
|
+
options: m
|
|
11
|
+
}) => /* @__PURE__ */ l(c, { children: [
|
|
12
|
+
/* @__PURE__ */ r(d, { message: e, placement: "top", children: /* @__PURE__ */ r(s, { ...n, type: "button", variant: "ghost", color: "tertiary", icon: i, "aria-label": e }) }),
|
|
13
|
+
/* @__PURE__ */ r(t.Menu, { children: m.map((o, a) => /* @__PURE__ */ r(p, { children: o.type === "divider" ? /* @__PURE__ */ r(t.Separator, {}) : /* @__PURE__ */ r(t.Item, { icon: o.icon, onClick: () => o.action(null), children: o.label }) }, a)) })
|
|
14
14
|
] });
|
|
15
15
|
export {
|
|
16
|
-
EditorToolbarDropdownMenu
|
|
16
|
+
x as EditorToolbarDropdownMenu
|
|
17
17
|
};
|
|
18
|
+
//# sourceMappingURL=EditorToolbar.DropdownMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorToolbar.DropdownMenu.js","sources":["../../../../../src/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.tsx"],"sourcesContent":["import { Fragment, ReactNode, RefAttributes } from 'react';\nimport {\n Dropdown,\n DropdownMenuOptions,\n IconButton,\n IconButtonProps,\n Tooltip,\n} from '../../../..';\n\ninterface Props {\n /**\n * Props for the trigger\n */\n triggerProps: JSX.IntrinsicAttributes &\n Omit<IconButtonProps, 'ref'> &\n RefAttributes<HTMLButtonElement>;\n /**\n * Menu icon\n */\n icon: ReactNode;\n /**\n * Menu label (for accessibility)\n */\n ariaLabel: string;\n /**\n * Options to display\n */\n options: DropdownMenuOptions[];\n}\n\nexport const EditorToolbarDropdownMenu = ({\n triggerProps,\n icon,\n ariaLabel,\n options,\n}: Props) => {\n return (\n <>\n <Tooltip message={ariaLabel} placement=\"top\">\n <IconButton\n {...triggerProps}\n type=\"button\"\n variant=\"ghost\"\n color=\"tertiary\"\n icon={icon}\n aria-label={ariaLabel}\n />\n </Tooltip>\n <Dropdown.Menu>\n {options.map((option, index) => {\n return (\n <Fragment key={index}>\n {option.type === 'divider' ? (\n <Dropdown.Separator />\n ) : (\n <Dropdown.Item\n icon={option.icon}\n onClick={() => option.action(null)}\n >\n {option.label}\n </Dropdown.Item>\n )}\n </Fragment>\n );\n })}\n </Dropdown.Menu>\n </>\n );\n};\n"],"names":["EditorToolbarDropdownMenu","triggerProps","icon","ariaLabel","options","jsxs","Fragment","jsx","Tooltip","IconButton","Dropdown","map","option","index","type","action","label"],"mappings":";;;;;AA8BO,MAAMA,IAA4BA,CAAC;AAAA,EACxCC,cAAAA;AAAAA,EACAC,MAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,SAAAA;AACK,MAGD,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACC,KAAQ,SAASL,GAAW,WAAU,OACrC,UAAA,gBAAAI,EAACE,KACC,GAAIR,GACJ,MAAK,UACL,SAAQ,SACR,OAAM,YACN,MAAAC,GACA,cAAYC,EAAU,CAAA,GAE1B;AAAA,EACA,gBAAAI,EAACG,EAAS,MAAT,EACEN,YAAQO,IAAI,CAACC,GAAQC,MAElB,gBAAAN,EAACD,GAAA,EACEM,UAAOE,EAAAA,SAAS,YACf,gBAAAP,EAACG,EAAS,WAAT,CAAqB,CAAA,IAErB,gBAAAH,EAAAG,EAAS,MAAT,EACC,MAAME,EAAOV,MACb,SAAS,MAAMU,EAAOG,OAAO,IAAI,GAEhCH,UAAAA,EAAOI,MACV,CAAA,EAAA,GATWH,CAWf,CAEH,GACH;AACF,EAAA,CAAA;"}
|
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { useEditorContext } from "../../hooks/useEditorContext.js";
|
|
5
|
-
import { Tooltip } from "../../../../components/Tooltip/Tooltip.js";
|
|
6
|
-
import { IconButton } from "../../../../components/Button/IconButton.js";
|
|
7
|
-
import { Icon } from "../../../../components/Icon/Icon.js";
|
|
8
|
-
import { Dropdown } from "../../../../components/Dropdown/Dropdown.js";
|
|
9
|
-
const
|
|
10
|
-
triggerProps,
|
|
11
|
-
itemRefs
|
|
1
|
+
import { jsxs as n, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import p, { Categories as t } from "emoji-picker-react";
|
|
3
|
+
import { useTranslation as c } from "react-i18next";
|
|
4
|
+
import { useEditorContext as l } from "../../hooks/useEditorContext.js";
|
|
5
|
+
import { Tooltip as j } from "../../../../components/Tooltip/Tooltip.js";
|
|
6
|
+
import { IconButton as b } from "../../../../components/Button/IconButton.js";
|
|
7
|
+
import { Icon as g } from "../../../../components/Icon/Icon.js";
|
|
8
|
+
import { Dropdown as E } from "../../../../components/Dropdown/Dropdown.js";
|
|
9
|
+
const A = ({
|
|
10
|
+
triggerProps: a,
|
|
11
|
+
itemRefs: m
|
|
12
12
|
}) => {
|
|
13
13
|
const {
|
|
14
|
-
t
|
|
15
|
-
} =
|
|
16
|
-
editor
|
|
17
|
-
} =
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
14
|
+
t: o
|
|
15
|
+
} = c(), {
|
|
16
|
+
editor: r
|
|
17
|
+
} = l();
|
|
18
|
+
return /* @__PURE__ */ n(s, { children: [
|
|
19
|
+
/* @__PURE__ */ e(j, { message: o("tiptap.toolbar.emojisPicker"), placement: "top", children: /* @__PURE__ */ e(b, { ...a, type: "button", variant: "ghost", color: "tertiary", icon: /* @__PURE__ */ e(g, { name: "smiley" }), "aria-label": o("tiptap.toolbar.emojisPicker") }) }),
|
|
20
|
+
/* @__PURE__ */ e(E.Menu, { children: /* @__PURE__ */ e("div", { ref: (i) => m.current["emoji-picker"] = i, children: /* @__PURE__ */ e(p, { height: 400, width: 316, onEmojiClick: (i) => r == null ? void 0 : r.commands.insertContentAt(r.view.state.selection, i.emoji), previewConfig: {
|
|
21
21
|
showPreview: !1
|
|
22
22
|
}, searchDisabled: !0, categories: [{
|
|
23
|
-
category:
|
|
24
|
-
name: `${
|
|
23
|
+
category: t.SUGGESTED,
|
|
24
|
+
name: `${o("tiptap.toolbar.emojis.recentlyUsed")}`
|
|
25
25
|
}, {
|
|
26
|
-
category:
|
|
27
|
-
name: `${
|
|
26
|
+
category: t.SMILEYS_PEOPLE,
|
|
27
|
+
name: `${o("tiptap.toolbar.emojis.people")}`
|
|
28
28
|
}, {
|
|
29
|
-
category:
|
|
30
|
-
name: `${
|
|
29
|
+
category: t.ANIMALS_NATURE,
|
|
30
|
+
name: `${o("tiptap.toolbar.emojis.animalsNature")}`
|
|
31
31
|
}, {
|
|
32
|
-
category:
|
|
33
|
-
name: `${
|
|
32
|
+
category: t.FOOD_DRINK,
|
|
33
|
+
name: `${o("tiptap.toolbar.emojis.foodDrink")}`
|
|
34
34
|
}, {
|
|
35
|
-
category:
|
|
36
|
-
name: `${
|
|
35
|
+
category: t.TRAVEL_PLACES,
|
|
36
|
+
name: `${o("tiptap.toolbar.emojis.travelPlaces")}`
|
|
37
37
|
}, {
|
|
38
|
-
category:
|
|
39
|
-
name: `${
|
|
38
|
+
category: t.ACTIVITIES,
|
|
39
|
+
name: `${o("tiptap.toolbar.emojis.activities")}`
|
|
40
40
|
}, {
|
|
41
|
-
category:
|
|
42
|
-
name: `${
|
|
41
|
+
category: t.OBJECTS,
|
|
42
|
+
name: `${o("tiptap.toolbar.emojis.objects")}`
|
|
43
43
|
}, {
|
|
44
|
-
category:
|
|
45
|
-
name: `${
|
|
44
|
+
category: t.SYMBOLS,
|
|
45
|
+
name: `${o("tiptap.toolbar.emojis.symbols")}`
|
|
46
46
|
}, {
|
|
47
|
-
category:
|
|
48
|
-
name: `${
|
|
47
|
+
category: t.FLAGS,
|
|
48
|
+
name: `${o("tiptap.toolbar.emojis.flags")}`
|
|
49
49
|
}] }) }) })
|
|
50
50
|
] });
|
|
51
51
|
};
|
|
52
52
|
export {
|
|
53
|
-
EditorToolbarEmoji
|
|
53
|
+
A as EditorToolbarEmoji
|
|
54
54
|
};
|
|
55
|
+
//# sourceMappingURL=EditorToolbar.Emoji.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorToolbar.Emoji.js","sources":["../../../../../src/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.tsx"],"sourcesContent":["import { RefAttributes } from 'react';\n\nimport EmojiPicker, { Categories } from 'emoji-picker-react';\nimport { useTranslation } from 'react-i18next';\n\nimport {\n Dropdown,\n Icon,\n IconButton,\n IconButtonProps,\n Tooltip,\n} from '../../../..';\nimport { useEditorContext } from '../../hooks/useEditorContext';\n\ninterface Props {\n /**\n * Props for the trigger\n */\n triggerProps: JSX.IntrinsicAttributes &\n Omit<IconButtonProps, 'ref'> &\n RefAttributes<HTMLButtonElement>;\n /**\n * Tracks refs on ColorPickers.\n */\n itemRefs: any;\n}\n\nexport const EditorToolbarEmoji = ({ triggerProps, itemRefs }: Props) => {\n const { t } = useTranslation();\n const { editor } = useEditorContext();\n\n return (\n <>\n <Tooltip message={t('tiptap.toolbar.emojisPicker')} placement=\"top\">\n <IconButton\n {...triggerProps}\n type=\"button\"\n variant=\"ghost\"\n color=\"tertiary\"\n icon={<Icon name=\"smiley\" />}\n aria-label={t('tiptap.toolbar.emojisPicker')}\n />\n </Tooltip>\n <Dropdown.Menu>\n <div ref={(el) => (itemRefs.current['emoji-picker'] = el)}>\n <EmojiPicker\n height={400}\n width={316}\n onEmojiClick={(emoji) =>\n editor?.commands.insertContentAt(\n editor.view.state.selection,\n emoji.emoji,\n )\n }\n previewConfig={{ showPreview: false }}\n searchDisabled={true}\n categories={[\n {\n category: Categories.SUGGESTED,\n name: `${t('tiptap.toolbar.emojis.recentlyUsed')}`,\n },\n {\n category: Categories.SMILEYS_PEOPLE,\n name: `${t('tiptap.toolbar.emojis.people')}`,\n },\n {\n category: Categories.ANIMALS_NATURE,\n name: `${t('tiptap.toolbar.emojis.animalsNature')}`,\n },\n {\n category: Categories.FOOD_DRINK,\n name: `${t('tiptap.toolbar.emojis.foodDrink')}`,\n },\n {\n category: Categories.TRAVEL_PLACES,\n name: `${t('tiptap.toolbar.emojis.travelPlaces')}`,\n },\n {\n category: Categories.ACTIVITIES,\n name: `${t('tiptap.toolbar.emojis.activities')}`,\n },\n {\n category: Categories.OBJECTS,\n name: `${t('tiptap.toolbar.emojis.objects')}`,\n },\n {\n category: Categories.SYMBOLS,\n name: `${t('tiptap.toolbar.emojis.symbols')}`,\n },\n {\n category: Categories.FLAGS,\n name: `${t('tiptap.toolbar.emojis.flags')}`,\n },\n ]}\n />\n </div>\n </Dropdown.Menu>\n </>\n );\n};\n"],"names":["EditorToolbarEmoji","triggerProps","itemRefs","t","useTranslation","editor","useEditorContext","jsxs","Fragment","jsx","Tooltip","IconButton","Icon","Dropdown","el","current","EmojiPicker","emoji","commands","insertContentAt","view","state","selection","showPreview","category","Categories","SUGGESTED","name","SMILEYS_PEOPLE","ANIMALS_NATURE","FOOD_DRINK","TRAVEL_PLACES","ACTIVITIES","OBJECTS","SYMBOLS","FLAGS"],"mappings":";;;;;;;;AA2BO,MAAMA,IAAqBA,CAAC;AAAA,EAAEC,cAAAA;AAAAA,EAAcC,UAAAA;AAAgB,MAAM;AACjE,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB;AAAA,IAAEC,QAAAA;AAAAA,MAAWC,EAAiB;AAEpC,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAQ,SAASP,EAAE,6BAA6B,GAAG,WAAU,OAC5D,UAAC,gBAAAM,EAAAE,GAAA,EACKV,GAAAA,GACJ,MAAK,UACL,SAAQ,SACR,OAAM,YACN,MAAM,gBAAAQ,EAACG,GAAK,EAAA,MAAK,SAAQ,CAAA,GACzB,cAAYT,EAAE,6BAA6B,EAAA,CAAE,EAEjD,CAAA;AAAA,IACC,gBAAAM,EAAAI,EAAS,MAAT,EACC,UAAC,gBAAAJ,EAAA,OAAA,EAAI,KAAMK,CAAAA,MAAQZ,EAASa,QAAQ,cAAc,IAAID,GACpD,UAAC,gBAAAL,EAAAO,GAAA,EACC,QAAQ,KACR,OAAO,KACP,cAAeC,CAAAA,MACbZ,KAAAA,gBAAAA,EAAQa,SAASC,gBACfd,EAAOe,KAAKC,MAAMC,WAClBL,EAAMA,QAGV,eAAe;AAAA,MAAEM,aAAa;AAAA,IAAA,GAC9B,gBAAgB,IAChB,YAAY,CACV;AAAA,MACEC,UAAUC,EAAWC;AAAAA,MACrBC,MAAM,GAAGxB,EAAE,oCAAoC,CAAC;AAAA,IAAA,GAElD;AAAA,MACEqB,UAAUC,EAAWG;AAAAA,MACrBD,MAAM,GAAGxB,EAAE,8BAA8B,CAAC;AAAA,IAAA,GAE5C;AAAA,MACEqB,UAAUC,EAAWI;AAAAA,MACrBF,MAAM,GAAGxB,EAAE,qCAAqC,CAAC;AAAA,IAAA,GAEnD;AAAA,MACEqB,UAAUC,EAAWK;AAAAA,MACrBH,MAAM,GAAGxB,EAAE,iCAAiC,CAAC;AAAA,IAAA,GAE/C;AAAA,MACEqB,UAAUC,EAAWM;AAAAA,MACrBJ,MAAM,GAAGxB,EAAE,oCAAoC,CAAC;AAAA,IAAA,GAElD;AAAA,MACEqB,UAAUC,EAAWO;AAAAA,MACrBL,MAAM,GAAGxB,EAAE,kCAAkC,CAAC;AAAA,IAAA,GAEhD;AAAA,MACEqB,UAAUC,EAAWQ;AAAAA,MACrBN,MAAM,GAAGxB,EAAE,+BAA+B,CAAC;AAAA,IAAA,GAE7C;AAAA,MACEqB,UAAUC,EAAWS;AAAAA,MACrBP,MAAM,GAAGxB,EAAE,+BAA+B,CAAC;AAAA,IAAA,GAE7C;AAAA,MACEqB,UAAUC,EAAWU;AAAAA,MACrBR,MAAM,GAAGxB,EAAE,6BAA6B,CAAC;AAAA,IAAA,CAC1C,EACD,CAAA,EAEN,CAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useMemo, useCallback, useEffect } from "react";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { useEditorContext } from "../../hooks/useEditorContext.js";
|
|
5
|
-
import { DefaultPalette } from "../../../../components/ColorPicker/ColorPalette.js";
|
|
6
|
-
import { ColorPicker } from "../../../../components/ColorPicker/ColorPicker.js";
|
|
7
|
-
import { Tooltip } from "../../../../components/Tooltip/Tooltip.js";
|
|
8
|
-
import { IconButton } from "../../../../components/Button/IconButton.js";
|
|
9
|
-
import { Icon } from "../../../../components/Icon/Icon.js";
|
|
10
|
-
import { Dropdown } from "../../../../components/Dropdown/Dropdown.js";
|
|
11
|
-
const
|
|
12
|
-
triggerProps,
|
|
13
|
-
itemRefs
|
|
1
|
+
import { jsxs as h, Fragment as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useMemo as u, useCallback as f, useEffect as b } from "react";
|
|
3
|
+
import { useTranslation as A } from "react-i18next";
|
|
4
|
+
import { useEditorContext as C } from "../../hooks/useEditorContext.js";
|
|
5
|
+
import { DefaultPalette as k } from "../../../../components/ColorPicker/ColorPalette.js";
|
|
6
|
+
import { ColorPicker as x } from "../../../../components/ColorPicker/ColorPicker.js";
|
|
7
|
+
import { Tooltip as H } from "../../../../components/Tooltip/Tooltip.js";
|
|
8
|
+
import { IconButton as y } from "../../../../components/Button/IconButton.js";
|
|
9
|
+
import { Icon as E } from "../../../../components/Icon/Icon.js";
|
|
10
|
+
import { Dropdown as T } from "../../../../components/Dropdown/Dropdown.js";
|
|
11
|
+
const N = ({
|
|
12
|
+
triggerProps: c,
|
|
13
|
+
itemRefs: l
|
|
14
14
|
}) => {
|
|
15
15
|
const {
|
|
16
|
-
t
|
|
17
|
-
} =
|
|
18
|
-
editor
|
|
19
|
-
} =
|
|
20
|
-
() =>
|
|
16
|
+
t: e
|
|
17
|
+
} = A(), {
|
|
18
|
+
editor: t
|
|
19
|
+
} = C(), [i, s] = g("#4A4A4A"), n = u(
|
|
20
|
+
() => t == null ? void 0 : t.isActive("customHighlight", {
|
|
21
21
|
color: /^#([0-9a-f]{3}){1,2}$/i
|
|
22
22
|
}),
|
|
23
23
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
-
[
|
|
25
|
-
),
|
|
26
|
-
|
|
27
|
-
color:
|
|
24
|
+
[t, t == null ? void 0 : t.state]
|
|
25
|
+
), a = f((o) => {
|
|
26
|
+
o === i || o === "" ? (s(""), t == null || t.chain().focus().unsetHighlight().run()) : (s(o), t == null || t.chain().focus().setHighlight({
|
|
27
|
+
color: o
|
|
28
28
|
}).run());
|
|
29
|
-
}, [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
const
|
|
34
|
-
...
|
|
29
|
+
}, [i, t]);
|
|
30
|
+
b(() => {
|
|
31
|
+
s((t == null ? void 0 : t.getAttributes("customHighlight").color) ?? "");
|
|
32
|
+
}, [t, t == null ? void 0 : t.state]);
|
|
33
|
+
const m = [{
|
|
34
|
+
...k,
|
|
35
35
|
reset: {
|
|
36
36
|
value: "transparent",
|
|
37
|
-
description:
|
|
37
|
+
description: e("tiptap.toolbar.highlight.none")
|
|
38
38
|
}
|
|
39
39
|
}];
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ h(p, { children: [
|
|
41
|
+
/* @__PURE__ */ r(H, { message: e("tiptap.toolbar.highlight.back"), placement: "top", children: /* @__PURE__ */ r(y, { ...c, type: "button", variant: "ghost", color: "tertiary", icon: /* @__PURE__ */ r(E, { name: "text-highlight" }), "aria-label": e("tiptap.toolbar.highlight.back"), className: n ? "selected" : "" }) }),
|
|
42
|
+
/* @__PURE__ */ r(T.Menu, { children: /* @__PURE__ */ r(x, { ref: (o) => l.current["color-picker"] = o, palettes: m, model: i, onSuccess: (o) => a(o.value) }) })
|
|
43
43
|
] });
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
46
|
-
EditorToolbarHighlightColor
|
|
46
|
+
N as EditorToolbarHighlightColor
|
|
47
47
|
};
|
|
48
|
+
//# sourceMappingURL=EditorToolbar.HighlightColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorToolbar.HighlightColor.js","sources":["../../../../../src/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.tsx"],"sourcesContent":["import {\n RefAttributes,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { useTranslation } from 'react-i18next';\n\nimport {\n ColorPalette,\n ColorPicker,\n DefaultPalette,\n Dropdown,\n Icon,\n IconButton,\n IconButtonProps,\n Tooltip,\n} from '../../../..';\nimport { useEditorContext } from '../../hooks/useEditorContext';\n\ninterface Props {\n /**\n * Props for the trigger\n */\n triggerProps: JSX.IntrinsicAttributes &\n Omit<IconButtonProps, 'ref'> &\n RefAttributes<HTMLButtonElement>;\n /**\n * Tracks refs on ColorPickers.\n */\n itemRefs: any;\n}\n\nexport const EditorToolbarHighlightColor = ({\n triggerProps,\n itemRefs,\n}: Props) => {\n const { t } = useTranslation();\n const { editor } = useEditorContext();\n\n // Manage text and background colors.\n const [color, setColor] = useState<string>('#4A4A4A');\n\n const isActive = useMemo(\n () =>\n editor?.isActive('customHighlight', {\n color: /^#([0-9a-f]{3}){1,2}$/i,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [editor, editor?.state],\n );\n\n // Triggered when the user chooses a highlighting color.\n const applyColor = useCallback(\n (value: string) => {\n // If the same color is picked, remove it (=toggle mode).\n if (value === color || value === '') {\n setColor('');\n editor?.chain().focus().unsetHighlight().run();\n } else {\n setColor(value);\n editor?.chain().focus().setHighlight({ color: value }).run();\n }\n },\n [color, editor],\n );\n\n // When cursor moves in table, update the current highlight color.\n useEffect(() => {\n setColor(editor?.getAttributes('customHighlight').color ?? '');\n }, [editor, editor?.state]);\n\n // Palettes of available colors to choose from.\n const palettes: ColorPalette[] = [\n {\n ...DefaultPalette,\n reset: {\n value: 'transparent',\n description: t('tiptap.toolbar.highlight.none'),\n },\n },\n ];\n\n return (\n <>\n <Tooltip message={t('tiptap.toolbar.highlight.back')} placement=\"top\">\n <IconButton\n {...triggerProps}\n type=\"button\"\n variant=\"ghost\"\n color=\"tertiary\"\n icon={<Icon name=\"text-highlight\" />}\n aria-label={t('tiptap.toolbar.highlight.back')}\n className={isActive ? 'selected' : ''}\n />\n </Tooltip>\n <Dropdown.Menu>\n <ColorPicker\n ref={(el: any) => (itemRefs.current['color-picker'] = el)}\n palettes={palettes}\n model={color}\n onSuccess={(item) => applyColor(item.value)}\n />\n </Dropdown.Menu>\n </>\n );\n};\n"],"names":["EditorToolbarHighlightColor","triggerProps","itemRefs","t","useTranslation","editor","useEditorContext","color","setColor","useState","isActive","useMemo","state","applyColor","useCallback","value","chain","focus","unsetHighlight","run","setHighlight","useEffect","getAttributes","palettes","DefaultPalette","reset","description","jsxs","Fragment","jsx","Tooltip","IconButton","Icon","Dropdown","ColorPicker","el","current","item"],"mappings":";;;;;;;;;;AAmCO,MAAMA,IAA8BA,CAAC;AAAA,EAC1CC,cAAAA;AAAAA,EACAC,UAAAA;AACK,MAAM;AACL,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB;AAAA,IAAEC,QAAAA;AAAAA,MAAWC,EAAiB,GAG9B,CAACC,GAAOC,CAAQ,IAAIC,EAAiB,SAAS,GAE9CC,IAAWC;AAAAA,IACf,MACEN,KAAAA,gBAAAA,EAAQK,SAAS,mBAAmB;AAAA,MAClCH,OAAO;AAAA,IAAA;AAAA;AAAA,IAGX,CAACF,GAAQA,KAAAA,gBAAAA,EAAQO,KAAK;AAAA,EAAA,GAIlBC,IAAaC,EACjB,CAACC,MAAkB;AAEbA,IAAAA,MAAUR,KAASQ,MAAU,MAC/BP,EAAS,EAAE,GACXH,KAAAA,QAAAA,EAAQW,QAAQC,QAAQC,iBAAiBC,UAEzCX,EAASO,CAAK,GACdV,KAAAA,QAAAA,EAAQW,QAAQC,QAAQG,aAAa;AAAA,MAAEb,OAAOQ;AAAAA,IAAAA,GAASI;AAAAA,EACzD,GAEF,CAACZ,GAAOF,CAAM,CAChB;AAGAgB,EAAAA,EAAU,MAAM;AACdb,IAAAA,GAASH,KAAAA,gBAAAA,EAAQiB,cAAc,mBAAmBf,UAAS,EAAE;AAAA,EAC5D,GAAA,CAACF,GAAQA,KAAAA,gBAAAA,EAAQO,KAAK,CAAC;AAG1B,QAAMW,IAA2B,CAC/B;AAAA,IACE,GAAGC;AAAAA,IACHC,OAAO;AAAA,MACLV,OAAO;AAAA,MACPW,aAAavB,EAAE,+BAA+B;AAAA,IAChD;AAAA,EAAA,CACD;AAGH,SAEI,gBAAAwB,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAQ,EAAA,SAAS3B,EAAE,+BAA+B,GAAG,WAAU,OAC9D,UAAA,gBAAA0B,EAACE,GACC,EAAA,GAAI9B,GACJ,MAAK,UACL,SAAQ,SACR,OAAM,YACN,MAAM,gBAAA4B,EAACG,GAAK,EAAA,MAAK,kBAAmB,GACpC,cAAY7B,EAAE,+BAA+B,GAC7C,WAAWO,IAAW,aAAa,GAAG,CAAA,GAE1C;AAAA,IACA,gBAAAmB,EAACI,EAAS,MAAT,EACC,4BAACC,GACC,EAAA,KAAK,CAACC,MAAajC,EAASkC,QAAQ,cAAc,IAAID,GACtD,UAAAZ,GACA,OAAOhB,GACP,WAAY8B,OAASxB,EAAWwB,EAAKtB,KAAK,EAAA,CAAE,EAEhD,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment as
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { Dropdown } from "../../../../components/Dropdown/Dropdown.js";
|
|
5
|
-
const
|
|
6
|
-
options
|
|
1
|
+
import { jsxs as i, Fragment as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as m } from "react";
|
|
3
|
+
import { useTranslation as s } from "react-i18next";
|
|
4
|
+
import { Dropdown as t } from "../../../../components/Dropdown/Dropdown.js";
|
|
5
|
+
const g = ({
|
|
6
|
+
options: n
|
|
7
7
|
}) => {
|
|
8
8
|
const {
|
|
9
|
-
t
|
|
10
|
-
} =
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
9
|
+
t: o
|
|
10
|
+
} = s();
|
|
11
|
+
return /* @__PURE__ */ i(l, { children: [
|
|
12
|
+
/* @__PURE__ */ r(t.Trigger, { variant: "ghost", label: o("tiptap.toolbar.plus"), size: "md", tabIndex: -1 }),
|
|
13
|
+
/* @__PURE__ */ r(t.Menu, { children: n.map((e, a) => /* @__PURE__ */ r(m, { children: e.type === "divider" ? /* @__PURE__ */ r(t.Separator, {}) : /* @__PURE__ */ r(t.Item, { icon: e.icon, onClick: () => e.action(null), children: e.label }) }, a)) })
|
|
14
14
|
] });
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
EditorToolbarPlusMenu
|
|
17
|
+
g as EditorToolbarPlusMenu
|
|
18
18
|
};
|
|
19
|
+
//# sourceMappingURL=EditorToolbar.PlusMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorToolbar.PlusMenu.js","sources":["../../../../../src/modules/editor/components/EditorToolbar/EditorToolbar.PlusMenu.tsx"],"sourcesContent":["import { Fragment } from 'react';\n\nimport { useTranslation } from 'react-i18next';\nimport { Dropdown, DropdownMenuOptions } from '../../../..';\n\ninterface Props {\n /**\n * Options to display\n */\n options: DropdownMenuOptions[];\n}\n\nexport const EditorToolbarPlusMenu = ({ options }: Props) => {\n const { t } = useTranslation();\n\n return (\n <>\n <Dropdown.Trigger\n variant=\"ghost\"\n label={t('tiptap.toolbar.plus')}\n size=\"md\"\n tabIndex={-1}\n />\n <Dropdown.Menu>\n {options.map((option, index) => {\n return (\n <Fragment key={index}>\n {option.type === 'divider' ? (\n <Dropdown.Separator />\n ) : (\n <Dropdown.Item\n icon={option.icon}\n onClick={() => option.action(null)}\n >\n {option.label}\n </Dropdown.Item>\n )}\n </Fragment>\n );\n })}\n </Dropdown.Menu>\n </>\n );\n};\n"],"names":["EditorToolbarPlusMenu","options","t","useTranslation","jsxs","Fragment","jsx","Dropdown","map","option","index","type","icon","action","label"],"mappings":";;;;AAYO,MAAMA,IAAwBA,CAAC;AAAA,EAAEC,SAAAA;AAAe,MAAM;AACrD,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe;AAE7B,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,EAAS,SAAT,EACC,SAAQ,SACR,OAAOL,EAAE,qBAAqB,GAC9B,MAAK,MACL,UAAU,GAAG,CAAA;AAAA,IAEf,gBAAAI,EAACC,EAAS,MAAT,EACEN,YAAQO,IAAI,CAACC,GAAQC,MAElB,gBAAAJ,EAACD,GAAA,EACEI,UAAOE,EAAAA,SAAS,YACf,gBAAAL,EAACC,EAAS,WAAT,CAAqB,CAAA,IAErB,gBAAAD,EAAAC,EAAS,MAAT,EACC,MAAME,EAAOG,MACb,SAAS,MAAMH,EAAOI,OAAO,IAAI,GAEhCJ,UAAAA,EAAOK,MACV,CAAA,EAAA,GATWJ,CAWf,CAEH,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useMemo, useCallback, useEffect } from "react";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { useEditorContext } from "../../hooks/useEditorContext.js";
|
|
5
|
-
import { DefaultPalette, AccessiblePalette } from "../../../../components/ColorPicker/ColorPalette.js";
|
|
6
|
-
import { Tooltip } from "../../../../components/Tooltip/Tooltip.js";
|
|
7
|
-
import { IconButton } from "../../../../components/Button/IconButton.js";
|
|
8
|
-
import { Icon } from "../../../../components/Icon/Icon.js";
|
|
9
|
-
import { Dropdown } from "../../../../components/Dropdown/Dropdown.js";
|
|
10
|
-
import { ColorPicker } from "../../../../components/ColorPicker/ColorPicker.js";
|
|
11
|
-
const
|
|
12
|
-
triggerProps,
|
|
13
|
-
itemRefs
|
|
1
|
+
import { jsxs as m, Fragment as f, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useMemo as b, useCallback as x, useEffect as A } from "react";
|
|
3
|
+
import { useTranslation as h } from "react-i18next";
|
|
4
|
+
import { useEditorContext as C } from "../../hooks/useEditorContext.js";
|
|
5
|
+
import { DefaultPalette as g, AccessiblePalette as y } from "../../../../components/ColorPicker/ColorPalette.js";
|
|
6
|
+
import { Tooltip as T } from "../../../../components/Tooltip/Tooltip.js";
|
|
7
|
+
import { IconButton as k } from "../../../../components/Button/IconButton.js";
|
|
8
|
+
import { Icon as E } from "../../../../components/Icon/Icon.js";
|
|
9
|
+
import { Dropdown as P } from "../../../../components/Dropdown/Dropdown.js";
|
|
10
|
+
import { ColorPicker as S } from "../../../../components/ColorPicker/ColorPicker.js";
|
|
11
|
+
const q = ({
|
|
12
|
+
triggerProps: a,
|
|
13
|
+
itemRefs: s
|
|
14
14
|
}) => {
|
|
15
15
|
const {
|
|
16
|
-
t
|
|
17
|
-
} =
|
|
18
|
-
editor
|
|
19
|
-
} =
|
|
20
|
-
() =>
|
|
16
|
+
t: e
|
|
17
|
+
} = h(), {
|
|
18
|
+
editor: o
|
|
19
|
+
} = C(), [l, c] = u("#4A4A4A"), n = b(
|
|
20
|
+
() => o == null ? void 0 : o.isActive("textStyle", {
|
|
21
21
|
color: /^#([0-9a-f]{3}){1,2}$/i
|
|
22
22
|
}),
|
|
23
23
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
-
[
|
|
25
|
-
),
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
const
|
|
33
|
-
...
|
|
34
|
-
label:
|
|
24
|
+
[o, o == null ? void 0 : o.state]
|
|
25
|
+
), p = x((t) => {
|
|
26
|
+
t === l ? (c(""), o == null || o.chain().focus().unsetColor().run()) : (c(t), o == null || o.chain().focus().setColor(t).run());
|
|
27
|
+
}, [l, o]);
|
|
28
|
+
A(() => {
|
|
29
|
+
const t = o == null ? void 0 : o.getAttributes("textStyle");
|
|
30
|
+
c((t == null ? void 0 : t.color) ?? "#4A4A4A");
|
|
31
|
+
}, [o, o == null ? void 0 : o.state]);
|
|
32
|
+
const i = [{
|
|
33
|
+
...g,
|
|
34
|
+
label: e("tiptap.toolbar.color.text")
|
|
35
35
|
}, {
|
|
36
|
-
...
|
|
37
|
-
label:
|
|
36
|
+
...y,
|
|
37
|
+
label: e("tiptap.toolbar.color.a13y"),
|
|
38
38
|
tooltip: {
|
|
39
|
-
message:
|
|
39
|
+
message: e("tiptap.toolbar.color.a13y.hint"),
|
|
40
40
|
placement: "right"
|
|
41
41
|
}
|
|
42
42
|
}];
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ m(f, { children: [
|
|
44
|
+
/* @__PURE__ */ r(T, { message: e("tiptap.toolbar.color.text"), placement: "top", children: /* @__PURE__ */ r(k, { ...a, type: "button", variant: "ghost", color: "tertiary", icon: /* @__PURE__ */ r(E, { name: "text-color" }), "aria-label": e("tiptap.toolbar.color.text"), className: n ? "selected" : "" }) }),
|
|
45
|
+
/* @__PURE__ */ r(P.Menu, { children: /* @__PURE__ */ r(S, { ref: (t) => s.current["color-picker"] = t, model: l, palettes: i, onSuccess: (t) => p(t.value) }) })
|
|
46
46
|
] });
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
|
-
EditorToolbarTextColor
|
|
49
|
+
q as EditorToolbarTextColor
|
|
50
50
|
};
|
|
51
|
+
//# sourceMappingURL=EditorToolbar.TextColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorToolbar.TextColor.js","sources":["../../../../../src/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.tsx"],"sourcesContent":["import {\n RefAttributes,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { useTranslation } from 'react-i18next';\n\nimport {\n AccessiblePalette,\n ColorPalette,\n ColorPicker,\n DefaultPalette,\n Dropdown,\n Icon,\n IconButton,\n IconButtonProps,\n Tooltip,\n} from '../../../..';\nimport { useEditorContext } from '../../hooks/useEditorContext';\n\ninterface Props {\n /**\n * Props for the trigger\n */\n triggerProps: JSX.IntrinsicAttributes &\n Omit<IconButtonProps, 'ref'> &\n RefAttributes<HTMLButtonElement>;\n /**\n * Tracks refs on ColorPickers.\n */\n itemRefs: any;\n}\n\nexport const EditorToolbarTextColor = ({ triggerProps, itemRefs }: Props) => {\n const { t } = useTranslation();\n const { editor } = useEditorContext();\n\n // Manage text and background colors.\n const [color, setColor] = useState<string>('#4A4A4A');\n\n const isActive = useMemo(\n () =>\n editor?.isActive('textStyle', {\n color: /^#([0-9a-f]{3}){1,2}$/i,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [editor, editor?.state],\n );\n\n // Triggered when the user chooses a color for cells background.\n const applyColor = useCallback(\n (value: string) => {\n // If the same color is picked, remove it (=toggle mode).\n if (value === color) {\n setColor('');\n editor?.chain().focus().unsetColor().run();\n } else {\n setColor(value);\n editor?.chain().focus().setColor(value).run();\n }\n },\n [color, editor],\n );\n\n // When cursor moves in table, update the current text color.\n useEffect(() => {\n const textStyle = editor?.getAttributes('textStyle');\n setColor(textStyle?.color ?? '#4A4A4A');\n }, [editor, editor?.state]);\n\n // Palettes of available colors to choose from.\n const palettes: ColorPalette[] = [\n { ...DefaultPalette, label: t('tiptap.toolbar.color.text') },\n {\n ...AccessiblePalette,\n label: t('tiptap.toolbar.color.a13y'),\n tooltip: {\n message: t('tiptap.toolbar.color.a13y.hint'),\n placement: 'right',\n },\n },\n ];\n\n return (\n <>\n <Tooltip message={t('tiptap.toolbar.color.text')} placement=\"top\">\n <IconButton\n {...triggerProps}\n type=\"button\"\n variant=\"ghost\"\n color=\"tertiary\"\n icon={<Icon name=\"text-color\" />}\n aria-label={t('tiptap.toolbar.color.text')}\n className={isActive ? 'selected' : ''}\n />\n </Tooltip>\n <Dropdown.Menu>\n <ColorPicker\n ref={(el: any) => (itemRefs.current['color-picker'] = el)}\n model={color}\n palettes={palettes}\n onSuccess={(item) => applyColor(item.value)}\n />\n </Dropdown.Menu>\n </>\n );\n};\n"],"names":["EditorToolbarTextColor","triggerProps","itemRefs","t","useTranslation","editor","useEditorContext","color","setColor","useState","isActive","useMemo","state","applyColor","useCallback","value","chain","focus","unsetColor","run","useEffect","textStyle","getAttributes","palettes","DefaultPalette","label","AccessiblePalette","tooltip","message","placement","jsxs","Fragment","jsx","Tooltip","IconButton","Icon","Dropdown","ColorPicker","el","current","item"],"mappings":";;;;;;;;;;AAoCO,MAAMA,IAAyBA,CAAC;AAAA,EAAEC,cAAAA;AAAAA,EAAcC,UAAAA;AAAgB,MAAM;AACrE,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB;AAAA,IAAEC,QAAAA;AAAAA,MAAWC,EAAiB,GAG9B,CAACC,GAAOC,CAAQ,IAAIC,EAAiB,SAAS,GAE9CC,IAAWC;AAAAA,IACf,MACEN,KAAAA,gBAAAA,EAAQK,SAAS,aAAa;AAAA,MAC5BH,OAAO;AAAA,IAAA;AAAA;AAAA,IAGX,CAACF,GAAQA,KAAAA,gBAAAA,EAAQO,KAAK;AAAA,EAAA,GAIlBC,IAAaC,EACjB,CAACC,MAAkB;AAEjB,IAAIA,MAAUR,KACZC,EAAS,EAAE,GACXH,KAAAA,QAAAA,EAAQW,QAAQC,QAAQC,aAAaC,UAErCX,EAASO,CAAK,GACdV,KAAAA,QAAAA,EAAQW,QAAQC,QAAQT,SAASO,GAAOI;AAAAA,EAC1C,GAEF,CAACZ,GAAOF,CAAM,CAChB;AAGAe,EAAAA,EAAU,MAAM;AACRC,UAAAA,IAAYhB,KAAAA,gBAAAA,EAAQiB,cAAc;AAC/BD,IAAAA,GAAAA,KAAAA,gBAAAA,EAAWd,UAAS,SAAS;AAAA,EACrC,GAAA,CAACF,GAAQA,KAAAA,gBAAAA,EAAQO,KAAK,CAAC;AAG1B,QAAMW,IAA2B,CAC/B;AAAA,IAAE,GAAGC;AAAAA,IAAgBC,OAAOtB,EAAE,2BAA2B;AAAA,EAAA,GACzD;AAAA,IACE,GAAGuB;AAAAA,IACHD,OAAOtB,EAAE,2BAA2B;AAAA,IACpCwB,SAAS;AAAA,MACPC,SAASzB,EAAE,gCAAgC;AAAA,MAC3C0B,WAAW;AAAA,IACb;AAAA,EAAA,CACD;AAGH,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAQ,EAAA,SAAS9B,EAAE,2BAA2B,GAAG,WAAU,OAC1D,UAAA,gBAAA6B,EAACE,GACC,EAAA,GAAIjC,GACJ,MAAK,UACL,SAAQ,SACR,OAAM,YACN,MAAM,gBAAA+B,EAACG,GAAK,EAAA,MAAK,cAAe,GAChC,cAAYhC,EAAE,2BAA2B,GACzC,WAAWO,IAAW,aAAa,GAAG,CAAA,GAE1C;AAAA,IACA,gBAAAsB,EAACI,EAAS,MAAT,EACC,4BAACC,GACC,EAAA,KAAK,CAACC,MAAapC,EAASqC,QAAQ,cAAc,IAAID,GACtD,OAAO/B,GACP,UAAAgB,GACA,WAAYiB,OAAS3B,EAAW2B,EAAKzB,KAAK,EAAA,CAAE,EAEhD,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|