@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 +1 @@
|
|
|
1
|
-
@use './integrations/AceEditor';
|
|
1
|
+
@use './integrations/AceEditor';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.ace-sqlgen-placeholder {
|
|
2
|
-
display: inline-block;
|
|
3
|
-
cursor: pointer;
|
|
4
|
-
}
|
|
1
|
+
.ace-sqlgen-placeholder {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
export const BarCell = styled.div `
|
|
3
|
-
position: absolute;
|
|
4
|
-
inset: 0;
|
|
5
|
-
background-color: rgba(0, 0, 0, 0.075);
|
|
6
|
-
|
|
7
|
-
.bar-line {
|
|
8
|
-
position: absolute;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
height: 3px;
|
|
11
|
-
width: 100%;
|
|
12
|
-
}
|
|
2
|
+
export const BarCell = styled.div `
|
|
3
|
+
position: absolute;
|
|
4
|
+
inset: 0;
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.075);
|
|
6
|
+
|
|
7
|
+
.bar-line {
|
|
8
|
+
position: absolute;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
height: 3px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
13
|
`;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
export const BarCell = styled.div `
|
|
3
|
-
position: absolute;
|
|
4
|
-
inset: 0;
|
|
5
|
-
background-color: rgba(0, 0, 0, 0.075);
|
|
6
|
-
|
|
7
|
-
.bar-line {
|
|
8
|
-
position: absolute;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
height: 3px;
|
|
11
|
-
width: 100%;
|
|
12
|
-
}
|
|
2
|
+
export const BarCell = styled.div `
|
|
3
|
+
position: absolute;
|
|
4
|
+
inset: 0;
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.075);
|
|
6
|
+
|
|
7
|
+
.bar-line {
|
|
8
|
+
position: absolute;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
height: 3px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
13
|
`;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
export const BarCell = styled.div `
|
|
3
|
-
position: absolute;
|
|
4
|
-
inset: 0;
|
|
5
|
-
background-color: rgba(0, 0, 0, 0.075);
|
|
6
|
-
|
|
7
|
-
.bar-line {
|
|
8
|
-
position: absolute;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
height: 3px;
|
|
11
|
-
width: 100%;
|
|
12
|
-
}
|
|
2
|
+
export const BarCell = styled.div `
|
|
3
|
+
position: absolute;
|
|
4
|
+
inset: 0;
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.075);
|
|
6
|
+
|
|
7
|
+
.bar-line {
|
|
8
|
+
position: absolute;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
height: 3px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
13
|
`;
|
|
14
|
-
export const HeatCell = styled.div `
|
|
15
|
-
position: absolute;
|
|
16
|
-
inset: 0;
|
|
14
|
+
export const HeatCell = styled.div `
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset: 0;
|
|
17
17
|
`;
|
|
18
|
-
export const StyledValue = styled.div `
|
|
19
|
-
position: relative;
|
|
20
|
-
z-index: 1;
|
|
18
|
+
export const StyledValue = styled.div `
|
|
19
|
+
position: relative;
|
|
20
|
+
z-index: 1;
|
|
21
21
|
`;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { Table } from '../Table';
|
|
3
|
-
export const StyledTable = styled(Table) `
|
|
4
|
-
.antsomi-table-thead {
|
|
5
|
-
.antsomi-table-cell {
|
|
6
|
-
background-color: white !important;
|
|
7
|
-
font-weight: 400 !important;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
3
|
+
export const StyledTable = styled(Table) `
|
|
4
|
+
.antsomi-table-thead {
|
|
5
|
+
.antsomi-table-cell {
|
|
6
|
+
background-color: white !important;
|
|
7
|
+
font-weight: 400 !important;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
10
|
`;
|
|
11
|
-
export const StyledHeader = styled.div `
|
|
12
|
-
background-color: #4285f4;
|
|
13
|
-
padding: 8px 10px;
|
|
14
|
-
text-align: right;
|
|
11
|
+
export const StyledHeader = styled.div `
|
|
12
|
+
background-color: #4285f4;
|
|
13
|
+
padding: 8px 10px;
|
|
14
|
+
text-align: right;
|
|
15
15
|
`;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { type TextEditorProviderRefHandler } from './provider';
|
|
3
|
+
import { type TextEditorProps, type TextEditorRef, type TextEditorWithProviderRef } from './types';
|
|
4
|
+
export declare const TextEditor: React.ForwardRefExoticComponent<TextEditorProps & {
|
|
5
|
+
colors?: string[] | undefined;
|
|
6
|
+
onChangeColors?: ((colors: string[]) => void) | undefined;
|
|
7
|
+
} & React.RefAttributes<TextEditorWithProviderRef>> & {
|
|
8
|
+
Provider: React.ForwardRefExoticComponent<import("./provider").TextEditorProviderProps & React.RefAttributes<TextEditorProviderRefHandler>>;
|
|
9
|
+
Internal: React.MemoExoticComponent<React.ForwardRefExoticComponent<TextEditorProps & React.RefAttributes<TextEditorRef>>>;
|
|
10
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ANTSOMI_COMPONENT_PREFIX_CLS } from '@antscorp/antsomi-ui/es/constants';
|
|
3
|
-
import { useDeepCompareMemo } from '@antscorp/antsomi-ui/es/hooks';
|
|
3
|
+
import { useDeepCompareEffect, useDeepCompareMemo } from '@antscorp/antsomi-ui/es/hooks';
|
|
4
4
|
import SubScript from '@tiptap/extension-subscript';
|
|
5
5
|
import Superscript from '@tiptap/extension-superscript';
|
|
6
6
|
import TextAlign from '@tiptap/extension-text-align';
|
|
7
7
|
import { TextStyleKit } from '@tiptap/extension-text-style';
|
|
8
|
-
import { Selection } from '@tiptap/extensions';
|
|
8
|
+
import { Selection, Focus } from '@tiptap/extensions';
|
|
9
9
|
import { useEditor } from '@tiptap/react';
|
|
10
10
|
import StarterKit from '@tiptap/starter-kit';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
|
-
import { isBoolean
|
|
13
|
-
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef, } from 'react';
|
|
12
|
+
import { isBoolean } from 'lodash';
|
|
13
|
+
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, } from 'react';
|
|
14
14
|
import { useDebouncedCallback } from 'use-debounce';
|
|
15
15
|
import { DEFAULT_TEXT_STYLE } from './constants';
|
|
16
16
|
import { BackgroundColor } from './extensions/BackgroundColor';
|
|
@@ -23,29 +23,54 @@ import { Indent } from './extensions/Indent';
|
|
|
23
23
|
import { LetterSpacing } from './extensions/LetterSpacing';
|
|
24
24
|
import { LineHeight } from './extensions/LineHeight';
|
|
25
25
|
import { CustomLink } from './extensions/Link';
|
|
26
|
+
import { CustomListItem } from './extensions/ListItem';
|
|
26
27
|
import { CustomOrderedList } from './extensions/OrderedList';
|
|
27
28
|
import { SmartTag } from './extensions/SmartTag';
|
|
28
29
|
import { TextTransform } from './extensions/TextTransform';
|
|
29
30
|
import { CustomUnorderedList } from './extensions/UnorderedList';
|
|
30
31
|
import { ClearFormatting } from './extensions/ClearFormatting';
|
|
31
|
-
import { useTextEditorStore } from './provider';
|
|
32
|
+
import { TextEditorProvider, useTextEditorStore, } from './provider';
|
|
32
33
|
import { StyledEditorContent } from './styled';
|
|
34
|
+
import { isSmartTagNode, } from './types';
|
|
33
35
|
import { emojiSuggestion } from './ui/Emoji';
|
|
34
|
-
import {
|
|
35
|
-
import { analyzeFont, defaultShouldShowBubbleMenu, handleLinkAction, handleSmartTagAction, isShowLinkToolbar, safeParseHTMLContent, htmlSerializerForOutput, } from './utils';
|
|
36
|
+
import { LinkPreviewToolbar, FormattingToolbar } from './ui/Toolbar';
|
|
37
|
+
import { analyzeFont, defaultShouldShowBubbleMenu, getAllFullLinkGroups, handleLinkAction, handleSmartTagAction, isShowLinkToolbar, safeParseHTMLContent, htmlSerializerForOutput, } from './utils';
|
|
36
38
|
import { BubbleMenu } from './ui/BubbleMenu';
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
39
|
+
import { LinkPopover } from './ui/LinkPopover';
|
|
40
|
+
const TextEditorInternal = memo(forwardRef((props, ref) => {
|
|
41
|
+
const { id, className, config, editable = true, initialContent = '', dataAttributes, onUpdateDebounced = 300, defaultTextStyle: defaultTextStyleProp, linkHandler: outerLinkHandler, smartTagHandler: outerSmartTagHandler, bubbleMenuProps, style, render, onUpdate, onFocus, onCreate, onChangeFont, } = props;
|
|
42
|
+
// Initialize bubbleMenuContainer with default value (document.body)
|
|
43
|
+
// This ensures BubbleMenu receives a valid appendTo prop on first render
|
|
44
|
+
const bubbleMenuContainer = useRef((() => {
|
|
45
|
+
const appendTo = bubbleMenuProps?.appendTo;
|
|
46
|
+
if (!appendTo)
|
|
47
|
+
return document.body;
|
|
48
|
+
return typeof appendTo === 'function' ? appendTo() : appendTo;
|
|
49
|
+
})());
|
|
50
|
+
const linkFormVisible = useTextEditorStore(state => state.linkFormState?.isVisible);
|
|
40
51
|
const setBubbleMenuContainer = useTextEditorStore(state => state.setBubbleMenuContainer);
|
|
52
|
+
const showLinkForm = useTextEditorStore(state => state.showLinkForm);
|
|
41
53
|
const defaultTextStyle = useDeepCompareMemo(() => ({
|
|
42
54
|
...DEFAULT_TEXT_STYLE,
|
|
43
55
|
...defaultTextStyleProp,
|
|
44
56
|
}), [defaultTextStyleProp]);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
const bubbleMenuAppendTo = bubbleMenuProps?.appendTo;
|
|
59
|
+
// Default to document.body when no appendTo is provided
|
|
60
|
+
// This prevents bubble menu from being clipped by overflow containers
|
|
61
|
+
const el = bubbleMenuAppendTo
|
|
62
|
+
? typeof bubbleMenuAppendTo === 'function'
|
|
63
|
+
? bubbleMenuAppendTo()
|
|
64
|
+
: bubbleMenuAppendTo
|
|
65
|
+
: document.body;
|
|
66
|
+
setBubbleMenuContainer(el);
|
|
67
|
+
bubbleMenuContainer.current = el;
|
|
68
|
+
}, [bubbleMenuProps?.appendTo, setBubbleMenuContainer]);
|
|
45
69
|
const handleOnUpdateDebounce = useDebouncedCallback((editor) => {
|
|
46
|
-
const html = editor.getHTML();
|
|
47
70
|
const text = editor.getText();
|
|
48
71
|
const json = editor.getJSON();
|
|
72
|
+
const html = editor.getHTML();
|
|
73
|
+
// console.log(id, { text });
|
|
49
74
|
onUpdate?.({
|
|
50
75
|
html: htmlSerializerForOutput(html),
|
|
51
76
|
text,
|
|
@@ -53,21 +78,40 @@ export const TextEditor = memo(forwardRef((props, ref) => {
|
|
|
53
78
|
});
|
|
54
79
|
}, onUpdateDebounced);
|
|
55
80
|
const contentRef = useRef(null);
|
|
81
|
+
// Compose linkHandler: merge outerLinkHandler with default handlers
|
|
82
|
+
// Allows partial override - user can provide only setNew or only edit
|
|
83
|
+
const linkHandler = useMemo(() => {
|
|
84
|
+
const defaultSetNew = ({ selectionText }) => {
|
|
85
|
+
showLinkForm('insert', {
|
|
86
|
+
url: '',
|
|
87
|
+
text: selectionText,
|
|
88
|
+
openInNewTab: false,
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
const defaultEdit = ({ attrs, selectionText, }) => {
|
|
92
|
+
showLinkForm('edit', {
|
|
93
|
+
url: attrs.href || '',
|
|
94
|
+
text: selectionText,
|
|
95
|
+
openInNewTab: attrs.target === '_blank',
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
return {
|
|
99
|
+
setNew: outerLinkHandler?.setNew || defaultSetNew,
|
|
100
|
+
edit: outerLinkHandler?.edit || defaultEdit,
|
|
101
|
+
};
|
|
102
|
+
}, [outerLinkHandler, showLinkForm]);
|
|
56
103
|
const editor = useEditor({
|
|
57
104
|
extensions: [
|
|
58
105
|
StarterKit.configure({
|
|
59
106
|
link: false,
|
|
60
107
|
bulletList: false,
|
|
61
108
|
orderedList: false,
|
|
62
|
-
listItem:
|
|
63
|
-
|
|
64
|
-
style: 'line-height:normal;',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
undoRedo: {
|
|
109
|
+
listItem: false,
|
|
110
|
+
undoRedo: config?.UndoRedo && {
|
|
68
111
|
depth: 100,
|
|
69
112
|
},
|
|
70
113
|
}),
|
|
114
|
+
CustomListItem,
|
|
71
115
|
CustomUnorderedList,
|
|
72
116
|
CustomOrderedList,
|
|
73
117
|
FontWeight.configure({
|
|
@@ -107,7 +151,12 @@ export const TextEditor = memo(forwardRef((props, ref) => {
|
|
|
107
151
|
Selection.configure({
|
|
108
152
|
className: 'selection',
|
|
109
153
|
}),
|
|
110
|
-
|
|
154
|
+
Focus.configure({
|
|
155
|
+
className: 'has-focused',
|
|
156
|
+
}),
|
|
157
|
+
SmartTag.configure({
|
|
158
|
+
generateSmartTagId: config?.SmartTag?.generateId,
|
|
159
|
+
}),
|
|
111
160
|
TextAlign.configure({
|
|
112
161
|
types: ['heading', 'paragraph'],
|
|
113
162
|
}),
|
|
@@ -121,7 +170,7 @@ export const TextEditor = memo(forwardRef((props, ref) => {
|
|
|
121
170
|
Indent,
|
|
122
171
|
Emoji.configure({
|
|
123
172
|
suggestion: emojiSuggestion({
|
|
124
|
-
container:
|
|
173
|
+
container: bubbleMenuContainer.current,
|
|
125
174
|
}),
|
|
126
175
|
}),
|
|
127
176
|
ClearFormatting.configure({
|
|
@@ -138,9 +187,22 @@ export const TextEditor = memo(forwardRef((props, ref) => {
|
|
|
138
187
|
wrapperElement: contentRef.current.parentElement,
|
|
139
188
|
defaultStyle: defaultTextStyle,
|
|
140
189
|
});
|
|
190
|
+
// console.log(
|
|
191
|
+
// '[ONCREATE] safeParseContent !== initialContent:',
|
|
192
|
+
// safeParseContent !== initialContent,
|
|
193
|
+
// );
|
|
141
194
|
if (safeParseContent !== initialContent) {
|
|
195
|
+
// console.log('[ONCREATE] Calling setContent - this RESETS editor content!');
|
|
142
196
|
editor.commands.setContent(safeParseContent);
|
|
143
197
|
}
|
|
198
|
+
const text = editor.getText();
|
|
199
|
+
const json = editor.getJSON();
|
|
200
|
+
const html = editor.getHTML();
|
|
201
|
+
onCreate?.({
|
|
202
|
+
html: htmlSerializerForOutput(html),
|
|
203
|
+
text,
|
|
204
|
+
json,
|
|
205
|
+
});
|
|
144
206
|
},
|
|
145
207
|
onUpdate: ({ editor }) => {
|
|
146
208
|
handleOnUpdateDebounce(editor);
|
|
@@ -154,7 +216,7 @@ export const TextEditor = memo(forwardRef((props, ref) => {
|
|
|
154
216
|
if (event.ctrlKey && event.key === 'k') {
|
|
155
217
|
// Add this line to prevent browser's default behavior.
|
|
156
218
|
event.preventDefault();
|
|
157
|
-
handleLinkAction(view,
|
|
219
|
+
handleLinkAction(view, linkHandler);
|
|
158
220
|
}
|
|
159
221
|
},
|
|
160
222
|
},
|
|
@@ -183,10 +245,15 @@ export const TextEditor = memo(forwardRef((props, ref) => {
|
|
|
183
245
|
return updatedAttrs;
|
|
184
246
|
})
|
|
185
247
|
.run(), [editor]);
|
|
186
|
-
const
|
|
248
|
+
const shouldShowLinkPreview = useCallback((params) => {
|
|
249
|
+
const { state } = params;
|
|
250
|
+
return isShowLinkToolbar(state);
|
|
251
|
+
}, []);
|
|
252
|
+
const shouldShowFormattingToolbar = useCallback((params) => {
|
|
187
253
|
const { state, view, element } = params;
|
|
254
|
+
// Don't show if link preview is visible
|
|
188
255
|
if (isShowLinkToolbar(state)) {
|
|
189
|
-
return
|
|
256
|
+
return false;
|
|
190
257
|
}
|
|
191
258
|
return defaultShouldShowBubbleMenu({
|
|
192
259
|
state,
|
|
@@ -203,10 +270,25 @@ export const TextEditor = memo(forwardRef((props, ref) => {
|
|
|
203
270
|
editor?.chain().blur().setTextSelection({ from: 0, to: 0 }).run();
|
|
204
271
|
}
|
|
205
272
|
}, [editor]);
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
273
|
+
const handleEachLinkGroup = useCallback(callback => {
|
|
274
|
+
if (!editor)
|
|
275
|
+
return;
|
|
276
|
+
const linkGroups = getAllFullLinkGroups(editor.state);
|
|
277
|
+
linkGroups.forEach(callback);
|
|
278
|
+
}, [editor]);
|
|
279
|
+
const handleEachSmartag = useCallback(callback => {
|
|
280
|
+
if (!editor)
|
|
281
|
+
return;
|
|
282
|
+
const { state } = editor;
|
|
283
|
+
const { doc } = state;
|
|
284
|
+
doc.descendants(node => {
|
|
285
|
+
if (isSmartTagNode(node)) {
|
|
286
|
+
callback(node.attrs);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}, [editor]);
|
|
209
290
|
useImperativeHandle(ref, () => ({
|
|
291
|
+
editor,
|
|
210
292
|
setLink: params => {
|
|
211
293
|
editor?.chain().setCustomLink(params).run();
|
|
212
294
|
},
|
|
@@ -226,33 +308,112 @@ export const TextEditor = memo(forwardRef((props, ref) => {
|
|
|
226
308
|
})
|
|
227
309
|
.run();
|
|
228
310
|
},
|
|
311
|
+
getHTML: () => htmlSerializerForOutput(editor.getHTML()),
|
|
312
|
+
eachLinkGroup: handleEachLinkGroup,
|
|
313
|
+
eachSmartag: handleEachSmartag,
|
|
229
314
|
setSmartTag: handleSetSmartTag,
|
|
230
315
|
deleteSmartTag: handleDeleteSmartTag,
|
|
231
316
|
updateSmartTagAttrs: handleUpdateSmartTagAttrs,
|
|
232
317
|
blur: handleBlur,
|
|
318
|
+
focus() {
|
|
319
|
+
editor.chain().focus().run();
|
|
320
|
+
},
|
|
321
|
+
setContent: editor.commands.setContent,
|
|
233
322
|
style: contentRef.current?.style,
|
|
234
|
-
editor,
|
|
235
323
|
}));
|
|
236
324
|
if (!editor) {
|
|
237
325
|
return null;
|
|
238
326
|
}
|
|
327
|
+
const bubbleMenus = (bubbleMenuProps?.enabled ?? true) ? (_jsxs(_Fragment, { children: [_jsx(LinkPopover, { editor: editor }), !linkFormVisible && (_jsxs(_Fragment, { children: [_jsx(BubbleMenu, { pluginKey: "linkPreviewBubbleMenu", ...bubbleMenuProps, appendTo: bubbleMenuContainer.current, editor: editor, shouldShow: shouldShowLinkPreview, children: _jsx(LinkPreviewToolbar, { editor: editor, linkHanlder: {
|
|
328
|
+
onUpsert: () => {
|
|
329
|
+
handleLinkAction(editor.view, linkHandler);
|
|
330
|
+
},
|
|
331
|
+
}, render: render }) }), _jsx(BubbleMenu, { pluginKey: "formattingBubbleMenu", ...bubbleMenuProps, appendTo: bubbleMenuContainer.current, editor: editor, shouldShow: shouldShowFormattingToolbar, children: _jsx(FormattingToolbar, { config: config, editor: editor, defaultTextStyle: defaultTextStyle, linkHanlder: {
|
|
332
|
+
onUpsert: () => {
|
|
333
|
+
handleLinkAction(editor.view, linkHandler);
|
|
334
|
+
},
|
|
335
|
+
}, smartTagHandler: {
|
|
336
|
+
onUpsert: (event) => {
|
|
337
|
+
handleSmartTagAction(event, editor.view, outerSmartTagHandler);
|
|
338
|
+
},
|
|
339
|
+
}, onChangeFont: ({ font, weight }) => {
|
|
340
|
+
onChangeFont?.({
|
|
341
|
+
font,
|
|
342
|
+
weight,
|
|
343
|
+
analysis: analyzeFont(font),
|
|
344
|
+
});
|
|
345
|
+
} }) })] }))] })) : null;
|
|
239
346
|
return (_jsxs(_Fragment, { children: [_jsx(StyledEditorContent, { className: clsx(`${ANTSOMI_COMPONENT_PREFIX_CLS}-text-editor`, className), "$textStyle": defaultTextStyle, style: {
|
|
240
347
|
// Inline styles apply to inner html elements (support email client)
|
|
241
|
-
...
|
|
348
|
+
...defaultTextStyle,
|
|
242
349
|
...style,
|
|
243
|
-
}, id: id, ref: contentRef, editor: editor, ...dataAttributes }),
|
|
244
|
-
onUpsert: () => {
|
|
245
|
-
handleLinkAction(editor.view, outerLinkHandler);
|
|
246
|
-
},
|
|
247
|
-
}, smartTagHandler: {
|
|
248
|
-
onUpsert: (event) => {
|
|
249
|
-
handleSmartTagAction(event, editor.view, outerSmartTagHandler);
|
|
250
|
-
},
|
|
251
|
-
}, render: render, onChangeFont: ({ font, weight }) => {
|
|
252
|
-
onChangeFont?.({
|
|
253
|
-
font,
|
|
254
|
-
weight,
|
|
255
|
-
analysis: analyzeFont(font),
|
|
256
|
-
});
|
|
257
|
-
} })) })] }));
|
|
350
|
+
}, id: id, ref: contentRef, editor: editor, ...dataAttributes }), bubbleMenus] }));
|
|
258
351
|
}));
|
|
352
|
+
TextEditorInternal.displayName = 'TextEditorInternal';
|
|
353
|
+
const TextEditorWithProvider = forwardRef((props, ref) => {
|
|
354
|
+
const { colors, onChangeColors, ...editorProps } = props;
|
|
355
|
+
const providerRef = useRef(null);
|
|
356
|
+
const editorRef = useRef(null);
|
|
357
|
+
// Sync external colors to internal store
|
|
358
|
+
useDeepCompareEffect(() => {
|
|
359
|
+
if (colors !== undefined) {
|
|
360
|
+
providerRef.current?.updateColors?.(colors);
|
|
361
|
+
}
|
|
362
|
+
}, [colors]);
|
|
363
|
+
useImperativeHandle(ref, () => ({
|
|
364
|
+
// Forward TextEditorRef methods - accessed at call time
|
|
365
|
+
get editor() {
|
|
366
|
+
return editorRef.current?.editor;
|
|
367
|
+
},
|
|
368
|
+
get style() {
|
|
369
|
+
return editorRef.current?.style;
|
|
370
|
+
},
|
|
371
|
+
get getHTML() {
|
|
372
|
+
return editorRef.current.getHTML;
|
|
373
|
+
},
|
|
374
|
+
get setLink() {
|
|
375
|
+
return editorRef.current.setLink;
|
|
376
|
+
},
|
|
377
|
+
get deleteLink() {
|
|
378
|
+
return editorRef.current.deleteLink;
|
|
379
|
+
},
|
|
380
|
+
get updateLinkAttrs() {
|
|
381
|
+
return editorRef.current.updateLinkAttrs;
|
|
382
|
+
},
|
|
383
|
+
get updateLinkText() {
|
|
384
|
+
return editorRef.current.updateLinkText;
|
|
385
|
+
},
|
|
386
|
+
get eachLinkGroup() {
|
|
387
|
+
return editorRef.current.eachLinkGroup;
|
|
388
|
+
},
|
|
389
|
+
get eachSmartag() {
|
|
390
|
+
return editorRef.current.eachSmartag;
|
|
391
|
+
},
|
|
392
|
+
get setSmartTag() {
|
|
393
|
+
return editorRef.current.setSmartTag;
|
|
394
|
+
},
|
|
395
|
+
get deleteSmartTag() {
|
|
396
|
+
return editorRef.current.deleteSmartTag;
|
|
397
|
+
},
|
|
398
|
+
get updateSmartTagAttrs() {
|
|
399
|
+
return editorRef.current.updateSmartTagAttrs;
|
|
400
|
+
},
|
|
401
|
+
get blur() {
|
|
402
|
+
return editorRef.current.blur;
|
|
403
|
+
},
|
|
404
|
+
get focus() {
|
|
405
|
+
return editorRef.current.focus;
|
|
406
|
+
},
|
|
407
|
+
get setContent() {
|
|
408
|
+
return editorRef.current.setContent;
|
|
409
|
+
},
|
|
410
|
+
// Forward TextEditorProviderRefHandler methods
|
|
411
|
+
updateColors: colors => providerRef.current?.updateColors?.(colors),
|
|
412
|
+
}), []);
|
|
413
|
+
return (_jsx(TextEditorProvider, { ref: providerRef, colors: colors, onChangeColors: onChangeColors, children: _jsx(TextEditorInternal, { ...editorProps, ref: editorRef }) }));
|
|
414
|
+
});
|
|
415
|
+
TextEditorWithProvider.displayName = 'TextEditorWithProvider';
|
|
416
|
+
export const TextEditor = Object.assign(TextEditorWithProvider, {
|
|
417
|
+
Provider: TextEditorProvider,
|
|
418
|
+
Internal: TextEditorInternal,
|
|
419
|
+
});
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import SETTINGS from './text-block.settings.json';
|
|
2
|
-
const CONTENT_WITH_INHERITED_STYLES = `
|
|
3
|
-
<div class="fr-box" role="application">
|
|
4
|
-
<div class="fr-wrapper" dir="auto">
|
|
5
|
-
<div class="fr-element fr-view" dir="auto" contenteditable="true" aria-disabled="false" spellcheck="true">
|
|
6
|
-
<p style="text-align: center;">
|
|
7
|
-
<span style="font-family: Montserrat; font-size: 22px; letter-spacing: 0px; color: rgb(0, 0, 0);">
|
|
8
|
-
<span id="isPasted" style="font-weight: 800; font-size: 34px; line-height: inherit; font-family: Montserrat; letter-spacing: 0px; text-align: center; text-transform: none; color: rgb(77, 96, 116);">Receive </span>
|
|
9
|
-
<span style="font-weight: 400; font-size: 34px; line-height: inherit; font-family: Montserrat; color: rgb(0, 0, 0); letter-spacing: normal; text-align: center; text-transform: none;">
|
|
10
|
-
<span style="font-weight: 800; font-size: inherit; line-height: inherit; font-family: Montserrat; letter-spacing: 0px; color: rgb(255, 79, 66);"><u>10% Off</u></span>
|
|
11
|
-
</span>
|
|
12
|
-
<span style="font-weight: 800; font-size: 34px; line-height: inherit; font-family: Montserrat; letter-spacing: 0px; text-align: center; text-transform: none; color: rgb(77, 96, 116);"> Your First Order!</span>
|
|
13
|
-
</span>
|
|
14
|
-
</p>
|
|
15
|
-
</div>
|
|
16
|
-
<span class="fr-placeholder" style="font-size: 12px; line-height: 12px; margin-top: 0px; padding-top: 0px; padding-left: 0px; margin-left: 0px; padding-right: 0px; margin-right: 0px; text-align: left;">Enter your text here</span>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
2
|
+
const CONTENT_WITH_INHERITED_STYLES = `
|
|
3
|
+
<div class="fr-box" role="application">
|
|
4
|
+
<div class="fr-wrapper" dir="auto">
|
|
5
|
+
<div class="fr-element fr-view" dir="auto" contenteditable="true" aria-disabled="false" spellcheck="true">
|
|
6
|
+
<p style="text-align: center;">
|
|
7
|
+
<span style="font-family: Montserrat; font-size: 22px; letter-spacing: 0px; color: rgb(0, 0, 0);">
|
|
8
|
+
<span id="isPasted" style="font-weight: 800; font-size: 34px; line-height: inherit; font-family: Montserrat; letter-spacing: 0px; text-align: center; text-transform: none; color: rgb(77, 96, 116);">Receive </span>
|
|
9
|
+
<span style="font-weight: 400; font-size: 34px; line-height: inherit; font-family: Montserrat; color: rgb(0, 0, 0); letter-spacing: normal; text-align: center; text-transform: none;">
|
|
10
|
+
<span style="font-weight: 800; font-size: inherit; line-height: inherit; font-family: Montserrat; letter-spacing: 0px; color: rgb(255, 79, 66);"><u>10% Off</u></span>
|
|
11
|
+
</span>
|
|
12
|
+
<span style="font-weight: 800; font-size: 34px; line-height: inherit; font-family: Montserrat; letter-spacing: 0px; text-align: center; text-transform: none; color: rgb(77, 96, 116);"> Your First Order!</span>
|
|
13
|
+
</span>
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
<span class="fr-placeholder" style="font-size: 12px; line-height: 12px; margin-top: 0px; padding-top: 0px; padding-left: 0px; margin-left: 0px; padding-right: 0px; margin-right: 0px; text-align: left;">Enter your text here</span>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
19
|
`;
|
|
20
|
-
export const HTML_DOM = `<!doctype html>
|
|
21
|
-
<html lang="en">
|
|
22
|
-
<head>
|
|
23
|
-
<meta charset="UTF-8" />
|
|
24
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
25
|
-
<title>Raw HTML</title>
|
|
26
|
-
</head>
|
|
27
|
-
<body>
|
|
28
|
-
<p><span style="line-height: 100%;"><span style="font-family: Arial, sans-serif; font-size: 14px; letter-spacing: 0px;">Dear </span><span style="font-family: Arial, sans-serif; font-size: 14px; letter-spacing: 0px; font-weight: 600; color: rgb(85, 85, 85);"><span data-dynamic="true" data-dynamic-id="zfs1gvrr" style="direction: unset; unicode-bidi: bidi-override; text-align: right; background-color: rgba(0, 199, 97, 0.2);">Email</span></span><span style="font-family: Arial, sans-serif; font-size: 14px; letter-spacing: 0px;">,</span></span></p>
|
|
29
|
-
<p><span style="font-size: 14px;"><br></span></p>
|
|
30
|
-
<p></p>
|
|
31
|
-
<p><span style="font-family: Arial, sans-serif; font-size: 14px; line-height: 100%; letter-spacing: 0px;">Here's a roundup of our top health and fitness stories from the past two weeks.</span></p>
|
|
32
|
-
|
|
33
|
-
<p><span style="font-family: Arial, sans-serif; font-size: 16px; line-height: 100%; letter-spacing: 0px;">Your Special Bonus Offer Has Been Unlocked</span></p>
|
|
34
|
-
<p><br></p>
|
|
35
|
-
<p><br></p>
|
|
36
|
-
<p><br></p>
|
|
37
|
-
<p><br></p>
|
|
38
|
-
<p><br></p>
|
|
39
|
-
<p><br></p>
|
|
40
|
-
<p><span style="font-family: Arial, sans-serif; font-size: 16px; line-height: 100%; letter-spacing: 0px;">fasdfasdf</span></p>
|
|
41
|
-
|
|
42
|
-
${SETTINGS.settings.rawHTML}
|
|
43
|
-
|
|
44
|
-
${CONTENT_WITH_INHERITED_STYLES}
|
|
45
|
-
</body>
|
|
46
|
-
</html>
|
|
20
|
+
export const HTML_DOM = `<!doctype html>
|
|
21
|
+
<html lang="en">
|
|
22
|
+
<head>
|
|
23
|
+
<meta charset="UTF-8" />
|
|
24
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
25
|
+
<title>Raw HTML</title>
|
|
26
|
+
</head>
|
|
27
|
+
<body>
|
|
28
|
+
<p><span style="line-height: 100%;"><span style="font-family: Arial, sans-serif; font-size: 14px; letter-spacing: 0px;">Dear </span><span style="font-family: Arial, sans-serif; font-size: 14px; letter-spacing: 0px; font-weight: 600; color: rgb(85, 85, 85);"><span data-dynamic="true" data-dynamic-id="zfs1gvrr" style="direction: unset; unicode-bidi: bidi-override; text-align: right; background-color: rgba(0, 199, 97, 0.2);">Email</span></span><span style="font-family: Arial, sans-serif; font-size: 14px; letter-spacing: 0px;">,</span></span></p>
|
|
29
|
+
<p><span style="font-size: 14px;"><br></span></p>
|
|
30
|
+
<p></p>
|
|
31
|
+
<p><span style="font-family: Arial, sans-serif; font-size: 14px; line-height: 100%; letter-spacing: 0px;">Here's a roundup of our top health and fitness stories from the past two weeks.</span></p>
|
|
32
|
+
|
|
33
|
+
<p><span style="font-family: Arial, sans-serif; font-size: 16px; line-height: 100%; letter-spacing: 0px;">Your Special Bonus Offer Has Been Unlocked</span></p>
|
|
34
|
+
<p><br></p>
|
|
35
|
+
<p><br></p>
|
|
36
|
+
<p><br></p>
|
|
37
|
+
<p><br></p>
|
|
38
|
+
<p><br></p>
|
|
39
|
+
<p><br></p>
|
|
40
|
+
<p><span style="font-family: Arial, sans-serif; font-size: 16px; line-height: 100%; letter-spacing: 0px;">fasdfasdf</span></p>
|
|
41
|
+
|
|
42
|
+
${SETTINGS.settings.rawHTML}
|
|
43
|
+
|
|
44
|
+
${CONTENT_WITH_INHERITED_STYLES}
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
|
47
47
|
`;
|
|
@@ -185,3 +185,12 @@ export declare const DEFAULT_FONT_GROUPING: {
|
|
|
185
185
|
readonly label: "Non-standard";
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
|
+
/**
|
|
189
|
+
* All available toolbar actions in default order
|
|
190
|
+
*/
|
|
191
|
+
export declare const ALL_TOOLBAR_ACTIONS: readonly ["fontFamily", "fontSize", "bold", "italic", "underline", "link", "strike", "superscript", "subscript", "textTransform", "textColor", "backgroundColor", "emoji", "smartTag", "bulletList", "orderedList", "textAlign", "lineSpacing", "letterSpacing", "indent", "outdent", "history", "clearFormatting"];
|
|
192
|
+
/**
|
|
193
|
+
* Default grouping of toolbar actions into rows
|
|
194
|
+
*/
|
|
195
|
+
export declare const DEFAULT_TOOLBAR_GROUPING: readonly [readonly ["fontFamily", "fontSize", "bold", "italic", "underline", "link", "strike", "superscript", "subscript", "textTransform", "textColor", "backgroundColor", "emoji", "smartTag"], readonly ["bulletList", "orderedList", "textAlign", "lineSpacing", "letterSpacing", "indent", "outdent", "history", "clearFormatting"]];
|
|
196
|
+
export declare const ATTR_WHITESPACE: RegExp;
|