@antscorp/antsomi-ui 2.0.109 → 2.0.111
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 -6
- 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/Eyedropper.d.ts +2 -0
- package/es/components/atoms/Eyedropper/Eyedropper.js +53 -0
- package/es/components/atoms/Eyedropper/index.d.ts +0 -0
- package/es/components/atoms/Eyedropper/index.js +1 -0
- package/es/components/atoms/Eyedropper/styled.d.ts +9 -0
- package/es/components/atoms/Eyedropper/styled.js +45 -0
- package/es/components/atoms/Eyedropper/types.d.ts +5 -0
- package/es/components/atoms/Eyedropper/types.js +1 -0
- package/es/components/atoms/Icon/index.js +19 -19
- package/es/components/atoms/Iframe/Iframe.js +18 -18
- package/es/components/atoms/Input/styled.js +104 -104
- 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/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/ALignRightIcon.d.ts +3 -0
- package/es/components/icons/ALignRightIcon.js +7 -0
- package/es/components/icons/AlignCenterIcon.d.ts +3 -0
- package/es/components/icons/AlignCenterIcon.js +7 -0
- package/es/components/icons/AlignJustifyIcon.d.ts +3 -0
- package/es/components/icons/AlignJustifyIcon.js +7 -0
- package/es/components/icons/AlignLeftIcon.d.ts +3 -0
- package/es/components/icons/AlignLeftIcon.js +7 -0
- package/es/components/icons/ArrowDropDownIcon.d.ts +3 -0
- package/es/components/icons/ArrowDropDownIcon.js +7 -0
- package/es/components/icons/ChevronRightIcon.d.ts +3 -0
- package/es/components/icons/ChevronRightIcon.js +7 -0
- package/es/components/icons/ColorizeIcon.d.ts +3 -0
- package/es/components/icons/ColorizeIcon.js +7 -0
- package/es/components/icons/DomainManagementIcon.js +1 -1
- package/es/components/icons/LazyIcon/LazyIcon.d.ts +9 -0
- package/es/components/icons/LazyIcon/LazyIcon.js +9 -0
- package/es/components/icons/LinkOffIcon.d.ts +3 -0
- package/es/components/icons/LinkOffIcon.js +7 -0
- package/es/components/icons/LoadingIcon.js +33 -33
- package/es/components/icons/MinusIcon.d.ts +3 -0
- package/es/components/icons/MinusIcon.js +7 -0
- package/es/components/icons/document/styled.js +43 -43
- package/es/components/icons/index.d.ts +9 -0
- package/es/components/icons/index.js +9 -0
- package/es/components/index.scss +2 -1
- package/es/components/molecules/AccessDenied/styled.js +28 -28
- package/es/components/molecules/AccountSelection/styled.js +110 -110
- 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/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/CommonCollection/index.js +2 -2
- package/es/components/molecules/EmojiCollections/styled.js +22 -22
- package/es/components/molecules/EmojiCollections/types.d.ts +1 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +2 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.js +10 -6
- package/es/components/molecules/EmojiPopover/styled.js +5 -5
- package/es/components/molecules/EmptyData/styled.js +53 -53
- package/es/components/molecules/EyedropperButton/EyedropperButton.d.ts +11 -0
- package/es/components/molecules/EyedropperButton/EyedropperButton.js +34 -0
- package/es/components/molecules/EyedropperButton/index.d.ts +0 -0
- package/es/components/molecules/EyedropperButton/index.js +1 -0
- package/es/components/molecules/EyedropperButton/styled.d.ts +7 -0
- package/es/components/molecules/EyedropperButton/styled.js +23 -0
- package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +3 -0
- package/es/components/molecules/FontSizeInput/FontSizeInput.js +134 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.d.ts +8 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +14 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.d.ts +21 -0
- package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.js +19 -0
- package/es/components/molecules/FontSizeInput/constants.d.ts +2 -0
- package/es/components/molecules/FontSizeInput/constants.js +5 -0
- package/es/components/molecules/FontSizeInput/index.d.ts +2 -0
- package/es/components/molecules/FontSizeInput/index.js +1 -0
- package/es/components/molecules/FontSizeInput/index.scss +15 -15
- package/es/components/molecules/FontSizeInput/styled.d.ts +7 -0
- package/es/components/molecules/FontSizeInput/styled.js +39 -0
- package/es/components/molecules/FontSizeInput/types.d.ts +23 -0
- package/es/components/molecules/FontSizeInput/types.js +1 -0
- package/es/components/molecules/FontSizeInput/utils.d.ts +7 -0
- package/es/components/molecules/FontSizeInput/utils.js +9 -0
- package/es/components/molecules/GradientSetting/styled.js +57 -57
- 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/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/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.d.ts +2 -1
- package/es/components/molecules/SearchPopover/SearchPopover.js +3 -3
- 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/styled.js +32 -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/components/GeneralAccess/styled.js +56 -56
- 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/styled.js +63 -63
- package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +31 -31
- 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 +50 -50
- package/es/components/molecules/TagifyInput/styled.js +37 -37
- package/es/components/molecules/TagifyInput/utils.js +13 -13
- package/es/components/molecules/TagifyInput/utils.style.js +218 -218
- 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 +6 -8
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +10 -10
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +49 -289
- 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 -82
- package/es/components/molecules/VirtualizedMenu/types.d.ts +2 -0
- package/es/components/molecules/VirtualizedMenu/utils.d.ts +2 -0
- package/es/components/molecules/VirtualizedMenu/utils.js +2 -0
- package/es/components/molecules/index.d.ts +1 -0
- package/es/components/molecules/index.js +1 -0
- package/es/components/molecules/index.scss +1 -0
- 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/styled.js +336 -336
- 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 -3059
- 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/ItemEvent/ItemEvent.js +7 -1
- package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/ItemGroupEvent.js +14 -2
- 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 +18 -18
- package/es/components/organism/ActivityTimeline/constants.js +7 -8
- 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 -39
- package/es/components/organism/ActivityTimeline/utils.d.ts +7 -1
- package/es/components/organism/ActivityTimeline/utils.js +224 -162
- 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/Help/styled.js +267 -267
- 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/styled.js +214 -214
- 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/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/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 +10 -0
- package/es/components/organism/TextEditor/TextEditor.js +388 -0
- package/es/components/organism/TextEditor/__mocks__/text-block.settings.json +320 -0
- package/es/components/organism/TextEditor/__mocks__/text-contennt.d.ts +1 -0
- package/es/components/organism/TextEditor/__mocks__/text-contennt.js +47 -0
- package/es/components/organism/TextEditor/constants.d.ts +196 -0
- package/es/components/organism/TextEditor/constants.js +398 -0
- package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +25 -0
- package/es/components/organism/TextEditor/extensions/BackgroundColor.js +43 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +18 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +81 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +15 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +35 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/index.d.ts +2 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/index.js +2 -0
- package/es/components/organism/TextEditor/extensions/ClearFormatting.d.ts +16 -0
- package/es/components/organism/TextEditor/extensions/ClearFormatting.js +30 -0
- package/es/components/organism/TextEditor/extensions/Color.d.ts +6 -0
- package/es/components/organism/TextEditor/extensions/Color.js +34 -0
- package/es/components/organism/TextEditor/extensions/Emoji.d.ts +57 -0
- package/es/components/organism/TextEditor/extensions/Emoji.js +184 -0
- package/es/components/organism/TextEditor/extensions/FontFamily.d.ts +6 -0
- package/es/components/organism/TextEditor/extensions/FontFamily.js +36 -0
- package/es/components/organism/TextEditor/extensions/FontSize.d.ts +31 -0
- package/es/components/organism/TextEditor/extensions/FontSize.js +46 -0
- package/es/components/organism/TextEditor/extensions/FontWeight.d.ts +23 -0
- package/es/components/organism/TextEditor/extensions/FontWeight.js +41 -0
- package/es/components/organism/TextEditor/extensions/Indent.d.ts +21 -0
- package/es/components/organism/TextEditor/extensions/Indent.js +63 -0
- package/es/components/organism/TextEditor/extensions/LetterSpacing.d.ts +32 -0
- package/es/components/organism/TextEditor/extensions/LetterSpacing.js +48 -0
- package/es/components/organism/TextEditor/extensions/LineHeight.d.ts +20 -0
- package/es/components/organism/TextEditor/extensions/LineHeight.js +101 -0
- package/es/components/organism/TextEditor/extensions/Link.d.ts +22 -0
- package/es/components/organism/TextEditor/extensions/Link.js +178 -0
- 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/ListItemMarker.d.ts +13 -0
- package/es/components/organism/TextEditor/extensions/ListItemMarker.js +174 -0
- package/es/components/organism/TextEditor/extensions/OrderedList.d.ts +56 -0
- package/es/components/organism/TextEditor/extensions/OrderedList.js +187 -0
- package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +28 -0
- package/es/components/organism/TextEditor/extensions/SmartTag.js +103 -0
- package/es/components/organism/TextEditor/extensions/StyleMemory.d.ts +36 -0
- package/es/components/organism/TextEditor/extensions/StyleMemory.js +163 -0
- package/es/components/organism/TextEditor/extensions/TextTransform.d.ts +30 -0
- package/es/components/organism/TextEditor/extensions/TextTransform.js +36 -0
- package/es/components/organism/TextEditor/extensions/UnorderedList.d.ts +55 -0
- package/es/components/organism/TextEditor/extensions/UnorderedList.js +176 -0
- package/es/components/organism/TextEditor/hooks/index.d.ts +6 -0
- package/es/components/organism/TextEditor/hooks/index.js +6 -0
- package/es/components/organism/TextEditor/hooks/useColorSet.d.ts +4 -0
- package/es/components/organism/TextEditor/hooks/useColorSet.js +29 -0
- package/es/components/organism/TextEditor/hooks/useDocumentState.d.ts +18 -0
- package/es/components/organism/TextEditor/hooks/useDocumentState.js +42 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +26 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.js +69 -0
- package/es/components/organism/TextEditor/hooks/usePersistence.d.ts +31 -0
- package/es/components/organism/TextEditor/hooks/usePersistence.js +169 -0
- package/es/components/organism/TextEditor/hooks/useStyleMemory.d.ts +6 -0
- package/es/components/organism/TextEditor/hooks/useStyleMemory.js +42 -0
- package/es/components/organism/TextEditor/hooks/useStylePresets.d.ts +34 -0
- package/es/components/organism/TextEditor/hooks/useStylePresets.js +83 -0
- package/es/components/organism/TextEditor/index.d.ts +18 -0
- package/es/components/organism/TextEditor/index.js +8 -0
- package/es/components/organism/TextEditor/index.scss +65 -0
- package/es/components/organism/TextEditor/provider.d.ts +15 -0
- package/es/components/organism/TextEditor/provider.js +36 -0
- package/es/components/organism/TextEditor/store.d.ts +20 -0
- package/es/components/organism/TextEditor/store.js +40 -0
- 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 +9 -0
- package/es/components/organism/TextEditor/styled.js +61 -0
- package/es/components/organism/TextEditor/types.d.ts +311 -0
- package/es/components/organism/TextEditor/types.js +6 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +3 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +114 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Button/Button.d.ts +9 -0
- package/es/components/organism/TextEditor/ui/Button/Button.js +35 -0
- package/es/components/organism/TextEditor/ui/Button/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Button/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Button/types.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Button/types.js +1 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.d.ts +39 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.js +131 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/ColorPicker/index.js +1 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.d.ts +17 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.js +51 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/DropdownButton/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.d.ts +11 -0
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +66 -0
- package/es/components/organism/TextEditor/ui/Emoji/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Emoji/index.js +2 -0
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +71 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontItem.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontItem.js +27 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.d.ts +16 -0
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +102 -0
- package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/FontPopover/styled.js +36 -0
- package/es/components/organism/TextEditor/ui/FontPopover/types.d.ts +35 -0
- package/es/components/organism/TextEditor/ui/FontPopover/types.js +1 -0
- 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.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Popover/Popover.js +9 -0
- package/es/components/organism/TextEditor/ui/Popover/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Popover/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Select/Select.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Select/Select.js +7 -0
- package/es/components/organism/TextEditor/ui/Select/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Select/index.js +1 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.js +44 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.js +1 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.js +58 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.d.ts +19 -0
- package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.js +1 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.d.ts +30 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +75 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/index.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/TextAlignSelect/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.d.ts +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.js +85 -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/BoldAction.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +19 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +93 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +20 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +4 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +32 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +41 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +8 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +51 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.js +21 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.js +17 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.js +28 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LineSpacingAction.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LineSpacingAction.js +45 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.d.ts +6 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.js +17 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.js +67 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.js +17 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.d.ts +7 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.js +26 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.js +26 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.js +3 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.js +29 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.d.ts +14 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.js +22 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.js +36 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.d.ts +5 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.d.ts +7 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +18 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +24 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +24 -0
- package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/Toolbar/index.js +2 -0
- package/es/components/organism/TextEditor/utils/documentState.d.ts +73 -0
- package/es/components/organism/TextEditor/utils/documentState.js +149 -0
- package/es/components/organism/TextEditor/utils/font.d.ts +74 -0
- package/es/components/organism/TextEditor/utils/font.js +147 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +87 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.js +460 -0
- package/es/components/organism/TextEditor/utils/indent.d.ts +11 -0
- package/es/components/organism/TextEditor/utils/indent.js +56 -0
- package/es/components/organism/TextEditor/utils/index.d.ts +8 -0
- package/es/components/organism/TextEditor/utils/index.js +16 -0
- package/es/components/organism/TextEditor/utils/link.d.ts +116 -0
- package/es/components/organism/TextEditor/utils/link.js +304 -0
- package/es/components/organism/TextEditor/utils/menu.d.ts +134 -0
- package/es/components/organism/TextEditor/utils/menu.js +321 -0
- package/es/components/organism/TextEditor/utils/selection.d.ts +25 -0
- package/es/components/organism/TextEditor/utils/selection.js +58 -0
- package/es/components/organism/TextEditor/utils/shared.d.ts +13 -0
- package/es/components/organism/TextEditor/utils/shared.js +52 -0
- package/es/components/organism/TextEditor/utils/smartTag.d.ts +49 -0
- package/es/components/organism/TextEditor/utils/smartTag.js +90 -0
- package/es/components/organism/TextEditor/utils/style.d.ts +78 -0
- package/es/components/organism/TextEditor/utils/style.js +193 -0
- package/es/components/organism/TicketEditor/styled.js +850 -850
- package/es/components/organism/TicketEditorV2/styled.js +839 -839
- package/es/components/organism/index.d.ts +1 -0
- package/es/components/organism/index.js +1 -0
- package/es/components/organism/index.scss +2 -1
- 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/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/constants/index.d.ts +1 -0
- package/es/constants/index.js +1 -0
- package/es/constants/web.d.ts +8 -0
- package/es/constants/web.js +57 -0
- package/es/hooks/index.d.ts +4 -0
- package/es/hooks/index.js +4 -0
- package/es/hooks/useBroadcastedLocalStorage.d.ts +5 -0
- package/es/hooks/useBroadcastedLocalStorage.js +71 -0
- package/es/hooks/useElementSize.d.ts +7 -0
- package/es/hooks/useElementSize.js +56 -0
- package/es/hooks/useEyedropper/attach.d.ts +4 -0
- package/es/hooks/useEyedropper/attach.js +9 -0
- package/es/hooks/useEyedropper/eyedropper.d.ts +69 -0
- package/es/hooks/useEyedropper/eyedropper.js +205 -0
- package/es/hooks/useEyedropper/index.d.ts +2 -0
- package/es/hooks/useEyedropper/index.js +7 -0
- package/es/hooks/useEyedropper/support.d.ts +1 -0
- package/es/hooks/useEyedropper/support.js +3 -0
- package/es/hooks/useEyedropper/types.d.ts +9 -0
- package/es/hooks/useEyedropper/types.js +1 -0
- package/es/hooks/useEyedropper/useEyedropper.d.ts +8 -0
- package/es/hooks/useEyedropper/useEyedropper.js +50 -0
- package/es/hooks/useEyedropper/utils.d.ts +11 -0
- package/es/hooks/useEyedropper/utils.js +17 -0
- package/es/hooks/useIsMounted.d.ts +1 -0
- package/es/hooks/useIsMounted.js +11 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locales/en/google-sheet.json +109 -8
- package/es/locales/i18n.d.ts +307 -4
- package/es/locales/ja/google-sheet.json +301 -200
- package/es/locales/vi/google-sheet.json +118 -17
- package/es/providers/ConfigProvider/GlobalStyle.js +1249 -1249
- package/es/styled/common.js +51 -51
- package/es/tests/styled.js +4 -4
- package/es/types/index.d.ts +9 -0
- package/es/utils/common.d.ts +15 -9
- package/es/utils/common.js +62 -24
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/es/utils/variables.js +7 -7
- package/es/utils/web.d.ts +80 -0
- package/es/utils/web.js +226 -0
- package/package.json +276 -266
- package/CHANGELOG.md +0 -63
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Color as TiptapColorExtension, } from '@tiptap/extension-text-style';
|
|
2
|
+
import tinycolor from 'tinycolor2';
|
|
3
|
+
export const Color = TiptapColorExtension.extend({
|
|
4
|
+
addGlobalAttributes() {
|
|
5
|
+
return [
|
|
6
|
+
{
|
|
7
|
+
types: this.options.types,
|
|
8
|
+
attributes: {
|
|
9
|
+
color: {
|
|
10
|
+
default: null,
|
|
11
|
+
parseHTML: element => element.style.color?.replace(/['"]+/g, ''),
|
|
12
|
+
renderHTML: attrs => {
|
|
13
|
+
if (!attrs.color || tinycolor.equals(attrs.color, this.options.defaultColor)) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
style: `color: ${attrs.color}`,
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
},
|
|
25
|
+
addCommands() {
|
|
26
|
+
return {
|
|
27
|
+
...this.parent?.(),
|
|
28
|
+
unsetColor: () => ({ chain }) => chain()
|
|
29
|
+
.setMark('textStyle', { color: this.options.defaultColor || null })
|
|
30
|
+
.removeEmptyTextStyle()
|
|
31
|
+
.run(),
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
import { DOMOutputSpec, Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
+
import { SuggestionOptions } from '@tiptap/suggestion';
|
|
4
|
+
export declare const LIST_EMOJI: ({
|
|
5
|
+
emoji: string;
|
|
6
|
+
skin_tone_support: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
unicode_version: string;
|
|
10
|
+
emoji_version: string;
|
|
11
|
+
skin_tone_support_unicode_version?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
emoji: string;
|
|
14
|
+
skin_tone_support: boolean;
|
|
15
|
+
skin_tone_support_unicode_version: string;
|
|
16
|
+
name: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
unicode_version: string;
|
|
19
|
+
emoji_version: string;
|
|
20
|
+
})[];
|
|
21
|
+
declare module '@tiptap/core' {
|
|
22
|
+
interface Commands<ReturnType> {
|
|
23
|
+
emoji: {
|
|
24
|
+
insertEmoji: (emojiName: string) => ReturnType;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export interface SuggestionItem {
|
|
29
|
+
emoji: string;
|
|
30
|
+
skin_tone_support: boolean;
|
|
31
|
+
name: string;
|
|
32
|
+
slug: string;
|
|
33
|
+
unicode_version: string;
|
|
34
|
+
emoji_version: string;
|
|
35
|
+
}
|
|
36
|
+
export interface EmojiNodeAttrs {
|
|
37
|
+
name?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export type EmojiOptions<Attrs extends Record<string, any> = EmojiNodeAttrs> = {
|
|
40
|
+
HTMLAttributes: Record<string, any>;
|
|
41
|
+
renderLabel?: (props: {
|
|
42
|
+
options: EmojiOptions<Attrs>;
|
|
43
|
+
node: ProseMirrorNode;
|
|
44
|
+
}) => string;
|
|
45
|
+
renderText: (props: {
|
|
46
|
+
options: EmojiOptions<Attrs>;
|
|
47
|
+
node: ProseMirrorNode;
|
|
48
|
+
}) => string;
|
|
49
|
+
renderHTML: (props: {
|
|
50
|
+
options: EmojiOptions<Attrs>;
|
|
51
|
+
node: ProseMirrorNode;
|
|
52
|
+
}) => DOMOutputSpec;
|
|
53
|
+
deleteTriggerWithBackspace: boolean;
|
|
54
|
+
suggestion: Omit<SuggestionOptions<SuggestionItem, Attrs>, 'editor'>;
|
|
55
|
+
};
|
|
56
|
+
export declare const EXTENSION_NAME = "emoji";
|
|
57
|
+
export declare const Emoji: Node<EmojiOptions<EmojiNodeAttrs>, any>;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { Node, mergeAttributes } from '@tiptap/core';
|
|
2
|
+
import { PluginKey } from '@tiptap/pm/state';
|
|
3
|
+
import Suggestion from '@tiptap/suggestion';
|
|
4
|
+
import { ICON_EMOJI_COMMON } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
5
|
+
import { memoize } from 'lodash';
|
|
6
|
+
export const LIST_EMOJI = ICON_EMOJI_COMMON.flatMap(group => group.emojis);
|
|
7
|
+
const findEmojiByName = memoize((name) => LIST_EMOJI.find(i => i.name === name)?.emoji);
|
|
8
|
+
export const EXTENSION_NAME = 'emoji';
|
|
9
|
+
export const Emoji = Node.create({
|
|
10
|
+
name: EXTENSION_NAME,
|
|
11
|
+
priority: 102,
|
|
12
|
+
group: 'inline',
|
|
13
|
+
inline: true,
|
|
14
|
+
atom: true,
|
|
15
|
+
selectable: true,
|
|
16
|
+
addOptions() {
|
|
17
|
+
return {
|
|
18
|
+
HTMLAttributes: {},
|
|
19
|
+
deleteTriggerWithBackspace: false,
|
|
20
|
+
renderText({ node }) {
|
|
21
|
+
return findEmojiByName(node.attrs.name) || node.attrs.name;
|
|
22
|
+
},
|
|
23
|
+
renderHTML({ options, node }) {
|
|
24
|
+
const emoji = findEmojiByName(node.attrs.name);
|
|
25
|
+
return [
|
|
26
|
+
'span',
|
|
27
|
+
mergeAttributes(this.HTMLAttributes, options.HTMLAttributes),
|
|
28
|
+
emoji || node.attrs.name,
|
|
29
|
+
];
|
|
30
|
+
},
|
|
31
|
+
suggestion: {
|
|
32
|
+
char: ':',
|
|
33
|
+
pluginKey: new PluginKey('emoji'),
|
|
34
|
+
command: ({ editor, range, props }) => {
|
|
35
|
+
const { name } = props;
|
|
36
|
+
// increase range.to by one when the next node is of type "text"
|
|
37
|
+
// and starts with a space character
|
|
38
|
+
const { nodeAfter } = editor.view.state.selection.$to;
|
|
39
|
+
const overrideSpace = nodeAfter?.text?.startsWith(' ');
|
|
40
|
+
if (overrideSpace) {
|
|
41
|
+
range.to++;
|
|
42
|
+
}
|
|
43
|
+
const nodeBeforeMarks = editor.state.doc
|
|
44
|
+
.resolve(range.from)
|
|
45
|
+
.marks()
|
|
46
|
+
.map(i => ({
|
|
47
|
+
type: i.type.name,
|
|
48
|
+
attrs: i.attrs,
|
|
49
|
+
}));
|
|
50
|
+
editor
|
|
51
|
+
.chain()
|
|
52
|
+
.focus()
|
|
53
|
+
.insertContentAt(range, [
|
|
54
|
+
{
|
|
55
|
+
type: this.name,
|
|
56
|
+
attrs: { name },
|
|
57
|
+
marks: nodeBeforeMarks,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: 'text',
|
|
61
|
+
text: ' ',
|
|
62
|
+
marks: nodeBeforeMarks,
|
|
63
|
+
},
|
|
64
|
+
])
|
|
65
|
+
.run();
|
|
66
|
+
// get reference to `window` object from editor element, to support cross-frame JS usage
|
|
67
|
+
editor.view.dom.ownerDocument.defaultView?.getSelection()?.collapseToEnd();
|
|
68
|
+
},
|
|
69
|
+
allow: ({ state, range }) => {
|
|
70
|
+
const $from = state.doc.resolve(range.from);
|
|
71
|
+
const type = state.schema.nodes[this.name];
|
|
72
|
+
const allow = !!$from.parent.type.contentMatch.matchType(type);
|
|
73
|
+
return allow;
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
addAttributes() {
|
|
79
|
+
return {
|
|
80
|
+
name: {
|
|
81
|
+
default: null,
|
|
82
|
+
parseHTML: element => element.getAttribute('data-name'),
|
|
83
|
+
renderHTML: attributes => {
|
|
84
|
+
if (!attributes.name) {
|
|
85
|
+
return {};
|
|
86
|
+
}
|
|
87
|
+
return { 'data-name': attributes.name };
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
parseHTML() {
|
|
93
|
+
return [
|
|
94
|
+
{
|
|
95
|
+
tag: `span[data-type="${this.name}"]`,
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
},
|
|
99
|
+
renderHTML({ node, HTMLAttributes }) {
|
|
100
|
+
const mergedOptions = { ...this.options };
|
|
101
|
+
mergedOptions.HTMLAttributes = mergeAttributes({
|
|
102
|
+
'data-type': this.name,
|
|
103
|
+
}, this.options.HTMLAttributes, HTMLAttributes);
|
|
104
|
+
const html = this.options.renderHTML({
|
|
105
|
+
options: mergedOptions,
|
|
106
|
+
node,
|
|
107
|
+
});
|
|
108
|
+
if (typeof html === 'string') {
|
|
109
|
+
return [
|
|
110
|
+
'span',
|
|
111
|
+
mergeAttributes({
|
|
112
|
+
'data-type': this.name,
|
|
113
|
+
}, this.options.HTMLAttributes, HTMLAttributes),
|
|
114
|
+
html,
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
return html;
|
|
118
|
+
},
|
|
119
|
+
renderText({ node }) {
|
|
120
|
+
return this.options.renderText({
|
|
121
|
+
options: this.options,
|
|
122
|
+
node,
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
addKeyboardShortcuts() {
|
|
126
|
+
return {
|
|
127
|
+
Backspace: () => this.editor.commands.command(({ tr, state }) => {
|
|
128
|
+
let isEmoji = false;
|
|
129
|
+
const { selection } = state;
|
|
130
|
+
const { empty, anchor } = selection;
|
|
131
|
+
if (!empty) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
state.doc.nodesBetween(anchor - 1, anchor, (node, pos) => {
|
|
135
|
+
if (node.type.name === this.name) {
|
|
136
|
+
isEmoji = true;
|
|
137
|
+
tr.insertText(this.options.deleteTriggerWithBackspace ? '' : this.options.suggestion.char || '', pos, pos + node.nodeSize);
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
return isEmoji;
|
|
142
|
+
}),
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
addCommands() {
|
|
146
|
+
return {
|
|
147
|
+
insertEmoji: emojiName => ({ editor, state }) => {
|
|
148
|
+
const { selection } = state;
|
|
149
|
+
const nodeBeforeMarks = selection.$from.marks().map(i => ({
|
|
150
|
+
type: i.type.name,
|
|
151
|
+
attrs: i.attrs,
|
|
152
|
+
}));
|
|
153
|
+
// Chèn emoji node
|
|
154
|
+
editor
|
|
155
|
+
.chain()
|
|
156
|
+
.focus()
|
|
157
|
+
.insertContent([
|
|
158
|
+
{
|
|
159
|
+
type: this.name,
|
|
160
|
+
attrs: { name: emojiName },
|
|
161
|
+
marks: nodeBeforeMarks,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
type: 'text',
|
|
165
|
+
text: ' ',
|
|
166
|
+
marks: nodeBeforeMarks,
|
|
167
|
+
},
|
|
168
|
+
])
|
|
169
|
+
.run();
|
|
170
|
+
// Đưa con trỏ về cuối emoji
|
|
171
|
+
editor.view.dom.ownerDocument.defaultView?.getSelection()?.collapseToEnd();
|
|
172
|
+
return true;
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
},
|
|
176
|
+
addProseMirrorPlugins() {
|
|
177
|
+
return [
|
|
178
|
+
Suggestion({
|
|
179
|
+
editor: this.editor,
|
|
180
|
+
...this.options.suggestion,
|
|
181
|
+
}),
|
|
182
|
+
];
|
|
183
|
+
},
|
|
184
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FontFamilyOptions as TiptapFontFamilyOptions } from '@tiptap/extension-text-style';
|
|
2
|
+
interface FontFamilyOptions extends TiptapFontFamilyOptions {
|
|
3
|
+
defaultFontFamily: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const FontFamily: import("@tiptap/core").Extension<FontFamilyOptions, any>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FontFamily as TiptapFontFamilyExtension, } from '@tiptap/extension-text-style';
|
|
2
|
+
export const FontFamily = TiptapFontFamilyExtension.extend({
|
|
3
|
+
addCommands() {
|
|
4
|
+
return {
|
|
5
|
+
...this.parent?.(),
|
|
6
|
+
unsetFontFamily: () => ({ chain }) => chain()
|
|
7
|
+
.setMark('textStyle', {
|
|
8
|
+
fontFamily: this.options.defaultFontFamily || null,
|
|
9
|
+
})
|
|
10
|
+
.removeEmptyTextStyle()
|
|
11
|
+
.run(),
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
addGlobalAttributes() {
|
|
15
|
+
return [
|
|
16
|
+
...(this.parent?.() || []),
|
|
17
|
+
{
|
|
18
|
+
types: this.options.types,
|
|
19
|
+
attributes: {
|
|
20
|
+
fontFamily: {
|
|
21
|
+
default: this.options.defaultFontFamily,
|
|
22
|
+
renderHTML: attrs => {
|
|
23
|
+
if (!attrs.fontFamily || attrs.fontFamily === this.options.defaultFontFamily) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
style: `font-family: ${attrs.fontFamily}`,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
parseHTML: element => element.style.fontFamily || this.options.defaultFontFamily,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
export type FontSizeOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* A list of node names where the font size can be applied.
|
|
5
|
+
* @default ['textStyle']
|
|
6
|
+
* @example ['heading', 'paragraph']
|
|
7
|
+
*/
|
|
8
|
+
types: string[];
|
|
9
|
+
defaultFontSize: string;
|
|
10
|
+
};
|
|
11
|
+
declare module '@tiptap/core' {
|
|
12
|
+
interface Commands<ReturnType> {
|
|
13
|
+
fontSize: {
|
|
14
|
+
/**
|
|
15
|
+
* Set the font size
|
|
16
|
+
* @param fontSize The font size
|
|
17
|
+
* @example editor.commands.setFontSize('16px')
|
|
18
|
+
*/
|
|
19
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
20
|
+
/**
|
|
21
|
+
* Unset the font size
|
|
22
|
+
* @example editor.commands.unsetFontSize()
|
|
23
|
+
*/
|
|
24
|
+
unsetFontSize: () => ReturnType;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* This extension allows you to set a font size for text.
|
|
30
|
+
*/
|
|
31
|
+
export declare const FontSize: Extension<FontSizeOptions, any>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { DEFAULT_TEXT_STYLE } from '../constants';
|
|
3
|
+
/**
|
|
4
|
+
* This extension allows you to set a font size for text.
|
|
5
|
+
*/
|
|
6
|
+
export const FontSize = Extension.create({
|
|
7
|
+
name: 'fontSize',
|
|
8
|
+
addOptions() {
|
|
9
|
+
return {
|
|
10
|
+
types: ['textStyle'],
|
|
11
|
+
defaultFontSize: DEFAULT_TEXT_STYLE.fontSize,
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
addGlobalAttributes() {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
types: this.options.types,
|
|
18
|
+
attributes: {
|
|
19
|
+
fontSize: {
|
|
20
|
+
default: this.options.defaultFontSize,
|
|
21
|
+
parseHTML: element => element.style.fontSize || this.options.defaultFontSize,
|
|
22
|
+
renderHTML: attrs => {
|
|
23
|
+
if (!attrs.fontSize || attrs.fontSize === this.options.defaultFontSize) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
style: `font-size: ${attrs.fontSize}`,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
},
|
|
35
|
+
addCommands() {
|
|
36
|
+
return {
|
|
37
|
+
setFontSize: fontSize => ({ chain }) => chain().setMark('textStyle', { fontSize }).run(),
|
|
38
|
+
unsetFontSize: () => ({ chain }) => chain()
|
|
39
|
+
.setMark('textStyle', {
|
|
40
|
+
fontSize: this.options.defaultFontSize || null,
|
|
41
|
+
})
|
|
42
|
+
.removeEmptyTextStyle()
|
|
43
|
+
.run(),
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
export interface FontWeightOptions {
|
|
3
|
+
types: string[];
|
|
4
|
+
defaultWeight: string | number;
|
|
5
|
+
}
|
|
6
|
+
declare module '@tiptap/core' {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
fontWeight: {
|
|
9
|
+
/**
|
|
10
|
+
* Set the font weight
|
|
11
|
+
* @param fontWeight The font weight
|
|
12
|
+
* @example editor.commands.setFontWeight('bold')
|
|
13
|
+
*/
|
|
14
|
+
setFontWeight: (fontWeight: string | number) => ReturnType;
|
|
15
|
+
/**
|
|
16
|
+
* Unset the font weight
|
|
17
|
+
* @example editor.commands.unsetFontWeight()
|
|
18
|
+
*/
|
|
19
|
+
unsetFontWeight: () => ReturnType;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare const FontWeight: Extension<any, any>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { DEFAULT_TEXT_STYLE } from '../constants';
|
|
3
|
+
export const FontWeight = Extension.create({
|
|
4
|
+
name: 'fontWeight',
|
|
5
|
+
addOptions() {
|
|
6
|
+
return {
|
|
7
|
+
types: ['textStyle'],
|
|
8
|
+
defaultWeight: DEFAULT_TEXT_STYLE.fontWeight,
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
addGlobalAttributes() {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
types: this.options.types,
|
|
15
|
+
attributes: {
|
|
16
|
+
fontWeight: {
|
|
17
|
+
default: this.options.defaultWeight,
|
|
18
|
+
renderHTML: attributes => {
|
|
19
|
+
if (!attributes.fontWeight) {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
style: `font-weight: ${attributes.fontWeight}`,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
parseHTML: element => element.style.fontWeight,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
},
|
|
32
|
+
addCommands() {
|
|
33
|
+
return {
|
|
34
|
+
setFontWeight: fontWeight => ({ chain }) => chain().setMark('textStyle', { fontWeight }).run(),
|
|
35
|
+
unsetFontWeight: () => ({ chain }) => chain()
|
|
36
|
+
.setMark('textStyle', { fontWeight: this.options.defaultWeight })
|
|
37
|
+
.removeEmptyTextStyle()
|
|
38
|
+
.run(),
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
export interface IndentOptions {
|
|
3
|
+
types: string[];
|
|
4
|
+
minIndent: number;
|
|
5
|
+
maxIndent: number;
|
|
6
|
+
}
|
|
7
|
+
declare module '@tiptap/core' {
|
|
8
|
+
interface Commands<ReturnType> {
|
|
9
|
+
indent: {
|
|
10
|
+
/**
|
|
11
|
+
* Set the indent attribute
|
|
12
|
+
*/
|
|
13
|
+
indent: () => ReturnType;
|
|
14
|
+
/**
|
|
15
|
+
* Set the outdent attribute
|
|
16
|
+
*/
|
|
17
|
+
outdent: () => ReturnType;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export declare const Indent: Extension<IndentOptions, any>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { createIndentCommand } from '../utils/indent';
|
|
3
|
+
export const Indent = Extension.create({
|
|
4
|
+
name: 'indent',
|
|
5
|
+
addOptions() {
|
|
6
|
+
return {
|
|
7
|
+
types: ['paragraph', 'heading', 'blockquote'],
|
|
8
|
+
minIndent: 0 /* IndentProps.min */,
|
|
9
|
+
maxIndent: 7 /* IndentProps.max */,
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
addGlobalAttributes() {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
types: this.options.types,
|
|
16
|
+
attributes: {
|
|
17
|
+
indent: {
|
|
18
|
+
default: 0,
|
|
19
|
+
parseHTML: element => {
|
|
20
|
+
const identAttr = element.getAttribute('data-indent');
|
|
21
|
+
return (identAttr ? parseInt(identAttr, 10) : 0) || 0;
|
|
22
|
+
},
|
|
23
|
+
renderHTML: attributes => {
|
|
24
|
+
if (!attributes.indent) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
'data-indent': attributes.indent,
|
|
29
|
+
style: `padding-left: ${attributes.indent * 1}em`,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
},
|
|
37
|
+
addCommands() {
|
|
38
|
+
return {
|
|
39
|
+
indent: () => createIndentCommand({
|
|
40
|
+
delta: 1 /* IndentProps.more */,
|
|
41
|
+
types: this.options.types,
|
|
42
|
+
}),
|
|
43
|
+
outdent: () => createIndentCommand({
|
|
44
|
+
delta: -1 /* IndentProps.less */,
|
|
45
|
+
types: this.options.types,
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
addKeyboardShortcuts() {
|
|
50
|
+
return {
|
|
51
|
+
Tab: () => {
|
|
52
|
+
if (!(this.editor.isActive('bulletList') || this.editor.isActive('orderedList')))
|
|
53
|
+
return this.editor.commands.indent();
|
|
54
|
+
return this.editor.commands.sinkListItem('listItem');
|
|
55
|
+
},
|
|
56
|
+
'Shift-Tab': () => {
|
|
57
|
+
if (!(this.editor.isActive('bulletList') || this.editor.isActive('orderedList')))
|
|
58
|
+
return this.editor.commands.outdent();
|
|
59
|
+
return this.editor.commands.sinkListItem('listItem');
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import '@tiptap/extension-text-style';
|
|
2
|
+
import { Extension } from '@tiptap/core';
|
|
3
|
+
export type LetterSpacingOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* A list of node names where the letter spacing can be applied.
|
|
6
|
+
* @default ['textStyle']
|
|
7
|
+
* @example ['heading', 'paragraph']
|
|
8
|
+
*/
|
|
9
|
+
types: string[];
|
|
10
|
+
defaultLetterSpacing?: string;
|
|
11
|
+
};
|
|
12
|
+
declare module '@tiptap/core' {
|
|
13
|
+
interface Commands<ReturnType> {
|
|
14
|
+
letterSpacing: {
|
|
15
|
+
/**
|
|
16
|
+
* Set the letter spacing
|
|
17
|
+
* @param letterSpacing The letter spacing
|
|
18
|
+
* @example editor.commands.setLetterSpacing('1px')
|
|
19
|
+
*/
|
|
20
|
+
setLetterSpacing: (letterSpacing: string) => ReturnType;
|
|
21
|
+
/**
|
|
22
|
+
* Unset the letter spacing
|
|
23
|
+
* @example editor.commands.unsetLetterSpacing()
|
|
24
|
+
*/
|
|
25
|
+
unsetLetterSpacing: () => ReturnType;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* This extension allows you to set a letter spacing for text.
|
|
31
|
+
*/
|
|
32
|
+
export declare const LetterSpacing: Extension<LetterSpacingOptions, any>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import '@tiptap/extension-text-style';
|
|
2
|
+
import { Extension } from '@tiptap/core';
|
|
3
|
+
import { DEFAULT_TEXT_STYLE } from '../constants';
|
|
4
|
+
/**
|
|
5
|
+
* This extension allows you to set a letter spacing for text.
|
|
6
|
+
*/
|
|
7
|
+
export const LetterSpacing = Extension.create({
|
|
8
|
+
name: 'letterSpacing',
|
|
9
|
+
addOptions() {
|
|
10
|
+
return {
|
|
11
|
+
defaultWeight: DEFAULT_TEXT_STYLE.letterSpacing,
|
|
12
|
+
types: ['textStyle'],
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
addGlobalAttributes() {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
types: this.options.types,
|
|
19
|
+
attributes: {
|
|
20
|
+
letterSpacing: {
|
|
21
|
+
default: this.options.defaultLetterSpacing,
|
|
22
|
+
parseHTML: el => el.style.letterSpacing || this.options.defaultLetterSpacing,
|
|
23
|
+
renderHTML: attrs => {
|
|
24
|
+
const { letterSpacing } = attrs;
|
|
25
|
+
if (!letterSpacing || letterSpacing === this.options.defaultLetterSpacing) {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
style: `letter-spacing: ${attrs.letterSpacing}`,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
},
|
|
37
|
+
addCommands() {
|
|
38
|
+
return {
|
|
39
|
+
setLetterSpacing: letterSpacing => ({ chain }) => chain().setMark('textStyle', { letterSpacing }).run(),
|
|
40
|
+
unsetLetterSpacing: () => ({ chain }) => chain()
|
|
41
|
+
.setMark('textStyle', {
|
|
42
|
+
letterSpacing: null,
|
|
43
|
+
})
|
|
44
|
+
.removeEmptyTextStyle()
|
|
45
|
+
.run(),
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
export interface LineHeightOptions {
|
|
3
|
+
types: string[];
|
|
4
|
+
defaultHeight: string;
|
|
5
|
+
}
|
|
6
|
+
declare module '@tiptap/core' {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
lineHeight: {
|
|
9
|
+
/**
|
|
10
|
+
* Set the line height attribute
|
|
11
|
+
*/
|
|
12
|
+
setLineHeight: (height: string) => ReturnType;
|
|
13
|
+
/**
|
|
14
|
+
* Unset the text align attribute
|
|
15
|
+
*/
|
|
16
|
+
unsetLineHeight: () => ReturnType;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare const LineHeight: Extension<LineHeightOptions, any>;
|