@antscorp/antsomi-ui 2.0.109 → 2.0.111
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 +78 -78
- package/es/__mocks__/1000_city.json +802 -802
- package/es/__mocks__/sql-query.json +56 -56
- package/es/assets/css/main.scss +8 -6
- package/es/assets/images/feedback.svg +3 -3
- package/es/assets/svg/mobile-frame.svg +3 -3
- package/es/assets/svg/warning-icon.svg +5 -5
- package/es/components/atoms/Alert/Alert.js +28 -28
- package/es/components/atoms/ContentEditable/styled.js +16 -16
- package/es/components/atoms/DividerPure/styled.js +35 -35
- package/es/components/atoms/Eyedropper/Eyedropper.d.ts +2 -0
- package/es/components/atoms/Eyedropper/Eyedropper.js +53 -0
- package/es/components/atoms/Eyedropper/index.d.ts +0 -0
- package/es/components/atoms/Eyedropper/index.js +1 -0
- package/es/components/atoms/Eyedropper/styled.d.ts +9 -0
- package/es/components/atoms/Eyedropper/styled.js +45 -0
- package/es/components/atoms/Eyedropper/types.d.ts +5 -0
- package/es/components/atoms/Eyedropper/types.js +1 -0
- package/es/components/atoms/Icon/index.js +19 -19
- package/es/components/atoms/Iframe/Iframe.js +18 -18
- package/es/components/atoms/Input/styled.js +104 -104
- package/es/components/atoms/InputDynamic/styled.js +284 -284
- package/es/components/atoms/MobileBrandingBar/styled.js +21 -21
- package/es/components/atoms/MobileFrame/styled.js +30 -30
- package/es/components/atoms/MobileFrameV2/styled.js +42 -42
- package/es/components/atoms/MobileFrameV3/styled.js +31 -31
- package/es/components/atoms/NotificationStatus/styled.js +10 -10
- package/es/components/atoms/PreviewTabs/styled.js +69 -69
- package/es/components/atoms/Radio/index.js +16 -16
- package/es/components/atoms/ReactIframe/ReactIframe.js +5 -5
- package/es/components/atoms/ReactIframe/styled.js +9 -9
- package/es/components/atoms/RequiredLabel/styled.js +3 -3
- package/es/components/atoms/ScrollBox/index.js +5 -5
- package/es/components/atoms/Scrollbars/styled.js +21 -21
- package/es/components/atoms/SlideBar/styled.js +194 -194
- package/es/components/atoms/Slider/styled.js +31 -31
- package/es/components/atoms/Space/Space.js +4 -4
- package/es/components/atoms/Spin/styled.js +11 -11
- package/es/components/atoms/Steps/styled.js +244 -244
- package/es/components/atoms/Switch/styled.js +56 -56
- package/es/components/atoms/Tag/Tag.js +10 -10
- package/es/components/atoms/Text/styled.js +34 -34
- package/es/components/icons/ALignRightIcon.d.ts +3 -0
- package/es/components/icons/ALignRightIcon.js +7 -0
- package/es/components/icons/AlignCenterIcon.d.ts +3 -0
- package/es/components/icons/AlignCenterIcon.js +7 -0
- package/es/components/icons/AlignJustifyIcon.d.ts +3 -0
- package/es/components/icons/AlignJustifyIcon.js +7 -0
- package/es/components/icons/AlignLeftIcon.d.ts +3 -0
- package/es/components/icons/AlignLeftIcon.js +7 -0
- package/es/components/icons/ArrowDropDownIcon.d.ts +3 -0
- package/es/components/icons/ArrowDropDownIcon.js +7 -0
- package/es/components/icons/ChevronRightIcon.d.ts +3 -0
- package/es/components/icons/ChevronRightIcon.js +7 -0
- package/es/components/icons/ColorizeIcon.d.ts +3 -0
- package/es/components/icons/ColorizeIcon.js +7 -0
- package/es/components/icons/DomainManagementIcon.js +1 -1
- package/es/components/icons/LazyIcon/LazyIcon.d.ts +9 -0
- package/es/components/icons/LazyIcon/LazyIcon.js +9 -0
- package/es/components/icons/LinkOffIcon.d.ts +3 -0
- package/es/components/icons/LinkOffIcon.js +7 -0
- package/es/components/icons/LoadingIcon.js +33 -33
- package/es/components/icons/MinusIcon.d.ts +3 -0
- package/es/components/icons/MinusIcon.js +7 -0
- package/es/components/icons/document/styled.js +43 -43
- package/es/components/icons/index.d.ts +9 -0
- package/es/components/icons/index.js +9 -0
- package/es/components/index.scss +2 -1
- package/es/components/molecules/AccessDenied/styled.js +28 -28
- package/es/components/molecules/AccountSelection/styled.js +110 -110
- package/es/components/molecules/AddDynamicContent/styled.js +23 -23
- package/es/components/molecules/AlignSetting/styled.js +4 -4
- package/es/components/molecules/ApplyPopupContent/styled.js +32 -32
- package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +8 -8
- package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +79 -79
- package/es/components/molecules/CalendarSelection/components/Footer/styled.js +4 -4
- package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +21 -21
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +26 -26
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +30 -30
- package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +26 -26
- package/es/components/molecules/CalendarSelection/styled.js +8 -8
- package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +119 -119
- package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +67 -67
- package/es/components/molecules/CaptureScreen/styled.js +240 -240
- package/es/components/molecules/ChartTab/components/styled.js +24 -24
- package/es/components/molecules/ChartTab/styled.js +20 -20
- package/es/components/molecules/ChatBox/AntsomiAI.js +8 -8
- package/es/components/molecules/ChatBox/ChatBoxInsight/QuestionItem.js +9 -9
- package/es/components/molecules/ChatBox/ChatBoxInsight/styled.js +365 -365
- package/es/components/molecules/ChatBox/styled.js +324 -324
- package/es/components/molecules/CodeStructure/styled.js +5 -5
- package/es/components/molecules/ColorPicker/ChromePicker/styled.js +10 -10
- package/es/components/molecules/ColorPicker/CustomPicker/styled.js +89 -89
- package/es/components/molecules/ColorPicker/SketchPicker/styled.js +5 -5
- package/es/components/molecules/ColorPicker/styled.js +7 -7
- package/es/components/molecules/ColorSetting/styled.js +39 -39
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +110 -110
- package/es/components/molecules/DatePickerV2/styled.js +6 -6
- package/es/components/molecules/DisplayFormat/styled.js +12 -12
- package/es/components/molecules/DrawerDetail/components/ToggleDrawerSizeButton.js +24 -24
- package/es/components/molecules/DrawerDetail/styled.js +109 -109
- package/es/components/molecules/Dropdown/style.scss +11 -11
- package/es/components/molecules/Dropdown/styled.js +28 -28
- package/es/components/molecules/EdgeSetting/styled.js +10 -10
- package/es/components/molecules/EditableName/styled.js +70 -70
- package/es/components/molecules/EditingList/styled.js +29 -29
- package/es/components/molecules/EditingListV2/components/List/List.js +9 -9
- package/es/components/molecules/EditorTab/styled.js +156 -156
- package/es/components/molecules/EmojiCollections/CommonCollection/index.js +2 -2
- package/es/components/molecules/EmojiCollections/styled.js +22 -22
- package/es/components/molecules/EmojiCollections/types.d.ts +1 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +2 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.js +10 -6
- package/es/components/molecules/EmojiPopover/styled.js +5 -5
- package/es/components/molecules/EmptyData/styled.js +53 -53
- package/es/components/molecules/EyedropperButton/EyedropperButton.d.ts +11 -0
- package/es/components/molecules/EyedropperButton/EyedropperButton.js +34 -0
- package/es/components/molecules/EyedropperButton/index.d.ts +0 -0
- package/es/components/molecules/EyedropperButton/index.js +1 -0
- package/es/components/molecules/EyedropperButton/styled.d.ts +7 -0
- package/es/components/molecules/EyedropperButton/styled.js +23 -0
- package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +3 -0
- package/es/components/molecules/FontSizeInput/FontSizeInput.js +134 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.d.ts +8 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +14 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.d.ts +21 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.js +19 -0
- package/es/components/molecules/FontSizeInput/constants.d.ts +2 -0
- package/es/components/molecules/FontSizeInput/constants.js +5 -0
- package/es/components/molecules/FontSizeInput/index.d.ts +2 -0
- package/es/components/molecules/FontSizeInput/index.js +1 -0
- package/es/components/molecules/FontSizeInput/index.scss +15 -15
- package/es/components/molecules/FontSizeInput/styled.d.ts +7 -0
- package/es/components/molecules/FontSizeInput/styled.js +39 -0
- package/es/components/molecules/FontSizeInput/types.d.ts +23 -0
- package/es/components/molecules/FontSizeInput/types.js +1 -0
- package/es/components/molecules/FontSizeInput/utils.d.ts +7 -0
- package/es/components/molecules/FontSizeInput/utils.js +9 -0
- package/es/components/molecules/GradientSetting/styled.js +57 -57
- package/es/components/molecules/HeaderV2/styled.js +70 -70
- package/es/components/molecules/IconSelection/styled.js +69 -69
- package/es/components/molecules/ImageEditor/components/ModalShortcut.js +21 -21
- package/es/components/molecules/ImageEditor/styled.js +5 -5
- package/es/components/molecules/ImagePreview/styled.js +3 -3
- package/es/components/molecules/InputNumberWithUnit/styled.js +14 -14
- package/es/components/molecules/InputSearch/styled.js +41 -41
- package/es/components/molecules/ItemNotFound/styled.js +26 -26
- package/es/components/molecules/MatchAnySelect/components/ExtendValuePopup.js +8 -8
- package/es/components/molecules/MatchAnySelect/styled.js +247 -247
- package/es/components/molecules/Modal/styled.js +63 -63
- package/es/components/molecules/ModalSelect/styled.js +152 -152
- package/es/components/molecules/ModalV2/styled.js +27 -27
- package/es/components/molecules/PopupDraggable/styled.js +57 -57
- package/es/components/molecules/PreviewModal/styled.js +26 -26
- package/es/components/molecules/ProcessLoading/styled.js +2 -2
- package/es/components/molecules/QuillEditor/CustomToolbar.js +3165 -3165
- package/es/components/molecules/QuillEditor/EditorToolbar.js +7 -7
- package/es/components/molecules/QuillEditor/styled.js +25 -25
- package/es/components/molecules/RadioGroup/styled.js +9 -9
- package/es/components/molecules/RequestAccess/styled.js +38 -38
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +77 -77
- package/es/components/molecules/ResizeGrid/styled.js +50 -50
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +118 -118
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +13 -13
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +40 -40
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +27 -27
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +2 -2
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +38 -38
- package/es/components/molecules/SearchPopover/SearchPopover.d.ts +2 -1
- package/es/components/molecules/SearchPopover/SearchPopover.js +3 -3
- package/es/components/molecules/SearchPopover/components/PopoverSelect/styled.js +36 -36
- package/es/components/molecules/SearchPopover/components/PopoverSelect/styles.scss +7 -7
- package/es/components/molecules/SearchPopover/styled.d.ts +12 -1
- package/es/components/molecules/SearchPopover/styled.js +32 -33
- package/es/components/molecules/SearchPopover/types.d.ts +4 -3
- package/es/components/molecules/Select/styled.js +32 -32
- package/es/components/molecules/SelectAccount/styled.js +147 -147
- package/es/components/molecules/SelectEventAttribute/styled.js +8 -8
- package/es/components/molecules/SelectMulti/styled.js +62 -62
- package/es/components/molecules/SelectV2/styled.js +124 -124
- package/es/components/molecules/SettingWrapper/styled.js +12 -12
- package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +56 -56
- package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +5 -5
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.js +15 -15
- package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +63 -63
- package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +31 -31
- package/es/components/molecules/SliderWithInputNumber/styled.js +2 -2
- package/es/components/molecules/Tabs/Tabs.js +11 -11
- package/es/components/molecules/TagifyInput/TagifyInput.js +50 -50
- package/es/components/molecules/TagifyInput/styled.js +37 -37
- package/es/components/molecules/TagifyInput/utils.js +13 -13
- package/es/components/molecules/TagifyInput/utils.style.js +218 -218
- package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +5 -5
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +276 -276
- package/es/components/molecules/TemplateSaveAs/styled.js +134 -134
- package/es/components/molecules/ThumbnailCard/styled.js +92 -92
- package/es/components/molecules/Tree/styled.js +38 -38
- package/es/components/molecules/UnsubscribePreferences/styled.js +7 -7
- package/es/components/molecules/UnsubscribePreview/components/styled.js +53 -53
- package/es/components/molecules/UnsubscribePreview/styled.js +48 -48
- package/es/components/molecules/UploadImage/styled.js +114 -114
- package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +1 -0
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +6 -8
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +10 -10
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +49 -289
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.d.ts +9 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.js +5 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.d.ts +23 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.js +81 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.d.ts +24 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.js +32 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.d.ts +26 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.js +93 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.d.ts +24 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.js +94 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.d.ts +7 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.js +132 -0
- package/es/components/molecules/VirtualizedMenu/styled.js +103 -82
- package/es/components/molecules/VirtualizedMenu/types.d.ts +2 -0
- package/es/components/molecules/VirtualizedMenu/utils.d.ts +2 -0
- package/es/components/molecules/VirtualizedMenu/utils.js +2 -0
- package/es/components/molecules/index.d.ts +1 -0
- package/es/components/molecules/index.js +1 -0
- package/es/components/molecules/index.scss +1 -0
- package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/styles.js +98 -98
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/styles.js +18 -18
- package/es/components/organism/AccountProfile/components/AccountSetting/styled.js +543 -543
- package/es/components/organism/AccountProfile/components/AccountSetting/styles.scss +39 -39
- package/es/components/organism/AccountSharing/styled.js +336 -336
- package/es/components/organism/ActivityTimeline/ActivityTimeline.js +3 -3
- package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +1290 -1290
- package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +1896 -3059
- package/es/components/organism/ActivityTimeline/components/ActionHistory/styled.js +28 -28
- package/es/components/organism/ActivityTimeline/components/CardMember/styled.js +60 -60
- package/es/components/organism/ActivityTimeline/components/ItemEvent/ItemEvent.js +7 -1
- package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/ItemGroupEvent.js +14 -2
- package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/styled.js +4 -4
- package/es/components/organism/ActivityTimeline/components/List/styled.js +77 -77
- package/es/components/organism/ActivityTimeline/components/ListItem/styled.js +37 -37
- package/es/components/organism/ActivityTimeline/components/ProductCard/styled.js +92 -92
- package/es/components/organism/ActivityTimeline/components/Redeem/styled.js +7 -7
- package/es/components/organism/ActivityTimeline/components/Slide/styled.js +20 -20
- package/es/components/organism/ActivityTimeline/components/TimeLineTitle/styled.js +7 -7
- package/es/components/organism/ActivityTimeline/components/TimelineSection/styled.js +69 -69
- package/es/components/organism/ActivityTimeline/constants.d.ts +18 -18
- package/es/components/organism/ActivityTimeline/constants.js +7 -8
- package/es/components/organism/ActivityTimeline/index.d.ts +530 -1
- package/es/components/organism/ActivityTimeline/index.js +9 -1
- package/es/components/organism/ActivityTimeline/styled.js +43 -39
- package/es/components/organism/ActivityTimeline/utils.d.ts +7 -1
- package/es/components/organism/ActivityTimeline/utils.js +224 -162
- package/es/components/organism/AlgorithmsSetting/styled.js +35 -35
- package/es/components/organism/BasicLogin/components/ChooseMethod/styled.js +19 -19
- package/es/components/organism/BasicLogin/components/LoginWithEmail/styled.js +3 -3
- package/es/components/organism/BasicLogin/components/LoginWithGG/styled.js +3 -3
- package/es/components/organism/BasicLogin/components/SignIn/styled.js +8 -8
- package/es/components/organism/BasicLogin/components/WidgetLayout/styled.js +18 -18
- package/es/components/organism/BasicLogin/styled.js +107 -107
- package/es/components/organism/ContentSources/styled.js +50 -50
- package/es/components/organism/DataTable/components/AddButton/index.js +8 -8
- package/es/components/organism/DataTable/components/ModifyColumn/styled.js +18 -18
- package/es/components/organism/DataTable/components/Pagination/styled.js +26 -26
- package/es/components/organism/DataTable/components/Table/styled.js +135 -135
- package/es/components/organism/DataTable/components/Toolbar/SearchPopover.js +17 -17
- package/es/components/organism/DataTable/components/Toolbar/styled.js +70 -70
- package/es/components/organism/DataTable/styled/index.js +84 -84
- package/es/components/organism/Filter/components/FilterCondition/styled.js +34 -34
- package/es/components/organism/Filter/styled.js +109 -109
- package/es/components/organism/FilterSetting/components/common/InputArray/styled.js +5 -5
- package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.js +63 -63
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/ColumnSuggestion/index.js +31 -31
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/Tree/index.js +22 -22
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.js +55 -55
- package/es/components/organism/FilterSetting/styled.js +19 -19
- package/es/components/organism/Help/styled.js +267 -267
- package/es/components/organism/LeftMenu/components/HomeMenu/styled.js +39 -39
- package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/styled.js +16 -16
- package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.js +156 -156
- package/es/components/organism/LeftMenu/styled.js +214 -214
- package/es/components/organism/Login/components/ChooseMethod/styled.js +19 -19
- package/es/components/organism/Login/components/ForgotPassword/styled.js +8 -8
- package/es/components/organism/Login/components/LoginSelectPortal/Item/styled.js +31 -31
- package/es/components/organism/Login/components/LoginSelectPortal/styled.js +3 -3
- package/es/components/organism/Login/components/LoginWithEmail/styled.js +3 -3
- package/es/components/organism/Login/components/LoginWithGG/styled.js +3 -3
- package/es/components/organism/Login/components/SetupGGAuthenticator/styled.js +7 -7
- package/es/components/organism/Login/components/SignIn/styled.js +8 -8
- package/es/components/organism/Login/components/VerifyAccount/styled.js +13 -13
- package/es/components/organism/Login/components/WidgetLayout/styled.js +18 -18
- package/es/components/organism/Login/styled.js +115 -115
- package/es/components/organism/Menu/styled.js +6 -6
- package/es/components/organism/ModifyColumnModal/styled.js +132 -132
- package/es/components/organism/Notification/styled.js +155 -155
- package/es/components/organism/PreviewCollections/Messages/SkeletonMessage/styled.js +14 -14
- package/es/components/organism/PreviewCollections/WhatsappMessage/CarouselMessage/styled.js +63 -63
- package/es/components/organism/PreviewCollections/constants.js +50 -50
- package/es/components/organism/PreviewCollections/styled.js +16 -16
- package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +78 -78
- package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +52 -52
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +18 -18
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +77 -77
- package/es/components/organism/PreviewTemplateModal/styled.js +21 -21
- package/es/components/organism/SQLGeneration/components/styled.js +354 -354
- package/es/components/organism/SQLGeneration/index.scss +1 -1
- package/es/components/organism/SQLGeneration/integrations/AceEditor/index.scss +4 -4
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +11 -11
- package/es/components/organism/Table/CrossTabTable/styled.js +11 -11
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +17 -17
- package/es/components/organism/Table/ExplorePivotTable/styled.js +11 -11
- package/es/components/organism/TextEditor/TextEditor.d.ts +10 -0
- package/es/components/organism/TextEditor/TextEditor.js +388 -0
- package/es/components/organism/TextEditor/__mocks__/text-block.settings.json +320 -0
- package/es/components/organism/TextEditor/__mocks__/text-contennt.d.ts +1 -0
- package/es/components/organism/TextEditor/__mocks__/text-contennt.js +47 -0
- package/es/components/organism/TextEditor/constants.d.ts +196 -0
- package/es/components/organism/TextEditor/constants.js +398 -0
- package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +25 -0
- package/es/components/organism/TextEditor/extensions/BackgroundColor.js +43 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +18 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +81 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +15 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +35 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/index.d.ts +2 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/index.js +2 -0
- package/es/components/organism/TextEditor/extensions/ClearFormatting.d.ts +16 -0
- package/es/components/organism/TextEditor/extensions/ClearFormatting.js +30 -0
- package/es/components/organism/TextEditor/extensions/Color.d.ts +6 -0
- package/es/components/organism/TextEditor/extensions/Color.js +34 -0
- package/es/components/organism/TextEditor/extensions/Emoji.d.ts +57 -0
- package/es/components/organism/TextEditor/extensions/Emoji.js +184 -0
- package/es/components/organism/TextEditor/extensions/FontFamily.d.ts +6 -0
- package/es/components/organism/TextEditor/extensions/FontFamily.js +36 -0
- package/es/components/organism/TextEditor/extensions/FontSize.d.ts +31 -0
- package/es/components/organism/TextEditor/extensions/FontSize.js +46 -0
- package/es/components/organism/TextEditor/extensions/FontWeight.d.ts +23 -0
- package/es/components/organism/TextEditor/extensions/FontWeight.js +41 -0
- package/es/components/organism/TextEditor/extensions/Indent.d.ts +21 -0
- package/es/components/organism/TextEditor/extensions/Indent.js +63 -0
- package/es/components/organism/TextEditor/extensions/LetterSpacing.d.ts +32 -0
- package/es/components/organism/TextEditor/extensions/LetterSpacing.js +48 -0
- package/es/components/organism/TextEditor/extensions/LineHeight.d.ts +20 -0
- package/es/components/organism/TextEditor/extensions/LineHeight.js +101 -0
- package/es/components/organism/TextEditor/extensions/Link.d.ts +22 -0
- package/es/components/organism/TextEditor/extensions/Link.js +178 -0
- package/es/components/organism/TextEditor/extensions/ListItem.d.ts +10 -0
- package/es/components/organism/TextEditor/extensions/ListItem.js +93 -0
- package/es/components/organism/TextEditor/extensions/ListItemMarker.d.ts +13 -0
- package/es/components/organism/TextEditor/extensions/ListItemMarker.js +174 -0
- package/es/components/organism/TextEditor/extensions/OrderedList.d.ts +56 -0
- package/es/components/organism/TextEditor/extensions/OrderedList.js +187 -0
- package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +28 -0
- package/es/components/organism/TextEditor/extensions/SmartTag.js +103 -0
- package/es/components/organism/TextEditor/extensions/StyleMemory.d.ts +36 -0
- package/es/components/organism/TextEditor/extensions/StyleMemory.js +163 -0
- package/es/components/organism/TextEditor/extensions/TextTransform.d.ts +30 -0
- package/es/components/organism/TextEditor/extensions/TextTransform.js +36 -0
- package/es/components/organism/TextEditor/extensions/UnorderedList.d.ts +55 -0
- package/es/components/organism/TextEditor/extensions/UnorderedList.js +176 -0
- package/es/components/organism/TextEditor/hooks/index.d.ts +6 -0
- package/es/components/organism/TextEditor/hooks/index.js +6 -0
- package/es/components/organism/TextEditor/hooks/useColorSet.d.ts +4 -0
- package/es/components/organism/TextEditor/hooks/useColorSet.js +29 -0
- package/es/components/organism/TextEditor/hooks/useDocumentState.d.ts +18 -0
- package/es/components/organism/TextEditor/hooks/useDocumentState.js +42 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +26 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.js +69 -0
- package/es/components/organism/TextEditor/hooks/usePersistence.d.ts +31 -0
- package/es/components/organism/TextEditor/hooks/usePersistence.js +169 -0
- package/es/components/organism/TextEditor/hooks/useStyleMemory.d.ts +6 -0
- package/es/components/organism/TextEditor/hooks/useStyleMemory.js +42 -0
- package/es/components/organism/TextEditor/hooks/useStylePresets.d.ts +34 -0
- package/es/components/organism/TextEditor/hooks/useStylePresets.js +83 -0
- package/es/components/organism/TextEditor/index.d.ts +18 -0
- package/es/components/organism/TextEditor/index.js +8 -0
- package/es/components/organism/TextEditor/index.scss +65 -0
- package/es/components/organism/TextEditor/provider.d.ts +15 -0
- package/es/components/organism/TextEditor/provider.js +36 -0
- package/es/components/organism/TextEditor/store.d.ts +20 -0
- package/es/components/organism/TextEditor/store.js +40 -0
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/froala-legacy-format.settings.json +95 -0
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.d.ts +111 -0
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.js +82 -0
- package/es/components/organism/TextEditor/stories/shared.d.ts +64 -0
- package/es/components/organism/TextEditor/stories/shared.js +57 -0
- package/es/components/organism/TextEditor/styled.d.ts +9 -0
- package/es/components/organism/TextEditor/styled.js +61 -0
- package/es/components/organism/TextEditor/types.d.ts +311 -0
- package/es/components/organism/TextEditor/types.js +6 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +3 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +114 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Button/Button.d.ts +9 -0
- package/es/components/organism/TextEditor/ui/Button/Button.js +35 -0
- package/es/components/organism/TextEditor/ui/Button/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Button/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Button/types.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Button/types.js +1 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.d.ts +39 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.js +131 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/index.js +1 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.d.ts +17 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.js +51 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.d.ts +11 -0
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +66 -0
- package/es/components/organism/TextEditor/ui/Emoji/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Emoji/index.js +2 -0
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +71 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontItem.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontItem.js +27 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.d.ts +16 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +102 -0
- package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/FontPopover/styled.js +36 -0
- package/es/components/organism/TextEditor/ui/FontPopover/types.d.ts +35 -0
- package/es/components/organism/TextEditor/ui/FontPopover/types.js +1 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.d.ts +16 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.js +61 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/index.js +1 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.d.ts +9 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.js +126 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Popover/Popover.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Popover/Popover.js +9 -0
- package/es/components/organism/TextEditor/ui/Popover/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Popover/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Select/Select.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Select/Select.js +7 -0
- package/es/components/organism/TextEditor/ui/Select/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Select/index.js +1 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.js +44 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.js +1 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.js +58 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.d.ts +19 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.js +1 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.d.ts +30 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +75 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.d.ts +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.js +85 -0
- package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.js +39 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +93 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +20 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +32 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +41 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +8 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +51 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.js +21 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.js +17 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.js +28 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LineSpacingAction.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LineSpacingAction.js +45 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.js +17 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.js +67 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.js +17 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.d.ts +7 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.js +26 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.js +26 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.js +3 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.js +29 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.d.ts +14 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.js +22 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.js +36 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.d.ts +7 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +24 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +24 -0
- package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Toolbar/index.js +2 -0
- package/es/components/organism/TextEditor/utils/documentState.d.ts +73 -0
- package/es/components/organism/TextEditor/utils/documentState.js +149 -0
- package/es/components/organism/TextEditor/utils/font.d.ts +74 -0
- package/es/components/organism/TextEditor/utils/font.js +147 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +87 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.js +460 -0
- package/es/components/organism/TextEditor/utils/indent.d.ts +11 -0
- package/es/components/organism/TextEditor/utils/indent.js +56 -0
- package/es/components/organism/TextEditor/utils/index.d.ts +8 -0
- package/es/components/organism/TextEditor/utils/index.js +16 -0
- package/es/components/organism/TextEditor/utils/link.d.ts +116 -0
- package/es/components/organism/TextEditor/utils/link.js +304 -0
- package/es/components/organism/TextEditor/utils/menu.d.ts +134 -0
- package/es/components/organism/TextEditor/utils/menu.js +321 -0
- package/es/components/organism/TextEditor/utils/selection.d.ts +25 -0
- package/es/components/organism/TextEditor/utils/selection.js +58 -0
- package/es/components/organism/TextEditor/utils/shared.d.ts +13 -0
- package/es/components/organism/TextEditor/utils/shared.js +52 -0
- package/es/components/organism/TextEditor/utils/smartTag.d.ts +49 -0
- package/es/components/organism/TextEditor/utils/smartTag.js +90 -0
- package/es/components/organism/TextEditor/utils/style.d.ts +78 -0
- package/es/components/organism/TextEditor/utils/style.js +193 -0
- package/es/components/organism/TicketEditor/styled.js +850 -850
- package/es/components/organism/TicketEditorV2/styled.js +839 -839
- package/es/components/organism/index.d.ts +1 -0
- package/es/components/organism/index.js +1 -0
- package/es/components/organism/index.scss +2 -1
- package/es/components/template/Layout/Layout.js +10 -10
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/components/OldLeftMenu/styled.js +73 -73
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/styled.js +39 -39
- package/es/components/template/Layout/components/RecommendationWorkspace/components/RecommendationImage/styled.js +61 -61
- package/es/components/template/Layout/components/RecommendationWorkspace/styled.js +16 -16
- package/es/components/template/Layout/styled.js +84 -84
- package/es/components/template/TemplateListing/components/BlankTemplate/styled.js +21 -21
- package/es/components/template/TemplateListing/components/CategoryListing/styled.js +123 -123
- package/es/components/template/TemplateListing/components/Empty/styled.js +20 -20
- package/es/components/template/TemplateListing/stories/demo/styled.js +4 -4
- package/es/components/template/TemplateListing/styled/index.js +40 -40
- package/es/constants/index.d.ts +1 -0
- package/es/constants/index.js +1 -0
- package/es/constants/web.d.ts +8 -0
- package/es/constants/web.js +57 -0
- package/es/hooks/index.d.ts +4 -0
- package/es/hooks/index.js +4 -0
- package/es/hooks/useBroadcastedLocalStorage.d.ts +5 -0
- package/es/hooks/useBroadcastedLocalStorage.js +71 -0
- package/es/hooks/useElementSize.d.ts +7 -0
- package/es/hooks/useElementSize.js +56 -0
- package/es/hooks/useEyedropper/attach.d.ts +4 -0
- package/es/hooks/useEyedropper/attach.js +9 -0
- package/es/hooks/useEyedropper/eyedropper.d.ts +69 -0
- package/es/hooks/useEyedropper/eyedropper.js +205 -0
- package/es/hooks/useEyedropper/index.d.ts +2 -0
- package/es/hooks/useEyedropper/index.js +7 -0
- package/es/hooks/useEyedropper/support.d.ts +1 -0
- package/es/hooks/useEyedropper/support.js +3 -0
- package/es/hooks/useEyedropper/types.d.ts +9 -0
- package/es/hooks/useEyedropper/types.js +1 -0
- package/es/hooks/useEyedropper/useEyedropper.d.ts +8 -0
- package/es/hooks/useEyedropper/useEyedropper.js +50 -0
- package/es/hooks/useEyedropper/utils.d.ts +11 -0
- package/es/hooks/useEyedropper/utils.js +17 -0
- package/es/hooks/useIsMounted.d.ts +1 -0
- package/es/hooks/useIsMounted.js +11 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locales/en/google-sheet.json +109 -8
- package/es/locales/i18n.d.ts +307 -4
- package/es/locales/ja/google-sheet.json +301 -200
- package/es/locales/vi/google-sheet.json +118 -17
- package/es/providers/ConfigProvider/GlobalStyle.js +1249 -1249
- package/es/styled/common.js +51 -51
- package/es/tests/styled.js +4 -4
- package/es/types/index.d.ts +9 -0
- package/es/utils/common.d.ts +15 -9
- package/es/utils/common.js +62 -24
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/es/utils/variables.js +7 -7
- package/es/utils/web.d.ts +80 -0
- package/es/utils/web.js +226 -0
- package/package.json +276 -266
- package/CHANGELOG.md +0 -63
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TextEditorButton } from '../../Button';
|
|
3
|
+
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
4
|
+
import { useEditorState } from '@tiptap/react';
|
|
5
|
+
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
6
|
+
const OutdentIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M10.8889 17.5556H22V15.3333H10.8889V17.5556ZM2 12L6.44444 16.4444V7.55556L2 12ZM2 22H22V19.7778H2V22ZM2 2V4.22222H22V2H2ZM10.8889 8.66667H22V6.44444H10.8889V8.66667ZM10.8889 13.1111H22V10.8889H10.8889V13.1111Z", fill: "currentColor" }) }));
|
|
7
|
+
export const OutdentAction = ({ editor }) => {
|
|
8
|
+
const { disabled } = useEditorState({
|
|
9
|
+
editor,
|
|
10
|
+
selector: ({ editor: editorInstance }) => ({
|
|
11
|
+
disabled: !editorInstance.can().chain().focus().outdent().run(),
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
return (_jsx(TextEditorButton, { disabled: disabled, icon: _jsx(OutdentIcon, { size: 18 }), onClick: () => editor.chain().focus().outdent().run(), tooltipProps: {
|
|
15
|
+
title: `${TOOLTIPS.OUTDENT.TITLE} (${TOOLTIPS.OUTDENT.SHORTCUT})`,
|
|
16
|
+
} }));
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Editor } from '@tiptap/core';
|
|
3
|
+
export interface SmartTagActionProps {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const SmartTagAction: (props: SmartTagActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TextEditorButton } from '../../Button';
|
|
3
|
+
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
4
|
+
import { useEditorState } from '@tiptap/react';
|
|
5
|
+
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
6
|
+
const BracesIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M8.33488 22C7.24726 21.7935 6.27276 21.1962 5.59506 20.3208C4.91737 19.4454 4.58329 18.3524 4.65581 17.2477V15.2244C4.65581 13.8484 4.10388 13.1605 3 13.1605V10.8349C4.10388 10.8349 4.65581 10.1434 4.65581 8.76047V6.61395C4.62732 5.54392 4.96584 4.49636 5.61512 3.64535C6.33032 2.82782 7.28199 2.25284 8.33837 2L8.98256 3.79884C8.12442 4.12597 7.67829 5.04225 7.64419 6.54767V8.76512C7.69096 9.43175 7.53511 10.0969 7.19707 10.6734C6.85903 11.2499 6.35461 11.7107 5.75 11.9953C6.35481 12.282 6.85892 12.7447 7.19629 13.3228C7.53366 13.9008 7.68856 14.5673 7.6407 15.2349V17.4442C7.67481 18.9496 8.12093 19.8659 8.97907 20.193L8.33488 22ZM15.0186 20.1907C15.8767 19.8636 16.3229 18.9473 16.357 17.4419V15.2244C16.309 14.5567 16.4653 13.8903 16.8051 13.3135C17.1448 12.7367 17.652 12.277 18.2593 11.9953C17.6523 11.7135 17.1453 11.2537 16.8057 10.677C16.4662 10.1002 16.3101 9.43383 16.3581 8.76628V6.54884C16.324 5.04341 15.8779 4.12713 15.0198 3.8L15.664 2.00116C16.7345 2.24964 17.6974 2.83439 18.4116 3.66977C19.0587 4.54795 19.3868 5.62058 19.3419 6.71047V8.76512C19.3419 10.1481 19.8938 10.8395 20.9977 10.8395V13.1651C19.8938 13.1651 19.3419 13.85 19.3419 15.2198V17.3907C19.382 18.4722 19.0328 19.5322 18.3577 20.3781C17.6825 21.2239 16.7263 21.7994 15.6628 22L15.0186 20.1907Z", fill: "currentColor" }) }));
|
|
7
|
+
export const SmartTagAction = (props) => {
|
|
8
|
+
const { editor, onClick } = props;
|
|
9
|
+
const { isActive } = useEditorState({
|
|
10
|
+
editor,
|
|
11
|
+
selector: ({ editor: editorInstance }) => ({
|
|
12
|
+
isActive: editorInstance.isActive('smartTag'),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
return (_jsx(TextEditorButton, { onClick: onClick, isActive: isActive, icon: _jsx(BracesIcon, { size: 18 }), tooltipProps: {
|
|
16
|
+
title: TOOLTIPS.SMART_TAG.TITLE,
|
|
17
|
+
} }));
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TextEditorButton } from '../../Button';
|
|
3
|
+
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
4
|
+
import { useEditorState } from '@tiptap/react';
|
|
5
|
+
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
6
|
+
const StrikethroughIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M9.77778 21H14.2222V17.6H9.77778V21ZM4.22222 4V7.4H9.77778V10.8H14.2222V7.4H19.7778V4H4.22222ZM2 15.3333H22V13.0667H2V15.3333Z", fill: "currentColor" }) }));
|
|
7
|
+
export const StrikeAction = ({ editor }) => {
|
|
8
|
+
const { isStrike, disabled } = useEditorState({
|
|
9
|
+
editor,
|
|
10
|
+
selector: ({ editor: editorInstance }) => ({
|
|
11
|
+
isStrike: editorInstance.isActive('strike'),
|
|
12
|
+
disabled: !editorInstance.can().chain().focus().toggleStrike().run(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
return (_jsx(TextEditorButton, { icon: _jsx(StrikethroughIcon, { size: 18 }), disabled: disabled, isActive: isStrike, onClick: () => editor.chain().focus().toggleStrike().run(), tooltipProps: {
|
|
16
|
+
title: `${TOOLTIPS.STRIKE.TITLE} (${TOOLTIPS.STRIKE.SHORTCUT})`,
|
|
17
|
+
} }));
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
3
|
+
import { TextEditorButton } from '../../Button';
|
|
4
|
+
import { useEditorState } from '@tiptap/react';
|
|
5
|
+
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
6
|
+
const SubscriptIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M20.8318 19.625H18.4953V20.8125H22V22H17.3271V19.625C17.3271 18.9719 17.8528 18.4375 18.4953 18.4375H20.8318V17.25H17.3271V16.0625H20.8318C21.4743 16.0625 22 16.5969 22 17.25V18.4375C22 19.0906 21.4743 19.625 20.8318 19.625ZM2 19.625H5.10748L9.07944 13.1887H9.21963L13.1916 19.625H16.2991L10.8668 10.9919L15.9369 3H12.8061L9.21963 8.92562H9.07944L5.46963 3H2.36215L7.40888 10.9919L2 19.625Z", fill: "currentColor" }) }));
|
|
7
|
+
export const SubscriptAction = ({ editor }) => {
|
|
8
|
+
const { isSubscript, isSuperscript, disabled } = useEditorState({
|
|
9
|
+
editor,
|
|
10
|
+
selector: ({ editor: editorInstance }) => ({
|
|
11
|
+
isSubscript: editorInstance.isActive('subscript'),
|
|
12
|
+
isSuperscript: editorInstance.isActive('superscript'),
|
|
13
|
+
disabled: !editorInstance.can().chain().focus().toggleSubscript().run(),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
return (_jsx(TextEditorButton, { onClick: () => {
|
|
17
|
+
if (isSuperscript) {
|
|
18
|
+
editor.chain().focus().toggleSuperscript().toggleSubscript().run();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
editor.chain().focus().toggleSubscript().run();
|
|
22
|
+
}
|
|
23
|
+
}, disabled: disabled, isActive: isSubscript, icon: _jsx(SubscriptIcon, { size: 18 }), tooltipProps: {
|
|
24
|
+
title: `${TOOLTIPS.SUBSCRIPT.TITLE} (${TOOLTIPS.SUBSCRIPT.SHORTCUT})`,
|
|
25
|
+
} }));
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
3
|
+
import { TextEditorButton } from '../../Button';
|
|
4
|
+
import { useEditorState } from '@tiptap/react';
|
|
5
|
+
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
6
|
+
const SuperscriptIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M20.8318 6.5625H18.4953V7.75H22V8.9375H17.3271V6.5625C17.3271 5.90937 17.8528 5.375 18.4953 5.375H20.8318V4.1875H17.3271V3H20.8318C21.4743 3 22 3.53437 22 4.1875V5.375C22 6.02813 21.4743 6.5625 20.8318 6.5625ZM2 22H5.10748L9.07944 15.5637H9.21963L13.1916 22H16.2991L10.8668 13.3669L15.9369 5.375H12.8061L9.21963 11.3006H9.07944L5.46963 5.375H2.36215L7.40888 13.3669L2 22Z", fill: "currentColor" }) }));
|
|
7
|
+
export const SuperscriptAction = ({ editor }) => {
|
|
8
|
+
const { isSuperscript, isSubscript, disabled } = useEditorState({
|
|
9
|
+
editor,
|
|
10
|
+
selector: ({ editor: editorInstance }) => ({
|
|
11
|
+
isSuperscript: editorInstance.isActive('superscript'),
|
|
12
|
+
isSubscript: editorInstance.isActive('subscript'),
|
|
13
|
+
disabled: !editorInstance.can().chain().focus().toggleSuperscript().run(),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
return (_jsx(TextEditorButton, { onClick: () => {
|
|
17
|
+
if (isSubscript) {
|
|
18
|
+
editor.chain().focus().toggleSubscript().toggleSuperscript().run();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
editor.chain().focus().toggleSuperscript().run();
|
|
22
|
+
}
|
|
23
|
+
}, disabled: disabled, isActive: isSuperscript, icon: _jsx(SuperscriptIcon, { size: 18 }), tooltipProps: {
|
|
24
|
+
title: `${TOOLTIPS.SUPERSCRIPT.TITLE} (${TOOLTIPS.SUBSCRIPT.SHORTCUT})`,
|
|
25
|
+
} }));
|
|
26
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Flex } from 'antd';
|
|
3
|
+
import { ColorPicker } from '../../ColorPicker';
|
|
4
|
+
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
5
|
+
import { useRef } from 'react';
|
|
6
|
+
import tinycolor from 'tinycolor2';
|
|
7
|
+
import { TextEditorButton } from '../../Button';
|
|
8
|
+
import { useEditorState } from '@tiptap/react';
|
|
9
|
+
const BrushCleaningIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M20.7879 12.7767C20.7879 13.3592 20.7205 13.9175 20.5859 14.4515C20.4512 14.9854 20.266 15.4951 20.0303 15.9806L18.4646 14.5243C18.5657 14.2492 18.6414 13.9701 18.6919 13.6869C18.7424 13.4037 18.7677 13.1003 18.7677 12.7767C18.7677 12.0162 18.6204 11.2961 18.3258 10.6165C18.0311 9.93689 17.5892 9.3301 17 8.79612L12.7071 4.71845L10.4848 6.80583L9.07071 5.4466L12.7071 2L18.4141 7.38835C19.1549 8.06796 19.7357 8.87298 20.1566 9.8034C20.5774 10.7338 20.7879 11.7249 20.7879 12.7767ZM20.5859 22L17.4545 18.9903C16.7643 19.4595 16.0236 19.8196 15.2323 20.0704C14.4411 20.3212 13.5993 20.4466 12.7071 20.4466C10.468 20.4466 8.56145 19.6982 6.98737 18.2015C5.4133 16.7047 4.62626 14.8964 4.62626 12.7767C4.62626 11.9515 4.76094 11.1586 5.0303 10.3981C5.29966 9.63754 5.7037 8.90938 6.24242 8.21359L2 4.13592L3.41414 2.7767L22 20.6408L20.5859 22ZM12.7071 18.5049C13.3131 18.5049 13.8897 18.4239 14.4369 18.2621C14.984 18.1003 15.5017 17.8738 15.9899 17.5825L7.65657 9.62136C7.30303 10.1392 7.0463 10.657 6.88636 11.1748C6.72643 11.6926 6.64646 12.2265 6.64646 12.7767C6.64646 14.3625 7.23569 15.7136 8.41414 16.8301C9.59259 17.9466 11.0236 18.5049 12.7071 18.5049Z", fill: "currentColor" }) }));
|
|
10
|
+
const HighlighterIcon = ({ size, color = 'currentColor' }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: [_jsx("path", { d: "M2 24V20H22V24H2Z", fill: color }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M16.7246 12.6748L12 17.4248C11.6001 17.8247 11.1294 18.0253 10.5879 18.0254C10.0462 18.0254 9.5748 17.8248 9.1748 17.4248L8.5 18H3.5L6.65039 14.875C6.25039 14.475 6.04206 13.9958 6.02539 13.4375C6.00873 12.8793 6.19974 12.4 6.59961 12L11.3252 7.27539L16.7246 12.6748ZM8 13.4004L10.5752 16L14.5996 12L12 9.40039L8 13.4004Z", fill: "currentColor" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.4121 2C17.9537 2 18.4252 2.19968 18.8252 2.59961L21.4248 5.1748C21.8248 5.5748 22.0254 6.04622 22.0254 6.58789C22.0253 7.12939 21.8247 7.6001 21.4248 8L16.7246 12.6748L11.3252 7.27539L16 2.59961C16.3999 2.19984 16.8707 2.0001 17.4121 2ZM13.4248 8L16 10.5752L20 6.59961L17.4004 4L13.4248 8Z", fill: "currentColor" })] }));
|
|
11
|
+
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
12
|
+
export const TextBackColorAction = ({ editor }) => {
|
|
13
|
+
const ref = useRef(null);
|
|
14
|
+
const { activeColor } = useEditorState({
|
|
15
|
+
editor,
|
|
16
|
+
selector: ({ editor: editorInstance }) => ({
|
|
17
|
+
activeColor: editorInstance.getAttributes('textStyle').backgroundColor,
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
const handleClearBackgroundColor = () => {
|
|
21
|
+
editor.chain().focus().unsetBackgroundColor().run();
|
|
22
|
+
ref.current?.setOpen(false);
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(ColorPicker, { ref: ref, value: activeColor, onChange: v => editor.chain().focus().setBackgroundColor(v).run(), popoverProps: {
|
|
25
|
+
content: ({ colorGrid, usedColors, customColorPicker }) => (_jsxs(Flex, { vertical: true, gap: 8, children: [colorGrid, usedColors, customColorPicker, _jsx(Button, { icon: _jsx(BrushCleaningIcon, { size: 18 }), onClick: handleClearBackgroundColor, type: "text", children: "None" })] })),
|
|
26
|
+
}, children: _jsx(TextEditorButton, { tooltipProps: {
|
|
27
|
+
title: TOOLTIPS.HIGHLIGHT.TITLE,
|
|
28
|
+
}, icon: _jsx(HighlighterIcon, { color: tinycolor(activeColor).isValid() ? activeColor : 'transparent', size: 18 }) }) }));
|
|
29
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Editor } from '@tiptap/core';
|
|
3
|
+
interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
4
|
+
color?: string;
|
|
5
|
+
textColor?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const TextColorIcon: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export interface TextColorActionProps {
|
|
10
|
+
editor: Editor;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const TextColorAction: ({ editor, defaultValue, }: TextColorActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ColorPicker } from '../../ColorPicker';
|
|
3
|
+
import { DEFAULT_TEXT_STYLE, TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
4
|
+
import tinycolor from 'tinycolor2';
|
|
5
|
+
import { TextEditorButton } from '../../Button';
|
|
6
|
+
import { useEditorState } from '@tiptap/react';
|
|
7
|
+
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
8
|
+
export const TextColorIcon = (props) => {
|
|
9
|
+
const { color, textColor = 'currentColor', size = 24, ...rest } = props;
|
|
10
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", ...rest, children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M19 18H16.415L15.0688 13.8862H8.98483L7.58504 18H5L10.6538 2H13.3462L19 18ZM9.73888 11.6004H14.2611L12.0536 4.97098H11.9464L9.73888 11.6004Z", fill: "currentColor" }), _jsx("path", { d: "M2 24V20H22V24H2Z", fill: textColor })] }));
|
|
11
|
+
};
|
|
12
|
+
export const TextColorAction = ({ editor, defaultValue = DEFAULT_TEXT_STYLE.color, }) => {
|
|
13
|
+
const { activeColor } = useEditorState({
|
|
14
|
+
editor,
|
|
15
|
+
selector: ({ editor: editorInstance }) => ({
|
|
16
|
+
activeColor: editorInstance.getAttributes('textStyle').color,
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
return (_jsx(ColorPicker, { value: activeColor, onChange: v => editor.chain().focus().setColor(v).run(), children: _jsx(TextEditorButton, { icon: _jsx(TextColorIcon, { size: 18, textColor: tinycolor(activeColor).isValid() ? activeColor : defaultValue }), tooltipProps: {
|
|
20
|
+
title: TOOLTIPS.TEXT_COLOR.TITLE,
|
|
21
|
+
} }) }));
|
|
22
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
3
|
+
import { DropdownButton } from '../../DropdownButton';
|
|
4
|
+
import { useEditorState } from '@tiptap/react';
|
|
5
|
+
const { TEXT_TRANSFORM, TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
6
|
+
const TextTransformIcon = ({ size }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: [_jsx("path", { d: "M21.8775 10.3857V12.3506H15.9394V10.3857H21.8775ZM17.4098 7.81406H20.1243V17.6674C20.1243 17.9692 20.162 18.2004 20.2374 18.3609C20.3191 18.5214 20.4385 18.6338 20.5956 18.698C20.7527 18.7558 20.9506 18.7847 21.1894 18.7847C21.3591 18.7847 21.5099 18.7783 21.6418 18.7654C21.7801 18.7462 21.8963 18.7269 21.9906 18.7076L22 20.7496C21.7675 20.8266 21.5162 20.8876 21.246 20.9326C20.9758 20.9775 20.6773 21 20.3505 21C19.7536 21 19.232 20.9005 18.7859 20.7014C18.346 20.4959 18.0067 20.1685 17.7679 19.719C17.5292 19.2695 17.4098 18.6787 17.4098 17.9467V7.81406Z", fill: "currentColor" }), _jsx("path", { d: "M2 3V6.59617H8.64727V20.9808H12.2836V6.59617H18.9309V3H2Z", fill: "currentColor" })] }));
|
|
7
|
+
export const TextTransformAction = ({ editor }) => {
|
|
8
|
+
const { textTransform } = useEditorState({
|
|
9
|
+
editor,
|
|
10
|
+
selector: ({ editor: editorInstance }) => ({
|
|
11
|
+
textTransform: editorInstance.getAttributes('textStyle').textTransform,
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
return (_jsx(DropdownButton, { tooltipProps: {
|
|
15
|
+
title: TOOLTIPS.TEXT_TRANSFORM.TITLE,
|
|
16
|
+
}, value: textTransform, options: [
|
|
17
|
+
{
|
|
18
|
+
label: TEXT_TRANSFORM.OPTIONS.UPPERCASE.LABEL,
|
|
19
|
+
value: TEXT_TRANSFORM.OPTIONS.UPPERCASE.VALUE,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: TEXT_TRANSFORM.OPTIONS.LOWERCASE.LABEL,
|
|
23
|
+
value: TEXT_TRANSFORM.OPTIONS.LOWERCASE.VALUE,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: TEXT_TRANSFORM.OPTIONS.CAPITALIZE.LABEL,
|
|
27
|
+
value: TEXT_TRANSFORM.OPTIONS.CAPITALIZE.VALUE,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: TEXT_TRANSFORM.OPTIONS.NONE.LABEL,
|
|
31
|
+
value: TEXT_TRANSFORM.OPTIONS.NONE.VALUE,
|
|
32
|
+
},
|
|
33
|
+
], onClickOption: v => {
|
|
34
|
+
editor.chain().focus().setTextTransform(v).run();
|
|
35
|
+
}, children: _jsx(TextTransformIcon, { size: 18 }) }));
|
|
36
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TextEditorButton } from '../../Button';
|
|
3
|
+
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
4
|
+
import { useEditorState } from '@tiptap/react';
|
|
5
|
+
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
6
|
+
const UnderlineIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M4 22V19.7778H20V22H4ZM12 17.5556C10.0762 17.5556 8.58095 16.9722 7.51429 15.8056C6.44762 14.6389 5.91429 13.0926 5.91429 11.1667V2H8.85714V11.3333C8.85714 12.3704 9.12381 13.213 9.65714 13.8611C10.1905 14.5093 10.9714 14.8333 12 14.8333C13.0286 14.8333 13.8095 14.5093 14.3429 13.8611C14.8762 13.213 15.1429 12.3704 15.1429 11.3333V2H18.0857V11.1667C18.0857 13.0926 17.5524 14.6389 16.4857 15.8056C15.419 16.9722 13.9238 17.5556 12 17.5556Z", fill: "currentColor" }) }));
|
|
7
|
+
export const UnderlineAction = ({ editor }) => {
|
|
8
|
+
const { isUnderline, disabled } = useEditorState({
|
|
9
|
+
editor,
|
|
10
|
+
selector: ({ editor: editorInstance }) => ({
|
|
11
|
+
isUnderline: editorInstance.isActive('underline'),
|
|
12
|
+
disabled: !editorInstance.can().chain().focus().toggleUnderline().run(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
return (_jsx(TextEditorButton, { onClick: () => editor.chain().focus().toggleUnderline().run(), disabled: disabled, isActive: isUnderline, icon: _jsx(UnderlineIcon, { size: 18 }), tooltipProps: {
|
|
16
|
+
title: `${TOOLTIPS.UNDERLINE.TITLE} (${TOOLTIPS.UNDERLINE.SHORTCUT})`,
|
|
17
|
+
} }));
|
|
18
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Editor } from '@tiptap/core';
|
|
3
|
+
interface UnsetLinkActionProps {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
}
|
|
6
|
+
export declare const UnsetLinkAction: import("react").MemoExoticComponent<(props: UnsetLinkActionProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Hooks
|
|
3
|
+
import { LinkOffIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
4
|
+
import { TextEditorButton } from '../../Button';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { useEditorState } from '@tiptap/react';
|
|
7
|
+
export const UnsetLinkAction = memo((props) => {
|
|
8
|
+
const { editor } = props;
|
|
9
|
+
const { disabled } = useEditorState({
|
|
10
|
+
editor,
|
|
11
|
+
selector: ({ editor: editorInstance }) => ({
|
|
12
|
+
disabled: !editorInstance.can().chain().focus().unsetCustomLink().run(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
return (_jsx(TextEditorButton, { tooltipProps: {
|
|
16
|
+
title: 'Remove link',
|
|
17
|
+
}, disabled: disabled, icon: _jsx(LinkOffIcon, { size: 18 }), onClick: () => editor.chain().unsetCustomLink().run() }));
|
|
18
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from './BoldAction';
|
|
2
|
+
export * from './BulletListAction';
|
|
3
|
+
export * from './ClearFormattingAction';
|
|
4
|
+
export * from './FontFamilyAction';
|
|
5
|
+
export * from './FontSizeAction';
|
|
6
|
+
export * from './ItalicAction';
|
|
7
|
+
export * from './StrikeAction';
|
|
8
|
+
export * from './SuperscriptAction';
|
|
9
|
+
export * from './SubscriptAction';
|
|
10
|
+
export * from './TextTransformAction';
|
|
11
|
+
export * from './LinkAction';
|
|
12
|
+
export * from './SmartTagAction';
|
|
13
|
+
export * from './TextColorAction';
|
|
14
|
+
export * from './OrderedListAction';
|
|
15
|
+
export * from './TextAlignAction';
|
|
16
|
+
export * from './IndentAction';
|
|
17
|
+
export * from './OutdentAction';
|
|
18
|
+
export * from './UnderlineAction';
|
|
19
|
+
export * from './EmojiAction';
|
|
20
|
+
export * from './HistoryAction';
|
|
21
|
+
export * from './LetterSpacing';
|
|
22
|
+
export * from './TextBackgroundColorAction';
|
|
23
|
+
export * from './UnsetLink';
|
|
24
|
+
export * from './LineSpacingAction';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from './BoldAction';
|
|
2
|
+
export * from './BulletListAction';
|
|
3
|
+
export * from './ClearFormattingAction';
|
|
4
|
+
export * from './FontFamilyAction';
|
|
5
|
+
export * from './FontSizeAction';
|
|
6
|
+
export * from './ItalicAction';
|
|
7
|
+
export * from './StrikeAction';
|
|
8
|
+
export * from './SuperscriptAction';
|
|
9
|
+
export * from './SubscriptAction';
|
|
10
|
+
export * from './TextTransformAction';
|
|
11
|
+
export * from './LinkAction';
|
|
12
|
+
export * from './SmartTagAction';
|
|
13
|
+
export * from './TextColorAction';
|
|
14
|
+
export * from './OrderedListAction';
|
|
15
|
+
export * from './TextAlignAction';
|
|
16
|
+
export * from './IndentAction';
|
|
17
|
+
export * from './OutdentAction';
|
|
18
|
+
export * from './UnderlineAction';
|
|
19
|
+
export * from './EmojiAction';
|
|
20
|
+
export * from './HistoryAction';
|
|
21
|
+
export * from './LetterSpacing';
|
|
22
|
+
export * from './TextBackgroundColorAction';
|
|
23
|
+
export * from './UnsetLink';
|
|
24
|
+
export * from './LineSpacingAction';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { EditorState } from '@tiptap/pm/state';
|
|
2
|
+
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
+
import { Editor } from '@tiptap/core';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for document emptiness detection
|
|
6
|
+
*/
|
|
7
|
+
export interface DocumentStateConfig {
|
|
8
|
+
/** Minimum size to consider document as having content */
|
|
9
|
+
minContentSize?: number;
|
|
10
|
+
/** Whether to consider whitespace-only content as empty */
|
|
11
|
+
ignoreWhitespace?: boolean;
|
|
12
|
+
/** Custom validation function */
|
|
13
|
+
customValidator?: (doc: ProseMirrorNode) => boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Calculates the minimum size of an empty document based on schema
|
|
17
|
+
*/
|
|
18
|
+
export declare function calculateEmptyDocumentSize(state: EditorState): number;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if document is effectively empty
|
|
21
|
+
*/
|
|
22
|
+
export declare function isDocumentEmpty(state: EditorState, config?: DocumentStateConfig): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if document has meaningful content
|
|
25
|
+
*/
|
|
26
|
+
export declare function hasDocumentContent(state: EditorState, config?: DocumentStateConfig): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Gets document content statistics
|
|
29
|
+
*/
|
|
30
|
+
export declare function getDocumentStats(state: EditorState): {
|
|
31
|
+
nodeSize: number;
|
|
32
|
+
textLength: number;
|
|
33
|
+
trimmedTextLength: number;
|
|
34
|
+
nodeCount: void;
|
|
35
|
+
isEmpty: boolean;
|
|
36
|
+
emptyDocumentSize: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Document state change detector
|
|
40
|
+
*/
|
|
41
|
+
export declare class DocumentStateTracker {
|
|
42
|
+
private previousState;
|
|
43
|
+
/**
|
|
44
|
+
* Updates tracker with new state and returns changes
|
|
45
|
+
*/
|
|
46
|
+
update(state: EditorState): {
|
|
47
|
+
isEmpty: boolean;
|
|
48
|
+
wasEmpty: boolean;
|
|
49
|
+
becameEmpty: boolean;
|
|
50
|
+
becameNonEmpty: boolean;
|
|
51
|
+
sizeChanged: boolean;
|
|
52
|
+
textLengthChanged: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Resets the tracker
|
|
56
|
+
*/
|
|
57
|
+
reset(): void;
|
|
58
|
+
}
|
|
59
|
+
export declare function isEntireParagraphSelected(editor: Editor): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Helper function to extract text from atom nodes (emoji, smartTag)
|
|
62
|
+
* Used as leafText callback for doc.textBetween()
|
|
63
|
+
*/
|
|
64
|
+
export declare const getTextFromAtomNode: (node: ProseMirrorNode) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Wrapper for doc.textBetween that automatically handles atom nodes (emoji, smartTag)
|
|
67
|
+
* @param state EditorState
|
|
68
|
+
* @param from Start position
|
|
69
|
+
* @param to End position
|
|
70
|
+
* @param blockSeparator Optional separator between blocks (default: '')
|
|
71
|
+
* @returns Text content including atom nodes
|
|
72
|
+
*/
|
|
73
|
+
export declare const textBetween: (state: EditorState, from: number, to: number, blockSeparator?: string) => string;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { LIST_EMOJI } from '../extensions/Emoji';
|
|
2
|
+
/**
|
|
3
|
+
* Default configuration for document state detection
|
|
4
|
+
*/
|
|
5
|
+
const DEFAULT_CONFIG = {
|
|
6
|
+
minContentSize: 4, // Standard ProseMirror empty doc size
|
|
7
|
+
ignoreWhitespace: true,
|
|
8
|
+
customValidator: () => false,
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Calculates the minimum size of an empty document based on schema
|
|
12
|
+
*/
|
|
13
|
+
export function calculateEmptyDocumentSize(state) {
|
|
14
|
+
// Create a minimal document with the same schema
|
|
15
|
+
const emptyDoc = state.schema.topNodeType.createAndFill();
|
|
16
|
+
return emptyDoc?.nodeSize ?? 4;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Checks if document is effectively empty
|
|
20
|
+
*/
|
|
21
|
+
export function isDocumentEmpty(state, config = {}) {
|
|
22
|
+
const { minContentSize, ignoreWhitespace, customValidator } = {
|
|
23
|
+
...DEFAULT_CONFIG,
|
|
24
|
+
...config,
|
|
25
|
+
};
|
|
26
|
+
const { doc } = state;
|
|
27
|
+
// Use custom validator if provided
|
|
28
|
+
if (customValidator(doc)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
// Check document size
|
|
32
|
+
const calculatedMinSize = calculateEmptyDocumentSize(state);
|
|
33
|
+
const effectiveMinSize = minContentSize === 4 ? calculatedMinSize : minContentSize;
|
|
34
|
+
if (doc.nodeSize <= effectiveMinSize) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
// Check if content is only whitespace
|
|
38
|
+
if (ignoreWhitespace) {
|
|
39
|
+
const textContent = doc.textContent.trim();
|
|
40
|
+
return textContent.length === 0;
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Checks if document has meaningful content
|
|
46
|
+
*/
|
|
47
|
+
export function hasDocumentContent(state, config = {}) {
|
|
48
|
+
return !isDocumentEmpty(state, config);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Gets document content statistics
|
|
52
|
+
*/
|
|
53
|
+
export function getDocumentStats(state) {
|
|
54
|
+
const { doc } = state;
|
|
55
|
+
return {
|
|
56
|
+
nodeSize: doc.nodeSize,
|
|
57
|
+
textLength: doc.textContent.length,
|
|
58
|
+
trimmedTextLength: doc.textContent.trim().length,
|
|
59
|
+
nodeCount: doc.nodesBetween(0, doc.nodeSize, () => true),
|
|
60
|
+
isEmpty: isDocumentEmpty(state),
|
|
61
|
+
emptyDocumentSize: calculateEmptyDocumentSize(state),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Document state change detector
|
|
66
|
+
*/
|
|
67
|
+
export class DocumentStateTracker {
|
|
68
|
+
constructor() {
|
|
69
|
+
this.previousState = null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Updates tracker with new state and returns changes
|
|
73
|
+
*/
|
|
74
|
+
update(state) {
|
|
75
|
+
const isEmpty = isDocumentEmpty(state);
|
|
76
|
+
const { nodeSize } = state.doc;
|
|
77
|
+
const textLength = state.doc.textContent.length;
|
|
78
|
+
const result = {
|
|
79
|
+
isEmpty,
|
|
80
|
+
wasEmpty: this.previousState?.isEmpty ?? true,
|
|
81
|
+
becameEmpty: false,
|
|
82
|
+
becameNonEmpty: false,
|
|
83
|
+
sizeChanged: false,
|
|
84
|
+
textLengthChanged: false,
|
|
85
|
+
};
|
|
86
|
+
if (this.previousState) {
|
|
87
|
+
result.becameEmpty = !this.previousState.isEmpty && isEmpty;
|
|
88
|
+
result.becameNonEmpty = this.previousState.isEmpty && !isEmpty;
|
|
89
|
+
result.sizeChanged = this.previousState.nodeSize !== nodeSize;
|
|
90
|
+
result.textLengthChanged = this.previousState.textLength !== textLength;
|
|
91
|
+
}
|
|
92
|
+
this.previousState = { isEmpty, nodeSize, textLength };
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resets the tracker
|
|
97
|
+
*/
|
|
98
|
+
reset() {
|
|
99
|
+
this.previousState = null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export function isEntireParagraphSelected(editor) {
|
|
103
|
+
const { state } = editor;
|
|
104
|
+
const { selection } = state;
|
|
105
|
+
const { from, to } = selection;
|
|
106
|
+
// Nếu không có selection hoặc selection rỗng
|
|
107
|
+
if (from === to) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
// Tìm node paragraph chứa selection
|
|
111
|
+
const $from = state.doc.resolve(from);
|
|
112
|
+
const $to = state.doc.resolve(to);
|
|
113
|
+
// Kiểm tra xem from và to có cùng trong một paragraph không
|
|
114
|
+
const fromParagraph = $from.node($from.depth);
|
|
115
|
+
const toParagraph = $to.node($to.depth);
|
|
116
|
+
// Nếu không cùng paragraph, return false
|
|
117
|
+
if (fromParagraph !== toParagraph || fromParagraph.type.name !== 'paragraph') {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
// Lấy vị trí bắt đầu và kết thúc của paragraph
|
|
121
|
+
const paragraphStart = $from.start($from.depth);
|
|
122
|
+
const paragraphEnd = $from.end($from.depth);
|
|
123
|
+
// Kiểm tra xem selection có bao phủ toàn bộ nội dung của paragraph không
|
|
124
|
+
return from === paragraphStart && to === paragraphEnd;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Helper function to extract text from atom nodes (emoji, smartTag)
|
|
128
|
+
* Used as leafText callback for doc.textBetween()
|
|
129
|
+
*/
|
|
130
|
+
export const getTextFromAtomNode = (node) => {
|
|
131
|
+
if (node.type.name === 'emoji') {
|
|
132
|
+
// Find emoji character from name
|
|
133
|
+
const emojiChar = LIST_EMOJI.find(i => i.name === node.attrs.name)?.emoji;
|
|
134
|
+
return emojiChar || node.attrs.name || '*';
|
|
135
|
+
}
|
|
136
|
+
if (node.type.name === 'smartTag') {
|
|
137
|
+
return node.attrs.content || '*';
|
|
138
|
+
}
|
|
139
|
+
return '*';
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Wrapper for doc.textBetween that automatically handles atom nodes (emoji, smartTag)
|
|
143
|
+
* @param state EditorState
|
|
144
|
+
* @param from Start position
|
|
145
|
+
* @param to End position
|
|
146
|
+
* @param blockSeparator Optional separator between blocks (default: '')
|
|
147
|
+
* @returns Text content including atom nodes
|
|
148
|
+
*/
|
|
149
|
+
export const textBetween = (state, from, to, blockSeparator = '') => state.doc.textBetween(from, to, blockSeparator, getTextFromAtomNode);
|