@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
|
@@ -330,3 +330,69 @@ export const DEFAULT_FONT_GROUPING = {
|
|
|
330
330
|
label: 'Non-standard',
|
|
331
331
|
},
|
|
332
332
|
};
|
|
333
|
+
/**
|
|
334
|
+
* All available toolbar actions in default order
|
|
335
|
+
*/
|
|
336
|
+
export const ALL_TOOLBAR_ACTIONS = [
|
|
337
|
+
// Row 1: Text formatting and styling
|
|
338
|
+
'fontFamily',
|
|
339
|
+
'fontSize',
|
|
340
|
+
'bold',
|
|
341
|
+
'italic',
|
|
342
|
+
'underline',
|
|
343
|
+
'link',
|
|
344
|
+
'strike',
|
|
345
|
+
'superscript',
|
|
346
|
+
'subscript',
|
|
347
|
+
'textTransform',
|
|
348
|
+
'textColor',
|
|
349
|
+
'backgroundColor',
|
|
350
|
+
'emoji',
|
|
351
|
+
'smartTag',
|
|
352
|
+
// Row 2: Lists, alignment, and utilities
|
|
353
|
+
'bulletList',
|
|
354
|
+
'orderedList',
|
|
355
|
+
'textAlign',
|
|
356
|
+
'lineSpacing',
|
|
357
|
+
'letterSpacing',
|
|
358
|
+
'indent',
|
|
359
|
+
'outdent',
|
|
360
|
+
'history',
|
|
361
|
+
'clearFormatting',
|
|
362
|
+
];
|
|
363
|
+
/**
|
|
364
|
+
* Default grouping of toolbar actions into rows
|
|
365
|
+
*/
|
|
366
|
+
export const DEFAULT_TOOLBAR_GROUPING = [
|
|
367
|
+
// Row 1
|
|
368
|
+
[
|
|
369
|
+
'fontFamily',
|
|
370
|
+
'fontSize',
|
|
371
|
+
'bold',
|
|
372
|
+
'italic',
|
|
373
|
+
'underline',
|
|
374
|
+
'link',
|
|
375
|
+
'strike',
|
|
376
|
+
'superscript',
|
|
377
|
+
'subscript',
|
|
378
|
+
'textTransform',
|
|
379
|
+
'textColor',
|
|
380
|
+
'backgroundColor',
|
|
381
|
+
'emoji',
|
|
382
|
+
'smartTag',
|
|
383
|
+
],
|
|
384
|
+
// Row 2
|
|
385
|
+
[
|
|
386
|
+
'bulletList',
|
|
387
|
+
'orderedList',
|
|
388
|
+
'textAlign',
|
|
389
|
+
'lineSpacing',
|
|
390
|
+
'letterSpacing',
|
|
391
|
+
'indent',
|
|
392
|
+
'outdent',
|
|
393
|
+
'history',
|
|
394
|
+
'clearFormatting',
|
|
395
|
+
],
|
|
396
|
+
];
|
|
397
|
+
// eslint-disable-next-line no-control-regex
|
|
398
|
+
export const ATTR_WHITESPACE = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;
|
|
@@ -1,140 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
|
1
|
+
import type { EditorState } from '@tiptap/pm/state';
|
|
2
|
+
import { BubbleMenuView as TiptapBubbleMenuView } from '@tiptap/extension-bubble-menu';
|
|
3
|
+
import { Plugin } from '@tiptap/pm/state';
|
|
5
4
|
import type { EditorView } from '@tiptap/pm/view';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* The plugin key.
|
|
9
|
-
* @type {PluginKey | string}
|
|
10
|
-
* @default 'bubbleMenu'
|
|
11
|
-
*/
|
|
12
|
-
pluginKey: PluginKey | string;
|
|
13
|
-
/**
|
|
14
|
-
* The editor instance.
|
|
15
|
-
*/
|
|
16
|
-
editor: Editor;
|
|
17
|
-
/**
|
|
18
|
-
* The DOM element that contains your menu.
|
|
19
|
-
* @type {HTMLElement}
|
|
20
|
-
* @default null
|
|
21
|
-
*/
|
|
22
|
-
element: HTMLElement;
|
|
23
|
-
container?: HTMLElement | (() => HTMLElement) | null;
|
|
24
|
-
/**
|
|
25
|
-
* The delay in milliseconds before the menu should be updated.
|
|
26
|
-
* This can be useful to prevent performance issues.
|
|
27
|
-
* @type {number}
|
|
28
|
-
* @default 250
|
|
29
|
-
*/
|
|
30
|
-
updateDelay?: number;
|
|
31
|
-
/**
|
|
32
|
-
* The delay in milliseconds before the menu position should be updated on window resize.
|
|
33
|
-
* This can be useful to prevent performance issues.
|
|
34
|
-
* @type {number}
|
|
35
|
-
* @default 60
|
|
36
|
-
*/
|
|
37
|
-
resizeDelay?: number;
|
|
38
|
-
/**
|
|
39
|
-
* A function that determines whether the menu should be shown or not.
|
|
40
|
-
* If this function returns `false`, the menu will be hidden, otherwise it will be shown.
|
|
41
|
-
*/
|
|
42
|
-
shouldShow?: ((props: {
|
|
43
|
-
editor: Editor;
|
|
44
|
-
element: HTMLElement;
|
|
45
|
-
view: EditorView;
|
|
46
|
-
state: EditorState;
|
|
47
|
-
oldState?: EditorState;
|
|
48
|
-
from: number;
|
|
49
|
-
to: number;
|
|
50
|
-
}) => boolean) | null;
|
|
51
|
-
/**
|
|
52
|
-
* The options for the bubble menu. Those are passed to Floating UI and include options for the placement, offset, flip, shift, arrow, size, autoPlacement,
|
|
53
|
-
* hide, and inline middlewares.
|
|
54
|
-
* @default {}
|
|
55
|
-
* @see https://floating-ui.com/docs/computePosition#options
|
|
56
|
-
*/
|
|
57
|
-
options?: {
|
|
58
|
-
strategy?: 'absolute' | 'fixed';
|
|
59
|
-
placement?: 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
|
60
|
-
offset?: Parameters<typeof offset>[0] | boolean;
|
|
61
|
-
flip?: Parameters<typeof flip>[0] | boolean;
|
|
62
|
-
shift?: Parameters<typeof shift>[0] | boolean;
|
|
63
|
-
arrow?: Parameters<typeof arrow>[0] | false;
|
|
64
|
-
size?: Parameters<typeof size>[0] | boolean;
|
|
65
|
-
autoPlacement?: Parameters<typeof autoPlacement>[0] | boolean;
|
|
66
|
-
hide?: Parameters<typeof hide>[0] | boolean;
|
|
67
|
-
inline?: Parameters<typeof inline>[0] | boolean;
|
|
68
|
-
onShow?: () => void;
|
|
69
|
-
onHide?: () => void;
|
|
70
|
-
onUpdate?: () => void;
|
|
71
|
-
onDestroy?: () => void;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
export type BubbleMenuViewProps = BubbleMenuPluginProps & {
|
|
75
|
-
view: EditorView;
|
|
76
|
-
};
|
|
77
|
-
export declare class BubbleMenuView implements PluginView {
|
|
78
|
-
editor: Editor;
|
|
79
|
-
element: HTMLElement;
|
|
80
|
-
container?: HTMLElement | (() => HTMLElement) | null;
|
|
81
|
-
view: EditorView;
|
|
82
|
-
preventHide: boolean;
|
|
83
|
-
updateDelay: number;
|
|
84
|
-
resizeDelay: number;
|
|
85
|
-
private updateDebounceTimer;
|
|
86
|
-
private resizeDebounceTimer;
|
|
5
|
+
import type { BubbleMenuPluginProps, BubbleMenuViewProps } from '@tiptap/extension-bubble-menu';
|
|
6
|
+
export declare class BubbleMenuView extends TiptapBubbleMenuView {
|
|
87
7
|
private resizeObserver;
|
|
88
|
-
|
|
89
|
-
private floatingUIOptions;
|
|
90
|
-
shouldShow: Exclude<BubbleMenuPluginProps['shouldShow'], null>;
|
|
91
|
-
get middlewares(): {
|
|
92
|
-
name: string;
|
|
93
|
-
options?: any;
|
|
94
|
-
fn: (state: {
|
|
95
|
-
x: number;
|
|
96
|
-
y: number;
|
|
97
|
-
platform: import("@floating-ui/core").Platform;
|
|
98
|
-
placement: import("@floating-ui/utils").Placement;
|
|
99
|
-
initialPlacement: import("@floating-ui/utils").Placement;
|
|
100
|
-
strategy: import("@floating-ui/utils").Strategy;
|
|
101
|
-
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
102
|
-
rects: import("@floating-ui/utils").ElementRects;
|
|
103
|
-
elements: import("@floating-ui/dom").Elements;
|
|
104
|
-
}) => import("@floating-ui/core").MiddlewareReturn | Promise<import("@floating-ui/core").MiddlewareReturn>;
|
|
105
|
-
}[];
|
|
106
|
-
constructor({ editor, element, view, updateDelay, resizeDelay, container, shouldShow, options, }: BubbleMenuViewProps);
|
|
107
|
-
mousedownHandler: () => void;
|
|
108
|
-
dragstartHandler: () => void;
|
|
109
|
-
/**
|
|
110
|
-
* Handles the window resize event and element resize event to update the position of the bubble menu.
|
|
111
|
-
* It uses a debounce mechanism to prevent excessive updates.
|
|
112
|
-
* The delay is defined by the `resizeDelay` property.
|
|
113
|
-
*/
|
|
114
|
-
resizeHandler: (delay?: number) => void;
|
|
115
|
-
/**
|
|
116
|
-
* Window resize handler that uses the default resize delay.
|
|
117
|
-
* This is a separate function to maintain the same reference for addEventListener/removeEventListener.
|
|
118
|
-
*/
|
|
119
|
-
windowResizeHandler: () => void;
|
|
8
|
+
constructor(props: BubbleMenuViewProps);
|
|
120
9
|
/**
|
|
121
10
|
* Sets up ResizeObserver to watch for bubble menu element size changes.
|
|
122
11
|
* This ensures the bubble menu position is updated when the element resizes
|
|
123
12
|
* due to React component rendering different children, not just when the window resizes.
|
|
124
13
|
*/
|
|
125
14
|
setupResizeObserver: () => void;
|
|
126
|
-
focusHandler: () => void;
|
|
127
|
-
blurHandler: ({ event }: {
|
|
128
|
-
event: FocusEvent;
|
|
129
|
-
}) => void;
|
|
130
|
-
updatePosition(): void;
|
|
131
|
-
update(view: EditorView, oldState?: EditorState): void;
|
|
132
|
-
handleDebouncedUpdate: (view: EditorView, oldState?: EditorState) => void;
|
|
133
|
-
getShouldShow(oldState?: EditorState): boolean | undefined;
|
|
134
15
|
updateHandler: (view: EditorView, selectionChanged: boolean, docChanged: boolean, oldState?: EditorState) => void;
|
|
135
|
-
private getContainer;
|
|
136
|
-
show(): void;
|
|
137
|
-
hide(): void;
|
|
138
16
|
destroy(): void;
|
|
139
17
|
}
|
|
140
18
|
export declare const BubbleMenuPlugin: (options: BubbleMenuPluginProps) => Plugin<any>;
|
|
@@ -1,123 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isTextSelection, posToDOMRect } from '@tiptap/core';
|
|
1
|
+
import { BubbleMenuView as TiptapBubbleMenuView } from '@tiptap/extension-bubble-menu';
|
|
3
2
|
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const bottom = Math.max(rect1.bottom, rect2.bottom);
|
|
8
|
-
const left = Math.min(rect1.left, rect2.left);
|
|
9
|
-
const right = Math.max(rect1.right, rect2.right);
|
|
10
|
-
const width = right - left;
|
|
11
|
-
const height = bottom - top;
|
|
12
|
-
const x = left;
|
|
13
|
-
const y = top;
|
|
14
|
-
return new DOMRect(x, y, width, height);
|
|
15
|
-
}
|
|
16
|
-
export class BubbleMenuView {
|
|
17
|
-
get middlewares() {
|
|
18
|
-
const middlewares = [];
|
|
19
|
-
if (this.floatingUIOptions.flip) {
|
|
20
|
-
middlewares.push(flip(typeof this.floatingUIOptions.flip !== 'boolean'
|
|
21
|
-
? this.floatingUIOptions.flip
|
|
22
|
-
: undefined));
|
|
23
|
-
}
|
|
24
|
-
if (this.floatingUIOptions.shift) {
|
|
25
|
-
middlewares.push(shift(typeof this.floatingUIOptions.shift !== 'boolean'
|
|
26
|
-
? this.floatingUIOptions.shift
|
|
27
|
-
: undefined));
|
|
28
|
-
}
|
|
29
|
-
if (this.floatingUIOptions.offset) {
|
|
30
|
-
middlewares.push(offset(typeof this.floatingUIOptions.offset !== 'boolean'
|
|
31
|
-
? this.floatingUIOptions.offset
|
|
32
|
-
: undefined));
|
|
33
|
-
}
|
|
34
|
-
if (this.floatingUIOptions.arrow) {
|
|
35
|
-
middlewares.push(arrow(this.floatingUIOptions.arrow));
|
|
36
|
-
}
|
|
37
|
-
if (this.floatingUIOptions.size) {
|
|
38
|
-
middlewares.push(size(typeof this.floatingUIOptions.size !== 'boolean'
|
|
39
|
-
? this.floatingUIOptions.size
|
|
40
|
-
: undefined));
|
|
41
|
-
}
|
|
42
|
-
if (this.floatingUIOptions.autoPlacement) {
|
|
43
|
-
middlewares.push(autoPlacement(typeof this.floatingUIOptions.autoPlacement !== 'boolean'
|
|
44
|
-
? this.floatingUIOptions.autoPlacement
|
|
45
|
-
: undefined));
|
|
46
|
-
}
|
|
47
|
-
if (this.floatingUIOptions.hide) {
|
|
48
|
-
middlewares.push(hide(typeof this.floatingUIOptions.hide !== 'boolean'
|
|
49
|
-
? this.floatingUIOptions.hide
|
|
50
|
-
: undefined));
|
|
51
|
-
}
|
|
52
|
-
if (this.floatingUIOptions.inline) {
|
|
53
|
-
middlewares.push(inline(typeof this.floatingUIOptions.inline !== 'boolean'
|
|
54
|
-
? this.floatingUIOptions.inline
|
|
55
|
-
: undefined));
|
|
56
|
-
}
|
|
57
|
-
return middlewares;
|
|
58
|
-
}
|
|
59
|
-
constructor({ editor, element, view, updateDelay = 250, resizeDelay = 60, container, shouldShow, options, }) {
|
|
60
|
-
this.preventHide = false;
|
|
61
|
-
this.isVisible = false;
|
|
62
|
-
this.floatingUIOptions = {
|
|
63
|
-
strategy: 'absolute',
|
|
64
|
-
placement: 'top',
|
|
65
|
-
offset: 8,
|
|
66
|
-
flip: {},
|
|
67
|
-
shift: {},
|
|
68
|
-
arrow: false,
|
|
69
|
-
size: false,
|
|
70
|
-
autoPlacement: false,
|
|
71
|
-
hide: false,
|
|
72
|
-
inline: false,
|
|
73
|
-
onShow: undefined,
|
|
74
|
-
onHide: undefined,
|
|
75
|
-
onUpdate: undefined,
|
|
76
|
-
onDestroy: undefined,
|
|
77
|
-
};
|
|
78
|
-
this.shouldShow = ({ view, state, from, to, }) => {
|
|
79
|
-
const { doc, selection } = state;
|
|
80
|
-
const { empty } = selection;
|
|
81
|
-
// Sometime check for `empty` is not enough.
|
|
82
|
-
// Doubleclick an empty paragraph returns a node size of 2.
|
|
83
|
-
// So we check also for an empty text size.
|
|
84
|
-
const isEmptyTextBlock = !doc.textBetween(from, to).length && isTextSelection(state.selection);
|
|
85
|
-
// When clicking on a element inside the bubble menu the editor "blur" event
|
|
86
|
-
// is called and the bubble menu item is focussed. In this case we should
|
|
87
|
-
// consider the menu as part of the editor and keep showing the menu
|
|
88
|
-
const isChildOfMenu = this.element.contains(document.activeElement);
|
|
89
|
-
const hasEditorFocus = view.hasFocus() || isChildOfMenu;
|
|
90
|
-
if (!hasEditorFocus || empty || isEmptyTextBlock || !this.editor.isEditable) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
94
|
-
};
|
|
95
|
-
this.mousedownHandler = () => {
|
|
96
|
-
this.preventHide = true;
|
|
97
|
-
};
|
|
98
|
-
this.dragstartHandler = () => {
|
|
99
|
-
this.hide();
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Handles the window resize event and element resize event to update the position of the bubble menu.
|
|
103
|
-
* It uses a debounce mechanism to prevent excessive updates.
|
|
104
|
-
* The delay is defined by the `resizeDelay` property.
|
|
105
|
-
*/
|
|
106
|
-
this.resizeHandler = (delay = this.resizeDelay) => {
|
|
107
|
-
if (this.resizeDebounceTimer) {
|
|
108
|
-
clearTimeout(this.resizeDebounceTimer);
|
|
109
|
-
}
|
|
110
|
-
this.resizeDebounceTimer = window.setTimeout(() => {
|
|
111
|
-
this.updatePosition();
|
|
112
|
-
}, delay);
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Window resize handler that uses the default resize delay.
|
|
116
|
-
* This is a separate function to maintain the same reference for addEventListener/removeEventListener.
|
|
117
|
-
*/
|
|
118
|
-
this.windowResizeHandler = () => {
|
|
119
|
-
this.resizeHandler();
|
|
120
|
-
};
|
|
3
|
+
export class BubbleMenuView extends TiptapBubbleMenuView {
|
|
4
|
+
constructor(props) {
|
|
5
|
+
super(props);
|
|
121
6
|
/**
|
|
122
7
|
* Sets up ResizeObserver to watch for bubble menu element size changes.
|
|
123
8
|
* This ensures the bubble menu position is updated when the element resizes
|
|
@@ -131,7 +16,7 @@ export class BubbleMenuView {
|
|
|
131
16
|
// Timer for debouncing the visibility restoration after resize
|
|
132
17
|
let resizeTimer = null;
|
|
133
18
|
// Time to wait before showing the element again after resize stops
|
|
134
|
-
const DEBOUNCE_TIME =
|
|
19
|
+
const DEBOUNCE_TIME = this.resizeDelay + 50;
|
|
135
20
|
this.resizeObserver = new ResizeObserver(entries => {
|
|
136
21
|
for (const entry of entries) {
|
|
137
22
|
// Only handle resize events for the bubble menu element itself
|
|
@@ -145,7 +30,7 @@ export class BubbleMenuView {
|
|
|
145
30
|
clearTimeout(resizeTimer);
|
|
146
31
|
}
|
|
147
32
|
// Immediately update the position with no delay for responsive positioning
|
|
148
|
-
this.resizeHandler(
|
|
33
|
+
this.resizeHandler();
|
|
149
34
|
// Set up a debounced timer to restore visibility after resize activity stops
|
|
150
35
|
resizeTimer = setTimeout(() => {
|
|
151
36
|
// Use requestAnimationFrame to ensure the position update is complete
|
|
@@ -165,36 +50,6 @@ export class BubbleMenuView {
|
|
|
165
50
|
// Also observe the editor view DOM element for editor size changes
|
|
166
51
|
this.resizeObserver.observe(this.view.dom);
|
|
167
52
|
};
|
|
168
|
-
this.focusHandler = () => {
|
|
169
|
-
// we use `setTimeout` to make sure `selection` is already updated
|
|
170
|
-
setTimeout(() => this.update(this.editor.view));
|
|
171
|
-
};
|
|
172
|
-
this.blurHandler = ({ event }) => {
|
|
173
|
-
if (this.preventHide) {
|
|
174
|
-
this.preventHide = false;
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
if (event?.relatedTarget && this.element.parentNode?.contains(event.relatedTarget)) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
if (event?.relatedTarget === this.editor.view.dom) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
this.hide();
|
|
184
|
-
};
|
|
185
|
-
this.handleDebouncedUpdate = (view, oldState) => {
|
|
186
|
-
const selectionChanged = !oldState?.selection.eq(view.state.selection);
|
|
187
|
-
const docChanged = !oldState?.doc.eq(view.state.doc);
|
|
188
|
-
if (!selectionChanged && !docChanged) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
if (this.updateDebounceTimer) {
|
|
192
|
-
clearTimeout(this.updateDebounceTimer);
|
|
193
|
-
}
|
|
194
|
-
this.updateDebounceTimer = window.setTimeout(() => {
|
|
195
|
-
this.updateHandler(view, selectionChanged, docChanged, oldState);
|
|
196
|
-
}, this.updateDelay);
|
|
197
|
-
};
|
|
198
53
|
this.updateHandler = (view, selectionChanged, docChanged, oldState) => {
|
|
199
54
|
const { composing } = view;
|
|
200
55
|
const isSame = !selectionChanged && !docChanged;
|
|
@@ -209,155 +64,15 @@ export class BubbleMenuView {
|
|
|
209
64
|
this.show();
|
|
210
65
|
this.updatePosition();
|
|
211
66
|
};
|
|
212
|
-
this.editor = editor;
|
|
213
|
-
this.element = element;
|
|
214
|
-
this.view = view;
|
|
215
|
-
this.updateDelay = updateDelay;
|
|
216
|
-
this.resizeDelay = resizeDelay;
|
|
217
|
-
this.container = container;
|
|
218
|
-
this.floatingUIOptions = {
|
|
219
|
-
...this.floatingUIOptions,
|
|
220
|
-
...options,
|
|
221
|
-
};
|
|
222
|
-
this.element.tabIndex = 0;
|
|
223
|
-
if (shouldShow) {
|
|
224
|
-
this.shouldShow = shouldShow;
|
|
225
|
-
}
|
|
226
|
-
const containerElement = this.getContainer();
|
|
227
|
-
if (containerElement === document.body) {
|
|
228
|
-
this.element.style.zIndex = '9999';
|
|
229
|
-
}
|
|
230
|
-
this.element.addEventListener('mousedown', this.mousedownHandler, { capture: true });
|
|
231
|
-
this.view.dom.addEventListener('dragstart', this.dragstartHandler);
|
|
232
|
-
this.editor.on('focus', this.focusHandler);
|
|
233
|
-
this.editor.on('blur', this.blurHandler);
|
|
234
|
-
window.addEventListener('resize', this.windowResizeHandler);
|
|
235
67
|
this.setupResizeObserver();
|
|
236
|
-
this.update(view, view.state);
|
|
237
|
-
if (this.getShouldShow()) {
|
|
238
|
-
this.show();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
updatePosition() {
|
|
242
|
-
const { selection } = this.editor.state;
|
|
243
|
-
const domRect = posToDOMRect(this.view, selection.from, selection.to);
|
|
244
|
-
let virtualElement = {
|
|
245
|
-
getBoundingClientRect: () => domRect,
|
|
246
|
-
getClientRects: () => [domRect],
|
|
247
|
-
};
|
|
248
|
-
// this is a special case for cell selections
|
|
249
|
-
if (selection instanceof CellSelection) {
|
|
250
|
-
const { $anchorCell, $headCell } = selection;
|
|
251
|
-
const from = $anchorCell ? $anchorCell.pos : $headCell.pos;
|
|
252
|
-
const to = $headCell ? $headCell.pos : $anchorCell.pos;
|
|
253
|
-
const fromDOM = this.view.nodeDOM(from);
|
|
254
|
-
const toDOM = this.view.nodeDOM(to);
|
|
255
|
-
if (!fromDOM || !toDOM) {
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
const clientRect = fromDOM === toDOM
|
|
259
|
-
? fromDOM.getBoundingClientRect()
|
|
260
|
-
: combineDOMRects(fromDOM.getBoundingClientRect(), toDOM.getBoundingClientRect());
|
|
261
|
-
virtualElement = {
|
|
262
|
-
getBoundingClientRect: () => clientRect,
|
|
263
|
-
getClientRects: () => [clientRect],
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
computePosition(virtualElement, this.element, {
|
|
267
|
-
placement: this.floatingUIOptions.placement,
|
|
268
|
-
strategy: this.floatingUIOptions.strategy,
|
|
269
|
-
middleware: this.middlewares,
|
|
270
|
-
}).then(({ x, y, strategy }) => {
|
|
271
|
-
this.element.style.width = 'max-content';
|
|
272
|
-
this.element.style.position = strategy;
|
|
273
|
-
this.element.style.left = `${x}px`;
|
|
274
|
-
this.element.style.top = `${y}px`;
|
|
275
|
-
if (this.isVisible && this.floatingUIOptions.onUpdate) {
|
|
276
|
-
this.floatingUIOptions.onUpdate();
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
update(view, oldState) {
|
|
281
|
-
const { state } = view;
|
|
282
|
-
const hasValidSelection = state.selection.from !== state.selection.to;
|
|
283
|
-
if (this.updateDelay > 0 && hasValidSelection) {
|
|
284
|
-
this.handleDebouncedUpdate(view, oldState);
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
const selectionChanged = !oldState?.selection.eq(view.state.selection);
|
|
288
|
-
const docChanged = !oldState?.doc.eq(view.state.doc);
|
|
289
|
-
this.updateHandler(view, selectionChanged, docChanged, oldState);
|
|
290
|
-
}
|
|
291
|
-
getShouldShow(oldState) {
|
|
292
|
-
const { state } = this.view;
|
|
293
|
-
const { selection } = state;
|
|
294
|
-
// support for CellSelections
|
|
295
|
-
const { ranges } = selection;
|
|
296
|
-
const from = Math.min(...ranges.map(range => range.$from.pos));
|
|
297
|
-
const to = Math.max(...ranges.map(range => range.$to.pos));
|
|
298
|
-
const shouldShow = this.shouldShow?.({
|
|
299
|
-
editor: this.editor,
|
|
300
|
-
element: this.element,
|
|
301
|
-
view: this.view,
|
|
302
|
-
state,
|
|
303
|
-
oldState,
|
|
304
|
-
from,
|
|
305
|
-
to,
|
|
306
|
-
});
|
|
307
|
-
return shouldShow;
|
|
308
|
-
}
|
|
309
|
-
getContainer() {
|
|
310
|
-
if (!this.container) {
|
|
311
|
-
return this.view.dom.parentElement;
|
|
312
|
-
}
|
|
313
|
-
if (typeof this.container === 'function') {
|
|
314
|
-
return this.container();
|
|
315
|
-
}
|
|
316
|
-
return this.container;
|
|
317
|
-
}
|
|
318
|
-
show() {
|
|
319
|
-
if (this.isVisible) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
this.element.style.visibility = 'visible';
|
|
323
|
-
this.element.style.opacity = '1';
|
|
324
|
-
const container = this.getContainer();
|
|
325
|
-
if (container) {
|
|
326
|
-
container.appendChild(this.element);
|
|
327
|
-
}
|
|
328
|
-
if (this.floatingUIOptions.onShow) {
|
|
329
|
-
this.floatingUIOptions.onShow();
|
|
330
|
-
}
|
|
331
|
-
this.isVisible = true;
|
|
332
|
-
}
|
|
333
|
-
hide() {
|
|
334
|
-
if (!this.isVisible) {
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
this.element.style.visibility = 'hidden';
|
|
338
|
-
this.element.style.opacity = '0';
|
|
339
|
-
// remove from the parent element
|
|
340
|
-
this.element.remove();
|
|
341
|
-
if (this.floatingUIOptions.onHide) {
|
|
342
|
-
this.floatingUIOptions.onHide();
|
|
343
|
-
}
|
|
344
|
-
this.isVisible = false;
|
|
345
68
|
}
|
|
346
69
|
destroy() {
|
|
347
|
-
|
|
348
|
-
this.element.removeEventListener('mousedown', this.mousedownHandler, { capture: true });
|
|
349
|
-
this.view.dom.removeEventListener('dragstart', this.dragstartHandler);
|
|
350
|
-
window.removeEventListener('resize', this.windowResizeHandler);
|
|
351
|
-
this.editor.off('focus', this.focusHandler);
|
|
352
|
-
this.editor.off('blur', this.blurHandler);
|
|
70
|
+
super.destroy();
|
|
353
71
|
// Cleanup ResizeObserver
|
|
354
72
|
if (this.resizeObserver) {
|
|
355
73
|
this.resizeObserver.disconnect();
|
|
356
74
|
this.resizeObserver = undefined;
|
|
357
75
|
}
|
|
358
|
-
if (this.floatingUIOptions.onDestroy) {
|
|
359
|
-
this.floatingUIOptions.onDestroy();
|
|
360
|
-
}
|
|
361
76
|
}
|
|
362
77
|
}
|
|
363
78
|
export const BubbleMenuPlugin = (options) => new Plugin({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
|
-
import type
|
|
2
|
+
import { type BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
3
3
|
export type BubbleMenuOptions = Omit<BubbleMenuPluginProps, 'editor' | 'element'> & {
|
|
4
4
|
/**
|
|
5
5
|
* The DOM element that contains your menu.
|
|
@@ -11,6 +11,7 @@ export const BubbleMenu = Extension.create({
|
|
|
11
11
|
element: null,
|
|
12
12
|
pluginKey: 'bubbleMenu',
|
|
13
13
|
updateDelay: undefined,
|
|
14
|
+
appendTo: undefined,
|
|
14
15
|
shouldShow: null,
|
|
15
16
|
};
|
|
16
17
|
},
|
|
@@ -24,6 +25,9 @@ export const BubbleMenu = Extension.create({
|
|
|
24
25
|
editor: this.editor,
|
|
25
26
|
element: this.options.element,
|
|
26
27
|
updateDelay: this.options.updateDelay,
|
|
28
|
+
options: this.options.options,
|
|
29
|
+
appendTo: this.options.appendTo,
|
|
30
|
+
getReferencedVirtualElement: this.options.getReferencedVirtualElement,
|
|
27
31
|
shouldShow: this.options.shouldShow,
|
|
28
32
|
}),
|
|
29
33
|
];
|
|
@@ -3,7 +3,7 @@ import { CUSTOM_LINK_EXTENSION_NAME, LINK_TEXT_COLOR } from '../constants';
|
|
|
3
3
|
import { TextSelection } from '@tiptap/pm/state';
|
|
4
4
|
import { dataAttrArrayToObject } from '@antscorp/antsomi-ui/es/utils';
|
|
5
5
|
import { isEmpty, isEqual, map, toString } from 'lodash';
|
|
6
|
-
import { getLinkMarkRanges, getLinkRange, isLinkColor } from '../utils';
|
|
6
|
+
import { getLinkMarkRanges, getLinkRange, isLinkColor, textBetween } from '../utils';
|
|
7
7
|
import { mergeAdjacentRanges } from '../utils/shared';
|
|
8
8
|
export const CustomLink = TiptapLinkExtension.extend({
|
|
9
9
|
name: CUSTOM_LINK_EXTENSION_NAME,
|
|
@@ -40,22 +40,41 @@ export const CustomLink = TiptapLinkExtension.extend({
|
|
|
40
40
|
setCustomLink: ({ attrs, content }) => ({ state, chain }) => {
|
|
41
41
|
const { selection } = state;
|
|
42
42
|
const { from, to } = selection;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
// Check if custom content is provided and different from current text
|
|
44
|
+
const currentText = textBetween(state, from, to);
|
|
45
|
+
const shouldUseCustomContent = content && currentText !== content;
|
|
46
|
+
if (shouldUseCustomContent) {
|
|
47
|
+
// Use custom content as string (replace content)
|
|
48
|
+
return chain()
|
|
49
|
+
.focus()
|
|
50
|
+
.deleteSelection()
|
|
51
|
+
.insertContent(content)
|
|
52
|
+
.command(({ tr }) => {
|
|
53
|
+
const endPos = tr.selection.from;
|
|
54
|
+
const startPos = endPos - content.length;
|
|
55
|
+
tr.setSelection(TextSelection.create(tr.doc, startPos, endPos));
|
|
56
|
+
return true;
|
|
57
|
+
})
|
|
58
|
+
.setLink({
|
|
59
|
+
...attrs,
|
|
60
|
+
href: attrs?.href || './',
|
|
61
|
+
})
|
|
62
|
+
.command(({ tr }) => {
|
|
63
|
+
const endPos = tr.selection.to;
|
|
64
|
+
tr.setSelection(TextSelection.create(tr.doc, endPos, endPos));
|
|
65
|
+
return true;
|
|
66
|
+
})
|
|
67
|
+
.run();
|
|
46
68
|
}
|
|
47
|
-
|
|
69
|
+
// Preserve existing content structure (atom nodes like smartTag)
|
|
70
|
+
// Just apply link mark on current selection without modifying content
|
|
71
|
+
return chain()
|
|
48
72
|
.focus()
|
|
49
|
-
.deleteSelection()
|
|
50
|
-
.insertContent(linkContent)
|
|
51
73
|
.command(({ tr }) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
tr.setSelection(TextSelection.create(tr.doc, startPos, endPos));
|
|
74
|
+
// Ensure selection is set correctly
|
|
75
|
+
tr.setSelection(TextSelection.create(tr.doc, from, to));
|
|
55
76
|
return true;
|
|
56
77
|
})
|
|
57
|
-
// .setUnderline()
|
|
58
|
-
// .setColor(LINK_TEXT_COLOR)
|
|
59
78
|
.setLink({
|
|
60
79
|
...attrs,
|
|
61
80
|
href: attrs?.href || './',
|
|
@@ -65,7 +84,7 @@ export const CustomLink = TiptapLinkExtension.extend({
|
|
|
65
84
|
tr.setSelection(TextSelection.create(tr.doc, endPos, endPos));
|
|
66
85
|
return true;
|
|
67
86
|
})
|
|
68
|
-
.run()
|
|
87
|
+
.run();
|
|
69
88
|
},
|
|
70
89
|
deleteCustomLink: predicate => ({ state, chain }) => {
|
|
71
90
|
const { doc } = state;
|
|
@@ -146,7 +165,7 @@ export const CustomLink = TiptapLinkExtension.extend({
|
|
|
146
165
|
to: state.doc.content.size,
|
|
147
166
|
}).filter(range => predicate(range.mark.attrs));
|
|
148
167
|
mergeAdjacentRanges(linkMarkRanges, (existingRanges, candidateRange) => existingRanges.some(range => mergeAdjacentEqualFn(range.mark.attrs, candidateRange.mark.attrs))).forEach(range => {
|
|
149
|
-
const currentText =
|
|
168
|
+
const currentText = textBetween(state, range.from, range.to);
|
|
150
169
|
const updatedText = updated(currentText);
|
|
151
170
|
if (currentText === updatedText)
|
|
152
171
|
return;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom ListItem extension that extends the default TipTap ListItem
|
|
3
|
+
* with custom Backspace behavior to prevent merging paragraphs into lists
|
|
4
|
+
*
|
|
5
|
+
* This extension only overrides keyboard shortcuts while maintaining
|
|
6
|
+
* all other default ListItem functionality (HTML parsing, rendering, etc.)
|
|
7
|
+
*
|
|
8
|
+
* @see https://www.tiptap.dev/api/nodes/list-item
|
|
9
|
+
*/
|
|
10
|
+
export declare const CustomListItem: import("@tiptap/core").Node<import("@tiptap/extension-list").ListItemOptions, any>;
|