@antscorp/antsomi-ui 2.0.89 → 2.0.91-text-editor-beta.1
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/es/assets/css/main.scss +4 -2
- 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/AntsomiAIIcon.d.ts +3 -0
- package/es/components/icons/AntsomiAIIcon.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/EmotionFeedbackIcon.d.ts +6 -0
- package/es/components/icons/EmotionFeedbackIcon.js +8 -0
- package/es/components/icons/FeedbackRatingIcon.d.ts +3 -0
- package/es/components/icons/FeedbackRatingIcon.js +7 -0
- package/es/components/icons/LazyIcon/LazyIcon.d.ts +17 -0
- package/es/components/icons/LazyIcon/LazyIcon.js +14 -0
- package/es/components/icons/LinkOffIcon.d.ts +3 -0
- package/es/components/icons/LinkOffIcon.js +7 -0
- package/es/components/icons/MinusIcon.d.ts +3 -0
- package/es/components/icons/MinusIcon.js +7 -0
- package/es/components/icons/NoteNewIcon.d.ts +3 -0
- package/es/components/icons/NoteNewIcon.js +7 -0
- package/es/components/icons/SearchNotFoundIcon.d.ts +3 -0
- package/es/components/icons/SearchNotFoundIcon.js +7 -0
- package/es/components/icons/SummarizeIcon.d.ts +3 -0
- package/es/components/icons/SummarizeIcon.js +7 -0
- package/es/components/icons/index.d.ts +14 -0
- package/es/components/icons/index.js +14 -0
- package/es/components/index.scss +2 -0
- package/es/components/molecules/ColorSetting/index.js +2 -11
- package/es/components/molecules/ColorSetting/styled.d.ts +1 -1
- package/es/components/molecules/ColorSetting/styled.js +9 -1
- package/es/components/molecules/EmojiCollections/CommonCollection/index.js +2 -2
- package/es/components/molecules/EmojiCollections/types.d.ts +1 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +1 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.js +10 -6
- package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
- package/es/components/molecules/EmojiPopover/styled.js +1 -1
- package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +3 -0
- package/es/components/molecules/FontSizeInput/FontSizeInput.js +127 -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 +20 -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/styled.d.ts +7 -0
- package/es/components/molecules/FontSizeInput/styled.js +36 -0
- package/es/components/molecules/FontSizeInput/styles.scss +15 -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/ItemNotFound/ItemNotFound.d.ts +6 -0
- package/es/components/molecules/ItemNotFound/ItemNotFound.js +9 -0
- package/es/components/molecules/ItemNotFound/index.d.ts +1 -0
- package/es/components/molecules/ItemNotFound/index.js +1 -0
- package/es/components/molecules/ItemNotFound/styled.d.ts +4 -0
- package/es/components/molecules/ItemNotFound/styled.js +29 -0
- package/es/components/molecules/MatchAnySelect/MatchesAnySelect.js +23 -7
- package/es/components/molecules/MatchAnySelect/components/ExtendValuePopup.d.ts +1 -0
- package/es/components/molecules/MatchAnySelect/components/ExtendValuePopup.js +7 -2
- package/es/components/molecules/MatchAnySelect/types.d.ts +2 -1
- package/es/components/molecules/MatchAnySelect/utils.d.ts +1 -0
- package/es/components/molecules/MatchAnySelect/utils.js +2 -0
- package/es/components/molecules/QuillEditor/EditorToolbar.js +1 -0
- package/es/components/molecules/QuillEditor/QuillEditor.d.ts +6 -1
- package/es/components/molecules/QuillEditor/QuillEditor.js +90 -55
- package/es/components/molecules/QuillEditor/styled.d.ts +5 -0
- package/es/components/molecules/QuillEditor/styled.js +29 -0
- package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +6 -3
- package/es/components/molecules/VirtualizedMenu/__mocks__/index.js +2550 -938
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.d.ts +1 -11
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +53 -25
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +8 -5
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +289 -46
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/index.js +1 -0
- package/es/components/molecules/VirtualizedMenu/styled.d.ts +2 -2
- package/es/components/molecules/VirtualizedMenu/styled.js +23 -4
- package/es/components/molecules/VirtualizedMenu/types.d.ts +27 -10
- package/es/components/molecules/VirtualizedMenu/utils.d.ts +8 -5
- package/es/components/molecules/VirtualizedMenu/utils.js +13 -18
- package/es/components/molecules/index.d.ts +2 -0
- package/es/components/molecules/index.js +2 -0
- package/es/components/molecules/index.scss +1 -0
- package/es/components/organism/ActivityTimeline/ActivityTimeline.js +15 -9
- package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +1290 -0
- package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +3059 -0
- package/es/components/organism/ActivityTimeline/components/ItemEvent/ItemEvent.d.ts +3 -4
- package/es/components/organism/ActivityTimeline/components/ItemEvent/ItemEvent.js +4 -3
- package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/ItemGroupEvent.d.ts +4 -6
- package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/ItemGroupEvent.js +4 -4
- package/es/components/organism/ActivityTimeline/components/TimeLineTitle/TimelineTitle.js +1 -1
- package/es/components/organism/ActivityTimeline/types.d.ts +2 -1
- package/es/components/organism/ActivityTimeline/utils.d.ts +1 -1
- package/es/components/organism/ActivityTimeline/utils.js +1 -1
- package/es/components/organism/Help/Help.js +47 -10
- package/es/components/organism/TextEditor/TextEditor.d.ts +3 -0
- package/es/components/organism/TextEditor/TextEditor.js +257 -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 +38 -0
- package/es/components/organism/TextEditor/constants.d.ts +175 -0
- package/es/components/organism/TextEditor/constants.js +321 -0
- package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +25 -0
- package/es/components/organism/TextEditor/extensions/BackgroundColor.js +46 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +130 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +247 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +15 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +31 -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/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 +32 -0
- package/es/components/organism/TextEditor/extensions/FontSize.js +47 -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/Highlight.d.ts +1 -0
- package/es/components/organism/TextEditor/extensions/Highlight.js +14 -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 +36 -0
- package/es/components/organism/TextEditor/extensions/Link.d.ts +16 -0
- package/es/components/organism/TextEditor/extensions/Link.js +48 -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 +39 -0
- package/es/components/organism/TextEditor/extensions/SmartTag.js +167 -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 +31 -0
- package/es/components/organism/TextEditor/extensions/TextTransform.js +37 -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 +7 -0
- package/es/components/organism/TextEditor/hooks/index.js +7 -0
- package/es/components/organism/TextEditor/hooks/useColorSet.d.ts +4 -0
- package/es/components/organism/TextEditor/hooks/useColorSet.js +22 -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/useLinkHandler.d.ts +11 -0
- package/es/components/organism/TextEditor/hooks/useLinkHandler.js +125 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +26 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.js +68 -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 +14 -0
- package/es/components/organism/TextEditor/index.js +6 -0
- package/es/components/organism/TextEditor/index.scss +61 -0
- package/es/components/organism/TextEditor/provider.d.ts +15 -0
- package/es/components/organism/TextEditor/provider.js +33 -0
- package/es/components/organism/TextEditor/store.d.ts +13 -0
- package/es/components/organism/TextEditor/store.js +20 -0
- package/es/components/organism/TextEditor/styled.d.ts +10 -0
- package/es/components/organism/TextEditor/styled.js +94 -0
- package/es/components/organism/TextEditor/types.d.ts +96 -0
- package/es/components/organism/TextEditor/types.js +3 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +85 -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/BubbleToolbar/BubbleToolbar.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.js +1 -0
- package/es/components/organism/TextEditor/ui/BubbleToolbar/index.d.ts +0 -0
- package/es/components/organism/TextEditor/ui/BubbleToolbar/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Button/Button.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Button/Button.js +31 -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/FontPopover.d.ts +12 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +69 -0
- package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/FontPopover/styled.js +22 -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 +52 -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 +77 -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/Toolbar.d.ts +15 -0
- package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.js +41 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +84 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +27 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +31 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +7 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +28 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +7 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +47 -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/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/SpacingAction.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.js +45 -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 +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Toolbar/index.js +1 -0
- package/es/components/organism/TextEditor/utils/documentState.d.ts +57 -0
- package/es/components/organism/TextEditor/utils/documentState.js +100 -0
- package/es/components/organism/TextEditor/utils/font.d.ts +73 -0
- package/es/components/organism/TextEditor/utils/font.js +160 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +63 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.js +319 -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 +100 -0
- package/es/components/organism/TextEditor/utils/link.js +149 -0
- package/es/components/organism/TextEditor/utils/menu.d.ts +134 -0
- package/es/components/organism/TextEditor/utils/menu.js +317 -0
- package/es/components/organism/TextEditor/utils/selection.d.ts +25 -0
- package/es/components/organism/TextEditor/utils/selection.js +57 -0
- package/es/components/organism/TextEditor/utils/shared.d.ts +1 -0
- package/es/components/organism/TextEditor/utils/shared.js +9 -0
- package/es/components/organism/TextEditor/utils/smartTag.d.ts +49 -0
- package/es/components/organism/TextEditor/utils/smartTag.js +89 -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/Content.js +47 -33
- package/es/components/organism/TicketEditor/components/MessageComponent.js +1 -0
- package/es/components/organism/TicketEditor/index.js +24 -16
- package/es/components/organism/TicketEditor/styled.js +1 -0
- package/es/components/organism/TicketEditorV2/Content.js +41 -7
- package/es/components/organism/TicketEditorV2/components/MessageComponent.js +1 -0
- package/es/components/organism/TicketEditorV2/styled.js +2 -1
- package/es/components/organism/index.d.ts +1 -0
- package/es/components/organism/index.js +1 -0
- package/es/components/organism/index.scss +1 -0
- package/es/hooks/index.d.ts +3 -0
- package/es/hooks/index.js +3 -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/useIsMounted.d.ts +1 -0
- package/es/hooks/useIsMounted.js +11 -0
- package/es/locales/en/translation.json +2 -1
- package/es/locales/i18n.d.ts +3 -1
- package/es/locales/vi/translation.json +2 -1
- package/es/utils/common.d.ts +6 -9
- package/es/utils/common.js +44 -23
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/es/utils/tree.d.ts +225 -0
- package/es/utils/tree.js +469 -0
- package/es/utils/web.d.ts +15 -0
- package/es/utils/web.js +39 -0
- package/package.json +25 -4
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { EventTrackingWithMap } from '../../types';
|
|
2
|
-
|
|
3
|
+
export declare const ItemEvent: React.ForwardRefExoticComponent<Partial<{
|
|
3
4
|
item: Record<string, any>;
|
|
4
5
|
objectName: string;
|
|
5
6
|
eventTracking: EventTrackingWithMap;
|
|
6
7
|
keyItem: string;
|
|
7
8
|
currency: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const ItemEvent: (props: ItemEventProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
9
|
+
}> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { checkShowRedeem, formatDateHeader, getInfoEvent } from '../../utils';
|
|
3
4
|
import { useAppConfigContext } from '@antscorp/antsomi-ui/es/providers';
|
|
4
5
|
import { TimelineSection } from '../TimelineSection/TimelineSection';
|
|
@@ -14,7 +15,7 @@ import { getPortalCurrency, safeParseDisplayFormatCurrency, } from '@antscorp/an
|
|
|
14
15
|
import { ListItem, ListItemTime, ListItemTimeLine, ListItemTitle } from '../ListItem';
|
|
15
16
|
import { List } from '../List';
|
|
16
17
|
import { Slide } from '../Slide';
|
|
17
|
-
export const ItemEvent = (props) => {
|
|
18
|
+
export const ItemEvent = forwardRef((props, ref) => {
|
|
18
19
|
const { keyItem: key = '', item = {}, objectName = '', eventTracking = { list: [], map: {} }, currency = getPortalCurrency(), } = props;
|
|
19
20
|
const { appConfig } = useAppConfigContext();
|
|
20
21
|
const { etype: eType } = item;
|
|
@@ -28,5 +29,5 @@ export const ItemEvent = (props) => {
|
|
|
28
29
|
: safeParseDisplayFormatCurrency(validateExtra.revenue)} `
|
|
29
30
|
: null, children: _jsx(Slide, { slidesPerView: perShow, items: renderProductCards(dataActivity[0], limitShowSlide, infoEvent, currency, key) }) }) }))] }));
|
|
30
31
|
};
|
|
31
|
-
return (_jsx(TimelineContainer, { className: "item-event", children: renderSingleEvent(item) }, key));
|
|
32
|
-
};
|
|
32
|
+
return (_jsx(TimelineContainer, { ref: ref, className: "item-event", children: renderSingleEvent(item) }, key));
|
|
33
|
+
});
|
package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/ItemGroupEvent.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EventTrackingWithMap } from '../../types';
|
|
3
3
|
import 'swiper/swiper-bundle.css';
|
|
4
|
-
|
|
4
|
+
export declare const renderProductCards: (dataItem: Record<string, any>, limitShow: number, inforEvent: Record<string, any>, infoCurrency: string, key: string) => React.ReactNode[];
|
|
5
|
+
export declare const ItemGroupEvent: React.ForwardRefExoticComponent<Partial<{
|
|
5
6
|
keyItem: string;
|
|
6
7
|
item: Record<string, any>;
|
|
7
8
|
objectName: string;
|
|
8
9
|
currency: string;
|
|
9
10
|
eventTracking: EventTrackingWithMap;
|
|
10
|
-
timezone?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const renderProductCards: (dataItem: Record<string, any>, limitShow: number, inforEvent: Record<string, any>, infoCurrency: string, key: string) => React.ReactNode[];
|
|
13
|
-
export declare const ItemGroupEvent: (props: ItemGroupEventProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
11
|
+
timezone?: string | undefined;
|
|
12
|
+
}> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable no-underscore-dangle */
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
4
|
import { checkShowRedeem, formatDateHeader, getInfoEvent } from '../../utils';
|
|
5
5
|
import { TimelineSection } from '../TimelineSection/TimelineSection';
|
|
6
6
|
import htmlParse from 'html-react-parser';
|
|
@@ -39,7 +39,7 @@ export const renderProductCards = (dataItem, limitShow, inforEvent, infoCurrency
|
|
|
39
39
|
});
|
|
40
40
|
return result;
|
|
41
41
|
};
|
|
42
|
-
export const ItemGroupEvent = (props) => {
|
|
42
|
+
export const ItemGroupEvent = forwardRef((props, ref) => {
|
|
43
43
|
const { appConfig } = useAppConfigContext();
|
|
44
44
|
const { keyItem: key = '', item = {}, objectName = '', eventTracking = { map: {}, list: [] }, currency = getPortalCurrency(), timezone = getPortalTimeZone(), } = props;
|
|
45
45
|
const { etype: eType } = item;
|
|
@@ -59,5 +59,5 @@ export const ItemGroupEvent = (props) => {
|
|
|
59
59
|
: null, children: _jsx(Slide, { slidesPerView: perShow, items: renderProductCards(itemEvent, limitShowSlide, infoEvent, currency, key) }) }) }))] }, `${titleEvent}-${fullContentEvent}-${index.toString()}`));
|
|
60
60
|
}) }) }));
|
|
61
61
|
};
|
|
62
|
-
return (_jsx(TimelineContainer, { className: "item-group-event", children: renderGroupEvent(item) }, key));
|
|
63
|
-
};
|
|
62
|
+
return (_jsx(TimelineContainer, { ref: ref, className: "item-group-event", children: renderGroupEvent(item) }, key));
|
|
63
|
+
});
|
|
@@ -15,5 +15,5 @@ export const TimeLineTitle = (props) => {
|
|
|
15
15
|
const content = showContent(type, data);
|
|
16
16
|
if (!content)
|
|
17
17
|
return null;
|
|
18
|
-
return _jsx(TimelineTitleRoot, { children: showContent(type, data) });
|
|
18
|
+
return _jsx(TimelineTitleRoot, { className: "item-title", children: showContent(type, data) });
|
|
19
19
|
};
|
|
@@ -13,8 +13,9 @@ export type ActivityTimeLineProps = Partial<{
|
|
|
13
13
|
title: string;
|
|
14
14
|
objectName: string;
|
|
15
15
|
eventTracking: EventTracking[];
|
|
16
|
-
onFetchMore: () => void
|
|
16
|
+
onFetchMore: () => Promise<void>;
|
|
17
17
|
longDateTimeFormat: string;
|
|
18
18
|
header: React.ReactNode;
|
|
19
19
|
className: string;
|
|
20
|
+
threshold?: number;
|
|
20
21
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventTrackingWithMap } from './types';
|
|
2
|
-
import { AppConfigProviderProps } from '
|
|
2
|
+
import { AppConfigProviderProps } from '../../../providers/AppConfigProvider/contexts';
|
|
3
3
|
export declare const getValuesReplace: (objectReplace: any[], data: Record<string, any>) => {};
|
|
4
4
|
export declare const getStringHtmlByType: (item: Record<string, any>, eType?: string) => string;
|
|
5
5
|
export declare const getProductName: (data: any[]) => string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
|
2
2
|
import { DATA_EVENT, mapTranslateCode } from './constants';
|
|
3
3
|
import { get } from 'lodash';
|
|
4
|
-
import { ENV } from '../../..';
|
|
5
4
|
import { translate, translations } from '@antscorp/antsomi-ui/es/locales';
|
|
6
5
|
import { safeParse } from '@antscorp/antsomi-ui/es/utils';
|
|
7
6
|
import { formatDate, formatUTCDateTZ } from '@antscorp/antsomi-ui/es/utils/date';
|
|
8
7
|
import { getPortalFormatDateTimeLong, getPortalTimeZone, } from '@antscorp/antsomi-ui/es/utils/portal';
|
|
9
8
|
import { CDP_ROUTE } from '@antscorp/antsomi-ui/es/constants';
|
|
9
|
+
import { ENV } from '@antscorp/antsomi-ui/es/config';
|
|
10
10
|
const translateAt = translate(translations._INFO_LOCATION, 'at');
|
|
11
11
|
const urlJourney = (data, config) => {
|
|
12
12
|
const { story = {} } = data;
|
|
@@ -30,6 +30,7 @@ import { BugIcon, CameraIcon, OpenUrlIcon, RequestIcon, ScreenshotMonitorIcon, }
|
|
|
30
30
|
import { base64ToFile, convertBlobToFile, generateUniqueId, mergeAudioStreams, } from '@antscorp/antsomi-ui/es/components/molecules/CaptureScreen/utils';
|
|
31
31
|
import { expendDefault, formatParams, postCustomEvent } from './utils';
|
|
32
32
|
import { useGetListUser } from './queries';
|
|
33
|
+
import { TCallBack } from '../../molecules/QuillEditor/QuillEditor';
|
|
33
34
|
const antIcon = _jsx(LoadingOutlined, { style: { fontSize: 40 }, spin: true });
|
|
34
35
|
const Loading = ({ isLoading, height, width }) => isLoading && (_jsx(WrapperLoading, { className: "loader-container", height: height, width: width, children: _jsx(Spin, { indicator: antIcon }) }));
|
|
35
36
|
const Help = props => {
|
|
@@ -93,6 +94,7 @@ const Help = props => {
|
|
|
93
94
|
const streamTracks = useRef();
|
|
94
95
|
const allAppOptionsRef = useRef([]);
|
|
95
96
|
const [fileInputKey, setFileInputKey] = useState(0);
|
|
97
|
+
const [isLoadingUpload, setIsLoadingUpload] = useState(false);
|
|
96
98
|
// const showModal = (captureKey: CaptureTypeProps) => {
|
|
97
99
|
// setOpen(true);
|
|
98
100
|
// setCaptureType(captureKey);
|
|
@@ -250,12 +252,17 @@ const Help = props => {
|
|
|
250
252
|
}
|
|
251
253
|
}, [allAppOptions, config, domainTicket, token, userId]);
|
|
252
254
|
const handleOnchangeFile = e => {
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
+
const file = e.target?.files[0];
|
|
256
|
+
if (!file)
|
|
257
|
+
return;
|
|
258
|
+
const sizeFile = file.size;
|
|
259
|
+
const fileType = file.type;
|
|
260
|
+
const isImage = fileType.startsWith('image/');
|
|
261
|
+
const limitSize = isImage ? 10 * 1024 * 1024 : 50 * 1024 * 1024;
|
|
255
262
|
if (sizeFile >= limitSize) {
|
|
256
263
|
setErrFile({
|
|
257
264
|
isError: true,
|
|
258
|
-
message:
|
|
265
|
+
message: `Maximum file size is reached (10MB for image & 50MB for other types).`,
|
|
259
266
|
});
|
|
260
267
|
}
|
|
261
268
|
else {
|
|
@@ -265,6 +272,7 @@ const Help = props => {
|
|
|
265
272
|
});
|
|
266
273
|
handleUploadFile(e.target.files[0]);
|
|
267
274
|
}
|
|
275
|
+
setFileInputKey(fileInputKey + 1);
|
|
268
276
|
};
|
|
269
277
|
const handleRemoveFile = token => {
|
|
270
278
|
let newListFile = valueInput.files;
|
|
@@ -837,10 +845,13 @@ const Help = props => {
|
|
|
837
845
|
domain: domainUpload,
|
|
838
846
|
token,
|
|
839
847
|
userId,
|
|
840
|
-
}), onChange: content =>
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
848
|
+
}), onChange: content => {
|
|
849
|
+
setValueInput(prevVal => ({
|
|
850
|
+
...prevVal,
|
|
851
|
+
message: content,
|
|
852
|
+
}));
|
|
853
|
+
setIsLoadingUpload(content.includes('<img src="data:image/png;base64'));
|
|
854
|
+
}, callback: callbackEditor, placeholder: "Enter your comment...", borderColor: "#e6e6e6", isRoundCorner: false, height: 159 }), _jsxs("div", { children: [valueInput.files?.length > 0 && (_jsx(WrapperLinkFiles, { children: valueInput.files?.map((file, index) => (_jsxs(WrapperLinkItemFiles, { children: [_jsxs("span", { style: {
|
|
844
855
|
display: 'flex',
|
|
845
856
|
alignItems: 'center',
|
|
846
857
|
gap: '10px',
|
|
@@ -877,9 +888,35 @@ const Help = props => {
|
|
|
877
888
|
}
|
|
878
889
|
}
|
|
879
890
|
};
|
|
880
|
-
const isDisableButtonSend = useMemo(() =>
|
|
881
|
-
|
|
882
|
-
|
|
891
|
+
const isDisableButtonSend = useMemo(() => !valueInput?.title || !valueInput?.message || isLoadingUpload, [valueInput, isLoadingUpload]);
|
|
892
|
+
const callbackEditor = (type, value) => {
|
|
893
|
+
switch (type) {
|
|
894
|
+
case TCallBack.LOADING_UPLOAD:
|
|
895
|
+
setIsLoadingUpload(value);
|
|
896
|
+
break;
|
|
897
|
+
case TCallBack.ERROR: {
|
|
898
|
+
switch (value) {
|
|
899
|
+
case 'FILE_TOO_LARGE':
|
|
900
|
+
setErrFile({
|
|
901
|
+
isError: true,
|
|
902
|
+
message: '*Maximum upload file size: 10MB',
|
|
903
|
+
});
|
|
904
|
+
break;
|
|
905
|
+
case 'RESET':
|
|
906
|
+
setErrFile({
|
|
907
|
+
isError: false,
|
|
908
|
+
message: '',
|
|
909
|
+
});
|
|
910
|
+
break;
|
|
911
|
+
default:
|
|
912
|
+
break;
|
|
913
|
+
}
|
|
914
|
+
break;
|
|
915
|
+
}
|
|
916
|
+
default:
|
|
917
|
+
break;
|
|
918
|
+
}
|
|
919
|
+
};
|
|
883
920
|
const renderPopupLayout = (type) => (_jsxs(_Fragment, { children: [_jsx(Loading, { isLoading: isMainLoading || isFetchingUsers, width: "100%", height: "100%" }), _jsx(WrapperHeader, { className: "cursor", children: _jsx(Header, { children: title }) }), _jsx(WrapperBody, { className: "popup-content", style: {
|
|
884
921
|
padding: type === REPORT_TYPES.CHAT ||
|
|
885
922
|
type === REPORT_TYPES.HELP ||
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
|
3
|
+
import { useEditor } from '@tiptap/react';
|
|
4
|
+
import StarterKit from '@tiptap/starter-kit';
|
|
5
|
+
import { TextStyleKit } from '@tiptap/extension-text-style';
|
|
6
|
+
import Superscript from '@tiptap/extension-superscript';
|
|
7
|
+
import SubScript from '@tiptap/extension-subscript';
|
|
8
|
+
import TextAlign from '@tiptap/extension-text-align';
|
|
9
|
+
import { FontSize } from './extensions/FontSize';
|
|
10
|
+
import { TextTransform } from './extensions/TextTransform';
|
|
11
|
+
import { FontFamily } from './extensions/FontFamily';
|
|
12
|
+
import { SmartTag } from './extensions/SmartTag';
|
|
13
|
+
import { Indent } from './extensions/Indent';
|
|
14
|
+
import { LineHeight } from './extensions/LineHeight';
|
|
15
|
+
import { Link as LinkExtension } from './extensions/Link';
|
|
16
|
+
import { Toolbar } from './ui/Toolbar/Toolbar';
|
|
17
|
+
import { Selection } from '@tiptap/extensions';
|
|
18
|
+
import { defaultShouldShowBubbleMenu, handleLinkAction, handleSmartTagAction, isShowLinkMenu, safeParseHTMLContent, } from './utils';
|
|
19
|
+
import { useLinkHandler } from './hooks/useLinkHandler';
|
|
20
|
+
import { useDebouncedCallback } from 'use-debounce';
|
|
21
|
+
import { StyledBubbleMenu, StyledEditorContent } from './styled';
|
|
22
|
+
import { BackgroundColor } from './extensions/BackgroundColor';
|
|
23
|
+
import { isBoolean } from 'lodash';
|
|
24
|
+
import { DEFAULT_TEXT_STYLE } from './constants';
|
|
25
|
+
import { Color } from './extensions/Color';
|
|
26
|
+
import { FontWeight } from './extensions/FontWeight';
|
|
27
|
+
import { useTextEditorStore } from './provider';
|
|
28
|
+
import { useDeepCompareMemo } from '@antscorp/antsomi-ui/es/hooks';
|
|
29
|
+
import { Emoji } from './extensions/Emoji';
|
|
30
|
+
import { emojiSuggestion } from './ui/Emoji';
|
|
31
|
+
import clsx from 'clsx';
|
|
32
|
+
import { ANTSOMI_COMPONENT_PREFIX_CLS } from '@antscorp/antsomi-ui/es/constants';
|
|
33
|
+
import produce from 'immer';
|
|
34
|
+
import { LetterSpacing } from './extensions/LetterSpacing';
|
|
35
|
+
import { CustomOrderedList } from './extensions/OrderedList';
|
|
36
|
+
import { CustomUnorderedList } from './extensions/UnorderedList';
|
|
37
|
+
export const TextEditor = memo(forwardRef((props, ref) => {
|
|
38
|
+
const { id, className, config, editable = true, initialContent, dataAttributes, onUpdateDebounced = 400, defaultTextStyle: defaultTextStyleProp, linkHandler: outerLinkHandler, smartTagHandler: outerSmartTagHandler, bubbleMenuProps, style, onUpdate, onFocus, onCreate, } = props;
|
|
39
|
+
const isShowBubbleMenu = useTextEditorStore(state => state.isShowBubbleMenu);
|
|
40
|
+
const setBubbleMenuContainer = useTextEditorStore(state => state.setBubbleMenuContainer);
|
|
41
|
+
const defaultTextStyle = useDeepCompareMemo(() => ({
|
|
42
|
+
...DEFAULT_TEXT_STYLE,
|
|
43
|
+
...defaultTextStyleProp,
|
|
44
|
+
}), [defaultTextStyleProp]);
|
|
45
|
+
const handleOnUpdateDebounce = useDebouncedCallback((editor) => {
|
|
46
|
+
const html = editor.getHTML();
|
|
47
|
+
const text = editor.getText();
|
|
48
|
+
const json = editor.getJSON();
|
|
49
|
+
onUpdate?.({ html, text, json });
|
|
50
|
+
}, onUpdateDebounced);
|
|
51
|
+
const contentRef = useRef(null);
|
|
52
|
+
const editor = useEditor({
|
|
53
|
+
extensions: [
|
|
54
|
+
StarterKit.configure({
|
|
55
|
+
link: false,
|
|
56
|
+
bulletList: false,
|
|
57
|
+
orderedList: false,
|
|
58
|
+
listItem: {
|
|
59
|
+
HTMLAttributes: {
|
|
60
|
+
style: 'line-height:normal;',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
undoRedo: {
|
|
64
|
+
depth: 100,
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
CustomUnorderedList,
|
|
68
|
+
CustomOrderedList,
|
|
69
|
+
FontWeight.configure({
|
|
70
|
+
defaultWeight: defaultTextStyle.fontWeight,
|
|
71
|
+
}),
|
|
72
|
+
LineHeight.configure({
|
|
73
|
+
defaultHeight: defaultTextStyle.lineHeight,
|
|
74
|
+
}),
|
|
75
|
+
FontFamily.configure({
|
|
76
|
+
defaultFontFamily: defaultTextStyle.fontFamily,
|
|
77
|
+
}),
|
|
78
|
+
FontSize.configure({
|
|
79
|
+
defaultFontSize: defaultTextStyle.fontSize,
|
|
80
|
+
}),
|
|
81
|
+
LetterSpacing.configure({
|
|
82
|
+
defaultLetterSpacing: defaultTextStyle.letterSpacing,
|
|
83
|
+
}),
|
|
84
|
+
Color.configure({
|
|
85
|
+
defaultColor: defaultTextStyle.color,
|
|
86
|
+
}),
|
|
87
|
+
BackgroundColor.configure({
|
|
88
|
+
defaultBackgroundColor: defaultTextStyle.backgroundColor,
|
|
89
|
+
}),
|
|
90
|
+
TextStyleKit.configure({
|
|
91
|
+
backgroundColor: false,
|
|
92
|
+
color: false,
|
|
93
|
+
textStyle: {
|
|
94
|
+
mergeNestedSpanStyles: true,
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
TextTransform,
|
|
98
|
+
Superscript,
|
|
99
|
+
SubScript,
|
|
100
|
+
Selection.configure({
|
|
101
|
+
className: 'selection',
|
|
102
|
+
}),
|
|
103
|
+
SmartTag.configure({
|
|
104
|
+
highlight: config?.SmartTag?.highlight,
|
|
105
|
+
}),
|
|
106
|
+
TextAlign.configure({
|
|
107
|
+
types: ['heading', 'paragraph'],
|
|
108
|
+
}),
|
|
109
|
+
LinkExtension.configure({
|
|
110
|
+
openOnClick: false,
|
|
111
|
+
HTMLAttributes: {
|
|
112
|
+
class: 'link',
|
|
113
|
+
style: 'text-decoration:inherit;color:inherit;',
|
|
114
|
+
rel: undefined,
|
|
115
|
+
},
|
|
116
|
+
}),
|
|
117
|
+
Indent,
|
|
118
|
+
Emoji.configure({
|
|
119
|
+
suggestion: emojiSuggestion({
|
|
120
|
+
container: bubbleMenuProps?.container,
|
|
121
|
+
}),
|
|
122
|
+
}),
|
|
123
|
+
],
|
|
124
|
+
content: safeParseHTMLContent(initialContent || ''),
|
|
125
|
+
onCreate: ({ editor }) => {
|
|
126
|
+
const html = editor.getHTML();
|
|
127
|
+
const text = editor.getText();
|
|
128
|
+
const json = editor.getJSON();
|
|
129
|
+
onCreate?.({ html, text, json });
|
|
130
|
+
},
|
|
131
|
+
onUpdate: ({ editor }) => {
|
|
132
|
+
handleOnUpdateDebounce(editor);
|
|
133
|
+
},
|
|
134
|
+
onFocus: ({ event }) => {
|
|
135
|
+
onFocus?.(event);
|
|
136
|
+
},
|
|
137
|
+
editorProps: {
|
|
138
|
+
attributes: { spellcheck: 'false' },
|
|
139
|
+
handleKeyDown(view, event) {
|
|
140
|
+
if (event.ctrlKey && event.key === 'k') {
|
|
141
|
+
// Add this line to prevent browser's default behavior.
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
handleLinkAction(view, outerLinkHandler);
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
const { setLink, deleteLink, updateLinkAttrsGlobally } = useLinkHandler({
|
|
149
|
+
editor,
|
|
150
|
+
highlight: config?.Link?.highlightDynamic,
|
|
151
|
+
});
|
|
152
|
+
// useStyleMemory(editor);
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
if (editable === undefined) {
|
|
155
|
+
editor?.setEditable(true);
|
|
156
|
+
}
|
|
157
|
+
else if (isBoolean(editable)) {
|
|
158
|
+
editor?.setEditable(editable);
|
|
159
|
+
}
|
|
160
|
+
}, [editor, editable]);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (editor && config?.SmartTag?.highlight !== undefined) {
|
|
163
|
+
editor.chain().updateSmartTagHighlight(config.SmartTag.highlight).run();
|
|
164
|
+
}
|
|
165
|
+
}, [editor, config?.SmartTag?.highlight]);
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
if (!isBoolean(config?.Link?.highlightDynamic)) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
updateLinkAttrsGlobally(attrs => produce(attrs, draft => {
|
|
171
|
+
if (!attrs.dynamic)
|
|
172
|
+
return;
|
|
173
|
+
const updatedClass = new Set(String(attrs.class).split(' '));
|
|
174
|
+
if (config?.Link?.highlightDynamic) {
|
|
175
|
+
updatedClass.add('highlight');
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
updatedClass.delete('highlight');
|
|
179
|
+
}
|
|
180
|
+
draft.class = [...updatedClass].join(' ');
|
|
181
|
+
}));
|
|
182
|
+
}, [config?.Link?.highlightDynamic, updateLinkAttrsGlobally]);
|
|
183
|
+
const handleSetSmartTag = useCallback(({ id, content }) => {
|
|
184
|
+
editor?.chain().focus().setSmartTag({ id, content }).run();
|
|
185
|
+
}, [editor]);
|
|
186
|
+
const handleDeleteSmartTag = useCallback(id => {
|
|
187
|
+
editor
|
|
188
|
+
?.chain()
|
|
189
|
+
.deleteSmartTagGlobally(attrs => attrs.id === id)
|
|
190
|
+
.run();
|
|
191
|
+
}, [editor]);
|
|
192
|
+
const handleUpdateSmartTagAttrs = useCallback((id, updatedAttrs) => editor
|
|
193
|
+
?.chain()
|
|
194
|
+
.updateSmartTagAttrsGlobally(attrs => {
|
|
195
|
+
if (attrs.id === id)
|
|
196
|
+
return updatedAttrs;
|
|
197
|
+
})
|
|
198
|
+
.run(), [editor]);
|
|
199
|
+
const handleUpdateLinkAttrs = useCallback((id, updatedAttrs) => updateLinkAttrsGlobally((attrs) => {
|
|
200
|
+
if (attrs.id === id) {
|
|
201
|
+
return updatedAttrs;
|
|
202
|
+
}
|
|
203
|
+
if (!attrs.id && attrs.href === updatedAttrs.href) {
|
|
204
|
+
return { id, ...updatedAttrs };
|
|
205
|
+
}
|
|
206
|
+
}), [updateLinkAttrsGlobally]);
|
|
207
|
+
const shouldShowBubbleMenu = useCallback((params) => {
|
|
208
|
+
const { state, view, element } = params;
|
|
209
|
+
if (isShowLinkMenu(state)) {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
return defaultShouldShowBubbleMenu({
|
|
213
|
+
state,
|
|
214
|
+
view,
|
|
215
|
+
element,
|
|
216
|
+
editor: params.editor,
|
|
217
|
+
});
|
|
218
|
+
}, []);
|
|
219
|
+
const handleBlur = useCallback((perserveSelection) => {
|
|
220
|
+
if (perserveSelection) {
|
|
221
|
+
editor?.chain().blur().run();
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
editor?.chain().blur().setTextSelection({ from: 0, to: 0 }).run();
|
|
225
|
+
}
|
|
226
|
+
}, [editor]);
|
|
227
|
+
const handleBubbleMenuRef = useCallback((htmlElement) => {
|
|
228
|
+
setBubbleMenuContainer(htmlElement);
|
|
229
|
+
}, [setBubbleMenuContainer]);
|
|
230
|
+
useImperativeHandle(ref, () => ({
|
|
231
|
+
setLink,
|
|
232
|
+
deleteLink,
|
|
233
|
+
updateLinkAttrs: handleUpdateLinkAttrs,
|
|
234
|
+
setSmartTag: handleSetSmartTag,
|
|
235
|
+
deleteSmartTag: handleDeleteSmartTag,
|
|
236
|
+
updateSmartTagAttrs: handleUpdateSmartTagAttrs,
|
|
237
|
+
blur: handleBlur,
|
|
238
|
+
style: contentRef.current?.style,
|
|
239
|
+
editor,
|
|
240
|
+
}));
|
|
241
|
+
if (!editor) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledEditorContent, { className: clsx(`${ANTSOMI_COMPONENT_PREFIX_CLS}-text-editor`, className), "$textStyle": defaultTextStyle, style: {
|
|
245
|
+
// Inline styles apply to inner html elements (support email client)
|
|
246
|
+
...defaultTextStyle,
|
|
247
|
+
...style,
|
|
248
|
+
}, id: id, ref: contentRef, editor: editor, ...dataAttributes }), _jsx(StyledBubbleMenu, { ref: handleBubbleMenuRef, editor: editor, shouldShow: shouldShowBubbleMenu, resizeDelay: 700, ...bubbleMenuProps, children: isShowBubbleMenu && (_jsx(Toolbar, { config: config, editor: editor, defaultTextStyle: defaultTextStyle, linkHanlder: {
|
|
249
|
+
onUpsert: () => {
|
|
250
|
+
handleLinkAction(editor.view, outerLinkHandler);
|
|
251
|
+
},
|
|
252
|
+
}, smartTagHandler: {
|
|
253
|
+
onUpsert: (event) => {
|
|
254
|
+
handleSmartTagAction(event, editor.view, outerSmartTagHandler);
|
|
255
|
+
},
|
|
256
|
+
} })) })] }));
|
|
257
|
+
}));
|