@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,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextEditorButtonProps } from '../Button';
|
|
3
|
-
type DropdownButtonProps = {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
value?: string;
|
|
6
|
-
options?: {
|
|
7
|
-
value: string;
|
|
8
|
-
label: React.ReactNode;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
}[];
|
|
11
|
-
tooltipProps?: TextEditorButtonProps['tooltipProps'];
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
onClickOption?: (key: string) => void;
|
|
15
|
-
};
|
|
16
|
-
export declare const DropdownButton: (props: DropdownButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Dropdown } from 'antd';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { TextEditorButton } from '../Button';
|
|
5
|
-
import { ArrowDropDownIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import clsx from 'clsx';
|
|
8
|
-
const StyledTriggerButton = styled(TextEditorButton) `
|
|
9
|
-
&.antsomi-dropdown-trigger.antsomi-btn {
|
|
10
|
-
gap: 0;
|
|
11
|
-
padding: 0;
|
|
12
|
-
width: 40px;
|
|
13
|
-
height: 36px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&.is-open {
|
|
17
|
-
svg.icon-dropdown {
|
|
18
|
-
transform: rotate(180deg);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
export const DropdownButton = (props) => {
|
|
23
|
-
const { className, children, disabled, tooltipProps, options = [], value, onClickOption } = props;
|
|
24
|
-
const selectedOpt = value ? options.filter(opt => opt.value === value) : [];
|
|
25
|
-
const isSelected = selectedOpt.length > 0;
|
|
26
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
27
|
-
const handleOpenChange = (visible) => {
|
|
28
|
-
if (disabled)
|
|
29
|
-
return;
|
|
30
|
-
setIsOpen(visible);
|
|
31
|
-
};
|
|
32
|
-
return (_jsx(Dropdown, { trigger: ['click'], className: clsx(className, {
|
|
33
|
-
'is-active': isSelected,
|
|
34
|
-
'is-open': isOpen,
|
|
35
|
-
}), disabled: disabled, placement: "bottomLeft", menu: {
|
|
36
|
-
style: {
|
|
37
|
-
maxHeight: 240,
|
|
38
|
-
overflow: 'auto',
|
|
39
|
-
},
|
|
40
|
-
items: options.map(opt => ({
|
|
41
|
-
key: opt.value,
|
|
42
|
-
label: opt.label,
|
|
43
|
-
disabled: opt.disabled,
|
|
44
|
-
})),
|
|
45
|
-
selectedKeys: selectedOpt.map(opt => opt.value),
|
|
46
|
-
onClick: e => {
|
|
47
|
-
const { key } = e;
|
|
48
|
-
onClickOption?.(key);
|
|
49
|
-
},
|
|
50
|
-
}, open: isOpen, onOpenChange: handleOpenChange, children: _jsxs(StyledTriggerButton, { tooltipProps: tooltipProps, isActive: isSelected, disabled: disabled, children: [children, _jsx(ArrowDropDownIcon, { className: "icon-dropdown", size: 16 })] }) }));
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DropdownButton } from './DropdownButton';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DropdownButton } from './DropdownButton';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { EmojiNodeAttrs, SuggestionItem } from '../../extensions/Emoji';
|
|
3
|
-
import { SuggestionProps } from '@tiptap/suggestion';
|
|
4
|
-
export declare const ITEM_SIZE = 28;
|
|
5
|
-
export type EmojiListRef = {
|
|
6
|
-
onKeyDown: (args: {
|
|
7
|
-
event: KeyboardEvent;
|
|
8
|
-
}) => boolean;
|
|
9
|
-
};
|
|
10
|
-
export type EmojiListProps = SuggestionProps<SuggestionItem, EmojiNodeAttrs>;
|
|
11
|
-
export declare const EmojiList: import("react").ForwardRefExoticComponent<EmojiListProps & import("react").RefAttributes<EmojiListRef>>;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Typography } from 'antd';
|
|
3
|
-
import { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
|
4
|
-
import { COMPONENT_CLS } from '../../constants';
|
|
5
|
-
import { VirtualizedMenu } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
export const ITEM_SIZE = 28;
|
|
8
|
-
export const EmojiList = forwardRef((props, ref) => {
|
|
9
|
-
const { items = [] } = props;
|
|
10
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
11
|
-
const selectItem = (index) => {
|
|
12
|
-
const item = items[index];
|
|
13
|
-
if (item) {
|
|
14
|
-
props.command({ name: item.name });
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
const upHandler = () => {
|
|
18
|
-
setSelectedIndex((selectedIndex + props.items.length - 1) % props.items.length);
|
|
19
|
-
};
|
|
20
|
-
const downHandler = () => {
|
|
21
|
-
setSelectedIndex((selectedIndex + 1) % props.items.length);
|
|
22
|
-
};
|
|
23
|
-
const enterHandler = () => {
|
|
24
|
-
selectItem(selectedIndex);
|
|
25
|
-
};
|
|
26
|
-
useEffect(() => setSelectedIndex(0), [props.items]);
|
|
27
|
-
useImperativeHandle(ref, () => ({
|
|
28
|
-
onKeyDown: ({ event }) => {
|
|
29
|
-
if (event.key === 'ArrowUp') {
|
|
30
|
-
upHandler();
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
if (event.key === 'ArrowDown') {
|
|
34
|
-
downHandler();
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
if (event.key === 'Enter') {
|
|
38
|
-
enterHandler();
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
},
|
|
43
|
-
}));
|
|
44
|
-
if (items.length <= 0) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
return (_jsx(VirtualizedMenu, { className: `${COMPONENT_CLS}-emoji-list`, itemSize: ITEM_SIZE, selected: items.at(selectedIndex) ? [items[selectedIndex].slug] : [], onClick: item => {
|
|
48
|
-
const idx = items.findIndex(i => i.slug === item.item.key);
|
|
49
|
-
if (idx !== -1) {
|
|
50
|
-
selectItem(idx);
|
|
51
|
-
}
|
|
52
|
-
}, items: items.map(i => ({
|
|
53
|
-
key: i.slug,
|
|
54
|
-
className: clsx(`${COMPONENT_CLS}-emoji-item`),
|
|
55
|
-
label: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
|
|
56
|
-
lineHeight: 1,
|
|
57
|
-
fontSize: ITEM_SIZE - 8,
|
|
58
|
-
}, children: i.emoji }), _jsxs(Typography.Text, { ellipsis: {
|
|
59
|
-
tooltip: {
|
|
60
|
-
title: i.slug,
|
|
61
|
-
mouseEnterDelay: 0.3,
|
|
62
|
-
placement: 'right',
|
|
63
|
-
},
|
|
64
|
-
}, children: [":", i.slug] }, i.slug)] })),
|
|
65
|
-
})) }));
|
|
66
|
-
});
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { posToDOMRect, ReactRenderer } from '@tiptap/react';
|
|
2
|
-
import { LIST_EMOJI } from '../../extensions/Emoji';
|
|
3
|
-
import { EmojiList, ITEM_SIZE } from './EmojiList';
|
|
4
|
-
import { computePosition, flip, shift } from '@floating-ui/dom';
|
|
5
|
-
import { COMPONENT_CLS } from '../../constants';
|
|
6
|
-
import { calInlineListSize } from '@antscorp/antsomi-ui/es/components/molecules/VirtualizedMenu/utils';
|
|
7
|
-
import { searchStringQuery } from '@antscorp/antsomi-ui/es/utils';
|
|
8
|
-
const updatePosition = (editor, element, itemLength) => {
|
|
9
|
-
const virtualElement = {
|
|
10
|
-
getBoundingClientRect: () => posToDOMRect(editor.view, editor.state.selection.from, editor.state.selection.to),
|
|
11
|
-
};
|
|
12
|
-
computePosition(virtualElement, element, {
|
|
13
|
-
placement: 'top-start',
|
|
14
|
-
strategy: 'absolute',
|
|
15
|
-
middleware: [shift(), flip()],
|
|
16
|
-
}).then(({ x, y, strategy }) => {
|
|
17
|
-
element.style.height = `${calInlineListSize(Math.min(itemLength, 6), ITEM_SIZE)}px`;
|
|
18
|
-
element.style.position = strategy;
|
|
19
|
-
element.style.left = `${x}px`;
|
|
20
|
-
element.style.top = `${y}px`;
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
export const suggestion = ({ container }) => ({
|
|
24
|
-
items: ({ query }) => LIST_EMOJI.filter(i => searchStringQuery(i.slug, query)),
|
|
25
|
-
render() {
|
|
26
|
-
let renderer;
|
|
27
|
-
const safeGetRenndererEl = () => {
|
|
28
|
-
if (renderer.element instanceof HTMLElement) {
|
|
29
|
-
return renderer.element;
|
|
30
|
-
}
|
|
31
|
-
throw Error('ReactRenderer element should be HTMLElement');
|
|
32
|
-
};
|
|
33
|
-
const destroy = () => {
|
|
34
|
-
renderer.destroy();
|
|
35
|
-
safeGetRenndererEl().remove();
|
|
36
|
-
};
|
|
37
|
-
return {
|
|
38
|
-
onStart: props => {
|
|
39
|
-
renderer = new ReactRenderer(EmojiList, {
|
|
40
|
-
props,
|
|
41
|
-
editor: props.editor,
|
|
42
|
-
});
|
|
43
|
-
if (!props.clientRect) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const rendererEl = safeGetRenndererEl();
|
|
47
|
-
rendererEl.classList.add(`${COMPONENT_CLS}-emoji-popover`);
|
|
48
|
-
(container || document.body).appendChild(rendererEl);
|
|
49
|
-
updatePosition(props.editor, rendererEl, props.items.length);
|
|
50
|
-
},
|
|
51
|
-
onUpdate(props) {
|
|
52
|
-
renderer.updateProps(props);
|
|
53
|
-
const rendererEl = safeGetRenndererEl();
|
|
54
|
-
if (!props.clientRect) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
updatePosition(props.editor, rendererEl, props.items.length);
|
|
58
|
-
},
|
|
59
|
-
onKeyDown(props) {
|
|
60
|
-
if (props.event.key === 'Escape') {
|
|
61
|
-
destroy();
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
return renderer.ref?.onKeyDown(props) || false;
|
|
65
|
-
},
|
|
66
|
-
onExit() {
|
|
67
|
-
destroy();
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FontConfig } from '../../types';
|
|
3
|
-
type FontPopoverProps = {
|
|
4
|
-
fonts?: FontConfig[];
|
|
5
|
-
value?: {
|
|
6
|
-
font: FontConfig;
|
|
7
|
-
weight: number;
|
|
8
|
-
};
|
|
9
|
-
onChange?: (font: FontConfig, weight: number) => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const FontPopover: import("react").MemoExoticComponent<(props: FontPopoverProps) => import("react/jsx-runtime").JSX.Element>;
|
|
12
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex, Typography } from 'antd';
|
|
3
|
-
import { SearchPopover, VirtualizedMenu } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
4
|
-
import { DEFAULT_FONT_CONFIGS, FONT_WEIGHT_MAP } from '../../constants';
|
|
5
|
-
import { memo, useMemo, useState } from 'react';
|
|
6
|
-
import { PopoverTrigger } from './styled';
|
|
7
|
-
import { calInlineListSize } from '@antscorp/antsomi-ui/es/components/molecules/VirtualizedMenu/utils';
|
|
8
|
-
import { useTextEditorStore } from '../../provider';
|
|
9
|
-
import clsx from 'clsx';
|
|
10
|
-
import { TextEditorPopover } from '../Popover';
|
|
11
|
-
import { ChevronRightIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
12
|
-
const FontItem = (props) => {
|
|
13
|
-
const { fontConfig, active, onSelectFont, onOpenChange } = props;
|
|
14
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
15
|
-
const numOfWeight = fontConfig.fontWeight.length;
|
|
16
|
-
const isActive = active.font.fontFamily.name === fontConfig.fontFamily.name;
|
|
17
|
-
const fontNameContent = (_jsxs(Flex, { className: clsx('font-popover-item', { active: isOpen || isActive }), style: { fontFamily: fontConfig.fontFamily.name }, onClick: () => onSelectFont?.(400), align: "center", justify: "space-between", children: [fontConfig.fontFamily.name, numOfWeight > 1 && _jsx(ChevronRightIcon, { size: 14 })] }));
|
|
18
|
-
const handleOpenChange = (newOpen) => {
|
|
19
|
-
setIsOpen(newOpen);
|
|
20
|
-
onOpenChange?.(newOpen);
|
|
21
|
-
};
|
|
22
|
-
if (numOfWeight < 2) {
|
|
23
|
-
return fontNameContent;
|
|
24
|
-
}
|
|
25
|
-
return (_jsx(TextEditorPopover, { open: isOpen, onOpenChange: handleOpenChange, placement: "rightTop", trigger: ['hover'], arrow: false, overlayClassName: "font-weight-popover", destroyTooltipOnHide: true, content: _jsx(Flex, { vertical: true, gap: 4, children: fontConfig.fontWeight.map(weight => (_jsx(Typography.Text, { className: clsx('font-weight-item', {
|
|
26
|
-
active: active.weight === weight,
|
|
27
|
-
}), style: {
|
|
28
|
-
fontFamily: fontConfig.fontFamily.name,
|
|
29
|
-
fontWeight: weight,
|
|
30
|
-
}, onClick: () => onSelectFont?.(weight), children: FONT_WEIGHT_MAP[weight] }, weight))) }), children: fontNameContent }));
|
|
31
|
-
};
|
|
32
|
-
export const FontPopover = memo((props) => {
|
|
33
|
-
const { fonts = [], value: fontValue = {
|
|
34
|
-
font: DEFAULT_FONT_CONFIGS[0],
|
|
35
|
-
weight: 400,
|
|
36
|
-
}, onChange, } = props;
|
|
37
|
-
const [search, setSearch] = useState('');
|
|
38
|
-
const [open, setOpen] = useState(false);
|
|
39
|
-
const bubbleMenuContainer = useTextEditorStore(state => state.bubbleMenuContainer);
|
|
40
|
-
const filteredFonts = useMemo(() => fonts
|
|
41
|
-
.filter(font => font.fontFamily.name.toLowerCase().includes(search.toLowerCase()))
|
|
42
|
-
.sort((a, b) => a.fontFamily.name.localeCompare(b.fontFamily.name)), [fonts, search]);
|
|
43
|
-
const handleClose = () => {
|
|
44
|
-
setOpen(false);
|
|
45
|
-
setSearch('');
|
|
46
|
-
};
|
|
47
|
-
const handleOpenChange = (newOpen) => {
|
|
48
|
-
setOpen(newOpen);
|
|
49
|
-
if (newOpen === false) {
|
|
50
|
-
handleClose();
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const handleChangeFont = (font, weight = 400) => {
|
|
54
|
-
onChange?.(font, weight);
|
|
55
|
-
handleClose();
|
|
56
|
-
};
|
|
57
|
-
const itemSize = 30;
|
|
58
|
-
const itemSpacing = 4;
|
|
59
|
-
const activeFontName = fontValue.font.fontFamily.name;
|
|
60
|
-
return (_jsx(SearchPopover, { open: open, placement: "bottomLeft", onOpenChange: handleOpenChange, getPopupContainer: () => bubbleMenuContainer || document.body, inputSearchProps: {
|
|
61
|
-
value: search,
|
|
62
|
-
onAfterChange: setSearch,
|
|
63
|
-
}, overlayClassName: "font-popover-overlay", content: _jsx("div", { className: "list-font-root", style: {
|
|
64
|
-
height: calInlineListSize(Math.min(filteredFonts.length, 6), itemSize, itemSpacing),
|
|
65
|
-
}, children: _jsx(VirtualizedMenu, { itemSize: itemSize, inlinePadding: 0, itemSpacing: itemSpacing, items: filteredFonts.map(fontConfig => ({
|
|
66
|
-
key: fontConfig.fontFamily.name,
|
|
67
|
-
label: (_jsx(FontItem, { fontConfig: fontConfig, active: { font: fontValue.font, weight: fontValue.weight }, onSelectFont: weight => handleChangeFont(fontConfig, weight) })),
|
|
68
|
-
})) }) }), children: _jsx(PopoverTrigger, { className: "font-popover-trigger", children: _jsx(Typography.Text, { ellipsis: { tooltip: true }, children: activeFontName }) }) }));
|
|
69
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PopoverTrigger: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
export const PopoverTrigger = styled.div `
|
|
4
|
-
&.font-popover-trigger {
|
|
5
|
-
width: 90px;
|
|
6
|
-
height: 30px;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
padding: 0 7px;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
text-overflow: ellipsis;
|
|
14
|
-
font-size: ${THEME.token?.fontSize || 12}px;
|
|
15
|
-
border-bottom: 1px solid ${THEME.token?.blue1};
|
|
16
|
-
flex-shrink: 0;
|
|
17
|
-
|
|
18
|
-
&:hover {
|
|
19
|
-
background-color: ${THEME.token?.blue};
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { type PopoverProps } from 'antd';
|
|
3
|
-
export interface TextEditorPopoverProps extends PopoverProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export declare const TextEditorPopover: ({ children, ...restProps }: TextEditorPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Popover } from 'antd';
|
|
3
|
-
import { useTextEditorStore } from '../../provider';
|
|
4
|
-
import { useCallback } from 'react';
|
|
5
|
-
export const TextEditorPopover = ({ children, ...restProps }) => {
|
|
6
|
-
const bubbleMenuContainer = useTextEditorStore(state => state.bubbleMenuContainer);
|
|
7
|
-
const getPopupContainer = useCallback(() => bubbleMenuContainer || document.body, [bubbleMenuContainer]);
|
|
8
|
-
return (_jsx(Popover, { trigger: ['click'], ...restProps, getPopupContainer: getPopupContainer, children: children }));
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Popover';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Popover';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Select } from 'antd';
|
|
3
|
-
import { useTextEditorStore } from '../../provider';
|
|
4
|
-
export const TextEditorSelect = (props) => {
|
|
5
|
-
const bubbleMenuContainer = useTextEditorStore(state => state.bubbleMenuContainer);
|
|
6
|
-
return _jsx(Select, { ...props, getPopupContainer: () => bubbleMenuContainer || document.body });
|
|
7
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Select';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Select';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ArrowDropDownIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
3
|
-
import { StyledDropdownButton } from './styled';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
import { Tooltip } from 'antd';
|
|
7
|
-
export const SplitButtonDropdown = (props) => {
|
|
8
|
-
const { children, disabled, value, className = '', tooltipProps, options = [], onClickOption, onClick, } = props;
|
|
9
|
-
const selectedOpt = value ? options.filter(opt => opt.value === value) : [];
|
|
10
|
-
const isSelected = selectedOpt.length > 0;
|
|
11
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
12
|
-
const handleOpenChange = (visible) => {
|
|
13
|
-
if (disabled)
|
|
14
|
-
return;
|
|
15
|
-
setIsOpen(visible);
|
|
16
|
-
};
|
|
17
|
-
return (_jsx(StyledDropdownButton, { disabled: disabled, trigger: ['click'], className: clsx(className, {
|
|
18
|
-
'is-active': isSelected,
|
|
19
|
-
'is-open': isOpen,
|
|
20
|
-
}), open: isOpen, onOpenChange: handleOpenChange, placement: "bottomLeft", menu: {
|
|
21
|
-
style: {
|
|
22
|
-
maxHeight: 240,
|
|
23
|
-
overflow: 'auto',
|
|
24
|
-
},
|
|
25
|
-
items: options.map(opt => ({
|
|
26
|
-
key: opt.value,
|
|
27
|
-
label: opt.label,
|
|
28
|
-
disabled: opt.disabled,
|
|
29
|
-
})),
|
|
30
|
-
selectedKeys: selectedOpt.map(opt => opt.value),
|
|
31
|
-
onClick: e => {
|
|
32
|
-
const { key } = e;
|
|
33
|
-
onClickOption?.(key);
|
|
34
|
-
},
|
|
35
|
-
}, onClick: e => {
|
|
36
|
-
onClick?.(e, isSelected);
|
|
37
|
-
}, icon: _jsx(ArrowDropDownIcon, { size: 16 }), type: "text", buttonsRender: buttons => {
|
|
38
|
-
const [fistButton, ...restButton] = buttons;
|
|
39
|
-
return [
|
|
40
|
-
_jsx(Tooltip, { placement: "top", mouseEnterDelay: 0.4, ...tooltipProps, open: disabled ? false : undefined, children: fistButton }),
|
|
41
|
-
...restButton,
|
|
42
|
-
];
|
|
43
|
-
}, children: children }));
|
|
44
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SplitButtonDropdown } from './SplitButtonDropdown';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SplitButtonDropdown } from './SplitButtonDropdown';
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Dropdown } from 'antd';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
export const StyledDropdownButton = styled(Dropdown.Button) `
|
|
4
|
-
&.antsomi-dropdown-button {
|
|
5
|
-
width: fit-content;
|
|
6
|
-
|
|
7
|
-
.antsomi-btn {
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.antsomi-btn-compact-item:not(.antsomi-btn-compact-last-item).antsomi-btn-compact-first-item {
|
|
12
|
-
width: 36px;
|
|
13
|
-
height: 36px;
|
|
14
|
-
border-start-end-radius: 0;
|
|
15
|
-
border-end-end-radius: 0;
|
|
16
|
-
|
|
17
|
-
&:hover:not(:disabled, .is-active) {
|
|
18
|
-
background-color: #ebebeb;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.antsomi-btn-compact-item:not(.antsomi-btn-compact-first-item).antsomi-btn-compact-last-item {
|
|
23
|
-
width: 16px;
|
|
24
|
-
height: 36px;
|
|
25
|
-
border-start-start-radius: 0;
|
|
26
|
-
border-end-start-radius: 0;
|
|
27
|
-
|
|
28
|
-
&:hover:not(:disabled),
|
|
29
|
-
&.antsomi-dropdown-open:not(:disabled) {
|
|
30
|
-
background-color: #ebebeb;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.is-active {
|
|
35
|
-
.antsomi-btn-compact-item:not(.antsomi-btn-compact-last-item).antsomi-btn-compact-first-item {
|
|
36
|
-
:not(:disabled) {
|
|
37
|
-
background-color: #e0ebf7;
|
|
38
|
-
|
|
39
|
-
&:hover {
|
|
40
|
-
background-color: #e0ebf7;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&.is-open {
|
|
47
|
-
.antsomi-btn-icon svg {
|
|
48
|
-
transform: rotate(180deg);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export type SplitButtonDropdownProps = {
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
style?: React.CSSProperties;
|
|
5
|
-
value?: string;
|
|
6
|
-
options?: {
|
|
7
|
-
value: string;
|
|
8
|
-
label: React.ReactNode;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
}[];
|
|
11
|
-
className?: string;
|
|
12
|
-
icon?: React.ReactNode;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
onClickOption?: (key: string) => void;
|
|
15
|
-
onClick?: (e: React.MouseEvent<HTMLElement>, isSelected: boolean) => void;
|
|
16
|
-
tooltipProps?: {
|
|
17
|
-
title?: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Editor } from '@tiptap/core';
|
|
3
|
-
declare const textAlignOptions: readonly [{
|
|
4
|
-
readonly label: string;
|
|
5
|
-
readonly value: string;
|
|
6
|
-
readonly shortcut: string;
|
|
7
|
-
readonly icon: import("react").ForwardRefExoticComponent<import("../../../../icons/types").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
8
|
-
}, {
|
|
9
|
-
readonly label: string;
|
|
10
|
-
readonly value: string;
|
|
11
|
-
readonly shortcut: string;
|
|
12
|
-
readonly icon: import("react").ForwardRefExoticComponent<import("../../../../icons/types").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
13
|
-
}, {
|
|
14
|
-
readonly label: string;
|
|
15
|
-
readonly value: string;
|
|
16
|
-
readonly shortcut: string;
|
|
17
|
-
readonly icon: import("react").ForwardRefExoticComponent<import("../../../../icons/types").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
18
|
-
}, {
|
|
19
|
-
readonly label: string;
|
|
20
|
-
readonly value: string;
|
|
21
|
-
readonly shortcut: string;
|
|
22
|
-
readonly icon: import("react").ForwardRefExoticComponent<import("../../../../icons/types").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
23
|
-
}];
|
|
24
|
-
type AlignType = (typeof textAlignOptions)[number]['value'];
|
|
25
|
-
interface TextAlignSelectProps {
|
|
26
|
-
editor?: Editor;
|
|
27
|
-
onChange?: (value: AlignType) => void;
|
|
28
|
-
}
|
|
29
|
-
export declare const TextAlignSelect: (props: TextAlignSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
export {};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { formatHotkey } from '@antscorp/antsomi-ui/es/utils';
|
|
3
|
-
import { Flex } from 'antd';
|
|
4
|
-
import { useMemo, useState } from 'react';
|
|
5
|
-
import { TEXT_EDITOR_CONSTANTS } from '../../constants';
|
|
6
|
-
import { TextEditorPopover } from '../Popover';
|
|
7
|
-
import { TextEditorButton } from '../Button';
|
|
8
|
-
import { ALignRightIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, ArrowDropDownIcon, } from '@antscorp/antsomi-ui/es/components/icons';
|
|
9
|
-
import styled from 'styled-components';
|
|
10
|
-
import { useEditorState } from '@tiptap/react';
|
|
11
|
-
const { TEXT_ALIGN } = TEXT_EDITOR_CONSTANTS;
|
|
12
|
-
const textAlignOptions = [
|
|
13
|
-
{
|
|
14
|
-
label: TEXT_ALIGN.OPTIONS.LEFT.LABEL,
|
|
15
|
-
value: TEXT_ALIGN.OPTIONS.LEFT.VALUE,
|
|
16
|
-
shortcut: formatHotkey('Shift+L'),
|
|
17
|
-
icon: AlignLeftIcon,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
label: TEXT_ALIGN.OPTIONS.CENTER.LABEL,
|
|
21
|
-
value: TEXT_ALIGN.OPTIONS.CENTER.VALUE,
|
|
22
|
-
shortcut: formatHotkey('Shift+E'),
|
|
23
|
-
icon: AlignCenterIcon,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
label: TEXT_ALIGN.OPTIONS.RIGHT.LABEL,
|
|
27
|
-
value: TEXT_ALIGN.OPTIONS.RIGHT.VALUE,
|
|
28
|
-
shortcut: formatHotkey('Shift+R'),
|
|
29
|
-
icon: ALignRightIcon,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: TEXT_ALIGN.OPTIONS.JUSTIFY.LABEL,
|
|
33
|
-
value: TEXT_ALIGN.OPTIONS.JUSTIFY.VALUE,
|
|
34
|
-
shortcut: formatHotkey('Shift+J'),
|
|
35
|
-
icon: AlignJustifyIcon,
|
|
36
|
-
},
|
|
37
|
-
];
|
|
38
|
-
const StyledTriggerButton = styled(TextEditorButton) `
|
|
39
|
-
&.antsomi-btn.antsomi-btn-text {
|
|
40
|
-
width: 40px;
|
|
41
|
-
gap: 0;
|
|
42
|
-
|
|
43
|
-
&.is-active {
|
|
44
|
-
background-color: unset;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
export const TextAlignSelect = (props) => {
|
|
49
|
-
const { editor, onChange } = props;
|
|
50
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
51
|
-
const { currentAlignment } = useEditorState({
|
|
52
|
-
editor: editor,
|
|
53
|
-
selector: ({ editor: editorInstance }) => {
|
|
54
|
-
const alignment = ['left', 'center', 'right', 'justify'].find(alignment => editorInstance?.isActive({ textAlign: alignment }));
|
|
55
|
-
return {
|
|
56
|
-
currentAlignment: alignment || 'left',
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
const selectedOption = useMemo(() => textAlignOptions.find(option => option.value === currentAlignment), [currentAlignment]);
|
|
61
|
-
const handleClickOption = (align) => {
|
|
62
|
-
setIsOpen(false);
|
|
63
|
-
onChange?.(align);
|
|
64
|
-
};
|
|
65
|
-
let AlignIconComponent = textAlignOptions[0].icon;
|
|
66
|
-
if (selectedOption) {
|
|
67
|
-
AlignIconComponent = selectedOption.icon;
|
|
68
|
-
}
|
|
69
|
-
return (_jsx(TextEditorPopover, { destroyTooltipOnHide: true, open: isOpen, arrow: false, overlayInnerStyle: { padding: 8 }, content: _jsx(Flex, { gap: 8, children: textAlignOptions.map(option => (_jsx(TextEditorButton, { icon: _jsx(option.icon, { size: 16 }, option.value), onClick: () => handleClickOption(option.value), isActive: currentAlignment === option.value, tooltipProps: {
|
|
70
|
-
title: `${TEXT_ALIGN.TOOLTIP} ${option.label.toLowerCase()} (${option.shortcut})`,
|
|
71
|
-
} }, option.value))) }), trigger: ['click'], placement: "bottomLeft", onOpenChange: setOpen => setIsOpen(setOpen), children: _jsx(StyledTriggerButton, { icon: _jsx(AlignIconComponent, { size: 18 }), isActive: !!currentAlignment, tooltipProps: { title: TEXT_ALIGN.TITLE }, children: _jsx(ArrowDropDownIcon, { style: {
|
|
72
|
-
flexShrink: 0,
|
|
73
|
-
...(isOpen && {
|
|
74
|
-
transform: 'rotate(180deg)',
|
|
75
|
-
}),
|
|
76
|
-
}, size: 16 }) }) }));
|
|
77
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TextAlignSelect } from './TextAlignSelect';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TextAlignSelect } from './TextAlignSelect';
|