@antscorp/antsomi-ui 2.0.89 → 2.0.91-text-editor-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/assets/css/main.scss +4 -2
- package/es/components/icons/ALignRightIcon.d.ts +3 -0
- package/es/components/icons/ALignRightIcon.js +7 -0
- package/es/components/icons/AlignCenterIcon.d.ts +3 -0
- package/es/components/icons/AlignCenterIcon.js +7 -0
- package/es/components/icons/AlignJustifyIcon.d.ts +3 -0
- package/es/components/icons/AlignJustifyIcon.js +7 -0
- package/es/components/icons/AlignLeftIcon.d.ts +3 -0
- package/es/components/icons/AlignLeftIcon.js +7 -0
- package/es/components/icons/AntsomiAIIcon.d.ts +3 -0
- package/es/components/icons/AntsomiAIIcon.js +7 -0
- package/es/components/icons/ArrowDropDownIcon.d.ts +3 -0
- package/es/components/icons/ArrowDropDownIcon.js +7 -0
- package/es/components/icons/ChevronRightIcon.d.ts +3 -0
- package/es/components/icons/ChevronRightIcon.js +7 -0
- package/es/components/icons/EmotionFeedbackIcon.d.ts +6 -0
- package/es/components/icons/EmotionFeedbackIcon.js +8 -0
- package/es/components/icons/FeedbackRatingIcon.d.ts +3 -0
- package/es/components/icons/FeedbackRatingIcon.js +7 -0
- package/es/components/icons/LazyIcon/LazyIcon.d.ts +17 -0
- package/es/components/icons/LazyIcon/LazyIcon.js +14 -0
- package/es/components/icons/LinkOffIcon.d.ts +3 -0
- package/es/components/icons/LinkOffIcon.js +7 -0
- package/es/components/icons/MinusIcon.d.ts +3 -0
- package/es/components/icons/MinusIcon.js +7 -0
- package/es/components/icons/NoteNewIcon.d.ts +3 -0
- package/es/components/icons/NoteNewIcon.js +7 -0
- package/es/components/icons/SearchNotFoundIcon.d.ts +3 -0
- package/es/components/icons/SearchNotFoundIcon.js +7 -0
- package/es/components/icons/SummarizeIcon.d.ts +3 -0
- package/es/components/icons/SummarizeIcon.js +7 -0
- package/es/components/icons/index.d.ts +14 -0
- package/es/components/icons/index.js +14 -0
- package/es/components/index.scss +2 -0
- package/es/components/molecules/ColorSetting/index.js +2 -11
- package/es/components/molecules/ColorSetting/styled.d.ts +1 -1
- package/es/components/molecules/ColorSetting/styled.js +9 -1
- package/es/components/molecules/EmojiCollections/CommonCollection/index.js +2 -2
- package/es/components/molecules/EmojiCollections/types.d.ts +1 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +1 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.js +10 -6
- package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
- package/es/components/molecules/EmojiPopover/styled.js +1 -1
- package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +3 -0
- package/es/components/molecules/FontSizeInput/FontSizeInput.js +127 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.d.ts +8 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +14 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.d.ts +20 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.js +19 -0
- package/es/components/molecules/FontSizeInput/constants.d.ts +2 -0
- package/es/components/molecules/FontSizeInput/constants.js +5 -0
- package/es/components/molecules/FontSizeInput/index.d.ts +2 -0
- package/es/components/molecules/FontSizeInput/index.js +1 -0
- package/es/components/molecules/FontSizeInput/styled.d.ts +7 -0
- package/es/components/molecules/FontSizeInput/styled.js +36 -0
- package/es/components/molecules/FontSizeInput/styles.scss +15 -0
- package/es/components/molecules/FontSizeInput/types.d.ts +23 -0
- package/es/components/molecules/FontSizeInput/types.js +1 -0
- package/es/components/molecules/FontSizeInput/utils.d.ts +7 -0
- package/es/components/molecules/FontSizeInput/utils.js +9 -0
- package/es/components/molecules/ItemNotFound/ItemNotFound.d.ts +6 -0
- package/es/components/molecules/ItemNotFound/ItemNotFound.js +9 -0
- package/es/components/molecules/ItemNotFound/index.d.ts +1 -0
- package/es/components/molecules/ItemNotFound/index.js +1 -0
- package/es/components/molecules/ItemNotFound/styled.d.ts +4 -0
- package/es/components/molecules/ItemNotFound/styled.js +29 -0
- package/es/components/molecules/MatchAnySelect/MatchesAnySelect.js +23 -7
- package/es/components/molecules/MatchAnySelect/components/ExtendValuePopup.d.ts +1 -0
- package/es/components/molecules/MatchAnySelect/components/ExtendValuePopup.js +7 -2
- package/es/components/molecules/MatchAnySelect/types.d.ts +2 -1
- package/es/components/molecules/MatchAnySelect/utils.d.ts +1 -0
- package/es/components/molecules/MatchAnySelect/utils.js +2 -0
- package/es/components/molecules/QuillEditor/EditorToolbar.js +1 -0
- package/es/components/molecules/QuillEditor/QuillEditor.d.ts +6 -1
- package/es/components/molecules/QuillEditor/QuillEditor.js +90 -55
- package/es/components/molecules/QuillEditor/styled.d.ts +5 -0
- package/es/components/molecules/QuillEditor/styled.js +29 -0
- package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +6 -3
- package/es/components/molecules/VirtualizedMenu/__mocks__/index.js +2550 -938
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.d.ts +1 -11
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +53 -25
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +8 -5
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +289 -46
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/index.js +1 -0
- package/es/components/molecules/VirtualizedMenu/styled.d.ts +2 -2
- package/es/components/molecules/VirtualizedMenu/styled.js +23 -4
- package/es/components/molecules/VirtualizedMenu/types.d.ts +27 -10
- package/es/components/molecules/VirtualizedMenu/utils.d.ts +8 -5
- package/es/components/molecules/VirtualizedMenu/utils.js +13 -18
- package/es/components/molecules/index.d.ts +2 -0
- package/es/components/molecules/index.js +2 -0
- package/es/components/molecules/index.scss +1 -0
- package/es/components/organism/ActivityTimeline/ActivityTimeline.js +15 -9
- package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +1290 -0
- package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +3059 -0
- package/es/components/organism/ActivityTimeline/components/ItemEvent/ItemEvent.d.ts +3 -4
- package/es/components/organism/ActivityTimeline/components/ItemEvent/ItemEvent.js +4 -3
- package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/ItemGroupEvent.d.ts +4 -6
- package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/ItemGroupEvent.js +4 -4
- package/es/components/organism/ActivityTimeline/components/TimeLineTitle/TimelineTitle.js +1 -1
- package/es/components/organism/ActivityTimeline/types.d.ts +2 -1
- package/es/components/organism/ActivityTimeline/utils.d.ts +1 -1
- package/es/components/organism/ActivityTimeline/utils.js +1 -1
- package/es/components/organism/Help/Help.js +47 -10
- package/es/components/organism/TextEditor/TextEditor.d.ts +3 -0
- package/es/components/organism/TextEditor/TextEditor.js +257 -0
- package/es/components/organism/TextEditor/__mocks__/text-block.settings.json +320 -0
- package/es/components/organism/TextEditor/__mocks__/text-contennt.d.ts +1 -0
- package/es/components/organism/TextEditor/__mocks__/text-contennt.js +38 -0
- package/es/components/organism/TextEditor/constants.d.ts +175 -0
- package/es/components/organism/TextEditor/constants.js +321 -0
- package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +25 -0
- package/es/components/organism/TextEditor/extensions/BackgroundColor.js +46 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +130 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +247 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +15 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +31 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/index.d.ts +2 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/index.js +2 -0
- package/es/components/organism/TextEditor/extensions/Color.d.ts +6 -0
- package/es/components/organism/TextEditor/extensions/Color.js +34 -0
- package/es/components/organism/TextEditor/extensions/Emoji.d.ts +57 -0
- package/es/components/organism/TextEditor/extensions/Emoji.js +184 -0
- package/es/components/organism/TextEditor/extensions/FontFamily.d.ts +6 -0
- package/es/components/organism/TextEditor/extensions/FontFamily.js +36 -0
- package/es/components/organism/TextEditor/extensions/FontSize.d.ts +32 -0
- package/es/components/organism/TextEditor/extensions/FontSize.js +47 -0
- package/es/components/organism/TextEditor/extensions/FontWeight.d.ts +23 -0
- package/es/components/organism/TextEditor/extensions/FontWeight.js +41 -0
- package/es/components/organism/TextEditor/extensions/Highlight.d.ts +1 -0
- package/es/components/organism/TextEditor/extensions/Highlight.js +14 -0
- package/es/components/organism/TextEditor/extensions/Indent.d.ts +21 -0
- package/es/components/organism/TextEditor/extensions/Indent.js +63 -0
- package/es/components/organism/TextEditor/extensions/LetterSpacing.d.ts +32 -0
- package/es/components/organism/TextEditor/extensions/LetterSpacing.js +48 -0
- package/es/components/organism/TextEditor/extensions/LineHeight.d.ts +20 -0
- package/es/components/organism/TextEditor/extensions/LineHeight.js +36 -0
- package/es/components/organism/TextEditor/extensions/Link.d.ts +16 -0
- package/es/components/organism/TextEditor/extensions/Link.js +48 -0
- package/es/components/organism/TextEditor/extensions/ListItemMarker.d.ts +13 -0
- package/es/components/organism/TextEditor/extensions/ListItemMarker.js +174 -0
- package/es/components/organism/TextEditor/extensions/OrderedList.d.ts +56 -0
- package/es/components/organism/TextEditor/extensions/OrderedList.js +187 -0
- package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +39 -0
- package/es/components/organism/TextEditor/extensions/SmartTag.js +167 -0
- package/es/components/organism/TextEditor/extensions/StyleMemory.d.ts +36 -0
- package/es/components/organism/TextEditor/extensions/StyleMemory.js +163 -0
- package/es/components/organism/TextEditor/extensions/TextTransform.d.ts +31 -0
- package/es/components/organism/TextEditor/extensions/TextTransform.js +37 -0
- package/es/components/organism/TextEditor/extensions/UnorderedList.d.ts +55 -0
- package/es/components/organism/TextEditor/extensions/UnorderedList.js +176 -0
- package/es/components/organism/TextEditor/hooks/index.d.ts +7 -0
- package/es/components/organism/TextEditor/hooks/index.js +7 -0
- package/es/components/organism/TextEditor/hooks/useColorSet.d.ts +4 -0
- package/es/components/organism/TextEditor/hooks/useColorSet.js +22 -0
- package/es/components/organism/TextEditor/hooks/useDocumentState.d.ts +18 -0
- package/es/components/organism/TextEditor/hooks/useDocumentState.js +42 -0
- package/es/components/organism/TextEditor/hooks/useLinkHandler.d.ts +11 -0
- package/es/components/organism/TextEditor/hooks/useLinkHandler.js +125 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +26 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.js +68 -0
- package/es/components/organism/TextEditor/hooks/usePersistence.d.ts +31 -0
- package/es/components/organism/TextEditor/hooks/usePersistence.js +169 -0
- package/es/components/organism/TextEditor/hooks/useStyleMemory.d.ts +6 -0
- package/es/components/organism/TextEditor/hooks/useStyleMemory.js +42 -0
- package/es/components/organism/TextEditor/hooks/useStylePresets.d.ts +34 -0
- package/es/components/organism/TextEditor/hooks/useStylePresets.js +83 -0
- package/es/components/organism/TextEditor/index.d.ts +14 -0
- package/es/components/organism/TextEditor/index.js +6 -0
- package/es/components/organism/TextEditor/index.scss +61 -0
- package/es/components/organism/TextEditor/provider.d.ts +15 -0
- package/es/components/organism/TextEditor/provider.js +33 -0
- package/es/components/organism/TextEditor/store.d.ts +13 -0
- package/es/components/organism/TextEditor/store.js +20 -0
- package/es/components/organism/TextEditor/styled.d.ts +10 -0
- package/es/components/organism/TextEditor/styled.js +94 -0
- package/es/components/organism/TextEditor/types.d.ts +96 -0
- package/es/components/organism/TextEditor/types.js +3 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +85 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/index.js +1 -0
- package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.js +1 -0
- package/es/components/organism/TextEditor/ui/BubbleToolbar/index.d.ts +0 -0
- package/es/components/organism/TextEditor/ui/BubbleToolbar/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Button/Button.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Button/Button.js +31 -0
- package/es/components/organism/TextEditor/ui/Button/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Button/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Button/types.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Button/types.js +1 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.d.ts +39 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.js +131 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/index.js +1 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.d.ts +17 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.js +51 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.d.ts +11 -0
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +66 -0
- package/es/components/organism/TextEditor/ui/Emoji/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Emoji/index.js +2 -0
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +71 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.d.ts +12 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +69 -0
- package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/FontPopover/styled.js +22 -0
- package/es/components/organism/TextEditor/ui/Popover/Popover.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Popover/Popover.js +9 -0
- package/es/components/organism/TextEditor/ui/Popover/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Popover/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Select/Select.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Select/Select.js +7 -0
- package/es/components/organism/TextEditor/ui/Select/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Select/index.js +1 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.js +44 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.js +1 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.js +52 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.d.ts +19 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.js +1 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.d.ts +30 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +77 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.d.ts +15 -0
- package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.js +41 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +84 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +27 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +31 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +7 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +28 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +7 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +47 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.js +21 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.js +17 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.js +28 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.js +17 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.js +67 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.js +17 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.d.ts +7 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.js +45 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.js +26 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.js +26 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.js +3 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.js +29 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.d.ts +14 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.js +22 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.js +36 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Toolbar/index.js +1 -0
- package/es/components/organism/TextEditor/utils/documentState.d.ts +57 -0
- package/es/components/organism/TextEditor/utils/documentState.js +100 -0
- package/es/components/organism/TextEditor/utils/font.d.ts +73 -0
- package/es/components/organism/TextEditor/utils/font.js +160 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +63 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.js +319 -0
- package/es/components/organism/TextEditor/utils/indent.d.ts +11 -0
- package/es/components/organism/TextEditor/utils/indent.js +56 -0
- package/es/components/organism/TextEditor/utils/index.d.ts +8 -0
- package/es/components/organism/TextEditor/utils/index.js +16 -0
- package/es/components/organism/TextEditor/utils/link.d.ts +100 -0
- package/es/components/organism/TextEditor/utils/link.js +149 -0
- package/es/components/organism/TextEditor/utils/menu.d.ts +134 -0
- package/es/components/organism/TextEditor/utils/menu.js +317 -0
- package/es/components/organism/TextEditor/utils/selection.d.ts +25 -0
- package/es/components/organism/TextEditor/utils/selection.js +57 -0
- package/es/components/organism/TextEditor/utils/shared.d.ts +1 -0
- package/es/components/organism/TextEditor/utils/shared.js +9 -0
- package/es/components/organism/TextEditor/utils/smartTag.d.ts +49 -0
- package/es/components/organism/TextEditor/utils/smartTag.js +89 -0
- package/es/components/organism/TextEditor/utils/style.d.ts +78 -0
- package/es/components/organism/TextEditor/utils/style.js +193 -0
- package/es/components/organism/TicketEditor/Content.js +47 -33
- package/es/components/organism/TicketEditor/components/MessageComponent.js +1 -0
- package/es/components/organism/TicketEditor/index.js +24 -16
- package/es/components/organism/TicketEditor/styled.js +1 -0
- package/es/components/organism/TicketEditorV2/Content.js +41 -7
- package/es/components/organism/TicketEditorV2/components/MessageComponent.js +1 -0
- package/es/components/organism/TicketEditorV2/styled.js +2 -1
- package/es/components/organism/index.d.ts +1 -0
- package/es/components/organism/index.js +1 -0
- package/es/components/organism/index.scss +1 -0
- package/es/hooks/index.d.ts +3 -0
- package/es/hooks/index.js +3 -0
- package/es/hooks/useBroadcastedLocalStorage.d.ts +5 -0
- package/es/hooks/useBroadcastedLocalStorage.js +71 -0
- package/es/hooks/useElementSize.d.ts +7 -0
- package/es/hooks/useElementSize.js +56 -0
- package/es/hooks/useIsMounted.d.ts +1 -0
- package/es/hooks/useIsMounted.js +11 -0
- package/es/locales/en/translation.json +2 -1
- package/es/locales/i18n.d.ts +3 -1
- package/es/locales/vi/translation.json +2 -1
- package/es/utils/common.d.ts +6 -9
- package/es/utils/common.js +44 -23
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/es/utils/tree.d.ts +225 -0
- package/es/utils/tree.js +469 -0
- package/es/utils/web.d.ts +15 -0
- package/es/utils/web.js +39 -0
- package/package.json +25 -4
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// Molecules
|
|
3
3
|
import { SettingWrapper } from '../SettingWrapper';
|
|
4
|
-
import { ColorPicker, } from '@antscorp/antsomi-ui/es/components/molecules/ColorPicker';
|
|
5
4
|
// Utils
|
|
6
5
|
import { handleError } from '@antscorp/antsomi-ui/es/utils';
|
|
7
6
|
import { Button, Icon, Text } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
8
7
|
// Styled
|
|
9
|
-
import { ButtonPreset, PresetColor, PresetWrapper } from './styled';
|
|
8
|
+
import { ButtonPreset, PresetColor, PresetWrapper, StyledColorPicker } from './styled';
|
|
10
9
|
const PATH = '@antscorp/antsomi-ui/es/components/molecules/ColorSetting/index.tsx';
|
|
11
10
|
const stylingCenter = {
|
|
12
11
|
display: 'flex',
|
|
@@ -64,13 +63,5 @@ export const ColorSetting = props => {
|
|
|
64
63
|
const presetColors = customColors ? (_jsxs("div", { children: [_jsxs("div", { style: stylingCenter, children: [_jsx(Text, { children: "Color Profile" }), !isHideBtnEdit && (_jsx(Button, { type: "primary", onClick: onClickEdit, children: "Edit" }))] }), _jsxs(PresetWrapper, { children: [_jsx(ButtonPreset, { shape: "circle", onClick: onClickAddNewPresetColor, children: _jsx(Icon, { type: "icon-ants-plus-slim", style: { fontSize: 14 } }) }), customColors && customColors.length
|
|
65
64
|
? customColors.map((customColor, idx) => (_jsx(PresetColor, { color: customColor, onClick: () => onClickPresetColor(customColor), children: _jsx("div", { className: "__color", style: { backgroundColor: customColor } }) }, idx)))
|
|
66
65
|
: null] })] })) : null;
|
|
67
|
-
return (_jsx(SettingWrapper, { label: label, className: className, labelClassName: labelClassName, labelStyle: labelStyling, vertical: vertical, children: _jsx(
|
|
68
|
-
};
|
|
69
|
-
ColorSetting.defaultProps = {
|
|
70
|
-
label: '',
|
|
71
|
-
labelClassName: '',
|
|
72
|
-
// customColors: [],
|
|
73
|
-
isHideBtnEdit: true,
|
|
74
|
-
callback: () => { },
|
|
75
|
-
onChange: () => { },
|
|
66
|
+
return (_jsx(SettingWrapper, { label: label, className: className, labelClassName: labelClassName, labelStyle: labelStyling, vertical: vertical, children: _jsx(StyledColorPicker, { ...restOf, color: color, presetColors: presetColors, onChange: onChange }) }));
|
|
76
67
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const StyledColorPicker: import("styled-components").StyledComponent<import("react").FC<import("@antscorp/antsomi-ui/es/components/molecules/ColorPicker").ColorPickerProps>, any, {}, never>;
|
|
3
3
|
export declare const PresetColor: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export declare const ButtonPreset: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<import("react").LegacyRef<HTMLElement>>>, any, {}, never>;
|
|
5
5
|
export declare const PresetWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
// Libraries
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { ColorPicker } from '@antscorp/antsomi-ui/es/components/molecules/ColorPicker';
|
|
3
4
|
// Image
|
|
4
5
|
import TransparentSvg from '@antscorp/antsomi-ui/es/assets/svg/transparent.svg';
|
|
5
6
|
// Components
|
|
6
7
|
import { Button } from '@antscorp/antsomi-ui/es/components/atoms/Button';
|
|
7
|
-
export const
|
|
8
|
+
export const StyledColorPicker = styled(ColorPicker) `
|
|
9
|
+
&.antsomi-color-picker {
|
|
10
|
+
.antsomi-popover-button {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
8
16
|
export const PresetColor = styled.div `
|
|
9
17
|
position: relative;
|
|
10
18
|
width: 24px;
|
|
@@ -16,7 +16,7 @@ import { COMMON_TAB_COLLECTION, MIN_VISIBLE_COUNT, SMILEYS_BODY } from './consta
|
|
|
16
16
|
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
17
17
|
const { Text } = Typography;
|
|
18
18
|
const emojiListParsed = JSON.parse(JSON.stringify(ICON_EMOJI_COMMON));
|
|
19
|
-
const CommonCollection = ({ onEmojiClick }) => {
|
|
19
|
+
const CommonCollection = ({ onEmojiClick, getPopupContainer }) => {
|
|
20
20
|
// States
|
|
21
21
|
const [visibleCount, setVisibleCount] = useState(MIN_VISIBLE_COUNT);
|
|
22
22
|
const [state, setState] = useImmer({
|
|
@@ -93,7 +93,7 @@ const CommonCollection = ({ onEmojiClick }) => {
|
|
|
93
93
|
});
|
|
94
94
|
return (_jsx(Scrollbars, { autoHeight: true, autoHeightMax: 150, onScroll: e => onScroll(e, emojiCollection.length), children: _jsx(Flex, { wrap: "wrap", children: content }) }));
|
|
95
95
|
}, [emojiCollection, visibleCount, onScroll, onEmojiClick]);
|
|
96
|
-
return (_jsxs(WrapperCollection, { children: [_jsxs(Flex, { gap: 20, justify: "space-between", align: "flex-end", children: [_jsx(Input, { placeholder: "Search...", suffix: _jsx(SearchIcon, { color: globalToken?.bw8 }), styles: { affixWrapper: { minWidth: 280 } }, onChange: handleChangeInput }), _jsx(Select, { placeholder: "Select collection", value: state.collectionActive, style: { width: 200 }, options: collectionOptions, optionRender: renderOption, onChange: handleChangeSelect })] }), _jsx(EmojiList, { children: renderCommonCollection() })] }));
|
|
96
|
+
return (_jsxs(WrapperCollection, { children: [_jsxs(Flex, { gap: 20, justify: "space-between", align: "flex-end", children: [_jsx(Input, { placeholder: "Search...", suffix: _jsx(SearchIcon, { color: globalToken?.bw8 }), styles: { affixWrapper: { minWidth: 280 } }, onChange: handleChangeInput }), _jsx(Select, { placeholder: "Select collection", value: state.collectionActive, style: { width: 200 }, options: collectionOptions, optionRender: renderOption, onChange: handleChangeSelect, getPopupContainer: getPopupContainer })] }), _jsx(EmojiList, { children: renderCommonCollection() })] }));
|
|
97
97
|
};
|
|
98
98
|
CommonCollection.defaultProps = {
|
|
99
99
|
onEmojiClick: () => { },
|
|
@@ -10,6 +10,7 @@ interface EmojiPopoverProps {
|
|
|
10
10
|
isForceHide?: boolean;
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
onEmojiClick?: (emoji: string | TagDataCustomize) => void;
|
|
13
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
13
14
|
}
|
|
14
15
|
declare const _default: React.NamedExoticComponent<EmojiPopoverProps>;
|
|
15
16
|
export default _default;
|
|
@@ -11,7 +11,7 @@ import { EMOJI_COLLECTIONS, } from '@antscorp/antsomi-ui/es/components/molecules
|
|
|
11
11
|
import { EmojiTabs, EmojiPopoverStyled } from './styled';
|
|
12
12
|
// Utils
|
|
13
13
|
import { handleGetTextToReplace } from './utils';
|
|
14
|
-
const EmojiPopover = ({ disabled, collections, isForceHide, children, onEmojiClick, }) => {
|
|
14
|
+
const EmojiPopover = ({ disabled, collections, isForceHide, children, onEmojiClick, getPopupContainer, }) => {
|
|
15
15
|
const [state, setState] = useImmer({
|
|
16
16
|
isOpen: false,
|
|
17
17
|
collectionActive: collections ? collections[0]?.key : EMOJI_COLLECTIONS.COMMON,
|
|
@@ -47,16 +47,16 @@ const EmojiPopover = ({ disabled, collections, isForceHide, children, onEmojiCli
|
|
|
47
47
|
const renderCollection = useCallback((collectionCurrent = '') => {
|
|
48
48
|
switch (collectionCurrent) {
|
|
49
49
|
case EMOJI_COLLECTIONS.VIBER: {
|
|
50
|
-
return _jsx(ViberCollection, { onEmojiClick: handleGetCodeEmoji });
|
|
50
|
+
return (_jsx(ViberCollection, { onEmojiClick: handleGetCodeEmoji, getPopupContainer: getPopupContainer }));
|
|
51
51
|
}
|
|
52
52
|
case EMOJI_COLLECTIONS.LINE: {
|
|
53
|
-
return _jsx(LineCollection, { onEmojiClick: handleGetCodeEmoji });
|
|
53
|
+
return (_jsx(LineCollection, { onEmojiClick: handleGetCodeEmoji, getPopupContainer: getPopupContainer }));
|
|
54
54
|
}
|
|
55
55
|
default: {
|
|
56
|
-
return _jsx(CommonCollection, { onEmojiClick: handleGetCodeEmoji });
|
|
56
|
+
return (_jsx(CommonCollection, { onEmojiClick: handleGetCodeEmoji, getPopupContainer: getPopupContainer }));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
}, [handleGetCodeEmoji]);
|
|
59
|
+
}, [handleGetCodeEmoji, getPopupContainer]);
|
|
60
60
|
const emojiCollections = useMemo(() => {
|
|
61
61
|
if (!collections)
|
|
62
62
|
return [];
|
|
@@ -66,7 +66,11 @@ const EmojiPopover = ({ disabled, collections, isForceHide, children, onEmojiCli
|
|
|
66
66
|
children: renderCollection(collection.key),
|
|
67
67
|
}));
|
|
68
68
|
}, [collections, renderCollection]);
|
|
69
|
-
|
|
69
|
+
let content = (_jsx(EmojiTabs, { activeKey: state.collectionActive, onTabClick: handleClickCollection, items: emojiCollections }));
|
|
70
|
+
if (emojiCollections.length <= 1) {
|
|
71
|
+
content = emojiCollections.at(0)?.children;
|
|
72
|
+
}
|
|
73
|
+
return (_jsx(EmojiPopoverStyled, { content: content, placement: "topLeft", trigger: "click", fresh: false, style: { padding: 15 }, arrow: false, rootClassName: "antsomi-emoji-popover", open: state.isOpen, onOpenChange: handleOpenChange, getPopupContainer: getPopupContainer, children: children || (_jsx(Button, { type: "link", icon: _jsx(EmojiSmileIcon, {}), disabled: disabled, onClick: () => handleOpenChange(true) })) }));
|
|
70
74
|
};
|
|
71
75
|
EmojiPopover.defaultProps = {
|
|
72
76
|
disabled: false,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const EmojiTabs: import("styled-components").StyledComponent<import("react").FC<import("antd
|
|
2
|
+
export declare const EmojiTabs: import("styled-components").StyledComponent<import("react").FC<import("antd").TabsProps> & {
|
|
3
3
|
TabPane: import("react").FC<import("antd").TabPaneProps>;
|
|
4
4
|
}, any, {
|
|
5
5
|
shadow?: boolean | undefined;
|
|
6
6
|
}, never>;
|
|
7
|
-
export declare const EmojiPopoverStyled: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd
|
|
7
|
+
export declare const EmojiPopoverStyled: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").PopoverProps & import("react").RefAttributes<unknown>> & {
|
|
8
8
|
_InternalPanelDoNotUseOrYouWillBeFired: import("react").FC<import("antd/es/popover/PurePanel").PurePanelProps>;
|
|
9
9
|
}, any, {}, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Libraries
|
|
2
|
+
import { Popover } from 'antd';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
// Components
|
|
4
|
-
import { Popover } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
5
5
|
import { Tabs as TabsUI } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
6
6
|
export const EmojiTabs = styled(TabsUI) `
|
|
7
7
|
.antsomi-tabs-tab {
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useState, useImperativeHandle, useEffect, useRef, useMemo, } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useElementSize } from '@antscorp/antsomi-ui/es/hooks';
|
|
5
|
+
import { DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE_OPTIONS } from './constants';
|
|
6
|
+
import { CLS } from './utils';
|
|
7
|
+
import { FontSizeDropdown } from './components/FontSizeDropdown';
|
|
8
|
+
import { FontSizeControl } from './components/FontSizeControl';
|
|
9
|
+
export const FontSizeInput = forwardRef((props, ref) => {
|
|
10
|
+
const { min = 1, max = 300, value: valueProp, defaultValue = DEFAULT_FONT_SIZE, options = DEFAULT_FONT_SIZE_OPTIONS, placeholder, style, className, disabled, dropdownProps, onFocus, onBlur, onChange = () => undefined, } = props;
|
|
11
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
12
|
+
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
13
|
+
const [popoverValue, setPopoverValue] = useState(null);
|
|
14
|
+
const [inputRef, { width: inputWidth }] = useElementSize();
|
|
15
|
+
const isControlled = valueProp !== undefined;
|
|
16
|
+
const value = isControlled ? +valueProp : +uncontrolledValue;
|
|
17
|
+
const popoverItemRefs = useRef(new Map());
|
|
18
|
+
const fontSizeOptions = useMemo(() => options.map(option => ({
|
|
19
|
+
size: option,
|
|
20
|
+
label: option.toString(),
|
|
21
|
+
className: clsx(CLS.PopoverListItem, {
|
|
22
|
+
[CLS.PopoverListItemSelected]: option === value,
|
|
23
|
+
}),
|
|
24
|
+
})), [options, value]);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!isPopoverOpen) {
|
|
27
|
+
setPopoverValue(null);
|
|
28
|
+
}
|
|
29
|
+
if (isPopoverOpen && popoverValue) {
|
|
30
|
+
popoverItemRefs.current.get(popoverValue)?.focus({
|
|
31
|
+
preventScroll: true,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}, [popoverValue, isPopoverOpen]);
|
|
35
|
+
const handleInputFocus = (event) => {
|
|
36
|
+
onFocus?.(value, event);
|
|
37
|
+
setIsPopoverOpen(true);
|
|
38
|
+
};
|
|
39
|
+
const handleInputBlur = (event) => {
|
|
40
|
+
onBlur?.(value, event);
|
|
41
|
+
if (!popoverValue) {
|
|
42
|
+
setIsPopoverOpen(false);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const handleValueChange = useCallback((newValue, info) => {
|
|
46
|
+
if (!isControlled) {
|
|
47
|
+
setUncontrolledValue(newValue);
|
|
48
|
+
}
|
|
49
|
+
onChange(newValue, info);
|
|
50
|
+
}, [isControlled, onChange]);
|
|
51
|
+
const handleKeyDown = useCallback((e) => {
|
|
52
|
+
const currentSize = popoverValue ?? value;
|
|
53
|
+
const currentFocusIndex = fontSizeOptions.findIndex(item => item.size === currentSize);
|
|
54
|
+
const firstFontSize = fontSizeOptions.at(0);
|
|
55
|
+
const lastFontSize = fontSizeOptions.at(-1);
|
|
56
|
+
switch (e.key) {
|
|
57
|
+
case 'Enter': {
|
|
58
|
+
inputRef.current?.blur();
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case 'ArrowDown': {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
if (currentFocusIndex !== -1) {
|
|
64
|
+
const nextFocusIndex = Math.min(fontSizeOptions.length - 1, currentFocusIndex + 1);
|
|
65
|
+
setPopoverValue(fontSizeOptions[nextFocusIndex].size);
|
|
66
|
+
}
|
|
67
|
+
else if (firstFontSize) {
|
|
68
|
+
setPopoverValue(firstFontSize.size);
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
case 'ArrowUp': {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
if (currentFocusIndex !== -1) {
|
|
75
|
+
const nextFocusIndex = Math.max(0, currentFocusIndex - 1);
|
|
76
|
+
setPopoverValue(fontSizeOptions[nextFocusIndex].size);
|
|
77
|
+
}
|
|
78
|
+
else if (lastFontSize) {
|
|
79
|
+
setPopoverValue(lastFontSize.size);
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
default:
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}, [fontSizeOptions, inputRef, value, popoverValue]);
|
|
87
|
+
const handleClickPopoverItem = useCallback((size) => {
|
|
88
|
+
handleValueChange(size, { type: 'dropdown' });
|
|
89
|
+
setIsPopoverOpen(false);
|
|
90
|
+
inputRef.current?.blur();
|
|
91
|
+
}, [handleValueChange, inputRef]);
|
|
92
|
+
const handlePopoverItemKeydown = useCallback((e, size) => {
|
|
93
|
+
const currentFocusIndex = fontSizeOptions.findIndex(item => item.size === popoverValue);
|
|
94
|
+
switch (e.key) {
|
|
95
|
+
case 'Enter': {
|
|
96
|
+
handleClickPopoverItem(size);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case 'ArrowDown': {
|
|
100
|
+
const nextFocusIndex = Math.min(fontSizeOptions.length - 1, currentFocusIndex + 1);
|
|
101
|
+
setPopoverValue(fontSizeOptions[nextFocusIndex].size);
|
|
102
|
+
e.stopPropagation();
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
case 'ArrowUp': {
|
|
106
|
+
const nextFocusIndex = Math.max(0, currentFocusIndex - 1);
|
|
107
|
+
setPopoverValue(fontSizeOptions[nextFocusIndex].size);
|
|
108
|
+
e.stopPropagation();
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
default:
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}, [fontSizeOptions, popoverValue, handleClickPopoverItem]);
|
|
115
|
+
useImperativeHandle(ref, () => ({
|
|
116
|
+
closeDropdown: () => setIsPopoverOpen(false),
|
|
117
|
+
}));
|
|
118
|
+
const content = (_jsx(FontSizeControl, { disabled: disabled, ref: inputRef, className: className, value: popoverValue ?? value, max: max, min: min, keyboard: false, defaultValue: defaultValue, style: style, placeholder: placeholder, onFocus: handleInputFocus, onBlur: handleInputBlur, onKeyDown: handleKeyDown, onChange: newValue => {
|
|
119
|
+
if (newValue === null)
|
|
120
|
+
return;
|
|
121
|
+
handleValueChange(Number(newValue), { type: 'input' });
|
|
122
|
+
}, onIncrement: () => handleValueChange(value + 1, { type: 'input' }), onDecrement: () => handleValueChange(value - 1, { type: 'input' }) }));
|
|
123
|
+
if (options.length) {
|
|
124
|
+
return (_jsx(FontSizeDropdown, { isOpen: isPopoverOpen, options: fontSizeOptions, popoverValue: popoverValue, width: inputWidth, itemRefs: popoverItemRefs, onItemClick: handleClickPopoverItem, onItemKeyDown: handlePopoverItemKeydown, onClose: () => setIsPopoverOpen(false), getPopupContainer: () => dropdownProps?.getPopupContainer?.() || document.body, children: content }));
|
|
125
|
+
}
|
|
126
|
+
return content;
|
|
127
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputNumberProps } from 'antd';
|
|
3
|
+
interface FontSizeControlProps extends InputNumberProps {
|
|
4
|
+
onIncrement: () => void;
|
|
5
|
+
onDecrement: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const FontSizeControl: import("react").ForwardRefExoticComponent<FontSizeControlProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { InputNumber } from 'antd';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { ControlButton, InputRoot } from '../styled';
|
|
5
|
+
import { CLS } from '../utils';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { AddIcon, MinusIcon } from '../../../icons';
|
|
8
|
+
export const FontSizeControl = forwardRef(({ onIncrement, onDecrement, ...rest }, ref) => (_jsxs(InputRoot, { children: [_jsx(ControlButton, { type: "text", onClick: onDecrement, disabled: rest.disabled ||
|
|
9
|
+
typeof rest.value !== 'number' ||
|
|
10
|
+
typeof rest.min !== 'number' ||
|
|
11
|
+
rest.value <= rest.min, children: _jsx(MinusIcon, { size: 14 }) }), _jsx(InputNumber, { ref: ref, className: clsx(CLS.Input, rest.className), parser: value => value?.replace(/[^\d]/g, ''), controls: false, ...rest }), _jsx(ControlButton, { type: "text", onClick: onIncrement, disabled: rest.disabled ||
|
|
12
|
+
typeof rest.value !== 'number' ||
|
|
13
|
+
typeof rest.max !== 'number' ||
|
|
14
|
+
rest.value >= rest.max, children: _jsx(AddIcon, { size: 14 }) })] })));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
type FontSizeOption = {
|
|
3
|
+
size: number;
|
|
4
|
+
label: string;
|
|
5
|
+
className: string;
|
|
6
|
+
};
|
|
7
|
+
interface FontSizeDropdownProps {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
options: FontSizeOption[];
|
|
11
|
+
popoverValue: number | null;
|
|
12
|
+
width: number;
|
|
13
|
+
itemRefs: RefObject<Map<number, HTMLLIElement>>;
|
|
14
|
+
onItemClick: (size: number) => void;
|
|
15
|
+
onItemKeyDown: (e: React.KeyboardEvent, size: number) => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
getPopupContainer?: () => HTMLElement;
|
|
18
|
+
}
|
|
19
|
+
export declare const FontSizeDropdown: ({ children, isOpen, options, popoverValue, width, itemRefs, onItemClick, onItemKeyDown, onClose, getPopupContainer, }: FontSizeDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Popover } from 'antd';
|
|
3
|
+
import { CLS } from '../utils';
|
|
4
|
+
import { StyledListFont, StyledListItemFont } from '../styled';
|
|
5
|
+
export const FontSizeDropdown = ({ children, isOpen, options, popoverValue, width, itemRefs, onItemClick, onItemKeyDown, onClose, getPopupContainer, }) => {
|
|
6
|
+
const content = (_jsx(StyledListFont, { role: "list", className: CLS.PopoverList, style: { width: `${width}px` }, onMouseDown: e => e.preventDefault(), children: options.map((i, idx) => {
|
|
7
|
+
const isFocused = i.size === popoverValue;
|
|
8
|
+
return (_jsx(StyledListItemFont, { ref: el => {
|
|
9
|
+
if (!el || !itemRefs.current)
|
|
10
|
+
return;
|
|
11
|
+
itemRefs.current.set(i.size, el);
|
|
12
|
+
}, role: "listitem", className: i.className, "aria-posinset": idx + 1, "aria-setsize": options.length, tabIndex: isFocused ? 0 : -1, onClick: () => onItemClick(i.size), onKeyDown: e => onItemKeyDown(e, i.size), ...(isFocused && {
|
|
13
|
+
onBlur: onClose,
|
|
14
|
+
}), children: i.label }, i.size));
|
|
15
|
+
}) }));
|
|
16
|
+
return (_jsx(Popover, { arrow: false, open: isOpen, overlayClassName: CLS.Popover, overlayInnerStyle: {
|
|
17
|
+
borderRadius: 4,
|
|
18
|
+
}, content: content, getPopupContainer: getPopupContainer, placement: "bottom", children: children }));
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FontSizeInput';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledListFont: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
3
|
+
export declare const StyledListItemFont: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
4
|
+
export declare const InputRoot: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const ControlButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<HTMLElement>> & {
|
|
6
|
+
Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
|
|
7
|
+
}, any, {}, never>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
export const StyledListFont = styled.ul `
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
list-style-type: none;
|
|
8
|
+
`;
|
|
9
|
+
export const StyledListItemFont = styled.li `
|
|
10
|
+
padding: 6px 10px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
text-align: center;
|
|
13
|
+
|
|
14
|
+
&:focus-visible {
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&:hover,
|
|
19
|
+
&:focus-visible {
|
|
20
|
+
background-color: ${THEME.components?.Menu?.itemHoverBg};
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
export const InputRoot = styled.div `
|
|
24
|
+
gap: 2px;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
width: fit-content;
|
|
28
|
+
`;
|
|
29
|
+
export const ControlButton = styled(Button) `
|
|
30
|
+
&.antsomi-btn {
|
|
31
|
+
width: 24px;
|
|
32
|
+
height: 24px;
|
|
33
|
+
border-radius: 4px;
|
|
34
|
+
padding: 0px;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface HandlerRef {
|
|
3
|
+
closeDropdown: () => void;
|
|
4
|
+
}
|
|
5
|
+
export interface FontSizeInputProps {
|
|
6
|
+
value: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
defaultValue?: number;
|
|
10
|
+
options?: number[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
className?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
onChange?: (value: number, info: {
|
|
16
|
+
type: 'input' | 'dropdown';
|
|
17
|
+
}) => void;
|
|
18
|
+
onFocus?: (value: number, event: React.FocusEvent<HTMLInputElement>) => void;
|
|
19
|
+
onBlur?: (value: number, event: React.FocusEvent<HTMLInputElement>) => void;
|
|
20
|
+
dropdownProps?: {
|
|
21
|
+
getPopupContainer?: () => HTMLElement | null;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { antsomiClsx } from '@antscorp/antsomi-ui/es/utils';
|
|
2
|
+
const componentCls = antsomiClsx('font-size-input');
|
|
3
|
+
export const CLS = {
|
|
4
|
+
Popover: componentCls('popover'),
|
|
5
|
+
PopoverList: componentCls('popover-list'),
|
|
6
|
+
PopoverListItem: componentCls('popover-list-item'),
|
|
7
|
+
PopoverListItemSelected: componentCls('popover-list-item-selected'),
|
|
8
|
+
Input: componentCls('input'),
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex } from 'antd';
|
|
3
|
+
import { translate, translations } from '@antscorp/antsomi-locales';
|
|
4
|
+
import { SearchNotFoundIcon } from '../../icons';
|
|
5
|
+
import { ContainerModule } from './styled';
|
|
6
|
+
export const ItemNotFound = props => {
|
|
7
|
+
const { height = '100%' } = props;
|
|
8
|
+
return (_jsx(ContainerModule, { "$height": height, children: _jsxs("div", { children: [_jsxs(Flex, { className: "item-title", align: "center", children: [_jsx("span", { className: "content-title", children: translate(translations._ERR_ITEM_NOT_FOUND, 'Item not found') }), _jsx(SearchNotFoundIcon, { className: "icon-title" })] }), _jsx("div", { className: "item-body", children: translate(translations._ERR_ITEM_NOT_FOUND_DES, 'Item does not exist or has been deleted') })] }) }));
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ItemNotFound } from './ItemNotFound';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ItemNotFound } from './ItemNotFound';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ContainerModule: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {
|
|
3
|
+
$height: string;
|
|
4
|
+
}, never>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Flex } from 'antd';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const ContainerModule = styled(Flex) `
|
|
4
|
+
height: ${props => (props.$height ? props.$height : '100%')};
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 5px;
|
|
9
|
+
.item-title {
|
|
10
|
+
display: flex;
|
|
11
|
+
|
|
12
|
+
.content-title {
|
|
13
|
+
font-size: 20px;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
color: #f29100;
|
|
16
|
+
margin-right: 5px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.icon-title {
|
|
20
|
+
font-size: 24px;
|
|
21
|
+
color: #666666;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.item-body {
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
color: #595959;
|
|
28
|
+
}
|
|
29
|
+
`;
|