@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,366 +0,0 @@
|
|
|
1
|
-
import { arrow, autoPlacement, computePosition, flip, hide, inline, offset, shift, size, } from '@floating-ui/dom';
|
|
2
|
-
import { isTextSelection, posToDOMRect } from '@tiptap/core';
|
|
3
|
-
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
|
4
|
-
import { CellSelection } from '@tiptap/pm/tables';
|
|
5
|
-
function combineDOMRects(rect1, rect2) {
|
|
6
|
-
const top = Math.min(rect1.top, rect2.top);
|
|
7
|
-
const bottom = Math.max(rect1.bottom, rect2.bottom);
|
|
8
|
-
const left = Math.min(rect1.left, rect2.left);
|
|
9
|
-
const right = Math.max(rect1.right, rect2.right);
|
|
10
|
-
const width = right - left;
|
|
11
|
-
const height = bottom - top;
|
|
12
|
-
const x = left;
|
|
13
|
-
const y = top;
|
|
14
|
-
return new DOMRect(x, y, width, height);
|
|
15
|
-
}
|
|
16
|
-
export class BubbleMenuView {
|
|
17
|
-
get middlewares() {
|
|
18
|
-
const middlewares = [];
|
|
19
|
-
if (this.floatingUIOptions.flip) {
|
|
20
|
-
middlewares.push(flip(typeof this.floatingUIOptions.flip !== 'boolean'
|
|
21
|
-
? this.floatingUIOptions.flip
|
|
22
|
-
: undefined));
|
|
23
|
-
}
|
|
24
|
-
if (this.floatingUIOptions.shift) {
|
|
25
|
-
middlewares.push(shift(typeof this.floatingUIOptions.shift !== 'boolean'
|
|
26
|
-
? this.floatingUIOptions.shift
|
|
27
|
-
: undefined));
|
|
28
|
-
}
|
|
29
|
-
if (this.floatingUIOptions.offset) {
|
|
30
|
-
middlewares.push(offset(typeof this.floatingUIOptions.offset !== 'boolean'
|
|
31
|
-
? this.floatingUIOptions.offset
|
|
32
|
-
: undefined));
|
|
33
|
-
}
|
|
34
|
-
if (this.floatingUIOptions.arrow) {
|
|
35
|
-
middlewares.push(arrow(this.floatingUIOptions.arrow));
|
|
36
|
-
}
|
|
37
|
-
if (this.floatingUIOptions.size) {
|
|
38
|
-
middlewares.push(size(typeof this.floatingUIOptions.size !== 'boolean'
|
|
39
|
-
? this.floatingUIOptions.size
|
|
40
|
-
: undefined));
|
|
41
|
-
}
|
|
42
|
-
if (this.floatingUIOptions.autoPlacement) {
|
|
43
|
-
middlewares.push(autoPlacement(typeof this.floatingUIOptions.autoPlacement !== 'boolean'
|
|
44
|
-
? this.floatingUIOptions.autoPlacement
|
|
45
|
-
: undefined));
|
|
46
|
-
}
|
|
47
|
-
if (this.floatingUIOptions.hide) {
|
|
48
|
-
middlewares.push(hide(typeof this.floatingUIOptions.hide !== 'boolean'
|
|
49
|
-
? this.floatingUIOptions.hide
|
|
50
|
-
: undefined));
|
|
51
|
-
}
|
|
52
|
-
if (this.floatingUIOptions.inline) {
|
|
53
|
-
middlewares.push(inline(typeof this.floatingUIOptions.inline !== 'boolean'
|
|
54
|
-
? this.floatingUIOptions.inline
|
|
55
|
-
: undefined));
|
|
56
|
-
}
|
|
57
|
-
return middlewares;
|
|
58
|
-
}
|
|
59
|
-
constructor({ editor, element, view, updateDelay = 250, resizeDelay = 60, container, shouldShow, options, }) {
|
|
60
|
-
this.preventHide = false;
|
|
61
|
-
this.isVisible = false;
|
|
62
|
-
this.floatingUIOptions = {
|
|
63
|
-
strategy: 'absolute',
|
|
64
|
-
placement: 'top',
|
|
65
|
-
offset: 8,
|
|
66
|
-
flip: {},
|
|
67
|
-
shift: {},
|
|
68
|
-
arrow: false,
|
|
69
|
-
size: false,
|
|
70
|
-
autoPlacement: false,
|
|
71
|
-
hide: false,
|
|
72
|
-
inline: false,
|
|
73
|
-
onShow: undefined,
|
|
74
|
-
onHide: undefined,
|
|
75
|
-
onUpdate: undefined,
|
|
76
|
-
onDestroy: undefined,
|
|
77
|
-
};
|
|
78
|
-
this.shouldShow = ({ view, state, from, to, }) => {
|
|
79
|
-
const { doc, selection } = state;
|
|
80
|
-
const { empty } = selection;
|
|
81
|
-
// Sometime check for `empty` is not enough.
|
|
82
|
-
// Doubleclick an empty paragraph returns a node size of 2.
|
|
83
|
-
// So we check also for an empty text size.
|
|
84
|
-
const isEmptyTextBlock = !doc.textBetween(from, to).length && isTextSelection(state.selection);
|
|
85
|
-
// When clicking on a element inside the bubble menu the editor "blur" event
|
|
86
|
-
// is called and the bubble menu item is focussed. In this case we should
|
|
87
|
-
// consider the menu as part of the editor and keep showing the menu
|
|
88
|
-
const isChildOfMenu = this.element.contains(document.activeElement);
|
|
89
|
-
const hasEditorFocus = view.hasFocus() || isChildOfMenu;
|
|
90
|
-
if (!hasEditorFocus || empty || isEmptyTextBlock || !this.editor.isEditable) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
94
|
-
};
|
|
95
|
-
this.mousedownHandler = () => {
|
|
96
|
-
this.preventHide = true;
|
|
97
|
-
};
|
|
98
|
-
this.dragstartHandler = () => {
|
|
99
|
-
this.hide();
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Handles the window resize event and element resize event to update the position of the bubble menu.
|
|
103
|
-
* It uses a debounce mechanism to prevent excessive updates.
|
|
104
|
-
* The delay is defined by the `resizeDelay` property.
|
|
105
|
-
*/
|
|
106
|
-
this.resizeHandler = (delay = this.resizeDelay) => {
|
|
107
|
-
if (this.resizeDebounceTimer) {
|
|
108
|
-
clearTimeout(this.resizeDebounceTimer);
|
|
109
|
-
}
|
|
110
|
-
this.resizeDebounceTimer = window.setTimeout(() => {
|
|
111
|
-
this.updatePosition();
|
|
112
|
-
}, delay);
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Window resize handler that uses the default resize delay.
|
|
116
|
-
* This is a separate function to maintain the same reference for addEventListener/removeEventListener.
|
|
117
|
-
*/
|
|
118
|
-
this.windowResizeHandler = () => {
|
|
119
|
-
this.resizeHandler();
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Sets up ResizeObserver to watch for bubble menu element size changes.
|
|
123
|
-
* This ensures the bubble menu position is updated when the element resizes
|
|
124
|
-
* due to React component rendering different children, not just when the window resizes.
|
|
125
|
-
*/
|
|
126
|
-
this.setupResizeObserver = () => {
|
|
127
|
-
if (typeof ResizeObserver === 'undefined') {
|
|
128
|
-
// ResizeObserver is not supported in this environment
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
// Timer for debouncing the visibility restoration after resize
|
|
132
|
-
let resizeTimer = null;
|
|
133
|
-
// Time to wait before showing the element again after resize stops
|
|
134
|
-
const DEBOUNCE_TIME = 100;
|
|
135
|
-
this.resizeObserver = new ResizeObserver(entries => {
|
|
136
|
-
for (const entry of entries) {
|
|
137
|
-
// Only handle resize events for the bubble menu element itself
|
|
138
|
-
if (entry.target === this.element) {
|
|
139
|
-
// Temporarily hide the element to prevent visual glitches during resize
|
|
140
|
-
// This prevents the bubble menu from "jumping" or flickering while repositioning
|
|
141
|
-
this.element.style.visibility = 'hidden';
|
|
142
|
-
this.element.style.opacity = '0';
|
|
143
|
-
// Clear any existing timer to reset the debounce period
|
|
144
|
-
if (resizeTimer) {
|
|
145
|
-
clearTimeout(resizeTimer);
|
|
146
|
-
}
|
|
147
|
-
// Immediately update the position with no delay for responsive positioning
|
|
148
|
-
this.resizeHandler(0);
|
|
149
|
-
// Set up a debounced timer to restore visibility after resize activity stops
|
|
150
|
-
resizeTimer = setTimeout(() => {
|
|
151
|
-
// Use requestAnimationFrame to ensure the position update is complete
|
|
152
|
-
// before making the element visible again
|
|
153
|
-
requestAnimationFrame(() => {
|
|
154
|
-
this.element.style.visibility = 'visible';
|
|
155
|
-
this.element.style.opacity = '1';
|
|
156
|
-
resizeTimer = null;
|
|
157
|
-
});
|
|
158
|
-
}, DEBOUNCE_TIME);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
// Observe the bubble menu element itself - this is where React components are rendered
|
|
163
|
-
// When React renders different children, the element size may change
|
|
164
|
-
this.resizeObserver.observe(this.element);
|
|
165
|
-
// Also observe the editor view DOM element for editor size changes
|
|
166
|
-
this.resizeObserver.observe(this.view.dom);
|
|
167
|
-
};
|
|
168
|
-
this.focusHandler = () => {
|
|
169
|
-
// we use `setTimeout` to make sure `selection` is already updated
|
|
170
|
-
setTimeout(() => this.update(this.editor.view));
|
|
171
|
-
};
|
|
172
|
-
this.blurHandler = ({ event }) => {
|
|
173
|
-
if (this.preventHide) {
|
|
174
|
-
this.preventHide = false;
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
if (event?.relatedTarget && this.element.parentNode?.contains(event.relatedTarget)) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
if (event?.relatedTarget === this.editor.view.dom) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
this.hide();
|
|
184
|
-
};
|
|
185
|
-
this.handleDebouncedUpdate = (view, oldState) => {
|
|
186
|
-
const selectionChanged = !oldState?.selection.eq(view.state.selection);
|
|
187
|
-
const docChanged = !oldState?.doc.eq(view.state.doc);
|
|
188
|
-
if (!selectionChanged && !docChanged) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
if (this.updateDebounceTimer) {
|
|
192
|
-
clearTimeout(this.updateDebounceTimer);
|
|
193
|
-
}
|
|
194
|
-
this.updateDebounceTimer = window.setTimeout(() => {
|
|
195
|
-
this.updateHandler(view, selectionChanged, docChanged, oldState);
|
|
196
|
-
}, this.updateDelay);
|
|
197
|
-
};
|
|
198
|
-
this.updateHandler = (view, selectionChanged, docChanged, oldState) => {
|
|
199
|
-
const { composing } = view;
|
|
200
|
-
const isSame = !selectionChanged && !docChanged;
|
|
201
|
-
if (composing || isSame) {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
const shouldShow = this.getShouldShow(oldState);
|
|
205
|
-
if (!shouldShow) {
|
|
206
|
-
this.hide();
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
this.show();
|
|
210
|
-
this.updatePosition();
|
|
211
|
-
};
|
|
212
|
-
this.editor = editor;
|
|
213
|
-
this.element = element;
|
|
214
|
-
this.view = view;
|
|
215
|
-
this.updateDelay = updateDelay;
|
|
216
|
-
this.resizeDelay = resizeDelay;
|
|
217
|
-
this.container = container;
|
|
218
|
-
this.floatingUIOptions = {
|
|
219
|
-
...this.floatingUIOptions,
|
|
220
|
-
...options,
|
|
221
|
-
};
|
|
222
|
-
this.element.tabIndex = 0;
|
|
223
|
-
if (shouldShow) {
|
|
224
|
-
this.shouldShow = shouldShow;
|
|
225
|
-
}
|
|
226
|
-
const containerElement = this.getContainer();
|
|
227
|
-
if (containerElement === document.body) {
|
|
228
|
-
this.element.style.zIndex = '9999';
|
|
229
|
-
}
|
|
230
|
-
this.element.addEventListener('mousedown', this.mousedownHandler, { capture: true });
|
|
231
|
-
this.view.dom.addEventListener('dragstart', this.dragstartHandler);
|
|
232
|
-
this.editor.on('focus', this.focusHandler);
|
|
233
|
-
this.editor.on('blur', this.blurHandler);
|
|
234
|
-
window.addEventListener('resize', this.windowResizeHandler);
|
|
235
|
-
this.setupResizeObserver();
|
|
236
|
-
this.update(view, view.state);
|
|
237
|
-
if (this.getShouldShow()) {
|
|
238
|
-
this.show();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
updatePosition() {
|
|
242
|
-
const { selection } = this.editor.state;
|
|
243
|
-
const domRect = posToDOMRect(this.view, selection.from, selection.to);
|
|
244
|
-
let virtualElement = {
|
|
245
|
-
getBoundingClientRect: () => domRect,
|
|
246
|
-
getClientRects: () => [domRect],
|
|
247
|
-
};
|
|
248
|
-
// this is a special case for cell selections
|
|
249
|
-
if (selection instanceof CellSelection) {
|
|
250
|
-
const { $anchorCell, $headCell } = selection;
|
|
251
|
-
const from = $anchorCell ? $anchorCell.pos : $headCell.pos;
|
|
252
|
-
const to = $headCell ? $headCell.pos : $anchorCell.pos;
|
|
253
|
-
const fromDOM = this.view.nodeDOM(from);
|
|
254
|
-
const toDOM = this.view.nodeDOM(to);
|
|
255
|
-
if (!fromDOM || !toDOM) {
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
const clientRect = fromDOM === toDOM
|
|
259
|
-
? fromDOM.getBoundingClientRect()
|
|
260
|
-
: combineDOMRects(fromDOM.getBoundingClientRect(), toDOM.getBoundingClientRect());
|
|
261
|
-
virtualElement = {
|
|
262
|
-
getBoundingClientRect: () => clientRect,
|
|
263
|
-
getClientRects: () => [clientRect],
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
computePosition(virtualElement, this.element, {
|
|
267
|
-
placement: this.floatingUIOptions.placement,
|
|
268
|
-
strategy: this.floatingUIOptions.strategy,
|
|
269
|
-
middleware: this.middlewares,
|
|
270
|
-
}).then(({ x, y, strategy }) => {
|
|
271
|
-
this.element.style.width = 'max-content';
|
|
272
|
-
this.element.style.position = strategy;
|
|
273
|
-
this.element.style.left = `${x}px`;
|
|
274
|
-
this.element.style.top = `${y}px`;
|
|
275
|
-
if (this.isVisible && this.floatingUIOptions.onUpdate) {
|
|
276
|
-
this.floatingUIOptions.onUpdate();
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
update(view, oldState) {
|
|
281
|
-
const { state } = view;
|
|
282
|
-
const hasValidSelection = state.selection.from !== state.selection.to;
|
|
283
|
-
if (this.updateDelay > 0 && hasValidSelection) {
|
|
284
|
-
this.handleDebouncedUpdate(view, oldState);
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
const selectionChanged = !oldState?.selection.eq(view.state.selection);
|
|
288
|
-
const docChanged = !oldState?.doc.eq(view.state.doc);
|
|
289
|
-
this.updateHandler(view, selectionChanged, docChanged, oldState);
|
|
290
|
-
}
|
|
291
|
-
getShouldShow(oldState) {
|
|
292
|
-
const { state } = this.view;
|
|
293
|
-
const { selection } = state;
|
|
294
|
-
// support for CellSelections
|
|
295
|
-
const { ranges } = selection;
|
|
296
|
-
const from = Math.min(...ranges.map(range => range.$from.pos));
|
|
297
|
-
const to = Math.max(...ranges.map(range => range.$to.pos));
|
|
298
|
-
const shouldShow = this.shouldShow?.({
|
|
299
|
-
editor: this.editor,
|
|
300
|
-
element: this.element,
|
|
301
|
-
view: this.view,
|
|
302
|
-
state,
|
|
303
|
-
oldState,
|
|
304
|
-
from,
|
|
305
|
-
to,
|
|
306
|
-
});
|
|
307
|
-
return shouldShow;
|
|
308
|
-
}
|
|
309
|
-
getContainer() {
|
|
310
|
-
if (!this.container) {
|
|
311
|
-
return this.view.dom.parentElement;
|
|
312
|
-
}
|
|
313
|
-
if (typeof this.container === 'function') {
|
|
314
|
-
return this.container();
|
|
315
|
-
}
|
|
316
|
-
return this.container;
|
|
317
|
-
}
|
|
318
|
-
show() {
|
|
319
|
-
if (this.isVisible) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
this.element.style.visibility = 'visible';
|
|
323
|
-
this.element.style.opacity = '1';
|
|
324
|
-
const container = this.getContainer();
|
|
325
|
-
if (container) {
|
|
326
|
-
container.appendChild(this.element);
|
|
327
|
-
}
|
|
328
|
-
if (this.floatingUIOptions.onShow) {
|
|
329
|
-
this.floatingUIOptions.onShow();
|
|
330
|
-
}
|
|
331
|
-
this.isVisible = true;
|
|
332
|
-
}
|
|
333
|
-
hide() {
|
|
334
|
-
if (!this.isVisible) {
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
this.element.style.visibility = 'hidden';
|
|
338
|
-
this.element.style.opacity = '0';
|
|
339
|
-
// remove from the parent element
|
|
340
|
-
this.element.remove();
|
|
341
|
-
if (this.floatingUIOptions.onHide) {
|
|
342
|
-
this.floatingUIOptions.onHide();
|
|
343
|
-
}
|
|
344
|
-
this.isVisible = false;
|
|
345
|
-
}
|
|
346
|
-
destroy() {
|
|
347
|
-
this.hide();
|
|
348
|
-
this.element.removeEventListener('mousedown', this.mousedownHandler, { capture: true });
|
|
349
|
-
this.view.dom.removeEventListener('dragstart', this.dragstartHandler);
|
|
350
|
-
window.removeEventListener('resize', this.windowResizeHandler);
|
|
351
|
-
this.editor.off('focus', this.focusHandler);
|
|
352
|
-
this.editor.off('blur', this.blurHandler);
|
|
353
|
-
// Cleanup ResizeObserver
|
|
354
|
-
if (this.resizeObserver) {
|
|
355
|
-
this.resizeObserver.disconnect();
|
|
356
|
-
this.resizeObserver = undefined;
|
|
357
|
-
}
|
|
358
|
-
if (this.floatingUIOptions.onDestroy) {
|
|
359
|
-
this.floatingUIOptions.onDestroy();
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
export const BubbleMenuPlugin = (options) => new Plugin({
|
|
364
|
-
key: typeof options.pluginKey === 'string' ? new PluginKey(options.pluginKey) : options.pluginKey,
|
|
365
|
-
view: view => new BubbleMenuView({ view, ...options }),
|
|
366
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import type { BubbleMenuPluginProps } from './bubble-menu-plugin';
|
|
3
|
-
export type BubbleMenuOptions = Omit<BubbleMenuPluginProps, 'editor' | 'element'> & {
|
|
4
|
-
/**
|
|
5
|
-
* The DOM element that contains your menu.
|
|
6
|
-
* @type {HTMLElement}
|
|
7
|
-
* @default null
|
|
8
|
-
*/
|
|
9
|
-
element: HTMLElement | null;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* This extension allows you to create a bubble menu.
|
|
13
|
-
* @see https://tiptap.dev/api/extensions/bubble-menu
|
|
14
|
-
*/
|
|
15
|
-
export declare const BubbleMenu: Extension<BubbleMenuOptions, any>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import { BubbleMenuPlugin } from './bubble-menu-plugin';
|
|
3
|
-
/**
|
|
4
|
-
* This extension allows you to create a bubble menu.
|
|
5
|
-
* @see https://tiptap.dev/api/extensions/bubble-menu
|
|
6
|
-
*/
|
|
7
|
-
export const BubbleMenu = Extension.create({
|
|
8
|
-
name: 'bubbleMenu',
|
|
9
|
-
addOptions() {
|
|
10
|
-
return {
|
|
11
|
-
element: null,
|
|
12
|
-
pluginKey: 'bubbleMenu',
|
|
13
|
-
updateDelay: undefined,
|
|
14
|
-
shouldShow: null,
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
addProseMirrorPlugins() {
|
|
18
|
-
if (!this.options.element) {
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
return [
|
|
22
|
-
BubbleMenuPlugin({
|
|
23
|
-
pluginKey: this.options.pluginKey,
|
|
24
|
-
editor: this.editor,
|
|
25
|
-
element: this.options.element,
|
|
26
|
-
updateDelay: this.options.updateDelay,
|
|
27
|
-
shouldShow: this.options.shouldShow,
|
|
28
|
-
}),
|
|
29
|
-
];
|
|
30
|
-
},
|
|
31
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import { TextStyle } from '../types';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
clearFormatting: {
|
|
6
|
-
/**
|
|
7
|
-
* Clear all formatting
|
|
8
|
-
*/
|
|
9
|
-
clearFormatting: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export type ClearFormattingOptions = {
|
|
14
|
-
defaultTextStyle?: TextStyle;
|
|
15
|
-
};
|
|
16
|
-
export declare const ClearFormatting: Extension<any, any>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import { DEFAULT_TEXT_STYLE } from '../constants';
|
|
3
|
-
export const ClearFormatting = Extension.create({
|
|
4
|
-
name: 'clearFormatting',
|
|
5
|
-
addOptions() {
|
|
6
|
-
return {
|
|
7
|
-
defaultTextStyle: DEFAULT_TEXT_STYLE,
|
|
8
|
-
};
|
|
9
|
-
},
|
|
10
|
-
addCommands() {
|
|
11
|
-
return {
|
|
12
|
-
clearFormatting: () => ({ chain }) => chain()
|
|
13
|
-
.unsetAllMarks()
|
|
14
|
-
.clearNodes()
|
|
15
|
-
.unsetTextAlign()
|
|
16
|
-
.unsetTextTransform()
|
|
17
|
-
.updateAttributes('textStyle', this.options.defaultTextStyle)
|
|
18
|
-
.run(),
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
addKeyboardShortcuts() {
|
|
22
|
-
return {
|
|
23
|
-
'Mod-\\': () => this.editor.commands.clearFormatting(),
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Color as TiptapColorExtension, } from '@tiptap/extension-text-style';
|
|
2
|
-
import tinycolor from 'tinycolor2';
|
|
3
|
-
export const Color = TiptapColorExtension.extend({
|
|
4
|
-
addGlobalAttributes() {
|
|
5
|
-
return [
|
|
6
|
-
{
|
|
7
|
-
types: this.options.types,
|
|
8
|
-
attributes: {
|
|
9
|
-
color: {
|
|
10
|
-
default: null,
|
|
11
|
-
parseHTML: element => element.style.color?.replace(/['"]+/g, ''),
|
|
12
|
-
renderHTML: attrs => {
|
|
13
|
-
if (!attrs.color || tinycolor.equals(attrs.color, this.options.defaultColor)) {
|
|
14
|
-
return {};
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
style: `color: ${attrs.color}`,
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
];
|
|
24
|
-
},
|
|
25
|
-
addCommands() {
|
|
26
|
-
return {
|
|
27
|
-
...this.parent?.(),
|
|
28
|
-
unsetColor: () => ({ chain }) => chain()
|
|
29
|
-
.setMark('textStyle', { color: this.options.defaultColor || null })
|
|
30
|
-
.removeEmptyTextStyle()
|
|
31
|
-
.run(),
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
import { DOMOutputSpec, Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
-
import { SuggestionOptions } from '@tiptap/suggestion';
|
|
4
|
-
export declare const LIST_EMOJI: ({
|
|
5
|
-
emoji: string;
|
|
6
|
-
skin_tone_support: boolean;
|
|
7
|
-
name: string;
|
|
8
|
-
slug: string;
|
|
9
|
-
unicode_version: string;
|
|
10
|
-
emoji_version: string;
|
|
11
|
-
skin_tone_support_unicode_version?: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
emoji: string;
|
|
14
|
-
skin_tone_support: boolean;
|
|
15
|
-
skin_tone_support_unicode_version: string;
|
|
16
|
-
name: string;
|
|
17
|
-
slug: string;
|
|
18
|
-
unicode_version: string;
|
|
19
|
-
emoji_version: string;
|
|
20
|
-
})[];
|
|
21
|
-
declare module '@tiptap/core' {
|
|
22
|
-
interface Commands<ReturnType> {
|
|
23
|
-
emoji: {
|
|
24
|
-
insertEmoji: (emojiName: string) => ReturnType;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export interface SuggestionItem {
|
|
29
|
-
emoji: string;
|
|
30
|
-
skin_tone_support: boolean;
|
|
31
|
-
name: string;
|
|
32
|
-
slug: string;
|
|
33
|
-
unicode_version: string;
|
|
34
|
-
emoji_version: string;
|
|
35
|
-
}
|
|
36
|
-
export interface EmojiNodeAttrs {
|
|
37
|
-
name?: string | null;
|
|
38
|
-
}
|
|
39
|
-
export type EmojiOptions<Attrs extends Record<string, any> = EmojiNodeAttrs> = {
|
|
40
|
-
HTMLAttributes: Record<string, any>;
|
|
41
|
-
renderLabel?: (props: {
|
|
42
|
-
options: EmojiOptions<Attrs>;
|
|
43
|
-
node: ProseMirrorNode;
|
|
44
|
-
}) => string;
|
|
45
|
-
renderText: (props: {
|
|
46
|
-
options: EmojiOptions<Attrs>;
|
|
47
|
-
node: ProseMirrorNode;
|
|
48
|
-
}) => string;
|
|
49
|
-
renderHTML: (props: {
|
|
50
|
-
options: EmojiOptions<Attrs>;
|
|
51
|
-
node: ProseMirrorNode;
|
|
52
|
-
}) => DOMOutputSpec;
|
|
53
|
-
deleteTriggerWithBackspace: boolean;
|
|
54
|
-
suggestion: Omit<SuggestionOptions<SuggestionItem, Attrs>, 'editor'>;
|
|
55
|
-
};
|
|
56
|
-
export declare const EXTENSION_NAME = "emoji";
|
|
57
|
-
export declare const Emoji: Node<EmojiOptions<EmojiNodeAttrs>, any>;
|