@antscorp/antsomi-ui 1.3.7-beta.7 → 1.3.7-beta.70
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/README.md +78 -78
- package/es/__mocks__/1000_city.json +802 -802
- package/es/__mocks__/sql-query.json +56 -56
- package/es/assets/css/main.scss +8 -8
- package/es/assets/images/feedback.svg +3 -3
- package/es/assets/svg/mobile-frame.svg +3 -3
- package/es/assets/svg/warning-icon.svg +5 -5
- package/es/components/atoms/Alert/Alert.js +28 -28
- package/es/components/atoms/ContentEditable/styled.js +16 -16
- package/es/components/atoms/DividerPure/styled.js +35 -35
- package/es/components/atoms/Eyedropper/styled.js +39 -39
- package/es/components/atoms/Icon/index.js +19 -19
- package/es/components/atoms/Iframe/Iframe.js +18 -18
- package/es/components/atoms/Input/Input.js +3 -1
- package/es/components/atoms/Input/styled.js +104 -104
- package/es/components/atoms/InputDynamic/InputDynamic.js +3 -3
- package/es/components/atoms/InputDynamic/styled.js +284 -284
- package/es/components/atoms/MobileBrandingBar/styled.js +21 -21
- package/es/components/atoms/MobileFrame/styled.js +30 -30
- package/es/components/atoms/MobileFrameV2/styled.js +42 -42
- package/es/components/atoms/MobileFrameV3/styled.js +31 -31
- package/es/components/atoms/NotificationStatus/styled.js +10 -10
- package/es/components/atoms/PreviewTabs/styled.js +69 -69
- package/es/components/atoms/Radio/index.js +16 -16
- package/es/components/atoms/ReactIframe/ReactIframe.js +5 -5
- package/es/components/atoms/ReactIframe/styled.js +9 -9
- package/es/components/atoms/RequiredLabel/styled.js +3 -3
- package/es/components/atoms/ScrollBox/index.js +5 -5
- package/es/components/atoms/Scrollbars/styled.js +21 -21
- package/es/components/atoms/SelectAssociatedTag/styled.js +51 -51
- package/es/components/atoms/SlideBar/styled.js +194 -194
- package/es/components/atoms/Slider/styled.js +31 -31
- package/es/components/atoms/Space/Space.js +4 -4
- package/es/components/atoms/Spin/styled.js +11 -11
- package/es/components/atoms/Steps/styled.js +244 -244
- package/es/components/atoms/Switch/styled.js +56 -56
- package/es/components/atoms/Tag/Tag.js +10 -10
- package/es/components/atoms/Text/styled.js +34 -34
- package/es/components/icons/DomainManagementIcon.js +1 -1
- package/es/components/icons/LazyIcon/LazyIcon.d.ts +2 -0
- package/es/components/icons/LazyIcon/LazyIcon.js +2 -0
- package/es/components/icons/LoadingIcon.js +33 -33
- package/es/components/icons/QRCodeManagementIcon.d.ts +3 -0
- package/es/components/icons/QRCodeManagementIcon.js +7 -0
- package/es/components/icons/QRSetDashboardIcon.d.ts +3 -0
- package/es/components/icons/QRSetDashboardIcon.js +7 -0
- package/es/components/icons/document/styled.js +43 -43
- package/es/components/icons/index.d.ts +2 -0
- package/es/components/icons/index.js +2 -0
- package/es/components/index.scss +2 -2
- package/es/components/molecules/AccessDenied/styled.js +28 -28
- package/es/components/molecules/AccountSelection/styled.js +110 -110
- package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +28 -2
- package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +1 -0
- package/es/components/molecules/AddDynamicContent/constants.d.ts +2 -0
- package/es/components/molecules/AddDynamicContent/constants.js +2 -0
- package/es/components/molecules/AddDynamicContent/styled.js +23 -23
- package/es/components/molecules/AlignSetting/styled.js +4 -4
- package/es/components/molecules/ApplyPopupContent/styled.js +32 -32
- package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +8 -8
- package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +79 -79
- package/es/components/molecules/CalendarSelection/components/Footer/styled.js +4 -4
- package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +21 -21
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +26 -26
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +30 -30
- package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +26 -26
- package/es/components/molecules/CalendarSelection/styled.js +8 -8
- package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +119 -119
- package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +67 -67
- package/es/components/molecules/CaptureScreen/styled.js +240 -240
- package/es/components/molecules/ChartTab/components/styled.js +24 -24
- package/es/components/molecules/ChartTab/styled.js +20 -20
- package/es/components/molecules/ChatBox/AntsomiAI.js +8 -8
- package/es/components/molecules/ChatBox/ChatBoxInsight/QuestionItem.js +9 -9
- package/es/components/molecules/ChatBox/ChatBoxInsight/styled.js +365 -365
- package/es/components/molecules/ChatBox/styled.js +324 -324
- package/es/components/molecules/CodeStructure/styled.js +5 -5
- package/es/components/molecules/ColorPicker/ChromePicker/styled.js +10 -10
- package/es/components/molecules/ColorPicker/CustomPicker/styled.js +89 -89
- package/es/components/molecules/ColorPicker/SketchPicker/styled.js +5 -5
- package/es/components/molecules/ColorPicker/index.d.ts +2 -0
- package/es/components/molecules/ColorPicker/index.js +8 -3
- package/es/components/molecules/ColorPicker/styled.js +7 -7
- package/es/components/molecules/ColorSetting/styled.js +39 -39
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +110 -110
- package/es/components/molecules/DatePickerV2/styled.js +6 -6
- package/es/components/molecules/DisplayFormat/styled.js +12 -12
- package/es/components/molecules/DrawerDetail/components/ToggleDrawerSizeButton.js +24 -24
- package/es/components/molecules/DrawerDetail/styled.js +109 -109
- package/es/components/molecules/Dropdown/style.scss +11 -11
- package/es/components/molecules/Dropdown/styled.js +28 -28
- package/es/components/molecules/EdgeSetting/styled.js +10 -10
- package/es/components/molecules/EditableName/styled.js +70 -70
- package/es/components/molecules/EditingList/styled.js +29 -29
- package/es/components/molecules/EditingListV2/components/List/List.js +9 -9
- package/es/components/molecules/EditorTab/styled.js +156 -156
- package/es/components/molecules/EmojiCollections/styled.js +22 -22
- package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +1 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.js +2 -2
- package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
- package/es/components/molecules/EmojiPopover/styled.js +5 -5
- package/es/components/molecules/EmptyData/styled.js +53 -53
- package/es/components/molecules/EyedropperButton/styled.js +19 -19
- package/es/components/molecules/FontSizeInput/index.scss +15 -15
- package/es/components/molecules/FontSizeInput/styled.js +31 -31
- package/es/components/molecules/GradientSetting/styled.js +57 -57
- package/es/components/molecules/HeaderV2/HeaderV2.d.ts +1 -1
- package/es/components/molecules/HeaderV2/styled.js +70 -70
- package/es/components/molecules/IconSelection/styled.js +69 -69
- package/es/components/molecules/ImageEditor/components/ModalShortcut.js +21 -21
- package/es/components/molecules/ImageEditor/styled.js +5 -5
- package/es/components/molecules/ImagePreview/styled.js +3 -3
- package/es/components/molecules/InputNumberWithUnit/styled.js +14 -14
- package/es/components/molecules/InputSearch/styled.js +41 -41
- package/es/components/molecules/InputSelectAttribute/styled.js +22 -22
- package/es/components/molecules/ItemNotFound/styled.js +26 -26
- package/es/components/molecules/MatchAnySelect/components/ExtendValuePopup.js +8 -8
- package/es/components/molecules/MatchAnySelect/styled.js +247 -247
- package/es/components/molecules/Modal/Modal.js +7 -1
- package/es/components/molecules/Modal/styled.js +63 -63
- package/es/components/molecules/ModalSelect/styled.js +152 -152
- package/es/components/molecules/ModalV2/styled.js +27 -27
- package/es/components/molecules/PopupDraggable/styled.js +57 -57
- package/es/components/molecules/PreviewModal/styled.js +26 -26
- package/es/components/molecules/ProcessLoading/styled.js +2 -2
- package/es/components/molecules/QuillEditor/CustomToolbar.js +3165 -3165
- package/es/components/molecules/QuillEditor/EditorToolbar.js +7 -7
- package/es/components/molecules/QuillEditor/styled.js +25 -25
- package/es/components/molecules/RadioGroup/styled.js +9 -9
- package/es/components/molecules/RequestAccess/styled.js +38 -38
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +77 -77
- package/es/components/molecules/ResizeGrid/styled.js +50 -50
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +118 -118
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +13 -13
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +40 -40
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +27 -27
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +2 -2
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +38 -38
- package/es/components/molecules/SearchPopover/SearchPopover.js +2 -2
- package/es/components/molecules/SearchPopover/components/PopoverSelect/styled.js +36 -36
- package/es/components/molecules/SearchPopover/components/PopoverSelect/styles.scss +7 -7
- package/es/components/molecules/SearchPopover/styled.d.ts +12 -1
- package/es/components/molecules/SearchPopover/styled.js +32 -33
- package/es/components/molecules/SearchPopover/types.d.ts +4 -3
- package/es/components/molecules/Select/Select.js +3 -3
- package/es/components/molecules/Select/styled.d.ts +3 -1
- package/es/components/molecules/Select/styled.js +76 -32
- package/es/components/molecules/SelectAccount/styled.js +147 -147
- package/es/components/molecules/SelectEventAttribute/styled.js +8 -8
- package/es/components/molecules/SelectMulti/styled.js +62 -62
- package/es/components/molecules/SelectV2/styled.js +124 -124
- package/es/components/molecules/SettingWrapper/styled.js +12 -12
- package/es/components/molecules/ShareAccess/ShareAccess.d.ts +2 -1
- package/es/components/molecules/ShareAccess/ShareAccess.js +12 -9
- package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +56 -56
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +5 -5
- package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +5 -5
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.js +15 -15
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +2 -2
- package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +63 -63
- package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +31 -31
- package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +2 -1
- package/es/components/molecules/ShareAccess/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/reducer.d.ts +1 -1
- package/es/components/molecules/ShareAccess/reducer.js +7 -4
- package/es/components/molecules/ShareAccess/types.d.ts +22 -0
- package/es/components/molecules/ShareAccess/utils.d.ts +3 -1
- package/es/components/molecules/ShareAccess/utils.js +35 -2
- package/es/components/molecules/SliderWithInputNumber/styled.js +2 -2
- package/es/components/molecules/Tabs/Tabs.js +11 -11
- package/es/components/molecules/TagifyInput/TagifyInput.js +98 -77
- package/es/components/molecules/TagifyInput/styled.js +37 -37
- package/es/components/molecules/TagifyInput/types.d.ts +14 -8
- package/es/components/molecules/TagifyInput/utils.d.ts +6 -1
- package/es/components/molecules/TagifyInput/utils.js +32 -13
- package/es/components/molecules/TagifyInput/utils.style.js +208 -208
- package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +5 -5
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +276 -276
- package/es/components/molecules/TemplateSaveAs/styled.js +134 -134
- package/es/components/molecules/ThumbnailCard/styled.js +92 -92
- package/es/components/molecules/Tree/styled.js +38 -38
- package/es/components/molecules/UnsubscribePreferences/styled.js +7 -7
- package/es/components/molecules/UnsubscribePreview/components/styled.js +53 -53
- package/es/components/molecules/UnsubscribePreview/styled.js +48 -48
- package/es/components/molecules/UploadImage/styled.js +114 -114
- package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +1 -0
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +3 -7
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +10 -10
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +46 -327
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.d.ts +9 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.js +5 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.d.ts +23 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.js +81 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.d.ts +24 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.js +32 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.d.ts +26 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.js +93 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.d.ts +24 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.js +94 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.d.ts +7 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.js +132 -0
- package/es/components/molecules/VirtualizedMenu/styled.js +103 -92
- package/es/components/molecules/VirtualizedMenu/types.d.ts +1 -0
- package/es/components/molecules/VirtualizedMenu/utils.d.ts +1 -0
- package/es/components/molecules/VirtualizedMenu/utils.js +1 -0
- package/es/components/molecules/index.d.ts +1 -0
- package/es/components/molecules/index.scss +1 -1
- package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/styles.js +98 -98
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/styles.js +18 -18
- package/es/components/organism/AccountProfile/components/AccountSetting/styled.js +543 -543
- package/es/components/organism/AccountProfile/components/AccountSetting/styles.scss +39 -39
- package/es/components/organism/AccountSharing/AccountSharing.d.ts +1 -0
- package/es/components/organism/AccountSharing/AccountSharing.js +17 -33
- package/es/components/organism/AccountSharing/styled.js +346 -346
- package/es/components/organism/ActivityTimeline/ActivityTimeline.js +3 -3
- package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +1290 -1290
- package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +1896 -1896
- package/es/components/organism/ActivityTimeline/components/ActionHistory/styled.js +28 -28
- package/es/components/organism/ActivityTimeline/components/CardMember/styled.js +60 -60
- package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/styled.js +4 -4
- package/es/components/organism/ActivityTimeline/components/List/styled.js +77 -77
- package/es/components/organism/ActivityTimeline/components/ListItem/styled.js +37 -37
- package/es/components/organism/ActivityTimeline/components/ProductCard/styled.js +92 -92
- package/es/components/organism/ActivityTimeline/components/Redeem/styled.js +7 -7
- package/es/components/organism/ActivityTimeline/components/Slide/styled.js +20 -20
- package/es/components/organism/ActivityTimeline/components/TimeLineTitle/styled.js +7 -7
- package/es/components/organism/ActivityTimeline/components/TimelineSection/styled.js +69 -69
- package/es/components/organism/ActivityTimeline/constants.d.ts +9 -9
- package/es/components/organism/ActivityTimeline/constants.js +3 -3
- package/es/components/organism/ActivityTimeline/index.d.ts +530 -1
- package/es/components/organism/ActivityTimeline/index.js +9 -1
- package/es/components/organism/ActivityTimeline/styled.js +43 -43
- package/es/components/organism/ActivityTimeline/utils.js +186 -15
- package/es/components/organism/AlgorithmsSetting/styled.js +35 -35
- package/es/components/organism/BasicLogin/components/ChooseMethod/styled.js +19 -19
- package/es/components/organism/BasicLogin/components/LoginWithEmail/styled.js +3 -3
- package/es/components/organism/BasicLogin/components/LoginWithGG/styled.js +3 -3
- package/es/components/organism/BasicLogin/components/SignIn/styled.js +8 -8
- package/es/components/organism/BasicLogin/components/WidgetLayout/styled.js +18 -18
- package/es/components/organism/BasicLogin/styled.js +107 -107
- package/es/components/organism/ContentSources/styled.js +50 -50
- package/es/components/organism/DataTable/components/AddButton/index.js +8 -8
- package/es/components/organism/DataTable/components/ModifyColumn/styled.js +18 -18
- package/es/components/organism/DataTable/components/Pagination/styled.js +26 -26
- package/es/components/organism/DataTable/components/Table/styled.js +135 -135
- package/es/components/organism/DataTable/components/Toolbar/SearchPopover.js +17 -17
- package/es/components/organism/DataTable/components/Toolbar/styled.js +70 -70
- package/es/components/organism/DataTable/styled/index.js +84 -84
- package/es/components/organism/Filter/components/FilterCondition/styled.js +34 -34
- package/es/components/organism/Filter/styled.js +109 -109
- package/es/components/organism/FilterSetting/components/common/InputArray/styled.js +5 -5
- package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.js +63 -63
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/ColumnSuggestion/index.js +31 -31
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/Tree/index.js +22 -22
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.js +55 -55
- package/es/components/organism/FilterSetting/styled.js +19 -19
- package/es/components/organism/GenerativeInsights/styled.js +55 -55
- package/es/components/organism/Help/styled.js +267 -267
- package/es/components/organism/LeftMenu/LeftMenu.js +6 -6
- package/es/components/organism/LeftMenu/components/HomeMenu/styled.js +39 -39
- package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/styled.js +16 -16
- package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.js +156 -156
- package/es/components/organism/LeftMenu/hooks/usePermission.js +1 -1
- package/es/components/organism/LeftMenu/styled.js +216 -214
- package/es/components/organism/LeftMenu/types/index.d.ts +7 -0
- package/es/components/organism/LeftMenu/utils/index.js +1 -1
- package/es/components/organism/Login/Login.js +19 -36
- package/es/components/organism/Login/components/ChooseMethod/styled.js +19 -19
- package/es/components/organism/Login/components/ForgotPassword/styled.js +8 -8
- package/es/components/organism/Login/components/LoginSelectPortal/Item/styled.js +31 -31
- package/es/components/organism/Login/components/LoginSelectPortal/styled.js +3 -3
- package/es/components/organism/Login/components/LoginWithEmail/styled.js +3 -3
- package/es/components/organism/Login/components/LoginWithGG/styled.js +3 -3
- package/es/components/organism/Login/components/SetupGGAuthenticator/styled.js +7 -7
- package/es/components/organism/Login/components/SignIn/SignIn.js +2 -2
- package/es/components/organism/Login/components/SignIn/styled.js +8 -8
- package/es/components/organism/Login/components/VerifyAccount/styled.js +13 -13
- package/es/components/organism/Login/components/WidgetLayout/styled.js +18 -18
- package/es/components/organism/Login/styled.js +115 -115
- package/es/components/organism/Login/types/index.d.ts +2 -0
- package/es/components/organism/Menu/styled.js +6 -6
- package/es/components/organism/ModifyColumnModal/styled.js +132 -132
- package/es/components/organism/Notification/styled.js +155 -155
- package/es/components/organism/PreviewCollections/Messages/SkeletonMessage/styled.js +14 -14
- package/es/components/organism/PreviewCollections/WhatsappMessage/CarouselMessage/styled.js +63 -63
- package/es/components/organism/PreviewCollections/constants.js +50 -50
- package/es/components/organism/PreviewCollections/styled.js +16 -16
- package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +78 -78
- package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +52 -52
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +18 -18
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +77 -77
- package/es/components/organism/PreviewTemplateModal/styled.js +21 -21
- package/es/components/organism/SQLGeneration/components/styled.js +354 -354
- package/es/components/organism/SQLGeneration/index.scss +1 -1
- package/es/components/organism/SQLGeneration/integrations/AceEditor/index.scss +4 -4
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +11 -11
- package/es/components/organism/Table/CrossTabTable/styled.js +11 -11
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +17 -17
- package/es/components/organism/Table/ExplorePivotTable/styled.js +11 -11
- package/es/components/organism/TextEditor/TextEditor.d.ts +9 -2
- package/es/components/organism/TextEditor/TextEditor.js +203 -42
- package/es/components/organism/TextEditor/__mocks__/text-contennt.js +44 -44
- package/es/components/organism/TextEditor/constants.d.ts +9 -0
- package/es/components/organism/TextEditor/constants.js +66 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +6 -128
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +7 -292
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +1 -1
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +4 -0
- package/es/components/organism/TextEditor/extensions/Link.js +33 -14
- package/es/components/organism/TextEditor/extensions/ListItem.d.ts +10 -0
- package/es/components/organism/TextEditor/extensions/ListItem.js +93 -0
- package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +5 -6
- package/es/components/organism/TextEditor/extensions/SmartTag.js +96 -4
- package/es/components/organism/TextEditor/hooks/useColorSet.js +7 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.js +2 -1
- package/es/components/organism/TextEditor/index.d.ts +7 -5
- package/es/components/organism/TextEditor/index.scss +65 -68
- package/es/components/organism/TextEditor/provider.d.ts +1 -0
- package/es/components/organism/TextEditor/provider.js +6 -3
- package/es/components/organism/TextEditor/store.d.ts +11 -4
- package/es/components/organism/TextEditor/store.js +22 -2
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/froala-legacy-format.settings.json +95 -0
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.d.ts +111 -0
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.js +82 -0
- package/es/components/organism/TextEditor/stories/shared.d.ts +64 -0
- package/es/components/organism/TextEditor/stories/shared.js +57 -0
- package/es/components/organism/TextEditor/styled.d.ts +1 -1
- package/es/components/organism/TextEditor/styled.js +54 -53
- package/es/components/organism/TextEditor/types.d.ts +161 -11
- package/es/components/organism/TextEditor/types.js +1 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +2 -1
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +80 -51
- package/es/components/organism/TextEditor/ui/Button/Button.js +22 -22
- package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.js +13 -13
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +1 -1
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +1 -1
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +2 -2
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +12 -2
- package/es/components/organism/TextEditor/ui/FontPopover/styled.js +32 -32
- package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.d.ts +16 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.js +61 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/index.js +1 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.d.ts +9 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.js +126 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Popover/Popover.js +1 -1
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.js +54 -54
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +10 -12
- package/es/components/organism/TextEditor/ui/Toolbar/{Toolbar.d.ts → FormattingToolbar.d.ts} +3 -4
- package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.js +90 -0
- package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.js +39 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +4 -3
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +2 -2
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +17 -12
- package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +2 -1
- package/es/components/organism/TextEditor/ui/Toolbar/index.js +2 -1
- package/es/components/organism/TextEditor/utils/documentState.d.ts +14 -0
- package/es/components/organism/TextEditor/utils/documentState.js +25 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.js +60 -0
- package/es/components/organism/TextEditor/utils/link.d.ts +10 -1
- package/es/components/organism/TextEditor/utils/link.js +161 -7
- package/es/components/organism/TextEditor/utils/menu.js +2 -1
- package/es/components/organism/TextEditor/utils/selection.js +3 -2
- package/es/components/organism/TextEditor/utils/smartTag.js +2 -1
- package/es/components/organism/TicketEditor/styled.js +860 -860
- package/es/components/organism/TicketEditorV2/styled.js +839 -839
- package/es/components/organism/index.d.ts +1 -1
- package/es/components/organism/index.scss +2 -2
- package/es/components/template/Layout/Layout.js +10 -10
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/components/OldLeftMenu/styled.js +73 -73
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/styled.js +39 -39
- package/es/components/template/Layout/components/RecommendationWorkspace/components/RecommendationImage/styled.js +61 -61
- package/es/components/template/Layout/components/RecommendationWorkspace/styled.js +16 -16
- package/es/components/template/Layout/styled.js +84 -84
- package/es/components/template/TemplateListing/Loadable.d.ts +1 -0
- package/es/components/template/TemplateListing/components/BlankTemplate/styled.js +21 -21
- package/es/components/template/TemplateListing/components/CategoryListing/styled.js +123 -123
- package/es/components/template/TemplateListing/components/Empty/styled.js +20 -20
- package/es/components/template/TemplateListing/stories/demo/styled.js +4 -4
- package/es/components/template/TemplateListing/styled/index.js +40 -40
- package/es/hooks/index.d.ts +1 -1
- package/es/hooks/index.js +1 -1
- package/es/providers/ConfigProvider/ConfigProvider.d.ts +4 -0
- package/es/providers/ConfigProvider/ConfigProvider.js +2 -3
- package/es/providers/ConfigProvider/GlobalStyle.d.ts +2 -2
- package/es/providers/ConfigProvider/GlobalStyle.js +1252 -1249
- package/es/services/MediaTemplateDesign/UploadFile/index.js +4 -4
- package/es/styled/common.js +51 -51
- package/es/tests/styled.js +4 -4
- package/es/utils/common.d.ts +1 -1
- package/es/utils/common.js +3 -3
- package/es/utils/cookie.js +2 -1
- package/es/utils/crossSubdomainCookieOptions.d.ts +14 -0
- package/es/utils/crossSubdomainCookieOptions.js +12 -0
- package/es/utils/variables.js +7 -7
- package/package.json +282 -286
- 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/Toolbar/Toolbar.js +0 -39
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
2
2
|
import { Dropdown } from 'antd';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
export const StyledDropdownButton = styled(Dropdown.Button) `
|
|
5
|
-
&.antsomi-dropdown-button {
|
|
6
|
-
width: fit-content;
|
|
7
|
-
|
|
8
|
-
.antsomi-btn {
|
|
9
|
-
border-radius: 4px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.antsomi-btn-compact-item:not(.antsomi-btn-compact-last-item).antsomi-btn-compact-first-item {
|
|
13
|
-
width: 24px;
|
|
14
|
-
height: 24px;
|
|
15
|
-
border-start-end-radius: 0;
|
|
16
|
-
border-end-end-radius: 0;
|
|
17
|
-
padding: 0;
|
|
18
|
-
color: ${THEME.token?.bw8};
|
|
19
|
-
|
|
20
|
-
&:hover:not(:disabled, .is-active) {
|
|
21
|
-
background-color: #ebebeb;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.antsomi-btn-compact-item:not(.antsomi-btn-compact-first-item).antsomi-btn-compact-last-item {
|
|
26
|
-
width: 16px;
|
|
27
|
-
height: 24px;
|
|
28
|
-
border-start-start-radius: 0;
|
|
29
|
-
border-end-start-radius: 0;
|
|
30
|
-
padding: 0;
|
|
31
|
-
|
|
32
|
-
&:hover:not(:disabled),
|
|
33
|
-
&.antsomi-dropdown-open:not(:disabled) {
|
|
34
|
-
background-color: #ebebeb;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&.is-active {
|
|
39
|
-
.antsomi-btn-compact-item:not(.antsomi-btn-compact-last-item).antsomi-btn-compact-first-item {
|
|
40
|
-
:not(:disabled) {
|
|
41
|
-
color: ${THEME.token?.colorPrimary};
|
|
42
|
-
background-color: #e0ebf7;
|
|
43
|
-
|
|
44
|
-
&:hover {
|
|
45
|
-
color: ${THEME.token?.colorPrimary};
|
|
46
|
-
background-color: #e0ebf7;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&.is-open {
|
|
53
|
-
.antsomi-btn-icon svg {
|
|
54
|
-
transform: rotate(180deg);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
4
|
+
export const StyledDropdownButton = styled(Dropdown.Button) `
|
|
5
|
+
&.antsomi-dropdown-button {
|
|
6
|
+
width: fit-content;
|
|
7
|
+
|
|
8
|
+
.antsomi-btn {
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.antsomi-btn-compact-item:not(.antsomi-btn-compact-last-item).antsomi-btn-compact-first-item {
|
|
13
|
+
width: 24px;
|
|
14
|
+
height: 24px;
|
|
15
|
+
border-start-end-radius: 0;
|
|
16
|
+
border-end-end-radius: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
color: ${THEME.token?.bw8};
|
|
19
|
+
|
|
20
|
+
&:hover:not(:disabled, .is-active) {
|
|
21
|
+
background-color: #ebebeb;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.antsomi-btn-compact-item:not(.antsomi-btn-compact-first-item).antsomi-btn-compact-last-item {
|
|
26
|
+
width: 16px;
|
|
27
|
+
height: 24px;
|
|
28
|
+
border-start-start-radius: 0;
|
|
29
|
+
border-end-start-radius: 0;
|
|
30
|
+
padding: 0;
|
|
31
|
+
|
|
32
|
+
&:hover:not(:disabled),
|
|
33
|
+
&.antsomi-dropdown-open:not(:disabled) {
|
|
34
|
+
background-color: #ebebeb;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.is-active {
|
|
39
|
+
.antsomi-btn-compact-item:not(.antsomi-btn-compact-last-item).antsomi-btn-compact-first-item {
|
|
40
|
+
:not(:disabled) {
|
|
41
|
+
color: ${THEME.token?.colorPrimary};
|
|
42
|
+
background-color: #e0ebf7;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
color: ${THEME.token?.colorPrimary};
|
|
46
|
+
background-color: #e0ebf7;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.is-open {
|
|
53
|
+
.antsomi-btn-icon svg {
|
|
54
|
+
transform: rotate(180deg);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
58
|
`;
|
|
@@ -35,15 +35,15 @@ const textAlignOptions = [
|
|
|
35
35
|
icon: AlignJustifyIcon,
|
|
36
36
|
},
|
|
37
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
|
-
}
|
|
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
47
|
`;
|
|
48
48
|
export const TextAlignSelect = (props) => {
|
|
49
49
|
const { editor, onChange } = props;
|
|
@@ -52,9 +52,7 @@ export const TextAlignSelect = (props) => {
|
|
|
52
52
|
editor: editor,
|
|
53
53
|
selector: ({ editor: editorInstance }) => {
|
|
54
54
|
const alignment = ['left', 'center', 'right', 'justify'].find(alignment => editorInstance?.isActive({ textAlign: alignment }));
|
|
55
|
-
return {
|
|
56
|
-
currentAlignment: alignment || 'left',
|
|
57
|
-
};
|
|
55
|
+
return { currentAlignment: alignment };
|
|
58
56
|
},
|
|
59
57
|
});
|
|
60
58
|
const selectedOption = useMemo(() => textAlignOptions.find(option => option.value === currentAlignment), [currentAlignment]);
|
package/es/components/organism/TextEditor/ui/Toolbar/{Toolbar.d.ts → FormattingToolbar.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Config, FontConfig,
|
|
4
|
-
export type
|
|
3
|
+
import { Config, FontConfig, TextStyle } from '../../types';
|
|
4
|
+
export type FormattingToolbarProps = {
|
|
5
5
|
editor: Editor;
|
|
6
6
|
config?: Config;
|
|
7
7
|
defaultTextStyle?: TextStyle;
|
|
@@ -11,10 +11,9 @@ export type ToolbarProps = {
|
|
|
11
11
|
linkHanlder?: {
|
|
12
12
|
onUpsert?: () => void;
|
|
13
13
|
};
|
|
14
|
-
render?: Partial<Pick<TextEditorComponentsRender, 'renderLinkToolbar'>>;
|
|
15
14
|
onChangeFont?: (args: {
|
|
16
15
|
font: FontConfig;
|
|
17
16
|
weight: number;
|
|
18
17
|
}) => void;
|
|
19
18
|
};
|
|
20
|
-
export declare const
|
|
19
|
+
export declare const FormattingToolbar: (props: FormattingToolbarProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Flex } from 'antd';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { ToolbarWrapper } from '../../styled';
|
|
5
|
+
import { BoldAction, BulletListAction, ClearFormattingAction, EmoijiAction, FontFamilyAction, FontSizeAction, HistoryAction, IndentAction, ItalicAction, LetterSpacingAction, LinkAction, OrderedListAction, OutdentAction, SmartTagAction, LineSpacingAction, StrikeAction, SubscriptAction, SuperscriptAction, TextAlignAction, TextBackColorAction, TextColorAction, TextTransformAction, UnderlineAction, } from './actions';
|
|
6
|
+
import { ALL_TOOLBAR_ACTIONS, DEFAULT_TEXT_STYLE, DEFAULT_TOOLBAR_GROUPING } from '../../constants';
|
|
7
|
+
import { useElementSize } from '@antscorp/antsomi-ui/es/hooks';
|
|
8
|
+
export const FormattingToolbar = (props) => {
|
|
9
|
+
const { editor, smartTagHandler, linkHanlder, config, defaultTextStyle = DEFAULT_TEXT_STYLE, onChangeFont, } = props;
|
|
10
|
+
const [ref] = useElementSize();
|
|
11
|
+
// Determine visible actions based on config
|
|
12
|
+
const visibleActions = useMemo(() => {
|
|
13
|
+
const toolbarConfig = config?.Toolbar;
|
|
14
|
+
// If items is false, hide toolbar entirely
|
|
15
|
+
if (toolbarConfig?.items === false) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
// If items is an array, use it (user-specified order)
|
|
19
|
+
if (Array.isArray(toolbarConfig?.items)) {
|
|
20
|
+
return toolbarConfig.items;
|
|
21
|
+
}
|
|
22
|
+
// Default: show all actions except excluded ones
|
|
23
|
+
const excludeSet = new Set(toolbarConfig?.exclude || []);
|
|
24
|
+
return ALL_TOOLBAR_ACTIONS.filter(action => !excludeSet.has(action));
|
|
25
|
+
}, [config?.Toolbar]);
|
|
26
|
+
// Map action names to React components
|
|
27
|
+
const actionComponentMap = useMemo(() => ({
|
|
28
|
+
fontFamily: (_jsx(FontFamilyAction, { editor: editor, fonts: config?.FontFamily?.fonts, onChange: (font, weight) => onChangeFont?.({ font, weight }), fontGroupingFn: config?.FontFamily?.fontGroupingFn, groupOrder: config?.FontFamily?.groupOrder, defaultFontFamily: defaultTextStyle.fontFamily }, "fontFamily")),
|
|
29
|
+
fontSize: (_jsx(FontSizeAction, { editor: editor, defaultFontSize: defaultTextStyle.fontSize }, "fontSize")),
|
|
30
|
+
bold: _jsx(BoldAction, { editor: editor }, "bold"),
|
|
31
|
+
italic: _jsx(ItalicAction, { editor: editor }, "italic"),
|
|
32
|
+
underline: _jsx(UnderlineAction, { editor: editor }, "underline"),
|
|
33
|
+
link: _jsx(LinkAction, { editor: editor, onClick: linkHanlder?.onUpsert }, "link"),
|
|
34
|
+
strike: _jsx(StrikeAction, { editor: editor }, "strike"),
|
|
35
|
+
superscript: _jsx(SuperscriptAction, { editor: editor }, "superscript"),
|
|
36
|
+
subscript: _jsx(SubscriptAction, { editor: editor }, "subscript"),
|
|
37
|
+
textTransform: _jsx(TextTransformAction, { editor: editor }, "textTransform"),
|
|
38
|
+
textColor: _jsx(TextColorAction, { editor: editor }, "textColor"),
|
|
39
|
+
backgroundColor: _jsx(TextBackColorAction, { editor: editor }, "backgroundColor"),
|
|
40
|
+
emoji: _jsx(EmoijiAction, { editor: editor }, "emoji"),
|
|
41
|
+
smartTag: (_jsx(SmartTagAction, { editor: editor, onClick: smartTagHandler?.onUpsert }, "smartTag")),
|
|
42
|
+
bulletList: (_jsx(BulletListAction, { editor: editor, useCustomBullet: config?.UnorderedList?.useCustomBullet }, "bulletList")),
|
|
43
|
+
orderedList: _jsx(OrderedListAction, { editor: editor }, "orderedList"),
|
|
44
|
+
textAlign: _jsx(TextAlignAction, { editor: editor }, "textAlign"),
|
|
45
|
+
lineSpacing: (_jsx(LineSpacingAction, { editor: editor, defaultValue: defaultTextStyle?.lineHeight }, "lineSpacing")),
|
|
46
|
+
letterSpacing: _jsx(LetterSpacingAction, { editor: editor }, "letterSpacing"),
|
|
47
|
+
indent: _jsx(IndentAction, { editor: editor }, "indent"),
|
|
48
|
+
outdent: _jsx(OutdentAction, { editor: editor }, "outdent"),
|
|
49
|
+
history: config?.UndoRedo !== false ? _jsx(HistoryAction, { editor: editor }, "history") : null,
|
|
50
|
+
clearFormatting: _jsx(ClearFormattingAction, { editor: editor }, "clearFormatting"),
|
|
51
|
+
}), [
|
|
52
|
+
editor,
|
|
53
|
+
config?.FontFamily?.fonts,
|
|
54
|
+
config?.FontFamily?.fontGroupingFn,
|
|
55
|
+
config?.FontFamily?.groupOrder,
|
|
56
|
+
config?.UnorderedList?.useCustomBullet,
|
|
57
|
+
config?.UndoRedo,
|
|
58
|
+
defaultTextStyle.fontFamily,
|
|
59
|
+
defaultTextStyle.fontSize,
|
|
60
|
+
defaultTextStyle?.lineHeight,
|
|
61
|
+
linkHanlder?.onUpsert,
|
|
62
|
+
smartTagHandler?.onUpsert,
|
|
63
|
+
onChangeFont,
|
|
64
|
+
]);
|
|
65
|
+
// Group actions into rows
|
|
66
|
+
const actionGroups = useMemo(() => {
|
|
67
|
+
if (visibleActions.length === 0) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
// Use default grouping to determine which row each action belongs to
|
|
71
|
+
const row1Actions = DEFAULT_TOOLBAR_GROUPING[0];
|
|
72
|
+
const row2Actions = DEFAULT_TOOLBAR_GROUPING[1];
|
|
73
|
+
const row1 = [];
|
|
74
|
+
const row2 = [];
|
|
75
|
+
visibleActions.forEach(action => {
|
|
76
|
+
if (row1Actions.includes(action)) {
|
|
77
|
+
row1.push(action);
|
|
78
|
+
}
|
|
79
|
+
else if (row2Actions.includes(action)) {
|
|
80
|
+
row2.push(action);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
return [row1, row2].filter(row => row.length > 0);
|
|
84
|
+
}, [visibleActions]);
|
|
85
|
+
// If no visible actions, don't render toolbar
|
|
86
|
+
if (visibleActions.length === 0) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
return (_jsx(ToolbarWrapper, { ref: ref, vertical: true, gap: 20, children: actionGroups.map((group, groupIdx) => (_jsx(Flex, { gap: 15, justify: "flex-start", align: "center", children: group.map(actionName => actionComponentMap[actionName]) }, groupIdx))) }));
|
|
90
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { TextEditorComponentsRender } from '../../types';
|
|
3
|
+
export type LinkPreviewToolbarProps = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
linkHanlder?: {
|
|
6
|
+
onUpsert?: () => void;
|
|
7
|
+
};
|
|
8
|
+
render?: Partial<Pick<TextEditorComponentsRender, 'renderLinkToolbar'>>;
|
|
9
|
+
};
|
|
10
|
+
export declare const LinkPreviewToolbar: (props: LinkPreviewToolbarProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CopyDuplicateIcon, EditIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
3
|
+
import { useEditorState } from '@tiptap/react';
|
|
4
|
+
import { Typography } from 'antd';
|
|
5
|
+
import { ToolbarWrapper } from '../../styled';
|
|
6
|
+
import { isShowLinkToolbar } from '../../utils';
|
|
7
|
+
import { TextEditorButton } from '../Button';
|
|
8
|
+
import { UnsetLinkAction } from './actions';
|
|
9
|
+
import { CUSTOM_LINK_EXTENSION_NAME } from '../../constants';
|
|
10
|
+
export const LinkPreviewToolbar = (props) => {
|
|
11
|
+
const { editor, linkHanlder, render } = props;
|
|
12
|
+
const { showLinkMenu, linkAttrs } = useEditorState({
|
|
13
|
+
editor,
|
|
14
|
+
selector: ctx => ({
|
|
15
|
+
showLinkMenu: isShowLinkToolbar(ctx.editor.state),
|
|
16
|
+
linkAttrs: editor.getAttributes(CUSTOM_LINK_EXTENSION_NAME),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
if (!showLinkMenu) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const href = String(linkAttrs?.href);
|
|
23
|
+
const goToLinkEl = (_jsx(Typography.Link, { style: { maxWidth: 150 }, ellipsis: true, href: href, children: href }));
|
|
24
|
+
const copyLinkEl = (_jsx(TextEditorButton, { icon: _jsx(CopyDuplicateIcon, { size: 18 }), tooltipProps: { title: 'Copy' }, onClick: () => {
|
|
25
|
+
navigator.clipboard.writeText(href);
|
|
26
|
+
} }));
|
|
27
|
+
const editLinkEl = (_jsx(TextEditorButton, { icon: _jsx(EditIcon, { size: 18 }), tooltipProps: { title: 'Edit' }, onClick: () => linkHanlder?.onUpsert?.() }));
|
|
28
|
+
const unsetLinkEl = _jsx(UnsetLinkAction, { editor: editor });
|
|
29
|
+
let linkTools = (_jsxs(_Fragment, { children: [goToLinkEl, copyLinkEl, editLinkEl, unsetLinkEl] }));
|
|
30
|
+
if (render?.renderLinkToolbar && linkAttrs) {
|
|
31
|
+
linkTools = render.renderLinkToolbar(linkAttrs, linkTools, {
|
|
32
|
+
copy: copyLinkEl,
|
|
33
|
+
edit: editLinkEl,
|
|
34
|
+
gotoLink: goToLinkEl,
|
|
35
|
+
unlink: unsetLinkEl,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return (_jsx(ToolbarWrapper, { wrap: "wrap", gap: 8, align: "center", children: linkTools }));
|
|
39
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import { EmojiSmileIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
4
|
-
import { EMOJI_COLLECTIONS
|
|
4
|
+
import { EMOJI_COLLECTIONS } from '@antscorp/antsomi-ui/es/components/molecules/TagifyInput';
|
|
5
|
+
import { EmojiPopover } from '@antscorp/antsomi-ui/es/components/molecules/EmojiPopover';
|
|
5
6
|
import { TextEditorButton } from '../../Button';
|
|
6
7
|
import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
|
|
7
8
|
import { useTextEditorStore } from '../../../provider';
|
|
@@ -16,7 +17,7 @@ export const EmoijiAction = ({ editor }) => {
|
|
|
16
17
|
}),
|
|
17
18
|
});
|
|
18
19
|
const getPopupContainer = useCallback(() => bubbleMenuContainer || document.body, [bubbleMenuContainer]);
|
|
19
|
-
return (_jsx(EmojiPopover, { collections: [
|
|
20
|
+
return (_jsx(EmojiPopover, { isForceHide: true, collections: [
|
|
20
21
|
{
|
|
21
22
|
key: EMOJI_COLLECTIONS.COMMON,
|
|
22
23
|
label: _jsx(EmojiSmileIcon, {}),
|
|
@@ -25,7 +26,7 @@ export const EmoijiAction = ({ editor }) => {
|
|
|
25
26
|
if (typeof emoji !== 'string')
|
|
26
27
|
return;
|
|
27
28
|
editor?.chain().insertEmoji(emoji);
|
|
28
|
-
}, getPopupContainer: getPopupContainer, children: _jsx(TextEditorButton, { disabled: disabled, tooltipProps: {
|
|
29
|
+
}, getPopupContainer: getPopupContainer, destroyTooltipOnHide: true, children: _jsx(TextEditorButton, { disabled: disabled, tooltipProps: {
|
|
29
30
|
title: TOOLTIPS.EMOJI.TITLE,
|
|
30
31
|
}, icon: _jsx(EmojiSmileIcon, { size: 18 }) }) }));
|
|
31
32
|
};
|
|
@@ -14,5 +14,6 @@ export interface FontFamilyActionProps {
|
|
|
14
14
|
groupOrder?: string[] | GroupOrderFunction;
|
|
15
15
|
/** Callback when font selection changes */
|
|
16
16
|
onChange?: (font: FontConfig, weight: number) => void;
|
|
17
|
+
defaultFontFamily?: string;
|
|
17
18
|
}
|
|
18
19
|
export declare const FontFamilyAction: (props: FontFamilyActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { getPrimaryFontFamily } from '@antscorp/antsomi-ui/es/utils';
|
|
|
5
5
|
import { useEditorState } from '@tiptap/react';
|
|
6
6
|
import { useCallback, useEffect, useRef } from 'react';
|
|
7
7
|
export const FontFamilyAction = (props) => {
|
|
8
|
-
const { editor, fonts = DEFAULT_FONT_CONFIGS, onChange, fontGroupingFn, groupOrder } = props;
|
|
8
|
+
const { editor, fonts = DEFAULT_FONT_CONFIGS, onChange, fontGroupingFn, groupOrder, defaultFontFamily, } = props;
|
|
9
9
|
const onChangeRef = useRef();
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
onChangeRef.current = onChange;
|
|
@@ -15,7 +15,7 @@ export const FontFamilyAction = (props) => {
|
|
|
15
15
|
selector: ({ editor: editorInstance }) => {
|
|
16
16
|
const { fontWeight, fontFamily } = editorInstance.getAttributes('textStyle') || {};
|
|
17
17
|
return {
|
|
18
|
-
fontValue: getPrimaryFontFamily(fontFamily),
|
|
18
|
+
fontValue: getPrimaryFontFamily(fontFamily || defaultFontFamily),
|
|
19
19
|
fontWeight: Number(fontWeight),
|
|
20
20
|
};
|
|
21
21
|
},
|
|
@@ -2,22 +2,22 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTextEditorStore } from '../../../provider';
|
|
3
3
|
import { FontSizeInput, } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import { memo, useCallback, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import { useThrottledCallback } from 'use-debounce';
|
|
7
7
|
import { useEditorState } from '@tiptap/react';
|
|
8
8
|
import { toString } from 'lodash';
|
|
9
9
|
import { DEFAULT_TEXT_STYLE } from '../../../constants';
|
|
10
|
-
const StyledFontSizeInput = styled(FontSizeInput) `
|
|
11
|
-
&.antsomi-input-number {
|
|
12
|
-
width: 36px;
|
|
13
|
-
|
|
14
|
-
input.antsomi-input-number-input {
|
|
15
|
-
text-align: center;
|
|
16
|
-
height: 30px;
|
|
17
|
-
padding-inline: 0;
|
|
18
|
-
font-size: 12px;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
10
|
+
const StyledFontSizeInput = styled(FontSizeInput) `
|
|
11
|
+
&.antsomi-input-number {
|
|
12
|
+
width: 36px;
|
|
13
|
+
|
|
14
|
+
input.antsomi-input-number-input {
|
|
15
|
+
text-align: center;
|
|
16
|
+
height: 30px;
|
|
17
|
+
padding-inline: 0;
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
21
|
`;
|
|
22
22
|
export const FontSizeAction = memo(({ editor, throttled = 100, defaultFontSize = DEFAULT_TEXT_STYLE.fontSize, }) => {
|
|
23
23
|
const inputRef = useRef(null);
|
|
@@ -30,6 +30,11 @@ export const FontSizeAction = memo(({ editor, throttled = 100, defaultFontSize =
|
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
32
|
const [currentFontSize, setCurrentFontSize] = useState(numberFontSize);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (numberFontSize) {
|
|
35
|
+
setCurrentFontSize(numberFontSize);
|
|
36
|
+
}
|
|
37
|
+
}, [numberFontSize]);
|
|
33
38
|
const updateEditorFontSize = useThrottledCallback((v) => {
|
|
34
39
|
if (v === numberFontSize)
|
|
35
40
|
return;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { LinkPreviewToolbar, type LinkPreviewToolbarProps } from './LinkPreviewToolbar';
|
|
2
|
+
export { FormattingToolbar, type FormattingToolbarProps } from './FormattingToolbar';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { LinkPreviewToolbar } from './LinkPreviewToolbar';
|
|
2
|
+
export { FormattingToolbar } from './FormattingToolbar';
|
|
@@ -57,3 +57,17 @@ export declare class DocumentStateTracker {
|
|
|
57
57
|
reset(): void;
|
|
58
58
|
}
|
|
59
59
|
export declare function isEntireParagraphSelected(editor: Editor): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Helper function to extract text from atom nodes (emoji, smartTag)
|
|
62
|
+
* Used as leafText callback for doc.textBetween()
|
|
63
|
+
*/
|
|
64
|
+
export declare const getTextFromAtomNode: (node: ProseMirrorNode) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Wrapper for doc.textBetween that automatically handles atom nodes (emoji, smartTag)
|
|
67
|
+
* @param state EditorState
|
|
68
|
+
* @param from Start position
|
|
69
|
+
* @param to End position
|
|
70
|
+
* @param blockSeparator Optional separator between blocks (default: '')
|
|
71
|
+
* @returns Text content including atom nodes
|
|
72
|
+
*/
|
|
73
|
+
export declare const textBetween: (state: EditorState, from: number, to: number, blockSeparator?: string) => string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LIST_EMOJI } from '../extensions/Emoji';
|
|
1
2
|
/**
|
|
2
3
|
* Default configuration for document state detection
|
|
3
4
|
*/
|
|
@@ -122,3 +123,27 @@ export function isEntireParagraphSelected(editor) {
|
|
|
122
123
|
// Kiểm tra xem selection có bao phủ toàn bộ nội dung của paragraph không
|
|
123
124
|
return from === paragraphStart && to === paragraphEnd;
|
|
124
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Helper function to extract text from atom nodes (emoji, smartTag)
|
|
128
|
+
* Used as leafText callback for doc.textBetween()
|
|
129
|
+
*/
|
|
130
|
+
export const getTextFromAtomNode = (node) => {
|
|
131
|
+
if (node.type.name === 'emoji') {
|
|
132
|
+
// Find emoji character from name
|
|
133
|
+
const emojiChar = LIST_EMOJI.find(i => i.name === node.attrs.name)?.emoji;
|
|
134
|
+
return emojiChar || node.attrs.name || '*';
|
|
135
|
+
}
|
|
136
|
+
if (node.type.name === 'smartTag') {
|
|
137
|
+
return node.attrs.content || '*';
|
|
138
|
+
}
|
|
139
|
+
return '*';
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Wrapper for doc.textBetween that automatically handles atom nodes (emoji, smartTag)
|
|
143
|
+
* @param state EditorState
|
|
144
|
+
* @param from Start position
|
|
145
|
+
* @param to End position
|
|
146
|
+
* @param blockSeparator Optional separator between blocks (default: '')
|
|
147
|
+
* @returns Text content including atom nodes
|
|
148
|
+
*/
|
|
149
|
+
export const textBetween = (state, from, to, blockSeparator = '') => state.doc.textBetween(from, to, blockSeparator, getTextFromAtomNode);
|
|
@@ -237,6 +237,64 @@ export function cleanLineBreaks(html) {
|
|
|
237
237
|
return html;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Swaps the structure when a dynamic tag contains only a single link.
|
|
242
|
+
* Changes from: <span data-dynamic><a>text</a></span>
|
|
243
|
+
* To: <a><span data-dynamic>text</span></a>
|
|
244
|
+
*
|
|
245
|
+
* @param html - HTML string to process
|
|
246
|
+
* @returns Processed HTML string with swapped structure
|
|
247
|
+
*/
|
|
248
|
+
function swapDynamicTagWithLink(html) {
|
|
249
|
+
try {
|
|
250
|
+
const parser = new DOMParser();
|
|
251
|
+
const doc = parser.parseFromString(html, 'text/html');
|
|
252
|
+
// Find all dynamic tag spans
|
|
253
|
+
const dynamicSpans = doc.querySelectorAll('span[data-dynamic="true"]');
|
|
254
|
+
dynamicSpans.forEach(dynamicSpan => {
|
|
255
|
+
// Get all child nodes (elements and text nodes)
|
|
256
|
+
const childNodes = Array.from(dynamicSpan.childNodes);
|
|
257
|
+
// Filter out empty text nodes (whitespace only)
|
|
258
|
+
const nonEmptyNodes = childNodes.filter(node => {
|
|
259
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
260
|
+
return node.textContent?.trim() !== '';
|
|
261
|
+
}
|
|
262
|
+
return true;
|
|
263
|
+
});
|
|
264
|
+
// Check if there's exactly one child and it's an <a> element
|
|
265
|
+
if (nonEmptyNodes.length === 1 && nonEmptyNodes[0].nodeType === Node.ELEMENT_NODE) {
|
|
266
|
+
const childElement = nonEmptyNodes[0];
|
|
267
|
+
if (childElement instanceof HTMLElement && childElement.tagName.toLowerCase() === 'a') {
|
|
268
|
+
const linkElement = childElement;
|
|
269
|
+
// Create new span with dynamic attributes
|
|
270
|
+
const newSpan = doc.createElement('span');
|
|
271
|
+
// Copy all attributes from original dynamic span
|
|
272
|
+
Array.from(dynamicSpan.attributes).forEach(attr => {
|
|
273
|
+
newSpan.setAttribute(attr.name, attr.value);
|
|
274
|
+
});
|
|
275
|
+
// Set the text content from the link
|
|
276
|
+
newSpan.textContent = linkElement.textContent;
|
|
277
|
+
// Create new link element
|
|
278
|
+
const newLink = doc.createElement('a');
|
|
279
|
+
// Copy all attributes from original link
|
|
280
|
+
Array.from(linkElement.attributes).forEach(attr => {
|
|
281
|
+
newLink.setAttribute(attr.name, attr.value);
|
|
282
|
+
});
|
|
283
|
+
// Put span inside link
|
|
284
|
+
newLink.appendChild(newSpan);
|
|
285
|
+
// Replace original dynamic span with the new link
|
|
286
|
+
dynamicSpan.replaceWith(newLink);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
return doc.body.innerHTML;
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
// eslint-disable-next-line no-console
|
|
294
|
+
console.error('Error swapping dynamic tag with link:', error);
|
|
295
|
+
return html; // Return original HTML in case of error
|
|
296
|
+
}
|
|
297
|
+
}
|
|
240
298
|
/**
|
|
241
299
|
* Safely parses and processes HTML content for editor use
|
|
242
300
|
* @param html - HTML string to process
|
|
@@ -260,6 +318,8 @@ export function safeParseHTMLContent(params) {
|
|
|
260
318
|
defaultStyle,
|
|
261
319
|
});
|
|
262
320
|
}
|
|
321
|
+
// Swap dynamic tag structure when it contains only a link
|
|
322
|
+
resultHTML = swapDynamicTagWithLink(resultHTML);
|
|
263
323
|
// console.log('after safeParseHTMLContent', resultHTML);
|
|
264
324
|
return resultHTML;
|
|
265
325
|
}
|
|
@@ -78,7 +78,7 @@ export declare const getActiveLinkAttrsFromRange: (params: {
|
|
|
78
78
|
readonly inactiveLinks: import("../types").LinkAttrs[];
|
|
79
79
|
} | undefined;
|
|
80
80
|
/**
|
|
81
|
-
* Extends selection to include full link marks
|
|
81
|
+
* Extends selection to include full link marks and adjacent links with same href
|
|
82
82
|
* @param state EditorState
|
|
83
83
|
* @param from Start position
|
|
84
84
|
* @param to End position
|
|
@@ -93,6 +93,15 @@ export declare const extendSelectionToFullLinks: (state: EditorState, from: numb
|
|
|
93
93
|
to: number;
|
|
94
94
|
linkAttrs: import("../types").LinkAttrs;
|
|
95
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Gets all full link groups in the document (adjacent links with same href are grouped)
|
|
98
|
+
* @param state EditorState
|
|
99
|
+
* @returns Array of link groups with attrs and content
|
|
100
|
+
*/
|
|
101
|
+
export declare const getAllFullLinkGroups: (state: EditorState) => {
|
|
102
|
+
attrs: LinkMarkRange['mark']['attrs'];
|
|
103
|
+
content: string;
|
|
104
|
+
}[];
|
|
96
105
|
/**
|
|
97
106
|
* Handles link actions (create or edit)
|
|
98
107
|
* @param view EditorView instance
|