@antscorp/antsomi-ui 2.0.92-text-editor-beta.6 → 2.0.93
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 +2 -4
- package/es/components/icons/LazyIcon/LazyIcon.d.ts +9 -18
- package/es/components/icons/LazyIcon/LazyIcon.js +9 -18
- package/es/components/icons/index.d.ts +9 -18
- package/es/components/icons/index.js +9 -18
- package/es/components/molecules/EmojiCollections/CommonCollection/index.js +2 -2
- package/es/components/molecules/EmojiCollections/types.d.ts +0 -1
- package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +0 -1
- package/es/components/molecules/EmojiPopover/EmojiPopover.js +6 -10
- package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
- package/es/components/molecules/EmojiPopover/styled.js +1 -1
- package/es/components/molecules/TagifyInput/patternHandlers.js +12 -0
- package/es/components/molecules/TagifyInput/utils.d.ts +1 -0
- package/es/components/molecules/TagifyInput/utils.js +1 -0
- package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +3 -6
- package/es/components/molecules/VirtualizedMenu/__mocks__/index.js +982 -2594
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.d.ts +11 -1
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +25 -53
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +5 -8
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +46 -289
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/index.js +0 -1
- package/es/components/molecules/VirtualizedMenu/styled.d.ts +2 -2
- package/es/components/molecules/VirtualizedMenu/styled.js +4 -23
- package/es/components/molecules/VirtualizedMenu/types.d.ts +10 -27
- package/es/components/molecules/VirtualizedMenu/utils.d.ts +5 -8
- package/es/components/molecules/VirtualizedMenu/utils.js +18 -13
- package/es/components/molecules/index.d.ts +0 -1
- package/es/components/molecules/index.js +0 -1
- package/es/components/organism/index.d.ts +0 -1
- package/es/components/organism/index.js +0 -1
- package/es/constants/api.js +3 -3
- package/es/hooks/index.d.ts +0 -4
- package/es/hooks/index.js +0 -4
- package/es/locales/i18n.d.ts +1 -1
- package/es/utils/common.d.ts +9 -14
- package/es/utils/common.js +23 -60
- package/es/utils/index.d.ts +0 -1
- package/es/utils/index.js +0 -1
- package/es/utils/web.d.ts +0 -15
- package/es/utils/web.js +0 -39
- package/package.json +4 -22
- package/es/components/atoms/Eyedropper/Eyedropper.d.ts +0 -2
- package/es/components/atoms/Eyedropper/Eyedropper.js +0 -53
- package/es/components/atoms/Eyedropper/index.d.ts +0 -0
- package/es/components/atoms/Eyedropper/index.js +0 -1
- package/es/components/atoms/Eyedropper/styled.d.ts +0 -9
- package/es/components/atoms/Eyedropper/styled.js +0 -45
- package/es/components/atoms/Eyedropper/types.d.ts +0 -5
- package/es/components/atoms/Eyedropper/types.js +0 -1
- package/es/components/icons/ALignRightIcon.d.ts +0 -3
- package/es/components/icons/ALignRightIcon.js +0 -7
- package/es/components/icons/AlignCenterIcon.d.ts +0 -3
- package/es/components/icons/AlignCenterIcon.js +0 -7
- package/es/components/icons/AlignJustifyIcon.d.ts +0 -3
- package/es/components/icons/AlignJustifyIcon.js +0 -7
- package/es/components/icons/AlignLeftIcon.d.ts +0 -3
- package/es/components/icons/AlignLeftIcon.js +0 -7
- package/es/components/icons/ArrowDropDownIcon.d.ts +0 -3
- package/es/components/icons/ArrowDropDownIcon.js +0 -7
- package/es/components/icons/ChevronRightIcon.d.ts +0 -3
- package/es/components/icons/ChevronRightIcon.js +0 -7
- package/es/components/icons/ColorizeIcon.d.ts +0 -3
- package/es/components/icons/ColorizeIcon.js +0 -7
- package/es/components/icons/LinkOffIcon.d.ts +0 -3
- package/es/components/icons/LinkOffIcon.js +0 -7
- package/es/components/icons/MinusIcon.d.ts +0 -3
- package/es/components/icons/MinusIcon.js +0 -7
- package/es/components/index.scss +0 -2
- package/es/components/molecules/EyedropperButton/EyedropperButton.d.ts +0 -11
- package/es/components/molecules/EyedropperButton/EyedropperButton.js +0 -34
- package/es/components/molecules/EyedropperButton/index.d.ts +0 -0
- package/es/components/molecules/EyedropperButton/index.js +0 -1
- package/es/components/molecules/EyedropperButton/styled.d.ts +0 -7
- package/es/components/molecules/EyedropperButton/styled.js +0 -23
- package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +0 -3
- package/es/components/molecules/FontSizeInput/FontSizeInput.js +0 -134
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.d.ts +0 -8
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +0 -14
- package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.d.ts +0 -21
- package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.js +0 -19
- package/es/components/molecules/FontSizeInput/constants.d.ts +0 -2
- package/es/components/molecules/FontSizeInput/constants.js +0 -5
- package/es/components/molecules/FontSizeInput/index.d.ts +0 -2
- package/es/components/molecules/FontSizeInput/index.js +0 -1
- package/es/components/molecules/FontSizeInput/styled.d.ts +0 -7
- package/es/components/molecules/FontSizeInput/styled.js +0 -40
- package/es/components/molecules/FontSizeInput/styles.scss +0 -15
- package/es/components/molecules/FontSizeInput/types.d.ts +0 -23
- package/es/components/molecules/FontSizeInput/types.js +0 -1
- package/es/components/molecules/FontSizeInput/utils.d.ts +0 -7
- package/es/components/molecules/FontSizeInput/utils.js +0 -9
- package/es/components/molecules/index.scss +0 -1
- package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +0 -1290
- package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +0 -3059
- package/es/components/organism/TextEditor/TextEditor.d.ts +0 -3
- package/es/components/organism/TextEditor/TextEditor.js +0 -264
- package/es/components/organism/TextEditor/__mocks__/text-block.settings.json +0 -320
- package/es/components/organism/TextEditor/__mocks__/text-contennt.d.ts +0 -1
- package/es/components/organism/TextEditor/__mocks__/text-contennt.js +0 -38
- package/es/components/organism/TextEditor/constants.d.ts +0 -177
- package/es/components/organism/TextEditor/constants.js +0 -323
- package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +0 -25
- package/es/components/organism/TextEditor/extensions/BackgroundColor.js +0 -46
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +0 -140
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +0 -366
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +0 -15
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +0 -31
- package/es/components/organism/TextEditor/extensions/BubbleMenu/index.d.ts +0 -2
- package/es/components/organism/TextEditor/extensions/BubbleMenu/index.js +0 -2
- package/es/components/organism/TextEditor/extensions/ClearFormatting.d.ts +0 -16
- package/es/components/organism/TextEditor/extensions/ClearFormatting.js +0 -26
- package/es/components/organism/TextEditor/extensions/Color.d.ts +0 -6
- package/es/components/organism/TextEditor/extensions/Color.js +0 -34
- package/es/components/organism/TextEditor/extensions/Emoji.d.ts +0 -57
- package/es/components/organism/TextEditor/extensions/Emoji.js +0 -184
- package/es/components/organism/TextEditor/extensions/FontFamily.d.ts +0 -6
- package/es/components/organism/TextEditor/extensions/FontFamily.js +0 -36
- package/es/components/organism/TextEditor/extensions/FontSize.d.ts +0 -31
- package/es/components/organism/TextEditor/extensions/FontSize.js +0 -46
- package/es/components/organism/TextEditor/extensions/FontWeight.d.ts +0 -23
- package/es/components/organism/TextEditor/extensions/FontWeight.js +0 -41
- package/es/components/organism/TextEditor/extensions/Indent.d.ts +0 -21
- package/es/components/organism/TextEditor/extensions/Indent.js +0 -63
- package/es/components/organism/TextEditor/extensions/LetterSpacing.d.ts +0 -32
- package/es/components/organism/TextEditor/extensions/LetterSpacing.js +0 -48
- package/es/components/organism/TextEditor/extensions/LineHeight.d.ts +0 -20
- package/es/components/organism/TextEditor/extensions/LineHeight.js +0 -36
- package/es/components/organism/TextEditor/extensions/Link.d.ts +0 -29
- package/es/components/organism/TextEditor/extensions/Link.js +0 -187
- package/es/components/organism/TextEditor/extensions/ListItemMarker.d.ts +0 -13
- package/es/components/organism/TextEditor/extensions/ListItemMarker.js +0 -174
- package/es/components/organism/TextEditor/extensions/OrderedList.d.ts +0 -56
- package/es/components/organism/TextEditor/extensions/OrderedList.js +0 -187
- package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +0 -39
- package/es/components/organism/TextEditor/extensions/SmartTag.js +0 -167
- package/es/components/organism/TextEditor/extensions/StyleMemory.d.ts +0 -36
- package/es/components/organism/TextEditor/extensions/StyleMemory.js +0 -163
- package/es/components/organism/TextEditor/extensions/TextTransform.d.ts +0 -30
- package/es/components/organism/TextEditor/extensions/TextTransform.js +0 -36
- package/es/components/organism/TextEditor/extensions/UnorderedList.d.ts +0 -55
- package/es/components/organism/TextEditor/extensions/UnorderedList.js +0 -176
- package/es/components/organism/TextEditor/hooks/index.d.ts +0 -6
- package/es/components/organism/TextEditor/hooks/index.js +0 -6
- package/es/components/organism/TextEditor/hooks/useColorSet.d.ts +0 -4
- package/es/components/organism/TextEditor/hooks/useColorSet.js +0 -22
- package/es/components/organism/TextEditor/hooks/useDocumentState.d.ts +0 -18
- package/es/components/organism/TextEditor/hooks/useDocumentState.js +0 -42
- package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +0 -26
- package/es/components/organism/TextEditor/hooks/useMarkTracking.js +0 -68
- package/es/components/organism/TextEditor/hooks/usePersistence.d.ts +0 -31
- package/es/components/organism/TextEditor/hooks/usePersistence.js +0 -169
- package/es/components/organism/TextEditor/hooks/useStyleMemory.d.ts +0 -6
- package/es/components/organism/TextEditor/hooks/useStyleMemory.js +0 -42
- package/es/components/organism/TextEditor/hooks/useStylePresets.d.ts +0 -34
- package/es/components/organism/TextEditor/hooks/useStylePresets.js +0 -83
- package/es/components/organism/TextEditor/index.d.ts +0 -16
- package/es/components/organism/TextEditor/index.js +0 -8
- package/es/components/organism/TextEditor/index.scss +0 -61
- package/es/components/organism/TextEditor/provider.d.ts +0 -14
- package/es/components/organism/TextEditor/provider.js +0 -33
- package/es/components/organism/TextEditor/store.d.ts +0 -13
- package/es/components/organism/TextEditor/store.js +0 -20
- package/es/components/organism/TextEditor/styled.d.ts +0 -10
- package/es/components/organism/TextEditor/styled.js +0 -94
- package/es/components/organism/TextEditor/types.d.ts +0 -139
- package/es/components/organism/TextEditor/types.js +0 -5
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +0 -6
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +0 -84
- package/es/components/organism/TextEditor/ui/BubbleMenu/index.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/BubbleMenu/index.js +0 -1
- package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.js +0 -1
- package/es/components/organism/TextEditor/ui/BubbleToolbar/index.d.ts +0 -0
- package/es/components/organism/TextEditor/ui/BubbleToolbar/index.js +0 -1
- package/es/components/organism/TextEditor/ui/Button/Button.d.ts +0 -2
- package/es/components/organism/TextEditor/ui/Button/Button.js +0 -31
- package/es/components/organism/TextEditor/ui/Button/index.d.ts +0 -2
- package/es/components/organism/TextEditor/ui/Button/index.js +0 -1
- package/es/components/organism/TextEditor/ui/Button/types.d.ts +0 -10
- package/es/components/organism/TextEditor/ui/Button/types.js +0 -1
- package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.d.ts +0 -39
- package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.js +0 -131
- package/es/components/organism/TextEditor/ui/ColorPicker/index.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/ColorPicker/index.js +0 -1
- package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.d.ts +0 -17
- package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.js +0 -51
- package/es/components/organism/TextEditor/ui/DropdownButton/index.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/DropdownButton/index.js +0 -1
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.d.ts +0 -11
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +0 -66
- package/es/components/organism/TextEditor/ui/Emoji/index.d.ts +0 -2
- package/es/components/organism/TextEditor/ui/Emoji/index.js +0 -2
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +0 -4
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +0 -71
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.d.ts +0 -12
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +0 -69
- package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/FontPopover/styled.js +0 -22
- package/es/components/organism/TextEditor/ui/Popover/Popover.d.ts +0 -6
- package/es/components/organism/TextEditor/ui/Popover/Popover.js +0 -9
- package/es/components/organism/TextEditor/ui/Popover/index.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/Popover/index.js +0 -1
- package/es/components/organism/TextEditor/ui/Select/Select.d.ts +0 -4
- package/es/components/organism/TextEditor/ui/Select/Select.js +0 -7
- package/es/components/organism/TextEditor/ui/Select/index.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/Select/index.js +0 -1
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.d.ts +0 -2
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.js +0 -44
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.js +0 -1
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.d.ts +0 -2
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.js +0 -52
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.d.ts +0 -19
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.js +0 -1
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.d.ts +0 -30
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +0 -77
- package/es/components/organism/TextEditor/ui/TextAlignSelect/index.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/TextAlignSelect/index.js +0 -1
- package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.d.ts +0 -16
- package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.js +0 -42
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +0 -18
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +0 -6
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +0 -93
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +0 -20
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +0 -4
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +0 -31
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +0 -7
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +0 -28
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +0 -7
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +0 -44
- package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.js +0 -21
- package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.js +0 -17
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.js +0 -18
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.js +0 -28
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.d.ts +0 -6
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.js +0 -17
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.js +0 -67
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.js +0 -17
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.d.ts +0 -7
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.js +0 -18
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.d.ts +0 -10
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.js +0 -45
- package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.js +0 -18
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.js +0 -26
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.js +0 -26
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.js +0 -3
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.js +0 -29
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.d.ts +0 -14
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.js +0 -22
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.js +0 -36
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.d.ts +0 -5
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.js +0 -18
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.d.ts +0 -6
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +0 -19
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +0 -24
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +0 -24
- package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/Toolbar/index.js +0 -1
- package/es/components/organism/TextEditor/utils/documentState.d.ts +0 -57
- package/es/components/organism/TextEditor/utils/documentState.js +0 -100
- package/es/components/organism/TextEditor/utils/font.d.ts +0 -73
- package/es/components/organism/TextEditor/utils/font.js +0 -160
- package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +0 -75
- package/es/components/organism/TextEditor/utils/htmlProcessing.js +0 -343
- package/es/components/organism/TextEditor/utils/indent.d.ts +0 -11
- package/es/components/organism/TextEditor/utils/indent.js +0 -56
- package/es/components/organism/TextEditor/utils/index.d.ts +0 -8
- package/es/components/organism/TextEditor/utils/index.js +0 -16
- package/es/components/organism/TextEditor/utils/link.d.ts +0 -108
- package/es/components/organism/TextEditor/utils/link.js +0 -151
- package/es/components/organism/TextEditor/utils/menu.d.ts +0 -134
- package/es/components/organism/TextEditor/utils/menu.js +0 -317
- package/es/components/organism/TextEditor/utils/selection.d.ts +0 -25
- package/es/components/organism/TextEditor/utils/selection.js +0 -57
- package/es/components/organism/TextEditor/utils/shared.d.ts +0 -1
- package/es/components/organism/TextEditor/utils/shared.js +0 -9
- package/es/components/organism/TextEditor/utils/smartTag.d.ts +0 -49
- package/es/components/organism/TextEditor/utils/smartTag.js +0 -89
- package/es/components/organism/TextEditor/utils/style.d.ts +0 -78
- package/es/components/organism/TextEditor/utils/style.js +0 -193
- package/es/components/organism/index.scss +0 -1
- package/es/hooks/useBroadcastedLocalStorage.d.ts +0 -5
- package/es/hooks/useBroadcastedLocalStorage.js +0 -71
- package/es/hooks/useElementSize.d.ts +0 -7
- package/es/hooks/useElementSize.js +0 -56
- package/es/hooks/useEyedropper/attach.d.ts +0 -4
- package/es/hooks/useEyedropper/attach.js +0 -9
- package/es/hooks/useEyedropper/eyedropper.d.ts +0 -69
- package/es/hooks/useEyedropper/eyedropper.js +0 -205
- package/es/hooks/useEyedropper/index.d.ts +0 -2
- package/es/hooks/useEyedropper/index.js +0 -7
- package/es/hooks/useEyedropper/support.d.ts +0 -1
- package/es/hooks/useEyedropper/support.js +0 -3
- package/es/hooks/useEyedropper/types.d.ts +0 -9
- package/es/hooks/useEyedropper/types.js +0 -1
- package/es/hooks/useEyedropper/useEyedropper.d.ts +0 -8
- package/es/hooks/useEyedropper/useEyedropper.js +0 -50
- package/es/hooks/useEyedropper/utils.d.ts +0 -11
- package/es/hooks/useEyedropper/utils.js +0 -17
- package/es/hooks/useIsMounted.d.ts +0 -1
- package/es/hooks/useIsMounted.js +0 -11
- package/es/utils/tree.d.ts +0 -225
- package/es/utils/tree.js +0 -469
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Config, TextEditorComponentsRender, TextStyle } from '../../types';
|
|
4
|
-
export type ToolbarProps = {
|
|
5
|
-
editor: Editor;
|
|
6
|
-
config?: Config;
|
|
7
|
-
defaultTextStyle?: TextStyle;
|
|
8
|
-
smartTagHandler?: {
|
|
9
|
-
onUpsert?: (event: React.MouseEvent) => void;
|
|
10
|
-
};
|
|
11
|
-
linkHanlder?: {
|
|
12
|
-
onUpsert?: () => void;
|
|
13
|
-
};
|
|
14
|
-
render?: Partial<Pick<TextEditorComponentsRender, 'renderLinkToolbar'>>;
|
|
15
|
-
};
|
|
16
|
-
export declare const Toolbar: (props: ToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CopyDuplicateIcon, EditIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
3
|
-
import { useEditorState } from '@tiptap/react';
|
|
4
|
-
import { Divider, Flex, Typography } from 'antd';
|
|
5
|
-
import { ToolbarWrapper } from '../../styled';
|
|
6
|
-
import { getLinkMark, isShowLinkToolbar } from '../../utils';
|
|
7
|
-
import { TextEditorButton } from '../Button';
|
|
8
|
-
import { BoldAction, BulletListAction, ClearFormattingAction, EmoijiAction, FontFamilyAction, FontSizeAction, HistoryAction, IndentAction, ItalicAction, LetterSpacingAction, LinkAction, OrderedListAction, OutdentAction, SmartTagAction, SpacingAction, StrikeAction, SubscriptAction, SuperscriptAction, TextAlignAction, TextBackColorAction, TextColorAction, TextTransformAction, UnderlineAction, UnsetLinkAction, } from './actions';
|
|
9
|
-
import { DEFAULT_TEXT_STYLE } from '../../constants';
|
|
10
|
-
export const Toolbar = (props) => {
|
|
11
|
-
const { editor, smartTagHandler, linkHanlder, config, defaultTextStyle = DEFAULT_TEXT_STYLE, render, } = props;
|
|
12
|
-
const { showLinkMenu, linkAttrs } = useEditorState({
|
|
13
|
-
editor,
|
|
14
|
-
selector: ({ editor: edtiorInstance }) => {
|
|
15
|
-
const { state } = edtiorInstance;
|
|
16
|
-
return {
|
|
17
|
-
showLinkMenu: isShowLinkToolbar(state),
|
|
18
|
-
linkAttrs: getLinkMark({ state })?.attrs,
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
if (showLinkMenu) {
|
|
23
|
-
const href = String(linkAttrs?.href);
|
|
24
|
-
const goToLinkEl = (_jsx(Typography.Link, { style: { maxWidth: 150 }, ellipsis: true, href: href, children: href }));
|
|
25
|
-
const copyLinkEl = (_jsx(TextEditorButton, { icon: _jsx(CopyDuplicateIcon, { size: 18 }), tooltipProps: { title: 'Copy' }, onClick: () => {
|
|
26
|
-
navigator.clipboard.writeText(href);
|
|
27
|
-
} }));
|
|
28
|
-
const editLinkEl = (_jsx(TextEditorButton, { icon: _jsx(EditIcon, { size: 18 }), tooltipProps: { title: 'Edit' }, onClick: () => linkHanlder?.onUpsert?.() }));
|
|
29
|
-
const unsetLinkEl = _jsx(UnsetLinkAction, { editor: editor });
|
|
30
|
-
let linkTools = (_jsxs(_Fragment, { children: [goToLinkEl, copyLinkEl, editLinkEl, unsetLinkEl] }));
|
|
31
|
-
if (render?.renderLinkToolbar && linkAttrs) {
|
|
32
|
-
linkTools = render.renderLinkToolbar(linkAttrs, linkTools, {
|
|
33
|
-
copy: copyLinkEl,
|
|
34
|
-
edit: editLinkEl,
|
|
35
|
-
gotoLink: goToLinkEl,
|
|
36
|
-
unlink: unsetLinkEl,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return (_jsx(ToolbarWrapper, { wrap: "wrap", gap: 8, align: "center", children: linkTools }));
|
|
40
|
-
}
|
|
41
|
-
return (_jsxs(ToolbarWrapper, { vertical: true, gap: 8, children: [_jsxs(Flex, { gap: 4, justify: "flex-start", align: "center", children: [_jsx(FontFamilyAction, { editor: editor, fonts: config?.FontFamily?.fonts }), _jsx(FontSizeAction, { editor: editor }), _jsx(BoldAction, { editor: editor }), _jsx(ItalicAction, { editor: editor }), _jsx(UnderlineAction, { editor: editor }), _jsx(LinkAction, { editor: editor, onClick: linkHanlder?.onUpsert }), _jsx(Divider, { type: "vertical", className: "toolbar-separator" }), _jsx(StrikeAction, { editor: editor }), _jsx(SuperscriptAction, { editor: editor }), _jsx(SubscriptAction, { editor: editor }), _jsx(Divider, { type: "vertical", className: "toolbar-separator" }), _jsx(TextTransformAction, { editor: editor }), _jsx(TextColorAction, { editor: editor }), _jsx(TextBackColorAction, { editor: editor }), _jsx(EmoijiAction, { editor: editor }), _jsx(SmartTagAction, { editor: editor, onClick: smartTagHandler?.onUpsert })] }), _jsxs(Flex, { gap: 4, justify: "flex-start", align: "center", children: [_jsx(BulletListAction, { editor: editor, useCustomBullet: config?.UnorderedList?.useCustomBullet }), _jsx(OrderedListAction, { editor: editor }), _jsx(TextAlignAction, { editor: editor }), _jsx(SpacingAction, { editor: editor, defaultValue: defaultTextStyle?.lineHeight }), _jsx(LetterSpacingAction, { editor: editor }), _jsx(IndentAction, { editor: editor }), _jsx(OutdentAction, { editor: editor }), _jsx(Divider, { type: "vertical", className: "toolbar-separator" }), _jsx(HistoryAction, { editor: editor }), _jsx(ClearFormattingAction, { editor: editor })] })] }));
|
|
42
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
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 BoldIcon = ({ 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: "M5 22V2H12.9687C14.5312 2 15.9736 2.47619 17.2957 3.42857C18.6178 4.38095 19.2788 5.70238 19.2788 7.39286C19.2788 8.60714 19.0024 9.54167 18.4495 10.1964C17.8966 10.8512 17.3798 11.3214 16.899 11.6071C17.5 11.869 18.1671 12.3571 18.9002 13.0714C19.6334 13.7857 20 14.8571 20 16.2857C20 18.4048 19.2187 19.8869 17.6562 20.7321C16.0937 21.5774 14.6274 22 13.2572 22H5ZM9.36298 18H13.113C14.2668 18 14.97 17.7083 15.2224 17.125C15.4748 16.5417 15.601 16.119 15.601 15.8571C15.601 15.5952 15.4748 15.1726 15.2224 14.5893C14.97 14.006 14.2308 13.7143 13.0048 13.7143H9.36298V18ZM9.36298 9.85714H12.7163C13.5096 9.85714 14.0865 9.65476 14.4471 9.25C14.8077 8.84524 14.988 8.39286 14.988 7.89286C14.988 7.32143 14.7837 6.85714 14.375 6.5C13.9663 6.14286 13.4375 5.96429 12.7885 5.96429H9.36298V9.85714Z", fill: "currentColor" }) }));
|
|
7
|
-
export const BoldAction = ({ editor }) => {
|
|
8
|
-
const { isBold, disabled } = useEditorState({
|
|
9
|
-
editor,
|
|
10
|
-
selector: ({ editor: editorInstance }) => ({
|
|
11
|
-
isBold: editorInstance.isActive('bold'),
|
|
12
|
-
disabled: !editorInstance.can().chain().focus().toggleBold().run(),
|
|
13
|
-
}),
|
|
14
|
-
});
|
|
15
|
-
return (_jsx(TextEditorButton, { disabled: disabled, onClick: () => editor.chain().focus().toggleBold().run(), isActive: isBold, icon: _jsx(BoldIcon, { size: 18 }), tooltipProps: {
|
|
16
|
-
title: `${TOOLTIPS.BOLD.TITLE} (${TOOLTIPS.BOLD.SHORTCUT})`,
|
|
17
|
-
} }));
|
|
18
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
export interface BulletListActionProps {
|
|
3
|
-
editor: Editor;
|
|
4
|
-
useCustomBullet?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare const BulletListAction: ({ editor, useCustomBullet }: BulletListActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { TEXT_EDITOR_CONSTANTS, UNORDERED_LIST_STYLE_TYPE } from '../../../constants';
|
|
3
|
-
import { isUnorderedListStyleType } from '../../../types';
|
|
4
|
-
import { CustomUnorderedList } from '../../../extensions/UnorderedList';
|
|
5
|
-
import { SplitButtonDropdown } from '../../SplitButtonDropdown';
|
|
6
|
-
import { useEditorState } from '@tiptap/react';
|
|
7
|
-
import { useMemo } from 'react';
|
|
8
|
-
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
9
|
-
const UnorderListIcon = ({ 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: "M3.57895 11C2.73684 11 2 11.7 2 12.5C2 13.3 2.73684 14 3.57895 14C4.42105 14 5.15789 13.3 5.15789 12.5C5.15789 11.7 4.42105 11 3.57895 11ZM3.57895 6C2.73684 6 2 6.7 2 7.5C2 8.3 2.73684 9 3.57895 9C4.42105 9 5.15789 8.3 5.15789 7.5C5.15789 6.7 4.42105 6 3.57895 6ZM3.57895 16C2.73684 16 2 16.7 2 17.5C2 18.3 2.73684 19 3.57895 19C4.42105 19 5.15789 18.3 5.15789 17.5C5.15789 16.7 4.42105 16 3.57895 16ZM7.26316 6.5V8.5H22V6.5H7.26316ZM7.26316 18.5H22V16.5H7.26316V18.5ZM7.26316 13.5H22V11.5H7.26316V13.5Z", fill: "currentColor" }) }));
|
|
10
|
-
const CUSTOM_BULLET_OPTIONS = [
|
|
11
|
-
{
|
|
12
|
-
label: '+',
|
|
13
|
-
value: `${UNORDERED_LIST_STYLE_TYPE.custom}_+`,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
label: '→',
|
|
17
|
-
value: `${UNORDERED_LIST_STYLE_TYPE.custom}_→`,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
label: '➤',
|
|
21
|
-
value: `${UNORDERED_LIST_STYLE_TYPE.custom}_➤`,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
label: '★',
|
|
25
|
-
value: `${UNORDERED_LIST_STYLE_TYPE.custom}_★`,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: '☆',
|
|
29
|
-
value: `${UNORDERED_LIST_STYLE_TYPE.custom}_☆`,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
const OPTIONS = [
|
|
33
|
-
{
|
|
34
|
-
label: '•',
|
|
35
|
-
value: UNORDERED_LIST_STYLE_TYPE.disc,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
label: '○',
|
|
39
|
-
value: UNORDERED_LIST_STYLE_TYPE.circle,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
label: '■',
|
|
43
|
-
value: UNORDERED_LIST_STYLE_TYPE.square,
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
export const BulletListAction = ({ editor, useCustomBullet = false }) => {
|
|
47
|
-
const { value, disabled, isSelected } = useEditorState({
|
|
48
|
-
editor,
|
|
49
|
-
selector: ({ editor: editorInstance }) => {
|
|
50
|
-
let value = editorInstance.getAttributes(CustomUnorderedList.name).listStyleType;
|
|
51
|
-
const disabled = !editorInstance.can().chain().focus().toggleCustomUnorderedList().run();
|
|
52
|
-
const isSelected = editorInstance.isActive(CustomUnorderedList.name);
|
|
53
|
-
if (isUnorderedListStyleType(value) && value === UNORDERED_LIST_STYLE_TYPE.custom) {
|
|
54
|
-
const bulletChar = editorInstance.getAttributes(CustomUnorderedList.name).customBulletChar;
|
|
55
|
-
value = `${UNORDERED_LIST_STYLE_TYPE.custom}_${bulletChar}`;
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
value,
|
|
59
|
-
disabled,
|
|
60
|
-
isSelected,
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
const options = useMemo(() => (useCustomBullet ? [...OPTIONS, ...CUSTOM_BULLET_OPTIONS] : OPTIONS), [useCustomBullet]);
|
|
65
|
-
return (_jsx(SplitButtonDropdown, { disabled: disabled, value: value, options: options, onClickOption: v => {
|
|
66
|
-
const [listStyleType, customBulletChar] = v.split('_');
|
|
67
|
-
if (!isUnorderedListStyleType(listStyleType))
|
|
68
|
-
return;
|
|
69
|
-
if (isSelected) {
|
|
70
|
-
editor
|
|
71
|
-
.chain()
|
|
72
|
-
.focus()
|
|
73
|
-
.setUnorderedListStyle({
|
|
74
|
-
listStyleType,
|
|
75
|
-
customBulletChar,
|
|
76
|
-
})
|
|
77
|
-
.run();
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
editor
|
|
81
|
-
.chain()
|
|
82
|
-
.focus()
|
|
83
|
-
.toggleCustomUnorderedList({
|
|
84
|
-
listStyleType,
|
|
85
|
-
customBulletChar,
|
|
86
|
-
})
|
|
87
|
-
.run();
|
|
88
|
-
}, onClick: () => {
|
|
89
|
-
editor.chain().focus().toggleCustomUnorderedList().run();
|
|
90
|
-
}, tooltipProps: {
|
|
91
|
-
title: `${TOOLTIPS.BULLET_LIST.TITLE} (${TOOLTIPS.BULLET_LIST.SHORTCUT})`,
|
|
92
|
-
}, children: _jsx(UnorderListIcon, { size: 18 }) }));
|
|
93
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
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 RemoveFormattingIcon = ({ 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: "M3.41111 3L2 4.42875L9.74445 12.27L7 18.75H10.3333L12.0778 14.6325L18.3667 21L19.7778 19.5712L3.72222 3.30375L3.41111 3ZM6.44444 3V3.2025L9.57778 6.375H12.2444L11.4444 8.265L13.7778 10.6275L15.5667 6.375H22V3H6.44444Z", fill: "currentColor" }) }));
|
|
7
|
-
export const ClearFormattingAction = ({ editor }) => {
|
|
8
|
-
const { disabled } = useEditorState({
|
|
9
|
-
editor,
|
|
10
|
-
selector: ({ editor: editorInstance }) => ({
|
|
11
|
-
disabled: !editorInstance.can().chain().focus().run(),
|
|
12
|
-
}),
|
|
13
|
-
});
|
|
14
|
-
const clearFormatting = () => {
|
|
15
|
-
editor?.chain().focus().clearFormatting().run();
|
|
16
|
-
};
|
|
17
|
-
return (_jsx(TextEditorButton, { onClick: clearFormatting, disabled: disabled, icon: _jsx(RemoveFormattingIcon, { size: 18 }), tooltipProps: {
|
|
18
|
-
title: `${TOOLTIPS.CLEAR_FORMATTING.TITLE} (${TOOLTIPS.CLEAR_FORMATTING.SHORTCUT})`,
|
|
19
|
-
} }));
|
|
20
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from 'react';
|
|
3
|
-
import { EmojiSmileIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
4
|
-
import { EMOJI_COLLECTIONS, EmojiPopover } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
5
|
-
import { TextEditorButton } from '../../Button';
|
|
6
|
-
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
7
|
-
import { useTextEditorStore } from '../../../provider';
|
|
8
|
-
import { useEditorState } from '@tiptap/react';
|
|
9
|
-
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
10
|
-
export const EmoijiAction = ({ editor }) => {
|
|
11
|
-
const bubbleMenuContainer = useTextEditorStore(state => state.bubbleMenuContainer);
|
|
12
|
-
const { disabled } = useEditorState({
|
|
13
|
-
editor: editor,
|
|
14
|
-
selector: ({ editor: editorInstance }) => ({
|
|
15
|
-
disabled: !editorInstance.can().chain().focus().run(),
|
|
16
|
-
}),
|
|
17
|
-
});
|
|
18
|
-
const getPopupContainer = useCallback(() => bubbleMenuContainer || document.body, [bubbleMenuContainer]);
|
|
19
|
-
return (_jsx(EmojiPopover, { collections: [
|
|
20
|
-
{
|
|
21
|
-
key: EMOJI_COLLECTIONS.COMMON,
|
|
22
|
-
label: _jsx(EmojiSmileIcon, {}),
|
|
23
|
-
},
|
|
24
|
-
], onEmojiClick: emoji => {
|
|
25
|
-
if (typeof emoji !== 'string')
|
|
26
|
-
return;
|
|
27
|
-
editor?.chain().insertEmoji(emoji);
|
|
28
|
-
}, getPopupContainer: getPopupContainer, children: _jsx(TextEditorButton, { disabled: disabled, tooltipProps: {
|
|
29
|
-
title: TOOLTIPS.EMOJI.TITLE,
|
|
30
|
-
}, icon: _jsx(EmojiSmileIcon, { size: 18 }) }) }));
|
|
31
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
import { FontConfig } from '../../../types';
|
|
3
|
-
export interface FontFamilyActionProps {
|
|
4
|
-
editor: Editor;
|
|
5
|
-
fonts?: FontConfig[];
|
|
6
|
-
}
|
|
7
|
-
export declare const FontFamilyAction: (props: FontFamilyActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { toString } from 'lodash';
|
|
3
|
-
import { DEFAULT_FONT_CONFIGS } from '../../../constants';
|
|
4
|
-
import { FontPopover } from '../../FontPopover/FontPopover';
|
|
5
|
-
import { useEditorState } from '@tiptap/react';
|
|
6
|
-
export const FontFamilyAction = (props) => {
|
|
7
|
-
const { editor, fonts = DEFAULT_FONT_CONFIGS } = props;
|
|
8
|
-
const { fontValue, fontWeight } = useEditorState({
|
|
9
|
-
editor,
|
|
10
|
-
selector: ({ editor: editorInstance }) => {
|
|
11
|
-
const { fontWeight, fontFamily } = editorInstance.getAttributes('textStyle') || {};
|
|
12
|
-
let fontValue = toString(fontFamily);
|
|
13
|
-
if (fontValue.split(',').length > 0) {
|
|
14
|
-
[fontValue] = fontValue.split(',');
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
fontValue,
|
|
18
|
-
fontWeight: Number(fontWeight),
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
return (_jsx(FontPopover, { fonts: fonts, value: {
|
|
23
|
-
font: fonts.find(font => fontValue.includes(font.fontFamily.name)) || fonts[0],
|
|
24
|
-
weight: fontWeight,
|
|
25
|
-
}, onChange: (font, weight) => {
|
|
26
|
-
editor.chain().focus().setFontFamily(font.fontFamily.name).setFontWeight(weight).run();
|
|
27
|
-
} }));
|
|
28
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Editor } from '@tiptap/core';
|
|
3
|
-
export interface FontSizeActionProps {
|
|
4
|
-
editor: Editor;
|
|
5
|
-
throttled?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const FontSizeAction: import("react").MemoExoticComponent<({ editor, throttled }: FontSizeActionProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTextEditorStore } from '../../../provider';
|
|
3
|
-
import { FontSizeInput, } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { memo, useCallback, useMemo, useRef, useState } from 'react';
|
|
6
|
-
import { useThrottledCallback } from 'use-debounce';
|
|
7
|
-
import { useEditorState } from '@tiptap/react';
|
|
8
|
-
const StyledFontSizeInput = styled(FontSizeInput) `
|
|
9
|
-
&.antsomi-input-number {
|
|
10
|
-
width: 36px;
|
|
11
|
-
|
|
12
|
-
input.antsomi-input-number-input {
|
|
13
|
-
text-align: center;
|
|
14
|
-
height: 30px;
|
|
15
|
-
padding-inline: 0;
|
|
16
|
-
font-size: 12px;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
export const FontSizeAction = memo(({ editor, throttled = 100 }) => {
|
|
21
|
-
const inputRef = useRef(null);
|
|
22
|
-
const bubbleMenuContainer = useTextEditorStore(state => state.bubbleMenuContainer);
|
|
23
|
-
const { numberFontSize } = useEditorState({
|
|
24
|
-
editor,
|
|
25
|
-
selector: ({ editor: editorInstance }) => {
|
|
26
|
-
const { fontSize } = editorInstance.getAttributes('textStyle');
|
|
27
|
-
return { numberFontSize: fontSize.replace('px', '') };
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
const [currentFontSize, setCurrentFontSize] = useState(numberFontSize);
|
|
31
|
-
const updateEditorFontSize = useThrottledCallback((v) => {
|
|
32
|
-
if (v === numberFontSize)
|
|
33
|
-
return;
|
|
34
|
-
editor.chain().focus().setFontSize(`${v}px`).run();
|
|
35
|
-
}, throttled);
|
|
36
|
-
const handleFontSizeChange = useCallback((value) => {
|
|
37
|
-
setCurrentFontSize(+value);
|
|
38
|
-
updateEditorFontSize(+value);
|
|
39
|
-
}, [updateEditorFontSize]);
|
|
40
|
-
const dropdownProps = useMemo(() => ({
|
|
41
|
-
getPopupContainer: () => bubbleMenuContainer,
|
|
42
|
-
}), [bubbleMenuContainer]);
|
|
43
|
-
return (_jsx(StyledFontSizeInput, { ref: inputRef, placeholder: "Font Size", value: currentFontSize, onChange: handleFontSizeChange, dropdownProps: dropdownProps }));
|
|
44
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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 UndoIcon = ({ 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.1768 9.02857C8.29834 9.37143 6.64088 10.0571 5.09392 11.3143L2 8V16H9.73481L6.75138 12.9143C10.8398 9.94286 16.4751 10.8571 19.4586 15.0857C19.6796 15.4286 19.9006 15.6571 20.011 16L22 14.9714C19.5691 10.6286 14.9282 8.22857 10.1768 9.02857Z", fill: "currentColor" }) }));
|
|
7
|
-
const RedoIcon = ({ 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: "M13.8232 9.02857C15.7017 9.37143 17.3591 10.0571 18.9061 11.3143L22 8V16H14.2652L17.2486 12.9143C13.1602 9.94286 7.52486 10.8571 4.54144 15.0857C4.32044 15.4286 4.09945 15.6571 3.98895 16L2 14.9714C4.43094 10.6286 9.07182 8.22857 13.8232 9.02857Z", fill: "currentColor" }) }));
|
|
8
|
-
export const HistoryAction = ({ editor }) => {
|
|
9
|
-
const { disabledUndo, disabledRedo } = useEditorState({
|
|
10
|
-
editor,
|
|
11
|
-
selector: ({ editor: editorInstance }) => ({
|
|
12
|
-
disabledUndo: !editorInstance.can().chain().focus().undo().run(),
|
|
13
|
-
disabledRedo: !editorInstance.can().chain().focus().redo().run(),
|
|
14
|
-
}),
|
|
15
|
-
});
|
|
16
|
-
return (_jsxs(_Fragment, { children: [_jsx(TextEditorButton, { disabled: disabledUndo, onClick: () => editor.chain().focus().undo().run(), icon: _jsx(UndoIcon, { size: 18 }), tooltipProps: {
|
|
17
|
-
title: `${TOOLTIPS.UNDO.TITLE} (${TOOLTIPS.UNDO.SHORTCUT})`,
|
|
18
|
-
} }), _jsx(TextEditorButton, { disabled: disabledRedo, onClick: () => editor.chain().focus().redo().run(), icon: _jsx(RedoIcon, { size: 18 }), tooltipProps: {
|
|
19
|
-
title: `${TOOLTIPS.REDO.TITLE} (${TOOLTIPS.REDO.SHORTCUT})`,
|
|
20
|
-
} })] }));
|
|
21
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
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 IndentIcon = ({ 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: "M2 22H22V19.7778H2V22ZM2 7.55556V16.4444L6.44444 12L2 7.55556ZM10.8889 17.5556H22V15.3333H10.8889V17.5556ZM2 2V4.22222H22V2H2ZM10.8889 8.66667H22V6.44444H10.8889V8.66667ZM10.8889 13.1111H22V10.8889H10.8889V13.1111Z", fill: "currentColor" }) }));
|
|
7
|
-
export const IndentAction = ({ editor }) => {
|
|
8
|
-
const { disabled } = useEditorState({
|
|
9
|
-
editor,
|
|
10
|
-
selector: ({ editor: editorInstance }) => ({
|
|
11
|
-
disabled: !editorInstance.can().chain().focus().indent().run(),
|
|
12
|
-
}),
|
|
13
|
-
});
|
|
14
|
-
return (_jsx(TextEditorButton, { disabled: disabled, icon: _jsx(IndentIcon, { size: 18 }), onClick: () => editor.chain().focus().indent().run(), tooltipProps: {
|
|
15
|
-
title: `${TOOLTIPS.INDENT.TITLE} (${TOOLTIPS.INDENT.SHORTCUT})`,
|
|
16
|
-
} }));
|
|
17
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
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 ItalicIcon = ({ 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: "M3 22V18.4286H8.84615L13.2308 5.57143H7.38462V2H22V5.57143H16.8846L12.5 18.4286H17.6154V22H3Z", fill: "currentColor" }) }));
|
|
7
|
-
export const ItalicAction = ({ editor }) => {
|
|
8
|
-
const { isItalic, disabled } = useEditorState({
|
|
9
|
-
editor,
|
|
10
|
-
selector: ({ editor: editorInstance }) => ({
|
|
11
|
-
isItalic: editorInstance.isActive('italic'),
|
|
12
|
-
disabled: !editorInstance.can().chain().focus().toggleItalic().run(),
|
|
13
|
-
}),
|
|
14
|
-
});
|
|
15
|
-
return (_jsx(TextEditorButton, { onClick: () => editor.chain().focus().toggleItalic().run(), disabled: disabled, isActive: isItalic, icon: _jsx(ItalicIcon, { size: 18 }), tooltipProps: {
|
|
16
|
-
title: `${TOOLTIPS.ITALIC.TITLE} (${TOOLTIPS.ITALIC.SHORTCUT})`,
|
|
17
|
-
} }));
|
|
18
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SplitButtonDropdown } from '../../SplitButtonDropdown';
|
|
3
|
-
import { range } from 'lodash';
|
|
4
|
-
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
5
|
-
import { useEditorState } from '@tiptap/react';
|
|
6
|
-
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
7
|
-
const LetterSpacingIcon = ({ 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: "M14.4 10.1053H18.5L16.5 4.42105L14.4 10.1053ZM15.6 2H17.3L22 14.6316H20.1L19.1 11.8947H13.7L12.7 14.6316H10.8L15.6 2ZM11.2 2H13.1L8.4 14.6316H6.7L2 2H3.9L7.5 12.2105M19 22V19.8947H5V22L2 18.8421L5 15.6842V17.7895H19V15.6842L22 18.8421L19 22Z", fill: "currentColor" }) }));
|
|
8
|
-
const LETTER_SPACING_VALUES = range(-10, 11);
|
|
9
|
-
export const LetterSpacingAction = ({ editor }) => {
|
|
10
|
-
const { letterSpacing } = useEditorState({
|
|
11
|
-
editor,
|
|
12
|
-
selector: ({ editor: editorInstance }) => ({
|
|
13
|
-
letterSpacing: editorInstance.getAttributes('textStyle').letterSpacing,
|
|
14
|
-
}),
|
|
15
|
-
});
|
|
16
|
-
return (_jsx(SplitButtonDropdown, { tooltipProps: {
|
|
17
|
-
title: TOOLTIPS.LETTER_SPACING.TITLE,
|
|
18
|
-
}, value: letterSpacing, options: LETTER_SPACING_VALUES.map(value => ({
|
|
19
|
-
value: `${value}px`,
|
|
20
|
-
label: `${value} px`,
|
|
21
|
-
})), onClickOption: v => {
|
|
22
|
-
editor.chain().focus().setLetterSpacing(v).run();
|
|
23
|
-
}, onClick: (_, isSelected) => {
|
|
24
|
-
if (isSelected) {
|
|
25
|
-
editor.chain().focus().unsetLetterSpacing().run();
|
|
26
|
-
}
|
|
27
|
-
}, children: _jsx(LetterSpacingIcon, { size: 18 }) }));
|
|
28
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
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 LinkIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: size, width: size, viewBox: "0 -960 960 960", fill: "currentColor", children: _jsx("path", { d: "M680-160v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm560-40h-80q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480Z" }) }));
|
|
7
|
-
export const LinkAction = ({ editor, onClick }) => {
|
|
8
|
-
const { isActive } = useEditorState({
|
|
9
|
-
editor,
|
|
10
|
-
selector: ({ editor: editorInstance }) => ({
|
|
11
|
-
isActive: editorInstance.isActive('link'),
|
|
12
|
-
}),
|
|
13
|
-
});
|
|
14
|
-
return (_jsx(TextEditorButton, { isActive: isActive, icon: _jsx(LinkIcon, { size: 18 }), onClick: () => onClick?.(), tooltipProps: {
|
|
15
|
-
title: TOOLTIPS.LINK.TITLE,
|
|
16
|
-
} }));
|
|
17
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ORDERED_LIST_STYLE_TYPE, TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
3
|
-
import { SplitButtonDropdown } from '../../SplitButtonDropdown';
|
|
4
|
-
import { CustomOrderedList } from '../../../extensions/OrderedList';
|
|
5
|
-
import { isOrderedListStyleType } from '../../../types';
|
|
6
|
-
import { useEditorState } from '@tiptap/react';
|
|
7
|
-
const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
|
|
8
|
-
const ListOrderedIcon = ({ 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: "M2 16.7857H4.10526V17.3214H3.05263V18.3929H4.10526V18.9286H2V20H5.15789V15.7143H2V16.7857ZM3.05263 9.28571H4.10526V5H2V6.07143H3.05263V9.28571ZM2 11.4286H3.89474L2 13.6786V14.6429H5.15789V13.5714H3.26316L5.15789 11.3214V10.3571H2V11.4286ZM7.26316 6.07143V8.21429H22V6.07143H7.26316ZM7.26316 18.9286H22V16.7857H7.26316V18.9286ZM7.26316 13.5714H22V11.4286H7.26316V13.5714Z", fill: "currentColor" }) }));
|
|
9
|
-
const OPTIONS = [
|
|
10
|
-
{
|
|
11
|
-
label: '1, 2, 3, ...',
|
|
12
|
-
value: ORDERED_LIST_STYLE_TYPE.decimal,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
label: 'a, b, c, ...',
|
|
16
|
-
value: ORDERED_LIST_STYLE_TYPE.lowerAlpha,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: 'A, B, C, ...',
|
|
20
|
-
value: ORDERED_LIST_STYLE_TYPE.upperAlpha,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: 'i, ii, iii, ...',
|
|
24
|
-
value: ORDERED_LIST_STYLE_TYPE.lowerRoman,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: 'I, II, III, ...',
|
|
28
|
-
value: ORDERED_LIST_STYLE_TYPE.upperRoman,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
label: 'α, β, γ, ...',
|
|
32
|
-
value: ORDERED_LIST_STYLE_TYPE.lowerGreek,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
label: '01, 02, 03, ...',
|
|
36
|
-
value: ORDERED_LIST_STYLE_TYPE.decimalLeadingZero,
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
export const OrderedListAction = ({ editor }) => {
|
|
40
|
-
const { value, disabled, isSelected } = useEditorState({
|
|
41
|
-
editor,
|
|
42
|
-
selector: ({ editor: editorInstance }) => ({
|
|
43
|
-
disabled: !editorInstance.can().chain().focus().toggleCustomOrderedList().run(),
|
|
44
|
-
value: editorInstance.getAttributes(CustomOrderedList.name).listStyleType,
|
|
45
|
-
isSelected: editorInstance.isActive(CustomOrderedList.name),
|
|
46
|
-
}),
|
|
47
|
-
});
|
|
48
|
-
return (_jsx(SplitButtonDropdown, { disabled: disabled, value: value, options: OPTIONS, onClickOption: v => {
|
|
49
|
-
if (!isOrderedListStyleType(v))
|
|
50
|
-
return;
|
|
51
|
-
if (isSelected) {
|
|
52
|
-
editor.chain().focus().setOrderedListStyleType(v).run();
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
editor
|
|
56
|
-
.chain()
|
|
57
|
-
.focus()
|
|
58
|
-
.toggleCustomOrderedList({
|
|
59
|
-
listStyleType: v,
|
|
60
|
-
})
|
|
61
|
-
.run();
|
|
62
|
-
}, onClick: () => {
|
|
63
|
-
editor.chain().focus().toggleCustomOrderedList().run();
|
|
64
|
-
}, tooltipProps: {
|
|
65
|
-
title: `${TOOLTIPS.ORDERED_LIST.TITLE} (${TOOLTIPS.ORDERED_LIST.SHORTCUT})`,
|
|
66
|
-
}, children: _jsx(ListOrderedIcon, { size: 18 }) }));
|
|
67
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
};
|